const vn="1.0.0-rc.24",rt=typeof window!="undefined",nr=typeof global!="undefined"?global:typeof window!="undefined"?window:typeof self!="undefined"?self:Function("return this")(),En=()=>!1,se=Array.isArray,Z=Object.assign,H=Object.defineProperty,k=Object.defineProperties,wn=Object.prototype.toString,ge=Object.prototype.hasOwnProperty,q=t=>wn.call(t);function pe(t){return t===void 0}function xe(t){return t===null}function B(t){return typeof t=="string"}function or(t){return typeof t=="boolean"}function pt(t){return typeof t=="number"}function R(t){return typeof t=="function"}function U(t){return q(t)==="[object Object]"}function An(t){return!xe(t)&&typeof t=="object"}function mt(t){return q(t)==="[object Promise]"}function bn(t){var e;return R(t)&&((e=t.name)===null||e===void 0?void 0:e.indexOf("bound "))===0&&!t.hasOwnProperty("prototype")}function nt(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 Pn(t){return typeof ShadowRoot!="undefined"&&t instanceof ShadowRoot}function ot(t){var e;return t instanceof URL||!!(!((e=t)===null||e===void 0)&&e.href)}function ce(t){var e;return t instanceof Element||B((e=t)===null||e===void 0?void 0:e.tagName)}function ye(t){var e;return t instanceof Node||pt((e=t)===null||e===void 0?void 0:e.nodeType)}function Rn(t){return q(t)==="[object HTMLAnchorElement]"}function Sn(t){return q(t)==="[object HTMLAudioElement]"}function yn(t){return q(t)==="[object HTMLVideoElement]"}function Mn(t){return q(t)==="[object HTMLLinkElement]"}function On(t){return q(t)==="[object HTMLBodyElement]"}function ir(t){return q(t)==="[object HTMLStyleElement]"}function be(t){return q(t)==="[object HTMLScriptElement]"}function Dn(t){return q(t)==="[object HTMLDivElement]"}function Cn(t){return q(t)==="[object HTMLImageElement]"}function In(t){return q(t)==="[object HTMLBaseElement]"}function ze(t){return q(t)==="[object DocumentFragment]"}function Ln(t){return q(t)==="[object ShadowRoot]"}function Ye(t){return ce(t)&&t.tagName.toUpperCase()==="MICRO-APP-BODY"}function Tn(t){return ce(t)&&t.tagName.toUpperCase()==="MICRO-APP-HEAD"}function xn(t){let e=q(t)==="[object HTMLElement]";if(e){const r=t.tagName.toUpperCase();e=e&&!r.startsWith("MICRO-APP")}return e}function Nn(t){return q(t)==="[object ProxyDocument]"}function sr(t,e){try{return W(t).pathname.split(".").pop()===e}catch{return!1}}function te(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 Pt(t){return t.startsWith("//")?`${nr.location.protocol}${t}`:t}function _t(t,e=null){if(!B(t)||!t)return"";try{const{origin:r,pathname:n,search:o}=W(Pt(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 it(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,it(Pt(e))).toString()}function Un(t){const e=t.split("/");return e.pop(),Pt(e.join("/")+"/")}function st(t,e,r,n){let o=0;function i(){++o===t.length&&n&&n()}t.forEach((s,a)=>{mt(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 Wn(){const t=document.createElement("script");return"noModule"in t}function Fn(){return"inline-"+Math.random().toString(36).substr(2,15)}function Hn(t){return t.filter(function(e){return e in this?!1:this[e]=!0},Object.create(null))}const at=nr.requestIdleCallback||function(t){const e=Date.now();return setTimeout(function(){t({didTimeout:!1,timeRemaining(){return Math.max(0,50-(Date.now()-e))}})},1)};function ar(t){return new Promise(e=>{at(()=>{t(e)})})}let Rt=null;function gt(t){Rt=t}function Q(){return Rt}function Ne(t){Rt!==t&&!Mt()&&(gt(t),ee(()=>{gt(null)}))}let St=null;function vt(t){St=t}function Ve(){return St}function yt(t){St!==t&&!Mt()&&(vt(t),ee(()=>{vt(null)}))}let Ce=!1;function Mt(){return Ce}function G(t){t!==!1?(gt(null),vt(null),t&&!Ce&&(Ce=!0,ee(()=>{Ce=!1}))):Ce=!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 he(t){return!t||/(^\d)|([^\w\d-_\u4e00-\u9fa5])/gi.test(t)}function Pe(t){return/^body$/i.test(t)||/^head$/i.test(t)||/^html$/i.test(t)||/^title$/i.test(t)||/^:root$/i.test(t)}function le(t){return Pn(t)?t.host:t}function ft(t){return t?t.replace(/^\s+|\s+$/g,""):""}function Wt(){return navigator.userAgent.indexOf("Firefox")>-1}function Ft(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];se(a)||(a=e[i]=[a]),a.push(s)}else e[i]=s}return e}function Je(t){let e="";for(const r in t){const n=t[r];xe(n)?e+=(e.length?"&":"")+r:(se(n)?n:[n]).forEach(i=>{pe(i)||(e+=(e.length?"&":"")+r,xe(i)||(e+="="+i))})}return e}function Ht(){const t=new Set;function e(r){return t.add(r),()=>t.has(r)?t.delete(r):!1}return{add:e,list:()=>t}}function jn(){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 Et(t){const e=t.attributes,r=new Map;for(let n=0;nar(r=>{e(),r()})):e()}function Ue(t){return(t==null?void 0:t.reduce((e,r)=>e.then(r),Promise.resolve()))||null}function We(t){return t.startsWith("inline-")}function jt(t,e,r,...n){try{R(t)&&t(...n)}catch(o){I(`An error occurred in app ${e} window.${r} `,null,o)}}function $n(t){for(;t!=null&&t.firstChild;)t.removeChild(t.firstChild)}function $t(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 Gn=["mounted","unmount"];function wt(t,e){return Gn.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 ue(t,e,r,n){var o;if(!t)return me(`element does not exist in lifecycle ${r}`,e);t=le(t),G();const i=Z({name:e,container:t},n&&{error:n}),s=new CustomEvent(r,{detail:i});qn(s,t),R((o=v.options.lifeCycles)===null||o===void 0?void 0:o[r])&&v.options.lifeCycles[r](s,e),t.dispatchEvent(s)}function oe(t,e,r={}){var n;const o=new CustomEvent(wt(e,t.name),{detail:r});(n=t.sandBox)===null||n===void 0||n.microAppWindow.dispatchEvent(o)}function ve(t,e=null,r={}){return G(),R(v.options.fetch)?v.options.fetch(t,r,e):window.fetch(t,r).then(n=>n.text())}class Ot{static getInstance(){return this.instance||(this.instance=new Ot),this.instance}run(e,r){const n=e.name,o=e.ssrUrl||e.url;(sr(o,"js")?Promise.resolve(`