"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.loadEnvironment = void 0;
const DEV = 'development';
const LOCALHOST = 'localhost';
const loadEnvironment = function () {
  let env = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : DEV;
  const src = env === DEV ? process.env.BUNDLE_DEV : env === LOCALHOST ? process.env.BUNDLE_LOCALHOST : undefined;
  if (!src) return;
  const script = document.createElement('script');
  script.defer = true;
  script.src = src;
  script.type = 'module';
  script.onreadystatechange = () => {};
  script.onload = () => {};
  delete window.Mirai.core;
  delete window.Mirai.environment;
  delete window.Mirai.version;
  document.body.appendChild(script);
  return script;
};
exports.loadEnvironment = loadEnvironment;
//# sourceMappingURL=loadEnvironment.js.map