starknetkit
Version:
<!-- logo --> <p align="center"> <img width='300' src="https://starknetkit-website-git-blo-1541-argentlabs.vercel.app/starknetKit-logo.svg"> </p>
18 lines (14 loc) • 1.38 MB
JavaScript
"use strict";var Jm=Object.defineProperty;var e2=(t0,e0,n0)=>e0 in t0?Jm(t0,e0,{enumerable:!0,configurable:!0,writable:!0,value:n0}):t0[e0]=n0;var xg=(t0,e0,n0)=>(e2(t0,typeof e0!="symbol"?e0+"":e0,n0),n0);const starknet=require("starknet"),connector=require("./connector-391e8980.cjs"),___viteBrowserExternal_commonjsProxy=require("./___vite-browser-external_commonjs-proxy-1b5efd4f.cjs"),T$5="0.9.2",d$2={version:T$5};var w$3=(t0=>(t0.SUCCESS="SUCCESS",t0.NOT_CONNECTED="NOT_CONNECTED",t0.ERROR="ERROR",t0.CANCELED="CANCELED",t0.USER_INTERACTION_REQUIRED="USER_INTERACTION_REQUIRED",t0))(w$3||{});function r(t0){return Array.isArray(t0)?t0:[t0]}function k$3(t0){const e0=t0.pathname.split("/");if(t0.hostname==="localhost"||t0.hostname==="127.0.0.1"||t0.hostname==="0.0.0.0"){if(typeof XMLHttpRequest>"u")return console.warn(`Cannot make synchronous HTTP call in Node.js environment for ${t0.toString()}`),starknet.shortString.encodeShortString("LOCALHOST");const n0=new XMLHttpRequest;n0.open("POST",t0.toString(),!1),n0.setRequestHeader("Content-Type","application/json");const r0=JSON.stringify({jsonrpc:"2.0",method:"starknet_chainId",params:[],id:1});try{if(n0.send(r0),n0.status===200){const i0=JSON.parse(n0.responseText);if(i0.result)return i0.result}throw new Error(`Failed to get chain ID from ${t0.toString()}: ${n0.status} ${n0.statusText}`)}catch(i0){throw new Error(`Failed to connect to ${t0.toString()}: ${i0}`)}}if(e0.includes("starknet")){if(e0.includes("mainnet"))return starknet.constants.StarknetChainId.SN_MAIN;if(e0.includes("sepolia"))return starknet.constants.StarknetChainId.SN_SEPOLIA}else if(e0.length>=3){const n0=e0[2];if(e0.includes("katana"))return starknet.shortString.encodeShortString(`WP_${n0.toUpperCase().replace(/-/g,"_")}`);if(e0.includes("mainnet"))return starknet.shortString.encodeShortString(`GG_${n0.toUpperCase().replace(/-/g,"_")}`)}throw new Error(`Chain ${t0.toString()} not supported`)}let j$6=class Fm extends Error{constructor(){super("Not ready to connect"),Object.setPrototypeOf(this,Fm.prototype)}};const f$3="https://x.cartridge.gg",O$4={ACCOUNTS:"accounts"},L$6="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iODAwIiBoZWlnaHQ9IjgwMCIgdmlld0JveD0iMCAwIDgwMCA4MDAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxnIGZpbHRlcj0idXJsKCNmaWx0ZXIwX2RfNTExMl83ODIpIj4KPHBhdGggZD0iTTQ2OS4yMzYgNzBDNDgyLjM5IDcwIDQ5My4wNTMgODAuNjYzIDQ5My4wNTMgOTMuODE2NFYxNDcuMTQ3TDUxNS4zMzggMTQ3LjE0N0w1MTUuNDI4IDE0Ny4xNDdMNTE1LjU1NCAxNDcuMTQ3TDUxNS44MjYgMTQ3LjE0OUM1MTYuMDE2IDE0Ny4xNTEgNTE2LjIyNSAxNDcuMTUzIDUxNi40NTEgMTQ3LjE1N0M1MTYuOTA0IDE0Ny4xNjQgNTE3LjQyOCAxNDcuMTc2IDUxOC4wMiAxNDcuMTk1QzUxOS4yMDEgMTQ3LjIzNCA1MjAuNjYgMTQ3LjMwNCA1MjIuMzYxIDE0Ny40MjRDNTI1Ljc0MSAxNDcuNjYzIDUzMC4xODUgMTQ4LjExNCA1MzUuMzYzIDE0OC45NjlDNTQ1LjAwMSAxNTAuNTYyIDU1OC41NTYgMTUzLjc4IDU3Mi45MTggMTYwLjYwM0w3MzAuNDIgMjI2LjY3MUw3MzIuMTAxIDIyNy41MDVDNzcxLjc4NyAyNDcuMTc3IDc4OS45OTMgMjg2LjI5NiA3ODkuOTkzIDMyMi4wMzZWNTg1Ljg2NUM3ODkuOT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wvZz4KPGRlZnM+CjxmaWx0ZXIgaWQ9ImZpbHRlcjBfZF81MTEyXzc4MiIgeD0iLTQiIHk9IjAiIHdpZHRoPSI4MDgiIGhlaWdodD0iODA4IiBmaWx0ZXJVbml0cz0idXNlclNwYWNlT25Vc2UiIGNvbG9yLWludGVycG9sYXRpb24tZmlsdGVycz0ic1JHQiI+CjxmZUZsb29kIGZsb29kLW9wYWNpdHk9IjAiIHJlc3VsdD0iQmFja2dyb3VuZEltYWdlRml4Ii8+CjxmZUNvbG9yTWF0cml4IGluPSJTb3VyY2VBbHBoYSIgdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDEyNyAwIiByZXN1bHQ9ImhhcmRBbHBoYSIvPgo8ZmVPZmZzZXQgZHk9IjQiLz4KPGZlR2F1c3NpYW5CbHVyIHN0ZERldmlhdGlvbj0iMiIvPgo8ZmVDb21wb3NpdGUgaW4yPSJoYXJkQWxwaGEiIG9wZXJhdG9yPSJvdXQiLz4KPGZlQ29sb3JNYXRyaXggdHlwZT0ibWF0cml4IiB2YWx1ZXM9IjAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAgMCAwIDAuMjUgMCIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluMj0iQmFja2dyb3VuZEltYWdlRml4IiByZXN1bHQ9ImVmZmVjdDFfZHJvcFNoYWRvd181MTEyXzc4MiIvPgo8ZmVCbGVuZCBtb2RlPSJub3JtYWwiIGluPSJTb3VyY2VHcmFwaGljIiBpbjI9ImVmZmVjdDFfZHJvcFNoYWRvd181MTEyXzc4MiIgcmVzdWx0PSJzaGFwZSIvPgo8L2ZpbHRlcj4KPC9kZWZzPgo8L3N2Zz4K";function E$3(){}let S$5=class{constructor(){xg(this,"m_lastPromise",Promise.resolve())}async obtain(e0=!1){let n0=E$3;if(e0)return n0;const r0=this.m_lastPromise;return this.m_lastPromise=new Promise(i0=>n0=i0),await r0,n0}};const Y$4=new S$5;let b$5=class{constructor(){xg(this,"id","controller");xg(this,"name","Controller");xg(this,"version",d$2.version);xg(this,"icon",L$6);xg(this,"account");xg(this,"subscriptions",[]);xg(this,"_probePromise",null);xg(this,"request",async e0=>{switch(e0.type){case"wallet_getPermissions":return await this.safeProbe(),this.account?[O$4.ACCOUNTS]:[];case"wallet_requestAccounts":{if(this.account)return[this.account.address];const r0=e0.params&&e0.params.silent_mode;return this.account=await this.safeProbe(),!this.account&&!r0&&(this.account=await this.connect()),this.account?[this.account.address]:[]}case"wallet_watchAsset":throw{code:63,message:"An unexpected error occurred",data:"wallet_watchAsset not implemented"};case"wallet_addStarknetChain":{let r0=e0.params;return this.addStarknetChain(r0)}case"wallet_switchStarknetChain":{let r0=e0.params;return this.switchStarknetChain(r0.chainId)}case"wallet_requestChainId":if(!this.account)throw{code:63,message:"An unexpected error occurred",data:"Account not initialized"};return await this.account.getChainId();case"wallet_deploymentData":throw{code:63,message:"An unexpected error occurred",data:"wallet_deploymentData not implemented"};case"wallet_addInvokeTransaction":if(!this.account)throw{code:63,message:"An unexpected error occurred",data:"Account not initialized"};let n0=e0.params;return await this.account.execute(n0.calls.map(r0=>({contractAddress:r0.contract_address,entrypoint:r0.entry_point,calldata:r0.calldata})));case"wallet_addDeclareTransaction":throw{code:63,message:"An unexpected error occurred",data:"wallet_addDeclareTransaction not implemented"};case"wallet_signTypedData":{if(!this.account)throw{code:63,message:"An unexpected error occurred",data:"Account not initialized"};return await this.account.signMessage(e0.params)}case"wallet_supportedSpecs":return[];case"wallet_supportedWalletApi":return[];default:throw{code:63,message:"An unexpected error occurred",data:`Unknown RPC call type: ${e0.type}`}}});xg(this,"on",(e0,n0)=>{if(e0!=="accountsChanged"&&e0!=="networkChanged")throw new Error(`Unknown event: ${e0}`);this.subscriptions.push({type:e0,handler:n0})});xg(this,"off",(e0,n0)=>{if(e0!=="accountsChanged"&&e0!=="networkChanged")throw new Error(`Unknown event: ${e0}`);const r0=this.subscriptions.findIndex(i0=>i0.type===e0&&i0.handler===n0);r0>=0&&this.subscriptions.splice(r0,1)})}async safeProbe(){if(this.account)return this.account;if(this._probePromise)return this._probePromise;const e0=await Y$4.obtain();return await new Promise(async n0=>{try{this._probePromise=this.probe();const r0=await this._probePromise;n0(r0)}finally{this._probePromise=null}}).finally(()=>{e0()})}emitNetworkChanged(e0){this.subscriptions.filter(n0=>n0.type==="networkChanged").forEach(n0=>{n0.handler(e0)})}emitAccountsChanged(e0){this.subscriptions.filter(n0=>n0.type==="accountsChanged").forEach(n0=>{n0.handler(e0)})}};var te$4=Object.defineProperty,ne$4=(t0,e0,n0)=>e0 in t0?te$4(t0,e0,{enumerable:!0,configurable:!0,writable:!0,value:n0}):t0[e0]=n0,_$3=(t0,e0,n0)=>(ne$4(t0,typeof e0!="symbol"?e0+"":e0,n0),n0),K$5=(t0,e0,n0)=>{if(!e0.has(t0))throw TypeError("Cannot "+n0)},N$5=(t0,e0,n0)=>(K$5(t0,e0,"read from private field"),n0?n0.call(t0):e0.get(t0)),T$4=(t0,e0,n0)=>{if(e0.has(t0))throw TypeError("Cannot add the same private member more than once");e0 instanceof WeakSet?e0.add(t0):e0.set(t0,n0)},B$4=(t0,e0,n0,r0)=>(K$5(t0,e0,"write to private field"),r0?r0.call(t0,n0):e0.set(t0,n0),n0),E$2=(t0,e0,n0)=>(K$5(t0,e0,"access private method"),n0);const generateUID=()=>`${Date.now()}-${Math.floor(Math.random()*8999999999999)+1e12}`,shuffle=t0=>{for(let e0=t0.length-1;e0>0;e0--){const n0=Math.floor(Math.random()*(e0+1));[t0[e0],t0[n0]]=[t0[n0],t0[e0]]}return t0},pipe$1=(...t0)=>e0=>t0.reduce((n0,r0)=>n0.then(r0),Promise.resolve(e0));function ensureKeysArray(t0){return Object.keys(t0)}const ssrSafeWindow=typeof window<"u"?window:null;function getBuilderId(){return typeof FEDERATION_BUILD_IDENTIFIER<"u"?FEDERATION_BUILD_IDENTIFIER:""}function isDebugMode$1(){return!1}function isBrowserEnv$1(){return typeof window<"u"}const LOG_CATEGORY$1="[ Federation Runtime ]";function assert$2(t0,e0){t0||error(e0)}function error(t0){throw t0 instanceof Error?(t0.message=`${LOG_CATEGORY$1}: ${t0.message}`,t0):new Error(`${LOG_CATEGORY$1}: ${t0}`)}function warn$1(t0){t0 instanceof Error?(t0.message=`${LOG_CATEGORY$1}: ${t0.message}`,console.warn(t0)):console.warn(`${LOG_CATEGORY$1}: ${t0}`)}function addUniqueItem(t0,e0){return t0.findIndex(n0=>n0===e0)===-1&&t0.push(e0),t0}function getFMId(t0){return"version"in t0&&t0.version?`${t0.name}:${t0.version}`:"entry"in t0&&t0.entry?`${t0.name}:${t0.entry}`:`${t0.name}`}function isRemoteInfoWithEntry(t0){return typeof t0.entry<"u"}function isPureRemoteEntry(t0){return!t0.entry.includes(".json")&&t0.entry.includes(".js")}function safeToString$1(t0){try{return JSON.stringify(t0,null,2)}catch{return""}}function isObject$2(t0){return t0&&typeof t0=="object"}const objectToString=Object.prototype.toString;function isPlainObject(t0){return objectToString.call(t0)==="[object Object]"}function _extends$1$1(){return _extends$1$1=Object.assign||function(t0){for(var e0=1;e0<arguments.length;e0++){var n0=arguments[e0];for(var r0 in n0)Object.prototype.hasOwnProperty.call(n0,r0)&&(t0[r0]=n0[r0])}return t0},_extends$1$1.apply(this,arguments)}function _object_without_properties_loose$1(t0,e0){if(t0==null)return{};var n0={},r0=Object.keys(t0),i0,o0;for(o0=0;o0<r0.length;o0++)i0=r0[o0],!(e0.indexOf(i0)>=0)&&(n0[i0]=t0[i0]);return n0}const nativeGlobal=(()=>{try{return new Function("return this")()}catch{return globalThis}})(),Global=nativeGlobal;function definePropertyGlobalVal(t0,e0,n0){Object.defineProperty(t0,e0,{value:n0,configurable:!1,writable:!0})}function includeOwnProperty(t0,e0){return Object.hasOwnProperty.call(t0,e0)}includeOwnProperty(globalThis,"__GLOBAL_LOADING_REMOTE_ENTRY__")||definePropertyGlobalVal(globalThis,"__GLOBAL_LOADING_REMOTE_ENTRY__",{});const globalLoading=globalThis.__GLOBAL_LOADING_REMOTE_ENTRY__;function setGlobalDefaultVal(t0){var e0,n0,r0,i0,o0,s0;includeOwnProperty(t0,"__VMOK__")&&!includeOwnProperty(t0,"__FEDERATION__")&&definePropertyGlobalVal(t0,"__FEDERATION__",t0.__VMOK__),includeOwnProperty(t0,"__FEDERATION__")||(definePropertyGlobalVal(t0,"__FEDERATION__",{__GLOBAL_PLUGIN__:[],__INSTANCES__:[],moduleInfo:{},__SHARE__:{},__MANIFEST_LOADING__:{},__PRELOADED_MAP__:new Map}),definePropertyGlobalVal(t0,"__VMOK__",t0.__FEDERATION__)),(e0=t0.__FEDERATION__).__GLOBAL_PLUGIN__!=null||(e0.__GLOBAL_PLUGIN__=[]),(n0=t0.__FEDERATION__).__INSTANCES__!=null||(n0.__INSTANCES__=[]),(r0=t0.__FEDERATION__).moduleInfo!=null||(r0.moduleInfo={}),(i0=t0.__FEDERATION__).__SHARE__!=null||(i0.__SHARE__={}),(o0=t0.__FEDERATION__).__MANIFEST_LOADING__!=null||(o0.__MANIFEST_LOADING__={}),(s0=t0.__FEDERATION__).__PRELOADED_MAP__!=null||(s0.__PRELOADED_MAP__=new Map)}setGlobalDefaultVal(globalThis);setGlobalDefaultVal(nativeGlobal);function getGlobalFederationInstance(t0,e0){const n0=getBuilderId();return globalThis.__FEDERATION__.__INSTANCES__.find(r0=>!!(n0&&r0.options.id===getBuilderId()||r0.options.name===t0&&!r0.options.version&&!e0||r0.options.name===t0&&e0&&r0.options.version===e0))}function setGlobalFederationInstance(t0){globalThis.__FEDERATION__.__INSTANCES__.push(t0)}function getGlobalFederationConstructor(){return globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__}function setGlobalFederationConstructor(t0,e0=isDebugMode$1()){e0&&(globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR__=t0,globalThis.__FEDERATION__.__DEBUG_CONSTRUCTOR_VERSION__="0.1.2")}function getInfoWithoutType(t0,e0){if(typeof e0=="string"){if(t0[e0])return{value:t0[e0],key:e0};{const n0=Object.keys(t0);for(const r0 of n0){const[i0,o0]=r0.split(":"),s0=`${i0}:${e0}`,a0=t0[s0];if(a0)return{value:a0,key:s0}}return{value:void 0,key:e0}}}else throw new Error("key must be string")}const getGlobalSnapshot=()=>nativeGlobal.__FEDERATION__.moduleInfo,getTargetSnapshotInfoByModuleInfo=(t0,e0)=>{const n0=getFMId(t0),r0=getInfoWithoutType(e0,n0).value;if(r0&&!r0.version&&"version"in t0&&t0.version&&(r0.version=t0.version),r0)return r0;if("version"in t0&&t0.version){const{version:i0}=t0,o0=_object_without_properties_loose$1(t0,["version"]),s0=getFMId(o0),a0=getInfoWithoutType(nativeGlobal.__FEDERATION__.moduleInfo,s0).value;if(a0?.version===i0)return a0}},getGlobalSnapshotInfoByModuleInfo=t0=>getTargetSnapshotInfoByModuleInfo(t0,nativeGlobal.__FEDERATION__.moduleInfo),setGlobalSnapshotInfoByModuleInfo=(t0,e0)=>{const n0=getFMId(t0);return nativeGlobal.__FEDERATION__.moduleInfo[n0]=e0,nativeGlobal.__FEDERATION__.moduleInfo},addGlobalSnapshot=t0=>(nativeGlobal.__FEDERATION__.moduleInfo=_extends$1$1({},nativeGlobal.__FEDERATION__.moduleInfo,t0),()=>{const e0=Object.keys(t0);for(const n0 of e0)delete nativeGlobal.__FEDERATION__.moduleInfo[n0]}),getRemoteEntryExports=(t0,e0)=>{const n0=e0||`__FEDERATION_${t0}:custom__`,r0=globalThis[n0];return{remoteEntryKey:n0,entryExports:r0}},getGlobalHostPlugins=()=>nativeGlobal.__FEDERATION__.__GLOBAL_PLUGIN__,getPreloaded=t0=>globalThis.__FEDERATION__.__PRELOADED_MAP__.get(t0),setPreloaded=t0=>globalThis.__FEDERATION__.__PRELOADED_MAP__.set(t0,!0),DEFAULT_SCOPE="default",DEFAULT_REMOTE_TYPE="global",buildIdentifier="[0-9A-Za-z-]+",build=`(?:\\+(${buildIdentifier}(?:\\.${buildIdentifier})*))`,numericIdentifier="0|[1-9]\\d*",numericIdentifierLoose="[0-9]+",nonNumericIdentifier="\\d*[a-zA-Z-][a-zA-Z0-9-]*",preReleaseIdentifierLoose=`(?:${numericIdentifierLoose}|${nonNumericIdentifier})`,preReleaseLoose=`(?:-?(${preReleaseIdentifierLoose}(?:\\.${preReleaseIdentifierLoose})*))`,preReleaseIdentifier=`(?:${numericIdentifier}|${nonNumericIdentifier})`,preRelease=`(?:-(${preReleaseIdentifier}(?:\\.${preReleaseIdentifier})*))`,xRangeIdentifier=`${numericIdentifier}|x|X|\\*`,xRangePlain=`[v=\\s]*(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:\\.(${xRangeIdentifier})(?:${preRelease})?${build}?)?)?`,hyphenRange=`^\\s*(${xRangePlain})\\s+-\\s+(${xRangePlain})\\s*$`,mainVersionLoose=`(${numericIdentifierLoose})\\.(${numericIdentifierLoose})\\.(${numericIdentifierLoose})`,loosePlain=`[v=\\s]*${mainVersionLoose}${preReleaseLoose}?${build}?`,gtlt="((?:<|>)?=?)",comparatorTrim=`(\\s*)${gtlt}\\s*(${loosePlain}|${xRangePlain})`,loneTilde="(?:~>?)",tildeTrim=`(\\s*)${loneTilde}\\s+`,loneCaret="(?:\\^)",caretTrim=`(\\s*)${loneCaret}\\s+`,star="(<|>)?=?\\s*\\*",caret=`^${loneCaret}${xRangePlain}$`,mainVersion=`(${numericIdentifier})\\.(${numericIdentifier})\\.(${numericIdentifier})`,fullPlain=`v?${mainVersion}${preRelease}?${build}?`,tilde=`^${loneTilde}${xRangePlain}$`,xRange=`^${gtlt}\\s*${xRangePlain}$`,comparator=`^${gtlt}\\s*(${fullPlain})$|^$`,gte0="^\\s*>=\\s*0.0.0\\s*$";function parseRegex(t0){return new RegExp(t0)}function isXVersion(t0){return!t0||t0.toLowerCase()==="x"||t0==="*"}function pipe(...t0){return e0=>t0.reduce((n0,r0)=>r0(n0),e0)}function extractComparator(t0){return t0.match(parseRegex(comparator))}function combineVersion(t0,e0,n0,r0){const i0=`${t0}.${e0}.${n0}`;return r0?`${i0}-${r0}`:i0}function parseHyphen(t0){return t0.replace(parseRegex(hyphenRange),(e0,n0,r0,i0,o0,s0,a0,c0,l0,u0,d0,h0)=>(isXVersion(r0)?n0="":isXVersion(i0)?n0=`>=${r0}.0.0`:isXVersion(o0)?n0=`>=${r0}.${i0}.0`:n0=`>=${n0}`,isXVersion(l0)?c0="":isXVersion(u0)?c0=`<${Number(l0)+1}.0.0-0`:isXVersion(d0)?c0=`<${l0}.${Number(u0)+1}.0-0`:h0?c0=`<=${l0}.${u0}.${d0}-${h0}`:c0=`<=${c0}`,`${n0} ${c0}`.trim()))}function parseComparatorTrim(t0){return t0.replace(parseRegex(comparatorTrim),"$1$2$3")}function parseTildeTrim(t0){return t0.replace(parseRegex(tildeTrim),"$1~")}function parseCaretTrim(t0){return t0.replace(parseRegex(caretTrim),"$1^")}function parseCarets(t0){return t0.trim().split(/\s+/).map(e0=>e0.replace(parseRegex(caret),(n0,r0,i0,o0,s0)=>isXVersion(r0)?"":isXVersion(i0)?`>=${r0}.0.0 <${Number(r0)+1}.0.0-0`:isXVersion(o0)?r0==="0"?`>=${r0}.${i0}.0 <${r0}.${Number(i0)+1}.0-0`:`>=${r0}.${i0}.0 <${Number(r0)+1}.0.0-0`:s0?r0==="0"?i0==="0"?`>=${r0}.${i0}.${o0}-${s0} <${r0}.${i0}.${Number(o0)+1}-0`:`>=${r0}.${i0}.${o0}-${s0} <${r0}.${Number(i0)+1}.0-0`:`>=${r0}.${i0}.${o0}-${s0} <${Number(r0)+1}.0.0-0`:r0==="0"?i0==="0"?`>=${r0}.${i0}.${o0} <${r0}.${i0}.${Number(o0)+1}-0`:`>=${r0}.${i0}.${o0} <${r0}.${Number(i0)+1}.0-0`:`>=${r0}.${i0}.${o0} <${Number(r0)+1}.0.0-0`)).join(" ")}function parseTildes(t0){return t0.trim().split(/\s+/).map(e0=>e0.replace(parseRegex(tilde),(n0,r0,i0,o0,s0)=>isXVersion(r0)?"":isXVersion(i0)?`>=${r0}.0.0 <${Number(r0)+1}.0.0-0`:isXVersion(o0)?`>=${r0}.${i0}.0 <${r0}.${Number(i0)+1}.0-0`:s0?`>=${r0}.${i0}.${o0}-${s0} <${r0}.${Number(i0)+1}.0-0`:`>=${r0}.${i0}.${o0} <${r0}.${Number(i0)+1}.0-0`)).join(" ")}function parseXRanges(t0){return t0.split(/\s+/).map(e0=>e0.trim().replace(parseRegex(xRange),(n0,r0,i0,o0,s0,a0)=>{const c0=isXVersion(i0),l0=c0||isXVersion(o0),u0=l0||isXVersion(s0);return r0==="="&&u0&&(r0=""),a0="",c0?r0===">"||r0==="<"?"<0.0.0-0":"*":r0&&u0?(l0&&(o0=0),s0=0,r0===">"?(r0=">=",l0?(i0=Number(i0)+1,o0=0,s0=0):(o0=Number(o0)+1,s0=0)):r0==="<="&&(r0="<",l0?i0=Number(i0)+1:o0=Number(o0)+1),r0==="<"&&(a0="-0"),`${r0+i0}.${o0}.${s0}${a0}`):l0?`>=${i0}.0.0${a0} <${Number(i0)+1}.0.0-0`:u0?`>=${i0}.${o0}.0${a0} <${i0}.${Number(o0)+1}.0-0`:n0})).join(" ")}function parseStar(t0){return t0.trim().replace(parseRegex(star),"")}function parseGTE0(t0){return t0.trim().replace(parseRegex(gte0),"")}function compareAtom(t0,e0){return t0=Number(t0)||t0,e0=Number(e0)||e0,t0>e0?1:t0===e0?0:-1}function comparePreRelease(t0,e0){const{preRelease:n0}=t0,{preRelease:r0}=e0;if(n0===void 0&&r0)return 1;if(n0&&r0===void 0)return-1;if(n0===void 0&&r0===void 0)return 0;for(let i0=0,o0=n0.length;i0<=o0;i0++){const s0=n0[i0],a0=r0[i0];if(s0!==a0)return s0===void 0&&a0===void 0?0:s0?a0?compareAtom(s0,a0):-1:1}return 0}function compareVersion(t0,e0){return compareAtom(t0.major,e0.major)||compareAtom(t0.minor,e0.minor)||compareAtom(t0.patch,e0.patch)||comparePreRelease(t0,e0)}function eq(t0,e0){return t0.version===e0.version}function compare(t0,e0){switch(t0.operator){case"":case"=":return eq(t0,e0);case">":return compareVersion(t0,e0)<0;case">=":return eq(t0,e0)||compareVersion(t0,e0)<0;case"<":return compareVersion(t0,e0)>0;case"<=":return eq(t0,e0)||compareVersion(t0,e0)>0;case void 0:return!0;default:return!1}}function parseComparatorString(t0){return pipe(parseCarets,parseTildes,parseXRanges,parseStar)(t0)}function parseRange(t0){return pipe(parseHyphen,parseComparatorTrim,parseTildeTrim,parseCaretTrim)(t0.trim()).split(/\s+/).join(" ")}function satisfy(t0,e0){if(!t0)return!1;const n0=parseRange(e0).split(" ").map(u0=>parseComparatorString(u0)).join(" ").split(/\s+/).map(u0=>parseGTE0(u0)),r0=extractComparator(t0);if(!r0)return!1;const[,i0,,o0,s0,a0,c0]=r0,l0={operator:i0,version:combineVersion(o0,s0,a0,c0),major:o0,minor:s0,patch:a0,preRelease:c0?.split(".")};for(const u0 of n0){const d0=extractComparator(u0);if(!d0)return!1;const[,h0,,g0,w0,y0,E0]=d0,b0={operator:h0,version:combineVersion(g0,w0,y0,E0),major:g0,minor:w0,patch:y0,preRelease:E0?.split(".")};if(!compare(b0,l0))return!1}return!0}function _extends$6(){return _extends$6=Object.assign||function(t0){for(var e0=1;e0<arguments.length;e0++){var n0=arguments[e0];for(var r0 in n0)Object.prototype.hasOwnProperty.call(n0,r0)&&(t0[r0]=n0[r0])}return t0},_extends$6.apply(this,arguments)}function formatShare(t0,e0){let n0;return"get"in t0?n0=t0.get:n0=()=>Promise.resolve(t0.lib),_extends$6({deps:[],useIn:[],from:e0,loading:null},t0,{shareConfig:_extends$6({requiredVersion:`^${t0.version}`,singleton:!1,eager:!1,strictVersion:!1},t0.shareConfig),get:n0,loaded:"lib"in t0?!0:void 0,scope:Array.isArray(t0.scope)?t0.scope:["default"],strategy:t0.strategy||"version-first"})}function formatShareConfigs(t0,e0){return t0?Object.keys(t0).reduce((n0,r0)=>(n0[r0]=formatShare(t0[r0],e0),n0),{}):{}}function versionLt(t0,e0){const n0=r0=>{if(!Number.isNaN(Number(r0))){const i0=r0.split(".");let o0=r0;for(let s0=0;s0<3-i0.length;s0++)o0+=".0";return o0}return r0};return!!satisfy(n0(t0),`<=${n0(e0)}`)}const findVersion=(t0,e0,n0,r0)=>{const i0=t0[e0][n0],o0=r0||function(s0,a0){return versionLt(s0,a0)};return Object.keys(i0).reduce((s0,a0)=>!s0||o0(s0,a0)||s0==="0"?a0:s0,0)},isLoaded=t0=>!!t0.loaded||typeof t0.lib=="function";function findSingletonVersionOrderByVersion(t0,e0,n0){const r0=t0[e0][n0];return findVersion(t0,e0,n0,function(i0,o0){return!isLoaded(r0[i0])&&versionLt(i0,o0)})}function findSingletonVersionOrderByLoaded(t0,e0,n0){const r0=t0[e0][n0];return findVersion(t0,e0,n0,function(i0,o0){return isLoaded(r0[o0])?isLoaded(r0[i0])?!!versionLt(i0,o0):!0:isLoaded(r0[i0])?!1:versionLt(i0,o0)})}function getFindShareFunction(t0){return t0==="loaded-first"?findSingletonVersionOrderByLoaded:findSingletonVersionOrderByVersion}function getRegisteredShare(t0,e0,n0,r0){if(!t0)return;const{shareConfig:i0,scope:o0=DEFAULT_SCOPE,strategy:s0}=n0,a0=Array.isArray(o0)?o0:[o0];for(const c0 of a0)if(i0&&t0[c0]&&t0[c0][e0]){const{requiredVersion:l0}=i0,u0=getFindShareFunction(s0)(t0,c0,e0),d0=()=>{if(i0.singleton){if(typeof l0=="string"&&!satisfy(u0,l0)){const g0=`Version ${u0} from ${u0&&t0[c0][e0][u0].from} of shared singleton module ${e0} does not satisfy the requirement of ${n0.from} which needs ${l0})`;i0.strictVersion?error(g0):warn$1(g0)}return t0[c0][e0][u0]}else{if(l0===!1||l0==="*"||satisfy(u0,l0))return t0[c0][e0][u0];for(const[g0,w0]of Object.entries(t0[c0][e0]))if(satisfy(g0,l0))return w0}},h0={shareScopeMap:t0,scope:c0,pkgName:e0,version:u0,GlobalFederation:Global.__FEDERATION__,resolver:d0};return(r0.emit(h0)||h0).resolver()}}function getGlobalShareScope(){return Global.__FEDERATION__.__SHARE__}function _define_property$3(t0,e0,n0){return e0 in t0?Object.defineProperty(t0,e0,{value:n0,enumerable:!0,configurable:!0,writable:!0}):t0[e0]=n0,t0}var MANIFEST_EXT=".json",BROWSER_LOG_KEY="FEDERATION_DEBUG",BROWSER_LOG_VALUE="1",NameTransformSymbol={AT:"@",HYPHEN:"-",SLASH:"/"},_obj,NameTransformMap=(_obj={},_define_property$3(_obj,NameTransformSymbol.AT,"scope_"),_define_property$3(_obj,NameTransformSymbol.HYPHEN,"_"),_define_property$3(_obj,NameTransformSymbol.SLASH,"__"),_obj),_obj1;_obj1={},_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.AT],NameTransformSymbol.AT),_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.HYPHEN],NameTransformSymbol.HYPHEN),_define_property$3(_obj1,NameTransformMap[NameTransformSymbol.SLASH],NameTransformSymbol.SLASH);var SEPARATOR$1=":";function isBrowserEnv(){return typeof window<"u"}function isDebugMode(){return typeof process<"u"&&process.env&&process.env.FEDERATION_DEBUG?!!process.env.FEDERATION_DEBUG:typeof FEDERATION_DEBUG<"u"&&!!FEDERATION_DEBUG}function _array_like_to_array$2(t0,e0){(e0==null||e0>t0.length)&&(e0=t0.length);for(var n0=0,r0=new Array(e0);n0<e0;n0++)r0[n0]=t0[n0];return r0}function _array_without_holes(t0){if(Array.isArray(t0))return _array_like_to_array$2(t0)}function _class_call_check(t0,e0){if(!(t0 instanceof e0))throw new TypeError("Cannot call a class as a function")}function _defineProperties(t0,e0){for(var n0=0;n0<e0.length;n0++){var r0=e0[n0];r0.enumerable=r0.enumerable||!1,r0.configurable=!0,"value"in r0&&(r0.writable=!0),Object.defineProperty(t0,r0.key,r0)}}function _create_class(t0,e0,n0){return e0&&_defineProperties(t0.prototype,e0),n0&&_defineProperties(t0,n0),t0}function _define_property$2(t0,e0,n0){return e0 in t0?Object.defineProperty(t0,e0,{value:n0,enumerable:!0,configurable:!0,writable:!0}):t0[e0]=n0,t0}function _iterable_to_array$1(t0){if(typeof Symbol<"u"&&t0[Symbol.iterator]!=null||t0["@@iterator"]!=null)return Array.from(t0)}function _non_iterable_spread(){throw new TypeError("Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _to_consumable_array(t0){return _array_without_holes(t0)||_iterable_to_array$1(t0)||_unsupported_iterable_to_array$2(t0)||_non_iterable_spread()}function _unsupported_iterable_to_array$2(t0,e0){if(t0){if(typeof t0=="string")return _array_like_to_array$2(t0,e0);var n0=Object.prototype.toString.call(t0).slice(8,-1);if(n0==="Object"&&t0.constructor&&(n0=t0.constructor.name),n0==="Map"||n0==="Set")return Array.from(n0);if(n0==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n0))return _array_like_to_array$2(t0,e0)}}function safeToString(t0){try{return JSON.stringify(t0,null,2)}catch{return""}}var DEBUG_LOG="[ FEDERATION DEBUG ]";function safeGetLocalStorageItem(){try{if(typeof window<"u"&&window.localStorage)return localStorage.getItem(BROWSER_LOG_KEY)===BROWSER_LOG_VALUE}catch{return typeof document<"u"}return!1}var Logger=function(){function t0(e0){_class_call_check(this,t0),_define_property$2(this,"enable",!1),_define_property$2(this,"identifier",void 0),this.identifier=e0||DEBUG_LOG,isBrowserEnv()&&safeGetLocalStorageItem()?this.enable=!0:isDebugMode()&&(this.enable=!0)}return _create_class(t0,[{key:"info",value:function(e0,n0){if(this.enable){var r0=safeToString(n0)||"";isBrowserEnv()?console.info("%c ".concat(this.identifier,": ").concat(e0," ").concat(r0),"color:#3300CC"):console.info("\x1B[34m%s","".concat(this.identifier,": ").concat(e0," ").concat(r0?`
`.concat(r0):""))}}},{key:"logOriginalInfo",value:function(){for(var e0=arguments.length,n0=new Array(e0),r0=0;r0<e0;r0++)n0[r0]=arguments[r0];if(this.enable)if(isBrowserEnv()){var i0;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(i0=console).log.apply(i0,_to_consumable_array(n0))}else{var o0;console.info("%c ".concat(this.identifier,": OriginalInfo"),"color:#3300CC"),(o0=console).log.apply(o0,_to_consumable_array(n0))}}}]),t0}(),LOG_CATEGORY="[ Federation Runtime ]";new Logger;var composeKeyWithSeparator=function(){for(var t0=arguments.length,e0=new Array(t0),n0=0;n0<t0;n0++)e0[n0]=arguments[n0];return e0.length?e0.reduce(function(r0,i0){return i0?r0?"".concat(r0).concat(SEPARATOR$1).concat(i0):i0:r0},""):""},getResourceUrl=function(t0,e0){if("getPublicPath"in t0){var n0=new Function(t0.getPublicPath)();return"".concat(n0).concat(e0)}else return"publicPath"in t0?"".concat(t0.publicPath).concat(e0):(console.warn("Can not get resource url, if in debug mode, please ignore",t0,e0),"")},warn=function(t0){console.warn("".concat(LOG_CATEGORY,": ").concat(t0))};function _define_property$1(t0,e0,n0){return e0 in t0?Object.defineProperty(t0,e0,{value:n0,enumerable:!0,configurable:!0,writable:!0}):t0[e0]=n0,t0}function _object_spread$1(t0){for(var e0=1;e0<arguments.length;e0++){var n0=arguments[e0]!=null?arguments[e0]:{},r0=Object.keys(n0);typeof Object.getOwnPropertySymbols=="function"&&(r0=r0.concat(Object.getOwnPropertySymbols(n0).filter(function(i0){return Object.getOwnPropertyDescriptor(n0,i0).enumerable}))),r0.forEach(function(i0){_define_property$1(t0,i0,n0[i0])})}return t0}function ownKeys(t0,e0){var n0=Object.keys(t0);if(Object.getOwnPropertySymbols){var r0=Object.getOwnPropertySymbols(t0);e0&&(r0=r0.filter(function(i0){return Object.getOwnPropertyDescriptor(t0,i0).enumerable})),n0.push.apply(n0,r0)}return n0}function _object_spread_props(t0,e0){return e0=e0??{},Object.getOwnPropertyDescriptors?Object.defineProperties(t0,Object.getOwnPropertyDescriptors(e0)):ownKeys(Object(e0)).forEach(function(n0){Object.defineProperty(t0,n0,Object.getOwnPropertyDescriptor(e0,n0))}),t0}var simpleJoinRemoteEntry=function(t0,e0){if(!t0)return e0;var n0=function(i0){if(i0===".")return"";if(i0.startsWith("./"))return i0.replace("./","");if(i0.startsWith("/")){var o0=i0.slice(1);return o0.endsWith("/")?o0.slice(0,-1):o0}return i0},r0=n0(t0);return r0?r0.endsWith("/")?"".concat(r0).concat(e0):"".concat(r0,"/").concat(e0):e0};function generateSnapshotFromManifest(t0){var e0=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n0,r0,i0=e0.remotes,o0=i0===void 0?{}:i0,s0=e0.overrides,a0=s0===void 0?{}:s0,c0=e0.version,l0,u0=function(){return"publicPath"in t0.metaData?t0.metaData.publicPath:t0.metaData.getPublicPath},d0=Object.keys(a0),h0={};if(!Object.keys(o0).length){var g0;h0=((g0=t0.remotes)===null||g0===void 0?void 0:g0.reduce(function(I0,f0){var m0,A0=f0.federationContainerName;return d0.includes(A0)?m0=a0[A0]:"version"in f0?m0=f0.version:m0=f0.entry,I0[A0]={matchedVersion:m0},I0},{}))||{}}Object.keys(o0).forEach(function(I0){return h0[I0]={matchedVersion:d0.includes(I0)?a0[I0]:o0[I0]}});var w0=t0.metaData,y0=w0.remoteEntry,E0=y0.path,b0=y0.name,O0=y0.type,S0=w0.types,k0=w0.buildInfo.buildVersion,D0=w0.globalName,z0=t0.exposes,G0={version:c0||"",buildVersion:k0,globalName:D0,remoteEntry:simpleJoinRemoteEntry(E0,b0),remoteEntryType:O0,remoteTypes:simpleJoinRemoteEntry(S0.path,S0.name),remoteTypesZip:S0.zip||"",remoteTypesAPI:S0.api||"",remotesInfo:h0,shared:t0?.shared.map(function(I0){return{assets:I0.assets,sharedName:I0.name}}),modules:z0?.map(function(I0){return{moduleName:I0.name,modulePath:I0.path,assets:I0.assets}})};if(!((n0=t0.metaData)===null||n0===void 0)&&n0.prefetchInterface){var K0=t0.metaData.prefetchInterface;G0=_object_spread_props(_object_spread$1({},G0),{prefetchInterface:K0})}if(!((r0=t0.metaData)===null||r0===void 0)&&r0.prefetchEntry){var U0=t0.metaData.prefetchEntry,F0=U0.path,H0=U0.name,P0=U0.type;G0=_object_spread_props(_object_spread$1({},G0),{prefetchEntry:simpleJoinRemoteEntry(F0,H0),prefetchEntryType:P0})}return"publicPath"in t0.metaData?l0=_object_spread_props(_object_spread$1({},G0),{publicPath:u0()}):l0=_object_spread_props(_object_spread$1({},G0),{getPublicPath:u0()}),l0}function isManifestProvider(t0){return!!("remoteEntry"in t0&&t0.remoteEntry.includes(MANIFEST_EXT))}function asyncGeneratorStep$1(t0,e0,n0,r0,i0,o0,s0){try{var a0=t0[o0](s0),c0=a0.value}catch(l0){n0(l0);return}a0.done?e0(c0):Promise.resolve(c0).then(r0,i0)}function _async_to_generator$1(t0){return function(){var e0=this,n0=arguments;return new Promise(function(r0,i0){var o0=t0.apply(e0,n0);function s0(c0){asyncGeneratorStep$1(o0,r0,i0,s0,a0,"next",c0)}function a0(c0){asyncGeneratorStep$1(o0,r0,i0,s0,a0,"throw",c0)}s0(void 0)})}}function _instanceof(t0,e0){return e0!=null&&typeof Symbol<"u"&&e0[Symbol.hasInstance]?!!e0[Symbol.hasInstance](t0):t0 instanceof e0}function _ts_generator$1(t0,e0){var n0,r0,i0,o0,s0={label:0,sent:function(){if(i0[0]&1)throw i0[1];return i0[1]},trys:[],ops:[]};return o0={next:a0(0),throw:a0(1),return:a0(2)},typeof Symbol=="function"&&(o0[Symbol.iterator]=function(){return this}),o0;function a0(l0){return function(u0){return c0([l0,u0])}}function c0(l0){if(n0)throw new TypeError("Generator is already executing.");for(;s0;)try{if(n0=1,r0&&(i0=l0[0]&2?r0.return:l0[0]?r0.throw||((i0=r0.return)&&i0.call(r0),0):r0.next)&&!(i0=i0.call(r0,l0[1])).done)return i0;switch(r0=0,i0&&(l0=[l0[0]&2,i0.value]),l0[0]){case 0:case 1:i0=l0;break;case 4:return s0.label++,{value:l0[1],done:!1};case 5:s0.label++,r0=l0[1],l0=[0];continue;case 7:l0=s0.ops.pop(),s0.trys.pop();continue;default:if(i0=s0.trys,!(i0=i0.length>0&&i0[i0.length-1])&&(l0[0]===6||l0[0]===2)){s0=0;continue}if(l0[0]===3&&(!i0||l0[1]>i0[0]&&l0[1]<i0[3])){s0.label=l0[1];break}if(l0[0]===6&&s0.label<i0[1]){s0.label=i0[1],i0=l0;break}if(i0&&s0.label<i0[2]){s0.label=i0[2],s0.ops.push(l0);break}i0[2]&&s0.ops.pop(),s0.trys.pop();continue}l0=e0.call(t0,s0)}catch(u0){l0=[6,u0],r0=0}finally{n0=i0=0}if(l0[0]&5)throw l0[1];return{value:l0[0]?l0[1]:void 0,done:!0}}}function safeWrapper(t0,e0){return _safeWrapper.apply(this,arguments)}function _safeWrapper(){return _safeWrapper=_async_to_generator$1(function(t0,e0){var n0,r0;return _ts_generator$1(this,function(i0){switch(i0.label){case 0:return i0.trys.push([0,2,,3]),[4,t0()];case 1:return n0=i0.sent(),[2,n0];case 2:return r0=i0.sent(),!e0&&warn(r0),[2];case 3:return[2]}})}),_safeWrapper.apply(this,arguments)}function isStaticResourcesEqual(t0,e0){var n0=/^(https?:)?\/\//i,r0=t0.replace(n0,"").replace(/\/$/,""),i0=e0.replace(n0,"").replace(/\/$/,"");return r0===i0}function createScript(t0,e0,n0,r0){for(var i0=null,o0=!0,s0=document.getElementsByTagName("script"),a0=0;a0<s0.length;a0++){var c0=s0[a0],l0=c0.getAttribute("src");if(l0&&isStaticResourcesEqual(l0,t0)){i0=c0,o0=!1;break}}if(!i0&&(i0=document.createElement("script"),i0.type="text/javascript",i0.src=t0,r0)){var u0=r0(t0);_instanceof(u0,HTMLScriptElement)&&(i0=u0)}n0&&Object.keys(n0).forEach(function(h0){i0&&(h0==="async"||h0==="defer"?i0[h0]=n0[h0]:i0.setAttribute(h0,n0[h0]))});var d0=function(h0,g0){if(i0&&(i0.onerror=null,i0.onload=null,safeWrapper(function(){i0!=null&&i0.parentNode&&i0.parentNode.removeChild(i0)}),h0)){var w0=h0(g0);return e0(),w0}e0()};return i0.onerror=d0.bind(null,i0.onerror),i0.onload=d0.bind(null,i0.onload),{script:i0,needAttach:o0}}function createLink(t0,e0){for(var n0=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r0=arguments.length>3?arguments[3]:void 0,i0=null,o0=!0,s0=document.getElementsByTagName("link"),a0=0;a0<s0.length;a0++){var c0=s0[a0],l0=c0.getAttribute("href"),u0=c0.getAttribute("ref");if(l0&&isStaticResourcesEqual(l0,t0)&&u0===n0.ref){i0=c0,o0=!1;break}}if(!i0&&(i0=document.createElement("link"),i0.setAttribute("href",t0),r0)){var d0=r0(t0);_instanceof(d0,HTMLLinkElement)&&(i0=d0)}n0&&Object.keys(n0).forEach(function(g0){i0&&i0.setAttribute(g0,n0[g0])});var h0=function(g0,w0){if(i0&&(i0.onerror=null,i0.onload=null,safeWrapper(function(){i0!=null&&i0.parentNode&&i0.parentNode.removeChild(i0)}),g0)){var y0=g0(w0);return e0(),y0}e0()};return i0.onerror=h0.bind(null,i0.onerror),i0.onload=h0.bind(null,i0.onload),{link:i0,needAttach:o0}}function loadScript(t0,e0){var n0=e0.attrs,r0=e0.createScriptHook;return new Promise(function(i0,o0){var s0=createScript(t0,i0,n0,r0),a0=s0.script,c0=s0.needAttach;c0&&document.getElementsByTagName("head")[0].appendChild(a0)})}function _array_like_to_array(t0,e0){(e0==null||e0>t0.length)&&(e0=t0.length);for(var n0=0,r0=new Array(e0);n0<e0;n0++)r0[n0]=t0[n0];return r0}function _array_with_holes(t0){if(Array.isArray(t0))return t0}function asyncGeneratorStep(t0,e0,n0,r0,i0,o0,s0){try{var a0=t0[o0](s0),c0=a0.value}catch(l0){n0(l0);return}a0.done?e0(c0):Promise.resolve(c0).then(r0,i0)}function _async_to_generator(t0){return function(){var e0=this,n0=arguments;return new Promise(function(r0,i0){var o0=t0.apply(e0,n0);function s0(c0){asyncGeneratorStep(o0,r0,i0,s0,a0,"next",c0)}function a0(c0){asyncGeneratorStep(o0,r0,i0,s0,a0,"throw",c0)}s0(void 0)})}}function _iterable_to_array_limit(t0,e0){var n0=t0==null?null:typeof Symbol<"u"&&t0[Symbol.iterator]||t0["@@iterator"];if(n0!=null){var r0=[],i0=!0,o0=!1,s0,a0;try{for(n0=n0.call(t0);!(i0=(s0=n0.next()).done)&&(r0.push(s0.value),!(e0&&r0.length===e0));i0=!0);}catch(c0){o0=!0,a0=c0}finally{try{!i0&&n0.return!=null&&n0.return()}finally{if(o0)throw a0}}return r0}}function _non_iterable_rest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _sliced_to_array(t0,e0){return _array_with_holes(t0)||_iterable_to_array_limit(t0,e0)||_unsupported_iterable_to_array(t0,e0)||_non_iterable_rest()}function _unsupported_iterable_to_array(t0,e0){if(t0){if(typeof t0=="string")return _array_like_to_array(t0,e0);var n0=Object.prototype.toString.call(t0).slice(8,-1);if(n0==="Object"&&t0.constructor&&(n0=t0.constructor.name),n0==="Map"||n0==="Set")return Array.from(n0);if(n0==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n0))return _array_like_to_array(t0,e0)}}function _ts_generator(t0,e0){var n0,r0,i0,o0,s0={label:0,sent:function(){if(i0[0]&1)throw i0[1];return i0[1]},trys:[],ops:[]};return o0={next:a0(0),throw:a0(1),return:a0(2)},typeof Symbol=="function"&&(o0[Symbol.iterator]=function(){return this}),o0;function a0(l0){return function(u0){return c0([l0,u0])}}function c0(l0){if(n0)throw new TypeError("Generator is already executing.");for(;s0;)try{if(n0=1,r0&&(i0=l0[0]&2?r0.return:l0[0]?r0.throw||((i0=r0.return)&&i0.call(r0),0):r0.next)&&!(i0=i0.call(r0,l0[1])).done)return i0;switch(r0=0,i0&&(l0=[l0[0]&2,i0.value]),l0[0]){case 0:case 1:i0=l0;break;case 4:return s0.label++,{value:l0[1],done:!1};case 5:s0.label++,r0=l0[1],l0=[0];continue;case 7:l0=s0.ops.pop(),s0.trys.pop();continue;default:if(i0=s0.trys,!(i0=i0.length>0&&i0[i0.length-1])&&(l0[0]===6||l0[0]===2)){s0=0;continue}if(l0[0]===3&&(!i0||l0[1]>i0[0]&&l0[1]<i0[3])){s0.label=l0[1];break}if(l0[0]===6&&s0.label<i0[1]){s0.label=i0[1],i0=l0;break}if(i0&&s0.label<i0[2]){s0.label=i0[2],s0.ops.push(l0);break}i0[2]&&s0.ops.pop(),s0.trys.pop();continue}l0=e0.call(t0,s0)}catch(u0){l0=[6,u0],r0=0}finally{n0=i0=0}if(l0[0]&5)throw l0[1];return{value:l0[0]?l0[1]:void 0,done:!0}}}function importNodeModule(t0){if(!t0)throw new Error("import specifier is required");var e0=new Function("name","return import(name)");return e0(t0).then(function(n0){return n0.default}).catch(function(n0){throw console.error("Error importing module ".concat(t0,":"),n0),n0})}function createScriptNode(url,cb,attrs,createScriptHook){if(createScriptHook){var hookResult=createScriptHook(url);hookResult&&typeof hookResult=="object"&&"url"in hookResult&&(url=hookResult.url)}var urlObj;try{urlObj=new URL(url)}catch(t0){console.error("Error constructing URL:",t0),cb(new Error("Invalid URL: ".concat(t0)));return}var getFetch=function(){var t0=_async_to_generator(function(){var e0;return _ts_generator(this,function(n0){switch(n0.label){case 0:return typeof fetch>"u"?[4,importNodeModule("node-fetch")]:[3,2];case 1:return e0=n0.sent(),[2,e0?.default||e0];case 2:return[2,fetch];case 3:return[2]}})});return function(){return t0.apply(this,arguments)}}();console.log("fetching",urlObj.href),getFetch().then(function(f){f(urlObj.href).then(function(t0){return t0.text()}).then(function(){var _ref=_async_to_generator(function(data){var _ref,path,vm,scriptContext,urlDirname,filename,script,exportedInterface,container;return _ts_generator(this,function(_state){switch(_state.label){case 0:return[4,Promise.all([importNodeModule("path"),importNodeModule("vm")])];case 1:_ref=_sliced_to_array.apply(void 0,[_state.sent(),2]),path=_ref[0],vm=_ref[1],scriptContext={exports:{},module:{exports:{}}},urlDirname=urlObj.pathname.split("/").slice(0,-1).join("/"),filename=path.basename(urlObj.pathname);try{if(script=new vm.Script("(function(exports, module, require, __dirname, __filename) {".concat(data,`
})`),filename),script.runInThisContext()(scriptContext.exports,scriptContext.module,eval("require"),urlDirname,filename),exportedInterface=scriptContext.module.exports||scriptContext.exports,attrs&&exportedInterface&&attrs.globalName)return container=exportedInterface[attrs.globalName]||exportedInterface,cb(void 0,container),[2];cb(void 0,exportedInterface)}catch(t0){cb(new Error("Script execution error: ".concat(t0)))}return[2]}})});return function(t0){return _ref.apply(this,arguments)}}()).catch(function(t0){cb(t0)})})}function loadScriptNode(t0,e0){return new Promise(function(n0,r0){createScriptNode(t0,function(i0,o0){if(i0)r0(i0);else{var s0,a0,c0=(e0==null||(s0=e0.attrs)===null||s0===void 0?void 0:s0.globalName)||"__FEDERATION_".concat(e0==null||(a0=e0.attrs)===null||a0===void 0?void 0:a0.name,":custom__"),l0=globalThis[c0]=o0;n0(l0)}},e0.attrs,e0.createScriptHook)})}function matchRemoteWithNameAndExpose(t0,e0){for(const n0 of t0){const r0=e0.startsWith(n0.name);let i0=e0.replace(n0.name,"");if(r0){if(i0.startsWith("/")){const a0=n0.name;return i0=`.${i0}`,{pkgNameOrAlias:a0,expose:i0,remote:n0}}else if(i0==="")return{pkgNameOrAlias:n0.name,expose:".",remote:n0}}const o0=n0.alias&&e0.startsWith(n0.alias);let s0=n0.alias&&e0.replace(n0.alias,"");if(n0.alias&&o0){if(s0&&s0.startsWith("/")){const a0=n0.alias;return s0=`.${s0}`,{pkgNameOrAlias:a0,expose:s0,remote:n0}}else if(s0==="")return{pkgNameOrAlias:n0.alias,expose:".",remote:n0}}}}function matchRemote(t0,e0){for(const n0 of t0)if(e0===n0.name||n0.alias&&e0===n0.alias)return n0}function registerPlugins(t0,e0){const n0=getGlobalHostPlugins();n0.length>0&&n0.forEach(r0=>{t0!=null&&t0.find(i0=>i0.name!==r0.name)&&t0.push(r0)}),t0&&t0.length>0&&t0.forEach(r0=>{e0.forEach(i0=>{i0.applyPlugin(r0)})})}function _extends$5(){return _extends$5=Object.assign||function(t0){for(var e0=1;e0<arguments.length;e0++){var n0=arguments[e0];for(var r0 in n0)Object.prototype.hasOwnProperty.call(n0,r0)&&(t0[r0]=n0[r0])}return t0},_extends$5.apply(this,arguments)}async function loadEsmEntry({entry:t0,remoteEntryExports:e0}){return new Promise((n0,r0)=>{try{e0?n0(e0):new Function("callbacks",`import("${t0}").then(callbacks[0]).catch(callbacks[1])`)([n0,r0])}catch(i0){r0(i0)}})}async function loadEntryScript({name:t0,globalName:e0,entry:n0,createScriptHook:r0}){const{entryExports:i0}=getRemoteEntryExports(t0,e0);return i0||(typeof document>"u"?loadScriptNode(n0,{attrs:{name:t0,globalName:e0},createScriptHook:r0}).then(()=>{const{remoteEntryKey:o0,entryExports:s0}=getRemoteEntryExports(t0,e0);return assert$2(s0,`
Unable to use the ${t0}'s '${n0}' URL with ${o0}'s globalName to get remoteEntry exports.
Possible reasons could be:
1. '${n0}' is not the correct URL, or the remoteEntry resource or name is incorrect.
2. ${o0} cannot be used to get remoteEntry exports in the window object.
`),s0}).catch(o0=>o0):loadScript(n0,{attrs:{},createScriptHook:r0}).then(()=>{const{remoteEntryKey:o0,entryExports:s0}=getRemoteEntryExports(t0,e0);return assert$2(s0,`
Unable to use the ${t0}'s '${n0}' URL with ${o0}'s globalName to get remoteEntry exports.
Possible reasons could be:
1. '${n0}' is not the correct URL, or the remoteEntry resource or name is incorrect.
2. ${o0} cannot be used to get remoteEntry exports in the window object.
`),s0}).catch(o0=>o0))}function getRemoteEntryUniqueKey(t0){const{entry:e0,name:n0}=t0;return composeKeyWithSeparator(n0,e0)}async function getRemoteEntry({remoteEntryExports:t0,remoteInfo:e0,createScriptHook:n0}){const{entry:r0,name:i0,type:o0,entryGlobalName:s0}=e0,a0=getRemoteEntryUniqueKey(e0);return t0||(globalLoading[a0]||(o0==="esm"?globalLoading[a0]=loadEsmEntry({entry:r0,remoteEntryExports:t0}):globalLoading[a0]=loadEntryScript({name:i0,globalName:s0,entry:r0,createScriptHook:n0})),globalLoading[a0])}function getRemoteInfo(t0){return _extends$5({},t0,{entry:"entry"in t0?t0.entry:"",type:t0.type||DEFAULT_REMOTE_TYPE,entryGlobalName:t0.entryGlobalName||t0.name,shareScope:t0.shareScope||DEFAULT_SCOPE})}function _extends$4(){return _extends$4=Object.assign||function(t0){for(var e0=1;e0<arguments.length;e0++){var n0=arguments[e0];for(var r0 in n0)Object.prototype.hasOwnProperty.call(n0,r0)&&(t0[r0]=n0[r0])}return t0},_extends$4.apply(this,arguments)}let Module=class{async getEntry(){if(this.remoteEntryExports)return this.remoteEntryExports;const t0=await getRemoteEntry({remoteInfo:this.remoteInfo,remoteEntryExports:this.remoteEntryExports,createScriptHook:e0=>{const n0=this.host.loaderHook.lifecycle.createScript.emit({url:e0});if(typeof document>"u"||n0 instanceof HTMLScriptElement)return n0}});return assert$2(t0,`remoteEntryExports is undefined
${safeToString$1(this.remoteInfo)}`),this.remoteEntryExports=t0,this.remoteEntryExports}async get(t0,e0){const{loadFactory:n0=!0}=e0||{loadFactory:!0},r0=await this.getEntry();if(!this.inited){const o0=this.host.shareScopeMap,s0=this.remoteInfo.shareScope||"default";o0[s0]||(o0[s0]={});const a0=o0[s0],c0=[],l0={version:this.remoteInfo.version||""};Object.defineProperty(l0,"hostId",{value:this.host.options.id||this.host.name,enumerable:!1});const u0=await this.host.hooks.lifecycle.beforeInitContainer.emit({shareScope:a0,remoteEntryInitOptions:l0,initScope:c0,remoteInfo:this.remoteInfo,origin:this.host});await r0.init(u0.shareScope,u0.initScope,u0.remoteEntryInitOptions),await this.host.hooks.lifecycle.initContainer.emit(_extends$4({},u0,{remoteEntryExports:r0}))}this.lib=r0,this.inited=!0;const i0=await r0.get(t0);return assert$2(i0,`${getFMId(this.remoteInfo)} remote don't export ${t0}.`),n0?await i0():i0}constructor({remoteInfo:t0,host:e0}){this.inited=!1,this.lib=void 0,this.remoteInfo=t0,this.host=e0}};class SyncHook{on(e0){typeof e0=="function"&&this.listeners.add(e0)}once(e0){const n0=this;this.on(function r0(...i0){return n0.remove(r0),e0.apply(null,i0)})}emit(...e0){let n0;return this.listeners.size>0&&this.listeners.forEach(r0=>{n0=r0(...e0)}),n0}remove(e0){this.listeners.delete(e0)}removeAll(){this.listeners.clear()}constructor(e0){this.type="",this.listeners=new Set,e0&&(this.type=e0)}}class AsyncHook extends SyncHook{emit(...e0){let n0;const r0=Array.from(this.listeners);if(r0.length>0){let i0=0;const o0=s0=>s0===!1?!1:i0<r0.length?Promise.resolve(r0[i0++].apply(null,e0)).then(o0):s0;n0=o0()}return Promise.resolve(n0)}}function checkReturnData(t0,e0){if(!isObject$2(e0))return!1;if(t0!==e0){for(const n0 in t0)if(!(n0 in e0))return!1}return!0}class SyncWaterfallHook extends SyncHook{emit(e0){isObject$2(e0)||error(`The data for the "${this.type}" hook should be an object.`);for(const n0 of this.listeners)try{const r0=n0(e0);if(checkReturnData(e0,r0))e0=r0;else{this.onerror(`A plugin returned an unacceptable value for the "${this.type}" type.`);break}}catch(r0){warn$1(r0),this.onerror(r0)}return e0}constructor(e0){super(),this.onerror=error,this.type=e0}}class AsyncWaterfallHook extends SyncHook{emit(e0){isObject$2(e0)||error(`The response data for the "${this.type}" hook must be an object.`);const n0=Array.from(this.listeners);if(n0.length>0){let r0=0;const i0=s0=>(warn$1(s0),this.onerror(s0),e0),o0=s0=>{if(checkReturnData(e0,s0)){if(e0=s0,r0<n0.length)try{return Promise.resolve(n0[r0++](e0)).then(o0,i0)}catch(a0){return i0(a0)}}else this.onerror(`A plugin returned an incorrect value for the "${this.type}" type.`);return e0};return Promise.resolve(o0(e0))}return Promise.resolve(e0)}constructor(e0){super(),this.onerror=error,this.type=e0}}class PluginSystem{applyPlugin(e0){assert$2(isPlainObject(e0),"Plugin configuration is invalid.");const n0=e0.name;assert$2(n0,"A name must be provided by the plugin."),this.registerPlugins[n0]||(this.registerPlugins[n0]=e0,Object.keys(this.lifecycle).forEach(r0=>{const i0=e0[r0];i0&&this.lifecycle[r0].on(i0)}))}removePlugin(e0){assert$2(e0,"A name is required.");const n0=this.registerPlugins[e0];assert$2(n0,`The plugin "${e0}" is not registered.`),Object.keys(n0).forEach(r0=>{r0!=="name"&&this.lifecycle[r0].remove(n0[r0])})}inherit({lifecycle:e0,registerPlugins:n0}){Object.keys(e0).forEach(r0=>{assert$2(!this.lifecycle[r0],`The hook "${r0}" has a conflict and cannot be inherited.`),