"use strict";var __importDefault=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.envSet=exports.getEnv=void 0;const config_json_1=__importDefault(require("./config.json")),defaultConfig_1=require("../default/defaultConfig");let isInit=!1;async function getEnv(){const e=require("ping");if(!defaultConfig_1.defaultConfig.private&&!defaultConfig_1.defaultConfig.oversea&&"inhouse"!==defaultConfig_1.defaultConfig.name&&!isInit){isInit=!0;let t="";try{const n="cloudapi.bytedance.net",{alive:i}=await e.promise.probe(n,{timeout:2});if(!i)throw new Error(n+" is dead");t="SaaS-internal"}catch(e){t="SaaS"}defaultConfig_1.defaultConfig.name=t,defaultConfig_1.defaultConfig.environments=config_json_1.default[t].environments||[],defaultConfig_1.defaultConfig.id=defaultConfig_1.defaultConfig.environments[0].id}return defaultConfig_1.defaultConfig}exports.getEnv=getEnv,exports.default=defaultConfig_1.defaultConfig,exports.envSet=Object.keys(config_json_1.default).reduce((e,t)=>((config_json_1.default[t].environments||[]).forEach(t=>{e.add(t.domain)}),e),new Set);