const En="1.0.0-rc.27",nt=typeof window!="undefined",or=typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Function("return this")(),wn=()=>!1,ae=Array.isArray,Z=Object.assign,H=Object.defineProperty,k=Object.defineProperties,bn=Object.prototype.toString,ge=Object.prototype.hasOwnProperty,K=t=>bn.call(t);function me(t){return t===void 0}function Ne(t){return t===null}function B(t){return typeof t=="string"}function ir(t){return typeof t=="boolean"}function mt(t){return typeof t=="number"}function R(t){return typeof t=="function"}function U(t){return K(t)==="[object Object]"}function An(t){return!Ne(t)&&typeof t=="object"}function _t(t){return K(t)==="[object Promise]"}function Pn(t){var e;return R(t)&&((e=t.name)===null||e===void 0?void 0:e.indexOf("bound "))===0&&!t.hasOwnProperty("prototype")}function ot(t){var e;if(R(t)){const r=t.toString();return((e=t.prototype)===null||e===void 0?void 0:e.constructor)===t&&Object.getOwnPropertyNames(t.prototype).length>1||/^function\s+[A-Z]/.test(r)||/^class\s+/.test(r)}return!1}function Rn(t){return typeof ShadowRoot!="undefined"&&t instanceof ShadowRoot}function it(t){var e;return t instanceof URL||!!(!((e=t)===null||e===void 0)&&e.href)}function le(t){var e;return t instanceof Element||B((e=t)===null||e===void 0?void 0:e.tagName)}function Me(t){var e;return t instanceof Node||mt((e=t)===null||e===void 0?void 0:e.nodeType)}function Sn(t){return K(t)==="[object HTMLAnchorElement]"}function yn(t){return K(t)==="[object HTMLAudioElement]"}function Mn(t){return K(t)==="[object HTMLVideoElement]"}function On(t){return K(t)==="[object HTMLLinkElement]"}function Dn(t){return K(t)==="[object HTMLBodyElement]"}function sr(t){return K(t)==="[object HTMLStyleElement]"}function Pe(t){return K(t)==="[object HTMLScriptElement]"}function Cn(t){return K(t)==="[object HTMLDivElement]"}function In(t){return K(t)==="[object HTMLImageElement]"}function Ln(t){return K(t)==="[object HTMLBaseElement]"}function Ye(t){return K(t)==="[object DocumentFragment]"}function Tn(t){return K(t)==="[object ShadowRoot]"}function Je(t){return le(t)&&t.tagName.toUpperCase()==="MICRO-APP-BODY"}function xn(t){return le(t)&&t.tagName.toUpperCase()==="MICRO-APP-HEAD"}function Nn(t){let e=K(t)==="[object HTMLElement]";if(e){const r=t.tagName.toUpperCase();e=e&&!r.startsWith("MICRO-APP")}return e}function Bn(t){return K(t)==="[object ProxyDocument]"}function ar(t,e){try{return W(t).pathname.split(".").pop()===e}catch{return!1}}function re(t,e,r){if(t==null)throw new TypeError("includes target is null or undefined");const n=Object(t),o=parseInt(n.length,10)||0;if(o===0)return!1;r=parseInt(r,10)||0;let i=Math.max(r>=0?r:o+r,0);for(;ir?new t(""+e,r):new t(""+e)}();function Rt(t){return t.startsWith("//")?`${or.location.protocol}${t}`:t}function vt(t,e=null){if(!B(t)||!t)return"";try{const{origin:r,pathname:n,search:o}=W(Rt(t),(window.rawWindow||window).location.href),i=`${r}${n}${o}`;return/^https?:\/\//.test(i)?i:""}catch(r){return I(r,e),""}}function $(t){return!B(t)||!t?"":t.replace(/(^\d+)|([^\w\d-_])/gi,"")}function st(t){const{origin:e,pathname:r}=W(t);if(/\.(\w+)$/.test(r)){const n=`${e}${r}`.split("/");return n.pop(),n.join("/")+"/"}return`${e}${r}/`.replace(/\/\/$/,"/")}function X(t,e){return!t||/^((((ht|f)tps?)|file):)?\/\//.test(t)||/^(data|blob):/.test(t)?t:W(t,st(Rt(e))).toString()}function Wn(t){const e=t.split("/");return e.pop(),Rt(e.join("/")+"/")}function at(t,e,r,n){let o=0;function i(){++o===t.length&&n&&n()}t.forEach((s,a)=>{_t(s)?s.then(c=>{e({data:c,index:a}),i()}).catch(c=>{r({error:c,index:a}),i()}):(e({data:s,index:a}),i())})}function Fn(){const t=document.createElement("script");return"noModule"in t}function Hn(){return"inline-"+Math.random().toString(36).substr(2,15)}function jn(t){return t.filter(function(e){return e in this?!1:this[e]=!0},Object.create(null))}const ct=or.requestIdleCallback||function(t){const e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining(){return Math.max(0,50-(Date.now()-e))}})},1)};function cr(t){return new Promise(e=>{ct(()=>{t(e)})})}let St=null;function gt(t){St=t}function Q(){return St}function Be(t){St!==t&&!Ot()&&(gt(t),ee(()=>{gt(null)}))}let yt=null;function Et(t){yt=t}function Xe(){return yt}function Mt(t){yt!==t&&!Ot()&&(Et(t),ee(()=>{Et(null)}))}let Ie=!1;function Ot(){return Ie}function G(t){t!==!1?(gt(null),Et(null),t&&!Ie&&(Ie=!0,ee(()=>{Ie=!1}))):Ie=!1}function z(t,e){const r=(window.rawDocument||document).createElement(t,e);return r.__MICRO_APP_NAME__&&delete r.__MICRO_APP_NAME__,r.__PURE_ELEMENT__=!0,r}function de(t){return!t||/(^\d)|([^\w\d-_\u4e00-\u9fa5])/gi.test(t)}function Re(t){return/^body$/i.test(t)||/^head$/i.test(t)||/^html$/i.test(t)||/^title$/i.test(t)||/^:root$/i.test(t)}function ue(t){return Rn(t)?t.host:t}function pt(t){return t?t.replace(/^\s+|\s+$/g,""):""}function Ft(){return navigator.userAgent.indexOf("Firefox")>-1}function Ht(t){const e={},r=t.split("&");for(const n of r){const o=n.indexOf("="),i=o<0?n:n.slice(0,o),s=o<0?null:n.slice(o+1);if(i in e){let a=e[i];ae(a)||(a=e[i]=[a]),a.push(s)}else e[i]=s}return e}function Ze(t){let e="";for(const r in t){const n=t[r];Ne(n)?e+=(e.length?"&":"")+r:(ae(n)?n:[n]).forEach(i=>{me(i)||(e+=(e.length?"&":"")+r,Ne(i)||(e+="="+i))})}return e}function jt(){const t=new Set;function e(r){return t.add(r),()=>t.has(r)?t.delete(r):!1}return{add:e,list:()=>t}}function $n(){const t=new Map;function e(r,n){return t.set(r,n),()=>t.has(r)?t.delete(r):!1}return{add:e,get:r=>t.get(r),delete:r=>t.has(r)?t.delete(r):!1}}function wt(t){const e=t.attributes,r=new Map;for(let n=0;ncr(r=>{e(),r()})):e()}function We(t){return(t==null?void 0:t.reduce((e,r)=>e.then(r),Promise.resolve()))||null}function Fe(t){return t.startsWith("inline-")}function $t(t,e,r,...n){try{R(t)&&t(...n)}catch(o){I(`An error occurred in app ${e} window.${r} `,null,o)}}function Gn(t){for(;t!=null&&t.firstChild;)t.removeChild(t.firstChild)}function Gt(t,e){if(t==null)return!1;if(R(e)){if(typeof t=="number"||typeof t=="string"||typeof t=="boolean")return!1}else throw new TypeError("Right-hand side of 'instanceof' is not callable");let r=Object.getPrototypeOf(t);for(;r;){if(r===e.prototype)return!0;r=Object.getPrototypeOf(r)}return!1}const qn=["mounted","unmount"];function bt(t,e){return qn.includes(t)?`${t}-${e}`:t}function Kn(t){return U(t)?!Object.keys(t).length:!0}function Qn(t,e){Object.defineProperties(t,{currentTarget:{get(){return e}},target:{get(){return e}}})}function he(t,e,r,n){var o;if(!t)return _e(`element does not exist in lifecycle ${r}`,e);t=ue(t),G();const i=Z({name:e,container:t},n&&{error:n}),s=new CustomEvent(r,{detail:i});Qn(s,t),R((o=_.options.lifeCycles)===null||o===void 0?void 0:o[r])&&_.options.lifeCycles[r](s,e),t.dispatchEvent(s)}function ie(t,e,r={}){var n;const o=new CustomEvent(bt(e,t.name),{detail:r});(n=t.sandBox)===null||n===void 0||n.microAppWindow.dispatchEvent(o)}function Ee(t,e=null,r={}){return G(),R(_.options.fetch)?_.options.fetch(t,r,e):window.fetch(t,r).then(n=>n.text())}class Dt{static getInstance(){return this.instance||(this.instance=new Dt),this.instance}run(e,r){const n=e.name,o=e.ssrUrl||e.url;(ar(o,"js")?Promise.resolve(`