<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>MXCORP Garment Costing</title>
    <link rel="preconnect" href="https://fonts.googleapis.com" />
    <link rel="preconnect" href="https://fonts.gstatic.com" />
    <link href="https://fonts.googleapis.com/css2?family=Inter:wght@300;400&display=swap" rel="stylesheet" />
    
    
  <script>
(function () {
  var RELOAD_KEY = 'mxcorp.assetReload';
  function assetPath(src) {
    return String(src || '').split('?')[0].split('#')[0];
  }
  function assetCacheKey(path) {
    var match = path.match(/-([A-Za-z0-9_-]+)\.(js|css|mjs)$/);
    return match ? match[1] : String(Date.now());
  }
  function assetUrl(path, bust) {
    var key = bust === true ? String(Date.now()) : assetCacheKey(path);
    return path + '?v=' + encodeURIComponent(key);
  }
  function showLoadError() {
    var root = document.getElementById('root');
    if (!root || root.childElementCount > 0) return;
    root.innerHTML =
      '<div style="padding:24px;font-family:Inter,system-ui,sans-serif;font-size:13px;line-height:1.5;max-width:420px">' +
      '<p style="margin:0 0 8px">The app failed to load after an update.</p>' +
      '<p style="margin:0 0 12px;color:#666">Use a hard refresh (Cmd+Shift+R on Mac, Ctrl+Shift+R on Windows) or click below.</p>' +
      '<button type="button" style="padding:8px 14px;cursor:pointer;margin-right:8px" onclick="location.reload()">Reload page</button>' +
      '<button type="button" style="padding:8px 14px;cursor:pointer" onclick="sessionStorage.removeItem(\'mxcorp.assetReload\');location.href=location.pathname+\'?v=\'+Date.now()">Hard refresh</button>' +
      '</div>';
  }
  function loadStylesheet(src, bustCache) {
    var path = assetPath(src);
    if (!path) return Promise.resolve();
    var url = assetUrl(path, bustCache);
    document.querySelectorAll('style[data-mxcorp-css]').forEach(function (node) {
      node.parentNode && node.parentNode.removeChild(node);
    });
    return fetch(url, { cache: 'no-store' })
      .then(function (res) {
        return res.text().then(function (body) {
          if (!res.ok || body.trimStart().startsWith('<!')) {
            throw new Error('css-not-found');
          }
          return body;
        });
      })
      .then(function (css) {
        var style = document.createElement('style');
        style.setAttribute('data-mxcorp-css', path);
        style.textContent = css;
        document.head.appendChild(style);
      });
  }
  function loadModule(src, bustCache) {
    var path = assetPath(src);
    var url = assetUrl(path, bustCache);
    return fetch(url, { cache: 'no-store' })
      .then(function (res) {
        return res.text().then(function (body) {
          if (!res.ok || body.trimStart().startsWith('<!')) {
            throw new Error('asset-not-found');
          }
          return body;
        });
      })
      .then(function () {
        return new Promise(function (resolve, reject) {
          var script = document.createElement('script');
          script.type = 'module';
          script.src = url;
          script.onload = function () {
            sessionStorage.removeItem(RELOAD_KEY);
            resolve();
          };
          script.onerror = function () {
            reject(new Error('asset-not-found'));
          };
          document.head.appendChild(script);
        });
      });
  }
  function bootAssets(cssSrc, jsSrc, cssBust, jsBust) {
    return loadStylesheet(cssSrc, cssBust).then(function () {
      return loadModule(jsSrc, jsBust);
    });
  }
  window.__mxcorpBoot = function (cssSrc, jsSrc) {
    var jsPath = assetPath(jsSrc);
    bootAssets(cssSrc, jsSrc, false, false).catch(function () {
      if (sessionStorage.getItem(RELOAD_KEY) === jsPath) {
        bootAssets(cssSrc, jsSrc, true, true).catch(showLoadError);
        return;
      }
      sessionStorage.setItem(RELOAD_KEY, jsPath);
      bootAssets(cssSrc, jsSrc, true, true).catch(showLoadError);
    });
  };
})();
</script><script>window.__mxcorpBoot('/static/index-BIm8ds_O.css','/static/index-DzkDFLR2.js');</script></head>
  <body>
    <div id="root"></div>
  </body>
</html>
