import{z as g,_ as k,A as v}from"./index.ab3d776b.js";import{r as S,e as P,d as E,F as C,j as l,R as I,l as L}from"./react.6693569e.js";import{S as D}from"./antd.e57bc55d.js";const p=window,a={},d={},m={};function f(t,s,e){typeof t!="string"&&(e=s,s=t,t=void 0),Array.isArray(s)||(e=s,s=void 0);const r=document.currentScript&&document.currentScript.src;t=t||r,t&&(a[t]={deps:s,factory:e,src:r,loaded:!1},d[t]&&(d[t].map(n=>n()),delete d[t]))}f.amd={pico:!0};function h(...t){let s=t.map(e=>new Promise((r,n)=>{if(e.charAt(0)==="!"&&(e=e.slice(1),delete a[e],delete m[e]),a[e]){const o=a[e];if(o.loaded)r(o.factory);else if(typeof o.factory=="function"){let i;o.deps?i=h(...o.deps):i=Promise.resolve([]),i.then(c=>{Array.isArray(c)||(c=[c]),o.factory=o.factory(...c),o.loaded=!0,r(o.factory)}).catch(n)}else o.loaded=!0,r(o.factory)}else if(/^\w+$/.test(e))d[e]=d[e]||[],d[e].push(()=>{h(e).then(r).catch(n)});else if(!m[e]){const o=document.createElement("script");typeof o.addEventListener<"u"?(o.addEventListener("load",()=>{const i=Object.keys(a).find(c=>a[c].src===o.src);i===void 0&&n(`module:${e} missing!`),h(i).then(r).catch(n),document.body.removeChild(o)}),o.src=e,o.async=!0,document.body.appendChild(o),m[e]=!0):n('Your browser is too OLD to run "pico" loader')}}));return s.length>1?Promise.all(s):s[0]}function O(...t){if(!p.define)p.define=f;else if(!p.define.amd||!p.define.amd.pico)throw new Error("Incompatible mix of defines found!");return h(...t)}class T{constructor(s){this.callbacks={},this.params=s,this.root={navigate:async(e,r)=>{window.location.href=e},goBack:()=>{window.history.back()},go:e=>{window.history.go(e)},refreshAccessToken:async()=>await g.refreshAccessToken(),setSession:async e=>{g.setSession(e)}}}on(s,e){this.callbacks[s]=e}off(s){delete this.callbacks[s]}}const $=T;f("react",I);f("react-dom",L);f("mobx",v);let b=Promise.resolve();const y={},w={};function R(t){return t.shadowRoot?t.shadowRoot:t.attachShadow?t.attachShadow({mode:"open"}):t}const G=[k(()=>import("./injectStyle.text.2bc96bb1.js"),[],import.meta.url).then(t=>String(t.default||t))],z=({uri:t,params:s,injectStyle:e,...r})=>{const n=S.exports.useRef(null);return S.exports.useEffect(()=>{const o=n.current;if(!!o)return b=b.then(async()=>{let i="";f("gpui-style-inject",()=>u=>{i+=`
`+u}),y[t]||(y[t]=await O(`!${t}`)),w[t]||(w[t]=i);const c=y[t],_=new $(s),x=[e,...await Promise.all(G),w[t]];return P.exports.render(E(C,{children:[x.map((u,A)=>u?l("style",{dangerouslySetInnerHTML:{__html:u}},A):null),c&&l(c,{gpui:_})]}),R(o)),Promise.resolve()}),()=>{P.exports.render(l("div",{}),R(o))}},[t,e,s]),l("div",{ref:n,...r,children:l(D,{spinning:!0})})};export{z as default};
