expxagents 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/dashboard/assets/{BufferResource-CovFyObI.js → BufferResource-n29YKExL.js} +1 -1
- package/dist/dashboard/assets/{CanvasRenderer-Cu9GjumS.js → CanvasRenderer-D8bxbxCc.js} +1 -1
- package/dist/dashboard/assets/{JarvisView-CIJSgHKf.js → JarvisView-BJqK_AFw.js} +1 -1
- package/dist/dashboard/assets/{RenderTargetSystem-D4UKdGHD.js → RenderTargetSystem-1alEUTh8.js} +1 -1
- package/dist/dashboard/assets/{WebGLRenderer-QLE6xf0w.js → WebGLRenderer-DBFowF-L.js} +1 -1
- package/dist/dashboard/assets/{WebGPURenderer-DxOAtpZ7.js → WebGPURenderer-Dhnyezst.js} +1 -1
- package/dist/dashboard/assets/{browserAll-CxsLh0vY.js → browserAll-CYuXG0tA.js} +1 -1
- package/dist/dashboard/assets/{index-Dyb-_BbG.js → index-DnPBs3Ux.js} +4 -4
- package/dist/dashboard/assets/{webworkerAll-BKu01pDB.js → webworkerAll-C-EDRe11.js} +1 -1
- package/dist/dashboard/index.html +1 -1
- package/dist/server/api/system-routes.d.ts.map +1 -1
- package/dist/server/api/system-routes.js +11 -0
- package/dist/server/api/system-routes.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-CYuXG0tA.js","assets/webworkerAll-C-EDRe11.js","assets/WebGPURenderer-Dhnyezst.js","assets/BufferResource-n29YKExL.js","assets/RenderTargetSystem-1alEUTh8.js","assets/WebGLRenderer-DBFowF-L.js","assets/CanvasRenderer-D8bxbxCc.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();const MO="modulepreload",RO=function(t){return"/"+t},LS={},Zd=function(e,n,i){let r=Promise.resolve();if(n&&n.length>0){let l=function(p){return Promise.all(p.map(m=>Promise.resolve(m).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const c=document.querySelector("meta[property=csp-nonce]"),d=(c==null?void 0:c.nonce)||(c==null?void 0:c.getAttribute("nonce"));r=l(n.map(p=>{if(p=RO(p),p in LS)return;LS[p]=!0;const m=p.endsWith(".css"),g=m?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${g}`))return;const b=document.createElement("link");if(b.rel=m?"stylesheet":MO,m||(b.as="script"),b.crossOrigin="",b.href=p,d&&b.setAttribute("nonce",d),document.head.appendChild(b),m)return new Promise((v,_)=>{b.addEventListener("load",v),b.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${p}`)))})}))}function s(l){const c=new Event("vite:preloadError",{cancelable:!0});if(c.payload=l,window.dispatchEvent(c),!c.defaultPrevented)throw l}return r.then(l=>{for(const c of l||[])c.status==="rejected"&&s(c.reason);return e().catch(s)})};function uu(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ix={exports:{}},qp={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react-jsx-runtime.production.js
|
|
@@ -58,7 +58,7 @@ Error generating stack: `+y.message+`
|
|
|
58
58
|
* @license MIT
|
|
59
59
|
*/var XS="popstate";function KS(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function jO(t={}){function e(i,r){var p;let s=(p=r.state)==null?void 0:p.masked,{pathname:l,search:c,hash:d}=s||i.location;return Nv("",{pathname:l,search:c,hash:d},r.state&&r.state.usr||null,r.state&&r.state.key||"default",s?{pathname:i.location.pathname,search:i.location.search,hash:i.location.hash}:void 0)}function n(i,r){return typeof r=="string"?r:Am(r)}return PO(e,n,null,t)}function Zn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function vl(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function HO(){return Math.random().toString(36).substring(2,10)}function $S(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function Nv(t,e,n=null,i,r){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?bh(e):e,state:n,key:e&&e.key||i||HO(),unstable_mask:r}}function Am({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function bh(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function PO(t,e,n,i={}){let{window:r=document.defaultView,v5Compat:s=!1}=i,l=r.history,c="POP",d=null,p=m();p==null&&(p=0,l.replaceState({...l.state,idx:p},""));function m(){return(l.state||{idx:null}).idx}function g(){c="POP";let C=m(),w=C==null?null:C-p;p=C,d&&d({action:c,location:A.location,delta:w})}function b(C,w){c="PUSH";let k=KS(C)?C:Nv(A.location,C,w);p=m()+1;let R=$S(k,p),O=A.createHref(k.unstable_mask||k);try{l.pushState(R,"",O)}catch(j){if(j instanceof DOMException&&j.name==="DataCloneError")throw j;r.location.assign(O)}s&&d&&d({action:c,location:A.location,delta:1})}function v(C,w){c="REPLACE";let k=KS(C)?C:Nv(A.location,C,w);p=m();let R=$S(k,p),O=A.createHref(k.unstable_mask||k);l.replaceState(R,"",O),s&&d&&d({action:c,location:A.location,delta:0})}function _(C){return GO(C)}let A={get action(){return c},get location(){return t(r,l)},listen(C){if(d)throw new Error("A history only accepts one active listener");return r.addEventListener(XS,g),d=C,()=>{r.removeEventListener(XS,g),d=null}},createHref(C){return e(r,C)},createURL:_,encodeLocation(C){let w=_(C);return{pathname:w.pathname,search:w.search,hash:w.hash}},push:b,replace:v,go(C){return l.go(C)}};return A}function GO(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Zn(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Am(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}function hC(t,e,n="/"){return FO(t,e,n,!1)}function FO(t,e,n,i){let r=typeof e=="string"?bh(e):e,s=ac(r.pathname||"/",n);if(s==null)return null;let l=pC(t);qO(l);let c=null;for(let d=0;c==null&&d<l.length;++d){let p=t3(s);c=JO(l[d],p,i)}return c}function pC(t,e=[],n=[],i="",r=!1){let s=(l,c,d=r,p)=>{let m={relativePath:p===void 0?l.path||"":p,caseSensitive:l.caseSensitive===!0,childrenIndex:c,route:l};if(m.relativePath.startsWith("/")){if(!m.relativePath.startsWith(i)&&d)return;Zn(m.relativePath.startsWith(i),`Absolute route path "${m.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),m.relativePath=m.relativePath.slice(i.length)}let g=ho([i,m.relativePath]),b=n.concat(m);l.children&&l.children.length>0&&(Zn(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),pC(l.children,e,b,g,d)),!(l.path==null&&!l.index)&&e.push({path:g,score:ZO(g,l.index),routesMeta:b})};return t.forEach((l,c)=>{var d;if(l.path===""||!((d=l.path)!=null&&d.includes("?")))s(l,c);else for(let p of mC(l.path))s(l,c,!0,p)}),e}function mC(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,r=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return r?[s,""]:[s];let l=mC(i.join("/")),c=[];return c.push(...l.map(d=>d===""?s:[s,d].join("/"))),r&&c.push(...l),c.map(d=>t.startsWith("/")&&d===""?"/":d)}function qO(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:QO(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var YO=/^:[\w-]+$/,VO=3,XO=2,KO=1,$O=10,WO=-2,WS=t=>t==="*";function ZO(t,e){let n=t.split("/"),i=n.length;return n.some(WS)&&(i+=WO),e&&(i+=XO),n.filter(r=>!WS(r)).reduce((r,s)=>r+(YO.test(s)?VO:s===""?KO:$O),i)}function QO(t,e){return t.length===e.length&&t.slice(0,-1).every((i,r)=>i===e[r])?t[t.length-1]-e[e.length-1]:0}function JO(t,e,n=!1){let{routesMeta:i}=t,r={},s="/",l=[];for(let c=0;c<i.length;++c){let d=i[c],p=c===i.length-1,m=s==="/"?e:e.slice(s.length)||"/",g=_0({path:d.relativePath,caseSensitive:d.caseSensitive,end:p},m),b=d.route;if(!g&&p&&n&&!i[i.length-1].route.index&&(g=_0({path:d.relativePath,caseSensitive:d.caseSensitive,end:!1},m)),!g)return null;Object.assign(r,g.params),l.push({params:r,pathname:ho([s,g.pathname]),pathnameBase:a3(ho([s,g.pathnameBase])),route:b}),g.pathnameBase!=="/"&&(s=ho([s,g.pathnameBase]))}return l}function _0(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=e3(t.path,t.caseSensitive,t.end),r=e.match(n);if(!r)return null;let s=r[0],l=s.replace(/(.)\/+$/,"$1"),c=r.slice(1);return{params:i.reduce((p,{paramName:m,isOptional:g},b)=>{if(m==="*"){let _=c[b]||"";l=s.slice(0,s.length-_.length).replace(/(.)\/+$/,"$1")}const v=c[b];return g&&!v?p[m]=void 0:p[m]=(v||"").replace(/%2F/g,"/"),p},{}),pathname:s,pathnameBase:l,pattern:t}}function e3(t,e=!1,n=!0){vl(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],r="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,c,d,p,m)=>{if(i.push({paramName:c,isOptional:d!=null}),d){let g=m.charAt(p+l.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),r+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?r+="\\/*$":t!==""&&t!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function t3(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return vl(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ac(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}var n3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function i3(t,e="/"){let{pathname:n,search:i="",hash:r=""}=typeof t=="string"?bh(t):t,s;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?s=ZS(n.substring(1),"/"):s=ZS(n,e)):s=e,{pathname:s,search:s3(i),hash:l3(r)}}function ZS(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(r=>{r===".."?n.length>1&&n.pop():r!=="."&&n.push(r)}),n.length>1?n.join("/"):"/"}function cx(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function r3(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function B_(t){let e=r3(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function X0(t,e,n,i=!1){let r;typeof t=="string"?r=bh(t):(r={...t},Zn(!r.pathname||!r.pathname.includes("?"),cx("?","pathname","search",r)),Zn(!r.pathname||!r.pathname.includes("#"),cx("#","pathname","hash",r)),Zn(!r.search||!r.search.includes("#"),cx("#","search","hash",r)));let s=t===""||r.pathname==="",l=s?"/":r.pathname,c;if(l==null)c=n;else{let g=e.length-1;if(!i&&l.startsWith("..")){let b=l.split("/");for(;b[0]==="..";)b.shift(),g-=1;r.pathname=b.join("/")}c=g>=0?e[g]:"/"}let d=i3(r,c),p=l&&l!=="/"&&l.endsWith("/"),m=(s||l===".")&&n.endsWith("/");return!d.pathname.endsWith("/")&&(p||m)&&(d.pathname+="/"),d}var ho=t=>t.join("/").replace(/\/\/+/g,"/"),a3=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),s3=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,l3=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,o3=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function c3(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function u3(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var gC=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function yC(t,e){let n=t;if(typeof n!="string"||!n3.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let i=n,r=!1;if(gC)try{let s=new URL(window.location.href),l=n.startsWith("//")?new URL(s.protocol+n):new URL(n),c=ac(l.pathname,e);l.origin===s.origin&&c!=null?n=c+l.search+l.hash:r=!0}catch{vl(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:i,isExternal:r,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var bC=["POST","PUT","PATCH","DELETE"];new Set(bC);var f3=["GET",...bC];new Set(f3);var xh=L.createContext(null);xh.displayName="DataRouter";var K0=L.createContext(null);K0.displayName="DataRouterState";var d3=L.createContext(!1),xC=L.createContext({isTransitioning:!1});xC.displayName="ViewTransition";var h3=L.createContext(new Map);h3.displayName="Fetchers";var p3=L.createContext(null);p3.displayName="Await";var as=L.createContext(null);as.displayName="Navigation";var Ym=L.createContext(null);Ym.displayName="Location";var _l=L.createContext({outlet:null,matches:[],isDataRoute:!1});_l.displayName="Route";var L_=L.createContext(null);L_.displayName="RouteError";var vC="REACT_ROUTER_ERROR",m3="REDIRECT",g3="ROUTE_ERROR_RESPONSE";function y3(t){if(t.startsWith(`${vC}:${m3}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function b3(t){if(t.startsWith(`${vC}:${g3}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new o3(e.status,e.statusText,e.data)}catch{}}function x3(t,{relative:e}={}){Zn(vh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=L.useContext(as),{hash:r,pathname:s,search:l}=Vm(t,{relative:e}),c=s;return n!=="/"&&(c=s==="/"?n:ho([n,s])),i.createHref({pathname:c,search:l,hash:r})}function vh(){return L.useContext(Ym)!=null}function Sl(){return Zn(vh(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(Ym).location}var _C="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function SC(t){L.useContext(as).static||L.useLayoutEffect(t)}function $0(){let{isDataRoute:t}=L.useContext(_l);return t?z3():v3()}function v3(){Zn(vh(),"useNavigate() may be used only in the context of a <Router> component.");let t=L.useContext(xh),{basename:e,navigator:n}=L.useContext(as),{matches:i}=L.useContext(_l),{pathname:r}=Sl(),s=JSON.stringify(B_(i)),l=L.useRef(!1);return SC(()=>{l.current=!0}),L.useCallback((d,p={})=>{if(vl(l.current,_C),!l.current)return;if(typeof d=="number"){n.go(d);return}let m=X0(d,JSON.parse(s),r,p.relative==="path");t==null&&e!=="/"&&(m.pathname=m.pathname==="/"?e:ho([e,m.pathname])),(p.replace?n.replace:n.push)(m,p.state,p)},[e,n,s,r,t])}var _3=L.createContext(null);function S3(t){let e=L.useContext(_l).outlet;return L.useMemo(()=>e&&L.createElement(_3.Provider,{value:t},e),[e,t])}function Vm(t,{relative:e}={}){let{matches:n}=L.useContext(_l),{pathname:i}=Sl(),r=JSON.stringify(B_(n));return L.useMemo(()=>X0(t,JSON.parse(r),i,e==="path"),[t,r,i,e])}function E3(t,e){return EC(t,e)}function EC(t,e,n){var C;Zn(vh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:i}=L.useContext(as),{matches:r}=L.useContext(_l),s=r[r.length-1],l=s?s.params:{},c=s?s.pathname:"/",d=s?s.pathnameBase:"/",p=s&&s.route;{let w=p&&p.path||"";TC(c,!p||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${c}" (under <Route path="${w}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
60
|
|
|
61
|
-
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let m=Sl(),g;if(e){let w=typeof e=="string"?bh(e):e;Zn(d==="/"||((C=w.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=m;let b=g.pathname||"/",v=b;if(d!=="/"){let w=d.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let _=hC(t,{pathname:v});vl(p||_!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),vl(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=M3(_&&_.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ho([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:ho([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),r,n);return e&&A?L.createElement(Ym.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},A):A}function w3(){let t=D3(),e=c3(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:s},"ErrorBoundary")," or"," ",L.createElement("code",{style:s},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),n?L.createElement("pre",{style:r},n):null,l)}var T3=L.createElement(w3,null),wC=class extends L.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=b3(t.digest);n&&(t=n)}let e=t!==void 0?L.createElement(_l.Provider,{value:this.props.routeContext},L.createElement(L_.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?L.createElement(C3,{error:t},e):e}};wC.contextType=d3;var ux=new WeakMap;function C3({children:t,error:e}){let{basename:n}=L.useContext(as);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=y3(e.digest);if(i){let r=ux.get(e);if(r)throw r;let s=yC(i.location,n);if(gC&&!ux.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw ux.set(e,l),l}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function A3({routeContext:t,match:e,children:n}){let i=L.useContext(xh);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),L.createElement(_l.Provider,{value:t},n)}function M3(t,e=[],n){let i=n==null?void 0:n.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i==null?void 0:i.errors;if(s!=null){let m=r.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Zn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let l=!1,c=-1;if(n&&i){l=i.renderFallback;for(let m=0;m<r.length;m++){let g=r[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:b,errors:v}=i,_=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||_){n.isStatic&&(l=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let d=n==null?void 0:n.onError,p=i&&d?(m,g)=>{var b,v;d(m,{location:i.location,params:((v=(b=i.matches)==null?void 0:b[0])==null?void 0:v.params)??{},unstable_pattern:u3(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,b)=>{let v,_=!1,A=null,C=null;i&&(v=s&&g.route.id?s[g.route.id]:void 0,A=g.route.errorElement||T3,l&&(c<0&&b===0?(TC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,C=null):c===b&&(_=!0,C=g.route.hydrateFallbackElement||null)));let w=e.concat(r.slice(0,b+1)),k=()=>{let R;return v?R=A:_?R=C:g.route.Component?R=L.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=m,L.createElement(A3,{match:g,routeContext:{outlet:m,matches:w,isDataRoute:i!=null},children:R})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?L.createElement(wC,{location:i.location,revalidation:i.revalidation,component:A,error:v,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):k()},null)}function U_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function R3(t){let e=L.useContext(xh);return Zn(e,U_(t)),e}function N3(t){let e=L.useContext(K0);return Zn(e,U_(t)),e}function k3(t){let e=L.useContext(_l);return Zn(e,U_(t)),e}function I_(t){let e=k3(t),n=e.matches[e.matches.length-1];return Zn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function O3(){return I_("useRouteId")}function D3(){var i;let t=L.useContext(L_),e=N3("useRouteError"),n=I_("useRouteError");return t!==void 0?t:(i=e.errors)==null?void 0:i[n]}function z3(){let{router:t}=R3("useNavigate"),e=I_("useNavigate"),n=L.useRef(!1);return SC(()=>{n.current=!0}),L.useCallback(async(r,s={})=>{vl(n.current,_C),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var QS={};function TC(t,e,n){!e&&!QS[t]&&(QS[t]=!0,vl(!1,n))}L.memo(B3);function B3({routes:t,future:e,state:n,isStatic:i,onError:r}){return EC(t,void 0,{state:n,isStatic:i,onError:r})}function L3({to:t,replace:e,state:n,relative:i}){Zn(vh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=L.useContext(as);vl(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=L.useContext(_l),{pathname:l}=Sl(),c=$0(),d=X0(t,B_(s),l,i==="path"),p=JSON.stringify(d);return L.useEffect(()=>{c(JSON.parse(p),{replace:e,state:n,relative:i})},[c,p,i,e,n]),null}function JS(t){return S3(t.context)}function Ca(t){Zn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function U3({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Zn(!vh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),d=L.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=bh(n));let{pathname:p="/",search:m="",hash:g="",state:b=null,key:v="default",unstable_mask:_}=n,A=L.useMemo(()=>{let C=ac(p,c);return C==null?null:{location:{pathname:C,search:m,hash:g,state:b,key:v,unstable_mask:_},navigationType:i}},[c,p,m,g,b,v,i,_]);return vl(A!=null,`<Router basename="${c}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:L.createElement(as.Provider,{value:d},L.createElement(Ym.Provider,{children:e,value:A}))}function I3({children:t,location:e}){return E3(kv(t),e)}function kv(t,e=[]){let n=[];return L.Children.forEach(t,(i,r)=>{if(!L.isValidElement(i))return;let s=[...e,r];if(i.type===L.Fragment){n.push.apply(n,kv(i.props.children,s));return}Zn(i.type===Ca,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Zn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=kv(i.props.children,s)),n.push(l)}),n}var u0="get",f0="application/x-www-form-urlencoded";function W0(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function j3(t){return W0(t)&&t.tagName.toLowerCase()==="button"}function H3(t){return W0(t)&&t.tagName.toLowerCase()==="form"}function P3(t){return W0(t)&&t.tagName.toLowerCase()==="input"}function G3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function F3(t,e){return t.button===0&&(!e||e==="_self")&&!G3(t)}var Ey=null;function q3(){if(Ey===null)try{new FormData(document.createElement("form"),0),Ey=!1}catch{Ey=!0}return Ey}var Y3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fx(t){return t!=null&&!Y3.has(t)?(vl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${f0}"`),null):t}function V3(t,e){let n,i,r,s,l;if(H3(t)){let c=t.getAttribute("action");i=c?ac(c,e):null,n=t.getAttribute("method")||u0,r=fx(t.getAttribute("enctype"))||f0,s=new FormData(t)}else if(j3(t)||P3(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(i=d?ac(d,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||u0,r=fx(t.getAttribute("formenctype"))||fx(c.getAttribute("enctype"))||f0,s=new FormData(c,t),!q3()){let{name:p,type:m,value:g}=t;if(m==="image"){let b=p?`${p}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else p&&s.append(p,g)}}else{if(W0(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=u0,i=null,r=f0,l=t}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j_(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function X3(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&ac(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function K3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function W3(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let l=await K3(s,n);return l.links?l.links():[]}return[]}));return eD(i.flat(1).filter($3).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function eE(t,e,n,i,r,s){let l=(d,p)=>n[p]?d.route.id!==n[p].route.id:!0,c=(d,p)=>{var m;return n[p].pathname!==d.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,p)=>l(d,p)||c(d,p)):s==="data"?e.filter((d,p)=>{var g;let m=i.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,p)||c(d,p))return!0;if(d.route.shouldRevalidate){let b=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Z3(t,e,{includeHydrateFallback:n}={}){return Q3(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Q3(t){return[...new Set(t)]}function J3(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function eD(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(J3(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function CC(){let t=L.useContext(xh);return j_(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function tD(){let t=L.useContext(K0);return j_(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var H_=L.createContext(void 0);H_.displayName="FrameworkContext";function AC(){let t=L.useContext(H_);return j_(t,"You must render this element inside a <HydratedRouter> element"),t}function nD(t,e){let n=L.useContext(H_),[i,r]=L.useState(!1),[s,l]=L.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=e,b=L.useRef(null);L.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let A=w=>{w.forEach(k=>{l(k.isIntersecting)})},C=new IntersectionObserver(A,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[t]),L.useEffect(()=>{if(i){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[i]);let v=()=>{r(!0)},_=()=>{r(!1),l(!1)};return n?t!=="intent"?[s,b,{}]:[s,b,{onFocus:Vp(c,v),onBlur:Vp(d,_),onMouseEnter:Vp(p,v),onMouseLeave:Vp(m,_),onTouchStart:Vp(g,v)}]:[!1,b,{}]}function Vp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function iD({page:t,...e}){let{router:n}=CC(),i=L.useMemo(()=>hC(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?L.createElement(aD,{page:t,matches:i,...e}):null}function rD(t){let{manifest:e,routeModules:n}=AC(),[i,r]=L.useState([]);return L.useEffect(()=>{let s=!1;return W3(t,e,n).then(l=>{s||r(l)}),()=>{s=!0}},[t,e,n]),i}function aD({page:t,matches:e,...n}){let i=Sl(),{future:r,manifest:s,routeModules:l}=AC(),{basename:c}=CC(),{loaderData:d,matches:p}=tD(),m=L.useMemo(()=>eE(t,e,p,s,i,"data"),[t,e,p,s,i]),g=L.useMemo(()=>eE(t,e,p,s,i,"assets"),[t,e,p,s,i]),b=L.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let A=new Set,C=!1;if(e.forEach(k=>{var O;let R=s.routes[k.route.id];!R||!R.hasLoader||(!m.some(j=>j.route.id===k.route.id)&&k.route.id in d&&((O=l[k.route.id])!=null&&O.shouldRevalidate)||R.hasClientLoader?C=!0:A.add(k.route.id))}),A.size===0)return[];let w=X3(t,c,r.unstable_trailingSlashAwareDataRequests,"data");return C&&A.size>0&&w.searchParams.set("_routes",e.filter(k=>A.has(k.route.id)).map(k=>k.route.id).join(",")),[w.pathname+w.search]},[c,r.unstable_trailingSlashAwareDataRequests,d,i,s,m,e,t,l]),v=L.useMemo(()=>Z3(g,s),[g,s]),_=rD(g);return L.createElement(L.Fragment,null,b.map(A=>L.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),v.map(A=>L.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),_.map(({key:A,link:C})=>L.createElement("link",{key:A,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function sD(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var lD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lD&&(window.__reactRouterVersion="7.13.1")}catch{}function oD({basename:t,children:e,unstable_useTransitions:n,window:i}){let r=L.useRef();r.current==null&&(r.current=jO({window:i,v5Compat:!0}));let s=r.current,[l,c]=L.useState({action:s.action,location:s.location}),d=L.useCallback(p=>{n===!1?c(p):L.startTransition(()=>c(p))},[n]);return L.useLayoutEffect(()=>s.listen(d),[s,d]),L.createElement(U3,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var MC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RC=L.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,unstable_mask:c,state:d,target:p,to:m,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:v,..._},A){let{basename:C,navigator:w,unstable_useTransitions:k}=L.useContext(as),R=typeof m=="string"&&MC.test(m),O=yC(m,C);m=O.to;let j=x3(m,{relative:r}),D=Sl(),G=null;if(c){let $=X0(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&($.pathname=$.pathname==="/"?C:ho([C,$.pathname])),G=w.createHref($)}let[W,P,I]=nD(i,_),K=fD(m,{replace:l,unstable_mask:c,state:d,target:p,preventScrollReset:g,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:v,unstable_useTransitions:k});function q($){e&&e($),$.defaultPrevented||K($)}let te=!(O.isExternal||s),H=L.createElement("a",{..._,...I,href:(te?G:void 0)||O.absoluteURL||j,onClick:te?q:e,ref:sD(A,P),target:p,"data-discover":!R&&n==="render"?"true":void 0});return W&&!R?L.createElement(L.Fragment,null,H,L.createElement(iD,{page:j})):H});RC.displayName="Link";var NC=L.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:c,children:d,...p},m){let g=Vm(l,{relative:p.relative}),b=Sl(),v=L.useContext(K0),{navigator:_,basename:A}=L.useContext(as),C=v!=null&&gD(g)&&c===!0,w=_.encodeLocation?_.encodeLocation(g).pathname:g.pathname,k=b.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(k=k.toLowerCase(),R=R?R.toLowerCase():null,w=w.toLowerCase()),R&&A&&(R=ac(R,A)||R);const O=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let j=k===w||!r&&k.startsWith(w)&&k.charAt(O)==="/",D=R!=null&&(R===w||!r&&R.startsWith(w)&&R.charAt(w.length)==="/"),G={isActive:j,isPending:D,isTransitioning:C},W=j?e:void 0,P;typeof i=="function"?P=i(G):P=[i,j?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(G):s;return L.createElement(RC,{...p,"aria-current":W,className:P,ref:m,style:I,to:l,viewTransition:c},typeof d=="function"?d(G):d)});NC.displayName="NavLink";var cD=L.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:l=u0,action:c,onSubmit:d,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b,...v},_)=>{let{unstable_useTransitions:A}=L.useContext(as),C=pD(),w=mD(c,{relative:p}),k=l.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&MC.test(c),O=j=>{if(d&&d(j),j.defaultPrevented)return;j.preventDefault();let D=j.nativeEvent.submitter,G=(D==null?void 0:D.getAttribute("formmethod"))||l,W=()=>C(D||j.currentTarget,{fetcherKey:e,method:G,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b});A&&n!==!1?L.startTransition(()=>W()):W()};return L.createElement("form",{ref:_,method:k,action:w,onSubmit:i?d:O,...v,"data-discover":!R&&t==="render"?"true":void 0})});cD.displayName="Form";function uD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kC(t){let e=L.useContext(xh);return Zn(e,uD(t)),e}function fD(t,{target:e,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:p}={}){let m=$0(),g=Sl(),b=Vm(t,{relative:l});return L.useCallback(v=>{if(F3(v,e)){v.preventDefault();let _=n!==void 0?n:Am(g)===Am(b),A=()=>m(t,{replace:_,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d});p?L.startTransition(()=>A()):A()}},[g,m,b,n,i,r,e,t,s,l,c,d,p])}var dD=0,hD=()=>`__${String(++dD)}__`;function pD(){let{router:t}=kC("useSubmit"),{basename:e}=L.useContext(as),n=O3(),i=t.fetch,r=t.navigate;return L.useCallback(async(s,l={})=>{let{action:c,method:d,encType:p,formData:m,body:g}=V3(s,e);if(l.navigate===!1){let b=l.fetcherKey||hD();await i(b,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,flushSync:l.flushSync})}else await r(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,n])}function mD(t,{relative:e}={}){let{basename:n}=L.useContext(as),i=L.useContext(_l);Zn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Vm(t||".",{relative:e})},l=Sl();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ho([n,s.pathname])),Am(s)}function gD(t,{relative:e}={}){let n=L.useContext(xC);Zn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=kC("useViewTransitionState"),r=Vm(t,{relative:e});if(!n.isTransitioning)return!1;let s=ac(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=ac(n.nextLocation.pathname,i)||n.nextLocation.pathname;return _0(r.pathname,l)!=null||_0(r.pathname,s)!=null}dC();const tE=t=>{let e;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(e):p;if(!Object.is(g,e)){const b=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,b))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=e=t(i,r,c);return c},yD=(t=>t?tE(t):tE),bD=t=>t;function xD(t,e=bD){const n=cm.useSyncExternalStore(t.subscribe,cm.useCallback(()=>e(t.getState()),[t,e]),cm.useCallback(()=>e(t.getInitialState()),[t,e]));return cm.useDebugValue(n),n}const nE=t=>{const e=yD(t),n=i=>xD(e,i);return Object.assign(n,e),n},Tf=(t=>t?nE(t):nE),ml=Tf(t=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(e,n)=>{t({loading:!0,error:null});try{const i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n}),credentials:"include"}),r=await i.json();if(!i.ok){t({loading:!1,error:r.error||"Login failed"});return}t({user:r.user,isAuthenticated:!0,loading:!1,error:null})}catch{t({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}t({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{t({loading:!0});try{const e=await fetch("/api/auth/me",{credentials:"include"});if(e.ok){const n=await e.json();t({user:n.user,isAuthenticated:!0,loading:!1})}else t({user:null,isAuthenticated:!1,loading:!1})}catch{t({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>t({user:null,isAuthenticated:!1,loading:!1,error:null})})),es=Tf((t,e)=>({squads:[],selectedSquad:null,activeStates:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const i=await n.json();t({squads:i.squads})}}catch{}},selectSquad:n=>t({selectedSquad:n}),setSquadState:(n,i)=>t(r=>({activeStates:{...r.activeStates,[n]:i}})),clearSquadState:n=>t(i=>{const{[n]:r,...s}=i.activeStates;return{activeStates:s}}),reset:()=>t({squads:[],selectedSquad:null,activeStates:{}})}));let vD=0;function iE(){return`local-${Date.now()}-${++vD}`}const ar=Tf((t,e)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:iE(),role:"user",content:n,createdAt:new Date().toISOString()};t(r=>{const s=r.conversationId,l=s&&!r.messages.some(c=>c.role==="user")?r.conversations.map(c=>c.id===s?{...c,preview:n.slice(0,80)}:c):r.conversations;return{messages:[...r.messages,i],error:null,conversations:l}})},setConversationId:n=>{t({conversationId:n})},startStreaming:()=>{t({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n,activity:null}))},setActivity:n=>{t({activity:n})},finishStreaming:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const i={id:iE(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};t(r=>({messages:[...r.messages,i]}))},setError:n=>{t({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,createdAt:l.created_at,preview:""}));for(const l of s)try{const c=await fetch(`/api/conversations/${l.id}/messages?limit=1`,{credentials:"include"});if(c.ok){const p=((await c.json()).data||[])[0];p&&(l.preview=p.content.slice(0,80))}}catch{}t({conversations:s})}catch{}},selectConversation:async n=>{t({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const i=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,role:l.role,content:l.content,agentId:l.agent_id??void 0,agentName:l.agent_name??void 0,createdAt:l.created_at}));t({messages:s})}catch{}},deleteConversation:async(n,i)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:s}=e();t(l=>({conversations:l.conversations.filter(c=>c.id!==n)})),s===n&&t({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const r=await i.json();if(!r.data||r.data.length===0){t({conversationId:null,messages:[],conversations:[]});return}const s=(r.data||[]).map(g=>({id:g.id,createdAt:g.created_at,preview:""})),l=r.data[0];t({conversationId:l.id,conversations:s});const c=await fetch(`/api/conversations/${l.id}/messages`,{credentials:"include"});if(!c.ok)return;const p=((await c.json()).data||[]).map(g=>({id:g.id,role:g.role,content:g.content,agentId:g.agent_id??void 0,agentName:g.agent_name??void 0,createdAt:g.created_at})),m=p.find(g=>g.role==="user");if(m){const g=s.findIndex(b=>b.id===l.id);g>=0&&(s[g].preview=m.content.slice(0,80))}t({messages:p,conversations:s});for(const g of s)if(g.id!==l.id)try{const b=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(b.ok){const _=((await b.json()).data||[])[0];_&&(g.preview=_.content.slice(0,80))}}catch{}t({conversations:[...s]})}catch{}},reset:()=>t({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function _D(t){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,i=new WebSocket(n),r=[];let s=!0;function l(c){i.readyState===WebSocket.OPEN?i.send(JSON.stringify(c)):i.readyState===WebSocket.CONNECTING&&r.push(c)}return i.onopen=()=>{var c,d;s||(d=(c=t.current).onReconnect)==null||d.call(c),s=!1;for(const p of r)i.send(JSON.stringify(p));r.length=0},i.onmessage=c=>{var d,p,m,g,b,v,_,A,C,w,k,R,O,j,D,G,W;try{const P=JSON.parse(c.data),I=t.current;switch(P.type){case"squad:state":(d=I.onSquadState)==null||d.call(I,P.squadName,P.state);break;case"squad:inactive":(p=I.onSquadInactive)==null||p.call(I,P.squadName,P.reason);break;case"chat:chunk":(m=I.onChatChunk)==null||m.call(I,P.squadName,P.conversationId,P.delta);break;case"chat:activity":(g=I.onChatActivity)==null||g.call(I,P.squadName,P.tool,P.summary);break;case"chat:done":(b=I.onChatDone)==null||b.call(I,P.squadName,P.conversationId,P.messageId);break;case"chat:error":(v=I.onChatError)==null||v.call(I,P.squadName,P.error);break;case"chat:agent_dm":(_=I.onChatAgentDm)==null||_.call(I,P.squadName,P.conversationId,P.agentId,P.agentName,P.message);break;case"chat:conversation_created":(A=I.onChatConversationCreated)==null||A.call(I,P.squadName,P.conversationId);break;case"agent:output_chunk":(C=I.onAgentOutputChunk)==null||C.call(I,P.squadName,P.agentId,P.agentName,P.delta);break;case"agent:step_start":(w=I.onAgentStepStart)==null||w.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"agent:step_complete":(k=I.onAgentStepComplete)==null||k.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"squad:checkpoint":(R=I.onSquadCheckpoint)==null||R.call(I,P.squadName,P.agentId,P.agentName,P.question);break;case"schedule:started":(O=I.onScheduleStarted)==null||O.call(I,P.squadName,P.jobId,P.attempt);break;case"schedule:chunk":(j=I.onScheduleChunk)==null||j.call(I,P.squadName,P.jobId,P.delta);break;case"schedule:done":(D=I.onScheduleDone)==null||D.call(I,P.squadName,P.jobId,P.summary,P.attempt);break;case"schedule:error":(G=I.onScheduleError)==null||G.call(I,P.squadName,P.jobId,P.error,P.attempt,P.willRetry);break;case"schedule:status_changed":(W=I.onScheduleStatusChanged)==null||W.call(I,P.squadName,P.status);break}}catch{}},{subscribe:c=>{l({type:"squad:subscribe",squadName:c})},unsubscribe:c=>{l({type:"squad:unsubscribe",squadName:c})},sendChat:(c,d,p)=>{const m={type:"chat:send",squadName:c,message:d};p&&p.length>0&&(m.files=p),l(m)},newConversation:c=>{l({type:"chat:new_conversation",squadName:c})},sendCheckpointResponse:(c,d)=>{l({type:"squad:checkpoint_response",squadName:c,answer:d})},disconnect:()=>{i.close()}}}function SD(t={}){const e=L.useRef(null),n=L.useRef(t),i=L.useRef(new Set);n.current=t,L.useEffect(()=>{const p=_D(n);e.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=L.useCallback(p=>{var m;i.current.add(p),(m=e.current)==null||m.subscribe(p)},[]),s=L.useCallback(p=>{var m;i.current.delete(p),(m=e.current)==null||m.unsubscribe(p)},[]),l=L.useCallback((p,m,g)=>{var b;(b=e.current)==null||b.sendChat(p,m,g)},[]),c=L.useCallback(p=>{var m;(m=e.current)==null||m.newConversation(p)},[]),d=L.useCallback((p,m)=>{var g;(g=e.current)==null||g.sendCheckpointResponse(p,m)},[]);return{subscribe:r,unsubscribe:s,sendChat:l,newConversation:c,sendCheckpointResponse:d}}function ED(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60,r=s=>s.toString().padStart(2,"0");return e>0?`${e}h ${r(n)}m ${r(i)}s`:`${n}m ${r(i)}s`}function wD({state:t}){const[e,n]=L.useState(0);return L.useEffect(()=>{if(!(t!=null&&t.startedAt)||t.status!=="running"){n(0);return}const i=new Date(t.startedAt).getTime(),r=()=>n(Math.floor((Date.now()-i)/1e3));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[t==null?void 0:t.startedAt,t==null?void 0:t.status]),T.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:t?T.jsxs(T.Fragment,{children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[T.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.status==="running"?"var(--status-active)":t.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:t.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:t.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),T.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",t.step.current,"/",t.step.total]}),T.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),T.jsx("span",{children:t.step.label})]}),T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[t.handoff&&T.jsxs("span",{style:{color:"var(--accent)"},children:[t.handoff.from," → ",t.handoff.to]}),t.status==="running"&&T.jsx("span",{style:{color:"var(--text-secondary)"},children:ED(e)})]})]}):T.jsxs(T.Fragment,{children:[T.jsx("span",{children:"Ready"}),T.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let Ov=null;function TD(t){Ov=t}function OC(t,e,n){Ov&&Ov(t,e,n)}let Dv=null;function CD(t){Dv=t}function AD(t){Dv&&Dv(t)}let zv=null;function MD(t){zv=t}function RD(t,e){zv&&zv(t,e)}const d0=32,fl=96,nu=64,pt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},Bv=[5227511,5025616,16750592,15022389,9315498,16771899],ND={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Br={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},Ka={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},hf={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},ru={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},sa={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},wa={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},nh={wall:7901340,wallHighlight:10795204,doorFrame:6111287},rr={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},Ta={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},Jo=480,Za=360,tf=400,qi=60,$a=120,dx=120,rE=160,aE=120,sE=160,kD=64,OD=80,DD=fl+32,zD=nu+48,lE=2,DC=10,$o=80;function wy(t,e,n){const i=Math.max(0,Math.min(1,n));return t+(e-t)*i}function BD(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}const LD=["nw","ne","sw","se"],UD={nw:"right",ne:"left",sw:"top",se:"top"};function S0(t){const e=DC,n=Math.max(1,t),i={nw:0,ne:0,sw:0,se:0},r=[];for(let Q=0;Q<n;Q++){const F=LD[Q%4];r.push({quadrant:F,slot:i[F]}),i[F]++}const s=Math.max(1,i.nw),l=Math.max(1,i.ne),c=Math.max(1,i.sw),d=Math.max(1,i.se),p=Math.max(tf,$a),m=s*(Za+e),g=l*(Za+e),b=Math.max(m+p,g+$a),v=c*(Za+e),_=d*(Za+e),A=Math.max(rE,sE),C=Math.max(v+A+e,_+A+e),w=Math.max(Jo,$a+e+tf),k=Math.max(Jo,$a),R=Math.max(Jo,dx),O=Math.max(Jo,aE),j=Math.max(w,R),D=Math.max(k,O),G=e+j+e+qi+e+D+e,W=e+b+e+qi+e+C+e,P={x:e+j+e,y:e,width:qi,height:W-2*e},I={x:e,y:e+b+e,width:G-2*e,height:qi},K={x:P.x+P.width/2,y:I.y+I.height/2},q={x:P.x-e-tf,y:I.y-e-tf,width:tf,height:tf},te={x:q.x-e-$a,y:I.y-e-$a,width:$a,height:$a},H={x:P.x+qi+e,y:I.y-e-$a,width:$a,height:$a},$={x:P.x-e-dx,y:I.y+qi+e+c*(Za+e),width:dx,height:rE},B={x:P.x+qi+e,y:I.y+qi+e+d*(Za+e),width:aE,height:sE},X=[],Z={};for(let Q=0;Q<n;Q++){const{quadrant:F,slot:Y}=r[Q],ee=UD[F];let V;F==="nw"?V={x:P.x-e-Jo,y:q.y-e-(Y+1)*Za-Y*e}:F==="ne"?V={x:P.x+qi+e,y:H.y-e-(Y+1)*Za-Y*e}:F==="sw"?V={x:P.x-e-Jo,y:I.y+qi+e+Y*(Za+e)}:V={x:P.x+qi+e,y:I.y+qi+e+Y*(Za+e)},X.push({origin:V,width:Jo,height:Za,quadrant:F,doorSide:ee}),ee==="right"||ee==="left"?Z[`squad-${Q}`]={x:P.x+qi/2,y:V.y+Za/2}:Z[`squad-${Q}`]={x:V.x+Jo/2,y:I.y+qi/2}}return Z.ceo={x:P.x+qi/2,y:q.y+tf/2},Z["bathroom-male"]={x:te.x+$a/2,y:I.y+qi/2},Z["bathroom-female"]={x:H.x+$a/2,y:I.y+qi/2},Z.kitchen={x:P.x+qi/2,y:$.y+$.height/2},Z["rest-area"]={x:P.x+qi/2,y:B.y+B.height/2},{totalWidth:G,totalHeight:W,squadOrigins:X,ceoOffice:q,corridorH:I,corridorV:P,bathroomMale:te,bathroomFemale:H,kitchen:$,restArea:B,doorPoints:Z,corridorHub:K}}function Qd(t,e,n,i){const r=t%lE,s=Math.floor(t/lE);return{x:e.x+kD+r*DD,y:e.y+OD+s*zD}}function gm(t,e,n){return{x:t.x+e-80,y:t.y+n-80}}function zC(t,e,n){return{x:t.x+e-160,y:t.y+Math.floor(n/2)}}function ID(t,e){const n=e==="male"?t.bathroomMale:t.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function jD(t){return{x:t.kitchen.x+t.kitchen.width/2,y:t.kitchen.y+t.kitchen.height/2}}function HD(t){return{x:t.restArea.x+t.restArea.width/2,y:t.restArea.y+t.restArea.height/2}}function PD(t){const e=t.corridorV;if(e.height>0&&Math.random()<.5)return{x:e.x+10+Math.random()*Math.max(0,e.width-20),y:e.y+10+Math.random()*Math.max(0,e.height-20)};const n=t.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function oE(t,e){const n=e.corridorH;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function cE(t,e){const n=e.corridorV;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function GD(t,e){if(t==="ceo"){const i=e.ceoOffice;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-male"){const i=e.bathroomMale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-female"){const i=e.bathroomFemale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="kitchen"){const i=e.kitchen;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="rest-area"){const i=e.restArea;return{x:i.x+i.width/2,y:i.y+i.height/2}}const n=t.match(/^squad-(\d+)$/);if(n){const i=parseInt(n[1],10),r=e.squadOrigins[i];if(r)return{x:r.origin.x+r.width/2,y:r.origin.y+r.height/2}}return e.corridorHub}function ym(t,e,n,i){const r=i.doorPoints[e],s=i.doorPoints[n];if(!r||!s)return[t];const l=i.corridorHub,c=GD(n,i),d=oE(r,i)&&oE(s,i),p=cE(r,i)&&cE(s,i);return d||p?[t,r,s,c]:[t,r,l,s,c]}function Ty(t,e){const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}const uE=500,fE=50;let dE=0;function hE(t){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[t]??"idle"}const si=Tf(t=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(e,n,i)=>{const r=`${e}:${n}`;t(s=>{var d;let c=(((d=s.bubbles[r])==null?void 0:d.text)??"")+i;return c.length>uE&&(c=c.slice(c.length-uE)),{bubbles:{...s.bubbles,[r]:{text:c,updatedAt:Date.now()}}}})},clearBubble:(e,n)=>{const i=`${e}:${n}`;t(r=>{const{[i]:s,...l}=r.bubbles;return{bubbles:l}})},clearAllBubbles:()=>t({bubbles:{}}),addActivity:(e,n,i)=>{const s={id:++dE,agentName:n,action:i,timestamp:Date.now()};t(l=>{var m;const d=[...((m=l.activityLog[e])==null?void 0:m.entries)??[],s],p=d.length>fE?d.slice(d.length-fE):d;return{activityLog:{...l.activityLog,[e]:{entries:p}}}})},setCheckpoint:(e,n,i,r)=>t(s=>({checkpoints:{...s.checkpoints,[e]:{agentId:n,agentName:i,question:r}}})),clearCheckpoint:e=>t(n=>{const{[e]:i,...r}=n.checkpoints;return{checkpoints:r}}),setActiveRoom:e=>t({activeRoom:e}),syncRooms:e=>t(n=>{const i=e;let r;return i.length===0?r=null:n.activeRoom===null||!i.includes(n.activeRoom)?r=i[0]:r=n.activeRoom,{rooms:i,activeRoom:r}}),setAgents:(e,n)=>t(i=>{const r=i.agentVisuals[e]??[],s=new Map(r.map(v=>[v.id,v])),l={x:0,y:0},c=S0(i.rooms.length),d=i.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=n.map((v,_)=>{const A=s.get(v.id);if(A){const k=v.status?hE(v.status):A.status,R=k!==A.status;let O=A.targetPosition;return R&&(k==="working"||k==="checkpoint"?O=Qd(_,l):O=gm(l,m,g)),{...A,name:v.name,deskIndex:_,status:k,targetPosition:O}}const C=v.status?hE(v.status):"idle",w=C==="working"||C==="checkpoint"?Qd(_,l):gm(l,m,g);return{id:v.id,name:v.name,colorIndex:_%6,status:C,deskIndex:_,position:w,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[e]:b}}}),setAgentStatus:(e,n,i)=>t(r=>{const s=r.agentVisuals[e];if(!s)return r;const l={x:0,y:0},c=S0(r.rooms.length),d=r.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=s.map(v=>{if(v.id!==n)return v;let _;return i==="working"||i==="checkpoint"?_=Qd(v.deskIndex,l):_=gm(l,m,g),{...v,status:i,targetPosition:_}});return{agentVisuals:{...r.agentVisuals,[e]:b}}}),reset:()=>{dE=0,t({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),OW={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textJarvis:"#00ff88",particleStart:"#00c8ff"},FD={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let BC=0;function qD(){return`jarvis-${Date.now()}-${++BC}`}let ao=null;const hx=Tf((t,e)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>t({mode:n}),addMessage:(n,i)=>{const r={id:qD(),role:n,content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r]}))},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n}))},finalizeMessage:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streamingText:""}))},selectSquad:n=>t({selectedSquad:n}),setUserName:n=>t({userName:n}),startStandbyTimer:()=>{ao&&clearTimeout(ao),ao=setTimeout(()=>{t({mode:"STANDBY"}),ao=null},FD.standbyTimeoutMs)},resetStandbyTimer:()=>{e().startStandbyTimer()},clearStandbyTimer:()=>{ao&&(clearTimeout(ao),ao=null)},reset:()=>{ao&&(clearTimeout(ao),ao=null),BC=0,t({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),la=Tf((t,e)=>({jobs:[],loading:!1,history:{},historyLoading:{},fetchJobs:async()=>{t({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const i=await n.json();t({jobs:i.data,loading:!1})}else t({loading:!1})}catch{t({loading:!1})}},createJob:async n=>(await fetch("/api/scheduler",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?(e().fetchJobs(),!0):!1,deleteJob:async n=>{await fetch(`/api/scheduler/${n}`,{method:"DELETE",credentials:"include"}),e().fetchJobs()},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),e().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),e().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,i)=>{t(r=>({jobs:r.jobs.map(s=>s.squad_name===n?{...s,status:i}:s)}))},fetchHistory:async n=>{t(i=>({historyLoading:{...i.historyLoading,[n]:!0}}));try{const i=await fetch(`/api/scheduler/${n}/history?limit=50`,{credentials:"include"});if(i.ok){const r=await i.json();t(s=>({history:{...s.history,[n]:r.data},historyLoading:{...s.historyLoading,[n]:!1}}))}else t(r=>({historyLoading:{...r.historyLoading,[n]:!1}}))}catch{t(i=>({historyLoading:{...i.historyLoading,[n]:!1}}))}}})),YD=600*1e3;function VD(){const[t,e]=L.useState(null),[n,i]=L.useState(!1),[r,s]=L.useState(!1),l=L.useCallback(async()=>{try{const d=await fetch("/api/system/version",{credentials:"include"});if(d.ok){const p=await d.json();e(p)}}catch{}},[]);L.useEffect(()=>{l();const d=setInterval(l,YD);return()=>clearInterval(d)},[l]);const c=async()=>{i(!0);try{await fetch("/api/system/update",{method:"POST",credentials:"include"})}catch{i(!1)}};return!(t!=null&&t.updateAvailable)||r?null:T.jsx("div",{"data-testid":"update-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"8px var(--sp-4)",background:"var(--surface-2)",borderBottom:"1px solid var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)",animation:"fadeIn 0.3s var(--ease-out) both"},children:n?T.jsxs("span",{style:{color:"var(--accent)"},children:["Updating to v",t.latest,"... Server will restart automatically."]}):T.jsxs(T.Fragment,{children:[T.jsxs("span",{children:["New version available: ",T.jsxs("strong",{style:{color:"var(--accent)"},children:["v",t.latest]}),T.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},children:["(current: v",t.current,")"]})]}),T.jsx("button",{"data-testid":"btn-update",onClick:c,style:{padding:"3px 12px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.68rem",fontWeight:600,cursor:"pointer",border:"none",background:"var(--accent)",color:"var(--text-inverse)",transition:"opacity 0.15s ease"},children:"Update"}),T.jsx("button",{"data-testid":"btn-dismiss-update",onClick:()=>s(!0),style:{padding:"2px 6px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:"✕"})]})})}const XD=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/settings",label:"Settings",icon:"⚙"}];function KD(){const t=ml(Y=>Y.user),e=ml(Y=>Y.isAuthenticated),n=ml(Y=>Y.loading),i=ml(Y=>Y.logout),r=ml(Y=>Y.checkAuth),s=$0(),l=Sl();l.pathname==="/office"||l.pathname;const c=l.pathname==="/jarvis",d=es(Y=>Y.squads),p=es(Y=>Y.selectedSquad),m=es(Y=>p?Y.activeStates[p]:null),g=es(Y=>Y.fetchSquads),b=es(Y=>Y.setSquadState),v=es(Y=>Y.clearSquadState),_=L.useCallback((Y,ee)=>{b(Y,ee);const V=si.getState();V.rooms.includes(Y)||V.syncRooms([...V.rooms,Y]),ee.status!=="checkpoint"&&V.clearCheckpoint(Y),ee.agents&&V.setAgents(Y,ee.agents.map(le=>({id:le.id,name:le.name,status:le.status})))},[b]),A=L.useCallback(Y=>{v(Y);const ee=si.getState(),V=ee.agentVisuals[Y];if(V)for(const le of V)ee.setAgentStatus(Y,le.id,"idle")},[v]),C=L.useCallback((Y,ee)=>{ar.setState(V=>({conversationId:ee,messages:[],conversations:[{id:ee,createdAt:new Date().toISOString(),preview:""},...V.conversations.filter(le=>le.id!==ee)]}))},[]),w=L.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().appendChunk(V);return}const le=ar.getState();le.streaming||le.startStreaming(),le.appendChunk(V)},[]),k=L.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().finalizeMessage(V);return}ar.getState().finishStreaming(V)},[]),R=L.useCallback((Y,ee)=>{if(Y==="_jarvis"){hx.getState().setMode("LISTENING");return}ar.getState().setError(ee)},[]),O=L.useCallback((Y,ee,V)=>{Y!=="_jarvis"&&ar.getState().setActivity(`${ee}${V?" "+V:""}`)},[]),j=L.useCallback((Y,ee,V,le,ye)=>{ar.getState().addAgentDm({agentId:V,agentName:le,content:ye})},[]),D=L.useCallback((Y,ee,V,le)=>{si.getState().appendBubble(Y,ee,le)},[]),G=L.useCallback((Y,ee,V,le,ye)=>{si.getState().addActivity(Y,V,`started "${ye}"`),si.getState().setAgentStatus(Y,ee,"working")},[]),W=L.useCallback((Y,ee,V,le,ye)=>{si.getState().addActivity(Y,V,`completed "${ye}"`),si.getState().setAgentStatus(Y,ee,"idle")},[]),P=L.useCallback((Y,ee,V,le)=>{si.getState().setCheckpoint(Y,ee,V,le),si.getState().setAgentStatus(Y,ee,"checkpoint")},[]),I=L.useCallback(()=>{si.getState().clearAllBubbles()},[]),K=L.useCallback((Y,ee,V)=>{la.getState().fetchJobs()},[]),q=L.useCallback((Y,ee,V,le)=>{la.getState().fetchJobs()},[]),te=L.useCallback((Y,ee,V,le,ye)=>{la.getState().fetchJobs()},[]),H=L.useCallback((Y,ee)=>{la.getState().updateJobStatus(Y,ee)},[]),{subscribe:$,unsubscribe:B,sendChat:X,newConversation:Z,sendCheckpointResponse:Q}=SD({onSquadState:_,onSquadInactive:A,onChatConversationCreated:C,onChatChunk:w,onChatActivity:O,onChatDone:k,onChatError:R,onChatAgentDm:j,onAgentOutputChunk:D,onAgentStepStart:G,onAgentStepComplete:W,onSquadCheckpoint:P,onReconnect:I,onScheduleStarted:K,onScheduleDone:q,onScheduleError:te,onScheduleStatusChanged:H});L.useEffect(()=>{TD(X)},[X]),L.useEffect(()=>{CD(Z)},[Z]),L.useEffect(()=>{MD(Q)},[Q]),L.useEffect(()=>{g().then(()=>{const{squads:Y}=es.getState();if(Y.length>0){const ee=si.getState(),V=Y.map(ve=>ve.code),le=ee.rooms,ye=[...new Set([...le,...V])];ee.syncRooms(ye);for(const ve of Y)!ee.agentVisuals[ve.code]&&ve.agents&&ve.agents.length>0&&ee.setAgents(ve.code,ve.agents.map(se=>({id:se.id,name:se.name,status:"idle"})))}})},[g]);const F=si(Y=>Y.rooms);return L.useEffect(()=>{for(const Y of F)$(Y);return()=>{for(const Y of F)B(Y)}},[F,$,B]),L.useEffect(()=>($("_expxagents"),()=>B("_expxagents")),[$,B]),L.useEffect(()=>{if(c)return $("_jarvis"),()=>B("_jarvis")},[c,$,B]),L.useEffect(()=>{e||r()},[]),L.useEffect(()=>{!n&&!e&&s("/login",{state:{from:l.pathname}})},[n,e,s,l.pathname]),c?T.jsx(JS,{}):T.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[T.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[T.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"}),T.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"})]}),T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[T.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}}),T.jsx("span",{children:t==null?void 0:t.username})]}),T.jsx("button",{onClick:i,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:Y=>Y.currentTarget.style.color="var(--status-error)",onMouseLeave:Y=>Y.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),T.jsx(VD,{}),T.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[T.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[T.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[T.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"}),XD.map(Y=>T.jsxs(NC,{to:Y.to,style:({isActive:ee})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:ee?600:400,color:ee?"var(--accent)":"var(--text-secondary)",background:ee?"var(--accent-glow)":"transparent",border:ee?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:Y.icon}),Y.label]},Y.to)),T.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),T.jsxs("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid rgba(0, 230, 138, 0.12)",transition:"all var(--duration-fast) var(--ease-out)"},children:[T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",T.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),T.jsxs("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[T.jsxs("span",{children:[d.length," squad",d.length!==1?"s":""]}),T.jsx("span",{children:"v0.1.0"})]})]}),T.jsx("main",{className:"grid-bg",style:{flex:1,overflow:"auto",position:"relative"},children:T.jsx(JS,{})})]}),T.jsx(wD,{state:m})]})}function $D(){var b;const[t,e]=L.useState(""),[n,i]=L.useState(""),r=ml(v=>v.login),s=ml(v=>v.loading),l=ml(v=>v.error),c=ml(v=>v.isAuthenticated),d=$0(),m=((b=Sl().state)==null?void 0:b.from)||"/";L.useEffect(()=>{c&&d(m,{replace:!0})},[c,d,m]);const g=v=>{v.preventDefault(),r(t,n)};return T.jsx("div",{className:"noise-bg grid-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)"},children:T.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360},children:[T.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[T.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"}),T.jsx("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"}),T.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),T.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&T.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:l}),T.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[T.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"}),T.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:v=>e(v.target.value),autoFocus:!0})]}),T.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[T.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"}),T.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:v=>i(v.target.value)})]}),T.jsx("button",{type:"submit",disabled:s,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:s?"wait":"pointer",opacity:s?.7:1},children:s?"Authenticating...":"Access Mission Control"})]}),T.jsx("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"})]})})}function LC(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=t.child;for(;i;){const r=LC(i,e,n);if(r)return r;i=i.sibling}}function UC(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const P_=UC(L.createContext(null));let IC=class extends L.Component{render(){return L.createElement(P_.Provider,{value:this._reactInternals},this.props.children)}};function WD(){const t=L.useContext(P_);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=L.useId();return L.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const i=LC(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const ZD=Symbol.for("react.context"),QD=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZD;function JD(){const t=WD(),[e]=L.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;QD(i)&&i!==P_&&!e.has(i)&&e.set(i,L.use(UC(i))),n=n.return}return e}function e4(){const t=JD();return L.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>L.createElement(e,null,L.createElement(n.Provider,{...i,value:t.get(n)})),e=>L.createElement(IC,{...e})),[t])}var Nt=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(Nt||{});const Lv=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Cy=(t,e)=>Lv(t).priority??e,oi={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var i,r;return(r=(i=this._removeHandlers)[n])==null?void 0:r.call(i,e)})}),this},add(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var s,l;const i=this._addHandlers,r=this._queue;i[n]?(l=i[n])==null||l.call(i,e):(r[n]=r[n]||[],(s=r[n])==null||s.push(e))})}),this},handle(t,e,n){var l;const i=this._addHandlers,r=this._removeHandlers;if(i[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,r[t]=n;const s=this._queue;return s[t]&&((l=s[t])==null||l.forEach(c=>e(c)),delete s[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,i=>{e.findIndex(s=>s.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((s,l)=>Cy(l.value,n)-Cy(s.value,n)))},i=>{const r=e.findIndex(s=>s.name===i.name);r!==-1&&e.splice(r,1)})},handleByList(t,e,n=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((r,s)=>Cy(s,n)-Cy(r,n)))},i=>{const r=e.indexOf(i.ref);r!==-1&&e.splice(r,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},t4={extension:{type:Nt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Zd(()=>import("./browserAll-CxsLh0vY.js"),__vite__mapDeps([0,1]))}},n4={extension:{type:Nt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Zd(()=>import("./webworkerAll-BKu01pDB.js"),[])}};class vr{constructor(e,n,i){this._x=n||0,this._y=i||0,this._observer=e}clone(e){return new vr(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var px={exports:{}},pE;function i4(){return pE||(pE=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(d,p,m){this.fn=d,this.context=p,this.once=m||!1}function s(d,p,m,g,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new r(m,g||d,b),_=n?n+p:p;return d._events[_]?d._events[_].fn?d._events[_]=[d._events[_],v]:d._events[_].push(v):(d._events[_]=v,d._eventsCount++),d}function l(d,p){--d._eventsCount===0?d._events=new i:delete d._events[p]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,g;if(this._eventsCount===0)return p;for(g in m=this._events)e.call(m,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=n?n+p:p,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,v=g.length,_=new Array(v);b<v;b++)_[b]=g[b].fn;return _},c.prototype.listenerCount=function(p){var m=n?n+p:p,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(p,m,g,b,v,_){var A=n?n+p:p;if(!this._events[A])return!1;var C=this._events[A],w=arguments.length,k,R;if(C.fn){switch(C.once&&this.removeListener(p,C.fn,void 0,!0),w){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,m),!0;case 3:return C.fn.call(C.context,m,g),!0;case 4:return C.fn.call(C.context,m,g,b),!0;case 5:return C.fn.call(C.context,m,g,b,v),!0;case 6:return C.fn.call(C.context,m,g,b,v,_),!0}for(R=1,k=new Array(w-1);R<w;R++)k[R-1]=arguments[R];C.fn.apply(C.context,k)}else{var O=C.length,j;for(R=0;R<O;R++)switch(C[R].once&&this.removeListener(p,C[R].fn,void 0,!0),w){case 1:C[R].fn.call(C[R].context);break;case 2:C[R].fn.call(C[R].context,m);break;case 3:C[R].fn.call(C[R].context,m,g);break;case 4:C[R].fn.call(C[R].context,m,g,b);break;default:if(!k)for(j=1,k=new Array(w-1);j<w;j++)k[j-1]=arguments[j];C[R].fn.apply(C[R].context,k)}}return!0},c.prototype.on=function(p,m,g){return s(this,p,m,g,!1)},c.prototype.once=function(p,m,g){return s(this,p,m,g,!0)},c.prototype.removeListener=function(p,m,g,b){var v=n?n+p:p;if(!this._events[v])return this;if(!m)return l(this,v),this;var _=this._events[v];if(_.fn)_.fn===m&&(!b||_.once)&&(!g||_.context===g)&&l(this,v);else{for(var A=0,C=[],w=_.length;A<w;A++)(_[A].fn!==m||b&&!_[A].once||g&&_[A].context!==g)&&C.push(_[A]);C.length?this._events[v]=C.length===1?C[0]:C:l(this,v)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=n?n+p:p,this._events[m]&&l(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,t.exports=c})(px)),px.exports}var r4=i4();const go=uu(r4),a4=Math.PI*2,s4=180/Math.PI,l4=Math.PI/180;class Lr{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new Lr(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return mx.x=0,mx.y=0,mx}}const mx=new Lr;class Ft{constructor(e=1,n=0,i=0,r=1,s=0,l=0){this.array=null,this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,i,r,s,l){return this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const i=n||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,n){n=n||new Lr;const i=e.x,r=e.y;return n.x=this.a*i+this.c*r+this.tx,n.y=this.b*i+this.d*r+this.ty,n}applyInverse(e,n){n=n||new Lr;const i=this.a,r=this.b,s=this.c,l=this.d,c=this.tx,d=this.ty,p=1/(i*l+s*-r),m=e.x,g=e.y;return n.x=l*p*m+-s*p*g+(d*s-c*l)*p,n.y=i*p*g+-r*p*m+(-d*i+c*r)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),i=Math.sin(e),r=this.a,s=this.c,l=this.tx;return this.a=r*n-this.b*i,this.b=r*i+this.b*n,this.c=s*n-this.d*i,this.d=s*i+this.d*n,this.tx=l*n-this.ty*i,this.ty=l*i+this.ty*n,this}append(e){const n=this.a,i=this.b,r=this.c,s=this.d;return this.a=e.a*n+e.b*r,this.b=e.a*i+e.b*s,this.c=e.c*n+e.d*r,this.d=e.c*i+e.d*s,this.tx=e.tx*n+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}appendFrom(e,n){const i=e.a,r=e.b,s=e.c,l=e.d,c=e.tx,d=e.ty,p=n.a,m=n.b,g=n.c,b=n.d;return this.a=i*p+r*g,this.b=i*m+r*b,this.c=s*p+l*g,this.d=s*m+l*b,this.tx=c*p+d*g+n.tx,this.ty=c*m+d*b+n.ty,this}setTransform(e,n,i,r,s,l,c,d,p){return this.a=Math.cos(c+p)*s,this.b=Math.sin(c+p)*s,this.c=-Math.sin(c-d)*l,this.d=Math.cos(c-d)*l,this.tx=e-(i*this.a+r*this.c),this.ty=n-(i*this.b+r*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,i=this.b,r=this.c,s=this.d,l=e.pivot,c=-Math.atan2(-r,s),d=Math.atan2(i,n),p=Math.abs(c+d);return p<1e-5||Math.abs(a4-p)<1e-5?(e.rotation=d,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=c,e.skew.y=d),e.scale.x=Math.sqrt(n*n+i*i),e.scale.y=Math.sqrt(r*r+s*s),e.position.x=this.tx+(l.x*n+l.y*r),e.position.y=this.ty+(l.x*i+l.y*s),e}invert(){const e=this.a,n=this.b,i=this.c,r=this.d,s=this.tx,l=e*r-n*i;return this.a=r/l,this.b=-n/l,this.c=-i/l,this.d=e/l,this.tx=(i*this.ty-r*s)/l,this.ty=-(e*this.ty-n*s)/l,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ft;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return c4.identity()}static get shared(){return o4.identity()}}const o4=new Ft,c4=new Ft,sf=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lf=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],of=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],cf=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Uv=[],jC=[],Ay=Math.sign;function u4(){for(let t=0;t<16;t++){const e=[];Uv.push(e);for(let n=0;n<16;n++){const i=Ay(sf[t]*sf[n]+of[t]*lf[n]),r=Ay(lf[t]*sf[n]+cf[t]*lf[n]),s=Ay(sf[t]*of[n]+of[t]*cf[n]),l=Ay(lf[t]*of[n]+cf[t]*cf[n]);for(let c=0;c<16;c++)if(sf[c]===i&&lf[c]===r&&of[c]===s&&cf[c]===l){e.push(c);break}}}for(let t=0;t<16;t++){const e=new Ft;e.set(sf[t],lf[t],of[t],cf[t],0,0),jC.push(e)}}u4();const Ln={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>sf[t],uY:t=>lf[t],vX:t=>of[t],vY:t=>cf[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Uv[t][e],sub:(t,e)=>Uv[t][Ln.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ln.S:Ln.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ln.E:Ln.W:e>0?t>0?Ln.SE:Ln.SW:t>0?Ln.NE:Ln.NW,matrixAppendRotationInv:(t,e,n=0,i=0,r=0,s=0)=>{const l=jC[Ln.inv(e)],c=l.a,d=l.b,p=l.c,m=l.d,g=n-Math.min(0,c*r,p*s,c*r+p*s),b=i-Math.min(0,d*r,m*s,d*r+m*s),v=t.a,_=t.b,A=t.c,C=t.d;t.a=c*v+d*A,t.b=c*_+d*C,t.c=p*v+m*A,t.d=p*_+m*C,t.tx=g*v+b*A+t.tx,t.ty=g*_+b*C+t.ty},transformRectCoords:(t,e,n,i)=>{const{x:r,y:s,width:l,height:c}=t,{x:d,y:p,width:m,height:g}=e;return n===Ln.E?(i.set(r+d,s+p,l,c),i):n===Ln.S?i.set(m-s-c+d,r+p,c,l):n===Ln.W?i.set(m-r-l+d,g-s-c+p,l,c):n===Ln.N?i.set(s+d,g-r-l+p,c,l):i.set(r+d,s+p,l,c)}},My=[new Lr,new Lr,new Lr,new Lr];class Ci{constructor(e=0,n=0,i=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Ci(0,0,0,0)}clone(){return new Ci(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,i,r=.5){const{width:s,height:l}=this;if(s<=0||l<=0)return!1;const c=this.x,d=this.y,p=i*(1-r),m=i-p,g=c-p,b=c+s+p,v=d-p,_=d+l+p,A=c+m,C=c+s-m,w=d+m,k=d+l-m;return e>=g&&e<=b&&n>=v&&n<=_&&!(e>A&&e<C&&n>w&&n<k)}intersects(e,n){if(!n){const W=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=W)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=My[0].set(e.left,e.top),d=My[1].set(e.left,e.bottom),p=My[2].set(e.right,e.top),m=My[3].set(e.right,e.bottom);if(p.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(p,p),n.apply(m,m),Math.max(c.x,d.x,p.x,m.x)<=i||Math.min(c.x,d.x,p.x,m.x)>=r||Math.max(c.y,d.y,p.y,m.y)<=s||Math.min(c.y,d.y,p.y,m.y)>=l))return!1;const b=g*(d.y-c.y),v=g*(c.x-d.x),_=b*i+v*s,A=b*r+v*s,C=b*i+v*l,w=b*r+v*l;if(Math.max(_,A,C,w)<=b*c.x+v*c.y||Math.min(_,A,C,w)>=b*m.x+v*m.y)return!1;const k=g*(c.y-p.y),R=g*(p.x-c.x),O=k*i+R*s,j=k*r+R*s,D=k*i+R*l,G=k*r+R*l;return!(Math.max(O,j,D,G)<=k*c.x+R*c.y||Math.min(O,j,D,G)>=k*m.x+R*m.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(i-n,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(e=1,n=.001){const i=Math.ceil((this.x+this.width-n)*e)/e,r=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=i-this.x,this.height=r-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=i-n,this.y=r,this.height=s-r,this}getBounds(e){return e||(e=new Ci),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,i=e.y,r=e.x+e.width,s=e.y+e.height;return n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&s>=this.y&&s<this.y+this.height}set(e,n,i,r){return this.x=e,this.y=n,this.width=i,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const gx={default:-1};function bi(t="default"){return gx[t]===void 0&&(gx[t]=-1),++gx[t]}const mE=new Set,yi="8.0.0",f4="8.3.4",Yd={quiet:!1,noColor:!1},rn=((t,e,n=3)=>{if(Yd.quiet||mE.has(e))return;let i=new Error().stack;const r=`${e}
|
|
61
|
+
Please change the parent <Route path="${w}"> to <Route path="${w==="/"?"*":`${w}/*`}">.`)}let m=Sl(),g;if(e){let w=typeof e=="string"?bh(e):e;Zn(d==="/"||((C=w.pathname)==null?void 0:C.startsWith(d)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${d}" but pathname "${w.pathname}" was given in the \`location\` prop.`),g=w}else g=m;let b=g.pathname||"/",v=b;if(d!=="/"){let w=d.replace(/^\//,"").split("/");v="/"+b.replace(/^\//,"").split("/").slice(w.length).join("/")}let _=hC(t,{pathname:v});vl(p||_!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),vl(_==null||_[_.length-1].route.element!==void 0||_[_.length-1].route.Component!==void 0||_[_.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let A=M3(_&&_.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ho([d,i.encodeLocation?i.encodeLocation(w.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?d:ho([d,i.encodeLocation?i.encodeLocation(w.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:w.pathnameBase])})),r,n);return e&&A?L.createElement(Ym.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...g},navigationType:"POP"}},A):A}function w3(){let t=D3(),e=c3(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",r={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},l=null;return console.error("Error handled by React Router default ErrorBoundary:",t),l=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:s},"ErrorBoundary")," or"," ",L.createElement("code",{style:s},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},e),n?L.createElement("pre",{style:r},n):null,l)}var T3=L.createElement(w3,null),wC=class extends L.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=b3(t.digest);n&&(t=n)}let e=t!==void 0?L.createElement(_l.Provider,{value:this.props.routeContext},L.createElement(L_.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?L.createElement(C3,{error:t},e):e}};wC.contextType=d3;var ux=new WeakMap;function C3({children:t,error:e}){let{basename:n}=L.useContext(as);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let i=y3(e.digest);if(i){let r=ux.get(e);if(r)throw r;let s=yC(i.location,n);if(gC&&!ux.get(e))if(s.isExternal||i.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:i.replace}));throw ux.set(e,l),l}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return t}function A3({routeContext:t,match:e,children:n}){let i=L.useContext(xh);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),L.createElement(_l.Provider,{value:t},n)}function M3(t,e=[],n){let i=n==null?void 0:n.state;if(t==null){if(!i)return null;if(i.errors)t=i.matches;else if(e.length===0&&!i.initialized&&i.matches.length>0)t=i.matches;else return null}let r=t,s=i==null?void 0:i.errors;if(s!=null){let m=r.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Zn(m>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),r=r.slice(0,Math.min(r.length,m+1))}let l=!1,c=-1;if(n&&i){l=i.renderFallback;for(let m=0;m<r.length;m++){let g=r[m];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(c=m),g.route.id){let{loaderData:b,errors:v}=i,_=g.route.loader&&!b.hasOwnProperty(g.route.id)&&(!v||v[g.route.id]===void 0);if(g.route.lazy||_){n.isStatic&&(l=!0),c>=0?r=r.slice(0,c+1):r=[r[0]];break}}}}let d=n==null?void 0:n.onError,p=i&&d?(m,g)=>{var b,v;d(m,{location:i.location,params:((v=(b=i.matches)==null?void 0:b[0])==null?void 0:v.params)??{},unstable_pattern:u3(i.matches),errorInfo:g})}:void 0;return r.reduceRight((m,g,b)=>{let v,_=!1,A=null,C=null;i&&(v=s&&g.route.id?s[g.route.id]:void 0,A=g.route.errorElement||T3,l&&(c<0&&b===0?(TC("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,C=null):c===b&&(_=!0,C=g.route.hydrateFallbackElement||null)));let w=e.concat(r.slice(0,b+1)),k=()=>{let R;return v?R=A:_?R=C:g.route.Component?R=L.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=m,L.createElement(A3,{match:g,routeContext:{outlet:m,matches:w,isDataRoute:i!=null},children:R})};return i&&(g.route.ErrorBoundary||g.route.errorElement||b===0)?L.createElement(wC,{location:i.location,revalidation:i.revalidation,component:A,error:v,children:k(),routeContext:{outlet:null,matches:w,isDataRoute:!0},onError:p}):k()},null)}function U_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function R3(t){let e=L.useContext(xh);return Zn(e,U_(t)),e}function N3(t){let e=L.useContext(K0);return Zn(e,U_(t)),e}function k3(t){let e=L.useContext(_l);return Zn(e,U_(t)),e}function I_(t){let e=k3(t),n=e.matches[e.matches.length-1];return Zn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function O3(){return I_("useRouteId")}function D3(){var i;let t=L.useContext(L_),e=N3("useRouteError"),n=I_("useRouteError");return t!==void 0?t:(i=e.errors)==null?void 0:i[n]}function z3(){let{router:t}=R3("useNavigate"),e=I_("useNavigate"),n=L.useRef(!1);return SC(()=>{n.current=!0}),L.useCallback(async(r,s={})=>{vl(n.current,_C),n.current&&(typeof r=="number"?await t.navigate(r):await t.navigate(r,{fromRouteId:e,...s}))},[t,e])}var QS={};function TC(t,e,n){!e&&!QS[t]&&(QS[t]=!0,vl(!1,n))}L.memo(B3);function B3({routes:t,future:e,state:n,isStatic:i,onError:r}){return EC(t,void 0,{state:n,isStatic:i,onError:r})}function L3({to:t,replace:e,state:n,relative:i}){Zn(vh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:r}=L.useContext(as);vl(!r,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=L.useContext(_l),{pathname:l}=Sl(),c=$0(),d=X0(t,B_(s),l,i==="path"),p=JSON.stringify(d);return L.useEffect(()=>{c(JSON.parse(p),{replace:e,state:n,relative:i})},[c,p,i,e,n]),null}function JS(t){return S3(t.context)}function Ca(t){Zn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function U3({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:r,static:s=!1,unstable_useTransitions:l}){Zn(!vh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let c=t.replace(/^\/*/,"/"),d=L.useMemo(()=>({basename:c,navigator:r,static:s,unstable_useTransitions:l,future:{}}),[c,r,s,l]);typeof n=="string"&&(n=bh(n));let{pathname:p="/",search:m="",hash:g="",state:b=null,key:v="default",unstable_mask:_}=n,A=L.useMemo(()=>{let C=ac(p,c);return C==null?null:{location:{pathname:C,search:m,hash:g,state:b,key:v,unstable_mask:_},navigationType:i}},[c,p,m,g,b,v,i,_]);return vl(A!=null,`<Router basename="${c}"> is not able to match the URL "${p}${m}${g}" because it does not start with the basename, so the <Router> won't render anything.`),A==null?null:L.createElement(as.Provider,{value:d},L.createElement(Ym.Provider,{children:e,value:A}))}function I3({children:t,location:e}){return E3(kv(t),e)}function kv(t,e=[]){let n=[];return L.Children.forEach(t,(i,r)=>{if(!L.isValidElement(i))return;let s=[...e,r];if(i.type===L.Fragment){n.push.apply(n,kv(i.props.children,s));return}Zn(i.type===Ca,`[${typeof i.type=="string"?i.type:i.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Zn(!i.props.index||!i.props.children,"An index route cannot have child routes.");let l={id:i.props.id||s.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,middleware:i.props.middleware,loader:i.props.loader,action:i.props.action,hydrateFallbackElement:i.props.hydrateFallbackElement,HydrateFallback:i.props.HydrateFallback,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.hasErrorBoundary===!0||i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=kv(i.props.children,s)),n.push(l)}),n}var u0="get",f0="application/x-www-form-urlencoded";function W0(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function j3(t){return W0(t)&&t.tagName.toLowerCase()==="button"}function H3(t){return W0(t)&&t.tagName.toLowerCase()==="form"}function P3(t){return W0(t)&&t.tagName.toLowerCase()==="input"}function G3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function F3(t,e){return t.button===0&&(!e||e==="_self")&&!G3(t)}var Ey=null;function q3(){if(Ey===null)try{new FormData(document.createElement("form"),0),Ey=!1}catch{Ey=!0}return Ey}var Y3=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function fx(t){return t!=null&&!Y3.has(t)?(vl(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${f0}"`),null):t}function V3(t,e){let n,i,r,s,l;if(H3(t)){let c=t.getAttribute("action");i=c?ac(c,e):null,n=t.getAttribute("method")||u0,r=fx(t.getAttribute("enctype"))||f0,s=new FormData(t)}else if(j3(t)||P3(t)&&(t.type==="submit"||t.type==="image")){let c=t.form;if(c==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let d=t.getAttribute("formaction")||c.getAttribute("action");if(i=d?ac(d,e):null,n=t.getAttribute("formmethod")||c.getAttribute("method")||u0,r=fx(t.getAttribute("formenctype"))||fx(c.getAttribute("enctype"))||f0,s=new FormData(c,t),!q3()){let{name:p,type:m,value:g}=t;if(m==="image"){let b=p?`${p}.`:"";s.append(`${b}x`,"0"),s.append(`${b}y`,"0")}else p&&s.append(p,g)}}else{if(W0(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=u0,i=null,r=f0,l=t}return s&&r==="text/plain"&&(l=s,s=void 0),{action:i,method:n.toLowerCase(),encType:r,formData:s,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function j_(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function X3(t,e,n,i){let r=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?r.pathname.endsWith("/")?r.pathname=`${r.pathname}_.${i}`:r.pathname=`${r.pathname}.${i}`:r.pathname==="/"?r.pathname=`_root.${i}`:e&&ac(r.pathname,e)==="/"?r.pathname=`${e.replace(/\/$/,"")}/_root.${i}`:r.pathname=`${r.pathname.replace(/\/$/,"")}.${i}`,r}async function K3(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function $3(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function W3(t,e,n){let i=await Promise.all(t.map(async r=>{let s=e.routes[r.route.id];if(s){let l=await K3(s,n);return l.links?l.links():[]}return[]}));return eD(i.flat(1).filter($3).filter(r=>r.rel==="stylesheet"||r.rel==="preload").map(r=>r.rel==="stylesheet"?{...r,rel:"prefetch",as:"style"}:{...r,rel:"prefetch"}))}function eE(t,e,n,i,r,s){let l=(d,p)=>n[p]?d.route.id!==n[p].route.id:!0,c=(d,p)=>{var m;return n[p].pathname!==d.pathname||((m=n[p].route.path)==null?void 0:m.endsWith("*"))&&n[p].params["*"]!==d.params["*"]};return s==="assets"?e.filter((d,p)=>l(d,p)||c(d,p)):s==="data"?e.filter((d,p)=>{var g;let m=i.routes[d.route.id];if(!m||!m.hasLoader)return!1;if(l(d,p)||c(d,p))return!0;if(d.route.shouldRevalidate){let b=d.route.shouldRevalidate({currentUrl:new URL(r.pathname+r.search+r.hash,window.origin),currentParams:((g=n[0])==null?void 0:g.params)||{},nextUrl:new URL(t,window.origin),nextParams:d.params,defaultShouldRevalidate:!0});if(typeof b=="boolean")return b}return!0}):[]}function Z3(t,e,{includeHydrateFallback:n}={}){return Q3(t.map(i=>{let r=e.routes[i.route.id];if(!r)return[];let s=[r.module];return r.clientActionModule&&(s=s.concat(r.clientActionModule)),r.clientLoaderModule&&(s=s.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(s=s.concat(r.hydrateFallbackModule)),r.imports&&(s=s.concat(r.imports)),s}).flat(1))}function Q3(t){return[...new Set(t)]}function J3(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function eD(t,e){let n=new Set;return new Set(e),t.reduce((i,r)=>{let s=JSON.stringify(J3(r));return n.has(s)||(n.add(s),i.push({key:s,link:r})),i},[])}function CC(){let t=L.useContext(xh);return j_(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function tD(){let t=L.useContext(K0);return j_(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var H_=L.createContext(void 0);H_.displayName="FrameworkContext";function AC(){let t=L.useContext(H_);return j_(t,"You must render this element inside a <HydratedRouter> element"),t}function nD(t,e){let n=L.useContext(H_),[i,r]=L.useState(!1),[s,l]=L.useState(!1),{onFocus:c,onBlur:d,onMouseEnter:p,onMouseLeave:m,onTouchStart:g}=e,b=L.useRef(null);L.useEffect(()=>{if(t==="render"&&l(!0),t==="viewport"){let A=w=>{w.forEach(k=>{l(k.isIntersecting)})},C=new IntersectionObserver(A,{threshold:.5});return b.current&&C.observe(b.current),()=>{C.disconnect()}}},[t]),L.useEffect(()=>{if(i){let A=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(A)}}},[i]);let v=()=>{r(!0)},_=()=>{r(!1),l(!1)};return n?t!=="intent"?[s,b,{}]:[s,b,{onFocus:Vp(c,v),onBlur:Vp(d,_),onMouseEnter:Vp(p,v),onMouseLeave:Vp(m,_),onTouchStart:Vp(g,v)}]:[!1,b,{}]}function Vp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function iD({page:t,...e}){let{router:n}=CC(),i=L.useMemo(()=>hC(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?L.createElement(aD,{page:t,matches:i,...e}):null}function rD(t){let{manifest:e,routeModules:n}=AC(),[i,r]=L.useState([]);return L.useEffect(()=>{let s=!1;return W3(t,e,n).then(l=>{s||r(l)}),()=>{s=!0}},[t,e,n]),i}function aD({page:t,matches:e,...n}){let i=Sl(),{future:r,manifest:s,routeModules:l}=AC(),{basename:c}=CC(),{loaderData:d,matches:p}=tD(),m=L.useMemo(()=>eE(t,e,p,s,i,"data"),[t,e,p,s,i]),g=L.useMemo(()=>eE(t,e,p,s,i,"assets"),[t,e,p,s,i]),b=L.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let A=new Set,C=!1;if(e.forEach(k=>{var O;let R=s.routes[k.route.id];!R||!R.hasLoader||(!m.some(j=>j.route.id===k.route.id)&&k.route.id in d&&((O=l[k.route.id])!=null&&O.shouldRevalidate)||R.hasClientLoader?C=!0:A.add(k.route.id))}),A.size===0)return[];let w=X3(t,c,r.unstable_trailingSlashAwareDataRequests,"data");return C&&A.size>0&&w.searchParams.set("_routes",e.filter(k=>A.has(k.route.id)).map(k=>k.route.id).join(",")),[w.pathname+w.search]},[c,r.unstable_trailingSlashAwareDataRequests,d,i,s,m,e,t,l]),v=L.useMemo(()=>Z3(g,s),[g,s]),_=rD(g);return L.createElement(L.Fragment,null,b.map(A=>L.createElement("link",{key:A,rel:"prefetch",as:"fetch",href:A,...n})),v.map(A=>L.createElement("link",{key:A,rel:"modulepreload",href:A,...n})),_.map(({key:A,link:C})=>L.createElement("link",{key:A,nonce:n.nonce,...C,crossOrigin:C.crossOrigin??n.crossOrigin})))}function sD(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var lD=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{lD&&(window.__reactRouterVersion="7.13.1")}catch{}function oD({basename:t,children:e,unstable_useTransitions:n,window:i}){let r=L.useRef();r.current==null&&(r.current=jO({window:i,v5Compat:!0}));let s=r.current,[l,c]=L.useState({action:s.action,location:s.location}),d=L.useCallback(p=>{n===!1?c(p):L.startTransition(()=>c(p))},[n]);return L.useLayoutEffect(()=>s.listen(d),[s,d]),L.createElement(U3,{basename:t,children:e,location:l.location,navigationType:l.action,navigator:s,unstable_useTransitions:n})}var MC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,RC=L.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:r,reloadDocument:s,replace:l,unstable_mask:c,state:d,target:p,to:m,preventScrollReset:g,viewTransition:b,unstable_defaultShouldRevalidate:v,..._},A){let{basename:C,navigator:w,unstable_useTransitions:k}=L.useContext(as),R=typeof m=="string"&&MC.test(m),O=yC(m,C);m=O.to;let j=x3(m,{relative:r}),D=Sl(),G=null;if(c){let $=X0(c,[],D.unstable_mask?D.unstable_mask.pathname:"/",!0);C!=="/"&&($.pathname=$.pathname==="/"?C:ho([C,$.pathname])),G=w.createHref($)}let[W,P,I]=nD(i,_),K=fD(m,{replace:l,unstable_mask:c,state:d,target:p,preventScrollReset:g,relative:r,viewTransition:b,unstable_defaultShouldRevalidate:v,unstable_useTransitions:k});function q($){e&&e($),$.defaultPrevented||K($)}let te=!(O.isExternal||s),H=L.createElement("a",{..._,...I,href:(te?G:void 0)||O.absoluteURL||j,onClick:te?q:e,ref:sD(A,P),target:p,"data-discover":!R&&n==="render"?"true":void 0});return W&&!R?L.createElement(L.Fragment,null,H,L.createElement(iD,{page:j})):H});RC.displayName="Link";var NC=L.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:r=!1,style:s,to:l,viewTransition:c,children:d,...p},m){let g=Vm(l,{relative:p.relative}),b=Sl(),v=L.useContext(K0),{navigator:_,basename:A}=L.useContext(as),C=v!=null&&gD(g)&&c===!0,w=_.encodeLocation?_.encodeLocation(g).pathname:g.pathname,k=b.pathname,R=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;n||(k=k.toLowerCase(),R=R?R.toLowerCase():null,w=w.toLowerCase()),R&&A&&(R=ac(R,A)||R);const O=w!=="/"&&w.endsWith("/")?w.length-1:w.length;let j=k===w||!r&&k.startsWith(w)&&k.charAt(O)==="/",D=R!=null&&(R===w||!r&&R.startsWith(w)&&R.charAt(w.length)==="/"),G={isActive:j,isPending:D,isTransitioning:C},W=j?e:void 0,P;typeof i=="function"?P=i(G):P=[i,j?"active":null,D?"pending":null,C?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(G):s;return L.createElement(RC,{...p,"aria-current":W,className:P,ref:m,style:I,to:l,viewTransition:c},typeof d=="function"?d(G):d)});NC.displayName="NavLink";var cD=L.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:r,state:s,method:l=u0,action:c,onSubmit:d,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b,...v},_)=>{let{unstable_useTransitions:A}=L.useContext(as),C=pD(),w=mD(c,{relative:p}),k=l.toLowerCase()==="get"?"get":"post",R=typeof c=="string"&&MC.test(c),O=j=>{if(d&&d(j),j.defaultPrevented)return;j.preventDefault();let D=j.nativeEvent.submitter,G=(D==null?void 0:D.getAttribute("formmethod"))||l,W=()=>C(D||j.currentTarget,{fetcherKey:e,method:G,navigate:n,replace:r,state:s,relative:p,preventScrollReset:m,viewTransition:g,unstable_defaultShouldRevalidate:b});A&&n!==!1?L.startTransition(()=>W()):W()};return L.createElement("form",{ref:_,method:k,action:w,onSubmit:i?d:O,...v,"data-discover":!R&&t==="render"?"true":void 0})});cD.displayName="Form";function uD(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function kC(t){let e=L.useContext(xh);return Zn(e,uD(t)),e}function fD(t,{target:e,replace:n,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d,unstable_useTransitions:p}={}){let m=$0(),g=Sl(),b=Vm(t,{relative:l});return L.useCallback(v=>{if(F3(v,e)){v.preventDefault();let _=n!==void 0?n:Am(g)===Am(b),A=()=>m(t,{replace:_,unstable_mask:i,state:r,preventScrollReset:s,relative:l,viewTransition:c,unstable_defaultShouldRevalidate:d});p?L.startTransition(()=>A()):A()}},[g,m,b,n,i,r,e,t,s,l,c,d,p])}var dD=0,hD=()=>`__${String(++dD)}__`;function pD(){let{router:t}=kC("useSubmit"),{basename:e}=L.useContext(as),n=O3(),i=t.fetch,r=t.navigate;return L.useCallback(async(s,l={})=>{let{action:c,method:d,encType:p,formData:m,body:g}=V3(s,e);if(l.navigate===!1){let b=l.fetcherKey||hD();await i(b,n,l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,flushSync:l.flushSync})}else await r(l.action||c,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:m,body:g,formMethod:l.method||d,formEncType:l.encType||p,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[i,r,e,n])}function mD(t,{relative:e}={}){let{basename:n}=L.useContext(as),i=L.useContext(_l);Zn(i,"useFormAction must be used inside a RouteContext");let[r]=i.matches.slice(-1),s={...Vm(t||".",{relative:e})},l=Sl();if(t==null){s.search=l.search;let c=new URLSearchParams(s.search),d=c.getAll("index");if(d.some(m=>m==="")){c.delete("index"),d.filter(g=>g).forEach(g=>c.append("index",g));let m=c.toString();s.search=m?`?${m}`:""}}return(!t||t===".")&&r.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:ho([n,s.pathname])),Am(s)}function gD(t,{relative:e}={}){let n=L.useContext(xC);Zn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=kC("useViewTransitionState"),r=Vm(t,{relative:e});if(!n.isTransitioning)return!1;let s=ac(n.currentLocation.pathname,i)||n.currentLocation.pathname,l=ac(n.nextLocation.pathname,i)||n.nextLocation.pathname;return _0(r.pathname,l)!=null||_0(r.pathname,s)!=null}dC();const tE=t=>{let e;const n=new Set,i=(p,m)=>{const g=typeof p=="function"?p(e):p;if(!Object.is(g,e)){const b=e;e=m??(typeof g!="object"||g===null)?g:Object.assign({},e,g),n.forEach(v=>v(e,b))}},r=()=>e,c={setState:i,getState:r,getInitialState:()=>d,subscribe:p=>(n.add(p),()=>n.delete(p))},d=e=t(i,r,c);return c},yD=(t=>t?tE(t):tE),bD=t=>t;function xD(t,e=bD){const n=cm.useSyncExternalStore(t.subscribe,cm.useCallback(()=>e(t.getState()),[t,e]),cm.useCallback(()=>e(t.getInitialState()),[t,e]));return cm.useDebugValue(n),n}const nE=t=>{const e=yD(t),n=i=>xD(e,i);return Object.assign(n,e),n},Tf=(t=>t?nE(t):nE),ml=Tf(t=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(e,n)=>{t({loading:!0,error:null});try{const i=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:e,password:n}),credentials:"include"}),r=await i.json();if(!i.ok){t({loading:!1,error:r.error||"Login failed"});return}t({user:r.user,isAuthenticated:!0,loading:!1,error:null})}catch{t({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}t({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{t({loading:!0});try{const e=await fetch("/api/auth/me",{credentials:"include"});if(e.ok){const n=await e.json();t({user:n.user,isAuthenticated:!0,loading:!1})}else t({user:null,isAuthenticated:!1,loading:!1})}catch{t({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>t({user:null,isAuthenticated:!1,loading:!1,error:null})})),es=Tf((t,e)=>({squads:[],selectedSquad:null,activeStates:{},fetchSquads:async()=>{try{const n=await fetch("/api/squads",{credentials:"include"});if(n.ok){const i=await n.json();t({squads:i.squads})}}catch{}},selectSquad:n=>t({selectedSquad:n}),setSquadState:(n,i)=>t(r=>({activeStates:{...r.activeStates,[n]:i}})),clearSquadState:n=>t(i=>{const{[n]:r,...s}=i.activeStates;return{activeStates:s}}),reset:()=>t({squads:[],selectedSquad:null,activeStates:{}})}));let vD=0;function iE(){return`local-${Date.now()}-${++vD}`}const ar=Tf((t,e)=>({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",activity:null,error:null,addUserMessage:n=>{const i={id:iE(),role:"user",content:n,createdAt:new Date().toISOString()};t(r=>{const s=r.conversationId,l=s&&!r.messages.some(c=>c.role==="user")?r.conversations.map(c=>c.id===s?{...c,preview:n.slice(0,80)}:c):r.conversations;return{messages:[...r.messages,i],error:null,conversations:l}})},setConversationId:n=>{t({conversationId:n})},startStreaming:()=>{t({streaming:!0,streamingText:"",activity:null,error:null})},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n,activity:null}))},setActivity:n=>{t({activity:n})},finishStreaming:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streaming:!1,streamingText:"",activity:null}))},addAgentDm:n=>{const i={id:iE(),role:"agent_dm",content:n.content,agentId:n.agentId,agentName:n.agentName,createdAt:new Date().toISOString()};t(r=>({messages:[...r.messages,i]}))},setError:n=>{t({error:n,streaming:!1,streamingText:"",activity:null})},loadConversations:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,createdAt:l.created_at,preview:""}));for(const l of s)try{const c=await fetch(`/api/conversations/${l.id}/messages?limit=1`,{credentials:"include"});if(c.ok){const p=((await c.json()).data||[])[0];p&&(l.preview=p.content.slice(0,80))}}catch{}t({conversations:s})}catch{}},selectConversation:async n=>{t({conversationId:n,messages:[],streaming:!1,streamingText:"",activity:null,error:null});try{const i=await fetch(`/api/conversations/${n}/messages`,{credentials:"include"});if(!i.ok)return;const s=((await i.json()).data||[]).map(l=>({id:l.id,role:l.role,content:l.content,agentId:l.agent_id??void 0,agentName:l.agent_name??void 0,createdAt:l.created_at}));t({messages:s})}catch{}},deleteConversation:async(n,i)=>{try{if(!(await fetch(`/api/conversations/${n}`,{method:"DELETE",credentials:"include"})).ok)return;const{conversationId:s}=e();t(l=>({conversations:l.conversations.filter(c=>c.id!==n)})),s===n&&t({conversationId:null,messages:[]})}catch{}},loadHistory:async n=>{try{const i=await fetch(`/api/squads/${n}/conversations`,{credentials:"include"});if(!i.ok)return;const r=await i.json();if(!r.data||r.data.length===0){t({conversationId:null,messages:[],conversations:[]});return}const s=(r.data||[]).map(g=>({id:g.id,createdAt:g.created_at,preview:""})),l=r.data[0];t({conversationId:l.id,conversations:s});const c=await fetch(`/api/conversations/${l.id}/messages`,{credentials:"include"});if(!c.ok)return;const p=((await c.json()).data||[]).map(g=>({id:g.id,role:g.role,content:g.content,agentId:g.agent_id??void 0,agentName:g.agent_name??void 0,createdAt:g.created_at})),m=p.find(g=>g.role==="user");if(m){const g=s.findIndex(b=>b.id===l.id);g>=0&&(s[g].preview=m.content.slice(0,80))}t({messages:p,conversations:s});for(const g of s)if(g.id!==l.id)try{const b=await fetch(`/api/conversations/${g.id}/messages?limit=1`,{credentials:"include"});if(b.ok){const _=((await b.json()).data||[])[0];_&&(g.preview=_.content.slice(0,80))}}catch{}t({conversations:[...s]})}catch{}},reset:()=>t({conversations:[],messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function _D(t){const n=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,i=new WebSocket(n),r=[];let s=!0;function l(c){i.readyState===WebSocket.OPEN?i.send(JSON.stringify(c)):i.readyState===WebSocket.CONNECTING&&r.push(c)}return i.onopen=()=>{var c,d;s||(d=(c=t.current).onReconnect)==null||d.call(c),s=!1;for(const p of r)i.send(JSON.stringify(p));r.length=0},i.onmessage=c=>{var d,p,m,g,b,v,_,A,C,w,k,R,O,j,D,G,W;try{const P=JSON.parse(c.data),I=t.current;switch(P.type){case"squad:state":(d=I.onSquadState)==null||d.call(I,P.squadName,P.state);break;case"squad:inactive":(p=I.onSquadInactive)==null||p.call(I,P.squadName,P.reason);break;case"chat:chunk":(m=I.onChatChunk)==null||m.call(I,P.squadName,P.conversationId,P.delta);break;case"chat:activity":(g=I.onChatActivity)==null||g.call(I,P.squadName,P.tool,P.summary);break;case"chat:done":(b=I.onChatDone)==null||b.call(I,P.squadName,P.conversationId,P.messageId);break;case"chat:error":(v=I.onChatError)==null||v.call(I,P.squadName,P.error);break;case"chat:agent_dm":(_=I.onChatAgentDm)==null||_.call(I,P.squadName,P.conversationId,P.agentId,P.agentName,P.message);break;case"chat:conversation_created":(A=I.onChatConversationCreated)==null||A.call(I,P.squadName,P.conversationId);break;case"agent:output_chunk":(C=I.onAgentOutputChunk)==null||C.call(I,P.squadName,P.agentId,P.agentName,P.delta);break;case"agent:step_start":(w=I.onAgentStepStart)==null||w.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"agent:step_complete":(k=I.onAgentStepComplete)==null||k.call(I,P.squadName,P.agentId,P.agentName,P.stepIndex,P.stepLabel);break;case"squad:checkpoint":(R=I.onSquadCheckpoint)==null||R.call(I,P.squadName,P.agentId,P.agentName,P.question);break;case"schedule:started":(O=I.onScheduleStarted)==null||O.call(I,P.squadName,P.jobId,P.attempt);break;case"schedule:chunk":(j=I.onScheduleChunk)==null||j.call(I,P.squadName,P.jobId,P.delta);break;case"schedule:done":(D=I.onScheduleDone)==null||D.call(I,P.squadName,P.jobId,P.summary,P.attempt);break;case"schedule:error":(G=I.onScheduleError)==null||G.call(I,P.squadName,P.jobId,P.error,P.attempt,P.willRetry);break;case"schedule:status_changed":(W=I.onScheduleStatusChanged)==null||W.call(I,P.squadName,P.status);break}}catch{}},{subscribe:c=>{l({type:"squad:subscribe",squadName:c})},unsubscribe:c=>{l({type:"squad:unsubscribe",squadName:c})},sendChat:(c,d,p)=>{const m={type:"chat:send",squadName:c,message:d};p&&p.length>0&&(m.files=p),l(m)},newConversation:c=>{l({type:"chat:new_conversation",squadName:c})},sendCheckpointResponse:(c,d)=>{l({type:"squad:checkpoint_response",squadName:c,answer:d})},disconnect:()=>{i.close()}}}function SD(t={}){const e=L.useRef(null),n=L.useRef(t),i=L.useRef(new Set);n.current=t,L.useEffect(()=>{const p=_D(n);e.current=p;for(const m of i.current)p.subscribe(m);return()=>{p.disconnect()}},[]);const r=L.useCallback(p=>{var m;i.current.add(p),(m=e.current)==null||m.subscribe(p)},[]),s=L.useCallback(p=>{var m;i.current.delete(p),(m=e.current)==null||m.unsubscribe(p)},[]),l=L.useCallback((p,m,g)=>{var b;(b=e.current)==null||b.sendChat(p,m,g)},[]),c=L.useCallback(p=>{var m;(m=e.current)==null||m.newConversation(p)},[]),d=L.useCallback((p,m)=>{var g;(g=e.current)==null||g.sendCheckpointResponse(p,m)},[]);return{subscribe:r,unsubscribe:s,sendChat:l,newConversation:c,sendCheckpointResponse:d}}function ED(t){const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60,r=s=>s.toString().padStart(2,"0");return e>0?`${e}h ${r(n)}m ${r(i)}s`:`${n}m ${r(i)}s`}function wD({state:t}){const[e,n]=L.useState(0);return L.useEffect(()=>{if(!(t!=null&&t.startedAt)||t.status!=="running"){n(0);return}const i=new Date(t.startedAt).getTime(),r=()=>n(Math.floor((Date.now()-i)/1e3));r();const s=setInterval(r,1e3);return()=>clearInterval(s)},[t==null?void 0:t.startedAt,t==null?void 0:t.status]),T.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--statusbar-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:t?T.jsxs(T.Fragment,{children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[T.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.status==="running"?"var(--status-active)":t.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:t.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:t.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),T.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",t.step.current,"/",t.step.total]}),T.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),T.jsx("span",{children:t.step.label})]}),T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[t.handoff&&T.jsxs("span",{style:{color:"var(--accent)"},children:[t.handoff.from," → ",t.handoff.to]}),t.status==="running"&&T.jsx("span",{style:{color:"var(--text-secondary)"},children:ED(e)})]})]}):T.jsxs(T.Fragment,{children:[T.jsx("span",{children:"Ready"}),T.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let Ov=null;function TD(t){Ov=t}function OC(t,e,n){Ov&&Ov(t,e,n)}let Dv=null;function CD(t){Dv=t}function AD(t){Dv&&Dv(t)}let zv=null;function MD(t){zv=t}function RD(t,e){zv&&zv(t,e)}const d0=32,fl=96,nu=64,pt={floor:13158600,floorHighlight:14211288,floorGrout:12105912,wall:15261904,wallTrim:11577496,baseboard:7035464,desk:15263976,deskTop:16119285,deskShadow:13684944,deskLeg:1710618,deskEdge:14737632,monitor:2236976,monitorScreen:1981020,monitorScreenGlow:2773120,monitorStand:3355456,keyboard:3355456,keyboardKey:4473941,chairSeat:2899536,chairBack:3426654,chairBase:4473924,chairWheel:3355443,plant:5025616,plantDark:3706428,plantLight:6732650,pot:9133628,potRim:10515018,soil:4863264,bookshelf:8020808,bookshelfEdge:9139029,bookColors:[15022389,2001125,4431943,16750592,9315498,35195,16635957],rug:6044974,rugPattern:8016448,rugBorder:4861472},Bv=[5227511,5025616,16750592,15022389,9315498,16771899],ND={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},Br={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},Ka={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},hf={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},ru={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},sa={floor:14477552,tile:12966120,tileGrout:11453652,wall:14740208,stall:11583173,stallDoor:9479342,sink:15527921,sinkBowl:16777215,mirror:11789820,mirrorFrame:7901340,toilet:16448250,toiletSeat:15658734,pipe:9479342},wa={floor:6111287,carpet:5125166,carpetBorder:4073251,desk:4073251,deskTop:6111287,deskEdge:2890510,chair:1713022,chairSeat:2635155,window:8508666,windowFrame:5533306,windowSill:7901340,bookshelf:7162945,globe:4367861,nameplate:16766720},nh={wall:7901340,wallHighlight:10795204,doorFrame:6111287},rr={floor:16115411,tile:15259072,tileGrout:13942952,counter:6111287,counterTop:7951688,fridge:15527921,fridgeDoor:14737632,fridgeHandle:10395294,table:9268835,tableTop:10586239,chair:7162945,coffeeMaker:3622735,coffeeMakerLight:5025616,lamp:16766287},Ta={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},Jo=480,Za=360,tf=400,qi=60,$a=120,dx=120,rE=160,aE=120,sE=160,kD=64,OD=80,DD=fl+32,zD=nu+48,lE=2,DC=10,$o=80;function wy(t,e,n){const i=Math.max(0,Math.min(1,n));return t+(e-t)*i}function BD(t){return t<.5?2*t*t:1-Math.pow(-2*t+2,2)/2}const LD=["nw","ne","sw","se"],UD={nw:"right",ne:"left",sw:"top",se:"top"};function S0(t){const e=DC,n=Math.max(1,t),i={nw:0,ne:0,sw:0,se:0},r=[];for(let Q=0;Q<n;Q++){const F=LD[Q%4];r.push({quadrant:F,slot:i[F]}),i[F]++}const s=Math.max(1,i.nw),l=Math.max(1,i.ne),c=Math.max(1,i.sw),d=Math.max(1,i.se),p=Math.max(tf,$a),m=s*(Za+e),g=l*(Za+e),b=Math.max(m+p,g+$a),v=c*(Za+e),_=d*(Za+e),A=Math.max(rE,sE),C=Math.max(v+A+e,_+A+e),w=Math.max(Jo,$a+e+tf),k=Math.max(Jo,$a),R=Math.max(Jo,dx),O=Math.max(Jo,aE),j=Math.max(w,R),D=Math.max(k,O),G=e+j+e+qi+e+D+e,W=e+b+e+qi+e+C+e,P={x:e+j+e,y:e,width:qi,height:W-2*e},I={x:e,y:e+b+e,width:G-2*e,height:qi},K={x:P.x+P.width/2,y:I.y+I.height/2},q={x:P.x-e-tf,y:I.y-e-tf,width:tf,height:tf},te={x:q.x-e-$a,y:I.y-e-$a,width:$a,height:$a},H={x:P.x+qi+e,y:I.y-e-$a,width:$a,height:$a},$={x:P.x-e-dx,y:I.y+qi+e+c*(Za+e),width:dx,height:rE},B={x:P.x+qi+e,y:I.y+qi+e+d*(Za+e),width:aE,height:sE},X=[],Z={};for(let Q=0;Q<n;Q++){const{quadrant:F,slot:Y}=r[Q],ee=UD[F];let V;F==="nw"?V={x:P.x-e-Jo,y:q.y-e-(Y+1)*Za-Y*e}:F==="ne"?V={x:P.x+qi+e,y:H.y-e-(Y+1)*Za-Y*e}:F==="sw"?V={x:P.x-e-Jo,y:I.y+qi+e+Y*(Za+e)}:V={x:P.x+qi+e,y:I.y+qi+e+Y*(Za+e)},X.push({origin:V,width:Jo,height:Za,quadrant:F,doorSide:ee}),ee==="right"||ee==="left"?Z[`squad-${Q}`]={x:P.x+qi/2,y:V.y+Za/2}:Z[`squad-${Q}`]={x:V.x+Jo/2,y:I.y+qi/2}}return Z.ceo={x:P.x+qi/2,y:q.y+tf/2},Z["bathroom-male"]={x:te.x+$a/2,y:I.y+qi/2},Z["bathroom-female"]={x:H.x+$a/2,y:I.y+qi/2},Z.kitchen={x:P.x+qi/2,y:$.y+$.height/2},Z["rest-area"]={x:P.x+qi/2,y:B.y+B.height/2},{totalWidth:G,totalHeight:W,squadOrigins:X,ceoOffice:q,corridorH:I,corridorV:P,bathroomMale:te,bathroomFemale:H,kitchen:$,restArea:B,doorPoints:Z,corridorHub:K}}function Qd(t,e,n,i){const r=t%lE,s=Math.floor(t/lE);return{x:e.x+kD+r*DD,y:e.y+OD+s*zD}}function gm(t,e,n){return{x:t.x+e-80,y:t.y+n-80}}function zC(t,e,n){return{x:t.x+e-160,y:t.y+Math.floor(n/2)}}function ID(t,e){const n=e==="male"?t.bathroomMale:t.bathroomFemale;return{x:n.x+n.width/2,y:n.y+n.height/2}}function jD(t){return{x:t.kitchen.x+t.kitchen.width/2,y:t.kitchen.y+t.kitchen.height/2}}function HD(t){return{x:t.restArea.x+t.restArea.width/2,y:t.restArea.y+t.restArea.height/2}}function PD(t){const e=t.corridorV;if(e.height>0&&Math.random()<.5)return{x:e.x+10+Math.random()*Math.max(0,e.width-20),y:e.y+10+Math.random()*Math.max(0,e.height-20)};const n=t.corridorH;return{x:n.x+20+Math.random()*Math.max(0,n.width-40),y:n.y+10+Math.random()*Math.max(0,n.height-20)}}function oE(t,e){const n=e.corridorH;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function cE(t,e){const n=e.corridorV;return t.x>=n.x&&t.x<=n.x+n.width&&t.y>=n.y&&t.y<=n.y+n.height}function GD(t,e){if(t==="ceo"){const i=e.ceoOffice;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-male"){const i=e.bathroomMale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="bathroom-female"){const i=e.bathroomFemale;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="kitchen"){const i=e.kitchen;return{x:i.x+i.width/2,y:i.y+i.height/2}}if(t==="rest-area"){const i=e.restArea;return{x:i.x+i.width/2,y:i.y+i.height/2}}const n=t.match(/^squad-(\d+)$/);if(n){const i=parseInt(n[1],10),r=e.squadOrigins[i];if(r)return{x:r.origin.x+r.width/2,y:r.origin.y+r.height/2}}return e.corridorHub}function ym(t,e,n,i){const r=i.doorPoints[e],s=i.doorPoints[n];if(!r||!s)return[t];const l=i.corridorHub,c=GD(n,i),d=oE(r,i)&&oE(s,i),p=cE(r,i)&&cE(s,i);return d||p?[t,r,s,c]:[t,r,l,s,c]}function Ty(t,e){const n=t.x-e.x,i=t.y-e.y;return Math.sqrt(n*n+i*i)}const uE=500,fE=50;let dE=0;function hE(t){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[t]??"idle"}const si=Tf(t=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(e,n,i)=>{const r=`${e}:${n}`;t(s=>{var d;let c=(((d=s.bubbles[r])==null?void 0:d.text)??"")+i;return c.length>uE&&(c=c.slice(c.length-uE)),{bubbles:{...s.bubbles,[r]:{text:c,updatedAt:Date.now()}}}})},clearBubble:(e,n)=>{const i=`${e}:${n}`;t(r=>{const{[i]:s,...l}=r.bubbles;return{bubbles:l}})},clearAllBubbles:()=>t({bubbles:{}}),addActivity:(e,n,i)=>{const s={id:++dE,agentName:n,action:i,timestamp:Date.now()};t(l=>{var m;const d=[...((m=l.activityLog[e])==null?void 0:m.entries)??[],s],p=d.length>fE?d.slice(d.length-fE):d;return{activityLog:{...l.activityLog,[e]:{entries:p}}}})},setCheckpoint:(e,n,i,r)=>t(s=>({checkpoints:{...s.checkpoints,[e]:{agentId:n,agentName:i,question:r}}})),clearCheckpoint:e=>t(n=>{const{[e]:i,...r}=n.checkpoints;return{checkpoints:r}}),setActiveRoom:e=>t({activeRoom:e}),syncRooms:e=>t(n=>{const i=e;let r;return i.length===0?r=null:n.activeRoom===null||!i.includes(n.activeRoom)?r=i[0]:r=n.activeRoom,{rooms:i,activeRoom:r}}),setAgents:(e,n)=>t(i=>{const r=i.agentVisuals[e]??[],s=new Map(r.map(v=>[v.id,v])),l={x:0,y:0},c=S0(i.rooms.length),d=i.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=n.map((v,_)=>{const A=s.get(v.id);if(A){const k=v.status?hE(v.status):A.status,R=k!==A.status;let O=A.targetPosition;return R&&(k==="working"||k==="checkpoint"?O=Qd(_,l):O=gm(l,m,g)),{...A,name:v.name,deskIndex:_,status:k,targetPosition:O}}const C=v.status?hE(v.status):"idle",w=C==="working"||C==="checkpoint"?Qd(_,l):gm(l,m,g);return{id:v.id,name:v.name,colorIndex:_%6,status:C,deskIndex:_,position:w,targetPosition:null}});return{agentVisuals:{...i.agentVisuals,[e]:b}}}),setAgentStatus:(e,n,i)=>t(r=>{const s=r.agentVisuals[e];if(!s)return r;const l={x:0,y:0},c=S0(r.rooms.length),d=r.rooms.indexOf(e),p=c.squadOrigins[d],m=(p==null?void 0:p.width)??480,g=(p==null?void 0:p.height)??360,b=s.map(v=>{if(v.id!==n)return v;let _;return i==="working"||i==="checkpoint"?_=Qd(v.deskIndex,l):_=gm(l,m,g),{...v,status:i,targetPosition:_}});return{agentVisuals:{...r.agentVisuals,[e]:b}}}),reset:()=>{dE=0,t({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),OW={background:"#0a0a0f",grid:"rgba(0, 200, 255, 0.06)",orbStandby:"#1a3a5c",orbListening:"#00c8ff",orbProcessing:"#ff8c00",orbSpeaking:"#00ff88",panelBg:"rgba(0, 200, 255, 0.08)",panelBorder:"rgba(0, 200, 255, 0.25)",textPrimary:"#e0e8f0",textAccent:"#00c8ff",textJarvis:"#00ff88",particleStart:"#00c8ff"},FD={orbRadius:60,orbRingWidth:3,gridSpacing:40,particleCount:65,particleMinRadius:1,particleMaxRadius:3,waveformBars:32,waveformMaxHeight:40,panelWidth:180,panelPadding:12,transcriptLineHeight:20,standbyTimeoutMs:15e3,ttsSplitLength:300};let BC=0;function qD(){return`jarvis-${Date.now()}-${++BC}`}let ao=null;const hx=Tf((t,e)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:n=>t({mode:n}),addMessage:(n,i)=>{const r={id:qD(),role:n,content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r]}))},appendChunk:n=>{t(i=>({streamingText:i.streamingText+n}))},finalizeMessage:n=>{const{streamingText:i}=e(),r={id:n,role:"assistant",content:i,createdAt:new Date().toISOString()};t(s=>({messages:[...s.messages,r],streamingText:""}))},selectSquad:n=>t({selectedSquad:n}),setUserName:n=>t({userName:n}),startStandbyTimer:()=>{ao&&clearTimeout(ao),ao=setTimeout(()=>{t({mode:"STANDBY"}),ao=null},FD.standbyTimeoutMs)},resetStandbyTimer:()=>{e().startStandbyTimer()},clearStandbyTimer:()=>{ao&&(clearTimeout(ao),ao=null)},reset:()=>{ao&&(clearTimeout(ao),ao=null),BC=0,t({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),la=Tf((t,e)=>({jobs:[],loading:!1,history:{},historyLoading:{},fetchJobs:async()=>{t({loading:!0});try{const n=await fetch("/api/scheduler",{credentials:"include"});if(n.ok){const i=await n.json();t({jobs:i.data,loading:!1})}else t({loading:!1})}catch{t({loading:!1})}},createJob:async n=>(await fetch("/api/scheduler",{method:"POST",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)})).ok?(e().fetchJobs(),!0):!1,deleteJob:async n=>{await fetch(`/api/scheduler/${n}`,{method:"DELETE",credentials:"include"}),e().fetchJobs()},pauseJob:async n=>{await fetch(`/api/scheduler/${n}/pause`,{method:"POST",credentials:"include"}),e().fetchJobs()},resumeJob:async n=>{await fetch(`/api/scheduler/${n}/resume`,{method:"POST",credentials:"include"}),e().fetchJobs()},triggerJob:async n=>{await fetch(`/api/scheduler/${n}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(n,i)=>{t(r=>({jobs:r.jobs.map(s=>s.squad_name===n?{...s,status:i}:s)}))},fetchHistory:async n=>{t(i=>({historyLoading:{...i.historyLoading,[n]:!0}}));try{const i=await fetch(`/api/scheduler/${n}/history?limit=50`,{credentials:"include"});if(i.ok){const r=await i.json();t(s=>({history:{...s.history,[n]:r.data},historyLoading:{...s.historyLoading,[n]:!1}}))}else t(r=>({historyLoading:{...r.historyLoading,[n]:!1}}))}catch{t(i=>({historyLoading:{...i.historyLoading,[n]:!1}}))}}})),YD=600*1e3;function VD(){const[t,e]=L.useState(null),[n,i]=L.useState(!1),[r,s]=L.useState(!1),l=L.useCallback(async()=>{try{const d=await fetch("/api/system/version",{credentials:"include"});if(d.ok){const p=await d.json();e(p)}}catch{}},[]);L.useEffect(()=>{l();const d=setInterval(l,YD);return()=>clearInterval(d)},[l]);const c=async()=>{i(!0);try{await fetch("/api/system/update",{method:"POST",credentials:"include"})}catch{i(!1)}};return!(t!=null&&t.updateAvailable)||r?null:T.jsx("div",{"data-testid":"update-banner",style:{display:"flex",alignItems:"center",justifyContent:"center",gap:"var(--sp-3)",padding:"8px var(--sp-4)",background:"var(--surface-2)",borderBottom:"1px solid var(--accent)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)",animation:"fadeIn 0.3s var(--ease-out) both"},children:n?T.jsxs("span",{style:{color:"var(--accent)"},children:["Updating to v",t.latest,"... Server will restart automatically."]}):T.jsxs(T.Fragment,{children:[T.jsxs("span",{children:["New version available: ",T.jsxs("strong",{style:{color:"var(--accent)"},children:["v",t.latest]}),T.jsxs("span",{style:{color:"var(--text-muted)",marginLeft:6},children:["(current: v",t.current,")"]})]}),T.jsx("button",{"data-testid":"btn-update",onClick:c,style:{padding:"3px 12px",borderRadius:"var(--radius-xs)",fontFamily:"var(--font-mono)",fontSize:"0.68rem",fontWeight:600,cursor:"pointer",border:"none",background:"var(--accent)",color:"var(--text-inverse)",transition:"opacity 0.15s ease"},children:"Update"}),T.jsx("button",{"data-testid":"btn-dismiss-update",onClick:()=>s(!0),style:{padding:"2px 6px",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.68rem"},children:"✕"})]})})}const XD=[{to:"/office",label:"Office",icon:"⬡"},{to:"/chat",label:"Chat",icon:"◈"},{to:"/kanban",label:"Kanban",icon:"▦"},{to:"/scheduler",label:"Scheduler",icon:"⏣"},{to:"/email",label:"Email",icon:"✉"},{to:"/orgchart",label:"Org Chart",icon:"◎"},{to:"/graph",label:"Graph",icon:"◇"},{to:"/files",label:"Files",icon:"▤"},{to:"/settings",label:"Settings",icon:"⚙"}];function KD(){const t=ml(Y=>Y.user),e=ml(Y=>Y.isAuthenticated),n=ml(Y=>Y.loading),i=ml(Y=>Y.logout),r=ml(Y=>Y.checkAuth),s=$0(),l=Sl();l.pathname==="/office"||l.pathname;const c=l.pathname==="/jarvis",d=es(Y=>Y.squads),p=es(Y=>Y.selectedSquad),m=es(Y=>p?Y.activeStates[p]:null),g=es(Y=>Y.fetchSquads),b=es(Y=>Y.setSquadState),v=es(Y=>Y.clearSquadState),_=L.useCallback((Y,ee)=>{b(Y,ee);const V=si.getState();V.rooms.includes(Y)||V.syncRooms([...V.rooms,Y]),ee.status!=="checkpoint"&&V.clearCheckpoint(Y),ee.agents&&V.setAgents(Y,ee.agents.map(le=>({id:le.id,name:le.name,status:le.status})))},[b]),A=L.useCallback(Y=>{v(Y);const ee=si.getState(),V=ee.agentVisuals[Y];if(V)for(const le of V)ee.setAgentStatus(Y,le.id,"idle")},[v]),C=L.useCallback((Y,ee)=>{ar.setState(V=>({conversationId:ee,messages:[],conversations:[{id:ee,createdAt:new Date().toISOString(),preview:""},...V.conversations.filter(le=>le.id!==ee)]}))},[]),w=L.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().appendChunk(V);return}const le=ar.getState();le.streaming||le.startStreaming(),le.appendChunk(V)},[]),k=L.useCallback((Y,ee,V)=>{if(Y==="_jarvis"){hx.getState().finalizeMessage(V);return}ar.getState().finishStreaming(V)},[]),R=L.useCallback((Y,ee)=>{if(Y==="_jarvis"){hx.getState().setMode("LISTENING");return}ar.getState().setError(ee)},[]),O=L.useCallback((Y,ee,V)=>{Y!=="_jarvis"&&ar.getState().setActivity(`${ee}${V?" "+V:""}`)},[]),j=L.useCallback((Y,ee,V,le,ye)=>{ar.getState().addAgentDm({agentId:V,agentName:le,content:ye})},[]),D=L.useCallback((Y,ee,V,le)=>{si.getState().appendBubble(Y,ee,le)},[]),G=L.useCallback((Y,ee,V,le,ye)=>{si.getState().addActivity(Y,V,`started "${ye}"`),si.getState().setAgentStatus(Y,ee,"working")},[]),W=L.useCallback((Y,ee,V,le,ye)=>{si.getState().addActivity(Y,V,`completed "${ye}"`),si.getState().setAgentStatus(Y,ee,"idle")},[]),P=L.useCallback((Y,ee,V,le)=>{si.getState().setCheckpoint(Y,ee,V,le),si.getState().setAgentStatus(Y,ee,"checkpoint")},[]),I=L.useCallback(()=>{si.getState().clearAllBubbles()},[]),K=L.useCallback((Y,ee,V)=>{la.getState().fetchJobs()},[]),q=L.useCallback((Y,ee,V,le)=>{la.getState().fetchJobs()},[]),te=L.useCallback((Y,ee,V,le,ye)=>{la.getState().fetchJobs()},[]),H=L.useCallback((Y,ee)=>{la.getState().updateJobStatus(Y,ee)},[]),{subscribe:$,unsubscribe:B,sendChat:X,newConversation:Z,sendCheckpointResponse:Q}=SD({onSquadState:_,onSquadInactive:A,onChatConversationCreated:C,onChatChunk:w,onChatActivity:O,onChatDone:k,onChatError:R,onChatAgentDm:j,onAgentOutputChunk:D,onAgentStepStart:G,onAgentStepComplete:W,onSquadCheckpoint:P,onReconnect:I,onScheduleStarted:K,onScheduleDone:q,onScheduleError:te,onScheduleStatusChanged:H});L.useEffect(()=>{TD(X)},[X]),L.useEffect(()=>{CD(Z)},[Z]),L.useEffect(()=>{MD(Q)},[Q]),L.useEffect(()=>{g().then(()=>{const{squads:Y}=es.getState();if(Y.length>0){const ee=si.getState(),V=Y.map(ve=>ve.code),le=ee.rooms,ye=[...new Set([...le,...V])];ee.syncRooms(ye);for(const ve of Y)!ee.agentVisuals[ve.code]&&ve.agents&&ve.agents.length>0&&ee.setAgents(ve.code,ve.agents.map(se=>({id:se.id,name:se.name,status:"idle"})))}})},[g]);const F=si(Y=>Y.rooms);return L.useEffect(()=>{for(const Y of F)$(Y);return()=>{for(const Y of F)B(Y)}},[F,$,B]),L.useEffect(()=>($("_expxagents"),()=>B("_expxagents")),[$,B]),L.useEffect(()=>{if(c)return $("_jarvis"),()=>B("_jarvis")},[c,$,B]),L.useEffect(()=>{e||r()},[]),L.useEffect(()=>{!n&&!e&&s("/login",{state:{from:l.pathname}})},[n,e,s,l.pathname]),c?T.jsx(JS,{}):T.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[T.jsxs("header",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",height:"var(--header-height)",padding:"0 var(--sp-4)",background:"var(--surface-1)",borderBottom:"1px solid var(--border-subtle)",position:"relative",zIndex:10},children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[T.jsx("div",{style:{width:28,height:28,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.8rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:"EX"}),T.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)",letterSpacing:"0.05em"},children:"MISSION CONTROL"})]}),T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[T.jsx("button",{"data-testid":"btn-restart-server",onClick:async()=>{if(confirm("Restart the server? It will be briefly unavailable."))try{await fetch("/api/system/restart",{method:"POST",credentials:"include"})}catch{}},title:"Restart server",style:{background:"none",border:"1px solid var(--border-subtle)",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",padding:"3px 8px",borderRadius:"var(--radius-xs)",transition:"all var(--duration-fast) var(--ease-out)",display:"flex",alignItems:"center",gap:4},onMouseEnter:Y=>{Y.currentTarget.style.color="var(--accent)",Y.currentTarget.style.borderColor="var(--accent)"},onMouseLeave:Y=>{Y.currentTarget.style.color="var(--text-muted)",Y.currentTarget.style.borderColor="var(--border-subtle)"},children:"↻ Restart"}),T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[T.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:"var(--status-active)",boxShadow:"0 0 8px var(--status-active-glow)",animation:"statusPulse 2s ease-in-out infinite"}}),T.jsx("span",{children:t==null?void 0:t.username})]}),T.jsx("button",{onClick:i,className:"btn-ghost",style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",padding:"4px 8px",borderRadius:"var(--radius-xs)",transition:"color var(--duration-fast) var(--ease-out)"},onMouseEnter:Y=>Y.currentTarget.style.color="var(--status-error)",onMouseLeave:Y=>Y.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),T.jsx(VD,{}),T.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[T.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[T.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[T.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",padding:"0 var(--sp-2)",marginBottom:"var(--sp-1)"},children:"Navigation"}),XD.map(Y=>T.jsxs(NC,{to:Y.to,style:({isActive:ee})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:ee?600:400,color:ee?"var(--accent)":"var(--text-secondary)",background:ee?"var(--accent-glow)":"transparent",border:ee?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:Y.icon}),Y.label]},Y.to)),T.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),T.jsxs("a",{href:"/jarvis",target:"_blank",rel:"noopener noreferrer",style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:500,color:"var(--status-active)",background:"var(--status-active-glow)",border:"1px solid rgba(0, 230, 138, 0.12)",transition:"all var(--duration-fast) var(--ease-out)"},children:[T.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",T.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),T.jsxs("div",{style:{padding:"var(--sp-3)",borderTop:"1px solid var(--border-subtle)",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",justifyContent:"space-between"},children:[T.jsxs("span",{children:[d.length," squad",d.length!==1?"s":""]}),T.jsx("span",{children:"v0.1.0"})]})]}),T.jsx("main",{className:"grid-bg",style:{flex:1,overflow:"auto",position:"relative"},children:T.jsx(JS,{})})]}),T.jsx(wD,{state:m})]})}function $D(){var b;const[t,e]=L.useState(""),[n,i]=L.useState(""),r=ml(v=>v.login),s=ml(v=>v.loading),l=ml(v=>v.error),c=ml(v=>v.isAuthenticated),d=$0(),m=((b=Sl().state)==null?void 0:b.from)||"/";L.useEffect(()=>{c&&d(m,{replace:!0})},[c,d,m]);const g=v=>{v.preventDefault(),r(t,n)};return T.jsx("div",{className:"noise-bg grid-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)"},children:T.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360},children:[T.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[T.jsx("div",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:48,height:48,borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",fontSize:"1.1rem",fontWeight:800,color:"var(--text-inverse)",boxShadow:"var(--shadow-glow-strong)",marginBottom:"var(--sp-4)"},children:"EX"}),T.jsx("h1",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.4rem",color:"var(--text-primary)",letterSpacing:"-0.02em",marginBottom:"var(--sp-1)"},children:"ExpxAgents"}),T.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),T.jsxs("form",{onSubmit:g,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[l&&T.jsx("div",{style:{padding:"var(--sp-2) var(--sp-3)",marginBottom:"var(--sp-4)",borderRadius:"var(--radius-sm)",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",fontSize:"0.8rem",fontFamily:"var(--font-mono)"},children:l}),T.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[T.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Username"}),T.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:t,onChange:v=>e(v.target.value),autoFocus:!0})]}),T.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[T.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:"Password"}),T.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:n,onChange:v=>i(v.target.value)})]}),T.jsx("button",{type:"submit",disabled:s,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:s?"wait":"pointer",opacity:s?.7:1},children:s?"Authenticating...":"Access Mission Control"})]}),T.jsx("p",{style:{textAlign:"center",marginTop:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"AI Squad Orchestration Platform"})]})})}function LC(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=t.child;for(;i;){const r=LC(i,e,n);if(r)return r;i=i.sibling}}function UC(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const P_=UC(L.createContext(null));let IC=class extends L.Component{render(){return L.createElement(P_.Provider,{value:this._reactInternals},this.props.children)}};function WD(){const t=L.useContext(P_);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=L.useId();return L.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const i=LC(n,!1,r=>{let s=r.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const ZD=Symbol.for("react.context"),QD=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===ZD;function JD(){const t=WD(),[e]=L.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;QD(i)&&i!==P_&&!e.has(i)&&e.set(i,L.use(UC(i))),n=n.return}return e}function e4(){const t=JD();return L.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>L.createElement(e,null,L.createElement(n.Provider,{...i,value:t.get(n)})),e=>L.createElement(IC,{...e})),[t])}var Nt=(t=>(t.Application="application",t.WebGLPipes="webgl-pipes",t.WebGLPipesAdaptor="webgl-pipes-adaptor",t.WebGLSystem="webgl-system",t.WebGPUPipes="webgpu-pipes",t.WebGPUPipesAdaptor="webgpu-pipes-adaptor",t.WebGPUSystem="webgpu-system",t.CanvasSystem="canvas-system",t.CanvasPipesAdaptor="canvas-pipes-adaptor",t.CanvasPipes="canvas-pipes",t.Asset="asset",t.LoadParser="load-parser",t.ResolveParser="resolve-parser",t.CacheParser="cache-parser",t.DetectionParser="detection-parser",t.MaskEffect="mask-effect",t.BlendMode="blend-mode",t.TextureSource="texture-source",t.Environment="environment",t.ShapeBuilder="shape-builder",t.Batcher="batcher",t))(Nt||{});const Lv=t=>{if(typeof t=="function"||typeof t=="object"&&t.extension){if(!t.extension)throw new Error("Extension class must have an extension object");t={...typeof t.extension!="object"?{type:t.extension}:t.extension,ref:t}}if(typeof t=="object")t={...t};else throw new Error("Invalid extension type");return typeof t.type=="string"&&(t.type=[t.type]),t},Cy=(t,e)=>Lv(t).priority??e,oi={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var i,r;return(r=(i=this._removeHandlers)[n])==null?void 0:r.call(i,e)})}),this},add(...t){return t.map(Lv).forEach(e=>{e.type.forEach(n=>{var s,l;const i=this._addHandlers,r=this._queue;i[n]?(l=i[n])==null||l.call(i,e):(r[n]=r[n]||[],(s=r[n])==null||s.push(e))})}),this},handle(t,e,n){var l;const i=this._addHandlers,r=this._removeHandlers;if(i[t]||r[t])throw new Error(`Extension type ${t} already has a handler`);i[t]=e,r[t]=n;const s=this._queue;return s[t]&&((l=s[t])==null||l.forEach(c=>e(c)),delete s[t]),this},handleByMap(t,e){return this.handle(t,n=>{n.name&&(e[n.name]=n.ref)},n=>{n.name&&delete e[n.name]})},handleByNamedList(t,e,n=-1){return this.handle(t,i=>{e.findIndex(s=>s.name===i.name)>=0||(e.push({name:i.name,value:i.ref}),e.sort((s,l)=>Cy(l.value,n)-Cy(s.value,n)))},i=>{const r=e.findIndex(s=>s.name===i.name);r!==-1&&e.splice(r,1)})},handleByList(t,e,n=-1){return this.handle(t,i=>{e.includes(i.ref)||(e.push(i.ref),e.sort((r,s)=>Cy(s,n)-Cy(r,n)))},i=>{const r=e.indexOf(i.ref);r!==-1&&e.splice(r,1)})},mixin(t,...e){for(const n of e)Object.defineProperties(t.prototype,Object.getOwnPropertyDescriptors(n))}},t4={extension:{type:Nt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Zd(()=>import("./browserAll-CYuXG0tA.js"),__vite__mapDeps([0,1]))}},n4={extension:{type:Nt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Zd(()=>import("./webworkerAll-C-EDRe11.js"),[])}};class vr{constructor(e,n,i){this._x=n||0,this._y=i||0,this._observer=e}clone(e){return new vr(e??this._observer,this._x,this._y)}set(e=0,n=e){return(this._x!==e||this._y!==n)&&(this._x=e,this._y=n,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var px={exports:{}},pE;function i4(){return pE||(pE=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function i(){}Object.create&&(i.prototype=Object.create(null),new i().__proto__||(n=!1));function r(d,p,m){this.fn=d,this.context=p,this.once=m||!1}function s(d,p,m,g,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new r(m,g||d,b),_=n?n+p:p;return d._events[_]?d._events[_].fn?d._events[_]=[d._events[_],v]:d._events[_].push(v):(d._events[_]=v,d._eventsCount++),d}function l(d,p){--d._eventsCount===0?d._events=new i:delete d._events[p]}function c(){this._events=new i,this._eventsCount=0}c.prototype.eventNames=function(){var p=[],m,g;if(this._eventsCount===0)return p;for(g in m=this._events)e.call(m,g)&&p.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},c.prototype.listeners=function(p){var m=n?n+p:p,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,v=g.length,_=new Array(v);b<v;b++)_[b]=g[b].fn;return _},c.prototype.listenerCount=function(p){var m=n?n+p:p,g=this._events[m];return g?g.fn?1:g.length:0},c.prototype.emit=function(p,m,g,b,v,_){var A=n?n+p:p;if(!this._events[A])return!1;var C=this._events[A],w=arguments.length,k,R;if(C.fn){switch(C.once&&this.removeListener(p,C.fn,void 0,!0),w){case 1:return C.fn.call(C.context),!0;case 2:return C.fn.call(C.context,m),!0;case 3:return C.fn.call(C.context,m,g),!0;case 4:return C.fn.call(C.context,m,g,b),!0;case 5:return C.fn.call(C.context,m,g,b,v),!0;case 6:return C.fn.call(C.context,m,g,b,v,_),!0}for(R=1,k=new Array(w-1);R<w;R++)k[R-1]=arguments[R];C.fn.apply(C.context,k)}else{var O=C.length,j;for(R=0;R<O;R++)switch(C[R].once&&this.removeListener(p,C[R].fn,void 0,!0),w){case 1:C[R].fn.call(C[R].context);break;case 2:C[R].fn.call(C[R].context,m);break;case 3:C[R].fn.call(C[R].context,m,g);break;case 4:C[R].fn.call(C[R].context,m,g,b);break;default:if(!k)for(j=1,k=new Array(w-1);j<w;j++)k[j-1]=arguments[j];C[R].fn.apply(C[R].context,k)}}return!0},c.prototype.on=function(p,m,g){return s(this,p,m,g,!1)},c.prototype.once=function(p,m,g){return s(this,p,m,g,!0)},c.prototype.removeListener=function(p,m,g,b){var v=n?n+p:p;if(!this._events[v])return this;if(!m)return l(this,v),this;var _=this._events[v];if(_.fn)_.fn===m&&(!b||_.once)&&(!g||_.context===g)&&l(this,v);else{for(var A=0,C=[],w=_.length;A<w;A++)(_[A].fn!==m||b&&!_[A].once||g&&_[A].context!==g)&&C.push(_[A]);C.length?this._events[v]=C.length===1?C[0]:C:l(this,v)}return this},c.prototype.removeAllListeners=function(p){var m;return p?(m=n?n+p:p,this._events[m]&&l(this,m)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=n,c.EventEmitter=c,t.exports=c})(px)),px.exports}var r4=i4();const go=uu(r4),a4=Math.PI*2,s4=180/Math.PI,l4=Math.PI/180;class Lr{constructor(e=0,n=0){this.x=0,this.y=0,this.x=e,this.y=n}clone(){return new Lr(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,n=e){return this.x=e,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return mx.x=0,mx.y=0,mx}}const mx=new Lr;class Ft{constructor(e=1,n=0,i=0,r=1,s=0,l=0){this.array=null,this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,n,i,r,s,l){return this.a=e,this.b=n,this.c=i,this.d=r,this.tx=s,this.ty=l,this}toArray(e,n){this.array||(this.array=new Float32Array(9));const i=n||this.array;return e?(i[0]=this.a,i[1]=this.b,i[2]=0,i[3]=this.c,i[4]=this.d,i[5]=0,i[6]=this.tx,i[7]=this.ty,i[8]=1):(i[0]=this.a,i[1]=this.c,i[2]=this.tx,i[3]=this.b,i[4]=this.d,i[5]=this.ty,i[6]=0,i[7]=0,i[8]=1),i}apply(e,n){n=n||new Lr;const i=e.x,r=e.y;return n.x=this.a*i+this.c*r+this.tx,n.y=this.b*i+this.d*r+this.ty,n}applyInverse(e,n){n=n||new Lr;const i=this.a,r=this.b,s=this.c,l=this.d,c=this.tx,d=this.ty,p=1/(i*l+s*-r),m=e.x,g=e.y;return n.x=l*p*m+-s*p*g+(d*s-c*l)*p,n.y=i*p*g+-r*p*m+(-d*i+c*r)*p,n}translate(e,n){return this.tx+=e,this.ty+=n,this}scale(e,n){return this.a*=e,this.d*=n,this.c*=e,this.b*=n,this.tx*=e,this.ty*=n,this}rotate(e){const n=Math.cos(e),i=Math.sin(e),r=this.a,s=this.c,l=this.tx;return this.a=r*n-this.b*i,this.b=r*i+this.b*n,this.c=s*n-this.d*i,this.d=s*i+this.d*n,this.tx=l*n-this.ty*i,this.ty=l*i+this.ty*n,this}append(e){const n=this.a,i=this.b,r=this.c,s=this.d;return this.a=e.a*n+e.b*r,this.b=e.a*i+e.b*s,this.c=e.c*n+e.d*r,this.d=e.c*i+e.d*s,this.tx=e.tx*n+e.ty*r+this.tx,this.ty=e.tx*i+e.ty*s+this.ty,this}appendFrom(e,n){const i=e.a,r=e.b,s=e.c,l=e.d,c=e.tx,d=e.ty,p=n.a,m=n.b,g=n.c,b=n.d;return this.a=i*p+r*g,this.b=i*m+r*b,this.c=s*p+l*g,this.d=s*m+l*b,this.tx=c*p+d*g+n.tx,this.ty=c*m+d*b+n.ty,this}setTransform(e,n,i,r,s,l,c,d,p){return this.a=Math.cos(c+p)*s,this.b=Math.sin(c+p)*s,this.c=-Math.sin(c-d)*l,this.d=Math.cos(c-d)*l,this.tx=e-(i*this.a+r*this.c),this.ty=n-(i*this.b+r*this.d),this}prepend(e){const n=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const i=this.a,r=this.c;this.a=i*e.a+this.b*e.c,this.b=i*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=n*e.a+this.ty*e.c+e.tx,this.ty=n*e.b+this.ty*e.d+e.ty,this}decompose(e){const n=this.a,i=this.b,r=this.c,s=this.d,l=e.pivot,c=-Math.atan2(-r,s),d=Math.atan2(i,n),p=Math.abs(c+d);return p<1e-5||Math.abs(a4-p)<1e-5?(e.rotation=d,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=c,e.skew.y=d),e.scale.x=Math.sqrt(n*n+i*i),e.scale.y=Math.sqrt(r*r+s*s),e.position.x=this.tx+(l.x*n+l.y*r),e.position.y=this.ty+(l.x*i+l.y*s),e}invert(){const e=this.a,n=this.b,i=this.c,r=this.d,s=this.tx,l=e*r-n*i;return this.a=r/l,this.b=-n/l,this.c=-i/l,this.d=e/l,this.tx=(i*this.ty-r*s)/l,this.ty=-(e*this.ty-n*s)/l,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Ft;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return c4.identity()}static get shared(){return o4.identity()}}const o4=new Ft,c4=new Ft,sf=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],lf=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],of=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],cf=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],Uv=[],jC=[],Ay=Math.sign;function u4(){for(let t=0;t<16;t++){const e=[];Uv.push(e);for(let n=0;n<16;n++){const i=Ay(sf[t]*sf[n]+of[t]*lf[n]),r=Ay(lf[t]*sf[n]+cf[t]*lf[n]),s=Ay(sf[t]*of[n]+of[t]*cf[n]),l=Ay(lf[t]*of[n]+cf[t]*cf[n]);for(let c=0;c<16;c++)if(sf[c]===i&&lf[c]===r&&of[c]===s&&cf[c]===l){e.push(c);break}}}for(let t=0;t<16;t++){const e=new Ft;e.set(sf[t],lf[t],of[t],cf[t],0,0),jC.push(e)}}u4();const Ln={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:t=>sf[t],uY:t=>lf[t],vX:t=>of[t],vY:t=>cf[t],inv:t=>t&8?t&15:-t&7,add:(t,e)=>Uv[t][e],sub:(t,e)=>Uv[t][Ln.inv(e)],rotate180:t=>t^4,isVertical:t=>(t&3)===2,byDirection:(t,e)=>Math.abs(t)*2<=Math.abs(e)?e>=0?Ln.S:Ln.N:Math.abs(e)*2<=Math.abs(t)?t>0?Ln.E:Ln.W:e>0?t>0?Ln.SE:Ln.SW:t>0?Ln.NE:Ln.NW,matrixAppendRotationInv:(t,e,n=0,i=0,r=0,s=0)=>{const l=jC[Ln.inv(e)],c=l.a,d=l.b,p=l.c,m=l.d,g=n-Math.min(0,c*r,p*s,c*r+p*s),b=i-Math.min(0,d*r,m*s,d*r+m*s),v=t.a,_=t.b,A=t.c,C=t.d;t.a=c*v+d*A,t.b=c*_+d*C,t.c=p*v+m*A,t.d=p*_+m*C,t.tx=g*v+b*A+t.tx,t.ty=g*_+b*C+t.ty},transformRectCoords:(t,e,n,i)=>{const{x:r,y:s,width:l,height:c}=t,{x:d,y:p,width:m,height:g}=e;return n===Ln.E?(i.set(r+d,s+p,l,c),i):n===Ln.S?i.set(m-s-c+d,r+p,c,l):n===Ln.W?i.set(m-r-l+d,g-s-c+p,l,c):n===Ln.N?i.set(s+d,g-r-l+p,c,l):i.set(r+d,s+p,l,c)}},My=[new Lr,new Lr,new Lr,new Lr];class Ci{constructor(e=0,n=0,i=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(n),this.width=Number(i),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Ci(0,0,0,0)}clone(){return new Ci(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(e,n,i,r=.5){const{width:s,height:l}=this;if(s<=0||l<=0)return!1;const c=this.x,d=this.y,p=i*(1-r),m=i-p,g=c-p,b=c+s+p,v=d-p,_=d+l+p,A=c+m,C=c+s-m,w=d+m,k=d+l-m;return e>=g&&e<=b&&n>=v&&n<=_&&!(e>A&&e<C&&n>w&&n<k)}intersects(e,n){if(!n){const W=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=W)return!1;const I=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>I}const i=this.left,r=this.right,s=this.top,l=this.bottom;if(r<=i||l<=s)return!1;const c=My[0].set(e.left,e.top),d=My[1].set(e.left,e.bottom),p=My[2].set(e.right,e.top),m=My[3].set(e.right,e.bottom);if(p.x<=c.x||d.y<=c.y)return!1;const g=Math.sign(n.a*n.d-n.b*n.c);if(g===0||(n.apply(c,c),n.apply(d,d),n.apply(p,p),n.apply(m,m),Math.max(c.x,d.x,p.x,m.x)<=i||Math.min(c.x,d.x,p.x,m.x)>=r||Math.max(c.y,d.y,p.y,m.y)<=s||Math.min(c.y,d.y,p.y,m.y)>=l))return!1;const b=g*(d.y-c.y),v=g*(c.x-d.x),_=b*i+v*s,A=b*r+v*s,C=b*i+v*l,w=b*r+v*l;if(Math.max(_,A,C,w)<=b*c.x+v*c.y||Math.min(_,A,C,w)>=b*m.x+v*m.y)return!1;const k=g*(c.y-p.y),R=g*(p.x-c.x),O=k*i+R*s,j=k*r+R*s,D=k*i+R*l,G=k*r+R*l;return!(Math.max(O,j,D,G)<=k*c.x+R*c.y||Math.min(O,j,D,G)>=k*m.x+R*m.y)}pad(e=0,n=e){return this.x-=e,this.y-=n,this.width+=e*2,this.height+=n*2,this}fit(e){const n=Math.max(this.x,e.x),i=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),s=Math.min(this.y+this.height,e.y+e.height);return this.x=n,this.width=Math.max(i-n,0),this.y=r,this.height=Math.max(s-r,0),this}ceil(e=1,n=.001){const i=Math.ceil((this.x+this.width-n)*e)/e,r=Math.ceil((this.y+this.height-n)*e)/e;return this.x=Math.floor((this.x+n)*e)/e,this.y=Math.floor((this.y+n)*e)/e,this.width=i-this.x,this.height=r-this.y,this}scale(e,n=e){return this.x*=e,this.y*=n,this.width*=e,this.height*=n,this}enlarge(e){const n=Math.min(this.x,e.x),i=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),s=Math.max(this.y+this.height,e.y+e.height);return this.x=n,this.width=i-n,this.y=r,this.height=s-r,this}getBounds(e){return e||(e=new Ci),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const n=e.x,i=e.y,r=e.x+e.width,s=e.y+e.height;return n>=this.x&&n<this.x+this.width&&i>=this.y&&i<this.y+this.height&&r>=this.x&&r<this.x+this.width&&s>=this.y&&s<this.y+this.height}set(e,n,i,r){return this.x=e,this.y=n,this.width=i,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const gx={default:-1};function bi(t="default"){return gx[t]===void 0&&(gx[t]=-1),++gx[t]}const mE=new Set,yi="8.0.0",f4="8.3.4",Yd={quiet:!1,noColor:!1},rn=((t,e,n=3)=>{if(Yd.quiet||mE.has(e))return;let i=new Error().stack;const r=`${e}
|
|
62
62
|
Deprecated since v${t}`,s=typeof console.groupCollapsed=="function"&&!Yd.noColor;typeof i>"u"?console.warn("PixiJS Deprecation Warning: ",r):(i=i.split(`
|
|
63
63
|
`).splice(n).join(`
|
|
64
64
|
`),s?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",r),console.warn(i),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",r),console.warn(i))),mE.add(e)});Object.defineProperties(rn,{quiet:{get:()=>Yd.quiet,set:t=>{Yd.quiet=t},enumerable:!0,configurable:!1},noColor:{get:()=>Yd.noColor,set:t=>{Yd.noColor=t},enumerable:!0,configurable:!1}});const HC=()=>{};function ih(t){return t+=t===0?1:0,--t,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t+1}function gE(t){return!(t&t-1)&&!!t}function PC(t){const e={};for(const n in t)t[n]!==void 0&&(e[n]=t[n]);return e}const yE=Object.create(null);function d4(t){const e=yE[t];return e===void 0&&(yE[t]=bi("resource")),e}const GC=class FC extends go{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...FC.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){rn(yi,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this._sharedResourceId=null,this.emit("change",this)}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=d4(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};GC.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let rh=GC;const qC=class YC extends go{constructor(e={}){super(),this.options=e,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=bi("textureSource"),this._resourceType="textureSource",this._resourceId=bi("resource"),this.uploadMethodId="unknown",this._resolution=1,this.pixelWidth=1,this.pixelHeight=1,this.width=1,this.height=1,this.sampleCount=1,this.mipLevelCount=1,this.autoGenerateMipmaps=!1,this.format="rgba8unorm",this.dimension="2d",this.viewDimension="2d",this.arrayLayerCount=1,this.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...YC.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.viewDimension=e.viewDimension??e.dimensions,this.arrayLayerCount=e.arrayLayerCount,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new rh(PC(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var n,i;this.style!==e&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=e,(i=this._style)==null||i.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){var e,n;this._resourceId=bi("resource"),this.emit("change",this),this.emit("unload",this);for(const i in this._gpuData)(n=(e=this._gpuData[i])==null?void 0:e.destroy)==null||n.call(e);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,n,i){i||(i=this._resolution),e||(e=this.width),n||(n=this.height);const r=Math.round(e*i),s=Math.round(n*i);return this.width=r/i,this.height=s/i,this._resolution=i,this.pixelWidth===r&&this.pixelHeight===s?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=s,this.emit("resize",this),this._resourceId=bi("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=gE(this.pixelWidth)&&gE(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};qC.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",viewDimension:"2d",arrayLayerCount:1,mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Ls=qC;class G_ extends Ls{constructor(e){const n=e.resource||new Float32Array(e.width*e.height*4);let i=e.format;i||(n instanceof Float32Array?i="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?i="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?i="rgba16uint":(n instanceof Int8Array,i="bgra8unorm")),super({...e,resource:n,format:i}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}G_.extension=Nt.TextureSource;const bE=new Ft;class h4{constructor(e,n){this.mapCoord=new Ft,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var n;this.texture!==e&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,n){n===void 0&&(n=e);const i=this.mapCoord;for(let r=0;r<e.length;r+=2){const s=e[r],l=e[r+1];n[r]=s*i.a+l*i.c+i.tx,n[r+1]=s*i.b+l*i.d+i.ty}return n}update(){const e=this._texture;this._updateID++;const n=e.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const i=e.orig,r=e.trim;r&&(bE.set(i.width/r.width,0,0,i.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(bE));const s=e.source,l=this.uClampFrame,c=this.clampMargin/s._resolution,d=this.clampOffset/s._resolution;return l[0]=(e.frame.x+c+d)/s.width,l[1]=(e.frame.y+c+d)/s.height,l[2]=(e.frame.x+e.frame.width-c+d)/s.width,l[3]=(e.frame.y+e.frame.height-c+d)/s.height,this.uClampOffset[0]=this.clampOffset/s.pixelWidth,this.uClampOffset[1]=this.clampOffset/s.pixelHeight,this.isSimple=e.frame.width===s.width&&e.frame.height===s.height&&e.rotate===0,!0}}class Rn extends go{constructor({source:e,label:n,frame:i,orig:r,trim:s,defaultAnchor:l,defaultBorders:c,rotate:d,dynamic:p}={}){if(super(),this.uid=bi("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Ci,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(e==null?void 0:e.source)??new Ls,this.noFrame=!i,i)this.frame.copyFrom(i);else{const{width:m,height:g}=this._source;this.frame.width=m,this.frame.height=g}this.orig=r||this.frame,this.trim=s,this.rotate=d??0,this.defaultAnchor=l,this.defaultBorders=c,this.destroyed=!1,this.dynamic=p||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new h4(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:n}=this,{width:i,height:r}=this._source,s=n.x/i,l=n.y/r,c=n.width/i,d=n.height/r;let p=this.rotate;if(p){const m=c/2,g=d/2,b=s+m,v=l+g;p=Ln.add(p,Ln.NW),e.x0=b+m*Ln.uX(p),e.y0=v+g*Ln.uY(p),p=Ln.add(p,2),e.x1=b+m*Ln.uX(p),e.y1=v+g*Ln.uY(p),p=Ln.add(p,2),e.x2=b+m*Ln.uX(p),e.y2=v+g*Ln.uY(p),p=Ln.add(p,2),e.x3=b+m*Ln.uX(p),e.y3=v+g*Ln.uY(p)}else e.x0=s,e.y0=l,e.x1=s+c,e.y1=l,e.x2=s+c,e.y2=l+d,e.x3=s,e.y3=l+d}destroy(e=!1){this._source&&(this._source.off("resize",this.update,this),e&&(this._source.destroy(),this._source=null)),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return rn(yi,"Texture.baseTexture is now Texture.source"),this._source}}Rn.EMPTY=new Rn({label:"EMPTY",source:new Ls({label:"EMPTY"})});Rn.EMPTY.destroy=HC;Rn.WHITE=new Rn({source:new G_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Rn.WHITE.destroy=HC;function VC(t,e,n){const{width:i,height:r}=n.orig,s=n.trim;if(s){const l=s.width,c=s.height;t.minX=s.x-e._x*i,t.maxX=t.minX+l,t.minY=s.y-e._y*r,t.maxY=t.minY+c}else t.minX=-e._x*i,t.maxX=t.minX+i,t.minY=-e._y*r,t.maxY=t.minY+r}const xE=new Ft;class Bs{constructor(e=1/0,n=1/0,i=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=xE,this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Ci);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=xE,this}set(e,n,i,r){this.minX=e,this.minY=n,this.maxX=i,this.maxY=r}addFrame(e,n,i,r,s){s||(s=this.matrix);const l=s.a,c=s.b,d=s.c,p=s.d,m=s.tx,g=s.ty;let b=this.minX,v=this.minY,_=this.maxX,A=this.maxY,C=l*e+d*n+m,w=c*e+p*n+g;C<b&&(b=C),w<v&&(v=w),C>_&&(_=C),w>A&&(A=w),C=l*i+d*n+m,w=c*i+p*n+g,C<b&&(b=C),w<v&&(v=w),C>_&&(_=C),w>A&&(A=w),C=l*e+d*r+m,w=c*e+p*r+g,C<b&&(b=C),w<v&&(v=w),C>_&&(_=C),w>A&&(A=w),C=l*i+d*r+m,w=c*i+p*r+g,C<b&&(b=C),w<v&&(v=w),C>_&&(_=C),w>A&&(A=w),this.minX=b,this.minY=v,this.maxX=_,this.maxY=A}addRect(e,n){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,n)}addBounds(e,n){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,n)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const n=this.minX,i=this.minY,r=this.maxX,s=this.maxY,{a:l,b:c,c:d,d:p,tx:m,ty:g}=e;let b=l*n+d*i+m,v=c*n+p*i+g;this.minX=b,this.minY=v,this.maxX=b,this.maxY=v,b=l*r+d*i+m,v=c*r+p*i+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY,b=l*n+d*s+m,v=c*n+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY,b=l*r+d*s+m,v=c*r+p*s+g,this.minX=b<this.minX?b:this.minX,this.minY=v<this.minY?v:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=v>this.maxY?v:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,n,i,r){return this.minX<e&&(this.minX=e),this.maxX>n&&(this.maxX=n),this.minY<i&&(this.minY=i),this.maxY>r&&(this.maxY=r),this}pad(e,n=e){return this.minX-=e,this.maxX+=e,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new Bs(this.minX,this.minY,this.maxX,this.maxY)}scale(e,n=e){return this.minX*=e,this.minY*=n,this.maxX*=e,this.maxY*=n,this}get x(){return this.minX}set x(e){const n=this.maxX-this.minX;this.minX=e,this.maxX=e+n}get y(){return this.minY}set y(e){const n=this.maxY-this.minY;this.minY=e,this.maxY=e+n}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,n,i,r){let s=this.minX,l=this.minY,c=this.maxX,d=this.maxY;r||(r=this.matrix);const p=r.a,m=r.b,g=r.c,b=r.d,v=r.tx,_=r.ty;for(let A=n;A<i;A+=2){const C=e[A],w=e[A+1],k=p*C+g*w+v,R=m*C+b*w+_;s=k<s?k:s,l=R<l?R:l,c=k>c?k:c,d=R>d?R:d}this.minX=s,this.minY=l,this.maxX=c,this.maxY=d}containsPoint(e,n){return this.minX<=e&&this.minY<=n&&this.maxX>=e&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var p4={grad:.9,turn:360,rad:360/(2*Math.PI)},Wo=function(t){return typeof t=="string"?t.length>0:typeof t=="number"},sr=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=Math.pow(10,e)),Math.round(n*t)/n+0},Ds=function(t,e,n){return e===void 0&&(e=0),n===void 0&&(n=1),t>n?n:t>e?t:e},XC=function(t){return(t=isFinite(t)?t%360:0)>0?t:t+360},vE=function(t){return{r:Ds(t.r,0,255),g:Ds(t.g,0,255),b:Ds(t.b,0,255),a:Ds(t.a)}},yx=function(t){return{r:sr(t.r),g:sr(t.g),b:sr(t.b),a:sr(t.a,3)}},m4=/^#([0-9a-f]{3,8})$/i,Ry=function(t){var e=t.toString(16);return e.length<2?"0"+e:e},KC=function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=Math.max(e,n,i),l=s-Math.min(e,n,i),c=l?s===e?(n-i)/l:s===n?2+(i-e)/l:4+(e-n)/l:0;return{h:60*(c<0?c+6:c),s:s?l/s*100:0,v:s/255*100,a:r}},$C=function(t){var e=t.h,n=t.s,i=t.v,r=t.a;e=e/360*6,n/=100,i/=100;var s=Math.floor(e),l=i*(1-n),c=i*(1-(e-s)*n),d=i*(1-(1-e+s)*n),p=s%6;return{r:255*[i,c,l,l,d,i][p],g:255*[d,i,i,c,l,l][p],b:255*[l,l,d,i,i,c][p],a:r}},_E=function(t){return{h:XC(t.h),s:Ds(t.s,0,100),l:Ds(t.l,0,100),a:Ds(t.a)}},SE=function(t){return{h:sr(t.h),s:sr(t.s),l:sr(t.l),a:sr(t.a,3)}},EE=function(t){return $C((n=(e=t).s,{h:e.h,s:(n*=((i=e.l)<50?i:100-i)/100)>0?2*n/(i+n)*100:0,v:i+n,a:e.a}));var e,n,i},bm=function(t){return{h:(e=KC(t)).h,s:(r=(200-(n=e.s))*(i=e.v)/100)>0&&r<200?n*i/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,n,i,r},g4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,y4=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,b4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x4=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,Iv={string:[[function(t){var e=m4.exec(t);return e?(t=e[1]).length<=4?{r:parseInt(t[0]+t[0],16),g:parseInt(t[1]+t[1],16),b:parseInt(t[2]+t[2],16),a:t.length===4?sr(parseInt(t[3]+t[3],16)/255,2):1}:t.length===6||t.length===8?{r:parseInt(t.substr(0,2),16),g:parseInt(t.substr(2,2),16),b:parseInt(t.substr(4,2),16),a:t.length===8?sr(parseInt(t.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(t){var e=b4.exec(t)||x4.exec(t);return e?e[2]!==e[4]||e[4]!==e[6]?null:vE({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(t){var e=g4.exec(t)||y4.exec(t);if(!e)return null;var n,i,r=_E({h:(n=e[1],i=e[2],i===void 0&&(i="deg"),Number(n)*(p4[i]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return EE(r)},"hsl"]],object:[[function(t){var e=t.r,n=t.g,i=t.b,r=t.a,s=r===void 0?1:r;return Wo(e)&&Wo(n)&&Wo(i)?vE({r:Number(e),g:Number(n),b:Number(i),a:Number(s)}):null},"rgb"],[function(t){var e=t.h,n=t.s,i=t.l,r=t.a,s=r===void 0?1:r;if(!Wo(e)||!Wo(n)||!Wo(i))return null;var l=_E({h:Number(e),s:Number(n),l:Number(i),a:Number(s)});return EE(l)},"hsl"],[function(t){var e=t.h,n=t.s,i=t.v,r=t.a,s=r===void 0?1:r;if(!Wo(e)||!Wo(n)||!Wo(i))return null;var l=(function(c){return{h:XC(c.h),s:Ds(c.s,0,100),v:Ds(c.v,0,100),a:Ds(c.a)}})({h:Number(e),s:Number(n),v:Number(i),a:Number(s)});return $C(l)},"hsv"]]},wE=function(t,e){for(var n=0;n<e.length;n++){var i=e[n][0](t);if(i)return[i,e[n][1]]}return[null,void 0]},v4=function(t){return typeof t=="string"?wE(t.trim(),Iv.string):typeof t=="object"&&t!==null?wE(t,Iv.object):[null,void 0]},bx=function(t,e){var n=bm(t);return{h:n.h,s:Ds(n.s+100*e,0,100),l:n.l,a:n.a}},xx=function(t){return(299*t.r+587*t.g+114*t.b)/1e3/255},TE=function(t,e){var n=bm(t);return{h:n.h,s:n.s,l:Ds(n.l+100*e,0,100),a:n.a}},jv=(function(){function t(e){this.parsed=v4(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return t.prototype.isValid=function(){return this.parsed!==null},t.prototype.brightness=function(){return sr(xx(this.rgba),2)},t.prototype.isDark=function(){return xx(this.rgba)<.5},t.prototype.isLight=function(){return xx(this.rgba)>=.5},t.prototype.toHex=function(){return e=yx(this.rgba),n=e.r,i=e.g,r=e.b,l=(s=e.a)<1?Ry(sr(255*s)):"","#"+Ry(n)+Ry(i)+Ry(r)+l;var e,n,i,r,s,l},t.prototype.toRgb=function(){return yx(this.rgba)},t.prototype.toRgbString=function(){return e=yx(this.rgba),n=e.r,i=e.g,r=e.b,(s=e.a)<1?"rgba("+n+", "+i+", "+r+", "+s+")":"rgb("+n+", "+i+", "+r+")";var e,n,i,r,s},t.prototype.toHsl=function(){return SE(bm(this.rgba))},t.prototype.toHslString=function(){return e=SE(bm(this.rgba)),n=e.h,i=e.s,r=e.l,(s=e.a)<1?"hsla("+n+", "+i+"%, "+r+"%, "+s+")":"hsl("+n+", "+i+"%, "+r+"%)";var e,n,i,r,s},t.prototype.toHsv=function(){return e=KC(this.rgba),{h:sr(e.h),s:sr(e.s),v:sr(e.v),a:sr(e.a,3)};var e},t.prototype.invert=function(){return lo({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},t.prototype.saturate=function(e){return e===void 0&&(e=.1),lo(bx(this.rgba,e))},t.prototype.desaturate=function(e){return e===void 0&&(e=.1),lo(bx(this.rgba,-e))},t.prototype.grayscale=function(){return lo(bx(this.rgba,-1))},t.prototype.lighten=function(e){return e===void 0&&(e=.1),lo(TE(this.rgba,e))},t.prototype.darken=function(e){return e===void 0&&(e=.1),lo(TE(this.rgba,-e))},t.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},t.prototype.alpha=function(e){return typeof e=="number"?lo({r:(n=this.rgba).r,g:n.g,b:n.b,a:e}):sr(this.rgba.a,3);var n},t.prototype.hue=function(e){var n=bm(this.rgba);return typeof e=="number"?lo({h:e,s:n.s,l:n.l,a:n.a}):sr(n.h)},t.prototype.isEqual=function(e){return this.toHex()===lo(e).toHex()},t})(),lo=function(t){return t instanceof jv?t:new jv(t)},CE=[],_4=function(t){t.forEach(function(e){CE.indexOf(e)<0&&(e(jv,Iv),CE.push(e))})};function S4(t,e){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},i={};for(var r in n)i[n[r]]=r;var s={};t.prototype.toName=function(l){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var c,d,p=i[this.toHex()];if(p)return p;if(l!=null&&l.closest){var m=this.toRgb(),g=1/0,b="black";if(!s.length)for(var v in n)s[v]=new t(n[v]).toRgb();for(var _ in n){var A=(c=m,d=s[_],Math.pow(c.r-d.r,2)+Math.pow(c.g-d.g,2)+Math.pow(c.b-d.b,2));A<g&&(g=A,b=_)}return b}},e.string.push([function(l){var c=l.toLowerCase(),d=c==="transparent"?"#0000":n[c];return d?new t(d).toRgb():null},"name"])}_4([S4]);const ah=class um{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof um)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,n){const i=typeof e;if(i!==typeof n)return!1;if(i==="number"||i==="string"||e instanceof Number)return e===n;if(Array.isArray(e)&&Array.isArray(n)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(n))return e.length!==n.length?!1:e.every((s,l)=>s===n[l]);if(e!==null&&n!==null){const s=Object.keys(e),l=Object.keys(n);return s.length!==l.length?!1:s.every(c=>e[c]===n[c])}return e===n}toRgba(){const[e,n,i,r]=this._components;return{r:e,g:n,b:i,a:r}}toRgb(){const[e,n,i]=this._components;return{r:e,g:n,b:i}}toRgbaString(){const[e,n,i]=this.toUint8RgbArray();return`rgba(${e},${n},${i},${this.alpha})`}toUint8RgbArray(e){const[n,i,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(n*255),e[1]=Math.round(i*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[n,i,r,s]=this._components;return e[0]=n,e[1]=i,e[2]=r,e[3]=s,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[n,i,r]=this._components;return e[0]=n,e[1]=i,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,n,i]=this.toUint8RgbArray();return(i<<16)+(n<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[n,i,r,s]=um._temp.setValue(e)._components;return this._components[0]*=n,this._components[1]*=i,this._components[2]*=r,this._components[3]*=s,this._refreshInt(),this._value=null,this}premultiply(e,n=!0){return n&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,n=!0){if(e===1)return(255<<24)+this._int;if(e===0)return n?0:this._int;let i=this._int>>16&255,r=this._int>>8&255,s=this._int&255;return n&&(i=i*e+.5|0,r=r*e+.5|0,s=s*e+.5|0),(e*255<<24)+(i<<16)+(r<<8)+s}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(e){return this._components[3]=this._clamp(e),this._value=null,this}_normalize(e){let n,i,r,s;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const l=e;n=(l>>16&255)/255,i=(l>>8&255)/255,r=(l&255)/255,s=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[n,i,r,s=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[n,i,r,s=255]=e,n/=255,i/=255,r/=255,s/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const c=um.HEX_PATTERN.exec(e);c&&(e=`#${c[2]}`)}const l=lo(e);l.isValid()&&({r:n,g:i,b:r,a:s}=l.rgba,n/=255,i/=255,r/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=i,this._components[2]=r,this._components[3]=s,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,n,i]=this._components;this._int=(e*255<<16)+(n*255<<8)+(i*255|0)}_clamp(e,n=0,i=1){return typeof e=="number"?Math.min(Math.max(e,n),i):(e.forEach((r,s)=>{e[s]=Math.min(Math.max(r,n),i)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof um||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};ah.shared=new ah;ah._temp=new ah;ah.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Yi=ah;const E4={cullArea:null,cullable:!1,cullableChildren:!0};let vx=0;const AE=500;function da(...t){vx!==AE&&(vx++,vx===AE?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...t))}const Xm={_registeredResources:new Set,register(t){this._registeredResources.add(t)},unregister(t){this._registeredResources.delete(t)},release(){this._registeredResources.forEach(t=>t.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(t){return this._registeredResources.has(t)},reset(){this._registeredResources.clear()}};class w4{constructor(e,n){this._pool=[],this._count=0,this._index=0,this._classType=e,n&&this.prepopulate(n)}prepopulate(e){for(let n=0;n<e;n++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var i;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(i=n.init)==null||i.call(n,e),n}return(e){var n;(n=e.reset)==null||n.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){if(this._pool.length>0&&this._pool[0].destroy)for(let e=0;e<this._index;e++)this._pool[e].destroy();this._pool.length=0,this._count=0,this._index=0}}class T4{constructor(){this._poolsByClass=new Map}prepopulate(e,n){this.getPool(e).prepopulate(n)}get(e,n){return this.getPool(e).get(n)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new w4(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(n=>{const i=e[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;e[i]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),e}clear(){this._poolsByClass.forEach(e=>e.clear()),this._poolsByClass.clear()}}const ka=new T4;Xm.register(ka);const C4={get isCachedAsTexture(){var t;return!!((t=this.renderGroup)!=null&&t.isCachedAsTexture)},cacheAsTexture(t){typeof t=="boolean"&&t===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(t===!0?{}:t))},updateCacheTexture(){var t;(t=this.renderGroup)==null||t.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(t){rn("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(t)}};function A4(t,e,n){const i=t.length;let r;if(e>=i||n===0)return;n=e+n>i?i-e:n;const s=i-n;for(r=e;r<s;++r)t[r]=t[r+n];t.length=s}const M4={allowChildren:!0,removeChildren(t=0,e){var s;const n=e??this.children.length,i=n-t,r=[];if(i>0&&i<=n){for(let c=n-1;c>=t;c--){const d=this.children[c];d&&(r.push(d),d.parent=null)}A4(this.children,t,n);const l=this.renderGroup||this.parentRenderGroup;l&&l.removeChildren(r);for(let c=0;c<r.length;++c){const d=r[c];(s=d.parentRenderLayer)==null||s.detach(d),this.emit("childRemoved",d,this,c),r[c].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(i===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(t){const e=this.getChildAt(t);return this.removeChild(e)},getChildAt(t){if(t<0||t>=this.children.length)throw new Error(`getChildAt: Index (${t}) does not exist.`);return this.children[t]},setChildIndex(t,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(t),this.addChildAt(t,e)},getChildIndex(t){const e=this.children.indexOf(t);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(t,e){this.allowChildren||rn(yi,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(e<0||e>n.length)throw new Error(`${t}addChildAt: The index ${e} supplied is out of bounds ${n.length}`);const i=t.parent===this;if(t.parent){const s=t.parent.children.indexOf(t);if(i){if(s===e)return t;t.parent.children.splice(s,1)}else t.removeFromParent()}e===n.length?n.push(t):n.splice(e,0,t),t.parent=this,t.didChange=!0,t._updateFlags=15;const r=this.renderGroup||this.parentRenderGroup;return r&&r.addChild(t),this.sortableChildren&&(this.sortDirty=!0),i||(this.emit("childAdded",t,this,e),t.emit("added",this)),t},swapChildren(t,e){if(t===e)return;const n=this.getChildIndex(t),i=this.getChildIndex(e);this.children[n]=e,this.children[i]=t;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var t;(t=this.parent)==null||t.removeChild(this)},reparentChild(...t){return t.length===1?this.reparentChildAt(t[0],this.children.length):(t.forEach(e=>this.reparentChildAt(e,this.children.length)),t[0])},reparentChildAt(t,e){if(t.parent===this)return this.setChildIndex(t,e),t;const n=t.worldTransform.clone();t.removeFromParent(),this.addChildAt(t,e);const i=this.worldTransform.clone();return i.invert(),n.prepend(i),t.setFromMatrix(n),t},replaceChild(t,e){t.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(t)),e.setFromMatrix(t.localTransform),e.updateLocalTransform(),this.removeChild(t)}},R4={collectRenderables(t,e,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(t,e,n):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,t):this.collectRenderablesWithEffects(t,e,n))},collectRenderablesSimple(t,e,n){const i=this.children,r=i.length;for(let s=0;s<r;s++)i[s].collectRenderables(t,e,n)},collectRenderablesWithEffects(t,e,n){const{renderPipes:i}=e;for(let r=0;r<this.effects.length;r++){const s=this.effects[r];i[s.pipe].push(s,this,t)}this.collectRenderablesSimple(t,e,n);for(let r=this.effects.length-1;r>=0;r--){const s=this.effects[r];i[s.pipe].pop(s,this,t)}}};class ME{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class N4{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let n=0;n<this._tests.length;n++){const i=this._tests[n];if(i.test(e))return ka.get(i.maskClass,e)}return e}returnMaskEffect(e){ka.return(e)}}const Hv=new N4;oi.handleByList(Nt.MaskEffect,Hv._effectClasses);const k4={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const t=this.renderGroup||this.parentRenderGroup;t&&(t.structureDidChange=!0)},addEffect(t){this.effects.indexOf(t)===-1&&(this.effects.push(t),this.effects.sort((n,i)=>n.priority-i.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(t){const e=this.effects.indexOf(t);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(t){const e=this._maskEffect;(e==null?void 0:e.mask)!==t&&(e&&(this.removeEffect(e),Hv.returnMaskEffect(e),this._maskEffect=null),t!=null&&(this._maskEffect=Hv.getMaskEffect(t),this.addEffect(this._maskEffect)))},get mask(){var t;return(t=this._maskEffect)==null?void 0:t.mask},setMask(t){this._maskOptions={...this._maskOptions,...t},t.mask&&(this.mask=t.mask),this._markStructureAsChanged()},set filters(t){var s;!Array.isArray(t)&&t&&(t=[t]);const e=this._filterEffect||(this._filterEffect=new ME);t=t;const n=(t==null?void 0:t.length)>0,i=((s=e.filters)==null?void 0:s.length)>0,r=n!==i;t=Array.isArray(t)?t.slice(0):t,e.filters=Object.freeze(t),r&&(n?this.addEffect(e):(this.removeEffect(e),e.filters=t??null))},get filters(){var t;return(t=this._filterEffect)==null?void 0:t.filters},set filterArea(t){this._filterEffect||(this._filterEffect=new ME),this._filterEffect.filterArea=t},get filterArea(){var t;return(t=this._filterEffect)==null?void 0:t.filterArea}},O4={label:null,get name(){return rn(yi,"Container.name property has been removed, use Container.label instead"),this.label},set name(t){rn(yi,"Container.name property has been removed, use Container.label instead"),this.label=t},getChildByName(t,e=!1){return this.getChildByLabel(t,e)},getChildByLabel(t,e=!1){const n=this.children;for(let i=0;i<n.length;i++){const r=n[i];if(r.label===t||t instanceof RegExp&&t.test(r.label))return r}if(e)for(let i=0;i<n.length;i++){const s=n[i].getChildByLabel(t,!0);if(s)return s}return null},getChildrenByLabel(t,e=!1,n=[]){const i=this.children;for(let r=0;r<i.length;r++){const s=i[r];(s.label===t||t instanceof RegExp&&t.test(s.label))&&n.push(s)}if(e)for(let r=0;r<i.length;r++)i[r].getChildrenByLabel(t,!0,n);return n}},fa=ka.getPool(Ft),ic=ka.getPool(Bs),D4=new Ft,z4={getFastGlobalBounds(t,e){e||(e=new Bs),e.clear(),this._getGlobalBoundsRecursive(!!t,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(n.worldTransform),e},_getGlobalBoundsRecursive(t,e,n){let i=e;if(t&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(i=ic.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const l=this.bounds;i.addFrame(l.minX,l.minY,l.maxX,l.maxY,this.groupTransform)}const s=this.children;for(let l=0;l<s.length;l++)s[l]._getGlobalBoundsRecursive(t,i,n)}if(r){let s=!1;const l=this.renderGroup||this.parentRenderGroup;for(let c=0;c<this.effects.length;c++)this.effects[c].addBounds&&(s||(s=!0,i.applyMatrix(l.worldTransform)),this.effects[c].addBounds(i,!0));s&&i.applyMatrix(l.worldTransform.copyTo(D4).invert()),e.addBounds(i),ic.return(i)}else this.renderGroup&&(e.addBounds(i,this.relativeGroupTransform),ic.return(i))}};function WC(t,e,n){n.clear();let i,r;return t.parent?e?i=t.parent.worldTransform:(r=fa.get().identity(),i=F_(t,r)):i=Ft.IDENTITY,ZC(t,n,i,e),r&&fa.return(r),n.isValid||n.set(0,0,0,0),n}function ZC(t,e,n,i){var c,d;if(!t.visible||!t.measurable)return;let r;i?r=t.worldTransform:(t.updateLocalTransform(),r=fa.get(),r.appendFrom(t.localTransform,n));const s=e,l=!!t.effects.length;if(l&&(e=ic.get().clear()),t.boundsArea)e.addRect(t.boundsArea,r);else{const p=t.bounds;p&&!p.isEmpty()&&(e.matrix=r,e.addBounds(p));for(let m=0;m<t.children.length;m++)ZC(t.children[m],e,r,i)}if(l){for(let p=0;p<t.effects.length;p++)(d=(c=t.effects[p]).addBounds)==null||d.call(c,e);s.addBounds(e,Ft.IDENTITY),ic.return(e)}i||fa.return(r)}function F_(t,e){const n=t.parent;return n&&(F_(n,e),n.updateLocalTransform(),e.append(n.localTransform)),e}function QC(t,e){if(t===16777215||!e)return e;if(e===16777215||!t)return t;const n=t>>16&255,i=t>>8&255,r=t&255,s=e>>16&255,l=e>>8&255,c=e&255,d=n*s/255|0,p=i*l/255|0,m=r*c/255|0;return(d<<16)+(p<<8)+m}const RE=16777215;function NE(t,e){return t===RE?e:e===RE?t:QC(t,e)}function h0(t){return((t&255)<<16)+(t&65280)+(t>>16&255)}const B4={getGlobalAlpha(t){if(t)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,n=this.parent;for(;n;)e*=n.alpha,n=n.parent;return e},getGlobalTransform(t=new Ft,e){if(e)return t.copyFrom(this.worldTransform);this.updateLocalTransform();const n=F_(this,fa.get().identity());return t.appendFrom(this.localTransform,n),fa.return(n),t},getGlobalTint(t){if(t)return this.renderGroup?h0(this.renderGroup.worldColor):this.parentRenderGroup?h0(NE(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,n=this.parent;for(;n;)e=NE(e,n.localColor),n=n.parent;return h0(e)}};function JC(t,e,n){return e.clear(),n||(n=Ft.IDENTITY),eA(t,e,n,t,!0),e.isValid||e.set(0,0,0,0),e}function eA(t,e,n,i,r){var d,p;let s;if(r)s=fa.get(),s=n.copyTo(s);else{if(!t.visible||!t.measurable)return;t.updateLocalTransform();const m=t.localTransform;s=fa.get(),s.appendFrom(m,n)}const l=e,c=!!t.effects.length;if(c&&(e=ic.get().clear()),t.boundsArea)e.addRect(t.boundsArea,s);else{t.renderPipeId&&(e.matrix=s,e.addBounds(t.bounds));const m=t.children;for(let g=0;g<m.length;g++)eA(m[g],e,s,i,!1)}if(c){for(let m=0;m<t.effects.length;m++)(p=(d=t.effects[m]).addLocalBounds)==null||p.call(d,e,i);l.addBounds(e,Ft.IDENTITY),ic.return(e)}fa.return(s)}function tA(t,e){const n=t.children;for(let i=0;i<n.length;i++){const r=n[i],s=r.uid,l=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,c=e.index;(e.data[c]!==s||e.data[c+1]!==l)&&(e.data[e.index]=s,e.data[e.index+1]=l,e.didChange=!0),e.index=c+2,r.children.length&&tA(r,e)}return e.didChange}const L4=new Ft,U4={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(t,e){const n=Math.sign(this.scale.x)||1;e!==0?this.scale.x=t/e*n:this.scale.x=n},_setHeight(t,e){const n=Math.sign(this.scale.y)||1;e!==0?this.scale.y=t/e*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new Bs});const t=this._localBoundsCacheData;return t.index=1,t.didChange=!1,t.data[0]!==this._didViewChangeTick&&(t.didChange=!0,t.data[0]=this._didViewChangeTick),tA(this,t),t.didChange&&JC(this,t.localBounds,L4),t.localBounds},getBounds(t,e){return WC(this,t,e||new Bs)}},I4={_onRender:null,set onRender(t){const e=this.renderGroup||this.parentRenderGroup;if(!t){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=t},get onRender(){return this._onRender}},j4={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(t){this._zIndex!==t&&(this._zIndex=t,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(H4))}};function H4(t,e){return t._zIndex-e._zIndex}const P4={getGlobalPosition(t=new Lr,e=!1){return this.parent?this.parent.toGlobal(this._position,t,e):(t.x=this._position.x,t.y=this._position.y),t},toGlobal(t,e,n=!1){const i=this.getGlobalTransform(fa.get(),n);return e=i.apply(t,e),fa.return(i),e},toLocal(t,e,n,i){e&&(t=e.toGlobal(t,n,i));const r=this.getGlobalTransform(fa.get(),i);return n=r.applyInverse(t,n),fa.return(r),n}};class q_{constructor(){this.uid=bi("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}destroy(){this.instructions.length=0,this.renderables.length=0,this.renderPipes=null,this.gcTick=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let G4=0;class F4{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new rh(this.textureOptions)}createTexture(e,n,i,r){const s=new Ls({...this.textureOptions,width:e,height:n,resolution:1,antialias:i,autoGarbageCollect:!1,autoGenerateMipmaps:r});return new Rn({source:s,label:`texturePool_${G4++}`})}getOptimalTexture(e,n,i=1,r,s=!1){let l=Math.ceil(e*i-1e-6),c=Math.ceil(n*i-1e-6);l=ih(l),c=ih(c);const d=r?1:0,p=s?1:0,m=(l<<17)+(c<<2)+(p<<1)+d;this._texturePool[m]||(this._texturePool[m]=[]);let g=this._texturePool[m].pop();return g||(g=this.createTexture(l,c,r,s)),g.source._resolution=i,g.source.width=l/i,g.source.height=c/i,g.source.pixelWidth=l,g.source.pixelHeight=c,g.frame.x=0,g.frame.y=0,g.frame.width=e,g.frame.height=n,g.updateUvs(),this._poolKeyHash[g.uid]=m,g}getSameSizeTexture(e,n=!1){const i=e.source;return this.getOptimalTexture(e.width,e.height,i._resolution,n)}returnTexture(e,n=!1){const i=this._poolKeyHash[e.uid];n&&(e.source.style=this.textureStyle),this._texturePool[i].push(e)}clear(e){if(e=e!==!1,e)for(const n in this._texturePool){const i=this._texturePool[n];if(i)for(let r=0;r<i.length;r++)i[r].destroy(!0)}this._texturePool={}}}const Z0=new F4;Xm.register(Z0);class q4{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Ft,this.worldColorAlpha=4294967295,this.worldColor=16777215,this.worldAlpha=1,this.childrenToUpdate=Object.create(null),this.updateTick=0,this.gcTick=0,this.childrenRenderablesToUpdate={list:[],index:0},this.structureDidChange=!0,this.instructionSet=new q_,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const n=e.children;for(let i=0;i<n.length;i++){const r=n[i];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(Z0.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const e=this._parentCacheAsTextureRenderGroup;e&&!e.textureNeedsUpdate&&e.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const n=this.childrenToUpdate[e];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const n=this.renderGroupChildren.indexOf(e);n>-1&&this.renderGroupChildren.splice(n,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const n=e.children;for(let i=0;i<n.length;i++)this.addChild(n[i])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const n=e.children;for(let i=0;i<n.length;i++)this.removeChild(n[i])}removeChildren(e){for(let n=0;n<e.length;n++)this.removeChild(e[n])}onChildUpdate(e){let n=this.childrenToUpdate[e.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const n=this.root.children;for(let i=0;i<n.length;i++)this._getChildren(n[i],e);return e}_getChildren(e,n=[]){if(n.push(e),e.renderGroup)return n;const i=e.children;for(let r=0;r<i.length;r++)this._getChildren(i[r],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Ft),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Ft),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Ft),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function Y4(t,e,n={}){for(const i in e)!n[i]&&e[i]!==void 0&&(t[i]=e[i])}const _x=new vr(null),Ny=new vr(null),Sx=new vr(null,1,1),ky=new vr(null),kE=1,V4=2,Ex=4;class _r extends go{constructor(e={}){var n,i;super(),this.uid=bi("renderable"),this._updateFlags=15,this.renderGroup=null,this.parentRenderGroup=null,this.parentRenderGroupIndex=0,this.didChange=!1,this.didViewUpdate=!1,this.relativeRenderGroupDepth=0,this.children=[],this.parent=null,this.includeInBuild=!0,this.measurable=!0,this.isSimple=!0,this.parentRenderLayer=null,this.updateTick=-1,this.localTransform=new Ft,this.relativeGroupTransform=new Ft,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new vr(this,0,0),this._scale=Sx,this._pivot=Ny,this._origin=ky,this._skew=_x,this._cx=1,this._sx=0,this._cy=0,this._sy=1,this._rotation=0,this.localColor=16777215,this.localAlpha=1,this.groupAlpha=1,this.groupColor=16777215,this.groupColorAlpha=4294967295,this.localBlendMode="inherit",this.groupBlendMode="normal",this.localDisplayStatus=7,this.globalDisplayStatus=7,this._didContainerChangeTick=0,this._didViewChangeTick=0,this._didLocalTransformChangeId=-1,this.effects=[],Y4(this,e,{children:!0,parent:!0,effects:!0}),(n=e.children)==null||n.forEach(r=>this.addChild(r)),(i=e.parent)==null||i.addChild(this)}static mixin(e){rn("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),oi.mixin(_r,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||rn(yi,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const n=e[0],i=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),i&&(i.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,i&&i.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const n=e[0],i=this.children.indexOf(n);return i>-1&&(this._didViewChangeTick++,this.children.splice(i,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,i),n.emit("removed",this)),n}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=ka.get(q4,this),this.groupTransform=Ft.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),ka.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Ft),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*s4}set angle(e){this.rotation=e*l4}get pivot(){return this._pivot===Ny&&(this._pivot=new vr(this,0,0)),this._pivot}set pivot(e){this._pivot===Ny&&(this._pivot=new vr(this,0,0),this._origin!==ky&&da("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===_x&&(this._skew=new vr(this,0,0)),this._skew}set skew(e){this._skew===_x&&(this._skew=new vr(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===Sx&&(this._scale=new vr(this,1,1)),this._scale}set scale(e){this._scale===Sx&&(this._scale=new vr(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===ky&&(this._origin=new vr(this,0,0)),this._origin}set origin(e){this._origin===ky&&(this._origin=new vr(this,0,0),this._pivot!==Ny&&da("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const n=this.getLocalBounds().width;this._setWidth(e,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const n=this.getLocalBounds().height;this._setHeight(e,n)}getSize(e){e||(e={});const n=this.getLocalBounds();return e.width=Math.abs(this.scale.x*n.width),e.height=Math.abs(this.scale.y*n.height),e}setSize(e,n){const i=this.getLocalBounds();typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,i.width),n!==void 0&&this._setHeight(n,i.height)}_updateSkew(){const e=this._rotation,n=this._skew;this._cx=Math.cos(e+n._y),this._sx=Math.sin(e+n._y),this._cy=-Math.sin(e-n._x),this._sy=Math.cos(e-n._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const n=this.localTransform,i=this._scale,r=this._pivot,s=this._origin,l=this._position,c=i._x,d=i._y,p=r._x,m=r._y,g=-s._x,b=-s._y;n.a=this._cx*c,n.b=this._sx*c,n.c=this._cy*d,n.d=this._sy*d,n.tx=l._x-(p*n.a+m*n.c)+(g*n.a+b*n.c)-g,n.ty=l._y-(p*n.b+m*n.d)+(g*n.b+b*n.d)-b}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=kE,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const i=Yi.shared.setValue(e??16777215).toBgrNumber();i!==this.localColor&&(this.localColor=i,this._updateFlags|=kE,this._onUpdate())}get tint(){return h0(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=V4,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const n=e?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ex,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",e))}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const n=e?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Ex,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const n=e?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Ex,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var r;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e==null?void 0:e.children)&&n)for(let s=0;s<n.length;++s)n[s].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}oi.mixin(_r,M4,z4,P4,I4,U4,k4,O4,j4,E4,C4,B4,R4);class Y_ extends _r{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this._bounds=new Bs(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=e.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const n=this.bounds,{x:i,y:r}=e;return i>=n.minX&&i<=n.maxX&&r>=n.minY&&r<=n.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(e){this.unload(),super.destroy(e),this._bounds=null}collectRenderablesSimple(e,n,i){const{renderPipes:r}=n;r.blendMode.pushBlendMode(this,this.groupBlendMode,e);const l=r[this.renderPipeId];l!=null&&l.addRenderable&&l.addRenderable(this,e),this.didViewUpdate=!1;const c=this.children,d=c.length;for(let p=0;p<d;p++)c[p].collectRenderables(e,n,i);r.blendMode.popBlendMode(e)}}class sh extends Y_{constructor(e=Rn.EMPTY){e instanceof Rn&&(e={texture:e});const{texture:n=Rn.EMPTY,anchor:i,roundPixels:r,width:s,height:l,...c}=e;super({label:"Sprite",...c}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new vr({_onUpdate:()=>{this.onViewUpdate()}}),i?this.anchor=i:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=r??!1,s!==void 0&&(this.width=s),l!==void 0&&(this.height=l)}static from(e,n=!1){return e instanceof Rn?new sh(e):new sh(Rn.from(e,n))}set texture(e){e||(e=Rn.EMPTY);const n=this._texture;n!==e&&(n&&n.dynamic&&n.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return VC(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return rn("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,n=this._texture,i=this._bounds,{width:r,height:s}=n.orig;i.minX=-e._x*r,i.maxX=i.minX+r,i.minY=-e._y*s,i.maxY=i.minY+s}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const i=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(i)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,n){typeof e=="object"?(n=e.height??e.width,e=e.width):n??(n=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const X4=new Bs;function nA(t,e,n){const i=X4;t.measurable=!0,WC(t,n,i),e.addBoundsMask(i),t.measurable=!1}function iA(t,e,n){const i=ic.get();t.measurable=!0;const r=fa.get().identity(),s=rA(t,n,r);JC(t,i,s),t.measurable=!1,e.addBoundsMask(i),fa.return(r),ic.return(i)}function rA(t,e,n){return t?(t!==e&&(rA(t.parent,e,n),t.updateLocalTransform(),n.append(t.localTransform)),n):(da("Mask bounds, renderable is not inside the root container"),n)}class aA{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof sh),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask=null)}addBounds(e,n){this.inverse||nA(this.mask,e,n)}addLocalBounds(e,n){iA(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof sh}}aA.extension=Nt.MaskEffect;class sA{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}sA.extension=Nt.MaskEffect;class lA{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(e,n){nA(this.mask,e,n)}addLocalBounds(e,n){iA(this.mask,e,n)}containsPoint(e,n){const i=this.mask;return n(i,e)}destroy(){this.reset()}static test(e){return e instanceof _r}}lA.extension=Nt.MaskEffect;const K4={createCanvas:(t,e)=>{const n=document.createElement("canvas");return n.width=t,n.height=e,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(t,e)=>fetch(t,e),parseXML:t=>new DOMParser().parseFromString(t,"text/xml")};let OE=K4;const ns={get(){return OE},set(t){OE=t}};class oA extends Ls{constructor(e){e.resource||(e.resource=ns.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,n=this.height,i=this._resolution){const r=super.resize(e,n,i);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}oA.extension=Nt.TextureSource;class E0 extends Ls{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}E0.extension=Nt.TextureSource;var w0=(t=>(t[t.INTERACTION=50]="INTERACTION",t[t.HIGH=25]="HIGH",t[t.NORMAL=0]="NORMAL",t[t.LOW=-25]="LOW",t[t.UTILITY=-50]="UTILITY",t))(w0||{});class wx{constructor(e,n=null,i=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=n,this.priority=i,this._once=r}match(e,n=null){return this._fn===e&&this._context===n}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const n=this.next;return this.next=e?null:n,this.previous=null,n}}const cA=class Qa{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new wx(null,null,1/0),this.deltaMS=1/Qa.targetFPMS,this.elapsedMS=1/Qa.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,n,i=w0.NORMAL){return this._addListener(new wx(e,n,i))}addOnce(e,n,i=w0.NORMAL){return this._addListener(new wx(e,n,i,!0))}_addListener(e){let n=this._head.next,i=this._head;if(!n)e.connect(i);else{for(;n;){if(e.priority>n.priority){e.connect(i);break}i=n,n=n.next}e.previous||e.connect(i)}return this._startIfPossible(),this}remove(e,n){let i=this._head.next;for(;i;)i.match(e,n)?i=i.destroy():i=i.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,n=this._head;for(;n=n.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let n;if(e>this.lastTime){if(n=this.elapsedMS=e-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const s=e-this._lastFrame|0;if(s<this._minElapsedMS)return;this._lastFrame=e-s%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*Qa.targetFPMS;const i=this._head;let r=i.next;for(;r;)r=r.emit(this);i.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const n=Math.min(Math.max(0,e)/1e3,Qa.targetFPMS);this._maxElapsedMS=1/n,this._minElapsedMS&&e>this.maxFPS&&(this.maxFPS=e)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){e===0?this._minElapsedMS=0:(e<this.minFPS&&(this.minFPS=e),this._minElapsedMS=1/(e/1e3))}static get shared(){if(!Qa._shared){const e=Qa._shared=new Qa;e.autoStart=!0,e._protected=!0}return Qa._shared}static get system(){if(!Qa._system){const e=Qa._system=new Qa;e.autoStart=!0,e._protected=!0}return Qa._system}};cA.targetFPMS=.06;let Vd=cA,Tx;async function $4(){return Tx??(Tx=(async()=>{var l;const e=ns.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const n=await new Promise(c=>{const d=document.createElement("video");d.onloadeddata=()=>c(d),d.onerror=()=>c(null),d.autoplay=!1,d.crossOrigin="anonymous",d.preload="auto",d.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",d.load()});if(!n)return"premultiply-alpha-on-upload";const i=e.createTexture();e.bindTexture(e.TEXTURE_2D,i);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,i,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,n);const s=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,s),e.deleteFramebuffer(r),e.deleteTexture(i),(l=e.getExtension("WEBGL_lose_context"))==null||l.loseContext(),s[0]<=s[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Tx}const Q0=class uA extends Ls{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...uA.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=Vd.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,n=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(n.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await $4(),this._load=new Promise((i,r)=>{this.isValid?i(this):(this._resolve=i,this._reject=r,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Vd.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Vd.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Vd.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};Q0.extension=Nt.TextureSource;Q0.defaultOptions={...Ls.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Q0.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let W4=Q0;const Hd=(t,e,n=!1)=>(Array.isArray(t)||(t=[t]),e?t.map(i=>typeof i=="string"||n?e(i):i):t);class Z4{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const n=this._cache.get(e);return n||da(`[Assets] Asset id ${e} was not found in the Cache`),n}set(e,n){const i=Hd(e);let r;for(let d=0;d<this.parsers.length;d++){const p=this.parsers[d];if(p.test(n)){r=p.getCacheableAssets(i,n);break}}const s=new Map(Object.entries(r||{}));r||i.forEach(d=>{s.set(d,n)});const l=[...s.keys()],c={cacheKeys:l,keys:i};i.forEach(d=>{this._cacheMap.set(d,c)}),l.forEach(d=>{const p=r?r[d]:n;this._cache.has(d)&&this._cache.get(d)!==p&&da("[Cache] already has key:",d),this._cache.set(d,s.get(d))})}remove(e){if(!this._cacheMap.has(e)){da(`[Assets] Asset id ${e} was not found in the Cache`);return}const n=this._cacheMap.get(e);n.cacheKeys.forEach(r=>{this._cache.delete(r)}),n.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Pd=new Z4,Pv=[];oi.handleByList(Nt.TextureSource,Pv);function fA(t={}){const e=t&&t.resource,n=e?t.resource:t,i=e?t:{resource:t};for(let r=0;r<Pv.length;r++){const s=Pv[r];if(s.test(n))return new s(i)}throw new Error(`Could not find a source type for resource: ${i.resource}`)}function Q4(t={},e=!1){const n=t&&t.resource,i=n?t.resource:t,r=n?t:{resource:t};if(!e&&Pd.has(i))return Pd.get(i);const s=new Rn({source:fA(r)});return s.on("destroy",()=>{Pd.has(i)&&Pd.remove(i)}),e||Pd.set(i,s),s}function J4(t,e=!1){return typeof t=="string"?Pd.get(t):t instanceof Ls?new Rn({source:t}):Q4(t,e)}Rn.from=J4;Ls.from=fA;oi.add(aA,sA,lA,W4,E0,oA,G_);var dA=(t=>(t[t.Low=0]="Low",t[t.Normal=1]="Normal",t[t.High=2]="High",t))(dA||{});function cl(t){if(typeof t!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(t)}`)}function Xp(t){return t.split("?")[0].split("#")[0]}function ez(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function tz(t,e,n){return t.replace(new RegExp(ez(e),"g"),n)}function nz(t,e){let n="",i=0,r=-1,s=0,l=-1;for(let c=0;c<=t.length;++c){if(c<t.length)l=t.charCodeAt(c);else{if(l===47)break;l=47}if(l===47){if(!(r===c-1||s===1))if(r!==c-1&&s===2){if(n.length<2||i!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const d=n.lastIndexOf("/");if(d!==n.length-1){d===-1?(n="",i=0):(n=n.slice(0,d),i=n.length-1-n.lastIndexOf("/")),r=c,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,r=c,s=0;continue}}}else n.length>0?n+=`/${t.slice(r+1,c)}`:n=t.slice(r+1,c),i=c-r-1;r=c,s=0}else l===46&&s!==-1?++s:s=-1}return n}const Mm={toPosix(t){return tz(t,"\\","/")},isUrl(t){return/^https?:/.test(this.toPosix(t))},isDataUrl(t){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(t)},isBlobUrl(t){return t.startsWith("blob:")},hasProtocol(t){return/^[^/:]+:/.test(this.toPosix(t))},getProtocol(t){cl(t),t=this.toPosix(t);const e=/^file:\/\/\//.exec(t);if(e)return e[0];const n=/^[^/:]+:\/{0,2}/.exec(t);return n?n[0]:""},toAbsolute(t,e,n){if(cl(t),this.isDataUrl(t)||this.isBlobUrl(t))return t;const i=Xp(this.toPosix(e??ns.get().getBaseUrl())),r=Xp(this.toPosix(n??this.rootname(i)));return t=this.toPosix(t),t.startsWith("/")?Mm.join(r,t.slice(1)):this.isAbsolute(t)?t:this.join(i,t)},normalize(t){if(cl(t),t.length===0)return".";if(this.isDataUrl(t)||this.isBlobUrl(t))return t;t=this.toPosix(t);let e="";const n=t.startsWith("/");this.hasProtocol(t)&&(e=this.rootname(t),t=t.slice(e.length));const i=t.endsWith("/");return t=nz(t),t.length>0&&i&&(t+="/"),n?`/${t}`:e+t},isAbsolute(t){return cl(t),t=this.toPosix(t),this.hasProtocol(t)?!0:t.startsWith("/")},join(...t){if(t.length===0)return".";let e;for(let n=0;n<t.length;++n){const i=t[n];if(cl(i),i.length>0)if(e===void 0)e=i;else{const r=t[n-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${i}`:e+=`/${i}`}}return e===void 0?".":this.normalize(e)},dirname(t){if(cl(t),t.length===0)return".";t=this.toPosix(t);let e=t.charCodeAt(0);const n=e===47;let i=-1,r=!0;const s=this.getProtocol(t),l=t;t=t.slice(s.length);for(let c=t.length-1;c>=1;--c)if(e=t.charCodeAt(c),e===47){if(!r){i=c;break}}else r=!1;return i===-1?n?"/":this.isUrl(l)?s+t:s:n&&i===1?"//":s+t.slice(0,i)},rootname(t){cl(t),t=this.toPosix(t);let e="";if(t.startsWith("/")?e="/":e=this.getProtocol(t),this.isUrl(t)){const n=t.indexOf("/",e.length);n!==-1?e=t.slice(0,n):e=t,e.endsWith("/")||(e+="/")}return e},basename(t,e){cl(t),e&&cl(e),t=Xp(this.toPosix(t));let n=0,i=-1,r=!0,s;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e.length===t.length&&e===t)return"";let l=e.length-1,c=-1;for(s=t.length-1;s>=0;--s){const d=t.charCodeAt(s);if(d===47){if(!r){n=s+1;break}}else c===-1&&(r=!1,c=s+1),l>=0&&(d===e.charCodeAt(l)?--l===-1&&(i=s):(l=-1,i=c))}return n===i?i=c:i===-1&&(i=t.length),t.slice(n,i)}for(s=t.length-1;s>=0;--s)if(t.charCodeAt(s)===47){if(!r){n=s+1;break}}else i===-1&&(r=!1,i=s+1);return i===-1?"":t.slice(n,i)},extname(t){cl(t),t=Xp(this.toPosix(t));let e=-1,n=0,i=-1,r=!0,s=0;for(let l=t.length-1;l>=0;--l){const c=t.charCodeAt(l);if(c===47){if(!r){n=l+1;break}continue}i===-1&&(r=!1,i=l+1),c===46?e===-1?e=l:s!==1&&(s=1):e!==-1&&(s=-1)}return e===-1||i===-1||s===0||s===1&&e===i-1&&e===n+1?"":t.slice(e,i)},parse(t){cl(t);const e={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return e;t=Xp(this.toPosix(t));let n=t.charCodeAt(0);const i=this.isAbsolute(t);let r;e.root=this.rootname(t),i||this.hasProtocol(t)?r=1:r=0;let s=-1,l=0,c=-1,d=!0,p=t.length-1,m=0;for(;p>=r;--p){if(n=t.charCodeAt(p),n===47){if(!d){l=p+1;break}continue}c===-1&&(d=!1,c=p+1),n===46?s===-1?s=p:m!==1&&(m=1):s!==-1&&(m=-1)}return s===-1||c===-1||m===0||m===1&&s===c-1&&s===l+1?c!==-1&&(l===0&&i?e.base=e.name=t.slice(1,c):e.base=e.name=t.slice(l,c)):(l===0&&i?(e.name=t.slice(1,s),e.base=t.slice(1,c)):(e.name=t.slice(l,s),e.base=t.slice(l,c)),e.ext=t.slice(s,c)),e.dir=this.dirname(t),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function hA(t,e,n,i,r){const s=e[n];for(let l=0;l<s.length;l++){const c=s[l];n<e.length-1?hA(t.replace(i[n],c),e,n+1,i,r):r.push(t.replace(i[n],c))}}function iz(t){const e=/\{(.*?)\}/g,n=t.match(e),i=[];if(n){const r=[];n.forEach(s=>{const l=s.substring(1,s.length-1).split(",");r.push(l)}),hA(t,r,0,n,i)}else i.push(t);return i}const DE=t=>!Array.isArray(t);class pA{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,n)=>`${e}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(e,n)=>n.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const n=e;this._defaultSearchParams=Object.keys(n).map(i=>`${encodeURIComponent(i)}=${encodeURIComponent(n[i])}`).join("&")}}getAlias(e){const{alias:n,src:i}=e;return Hd(n||i,s=>typeof s=="string"?s:Array.isArray(s)?s.map(l=>(l==null?void 0:l.src)??l):s!=null&&s.src?s.src:s,!0)}removeAlias(e,n){this._assetMap[e]&&(n&&n!==this._resolverHash[e]||(delete this._resolverHash[e],delete this._assetMap[e]))}addManifest(e){this._manifest&&da("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(e,n){const i=[];let r=n;Array.isArray(n)||(r=Object.entries(n).map(([s,l])=>typeof l=="string"||Array.isArray(l)?{alias:s,src:l}:{alias:s,...l})),r.forEach(s=>{const l=s.src,c=s.alias;let d;if(typeof c=="string"){const p=this._createBundleAssetId(e,c);i.push(p),d=[c,p]}else{const p=c.map(m=>this._createBundleAssetId(e,m));i.push(...p),d=[...c,...p]}this.add({...s,alias:d,src:l})}),this._bundles[e]=i}add(e){const n=[];Array.isArray(e)?n.push(...e):n.push(e);let i;i=s=>{this.hasKey(s)&&da(`[Resolver] already has key: ${s} overwriting`)},Hd(n).forEach(s=>{const{src:l}=s;let{data:c,format:d,loadParser:p,parser:m}=s;const g=Hd(l).map(A=>typeof A=="string"?iz(A):Array.isArray(A)?A:[A]),b=this.getAlias(s);Array.isArray(b)?b.forEach(i):i(b);const v=[],_=A=>{const C=this._parsers.find(w=>w.test(A));return{src:A,...C==null?void 0:C.parse(A)}};g.forEach(A=>{A.forEach(C=>{let w={};if(typeof C!="object"?w=_(C):(c=C.data??c,d=C.format??d,(C.loadParser||C.parser)&&(p=C.loadParser??p,m=C.parser??m),w={..._(C.src),...C}),!b)throw new Error(`[Resolver] alias is undefined for this asset: ${w.src}`);w=this._buildResolvedAsset(w,{aliases:b,data:c,format:d,loadParser:p,parser:m,progressSize:s.progressSize}),v.push(w)})}),b.forEach(A=>{this._assetMap[A]=v})})}resolveBundle(e){const n=DE(e);e=Hd(e);const i={};return e.forEach(r=>{const s=this._bundles[r];if(s){const l=this.resolve(s),c={};for(const d in l){const p=l[d];c[this._extractAssetIdFromBundle(r,d)]=p}i[r]=c}}),n?i[e[0]]:i}resolveUrl(e){const n=this.resolve(e);if(typeof e!="string"){const i={};for(const r in n)i[r]=n[r].src;return i}return n.src}resolve(e){const n=DE(e);e=Hd(e);const i={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let s=this._assetMap[r];const l=this._getPreferredOrder(s);l==null||l.priority.forEach(c=>{l.params[c].forEach(d=>{const p=s.filter(m=>m[c]?m[c]===d:!1);p.length&&(s=p)})}),this._resolverHash[r]=s[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});i[r]=this._resolverHash[r]}),n?i[e[0]]:i}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let n=0;n<e.length;n++){const i=e[n],r=this._preferredOrder.find(s=>s.params.format.includes(i.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const n=/\?/.test(e)?"&":"?";return`${e}${n}${this._defaultSearchParams}`}_buildResolvedAsset(e,n){const{aliases:i,data:r,loadParser:s,parser:l,format:c,progressSize:d}=n;return(this._basePath||this._rootPath)&&(e.src=Mm.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=i??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=s??e.loadParser,e.parser=l??e.parser,e.format=c??e.format??rz(e.src),d!==void 0&&(e.progressSize=d),e}}pA.RETINA_PREFIX=/@([0-9\.]+)x/;function rz(t){return t.split(".").pop().split("?").shift().split("#").shift()}const zE=(t,e)=>{const n=e.split("?")[1];return n&&(t+=`?${n}`),t},mA=class fm{constructor(e,n){this.linkedSheets=[];let i=e;(e==null?void 0:e.source)instanceof Ls&&(i={texture:e,data:n});const{texture:r,data:s,cachePrefix:l=""}=i;this.cachePrefix=l,this._texture=r instanceof Rn?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=s;const c=parseFloat(s.meta.scale);c?(this.resolution=c,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=fm.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(e,n=!1){let i=e;const r=n?1/0:fm.BATCH_SIZE;for(;i-e<r&&i<this._frameKeys.length;){const s=this._frameKeys[i],l=this._frames[s],c=l.frame;if(c){let d=null,p=null;const m=l.trimmed!==!1&&l.sourceSize?l.sourceSize:l.frame,g=new Ci(0,0,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution);l.rotated?d=new Ci(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.h)/this.resolution,Math.floor(c.w)/this.resolution):d=new Ci(Math.floor(c.x)/this.resolution,Math.floor(c.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution),l.trimmed!==!1&&l.spriteSourceSize&&(p=new Ci(Math.floor(l.spriteSourceSize.x)/this.resolution,Math.floor(l.spriteSourceSize.y)/this.resolution,Math.floor(c.w)/this.resolution,Math.floor(c.h)/this.resolution)),this.textures[s]=new Rn({source:this.textureSource,frame:d,orig:g,trim:p,rotate:l.rotated?2:0,defaultAnchor:l.anchor,defaultBorders:l.borders,label:s.toString()})}i++}}_processAnimations(){const e=this.data.animations||{};for(const n in e){this.animations[n]=[];for(let i=0;i<e[n].length;i++){const r=e[n][i];this.animations[n].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*fm.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*fm.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var n;for(const i in this.textures)this.textures[i].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};mA.BATCH_SIZE=1e3;let BE=mA;const az=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function gA(t,e,n){const i={};if(t.forEach(r=>{i[r]=e}),Object.keys(e.textures).forEach(r=>{i[`${e.cachePrefix}${r}`]=e.textures[r]}),!n){const r=Mm.dirname(t[0]);e.linkedSheets.forEach((s,l)=>{const c=gA([`${r}/${e.data.meta.related_multi_packs[l]}`],s,!0);Object.assign(i,c)})}return i}const sz={extension:Nt.Asset,cache:{test:t=>t instanceof BE,getCacheableAssets:(t,e)=>gA(t,e,!1)},resolver:{extension:{type:Nt.ResolveParser,name:"resolveSpritesheet"},test:t=>{const n=t.split("?")[0].split("."),i=n.pop(),r=n.pop();return i==="json"&&az.includes(r)},parse:t=>{var n;const e=t.split(".");return{resolution:parseFloat(((n=pA.RETINA_PREFIX.exec(t))==null?void 0:n[1])??"1"),format:e[e.length-2],src:t}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Nt.LoadParser,priority:dA.Normal,name:"spritesheetLoader"},async testParse(t,e){return Mm.extname(e.src).toLowerCase()===".json"&&!!t.frames},async parse(t,e,n){var g,b;const{texture:i,imageFilename:r,textureOptions:s,cachePrefix:l}=(e==null?void 0:e.data)??{};let c=Mm.dirname(e.src);c&&c.lastIndexOf("/")!==c.length-1&&(c+="/");let d;if(i instanceof Rn)d=i;else{const v=zE(c+(r??t.meta.image),e.src);d=(await n.load([{src:v,data:s}]))[v]}const p=new BE({texture:d.source,data:t,cachePrefix:l});await p.parse();const m=(g=t==null?void 0:t.meta)==null?void 0:g.related_multi_packs;if(Array.isArray(m)){const v=[];for(const A of m){if(typeof A!="string")continue;let C=c+A;(b=e.data)!=null&&b.ignoreMultiPack||(C=zE(C,e.src),v.push(n.load({src:C,data:{textureOptions:s,ignoreMultiPack:!0}})))}const _=await Promise.all(v);p.linkedSheets=_,_.forEach(A=>{A.linkedSheets=[p].concat(p.linkedSheets.filter(C=>C!==A))})}return p},async unload(t,e,n){await n.unload(t.textureSource._sourceOrigin),t.destroy(!1)}}};oi.add(sz);const Cx=Object.create(null),LE=Object.create(null);function V_(t,e){let n=LE[t];return n===void 0&&(Cx[e]===void 0&&(Cx[e]=1),LE[t]=n=Cx[e]++),n}let Od;function yA(){return(!Od||Od!=null&&Od.isContextLost())&&(Od=ns.get().createCanvas().getContext("webgl",{})),Od}let Oy;function lz(){if(!Oy){Oy="mediump";const t=yA();t&&t.getShaderPrecisionFormat&&(Oy=t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision?"highp":"mediump")}return Oy}function oz(t,e,n){return e?t:n?(t=t.replace("out vec4 finalColor;",""),`
|
|
@@ -79,7 +79,7 @@ Deprecated since v${t}`,s=typeof console.groupCollapsed=="function"&&!Yd.noColor
|
|
|
79
79
|
`}function cz(t,e,n){const i=n?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(t.substring(0,9)!=="precision"){let r=n?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&i!=="highp"&&(r="mediump"),`precision ${r} float;
|
|
80
80
|
${t}`}else if(i!=="highp"&&t.substring(0,15)==="precision highp")return t.replace("precision highp","precision mediump");return t}function uz(t,e){return e?`#version 300 es
|
|
81
81
|
${t}`:t}const fz={},dz={};function hz(t,{name:e="pixi-program"},n=!0){e=e.replace(/\s+/g,"-"),e+=n?"-fragment":"-vertex";const i=n?fz:dz;return i[e]?(i[e]++,e+=`-${i[e]}`):i[e]=1,t.indexOf("#define SHADER_NAME")!==-1?t:`${`#define SHADER_NAME ${e}`}
|
|
82
|
-
${t}`}function pz(t,e){return e?t.replace("#version 300 es",""):t}const Ax={stripVersion:pz,ensurePrecision:cz,addProgramDefines:oz,setProgramName:hz,insertVersion:uz},Kp=Object.create(null),bA=class Gv{constructor(e){e={...Gv.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:lz()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let r=e.fragment,s=e.vertex;Object.keys(Ax).forEach(l=>{const c=i[l];r=Ax[l](r,c,!0),s=Ax[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=V_(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Kp[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Kp[n]||(Kp[n]=new Gv(e),Kp[n]._cacheKey=n),Kp[n]}};bA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let X_=bA;const UE={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function mz(t){return UE[t]??UE.float32}const gz={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},IE=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function jE(t,e){let n;for(;(n=IE.exec(t))!==null;){const i=gz[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:i,stride:mz(i).stride,offset:0,instance:!1,start:0}}IE.lastIndex=0}function yz(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function bz({source:t,entryPoint:e}){const n={},i=yz(t),r=i.indexOf(`fn ${e}(`);if(r===-1)return n;const s=i.indexOf("->",r);if(s===-1)return n;const l=i.substring(r,s);if(jE(l,n),Object.keys(n).length===0){const c=l.match(/\(\s*\w+\s*:\s*(\w+)/);if(c){const d=c[1],p=new RegExp(`struct\\s+${d}\\s*\\{([^}]+)\\}`,"s"),m=i.match(p);m&&jE(m[1],n)}}return n}function Mx(t){var g,b;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,s=/:\s*([\w<>]+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,p=(g=t.match(e))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(r)[2],isUniform:v.match(r)[1]==="<uniform>",type:v.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((b=t.match(l))==null?void 0:b.map(v=>{const _=v.match(d)[1],A=v.match(c).reduce((C,w)=>{const[k,R]=w.split(":");return C[k.trim()]=R.trim(),C},{});return A?{name:_,members:A}:null}).filter(({name:v})=>p.some(_=>_.type===v||_.type.includes(`<${v}>`))))??[];return{groups:p,structs:m}}var uf=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(uf||{});function xz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:uf.VERTEX|uf.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):i.type==="texture_2d_array"||i.type.startsWith("texture_2d_array<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(i.type==="texture_cube"||i.type.startsWith("texture_cube<"))&&e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function vz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding}return e}function _z(t,e){const n=new Set,i=new Set,r=[...t.structs,...e.structs].filter(l=>n.has(l.name)?!1:(n.add(l.name),!0)),s=[...t.groups,...e.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:r,groups:s}}const $p=Object.create(null);class Km{constructor(e){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:r,gpuLayout:s,name:l}=e;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const p=Mx(n.source);this.structsAndGroups=p}else{const p=Mx(i.source),m=Mx(n.source);this.structsAndGroups=_z(p,m)}this.layout=r??vz(this.structsAndGroups),this.gpuLayout=s??xz(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,i=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=V_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=bz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,$p[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return $p[n]||($p[n]=new Km(e),$p[n]._cacheKey=n),$p[n]}}const xA=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Sz=xA.reduce((t,e)=>(t[e]=!0,t),{});function Ez(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const vA=class _A{constructor(e,n){this._touched=0,this.uid=bi("uniform"),this._resourceType="uniformGroup",this._resourceId=bi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={..._A.defaultOptions,...n},this.uniformStructures=e;const i={};for(const r in e){const s=e[r];if(s.name=r,s.size=s.size??1,!Sz[s.type]){const l=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(l){const[,c,d]=l;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${c}', size: ${d} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${xA.join(", ")}`)}s.value??(s.value=Ez(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=V_(Object.keys(i).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};vA.defaultOptions={ubo:!1,isStatic:!1};let SA=vA;class p0{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in e){const r=e[i];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const i in this.resources)e[n++]=this.resources[i]._resourceId;this._key=e.join("|")}setResource(e,n){var r,s;const i=this.resources[n];e!==i&&((r=i==null?void 0:i.off)==null||r.call(i,"change",this.onResourceChange,this),(s=e.on)==null||s.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const i=this.resources;for(const r in i)i[r]._gcLastUsed=e,i[r]._touched=n}destroy(){var n;const e=this.resources;for(const i in e){const r=e[i];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var Fv=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(Fv||{});class J0 extends go{constructor(e){super(),this.uid=bi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:i,groups:r,resources:s,compatibleRenderers:l,groupMap:c}=e;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Fv.WEBGPU),i&&(l|=Fv.WEBGL)),this.compatibleRenderers=l;const d={};if(!s&&!r&&(s={}),s&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&c)for(const p in c)for(const m in c[p]){const g=c[p][m];d[g]={group:p,binding:m,name:g}}else if(n&&r&&!c){const p=n.structsAndGroups.groups;c={},p.forEach(m=>{c[m.group]=c[m.group]||{},c[m.group][m.binding]=m.name,d[m.name]=m})}else if(s){r={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let p=0;for(const m in s)d[m]||(r[99]||(r[99]=new p0,this._ownedBindGroups.push(r[99])),d[m]={group:99,binding:p,name:m},c[99]=c[99]||{},c[99][p]=m,p++);for(const m in s){const g=m;let b=s[m];!b.source&&!b._resourceType&&(b=new SA(b));const v=d[g];v&&(r[v.group]||(r[v.group]=new p0,this._ownedBindGroups.push(r[v.group])),r[v.group].setResource(b,v.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,d)}addResource(e,n,i){var r,s;(r=this._uniformBindMap)[n]||(r[n]={}),(s=this._uniformBindMap[n])[i]||(s[i]=e),this.groups[n]||(this.groups[n]=new p0,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const i={};for(const r in n){const s=n[r];Object.defineProperty(i,s.name,{get(){return e[s.group].getResource(s.binding)},set(l){e[s.group].setResource(l,s.binding)}})}return i}destroy(e=!1){var n,i;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new J0({gpuProgram:s,glProgram:l,...r})}}const wz={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Rx=0,Nx=1,kx=2,Ox=3,Dx=4,zx=5,qv=class EA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Rx)}set blend(e){!!(this.data&1<<Rx)!==e&&(this.data^=1<<Rx)}get offsets(){return!!(this.data&1<<Nx)}set offsets(e){!!(this.data&1<<Nx)!==e&&(this.data^=1<<Nx)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<kx)}set culling(e){!!(this.data&1<<kx)!==e&&(this.data^=1<<kx)}get depthTest(){return!!(this.data&1<<Ox)}set depthTest(e){!!(this.data&1<<Ox)!==e&&(this.data^=1<<Ox)}get depthMask(){return!!(this.data&1<<zx)}set depthMask(e){!!(this.data&1<<zx)!==e&&(this.data^=1<<zx)}get clockwiseFrontFace(){return!!(this.data&1<<Dx)}set clockwiseFrontFace(e){!!(this.data&1<<Dx)!==e&&(this.data^=1<<Dx)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=wz[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new EA;return e.depthTest=!1,e.blend=!0,e}};qv.default2d=qv.for2d();let K_=qv;const wA=class Yv extends J0{constructor(e){e={...Yv.defaultOptions,...e},super(e),this.enabled=!0,this._state=K_.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,i,r){e.applyFilter(this,n,i,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new Yv({gpuProgram:s,glProgram:l,...r})}};wA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Cf=wA;const Vv=[];oi.handleByNamedList(Nt.Environment,Vv);async function Tz(t){if(!t)for(let e=0;e<Vv.length;e++){const n=Vv[e];if(n.value.test()){await n.value.load();return}}}let Wp;function Cz(){if(typeof Wp=="boolean")return Wp;try{Wp=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Wp=!1}return Wp}function HE(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=TA(t,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,d,p;if(i&&(s=kz(t,e,s,n)),t.length>80*n){c=t[0],d=t[1];let m=c,g=d;for(let b=n;b<r;b+=n){const v=t[b],_=t[b+1];v<c&&(c=v),_<d&&(d=_),v>m&&(m=v),_>g&&(g=_)}p=Math.max(m-c,g-d),p=p!==0?32767/p:0}return Rm(s,l,n,c,d,p,0),l}function TA(t,e,n,i,r){let s;if(r===Gz(t,e,n,i)>0)for(let l=e;l<n;l+=i)s=PE(l/i|0,t[l],t[l+1],s);else for(let l=n-i;l>=e;l-=i)s=PE(l/i|0,t[l],t[l+1],s);return s&&lh(s,s.next)&&(km(s),s=s.next),s}function bf(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(lh(n,n.next)||li(n.prev,n,n.next)===0)){if(km(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function Rm(t,e,n,i,r,s,l){if(!t)return;!l&&s&&Lz(t,i,r,s);let c=t;for(;t.prev!==t.next;){const d=t.prev,p=t.next;if(s?Mz(t,i,r,s):Az(t)){e.push(d.i,t.i,p.i),km(t),t=p.next,c=p.next;continue}if(t=p,t===c){l?l===1?(t=Rz(bf(t),e),Rm(t,e,n,i,r,s,2)):l===2&&Nz(t,e,n,i,r,s):Rm(bf(t),e,n,i,r,s,1);break}}}function Az(t){const e=t.prev,n=t,i=t.next;if(li(e,n,i)>=0)return!1;const r=e.x,s=n.x,l=i.x,c=e.y,d=n.y,p=i.y,m=Math.min(r,s,l),g=Math.min(c,d,p),b=Math.max(r,s,l),v=Math.max(c,d,p);let _=i.next;for(;_!==e;){if(_.x>=m&&_.x<=b&&_.y>=g&&_.y<=v&&dm(r,c,s,d,l,p,_.x,_.y)&&li(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function Mz(t,e,n,i){const r=t.prev,s=t,l=t.next;if(li(r,s,l)>=0)return!1;const c=r.x,d=s.x,p=l.x,m=r.y,g=s.y,b=l.y,v=Math.min(c,d,p),_=Math.min(m,g,b),A=Math.max(c,d,p),C=Math.max(m,g,b),w=Xv(v,_,e,n,i),k=Xv(A,C,e,n,i);let R=t.prevZ,O=t.nextZ;for(;R&&R.z>=w&&O&&O.z<=k;){if(R.x>=v&&R.x<=A&&R.y>=_&&R.y<=C&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&li(R.prev,R,R.next)>=0||(R=R.prevZ,O.x>=v&&O.x<=A&&O.y>=_&&O.y<=C&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&li(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;R&&R.z>=w;){if(R.x>=v&&R.x<=A&&R.y>=_&&R.y<=C&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&li(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;O&&O.z<=k;){if(O.x>=v&&O.x<=A&&O.y>=_&&O.y<=C&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&li(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function Rz(t,e){let n=t;do{const i=n.prev,r=n.next.next;!lh(i,r)&&AA(i,n,n.next,r)&&Nm(i,r)&&Nm(r,i)&&(e.push(i.i,n.i,r.i),km(n),km(n.next),n=t=r),n=n.next}while(n!==t);return bf(n)}function Nz(t,e,n,i,r,s){let l=t;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&jz(l,c)){let d=MA(l,c);l=bf(l,l.next),d=bf(d,d.next),Rm(l,e,n,i,r,s,0),Rm(d,e,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==t)}function kz(t,e,n,i){const r=[];for(let s=0,l=e.length;s<l;s++){const c=e[s]*i,d=s<l-1?e[s+1]*i:t.length,p=TA(t,c,d,i,!1);p===p.next&&(p.steiner=!0),r.push(Iz(p))}r.sort(Oz);for(let s=0;s<r.length;s++)n=Dz(r[s],n);return n}function Oz(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function Dz(t,e){const n=zz(t,e);if(!n)return e;const i=MA(n,t);return bf(i,i.next),bf(n,n.next)}function zz(t,e){let n=e;const i=t.x,r=t.y;let s=-1/0,l;if(lh(t,n))return n;do{if(lh(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const g=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=i&&g>s&&(s=g,l=n.x<n.next.x?n:n.next,g===i))return l}n=n.next}while(n!==e);if(!l)return null;const c=l,d=l.x,p=l.y;let m=1/0;n=l;do{if(i>=n.x&&n.x>=d&&i!==n.x&&CA(r<p?i:s,r,d,p,r<p?s:i,r,n.x,n.y)){const g=Math.abs(r-n.y)/(i-n.x);Nm(n,t)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&Bz(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function Bz(t,e){return li(t.prev,t,e.prev)<0&&li(e.next,t,t.next)<0}function Lz(t,e,n,i){let r=t;do r.z===0&&(r.z=Xv(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Uz(r)}function Uz(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let l=i,c=0;for(let p=0;p<n&&(c++,l=l.nextZ,!!l);p++);let d=n;for(;c>0||d>0&&l;)c!==0&&(d===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,c--):(r=l,l=l.nextZ,d--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=l}s.nextZ=null,n*=2}while(e>1);return t}function Xv(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Iz(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function CA(t,e,n,i,r,s,l,c){return(r-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(i-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(r-l)*(i-c)}function dm(t,e,n,i,r,s,l,c){return!(t===l&&e===c)&&CA(t,e,n,i,r,s,l,c)}function jz(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Hz(t,e)&&(Nm(t,e)&&Nm(e,t)&&Pz(t,e)&&(li(t.prev,t,e.prev)||li(t,e.prev,e))||lh(t,e)&&li(t.prev,t,t.next)>0&&li(e.prev,e,e.next)>0)}function li(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function lh(t,e){return t.x===e.x&&t.y===e.y}function AA(t,e,n,i){const r=zy(li(t,e,n)),s=zy(li(t,e,i)),l=zy(li(n,i,t)),c=zy(li(n,i,e));return!!(r!==s&&l!==c||r===0&&Dy(t,n,e)||s===0&&Dy(t,i,e)||l===0&&Dy(n,t,i)||c===0&&Dy(n,e,i))}function Dy(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function zy(t){return t>0?1:t<0?-1:0}function Hz(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&AA(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Nm(t,e){return li(t.prev,t,t.next)<0?li(t,e,t.next)>=0&&li(t,t.prev,e)>=0:li(t,e,t.prev)<0||li(t,t.next,e)<0}function Pz(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function MA(t,e){const n=Kv(t.i,t.x,t.y),i=Kv(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function PE(t,e,n,i){const r=Kv(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function km(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Kv(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Gz(t,e,n,i){let r=0;for(let s=e,l=n-i;s<n;s+=i)r+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return r}const Fz=HE.default||HE;var RA=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(RA||{});class qz{constructor(e){this.items=[],this._name=e}emit(e,n,i,r,s,l,c,d){const{name:p,items:m}=this;for(let g=0,b=m.length;g<b;g++)m[g][p](e,n,i,r,s,l,c,d);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Yz=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],NA=class kA extends go{constructor(e){super(),this.tick=0,this.uid=bi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...Yz,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await Tz(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...kA.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e}render(e,n){this.tick++;let i=e;if(i instanceof _r&&(i={container:i},n&&(rn(yi,"passing a second argument is deprecated, please use render options instead"),i.target=n.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:Yi.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i))}resize(e,n,i){const r=this.view.resolution;this.view.resize(e,n,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=RA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=e;Yi.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,Yi.shared.toArray(),l??0,c??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new qz(n)})}_addSystems(e){let n;for(n in e){const i=e[n];this._addSystem(i.value,i.name)}}_addSystem(e,n){const i=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(e,n){const i=n.reduce((r,s)=>(r[s.name]=s.value,r),{});e.forEach(r=>{const s=r.value,l=r.name,c=i[l];this.renderPipes[l]=new s(this,c?new c:null),this.runners.destroy.add(this.renderPipes[l])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&Xm.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Cz())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};NA.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let OA=NA,By;function Vz(t){return By!==void 0||(By=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??OA.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ns.get().getWebGLRenderingContext())return!1;let r=ns.get().createCanvas().getContext("webgl",e);const s=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const l=r.getExtension("WEBGL_lose_context");l&&l.loseContext()}return r=null,s}catch{return!1}})()),By}let Ly;async function Xz(t={}){return Ly!==void 0||(Ly=await(async()=>{const e=ns.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),Ly}const GE=["webgl","webgpu","canvas"];async function Kz(t){let e=[];t.preference?(e.push(t.preference),GE.forEach(s=>{s!==t.preference&&e.push(s)})):e=GE.slice();let n,i={};for(let s=0;s<e.length;s++){const l=e[s];if(l==="webgpu"&&await Xz()){const{WebGPURenderer:c}=await Zd(async()=>{const{WebGPURenderer:d}=await import("./WebGPURenderer-DxOAtpZ7.js");return{WebGPURenderer:d}},__vite__mapDeps([2,3,4]));n=c,i={...t,...t.webgpu};break}else if(l==="webgl"&&Vz(t.failIfMajorPerformanceCaveat??OA.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await Zd(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-QLE6xf0w.js");return{WebGLRenderer:d}},__vite__mapDeps([5,3,4]));n=c,i={...t,...t.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await Zd(async()=>{const{CanvasRenderer:d}=await import("./CanvasRenderer-Cu9GjumS.js");return{CanvasRenderer:d}},__vite__mapDeps([6,4]));n=c,i={...t,...t.canvasOptions};break}}if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(i),r}const DA="8.17.0";class zA{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,DA)}static destroy(){}}zA.extension=Nt.Application;class $z{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,DA)}destroy(){this._renderer=null}}$z.extension={type:[Nt.WebGLSystem,Nt.WebGPUSystem],name:"initHook",priority:-10};class BA{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,i;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;n=r,i=s}this.renderer.resize(n,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}BA.extension=Nt.Application;class LA{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,w0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Vd.shared:new Vd,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}LA.extension=Nt.Application;oi.add(BA);oi.add(LA);const UA=class $v{constructor(...e){this.stage=new _r,e[0]!==void 0&&rn(yi,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new _r),this.renderer=await Kz(e),$v._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return rn(yi,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const i=$v._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};UA._plugins=[];let $_=UA;oi.handleByList(Nt.Application,$_._plugins);oi.add(zA);var Bx,FE;function Wz(){if(FE)return Bx;FE=1,Bx=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var l=[];return s.replace(e,function(c,d,p){var m=d.toLowerCase();for(p=r(p),m=="m"&&p.length>2&&(l.push([d].concat(p.splice(0,2))),m="l",d=d=="m"?"l":"L");;){if(p.length==t[m])return p.unshift(d),l.push(p);if(p.length<t[m])throw new Error("malformed path data");l.push([d].concat(p.splice(0,t[m])))}}),l}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(s){var l=s.match(i);return l?l.map(Number):[]}return Bx}var Zz=Wz();const Qz=uu(Zz);function Jz(t,e){const n=Qz(t),i=[];let r=null,s=0,l=0;for(let c=0;c<n.length;c++){const d=n[c],p=d[0],m=d;switch(p){case"M":s=m[1],l=m[2],e.moveTo(s,l);break;case"m":s+=m[1],l+=m[2],e.moveTo(s,l);break;case"H":s=m[1],e.lineTo(s,l);break;case"h":s+=m[1],e.lineTo(s,l);break;case"V":l=m[1],e.lineTo(s,l);break;case"v":l+=m[1],e.lineTo(s,l);break;case"L":s=m[1],l=m[2],e.lineTo(s,l);break;case"l":s+=m[1],l+=m[2],e.lineTo(s,l);break;case"C":s=m[5],l=m[6],e.bezierCurveTo(m[1],m[2],m[3],m[4],s,l);break;case"c":e.bezierCurveTo(s+m[1],l+m[2],s+m[3],l+m[4],s+m[5],l+m[6]),s+=m[5],l+=m[6];break;case"S":s=m[3],l=m[4],e.bezierCurveToShort(m[1],m[2],s,l);break;case"s":e.bezierCurveToShort(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"Q":s=m[3],l=m[4],e.quadraticCurveTo(m[1],m[2],s,l);break;case"q":e.quadraticCurveTo(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"T":s=m[1],l=m[2],e.quadraticCurveToShort(s,l);break;case"t":s+=m[1],l+=m[2],e.quadraticCurveToShort(s,l);break;case"A":s=m[6],l=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"a":s+=m[6],l+=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"Z":case"z":e.closePath(),i.length>0&&(r=i.pop(),r?(s=r.startX,l=r.startY):(s=0,l=0)),r=null;break;default:da(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return e}class W_{constructor(e=0,n=0,i=0){this.type="circle",this.x=e,this.y=n,this.radius=i}clone(){return new W_(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-e,s=this.y-n;return r*=r,s*=s,r+s<=i}strokeContains(e,n,i,r=.5){if(this.radius===0)return!1;const s=this.x-e,l=this.y-n,c=this.radius,d=(1-r)*i,p=Math.sqrt(s*s+l*l);return p<=c+d&&p>c-(i-d)}getBounds(e){return e||(e=new Ci),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Z_{constructor(e=0,n=0,i=0,r=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=i,this.halfHeight=r}clone(){return new Z_(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(e-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(e,n,i,r=.5){const{halfWidth:s,halfHeight:l}=this;if(s<=0||l<=0)return!1;const c=i*(1-r),d=i-c,p=s-d,m=l-d,g=s+c,b=l+c,v=e-this.x,_=n-this.y,A=v*v/(p*p)+_*_/(m*m),C=v*v/(g*g)+_*_/(b*b);return A>1&&C<=1}getBounds(e){return e||(e=new Ci),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function e5(t,e,n,i,r,s){const l=t-n,c=e-i,d=r-n,p=s-i,m=l*d+c*p,g=d*d+p*p;let b=-1;g!==0&&(b=m/g);let v,_;b<0?(v=n,_=i):b>1?(v=r,_=s):(v=n+b*d,_=i+b*p);const A=t-v,C=e-_;return A*A+C*C}let t5,n5;class xm{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const i=[];for(let r=0,s=n.length;r<s;r++)i.push(n[r].x,n[r].y);n=i}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,i=n.length;for(let r=0;r<i;r+=2){const s=n[r],l=n[r+1],c=n[(r+2)%i],d=n[(r+3)%i];e+=(c-s)*(d+l)}return e<0}containsPolygon(e){const n=this.getBounds(t5),i=e.getBounds(n5);if(!n.containsRect(i))return!1;const r=e.points;for(let s=0;s<r.length;s+=2){const l=r[s],c=r[s+1];if(!this.contains(l,c))return!1}return!0}clone(){const e=this.points.slice(),n=new xm(e);return n.closePath=this.closePath,n}contains(e,n){let i=!1;const r=this.points.length/2;for(let s=0,l=r-1;s<r;l=s++){const c=this.points[s*2],d=this.points[s*2+1],p=this.points[l*2],m=this.points[l*2+1];d>n!=m>n&&e<(p-c)*((n-d)/(m-d))+c&&(i=!i)}return i}strokeContains(e,n,i,r=.5){const s=i*i,l=s*(1-r),c=s-l,{points:d}=this,p=d.length-(this.closePath?0:2);for(let m=0;m<p;m+=2){const g=d[m],b=d[m+1],v=d[(m+2)%d.length],_=d[(m+3)%d.length],A=e5(e,n,g,b,v,_),C=Math.sign((v-g)*(n-b)-(_-b)*(e-g));if(A<=(C<0?c:l))return!0}return!1}getBounds(e){e||(e=new Ci);const n=this.points;let i=1/0,r=-1/0,s=1/0,l=-1/0;for(let c=0,d=n.length;c<d;c+=2){const p=n[c],m=n[c+1];i=p<i?p:i,r=p>r?p:r,s=m<s?m:s,l=m>l?m:l}return e.x=i,e.width=r-i,e.y=s,e.height=l-s,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return rn("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return rn("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Uy=(t,e,n,i,r,s,l)=>{const c=t-n,d=e-i,p=Math.sqrt(c*c+d*d);return p>=r-s&&p<=r+l};class Q_{constructor(e=0,n=0,i=0,r=0,s=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=i,this.height=r,this.radius=s}getBounds(e){return e||(e=new Ci),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new Q_(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let r=e-(this.x+i),s=n-(this.y+i);const l=i*i;if(r*r+s*s<=l||(r=e-(this.x+this.width-i),r*r+s*s<=l)||(s=n-(this.y+this.height-i),r*r+s*s<=l)||(r=e-(this.x+i),r*r+s*s<=l))return!0}return!1}strokeContains(e,n,i,r=.5){const{x:s,y:l,width:c,height:d,radius:p}=this,m=i*(1-r),g=i-m,b=s+p,v=l+p,_=c-p*2,A=d-p*2,C=s+c,w=l+d;return(e>=s-m&&e<=s+g||e>=C-g&&e<=C+m)&&n>=v&&n<=v+A||(n>=l-m&&n<=l+g||n>=w-g&&n<=w+m)&&e>=b&&e<=b+_?!0:e<b&&n<v&&Uy(e,n,b,v,p,g,m)||e>C-p&&n<v&&Uy(e,n,C-p,v,p,g,m)||e>C-p&&n>w-p&&Uy(e,n,C-p,w-p,p,g,m)||e<b&&n>w-p&&Uy(e,n,b,w-p,p,g,m)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const IA={};function i5(t,e,n){let i=2166136261;for(let r=0;r<e;r++)i^=t[r].uid,i=Math.imul(i,16777619),i>>>=0;return IA[i]||r5(t,e,i,n)}function r5(t,e,n,i){const r={};let s=0;for(let c=0;c<i;c++){const d=c<e?t[c]:Rn.EMPTY.source;r[s++]=d.source,r[s++]=d.style}const l=new p0(r);return IA[n]=l,l}class qE{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function YE(t,e,n,i){if(n??(n=0),i??(i=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(i&7)){const r=i/8;new Float64Array(e,0,r).set(new Float64Array(t,n,r))}else if(!(n&3)&&!(i&3)){const r=i/4;new Float32Array(e,0,r).set(new Float32Array(t,n,r))}else new Uint8Array(e).set(new Uint8Array(t,n,i))}const a5={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var s5=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(s5||{});function VE(t,e){return e.alphaMode==="no-premultiply-alpha"&&a5[t]||t}const l5=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
82
|
+
${t}`}function pz(t,e){return e?t.replace("#version 300 es",""):t}const Ax={stripVersion:pz,ensurePrecision:cz,addProgramDefines:oz,setProgramName:hz,insertVersion:uz},Kp=Object.create(null),bA=class Gv{constructor(e){e={...Gv.defaultOptions,...e};const n=e.fragment.indexOf("#version 300 es")!==-1,i={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:lz()},setProgramName:{name:e.name},addProgramDefines:n,insertVersion:n};let r=e.fragment,s=e.vertex;Object.keys(Ax).forEach(l=>{const c=i[l];r=Ax[l](r,c,!0),s=Ax[l](s,c,!1)}),this.fragment=r,this.vertex=s,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=V_(`${this.vertex}:${this.fragment}`,"gl-program")}destroy(){this.fragment=null,this.vertex=null,this._attributeData=null,this._uniformData=null,this._uniformBlockData=null,this.transformFeedbackVaryings=null,Kp[this._cacheKey]=null}static from(e){const n=`${e.vertex}:${e.fragment}`;return Kp[n]||(Kp[n]=new Gv(e),Kp[n]._cacheKey=n),Kp[n]}};bA.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let X_=bA;const UE={uint8x2:{size:2,stride:2,normalised:!1},uint8x4:{size:4,stride:4,normalised:!1},sint8x2:{size:2,stride:2,normalised:!1},sint8x4:{size:4,stride:4,normalised:!1},unorm8x2:{size:2,stride:2,normalised:!0},unorm8x4:{size:4,stride:4,normalised:!0},snorm8x2:{size:2,stride:2,normalised:!0},snorm8x4:{size:4,stride:4,normalised:!0},uint16x2:{size:2,stride:4,normalised:!1},uint16x4:{size:4,stride:8,normalised:!1},sint16x2:{size:2,stride:4,normalised:!1},sint16x4:{size:4,stride:8,normalised:!1},unorm16x2:{size:2,stride:4,normalised:!0},unorm16x4:{size:4,stride:8,normalised:!0},snorm16x2:{size:2,stride:4,normalised:!0},snorm16x4:{size:4,stride:8,normalised:!0},float16x2:{size:2,stride:4,normalised:!1},float16x4:{size:4,stride:8,normalised:!1},float32:{size:1,stride:4,normalised:!1},float32x2:{size:2,stride:8,normalised:!1},float32x3:{size:3,stride:12,normalised:!1},float32x4:{size:4,stride:16,normalised:!1},uint32:{size:1,stride:4,normalised:!1},uint32x2:{size:2,stride:8,normalised:!1},uint32x3:{size:3,stride:12,normalised:!1},uint32x4:{size:4,stride:16,normalised:!1},sint32:{size:1,stride:4,normalised:!1},sint32x2:{size:2,stride:8,normalised:!1},sint32x3:{size:3,stride:12,normalised:!1},sint32x4:{size:4,stride:16,normalised:!1}};function mz(t){return UE[t]??UE.float32}const gz={f32:"float32","vec2<f32>":"float32x2","vec3<f32>":"float32x3","vec4<f32>":"float32x4",vec2f:"float32x2",vec3f:"float32x3",vec4f:"float32x4",i32:"sint32","vec2<i32>":"sint32x2","vec3<i32>":"sint32x3","vec4<i32>":"sint32x4",vec2i:"sint32x2",vec3i:"sint32x3",vec4i:"sint32x4",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",vec2u:"uint32x2",vec3u:"uint32x3",vec4u:"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"},IE=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function jE(t,e){let n;for(;(n=IE.exec(t))!==null;){const i=gz[n[3]]??"float32";e[n[2]]={location:parseInt(n[1],10),format:i,stride:mz(i).stride,offset:0,instance:!1,start:0}}IE.lastIndex=0}function yz(t){return t.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function bz({source:t,entryPoint:e}){const n={},i=yz(t),r=i.indexOf(`fn ${e}(`);if(r===-1)return n;const s=i.indexOf("->",r);if(s===-1)return n;const l=i.substring(r,s);if(jE(l,n),Object.keys(n).length===0){const c=l.match(/\(\s*\w+\s*:\s*(\w+)/);if(c){const d=c[1],p=new RegExp(`struct\\s+${d}\\s*\\{([^}]+)\\}`,"s"),m=i.match(p);m&&jE(m[1],n)}}return n}function Mx(t){var g,b;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,i=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,s=/:\s*([\w<>]+)/,l=/struct\s+(\w+)\s*{([^}]+)}/g,c=/(\w+)\s*:\s*([\w\<\>]+)/g,d=/struct\s+(\w+)/,p=(g=t.match(e))==null?void 0:g.map(v=>({group:parseInt(v.match(n)[1],10),binding:parseInt(v.match(i)[1],10),name:v.match(r)[2],isUniform:v.match(r)[1]==="<uniform>",type:v.match(s)[1]}));if(!p)return{groups:[],structs:[]};const m=((b=t.match(l))==null?void 0:b.map(v=>{const _=v.match(d)[1],A=v.match(c).reduce((C,w)=>{const[k,R]=w.split(":");return C[k.trim()]=R.trim(),C},{});return A?{name:_,members:A}:null}).filter(({name:v})=>p.some(_=>_.type===v||_.type.includes(`<${v}>`))))??[];return{groups:p,structs:m}}var uf=(t=>(t[t.VERTEX=1]="VERTEX",t[t.FRAGMENT=2]="FRAGMENT",t[t.COMPUTE=4]="COMPUTE",t))(uf||{});function xz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]=[]),i.isUniform?e[i.group].push({binding:i.binding,visibility:uf.VERTEX|uf.FRAGMENT,buffer:{type:"uniform"}}):i.type==="sampler"?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,sampler:{type:"filtering"}}):i.type==="texture_2d"||i.type.startsWith("texture_2d<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):i.type==="texture_2d_array"||i.type.startsWith("texture_2d_array<")?e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(i.type==="texture_cube"||i.type.startsWith("texture_cube<"))&&e[i.group].push({binding:i.binding,visibility:uf.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<e.length;n++)e[n]||(e[n]=[]);return e}function vz({groups:t}){const e=[];for(let n=0;n<t.length;n++){const i=t[n];e[i.group]||(e[i.group]={}),e[i.group][i.name]=i.binding}return e}function _z(t,e){const n=new Set,i=new Set,r=[...t.structs,...e.structs].filter(l=>n.has(l.name)?!1:(n.add(l.name),!0)),s=[...t.groups,...e.groups].filter(l=>{const c=`${l.name}-${l.binding}`;return i.has(c)?!1:(i.add(c),!0)});return{structs:r,groups:s}}const $p=Object.create(null);class Km{constructor(e){var c,d;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:i,layout:r,gpuLayout:s,name:l}=e;if(this.name=l,this.fragment=n,this.vertex=i,n.source===i.source){const p=Mx(n.source);this.structsAndGroups=p}else{const p=Mx(i.source),m=Mx(n.source);this.structsAndGroups=_z(p,m)}this.layout=r??vz(this.structsAndGroups),this.gpuLayout=s??xz(this.structsAndGroups),this.autoAssignGlobalUniforms=((c=this.layout[0])==null?void 0:c.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((d=this.layout[1])==null?void 0:d.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:n}=this,i=e.source+n.source+e.entryPoint+n.entryPoint;this._layoutKey=V_(i,"program")}get attributeData(){return this._attributeData??(this._attributeData=bz(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,$p[this._cacheKey]=null}static from(e){const n=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return $p[n]||($p[n]=new Km(e),$p[n]._cacheKey=n),$p[n]}}const xA=["f32","i32","vec2<f32>","vec3<f32>","vec4<f32>","mat2x2<f32>","mat3x3<f32>","mat4x4<f32>","mat3x2<f32>","mat4x2<f32>","mat2x3<f32>","mat4x3<f32>","mat2x4<f32>","mat3x4<f32>","vec2<i32>","vec3<i32>","vec4<i32>"],Sz=xA.reduce((t,e)=>(t[e]=!0,t),{});function Ez(t,e){switch(t){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const vA=class _A{constructor(e,n){this._touched=0,this.uid=bi("uniform"),this._resourceType="uniformGroup",this._resourceId=bi("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={..._A.defaultOptions,...n},this.uniformStructures=e;const i={};for(const r in e){const s=e[r];if(s.name=r,s.size=s.size??1,!Sz[s.type]){const l=s.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(l){const[,c,d]=l;throw new Error(`Uniform type ${s.type} is not supported. Use type: '${c}', size: ${d} instead.`)}throw new Error(`Uniform type ${s.type} is not supported. Supported uniform types are: ${xA.join(", ")}`)}s.value??(s.value=Ez(s.type,s.size)),i[r]=s.value}this.uniforms=i,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=V_(Object.keys(i).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};vA.defaultOptions={ubo:!1,isStatic:!1};let SA=vA;class p0{constructor(e){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const i in e){const r=e[i];this.setResource(r,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let n=0;for(const i in this.resources)e[n++]=this.resources[i]._resourceId;this._key=e.join("|")}setResource(e,n){var r,s;const i=this.resources[n];e!==i&&((r=i==null?void 0:i.off)==null||r.call(i,"change",this.onResourceChange,this),(s=e.on)==null||s.call(e,"change",this.onResourceChange,this),this.resources[n]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e,n){const i=this.resources;for(const r in i)i[r]._gcLastUsed=e,i[r]._touched=n}destroy(){var n;const e=this.resources;for(const i in e){const r=e[i];(n=r==null?void 0:r.off)==null||n.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){this._dirty=!0,e.destroyed?this.destroy():this._updateKey()}}var Fv=(t=>(t[t.WEBGL=1]="WEBGL",t[t.WEBGPU=2]="WEBGPU",t[t.CANVAS=4]="CANVAS",t[t.BOTH=3]="BOTH",t))(Fv||{});class J0 extends go{constructor(e){super(),this.uid=bi("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:i,groups:r,resources:s,compatibleRenderers:l,groupMap:c}=e;this.gpuProgram=n,this.glProgram=i,l===void 0&&(l=0,n&&(l|=Fv.WEBGPU),i&&(l|=Fv.WEBGL)),this.compatibleRenderers=l;const d={};if(!s&&!r&&(s={}),s&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&r&&!c)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&r&&c)for(const p in c)for(const m in c[p]){const g=c[p][m];d[g]={group:p,binding:m,name:g}}else if(n&&r&&!c){const p=n.structsAndGroups.groups;c={},p.forEach(m=>{c[m.group]=c[m.group]||{},c[m.group][m.binding]=m.name,d[m.name]=m})}else if(s){r={},c={},n&&n.structsAndGroups.groups.forEach(g=>{c[g.group]=c[g.group]||{},c[g.group][g.binding]=g.name,d[g.name]=g});let p=0;for(const m in s)d[m]||(r[99]||(r[99]=new p0,this._ownedBindGroups.push(r[99])),d[m]={group:99,binding:p,name:m},c[99]=c[99]||{},c[99][p]=m,p++);for(const m in s){const g=m;let b=s[m];!b.source&&!b._resourceType&&(b=new SA(b));const v=d[g];v&&(r[v.group]||(r[v.group]=new p0,this._ownedBindGroups.push(r[v.group])),r[v.group].setResource(b,v.binding))}}this.groups=r,this._uniformBindMap=c,this.resources=this._buildResourceAccessor(r,d)}addResource(e,n,i){var r,s;(r=this._uniformBindMap)[n]||(r[n]={}),(s=this._uniformBindMap[n])[i]||(s[i]=e),this.groups[n]||(this.groups[n]=new p0,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(e,n){const i={};for(const r in n){const s=n[r];Object.defineProperty(i,s.name,{get(){return e[s.group].getResource(s.binding)},set(l){e[s.group].setResource(l,s.binding)}})}return i}destroy(e=!1){var n,i;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),e&&((n=this.gpuProgram)==null||n.destroy(),(i=this.glProgram)==null||i.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new J0({gpuProgram:s,glProgram:l,...r})}}const wz={normal:0,add:1,multiply:2,screen:3,overlay:4,erase:5,"normal-npm":6,"add-npm":7,"screen-npm":8,min:9,max:10},Rx=0,Nx=1,kx=2,Ox=3,Dx=4,zx=5,qv=class EA{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Rx)}set blend(e){!!(this.data&1<<Rx)!==e&&(this.data^=1<<Rx)}get offsets(){return!!(this.data&1<<Nx)}set offsets(e){!!(this.data&1<<Nx)!==e&&(this.data^=1<<Nx)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<kx)}set culling(e){!!(this.data&1<<kx)!==e&&(this.data^=1<<kx)}get depthTest(){return!!(this.data&1<<Ox)}set depthTest(e){!!(this.data&1<<Ox)!==e&&(this.data^=1<<Ox)}get depthMask(){return!!(this.data&1<<zx)}set depthMask(e){!!(this.data&1<<zx)!==e&&(this.data^=1<<zx)}get clockwiseFrontFace(){return!!(this.data&1<<Dx)}set clockwiseFrontFace(e){!!(this.data&1<<Dx)!==e&&(this.data^=1<<Dx)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=wz[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new EA;return e.depthTest=!1,e.blend=!0,e}};qv.default2d=qv.for2d();let K_=qv;const wA=class Yv extends J0{constructor(e){e={...Yv.defaultOptions,...e},super(e),this.enabled=!0,this._state=K_.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1),e.blendRequired&&this.addResource("uBackTexture",0,3)}apply(e,n,i,r){e.applyFilter(this,n,i,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:n,gl:i,...r}=e;let s,l;return n&&(s=Km.from(n)),i&&(l=X_.from(i)),new Yv({gpuProgram:s,glProgram:l,...r})}};wA.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Cf=wA;const Vv=[];oi.handleByNamedList(Nt.Environment,Vv);async function Tz(t){if(!t)for(let e=0;e<Vv.length;e++){const n=Vv[e];if(n.value.test()){await n.value.load();return}}}let Wp;function Cz(){if(typeof Wp=="boolean")return Wp;try{Wp=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Wp=!1}return Wp}function HE(t,e,n=2){const i=e&&e.length,r=i?e[0]*n:t.length;let s=TA(t,0,r,n,!0);const l=[];if(!s||s.next===s.prev)return l;let c,d,p;if(i&&(s=kz(t,e,s,n)),t.length>80*n){c=t[0],d=t[1];let m=c,g=d;for(let b=n;b<r;b+=n){const v=t[b],_=t[b+1];v<c&&(c=v),_<d&&(d=_),v>m&&(m=v),_>g&&(g=_)}p=Math.max(m-c,g-d),p=p!==0?32767/p:0}return Rm(s,l,n,c,d,p,0),l}function TA(t,e,n,i,r){let s;if(r===Gz(t,e,n,i)>0)for(let l=e;l<n;l+=i)s=PE(l/i|0,t[l],t[l+1],s);else for(let l=n-i;l>=e;l-=i)s=PE(l/i|0,t[l],t[l+1],s);return s&&lh(s,s.next)&&(km(s),s=s.next),s}function bf(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(lh(n,n.next)||li(n.prev,n,n.next)===0)){if(km(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function Rm(t,e,n,i,r,s,l){if(!t)return;!l&&s&&Lz(t,i,r,s);let c=t;for(;t.prev!==t.next;){const d=t.prev,p=t.next;if(s?Mz(t,i,r,s):Az(t)){e.push(d.i,t.i,p.i),km(t),t=p.next,c=p.next;continue}if(t=p,t===c){l?l===1?(t=Rz(bf(t),e),Rm(t,e,n,i,r,s,2)):l===2&&Nz(t,e,n,i,r,s):Rm(bf(t),e,n,i,r,s,1);break}}}function Az(t){const e=t.prev,n=t,i=t.next;if(li(e,n,i)>=0)return!1;const r=e.x,s=n.x,l=i.x,c=e.y,d=n.y,p=i.y,m=Math.min(r,s,l),g=Math.min(c,d,p),b=Math.max(r,s,l),v=Math.max(c,d,p);let _=i.next;for(;_!==e;){if(_.x>=m&&_.x<=b&&_.y>=g&&_.y<=v&&dm(r,c,s,d,l,p,_.x,_.y)&&li(_.prev,_,_.next)>=0)return!1;_=_.next}return!0}function Mz(t,e,n,i){const r=t.prev,s=t,l=t.next;if(li(r,s,l)>=0)return!1;const c=r.x,d=s.x,p=l.x,m=r.y,g=s.y,b=l.y,v=Math.min(c,d,p),_=Math.min(m,g,b),A=Math.max(c,d,p),C=Math.max(m,g,b),w=Xv(v,_,e,n,i),k=Xv(A,C,e,n,i);let R=t.prevZ,O=t.nextZ;for(;R&&R.z>=w&&O&&O.z<=k;){if(R.x>=v&&R.x<=A&&R.y>=_&&R.y<=C&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&li(R.prev,R,R.next)>=0||(R=R.prevZ,O.x>=v&&O.x<=A&&O.y>=_&&O.y<=C&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&li(O.prev,O,O.next)>=0))return!1;O=O.nextZ}for(;R&&R.z>=w;){if(R.x>=v&&R.x<=A&&R.y>=_&&R.y<=C&&R!==r&&R!==l&&dm(c,m,d,g,p,b,R.x,R.y)&&li(R.prev,R,R.next)>=0)return!1;R=R.prevZ}for(;O&&O.z<=k;){if(O.x>=v&&O.x<=A&&O.y>=_&&O.y<=C&&O!==r&&O!==l&&dm(c,m,d,g,p,b,O.x,O.y)&&li(O.prev,O,O.next)>=0)return!1;O=O.nextZ}return!0}function Rz(t,e){let n=t;do{const i=n.prev,r=n.next.next;!lh(i,r)&&AA(i,n,n.next,r)&&Nm(i,r)&&Nm(r,i)&&(e.push(i.i,n.i,r.i),km(n),km(n.next),n=t=r),n=n.next}while(n!==t);return bf(n)}function Nz(t,e,n,i,r,s){let l=t;do{let c=l.next.next;for(;c!==l.prev;){if(l.i!==c.i&&jz(l,c)){let d=MA(l,c);l=bf(l,l.next),d=bf(d,d.next),Rm(l,e,n,i,r,s,0),Rm(d,e,n,i,r,s,0);return}c=c.next}l=l.next}while(l!==t)}function kz(t,e,n,i){const r=[];for(let s=0,l=e.length;s<l;s++){const c=e[s]*i,d=s<l-1?e[s+1]*i:t.length,p=TA(t,c,d,i,!1);p===p.next&&(p.steiner=!0),r.push(Iz(p))}r.sort(Oz);for(let s=0;s<r.length;s++)n=Dz(r[s],n);return n}function Oz(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),r=(e.next.y-e.y)/(e.next.x-e.x);n=i-r}return n}function Dz(t,e){const n=zz(t,e);if(!n)return e;const i=MA(n,t);return bf(i,i.next),bf(n,n.next)}function zz(t,e){let n=e;const i=t.x,r=t.y;let s=-1/0,l;if(lh(t,n))return n;do{if(lh(t,n.next))return n.next;if(r<=n.y&&r>=n.next.y&&n.next.y!==n.y){const g=n.x+(r-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(g<=i&&g>s&&(s=g,l=n.x<n.next.x?n:n.next,g===i))return l}n=n.next}while(n!==e);if(!l)return null;const c=l,d=l.x,p=l.y;let m=1/0;n=l;do{if(i>=n.x&&n.x>=d&&i!==n.x&&CA(r<p?i:s,r,d,p,r<p?s:i,r,n.x,n.y)){const g=Math.abs(r-n.y)/(i-n.x);Nm(n,t)&&(g<m||g===m&&(n.x>l.x||n.x===l.x&&Bz(l,n)))&&(l=n,m=g)}n=n.next}while(n!==c);return l}function Bz(t,e){return li(t.prev,t,e.prev)<0&&li(e.next,t,t.next)<0}function Lz(t,e,n,i){let r=t;do r.z===0&&(r.z=Xv(r.x,r.y,e,n,i)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==t);r.prevZ.nextZ=null,r.prevZ=null,Uz(r)}function Uz(t){let e,n=1;do{let i=t,r;t=null;let s=null;for(e=0;i;){e++;let l=i,c=0;for(let p=0;p<n&&(c++,l=l.nextZ,!!l);p++);let d=n;for(;c>0||d>0&&l;)c!==0&&(d===0||!l||i.z<=l.z)?(r=i,i=i.nextZ,c--):(r=l,l=l.nextZ,d--),s?s.nextZ=r:t=r,r.prevZ=s,s=r;i=l}s.nextZ=null,n*=2}while(e>1);return t}function Xv(t,e,n,i,r){return t=(t-n)*r|0,e=(e-i)*r|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function Iz(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function CA(t,e,n,i,r,s,l,c){return(r-l)*(e-c)>=(t-l)*(s-c)&&(t-l)*(i-c)>=(n-l)*(e-c)&&(n-l)*(s-c)>=(r-l)*(i-c)}function dm(t,e,n,i,r,s,l,c){return!(t===l&&e===c)&&CA(t,e,n,i,r,s,l,c)}function jz(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!Hz(t,e)&&(Nm(t,e)&&Nm(e,t)&&Pz(t,e)&&(li(t.prev,t,e.prev)||li(t,e.prev,e))||lh(t,e)&&li(t.prev,t,t.next)>0&&li(e.prev,e,e.next)>0)}function li(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function lh(t,e){return t.x===e.x&&t.y===e.y}function AA(t,e,n,i){const r=zy(li(t,e,n)),s=zy(li(t,e,i)),l=zy(li(n,i,t)),c=zy(li(n,i,e));return!!(r!==s&&l!==c||r===0&&Dy(t,n,e)||s===0&&Dy(t,i,e)||l===0&&Dy(n,t,i)||c===0&&Dy(n,e,i))}function Dy(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function zy(t){return t>0?1:t<0?-1:0}function Hz(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&AA(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function Nm(t,e){return li(t.prev,t,t.next)<0?li(t,e,t.next)>=0&&li(t,t.prev,e)>=0:li(t,e,t.prev)<0||li(t,t.next,e)<0}function Pz(t,e){let n=t,i=!1;const r=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&r<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function MA(t,e){const n=Kv(t.i,t.x,t.y),i=Kv(e.i,e.x,e.y),r=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=r,r.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function PE(t,e,n,i){const r=Kv(t,e,n);return i?(r.next=i.next,r.prev=i,i.next.prev=r,i.next=r):(r.prev=r,r.next=r),r}function km(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function Kv(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function Gz(t,e,n,i){let r=0;for(let s=e,l=n-i;s<n;s+=i)r+=(t[l]-t[s])*(t[s+1]+t[l+1]),l=s;return r}const Fz=HE.default||HE;var RA=(t=>(t[t.NONE=0]="NONE",t[t.COLOR=16384]="COLOR",t[t.STENCIL=1024]="STENCIL",t[t.DEPTH=256]="DEPTH",t[t.COLOR_DEPTH=16640]="COLOR_DEPTH",t[t.COLOR_STENCIL=17408]="COLOR_STENCIL",t[t.DEPTH_STENCIL=1280]="DEPTH_STENCIL",t[t.ALL=17664]="ALL",t))(RA||{});class qz{constructor(e){this.items=[],this._name=e}emit(e,n,i,r,s,l,c,d){const{name:p,items:m}=this;for(let g=0,b=m.length;g<b;g++)m[g][p](e,n,i,r,s,l,c,d);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const n=this.items.indexOf(e);return n!==-1&&this.items.splice(n,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const Yz=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],NA=class kA extends go{constructor(e){super(),this.tick=0,this.uid=bi("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const n=[...Yz,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(e={}){const n=e.skipExtensionImports===!0?!0:e.manageImports===!1;await Tz(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const i in this._systemsHash)e={...this._systemsHash[i].constructor.defaultOptions,...e};e={...kA.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let i=0;i<this.runners.init.items.length;i++)await this.runners.init.items[i].init(e);this._initOptions=e}render(e,n){this.tick++;let i=e;if(i instanceof _r&&(i={container:i},n&&(rn(yi,"passing a second argument is deprecated, please use render options instead"),i.target=n.renderTexture)),i.target||(i.target=this.view.renderTarget),i.target===this.view.renderTarget&&(this._lastObjectRendered=i.container,i.clearColor??(i.clearColor=this.background.colorRgba),i.clear??(i.clear=this.background.clearBeforeRender)),i.clearColor){const r=Array.isArray(i.clearColor)&&i.clearColor.length===4;i.clearColor=r?i.clearColor:Yi.shared.setValue(i.clearColor).toArray()}i.transform||(i.container.updateLocalTransform(),i.transform=i.container.localTransform),i.container.visible&&(i.container.enableRenderGroup(),this.runners.prerender.emit(i),this.runners.renderStart.emit(i),this.runners.render.emit(i),this.runners.renderEnd.emit(i),this.runners.postrender.emit(i))}resize(e,n,i){const r=this.view.resolution;this.view.resize(e,n,i),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),i!==void 0&&i!==r&&this.runners.resolutionChange.emit(i)}clear(e={}){const n=this;e.target||(e.target=n.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=RA.ALL);const{clear:i,clearColor:r,target:s,mipLevel:l,layer:c}=e;Yi.shared.setValue(r??this.background.colorRgba),n.renderTarget.clear(s,i,Yi.shared.toArray(),l??0,c??0)}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(n=>{this.runners[n]=new qz(n)})}_addSystems(e){let n;for(n in e){const i=e[n];this._addSystem(i.value,i.name)}}_addSystem(e,n){const i=new e(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=i,this._systemsHash[n]=i;for(const r in this.runners)this.runners[r].add(i);return this}_addPipes(e,n){const i=n.reduce((r,s)=>(r[s.name]=s.value,r),{});e.forEach(r=>{const s=r.value,l=r.name,c=i[l];this.renderPipes[l]=new s(this,c?new c:null),this.runners.destroy.add(this.renderPipes[l])})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),(e===!0||typeof e=="object"&&e.releaseGlobalResources)&&Xm.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!Cz())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}resetState(){this.runners.resetState.emit()}};NA.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let OA=NA,By;function Vz(t){return By!==void 0||(By=(()=>{var n;const e={stencil:!0,failIfMajorPerformanceCaveat:t??OA.defaultOptions.failIfMajorPerformanceCaveat};try{if(!ns.get().getWebGLRenderingContext())return!1;let r=ns.get().createCanvas().getContext("webgl",e);const s=!!((n=r==null?void 0:r.getContextAttributes())!=null&&n.stencil);if(r){const l=r.getExtension("WEBGL_lose_context");l&&l.loseContext()}return r=null,s}catch{return!1}})()),By}let Ly;async function Xz(t={}){return Ly!==void 0||(Ly=await(async()=>{const e=ns.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(t)).requestDevice(),!0}catch{return!1}})()),Ly}const GE=["webgl","webgpu","canvas"];async function Kz(t){let e=[];t.preference?(e.push(t.preference),GE.forEach(s=>{s!==t.preference&&e.push(s)})):e=GE.slice();let n,i={};for(let s=0;s<e.length;s++){const l=e[s];if(l==="webgpu"&&await Xz()){const{WebGPURenderer:c}=await Zd(async()=>{const{WebGPURenderer:d}=await import("./WebGPURenderer-Dhnyezst.js");return{WebGPURenderer:d}},__vite__mapDeps([2,3,4]));n=c,i={...t,...t.webgpu};break}else if(l==="webgl"&&Vz(t.failIfMajorPerformanceCaveat??OA.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:c}=await Zd(async()=>{const{WebGLRenderer:d}=await import("./WebGLRenderer-DBFowF-L.js");return{WebGLRenderer:d}},__vite__mapDeps([5,3,4]));n=c,i={...t,...t.webgl};break}else if(l==="canvas"){const{CanvasRenderer:c}=await Zd(async()=>{const{CanvasRenderer:d}=await import("./CanvasRenderer-D8bxbxCc.js");return{CanvasRenderer:d}},__vite__mapDeps([6,4]));n=c,i={...t,...t.canvasOptions};break}}if(delete i.webgpu,delete i.webgl,delete i.canvasOptions,!n)throw new Error("No available renderer for the current environment");const r=new n;return await r.init(i),r}const DA="8.17.0";class zA{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,DA)}static destroy(){}}zA.extension=Nt.Application;class $z{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,DA)}destroy(){this._renderer=null}}$z.extension={type:[Nt.WebGLSystem,Nt.WebGPUSystem],name:"initHook",priority:-10};class BA{static init(e){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,i;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,i=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:s}=this._resizeTo;n=r,i=s}this.renderer.resize(n,i),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}BA.extension=Nt.Application;class LA{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,w0.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Vd.shared:new Vd,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}LA.extension=Nt.Application;oi.add(BA);oi.add(LA);const UA=class $v{constructor(...e){this.stage=new _r,e[0]!==void 0&&rn(yi,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.stage||(this.stage=new _r),this.renderer=await Kz(e),$v._plugins.forEach(n=>{n.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return rn(yi,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,n=!1){const i=$v._plugins.slice(0);i.reverse(),i.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(e),this.renderer=null}};UA._plugins=[];let $_=UA;oi.handleByList(Nt.Application,$_._plugins);oi.add(zA);var Bx,FE;function Wz(){if(FE)return Bx;FE=1,Bx=n;var t={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function n(s){var l=[];return s.replace(e,function(c,d,p){var m=d.toLowerCase();for(p=r(p),m=="m"&&p.length>2&&(l.push([d].concat(p.splice(0,2))),m="l",d=d=="m"?"l":"L");;){if(p.length==t[m])return p.unshift(d),l.push(p);if(p.length<t[m])throw new Error("malformed path data");l.push([d].concat(p.splice(0,t[m])))}}),l}var i=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(s){var l=s.match(i);return l?l.map(Number):[]}return Bx}var Zz=Wz();const Qz=uu(Zz);function Jz(t,e){const n=Qz(t),i=[];let r=null,s=0,l=0;for(let c=0;c<n.length;c++){const d=n[c],p=d[0],m=d;switch(p){case"M":s=m[1],l=m[2],e.moveTo(s,l);break;case"m":s+=m[1],l+=m[2],e.moveTo(s,l);break;case"H":s=m[1],e.lineTo(s,l);break;case"h":s+=m[1],e.lineTo(s,l);break;case"V":l=m[1],e.lineTo(s,l);break;case"v":l+=m[1],e.lineTo(s,l);break;case"L":s=m[1],l=m[2],e.lineTo(s,l);break;case"l":s+=m[1],l+=m[2],e.lineTo(s,l);break;case"C":s=m[5],l=m[6],e.bezierCurveTo(m[1],m[2],m[3],m[4],s,l);break;case"c":e.bezierCurveTo(s+m[1],l+m[2],s+m[3],l+m[4],s+m[5],l+m[6]),s+=m[5],l+=m[6];break;case"S":s=m[3],l=m[4],e.bezierCurveToShort(m[1],m[2],s,l);break;case"s":e.bezierCurveToShort(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"Q":s=m[3],l=m[4],e.quadraticCurveTo(m[1],m[2],s,l);break;case"q":e.quadraticCurveTo(s+m[1],l+m[2],s+m[3],l+m[4]),s+=m[3],l+=m[4];break;case"T":s=m[1],l=m[2],e.quadraticCurveToShort(s,l);break;case"t":s+=m[1],l+=m[2],e.quadraticCurveToShort(s,l);break;case"A":s=m[6],l=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"a":s+=m[6],l+=m[7],e.arcToSvg(m[1],m[2],m[3],m[4],m[5],s,l);break;case"Z":case"z":e.closePath(),i.length>0&&(r=i.pop(),r?(s=r.startX,l=r.startY):(s=0,l=0)),r=null;break;default:da(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&r===null&&(r={startX:s,startY:l},i.push(r))}return e}class W_{constructor(e=0,n=0,i=0){this.type="circle",this.x=e,this.y=n,this.radius=i}clone(){return new W_(this.x,this.y,this.radius)}contains(e,n){if(this.radius<=0)return!1;const i=this.radius*this.radius;let r=this.x-e,s=this.y-n;return r*=r,s*=s,r+s<=i}strokeContains(e,n,i,r=.5){if(this.radius===0)return!1;const s=this.x-e,l=this.y-n,c=this.radius,d=(1-r)*i,p=Math.sqrt(s*s+l*l);return p<=c+d&&p>c-(i-d)}getBounds(e){return e||(e=new Ci),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class Z_{constructor(e=0,n=0,i=0,r=0){this.type="ellipse",this.x=e,this.y=n,this.halfWidth=i,this.halfHeight=r}clone(){return new Z_(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let i=(e-this.x)/this.halfWidth,r=(n-this.y)/this.halfHeight;return i*=i,r*=r,i+r<=1}strokeContains(e,n,i,r=.5){const{halfWidth:s,halfHeight:l}=this;if(s<=0||l<=0)return!1;const c=i*(1-r),d=i-c,p=s-d,m=l-d,g=s+c,b=l+c,v=e-this.x,_=n-this.y,A=v*v/(p*p)+_*_/(m*m),C=v*v/(g*g)+_*_/(b*b);return A>1&&C<=1}getBounds(e){return e||(e=new Ci),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function e5(t,e,n,i,r,s){const l=t-n,c=e-i,d=r-n,p=s-i,m=l*d+c*p,g=d*d+p*p;let b=-1;g!==0&&(b=m/g);let v,_;b<0?(v=n,_=i):b>1?(v=r,_=s):(v=n+b*d,_=i+b*p);const A=t-v,C=e-_;return A*A+C*C}let t5,n5;class xm{constructor(...e){this.type="polygon";let n=Array.isArray(e[0])?e[0]:e;if(typeof n[0]!="number"){const i=[];for(let r=0,s=n.length;r<s;r++)i.push(n[r].x,n[r].y);n=i}this.points=n,this.closePath=!0}isClockwise(){let e=0;const n=this.points,i=n.length;for(let r=0;r<i;r+=2){const s=n[r],l=n[r+1],c=n[(r+2)%i],d=n[(r+3)%i];e+=(c-s)*(d+l)}return e<0}containsPolygon(e){const n=this.getBounds(t5),i=e.getBounds(n5);if(!n.containsRect(i))return!1;const r=e.points;for(let s=0;s<r.length;s+=2){const l=r[s],c=r[s+1];if(!this.contains(l,c))return!1}return!0}clone(){const e=this.points.slice(),n=new xm(e);return n.closePath=this.closePath,n}contains(e,n){let i=!1;const r=this.points.length/2;for(let s=0,l=r-1;s<r;l=s++){const c=this.points[s*2],d=this.points[s*2+1],p=this.points[l*2],m=this.points[l*2+1];d>n!=m>n&&e<(p-c)*((n-d)/(m-d))+c&&(i=!i)}return i}strokeContains(e,n,i,r=.5){const s=i*i,l=s*(1-r),c=s-l,{points:d}=this,p=d.length-(this.closePath?0:2);for(let m=0;m<p;m+=2){const g=d[m],b=d[m+1],v=d[(m+2)%d.length],_=d[(m+3)%d.length],A=e5(e,n,g,b,v,_),C=Math.sign((v-g)*(n-b)-(_-b)*(e-g));if(A<=(C<0?c:l))return!0}return!1}getBounds(e){e||(e=new Ci);const n=this.points;let i=1/0,r=-1/0,s=1/0,l=-1/0;for(let c=0,d=n.length;c<d;c+=2){const p=n[c],m=n[c+1];i=p<i?p:i,r=p>r?p:r,s=m<s?m:s,l=m>l?m:l}return e.x=i,e.width=r-i,e.y=s,e.height=l-s,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,n)=>`${e}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return rn("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return rn("8.11.0","Polygon.y is deprecated, please use Polygon.lastY instead."),this.points[this.points.length-1]}get startX(){return this.points[0]}get startY(){return this.points[1]}}const Uy=(t,e,n,i,r,s,l)=>{const c=t-n,d=e-i,p=Math.sqrt(c*c+d*d);return p>=r-s&&p<=r+l};class Q_{constructor(e=0,n=0,i=0,r=0,s=20){this.type="roundedRectangle",this.x=e,this.y=n,this.width=i,this.height=r,this.radius=s}getBounds(e){return e||(e=new Ci),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new Q_(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,n){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const i=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+i&&n<=this.y+this.height-i||e>=this.x+i&&e<=this.x+this.width-i)return!0;let r=e-(this.x+i),s=n-(this.y+i);const l=i*i;if(r*r+s*s<=l||(r=e-(this.x+this.width-i),r*r+s*s<=l)||(s=n-(this.y+this.height-i),r*r+s*s<=l)||(r=e-(this.x+i),r*r+s*s<=l))return!0}return!1}strokeContains(e,n,i,r=.5){const{x:s,y:l,width:c,height:d,radius:p}=this,m=i*(1-r),g=i-m,b=s+p,v=l+p,_=c-p*2,A=d-p*2,C=s+c,w=l+d;return(e>=s-m&&e<=s+g||e>=C-g&&e<=C+m)&&n>=v&&n<=v+A||(n>=l-m&&n<=l+g||n>=w-g&&n<=w+m)&&e>=b&&e<=b+_?!0:e<b&&n<v&&Uy(e,n,b,v,p,g,m)||e>C-p&&n<v&&Uy(e,n,C-p,v,p,g,m)||e>C-p&&n>w-p&&Uy(e,n,C-p,w-p,p,g,m)||e<b&&n>w-p&&Uy(e,n,b,w-p,p,g,m)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const IA={};function i5(t,e,n){let i=2166136261;for(let r=0;r<e;r++)i^=t[r].uid,i=Math.imul(i,16777619),i>>>=0;return IA[i]||r5(t,e,i,n)}function r5(t,e,n,i){const r={};let s=0;for(let c=0;c<i;c++){const d=c<e?t[c]:Rn.EMPTY.source;r[s++]=d.source,r[s++]=d.style}const l=new p0(r);return IA[n]=l,l}class qE{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this.uint32View=null,this.float32View=null,this.uint16View=null,this._int8View=null,this._uint8View=null,this._int16View=null,this._int32View=null,this._float64Array=null,this._bigUint64Array=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function YE(t,e,n,i){if(n??(n=0),i??(i=Math.min(t.byteLength-n,e.byteLength)),!(n&7)&&!(i&7)){const r=i/8;new Float64Array(e,0,r).set(new Float64Array(t,n,r))}else if(!(n&3)&&!(i&3)){const r=i/4;new Float32Array(e,0,r).set(new Float32Array(t,n,r))}else new Uint8Array(e).set(new Uint8Array(t,n,i))}const a5={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var s5=(t=>(t[t.DISABLED=0]="DISABLED",t[t.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",t[t.MASK_ACTIVE=2]="MASK_ACTIVE",t[t.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",t[t.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",t[t.NONE=5]="NONE",t))(s5||{});function VE(t,e){return e.alphaMode==="no-premultiply-alpha"&&a5[t]||t}const l5=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
83
83
|
`);function o5(t){let e="";for(let n=0;n<t;++n)n>0&&(e+=`
|
|
84
84
|
else `),n<t-1&&(e+=`if(test == ${n}.0){}`);return e}function c5(t,e){if(t===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const i=l5.replace(/%forloop%/gi,o5(t));if(e.shaderSource(n,i),e.compileShader(n),!e.getShaderParameter(n,e.COMPILE_STATUS))t=t/2|0;else break}}finally{e.deleteShader(n)}return t}let Dd=null;function u5(){var e;if(Dd)return Dd;const t=yA();return Dd=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),Dd=c5(Dd,t),(e=t.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Dd}class f5{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const n=this.textures[e];this.textures[e]=null,this.ids[n.uid]=null}this.count=0}}class d5{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new f5,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null,this.elements=null}}const vm=[];let T0=0;Xm.register({clear:()=>{if(vm.length>0)for(const t of vm)t&&t.destroy();vm.length=0,T0=0}});function XE(){return T0>0?vm[--T0]:new d5}function KE(t){t.elements=null,vm[T0++]=t}let Zp=0;const jA=class HA{constructor(e){this.uid=bi("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...HA.defaultOptions,...e},e.maxTextures||(rn("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=u5());const{maxTextures:n,attributesInitialSize:i,indicesInitialSize:r}=e;this.attributeBuffer=new qE(i*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)KE(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,n){const i=e._batch.textures.ids[n._source.uid];return!i&&i!==0?!1:(e._textureId=i,e.texture=n,!0)}updateElement(e){this.dirty=!0;const n=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,n.float32View,n.uint32View,e._attributeStart,e._textureId)}break(e){const n=this._elements;if(!n[this.elementStart])return;let i=XE(),r=i.textures;r.clear();const s=n[this.elementStart];let l=VE(s.blendMode,s.texture._source),c=s.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const d=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,m=this.indexBuffer;let g=this._batchIndexSize,b=this._batchIndexStart,v="startBatch",_=[];const A=this.maxTextures;for(let C=this.elementStart;C<this.elementSize;++C){const w=n[C];n[C]=null;const R=w.texture._source,O=VE(w.blendMode,R),j=l!==O||c!==w.topology;if(R._batchTick===Zp&&!j){w._textureId=R._textureBindLocation,g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize)),w._batch=i,_.push(w);continue}R._batchTick=Zp,(r.count>=A||j)&&(this._finishBatch(i,b,g-b,r,l,c,e,v,_),v="renderBatch",b=g,l=O,c=w.topology,i=XE(),r=i.textures,r.clear(),_=[],++Zp),w._textureId=R._textureBindLocation=r.count,r.ids[R.uid]=r.count,r.textures[r.count++]=R,w._batch=i,_.push(w),g+=w.indexSize,w.packAsQuad?(this.packQuadAttributes(w,d,p,w._attributeStart,w._textureId),this.packQuadIndex(m,w._indexStart,w._attributeStart/this.vertexSize)):(this.packAttributes(w,d,p,w._attributeStart,w._textureId),this.packIndex(w,m,w._indexStart,w._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(i,b,g-b,r,l,c,e,v,_),b=g,++Zp),this.elementStart=this.elementSize,this._batchIndexStart=b,this._batchIndexSize=g}_finishBatch(e,n,i,r,s,l,c,d,p){e.gpuBindGroup=null,e.bindGroup=null,e.action=d,e.batcher=this,e.textures=r,e.blendMode=s,e.topology=l,e.start=n,e.size=i,e.elements=p,++Zp,this.batches[this.batchIndex++]=e,c.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const n=Math.max(e,this.attributeBuffer.size*2),i=new qE(n);YE(this.attributeBuffer.rawBinaryData,i.rawBinaryData),this.attributeBuffer=i}_resizeIndexBuffer(e){const n=this.indexBuffer;let i=Math.max(e,n.length*1.5);i+=i%2;const r=i>65535?new Uint32Array(i):new Uint16Array(i);if(r.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let s=0;s<n.length;s++)r[s]=n[s];else YE(n.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,n,i){e[n]=i+0,e[n+1]=i+1,e[n+2]=i+2,e[n+3]=i+0,e[n+4]=i+2,e[n+5]=i+3}packIndex(e,n,i,r){const s=e.indices,l=e.indexSize,c=e.indexOffset,d=e.attributeOffset;for(let p=0;p<l;p++)n[i++]=r+s[p+c]-d}destroy(e={}){var n;if(this.batches!==null){for(let i=0;i<this.batchIndex;i++)KE(this.batches[i]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,e.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let i=0;i<this._elements.length;i++)this._elements[i]&&(this._elements[i]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};jA.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let h5=jA;var Ma=(t=>(t[t.MAP_READ=1]="MAP_READ",t[t.MAP_WRITE=2]="MAP_WRITE",t[t.COPY_SRC=4]="COPY_SRC",t[t.COPY_DST=8]="COPY_DST",t[t.INDEX=16]="INDEX",t[t.VERTEX=32]="VERTEX",t[t.UNIFORM=64]="UNIFORM",t[t.STORAGE=128]="STORAGE",t[t.INDIRECT=256]="INDIRECT",t[t.QUERY_RESOLVE=512]="QUERY_RESOLVE",t[t.STATIC=1024]="STATIC",t))(Ma||{});class Om extends go{constructor(e){let{data:n,size:i}=e;const{usage:r,label:s,shrinkToFit:l}=e;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=bi("buffer"),this._resourceType="buffer",this._resourceId=bi("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,i??(i=n==null?void 0:n.byteLength);const c=!!n;this.descriptor={size:i,usage:r,mappedAtCreation:c,label:s},this.shrinkToFit=l??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&Ma.STATIC)}set static(e){e?this.descriptor.usage|=Ma.STATIC:this.descriptor.usage&=~Ma.STATIC}setDataWithSize(e,n,i){if(this._updateID++,this._updateSize=n*e.BYTES_PER_ELEMENT,this._data===e){i&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?i&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=bi("resource"),this.emit("change",this));return}i&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(){this.destroyed=!0,this.unload(),this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function PA(t,e){if(!(t instanceof Om)){let n=e?Ma.INDEX:Ma.VERTEX;t instanceof Array&&(e?(t=new Uint32Array(t),n=Ma.INDEX|Ma.COPY_DST):(t=new Float32Array(t),n=Ma.VERTEX|Ma.COPY_DST)),t=new Om({data:t,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return t}function p5(t,e,n){const i=t.getAttribute(e);if(!i)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const r=i.buffer.data;let s=1/0,l=1/0,c=-1/0,d=-1/0;const p=r.BYTES_PER_ELEMENT,m=(i.offset||0)/p,g=(i.stride||8)/p;for(let b=m;b<r.length;b+=g){const v=r[b],_=r[b+1];v>c&&(c=v),_>d&&(d=_),v<s&&(s=v),_<l&&(l=_)}return n.minX=s,n.minY=l,n.maxX=c,n.maxY=d,n}function m5(t){return(t instanceof Om||Array.isArray(t)||t.BYTES_PER_ELEMENT)&&(t={buffer:t}),t.buffer=PA(t.buffer,!1),t}class g5 extends go{constructor(e={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=bi("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new Bs,this._boundsDirty=!0;const{attributes:n,indexBuffer:i,topology:r}=e;if(this.buffers=[],this.attributes={},n)for(const s in n)this.addAttribute(s,n[s]);this.instanceCount=e.instanceCount??1,i&&this.addIndex(i),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const n=this.attributes[e];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(e,n){const i=m5(n);this.buffers.indexOf(i.buffer)===-1&&(this.buffers.push(i.buffer),i.buffer.on("update",this.onBufferUpdate,this),i.buffer.on("change",this.onBufferUpdate,this)),this.attributes[e]=i}addIndex(e){this.indexBuffer=PA(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,p5(this,"aPosition",this._bounds)):this._bounds}unload(){var e;this.emit("unload",this);for(const n in this._gpuData)(e=this._gpuData[n])==null||e.destroy();this._gpuData=Object.create(null)}destroy(e=!1){var n;this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(i=>i.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const y5=new Float32Array(1),b5=new Uint32Array(1);class x5 extends g5{constructor(){const n=new Om({data:y5,label:"attribute-batch-buffer",usage:Ma.VERTEX|Ma.COPY_DST,shrinkToFit:!1}),i=new Om({data:b5,label:"index-batch-buffer",usage:Ma.INDEX|Ma.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:r,offset:0},aUV:{buffer:n,format:"float32x2",stride:r,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:r,offset:20}},indexBuffer:i})}}function $E(t,e,n){if(t)for(const i in t){const r=i.toLocaleLowerCase(),s=e[r];if(s){let l=t[i];i==="header"&&(l=l.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&s.push(`//----${n}----//`),s.push(l)}else da(`${i} placement hook does not exist in shader`)}}const v5=/\{\{(.*?)\}\}/g;function WE(t){var i;const e={};return(((i=t.match(v5))==null?void 0:i.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function ZE(t,e){let n;const i=/@in\s+([^;]+);/g;for(;(n=i.exec(t))!==null;)e.push(n[1])}function QE(t,e,n=!1){const i=[];ZE(e,i),t.forEach(c=>{c.header&&ZE(c.header,i)});const r=i;n&&r.sort();const s=r.map((c,d)=>` @location(${d}) ${c},`).join(`
|
|
85
85
|
`);let l=e.replace(/@in\s+[^;]+;\s*/g,"");return l=l.replace("{{in}}",`
|
|
@@ -397,4 +397,4 @@ https://github.com/highlightjs/highlight.js/issues/2277`),jn=Re,Qt=Ke),_t===void
|
|
|
397
397
|
`,`
|
|
398
398
|
+`).split(`
|
|
399
399
|
`)),m=p.reduce((g,b)=>g.concat(...b),[]);return[p,m]}return[[],[]]},[t]);return L.useEffect(()=>{const d=(e==null?void 0:e.target)??FT,p=(e==null?void 0:e.actInsideInputWithModifier)??!0;if(t!==null){const m=v=>{var C,w;if(r.current=v.ctrlKey||v.metaKey||v.shiftKey||v.altKey,(!r.current||r.current&&!p)&&jN(v))return!1;const A=YT(v.code,c);if(s.current.add(v[A]),qT(l,s.current,!1)){const k=((w=(C=v.composedPath)==null?void 0:C.call(v))==null?void 0:w[0])||v.target,R=(k==null?void 0:k.nodeName)==="BUTTON"||(k==null?void 0:k.nodeName)==="A";e.preventDefault!==!1&&(r.current||!R)&&v.preventDefault(),i(!0)}},g=v=>{const _=YT(v.code,c);qT(l,s.current,!0)?(i(!1),s.current.clear()):s.current.delete(v[_]),v.key==="Meta"&&s.current.clear(),r.current=!1},b=()=>{s.current.clear(),i(!1)};return d==null||d.addEventListener("keydown",m),d==null||d.addEventListener("keyup",g),window.addEventListener("blur",b),window.addEventListener("contextmenu",b),()=>{d==null||d.removeEventListener("keydown",m),d==null||d.removeEventListener("keyup",g),window.removeEventListener("blur",b),window.removeEventListener("contextmenu",b)}}},[t,i]),n}function qT(t,e,n){return t.filter(i=>n||i.length===e.size).some(i=>i.every(r=>e.has(r)))}function YT(t,e){return e.includes(t)?"code":"key"}const xK=()=>{const t=Jn();return L.useMemo(()=>({zoomIn:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomOut:e=>{const{panZoom:n}=t.getState();return n?n.scaleBy(1/1.2,{duration:e==null?void 0:e.duration}):Promise.resolve(!1)},zoomTo:(e,n)=>{const{panZoom:i}=t.getState();return i?i.scaleTo(e,{duration:n==null?void 0:n.duration}):Promise.resolve(!1)},getZoom:()=>t.getState().transform[2],setViewport:async(e,n)=>{const{transform:[i,r,s],panZoom:l}=t.getState();return l?(await l.setViewport({x:e.x??i,y:e.y??r,zoom:e.zoom??s},n),Promise.resolve(!0)):Promise.resolve(!1)},getViewport:()=>{const[e,n,i]=t.getState().transform;return{x:e,y:n,zoom:i}},setCenter:async(e,n,i)=>t.getState().setCenter(e,n,i),fitBounds:async(e,n)=>{const{width:i,height:r,minZoom:s,maxZoom:l,panZoom:c}=t.getState(),d=L1(e,i,r,s,l,(n==null?void 0:n.padding)??.1);return c?(await c.setViewport(d,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),Promise.resolve(!0)):Promise.resolve(!1)},screenToFlowPosition:(e,n={})=>{const{transform:i,snapGrid:r,snapToGrid:s,domNode:l}=t.getState();if(!l)return e;const{x:c,y:d}=l.getBoundingClientRect(),p={x:e.x-c,y:e.y-d},m=n.snapGrid??r,g=n.snapToGrid??s;return ag(p,i,g,m)},flowToScreenPosition:e=>{const{transform:n,domNode:i}=t.getState();if(!i)return e;const{x:r,y:s}=i.getBoundingClientRect(),l=Y0(e,n);return{x:l.x+r,y:l.y+s}}}),[])};function lk(t,e){const n=[],i=new Map,r=[];for(const s of t)if(s.type==="add"){r.push(s);continue}else if(s.type==="remove"||s.type==="replace")i.set(s.id,[s]);else{const l=i.get(s.id);l?l.push(s):i.set(s.id,[s])}for(const s of e){const l=i.get(s.id);if(!l){n.push(s);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const c={...s};for(const d of l)vK(d,c);n.push(c)}return r.length&&r.forEach(s=>{s.index!==void 0?n.splice(s.index,0,{...s.item}):n.push({...s.item})}),n}function vK(t,e){switch(t.type){case"select":{e.selected=t.selected;break}case"position":{typeof t.position<"u"&&(e.position=t.position),typeof t.dragging<"u"&&(e.dragging=t.dragging);break}case"dimensions":{typeof t.dimensions<"u"&&(e.measured={...t.dimensions},t.setAttributes&&((t.setAttributes===!0||t.setAttributes==="width")&&(e.width=t.dimensions.width),(t.setAttributes===!0||t.setAttributes==="height")&&(e.height=t.dimensions.height))),typeof t.resizing=="boolean"&&(e.resizing=t.resizing);break}}}function _K(t,e){return lk(t,e)}function SK(t,e){return lk(t,e)}function df(t,e){return{id:t,type:"select",selected:e}}function Wd(t,e=new Set,n=!1){const i=[];for(const[r,s]of t){const l=e.has(r);!(s.selected===void 0&&!l)&&s.selected!==l&&(n&&(s.selected=l),i.push(df(s.id,l)))}return i}function VT({items:t=[],lookup:e}){var r;const n=[],i=new Map(t.map(s=>[s.id,s]));for(const[s,l]of t.entries()){const c=e.get(l.id),d=((r=c==null?void 0:c.internals)==null?void 0:r.userNode)??c;d!==void 0&&d!==l&&n.push({id:l.id,item:l,type:"replace"}),d===void 0&&n.push({item:l,type:"add",index:s})}for(const[s]of e)i.get(s)===void 0&&n.push({id:s,type:"remove"});return n}function XT(t){return{id:t.id,type:"remove"}}const KT=t=>qV(t),EK=t=>kN(t);function ok(t){return L.forwardRef(t)}const wK=typeof window<"u"?L.useLayoutEffect:L.useEffect;function $T(t){const[e,n]=L.useState(BigInt(0)),[i]=L.useState(()=>TK(()=>n(r=>r+BigInt(1))));return wK(()=>{const r=i.get();r.length&&(t(r),i.reset())},[e]),i}function TK(t){let e=[];return{get:()=>e,reset:()=>{e=[]},push:n=>{e.push(n),t()}}}const ck=L.createContext(null);function CK({children:t}){const e=Jn(),n=L.useCallback(c=>{const{nodes:d=[],setNodes:p,hasDefaultNodes:m,onNodesChange:g,nodeLookup:b,fitViewQueued:v,onNodesChangeMiddlewareMap:_}=e.getState();let A=d;for(const w of c)A=typeof w=="function"?w(A):w;let C=VT({items:A,lookup:b});for(const w of _.values())C=w(C);m&&p(A),C.length>0?g==null||g(C):v&&window.requestAnimationFrame(()=>{const{fitViewQueued:w,nodes:k,setNodes:R}=e.getState();w&&R(k)})},[]),i=$T(n),r=L.useCallback(c=>{const{edges:d=[],setEdges:p,hasDefaultEdges:m,onEdgesChange:g,edgeLookup:b}=e.getState();let v=d;for(const _ of c)v=typeof _=="function"?_(v):_;m?p(v):g&&g(VT({items:v,lookup:b}))},[]),s=$T(r),l=L.useMemo(()=>({nodeQueue:i,edgeQueue:s}),[]);return T.jsx(ck.Provider,{value:l,children:t})}function AK(){const t=L.useContext(ck);if(!t)throw new Error("useBatchContext must be used within a BatchProvider");return t}const MK=t=>!!t.panZoom;function xb(){const t=xK(),e=Jn(),n=AK(),i=en(MK),r=L.useMemo(()=>{const s=g=>e.getState().nodeLookup.get(g),l=g=>{n.nodeQueue.push(g)},c=g=>{n.edgeQueue.push(g)},d=g=>{var w,k;const{nodeLookup:b,nodeOrigin:v}=e.getState(),_=KT(g)?g:b.get(g.id),A=_.parentId?UN(_.position,_.measured,_.parentId,b,v):_.position,C={..._,position:A,width:((w=_.measured)==null?void 0:w.width)??_.width,height:((k=_.measured)==null?void 0:k.height)??_.height};return ph(C)},p=(g,b,v={replace:!1})=>{l(_=>_.map(A=>{if(A.id===g){const C=typeof b=="function"?b(A):b;return v.replace&&KT(C)?C:{...A,...C}}return A}))},m=(g,b,v={replace:!1})=>{c(_=>_.map(A=>{if(A.id===g){const C=typeof b=="function"?b(A):b;return v.replace&&EK(C)?C:{...A,...C}}return A}))};return{getNodes:()=>e.getState().nodes.map(g=>({...g})),getNode:g=>{var b;return(b=s(g))==null?void 0:b.internals.userNode},getInternalNode:s,getEdges:()=>{const{edges:g=[]}=e.getState();return g.map(b=>({...b}))},getEdge:g=>e.getState().edgeLookup.get(g),setNodes:l,setEdges:c,addNodes:g=>{const b=Array.isArray(g)?g:[g];n.nodeQueue.push(v=>[...v,...b])},addEdges:g=>{const b=Array.isArray(g)?g:[g];n.edgeQueue.push(v=>[...v,...b])},toObject:()=>{const{nodes:g=[],edges:b=[],transform:v}=e.getState(),[_,A,C]=v;return{nodes:g.map(w=>({...w})),edges:b.map(w=>({...w})),viewport:{x:_,y:A,zoom:C}}},deleteElements:async({nodes:g=[],edges:b=[]})=>{const{nodes:v,edges:_,onNodesDelete:A,onEdgesDelete:C,triggerNodeChanges:w,triggerEdgeChanges:k,onDelete:R,onBeforeDelete:O}=e.getState(),{nodes:j,edges:D}=await $V({nodesToRemove:g,edgesToRemove:b,nodes:v,edges:_,onBeforeDelete:O}),G=D.length>0,W=j.length>0;if(G){const P=D.map(XT);C==null||C(D),k(P)}if(W){const P=j.map(XT);A==null||A(j),w(P)}return(W||G)&&(R==null||R({nodes:j,edges:D})),{deletedNodes:j,deletedEdges:D}},getIntersectingNodes:(g,b=!0,v)=>{const _=vT(g),A=_?g:d(g),C=v!==void 0;return A?(v||e.getState().nodes).filter(w=>{const k=e.getState().nodeLookup.get(w.id);if(k&&!_&&(w.id===g.id||!k.internals.positionAbsolute))return!1;const R=ph(C?w:k),O=Gm(R,A);return b&&O>0||O>=R.width*R.height||O>=A.width*A.height}):[]},isNodeIntersecting:(g,b,v=!0)=>{const A=vT(g)?g:d(g);if(!A)return!1;const C=Gm(A,b);return v&&C>0||C>=b.width*b.height||C>=A.width*A.height},updateNode:p,updateNodeData:(g,b,v={replace:!1})=>{p(g,_=>{const A=typeof b=="function"?b(_):b;return v.replace?{..._,data:A}:{..._,data:{..._.data,...A}}},v)},updateEdge:m,updateEdgeData:(g,b,v={replace:!1})=>{m(g,_=>{const A=typeof b=="function"?b(_):b;return v.replace?{..._,data:A}:{..._,data:{..._.data,...A}}},v)},getNodesBounds:g=>{const{nodeLookup:b,nodeOrigin:v}=e.getState();return YV(g,{nodeLookup:b,nodeOrigin:v})},getHandleConnections:({type:g,id:b,nodeId:v})=>{var _;return Array.from(((_=e.getState().connectionLookup.get(`${v}-${g}${b?`-${b}`:""}`))==null?void 0:_.values())??[])},getNodeConnections:({type:g,handleId:b,nodeId:v})=>{var _;return Array.from(((_=e.getState().connectionLookup.get(`${v}${g?b?`-${g}-${b}`:`-${g}`:""}`))==null?void 0:_.values())??[])},fitView:async g=>{const b=e.getState().fitViewResolver??JV();return e.setState({fitViewQueued:!0,fitViewOptions:g,fitViewResolver:b}),n.nodeQueue.push(v=>[...v]),b.promise}}},[]);return L.useMemo(()=>({...r,...t,viewportInitialized:i}),[i])}const WT=t=>t.selected,RK=typeof window<"u"?window:void 0;function NK({deleteKeyCode:t,multiSelectionKeyCode:e}){const n=Jn(),{deleteElements:i}=xb(),r=qm(t,{actInsideInputWithModifier:!1}),s=qm(e,{target:RK});L.useEffect(()=>{if(r){const{edges:l,nodes:c}=n.getState();i({nodes:c.filter(WT),edges:l.filter(WT)}),n.setState({nodesSelectionActive:!1})}},[r]),L.useEffect(()=>{n.setState({multiSelectionActive:s})},[s])}function kK(t){const e=Jn();L.useEffect(()=>{const n=()=>{var r,s,l,c;if(!t.current||!(((s=(r=t.current).checkVisibility)==null?void 0:s.call(r))??!0))return!1;const i=U1(t.current);(i.height===0||i.width===0)&&((c=(l=e.getState()).onError)==null||c.call(l,"004",mo.error004())),e.setState({width:i.width||500,height:i.height||500})};if(t.current){n(),window.addEventListener("resize",n);const i=new ResizeObserver(()=>n());return i.observe(t.current),()=>{window.removeEventListener("resize",n),i&&t.current&&i.unobserve(t.current)}}},[])}const vb={position:"absolute",width:"100%",height:"100%",top:0,left:0},OK=t=>({userSelectionActive:t.userSelectionActive,lib:t.lib,connectionInProgress:t.connection.inProgress});function DK({onPaneContextMenu:t,zoomOnScroll:e=!0,zoomOnPinch:n=!0,panOnScroll:i=!1,panOnScrollSpeed:r=.5,panOnScrollMode:s=yf.Free,zoomOnDoubleClick:l=!0,panOnDrag:c=!0,defaultViewport:d,translateExtent:p,minZoom:m,maxZoom:g,zoomActivationKeyCode:b,preventScrolling:v=!0,children:_,noWheelClassName:A,noPanClassName:C,onViewportChange:w,isControlledViewport:k,paneClickDistance:R,selectionOnDrag:O}){const j=Jn(),D=L.useRef(null),{userSelectionActive:G,lib:W,connectionInProgress:P}=en(OK,Qn),I=qm(b),K=L.useRef();kK(D);const q=L.useCallback(te=>{w==null||w({x:te[0],y:te[1],zoom:te[2]}),k||j.setState({transform:te})},[w,k]);return L.useEffect(()=>{if(D.current){K.current=LX({domNode:D.current,minZoom:m,maxZoom:g,translateExtent:p,viewport:d,onDraggingChange:B=>j.setState(X=>X.paneDragging===B?X:{paneDragging:B}),onPanZoomStart:(B,X)=>{const{onViewportChangeStart:Z,onMoveStart:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)},onPanZoom:(B,X)=>{const{onViewportChange:Z,onMove:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)},onPanZoomEnd:(B,X)=>{const{onViewportChangeEnd:Z,onMoveEnd:Q}=j.getState();Q==null||Q(B,X),Z==null||Z(X)}});const{x:te,y:H,zoom:$}=K.current.getViewport();return j.setState({panZoom:K.current,transform:[te,H,$],domNode:D.current.closest(".react-flow")}),()=>{var B;(B=K.current)==null||B.destroy()}}},[]),L.useEffect(()=>{var te;(te=K.current)==null||te.update({onPaneContextMenu:t,zoomOnScroll:e,zoomOnPinch:n,panOnScroll:i,panOnScrollSpeed:r,panOnScrollMode:s,zoomOnDoubleClick:l,panOnDrag:c,zoomActivationKeyPressed:I,preventScrolling:v,noPanClassName:C,userSelectionActive:G,noWheelClassName:A,lib:W,onTransformChange:q,connectionInProgress:P,selectionOnDrag:O,paneClickDistance:R})},[t,e,n,i,r,s,l,c,I,v,C,G,A,W,q,P,O,R]),T.jsx("div",{className:"react-flow__renderer",ref:D,style:vb,children:_})}const zK=t=>({userSelectionActive:t.userSelectionActive,userSelectionRect:t.userSelectionRect});function BK(){const{userSelectionActive:t,userSelectionRect:e}=en(zK,Qn);return t&&e?T.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:e.width,height:e.height,transform:`translate(${e.x}px, ${e.y}px)`}}):null}const Mv=(t,e)=>n=>{n.target===e.current&&(t==null||t(n))},LK=t=>({userSelectionActive:t.userSelectionActive,elementsSelectable:t.elementsSelectable,connectionInProgress:t.connection.inProgress,dragging:t.paneDragging});function UK({isSelecting:t,selectionKeyPressed:e,selectionMode:n=Pm.Full,panOnDrag:i,paneClickDistance:r,selectionOnDrag:s,onSelectionStart:l,onSelectionEnd:c,onPaneClick:d,onPaneContextMenu:p,onPaneScroll:m,onPaneMouseEnter:g,onPaneMouseMove:b,onPaneMouseLeave:v,children:_}){const A=Jn(),{userSelectionActive:C,elementsSelectable:w,dragging:k,connectionInProgress:R}=en(LK,Qn),O=w&&(t||C),j=L.useRef(null),D=L.useRef(),G=L.useRef(new Set),W=L.useRef(new Set),P=L.useRef(!1),I=Z=>{if(P.current||R){P.current=!1;return}d==null||d(Z),A.getState().resetSelectedElements(),A.setState({nodesSelectionActive:!1})},K=Z=>{if(Array.isArray(i)&&(i!=null&&i.includes(2))){Z.preventDefault();return}p==null||p(Z)},q=m?Z=>m(Z):void 0,te=Z=>{P.current&&(Z.stopPropagation(),P.current=!1)},H=Z=>{var ye,ve;const{domNode:Q}=A.getState();if(D.current=Q==null?void 0:Q.getBoundingClientRect(),!D.current)return;const F=Z.target===j.current;if(!F&&!!Z.target.closest(".nokey")||!t||!(s&&F||e)||Z.button!==0||!Z.isPrimary)return;(ve=(ye=Z.target)==null?void 0:ye.setPointerCapture)==null||ve.call(ye,Z.pointerId),P.current=!1;const{x:V,y:le}=bl(Z.nativeEvent,D.current);A.setState({userSelectionRect:{width:0,height:0,startX:V,startY:le,x:V,y:le}}),F||(Z.stopPropagation(),Z.preventDefault())},$=Z=>{const{userSelectionRect:Q,transform:F,nodeLookup:Y,edgeLookup:ee,connectionLookup:V,triggerNodeChanges:le,triggerEdgeChanges:ye,defaultEdgeOptions:ve,resetSelectedElements:se}=A.getState();if(!D.current||!Q)return;const{x:me,y:Me}=bl(Z.nativeEvent,D.current),{startX:Ue,startY:Le}=Q;if(!P.current){const Ie=e?0:r;if(Math.hypot(me-Ue,Me-Le)<=Ie)return;se(),l==null||l(Z)}P.current=!0;const Pe={startX:Ue,startY:Le,x:me<Ue?me:Ue,y:Me<Le?Me:Le,width:Math.abs(me-Ue),height:Math.abs(Me-Le)},He=G.current,Xe=W.current;G.current=new Set(B1(Y,Pe,F,n===Pm.Partial,!0).map(Ie=>Ie.id)),W.current=new Set;const ot=(ve==null?void 0:ve.selectable)??!0;for(const Ie of G.current){const de=V.get(Ie);if(de)for(const{edgeId:ut}of de.values()){const It=ee.get(ut);It&&(It.selectable??ot)&&W.current.add(ut)}}if(!_T(He,G.current)){const Ie=Wd(Y,G.current,!0);le(Ie)}if(!_T(Xe,W.current)){const Ie=Wd(ee,W.current);ye(Ie)}A.setState({userSelectionRect:Pe,userSelectionActive:!0,nodesSelectionActive:!1})},B=Z=>{var Q,F;Z.button===0&&((F=(Q=Z.target)==null?void 0:Q.releasePointerCapture)==null||F.call(Q,Z.pointerId),!C&&Z.target===j.current&&A.getState().userSelectionRect&&(I==null||I(Z)),A.setState({userSelectionActive:!1,userSelectionRect:null}),P.current&&(c==null||c(Z),A.setState({nodesSelectionActive:G.current.size>0})))},X=i===!0||Array.isArray(i)&&i.includes(0);return T.jsxs("div",{className:zi(["react-flow__pane",{draggable:X,dragging:k,selection:t}]),onClick:O?void 0:Mv(I,j),onContextMenu:Mv(K,j),onWheel:Mv(q,j),onPointerEnter:O?void 0:g,onPointerMove:O?$:b,onPointerUp:O?B:void 0,onPointerDownCapture:O?H:void 0,onClickCapture:O?te:void 0,onPointerLeave:v,ref:j,style:vb,children:[_,T.jsx(BK,{})]})}function D_({id:t,store:e,unselect:n=!1,nodeRef:i}){const{addSelectedNodes:r,unselectNodesAndEdges:s,multiSelectionActive:l,nodeLookup:c,onError:d}=e.getState(),p=c.get(t);if(!p){d==null||d("012",mo.error012(t));return}e.setState({nodesSelectionActive:!1}),p.selected?(n||p.selected&&l)&&(s({nodes:[p],edges:[]}),requestAnimationFrame(()=>{var m;return(m=i==null?void 0:i.current)==null?void 0:m.blur()})):r([t])}function uk({nodeRef:t,disabled:e=!1,noDragClassName:n,handleSelector:i,nodeId:r,isSelectable:s,nodeClickDistance:l}){const c=Jn(),[d,p]=L.useState(!1),m=L.useRef();return L.useEffect(()=>{m.current=SX({getStoreItems:()=>c.getState(),onNodeMouseDown:g=>{D_({id:g,store:c,nodeRef:t})},onDragStart:()=>{p(!0)},onDragStop:()=>{p(!1)}})},[]),L.useEffect(()=>{if(!(e||!t.current||!m.current))return m.current.update({noDragClassName:n,handleSelector:i,domNode:t.current,isSelectable:s,nodeId:r,nodeClickDistance:l}),()=>{var g;(g=m.current)==null||g.destroy()}},[n,i,e,s,t,r,l]),d}const IK=t=>e=>e.selected&&(e.draggable||t&&typeof e.draggable>"u");function fk(){const t=Jn();return L.useCallback(n=>{const{nodeExtent:i,snapToGrid:r,snapGrid:s,nodesDraggable:l,onError:c,updateNodePositions:d,nodeLookup:p,nodeOrigin:m}=t.getState(),g=new Map,b=IK(l),v=r?s[0]:5,_=r?s[1]:5,A=n.direction.x*v*n.factor,C=n.direction.y*_*n.factor;for(const[,w]of p){if(!b(w))continue;let k={x:w.internals.positionAbsolute.x+A,y:w.internals.positionAbsolute.y+C};r&&(k=rg(k,s));const{position:R,positionAbsolute:O}=ON({nodeId:w.id,nextPosition:k,nodeLookup:p,nodeExtent:i,nodeOrigin:m,onError:c});w.position=R,w.internals.positionAbsolute=O,g.set(w.id,w)}d(g)},[])}const F1=L.createContext(null),jK=F1.Provider;F1.Consumer;const dk=()=>L.useContext(F1),HK=t=>({connectOnClick:t.connectOnClick,noPanClassName:t.noPanClassName,rfId:t.rfId}),PK=(t,e,n)=>i=>{const{connectionClickStartHandle:r,connectionMode:s,connection:l}=i,{fromHandle:c,toHandle:d,isValid:p}=l,m=(d==null?void 0:d.nodeId)===t&&(d==null?void 0:d.id)===e&&(d==null?void 0:d.type)===n;return{connectingFrom:(c==null?void 0:c.nodeId)===t&&(c==null?void 0:c.id)===e&&(c==null?void 0:c.type)===n,connectingTo:m,clickConnecting:(r==null?void 0:r.nodeId)===t&&(r==null?void 0:r.id)===e&&(r==null?void 0:r.type)===n,isPossibleEndHandle:s===dh.Strict?(c==null?void 0:c.type)!==n:t!==(c==null?void 0:c.nodeId)||e!==(c==null?void 0:c.id),connectionInProcess:!!c,clickConnectionInProcess:!!r,valid:m&&p}};function GK({type:t="source",position:e=Je.Top,isValidConnection:n,isConnectable:i=!0,isConnectableStart:r=!0,isConnectableEnd:s=!0,id:l,onConnect:c,children:d,className:p,onMouseDown:m,onTouchStart:g,...b},v){var $,B;const _=l||null,A=t==="target",C=Jn(),w=dk(),{connectOnClick:k,noPanClassName:R,rfId:O}=en(HK,Qn),{connectingFrom:j,connectingTo:D,clickConnecting:G,isPossibleEndHandle:W,connectionInProcess:P,clickConnectionInProcess:I,valid:K}=en(PK(w,_,t),Qn);w||(B=($=C.getState()).onError)==null||B.call($,"010",mo.error010());const q=X=>{const{defaultEdgeOptions:Z,onConnect:Q,hasDefaultEdges:F}=C.getState(),Y={...Z,...X};if(F){const{edges:ee,setEdges:V}=C.getState();V(sX(Y,ee))}Q==null||Q(Y),c==null||c(Y)},te=X=>{if(!w)return;const Z=HN(X.nativeEvent);if(r&&(Z&&X.button===0||!Z)){const Q=C.getState();O_.onPointerDown(X.nativeEvent,{handleDomNode:X.currentTarget,autoPanOnConnect:Q.autoPanOnConnect,connectionMode:Q.connectionMode,connectionRadius:Q.connectionRadius,domNode:Q.domNode,nodeLookup:Q.nodeLookup,lib:Q.lib,isTarget:A,handleId:_,nodeId:w,flowId:Q.rfId,panBy:Q.panBy,cancelConnection:Q.cancelConnection,onConnectStart:Q.onConnectStart,onConnectEnd:(...F)=>{var Y,ee;return(ee=(Y=C.getState()).onConnectEnd)==null?void 0:ee.call(Y,...F)},updateConnection:Q.updateConnection,onConnect:q,isValidConnection:n||((...F)=>{var Y,ee;return((ee=(Y=C.getState()).isValidConnection)==null?void 0:ee.call(Y,...F))??!0}),getTransform:()=>C.getState().transform,getFromHandle:()=>C.getState().connection.fromHandle,autoPanSpeed:Q.autoPanSpeed,dragThreshold:Q.connectionDragThreshold})}Z?m==null||m(X):g==null||g(X)},H=X=>{const{onClickConnectStart:Z,onClickConnectEnd:Q,connectionClickStartHandle:F,connectionMode:Y,isValidConnection:ee,lib:V,rfId:le,nodeLookup:ye,connection:ve}=C.getState();if(!w||!F&&!r)return;if(!F){Z==null||Z(X.nativeEvent,{nodeId:w,handleId:_,handleType:t}),C.setState({connectionClickStartHandle:{nodeId:w,type:t,id:_}});return}const se=IN(X.target),me=n||ee,{connection:Me,isValid:Ue}=O_.isValid(X.nativeEvent,{handle:{nodeId:w,id:_,type:t},connectionMode:Y,fromNodeId:F.nodeId,fromHandleId:F.id||null,fromType:F.type,isValidConnection:me,flowId:le,doc:se,lib:V,nodeLookup:ye});Ue&&Me&&q(Me);const Le=structuredClone(ve);delete Le.inProgress,Le.toPosition=Le.toHandle?Le.toHandle.position:null,Q==null||Q(X,Le),C.setState({connectionClickStartHandle:null})};return T.jsx("div",{"data-handleid":_,"data-nodeid":w,"data-handlepos":e,"data-id":`${O}-${w}-${_}-${t}`,className:zi(["react-flow__handle",`react-flow__handle-${e}`,"nodrag",R,p,{source:!A,target:A,connectable:i,connectablestart:r,connectableend:s,clickconnecting:G,connectingfrom:j,connectingto:D,valid:K,connectionindicator:i&&(!P||W)&&(P||I?s:r)}]),onMouseDown:te,onTouchStart:te,onClick:k?H:void 0,ref:v,...b,children:d})}const cu=L.memo(ok(GK));function FK({data:t,isConnectable:e,sourcePosition:n=Je.Bottom}){return T.jsxs(T.Fragment,{children:[t==null?void 0:t.label,T.jsx(cu,{type:"source",position:n,isConnectable:e})]})}function qK({data:t,isConnectable:e,targetPosition:n=Je.Top,sourcePosition:i=Je.Bottom}){return T.jsxs(T.Fragment,{children:[T.jsx(cu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label,T.jsx(cu,{type:"source",position:i,isConnectable:e})]})}function YK(){return null}function VK({data:t,isConnectable:e,targetPosition:n=Je.Top}){return T.jsxs(T.Fragment,{children:[T.jsx(cu,{type:"target",position:n,isConnectable:e}),t==null?void 0:t.label]})}const V0={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},ZT={input:FK,default:qK,output:VK,group:YK};function XK(t){var e,n,i,r;return t.internals.handleBounds===void 0?{width:t.width??t.initialWidth??((e=t.style)==null?void 0:e.width),height:t.height??t.initialHeight??((n=t.style)==null?void 0:n.height)}:{width:t.width??((i=t.style)==null?void 0:i.width),height:t.height??((r=t.style)==null?void 0:r.height)}}const KK=t=>{const{width:e,height:n,x:i,y:r}=ig(t.nodeLookup,{filter:s=>!!s.selected});return{width:yl(e)?e:null,height:yl(n)?n:null,userSelectionActive:t.userSelectionActive,transformString:`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]}) translate(${i}px,${r}px)`}};function $K({onSelectionContextMenu:t,noPanClassName:e,disableKeyboardA11y:n}){const i=Jn(),{width:r,height:s,transformString:l,userSelectionActive:c}=en(KK,Qn),d=fk(),p=L.useRef(null);L.useEffect(()=>{var v;n||(v=p.current)==null||v.focus({preventScroll:!0})},[n]);const m=!c&&r!==null&&s!==null;if(uk({nodeRef:p,disabled:!m}),!m)return null;const g=t?v=>{const _=i.getState().nodes.filter(A=>A.selected);t(v,_)}:void 0,b=v=>{Object.prototype.hasOwnProperty.call(V0,v.key)&&(v.preventDefault(),d({direction:V0[v.key],factor:v.shiftKey?4:1}))};return T.jsx("div",{className:zi(["react-flow__nodesselection","react-flow__container",e]),style:{transform:l},children:T.jsx("div",{ref:p,className:"react-flow__nodesselection-rect",onContextMenu:g,tabIndex:n?void 0:-1,onKeyDown:n?void 0:b,style:{width:r,height:s}})})}const QT=typeof window<"u"?window:void 0,WK=t=>({nodesSelectionActive:t.nodesSelectionActive,userSelectionActive:t.userSelectionActive});function hk({children:t,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,paneClickDistance:c,deleteKeyCode:d,selectionKeyCode:p,selectionOnDrag:m,selectionMode:g,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:_,panActivationKeyCode:A,zoomActivationKeyCode:C,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:R,panOnScroll:O,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:G,panOnDrag:W,defaultViewport:P,translateExtent:I,minZoom:K,maxZoom:q,preventScrolling:te,onSelectionContextMenu:H,noWheelClassName:$,noPanClassName:B,disableKeyboardA11y:X,onViewportChange:Z,isControlledViewport:Q}){const{nodesSelectionActive:F,userSelectionActive:Y}=en(WK,Qn),ee=qm(p,{target:QT}),V=qm(A,{target:QT}),le=V||W,ye=V||O,ve=m&&le!==!0,se=ee||Y||ve;return NK({deleteKeyCode:d,multiSelectionKeyCode:_}),T.jsx(DK,{onPaneContextMenu:s,elementsSelectable:w,zoomOnScroll:k,zoomOnPinch:R,panOnScroll:ye,panOnScrollSpeed:j,panOnScrollMode:D,zoomOnDoubleClick:G,panOnDrag:!ee&&le,defaultViewport:P,translateExtent:I,minZoom:K,maxZoom:q,zoomActivationKeyCode:C,preventScrolling:te,noWheelClassName:$,noPanClassName:B,onViewportChange:Z,isControlledViewport:Q,paneClickDistance:c,selectionOnDrag:ve,children:T.jsxs(UK,{onSelectionStart:b,onSelectionEnd:v,onPaneClick:e,onPaneMouseEnter:n,onPaneMouseMove:i,onPaneMouseLeave:r,onPaneContextMenu:s,onPaneScroll:l,panOnDrag:le,isSelecting:!!se,selectionMode:g,selectionKeyPressed:ee,paneClickDistance:c,selectionOnDrag:ve,children:[t,F&&T.jsx($K,{onSelectionContextMenu:H,noPanClassName:B,disableKeyboardA11y:X})]})})}hk.displayName="FlowRenderer";const ZK=L.memo(hk),QK=t=>e=>t?B1(e.nodeLookup,{x:0,y:0,width:e.width,height:e.height},e.transform,!0).map(n=>n.id):Array.from(e.nodeLookup.keys());function JK(t){return en(L.useCallback(QK(t),[t]),Qn)}const e$=t=>t.updateNodeInternals;function t$(){const t=en(e$),[e]=L.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const i=new Map;n.forEach(r=>{const s=r.target.getAttribute("data-id");i.set(s,{id:s,nodeElement:r.target,force:!0})}),t(i)}));return L.useEffect(()=>()=>{e==null||e.disconnect()},[e]),e}function n$({node:t,nodeType:e,hasDimensions:n,resizeObserver:i}){const r=Jn(),s=L.useRef(null),l=L.useRef(null),c=L.useRef(t.sourcePosition),d=L.useRef(t.targetPosition),p=L.useRef(e),m=n&&!!t.internals.handleBounds;return L.useEffect(()=>{s.current&&!t.hidden&&(!m||l.current!==s.current)&&(l.current&&(i==null||i.unobserve(l.current)),i==null||i.observe(s.current),l.current=s.current)},[m,t.hidden]),L.useEffect(()=>()=>{l.current&&(i==null||i.unobserve(l.current),l.current=null)},[]),L.useEffect(()=>{if(s.current){const g=p.current!==e,b=c.current!==t.sourcePosition,v=d.current!==t.targetPosition;(g||b||v)&&(p.current=e,c.current=t.sourcePosition,d.current=t.targetPosition,r.getState().updateNodeInternals(new Map([[t.id,{id:t.id,nodeElement:s.current,force:!0}]])))}},[t.id,e,t.sourcePosition,t.targetPosition]),s}function i$({id:t,onClick:e,onMouseEnter:n,onMouseMove:i,onMouseLeave:r,onContextMenu:s,onDoubleClick:l,nodesDraggable:c,elementsSelectable:d,nodesConnectable:p,nodesFocusable:m,resizeObserver:g,noDragClassName:b,noPanClassName:v,disableKeyboardA11y:_,rfId:A,nodeTypes:C,nodeClickDistance:w,onError:k}){const{node:R,internals:O,isParent:j}=en(me=>{const Me=me.nodeLookup.get(t),Ue=me.parentLookup.has(t);return{node:Me,internals:Me.internals,isParent:Ue}},Qn);let D=R.type||"default",G=(C==null?void 0:C[D])||ZT[D];G===void 0&&(k==null||k("003",mo.error003(D)),D="default",G=(C==null?void 0:C.default)||ZT.default);const W=!!(R.draggable||c&&typeof R.draggable>"u"),P=!!(R.selectable||d&&typeof R.selectable>"u"),I=!!(R.connectable||p&&typeof R.connectable>"u"),K=!!(R.focusable||m&&typeof R.focusable>"u"),q=Jn(),te=LN(R),H=n$({node:R,nodeType:D,hasDimensions:te,resizeObserver:g}),$=uk({nodeRef:H,disabled:R.hidden||!W,noDragClassName:b,handleSelector:R.dragHandle,nodeId:t,isSelectable:P,nodeClickDistance:w}),B=fk();if(R.hidden)return null;const X=uc(R),Z=XK(R),Q=P||W||e||n||i||r,F=n?me=>n(me,{...O.userNode}):void 0,Y=i?me=>i(me,{...O.userNode}):void 0,ee=r?me=>r(me,{...O.userNode}):void 0,V=s?me=>s(me,{...O.userNode}):void 0,le=l?me=>l(me,{...O.userNode}):void 0,ye=me=>{const{selectNodesOnDrag:Me,nodeDragThreshold:Ue}=q.getState();P&&(!Me||!W||Ue>0)&&D_({id:t,store:q,nodeRef:H}),e&&e(me,{...O.userNode})},ve=me=>{if(!(jN(me.nativeEvent)||_)){if(AN.includes(me.key)&&P){const Me=me.key==="Escape";D_({id:t,store:q,unselect:Me,nodeRef:H})}else if(W&&R.selected&&Object.prototype.hasOwnProperty.call(V0,me.key)){me.preventDefault();const{ariaLabelConfig:Me}=q.getState();q.setState({ariaLiveMessage:Me["node.a11yDescription.ariaLiveMessage"]({direction:me.key.replace("Arrow","").toLowerCase(),x:~~O.positionAbsolute.x,y:~~O.positionAbsolute.y})}),B({direction:V0[me.key],factor:me.shiftKey?4:1})}}},se=()=>{var Xe;if(_||!((Xe=H.current)!=null&&Xe.matches(":focus-visible")))return;const{transform:me,width:Me,height:Ue,autoPanOnNodeFocus:Le,setCenter:Pe}=q.getState();if(!Le)return;B1(new Map([[t,R]]),{x:0,y:0,width:Me,height:Ue},me,!0).length>0||Pe(R.position.x+X.width/2,R.position.y+X.height/2,{zoom:me[2]})};return T.jsx("div",{className:zi(["react-flow__node",`react-flow__node-${D}`,{[v]:W},R.className,{selected:R.selected,selectable:P,parent:j,draggable:W,dragging:$}]),ref:H,style:{zIndex:O.z,transform:`translate(${O.positionAbsolute.x}px,${O.positionAbsolute.y}px)`,pointerEvents:Q?"all":"none",visibility:te?"visible":"hidden",...R.style,...Z},"data-id":t,"data-testid":`rf__node-${t}`,onMouseEnter:F,onMouseMove:Y,onMouseLeave:ee,onContextMenu:V,onClick:ye,onDoubleClick:le,onKeyDown:K?ve:void 0,tabIndex:K?0:void 0,onFocus:K?se:void 0,role:R.ariaRole??(K?"group":void 0),"aria-roledescription":"node","aria-describedby":_?void 0:`${rk}-${A}`,"aria-label":R.ariaLabel,...R.domAttributes,children:T.jsx(jK,{value:t,children:T.jsx(G,{id:t,data:R.data,type:D,positionAbsoluteX:O.positionAbsolute.x,positionAbsoluteY:O.positionAbsolute.y,selected:R.selected??!1,selectable:P,draggable:W,deletable:R.deletable??!0,isConnectable:I,sourcePosition:R.sourcePosition,targetPosition:R.targetPosition,dragging:$,dragHandle:R.dragHandle,zIndex:O.z,parentId:R.parentId,...X})})})}var r$=L.memo(i$);const a$=t=>({nodesDraggable:t.nodesDraggable,nodesConnectable:t.nodesConnectable,nodesFocusable:t.nodesFocusable,elementsSelectable:t.elementsSelectable,onError:t.onError});function pk(t){const{nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,onError:s}=en(a$,Qn),l=JK(t.onlyRenderVisibleElements),c=t$();return T.jsx("div",{className:"react-flow__nodes",style:vb,children:l.map(d=>T.jsx(r$,{id:d,nodeTypes:t.nodeTypes,nodeExtent:t.nodeExtent,onClick:t.onNodeClick,onMouseEnter:t.onNodeMouseEnter,onMouseMove:t.onNodeMouseMove,onMouseLeave:t.onNodeMouseLeave,onContextMenu:t.onNodeContextMenu,onDoubleClick:t.onNodeDoubleClick,noDragClassName:t.noDragClassName,noPanClassName:t.noPanClassName,rfId:t.rfId,disableKeyboardA11y:t.disableKeyboardA11y,resizeObserver:c,nodesDraggable:e,nodesConnectable:n,nodesFocusable:i,elementsSelectable:r,nodeClickDistance:t.nodeClickDistance,onError:s},d))})}pk.displayName="NodeRenderer";const s$=L.memo(pk);function l$(t){return en(L.useCallback(n=>{if(!t)return n.edges.map(r=>r.id);const i=[];if(n.width&&n.height)for(const r of n.edges){const s=n.nodeLookup.get(r.source),l=n.nodeLookup.get(r.target);s&&l&&iX({sourceNode:s,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&i.push(r.id)}return i},[t]),Qn)}const o$=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t}};return T.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},c$=({color:t="none",strokeWidth:e=1})=>{const n={strokeWidth:e,...t&&{stroke:t,fill:t}};return T.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},JT={[F0.Arrow]:o$,[F0.ArrowClosed]:c$};function u$(t){const e=Jn();return L.useMemo(()=>{var r,s;return Object.prototype.hasOwnProperty.call(JT,t)?JT[t]:((s=(r=e.getState()).onError)==null||s.call(r,"009",mo.error009(t)),null)},[t])}const f$=({id:t,type:e,color:n,width:i=12.5,height:r=12.5,markerUnits:s="strokeWidth",strokeWidth:l,orient:c="auto-start-reverse"})=>{const d=u$(e);return d?T.jsx("marker",{className:"react-flow__arrowhead",id:t,markerWidth:`${i}`,markerHeight:`${r}`,viewBox:"-10 -10 20 20",markerUnits:s,orient:c,refX:"0",refY:"0",children:T.jsx(d,{color:n,strokeWidth:l})}):null},mk=({defaultColor:t,rfId:e})=>{const n=en(s=>s.edges),i=en(s=>s.defaultEdgeOptions),r=L.useMemo(()=>fX(n,{id:e,defaultColor:t,defaultMarkerStart:i==null?void 0:i.markerStart,defaultMarkerEnd:i==null?void 0:i.markerEnd}),[n,i,e,t]);return r.length?T.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:T.jsx("defs",{children:r.map(s=>T.jsx(f$,{id:s.id,type:s.type,color:s.color,width:s.width,height:s.height,markerUnits:s.markerUnits,strokeWidth:s.strokeWidth,orient:s.orient},s.id))})}):null};mk.displayName="MarkerDefinitions";var d$=L.memo(mk);function gk({x:t,y:e,label:n,labelStyle:i,labelShowBg:r=!0,labelBgStyle:s,labelBgPadding:l=[2,4],labelBgBorderRadius:c=2,children:d,className:p,...m}){const[g,b]=L.useState({x:1,y:0,width:0,height:0}),v=zi(["react-flow__edge-textwrapper",p]),_=L.useRef(null);return L.useEffect(()=>{if(_.current){const A=_.current.getBBox();b({x:A.x,y:A.y,width:A.width,height:A.height})}},[n]),n?T.jsxs("g",{transform:`translate(${t-g.width/2} ${e-g.height/2})`,className:v,visibility:g.width?"visible":"hidden",...m,children:[r&&T.jsx("rect",{width:g.width+2*l[0],x:-l[0],y:-l[1],height:g.height+2*l[1],className:"react-flow__edge-textbg",style:s,rx:c,ry:c}),T.jsx("text",{className:"react-flow__edge-text",y:g.height/2,dy:"0.3em",ref:_,style:i,children:n}),d]}):null}gk.displayName="EdgeText";const h$=L.memo(gk);function _b({path:t,labelX:e,labelY:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d,interactionWidth:p=20,...m}){return T.jsxs(T.Fragment,{children:[T.jsx("path",{...m,d:t,fill:"none",className:zi(["react-flow__edge-path",m.className])}),p?T.jsx("path",{d:t,fill:"none",strokeOpacity:0,strokeWidth:p,className:"react-flow__edge-interaction"}):null,i&&yl(e)&&yl(n)?T.jsx(h$,{x:e,y:n,label:i,labelStyle:r,labelShowBg:s,labelBgStyle:l,labelBgPadding:c,labelBgBorderRadius:d}):null]})}function eC({pos:t,x1:e,y1:n,x2:i,y2:r}){return t===Je.Left||t===Je.Right?[.5*(e+i),n]:[e,.5*(n+r)]}function yk({sourceX:t,sourceY:e,sourcePosition:n=Je.Bottom,targetX:i,targetY:r,targetPosition:s=Je.Top}){const[l,c]=eC({pos:n,x1:t,y1:e,x2:i,y2:r}),[d,p]=eC({pos:s,x1:i,y1:r,x2:t,y2:e}),[m,g,b,v]=PN({sourceX:t,sourceY:e,targetX:i,targetY:r,sourceControlX:l,sourceControlY:c,targetControlX:d,targetControlY:p});return[`M${t},${e} C${l},${c} ${d},${p} ${i},${r}`,m,g,b,v]}function bk(t){return L.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l,targetPosition:c,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:A,markerStart:C,interactionWidth:w})=>{const[k,R,O]=yk({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c}),j=t.isInternal?void 0:e;return T.jsx(_b,{id:j,path:k,labelX:R,labelY:O,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:A,markerStart:C,interactionWidth:w})})}const p$=bk({isInternal:!1}),xk=bk({isInternal:!0});p$.displayName="SimpleBezierEdge";xk.displayName="SimpleBezierEdgeInternal";function vk(t){return L.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,sourcePosition:v=Je.Bottom,targetPosition:_=Je.Top,markerEnd:A,markerStart:C,pathOptions:w,interactionWidth:k})=>{const[R,O,j]=R_({sourceX:n,sourceY:i,sourcePosition:v,targetX:r,targetY:s,targetPosition:_,borderRadius:w==null?void 0:w.borderRadius,offset:w==null?void 0:w.offset,stepPosition:w==null?void 0:w.stepPosition}),D=t.isInternal?void 0:e;return T.jsx(_b,{id:D,path:R,labelX:O,labelY:j,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:A,markerStart:C,interactionWidth:k})})}const _k=vk({isInternal:!1}),Sk=vk({isInternal:!0});_k.displayName="SmoothStepEdge";Sk.displayName="SmoothStepEdgeInternal";function Ek(t){return L.memo(({id:e,...n})=>{var r;const i=t.isInternal?void 0:e;return T.jsx(_k,{...n,id:i,pathOptions:L.useMemo(()=>{var s;return{borderRadius:0,offset:(s=n.pathOptions)==null?void 0:s.offset}},[(r=n.pathOptions)==null?void 0:r.offset])})})}const m$=Ek({isInternal:!1}),wk=Ek({isInternal:!0});m$.displayName="StepEdge";wk.displayName="StepEdgeInternal";function Tk(t){return L.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:v,markerStart:_,interactionWidth:A})=>{const[C,w,k]=qN({sourceX:n,sourceY:i,targetX:r,targetY:s}),R=t.isInternal?void 0:e;return T.jsx(_b,{id:R,path:C,labelX:w,labelY:k,label:l,labelStyle:c,labelShowBg:d,labelBgStyle:p,labelBgPadding:m,labelBgBorderRadius:g,style:b,markerEnd:v,markerStart:_,interactionWidth:A})})}const g$=Tk({isInternal:!1}),Ck=Tk({isInternal:!0});g$.displayName="StraightEdge";Ck.displayName="StraightEdgeInternal";function Ak(t){return L.memo(({id:e,sourceX:n,sourceY:i,targetX:r,targetY:s,sourcePosition:l=Je.Bottom,targetPosition:c=Je.Top,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:A,markerStart:C,pathOptions:w,interactionWidth:k})=>{const[R,O,j]=GN({sourceX:n,sourceY:i,sourcePosition:l,targetX:r,targetY:s,targetPosition:c,curvature:w==null?void 0:w.curvature}),D=t.isInternal?void 0:e;return T.jsx(_b,{id:D,path:R,labelX:O,labelY:j,label:d,labelStyle:p,labelShowBg:m,labelBgStyle:g,labelBgPadding:b,labelBgBorderRadius:v,style:_,markerEnd:A,markerStart:C,interactionWidth:k})})}const y$=Ak({isInternal:!1}),Mk=Ak({isInternal:!0});y$.displayName="BezierEdge";Mk.displayName="BezierEdgeInternal";const tC={default:Mk,straight:Ck,step:wk,smoothstep:Sk,simplebezier:xk},nC={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null},b$=(t,e,n)=>n===Je.Left?t-e:n===Je.Right?t+e:t,x$=(t,e,n)=>n===Je.Top?t-e:n===Je.Bottom?t+e:t,iC="react-flow__edgeupdater";function rC({position:t,centerX:e,centerY:n,radius:i=10,onMouseDown:r,onMouseEnter:s,onMouseOut:l,type:c}){return T.jsx("circle",{onMouseDown:r,onMouseEnter:s,onMouseOut:l,className:zi([iC,`${iC}-${c}`]),cx:b$(e,i,t),cy:x$(n,i,t),r:i,stroke:"transparent",fill:"transparent"})}function v$({isReconnectable:t,reconnectRadius:e,edge:n,sourceX:i,sourceY:r,targetX:s,targetY:l,sourcePosition:c,targetPosition:d,onReconnect:p,onReconnectStart:m,onReconnectEnd:g,setReconnecting:b,setUpdateHover:v}){const _=Jn(),A=(O,j)=>{if(O.button!==0)return;const{autoPanOnConnect:D,domNode:G,connectionMode:W,connectionRadius:P,lib:I,onConnectStart:K,cancelConnection:q,nodeLookup:te,rfId:H,panBy:$,updateConnection:B}=_.getState(),X=j.type==="target",Z=(Y,ee)=>{b(!1),g==null||g(Y,n,j.type,ee)},Q=Y=>p==null?void 0:p(n,Y),F=(Y,ee)=>{b(!0),m==null||m(O,n,j.type),K==null||K(Y,ee)};O_.onPointerDown(O.nativeEvent,{autoPanOnConnect:D,connectionMode:W,connectionRadius:P,domNode:G,handleId:j.id,nodeId:j.nodeId,nodeLookup:te,isTarget:X,edgeUpdaterType:j.type,lib:I,flowId:H,cancelConnection:q,panBy:$,isValidConnection:(...Y)=>{var ee,V;return((V=(ee=_.getState()).isValidConnection)==null?void 0:V.call(ee,...Y))??!0},onConnect:Q,onConnectStart:F,onConnectEnd:(...Y)=>{var ee,V;return(V=(ee=_.getState()).onConnectEnd)==null?void 0:V.call(ee,...Y)},onReconnectEnd:Z,updateConnection:B,getTransform:()=>_.getState().transform,getFromHandle:()=>_.getState().connection.fromHandle,dragThreshold:_.getState().connectionDragThreshold,handleDomNode:O.currentTarget})},C=O=>A(O,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),w=O=>A(O,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),k=()=>v(!0),R=()=>v(!1);return T.jsxs(T.Fragment,{children:[(t===!0||t==="source")&&T.jsx(rC,{position:c,centerX:i,centerY:r,radius:e,onMouseDown:C,onMouseEnter:k,onMouseOut:R,type:"source"}),(t===!0||t==="target")&&T.jsx(rC,{position:d,centerX:s,centerY:l,radius:e,onMouseDown:w,onMouseEnter:k,onMouseOut:R,type:"target"})]})}function _$({id:t,edgesFocusable:e,edgesReconnectable:n,elementsSelectable:i,onClick:r,onDoubleClick:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,reconnectRadius:m,onReconnect:g,onReconnectStart:b,onReconnectEnd:v,rfId:_,edgeTypes:A,noPanClassName:C,onError:w,disableKeyboardA11y:k}){let R=en(Pe=>Pe.edgeLookup.get(t));const O=en(Pe=>Pe.defaultEdgeOptions);R=O?{...O,...R}:R;let j=R.type||"default",D=(A==null?void 0:A[j])||tC[j];D===void 0&&(w==null||w("011",mo.error011(j)),j="default",D=(A==null?void 0:A.default)||tC.default);const G=!!(R.focusable||e&&typeof R.focusable>"u"),W=typeof g<"u"&&(R.reconnectable||n&&typeof R.reconnectable>"u"),P=!!(R.selectable||i&&typeof R.selectable>"u"),I=L.useRef(null),[K,q]=L.useState(!1),[te,H]=L.useState(!1),$=Jn(),{zIndex:B,sourceX:X,sourceY:Z,targetX:Q,targetY:F,sourcePosition:Y,targetPosition:ee}=en(L.useCallback(Pe=>{const He=Pe.nodeLookup.get(R.source),Xe=Pe.nodeLookup.get(R.target);if(!He||!Xe)return{zIndex:R.zIndex,...nC};const ot=uX({id:t,sourceNode:He,targetNode:Xe,sourceHandle:R.sourceHandle||null,targetHandle:R.targetHandle||null,connectionMode:Pe.connectionMode,onError:w});return{zIndex:nX({selected:R.selected,zIndex:R.zIndex,sourceNode:He,targetNode:Xe,elevateOnSelect:Pe.elevateEdgesOnSelect,zIndexMode:Pe.zIndexMode}),...ot||nC}},[R.source,R.target,R.sourceHandle,R.targetHandle,R.selected,R.zIndex]),Qn),V=L.useMemo(()=>R.markerStart?`url('#${N_(R.markerStart,_)}')`:void 0,[R.markerStart,_]),le=L.useMemo(()=>R.markerEnd?`url('#${N_(R.markerEnd,_)}')`:void 0,[R.markerEnd,_]);if(R.hidden||X===null||Z===null||Q===null||F===null)return null;const ye=Pe=>{var Ie;const{addSelectedEdges:He,unselectNodesAndEdges:Xe,multiSelectionActive:ot}=$.getState();P&&($.setState({nodesSelectionActive:!1}),R.selected&&ot?(Xe({nodes:[],edges:[R]}),(Ie=I.current)==null||Ie.blur()):He([t])),r&&r(Pe,R)},ve=s?Pe=>{s(Pe,{...R})}:void 0,se=l?Pe=>{l(Pe,{...R})}:void 0,me=c?Pe=>{c(Pe,{...R})}:void 0,Me=d?Pe=>{d(Pe,{...R})}:void 0,Ue=p?Pe=>{p(Pe,{...R})}:void 0,Le=Pe=>{var He;if(!k&&AN.includes(Pe.key)&&P){const{unselectNodesAndEdges:Xe,addSelectedEdges:ot}=$.getState();Pe.key==="Escape"?((He=I.current)==null||He.blur(),Xe({edges:[R]})):ot([t])}};return T.jsx("svg",{style:{zIndex:B},children:T.jsxs("g",{className:zi(["react-flow__edge",`react-flow__edge-${j}`,R.className,C,{selected:R.selected,animated:R.animated,inactive:!P&&!r,updating:K,selectable:P}]),onClick:ye,onDoubleClick:ve,onContextMenu:se,onMouseEnter:me,onMouseMove:Me,onMouseLeave:Ue,onKeyDown:G?Le:void 0,tabIndex:G?0:void 0,role:R.ariaRole??(G?"group":"img"),"aria-roledescription":"edge","data-id":t,"data-testid":`rf__edge-${t}`,"aria-label":R.ariaLabel===null?void 0:R.ariaLabel||`Edge from ${R.source} to ${R.target}`,"aria-describedby":G?`${ak}-${_}`:void 0,ref:I,...R.domAttributes,children:[!te&&T.jsx(D,{id:t,source:R.source,target:R.target,type:R.type,selected:R.selected,animated:R.animated,selectable:P,deletable:R.deletable??!0,label:R.label,labelStyle:R.labelStyle,labelShowBg:R.labelShowBg,labelBgStyle:R.labelBgStyle,labelBgPadding:R.labelBgPadding,labelBgBorderRadius:R.labelBgBorderRadius,sourceX:X,sourceY:Z,targetX:Q,targetY:F,sourcePosition:Y,targetPosition:ee,data:R.data,style:R.style,sourceHandleId:R.sourceHandle,targetHandleId:R.targetHandle,markerStart:V,markerEnd:le,pathOptions:"pathOptions"in R?R.pathOptions:void 0,interactionWidth:R.interactionWidth}),W&&T.jsx(v$,{edge:R,isReconnectable:W,reconnectRadius:m,onReconnect:g,onReconnectStart:b,onReconnectEnd:v,sourceX:X,sourceY:Z,targetX:Q,targetY:F,sourcePosition:Y,targetPosition:ee,setUpdateHover:q,setReconnecting:H})]})})}var S$=L.memo(_$);const E$=t=>({edgesFocusable:t.edgesFocusable,edgesReconnectable:t.edgesReconnectable,elementsSelectable:t.elementsSelectable,connectionMode:t.connectionMode,onError:t.onError});function Rk({defaultMarkerColor:t,onlyRenderVisibleElements:e,rfId:n,edgeTypes:i,noPanClassName:r,onReconnect:s,onEdgeContextMenu:l,onEdgeMouseEnter:c,onEdgeMouseMove:d,onEdgeMouseLeave:p,onEdgeClick:m,reconnectRadius:g,onEdgeDoubleClick:b,onReconnectStart:v,onReconnectEnd:_,disableKeyboardA11y:A}){const{edgesFocusable:C,edgesReconnectable:w,elementsSelectable:k,onError:R}=en(E$,Qn),O=l$(e);return T.jsxs("div",{className:"react-flow__edges",children:[T.jsx(d$,{defaultColor:t,rfId:n}),O.map(j=>T.jsx(S$,{id:j,edgesFocusable:C,edgesReconnectable:w,elementsSelectable:k,noPanClassName:r,onReconnect:s,onContextMenu:l,onMouseEnter:c,onMouseMove:d,onMouseLeave:p,onClick:m,reconnectRadius:g,onDoubleClick:b,onReconnectStart:v,onReconnectEnd:_,rfId:n,onError:R,edgeTypes:i,disableKeyboardA11y:A},j))]})}Rk.displayName="EdgeRenderer";const w$=L.memo(Rk),T$=t=>`translate(${t.transform[0]}px,${t.transform[1]}px) scale(${t.transform[2]})`;function C$({children:t}){const e=en(T$);return T.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:e},children:t})}function A$(t){const e=xb(),n=L.useRef(!1);L.useEffect(()=>{!n.current&&e.viewportInitialized&&t&&(setTimeout(()=>t(e),1),n.current=!0)},[t,e.viewportInitialized])}const M$=t=>{var e;return(e=t.panZoom)==null?void 0:e.syncViewport};function R$(t){const e=en(M$),n=Jn();return L.useEffect(()=>{t&&(e==null||e(t),n.setState({transform:[t.x,t.y,t.zoom]}))},[t,e]),null}function N$(t){return t.connection.inProgress?{...t.connection,to:ag(t.connection.to,t.transform)}:{...t.connection}}function k$(t){return N$}function O$(t){const e=k$();return en(e,Qn)}const D$=t=>({nodesConnectable:t.nodesConnectable,isValid:t.connection.isValid,inProgress:t.connection.inProgress,width:t.width,height:t.height});function z$({containerStyle:t,style:e,type:n,component:i}){const{nodesConnectable:r,width:s,height:l,isValid:c,inProgress:d}=en(D$,Qn);return!(s&&r&&d)?null:T.jsx("svg",{style:t,width:s,height:l,className:"react-flow__connectionline react-flow__container",children:T.jsx("g",{className:zi(["react-flow__connection",NN(c)]),children:T.jsx(Nk,{style:e,type:n,CustomComponent:i,isValid:c})})})}const Nk=({style:t,type:e=au.Bezier,CustomComponent:n,isValid:i})=>{const{inProgress:r,from:s,fromNode:l,fromHandle:c,fromPosition:d,to:p,toNode:m,toHandle:g,toPosition:b,pointer:v}=O$();if(!r)return;if(n)return T.jsx(n,{connectionLineType:e,connectionLineStyle:t,fromNode:l,fromHandle:c,fromX:s.x,fromY:s.y,toX:p.x,toY:p.y,fromPosition:d,toPosition:b,connectionStatus:NN(i),toNode:m,toHandle:g,pointer:v});let _="";const A={sourceX:s.x,sourceY:s.y,sourcePosition:d,targetX:p.x,targetY:p.y,targetPosition:b};switch(e){case au.Bezier:[_]=GN(A);break;case au.SimpleBezier:[_]=yk(A);break;case au.Step:[_]=R_({...A,borderRadius:0});break;case au.SmoothStep:[_]=R_(A);break;default:[_]=qN(A)}return T.jsx("path",{d:_,fill:"none",className:"react-flow__connection-path",style:t})};Nk.displayName="ConnectionLine";const B$={};function aC(t=B$){L.useRef(t),Jn(),L.useEffect(()=>{},[t])}function L$(){Jn(),L.useRef(!1),L.useEffect(()=>{},[])}function kk({nodeTypes:t,edgeTypes:e,onInit:n,onNodeClick:i,onEdgeClick:r,onNodeDoubleClick:s,onEdgeDoubleClick:l,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,onSelectionContextMenu:g,onSelectionStart:b,onSelectionEnd:v,connectionLineType:_,connectionLineStyle:A,connectionLineComponent:C,connectionLineContainerStyle:w,selectionKeyCode:k,selectionOnDrag:R,selectionMode:O,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:G,deleteKeyCode:W,onlyRenderVisibleElements:P,elementsSelectable:I,defaultViewport:K,translateExtent:q,minZoom:te,maxZoom:H,preventScrolling:$,defaultMarkerColor:B,zoomOnScroll:X,zoomOnPinch:Z,panOnScroll:Q,panOnScrollSpeed:F,panOnScrollMode:Y,zoomOnDoubleClick:ee,panOnDrag:V,onPaneClick:le,onPaneMouseEnter:ye,onPaneMouseMove:ve,onPaneMouseLeave:se,onPaneScroll:me,onPaneContextMenu:Me,paneClickDistance:Ue,nodeClickDistance:Le,onEdgeContextMenu:Pe,onEdgeMouseEnter:He,onEdgeMouseMove:Xe,onEdgeMouseLeave:ot,reconnectRadius:Ie,onReconnect:de,onReconnectStart:ut,onReconnectEnd:It,noDragClassName:jt,noWheelClassName:Sn,noPanClassName:xi,disableKeyboardA11y:qt,nodeExtent:Zt,rfId:Bi,viewport:_e,onViewportChange:ke}){return aC(t),aC(e),L$(),A$(n),R$(_e),T.jsx(ZK,{onPaneClick:le,onPaneMouseEnter:ye,onPaneMouseMove:ve,onPaneMouseLeave:se,onPaneContextMenu:Me,onPaneScroll:me,paneClickDistance:Ue,deleteKeyCode:W,selectionKeyCode:k,selectionOnDrag:R,selectionMode:O,onSelectionStart:b,onSelectionEnd:v,multiSelectionKeyCode:j,panActivationKeyCode:D,zoomActivationKeyCode:G,elementsSelectable:I,zoomOnScroll:X,zoomOnPinch:Z,zoomOnDoubleClick:ee,panOnScroll:Q,panOnScrollSpeed:F,panOnScrollMode:Y,panOnDrag:V,defaultViewport:K,translateExtent:q,minZoom:te,maxZoom:H,onSelectionContextMenu:g,preventScrolling:$,noDragClassName:jt,noWheelClassName:Sn,noPanClassName:xi,disableKeyboardA11y:qt,onViewportChange:ke,isControlledViewport:!!_e,children:T.jsxs(C$,{children:[T.jsx(w$,{edgeTypes:e,onEdgeClick:r,onEdgeDoubleClick:l,onReconnect:de,onReconnectStart:ut,onReconnectEnd:It,onlyRenderVisibleElements:P,onEdgeContextMenu:Pe,onEdgeMouseEnter:He,onEdgeMouseMove:Xe,onEdgeMouseLeave:ot,reconnectRadius:Ie,defaultMarkerColor:B,noPanClassName:xi,disableKeyboardA11y:qt,rfId:Bi}),T.jsx(z$,{style:A,type:_,component:C,containerStyle:w}),T.jsx("div",{className:"react-flow__edgelabel-renderer"}),T.jsx(s$,{nodeTypes:t,onNodeClick:i,onNodeDoubleClick:s,onNodeMouseEnter:c,onNodeMouseMove:d,onNodeMouseLeave:p,onNodeContextMenu:m,nodeClickDistance:Le,onlyRenderVisibleElements:P,noPanClassName:xi,noDragClassName:jt,disableKeyboardA11y:qt,nodeExtent:Zt,rfId:Bi}),T.jsx("div",{className:"react-flow__viewport-portal"})]})})}kk.displayName="GraphView";const U$=L.memo(kk),sC=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d=.5,maxZoom:p=2,nodeOrigin:m,nodeExtent:g,zIndexMode:b="basic"}={})=>{const v=new Map,_=new Map,A=new Map,C=new Map,w=i??e??[],k=n??t??[],R=m??[0,0],O=g??Hm;XN(A,C,w);const j=k_(k,v,_,{nodeOrigin:R,nodeExtent:O,zIndexMode:b});let D=[0,0,1];if(l&&r&&s){const G=ig(v,{filter:K=>!!((K.width||K.initialWidth)&&(K.height||K.initialHeight))}),{x:W,y:P,zoom:I}=L1(G,r,s,d,p,(c==null?void 0:c.padding)??.1);D=[W,P,I]}return{rfId:"1",width:r??0,height:s??0,transform:D,nodes:k,nodesInitialized:j,nodeLookup:v,parentLookup:_,edges:w,edgeLookup:C,connectionLookup:A,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:i!==void 0,panZoom:null,minZoom:d,maxZoom:p,translateExtent:Hm,nodeExtent:O,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:dh.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:R,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:c,fitViewResolver:null,connection:{...RN},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:WV,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:MN,zIndexMode:b,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},I$=({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,zIndexMode:b})=>eK((v,_)=>{async function A(){const{nodeLookup:C,panZoom:w,fitViewOptions:k,fitViewResolver:R,width:O,height:j,minZoom:D,maxZoom:G}=_();w&&(await KV({nodes:C,width:O,height:j,panZoom:w,minZoom:D,maxZoom:G},k),R==null||R.resolve(!0),v({fitViewResolver:null}))}return{...sC({nodes:t,edges:e,width:r,height:s,fitView:l,fitViewOptions:c,minZoom:d,maxZoom:p,nodeOrigin:m,nodeExtent:g,defaultNodes:n,defaultEdges:i,zIndexMode:b}),setNodes:C=>{const{nodeLookup:w,parentLookup:k,nodeOrigin:R,elevateNodesOnSelect:O,fitViewQueued:j,zIndexMode:D}=_(),G=k_(C,w,k,{nodeOrigin:R,nodeExtent:g,elevateNodesOnSelect:O,checkEquality:!0,zIndexMode:D});j&&G?(A(),v({nodes:C,nodesInitialized:G,fitViewQueued:!1,fitViewOptions:void 0})):v({nodes:C,nodesInitialized:G})},setEdges:C=>{const{connectionLookup:w,edgeLookup:k}=_();XN(w,k,C),v({edges:C})},setDefaultNodesAndEdges:(C,w)=>{if(C){const{setNodes:k}=_();k(C),v({hasDefaultNodes:!0})}if(w){const{setEdges:k}=_();k(w),v({hasDefaultEdges:!0})}},updateNodeInternals:C=>{const{triggerNodeChanges:w,nodeLookup:k,parentLookup:R,domNode:O,nodeOrigin:j,nodeExtent:D,debug:G,fitViewQueued:W,zIndexMode:P}=_(),{changes:I,updatedInternals:K}=bX(C,k,R,O,j,D,P);K&&(pX(k,R,{nodeOrigin:j,nodeExtent:D,zIndexMode:P}),W?(A(),v({fitViewQueued:!1,fitViewOptions:void 0})):v({}),(I==null?void 0:I.length)>0&&(G&&console.log("React Flow: trigger node changes",I),w==null||w(I)))},updateNodePositions:(C,w=!1)=>{const k=[];let R=[];const{nodeLookup:O,triggerNodeChanges:j,connection:D,updateConnection:G,onNodesChangeMiddlewareMap:W}=_();for(const[P,I]of C){const K=O.get(P),q=!!(K!=null&&K.expandParent&&(K!=null&&K.parentId)&&(I!=null&&I.position)),te={id:P,type:"position",position:q?{x:Math.max(0,I.position.x),y:Math.max(0,I.position.y)}:I.position,dragging:w};if(K&&D.inProgress&&D.fromNode.id===K.id){const H=wf(K,D.fromHandle,Je.Left,!0);G({...D,from:H})}q&&K.parentId&&k.push({id:P,parentId:K.parentId,rect:{...I.internals.positionAbsolute,width:I.measured.width??0,height:I.measured.height??0}}),R.push(te)}if(k.length>0){const{parentLookup:P,nodeOrigin:I}=_(),K=G1(k,O,P,I);R.push(...K)}for(const P of W.values())R=P(R);j(R)},triggerNodeChanges:C=>{const{onNodesChange:w,setNodes:k,nodes:R,hasDefaultNodes:O,debug:j}=_();if(C!=null&&C.length){if(O){const D=_K(C,R);k(D)}j&&console.log("React Flow: trigger node changes",C),w==null||w(C)}},triggerEdgeChanges:C=>{const{onEdgesChange:w,setEdges:k,edges:R,hasDefaultEdges:O,debug:j}=_();if(C!=null&&C.length){if(O){const D=SK(C,R);k(D)}j&&console.log("React Flow: trigger edge changes",C),w==null||w(C)}},addSelectedNodes:C=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:j}=_();if(w){const D=C.map(G=>df(G,!0));O(D);return}O(Wd(R,new Set([...C]),!0)),j(Wd(k))},addSelectedEdges:C=>{const{multiSelectionActive:w,edgeLookup:k,nodeLookup:R,triggerNodeChanges:O,triggerEdgeChanges:j}=_();if(w){const D=C.map(G=>df(G,!0));j(D);return}j(Wd(k,new Set([...C]))),O(Wd(R,new Set,!0))},unselectNodesAndEdges:({nodes:C,edges:w}={})=>{const{edges:k,nodes:R,nodeLookup:O,triggerNodeChanges:j,triggerEdgeChanges:D}=_(),G=C||R,W=w||k,P=[];for(const K of G){if(!K.selected)continue;const q=O.get(K.id);q&&(q.selected=!1),P.push(df(K.id,!1))}const I=[];for(const K of W)K.selected&&I.push(df(K.id,!1));j(P),D(I)},setMinZoom:C=>{const{panZoom:w,maxZoom:k}=_();w==null||w.setScaleExtent([C,k]),v({minZoom:C})},setMaxZoom:C=>{const{panZoom:w,minZoom:k}=_();w==null||w.setScaleExtent([k,C]),v({maxZoom:C})},setTranslateExtent:C=>{var w;(w=_().panZoom)==null||w.setTranslateExtent(C),v({translateExtent:C})},resetSelectedElements:()=>{const{edges:C,nodes:w,triggerNodeChanges:k,triggerEdgeChanges:R,elementsSelectable:O}=_();if(!O)return;const j=w.reduce((G,W)=>W.selected?[...G,df(W.id,!1)]:G,[]),D=C.reduce((G,W)=>W.selected?[...G,df(W.id,!1)]:G,[]);k(j),R(D)},setNodeExtent:C=>{const{nodes:w,nodeLookup:k,parentLookup:R,nodeOrigin:O,elevateNodesOnSelect:j,nodeExtent:D,zIndexMode:G}=_();C[0][0]===D[0][0]&&C[0][1]===D[0][1]&&C[1][0]===D[1][0]&&C[1][1]===D[1][1]||(k_(w,k,R,{nodeOrigin:O,nodeExtent:C,elevateNodesOnSelect:j,checkEquality:!1,zIndexMode:G}),v({nodeExtent:C}))},panBy:C=>{const{transform:w,width:k,height:R,panZoom:O,translateExtent:j}=_();return xX({delta:C,panZoom:O,transform:w,translateExtent:j,width:k,height:R})},setCenter:async(C,w,k)=>{const{width:R,height:O,maxZoom:j,panZoom:D}=_();if(!D)return Promise.resolve(!1);const G=typeof(k==null?void 0:k.zoom)<"u"?k.zoom:j;return await D.setViewport({x:R/2-C*G,y:O/2-w*G,zoom:G},{duration:k==null?void 0:k.duration,ease:k==null?void 0:k.ease,interpolate:k==null?void 0:k.interpolate}),Promise.resolve(!0)},cancelConnection:()=>{v({connection:{...RN}})},updateConnection:C=>{v({connection:C})},reset:()=>v({...sC()})}},Object.is);function Ok({initialNodes:t,initialEdges:e,defaultNodes:n,defaultEdges:i,initialWidth:r,initialHeight:s,initialMinZoom:l,initialMaxZoom:c,initialFitViewOptions:d,fitView:p,nodeOrigin:m,nodeExtent:g,zIndexMode:b,children:v}){const[_]=L.useState(()=>I$({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,width:r,height:s,fitView:p,minZoom:l,maxZoom:c,fitViewOptions:d,nodeOrigin:m,nodeExtent:g,zIndexMode:b}));return T.jsx(tK,{value:_,children:T.jsx(CK,{children:v})})}function j$({children:t,nodes:e,edges:n,defaultNodes:i,defaultEdges:r,width:s,height:l,fitView:c,fitViewOptions:d,minZoom:p,maxZoom:m,nodeOrigin:g,nodeExtent:b,zIndexMode:v}){return L.useContext(yb)?T.jsx(T.Fragment,{children:t}):T.jsx(Ok,{initialNodes:e,initialEdges:n,defaultNodes:i,defaultEdges:r,initialWidth:s,initialHeight:l,fitView:c,initialFitViewOptions:d,initialMinZoom:p,initialMaxZoom:m,nodeOrigin:g,nodeExtent:b,zIndexMode:v,children:t})}const H$={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function P$({nodes:t,edges:e,defaultNodes:n,defaultEdges:i,className:r,nodeTypes:s,edgeTypes:l,onNodeClick:c,onEdgeClick:d,onInit:p,onMove:m,onMoveStart:g,onMoveEnd:b,onConnect:v,onConnectStart:_,onConnectEnd:A,onClickConnectStart:C,onClickConnectEnd:w,onNodeMouseEnter:k,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,onNodeDragStart:G,onNodeDrag:W,onNodeDragStop:P,onNodesDelete:I,onEdgesDelete:K,onDelete:q,onSelectionChange:te,onSelectionDragStart:H,onSelectionDrag:$,onSelectionDragStop:B,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:Q,onBeforeDelete:F,connectionMode:Y,connectionLineType:ee=au.Bezier,connectionLineStyle:V,connectionLineComponent:le,connectionLineContainerStyle:ye,deleteKeyCode:ve="Backspace",selectionKeyCode:se="Shift",selectionOnDrag:me=!1,selectionMode:Me=Pm.Full,panActivationKeyCode:Ue="Space",multiSelectionKeyCode:Le=Fm()?"Meta":"Control",zoomActivationKeyCode:Pe=Fm()?"Meta":"Control",snapToGrid:He,snapGrid:Xe,onlyRenderVisibleElements:ot=!1,selectNodesOnDrag:Ie,nodesDraggable:de,autoPanOnNodeFocus:ut,nodesConnectable:It,nodesFocusable:jt,nodeOrigin:Sn=sk,edgesFocusable:xi,edgesReconnectable:qt,elementsSelectable:Zt=!0,defaultViewport:Bi=pK,minZoom:_e=.5,maxZoom:ke=2,translateExtent:et=Hm,preventScrolling:vt=!0,nodeExtent:Ot,defaultMarkerColor:vi="#b1b1b7",zoomOnScroll:lr=!0,zoomOnPinch:En=!0,panOnScroll:tn=!1,panOnScrollSpeed:qn=.5,panOnScrollMode:Yt=yf.Free,zoomOnDoubleClick:Vi=!0,panOnDrag:ei=!0,onPaneClick:xo,onPaneMouseEnter:ss,onPaneMouseMove:Da,onPaneMouseLeave:ls,onPaneScroll:_i,onPaneContextMenu:ae,paneClickDistance:we=1,nodeClickDistance:Be=0,children:tt,onReconnect:an,onReconnectStart:sn,onReconnectEnd:qe,onEdgeContextMenu:Ge,onEdgeDoubleClick:nt,onEdgeMouseEnter:Nn,onEdgeMouseMove:Vt,onEdgeMouseLeave:ha,reconnectRadius:or=10,onNodesChange:Xi,onEdgesChange:cr,noDragClassName:xt="nodrag",noWheelClassName:ci="nowheel",noPanClassName:jr="nopan",fitView:Us,fitViewOptions:wl,connectOnClick:Tl,attributionPosition:Cl,proOptions:za,defaultEdgeOptions:Is,elevateNodesOnSelect:ln=!0,elevateEdgesOnSelect:on=!1,disableKeyboardA11y:ur=!1,autoPanOnConnect:Hr,autoPanOnNodeDrag:In,autoPanSpeed:Sr,connectionRadius:pa,isValidConnection:Pr,onError:Re,style:Ke,id:_t,nodeDragThreshold:Qt,connectionDragThreshold:jn,viewport:Si,onViewportChange:Ki,width:Ai,height:mn,colorMode:fr="light",debug:vo,onScroll:ma,ariaLabelConfig:Al,zIndexMode:Ba="basic",...fc},Li){const os=_t||"1",cs=bK(fr),js=L.useCallback(ui=>{ui.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),ma==null||ma(ui)},[ma]);return T.jsx("div",{"data-testid":"rf__wrapper",...fc,onScroll:js,style:{...Ke,...H$},ref:Li,className:zi(["react-flow",r,cs]),id:_t,role:"application",children:T.jsxs(j$,{nodes:t,edges:e,width:Ai,height:mn,fitView:Us,fitViewOptions:wl,minZoom:_e,maxZoom:ke,nodeOrigin:Sn,nodeExtent:Ot,zIndexMode:Ba,children:[T.jsx(U$,{onInit:p,onNodeClick:c,onEdgeClick:d,onNodeMouseEnter:k,onNodeMouseMove:R,onNodeMouseLeave:O,onNodeContextMenu:j,onNodeDoubleClick:D,nodeTypes:s,edgeTypes:l,connectionLineType:ee,connectionLineStyle:V,connectionLineComponent:le,connectionLineContainerStyle:ye,selectionKeyCode:se,selectionOnDrag:me,selectionMode:Me,deleteKeyCode:ve,multiSelectionKeyCode:Le,panActivationKeyCode:Ue,zoomActivationKeyCode:Pe,onlyRenderVisibleElements:ot,defaultViewport:Bi,translateExtent:et,minZoom:_e,maxZoom:ke,preventScrolling:vt,zoomOnScroll:lr,zoomOnPinch:En,zoomOnDoubleClick:Vi,panOnScroll:tn,panOnScrollSpeed:qn,panOnScrollMode:Yt,panOnDrag:ei,onPaneClick:xo,onPaneMouseEnter:ss,onPaneMouseMove:Da,onPaneMouseLeave:ls,onPaneScroll:_i,onPaneContextMenu:ae,paneClickDistance:we,nodeClickDistance:Be,onSelectionContextMenu:X,onSelectionStart:Z,onSelectionEnd:Q,onReconnect:an,onReconnectStart:sn,onReconnectEnd:qe,onEdgeContextMenu:Ge,onEdgeDoubleClick:nt,onEdgeMouseEnter:Nn,onEdgeMouseMove:Vt,onEdgeMouseLeave:ha,reconnectRadius:or,defaultMarkerColor:vi,noDragClassName:xt,noWheelClassName:ci,noPanClassName:jr,rfId:os,disableKeyboardA11y:ur,nodeExtent:Ot,viewport:Si,onViewportChange:Ki}),T.jsx(yK,{nodes:t,edges:e,defaultNodes:n,defaultEdges:i,onConnect:v,onConnectStart:_,onConnectEnd:A,onClickConnectStart:C,onClickConnectEnd:w,nodesDraggable:de,autoPanOnNodeFocus:ut,nodesConnectable:It,nodesFocusable:jt,edgesFocusable:xi,edgesReconnectable:qt,elementsSelectable:Zt,elevateNodesOnSelect:ln,elevateEdgesOnSelect:on,minZoom:_e,maxZoom:ke,nodeExtent:Ot,onNodesChange:Xi,onEdgesChange:cr,snapToGrid:He,snapGrid:Xe,connectionMode:Y,translateExtent:et,connectOnClick:Tl,defaultEdgeOptions:Is,fitView:Us,fitViewOptions:wl,onNodesDelete:I,onEdgesDelete:K,onDelete:q,onNodeDragStart:G,onNodeDrag:W,onNodeDragStop:P,onSelectionDrag:$,onSelectionDragStart:H,onSelectionDragStop:B,onMove:m,onMoveStart:g,onMoveEnd:b,noPanClassName:jr,nodeOrigin:Sn,rfId:os,autoPanOnConnect:Hr,autoPanOnNodeDrag:In,autoPanSpeed:Sr,onError:Re,connectionRadius:pa,isValidConnection:Pr,selectNodesOnDrag:Ie,nodeDragThreshold:Qt,connectionDragThreshold:jn,onBeforeDelete:F,debug:vo,ariaLabelConfig:Al,zIndexMode:Ba}),T.jsx(hK,{onSelectionChange:te}),tt,T.jsx(oK,{proOptions:za,position:Cl}),T.jsx(lK,{rfId:os,disableKeyboardA11y:ur})]})})}var G$=ok(P$);function F$({dimensions:t,lineWidth:e,variant:n,className:i}){return T.jsx("path",{strokeWidth:e,d:`M${t[0]/2} 0 V${t[1]} M0 ${t[1]/2} H${t[0]}`,className:zi(["react-flow__background-pattern",n,i])})}function q$({radius:t,className:e}){return T.jsx("circle",{cx:t,cy:t,r:t,className:zi(["react-flow__background-pattern","dots",e])})}var lu;(function(t){t.Lines="lines",t.Dots="dots",t.Cross="cross"})(lu||(lu={}));const Y$={[lu.Dots]:1,[lu.Lines]:1,[lu.Cross]:6},V$=t=>({transform:t.transform,patternId:`pattern-${t.rfId}`});function Dk({id:t,variant:e=lu.Dots,gap:n=20,size:i,lineWidth:r=1,offset:s=0,color:l,bgColor:c,style:d,className:p,patternClassName:m}){const g=L.useRef(null),{transform:b,patternId:v}=en(V$,Qn),_=i||Y$[e],A=e===lu.Dots,C=e===lu.Cross,w=Array.isArray(n)?n:[n,n],k=[w[0]*b[2]||1,w[1]*b[2]||1],R=_*b[2],O=Array.isArray(s)?s:[s,s],j=C?[R,R]:k,D=[O[0]*b[2]||1+j[0]/2,O[1]*b[2]||1+j[1]/2],G=`${v}${t||""}`;return T.jsxs("svg",{className:zi(["react-flow__background",p]),style:{...d,...vb,"--xy-background-color-props":c,"--xy-background-pattern-color-props":l},ref:g,"data-testid":"rf__background",children:[T.jsx("pattern",{id:G,x:b[0]%k[0],y:b[1]%k[1],width:k[0],height:k[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${D[0]},-${D[1]})`,children:A?T.jsx(q$,{radius:R/2,className:m}):T.jsx(F$,{dimensions:j,lineWidth:r,variant:e,className:m})}),T.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${G})`})]})}Dk.displayName="Background";const X$=L.memo(Dk);function K$(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:T.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function $$(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:T.jsx("path",{d:"M0 0h32v4.2H0z"})})}function W$(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:T.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function Z$(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function Q$(){return T.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:T.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function c0({children:t,className:e,...n}){return T.jsx("button",{type:"button",className:zi(["react-flow__controls-button",e]),...n,children:t})}const J$=t=>({isInteractive:t.nodesDraggable||t.nodesConnectable||t.elementsSelectable,minZoomReached:t.transform[2]<=t.minZoom,maxZoomReached:t.transform[2]>=t.maxZoom,ariaLabelConfig:t.ariaLabelConfig});function zk({style:t,showZoom:e=!0,showFitView:n=!0,showInteractive:i=!0,fitViewOptions:r,onZoomIn:s,onZoomOut:l,onFitView:c,onInteractiveChange:d,className:p,children:m,position:g="bottom-left",orientation:b="vertical","aria-label":v}){const _=Jn(),{isInteractive:A,minZoomReached:C,maxZoomReached:w,ariaLabelConfig:k}=en(J$,Qn),{zoomIn:R,zoomOut:O,fitView:j}=xb(),D=()=>{R(),s==null||s()},G=()=>{O(),l==null||l()},W=()=>{j(r),c==null||c()},P=()=>{_.setState({nodesDraggable:!A,nodesConnectable:!A,elementsSelectable:!A}),d==null||d(!A)},I=b==="horizontal"?"horizontal":"vertical";return T.jsxs(bb,{className:zi(["react-flow__controls",I,p]),position:g,style:t,"data-testid":"rf__controls","aria-label":v??k["controls.ariaLabel"],children:[e&&T.jsxs(T.Fragment,{children:[T.jsx(c0,{onClick:D,className:"react-flow__controls-zoomin",title:k["controls.zoomIn.ariaLabel"],"aria-label":k["controls.zoomIn.ariaLabel"],disabled:w,children:T.jsx(K$,{})}),T.jsx(c0,{onClick:G,className:"react-flow__controls-zoomout",title:k["controls.zoomOut.ariaLabel"],"aria-label":k["controls.zoomOut.ariaLabel"],disabled:C,children:T.jsx($$,{})})]}),n&&T.jsx(c0,{className:"react-flow__controls-fitview",onClick:W,title:k["controls.fitView.ariaLabel"],"aria-label":k["controls.fitView.ariaLabel"],children:T.jsx(W$,{})}),i&&T.jsx(c0,{className:"react-flow__controls-interactive",onClick:P,title:k["controls.interactive.ariaLabel"],"aria-label":k["controls.interactive.ariaLabel"],children:A?T.jsx(Q$,{}):T.jsx(Z$,{})}),m]})}zk.displayName="Controls";const eW=L.memo(zk);function tW({id:t,x:e,y:n,width:i,height:r,style:s,color:l,strokeColor:c,strokeWidth:d,className:p,borderRadius:m,shapeRendering:g,selected:b,onClick:v}){const{background:_,backgroundColor:A}=s||{},C=l||_||A;return T.jsx("rect",{className:zi(["react-flow__minimap-node",{selected:b},p]),x:e,y:n,rx:m,ry:m,width:i,height:r,style:{fill:C,stroke:c,strokeWidth:d},shapeRendering:g,onClick:v?w=>v(w,t):void 0})}const nW=L.memo(tW),iW=t=>t.nodes.map(e=>e.id),Rv=t=>t instanceof Function?t:()=>t;function rW({nodeStrokeColor:t,nodeColor:e,nodeClassName:n="",nodeBorderRadius:i=5,nodeStrokeWidth:r,nodeComponent:s=nW,onClick:l}){const c=en(iW,Qn),d=Rv(e),p=Rv(t),m=Rv(n),g=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return T.jsx(T.Fragment,{children:c.map(b=>T.jsx(sW,{id:b,nodeColorFunc:d,nodeStrokeColorFunc:p,nodeClassNameFunc:m,nodeBorderRadius:i,nodeStrokeWidth:r,NodeComponent:s,onClick:l,shapeRendering:g},b))})}function aW({id:t,nodeColorFunc:e,nodeStrokeColorFunc:n,nodeClassNameFunc:i,nodeBorderRadius:r,nodeStrokeWidth:s,shapeRendering:l,NodeComponent:c,onClick:d}){const{node:p,x:m,y:g,width:b,height:v}=en(_=>{const A=_.nodeLookup.get(t);if(!A)return{node:void 0,x:0,y:0,width:0,height:0};const C=A.internals.userNode,{x:w,y:k}=A.internals.positionAbsolute,{width:R,height:O}=uc(C);return{node:C,x:w,y:k,width:R,height:O}},Qn);return!p||p.hidden||!LN(p)?null:T.jsx(c,{x:m,y:g,width:b,height:v,style:p.style,selected:!!p.selected,className:i(p),color:e(p),borderRadius:r,strokeColor:n(p),strokeWidth:s,shapeRendering:l,onClick:d,id:p.id})}const sW=L.memo(aW);var lW=L.memo(rW);const oW=200,cW=150,uW=t=>!t.hidden,fW=t=>{const e={x:-t.transform[0]/t.transform[2],y:-t.transform[1]/t.transform[2],width:t.width/t.transform[2],height:t.height/t.transform[2]};return{viewBB:e,boundingRect:t.nodeLookup.size>0?BN(ig(t.nodeLookup,{filter:uW}),e):e,rfId:t.rfId,panZoom:t.panZoom,translateExtent:t.translateExtent,flowWidth:t.width,flowHeight:t.height,ariaLabelConfig:t.ariaLabelConfig}},dW="react-flow__minimap-desc";function Bk({style:t,className:e,nodeStrokeColor:n,nodeColor:i,nodeClassName:r="",nodeBorderRadius:s=5,nodeStrokeWidth:l,nodeComponent:c,bgColor:d,maskColor:p,maskStrokeColor:m,maskStrokeWidth:g,position:b="bottom-right",onClick:v,onNodeClick:_,pannable:A=!1,zoomable:C=!1,ariaLabel:w,inversePan:k,zoomStep:R=1,offsetScale:O=5}){const j=Jn(),D=L.useRef(null),{boundingRect:G,viewBB:W,rfId:P,panZoom:I,translateExtent:K,flowWidth:q,flowHeight:te,ariaLabelConfig:H}=en(fW,Qn),$=(t==null?void 0:t.width)??oW,B=(t==null?void 0:t.height)??cW,X=G.width/$,Z=G.height/B,Q=Math.max(X,Z),F=Q*$,Y=Q*B,ee=O*Q,V=G.x-(F-G.width)/2-ee,le=G.y-(Y-G.height)/2-ee,ye=F+ee*2,ve=Y+ee*2,se=`${dW}-${P}`,me=L.useRef(0),Me=L.useRef();me.current=Q,L.useEffect(()=>{if(D.current&&I)return Me.current=MX({domNode:D.current,panZoom:I,getTransform:()=>j.getState().transform,getViewScale:()=>me.current}),()=>{var He;(He=Me.current)==null||He.destroy()}},[I]),L.useEffect(()=>{var He;(He=Me.current)==null||He.update({translateExtent:K,width:q,height:te,inversePan:k,pannable:A,zoomStep:R,zoomable:C})},[A,C,k,R,K,q,te]);const Ue=v?He=>{var Ie;const[Xe,ot]=((Ie=Me.current)==null?void 0:Ie.pointer(He))||[0,0];v(He,{x:Xe,y:ot})}:void 0,Le=_?L.useCallback((He,Xe)=>{const ot=j.getState().nodeLookup.get(Xe).internals.userNode;_(He,ot)},[]):void 0,Pe=w??H["minimap.ariaLabel"];return T.jsx(bb,{position:b,style:{...t,"--xy-minimap-background-color-props":typeof d=="string"?d:void 0,"--xy-minimap-mask-background-color-props":typeof p=="string"?p:void 0,"--xy-minimap-mask-stroke-color-props":typeof m=="string"?m:void 0,"--xy-minimap-mask-stroke-width-props":typeof g=="number"?g*Q:void 0,"--xy-minimap-node-background-color-props":typeof i=="string"?i:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:zi(["react-flow__minimap",e]),"data-testid":"rf__minimap",children:T.jsxs("svg",{width:$,height:B,viewBox:`${V} ${le} ${ye} ${ve}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":se,ref:D,onClick:Ue,children:[Pe&&T.jsx("title",{id:se,children:Pe}),T.jsx(lW,{onClick:Le,nodeColor:i,nodeStrokeColor:n,nodeBorderRadius:s,nodeClassName:r,nodeStrokeWidth:l,nodeComponent:c}),T.jsx("path",{className:"react-flow__minimap-mask",d:`M${V-ee},${le-ee}h${ye+ee*2}v${ve+ee*2}h${-ye-ee*2}z
|
|
400
|
-
M${W.x},${W.y}h${W.width}v${W.height}h${-W.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Bk.displayName="MiniMap";const hW=L.memo(Bk),pW=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,mW={[gh.Line]:"right",[gh.Handle]:"bottom-right"};function gW({nodeId:t,position:e,variant:n=gh.Handle,className:i,style:r=void 0,children:s,color:l,minWidth:c=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:b,autoScale:v=!0,shouldResize:_,onResizeStart:A,onResize:C,onResizeEnd:w}){const k=dk(),R=typeof t=="string"?t:k,O=Jn(),j=L.useRef(null),D=n===gh.Handle,G=en(L.useCallback(pW(D&&v),[D,v]),Qn),W=L.useRef(null),P=e??mW[n];L.useEffect(()=>{if(!(!j.current||!R))return W.current||(W.current=GX({domNode:j.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:K,transform:q,snapGrid:te,snapToGrid:H,nodeOrigin:$,domNode:B}=O.getState();return{nodeLookup:K,transform:q,snapGrid:te,snapToGrid:H,nodeOrigin:$,paneDomNode:B}},onChange:(K,q)=>{const{triggerNodeChanges:te,nodeLookup:H,parentLookup:$,nodeOrigin:B}=O.getState(),X=[],Z={x:K.x,y:K.y},Q=H.get(R);if(Q&&Q.expandParent&&Q.parentId){const F=Q.origin??B,Y=K.width??Q.measured.width??0,ee=K.height??Q.measured.height??0,V={id:Q.id,parentId:Q.parentId,rect:{width:Y,height:ee,...UN({x:K.x??Q.position.x,y:K.y??Q.position.y},{width:Y,height:ee},Q.parentId,H,F)}},le=G1([V],H,$,B);X.push(...le),Z.x=K.x?Math.max(F[0]*Y,K.x):void 0,Z.y=K.y?Math.max(F[1]*ee,K.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const F={id:R,type:"position",position:{...Z}};X.push(F)}if(K.width!==void 0&&K.height!==void 0){const Y={id:R,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};X.push(Y)}for(const F of q){const Y={...F,type:"position"};X.push(Y)}te(X)},onEnd:({width:K,height:q})=>{const te={id:R,type:"dimensions",resizing:!1,dimensions:{width:K,height:q}};O.getState().triggerNodeChanges([te])}})),W.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:d,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:b,onResizeStart:A,onResize:C,onResizeEnd:w,shouldResize:_}),()=>{var K;(K=W.current)==null||K.destroy()}},[P,c,d,p,m,g,A,C,w,_]);const I=P.split("-");return T.jsx("div",{className:zi(["react-flow__resize-control","nodrag",...I,n,i]),ref:j,style:{...r,scale:G,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:s})}L.memo(gW);const Lk={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},lC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"};function yW({data:t}){return T.jsxs("div",{style:{padding:"16px 32px",border:"2px solid rgba(0, 200, 255, 0.4)",borderRadius:12,background:"linear-gradient(135deg, #121425, #1a1d35)",boxShadow:"0 0 30px rgba(0, 200, 255, 0.15), 0 4px 16px rgba(0,0,0,0.5)",textAlign:"center",minWidth:200},children:[T.jsx(cu,{type:"source",position:Je.Bottom,style:Lk}),T.jsx("div",{style:{width:44,height:44,borderRadius:8,background:"linear-gradient(135deg, #00c8ff, #0090b8)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",fontWeight:700,color:"#07080e",margin:"0 auto 8px",boxShadow:"0 0 16px rgba(0, 200, 255, 0.35)"},children:t.label.slice(0,2).toUpperCase()}),T.jsx("div",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1rem",color:"#e8ecf4"},children:t.label}),T.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.6rem",color:"#555d73",marginTop:3},children:"CEO"})]})}function bW({data:t}){const e=t.agents;return T.jsxs("div",{style:{padding:"14px 20px",border:"1px solid rgba(0, 230, 138, 0.25)",borderRadius:10,background:"linear-gradient(135deg, #0d1a14, #121425)",boxShadow:"0 0 16px rgba(0, 230, 138, 0.08), 0 2px 8px rgba(0,0,0,0.3)",textAlign:"center",minWidth:160},children:[T.jsx(cu,{type:"target",position:Je.Top,style:lC}),T.jsx(cu,{type:"source",position:Je.Bottom,style:lC}),T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[T.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"rgba(0, 230, 138, 0.15)",border:"1px solid rgba(0, 230, 138, 0.25)",fontSize:"0.6rem",color:"#00e68a",fontWeight:700},children:t.label.slice(0,1).toUpperCase()}),T.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:600,fontSize:"0.82rem",color:"#00e68a"},children:t.label})]}),t.description?T.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73",marginBottom:4,maxWidth:180},children:String(t.description)}):null,T.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73"},children:[e.length," agent",e.length!==1?"s":""]})]})}function xW({data:t}){return T.jsxs("div",{style:{padding:"8px 16px",border:"1px solid rgba(100, 120, 200, 0.12)",borderRadius:6,background:"#0c0e18",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",textAlign:"center",minWidth:110},children:[T.jsx(cu,{type:"target",position:Je.Top,style:Lk}),T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[T.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"#00e68a",boxShadow:"0 0 6px rgba(0,230,138,0.4)",flexShrink:0}}),T.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:500,fontSize:"0.72rem",color:"#8b93a8"},children:t.label})]})]})}const vW={company:yW,squad:bW,agent:xW},oC=280,_W=52,SW=170;function EW(t){const{tree:e,squads:n}=t,i=[],r=[];if(n.length===0)return i.push({id:"company",type:"company",position:{x:0,y:0},data:{label:e.name},draggable:!0}),{nodes:i,edges:r};const l=n.length*oC/2-100;return i.push({id:"company",type:"company",position:{x:l,y:0},data:{label:e.name},draggable:!0}),n.forEach((c,d)=>{const p=`squad-${c.code}`,m=d*oC;i.push({id:p,type:"squad",position:{x:m,y:200},data:{label:c.name,description:c.description,agents:c.agents},draggable:!0}),r.push({id:`company-${p}`,source:"company",target:p,style:{stroke:"rgba(0, 230, 138, 0.3)",strokeWidth:2},animated:!1});const g=c.agents.length,b=Math.min(g,2),v=m+80;c.agents.forEach((_,A)=>{const C=A%b,w=Math.floor(A/b),k=v+(C-(b-1)/2)*SW-55,R=400+w*_W,O=`agent-${c.code}-${_.id}`;i.push({id:O,type:"agent",position:{x:k,y:R},data:{label:_.name},draggable:!0}),r.push({id:`${p}-${O}`,source:p,target:O,style:{stroke:"rgba(100, 120, 200, 0.15)",strokeWidth:1},animated:!1})})}),{nodes:i,edges:r}}function wW({data:t}){const{fitView:e}=xb(),{nodes:n,edges:i}=L.useMemo(()=>EW(t),[t]);L.useEffect(()=>{const s=setTimeout(()=>e({padding:.12,duration:400}),50);return()=>clearTimeout(s)},[n.length,e]);const r=t.squads.reduce((s,l)=>s+l.agents.length,0);return T.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[T.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[T.jsxs("h2",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1.1rem",color:"#e8ecf4",marginBottom:2},children:[t.tree.name," — Org Chart"]}),T.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.65rem",color:"#555d73"},children:[t.squads.length," active squad",t.squads.length!==1?"s":""," / ",r," agents"]})]}),T.jsx("div",{style:{flex:1,minHeight:0},children:T.jsxs(G$,{nodes:n,edges:i,nodeTypes:vW,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"#07080e"},nodesDraggable:!0,nodesConnectable:!1,children:[T.jsx(X$,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),T.jsx(eW,{showInteractive:!1,style:{background:"#121425",border:"1px solid rgba(100, 120, 200, 0.15)",borderRadius:8}}),T.jsx(hW,{nodeColor:s=>s.type==="company"?"#00c8ff":s.type==="squad"?"#00e68a":"#555d73",maskColor:"rgba(7, 8, 14, 0.85)",style:{background:"#0c0e18",border:"1px solid rgba(100, 120, 200, 0.1)",borderRadius:8}})]})})]})}function TW(){const[t,e]=L.useState(null),[n,i]=L.useState(!0),[r,s]=L.useState(null);return L.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{e(l),i(!1)}).catch(l=>{s(l.message),i(!1)})},[]),n?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#555d73"},children:"Loading org chart..."}):r||!t?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#ff4070"},children:r||"Failed to load org chart"}):T.jsx(Ok,{children:T.jsx(wW,{data:t})})}const Uk={squad:"#00c8ff",agent:"#00e68a",memory:"#b388ff",skill:"#ffab40"},z_={squad:18,agent:12,memory:8,skill:8},cC={contains:"rgba(255,255,255,0.08)",pipeline:"rgba(0,200,255,0.4)",delivers:"rgba(0,230,138,0.5)",uses_skill:"rgba(255,171,64,0.15)",has_memory:"rgba(179,136,255,0.15)",shared_skill:"rgba(255,171,64,0.3)",shared_memory:"rgba(179,136,255,0.3)"};function CW(t,e,n,i,r){const s=n/2,l=i/2,c=3e3*r,d=.008*r,p=.01*r,m=.85;for(let b=0;b<t.length;b++){let v=0,_=0;for(let A=0;A<t.length;A++){if(b===A)continue;const C=t[b].x-t[A].x,w=t[b].y-t[A].y,k=C*C+w*w+1,R=c/k,O=Math.sqrt(k);v+=C/O*R,_+=w/O*R}v+=(s-t[b].x)*p,_+=(l-t[b].y)*p,t[b].vx=(t[b].vx+v)*m,t[b].vy=(t[b].vy+_)*m}for(const b of e){const v=t.findIndex(j=>j.id===b.source),_=t.findIndex(j=>j.id===b.target);if(v===-1||_===-1)continue;const A=t[_].x-t[v].x,C=t[_].y-t[v].y,w=Math.sqrt(A*A+C*C)+1,k=(w-100)*d,R=A/w*k,O=C/w*k;t[v].vx+=R,t[v].vy+=O,t[_].vx-=R,t[_].vy-=O}let g=0;for(const b of t)b.x+=b.vx,b.y+=b.vy,g+=b.vx*b.vx+b.vy*b.vy;return g}function AW(t,e){const n=new Map;for(const l of e)n.has(l.source)||n.set(l.source,[]),n.has(l.target)||n.set(l.target,[]),n.get(l.source).push(l.target),n.get(l.target).push(l.source);const i=new Map;i.set(t,0);const r=[t];let s=0;for(;s<r.length;){const l=r[s++],c=i.get(l);for(const d of n.get(l)||[])i.has(d)||(i.set(d,c+1),r.push(d))}return i}function MW(t,e,n,i,r,s,l,c,d){t.clearRect(0,0,i,r),t.save(),t.translate(l,c),t.scale(d,d);const p=new Map(e.map(b=>[b.id,b]));let m=null;if(s){m=AW(s.id,n);for(const b of m.values());}const g=b=>{if(!s||!m||b===s.id)return 1;const v=m.get(b);return v===void 0?.06:Math.max(.08,1-v*.28)};for(const b of n){const v=p.get(b.source),_=p.get(b.target);if(!v||!_)continue;const A=Math.min(g(b.source),g(b.target)),C=s&&(b.source===s.id||b.target===s.id);if(t.globalAlpha=A,t.beginPath(),t.moveTo(v.x,v.y),t.lineTo(_.x,_.y),t.strokeStyle=C?"rgba(255,255,255,0.6)":cC[b.type]||"rgba(255,255,255,0.06)",t.lineWidth=C?1.8:b.type==="delivers"||b.type==="pipeline"?1.2:.5,t.stroke(),b.type==="delivers"||b.type==="pipeline"){const w=Math.atan2(_.y-v.y,_.x-v.x),k=z_[_.type]||10,R=_.x-Math.cos(w)*(k+4),O=_.y-Math.sin(w)*(k+4);t.beginPath(),t.moveTo(R,O),t.lineTo(R-Math.cos(w-.4)*6,O-Math.sin(w-.4)*6),t.lineTo(R-Math.cos(w+.4)*6,O-Math.sin(w+.4)*6),t.closePath(),t.fillStyle=cC[b.type],t.fill()}}t.globalAlpha=1;for(const b of e){const v=z_[b.type]||10,_=Uk[b.type]||"#888",A=(s==null?void 0:s.id)===b.id,C=g(b.id);t.globalAlpha=C,t.beginPath(),t.arc(b.x,b.y,v,0,Math.PI*2),A&&(t.shadowColor=_,t.shadowBlur=24),t.fillStyle=_,t.fill(),t.shadowBlur=0;const w=b.type==="squad"?11:9;t.font=`${b.type==="squad"?"600":"400"} ${w}px "JetBrains Mono", monospace`,t.textAlign="center",t.textBaseline="top",t.fillStyle="rgba(255,255,255,0.85)",t.fillText(b.label,b.x,b.y+v+4)}t.globalAlpha=1,t.restore()}function RW(){const t=L.useRef(null),[e,n]=L.useState([]),[i,r]=L.useState([]),[s,l]=L.useState(!0),[c,d]=L.useState(null),p=L.useRef(null),m=L.useRef(null),g=L.useRef(null),b=L.useRef(!1),v=L.useRef({x:0,y:0}),_=L.useRef(1),A=L.useRef(!1),C=L.useRef({x:0,y:0}),w=L.useRef([]),k=L.useRef([]),R=L.useRef(0),O=L.useRef(1),j=L.useRef(!0);L.useEffect(()=>{fetch("/api/graph",{credentials:"include"}).then(W=>W.json()).then(W=>{const P=window.innerWidth,I=window.innerHeight,K=W.nodes.map((q,te)=>({...q,x:P/2+(Math.random()-.5)*400,y:I/2+(Math.random()-.5)*400,vx:0,vy:0}));w.current=K,k.current=W.edges,n(K),r(W.edges),l(!1)}).catch(()=>{d("Failed to load graph data"),l(!1)})},[]);const D=L.useCallback((W,P)=>{const I=v.current,K=_.current,q=(W-I.x)/K,te=(P-I.y)/K;for(let H=w.current.length-1;H>=0;H--){const $=w.current[H],B=z_[$.type]||10,X=q-$.x,Z=te-$.y;if(X*X+Z*Z<(B+4)*(B+4))return $}return null},[]);L.useEffect(()=>{const W=t.current;if(!W)return;const P=H=>{const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top;if(g.current){b.current=!0;const Q=_.current,F=v.current;g.current.x=(B-F.x)/Q,g.current.y=(X-F.y)/Q,g.current.vx=0,g.current.vy=0,O.current=.3,j.current=!0;return}if(A.current){v.current.x+=B-C.current.x,v.current.y+=X-C.current.y,C.current={x:B,y:X};return}const Z=D(B,X);p.current=Z,W.style.cursor=Z?"grab":"default"},I=H=>{const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top;b.current=!1;const Z=D(B,X);Z?(g.current=Z,W.style.cursor="grabbing"):(A.current=!0,C.current={x:B,y:X},W.style.cursor="move")},K=H=>{var B;g.current;const $=A.current;if(g.current=null,A.current=!1,W.style.cursor="default",!b.current){const X=W.getBoundingClientRect(),Z=H.clientX-X.left,Q=H.clientY-X.top,F=D(Z,Q);F?m.current=((B=m.current)==null?void 0:B.id)===F.id?null:F:$||(m.current=null)}},q=H=>{H.preventDefault();const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top,Z=H.deltaY>0?.92:1.08,Q=Math.max(.2,Math.min(5,_.current*Z)),F=Q/_.current;v.current.x=B-(B-v.current.x)*F,v.current.y=X-(X-v.current.y)*F,_.current=Q},te=()=>{g.current=null,A.current=!1,W.style.cursor="default"};return W.addEventListener("mousemove",P),W.addEventListener("mousedown",I),W.addEventListener("mouseup",K),W.addEventListener("mouseleave",te),W.addEventListener("wheel",q,{passive:!1}),()=>{W.removeEventListener("mousemove",P),W.removeEventListener("mousedown",I),W.removeEventListener("mouseup",K),W.removeEventListener("mouseleave",te),W.removeEventListener("wheel",q)}},[D]),L.useEffect(()=>{if(s||w.current.length===0)return;const W=t.current;if(!W)return;const P=()=>{const te=W.parentElement;te&&(W.width=te.clientWidth*window.devicePixelRatio,W.height=te.clientHeight*window.devicePixelRatio,W.style.width=te.clientWidth+"px",W.style.height=te.clientHeight+"px")};P(),window.addEventListener("resize",P);const I=W.getContext("2d");let K=!0;const q=()=>{if(!K)return;const te=W.width/window.devicePixelRatio,H=W.height/window.devicePixelRatio;I.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),j.current&&(CW(w.current,k.current,te,H,O.current),O.current*=.98,O.current<.001&&(j.current=!1,O.current=0)),MW(I,w.current,k.current,te,H,m.current,v.current.x,v.current.y,_.current),R.current=requestAnimationFrame(q)};return R.current=requestAnimationFrame(q),()=>{K=!1,cancelAnimationFrame(R.current),window.removeEventListener("resize",P)}},[s]);const G=L.useCallback(W=>{const P=t.current;if(!P)return;const I=W==="in"?1.25:.8,K=P.clientWidth/2,q=P.clientHeight/2,te=Math.max(.2,Math.min(5,_.current*I)),H=te/_.current;v.current.x=K-(K-v.current.x)*H,v.current.y=q-(q-v.current.y)*H,_.current=te},[]);return s?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading graph..."}):c?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:c}):T.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[T.jsx("canvas",{ref:t,style:{display:"block",touchAction:"none"}}),T.jsx("div",{style:{position:"absolute",bottom:16,left:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",flexDirection:"column",gap:6},children:Object.entries(Uk).map(([W,P])=>T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[T.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:P,display:"inline-block"}}),T.jsx("span",{style:{textTransform:"capitalize"},children:W})]},W))}),T.jsxs("div",{style:{position:"absolute",top:16,right:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",gap:16},children:[T.jsxs("span",{children:[e.length," nodes"]}),T.jsxs("span",{children:[i.length," edges"]})]}),T.jsx("div",{style:{position:"absolute",bottom:16,right:16,display:"flex",flexDirection:"column",gap:4},children:[{label:"+",action:"in"},{label:"−",action:"out"}].map(({label:W,action:P})=>T.jsx("button",{onClick:()=>G(P),style:{width:32,height:32,background:"rgba(10, 12, 16, 0.85)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"1rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:W},P))})]})}function NW(){const[t,e]=L.useState([]),[n,i]=L.useState(null),[r,s]=L.useState(""),[l,c]=L.useState(""),[d,p]=L.useState(!1),[m,g]=L.useState(!1),[b,v]=L.useState(new Set),[_,A]=L.useState(""),C=L.useRef(null);L.useEffect(()=>{fetch("/api/files",{credentials:"include"}).then(D=>D.json()).then(D=>{const G=new Map;for(const P of D)G.has(P.squad)||G.set(P.squad,{squad:P.squad,squadName:P.squadName,files:[]}),G.get(P.squad).files.push(P);const W=[...G.values()];e(W)})},[]);const w=L.useCallback(D=>{i(D),g(!0),fetch(`/api/files/${D.squad}/${D.path}`,{credentials:"include"}).then(G=>G.json()).then(G=>{s(G.content),c(G.content),g(!1)}).catch(()=>{s(""),c(""),g(!1)})},[]),k=L.useCallback(async()=>{n&&(p(!0),await fetch(`/api/files/${n.squad}/${n.path}`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})}),c(r),p(!1))},[n,r]),R=L.useCallback(D=>{v(G=>{const W=new Set(G);return W.has(D)?W.delete(D):W.add(D),W})},[]),O=r!==l;L.useEffect(()=>{const D=G=>{(G.metaKey||G.ctrlKey)&&G.key==="s"&&(G.preventDefault(),O&&n&&k())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[O,n,k]);const j=D=>D==="squad.yaml"?"⚙":D==="memories.md"?"◆":"◇";return T.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[T.jsxs("div",{style:{width:260,minWidth:260,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[T.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squad Files"}),T.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:T.jsx("input",{type:"text",placeholder:"Search squads...",value:_,onChange:D=>A(D.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none"}})}),T.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:[t.filter(D=>{if(!_)return!0;const G=_.toLowerCase();return D.squadName.toLowerCase().includes(G)||D.squad.toLowerCase().includes(G)}).map(D=>T.jsxs("div",{children:[T.jsxs("button",{onClick:()=>R(D.squad),style:{width:"100%",background:"none",border:"none",padding:"6px 14px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:"var(--text-primary)",textAlign:"left"},children:[T.jsx("span",{style:{fontSize:"0.6rem",transition:"transform 0.15s ease",transform:b.has(D.squad)?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),D.squadName]}),b.has(D.squad)&&T.jsx("div",{style:{paddingLeft:14},children:D.files.map(G=>{const W=(n==null?void 0:n.squad)===G.squad&&(n==null?void 0:n.path)===G.path;return T.jsxs("button",{onClick:()=>w(G),style:{width:"100%",background:W?"var(--accent-glow)":"none",border:W?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-xs)",padding:"5px 10px",display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:W?"var(--accent)":"var(--text-secondary)",textAlign:"left"},children:[T.jsx("span",{style:{opacity:.6},children:j(G.file)}),G.file]},`${G.squad}/${G.path}`)})})]},D.squad)),t.length===0&&T.jsx("div",{style:{padding:"20px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),T.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:n?T.jsxs(T.Fragment,{children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[T.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:8},children:[T.jsx("span",{style:{color:"var(--text-muted)"},children:n.squadName}),T.jsx("span",{style:{color:"var(--text-muted)",opacity:.4},children:"/"}),T.jsx("span",{children:n.file}),O&&T.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",display:"inline-block"}})]}),T.jsxs("button",{onClick:k,disabled:!O||d,style:{background:O?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:O?"var(--text-inverse)":"var(--text-muted)",cursor:O?"pointer":"default",opacity:O?1:.5,transition:"all 0.15s ease"},children:[d?"Saving...":"Save",T.jsx("span",{style:{marginLeft:6,fontSize:"0.6rem",opacity:.7},children:"⌘S"})]})]}),m?T.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading..."}):T.jsx("textarea",{ref:C,value:r,onChange:D=>s(D.target.value),spellCheck:!1,style:{flex:1,width:"100%",padding:"16px 20px",border:"none",outline:"none",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.8rem",lineHeight:1.7,tabSize:2,whiteSpace:"pre",overflowWrap:"normal",overflowX:"auto"}})]}):T.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[T.jsx("span",{style:{fontSize:"2rem",opacity:.3},children:"◇"}),T.jsx("span",{style:{fontSize:"0.8rem"},children:"Select a file to edit"})]})})]})}const kW=L.lazy(()=>Zd(()=>import("./JarvisView-CIJSgHKf.js"),[]).then(t=>({default:t.JarvisView})));IO.createRoot(document.getElementById("root")).render(T.jsx(L.StrictMode,{children:T.jsx(oD,{children:T.jsxs(I3,{children:[T.jsx(Ca,{path:"/login",element:T.jsx($D,{})}),T.jsxs(Ca,{path:"/",element:T.jsx(KD,{}),children:[T.jsx(Ca,{index:!0,element:T.jsx(L3,{to:"/office",replace:!0})}),T.jsx(Ca,{path:"office",element:T.jsx(_8,{})}),T.jsx(Ca,{path:"chat",element:T.jsx(PG,{})}),T.jsx(Ca,{path:"kanban",element:T.jsx(YG,{})}),T.jsx(Ca,{path:"settings",element:T.jsx(nF,{})}),T.jsx(Ca,{path:"scheduler",element:T.jsx(sF,{})}),T.jsx(Ca,{path:"email",element:T.jsx(uF,{})}),T.jsx(Ca,{path:"orgchart",element:T.jsx(TW,{})}),T.jsx(Ca,{path:"graph",element:T.jsx(RW,{})}),T.jsx(Ca,{path:"files",element:T.jsx(NW,{})}),T.jsx(Ca,{path:"jarvis",element:T.jsx(L.Suspense,{fallback:null,children:T.jsx(kW,{})})})]})]})})}));export{J0 as $,OA as A,Om as B,Yi as C,ns as D,go as E,sc as F,Ra as G,K_ as H,$m as I,FD as J,YE as K,p0 as L,Ft as M,V_ as N,RA as O,Lr as P,Ls as Q,Fv as R,s5 as S,Rn as T,w0 as U,SA as V,t_ as W,z5 as X,L5 as Y,F5 as Z,H5 as _,OW as a,Cf as a0,h4 as a1,Km as a2,X_ as a3,V5 as a4,ka as a5,WC as a6,Bs as a7,Z0 as a8,ME as a9,sh as aa,CB as ab,q4 as ac,NE as ad,Ex as ae,kE as af,V4 as ag,rh as ah,Ci as ai,JC as aj,$6 as ak,DA as al,rn as am,Xm as an,yi as ao,$z as ap,qz as aq,g5 as ar,c5 as as,B5 as at,U5 as au,q5 as av,G5 as aw,Y5 as ax,ml as b,es as c,Cz as d,Ma as e,bi as f,mz as g,Ln as h,h0 as i,T as j,Nt as k,o6 as l,QC as m,eb as n,J5 as o,tb as p,oA as q,L as r,OC as s,oi as t,hx as u,Vd as v,da as w,A4 as x,_r as y,i5 as z};
|
|
400
|
+
M${W.x},${W.y}h${W.width}v${W.height}h${-W.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}Bk.displayName="MiniMap";const hW=L.memo(Bk),pW=t=>e=>t?`${Math.max(1/e.transform[2],1)}`:void 0,mW={[gh.Line]:"right",[gh.Handle]:"bottom-right"};function gW({nodeId:t,position:e,variant:n=gh.Handle,className:i,style:r=void 0,children:s,color:l,minWidth:c=10,minHeight:d=10,maxWidth:p=Number.MAX_VALUE,maxHeight:m=Number.MAX_VALUE,keepAspectRatio:g=!1,resizeDirection:b,autoScale:v=!0,shouldResize:_,onResizeStart:A,onResize:C,onResizeEnd:w}){const k=dk(),R=typeof t=="string"?t:k,O=Jn(),j=L.useRef(null),D=n===gh.Handle,G=en(L.useCallback(pW(D&&v),[D,v]),Qn),W=L.useRef(null),P=e??mW[n];L.useEffect(()=>{if(!(!j.current||!R))return W.current||(W.current=GX({domNode:j.current,nodeId:R,getStoreItems:()=>{const{nodeLookup:K,transform:q,snapGrid:te,snapToGrid:H,nodeOrigin:$,domNode:B}=O.getState();return{nodeLookup:K,transform:q,snapGrid:te,snapToGrid:H,nodeOrigin:$,paneDomNode:B}},onChange:(K,q)=>{const{triggerNodeChanges:te,nodeLookup:H,parentLookup:$,nodeOrigin:B}=O.getState(),X=[],Z={x:K.x,y:K.y},Q=H.get(R);if(Q&&Q.expandParent&&Q.parentId){const F=Q.origin??B,Y=K.width??Q.measured.width??0,ee=K.height??Q.measured.height??0,V={id:Q.id,parentId:Q.parentId,rect:{width:Y,height:ee,...UN({x:K.x??Q.position.x,y:K.y??Q.position.y},{width:Y,height:ee},Q.parentId,H,F)}},le=G1([V],H,$,B);X.push(...le),Z.x=K.x?Math.max(F[0]*Y,K.x):void 0,Z.y=K.y?Math.max(F[1]*ee,K.y):void 0}if(Z.x!==void 0&&Z.y!==void 0){const F={id:R,type:"position",position:{...Z}};X.push(F)}if(K.width!==void 0&&K.height!==void 0){const Y={id:R,type:"dimensions",resizing:!0,setAttributes:b?b==="horizontal"?"width":"height":!0,dimensions:{width:K.width,height:K.height}};X.push(Y)}for(const F of q){const Y={...F,type:"position"};X.push(Y)}te(X)},onEnd:({width:K,height:q})=>{const te={id:R,type:"dimensions",resizing:!1,dimensions:{width:K,height:q}};O.getState().triggerNodeChanges([te])}})),W.current.update({controlPosition:P,boundaries:{minWidth:c,minHeight:d,maxWidth:p,maxHeight:m},keepAspectRatio:g,resizeDirection:b,onResizeStart:A,onResize:C,onResizeEnd:w,shouldResize:_}),()=>{var K;(K=W.current)==null||K.destroy()}},[P,c,d,p,m,g,A,C,w,_]);const I=P.split("-");return T.jsx("div",{className:zi(["react-flow__resize-control","nodrag",...I,n,i]),ref:j,style:{...r,scale:G,...l&&{[D?"backgroundColor":"borderColor"]:l}},children:s})}L.memo(gW);const Lk={background:"rgba(0, 200, 255, 0.4)",width:6,height:6,border:"none"},lC={background:"rgba(0, 230, 138, 0.4)",width:6,height:6,border:"none"};function yW({data:t}){return T.jsxs("div",{style:{padding:"16px 32px",border:"2px solid rgba(0, 200, 255, 0.4)",borderRadius:12,background:"linear-gradient(135deg, #121425, #1a1d35)",boxShadow:"0 0 30px rgba(0, 200, 255, 0.15), 0 4px 16px rgba(0,0,0,0.5)",textAlign:"center",minWidth:200},children:[T.jsx(cu,{type:"source",position:Je.Bottom,style:Lk}),T.jsx("div",{style:{width:44,height:44,borderRadius:8,background:"linear-gradient(135deg, #00c8ff, #0090b8)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.1rem",fontWeight:700,color:"#07080e",margin:"0 auto 8px",boxShadow:"0 0 16px rgba(0, 200, 255, 0.35)"},children:t.label.slice(0,2).toUpperCase()}),T.jsx("div",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1rem",color:"#e8ecf4"},children:t.label}),T.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.6rem",color:"#555d73",marginTop:3},children:"CEO"})]})}function bW({data:t}){const e=t.agents;return T.jsxs("div",{style:{padding:"14px 20px",border:"1px solid rgba(0, 230, 138, 0.25)",borderRadius:10,background:"linear-gradient(135deg, #0d1a14, #121425)",boxShadow:"0 0 16px rgba(0, 230, 138, 0.08), 0 2px 8px rgba(0,0,0,0.3)",textAlign:"center",minWidth:160},children:[T.jsx(cu,{type:"target",position:Je.Top,style:lC}),T.jsx(cu,{type:"source",position:Je.Bottom,style:lC}),T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:8,marginBottom:4},children:[T.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:5,background:"rgba(0, 230, 138, 0.15)",border:"1px solid rgba(0, 230, 138, 0.25)",fontSize:"0.6rem",color:"#00e68a",fontWeight:700},children:t.label.slice(0,1).toUpperCase()}),T.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:600,fontSize:"0.82rem",color:"#00e68a"},children:t.label})]}),t.description?T.jsx("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73",marginBottom:4,maxWidth:180},children:String(t.description)}):null,T.jsxs("div",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.55rem",color:"#555d73"},children:[e.length," agent",e.length!==1?"s":""]})]})}function xW({data:t}){return T.jsxs("div",{style:{padding:"8px 16px",border:"1px solid rgba(100, 120, 200, 0.12)",borderRadius:6,background:"#0c0e18",boxShadow:"0 1px 4px rgba(0,0,0,0.3)",textAlign:"center",minWidth:110},children:[T.jsx(cu,{type:"target",position:Je.Top,style:Lk}),T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",gap:6},children:[T.jsx("span",{style:{width:7,height:7,borderRadius:"50%",background:"#00e68a",boxShadow:"0 0 6px rgba(0,230,138,0.4)",flexShrink:0}}),T.jsx("span",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:500,fontSize:"0.72rem",color:"#8b93a8"},children:t.label})]})]})}const vW={company:yW,squad:bW,agent:xW},oC=280,_W=52,SW=170;function EW(t){const{tree:e,squads:n}=t,i=[],r=[];if(n.length===0)return i.push({id:"company",type:"company",position:{x:0,y:0},data:{label:e.name},draggable:!0}),{nodes:i,edges:r};const l=n.length*oC/2-100;return i.push({id:"company",type:"company",position:{x:l,y:0},data:{label:e.name},draggable:!0}),n.forEach((c,d)=>{const p=`squad-${c.code}`,m=d*oC;i.push({id:p,type:"squad",position:{x:m,y:200},data:{label:c.name,description:c.description,agents:c.agents},draggable:!0}),r.push({id:`company-${p}`,source:"company",target:p,style:{stroke:"rgba(0, 230, 138, 0.3)",strokeWidth:2},animated:!1});const g=c.agents.length,b=Math.min(g,2),v=m+80;c.agents.forEach((_,A)=>{const C=A%b,w=Math.floor(A/b),k=v+(C-(b-1)/2)*SW-55,R=400+w*_W,O=`agent-${c.code}-${_.id}`;i.push({id:O,type:"agent",position:{x:k,y:R},data:{label:_.name},draggable:!0}),r.push({id:`${p}-${O}`,source:p,target:O,style:{stroke:"rgba(100, 120, 200, 0.15)",strokeWidth:1},animated:!1})})}),{nodes:i,edges:r}}function wW({data:t}){const{fitView:e}=xb(),{nodes:n,edges:i}=L.useMemo(()=>EW(t),[t]);L.useEffect(()=>{const s=setTimeout(()=>e({padding:.12,duration:400}),50);return()=>clearTimeout(s)},[n.length,e]);const r=t.squads.reduce((s,l)=>s+l.agents.length,0);return T.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",animation:"fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) both"},children:[T.jsxs("div",{style:{padding:"16px 20px 12px",flexShrink:0},children:[T.jsxs("h2",{style:{fontFamily:"'Outfit', sans-serif",fontWeight:700,fontSize:"1.1rem",color:"#e8ecf4",marginBottom:2},children:[t.tree.name," — Org Chart"]}),T.jsxs("p",{style:{fontFamily:"'JetBrains Mono', monospace",fontSize:"0.65rem",color:"#555d73"},children:[t.squads.length," active squad",t.squads.length!==1?"s":""," / ",r," agents"]})]}),T.jsx("div",{style:{flex:1,minHeight:0},children:T.jsxs(G$,{nodes:n,edges:i,nodeTypes:vW,fitView:!0,fitViewOptions:{padding:.12},minZoom:.1,maxZoom:2,proOptions:{hideAttribution:!0},style:{background:"#07080e"},nodesDraggable:!0,nodesConnectable:!1,children:[T.jsx(X$,{color:"rgba(100, 120, 200, 0.04)",gap:24,size:1}),T.jsx(eW,{showInteractive:!1,style:{background:"#121425",border:"1px solid rgba(100, 120, 200, 0.15)",borderRadius:8}}),T.jsx(hW,{nodeColor:s=>s.type==="company"?"#00c8ff":s.type==="squad"?"#00e68a":"#555d73",maskColor:"rgba(7, 8, 14, 0.85)",style:{background:"#0c0e18",border:"1px solid rgba(100, 120, 200, 0.1)",borderRadius:8}})]})})]})}function TW(){const[t,e]=L.useState(null),[n,i]=L.useState(!0),[r,s]=L.useState(null);return L.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(l=>{if(!l.ok)throw new Error(`HTTP ${l.status}`);return l.json()}).then(l=>{e(l),i(!1)}).catch(l=>{s(l.message),i(!1)})},[]),n?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#555d73"},children:"Loading org chart..."}):r||!t?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"'JetBrains Mono', monospace",fontSize:"0.75rem",color:"#ff4070"},children:r||"Failed to load org chart"}):T.jsx(Ok,{children:T.jsx(wW,{data:t})})}const Uk={squad:"#00c8ff",agent:"#00e68a",memory:"#b388ff",skill:"#ffab40"},z_={squad:18,agent:12,memory:8,skill:8},cC={contains:"rgba(255,255,255,0.08)",pipeline:"rgba(0,200,255,0.4)",delivers:"rgba(0,230,138,0.5)",uses_skill:"rgba(255,171,64,0.15)",has_memory:"rgba(179,136,255,0.15)",shared_skill:"rgba(255,171,64,0.3)",shared_memory:"rgba(179,136,255,0.3)"};function CW(t,e,n,i,r){const s=n/2,l=i/2,c=3e3*r,d=.008*r,p=.01*r,m=.85;for(let b=0;b<t.length;b++){let v=0,_=0;for(let A=0;A<t.length;A++){if(b===A)continue;const C=t[b].x-t[A].x,w=t[b].y-t[A].y,k=C*C+w*w+1,R=c/k,O=Math.sqrt(k);v+=C/O*R,_+=w/O*R}v+=(s-t[b].x)*p,_+=(l-t[b].y)*p,t[b].vx=(t[b].vx+v)*m,t[b].vy=(t[b].vy+_)*m}for(const b of e){const v=t.findIndex(j=>j.id===b.source),_=t.findIndex(j=>j.id===b.target);if(v===-1||_===-1)continue;const A=t[_].x-t[v].x,C=t[_].y-t[v].y,w=Math.sqrt(A*A+C*C)+1,k=(w-100)*d,R=A/w*k,O=C/w*k;t[v].vx+=R,t[v].vy+=O,t[_].vx-=R,t[_].vy-=O}let g=0;for(const b of t)b.x+=b.vx,b.y+=b.vy,g+=b.vx*b.vx+b.vy*b.vy;return g}function AW(t,e){const n=new Map;for(const l of e)n.has(l.source)||n.set(l.source,[]),n.has(l.target)||n.set(l.target,[]),n.get(l.source).push(l.target),n.get(l.target).push(l.source);const i=new Map;i.set(t,0);const r=[t];let s=0;for(;s<r.length;){const l=r[s++],c=i.get(l);for(const d of n.get(l)||[])i.has(d)||(i.set(d,c+1),r.push(d))}return i}function MW(t,e,n,i,r,s,l,c,d){t.clearRect(0,0,i,r),t.save(),t.translate(l,c),t.scale(d,d);const p=new Map(e.map(b=>[b.id,b]));let m=null;if(s){m=AW(s.id,n);for(const b of m.values());}const g=b=>{if(!s||!m||b===s.id)return 1;const v=m.get(b);return v===void 0?.06:Math.max(.08,1-v*.28)};for(const b of n){const v=p.get(b.source),_=p.get(b.target);if(!v||!_)continue;const A=Math.min(g(b.source),g(b.target)),C=s&&(b.source===s.id||b.target===s.id);if(t.globalAlpha=A,t.beginPath(),t.moveTo(v.x,v.y),t.lineTo(_.x,_.y),t.strokeStyle=C?"rgba(255,255,255,0.6)":cC[b.type]||"rgba(255,255,255,0.06)",t.lineWidth=C?1.8:b.type==="delivers"||b.type==="pipeline"?1.2:.5,t.stroke(),b.type==="delivers"||b.type==="pipeline"){const w=Math.atan2(_.y-v.y,_.x-v.x),k=z_[_.type]||10,R=_.x-Math.cos(w)*(k+4),O=_.y-Math.sin(w)*(k+4);t.beginPath(),t.moveTo(R,O),t.lineTo(R-Math.cos(w-.4)*6,O-Math.sin(w-.4)*6),t.lineTo(R-Math.cos(w+.4)*6,O-Math.sin(w+.4)*6),t.closePath(),t.fillStyle=cC[b.type],t.fill()}}t.globalAlpha=1;for(const b of e){const v=z_[b.type]||10,_=Uk[b.type]||"#888",A=(s==null?void 0:s.id)===b.id,C=g(b.id);t.globalAlpha=C,t.beginPath(),t.arc(b.x,b.y,v,0,Math.PI*2),A&&(t.shadowColor=_,t.shadowBlur=24),t.fillStyle=_,t.fill(),t.shadowBlur=0;const w=b.type==="squad"?11:9;t.font=`${b.type==="squad"?"600":"400"} ${w}px "JetBrains Mono", monospace`,t.textAlign="center",t.textBaseline="top",t.fillStyle="rgba(255,255,255,0.85)",t.fillText(b.label,b.x,b.y+v+4)}t.globalAlpha=1,t.restore()}function RW(){const t=L.useRef(null),[e,n]=L.useState([]),[i,r]=L.useState([]),[s,l]=L.useState(!0),[c,d]=L.useState(null),p=L.useRef(null),m=L.useRef(null),g=L.useRef(null),b=L.useRef(!1),v=L.useRef({x:0,y:0}),_=L.useRef(1),A=L.useRef(!1),C=L.useRef({x:0,y:0}),w=L.useRef([]),k=L.useRef([]),R=L.useRef(0),O=L.useRef(1),j=L.useRef(!0);L.useEffect(()=>{fetch("/api/graph",{credentials:"include"}).then(W=>W.json()).then(W=>{const P=window.innerWidth,I=window.innerHeight,K=W.nodes.map((q,te)=>({...q,x:P/2+(Math.random()-.5)*400,y:I/2+(Math.random()-.5)*400,vx:0,vy:0}));w.current=K,k.current=W.edges,n(K),r(W.edges),l(!1)}).catch(()=>{d("Failed to load graph data"),l(!1)})},[]);const D=L.useCallback((W,P)=>{const I=v.current,K=_.current,q=(W-I.x)/K,te=(P-I.y)/K;for(let H=w.current.length-1;H>=0;H--){const $=w.current[H],B=z_[$.type]||10,X=q-$.x,Z=te-$.y;if(X*X+Z*Z<(B+4)*(B+4))return $}return null},[]);L.useEffect(()=>{const W=t.current;if(!W)return;const P=H=>{const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top;if(g.current){b.current=!0;const Q=_.current,F=v.current;g.current.x=(B-F.x)/Q,g.current.y=(X-F.y)/Q,g.current.vx=0,g.current.vy=0,O.current=.3,j.current=!0;return}if(A.current){v.current.x+=B-C.current.x,v.current.y+=X-C.current.y,C.current={x:B,y:X};return}const Z=D(B,X);p.current=Z,W.style.cursor=Z?"grab":"default"},I=H=>{const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top;b.current=!1;const Z=D(B,X);Z?(g.current=Z,W.style.cursor="grabbing"):(A.current=!0,C.current={x:B,y:X},W.style.cursor="move")},K=H=>{var B;g.current;const $=A.current;if(g.current=null,A.current=!1,W.style.cursor="default",!b.current){const X=W.getBoundingClientRect(),Z=H.clientX-X.left,Q=H.clientY-X.top,F=D(Z,Q);F?m.current=((B=m.current)==null?void 0:B.id)===F.id?null:F:$||(m.current=null)}},q=H=>{H.preventDefault();const $=W.getBoundingClientRect(),B=H.clientX-$.left,X=H.clientY-$.top,Z=H.deltaY>0?.92:1.08,Q=Math.max(.2,Math.min(5,_.current*Z)),F=Q/_.current;v.current.x=B-(B-v.current.x)*F,v.current.y=X-(X-v.current.y)*F,_.current=Q},te=()=>{g.current=null,A.current=!1,W.style.cursor="default"};return W.addEventListener("mousemove",P),W.addEventListener("mousedown",I),W.addEventListener("mouseup",K),W.addEventListener("mouseleave",te),W.addEventListener("wheel",q,{passive:!1}),()=>{W.removeEventListener("mousemove",P),W.removeEventListener("mousedown",I),W.removeEventListener("mouseup",K),W.removeEventListener("mouseleave",te),W.removeEventListener("wheel",q)}},[D]),L.useEffect(()=>{if(s||w.current.length===0)return;const W=t.current;if(!W)return;const P=()=>{const te=W.parentElement;te&&(W.width=te.clientWidth*window.devicePixelRatio,W.height=te.clientHeight*window.devicePixelRatio,W.style.width=te.clientWidth+"px",W.style.height=te.clientHeight+"px")};P(),window.addEventListener("resize",P);const I=W.getContext("2d");let K=!0;const q=()=>{if(!K)return;const te=W.width/window.devicePixelRatio,H=W.height/window.devicePixelRatio;I.setTransform(window.devicePixelRatio,0,0,window.devicePixelRatio,0,0),j.current&&(CW(w.current,k.current,te,H,O.current),O.current*=.98,O.current<.001&&(j.current=!1,O.current=0)),MW(I,w.current,k.current,te,H,m.current,v.current.x,v.current.y,_.current),R.current=requestAnimationFrame(q)};return R.current=requestAnimationFrame(q),()=>{K=!1,cancelAnimationFrame(R.current),window.removeEventListener("resize",P)}},[s]);const G=L.useCallback(W=>{const P=t.current;if(!P)return;const I=W==="in"?1.25:.8,K=P.clientWidth/2,q=P.clientHeight/2,te=Math.max(.2,Math.min(5,_.current*I)),H=te/_.current;v.current.x=K-(K-v.current.x)*H,v.current.y=q-(q-v.current.y)*H,_.current=te},[]);return s?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading graph..."}):c?T.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:c}):T.jsxs("div",{style:{position:"relative",width:"100%",height:"100%",overflow:"hidden"},children:[T.jsx("canvas",{ref:t,style:{display:"block",touchAction:"none"}}),T.jsx("div",{style:{position:"absolute",bottom:16,left:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",flexDirection:"column",gap:6},children:Object.entries(Uk).map(([W,P])=>T.jsxs("div",{style:{display:"flex",alignItems:"center",gap:8},children:[T.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:P,display:"inline-block"}}),T.jsx("span",{style:{textTransform:"capitalize"},children:W})]},W))}),T.jsxs("div",{style:{position:"absolute",top:16,right:16,background:"rgba(10, 12, 16, 0.85)",borderRadius:"var(--radius-sm)",border:"1px solid var(--border-subtle)",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",display:"flex",gap:16},children:[T.jsxs("span",{children:[e.length," nodes"]}),T.jsxs("span",{children:[i.length," edges"]})]}),T.jsx("div",{style:{position:"absolute",bottom:16,right:16,display:"flex",flexDirection:"column",gap:4},children:[{label:"+",action:"in"},{label:"−",action:"out"}].map(({label:W,action:P})=>T.jsx("button",{onClick:()=>G(P),style:{width:32,height:32,background:"rgba(10, 12, 16, 0.85)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"1rem",cursor:"pointer",display:"flex",alignItems:"center",justifyContent:"center"},children:W},P))})]})}function NW(){const[t,e]=L.useState([]),[n,i]=L.useState(null),[r,s]=L.useState(""),[l,c]=L.useState(""),[d,p]=L.useState(!1),[m,g]=L.useState(!1),[b,v]=L.useState(new Set),[_,A]=L.useState(""),C=L.useRef(null);L.useEffect(()=>{fetch("/api/files",{credentials:"include"}).then(D=>D.json()).then(D=>{const G=new Map;for(const P of D)G.has(P.squad)||G.set(P.squad,{squad:P.squad,squadName:P.squadName,files:[]}),G.get(P.squad).files.push(P);const W=[...G.values()];e(W)})},[]);const w=L.useCallback(D=>{i(D),g(!0),fetch(`/api/files/${D.squad}/${D.path}`,{credentials:"include"}).then(G=>G.json()).then(G=>{s(G.content),c(G.content),g(!1)}).catch(()=>{s(""),c(""),g(!1)})},[]),k=L.useCallback(async()=>{n&&(p(!0),await fetch(`/api/files/${n.squad}/${n.path}`,{method:"PUT",credentials:"include",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:r})}),c(r),p(!1))},[n,r]),R=L.useCallback(D=>{v(G=>{const W=new Set(G);return W.has(D)?W.delete(D):W.add(D),W})},[]),O=r!==l;L.useEffect(()=>{const D=G=>{(G.metaKey||G.ctrlKey)&&G.key==="s"&&(G.preventDefault(),O&&n&&k())};return window.addEventListener("keydown",D),()=>window.removeEventListener("keydown",D)},[O,n,k]);const j=D=>D==="squad.yaml"?"⚙":D==="memories.md"?"◆":"◇";return T.jsxs("div",{style:{display:"flex",height:"100%",overflow:"hidden"},children:[T.jsxs("div",{style:{width:260,minWidth:260,borderRight:"1px solid var(--border-subtle)",background:"var(--surface-1)",display:"flex",flexDirection:"column",overflow:"hidden"},children:[T.jsx("div",{style:{padding:"12px 14px",fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",borderBottom:"1px solid var(--border-subtle)"},children:"Squad Files"}),T.jsx("div",{style:{padding:"8px 10px",borderBottom:"1px solid var(--border-subtle)"},children:T.jsx("input",{type:"text",placeholder:"Search squads...",value:_,onChange:D=>A(D.target.value),style:{width:"100%",padding:"5px 8px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-xs)",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",outline:"none"}})}),T.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"8px 0"},children:[t.filter(D=>{if(!_)return!0;const G=_.toLowerCase();return D.squadName.toLowerCase().includes(G)||D.squad.toLowerCase().includes(G)}).map(D=>T.jsxs("div",{children:[T.jsxs("button",{onClick:()=>R(D.squad),style:{width:"100%",background:"none",border:"none",padding:"6px 14px",display:"flex",alignItems:"center",gap:8,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:"var(--text-primary)",textAlign:"left"},children:[T.jsx("span",{style:{fontSize:"0.6rem",transition:"transform 0.15s ease",transform:b.has(D.squad)?"rotate(90deg)":"rotate(0deg)",display:"inline-block"},children:"▶"}),D.squadName]}),b.has(D.squad)&&T.jsx("div",{style:{paddingLeft:14},children:D.files.map(G=>{const W=(n==null?void 0:n.squad)===G.squad&&(n==null?void 0:n.path)===G.path;return T.jsxs("button",{onClick:()=>w(G),style:{width:"100%",background:W?"var(--accent-glow)":"none",border:W?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",borderRadius:"var(--radius-xs)",padding:"5px 10px",display:"flex",alignItems:"center",gap:6,cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:W?"var(--accent)":"var(--text-secondary)",textAlign:"left"},children:[T.jsx("span",{style:{opacity:.6},children:j(G.file)}),G.file]},`${G.squad}/${G.path}`)})})]},D.squad)),t.length===0&&T.jsx("div",{style:{padding:"20px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",textAlign:"center"},children:"No squads found"})]})]}),T.jsx("div",{style:{flex:1,display:"flex",flexDirection:"column",overflow:"hidden"},children:n?T.jsxs(T.Fragment,{children:[T.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--surface-1)"},children:[T.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:8},children:[T.jsx("span",{style:{color:"var(--text-muted)"},children:n.squadName}),T.jsx("span",{style:{color:"var(--text-muted)",opacity:.4},children:"/"}),T.jsx("span",{children:n.file}),O&&T.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:"var(--accent)",display:"inline-block"}})]}),T.jsxs("button",{onClick:k,disabled:!O||d,style:{background:O?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-xs)",padding:"4px 14px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",fontWeight:600,color:O?"var(--text-inverse)":"var(--text-muted)",cursor:O?"pointer":"default",opacity:O?1:.5,transition:"all 0.15s ease"},children:[d?"Saving...":"Save",T.jsx("span",{style:{marginLeft:6,fontSize:"0.6rem",opacity:.7},children:"⌘S"})]})]}),m?T.jsx("div",{style:{flex:1,display:"flex",alignItems:"center",justifyContent:"center",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem"},children:"Loading..."}):T.jsx("textarea",{ref:C,value:r,onChange:D=>s(D.target.value),spellCheck:!1,style:{flex:1,width:"100%",padding:"16px 20px",border:"none",outline:"none",resize:"none",background:"var(--surface-0)",color:"var(--text-primary)",fontFamily:'"JetBrains Mono", "Fira Code", monospace',fontSize:"0.8rem",lineHeight:1.7,tabSize:2,whiteSpace:"pre",overflowWrap:"normal",overflowX:"auto"}})]}):T.jsxs("div",{style:{flex:1,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:8,color:"var(--text-muted)",fontFamily:"var(--font-mono)"},children:[T.jsx("span",{style:{fontSize:"2rem",opacity:.3},children:"◇"}),T.jsx("span",{style:{fontSize:"0.8rem"},children:"Select a file to edit"})]})})]})}const kW=L.lazy(()=>Zd(()=>import("./JarvisView-BJqK_AFw.js"),[]).then(t=>({default:t.JarvisView})));IO.createRoot(document.getElementById("root")).render(T.jsx(L.StrictMode,{children:T.jsx(oD,{children:T.jsxs(I3,{children:[T.jsx(Ca,{path:"/login",element:T.jsx($D,{})}),T.jsxs(Ca,{path:"/",element:T.jsx(KD,{}),children:[T.jsx(Ca,{index:!0,element:T.jsx(L3,{to:"/office",replace:!0})}),T.jsx(Ca,{path:"office",element:T.jsx(_8,{})}),T.jsx(Ca,{path:"chat",element:T.jsx(PG,{})}),T.jsx(Ca,{path:"kanban",element:T.jsx(YG,{})}),T.jsx(Ca,{path:"settings",element:T.jsx(nF,{})}),T.jsx(Ca,{path:"scheduler",element:T.jsx(sF,{})}),T.jsx(Ca,{path:"email",element:T.jsx(uF,{})}),T.jsx(Ca,{path:"orgchart",element:T.jsx(TW,{})}),T.jsx(Ca,{path:"graph",element:T.jsx(RW,{})}),T.jsx(Ca,{path:"files",element:T.jsx(NW,{})}),T.jsx(Ca,{path:"jarvis",element:T.jsx(L.Suspense,{fallback:null,children:T.jsx(kW,{})})})]})]})})}));export{J0 as $,OA as A,Om as B,Yi as C,ns as D,go as E,sc as F,Ra as G,K_ as H,$m as I,FD as J,YE as K,p0 as L,Ft as M,V_ as N,RA as O,Lr as P,Ls as Q,Fv as R,s5 as S,Rn as T,w0 as U,SA as V,t_ as W,z5 as X,L5 as Y,F5 as Z,H5 as _,OW as a,Cf as a0,h4 as a1,Km as a2,X_ as a3,V5 as a4,ka as a5,WC as a6,Bs as a7,Z0 as a8,ME as a9,sh as aa,CB as ab,q4 as ac,NE as ad,Ex as ae,kE as af,V4 as ag,rh as ah,Ci as ai,JC as aj,$6 as ak,DA as al,rn as am,Xm as an,yi as ao,$z as ap,qz as aq,g5 as ar,c5 as as,B5 as at,U5 as au,q5 as av,G5 as aw,Y5 as ax,ml as b,es as c,Cz as d,Ma as e,bi as f,mz as g,Ln as h,h0 as i,T as j,Nt as k,o6 as l,QC as m,eb as n,J5 as o,tb as p,oA as q,L as r,OC as s,oi as t,hx as u,Vd as v,da as w,A4 as x,_r as y,i5 as z};
|