expxagents 0.12.2 → 0.13.0

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.
Files changed (62) hide show
  1. package/dist/dashboard/assets/{BufferResource-DTKCcSRK.js → BufferResource-D9aUIz5c.js} +1 -1
  2. package/dist/dashboard/assets/{CanvasRenderer-RC-R9HHB.js → CanvasRenderer-DfAInYD0.js} +1 -1
  3. package/dist/dashboard/assets/{JarvisView-BxEaO5CE.js → JarvisView-D78mY8i-.js} +1 -1
  4. package/dist/dashboard/assets/{RenderTargetSystem-BNs6mZy_.js → RenderTargetSystem-DZo6ujA0.js} +1 -1
  5. package/dist/dashboard/assets/{WebGLRenderer-DZqhYwUo.js → WebGLRenderer-BKreDG7Z.js} +1 -1
  6. package/dist/dashboard/assets/{WebGPURenderer-DKvNGGnd.js → WebGPURenderer-DeKuexG2.js} +1 -1
  7. package/dist/dashboard/assets/{browserAll-DpQDqd5Z.js → browserAll-3U5O7dnB.js} +1 -1
  8. package/dist/dashboard/assets/index-CahtAeF7.js +400 -0
  9. package/dist/dashboard/assets/index-DHu3wE8e.css +1 -0
  10. package/dist/dashboard/assets/{webworkerAll-DKgN-y6e.js → webworkerAll-CBlDUJVW.js} +1 -1
  11. package/dist/dashboard/index.html +2 -2
  12. package/dist/server/api/__tests__/integration-routes.test.d.ts +2 -0
  13. package/dist/server/api/__tests__/integration-routes.test.d.ts.map +1 -0
  14. package/dist/server/api/__tests__/integration-routes.test.js +243 -0
  15. package/dist/server/api/__tests__/integration-routes.test.js.map +1 -0
  16. package/dist/server/api/__tests__/team-routes.test.d.ts +2 -0
  17. package/dist/server/api/__tests__/team-routes.test.d.ts.map +1 -0
  18. package/dist/server/api/__tests__/team-routes.test.js +116 -0
  19. package/dist/server/api/__tests__/team-routes.test.js.map +1 -0
  20. package/dist/server/api/integration-routes.d.ts +23 -0
  21. package/dist/server/api/integration-routes.d.ts.map +1 -0
  22. package/dist/server/api/integration-routes.js +321 -0
  23. package/dist/server/api/integration-routes.js.map +1 -0
  24. package/dist/server/api/squads-routes.d.ts.map +1 -1
  25. package/dist/server/api/squads-routes.js +12 -1
  26. package/dist/server/api/squads-routes.js.map +1 -1
  27. package/dist/server/api/team-routes.d.ts +8 -0
  28. package/dist/server/api/team-routes.d.ts.map +1 -0
  29. package/dist/server/api/team-routes.js +55 -0
  30. package/dist/server/api/team-routes.js.map +1 -0
  31. package/dist/server/app.d.ts.map +1 -1
  32. package/dist/server/app.js +4 -0
  33. package/dist/server/app.js.map +1 -1
  34. package/dist/server/bridge/__tests__/claude-bridge.test.js +79 -11
  35. package/dist/server/bridge/__tests__/claude-bridge.test.js.map +1 -1
  36. package/dist/server/bridge/chat-handler.d.ts +6 -1
  37. package/dist/server/bridge/chat-handler.d.ts.map +1 -1
  38. package/dist/server/bridge/chat-handler.js +106 -5
  39. package/dist/server/bridge/chat-handler.js.map +1 -1
  40. package/dist/server/bridge/claude-bridge.d.ts +6 -0
  41. package/dist/server/bridge/claude-bridge.d.ts.map +1 -1
  42. package/dist/server/bridge/claude-bridge.js +90 -10
  43. package/dist/server/bridge/claude-bridge.js.map +1 -1
  44. package/dist/server/bridge/conversation.d.ts +1 -0
  45. package/dist/server/bridge/conversation.d.ts.map +1 -1
  46. package/dist/server/bridge/conversation.js +5 -0
  47. package/dist/server/bridge/conversation.js.map +1 -1
  48. package/dist/server/db/schema.d.ts +1 -1
  49. package/dist/server/db/schema.d.ts.map +1 -1
  50. package/dist/server/db/schema.js +18 -0
  51. package/dist/server/db/schema.js.map +1 -1
  52. package/dist/server/routes/__tests__/conversations.test.js +18 -1
  53. package/dist/server/routes/__tests__/conversations.test.js.map +1 -1
  54. package/dist/server/routes/conversations.d.ts.map +1 -1
  55. package/dist/server/routes/conversations.js +12 -1
  56. package/dist/server/routes/conversations.js.map +1 -1
  57. package/dist/server/ws/ws-handler.d.ts.map +1 -1
  58. package/dist/server/ws/ws-handler.js +17 -3
  59. package/dist/server/ws/ws-handler.js.map +1 -1
  60. package/package.json +1 -1
  61. package/dist/dashboard/assets/index-B-8_BLE5.css +0 -1
  62. package/dist/dashboard/assets/index-C_HJOTiO.js +0 -344
@@ -1,344 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-DpQDqd5Z.js","assets/webworkerAll-DKgN-y6e.js","assets/WebGPURenderer-DKvNGGnd.js","assets/BufferResource-DTKCcSRK.js","assets/RenderTargetSystem-BNs6mZy_.js","assets/WebGLRenderer-DZqhYwUo.js","assets/CanvasRenderer-RC-R9HHB.js"])))=>i.map(i=>d[i]);
2
- (function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))l(o);new MutationObserver(o=>{for(const c of o)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&l(h)}).observe(document,{childList:!0,subtree:!0});function a(o){const c={};return o.integrity&&(c.integrity=o.integrity),o.referrerPolicy&&(c.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?c.credentials="include":o.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(o){if(o.ep)return;o.ep=!0;const c=a(o);fetch(o.href,c)}})();const Y2="modulepreload",q2=function(n){return"/"+n},_v={},tf=function(t,a,l){let o=Promise.resolve();if(a&&a.length>0){let h=function(y){return Promise.all(y.map(x=>Promise.resolve(x).then(_=>({status:"fulfilled",value:_}),_=>({status:"rejected",reason:_}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),p=(m==null?void 0:m.nonce)||(m==null?void 0:m.getAttribute("nonce"));o=h(a.map(y=>{if(y=q2(y),y in _v)return;_v[y]=!0;const x=y.endsWith(".css"),_=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${_}`))return;const T=document.createElement("link");if(T.rel=x?"stylesheet":Y2,x||(T.as="script"),T.crossOrigin="",T.href=y,p&&T.setAttribute("nonce",p),document.head.appendChild(T),x)return new Promise((C,M)=>{T.addEventListener("load",C),T.addEventListener("error",()=>M(new Error(`Unable to preload CSS for ${y}`)))})}))}function c(h){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=h,window.dispatchEvent(m),!m.defaultPrevented)throw h}return o.then(h=>{for(const m of h||[])m.status==="rejected"&&c(m.reason);return t().catch(c)})};function Gp(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var By={exports:{}},Qh={};/**
3
- * @license React
4
- * react-jsx-runtime.production.js
5
- *
6
- * Copyright (c) Meta Platforms, Inc. and affiliates.
7
- *
8
- * This source code is licensed under the MIT license found in the
9
- * LICENSE file in the root directory of this source tree.
10
- */var Tv;function L2(){if(Tv)return Qh;Tv=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function a(l,o,c){var h=null;if(c!==void 0&&(h=""+c),o.key!==void 0&&(h=""+o.key),"key"in o){c={};for(var m in o)m!=="key"&&(c[m]=o[m])}else c=o;return o=c.ref,{$$typeof:n,type:l,key:h,ref:o!==void 0?o:null,props:c}}return Qh.Fragment=t,Qh.jsx=a,Qh.jsxs=a,Qh}var Ev;function X2(){return Ev||(Ev=1,By.exports=L2()),By.exports}var R=X2(),jy={exports:{}},Vt={};/**
11
- * @license React
12
- * react.production.js
13
- *
14
- * Copyright (c) Meta Platforms, Inc. and affiliates.
15
- *
16
- * This source code is licensed under the MIT license found in the
17
- * LICENSE file in the root directory of this source tree.
18
- */var Cv;function V2(){if(Cv)return Vt;Cv=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),h=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),T=Symbol.iterator;function C(U){return U===null||typeof U!="object"?null:(U=T&&U[T]||U["@@iterator"],typeof U=="function"?U:null)}var M={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,z={};function D(U,F,tt){this.props=U,this.context=F,this.refs=z,this.updater=tt||M}D.prototype.isReactComponent={},D.prototype.setState=function(U,F){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,F,"setState")},D.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function N(){}N.prototype=D.prototype;function j(U,F,tt){this.props=U,this.context=F,this.refs=z,this.updater=tt||M}var G=j.prototype=new N;G.constructor=j,w(G,D.prototype),G.isPureReactComponent=!0;var k=Array.isArray;function q(){}var Z={H:null,A:null,T:null,S:null},W=Object.prototype.hasOwnProperty;function L(U,F,tt){var pt=tt.ref;return{$$typeof:n,type:U,key:F,ref:pt!==void 0?pt:null,props:tt}}function $(U,F){return L(U.type,F,U.props)}function et(U){return typeof U=="object"&&U!==null&&U.$$typeof===n}function ct(U){var F={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(tt){return F[tt]})}var vt=/\/+/g;function dt(U,F){return typeof U=="object"&&U!==null&&U.key!=null?ct(""+U.key):F.toString(36)}function St(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(q,q):(U.status="pending",U.then(function(F){U.status==="pending"&&(U.status="fulfilled",U.value=F)},function(F){U.status==="pending"&&(U.status="rejected",U.reason=F)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function H(U,F,tt,pt,_t){var At=typeof U;(At==="undefined"||At==="boolean")&&(U=null);var Ot=!1;if(U===null)Ot=!0;else switch(At){case"bigint":case"string":case"number":Ot=!0;break;case"object":switch(U.$$typeof){case n:case t:Ot=!0;break;case x:return Ot=U._init,H(Ot(U._payload),F,tt,pt,_t)}}if(Ot)return _t=_t(U),Ot=pt===""?"."+dt(U,0):pt,k(_t)?(tt="",Ot!=null&&(tt=Ot.replace(vt,"$&/")+"/"),H(_t,F,tt,"",function(ga){return ga})):_t!=null&&(et(_t)&&(_t=$(_t,tt+(_t.key==null||U&&U.key===_t.key?"":(""+_t.key).replace(vt,"$&/")+"/")+Ot)),F.push(_t)),1;Ot=0;var fe=pt===""?".":pt+":";if(k(U))for(var ce=0;ce<U.length;ce++)pt=U[ce],At=fe+dt(pt,ce),Ot+=H(pt,F,tt,At,_t);else if(ce=C(U),typeof ce=="function")for(U=ce.call(U),ce=0;!(pt=U.next()).done;)pt=pt.value,At=fe+dt(pt,ce++),Ot+=H(pt,F,tt,At,_t);else if(At==="object"){if(typeof U.then=="function")return H(St(U),F,tt,pt,_t);throw F=String(U),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return Ot}function Q(U,F,tt){if(U==null)return U;var pt=[],_t=0;return H(U,pt,"","",function(At){return F.call(tt,At,_t++)}),pt}function ot(U){if(U._status===-1){var F=U._result;F=F(),F.then(function(tt){(U._status===0||U._status===-1)&&(U._status=1,U._result=tt)},function(tt){(U._status===0||U._status===-1)&&(U._status=2,U._result=tt)}),U._status===-1&&(U._status=0,U._result=F)}if(U._status===1)return U._result.default;throw U._result}var rt=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)},gt={map:Q,forEach:function(U,F,tt){Q(U,function(){F.apply(this,arguments)},tt)},count:function(U){var F=0;return Q(U,function(){F++}),F},toArray:function(U){return Q(U,function(F){return F})||[]},only:function(U){if(!et(U))throw Error("React.Children.only expected to receive a single React element child.");return U}};return Vt.Activity=_,Vt.Children=gt,Vt.Component=D,Vt.Fragment=a,Vt.Profiler=o,Vt.PureComponent=j,Vt.StrictMode=l,Vt.Suspense=p,Vt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,Vt.__COMPILER_RUNTIME={__proto__:null,c:function(U){return Z.H.useMemoCache(U)}},Vt.cache=function(U){return function(){return U.apply(null,arguments)}},Vt.cacheSignal=function(){return null},Vt.cloneElement=function(U,F,tt){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var pt=w({},U.props),_t=U.key;if(F!=null)for(At in F.key!==void 0&&(_t=""+F.key),F)!W.call(F,At)||At==="key"||At==="__self"||At==="__source"||At==="ref"&&F.ref===void 0||(pt[At]=F[At]);var At=arguments.length-2;if(At===1)pt.children=tt;else if(1<At){for(var Ot=Array(At),fe=0;fe<At;fe++)Ot[fe]=arguments[fe+2];pt.children=Ot}return L(U.type,_t,pt)},Vt.createContext=function(U){return U={$$typeof:h,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:c,_context:U},U},Vt.createElement=function(U,F,tt){var pt,_t={},At=null;if(F!=null)for(pt in F.key!==void 0&&(At=""+F.key),F)W.call(F,pt)&&pt!=="key"&&pt!=="__self"&&pt!=="__source"&&(_t[pt]=F[pt]);var Ot=arguments.length-2;if(Ot===1)_t.children=tt;else if(1<Ot){for(var fe=Array(Ot),ce=0;ce<Ot;ce++)fe[ce]=arguments[ce+2];_t.children=fe}if(U&&U.defaultProps)for(pt in Ot=U.defaultProps,Ot)_t[pt]===void 0&&(_t[pt]=Ot[pt]);return L(U,At,_t)},Vt.createRef=function(){return{current:null}},Vt.forwardRef=function(U){return{$$typeof:m,render:U}},Vt.isValidElement=et,Vt.lazy=function(U){return{$$typeof:x,_payload:{_status:-1,_result:U},_init:ot}},Vt.memo=function(U,F){return{$$typeof:y,type:U,compare:F===void 0?null:F}},Vt.startTransition=function(U){var F=Z.T,tt={};Z.T=tt;try{var pt=U(),_t=Z.S;_t!==null&&_t(tt,pt),typeof pt=="object"&&pt!==null&&typeof pt.then=="function"&&pt.then(q,rt)}catch(At){rt(At)}finally{F!==null&&tt.types!==null&&(F.types=tt.types),Z.T=F}},Vt.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},Vt.use=function(U){return Z.H.use(U)},Vt.useActionState=function(U,F,tt){return Z.H.useActionState(U,F,tt)},Vt.useCallback=function(U,F){return Z.H.useCallback(U,F)},Vt.useContext=function(U){return Z.H.useContext(U)},Vt.useDebugValue=function(){},Vt.useDeferredValue=function(U,F){return Z.H.useDeferredValue(U,F)},Vt.useEffect=function(U,F){return Z.H.useEffect(U,F)},Vt.useEffectEvent=function(U){return Z.H.useEffectEvent(U)},Vt.useId=function(){return Z.H.useId()},Vt.useImperativeHandle=function(U,F,tt){return Z.H.useImperativeHandle(U,F,tt)},Vt.useInsertionEffect=function(U,F){return Z.H.useInsertionEffect(U,F)},Vt.useLayoutEffect=function(U,F){return Z.H.useLayoutEffect(U,F)},Vt.useMemo=function(U,F){return Z.H.useMemo(U,F)},Vt.useOptimistic=function(U,F){return Z.H.useOptimistic(U,F)},Vt.useReducer=function(U,F,tt){return Z.H.useReducer(U,F,tt)},Vt.useRef=function(U){return Z.H.useRef(U)},Vt.useState=function(U){return Z.H.useState(U)},Vt.useSyncExternalStore=function(U,F,tt){return Z.H.useSyncExternalStore(U,F,tt)},Vt.useTransition=function(){return Z.H.useTransition()},Vt.version="19.2.4",Vt}var Av;function Yp(){return Av||(Av=1,jy.exports=V2()),jy.exports}var Y=Yp();const np=Gp(Y);var Uy={exports:{}},Kh={},Hy={exports:{}},Gy={};/**
19
- * @license React
20
- * scheduler.production.js
21
- *
22
- * Copyright (c) Meta Platforms, Inc. and affiliates.
23
- *
24
- * This source code is licensed under the MIT license found in the
25
- * LICENSE file in the root directory of this source tree.
26
- */var Mv;function k2(){return Mv||(Mv=1,(function(n){function t(H,Q){var ot=H.length;H.push(Q);t:for(;0<ot;){var rt=ot-1>>>1,gt=H[rt];if(0<o(gt,Q))H[rt]=Q,H[ot]=gt,ot=rt;else break t}}function a(H){return H.length===0?null:H[0]}function l(H){if(H.length===0)return null;var Q=H[0],ot=H.pop();if(ot!==Q){H[0]=ot;t:for(var rt=0,gt=H.length,U=gt>>>1;rt<U;){var F=2*(rt+1)-1,tt=H[F],pt=F+1,_t=H[pt];if(0>o(tt,ot))pt<gt&&0>o(_t,tt)?(H[rt]=_t,H[pt]=ot,rt=pt):(H[rt]=tt,H[F]=ot,rt=F);else if(pt<gt&&0>o(_t,ot))H[rt]=_t,H[pt]=ot,rt=pt;else break t}}return Q}function o(H,Q){var ot=H.sortIndex-Q.sortIndex;return ot!==0?ot:H.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var p=[],y=[],x=1,_=null,T=3,C=!1,M=!1,w=!1,z=!1,D=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;function G(H){for(var Q=a(y);Q!==null;){if(Q.callback===null)l(y);else if(Q.startTime<=H)l(y),Q.sortIndex=Q.expirationTime,t(p,Q);else break;Q=a(y)}}function k(H){if(w=!1,G(H),!M)if(a(p)!==null)M=!0,q||(q=!0,ct());else{var Q=a(y);Q!==null&&St(k,Q.startTime-H)}}var q=!1,Z=-1,W=5,L=-1;function $(){return z?!0:!(n.unstable_now()-L<W)}function et(){if(z=!1,q){var H=n.unstable_now();L=H;var Q=!0;try{t:{M=!1,w&&(w=!1,N(Z),Z=-1),C=!0;var ot=T;try{e:{for(G(H),_=a(p);_!==null&&!(_.expirationTime>H&&$());){var rt=_.callback;if(typeof rt=="function"){_.callback=null,T=_.priorityLevel;var gt=rt(_.expirationTime<=H);if(H=n.unstable_now(),typeof gt=="function"){_.callback=gt,G(H),Q=!0;break e}_===a(p)&&l(p),G(H)}else l(p);_=a(p)}if(_!==null)Q=!0;else{var U=a(y);U!==null&&St(k,U.startTime-H),Q=!1}}break t}finally{_=null,T=ot,C=!1}Q=void 0}}finally{Q?ct():q=!1}}}var ct;if(typeof j=="function")ct=function(){j(et)};else if(typeof MessageChannel<"u"){var vt=new MessageChannel,dt=vt.port2;vt.port1.onmessage=et,ct=function(){dt.postMessage(null)}}else ct=function(){D(et,0)};function St(H,Q){Z=D(function(){H(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(H){H.callback=null},n.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<H?Math.floor(1e3/H):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_next=function(H){switch(T){case 1:case 2:case 3:var Q=3;break;default:Q=T}var ot=T;T=Q;try{return H()}finally{T=ot}},n.unstable_requestPaint=function(){z=!0},n.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ot=T;T=H;try{return Q()}finally{T=ot}},n.unstable_scheduleCallback=function(H,Q,ot){var rt=n.unstable_now();switch(typeof ot=="object"&&ot!==null?(ot=ot.delay,ot=typeof ot=="number"&&0<ot?rt+ot:rt):ot=rt,H){case 1:var gt=-1;break;case 2:gt=250;break;case 5:gt=1073741823;break;case 4:gt=1e4;break;default:gt=5e3}return gt=ot+gt,H={id:x++,callback:Q,priorityLevel:H,startTime:ot,expirationTime:gt,sortIndex:-1},ot>rt?(H.sortIndex=ot,t(y,H),a(p)===null&&H===a(y)&&(w?(N(Z),Z=-1):w=!0,St(k,ot-rt))):(H.sortIndex=gt,t(p,H),M||C||(M=!0,q||(q=!0,ct()))),H},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(H){var Q=T;return function(){var ot=T;T=Q;try{return H.apply(this,arguments)}finally{T=ot}}}})(Gy)),Gy}var Rv;function Q2(){return Rv||(Rv=1,Hy.exports=k2()),Hy.exports}var Yy={exports:{}},ma={};/**
27
- * @license React
28
- * react-dom.production.js
29
- *
30
- * Copyright (c) Meta Platforms, Inc. and affiliates.
31
- *
32
- * This source code is licensed under the MIT license found in the
33
- * LICENSE file in the root directory of this source tree.
34
- */var zv;function K2(){if(zv)return ma;zv=1;var n=Yp();function t(p){var y="https://react.dev/errors/"+p;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)y+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+p+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var l={d:{f:a,r:function(){throw Error(t(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function c(p,y,x){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:_==null?null:""+_,children:p,containerInfo:y,implementation:x}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(p,y){if(p==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return ma.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,ma.createPortal=function(p,y){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(t(299));return c(p,y,null,x)},ma.flushSync=function(p){var y=h.T,x=l.p;try{if(h.T=null,l.p=2,p)return p()}finally{h.T=y,l.p=x,l.d.f()}},ma.preconnect=function(p,y){typeof p=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,l.d.C(p,y))},ma.prefetchDNS=function(p){typeof p=="string"&&l.d.D(p)},ma.preinit=function(p,y){if(typeof p=="string"&&y&&typeof y.as=="string"){var x=y.as,_=m(x,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,C=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;x==="style"?l.d.S(p,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:_,integrity:T,fetchPriority:C}):x==="script"&&l.d.X(p,{crossOrigin:_,integrity:T,fetchPriority:C,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},ma.preinitModule=function(p,y){if(typeof p=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var x=m(y.as,y.crossOrigin);l.d.M(p,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&l.d.M(p)},ma.preload=function(p,y){if(typeof p=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var x=y.as,_=m(x,y.crossOrigin);l.d.L(p,x,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},ma.preloadModule=function(p,y){if(typeof p=="string")if(y){var x=m(y.as,y.crossOrigin);l.d.m(p,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else l.d.m(p)},ma.requestFormReset=function(p){l.d.r(p)},ma.unstable_batchedUpdates=function(p,y){return p(y)},ma.useFormState=function(p,y,x){return h.H.useFormState(p,y,x)},ma.useFormStatus=function(){return h.H.useHostTransitionStatus()},ma.version="19.2.4",ma}var wv;function Z2(){if(wv)return Yy.exports;wv=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),Yy.exports=K2(),Yy.exports}/**
35
- * @license React
36
- * react-dom-client.production.js
37
- *
38
- * Copyright (c) Meta Platforms, Inc. and affiliates.
39
- *
40
- * This source code is licensed under the MIT license found in the
41
- * LICENSE file in the root directory of this source tree.
42
- */var Dv;function F2(){if(Dv)return Kh;Dv=1;var n=Q2(),t=Yp(),a=Z2();function l(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)i+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var i=e,u=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(u=i.return),e=i.return;while(e)}return i.tag===3?u:null}function h(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function m(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function p(e){if(c(e)!==e)throw Error(l(188))}function y(e){var i=e.alternate;if(!i){if(i=c(e),i===null)throw Error(l(188));return i!==e?null:e}for(var u=e,f=i;;){var g=u.return;if(g===null)break;var b=g.alternate;if(b===null){if(f=g.return,f!==null){u=f;continue}break}if(g.child===b.child){for(b=g.child;b;){if(b===u)return p(g),e;if(b===f)return p(g),i;b=b.sibling}throw Error(l(188))}if(u.return!==f.return)u=g,f=b;else{for(var A=!1,O=g.child;O;){if(O===u){A=!0,u=g,f=b;break}if(O===f){A=!0,f=g,u=b;break}O=O.sibling}if(!A){for(O=b.child;O;){if(O===u){A=!0,u=b,f=g;break}if(O===f){A=!0,f=b,u=g;break}O=O.sibling}if(!A)throw Error(l(189))}}if(u.alternate!==f)throw Error(l(190))}if(u.tag!==3)throw Error(l(188));return u.stateNode.current===u?e:i}function x(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=x(e),i!==null)return i;e=e.sibling}return null}var _=Object.assign,T=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),M=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),D=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),j=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),L=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),et=Symbol.iterator;function ct(e){return e===null||typeof e!="object"?null:(e=et&&e[et]||e["@@iterator"],typeof e=="function"?e:null)}var vt=Symbol.for("react.client.reference");function dt(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===vt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case D:return"Profiler";case z:return"StrictMode";case k:return"Suspense";case q:return"SuspenseList";case L:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case M:return"Portal";case j:return e.displayName||"Context";case N:return(e._context.displayName||"Context")+".Consumer";case G:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Z:return i=e.displayName||null,i!==null?i:dt(e.type)||"Memo";case W:i=e._payload,e=e._init;try{return dt(e(i))}catch{}}return null}var St=Array.isArray,H=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ot={pending:!1,data:null,method:null,action:null},rt=[],gt=-1;function U(e){return{current:e}}function F(e){0>gt||(e.current=rt[gt],rt[gt]=null,gt--)}function tt(e,i){gt++,rt[gt]=e.current,e.current=i}var pt=U(null),_t=U(null),At=U(null),Ot=U(null);function fe(e,i){switch(tt(At,i),tt(_t,e),tt(pt,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?Qg(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=Qg(i),e=Kg(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}F(pt),tt(pt,e)}function ce(){F(pt),F(_t),F(At)}function ga(e){e.memoizedState!==null&&tt(Ot,e);var i=pt.current,u=Kg(i,e.type);i!==u&&(tt(_t,e),tt(pt,u))}function La(e){_t.current===e&&(F(pt),F(_t)),Ot.current===e&&(F(Ot),Lh._currentValue=ot)}var Xn,ta;function pn(e){if(Xn===void 0)try{throw Error()}catch(u){var i=u.stack.trim().match(/\n( *(at )?)/);Xn=i&&i[1]||"",ta=-1<u.stack.indexOf(`
43
- at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
44
- `+Xn+e+ta}var ea=!1;function Ts(e,i){if(!e||ea)return"";ea=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var yt=function(){throw Error()};if(Object.defineProperty(yt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(yt,[])}catch(ut){var lt=ut}Reflect.construct(e,[],yt)}else{try{yt.call()}catch(ut){lt=ut}e.call(yt.prototype)}}else{try{throw Error()}catch(ut){lt=ut}(yt=e())&&typeof yt.catch=="function"&&yt.catch(function(){})}}catch(ut){if(ut&&lt&&typeof ut.stack=="string")return[ut.stack,lt.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var g=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");g&&g.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var b=f.DetermineComponentFrameRoot(),A=b[0],O=b[1];if(A&&O){var V=A.split(`
45
- `),at=O.split(`
46
- `);for(g=f=0;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;for(;g<at.length&&!at[g].includes("DetermineComponentFrameRoot");)g++;if(f===V.length||g===at.length)for(f=V.length-1,g=at.length-1;1<=f&&0<=g&&V[f]!==at[g];)g--;for(;1<=f&&0<=g;f--,g--)if(V[f]!==at[g]){if(f!==1||g!==1)do if(f--,g--,0>g||V[f]!==at[g]){var ft=`
47
- `+V[f].replace(" at new "," at ");return e.displayName&&ft.includes("<anonymous>")&&(ft=ft.replace("<anonymous>",e.displayName)),ft}while(1<=f&&0<=g);break}}}finally{ea=!1,Error.prepareStackTrace=u}return(u=e?e.displayName||e.name:"")?pn(u):""}function li(e,i){switch(e.tag){case 26:case 27:case 5:return pn(e.type);case 16:return pn("Lazy");case 13:return e.child!==i&&i!==null?pn("Suspense Fallback"):pn("Suspense");case 19:return pn("SuspenseList");case 0:case 15:return Ts(e.type,!1);case 11:return Ts(e.type.render,!1);case 1:return Ts(e.type,!0);case 31:return pn("Activity");default:return""}}function ou(e){try{var i="",u=null;do i+=li(e,u),u=e,e=e.return;while(e);return i}catch(f){return`
48
- Error generating stack: `+f.message+`
49
- `+f.stack}}var Es=Object.prototype.hasOwnProperty,Xa=n.unstable_scheduleCallback,Ul=n.unstable_cancelCallback,Pp=n.unstable_shouldYield,Ed=n.unstable_requestPaint,na=n.unstable_now,Cd=n.unstable_getCurrentPriorityLevel,Ad=n.unstable_ImmediatePriority,Ao=n.unstable_UserBlockingPriority,Mo=n.unstable_NormalPriority,Md=n.unstable_LowPriority,Rd=n.unstable_IdlePriority,df=n.log,mf=n.unstable_setDisableYieldValue,Va=null,$e=null;function ka(e){if(typeof df=="function"&&mf(e),$e&&typeof $e.setStrictMode=="function")try{$e.setStrictMode(Va,e)}catch{}}var Vn=Math.clz32?Math.clz32:zd,cu=Math.log,fu=Math.LN2;function zd(e){return e>>>=0,e===0?32:31-(cu(e)/fu|0)|0}var hu=256,Cs=262144,du=4194304;function Ci(e){var i=e&42;if(i!==0)return i;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function mu(e,i,u){var f=e.pendingLanes;if(f===0)return 0;var g=0,b=e.suspendedLanes,A=e.pingedLanes;e=e.warmLanes;var O=f&134217727;return O!==0?(f=O&~b,f!==0?g=Ci(f):(A&=O,A!==0?g=Ci(A):u||(u=O&~e,u!==0&&(g=Ci(u))))):(O=f&~b,O!==0?g=Ci(O):A!==0?g=Ci(A):u||(u=f&~e,u!==0&&(g=Ci(u)))),g===0?0:i!==0&&i!==g&&(i&b)===0&&(b=g&-g,u=i&-i,b>=u||b===32&&(u&4194048)!==0)?i:g}function mr(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function Ro(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pr(){var e=du;return du<<=1,(du&62914560)===0&&(du=4194304),e}function yr(e){for(var i=[],u=0;31>u;u++)i.push(e);return i}function gr(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function wd(e,i,u,f,g,b){var A=e.pendingLanes;e.pendingLanes=u,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=u,e.entangledLanes&=u,e.errorRecoveryDisabledLanes&=u,e.shellSuspendCounter=0;var O=e.entanglements,V=e.expirationTimes,at=e.hiddenUpdates;for(u=A&~u;0<u;){var ft=31-Vn(u),yt=1<<ft;O[ft]=0,V[ft]=-1;var lt=at[ft];if(lt!==null)for(at[ft]=null,ft=0;ft<lt.length;ft++){var ut=lt[ft];ut!==null&&(ut.lane&=-536870913)}u&=~yt}f!==0&&pf(e,f,0),b!==0&&g===0&&e.tag!==0&&(e.suspendedLanes|=b&~(A&~i))}function pf(e,i,u){e.pendingLanes|=i,e.suspendedLanes&=~i;var f=31-Vn(i);e.entangledLanes|=i,e.entanglements[f]=e.entanglements[f]|1073741824|u&261930}function zo(e,i){var u=e.entangledLanes|=i;for(e=e.entanglements;u;){var f=31-Vn(u),g=1<<f;g&i|e[f]&i&&(e[f]|=i),u&=~g}}function wo(e,i){var u=i&-i;return u=(u&42)!==0?1:Ai(u),(u&(e.suspendedLanes|i))!==0?0:u}function Ai(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Do(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function nl(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:pv(e.type))}function Mi(e,i){var u=Q.p;try{return Q.p=e,i()}finally{Q.p=u}}var si=Math.random().toString(36).slice(2),Pt="__reactFiber$"+si,wn="__reactProps$"+si,Hl="__reactContainer$"+si,Oo="__reactEvents$"+si,Dd="__reactListeners$"+si,Ip="__reactHandles$"+si,No="__reactResources$"+si,As="__reactMarker$"+si;function pu(e){delete e[Pt],delete e[wn],delete e[Oo],delete e[Dd],delete e[Ip]}function cn(e){var i=e[Pt];if(i)return i;for(var u=e.parentNode;u;){if(i=u[Hl]||u[Pt]){if(u=i.alternate,i.child!==null||u!==null&&u.child!==null)for(e=$g(e);e!==null;){if(u=e[Pt])return u;e=$g(e)}return i}e=u,u=e.parentNode}return null}function we(e){if(e=e[Pt]||e[Hl]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function al(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(l(33))}function il(e){var i=e[No];return i||(i=e[No]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function tn(e){e[As]=!0}var Ri=new Set,yu={};function ll(e,i){Gl(e,i),Gl(e+"Capture",i)}function Gl(e,i){for(yu[e]=i,e=0;e<i.length;e++)Ri.add(i[e])}var Od=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),yf={},gf={};function Nd(e){return Es.call(gf,e)?!0:Es.call(yf,e)?!1:Od.test(e)?gf[e]=!0:(yf[e]=!0,!1)}function gu(e,i,u){if(Nd(i))if(u===null)e.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+u)}}function vu(e,i,u){if(u===null)e.removeAttribute(i);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+u)}}function ri(e,i,u,f){if(f===null)e.removeAttribute(u);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(u);return}e.setAttributeNS(i,u,""+f)}}function va(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bd(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function jd(e,i,u){var f=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var g=f.get,b=f.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return g.call(this)},set:function(A){u=""+A,b.call(this,A)}}),Object.defineProperty(e,i,{enumerable:f.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Bo(e){if(!e._valueTracker){var i=Bd(e)?"checked":"value";e._valueTracker=jd(e,i,""+e[i])}}function vf(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var u=i.getValue(),f="";return e&&(f=Bd(e)?e.checked?"true":"false":e.value),e=f,e!==u?(i.setValue(e),!0):!1}function vr(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Ud=/[\n"\\]/g;function xa(e){return e.replace(Ud,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function jo(e,i,u,f,g,b,A,O){e.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?e.type=A:e.removeAttribute("type"),i!=null?A==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+va(i)):e.value!==""+va(i)&&(e.value=""+va(i)):A!=="submit"&&A!=="reset"||e.removeAttribute("value"),i!=null?Uo(e,A,va(i)):u!=null?Uo(e,A,va(u)):f!=null&&e.removeAttribute("value"),g==null&&b!=null&&(e.defaultChecked=!!b),g!=null&&(e.checked=g&&typeof g!="function"&&typeof g!="symbol"),O!=null&&typeof O!="function"&&typeof O!="symbol"&&typeof O!="boolean"?e.name=""+va(O):e.removeAttribute("name")}function xf(e,i,u,f,g,b,A,O){if(b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"&&(e.type=b),i!=null||u!=null){if(!(b!=="submit"&&b!=="reset"||i!=null)){Bo(e);return}u=u!=null?""+va(u):"",i=i!=null?""+va(i):u,O||i===e.value||(e.value=i),e.defaultValue=i}f=f??g,f=typeof f!="function"&&typeof f!="symbol"&&!!f,e.checked=O?e.checked:!!f,e.defaultChecked=!!f,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(e.name=A),Bo(e)}function Uo(e,i,u){i==="number"&&vr(e.ownerDocument)===e||e.defaultValue===""+u||(e.defaultValue=""+u)}function xr(e,i,u,f){if(e=e.options,i){i={};for(var g=0;g<u.length;g++)i["$"+u[g]]=!0;for(u=0;u<e.length;u++)g=i.hasOwnProperty("$"+e[u].value),e[u].selected!==g&&(e[u].selected=g),g&&f&&(e[u].defaultSelected=!0)}else{for(u=""+va(u),i=null,g=0;g<e.length;g++){if(e[g].value===u){e[g].selected=!0,f&&(e[g].defaultSelected=!0);return}i!==null||e[g].disabled||(i=e[g])}i!==null&&(i.selected=!0)}}function bf(e,i,u){if(i!=null&&(i=""+va(i),i!==e.value&&(e.value=i),u==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=u!=null?""+va(u):""}function Ms(e,i,u,f){if(i==null){if(f!=null){if(u!=null)throw Error(l(92));if(St(f)){if(1<f.length)throw Error(l(93));f=f[0]}u=f}u==null&&(u=""),i=u}u=va(i),e.defaultValue=u,f=e.textContent,f===u&&f!==""&&f!==null&&(e.value=f),Bo(e)}function Rs(e,i){if(i){var u=e.firstChild;if(u&&u===e.lastChild&&u.nodeType===3){u.nodeValue=i;return}}e.textContent=i}var Ho=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function xu(e,i,u){var f=i.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?f?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":f?e.setProperty(i,u):typeof u!="number"||u===0||Ho.has(i)?i==="float"?e.cssFloat=u:e[i]=(""+u).trim():e[i]=u+"px"}function Sf(e,i,u){if(i!=null&&typeof i!="object")throw Error(l(62));if(e=e.style,u!=null){for(var f in u)!u.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?e.setProperty(f,""):f==="float"?e.cssFloat="":e[f]="");for(var g in i)f=i[g],i.hasOwnProperty(g)&&u[g]!==f&&xu(e,g,f)}else for(var b in i)i.hasOwnProperty(b)&&xu(e,b,i[b])}function bu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Hd=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Gd=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Su(e){return Gd.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function zi(){}var _u=null;function Go(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var zs=null,Yl=null;function _f(e){var i=we(e);if(i&&(e=i.stateNode)){var u=e[wn]||null;t:switch(e=i.stateNode,i.type){case"input":if(jo(e,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),i=u.name,u.type==="radio"&&i!=null){for(u=e;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+xa(""+i)+'"][type="radio"]'),i=0;i<u.length;i++){var f=u[i];if(f!==e&&f.form===e.form){var g=f[wn]||null;if(!g)throw Error(l(90));jo(f,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name)}}for(i=0;i<u.length;i++)f=u[i],f.form===e.form&&vf(f)}break t;case"textarea":bf(e,u.value,u.defaultValue);break t;case"select":i=u.value,i!=null&&xr(e,!!u.multiple,i,!1)}}}var Yo=!1;function Tf(e,i,u){if(Yo)return e(i,u);Yo=!0;try{var f=e(i);return f}finally{if(Yo=!1,(zs!==null||Yl!==null)&&(B(),zs&&(i=zs,e=Yl,Yl=zs=null,_f(i),e)))for(i=0;i<e.length;i++)_f(e[i])}}function ws(e,i){var u=e.stateNode;if(u===null)return null;var f=u[wn]||null;if(f===null)return null;u=f[i];t:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(e=e.type,f=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!f;break t;default:e=!1}if(e)return null;if(u&&typeof u!="function")throw Error(l(231,i,typeof u));return u}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),qo=!1;if(wi)try{var Tu={};Object.defineProperty(Tu,"passive",{get:function(){qo=!0}}),window.addEventListener("test",Tu,Tu),window.removeEventListener("test",Tu,Tu)}catch{qo=!1}var ql=null,Lo=null,Ll=null;function Xo(){if(Ll)return Ll;var e,i=Lo,u=i.length,f,g="value"in ql?ql.value:ql.textContent,b=g.length;for(e=0;e<u&&i[e]===g[e];e++);var A=u-e;for(f=1;f<=A&&i[u-f]===g[b-f];f++);return Ll=g.slice(e,1<f?1-f:void 0)}function Ds(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Eu(){return!0}function Ef(){return!1}function Dn(e){function i(u,f,g,b,A){this._reactName=u,this._targetInst=g,this.type=f,this.nativeEvent=b,this.target=A,this.currentTarget=null;for(var O in e)e.hasOwnProperty(O)&&(u=e[O],this[O]=u?u(b):b[O]);return this.isDefaultPrevented=(b.defaultPrevented!=null?b.defaultPrevented:b.returnValue===!1)?Eu:Ef,this.isPropagationStopped=Ef,this}return _(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=Eu)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=Eu)},persist:function(){},isPersistent:Eu}),i}var Xl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Cu=Dn(Xl),ui=_({},Xl,{view:0,detail:0}),Vo=Dn(ui),ko,Au,br,Mu=_({},ui,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zu,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==br&&(br&&e.type==="mousemove"?(ko=e.screenX-br.screenX,Au=e.screenY-br.screenY):Au=ko=0,br=e),ko)},movementY:function(e){return"movementY"in e?e.movementY:Au}}),Yd=Dn(Mu),Sn=_({},Mu,{dataTransfer:0}),qd=Dn(Sn),Ld=_({},ui,{relatedTarget:0}),Qo=Dn(Ld),Xd=_({},Xl,{animationName:0,elapsedTime:0,pseudoElement:0}),Vd=Dn(Xd),Ru=_({},Xl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Cf=Dn(Ru),kd=_({},Xl,{data:0}),Af=Dn(kd),Qd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Mf={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Rf={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kd(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Rf[e])?!!i[e]:!1}function zu(){return Kd}var zf=_({},ui,{key:function(e){if(e.key){var i=Qd[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=Ds(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Mf[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zu,charCode:function(e){return e.type==="keypress"?Ds(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ds(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),wf=Dn(zf),Zd=_({},Mu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ko=Dn(Zd),Fd=_({},ui,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zu}),sl=Dn(Fd),Df=_({},Xl,{propertyName:0,elapsedTime:0,pseudoElement:0}),$p=Dn(Df),Wd=_({},Mu,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Vl=Dn(Wd),rl=_({},Xl,{newState:0,oldState:0}),Of=Dn(rl),Nf=[9,13,27,32],Os=wi&&"CompositionEvent"in window,kl=null;wi&&"documentMode"in document&&(kl=document.documentMode);var Ns=wi&&"TextEvent"in window&&!kl,_n=wi&&(!Os||kl&&8<kl&&11>=kl),wu=" ",Bf=!1;function Zo(e,i){switch(e){case"keyup":return Nf.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sr(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ql=!1;function Fo(e,i){switch(e){case"compositionend":return Sr(i);case"keypress":return i.which!==32?null:(Bf=!0,wu);case"textInput":return e=i.data,e===wu&&Bf?null:e;default:return null}}function Jd(e,i){if(Ql)return e==="compositionend"||!Os&&Zo(e,i)?(e=Xo(),Ll=Lo=ql=null,Ql=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return _n&&i.locale!=="ko"?null:i.data;default:return null}}var ba={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function jf(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!ba[e.type]:i==="textarea"}function Wo(e,i,u,f){zs?Yl?Yl.push(f):Yl=[f]:zs=f,i=Lm(i,"onChange"),0<i.length&&(u=new Cu("onChange","change",null,u,f),e.push({event:u,listeners:i}))}var _r=null,Tr=null;function Uf(e){Yg(e,0)}function Er(e){var i=al(e);if(vf(i))return e}function Hf(e,i){if(e==="change")return i}var Du=!1;if(wi){var Bs;if(wi){var De="oninput"in document;if(!De){var Pd=document.createElement("div");Pd.setAttribute("oninput","return;"),De=typeof Pd.oninput=="function"}Bs=De}else Bs=!1;Du=Bs&&(!document.documentMode||9<document.documentMode)}function Id(){_r&&(_r.detachEvent("onpropertychange",Gf),Tr=_r=null)}function Gf(e){if(e.propertyName==="value"&&Er(Tr)){var i=[];Wo(i,Tr,e,Go(e)),Tf(Uf,i)}}function Ou(e,i,u){e==="focusin"?(Id(),_r=i,Tr=u,_r.attachEvent("onpropertychange",Gf)):e==="focusout"&&Id()}function Kl(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Er(Tr)}function $d(e,i){if(e==="click")return Er(i)}function tm(e,i){if(e==="input"||e==="change")return Er(i)}function js(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Oe=typeof Object.is=="function"?Object.is:js;function Cr(e,i){if(Oe(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var u=Object.keys(e),f=Object.keys(i);if(u.length!==f.length)return!1;for(f=0;f<u.length;f++){var g=u[f];if(!Es.call(i,g)||!Oe(e[g],i[g]))return!1}return!0}function Yf(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function qf(e,i){var u=Yf(e);e=0;for(var f;u;){if(u.nodeType===3){if(f=e+u.textContent.length,e<=i&&f>=i)return{node:u,offset:i-e};e=f}t:{for(;u;){if(u.nextSibling){u=u.nextSibling;break t}u=u.parentNode}u=void 0}u=Yf(u)}}function Jo(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Jo(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Po(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=vr(e.document);i instanceof e.HTMLIFrameElement;){try{var u=typeof i.contentWindow.location.href=="string"}catch{u=!1}if(u)e=i.contentWindow;else break;i=vr(e.document)}return i}function Ar(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var em=wi&&"documentMode"in document&&11>=document.documentMode,Mr=null,Io=null,Rr=null,Sa=!1;function $o(e,i,u){var f=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Sa||Mr==null||Mr!==vr(f)||(f=Mr,"selectionStart"in f&&Ar(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Rr&&Cr(Rr,f)||(Rr=f,f=Lm(Io,"onSelect"),0<f.length&&(i=new Cu("onSelect","select",null,i,u),e.push({event:i,listeners:f}),i.target=Mr)))}function Zl(e,i){var u={};return u[e.toLowerCase()]=i.toLowerCase(),u["Webkit"+e]="webkit"+i,u["Moz"+e]="moz"+i,u}var zr={animationend:Zl("Animation","AnimationEnd"),animationiteration:Zl("Animation","AnimationIteration"),animationstart:Zl("Animation","AnimationStart"),transitionrun:Zl("Transition","TransitionRun"),transitionstart:Zl("Transition","TransitionStart"),transitioncancel:Zl("Transition","TransitionCancel"),transitionend:Zl("Transition","TransitionEnd")},Nu={},kn={};wi&&(kn=document.createElement("div").style,"AnimationEvent"in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),"TransitionEvent"in window||delete zr.transitionend.transition);function Fl(e){if(Nu[e])return Nu[e];if(!zr[e])return e;var i=zr[e],u;for(u in i)if(i.hasOwnProperty(u)&&u in kn)return Nu[e]=i[u];return e}var aa=Fl("animationend"),Lf=Fl("animationiteration"),Di=Fl("animationstart"),wr=Fl("transitionrun"),Wl=Fl("transitionstart"),Xf=Fl("transitioncancel"),tc=Fl("transitionend"),ul=new Map,ec="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");ec.push("scrollEnd");function On(e,i){ul.set(e,i),ll(i,[e])}var Jl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},yn=[],Us=0,nc=0;function Pl(){for(var e=Us,i=nc=Us=0;i<e;){var u=yn[i];yn[i++]=null;var f=yn[i];yn[i++]=null;var g=yn[i];yn[i++]=null;var b=yn[i];if(yn[i++]=null,f!==null&&g!==null){var A=f.pending;A===null?g.next=g:(g.next=A.next,A.next=g),f.pending=g}b!==0&&ac(u,g,b)}}function Bu(e,i,u,f){yn[Us++]=e,yn[Us++]=i,yn[Us++]=u,yn[Us++]=f,nc|=f,e.lanes|=f,e=e.alternate,e!==null&&(e.lanes|=f)}function Dr(e,i,u,f){return Bu(e,i,u,f),Or(e)}function Il(e,i){return Bu(e,null,null,i),Or(e)}function ac(e,i,u){e.lanes|=u;var f=e.alternate;f!==null&&(f.lanes|=u);for(var g=!1,b=e.return;b!==null;)b.childLanes|=u,f=b.alternate,f!==null&&(f.childLanes|=u),b.tag===22&&(e=b.stateNode,e===null||e._visibility&1||(g=!0)),e=b,b=b.return;return e.tag===3?(b=e.stateNode,g&&i!==null&&(g=31-Vn(u),e=b.hiddenUpdates,f=e[g],f===null?e[g]=[i]:f.push(i),i.lane=u|536870912),b):null}function Or(e){if(50<$s)throw $s=0,tr=null,Error(l(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var $l={};function nm(e,i,u,f){this.tag=e,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Qn(e,i,u,f){return new nm(e,i,u,f)}function Kn(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Oi(e,i){var u=e.alternate;return u===null?(u=Qn(e.tag,i,e.key,e.mode),u.elementType=e.elementType,u.type=e.type,u.stateNode=e.stateNode,u.alternate=e,e.alternate=u):(u.pendingProps=i,u.type=e.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=e.flags&65011712,u.childLanes=e.childLanes,u.lanes=e.lanes,u.child=e.child,u.memoizedProps=e.memoizedProps,u.memoizedState=e.memoizedState,u.updateQueue=e.updateQueue,i=e.dependencies,u.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},u.sibling=e.sibling,u.index=e.index,u.ref=e.ref,u.refCleanup=e.refCleanup,u}function Nn(e,i){e.flags&=65011714;var u=e.alternate;return u===null?(e.childLanes=0,e.lanes=i,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=u.childLanes,e.lanes=u.lanes,e.child=u.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=u.memoizedProps,e.memoizedState=u.memoizedState,e.updateQueue=u.updateQueue,e.type=u.type,i=u.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function ju(e,i,u,f,g,b){var A=0;if(f=e,typeof e=="function")Kn(e)&&(A=1);else if(typeof e=="string")A=M2(e,u,pt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case L:return e=Qn(31,u,i,g),e.elementType=L,e.lanes=b,e;case w:return ol(u.children,g,b,i);case z:A=8,g|=24;break;case D:return e=Qn(12,u,i,g|2),e.elementType=D,e.lanes=b,e;case k:return e=Qn(13,u,i,g),e.elementType=k,e.lanes=b,e;case q:return e=Qn(19,u,i,g),e.elementType=q,e.lanes=b,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case j:A=10;break t;case N:A=9;break t;case G:A=11;break t;case Z:A=14;break t;case W:A=16,f=null;break t}A=29,u=Error(l(130,e===null?"null":typeof e,"")),f=null}return i=Qn(A,u,i,g),i.elementType=e,i.type=f,i.lanes=b,i}function ol(e,i,u,f){return e=Qn(7,e,f,i),e.lanes=u,e}function ic(e,i,u){return e=Qn(6,e,null,i),e.lanes=u,e}function am(e){var i=Qn(18,null,null,0);return i.stateNode=e,i}function oi(e,i,u){return i=Qn(4,e.children!==null?e.children:[],e.key,i),i.lanes=u,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Vf=new WeakMap;function ia(e,i){if(typeof e=="object"&&e!==null){var u=Vf.get(e);return u!==void 0?u:(i={value:e,source:i,stack:ou(i)},Vf.set(e,i),i)}return{value:e,source:i,stack:ou(i)}}var ci=[],Hs=0,Uu=null,Nr=0,_a=[],la=0,Ni=null,Bi=1,ji="";function cl(e,i){ci[Hs++]=Nr,ci[Hs++]=Uu,Uu=e,Nr=i}function kf(e,i,u){_a[la++]=Bi,_a[la++]=ji,_a[la++]=Ni,Ni=e;var f=Bi;e=ji;var g=32-Vn(f)-1;f&=~(1<<g),u+=1;var b=32-Vn(i)+g;if(30<b){var A=g-g%5;b=(f&(1<<A)-1).toString(32),f>>=A,g-=A,Bi=1<<32-Vn(i)+g|u<<g|f,ji=b+e}else Bi=1<<b|u<<g|f,ji=e}function lc(e){e.return!==null&&(cl(e,1),kf(e,1,0))}function ts(e){for(;e===Uu;)Uu=ci[--Hs],ci[Hs]=null,Nr=ci[--Hs],ci[Hs]=null;for(;e===Ni;)Ni=_a[--la],_a[la]=null,ji=_a[--la],_a[la]=null,Bi=_a[--la],_a[la]=null}function Hu(e,i){_a[la++]=Bi,_a[la++]=ji,_a[la++]=Ni,Bi=i.id,ji=i.overflow,Ni=e}var gn=null,Ce=null,te=!1,fl=null,vn=!1,sc=Error(l(519));function It(e){var i=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gu(ia(i,e)),sc}function rc(e){var i=e.stateNode,u=e.type,f=e.memoizedProps;switch(i[Pt]=e,i[wn]=f,u){case"dialog":ee("cancel",i),ee("close",i);break;case"iframe":case"object":case"embed":ee("load",i);break;case"video":case"audio":for(u=0;u<Uh.length;u++)ee(Uh[u],i);break;case"source":ee("error",i);break;case"img":case"image":case"link":ee("error",i),ee("load",i);break;case"details":ee("toggle",i);break;case"input":ee("invalid",i),xf(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"select":ee("invalid",i);break;case"textarea":ee("invalid",i),Ms(i,f.value,f.defaultValue,f.children)}u=f.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||i.textContent===""+u||f.suppressHydrationWarning===!0||Vg(i.textContent,u)?(f.popover!=null&&(ee("beforetoggle",i),ee("toggle",i)),f.onScroll!=null&&ee("scroll",i),f.onScrollEnd!=null&&ee("scrollend",i),f.onClick!=null&&(i.onclick=zi),i=!0):i=!1,i||It(e,!0)}function im(e){for(gn=e.return;gn;)switch(gn.tag){case 5:case 31:case 13:vn=!1;return;case 27:case 3:vn=!0;return;default:gn=gn.return}}function Gs(e){if(e!==gn)return!1;if(!te)return im(e),te=!0,!1;var i=e.tag,u;if((u=i!==3&&i!==27)&&((u=i===5)&&(u=e.type,u=!(u!=="form"&&u!=="button")||xy(e.type,e.memoizedProps)),u=!u),u&&Ce&&It(e),im(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Ce=Ig(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));Ce=Ig(e)}else i===27?(i=Ce,Ir(e.type)?(e=Ey,Ey=null,Ce=e):Ce=i):Ce=gn?Ki(e.stateNode.nextSibling):null;return!0}function Ys(){Ce=gn=null,te=!1}function Qf(){var e=fl;return e!==null&&(Yn===null?Yn=e:Yn.push.apply(Yn,e),fl=null),e}function Gu(e){fl===null?fl=[e]:fl.push(e)}var Kf=U(null),hl=null,Bn=null;function dl(e,i,u){tt(Kf,i._currentValue),i._currentValue=u}function Qa(e){e._currentValue=Kf.current,F(Kf)}function ml(e,i,u){for(;e!==null;){var f=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),e===u)break;e=e.return}}function uc(e,i,u,f){var g=e.child;for(g!==null&&(g.return=e);g!==null;){var b=g.dependencies;if(b!==null){var A=g.child;b=b.firstContext;t:for(;b!==null;){var O=b;b=g;for(var V=0;V<i.length;V++)if(O.context===i[V]){b.lanes|=u,O=b.alternate,O!==null&&(O.lanes|=u),ml(b.return,u,e),f||(A=null);break t}b=O.next}}else if(g.tag===18){if(A=g.return,A===null)throw Error(l(341));A.lanes|=u,b=A.alternate,b!==null&&(b.lanes|=u),ml(A,u,e),A=null}else A=g.child;if(A!==null)A.return=g;else for(A=g;A!==null;){if(A===e){A=null;break}if(g=A.sibling,g!==null){g.return=A.return,A=g;break}A=A.return}g=A}}function es(e,i,u,f){e=null;for(var g=i,b=!1;g!==null;){if(!b){if((g.flags&524288)!==0)b=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var A=g.alternate;if(A===null)throw Error(l(387));if(A=A.memoizedProps,A!==null){var O=g.type;Oe(g.pendingProps.value,A.value)||(e!==null?e.push(O):e=[O])}}else if(g===Ot.current){if(A=g.alternate,A===null)throw Error(l(387));A.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(e!==null?e.push(Lh):e=[Lh])}g=g.return}e!==null&&uc(i,e,u,f),i.flags|=262144}function Br(e){for(e=e.firstContext;e!==null;){if(!Oe(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function qs(e){hl=e,Bn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function xn(e){return Zf(hl,e)}function Yu(e,i){return hl===null&&qs(e),Zf(e,i)}function Zf(e,i){var u=i._currentValue;if(i={context:i,memoizedValue:u,next:null},Bn===null){if(e===null)throw Error(l(308));Bn=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Bn=Bn.next=i;return u}var lm=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(u,f){e.push(f)}};this.abort=function(){i.aborted=!0,e.forEach(function(u){return u()})}},sm=n.unstable_scheduleCallback,Ff=n.unstable_NormalPriority,zt={$$typeof:j,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wf(){return{controller:new lm,data:new Map,refCount:0}}function Tn(e){e.refCount--,e.refCount===0&&sm(Ff,function(){e.controller.abort()})}var Ls=null,Jf=0,pl=0,fi=null;function jr(e,i){if(Ls===null){var u=Ls=[];Jf=0,pl=cy(),fi={status:"pending",value:void 0,then:function(f){u.push(f)}}}return Jf++,i.then(Pf,Pf),i}function Pf(){if(--Jf===0&&Ls!==null){fi!==null&&(fi.status="fulfilled");var e=Ls;Ls=null,pl=0,fi=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function If(e,i){var u=[],f={status:"pending",value:null,reason:null,then:function(g){u.push(g)}};return e.then(function(){f.status="fulfilled",f.value=i;for(var g=0;g<u.length;g++)(0,u[g])(i)},function(g){for(f.status="rejected",f.reason=g,g=0;g<u.length;g++)(0,u[g])(void 0)}),f}var rm=H.S;H.S=function(e,i){Wr=na(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&jr(e,i),rm!==null&&rm(e,i)};var ns=U(null);function Ui(){var e=ns.current;return e!==null?e:pe.pooledCache}function Ur(e,i){i===null?tt(ns,ns.current):tt(ns,i.pool)}function oc(){var e=Ui();return e===null?null:{parent:zt._currentValue,pool:e}}var as=Error(l(460)),qu=Error(l(474)),hi=Error(l(542)),Lu={then:function(){}};function um(e){return e=e.status,e==="fulfilled"||e==="rejected"}function $f(e,i,u){switch(u=e[u],u===void 0?e.push(i):u!==i&&(i.then(zi,zi),i=u),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,th(e),e;default:if(typeof i.status=="string")i.then(zi,zi);else{if(e=pe,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=i,e.status="pending",e.then(function(f){if(i.status==="pending"){var g=i;g.status="fulfilled",g.value=f}},function(f){if(i.status==="pending"){var g=i;g.status="rejected",g.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,th(e),e}throw Nt=i,as}}function Xs(e){try{var i=e._init;return i(e._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Nt=u,as):u}}var Nt=null;function cc(){if(Nt===null)throw Error(l(459));var e=Nt;return Nt=null,e}function th(e){if(e===as||e===hi)throw Error(l(483))}var is=null,ls=0;function fc(e){var i=ls;return ls+=1,is===null&&(is=[]),$f(is,e,i)}function Xu(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Vu(e,i){throw i.$$typeof===T?Error(l(525)):(e=Object.prototype.toString.call(i),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function Hr(e){function i(P,K){if(e){var nt=P.deletions;nt===null?(P.deletions=[K],P.flags|=16):nt.push(K)}}function u(P,K){if(!e)return null;for(;K!==null;)i(P,K),K=K.sibling;return null}function f(P){for(var K=new Map;P!==null;)P.key!==null?K.set(P.key,P):K.set(P.index,P),P=P.sibling;return K}function g(P,K){return P=Oi(P,K),P.index=0,P.sibling=null,P}function b(P,K,nt){return P.index=nt,e?(nt=P.alternate,nt!==null?(nt=nt.index,nt<K?(P.flags|=67108866,K):nt):(P.flags|=67108866,K)):(P.flags|=1048576,K)}function A(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function O(P,K,nt,mt){return K===null||K.tag!==6?(K=ic(nt,P.mode,mt),K.return=P,K):(K=g(K,nt),K.return=P,K)}function V(P,K,nt,mt){var Dt=nt.type;return Dt===w?ft(P,K,nt.props.children,mt,nt.key):K!==null&&(K.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===W&&Xs(Dt)===K.type)?(K=g(K,nt.props),Xu(K,nt),K.return=P,K):(K=ju(nt.type,nt.key,nt.props,null,P.mode,mt),Xu(K,nt),K.return=P,K)}function at(P,K,nt,mt){return K===null||K.tag!==4||K.stateNode.containerInfo!==nt.containerInfo||K.stateNode.implementation!==nt.implementation?(K=oi(nt,P.mode,mt),K.return=P,K):(K=g(K,nt.children||[]),K.return=P,K)}function ft(P,K,nt,mt,Dt){return K===null||K.tag!==7?(K=ol(nt,P.mode,mt,Dt),K.return=P,K):(K=g(K,nt),K.return=P,K)}function yt(P,K,nt){if(typeof K=="string"&&K!==""||typeof K=="number"||typeof K=="bigint")return K=ic(""+K,P.mode,nt),K.return=P,K;if(typeof K=="object"&&K!==null){switch(K.$$typeof){case C:return nt=ju(K.type,K.key,K.props,null,P.mode,nt),Xu(nt,K),nt.return=P,nt;case M:return K=oi(K,P.mode,nt),K.return=P,K;case W:return K=Xs(K),yt(P,K,nt)}if(St(K)||ct(K))return K=ol(K,P.mode,nt,null),K.return=P,K;if(typeof K.then=="function")return yt(P,fc(K),nt);if(K.$$typeof===j)return yt(P,Yu(P,K),nt);Vu(P,K)}return null}function lt(P,K,nt,mt){var Dt=K!==null?K.key:null;if(typeof nt=="string"&&nt!==""||typeof nt=="number"||typeof nt=="bigint")return Dt!==null?null:O(P,K,""+nt,mt);if(typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case C:return nt.key===Dt?V(P,K,nt,mt):null;case M:return nt.key===Dt?at(P,K,nt,mt):null;case W:return nt=Xs(nt),lt(P,K,nt,mt)}if(St(nt)||ct(nt))return Dt!==null?null:ft(P,K,nt,mt,null);if(typeof nt.then=="function")return lt(P,K,fc(nt),mt);if(nt.$$typeof===j)return lt(P,K,Yu(P,nt),mt);Vu(P,nt)}return null}function ut(P,K,nt,mt,Dt){if(typeof mt=="string"&&mt!==""||typeof mt=="number"||typeof mt=="bigint")return P=P.get(nt)||null,O(K,P,""+mt,Dt);if(typeof mt=="object"&&mt!==null){switch(mt.$$typeof){case C:return P=P.get(mt.key===null?nt:mt.key)||null,V(K,P,mt,Dt);case M:return P=P.get(mt.key===null?nt:mt.key)||null,at(K,P,mt,Dt);case W:return mt=Xs(mt),ut(P,K,nt,mt,Dt)}if(St(mt)||ct(mt))return P=P.get(nt)||null,ft(K,P,mt,Dt,null);if(typeof mt.then=="function")return ut(P,K,nt,fc(mt),Dt);if(mt.$$typeof===j)return ut(P,K,nt,Yu(K,mt),Dt);Vu(K,mt)}return null}function Ct(P,K,nt,mt){for(var Dt=null,ge=null,Mt=K,Zt=K=0,ie=null;Mt!==null&&Zt<nt.length;Zt++){Mt.index>Zt?(ie=Mt,Mt=null):ie=Mt.sibling;var ve=lt(P,Mt,nt[Zt],mt);if(ve===null){Mt===null&&(Mt=ie);break}e&&Mt&&ve.alternate===null&&i(P,Mt),K=b(ve,K,Zt),ge===null?Dt=ve:ge.sibling=ve,ge=ve,Mt=ie}if(Zt===nt.length)return u(P,Mt),te&&cl(P,Zt),Dt;if(Mt===null){for(;Zt<nt.length;Zt++)Mt=yt(P,nt[Zt],mt),Mt!==null&&(K=b(Mt,K,Zt),ge===null?Dt=Mt:ge.sibling=Mt,ge=Mt);return te&&cl(P,Zt),Dt}for(Mt=f(Mt);Zt<nt.length;Zt++)ie=ut(Mt,P,Zt,nt[Zt],mt),ie!==null&&(e&&ie.alternate!==null&&Mt.delete(ie.key===null?Zt:ie.key),K=b(ie,K,Zt),ge===null?Dt=ie:ge.sibling=ie,ge=ie);return e&&Mt.forEach(function(au){return i(P,au)}),te&&cl(P,Zt),Dt}function jt(P,K,nt,mt){if(nt==null)throw Error(l(151));for(var Dt=null,ge=null,Mt=K,Zt=K=0,ie=null,ve=nt.next();Mt!==null&&!ve.done;Zt++,ve=nt.next()){Mt.index>Zt?(ie=Mt,Mt=null):ie=Mt.sibling;var au=lt(P,Mt,ve.value,mt);if(au===null){Mt===null&&(Mt=ie);break}e&&Mt&&au.alternate===null&&i(P,Mt),K=b(au,K,Zt),ge===null?Dt=au:ge.sibling=au,ge=au,Mt=ie}if(ve.done)return u(P,Mt),te&&cl(P,Zt),Dt;if(Mt===null){for(;!ve.done;Zt++,ve=nt.next())ve=yt(P,ve.value,mt),ve!==null&&(K=b(ve,K,Zt),ge===null?Dt=ve:ge.sibling=ve,ge=ve);return te&&cl(P,Zt),Dt}for(Mt=f(Mt);!ve.done;Zt++,ve=nt.next())ve=ut(Mt,P,Zt,ve.value,mt),ve!==null&&(e&&ve.alternate!==null&&Mt.delete(ve.key===null?Zt:ve.key),K=b(ve,K,Zt),ge===null?Dt=ve:ge.sibling=ve,ge=ve);return e&&Mt.forEach(function(G2){return i(P,G2)}),te&&cl(P,Zt),Dt}function Re(P,K,nt,mt){if(typeof nt=="object"&&nt!==null&&nt.type===w&&nt.key===null&&(nt=nt.props.children),typeof nt=="object"&&nt!==null){switch(nt.$$typeof){case C:t:{for(var Dt=nt.key;K!==null;){if(K.key===Dt){if(Dt=nt.type,Dt===w){if(K.tag===7){u(P,K.sibling),mt=g(K,nt.props.children),mt.return=P,P=mt;break t}}else if(K.elementType===Dt||typeof Dt=="object"&&Dt!==null&&Dt.$$typeof===W&&Xs(Dt)===K.type){u(P,K.sibling),mt=g(K,nt.props),Xu(mt,nt),mt.return=P,P=mt;break t}u(P,K);break}else i(P,K);K=K.sibling}nt.type===w?(mt=ol(nt.props.children,P.mode,mt,nt.key),mt.return=P,P=mt):(mt=ju(nt.type,nt.key,nt.props,null,P.mode,mt),Xu(mt,nt),mt.return=P,P=mt)}return A(P);case M:t:{for(Dt=nt.key;K!==null;){if(K.key===Dt)if(K.tag===4&&K.stateNode.containerInfo===nt.containerInfo&&K.stateNode.implementation===nt.implementation){u(P,K.sibling),mt=g(K,nt.children||[]),mt.return=P,P=mt;break t}else{u(P,K);break}else i(P,K);K=K.sibling}mt=oi(nt,P.mode,mt),mt.return=P,P=mt}return A(P);case W:return nt=Xs(nt),Re(P,K,nt,mt)}if(St(nt))return Ct(P,K,nt,mt);if(ct(nt)){if(Dt=ct(nt),typeof Dt!="function")throw Error(l(150));return nt=Dt.call(nt),jt(P,K,nt,mt)}if(typeof nt.then=="function")return Re(P,K,fc(nt),mt);if(nt.$$typeof===j)return Re(P,K,Yu(P,nt),mt);Vu(P,nt)}return typeof nt=="string"&&nt!==""||typeof nt=="number"||typeof nt=="bigint"?(nt=""+nt,K!==null&&K.tag===6?(u(P,K.sibling),mt=g(K,nt),mt.return=P,P=mt):(u(P,K),mt=ic(nt,P.mode,mt),mt.return=P,P=mt),A(P)):u(P,K)}return function(P,K,nt,mt){try{ls=0;var Dt=Re(P,K,nt,mt);return is=null,Dt}catch(Mt){if(Mt===as||Mt===hi)throw Mt;var ge=Qn(29,Mt,null,P.mode);return ge.lanes=mt,ge.return=P,ge}finally{}}}var Vs=Hr(!0),om=Hr(!1),ss=!1;function eh(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nh(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Hi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function yl(e,i,u){var f=e.updateQueue;if(f===null)return null;if(f=f.shared,(ne&2)!==0){var g=f.pending;return g===null?i.next=i:(i.next=g.next,g.next=i),f.pending=i,i=Or(e),ac(e,null,u),i}return Bu(e,f,i,u),Or(e)}function rs(e,i,u){if(i=i.updateQueue,i!==null&&(i=i.shared,(u&4194048)!==0)){var f=i.lanes;f&=e.pendingLanes,u|=f,i.lanes=u,zo(e,u)}}function hc(e,i){var u=e.updateQueue,f=e.alternate;if(f!==null&&(f=f.updateQueue,u===f)){var g=null,b=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};b===null?g=b=A:b=b.next=A,u=u.next}while(u!==null);b===null?g=b=i:b=b.next=i}else g=b=i;u={baseState:f.baseState,firstBaseUpdate:g,lastBaseUpdate:b,shared:f.shared,callbacks:f.callbacks},e.updateQueue=u;return}e=u.lastBaseUpdate,e===null?u.firstBaseUpdate=i:e.next=i,u.lastBaseUpdate=i}var ah=!1;function ku(){if(ah){var e=fi;if(e!==null)throw e}}function ks(e,i,u,f){ah=!1;var g=e.updateQueue;ss=!1;var b=g.firstBaseUpdate,A=g.lastBaseUpdate,O=g.shared.pending;if(O!==null){g.shared.pending=null;var V=O,at=V.next;V.next=null,A===null?b=at:A.next=at,A=V;var ft=e.alternate;ft!==null&&(ft=ft.updateQueue,O=ft.lastBaseUpdate,O!==A&&(O===null?ft.firstBaseUpdate=at:O.next=at,ft.lastBaseUpdate=V))}if(b!==null){var yt=g.baseState;A=0,ft=at=V=null,O=b;do{var lt=O.lane&-536870913,ut=lt!==O.lane;if(ut?($t&lt)===lt:(f&lt)===lt){lt!==0&&lt===pl&&(ah=!0),ft!==null&&(ft=ft.next={lane:0,tag:O.tag,payload:O.payload,callback:null,next:null});t:{var Ct=e,jt=O;lt=i;var Re=u;switch(jt.tag){case 1:if(Ct=jt.payload,typeof Ct=="function"){yt=Ct.call(Re,yt,lt);break t}yt=Ct;break t;case 3:Ct.flags=Ct.flags&-65537|128;case 0:if(Ct=jt.payload,lt=typeof Ct=="function"?Ct.call(Re,yt,lt):Ct,lt==null)break t;yt=_({},yt,lt);break t;case 2:ss=!0}}lt=O.callback,lt!==null&&(e.flags|=64,ut&&(e.flags|=8192),ut=g.callbacks,ut===null?g.callbacks=[lt]:ut.push(lt))}else ut={lane:lt,tag:O.tag,payload:O.payload,callback:O.callback,next:null},ft===null?(at=ft=ut,V=yt):ft=ft.next=ut,A|=lt;if(O=O.next,O===null){if(O=g.shared.pending,O===null)break;ut=O,O=ut.next,ut.next=null,g.lastBaseUpdate=ut,g.shared.pending=null}}while(!0);ft===null&&(V=yt),g.baseState=V,g.firstBaseUpdate=at,g.lastBaseUpdate=ft,b===null&&(g.shared.lanes=0),Na|=A,e.lanes=A,e.memoizedState=yt}}function Gi(e,i){if(typeof e!="function")throw Error(l(191,e));e.call(i)}function En(e,i){var u=e.callbacks;if(u!==null)for(e.callbacks=null,e=0;e<u.length;e++)Gi(u[e],i)}var Ta=U(null),Zn=U(0);function ih(e,i){e=We,tt(Zn,e),tt(Ta,i),We=e|i.baseLanes}function lh(){tt(Zn,We),tt(Ta,Ta.current)}function jn(){We=Zn.current,F(Ta),F(Zn)}var fn=U(null),Ka=null;function us(e){var i=e.alternate;tt(Ge,Ge.current&1),tt(fn,e),Ka===null&&(i===null||Ta.current!==null||i.memoizedState!==null)&&(Ka=e)}function sh(e){tt(Ge,Ge.current),tt(fn,e),Ka===null&&(Ka=e)}function cm(e){e.tag===22?(tt(Ge,Ge.current),tt(fn,e),Ka===null&&(Ka=e)):gl()}function gl(){tt(Ge,Ge.current),tt(fn,fn.current)}function Ea(e){F(fn),Ka===e&&(Ka=null),F(Ge)}var Ge=U(0);function dc(e){for(var i=e;i!==null;){if(i.tag===13){var u=i.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||_y(u)||Ty(u)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var sa=0,Ut=null,Se=null,en=null,mc=!1,Yi=!1,Qs=!1,pc=0,Qu=0,qi=null,ty=0;function Ye(){throw Error(l(321))}function rh(e,i){if(i===null)return!1;for(var u=0;u<i.length&&u<e.length;u++)if(!Oe(e[u],i[u]))return!1;return!0}function uh(e,i,u,f,g,b){return sa=b,Ut=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,H.H=e===null||e.memoizedState===null?wm:qr,Qs=!1,b=u(f,g),Qs=!1,Yi&&(b=hm(i,u,f,g)),fm(e),b}function fm(e){H.H=Ju;var i=Se!==null&&Se.next!==null;if(sa=0,en=Se=Ut=null,mc=!1,Qu=0,qi=null,i)throw Error(l(300));e===null||Ne||(e=e.dependencies,e!==null&&Br(e)&&(Ne=!0))}function hm(e,i,u,f){Ut=e;var g=0;do{if(Yi&&(qi=null),Qu=0,Yi=!1,25<=g)throw Error(l(301));if(g+=1,en=Se=null,e.updateQueue!=null){var b=e.updateQueue;b.lastEffect=null,b.events=null,b.stores=null,b.memoCache!=null&&(b.memoCache.index=0)}H.H=Pu,b=i(u,f)}while(Yi);return b}function ey(){var e=H.H,i=e.useState()[0];return i=typeof i.then=="function"?Zu(i):i,e=e.useState()[0],(Se!==null?Se.memoizedState:null)!==e&&(Ut.flags|=1024),i}function oh(){var e=pc!==0;return pc=0,e}function ch(e,i,u){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~u}function fh(e){if(mc){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}mc=!1}sa=0,en=Se=Ut=null,Yi=!1,Qu=pc=0,qi=null}function Fn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return en===null?Ut.memoizedState=en=e:en=en.next=e,en}function Qe(){if(Se===null){var e=Ut.alternate;e=e!==null?e.memoizedState:null}else e=Se.next;var i=en===null?Ut.memoizedState:en.next;if(i!==null)en=i,Se=e;else{if(e===null)throw Ut.alternate===null?Error(l(467)):Error(l(310));Se=e,e={memoizedState:Se.memoizedState,baseState:Se.baseState,baseQueue:Se.baseQueue,queue:Se.queue,next:null},en===null?Ut.memoizedState=en=e:en=en.next=e}return en}function Ku(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Zu(e){var i=Qu;return Qu+=1,qi===null&&(qi=[]),e=$f(qi,e,i),i=Ut,(en===null?i.memoizedState:en.next)===null&&(i=i.alternate,H.H=i===null||i.memoizedState===null?wm:qr),e}function yc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Zu(e);if(e.$$typeof===j)return xn(e)}throw Error(l(438,String(e)))}function hh(e){var i=null,u=Ut.updateQueue;if(u!==null&&(i=u.memoCache),i==null){var f=Ut.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(g){return g.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),u===null&&(u=Ku(),Ut.updateQueue=u),u.memoCache=i,u=i.data[i.index],u===void 0)for(u=i.data[i.index]=Array(e),f=0;f<e;f++)u[f]=$;return i.index++,u}function vl(e,i){return typeof i=="function"?i(e):i}function gc(e){var i=Qe();return dh(i,Se,e)}function dh(e,i,u){var f=e.queue;if(f===null)throw Error(l(311));f.lastRenderedReducer=u;var g=e.baseQueue,b=f.pending;if(b!==null){if(g!==null){var A=g.next;g.next=b.next,b.next=A}i.baseQueue=g=b,f.pending=null}if(b=e.baseState,g===null)e.memoizedState=b;else{i=g.next;var O=A=null,V=null,at=i,ft=!1;do{var yt=at.lane&-536870913;if(yt!==at.lane?($t&yt)===yt:(sa&yt)===yt){var lt=at.revertLane;if(lt===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null}),yt===pl&&(ft=!0);else if((sa&lt)===lt){at=at.next,lt===pl&&(ft=!0);continue}else yt={lane:0,revertLane:at.revertLane,gesture:null,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null},V===null?(O=V=yt,A=b):V=V.next=yt,Ut.lanes|=lt,Na|=lt;yt=at.action,Qs&&u(b,yt),b=at.hasEagerState?at.eagerState:u(b,yt)}else lt={lane:yt,revertLane:at.revertLane,gesture:at.gesture,action:at.action,hasEagerState:at.hasEagerState,eagerState:at.eagerState,next:null},V===null?(O=V=lt,A=b):V=V.next=lt,Ut.lanes|=yt,Na|=yt;at=at.next}while(at!==null&&at!==i);if(V===null?A=b:V.next=O,!Oe(b,e.memoizedState)&&(Ne=!0,ft&&(u=fi,u!==null)))throw u;e.memoizedState=b,e.baseState=A,e.baseQueue=V,f.lastRenderedState=b}return g===null&&(f.lanes=0),[e.memoizedState,f.dispatch]}function vc(e){var i=Qe(),u=i.queue;if(u===null)throw Error(l(311));u.lastRenderedReducer=e;var f=u.dispatch,g=u.pending,b=i.memoizedState;if(g!==null){u.pending=null;var A=g=g.next;do b=e(b,A.action),A=A.next;while(A!==g);Oe(b,i.memoizedState)||(Ne=!0),i.memoizedState=b,i.baseQueue===null&&(i.baseState=b),u.lastRenderedState=b}return[b,f]}function mh(e,i,u){var f=Ut,g=Qe(),b=te;if(b){if(u===void 0)throw Error(l(407));u=u()}else u=i();var A=!Oe((Se||g).memoizedState,u);if(A&&(g.memoizedState=u,Ne=!0),g=g.queue,xh(yh.bind(null,f,g,e),[e]),g.getSnapshot!==i||A||en!==null&&en.memoizedState.tag&1){if(f.flags|=2048,Gr(9,{destroy:void 0},ph.bind(null,f,g,u,i),null),pe===null)throw Error(l(349));b||(sa&127)!==0||dm(f,i,u)}return u}function dm(e,i,u){e.flags|=16384,e={getSnapshot:i,value:u},i=Ut.updateQueue,i===null?(i=Ku(),Ut.updateQueue=i,i.stores=[e]):(u=i.stores,u===null?i.stores=[e]:u.push(e))}function ph(e,i,u,f){i.value=u,i.getSnapshot=f,gh(i)&&xc(e)}function yh(e,i,u){return u(function(){gh(i)&&xc(e)})}function gh(e){var i=e.getSnapshot;e=e.value;try{var u=i();return!Oe(e,u)}catch{return!0}}function xc(e){var i=Il(e,2);i!==null&&r(i,e,2)}function Fu(e){var i=Fn();if(typeof e=="function"){var u=e;if(e=u(),Qs){ka(!0);try{u()}finally{ka(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:e},i}function mm(e,i,u,f){return e.baseState=u,dh(e,Se,typeof f=="function"?f:vl)}function ny(e,i,u,f,g){if(xl(e))throw Error(l(485));if(e=i.action,e!==null){var b={payload:g,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){b.listeners.push(A)}};H.T!==null?u(!0):b.isTransition=!1,f(b),u=i.pending,u===null?(b.next=i.pending=b,pm(i,b)):(b.next=u.next,i.pending=u.next=b)}}function pm(e,i){var u=i.action,f=i.payload,g=e.state;if(i.isTransition){var b=H.T,A={};H.T=A;try{var O=u(g,f),V=H.S;V!==null&&V(A,O),ym(e,i,O)}catch(at){bc(e,i,at)}finally{b!==null&&A.types!==null&&(b.types=A.types),H.T=b}}else try{b=u(g,f),ym(e,i,b)}catch(at){bc(e,i,at)}}function ym(e,i,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(f){vh(e,i,f)},function(f){return bc(e,i,f)}):vh(e,i,u)}function vh(e,i,u){i.status="fulfilled",i.value=u,gm(i),e.state=u,i=e.pending,i!==null&&(u=i.next,u===i?e.pending=null:(u=u.next,i.next=u,pm(e,u)))}function bc(e,i,u){var f=e.pending;if(e.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=u,gm(i),i=i.next;while(i!==f)}e.action=null}function gm(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function vm(e,i){return i}function xm(e,i){if(te){var u=pe.formState;if(u!==null){t:{var f=Ut;if(te){if(Ce){e:{for(var g=Ce,b=vn;g.nodeType!==8;){if(!b){g=null;break e}if(g=Ki(g.nextSibling),g===null){g=null;break e}}b=g.data,g=b==="F!"||b==="F"?g:null}if(g){Ce=Ki(g.nextSibling),f=g.data==="F!";break t}}It(f)}f=!1}f&&(i=u[0])}}return u=Fn(),u.memoizedState=u.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vm,lastRenderedState:i},u.queue=f,u=zm.bind(null,Ut,f),f.dispatch=u,f=Fu(!1),b=Wu.bind(null,Ut,!1,f.queue),f=Fn(),g={state:i,dispatch:null,action:e,pending:null},f.queue=g,u=ny.bind(null,Ut,g,b,u),g.dispatch=u,f.memoizedState=e,[i,u,!1]}function bm(e){var i=Qe();return Sm(i,Se,e)}function Sm(e,i,u){if(i=dh(e,i,vm)[0],e=gc(vl)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Zu(i)}catch(A){throw A===as?hi:A}else f=i;i=Qe();var g=i.queue,b=g.dispatch;return u!==i.memoizedState&&(Ut.flags|=2048,Gr(9,{destroy:void 0},ay.bind(null,g,u),null)),[f,b,e]}function ay(e,i){e.action=i}function _m(e){var i=Qe(),u=Se;if(u!==null)return Sm(i,u,e);Qe(),i=i.memoizedState,u=Qe();var f=u.queue.dispatch;return u.memoizedState=e,[i,f,!1]}function Gr(e,i,u,f){return e={tag:e,create:u,deps:f,inst:i,next:null},i=Ut.updateQueue,i===null&&(i=Ku(),Ut.updateQueue=i),u=i.lastEffect,u===null?i.lastEffect=e.next=e:(f=u.next,u.next=e,e.next=f,i.lastEffect=e),e}function Tm(){return Qe().memoizedState}function Sc(e,i,u,f){var g=Fn();Ut.flags|=e,g.memoizedState=Gr(1|i,{destroy:void 0},u,f===void 0?null:f)}function _c(e,i,u,f){var g=Qe();f=f===void 0?null:f;var b=g.memoizedState.inst;Se!==null&&f!==null&&rh(f,Se.memoizedState.deps)?g.memoizedState=Gr(i,b,u,f):(Ut.flags|=e,g.memoizedState=Gr(1|i,b,u,f))}function Em(e,i){Sc(8390656,8,e,i)}function xh(e,i){_c(2048,8,e,i)}function Cm(e){Ut.flags|=4;var i=Ut.updateQueue;if(i===null)i=Ku(),Ut.updateQueue=i,i.events=[e];else{var u=i.events;u===null?i.events=[e]:u.push(e)}}function Am(e){var i=Qe().memoizedState;return Cm({ref:i,nextImpl:e}),function(){if((ne&2)!==0)throw Error(l(440));return i.impl.apply(void 0,arguments)}}function Mm(e,i){return _c(4,2,e,i)}function Ca(e,i){return _c(4,4,e,i)}function bh(e,i){if(typeof i=="function"){e=e();var u=i(e);return function(){typeof u=="function"?u():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Tc(e,i,u){u=u!=null?u.concat([e]):null,_c(4,4,bh.bind(null,i,e),u)}function Ec(){}function Sh(e,i){var u=Qe();i=i===void 0?null:i;var f=u.memoizedState;return i!==null&&rh(i,f[1])?f[0]:(u.memoizedState=[e,i],e)}function _h(e,i){var u=Qe();i=i===void 0?null:i;var f=u.memoizedState;if(i!==null&&rh(i,f[1]))return f[0];if(f=e(),Qs){ka(!0);try{e()}finally{ka(!1)}}return u.memoizedState=[f,i],f}function Th(e,i,u){return u===void 0||(sa&1073741824)!==0&&($t&261930)===0?e.memoizedState=i:(e.memoizedState=u,e=s(),Ut.lanes|=e,Na|=e,u)}function Eh(e,i,u,f){return Oe(u,i)?u:Ta.current!==null?(e=Th(e,u,f),Oe(e,i)||(Ne=!0),e):(sa&42)===0||(sa&1073741824)!==0&&($t&261930)===0?(Ne=!0,e.memoizedState=u):(e=s(),Ut.lanes|=e,Na|=e,i)}function Ch(e,i,u,f,g){var b=Q.p;Q.p=b!==0&&8>b?b:8;var A=H.T,O={};H.T=O,Wu(e,!1,i,u);try{var V=g(),at=H.S;if(at!==null&&at(O,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ft=If(V,f);Yr(e,i,ft,Jn(e))}else Yr(e,i,f,Jn(e))}catch(yt){Yr(e,i,{then:function(){},status:"rejected",reason:yt},Jn())}finally{Q.p=b,A!==null&&O.types!==null&&(A.types=O.types),H.T=A}}function iy(){}function Ah(e,i,u,f){if(e.tag!==5)throw Error(l(476));var g=Rm(e).queue;Ch(e,g,i,ot,u===null?iy:function(){return Mh(e),u(f)})}function Rm(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:ot,baseState:ot,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:ot},next:null};var u={};return i.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vl,lastRenderedState:u},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Mh(e){var i=Rm(e);i.next===null&&(i=e.alternate.memoizedState),Yr(e,i.next.queue,{},Jn())}function Rh(){return xn(Lh)}function Cn(){return Qe().memoizedState}function zh(){return Qe().memoizedState}function ly(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var u=Jn();e=Hi(u);var f=yl(i,e,u);f!==null&&(r(f,i,u),rs(f,i,u)),i={cache:Wf()},e.payload=i;return}i=i.return}}function sy(e,i,u){var f=Jn();u={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},xl(e)?Ks(i,u):(u=Dr(e,i,u,f),u!==null&&(r(u,e,f),ra(u,i,f)))}function zm(e,i,u){var f=Jn();Yr(e,i,u,f)}function Yr(e,i,u,f){var g={lane:f,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(xl(e))Ks(i,g);else{var b=e.alternate;if(e.lanes===0&&(b===null||b.lanes===0)&&(b=i.lastRenderedReducer,b!==null))try{var A=i.lastRenderedState,O=b(A,u);if(g.hasEagerState=!0,g.eagerState=O,Oe(O,A))return Bu(e,i,g,0),pe===null&&Pl(),!1}catch{}finally{}if(u=Dr(e,i,g,f),u!==null)return r(u,e,f),ra(u,i,f),!0}return!1}function Wu(e,i,u,f){if(f={lane:2,revertLane:cy(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},xl(e)){if(i)throw Error(l(479))}else i=Dr(e,u,f,2),i!==null&&r(i,e,2)}function xl(e){var i=e.alternate;return e===Ut||i!==null&&i===Ut}function Ks(e,i){Yi=mc=!0;var u=e.pending;u===null?i.next=i:(i.next=u.next,u.next=i),e.pending=i}function ra(e,i,u){if((u&4194048)!==0){var f=i.lanes;f&=e.pendingLanes,u|=f,i.lanes=u,zo(e,u)}}var Ju={readContext:xn,use:yc,useCallback:Ye,useContext:Ye,useEffect:Ye,useImperativeHandle:Ye,useLayoutEffect:Ye,useInsertionEffect:Ye,useMemo:Ye,useReducer:Ye,useRef:Ye,useState:Ye,useDebugValue:Ye,useDeferredValue:Ye,useTransition:Ye,useSyncExternalStore:Ye,useId:Ye,useHostTransitionStatus:Ye,useFormState:Ye,useActionState:Ye,useOptimistic:Ye,useMemoCache:Ye,useCacheRefresh:Ye};Ju.useEffectEvent=Ye;var wm={readContext:xn,use:yc,useCallback:function(e,i){return Fn().memoizedState=[e,i===void 0?null:i],e},useContext:xn,useEffect:Em,useImperativeHandle:function(e,i,u){u=u!=null?u.concat([e]):null,Sc(4194308,4,bh.bind(null,i,e),u)},useLayoutEffect:function(e,i){return Sc(4194308,4,e,i)},useInsertionEffect:function(e,i){Sc(4,2,e,i)},useMemo:function(e,i){var u=Fn();i=i===void 0?null:i;var f=e();if(Qs){ka(!0);try{e()}finally{ka(!1)}}return u.memoizedState=[f,i],f},useReducer:function(e,i,u){var f=Fn();if(u!==void 0){var g=u(i);if(Qs){ka(!0);try{u(i)}finally{ka(!1)}}}else g=i;return f.memoizedState=f.baseState=g,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:g},f.queue=e,e=e.dispatch=sy.bind(null,Ut,e),[f.memoizedState,e]},useRef:function(e){var i=Fn();return e={current:e},i.memoizedState=e},useState:function(e){e=Fu(e);var i=e.queue,u=zm.bind(null,Ut,i);return i.dispatch=u,[e.memoizedState,u]},useDebugValue:Ec,useDeferredValue:function(e,i){var u=Fn();return Th(u,e,i)},useTransition:function(){var e=Fu(!1);return e=Ch.bind(null,Ut,e.queue,!0,!1),Fn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,u){var f=Ut,g=Fn();if(te){if(u===void 0)throw Error(l(407));u=u()}else{if(u=i(),pe===null)throw Error(l(349));($t&127)!==0||dm(f,i,u)}g.memoizedState=u;var b={value:u,getSnapshot:i};return g.queue=b,Em(yh.bind(null,f,b,e),[e]),f.flags|=2048,Gr(9,{destroy:void 0},ph.bind(null,f,b,u,i),null),u},useId:function(){var e=Fn(),i=pe.identifierPrefix;if(te){var u=ji,f=Bi;u=(f&~(1<<32-Vn(f)-1)).toString(32)+u,i="_"+i+"R_"+u,u=pc++,0<u&&(i+="H"+u.toString(32)),i+="_"}else u=ty++,i="_"+i+"r_"+u.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Rh,useFormState:xm,useActionState:xm,useOptimistic:function(e){var i=Fn();i.memoizedState=i.baseState=e;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=u,i=Wu.bind(null,Ut,!0,u),u.dispatch=i,[e,i]},useMemoCache:hh,useCacheRefresh:function(){return Fn().memoizedState=ly.bind(null,Ut)},useEffectEvent:function(e){var i=Fn(),u={impl:e};return i.memoizedState=u,function(){if((ne&2)!==0)throw Error(l(440));return u.impl.apply(void 0,arguments)}}},qr={readContext:xn,use:yc,useCallback:Sh,useContext:xn,useEffect:xh,useImperativeHandle:Tc,useInsertionEffect:Mm,useLayoutEffect:Ca,useMemo:_h,useReducer:gc,useRef:Tm,useState:function(){return gc(vl)},useDebugValue:Ec,useDeferredValue:function(e,i){var u=Qe();return Eh(u,Se.memoizedState,e,i)},useTransition:function(){var e=gc(vl)[0],i=Qe().memoizedState;return[typeof e=="boolean"?e:Zu(e),i]},useSyncExternalStore:mh,useId:Cn,useHostTransitionStatus:Rh,useFormState:bm,useActionState:bm,useOptimistic:function(e,i){var u=Qe();return mm(u,Se,e,i)},useMemoCache:hh,useCacheRefresh:zh};qr.useEffectEvent=Am;var Pu={readContext:xn,use:yc,useCallback:Sh,useContext:xn,useEffect:xh,useImperativeHandle:Tc,useInsertionEffect:Mm,useLayoutEffect:Ca,useMemo:_h,useReducer:vc,useRef:Tm,useState:function(){return vc(vl)},useDebugValue:Ec,useDeferredValue:function(e,i){var u=Qe();return Se===null?Th(u,e,i):Eh(u,Se.memoizedState,e,i)},useTransition:function(){var e=vc(vl)[0],i=Qe().memoizedState;return[typeof e=="boolean"?e:Zu(e),i]},useSyncExternalStore:mh,useId:Cn,useHostTransitionStatus:Rh,useFormState:_m,useActionState:_m,useOptimistic:function(e,i){var u=Qe();return Se!==null?mm(u,Se,e,i):(u.baseState=e,[e,u.queue.dispatch])},useMemoCache:hh,useCacheRefresh:zh};Pu.useEffectEvent=Am;function Lr(e,i,u,f){i=e.memoizedState,u=u(f,i),u=u==null?i:_({},i,u),e.memoizedState=u,e.lanes===0&&(e.updateQueue.baseState=u)}var Iu={enqueueSetState:function(e,i,u){e=e._reactInternals;var f=Jn(),g=Hi(f);g.payload=i,u!=null&&(g.callback=u),i=yl(e,g,f),i!==null&&(r(i,e,f),rs(i,e,f))},enqueueReplaceState:function(e,i,u){e=e._reactInternals;var f=Jn(),g=Hi(f);g.tag=1,g.payload=i,u!=null&&(g.callback=u),i=yl(e,g,f),i!==null&&(r(i,e,f),rs(i,e,f))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var u=Jn(),f=Hi(u);f.tag=2,i!=null&&(f.callback=i),i=yl(e,f,u),i!==null&&(r(i,e,u),rs(i,e,u))}};function Dm(e,i,u,f,g,b,A){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(f,b,A):i.prototype&&i.prototype.isPureReactComponent?!Cr(u,f)||!Cr(g,b):!0}function Om(e,i,u,f){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(u,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(u,f),i.state!==e&&Iu.enqueueReplaceState(i,i.state,null)}function An(e,i){var u=i;if("ref"in i){u={};for(var f in i)f!=="ref"&&(u[f]=i[f])}if(e=e.defaultProps){u===i&&(u=_({},u));for(var g in e)u[g]===void 0&&(u[g]=e[g])}return u}function wh(e){Jl(e)}function Nm(e){console.error(e)}function Cc(e){Jl(e)}function Ac(e,i){try{var u=e.onUncaughtError;u(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function Bm(e,i,u){try{var f=e.onCaughtError;f(u.value,{componentStack:u.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Dh(e,i,u){return u=Hi(u),u.tag=3,u.payload={element:null},u.callback=function(){Ac(e,i)},u}function Xr(e){return e=Hi(e),e.tag=3,e}function ua(e,i,u,f){var g=u.type.getDerivedStateFromError;if(typeof g=="function"){var b=f.value;e.payload=function(){return g(b)},e.callback=function(){Bm(i,u,f)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(e.callback=function(){Bm(i,u,f),typeof g!="function"&&(Qi===null?Qi=new Set([this]):Qi.add(this));var O=f.stack;this.componentDidCatch(f.value,{componentStack:O!==null?O:""})})}function Aa(e,i,u,f,g){if(u.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=u.alternate,i!==null&&es(i,u,g,!0),u=fn.current,u!==null){switch(u.tag){case 31:case 13:return Ka===null?qt():u.alternate===null&&ye===0&&(ye=3),u.flags&=-257,u.flags|=65536,u.lanes=g,f===Lu?u.flags|=16384:(i=u.updateQueue,i===null?u.updateQueue=new Set([f]):i.add(f),ry(e,f,g)),!1;case 22:return u.flags|=65536,f===Lu?u.flags|=16384:(i=u.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},u.updateQueue=i):(u=i.retryQueue,u===null?i.retryQueue=new Set([f]):u.add(f)),ry(e,f,g)),!1}throw Error(l(435,u.tag))}return ry(e,f,g),qt(),!1}if(te)return i=fn.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=g,f!==sc&&(e=Error(l(422),{cause:f}),Gu(ia(e,u)))):(f!==sc&&(i=Error(l(423),{cause:f}),Gu(ia(i,u))),e=e.current.alternate,e.flags|=65536,g&=-g,e.lanes|=g,f=ia(f,u),g=Dh(e.stateNode,f,g),hc(e,g),ye!==4&&(ye=2)),!1;var b=Error(l(520),{cause:f});if(b=ia(b,u),gi===null?gi=[b]:gi.push(b),ye!==4&&(ye=2),i===null)return!0;f=ia(f,u),u=i;do{switch(u.tag){case 3:return u.flags|=65536,e=g&-g,u.lanes|=e,e=Dh(u.stateNode,f,e),hc(u,e),!1;case 1:if(i=u.type,b=u.stateNode,(u.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||b!==null&&typeof b.componentDidCatch=="function"&&(Qi===null||!Qi.has(b))))return u.flags|=65536,g&=-g,u.lanes|=g,g=Xr(g),ua(g,e,u,f),hc(u,g),!1}u=u.return}while(u!==null);return!1}var Mc=Error(l(461)),Ne=!1;function qe(e,i,u,f){i.child=e===null?om(i,null,u,f):Vs(i,e.child,u,f)}function $u(e,i,u,f,g){u=u.render;var b=i.ref;if("ref"in f){var A={};for(var O in f)O!=="ref"&&(A[O]=f[O])}else A=f;return qs(i),f=uh(e,i,u,A,b,g),O=oh(),e!==null&&!Ne?(ch(e,i,g),pi(e,i,g)):(te&&O&&lc(i),i.flags|=1,qe(e,i,f,g),i.child)}function to(e,i,u,f,g){if(e===null){var b=u.type;return typeof b=="function"&&!Kn(b)&&b.defaultProps===void 0&&u.compare===null?(i.tag=15,i.type=b,Ma(e,i,b,f,g)):(e=ju(u.type,null,f,i,i.mode,g),e.ref=i.ref,e.return=i,i.child=e)}if(b=e.child,!cs(e,g)){var A=b.memoizedProps;if(u=u.compare,u=u!==null?u:Cr,u(A,f)&&e.ref===i.ref)return pi(e,i,g)}return i.flags|=1,e=Oi(b,f),e.ref=i.ref,e.return=i,i.child=e}function Ma(e,i,u,f,g){if(e!==null){var b=e.memoizedProps;if(Cr(b,f)&&e.ref===i.ref)if(Ne=!1,i.pendingProps=f=b,cs(e,g))(e.flags&131072)!==0&&(Ne=!0);else return i.lanes=e.lanes,pi(e,i,g)}return Vr(e,i,u,f,g)}function Ra(e,i,u,f){var g=f.children,b=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if((i.flags&128)!==0){if(b=b!==null?b.baseLanes|u:u,e!==null){for(f=i.child=e.child,g=0;f!==null;)g=g|f.lanes|f.childLanes,f=f.sibling;f=g&~b}else f=0,i.child=null;return Li(e,i,b,u,f)}if((u&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ur(i,b!==null?b.cachePool:null),b!==null?ih(i,b):lh(),cm(i);else return f=i.lanes=536870912,Li(e,i,b!==null?b.baseLanes|u:u,u,f)}else b!==null?(Ur(i,b.cachePool),ih(i,b),gl(),i.memoizedState=null):(e!==null&&Ur(i,null),lh(),gl());return qe(e,i,g,u),i.child}function di(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function Li(e,i,u,f,g){var b=Ui();return b=b===null?null:{parent:zt._currentValue,pool:b},i.memoizedState={baseLanes:u,cachePool:b},e!==null&&Ur(i,null),lh(),cm(i),e!==null&&es(e,i,f,!0),i.childLanes=g,null}function Za(e,i){return i=kr({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function bn(e,i,u){return Vs(i,e.child,null,u),e=Za(i,i.pendingProps),e.flags|=2,Ea(i),i.memoizedState=null,e}function eo(e,i,u){var f=i.pendingProps,g=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(te){if(f.mode==="hidden")return e=Za(i,f),i.lanes=536870912,di(null,e);if(sh(i),(e=Ce)?(e=Pg(e,vn),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ni!==null?{id:Bi,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},u=am(e),u.return=i,i.child=u,gn=i,Ce=null)):e=null,e===null)throw It(i);return i.lanes=536870912,null}return Za(i,f)}var b=e.memoizedState;if(b!==null){var A=b.dehydrated;if(sh(i),g)if(i.flags&256)i.flags&=-257,i=bn(e,i,u);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(l(558));else if(Ne||es(e,i,u,!1),g=(u&e.childLanes)!==0,Ne||g){if(f=pe,f!==null&&(A=wo(f,u),A!==0&&A!==b.retryLane))throw b.retryLane=A,Il(e,A),r(f,e,A),Mc;qt(),i=bn(e,i,u)}else e=b.treeContext,Ce=Ki(A.nextSibling),gn=i,te=!0,fl=null,vn=!1,e!==null&&Hu(i,e),i=Za(i,f),i.flags|=4096;return i}return e=Oi(e.child,{mode:f.mode,children:f.children}),e.ref=i.ref,i.child=e,e.return=i,e}function mi(e,i){var u=i.ref;if(u===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(l(284));(e===null||e.ref!==u)&&(i.flags|=4194816)}}function Vr(e,i,u,f,g){return qs(i),u=uh(e,i,u,f,void 0,g),f=oh(),e!==null&&!Ne?(ch(e,i,g),pi(e,i,g)):(te&&f&&lc(i),i.flags|=1,qe(e,i,u,g),i.child)}function Un(e,i,u,f,g,b){return qs(i),i.updateQueue=null,u=hm(i,f,u,g),fm(e),f=oh(),e!==null&&!Ne?(ch(e,i,b),pi(e,i,b)):(te&&f&&lc(i),i.flags|=1,qe(e,i,u,b),i.child)}function Mn(e,i,u,f,g){if(qs(i),i.stateNode===null){var b=$l,A=u.contextType;typeof A=="object"&&A!==null&&(b=xn(A)),b=new u(f,b),i.memoizedState=b.state!==null&&b.state!==void 0?b.state:null,b.updater=Iu,i.stateNode=b,b._reactInternals=i,b=i.stateNode,b.props=f,b.state=i.memoizedState,b.refs={},eh(i),A=u.contextType,b.context=typeof A=="object"&&A!==null?xn(A):$l,b.state=i.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(Lr(i,u,A,f),b.state=i.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof b.getSnapshotBeforeUpdate=="function"||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(A=b.state,typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount(),A!==b.state&&Iu.enqueueReplaceState(b,b.state,null),ks(i,f,b,g),ku(),b.state=i.memoizedState),typeof b.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(e===null){b=i.stateNode;var O=i.memoizedProps,V=An(u,O);b.props=V;var at=b.context,ft=u.contextType;A=$l,typeof ft=="object"&&ft!==null&&(A=xn(ft));var yt=u.getDerivedStateFromProps;ft=typeof yt=="function"||typeof b.getSnapshotBeforeUpdate=="function",O=i.pendingProps!==O,ft||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(O||at!==A)&&Om(i,b,f,A),ss=!1;var lt=i.memoizedState;b.state=lt,ks(i,f,b,g),ku(),at=i.memoizedState,O||lt!==at||ss?(typeof yt=="function"&&(Lr(i,u,yt,f),at=i.memoizedState),(V=ss||Dm(i,u,V,f,lt,at,A))?(ft||typeof b.UNSAFE_componentWillMount!="function"&&typeof b.componentWillMount!="function"||(typeof b.componentWillMount=="function"&&b.componentWillMount(),typeof b.UNSAFE_componentWillMount=="function"&&b.UNSAFE_componentWillMount()),typeof b.componentDidMount=="function"&&(i.flags|=4194308)):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=at),b.props=f,b.state=at,b.context=A,f=V):(typeof b.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{b=i.stateNode,nh(e,i),A=i.memoizedProps,ft=An(u,A),b.props=ft,yt=i.pendingProps,lt=b.context,at=u.contextType,V=$l,typeof at=="object"&&at!==null&&(V=xn(at)),O=u.getDerivedStateFromProps,(at=typeof O=="function"||typeof b.getSnapshotBeforeUpdate=="function")||typeof b.UNSAFE_componentWillReceiveProps!="function"&&typeof b.componentWillReceiveProps!="function"||(A!==yt||lt!==V)&&Om(i,b,f,V),ss=!1,lt=i.memoizedState,b.state=lt,ks(i,f,b,g),ku();var ut=i.memoizedState;A!==yt||lt!==ut||ss||e!==null&&e.dependencies!==null&&Br(e.dependencies)?(typeof O=="function"&&(Lr(i,u,O,f),ut=i.memoizedState),(ft=ss||Dm(i,u,ft,f,lt,ut,V)||e!==null&&e.dependencies!==null&&Br(e.dependencies))?(at||typeof b.UNSAFE_componentWillUpdate!="function"&&typeof b.componentWillUpdate!="function"||(typeof b.componentWillUpdate=="function"&&b.componentWillUpdate(f,ut,V),typeof b.UNSAFE_componentWillUpdate=="function"&&b.UNSAFE_componentWillUpdate(f,ut,V)),typeof b.componentDidUpdate=="function"&&(i.flags|=4),typeof b.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof b.componentDidUpdate!="function"||A===e.memoizedProps&&lt===e.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&lt===e.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=ut),b.props=f,b.state=ut,b.context=V,f=ft):(typeof b.componentDidUpdate!="function"||A===e.memoizedProps&&lt===e.memoizedState||(i.flags|=4),typeof b.getSnapshotBeforeUpdate!="function"||A===e.memoizedProps&&lt===e.memoizedState||(i.flags|=1024),f=!1)}return b=f,mi(e,i),f=(i.flags&128)!==0,b||f?(b=i.stateNode,u=f&&typeof u.getDerivedStateFromError!="function"?null:b.render(),i.flags|=1,e!==null&&f?(i.child=Vs(i,e.child,null,g),i.child=Vs(i,null,u,g)):qe(e,i,u,g),i.memoizedState=b.state,e=i.child):e=pi(e,i,g),e}function se(e,i,u,f){return Ys(),i.flags|=256,qe(e,i,u,f),i.child}var za={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Fa(e){return{baseLanes:e,cachePool:oc()}}function no(e,i,u){return e=e!==null?e.childLanes&~u:0,i&&(e|=ae),e}function wa(e,i,u){var f=i.pendingProps,g=!1,b=(i.flags&128)!==0,A;if((A=b)||(A=e!==null&&e.memoizedState===null?!1:(Ge.current&2)!==0),A&&(g=!0,i.flags&=-129),A=(i.flags&32)!==0,i.flags&=-33,e===null){if(te){if(g?us(i):gl(),(e=Ce)?(e=Pg(e,vn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ni!==null?{id:Bi,overflow:ji}:null,retryLane:536870912,hydrationErrors:null},u=am(e),u.return=i,i.child=u,gn=i,Ce=null)):e=null,e===null)throw It(i);return Ty(e)?i.lanes=32:i.lanes=536870912,null}var O=f.children;return f=f.fallback,g?(gl(),g=i.mode,O=kr({mode:"hidden",children:O},g),f=ol(f,g,u,null),O.return=i,f.return=i,O.sibling=f,i.child=O,f=i.child,f.memoizedState=Fa(u),f.childLanes=no(e,A,u),i.memoizedState=za,di(null,f)):(us(i),os(i,O))}var V=e.memoizedState;if(V!==null&&(O=V.dehydrated,O!==null)){if(b)i.flags&256?(us(i),i.flags&=-257,i=Qr(e,i,u)):i.memoizedState!==null?(gl(),i.child=e.child,i.flags|=128,i=null):(gl(),O=f.fallback,g=i.mode,f=kr({mode:"visible",children:f.children},g),O=ol(O,g,u,null),O.flags|=2,f.return=i,O.return=i,f.sibling=O,i.child=f,Vs(i,e.child,null,u),f=i.child,f.memoizedState=Fa(u),f.childLanes=no(e,A,u),i.memoizedState=za,i=di(null,f));else if(us(i),Ty(O)){if(A=O.nextSibling&&O.nextSibling.dataset,A)var at=A.dgst;A=at,f=Error(l(419)),f.stack="",f.digest=A,Gu({value:f,source:null,stack:null}),i=Qr(e,i,u)}else if(Ne||es(e,i,u,!1),A=(u&e.childLanes)!==0,Ne||A){if(A=pe,A!==null&&(f=wo(A,u),f!==0&&f!==V.retryLane))throw V.retryLane=f,Il(e,f),r(A,e,f),Mc;_y(O)||qt(),i=Qr(e,i,u)}else _y(O)?(i.flags|=192,i.child=e.child,i=null):(e=V.treeContext,Ce=Ki(O.nextSibling),gn=i,te=!0,fl=null,vn=!1,e!==null&&Hu(i,e),i=os(i,f.children),i.flags|=4096);return i}return g?(gl(),O=f.fallback,g=i.mode,V=e.child,at=V.sibling,f=Oi(V,{mode:"hidden",children:f.children}),f.subtreeFlags=V.subtreeFlags&65011712,at!==null?O=Oi(at,O):(O=ol(O,g,u,null),O.flags|=2),O.return=i,f.return=i,f.sibling=O,i.child=f,di(null,f),f=i.child,O=e.child.memoizedState,O===null?O=Fa(u):(g=O.cachePool,g!==null?(V=zt._currentValue,g=g.parent!==V?{parent:V,pool:V}:g):g=oc(),O={baseLanes:O.baseLanes|u,cachePool:g}),f.memoizedState=O,f.childLanes=no(e,A,u),i.memoizedState=za,di(e.child,f)):(us(i),u=e.child,e=u.sibling,u=Oi(u,{mode:"visible",children:f.children}),u.return=i,u.sibling=null,e!==null&&(A=i.deletions,A===null?(i.deletions=[e],i.flags|=16):A.push(e)),i.child=u,i.memoizedState=null,u)}function os(e,i){return i=kr({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function kr(e,i){return e=Qn(22,e,null,i),e.lanes=0,e}function Qr(e,i,u){return Vs(i,e.child,null,u),e=os(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function Zs(e,i,u){e.lanes|=i;var f=e.alternate;f!==null&&(f.lanes|=i),ml(e.return,i,u)}function ao(e,i,u,f,g,b){var A=e.memoizedState;A===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:u,tailMode:g,treeForkCount:b}:(A.isBackwards=i,A.rendering=null,A.renderingStartTime=0,A.last=f,A.tail=u,A.tailMode=g,A.treeForkCount=b)}function io(e,i,u){var f=i.pendingProps,g=f.revealOrder,b=f.tail;f=f.children;var A=Ge.current,O=(A&2)!==0;if(O?(A=A&1|2,i.flags|=128):A&=1,tt(Ge,A),qe(e,i,f,u),f=te?Nr:0,!O&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zs(e,u,i);else if(e.tag===19)Zs(e,u,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break t;for(;e.sibling===null;){if(e.return===null||e.return===i)break t;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(g){case"forwards":for(u=i.child,g=null;u!==null;)e=u.alternate,e!==null&&dc(e)===null&&(g=u),u=u.sibling;u=g,u===null?(g=i.child,i.child=null):(g=u.sibling,u.sibling=null),ao(i,!1,g,u,b,f);break;case"backwards":case"unstable_legacy-backwards":for(u=null,g=i.child,i.child=null;g!==null;){if(e=g.alternate,e!==null&&dc(e)===null){i.child=g;break}e=g.sibling,g.sibling=u,u=g,g=e}ao(i,!0,u,null,b,f);break;case"together":ao(i,!1,null,null,void 0,f);break;default:i.memoizedState=null}return i.child}function pi(e,i,u){if(e!==null&&(i.dependencies=e.dependencies),Na|=i.lanes,(u&i.childLanes)===0)if(e!==null){if(es(e,i,u,!1),(u&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(l(153));if(i.child!==null){for(e=i.child,u=Oi(e,e.pendingProps),i.child=u,u.return=i;e.sibling!==null;)e=e.sibling,u=u.sibling=Oi(e,e.pendingProps),u.return=i;u.sibling=null}return i.child}function cs(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Br(e)))}function lo(e,i,u){switch(i.tag){case 3:fe(i,i.stateNode.containerInfo),dl(i,zt,e.memoizedState.cache),Ys();break;case 27:case 5:ga(i);break;case 4:fe(i,i.stateNode.containerInfo);break;case 10:dl(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,sh(i),null;break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(us(i),i.flags|=128,null):(u&i.child.childLanes)!==0?wa(e,i,u):(us(i),e=pi(e,i,u),e!==null?e.sibling:null);us(i);break;case 19:var g=(e.flags&128)!==0;if(f=(u&i.childLanes)!==0,f||(es(e,i,u,!1),f=(u&i.childLanes)!==0),g){if(f)return io(e,i,u);i.flags|=128}if(g=i.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),tt(Ge,Ge.current),f)break;return null;case 22:return i.lanes=0,Ra(e,i,u,i.pendingProps);case 24:dl(i,zt,e.memoizedState.cache)}return pi(e,i,u)}function Rc(e,i,u){if(e!==null)if(e.memoizedProps!==i.pendingProps)Ne=!0;else{if(!cs(e,u)&&(i.flags&128)===0)return Ne=!1,lo(e,i,u);Ne=(e.flags&131072)!==0}else Ne=!1,te&&(i.flags&1048576)!==0&&kf(i,Nr,i.index);switch(i.lanes=0,i.tag){case 16:t:{var f=i.pendingProps;if(e=Xs(i.elementType),i.type=e,typeof e=="function")Kn(e)?(f=An(e,f),i.tag=1,i=Mn(null,i,e,f,u)):(i.tag=0,i=Vr(null,i,e,f,u));else{if(e!=null){var g=e.$$typeof;if(g===G){i.tag=11,i=$u(null,i,e,f,u);break t}else if(g===Z){i.tag=14,i=to(null,i,e,f,u);break t}}throw i=dt(e)||e,Error(l(306,i,""))}}return i;case 0:return Vr(e,i,i.type,i.pendingProps,u);case 1:return f=i.type,g=An(f,i.pendingProps),Mn(e,i,f,g,u);case 3:t:{if(fe(i,i.stateNode.containerInfo),e===null)throw Error(l(387));f=i.pendingProps;var b=i.memoizedState;g=b.element,nh(e,i),ks(i,f,null,u);var A=i.memoizedState;if(f=A.cache,dl(i,zt,f),f!==b.cache&&uc(i,[zt],u,!0),ku(),f=A.element,b.isDehydrated)if(b={element:f,isDehydrated:!1,cache:A.cache},i.updateQueue.baseState=b,i.memoizedState=b,i.flags&256){i=se(e,i,f,u);break t}else if(f!==g){g=ia(Error(l(424)),i),Gu(g),i=se(e,i,f,u);break t}else{switch(e=i.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ce=Ki(e.firstChild),gn=i,te=!0,fl=null,vn=!0,u=om(i,null,f,u),i.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ys(),f===g){i=pi(e,i,u);break t}qe(e,i,f,u)}i=i.child}return i;case 26:return mi(e,i),e===null?(u=av(i.type,null,i.pendingProps,null))?i.memoizedState=u:te||(u=i.type,e=i.pendingProps,f=Xm(At.current).createElement(u),f[Pt]=i,f[wn]=e,Pn(f,u,e),tn(f),i.stateNode=f):i.memoizedState=av(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return ga(i),e===null&&te&&(f=i.stateNode=tv(i.type,i.pendingProps,At.current),gn=i,vn=!0,g=Ce,Ir(i.type)?(Ey=g,Ce=Ki(f.firstChild)):Ce=g),qe(e,i,i.pendingProps.children,u),mi(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&te&&((g=f=Ce)&&(f=m2(f,i.type,i.pendingProps,vn),f!==null?(i.stateNode=f,gn=i,Ce=Ki(f.firstChild),vn=!1,g=!0):g=!1),g||It(i)),ga(i),g=i.type,b=i.pendingProps,A=e!==null?e.memoizedProps:null,f=b.children,xy(g,b)?f=null:A!==null&&xy(g,A)&&(i.flags|=32),i.memoizedState!==null&&(g=uh(e,i,ey,null,null,u),Lh._currentValue=g),mi(e,i),qe(e,i,f,u),i.child;case 6:return e===null&&te&&((e=u=Ce)&&(u=p2(u,i.pendingProps,vn),u!==null?(i.stateNode=u,gn=i,Ce=null,e=!0):e=!1),e||It(i)),null;case 13:return wa(e,i,u);case 4:return fe(i,i.stateNode.containerInfo),f=i.pendingProps,e===null?i.child=Vs(i,null,f,u):qe(e,i,f,u),i.child;case 11:return $u(e,i,i.type,i.pendingProps,u);case 7:return qe(e,i,i.pendingProps,u),i.child;case 8:return qe(e,i,i.pendingProps.children,u),i.child;case 12:return qe(e,i,i.pendingProps.children,u),i.child;case 10:return f=i.pendingProps,dl(i,i.type,f.value),qe(e,i,f.children,u),i.child;case 9:return g=i.type._context,f=i.pendingProps.children,qs(i),g=xn(g),f=f(g),i.flags|=1,qe(e,i,f,u),i.child;case 14:return to(e,i,i.type,i.pendingProps,u);case 15:return Ma(e,i,i.type,i.pendingProps,u);case 19:return io(e,i,u);case 31:return eo(e,i,u);case 22:return Ra(e,i,u,i.pendingProps);case 24:return qs(i),f=xn(zt),e===null?(g=Ui(),g===null&&(g=pe,b=Wf(),g.pooledCache=b,b.refCount++,b!==null&&(g.pooledCacheLanes|=u),g=b),i.memoizedState={parent:f,cache:g},eh(i),dl(i,zt,g)):((e.lanes&u)!==0&&(nh(e,i),ks(i,null,null,u),ku()),g=e.memoizedState,b=i.memoizedState,g.parent!==f?(g={parent:f,cache:f},i.memoizedState=g,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=g),dl(i,zt,f)):(f=b.cache,dl(i,zt,f),f!==g.cache&&uc(i,[zt],u,!0))),qe(e,i,i.pendingProps.children,u),i.child;case 29:throw i.pendingProps}throw Error(l(156,i.tag))}function oa(e){e.flags|=4}function fs(e,i,u,f,g){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(g&335544128)===g)if(e.stateNode.complete)e.flags|=8192;else if(bt())e.flags|=8192;else throw Nt=Lu,qu}else e.flags&=-16777217}function bl(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!uv(i))if(bt())e.flags|=8192;else throw Nt=Lu,qu}function Kr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?pr():536870912,e.lanes|=i,Ba|=i)}function so(e,i){if(!te)switch(e.tailMode){case"hidden":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?e.tail=null:u.sibling=null;break;case"collapsed":u=e.tail;for(var f=null;u!==null;)u.alternate!==null&&(f=u),u=u.sibling;f===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:f.sibling=null}}function xe(e){var i=e.alternate!==null&&e.alternate.child===e.child,u=0,f=0;if(i)for(var g=e.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags&65011712,f|=g.flags&65011712,g.return=e,g=g.sibling;else for(g=e.child;g!==null;)u|=g.lanes|g.childLanes,f|=g.subtreeFlags,f|=g.flags,g.return=e,g=g.sibling;return e.subtreeFlags|=f,e.childLanes=u,i}function Oh(e,i,u){var f=i.pendingProps;switch(ts(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return xe(i),null;case 1:return xe(i),null;case 3:return u=i.stateNode,f=null,e!==null&&(f=e.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),Qa(zt),ce(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(Gs(i)?oa(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Qf())),xe(i),null;case 26:var g=i.type,b=i.memoizedState;return e===null?(oa(i),b!==null?(xe(i),bl(i,b)):(xe(i),fs(i,g,null,f,u))):b?b!==e.memoizedState?(oa(i),xe(i),bl(i,b)):(xe(i),i.flags&=-16777217):(e=e.memoizedProps,e!==f&&oa(i),xe(i),fs(i,g,e,f,u)),null;case 27:if(La(i),u=At.current,g=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==f&&oa(i);else{if(!f){if(i.stateNode===null)throw Error(l(166));return xe(i),null}e=pt.current,Gs(i)?rc(i):(e=tv(g,f,u),i.stateNode=e,oa(i))}return xe(i),null;case 5:if(La(i),g=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==f&&oa(i);else{if(!f){if(i.stateNode===null)throw Error(l(166));return xe(i),null}if(b=pt.current,Gs(i))rc(i);else{var A=Xm(At.current);switch(b){case 1:b=A.createElementNS("http://www.w3.org/2000/svg",g);break;case 2:b=A.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;default:switch(g){case"svg":b=A.createElementNS("http://www.w3.org/2000/svg",g);break;case"math":b=A.createElementNS("http://www.w3.org/1998/Math/MathML",g);break;case"script":b=A.createElement("div"),b.innerHTML="<script><\/script>",b=b.removeChild(b.firstChild);break;case"select":b=typeof f.is=="string"?A.createElement("select",{is:f.is}):A.createElement("select"),f.multiple?b.multiple=!0:f.size&&(b.size=f.size);break;default:b=typeof f.is=="string"?A.createElement(g,{is:f.is}):A.createElement(g)}}b[Pt]=i,b[wn]=f;t:for(A=i.child;A!==null;){if(A.tag===5||A.tag===6)b.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===i)break t;for(;A.sibling===null;){if(A.return===null||A.return===i)break t;A=A.return}A.sibling.return=A.return,A=A.sibling}i.stateNode=b;t:switch(Pn(b,g,f),g){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break t;case"img":f=!0;break t;default:f=!1}f&&oa(i)}}return xe(i),fs(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,u),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==f&&oa(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(l(166));if(e=At.current,Gs(i)){if(e=i.stateNode,u=i.memoizedProps,f=null,g=gn,g!==null)switch(g.tag){case 27:case 5:f=g.memoizedProps}e[Pt]=i,e=!!(e.nodeValue===u||f!==null&&f.suppressHydrationWarning===!0||Vg(e.nodeValue,u)),e||It(i,!0)}else e=Xm(e).createTextNode(f),e[Pt]=i,i.stateNode=e}return xe(i),null;case 31:if(u=i.memoizedState,e===null||e.memoizedState!==null){if(f=Gs(i),u!==null){if(e===null){if(!f)throw Error(l(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[Pt]=i}else Ys(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;xe(i),e=!1}else u=Qf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),e=!0;if(!e)return i.flags&256?(Ea(i),i):(Ea(i),null);if((i.flags&128)!==0)throw Error(l(558))}return xe(i),null;case 13:if(f=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(g=Gs(i),f!==null&&f.dehydrated!==null){if(e===null){if(!g)throw Error(l(318));if(g=i.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error(l(317));g[Pt]=i}else Ys(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;xe(i),g=!1}else g=Qf(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=g),g=!0;if(!g)return i.flags&256?(Ea(i),i):(Ea(i),null)}return Ea(i),(i.flags&128)!==0?(i.lanes=u,i):(u=f!==null,e=e!==null&&e.memoizedState!==null,u&&(f=i.child,g=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(g=f.alternate.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==g&&(f.flags|=2048)),u!==e&&u&&(i.child.flags|=8192),Kr(i,i.updateQueue),xe(i),null);case 4:return ce(),e===null&&my(i.stateNode.containerInfo),xe(i),null;case 10:return Qa(i.type),xe(i),null;case 19:if(F(Ge),f=i.memoizedState,f===null)return xe(i),null;if(g=(i.flags&128)!==0,b=f.rendering,b===null)if(g)so(f,!1);else{if(ye!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(b=dc(e),b!==null){for(i.flags|=128,so(f,!1),e=b.updateQueue,i.updateQueue=e,Kr(i,e),i.subtreeFlags=0,e=u,u=i.child;u!==null;)Nn(u,e),u=u.sibling;return tt(Ge,Ge.current&1|2),te&&cl(i,f.treeForkCount),i.child}e=e.sibling}f.tail!==null&&na()>ja&&(i.flags|=128,g=!0,so(f,!1),i.lanes=4194304)}else{if(!g)if(e=dc(b),e!==null){if(i.flags|=128,g=!0,e=e.updateQueue,i.updateQueue=e,Kr(i,e),so(f,!0),f.tail===null&&f.tailMode==="hidden"&&!b.alternate&&!te)return xe(i),null}else 2*na()-f.renderingStartTime>ja&&u!==536870912&&(i.flags|=128,g=!0,so(f,!1),i.lanes=4194304);f.isBackwards?(b.sibling=i.child,i.child=b):(e=f.last,e!==null?e.sibling=b:i.child=b,f.last=b)}return f.tail!==null?(e=f.tail,f.rendering=e,f.tail=e.sibling,f.renderingStartTime=na(),e.sibling=null,u=Ge.current,tt(Ge,g?u&1|2:u&1),te&&cl(i,f.treeForkCount),e):(xe(i),null);case 22:case 23:return Ea(i),jn(),f=i.memoizedState!==null,e!==null?e.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(u&536870912)!==0&&(i.flags&128)===0&&(xe(i),i.subtreeFlags&6&&(i.flags|=8192)):xe(i),u=i.updateQueue,u!==null&&Kr(i,u.retryQueue),u=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(u=e.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==u&&(i.flags|=2048),e!==null&&F(ns),null;case 24:return u=null,e!==null&&(u=e.memoizedState.cache),i.memoizedState.cache!==u&&(i.flags|=2048),Qa(zt),xe(i),null;case 25:return null;case 30:return null}throw Error(l(156,i.tag))}function zc(e,i){switch(ts(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Qa(zt),ce(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return La(i),null;case 31:if(i.memoizedState!==null){if(Ea(i),i.alternate===null)throw Error(l(340));Ys()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Ea(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(l(340));Ys()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return F(Ge),null;case 4:return ce(),null;case 10:return Qa(i.type),null;case 22:case 23:return Ea(i),jn(),e!==null&&F(ns),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Qa(zt),null;case 25:return null;default:return null}}function Fs(e,i){switch(ts(i),i.tag){case 3:Qa(zt),ce();break;case 26:case 27:case 5:La(i);break;case 4:ce();break;case 31:i.memoizedState!==null&&Ea(i);break;case 13:Ea(i);break;case 19:F(Ge);break;case 10:Qa(i.type);break;case 22:case 23:Ea(i),jn(),e!==null&&F(ns);break;case 24:Qa(zt)}}function Xi(e,i){try{var u=i.updateQueue,f=u!==null?u.lastEffect:null;if(f!==null){var g=f.next;u=g;do{if((u.tag&e)===e){f=void 0;var b=u.create,A=u.inst;f=b(),A.destroy=f}u=u.next}while(u!==g)}}catch(O){Ee(i,i.return,O)}}function Wa(e,i,u){try{var f=i.updateQueue,g=f!==null?f.lastEffect:null;if(g!==null){var b=g.next;f=b;do{if((f.tag&e)===e){var A=f.inst,O=A.destroy;if(O!==void 0){A.destroy=void 0,g=i;var V=u,at=O;try{at()}catch(ft){Ee(g,V,ft)}}}f=f.next}while(f!==b)}}catch(ft){Ee(i,i.return,ft)}}function hs(e){var i=e.updateQueue;if(i!==null){var u=e.stateNode;try{En(i,u)}catch(f){Ee(e,e.return,f)}}}function Nh(e,i,u){u.props=An(e.type,e.memoizedProps),u.state=e.memoizedState;try{u.componentWillUnmount()}catch(f){Ee(e,i,f)}}function Vi(e,i){try{var u=e.ref;if(u!==null){switch(e.tag){case 26:case 27:case 5:var f=e.stateNode;break;case 30:f=e.stateNode;break;default:f=e.stateNode}typeof u=="function"?e.refCleanup=u(f):u.current=f}}catch(g){Ee(e,i,g)}}function Da(e,i){var u=e.ref,f=e.refCleanup;if(u!==null)if(typeof f=="function")try{f()}catch(g){Ee(e,i,g)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(g){Ee(e,i,g)}else u.current=null}function Oa(e){var i=e.type,u=e.memoizedProps,f=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":u.autoFocus&&f.focus();break t;case"img":u.src?f.src=u.src:u.srcSet&&(f.srcset=u.srcSet)}}catch(g){Ee(e,e.return,g)}}function Ja(e,i,u){try{var f=e.stateNode;u2(f,e.type,u,i),f[wn]=i}catch(g){Ee(e,e.return,g)}}function nn(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ir(e.type)||e.tag===4}function ki(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||nn(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ir(e.type)||e.flags&2||e.child===null||e.tag===4)continue t;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function kt(e,i,u){var f=e.tag;if(f===5||f===6)e=e.stateNode,i?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(e,i):(i=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,i.appendChild(e),u=u._reactRootContainer,u!=null||i.onclick!==null||(i.onclick=zi));else if(f!==4&&(f===27&&Ir(e.type)&&(u=e.stateNode,i=null),e=e.child,e!==null))for(kt(e,i,u),e=e.sibling;e!==null;)kt(e,i,u),e=e.sibling}function he(e,i,u){var f=e.tag;if(f===5||f===6)e=e.stateNode,i?u.insertBefore(e,i):u.appendChild(e);else if(f!==4&&(f===27&&Ir(e.type)&&(u=e.stateNode),e=e.child,e!==null))for(he(e,i,u),e=e.sibling;e!==null;)he(e,i,u),e=e.sibling}function Ke(e){var i=e.stateNode,u=e.memoizedProps;try{for(var f=e.type,g=i.attributes;g.length;)i.removeAttributeNode(g[0]);Pn(i,f,u),i[Pt]=e,i[wn]=u}catch(b){Ee(e,e.return,b)}}var Pa=!1,Be=!1,Sl=!1,ro=typeof WeakSet=="function"?WeakSet:Set,Le=null;function Zr(e,i){if(e=e.containerInfo,gy=Wm,e=Po(e),Ar(e)){if("selectionStart"in e)var u={start:e.selectionStart,end:e.selectionEnd};else t:{u=(u=e.ownerDocument)&&u.defaultView||window;var f=u.getSelection&&u.getSelection();if(f&&f.rangeCount!==0){u=f.anchorNode;var g=f.anchorOffset,b=f.focusNode;f=f.focusOffset;try{u.nodeType,b.nodeType}catch{u=null;break t}var A=0,O=-1,V=-1,at=0,ft=0,yt=e,lt=null;e:for(;;){for(var ut;yt!==u||g!==0&&yt.nodeType!==3||(O=A+g),yt!==b||f!==0&&yt.nodeType!==3||(V=A+f),yt.nodeType===3&&(A+=yt.nodeValue.length),(ut=yt.firstChild)!==null;)lt=yt,yt=ut;for(;;){if(yt===e)break e;if(lt===u&&++at===g&&(O=A),lt===b&&++ft===f&&(V=A),(ut=yt.nextSibling)!==null)break;yt=lt,lt=yt.parentNode}yt=ut}u=O===-1||V===-1?null:{start:O,end:V}}else u=null}u=u||{start:0,end:0}}else u=null;for(vy={focusedElem:e,selectionRange:u},Wm=!1,Le=i;Le!==null;)if(i=Le,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,Le=e;else for(;Le!==null;){switch(i=Le,b=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(u=0;u<e.length;u++)g=e[u],g.ref.impl=g.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&b!==null){e=void 0,u=i,g=b.memoizedProps,b=b.memoizedState,f=u.stateNode;try{var Ct=An(u.type,g);e=f.getSnapshotBeforeUpdate(Ct,b),f.__reactInternalSnapshotBeforeUpdate=e}catch(jt){Ee(u,u.return,jt)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,u=e.nodeType,u===9)Sy(e);else if(u===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Sy(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=i.sibling,e!==null){e.return=i.return,Le=e;break}Le=i.return}}function jm(e,i,u){var f=u.flags;switch(u.tag){case 0:case 11:case 15:_l(e,u),f&4&&Xi(5,u);break;case 1:if(_l(e,u),f&4)if(e=u.stateNode,i===null)try{e.componentDidMount()}catch(A){Ee(u,u.return,A)}else{var g=An(u.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(g,i,e.__reactInternalSnapshotBeforeUpdate)}catch(A){Ee(u,u.return,A)}}f&64&&hs(u),f&512&&Vi(u,u.return);break;case 3:if(_l(e,u),f&64&&(e=u.updateQueue,e!==null)){if(i=null,u.child!==null)switch(u.child.tag){case 27:case 5:i=u.child.stateNode;break;case 1:i=u.child.stateNode}try{En(e,i)}catch(A){Ee(u,u.return,A)}}break;case 27:i===null&&f&4&&Ke(u);case 26:case 5:_l(e,u),i===null&&f&4&&Oa(u),f&512&&Vi(u,u.return);break;case 12:_l(e,u);break;case 31:_l(e,u),f&4&&Dc(e,u);break;case 13:_l(e,u),f&4&&Bh(e,u),f&64&&(e=u.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(u=JS.bind(null,u),y2(e,u))));break;case 22:if(f=u.memoizedState!==null||Pa,!f){i=i!==null&&i.memoizedState!==null||Be,g=Pa;var b=Be;Pa=f,(Be=i)&&!b?me(e,u,(u.subtreeFlags&8772)!==0):_l(e,u),Pa=g,Be=b}break;case 30:break;default:_l(e,u)}}function wc(e){var i=e.alternate;i!==null&&(e.alternate=null,wc(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&pu(i)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var re=null,an=!1;function Hn(e,i,u){for(u=u.child;u!==null;)ds(e,i,u),u=u.sibling}function ds(e,i,u){if($e&&typeof $e.onCommitFiberUnmount=="function")try{$e.onCommitFiberUnmount(Va,u)}catch{}switch(u.tag){case 26:Be||Da(u,i),Hn(e,i,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:Be||Da(u,i);var f=re,g=an;Ir(u.type)&&(re=u.stateNode,an=!1),Hn(e,i,u),Gh(u.stateNode),re=f,an=g;break;case 5:Be||Da(u,i);case 6:if(f=re,g=an,re=null,Hn(e,i,u),re=f,an=g,re!==null)if(an)try{(re.nodeType===9?re.body:re.nodeName==="HTML"?re.ownerDocument.body:re).removeChild(u.stateNode)}catch(b){Ee(u,i,b)}else try{re.removeChild(u.stateNode)}catch(b){Ee(u,i,b)}break;case 18:re!==null&&(an?(e=re,Wg(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,u.stateNode),Xc(e)):Wg(re,u.stateNode));break;case 4:f=re,g=an,re=u.stateNode.containerInfo,an=!0,Hn(e,i,u),re=f,an=g;break;case 0:case 11:case 14:case 15:Wa(2,u,i),Be||Wa(4,u,i),Hn(e,i,u);break;case 1:Be||(Da(u,i),f=u.stateNode,typeof f.componentWillUnmount=="function"&&Nh(u,i,f)),Hn(e,i,u);break;case 21:Hn(e,i,u);break;case 22:Be=(f=Be)||u.memoizedState!==null,Hn(e,i,u),Be=f;break;default:Hn(e,i,u)}}function Dc(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Xc(e)}catch(u){Ee(i,i.return,u)}}}function Bh(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Xc(e)}catch(u){Ee(i,i.return,u)}}function Um(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new ro),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new ro),i;default:throw Error(l(435,e.tag))}}function Ze(e,i){var u=Um(e);i.forEach(function(f){if(!u.has(f)){u.add(f);var g=PS.bind(null,e,f);f.then(g,g)}})}function Gn(e,i){var u=i.deletions;if(u!==null)for(var f=0;f<u.length;f++){var g=u[f],b=e,A=i,O=A;t:for(;O!==null;){switch(O.tag){case 27:if(Ir(O.type)){re=O.stateNode,an=!1;break t}break;case 5:re=O.stateNode,an=!1;break t;case 3:case 4:re=O.stateNode.containerInfo,an=!0;break t}O=O.return}if(re===null)throw Error(l(160));ds(b,A,g),re=null,an=!1,b=g.alternate,b!==null&&(b.return=null),g.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)ms(i,e),i=i.sibling}var ca=null;function ms(e,i){var u=e.alternate,f=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gn(i,e),Xe(e),f&4&&(Wa(3,e,e.return),Xi(3,e),Wa(5,e,e.return));break;case 1:Gn(i,e),Xe(e),f&512&&(Be||u===null||Da(u,u.return)),f&64&&Pa&&(e=e.updateQueue,e!==null&&(f=e.callbacks,f!==null&&(u=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=u===null?f:u.concat(f))));break;case 26:var g=ca;if(Gn(i,e),Xe(e),f&512&&(Be||u===null||Da(u,u.return)),f&4){var b=u!==null?u.memoizedState:null;if(f=e.memoizedState,u===null)if(f===null)if(e.stateNode===null){t:{f=e.type,u=e.memoizedProps,g=g.ownerDocument||g;e:switch(f){case"title":b=g.getElementsByTagName("title")[0],(!b||b[As]||b[Pt]||b.namespaceURI==="http://www.w3.org/2000/svg"||b.hasAttribute("itemprop"))&&(b=g.createElement(f),g.head.insertBefore(b,g.querySelector("head > title"))),Pn(b,f,u),b[Pt]=e,tn(b),f=b;break t;case"link":var A=sv("link","href",g).get(f+(u.href||""));if(A){for(var O=0;O<A.length;O++)if(b=A[O],b.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&b.getAttribute("rel")===(u.rel==null?null:u.rel)&&b.getAttribute("title")===(u.title==null?null:u.title)&&b.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(O,1);break e}}b=g.createElement(f),Pn(b,f,u),g.head.appendChild(b);break;case"meta":if(A=sv("meta","content",g).get(f+(u.content||""))){for(O=0;O<A.length;O++)if(b=A[O],b.getAttribute("content")===(u.content==null?null:""+u.content)&&b.getAttribute("name")===(u.name==null?null:u.name)&&b.getAttribute("property")===(u.property==null?null:u.property)&&b.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&b.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(O,1);break e}}b=g.createElement(f),Pn(b,f,u),g.head.appendChild(b);break;default:throw Error(l(468,f))}b[Pt]=e,tn(b),f=b}e.stateNode=f}else rv(g,e.type,e.stateNode);else e.stateNode=lv(g,f,e.memoizedProps);else b!==f?(b===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):b.count--,f===null?rv(g,e.type,e.stateNode):lv(g,f,e.memoizedProps)):f===null&&e.stateNode!==null&&Ja(e,e.memoizedProps,u.memoizedProps)}break;case 27:Gn(i,e),Xe(e),f&512&&(Be||u===null||Da(u,u.return)),u!==null&&f&4&&Ja(e,e.memoizedProps,u.memoizedProps);break;case 5:if(Gn(i,e),Xe(e),f&512&&(Be||u===null||Da(u,u.return)),e.flags&32){g=e.stateNode;try{Rs(g,"")}catch(Ct){Ee(e,e.return,Ct)}}f&4&&e.stateNode!=null&&(g=e.memoizedProps,Ja(e,g,u!==null?u.memoizedProps:g)),f&1024&&(Sl=!0);break;case 6:if(Gn(i,e),Xe(e),f&4){if(e.stateNode===null)throw Error(l(162));f=e.memoizedProps,u=e.stateNode;try{u.nodeValue=f}catch(Ct){Ee(e,e.return,Ct)}}break;case 3:if(Qm=null,g=ca,ca=Vm(i.containerInfo),Gn(i,e),ca=g,Xe(e),f&4&&u!==null&&u.memoizedState.isDehydrated)try{Xc(i.containerInfo)}catch(Ct){Ee(e,e.return,Ct)}Sl&&(Sl=!1,Hm(e));break;case 4:f=ca,ca=Vm(e.stateNode.containerInfo),Gn(i,e),Xe(e),ca=f;break;case 12:Gn(i,e),Xe(e);break;case 31:Gn(i,e),Xe(e),f&4&&(f=e.updateQueue,f!==null&&(e.updateQueue=null,Ze(e,f)));break;case 13:Gn(i,e),Xe(e),e.child.flags&8192&&e.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Cl=na()),f&4&&(f=e.updateQueue,f!==null&&(e.updateQueue=null,Ze(e,f)));break;case 22:g=e.memoizedState!==null;var V=u!==null&&u.memoizedState!==null,at=Pa,ft=Be;if(Pa=at||g,Be=ft||V,Gn(i,e),Be=ft,Pa=at,Xe(e),f&8192)t:for(i=e.stateNode,i._visibility=g?i._visibility&-2:i._visibility|1,g&&(u===null||V||Pa||Be||Ws(e)),u=null,i=e;;){if(i.tag===5||i.tag===26){if(u===null){V=u=i;try{if(b=V.stateNode,g)A=b.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{O=V.stateNode;var yt=V.memoizedProps.style,lt=yt!=null&&yt.hasOwnProperty("display")?yt.display:null;O.style.display=lt==null||typeof lt=="boolean"?"":(""+lt).trim()}}catch(Ct){Ee(V,V.return,Ct)}}}else if(i.tag===6){if(u===null){V=i;try{V.stateNode.nodeValue=g?"":V.memoizedProps}catch(Ct){Ee(V,V.return,Ct)}}}else if(i.tag===18){if(u===null){V=i;try{var ut=V.stateNode;g?Jg(ut,!0):Jg(V.stateNode,!1)}catch(Ct){Ee(V,V.return,Ct)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break t;for(;i.sibling===null;){if(i.return===null||i.return===e)break t;u===i&&(u=null),i=i.return}u===i&&(u=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=e.updateQueue,f!==null&&(u=f.retryQueue,u!==null&&(f.retryQueue=null,Ze(e,u))));break;case 19:Gn(i,e),Xe(e),f&4&&(f=e.updateQueue,f!==null&&(e.updateQueue=null,Ze(e,f)));break;case 30:break;case 21:break;default:Gn(i,e),Xe(e)}}function Xe(e){var i=e.flags;if(i&2){try{for(var u,f=e.return;f!==null;){if(nn(f)){u=f;break}f=f.return}if(u==null)throw Error(l(160));switch(u.tag){case 27:var g=u.stateNode,b=ki(e);he(e,b,g);break;case 5:var A=u.stateNode;u.flags&32&&(Rs(A,""),u.flags&=-33);var O=ki(e);he(e,O,A);break;case 3:case 4:var V=u.stateNode.containerInfo,at=ki(e);kt(e,at,V);break;default:throw Error(l(161))}}catch(ft){Ee(e,e.return,ft)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Hm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Hm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function _l(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)jm(e,i.alternate,i),i=i.sibling}function Ws(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:Wa(4,i,i.return),Ws(i);break;case 1:Da(i,i.return);var u=i.stateNode;typeof u.componentWillUnmount=="function"&&Nh(i,i.return,u),Ws(i);break;case 27:Gh(i.stateNode);case 26:case 5:Da(i,i.return),Ws(i);break;case 22:i.memoizedState===null&&Ws(i);break;case 30:Ws(i);break;default:Ws(i)}e=e.sibling}}function me(e,i,u){for(u=u&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,g=e,b=i,A=b.flags;switch(b.tag){case 0:case 11:case 15:me(g,b,u),Xi(4,b);break;case 1:if(me(g,b,u),f=b,g=f.stateNode,typeof g.componentDidMount=="function")try{g.componentDidMount()}catch(at){Ee(f,f.return,at)}if(f=b,g=f.updateQueue,g!==null){var O=f.stateNode;try{var V=g.shared.hiddenCallbacks;if(V!==null)for(g.shared.hiddenCallbacks=null,g=0;g<V.length;g++)Gi(V[g],O)}catch(at){Ee(f,f.return,at)}}u&&A&64&&hs(b),Vi(b,b.return);break;case 27:Ke(b);case 26:case 5:me(g,b,u),u&&f===null&&A&4&&Oa(b),Vi(b,b.return);break;case 12:me(g,b,u);break;case 31:me(g,b,u),u&&A&4&&Dc(g,b);break;case 13:me(g,b,u),u&&A&4&&Bh(g,b);break;case 22:b.memoizedState===null&&me(g,b,u),Vi(b,b.return);break;case 30:break;default:me(g,b,u)}i=i.sibling}}function Oc(e,i){var u=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(u=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==u&&(e!=null&&e.refCount++,u!=null&&Tn(u))}function Tl(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&Tn(e))}function hn(e,i,u,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ue(e,i,u,f),i=i.sibling}function Ue(e,i,u,f){var g=i.flags;switch(i.tag){case 0:case 11:case 15:hn(e,i,u,f),g&2048&&Xi(9,i);break;case 1:hn(e,i,u,f);break;case 3:hn(e,i,u,f),g&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&Tn(e)));break;case 12:if(g&2048){hn(e,i,u,f),e=i.stateNode;try{var b=i.memoizedProps,A=b.id,O=b.onPostCommit;typeof O=="function"&&O(A,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(V){Ee(i,i.return,V)}}else hn(e,i,u,f);break;case 31:hn(e,i,u,f);break;case 13:hn(e,i,u,f);break;case 23:break;case 22:b=i.stateNode,A=i.alternate,i.memoizedState!==null?b._visibility&2?hn(e,i,u,f):Fr(e,i):b._visibility&2?hn(e,i,u,f):(b._visibility|=2,ps(e,i,u,f,(i.subtreeFlags&10256)!==0||!1)),g&2048&&Oc(A,i);break;case 24:hn(e,i,u,f),g&2048&&Tl(i.alternate,i);break;default:hn(e,i,u,f)}}function ps(e,i,u,f,g){for(g=g&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var b=e,A=i,O=u,V=f,at=A.flags;switch(A.tag){case 0:case 11:case 15:ps(b,A,O,V,g),Xi(8,A);break;case 23:break;case 22:var ft=A.stateNode;A.memoizedState!==null?ft._visibility&2?ps(b,A,O,V,g):Fr(b,A):(ft._visibility|=2,ps(b,A,O,V,g)),g&&at&2048&&Oc(A.alternate,A);break;case 24:ps(b,A,O,V,g),g&&at&2048&&Tl(A.alternate,A);break;default:ps(b,A,O,V,g)}i=i.sibling}}function Fr(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var u=e,f=i,g=f.flags;switch(f.tag){case 22:Fr(u,f),g&2048&&Oc(f.alternate,f);break;case 24:Fr(u,f),g&2048&&Tl(f.alternate,f);break;default:Fr(u,f)}i=i.sibling}}var Ve=8192;function Js(e,i,u){if(e.subtreeFlags&Ve)for(e=e.child;e!==null;)Fe(e,i,u),e=e.sibling}function Fe(e,i,u){switch(e.tag){case 26:Js(e,i,u),e.flags&Ve&&e.memoizedState!==null&&R2(u,ca,e.memoizedState,e.memoizedProps);break;case 5:Js(e,i,u);break;case 3:case 4:var f=ca;ca=Vm(e.stateNode.containerInfo),Js(e,i,u),ca=f;break;case 22:e.memoizedState===null&&(f=e.alternate,f!==null&&f.memoizedState!==null?(f=Ve,Ve=16777216,Js(e,i,u),Ve=f):Js(e,i,u));break;default:Js(e,i,u)}}function fa(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function Wn(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Le=f,uo(f,e)}fa(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Ps(e),e=e.sibling}function Ps(e){switch(e.tag){case 0:case 11:case 15:Wn(e),e.flags&2048&&Wa(9,e,e.return);break;case 3:Wn(e);break;case 12:Wn(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,Nc(e)):Wn(e);break;default:Wn(e)}}function Nc(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];Le=f,uo(f,e)}fa(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:Wa(8,i,i.return),Nc(i);break;case 22:u=i.stateNode,u._visibility&2&&(u._visibility&=-3,Nc(i));break;default:Nc(i)}e=e.sibling}}function uo(e,i){for(;Le!==null;){var u=Le;switch(u.tag){case 0:case 11:case 15:Wa(8,u,i);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var f=u.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Tn(u.memoizedState.cache)}if(f=u.child,f!==null)f.return=u,Le=f;else t:for(u=e;Le!==null;){f=Le;var g=f.sibling,b=f.return;if(wc(f),f===u){Le=null;break t}if(g!==null){g.return=b,Le=g;break t}Le=b}}}var Bc={getCacheForType:function(e){var i=xn(zt),u=i.data.get(e);return u===void 0&&(u=e(),i.data.set(e,u)),u},cacheSignal:function(){return xn(zt).controller.signal}},jc=typeof WeakMap=="function"?WeakMap:Map,ne=0,pe=null,Qt=null,$t=0,wt=0,Wt=null,Xt=!1,Kt=!1,_e=!1,We=0,ye=0,Na=0,El=0,yi=0,ae=0,Ba=0,gi=null,Yn=null,ha=!1,Cl=0,Wr=0,ja=1/0,Jr=null,Qi=null,He=0,vi=null,Ua=null,Ia=0,Al=0,Is=null,Uc=null,$s=0,tr=null;function Jn(){return(ne&2)!==0&&$t!==0?$t&-$t:H.T!==null?cy():nl()}function s(){if(ae===0)if(($t&536870912)===0||te){var e=Cs;Cs<<=1,(Cs&3932160)===0&&(Cs=262144),ae=e}else ae=536870912;return e=fn.current,e!==null&&(e.flags|=32),ae}function r(e,i,u){(e===pe&&(wt===2||wt===9)||e.cancelPendingCommit!==null)&&(I(e,0),E(e,$t,ae,!1)),gr(e,u),((ne&2)===0||e!==pe)&&(e===pe&&((ne&2)===0&&(El|=u),ye===4&&E(e,$t,ae,!1)),ys(e))}function d(e,i,u){if((ne&6)!==0)throw Error(l(327));var f=!u&&(i&127)===0&&(i&e.expiredLanes)===0||mr(e,i),g=f?er(e,i):da(e,i,!0),b=f;do{if(g===0){Kt&&!f&&E(e,i,0,!1);break}else{if(u=e.current.alternate,b&&!S(u)){g=da(e,i,!1),b=!1;continue}if(g===2){if(b=i,e.errorRecoveryDisabledLanes&b)var A=0;else A=e.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){i=A;t:{var O=e;g=gi;var V=O.current.memoizedState.isDehydrated;if(V&&(I(O,A).flags|=256),A=da(O,A,!1),A!==2){if(_e&&!V){O.errorRecoveryDisabledLanes|=b,El|=b,g=4;break t}b=Yn,Yn=g,b!==null&&(Yn===null?Yn=b:Yn.push.apply(Yn,b))}g=A}if(b=!1,g!==2)continue}}if(g===1){I(e,0),E(e,i,0,!0);break}t:{switch(f=e,b=g,b){case 0:case 1:throw Error(l(345));case 4:if((i&4194048)!==i)break;case 6:E(f,i,ae,!Xt);break t;case 2:Yn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((i&62914560)===i&&(g=Cl+300-na(),10<g)){if(E(f,i,ae,!Xt),mu(f,0,!0)!==0)break t;Ia=i,f.timeoutHandle=Zg(v.bind(null,f,u,Yn,Jr,ha,i,ae,El,Ba,Xt,b,"Throttled",-0,0),g);break t}v(f,u,Yn,Jr,ha,i,ae,El,Ba,Xt,b,null,-0,0)}}break}while(!0);ys(e)}function v(e,i,u,f,g,b,A,O,V,at,ft,yt,lt,ut){if(e.timeoutHandle=-1,yt=i.subtreeFlags,yt&8192||(yt&16785408)===16785408){yt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:zi},Fe(i,b,yt);var Ct=(b&62914560)===b?Cl-na():(b&4194048)===b?Wr-na():0;if(Ct=z2(yt,Ct),Ct!==null){Ia=b,e.cancelPendingCommit=Ct(Ht.bind(null,e,i,b,u,f,g,A,O,V,ft,yt,null,lt,ut)),E(e,b,A,!at);return}}Ht(e,i,b,u,f,g,A,O,V)}function S(e){for(var i=e;;){var u=i.tag;if((u===0||u===11||u===15)&&i.flags&16384&&(u=i.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var f=0;f<u.length;f++){var g=u[f],b=g.getSnapshot;g=g.value;try{if(!Oe(b(),g))return!1}catch{return!1}}if(u=i.child,i.subtreeFlags&16384&&u!==null)u.return=i,i=u;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function E(e,i,u,f){i&=~yi,i&=~El,e.suspendedLanes|=i,e.pingedLanes&=~i,f&&(e.warmLanes|=i),f=e.expirationTimes;for(var g=i;0<g;){var b=31-Vn(g),A=1<<b;f[b]=-1,g&=~A}u!==0&&pf(e,u,i)}function B(){return(ne&6)===0?(jh(0),!1):!0}function X(){if(Qt!==null){if(wt===0)var e=Qt.return;else e=Qt,Bn=hl=null,fh(e),is=null,ls=0,e=Qt;for(;e!==null;)Fs(e.alternate,e),e=e.return;Qt=null}}function I(e,i){var u=e.timeoutHandle;u!==-1&&(e.timeoutHandle=-1,f2(u)),u=e.cancelPendingCommit,u!==null&&(e.cancelPendingCommit=null,u()),Ia=0,X(),pe=e,Qt=u=Oi(e.current,null),$t=i,wt=0,Wt=null,Xt=!1,Kt=mr(e,i),_e=!1,Ba=ae=yi=El=Na=ye=0,Yn=gi=null,ha=!1,(i&8)!==0&&(i|=i&32);var f=e.entangledLanes;if(f!==0)for(e=e.entanglements,f&=i;0<f;){var g=31-Vn(f),b=1<<g;i|=e[g],f&=~b}return We=i,Pl(),u}function ht(e,i){Ut=null,H.H=Ju,i===as||i===hi?(i=cc(),wt=3):i===qu?(i=cc(),wt=4):wt=i===Mc?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Wt=i,Qt===null&&(ye=1,Ac(e,ia(i,e.current)))}function bt(){var e=fn.current;return e===null?!0:($t&4194048)===$t?Ka===null:($t&62914560)===$t||($t&536870912)!==0?e===Ka:!1}function Tt(){var e=H.H;return H.H=Ju,e===null?Ju:e}function Et(){var e=H.A;return H.A=Bc,e}function qt(){ye=4,Xt||($t&4194048)!==$t&&fn.current!==null||(Kt=!0),(Na&134217727)===0&&(El&134217727)===0||pe===null||E(pe,$t,ae,!1)}function da(e,i,u){var f=ne;ne|=2;var g=Tt(),b=Et();(pe!==e||$t!==i)&&(Jr=null,I(e,i)),i=!1;var A=ye;t:do try{if(wt!==0&&Qt!==null){var O=Qt,V=Wt;switch(wt){case 8:X(),A=6;break t;case 3:case 2:case 9:case 6:fn.current===null&&(i=!0);var at=wt;if(wt=0,Wt=null,xt(e,O,V,at),u&&Kt){A=0;break t}break;default:at=wt,wt=0,Wt=null,xt(e,O,V,at)}}oo(),A=ye;break}catch(ft){ht(e,ft)}while(!0);return i&&e.shellSuspendCounter++,Bn=hl=null,ne=f,H.H=g,H.A=b,Qt===null&&(pe=null,$t=0,Pl()),A}function oo(){for(;Qt!==null;)J(Qt)}function er(e,i){var u=ne;ne|=2;var f=Tt(),g=Et();pe!==e||$t!==i?(Jr=null,ja=na()+500,I(e,i)):Kt=mr(e,i);t:do try{if(wt!==0&&Qt!==null){i=Qt;var b=Wt;e:switch(wt){case 1:wt=0,Wt=null,xt(e,i,b,1);break;case 2:case 9:if(um(b)){wt=0,Wt=null,st(i);break}i=function(){wt!==2&&wt!==9||pe!==e||(wt=7),ys(e)},b.then(i,i);break t;case 3:wt=7;break t;case 4:wt=5;break t;case 7:um(b)?(wt=0,Wt=null,st(i)):(wt=0,Wt=null,xt(e,i,b,7));break;case 5:var A=null;switch(Qt.tag){case 26:A=Qt.memoizedState;case 5:case 27:var O=Qt;if(A?uv(A):O.stateNode.complete){wt=0,Wt=null;var V=O.sibling;if(V!==null)Qt=V;else{var at=O.return;at!==null?(Qt=at,Rt(at)):Qt=null}break e}}wt=0,Wt=null,xt(e,i,b,5);break;case 6:wt=0,Wt=null,xt(e,i,b,6);break;case 8:X(),ye=6;break t;default:throw Error(l(462))}}it();break}catch(ft){ht(e,ft)}while(!0);return Bn=hl=null,H.H=f,H.A=g,ne=u,Qt!==null?0:(pe=null,$t=0,Pl(),ye)}function it(){for(;Qt!==null&&!Pp();)J(Qt)}function J(e){var i=Rc(e.alternate,e,We);e.memoizedProps=e.pendingProps,i===null?Rt(e):Qt=i}function st(e){var i=e,u=i.alternate;switch(i.tag){case 15:case 0:i=Un(u,i,i.pendingProps,i.type,void 0,$t);break;case 11:i=Un(u,i,i.pendingProps,i.type.render,i.ref,$t);break;case 5:fh(i);default:Fs(u,i),i=Qt=Nn(i,We),i=Rc(u,i,We)}e.memoizedProps=e.pendingProps,i===null?Rt(e):Qt=i}function xt(e,i,u,f){Bn=hl=null,fh(i),is=null,ls=0;var g=i.return;try{if(Aa(e,g,i,u,$t)){ye=1,Ac(e,ia(u,e.current)),Qt=null;return}}catch(b){if(g!==null)throw Qt=g,b;ye=1,Ac(e,ia(u,e.current)),Qt=null;return}i.flags&32768?(te||f===1?e=!0:Kt||($t&536870912)!==0?e=!1:(Xt=e=!0,(f===2||f===9||f===3||f===6)&&(f=fn.current,f!==null&&f.tag===13&&(f.flags|=16384))),Ae(i,e)):Rt(i)}function Rt(e){var i=e;do{if((i.flags&32768)!==0){Ae(i,Xt);return}e=i.return;var u=Oh(i.alternate,i,We);if(u!==null){Qt=u;return}if(i=i.sibling,i!==null){Qt=i;return}Qt=i=e}while(i!==null);ye===0&&(ye=5)}function Ae(e,i){do{var u=zc(e.alternate,e);if(u!==null){u.flags&=32767,Qt=u;return}if(u=e.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!i&&(e=e.sibling,e!==null)){Qt=e;return}Qt=e=u}while(e!==null);ye=6,Qt=null}function Ht(e,i,u,f,g,b,A,O,V){e.cancelPendingCommit=null;do Hc();while(He!==0);if((ne&6)!==0)throw Error(l(327));if(i!==null){if(i===e.current)throw Error(l(177));if(b=i.lanes|i.childLanes,b|=nc,wd(e,u,b,A,O,V),e===pe&&(Qt=pe=null,$t=0),Ua=i,vi=e,Ia=u,Al=b,Is=g,Uc=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,IS(Mo,function(){return wg(),null})):(e.callbackNode=null,e.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=H.T,H.T=null,g=Q.p,Q.p=2,A=ne,ne|=4;try{Zr(e,i,u)}finally{ne=A,Q.p=g,H.T=f}}He=1,ue(),dn(),oe()}}function ue(){if(He===1){He=0;var e=vi,i=Ua,u=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||u){u=H.T,H.T=null;var f=Q.p;Q.p=2;var g=ne;ne|=4;try{ms(i,e);var b=vy,A=Po(e.containerInfo),O=b.focusedElem,V=b.selectionRange;if(A!==O&&O&&O.ownerDocument&&Jo(O.ownerDocument.documentElement,O)){if(V!==null&&Ar(O)){var at=V.start,ft=V.end;if(ft===void 0&&(ft=at),"selectionStart"in O)O.selectionStart=at,O.selectionEnd=Math.min(ft,O.value.length);else{var yt=O.ownerDocument||document,lt=yt&&yt.defaultView||window;if(lt.getSelection){var ut=lt.getSelection(),Ct=O.textContent.length,jt=Math.min(V.start,Ct),Re=V.end===void 0?jt:Math.min(V.end,Ct);!ut.extend&&jt>Re&&(A=Re,Re=jt,jt=A);var P=qf(O,jt),K=qf(O,Re);if(P&&K&&(ut.rangeCount!==1||ut.anchorNode!==P.node||ut.anchorOffset!==P.offset||ut.focusNode!==K.node||ut.focusOffset!==K.offset)){var nt=yt.createRange();nt.setStart(P.node,P.offset),ut.removeAllRanges(),jt>Re?(ut.addRange(nt),ut.extend(K.node,K.offset)):(nt.setEnd(K.node,K.offset),ut.addRange(nt))}}}}for(yt=[],ut=O;ut=ut.parentNode;)ut.nodeType===1&&yt.push({element:ut,left:ut.scrollLeft,top:ut.scrollTop});for(typeof O.focus=="function"&&O.focus(),O=0;O<yt.length;O++){var mt=yt[O];mt.element.scrollLeft=mt.left,mt.element.scrollTop=mt.top}}Wm=!!gy,vy=gy=null}finally{ne=g,Q.p=f,H.T=u}}e.current=i,He=2}}function dn(){if(He===2){He=0;var e=vi,i=Ua,u=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||u){u=H.T,H.T=null;var f=Q.p;Q.p=2;var g=ne;ne|=4;try{jm(e,i.alternate,i)}finally{ne=g,Q.p=f,H.T=u}}He=3}}function oe(){if(He===4||He===3){He=0,Ed();var e=vi,i=Ua,u=Ia,f=Uc;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?He=5:(He=0,Ua=vi=null,Ml(e,e.pendingLanes));var g=e.pendingLanes;if(g===0&&(Qi=null),Do(u),i=i.stateNode,$e&&typeof $e.onCommitFiberRoot=="function")try{$e.onCommitFiberRoot(Va,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=H.T,g=Q.p,Q.p=2,H.T=null;try{for(var b=e.onRecoverableError,A=0;A<f.length;A++){var O=f[A];b(O.value,{componentStack:O.stack})}}finally{H.T=i,Q.p=g}}(Ia&3)!==0&&Hc(),ys(e),g=e.pendingLanes,(u&261930)!==0&&(g&42)!==0?e===tr?$s++:($s=0,tr=e):$s=0,jh(0)}}function Ml(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,Tn(i)))}function Hc(){return ue(),dn(),oe(),wg()}function wg(){if(He!==5)return!1;var e=vi,i=Al;Al=0;var u=Do(Ia),f=H.T,g=Q.p;try{Q.p=32>u?32:u,H.T=null,u=Is,Is=null;var b=vi,A=Ia;if(He=0,Ua=vi=null,Ia=0,(ne&6)!==0)throw Error(l(331));var O=ne;if(ne|=4,Ps(b.current),Ue(b,b.current,A,u),ne=O,jh(0,!1),$e&&typeof $e.onPostCommitFiberRoot=="function")try{$e.onPostCommitFiberRoot(Va,b)}catch{}return!0}finally{Q.p=g,H.T=f,Ml(e,i)}}function Dg(e,i,u){i=ia(u,i),i=Dh(e.stateNode,i,2),e=yl(e,i,2),e!==null&&(gr(e,2),ys(e))}function Ee(e,i,u){if(e.tag===3)Dg(e,e,u);else for(;i!==null;){if(i.tag===3){Dg(i,e,u);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Qi===null||!Qi.has(f))){e=ia(u,e),u=Xr(2),f=yl(i,u,2),f!==null&&(ua(u,f,i,e),gr(f,2),ys(f));break}}i=i.return}}function ry(e,i,u){var f=e.pingCache;if(f===null){f=e.pingCache=new jc;var g=new Set;f.set(i,g)}else g=f.get(i),g===void 0&&(g=new Set,f.set(i,g));g.has(u)||(_e=!0,g.add(u),e=WS.bind(null,e,i,u),i.then(e,e))}function WS(e,i,u){var f=e.pingCache;f!==null&&f.delete(i),e.pingedLanes|=e.suspendedLanes&u,e.warmLanes&=~u,pe===e&&($t&u)===u&&(ye===4||ye===3&&($t&62914560)===$t&&300>na()-Cl?(ne&2)===0&&I(e,0):yi|=u,Ba===$t&&(Ba=0)),ys(e)}function Og(e,i){i===0&&(i=pr()),e=Il(e,i),e!==null&&(gr(e,i),ys(e))}function JS(e){var i=e.memoizedState,u=0;i!==null&&(u=i.retryLane),Og(e,u)}function PS(e,i){var u=0;switch(e.tag){case 31:case 13:var f=e.stateNode,g=e.memoizedState;g!==null&&(u=g.retryLane);break;case 19:f=e.stateNode;break;case 22:f=e.stateNode._retryCache;break;default:throw Error(l(314))}f!==null&&f.delete(i),Og(e,u)}function IS(e,i){return Xa(e,i)}var Gm=null,Gc=null,uy=!1,Ym=!1,oy=!1,Pr=0;function ys(e){e!==Gc&&e.next===null&&(Gc===null?Gm=Gc=e:Gc=Gc.next=e),Ym=!0,uy||(uy=!0,t2())}function jh(e,i){if(!oy&&Ym){oy=!0;do for(var u=!1,f=Gm;f!==null;){if(e!==0){var g=f.pendingLanes;if(g===0)var b=0;else{var A=f.suspendedLanes,O=f.pingedLanes;b=(1<<31-Vn(42|e)+1)-1,b&=g&~(A&~O),b=b&201326741?b&201326741|1:b?b|2:0}b!==0&&(u=!0,Ug(f,b))}else b=$t,b=mu(f,f===pe?b:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(b&3)===0||mr(f,b)||(u=!0,Ug(f,b));f=f.next}while(u);oy=!1}}function $S(){Ng()}function Ng(){Ym=uy=!1;var e=0;Pr!==0&&c2()&&(e=Pr);for(var i=na(),u=null,f=Gm;f!==null;){var g=f.next,b=Bg(f,i);b===0?(f.next=null,u===null?Gm=g:u.next=g,g===null&&(Gc=u)):(u=f,(e!==0||(b&3)!==0)&&(Ym=!0)),f=g}He!==0&&He!==5||jh(e),Pr!==0&&(Pr=0)}function Bg(e,i){for(var u=e.suspendedLanes,f=e.pingedLanes,g=e.expirationTimes,b=e.pendingLanes&-62914561;0<b;){var A=31-Vn(b),O=1<<A,V=g[A];V===-1?((O&u)===0||(O&f)!==0)&&(g[A]=Ro(O,i)):V<=i&&(e.expiredLanes|=O),b&=~O}if(i=pe,u=$t,u=mu(e,e===i?u:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),f=e.callbackNode,u===0||e===i&&(wt===2||wt===9)||e.cancelPendingCommit!==null)return f!==null&&f!==null&&Ul(f),e.callbackNode=null,e.callbackPriority=0;if((u&3)===0||mr(e,u)){if(i=u&-u,i===e.callbackPriority)return i;switch(f!==null&&Ul(f),Do(u)){case 2:case 8:u=Ao;break;case 32:u=Mo;break;case 268435456:u=Rd;break;default:u=Mo}return f=jg.bind(null,e),u=Xa(u,f),e.callbackPriority=i,e.callbackNode=u,i}return f!==null&&f!==null&&Ul(f),e.callbackPriority=2,e.callbackNode=null,2}function jg(e,i){if(He!==0&&He!==5)return e.callbackNode=null,e.callbackPriority=0,null;var u=e.callbackNode;if(Hc()&&e.callbackNode!==u)return null;var f=$t;return f=mu(e,e===pe?f:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),f===0?null:(d(e,f,i),Bg(e,na()),e.callbackNode!=null&&e.callbackNode===u?jg.bind(null,e):null)}function Ug(e,i){if(Hc())return null;d(e,i,!0)}function t2(){h2(function(){(ne&6)!==0?Xa(Ad,$S):Ng()})}function cy(){if(Pr===0){var e=pl;e===0&&(e=hu,hu<<=1,(hu&261888)===0&&(hu=256)),Pr=e}return Pr}function Hg(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Su(""+e)}function Gg(e,i){var u=i.ownerDocument.createElement("input");return u.name=i.name,u.value=i.value,e.id&&u.setAttribute("form",e.id),i.parentNode.insertBefore(u,i),e=new FormData(e),u.parentNode.removeChild(u),e}function e2(e,i,u,f,g){if(i==="submit"&&u&&u.stateNode===g){var b=Hg((g[wn]||null).action),A=f.submitter;A&&(i=(i=A[wn]||null)?Hg(i.formAction):A.getAttribute("formAction"),i!==null&&(b=i,A=null));var O=new Cu("action","action",null,f,g);e.push({event:O,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(Pr!==0){var V=A?Gg(g,A):new FormData(g);Ah(u,{pending:!0,data:V,method:g.method,action:b},null,V)}}else typeof b=="function"&&(O.preventDefault(),V=A?Gg(g,A):new FormData(g),Ah(u,{pending:!0,data:V,method:g.method,action:b},b,V))},currentTarget:g}]})}}for(var fy=0;fy<ec.length;fy++){var hy=ec[fy],n2=hy.toLowerCase(),a2=hy[0].toUpperCase()+hy.slice(1);On(n2,"on"+a2)}On(aa,"onAnimationEnd"),On(Lf,"onAnimationIteration"),On(Di,"onAnimationStart"),On("dblclick","onDoubleClick"),On("focusin","onFocus"),On("focusout","onBlur"),On(wr,"onTransitionRun"),On(Wl,"onTransitionStart"),On(Xf,"onTransitionCancel"),On(tc,"onTransitionEnd"),Gl("onMouseEnter",["mouseout","mouseover"]),Gl("onMouseLeave",["mouseout","mouseover"]),Gl("onPointerEnter",["pointerout","pointerover"]),Gl("onPointerLeave",["pointerout","pointerover"]),ll("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ll("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ll("onBeforeInput",["compositionend","keypress","textInput","paste"]),ll("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ll("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uh="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),i2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uh));function Yg(e,i){i=(i&4)!==0;for(var u=0;u<e.length;u++){var f=e[u],g=f.event;f=f.listeners;t:{var b=void 0;if(i)for(var A=f.length-1;0<=A;A--){var O=f[A],V=O.instance,at=O.currentTarget;if(O=O.listener,V!==b&&g.isPropagationStopped())break t;b=O,g.currentTarget=at;try{b(g)}catch(ft){Jl(ft)}g.currentTarget=null,b=V}else for(A=0;A<f.length;A++){if(O=f[A],V=O.instance,at=O.currentTarget,O=O.listener,V!==b&&g.isPropagationStopped())break t;b=O,g.currentTarget=at;try{b(g)}catch(ft){Jl(ft)}g.currentTarget=null,b=V}}}}function ee(e,i){var u=i[Oo];u===void 0&&(u=i[Oo]=new Set);var f=e+"__bubble";u.has(f)||(qg(i,e,2,!1),u.add(f))}function dy(e,i,u){var f=0;i&&(f|=4),qg(u,e,f,i)}var qm="_reactListening"+Math.random().toString(36).slice(2);function my(e){if(!e[qm]){e[qm]=!0,Ri.forEach(function(u){u!=="selectionchange"&&(i2.has(u)||dy(u,!1,e),dy(u,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[qm]||(i[qm]=!0,dy("selectionchange",!1,i))}}function qg(e,i,u,f){switch(pv(i)){case 2:var g=O2;break;case 8:g=N2;break;default:g=zy}u=g.bind(null,i,u,e),g=void 0,!qo||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(g=!0),f?g!==void 0?e.addEventListener(i,u,{capture:!0,passive:g}):e.addEventListener(i,u,!0):g!==void 0?e.addEventListener(i,u,{passive:g}):e.addEventListener(i,u,!1)}function py(e,i,u,f,g){var b=f;if((i&1)===0&&(i&2)===0&&f!==null)t:for(;;){if(f===null)return;var A=f.tag;if(A===3||A===4){var O=f.stateNode.containerInfo;if(O===g)break;if(A===4)for(A=f.return;A!==null;){var V=A.tag;if((V===3||V===4)&&A.stateNode.containerInfo===g)return;A=A.return}for(;O!==null;){if(A=cn(O),A===null)return;if(V=A.tag,V===5||V===6||V===26||V===27){f=b=A;continue t}O=O.parentNode}}f=f.return}Tf(function(){var at=b,ft=Go(u),yt=[];t:{var lt=ul.get(e);if(lt!==void 0){var ut=Cu,Ct=e;switch(e){case"keypress":if(Ds(u)===0)break t;case"keydown":case"keyup":ut=wf;break;case"focusin":Ct="focus",ut=Qo;break;case"focusout":Ct="blur",ut=Qo;break;case"beforeblur":case"afterblur":ut=Qo;break;case"click":if(u.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ut=Yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ut=qd;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ut=sl;break;case aa:case Lf:case Di:ut=Vd;break;case tc:ut=$p;break;case"scroll":case"scrollend":ut=Vo;break;case"wheel":ut=Vl;break;case"copy":case"cut":case"paste":ut=Cf;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ut=Ko;break;case"toggle":case"beforetoggle":ut=Of}var jt=(i&4)!==0,Re=!jt&&(e==="scroll"||e==="scrollend"),P=jt?lt!==null?lt+"Capture":null:lt;jt=[];for(var K=at,nt;K!==null;){var mt=K;if(nt=mt.stateNode,mt=mt.tag,mt!==5&&mt!==26&&mt!==27||nt===null||P===null||(mt=ws(K,P),mt!=null&&jt.push(Hh(K,mt,nt))),Re)break;K=K.return}0<jt.length&&(lt=new ut(lt,Ct,null,u,ft),yt.push({event:lt,listeners:jt}))}}if((i&7)===0){t:{if(lt=e==="mouseover"||e==="pointerover",ut=e==="mouseout"||e==="pointerout",lt&&u!==_u&&(Ct=u.relatedTarget||u.fromElement)&&(cn(Ct)||Ct[Hl]))break t;if((ut||lt)&&(lt=ft.window===ft?ft:(lt=ft.ownerDocument)?lt.defaultView||lt.parentWindow:window,ut?(Ct=u.relatedTarget||u.toElement,ut=at,Ct=Ct?cn(Ct):null,Ct!==null&&(Re=c(Ct),jt=Ct.tag,Ct!==Re||jt!==5&&jt!==27&&jt!==6)&&(Ct=null)):(ut=null,Ct=at),ut!==Ct)){if(jt=Yd,mt="onMouseLeave",P="onMouseEnter",K="mouse",(e==="pointerout"||e==="pointerover")&&(jt=Ko,mt="onPointerLeave",P="onPointerEnter",K="pointer"),Re=ut==null?lt:al(ut),nt=Ct==null?lt:al(Ct),lt=new jt(mt,K+"leave",ut,u,ft),lt.target=Re,lt.relatedTarget=nt,mt=null,cn(ft)===at&&(jt=new jt(P,K+"enter",Ct,u,ft),jt.target=nt,jt.relatedTarget=Re,mt=jt),Re=mt,ut&&Ct)e:{for(jt=l2,P=ut,K=Ct,nt=0,mt=P;mt;mt=jt(mt))nt++;mt=0;for(var Dt=K;Dt;Dt=jt(Dt))mt++;for(;0<nt-mt;)P=jt(P),nt--;for(;0<mt-nt;)K=jt(K),mt--;for(;nt--;){if(P===K||K!==null&&P===K.alternate){jt=P;break e}P=jt(P),K=jt(K)}jt=null}else jt=null;ut!==null&&Lg(yt,lt,ut,jt,!1),Ct!==null&&Re!==null&&Lg(yt,Re,Ct,jt,!0)}}t:{if(lt=at?al(at):window,ut=lt.nodeName&&lt.nodeName.toLowerCase(),ut==="select"||ut==="input"&&lt.type==="file")var ge=Hf;else if(jf(lt))if(Du)ge=tm;else{ge=Kl;var Mt=Ou}else ut=lt.nodeName,!ut||ut.toLowerCase()!=="input"||lt.type!=="checkbox"&&lt.type!=="radio"?at&&bu(at.elementType)&&(ge=Hf):ge=$d;if(ge&&(ge=ge(e,at))){Wo(yt,ge,u,ft);break t}Mt&&Mt(e,lt,at),e==="focusout"&&at&&lt.type==="number"&&at.memoizedProps.value!=null&&Uo(lt,"number",lt.value)}switch(Mt=at?al(at):window,e){case"focusin":(jf(Mt)||Mt.contentEditable==="true")&&(Mr=Mt,Io=at,Rr=null);break;case"focusout":Rr=Io=Mr=null;break;case"mousedown":Sa=!0;break;case"contextmenu":case"mouseup":case"dragend":Sa=!1,$o(yt,u,ft);break;case"selectionchange":if(em)break;case"keydown":case"keyup":$o(yt,u,ft)}var Zt;if(Os)t:{switch(e){case"compositionstart":var ie="onCompositionStart";break t;case"compositionend":ie="onCompositionEnd";break t;case"compositionupdate":ie="onCompositionUpdate";break t}ie=void 0}else Ql?Zo(e,u)&&(ie="onCompositionEnd"):e==="keydown"&&u.keyCode===229&&(ie="onCompositionStart");ie&&(_n&&u.locale!=="ko"&&(Ql||ie!=="onCompositionStart"?ie==="onCompositionEnd"&&Ql&&(Zt=Xo()):(ql=ft,Lo="value"in ql?ql.value:ql.textContent,Ql=!0)),Mt=Lm(at,ie),0<Mt.length&&(ie=new Af(ie,e,null,u,ft),yt.push({event:ie,listeners:Mt}),Zt?ie.data=Zt:(Zt=Sr(u),Zt!==null&&(ie.data=Zt)))),(Zt=Ns?Fo(e,u):Jd(e,u))&&(ie=Lm(at,"onBeforeInput"),0<ie.length&&(Mt=new Af("onBeforeInput","beforeinput",null,u,ft),yt.push({event:Mt,listeners:ie}),Mt.data=Zt)),e2(yt,e,at,u,ft)}Yg(yt,i)})}function Hh(e,i,u){return{instance:e,listener:i,currentTarget:u}}function Lm(e,i){for(var u=i+"Capture",f=[];e!==null;){var g=e,b=g.stateNode;if(g=g.tag,g!==5&&g!==26&&g!==27||b===null||(g=ws(e,u),g!=null&&f.unshift(Hh(e,g,b)),g=ws(e,i),g!=null&&f.push(Hh(e,g,b))),e.tag===3)return f;e=e.return}return[]}function l2(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Lg(e,i,u,f,g){for(var b=i._reactName,A=[];u!==null&&u!==f;){var O=u,V=O.alternate,at=O.stateNode;if(O=O.tag,V!==null&&V===f)break;O!==5&&O!==26&&O!==27||at===null||(V=at,g?(at=ws(u,b),at!=null&&A.unshift(Hh(u,at,V))):g||(at=ws(u,b),at!=null&&A.push(Hh(u,at,V)))),u=u.return}A.length!==0&&e.push({event:i,listeners:A})}var s2=/\r\n?/g,r2=/\u0000|\uFFFD/g;function Xg(e){return(typeof e=="string"?e:""+e).replace(s2,`
50
- `).replace(r2,"")}function Vg(e,i){return i=Xg(i),Xg(e)===i}function Me(e,i,u,f,g,b){switch(u){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Rs(e,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Rs(e,""+f);break;case"className":vu(e,"class",f);break;case"tabIndex":vu(e,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":vu(e,u,f);break;case"style":Sf(e,f,b);break;case"data":if(i!=="object"){vu(e,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||u!=="href")){e.removeAttribute(u);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){e.removeAttribute(u);break}f=Su(""+f),e.setAttribute(u,f);break;case"action":case"formAction":if(typeof f=="function"){e.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof b=="function"&&(u==="formAction"?(i!=="input"&&Me(e,i,"name",g.name,g,null),Me(e,i,"formEncType",g.formEncType,g,null),Me(e,i,"formMethod",g.formMethod,g,null),Me(e,i,"formTarget",g.formTarget,g,null)):(Me(e,i,"encType",g.encType,g,null),Me(e,i,"method",g.method,g,null),Me(e,i,"target",g.target,g,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){e.removeAttribute(u);break}f=Su(""+f),e.setAttribute(u,f);break;case"onClick":f!=null&&(e.onclick=zi);break;case"onScroll":f!=null&&ee("scroll",e);break;case"onScrollEnd":f!=null&&ee("scrollend",e);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(l(61));if(u=f.__html,u!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=u}}break;case"multiple":e.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":e.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){e.removeAttribute("xlink:href");break}u=Su(""+f),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?e.setAttribute(u,""+f):e.removeAttribute(u);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?e.setAttribute(u,""):e.removeAttribute(u);break;case"capture":case"download":f===!0?e.setAttribute(u,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?e.setAttribute(u,f):e.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?e.setAttribute(u,f):e.removeAttribute(u);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?e.removeAttribute(u):e.setAttribute(u,f);break;case"popover":ee("beforetoggle",e),ee("toggle",e),gu(e,"popover",f);break;case"xlinkActuate":ri(e,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":ri(e,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":ri(e,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":ri(e,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":ri(e,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":ri(e,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":ri(e,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":ri(e,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":ri(e,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":gu(e,"is",f);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Hd.get(u)||u,gu(e,u,f))}}function yy(e,i,u,f,g,b){switch(u){case"style":Sf(e,f,b);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(l(61));if(u=f.__html,u!=null){if(g.children!=null)throw Error(l(60));e.innerHTML=u}}break;case"children":typeof f=="string"?Rs(e,f):(typeof f=="number"||typeof f=="bigint")&&Rs(e,""+f);break;case"onScroll":f!=null&&ee("scroll",e);break;case"onScrollEnd":f!=null&&ee("scrollend",e);break;case"onClick":f!=null&&(e.onclick=zi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!yu.hasOwnProperty(u))t:{if(u[0]==="o"&&u[1]==="n"&&(g=u.endsWith("Capture"),i=u.slice(2,g?u.length-7:void 0),b=e[wn]||null,b=b!=null?b[u]:null,typeof b=="function"&&e.removeEventListener(i,b,g),typeof f=="function")){typeof b!="function"&&b!==null&&(u in e?e[u]=null:e.hasAttribute(u)&&e.removeAttribute(u)),e.addEventListener(i,f,g);break t}u in e?e[u]=f:f===!0?e.setAttribute(u,""):gu(e,u,f)}}}function Pn(e,i,u){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ee("error",e),ee("load",e);var f=!1,g=!1,b;for(b in u)if(u.hasOwnProperty(b)){var A=u[b];if(A!=null)switch(b){case"src":f=!0;break;case"srcSet":g=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Me(e,i,b,A,u,null)}}g&&Me(e,i,"srcSet",u.srcSet,u,null),f&&Me(e,i,"src",u.src,u,null);return;case"input":ee("invalid",e);var O=b=A=g=null,V=null,at=null;for(f in u)if(u.hasOwnProperty(f)){var ft=u[f];if(ft!=null)switch(f){case"name":g=ft;break;case"type":A=ft;break;case"checked":V=ft;break;case"defaultChecked":at=ft;break;case"value":b=ft;break;case"defaultValue":O=ft;break;case"children":case"dangerouslySetInnerHTML":if(ft!=null)throw Error(l(137,i));break;default:Me(e,i,f,ft,u,null)}}xf(e,b,O,V,at,A,g,!1);return;case"select":ee("invalid",e),f=A=b=null;for(g in u)if(u.hasOwnProperty(g)&&(O=u[g],O!=null))switch(g){case"value":b=O;break;case"defaultValue":A=O;break;case"multiple":f=O;default:Me(e,i,g,O,u,null)}i=b,u=A,e.multiple=!!f,i!=null?xr(e,!!f,i,!1):u!=null&&xr(e,!!f,u,!0);return;case"textarea":ee("invalid",e),b=g=f=null;for(A in u)if(u.hasOwnProperty(A)&&(O=u[A],O!=null))switch(A){case"value":f=O;break;case"defaultValue":g=O;break;case"children":b=O;break;case"dangerouslySetInnerHTML":if(O!=null)throw Error(l(91));break;default:Me(e,i,A,O,u,null)}Ms(e,f,g,b);return;case"option":for(V in u)if(u.hasOwnProperty(V)&&(f=u[V],f!=null))switch(V){case"selected":e.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Me(e,i,V,f,u,null)}return;case"dialog":ee("beforetoggle",e),ee("toggle",e),ee("cancel",e),ee("close",e);break;case"iframe":case"object":ee("load",e);break;case"video":case"audio":for(f=0;f<Uh.length;f++)ee(Uh[f],e);break;case"image":ee("error",e),ee("load",e);break;case"details":ee("toggle",e);break;case"embed":case"source":case"link":ee("error",e),ee("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(at in u)if(u.hasOwnProperty(at)&&(f=u[at],f!=null))switch(at){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Me(e,i,at,f,u,null)}return;default:if(bu(i)){for(ft in u)u.hasOwnProperty(ft)&&(f=u[ft],f!==void 0&&yy(e,i,ft,f,u,void 0));return}}for(O in u)u.hasOwnProperty(O)&&(f=u[O],f!=null&&Me(e,i,O,f,u,null))}function u2(e,i,u,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var g=null,b=null,A=null,O=null,V=null,at=null,ft=null;for(ut in u){var yt=u[ut];if(u.hasOwnProperty(ut)&&yt!=null)switch(ut){case"checked":break;case"value":break;case"defaultValue":V=yt;default:f.hasOwnProperty(ut)||Me(e,i,ut,null,f,yt)}}for(var lt in f){var ut=f[lt];if(yt=u[lt],f.hasOwnProperty(lt)&&(ut!=null||yt!=null))switch(lt){case"type":b=ut;break;case"name":g=ut;break;case"checked":at=ut;break;case"defaultChecked":ft=ut;break;case"value":A=ut;break;case"defaultValue":O=ut;break;case"children":case"dangerouslySetInnerHTML":if(ut!=null)throw Error(l(137,i));break;default:ut!==yt&&Me(e,i,lt,ut,f,yt)}}jo(e,A,O,V,at,ft,b,g);return;case"select":ut=A=O=lt=null;for(b in u)if(V=u[b],u.hasOwnProperty(b)&&V!=null)switch(b){case"value":break;case"multiple":ut=V;default:f.hasOwnProperty(b)||Me(e,i,b,null,f,V)}for(g in f)if(b=f[g],V=u[g],f.hasOwnProperty(g)&&(b!=null||V!=null))switch(g){case"value":lt=b;break;case"defaultValue":O=b;break;case"multiple":A=b;default:b!==V&&Me(e,i,g,b,f,V)}i=O,u=A,f=ut,lt!=null?xr(e,!!u,lt,!1):!!f!=!!u&&(i!=null?xr(e,!!u,i,!0):xr(e,!!u,u?[]:"",!1));return;case"textarea":ut=lt=null;for(O in u)if(g=u[O],u.hasOwnProperty(O)&&g!=null&&!f.hasOwnProperty(O))switch(O){case"value":break;case"children":break;default:Me(e,i,O,null,f,g)}for(A in f)if(g=f[A],b=u[A],f.hasOwnProperty(A)&&(g!=null||b!=null))switch(A){case"value":lt=g;break;case"defaultValue":ut=g;break;case"children":break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(l(91));break;default:g!==b&&Me(e,i,A,g,f,b)}bf(e,lt,ut);return;case"option":for(var Ct in u)if(lt=u[Ct],u.hasOwnProperty(Ct)&&lt!=null&&!f.hasOwnProperty(Ct))switch(Ct){case"selected":e.selected=!1;break;default:Me(e,i,Ct,null,f,lt)}for(V in f)if(lt=f[V],ut=u[V],f.hasOwnProperty(V)&&lt!==ut&&(lt!=null||ut!=null))switch(V){case"selected":e.selected=lt&&typeof lt!="function"&&typeof lt!="symbol";break;default:Me(e,i,V,lt,f,ut)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var jt in u)lt=u[jt],u.hasOwnProperty(jt)&&lt!=null&&!f.hasOwnProperty(jt)&&Me(e,i,jt,null,f,lt);for(at in f)if(lt=f[at],ut=u[at],f.hasOwnProperty(at)&&lt!==ut&&(lt!=null||ut!=null))switch(at){case"children":case"dangerouslySetInnerHTML":if(lt!=null)throw Error(l(137,i));break;default:Me(e,i,at,lt,f,ut)}return;default:if(bu(i)){for(var Re in u)lt=u[Re],u.hasOwnProperty(Re)&&lt!==void 0&&!f.hasOwnProperty(Re)&&yy(e,i,Re,void 0,f,lt);for(ft in f)lt=f[ft],ut=u[ft],!f.hasOwnProperty(ft)||lt===ut||lt===void 0&&ut===void 0||yy(e,i,ft,lt,f,ut);return}}for(var P in u)lt=u[P],u.hasOwnProperty(P)&&lt!=null&&!f.hasOwnProperty(P)&&Me(e,i,P,null,f,lt);for(yt in f)lt=f[yt],ut=u[yt],!f.hasOwnProperty(yt)||lt===ut||lt==null&&ut==null||Me(e,i,yt,lt,f,ut)}function kg(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o2(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,u=performance.getEntriesByType("resource"),f=0;f<u.length;f++){var g=u[f],b=g.transferSize,A=g.initiatorType,O=g.duration;if(b&&O&&kg(A)){for(A=0,O=g.responseEnd,f+=1;f<u.length;f++){var V=u[f],at=V.startTime;if(at>O)break;var ft=V.transferSize,yt=V.initiatorType;ft&&kg(yt)&&(V=V.responseEnd,A+=ft*(V<O?1:(O-at)/(V-at)))}if(--f,i+=8*(b+A)/(g.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var gy=null,vy=null;function Xm(e){return e.nodeType===9?e:e.ownerDocument}function Qg(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Kg(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function xy(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var by=null;function c2(){var e=window.event;return e&&e.type==="popstate"?e===by?!1:(by=e,!0):(by=null,!1)}var Zg=typeof setTimeout=="function"?setTimeout:void 0,f2=typeof clearTimeout=="function"?clearTimeout:void 0,Fg=typeof Promise=="function"?Promise:void 0,h2=typeof queueMicrotask=="function"?queueMicrotask:typeof Fg<"u"?function(e){return Fg.resolve(null).then(e).catch(d2)}:Zg;function d2(e){setTimeout(function(){throw e})}function Ir(e){return e==="head"}function Wg(e,i){var u=i,f=0;do{var g=u.nextSibling;if(e.removeChild(u),g&&g.nodeType===8)if(u=g.data,u==="/$"||u==="/&"){if(f===0){e.removeChild(g),Xc(i);return}f--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")f++;else if(u==="html")Gh(e.ownerDocument.documentElement);else if(u==="head"){u=e.ownerDocument.head,Gh(u);for(var b=u.firstChild;b;){var A=b.nextSibling,O=b.nodeName;b[As]||O==="SCRIPT"||O==="STYLE"||O==="LINK"&&b.rel.toLowerCase()==="stylesheet"||u.removeChild(b),b=A}}else u==="body"&&Gh(e.ownerDocument.body);u=g}while(u);Xc(i)}function Jg(e,i){var u=e;e=0;do{var f=u.nextSibling;if(u.nodeType===1?i?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(i?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),f&&f.nodeType===8)if(u=f.data,u==="/$"){if(e===0)break;e--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||e++;u=f}while(u)}function Sy(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var u=i;switch(i=i.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Sy(u),pu(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}e.removeChild(u)}}function m2(e,i,u,f){for(;e.nodeType===1;){var g=u;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(f){if(!e[As])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(b=e.getAttribute("rel"),b==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(b!==g.rel||e.getAttribute("href")!==(g.href==null||g.href===""?null:g.href)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin)||e.getAttribute("title")!==(g.title==null?null:g.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(b=e.getAttribute("src"),(b!==(g.src==null?null:g.src)||e.getAttribute("type")!==(g.type==null?null:g.type)||e.getAttribute("crossorigin")!==(g.crossOrigin==null?null:g.crossOrigin))&&b&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var b=g.name==null?null:""+g.name;if(g.type==="hidden"&&e.getAttribute("name")===b)return e}else return e;if(e=Ki(e.nextSibling),e===null)break}return null}function p2(e,i,u){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!u||(e=Ki(e.nextSibling),e===null))return null;return e}function Pg(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Ki(e.nextSibling),e===null))return null;return e}function _y(e){return e.data==="$?"||e.data==="$~"}function Ty(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function y2(e,i){var u=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||u.readyState!=="loading")i();else{var f=function(){i(),u.removeEventListener("DOMContentLoaded",f)};u.addEventListener("DOMContentLoaded",f),e._reactRetry=f}}function Ki(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var Ey=null;function Ig(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var u=e.data;if(u==="/$"||u==="/&"){if(i===0)return Ki(e.nextSibling);i--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||i++}e=e.nextSibling}return null}function $g(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var u=e.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(i===0)return e;i--}else u!=="/$"&&u!=="/&"||i++}e=e.previousSibling}return null}function tv(e,i,u){switch(i=Xm(u),e){case"html":if(e=i.documentElement,!e)throw Error(l(452));return e;case"head":if(e=i.head,!e)throw Error(l(453));return e;case"body":if(e=i.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function Gh(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);pu(e)}var Zi=new Map,ev=new Set;function Vm(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var nr=Q.d;Q.d={f:g2,r:v2,D:x2,C:b2,L:S2,m:_2,X:E2,S:T2,M:C2};function g2(){var e=nr.f(),i=B();return e||i}function v2(e){var i=we(e);i!==null&&i.tag===5&&i.type==="form"?Mh(i):nr.r(e)}var Yc=typeof document>"u"?null:document;function nv(e,i,u){var f=Yc;if(f&&typeof i=="string"&&i){var g=xa(i);g='link[rel="'+e+'"][href="'+g+'"]',typeof u=="string"&&(g+='[crossorigin="'+u+'"]'),ev.has(g)||(ev.add(g),e={rel:e,crossOrigin:u,href:i},f.querySelector(g)===null&&(i=f.createElement("link"),Pn(i,"link",e),tn(i),f.head.appendChild(i)))}}function x2(e){nr.D(e),nv("dns-prefetch",e,null)}function b2(e,i){nr.C(e,i),nv("preconnect",e,i)}function S2(e,i,u){nr.L(e,i,u);var f=Yc;if(f&&e&&i){var g='link[rel="preload"][as="'+xa(i)+'"]';i==="image"&&u&&u.imageSrcSet?(g+='[imagesrcset="'+xa(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(g+='[imagesizes="'+xa(u.imageSizes)+'"]')):g+='[href="'+xa(e)+'"]';var b=g;switch(i){case"style":b=qc(e);break;case"script":b=Lc(e)}Zi.has(b)||(e=_({rel:"preload",href:i==="image"&&u&&u.imageSrcSet?void 0:e,as:i},u),Zi.set(b,e),f.querySelector(g)!==null||i==="style"&&f.querySelector(Yh(b))||i==="script"&&f.querySelector(qh(b))||(i=f.createElement("link"),Pn(i,"link",e),tn(i),f.head.appendChild(i)))}}function _2(e,i){nr.m(e,i);var u=Yc;if(u&&e){var f=i&&typeof i.as=="string"?i.as:"script",g='link[rel="modulepreload"][as="'+xa(f)+'"][href="'+xa(e)+'"]',b=g;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":b=Lc(e)}if(!Zi.has(b)&&(e=_({rel:"modulepreload",href:e},i),Zi.set(b,e),u.querySelector(g)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(qh(b)))return}f=u.createElement("link"),Pn(f,"link",e),tn(f),u.head.appendChild(f)}}}function T2(e,i,u){nr.S(e,i,u);var f=Yc;if(f&&e){var g=il(f).hoistableStyles,b=qc(e);i=i||"default";var A=g.get(b);if(!A){var O={loading:0,preload:null};if(A=f.querySelector(Yh(b)))O.loading=5;else{e=_({rel:"stylesheet",href:e,"data-precedence":i},u),(u=Zi.get(b))&&Cy(e,u);var V=A=f.createElement("link");tn(V),Pn(V,"link",e),V._p=new Promise(function(at,ft){V.onload=at,V.onerror=ft}),V.addEventListener("load",function(){O.loading|=1}),V.addEventListener("error",function(){O.loading|=2}),O.loading|=4,km(A,i,f)}A={type:"stylesheet",instance:A,count:1,state:O},g.set(b,A)}}}function E2(e,i){nr.X(e,i);var u=Yc;if(u&&e){var f=il(u).hoistableScripts,g=Lc(e),b=f.get(g);b||(b=u.querySelector(qh(g)),b||(e=_({src:e,async:!0},i),(i=Zi.get(g))&&Ay(e,i),b=u.createElement("script"),tn(b),Pn(b,"link",e),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(g,b))}}function C2(e,i){nr.M(e,i);var u=Yc;if(u&&e){var f=il(u).hoistableScripts,g=Lc(e),b=f.get(g);b||(b=u.querySelector(qh(g)),b||(e=_({src:e,async:!0,type:"module"},i),(i=Zi.get(g))&&Ay(e,i),b=u.createElement("script"),tn(b),Pn(b,"link",e),u.head.appendChild(b)),b={type:"script",instance:b,count:1,state:null},f.set(g,b))}}function av(e,i,u,f){var g=(g=At.current)?Vm(g):null;if(!g)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(i=qc(u.href),u=il(g).hoistableStyles,f=u.get(i),f||(f={type:"style",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){e=qc(u.href);var b=il(g).hoistableStyles,A=b.get(e);if(A||(g=g.ownerDocument||g,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},b.set(e,A),(b=g.querySelector(Yh(e)))&&!b._p&&(A.instance=b,A.state.loading=5),Zi.has(e)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},Zi.set(e,u),b||A2(g,e,u,A.state))),i&&f===null)throw Error(l(528,""));return A}if(i&&f!==null)throw Error(l(529,""));return null;case"script":return i=u.async,u=u.src,typeof u=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Lc(u),u=il(g).hoistableScripts,f=u.get(i),f||(f={type:"script",instance:null,count:0,state:null},u.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function qc(e){return'href="'+xa(e)+'"'}function Yh(e){return'link[rel="stylesheet"]['+e+"]"}function iv(e){return _({},e,{"data-precedence":e.precedence,precedence:null})}function A2(e,i,u,f){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=e.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),Pn(i,"link",u),tn(i),e.head.appendChild(i))}function Lc(e){return'[src="'+xa(e)+'"]'}function qh(e){return"script[async]"+e}function lv(e,i,u){if(i.count++,i.instance===null)switch(i.type){case"style":var f=e.querySelector('style[data-href~="'+xa(u.href)+'"]');if(f)return i.instance=f,tn(f),f;var g=_({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return f=(e.ownerDocument||e).createElement("style"),tn(f),Pn(f,"style",g),km(f,u.precedence,e),i.instance=f;case"stylesheet":g=qc(u.href);var b=e.querySelector(Yh(g));if(b)return i.state.loading|=4,i.instance=b,tn(b),b;f=iv(u),(g=Zi.get(g))&&Cy(f,g),b=(e.ownerDocument||e).createElement("link"),tn(b);var A=b;return A._p=new Promise(function(O,V){A.onload=O,A.onerror=V}),Pn(b,"link",f),i.state.loading|=4,km(b,u.precedence,e),i.instance=b;case"script":return b=Lc(u.src),(g=e.querySelector(qh(b)))?(i.instance=g,tn(g),g):(f=u,(g=Zi.get(b))&&(f=_({},u),Ay(f,g)),e=e.ownerDocument||e,g=e.createElement("script"),tn(g),Pn(g,"link",f),e.head.appendChild(g),i.instance=g);case"void":return null;default:throw Error(l(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,km(f,u.precedence,e));return i.instance}function km(e,i,u){for(var f=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),g=f.length?f[f.length-1]:null,b=g,A=0;A<f.length;A++){var O=f[A];if(O.dataset.precedence===i)b=O;else if(b!==g)break}b?b.parentNode.insertBefore(e,b.nextSibling):(i=u.nodeType===9?u.head:u,i.insertBefore(e,i.firstChild))}function Cy(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function Ay(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var Qm=null;function sv(e,i,u){if(Qm===null){var f=new Map,g=Qm=new Map;g.set(u,f)}else g=Qm,f=g.get(u),f||(f=new Map,g.set(u,f));if(f.has(e))return f;for(f.set(e,null),u=u.getElementsByTagName(e),g=0;g<u.length;g++){var b=u[g];if(!(b[As]||b[Pt]||e==="link"&&b.getAttribute("rel")==="stylesheet")&&b.namespaceURI!=="http://www.w3.org/2000/svg"){var A=b.getAttribute(i)||"";A=e+A;var O=f.get(A);O?O.push(b):f.set(A,[b])}}return f}function rv(e,i,u){e=e.ownerDocument||e,e.head.insertBefore(u,i==="title"?e.querySelector("head > title"):null)}function M2(e,i,u){if(u===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function uv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function R2(e,i,u,f){if(u.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var g=qc(f.href),b=i.querySelector(Yh(g));if(b){i=b._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Km.bind(e),i.then(e,e)),u.state.loading|=4,u.instance=b,tn(b);return}b=i.ownerDocument||i,f=iv(f),(g=Zi.get(g))&&Cy(f,g),b=b.createElement("link"),tn(b);var A=b;A._p=new Promise(function(O,V){A.onload=O,A.onerror=V}),Pn(b,"link",f),u.instance=b}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(u,i),(i=u.state.preload)&&(u.state.loading&3)===0&&(e.count++,u=Km.bind(e),i.addEventListener("load",u),i.addEventListener("error",u))}}var My=0;function z2(e,i){return e.stylesheets&&e.count===0&&Fm(e,e.stylesheets),0<e.count||0<e.imgCount?function(u){var f=setTimeout(function(){if(e.stylesheets&&Fm(e,e.stylesheets),e.unsuspend){var b=e.unsuspend;e.unsuspend=null,b()}},6e4+i);0<e.imgBytes&&My===0&&(My=62500*o2());var g=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Fm(e,e.stylesheets),e.unsuspend)){var b=e.unsuspend;e.unsuspend=null,b()}},(e.imgBytes>My?50:800)+i);return e.unsuspend=u,function(){e.unsuspend=null,clearTimeout(f),clearTimeout(g)}}:null}function Km(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Fm(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Zm=null;function Fm(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Zm=new Map,i.forEach(w2,e),Zm=null,Km.call(e))}function w2(e,i){if(!(i.state.loading&4)){var u=Zm.get(e);if(u)var f=u.get(null);else{u=new Map,Zm.set(e,u);for(var g=e.querySelectorAll("link[data-precedence],style[data-precedence]"),b=0;b<g.length;b++){var A=g[b];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),f=A)}f&&u.set(null,f)}g=i.instance,A=g.getAttribute("data-precedence"),b=u.get(A)||f,b===f&&u.set(null,g),u.set(A,g),this.count++,f=Km.bind(this),g.addEventListener("load",f),g.addEventListener("error",f),b?b.parentNode.insertBefore(g,b.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(g,e.firstChild)),i.state.loading|=4}}var Lh={$$typeof:j,Provider:null,Consumer:null,_currentValue:ot,_currentValue2:ot,_threadCount:0};function D2(e,i,u,f,g,b,A,O,V){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=yr(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=yr(0),this.hiddenUpdates=yr(null),this.identifierPrefix=f,this.onUncaughtError=g,this.onCaughtError=b,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function ov(e,i,u,f,g,b,A,O,V,at,ft,yt){return e=new D2(e,i,u,A,V,at,ft,yt,O),i=1,b===!0&&(i|=24),b=Qn(3,null,null,i),e.current=b,b.stateNode=e,i=Wf(),i.refCount++,e.pooledCache=i,i.refCount++,b.memoizedState={element:f,isDehydrated:u,cache:i},eh(b),e}function cv(e){return e?(e=$l,e):$l}function fv(e,i,u,f,g,b){g=cv(g),f.context===null?f.context=g:f.pendingContext=g,f=Hi(i),f.payload={element:u},b=b===void 0?null:b,b!==null&&(f.callback=b),u=yl(e,f,i),u!==null&&(r(u,e,i),rs(u,e,i))}function hv(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var u=e.retryLane;e.retryLane=u!==0&&u<i?u:i}}function Ry(e,i){hv(e,i),(e=e.alternate)&&hv(e,i)}function dv(e){if(e.tag===13||e.tag===31){var i=Il(e,67108864);i!==null&&r(i,e,67108864),Ry(e,67108864)}}function mv(e){if(e.tag===13||e.tag===31){var i=Jn();i=Ai(i);var u=Il(e,i);u!==null&&r(u,e,i),Ry(e,i)}}var Wm=!0;function O2(e,i,u,f){var g=H.T;H.T=null;var b=Q.p;try{Q.p=2,zy(e,i,u,f)}finally{Q.p=b,H.T=g}}function N2(e,i,u,f){var g=H.T;H.T=null;var b=Q.p;try{Q.p=8,zy(e,i,u,f)}finally{Q.p=b,H.T=g}}function zy(e,i,u,f){if(Wm){var g=wy(f);if(g===null)py(e,i,f,Jm,u),yv(e,f);else if(j2(g,e,i,u,f))f.stopPropagation();else if(yv(e,f),i&4&&-1<B2.indexOf(e)){for(;g!==null;){var b=we(g);if(b!==null)switch(b.tag){case 3:if(b=b.stateNode,b.current.memoizedState.isDehydrated){var A=Ci(b.pendingLanes);if(A!==0){var O=b;for(O.pendingLanes|=2,O.entangledLanes|=2;A;){var V=1<<31-Vn(A);O.entanglements[1]|=V,A&=~V}ys(b),(ne&6)===0&&(ja=na()+500,jh(0))}}break;case 31:case 13:O=Il(b,2),O!==null&&r(O,b,2),B(),Ry(b,2)}if(b=wy(f),b===null&&py(e,i,f,Jm,u),b===g)break;g=b}g!==null&&f.stopPropagation()}else py(e,i,f,null,u)}}function wy(e){return e=Go(e),Dy(e)}var Jm=null;function Dy(e){if(Jm=null,e=cn(e),e!==null){var i=c(e);if(i===null)e=null;else{var u=i.tag;if(u===13){if(e=h(i),e!==null)return e;e=null}else if(u===31){if(e=m(i),e!==null)return e;e=null}else if(u===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Jm=e,null}function pv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Cd()){case Ad:return 2;case Ao:return 8;case Mo:case Md:return 32;case Rd:return 268435456;default:return 32}default:return 32}}var Oy=!1,$r=null,tu=null,eu=null,Xh=new Map,Vh=new Map,nu=[],B2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function yv(e,i){switch(e){case"focusin":case"focusout":$r=null;break;case"dragenter":case"dragleave":tu=null;break;case"mouseover":case"mouseout":eu=null;break;case"pointerover":case"pointerout":Xh.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Vh.delete(i.pointerId)}}function kh(e,i,u,f,g,b){return e===null||e.nativeEvent!==b?(e={blockedOn:i,domEventName:u,eventSystemFlags:f,nativeEvent:b,targetContainers:[g]},i!==null&&(i=we(i),i!==null&&dv(i)),e):(e.eventSystemFlags|=f,i=e.targetContainers,g!==null&&i.indexOf(g)===-1&&i.push(g),e)}function j2(e,i,u,f,g){switch(i){case"focusin":return $r=kh($r,e,i,u,f,g),!0;case"dragenter":return tu=kh(tu,e,i,u,f,g),!0;case"mouseover":return eu=kh(eu,e,i,u,f,g),!0;case"pointerover":var b=g.pointerId;return Xh.set(b,kh(Xh.get(b)||null,e,i,u,f,g)),!0;case"gotpointercapture":return b=g.pointerId,Vh.set(b,kh(Vh.get(b)||null,e,i,u,f,g)),!0}return!1}function gv(e){var i=cn(e.target);if(i!==null){var u=c(i);if(u!==null){if(i=u.tag,i===13){if(i=h(u),i!==null){e.blockedOn=i,Mi(e.priority,function(){mv(u)});return}}else if(i===31){if(i=m(u),i!==null){e.blockedOn=i,Mi(e.priority,function(){mv(u)});return}}else if(i===3&&u.stateNode.current.memoizedState.isDehydrated){e.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Pm(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var u=wy(e.nativeEvent);if(u===null){u=e.nativeEvent;var f=new u.constructor(u.type,u);_u=f,u.target.dispatchEvent(f),_u=null}else return i=we(u),i!==null&&dv(i),e.blockedOn=u,!1;i.shift()}return!0}function vv(e,i,u){Pm(e)&&u.delete(i)}function U2(){Oy=!1,$r!==null&&Pm($r)&&($r=null),tu!==null&&Pm(tu)&&(tu=null),eu!==null&&Pm(eu)&&(eu=null),Xh.forEach(vv),Vh.forEach(vv)}function Im(e,i){e.blockedOn===i&&(e.blockedOn=null,Oy||(Oy=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,U2)))}var $m=null;function xv(e){$m!==e&&($m=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){$m===e&&($m=null);for(var i=0;i<e.length;i+=3){var u=e[i],f=e[i+1],g=e[i+2];if(typeof f!="function"){if(Dy(f||u)===null)continue;break}var b=we(u);b!==null&&(e.splice(i,3),i-=3,Ah(b,{pending:!0,data:g,method:u.method,action:f},f,g))}}))}function Xc(e){function i(V){return Im(V,e)}$r!==null&&Im($r,e),tu!==null&&Im(tu,e),eu!==null&&Im(eu,e),Xh.forEach(i),Vh.forEach(i);for(var u=0;u<nu.length;u++){var f=nu[u];f.blockedOn===e&&(f.blockedOn=null)}for(;0<nu.length&&(u=nu[0],u.blockedOn===null);)gv(u),u.blockedOn===null&&nu.shift();if(u=(e.ownerDocument||e).$$reactFormReplay,u!=null)for(f=0;f<u.length;f+=3){var g=u[f],b=u[f+1],A=g[wn]||null;if(typeof b=="function")A||xv(u);else if(A){var O=null;if(b&&b.hasAttribute("formAction")){if(g=b,A=b[wn]||null)O=A.formAction;else if(Dy(g)!==null)continue}else O=A.action;typeof O=="function"?u[f+1]=O:(u.splice(f,3),f-=3),xv(u)}}}function bv(){function e(b){b.canIntercept&&b.info==="react-transition"&&b.intercept({handler:function(){return new Promise(function(A){return g=A})},focusReset:"manual",scroll:"manual"})}function i(){g!==null&&(g(),g=null),f||setTimeout(u,20)}function u(){if(!f&&!navigation.transition){var b=navigation.currentEntry;b&&b.url!=null&&navigation.navigate(b.url,{state:b.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,g=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(u,100),function(){f=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),g!==null&&(g(),g=null)}}}function Ny(e){this._internalRoot=e}tp.prototype.render=Ny.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(l(409));var u=i.current,f=Jn();fv(u,f,e,i,null,null)},tp.prototype.unmount=Ny.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;fv(e.current,2,null,e,null,null),B(),i[Hl]=null}};function tp(e){this._internalRoot=e}tp.prototype.unstable_scheduleHydration=function(e){if(e){var i=nl();e={blockedOn:null,target:e,priority:i};for(var u=0;u<nu.length&&i!==0&&i<nu[u].priority;u++);nu.splice(u,0,e),u===0&&gv(e)}};var Sv=t.version;if(Sv!=="19.2.4")throw Error(l(527,Sv,"19.2.4"));Q.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=y(i),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var H2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:H,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ep=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ep.isDisabled&&ep.supportsFiber)try{Va=ep.inject(H2),$e=ep}catch{}}return Kh.createRoot=function(e,i){if(!o(e))throw Error(l(299));var u=!1,f="",g=wh,b=Nm,A=Cc;return i!=null&&(i.unstable_strictMode===!0&&(u=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(g=i.onUncaughtError),i.onCaughtError!==void 0&&(b=i.onCaughtError),i.onRecoverableError!==void 0&&(A=i.onRecoverableError)),i=ov(e,1,!1,null,null,u,f,null,g,b,A,bv),e[Hl]=i.current,my(e),new Ny(i)},Kh.hydrateRoot=function(e,i,u){if(!o(e))throw Error(l(299));var f=!1,g="",b=wh,A=Nm,O=Cc,V=null;return u!=null&&(u.unstable_strictMode===!0&&(f=!0),u.identifierPrefix!==void 0&&(g=u.identifierPrefix),u.onUncaughtError!==void 0&&(b=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(O=u.onRecoverableError),u.formState!==void 0&&(V=u.formState)),i=ov(e,1,!0,i,u??null,f,g,V,b,A,O,bv),i.context=cv(null),u=i.current,f=Jn(),f=Ai(f),g=Hi(f),g.callback=null,yl(u,g,f),u=f,i.current.lanes=u,gr(i,u),ys(i),e[Hl]=i.current,my(e),new tp(i)},Kh.version="19.2.4",Kh}var Ov;function W2(){if(Ov)return Uy.exports;Ov=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),Uy.exports=F2(),Uy.exports}var J2=W2();/**
51
- * react-router v7.13.1
52
- *
53
- * Copyright (c) Remix Software Inc.
54
- *
55
- * This source code is licensed under the MIT license found in the
56
- * LICENSE.md file in the root directory of this source tree.
57
- *
58
- * @license MIT
59
- */var Nv="popstate";function Bv(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function P2(n={}){function t(l,o){var y;let c=(y=o.state)==null?void 0:y.masked,{pathname:h,search:m,hash:p}=c||l.location;return R0("",{pathname:h,search:m,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",c?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function a(l,o){return typeof o=="string"?o:hd(o)}return $2(t,a,null,n)}function ke(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function Nl(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function I2(){return Math.random().toString(36).substring(2,10)}function jv(n,t){return{usr:n.state,key:n.key,idx:t,masked:n.unstable_mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function R0(n,t,a=null,l,o){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof t=="string"?cf(t):t,state:a,key:t&&t.key||l||I2(),unstable_mask:o}}function hd({pathname:n="/",search:t="",hash:a=""}){return t&&t!=="?"&&(n+=t.charAt(0)==="?"?t:"?"+t),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function cf(n){let t={};if(n){let a=n.indexOf("#");a>=0&&(t.hash=n.substring(a),n=n.substring(0,a));let l=n.indexOf("?");l>=0&&(t.search=n.substring(l),n=n.substring(0,l)),n&&(t.pathname=n)}return t}function $2(n,t,a,l={}){let{window:o=document.defaultView,v5Compat:c=!1}=l,h=o.history,m="POP",p=null,y=x();y==null&&(y=0,h.replaceState({...h.state,idx:y},""));function x(){return(h.state||{idx:null}).idx}function _(){m="POP";let z=x(),D=z==null?null:z-y;y=z,p&&p({action:m,location:w.location,delta:D})}function T(z,D){m="PUSH";let N=Bv(z)?z:R0(w.location,z,D);y=x()+1;let j=jv(N,y),G=w.createHref(N.unstable_mask||N);try{h.pushState(j,"",G)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;o.location.assign(G)}c&&p&&p({action:m,location:w.location,delta:1})}function C(z,D){m="REPLACE";let N=Bv(z)?z:R0(w.location,z,D);y=x();let j=jv(N,y),G=w.createHref(N.unstable_mask||N);h.replaceState(j,"",G),c&&p&&p({action:m,location:w.location,delta:0})}function M(z){return t_(z)}let w={get action(){return m},get location(){return n(o,h)},listen(z){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(Nv,_),p=z,()=>{o.removeEventListener(Nv,_),p=null}},createHref(z){return t(o,z)},createURL:M,encodeLocation(z){let D=M(z);return{pathname:D.pathname,search:D.search,hash:D.hash}},push:T,replace:C,go(z){return h.go(z)}};return w}function t_(n,t=!1){let a="http://localhost";typeof window<"u"&&(a=window.location.origin!=="null"?window.location.origin:window.location.href),ke(a,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:hd(n);return l=l.replace(/ $/,"%20"),!t&&l.startsWith("//")&&(l=a+l),new URL(l,a)}function Yx(n,t,a="/"){return e_(n,t,a,!1)}function e_(n,t,a,l){let o=typeof t=="string"?cf(t):t,c=fr(o.pathname||"/",a);if(c==null)return null;let h=qx(n);n_(h);let m=null;for(let p=0;m==null&&p<h.length;++p){let y=d_(c);m=f_(h[p],y,l)}return m}function qx(n,t=[],a=[],l="",o=!1){let c=(h,m,p=o,y)=>{let x={relativePath:y===void 0?h.path||"":y,caseSensitive:h.caseSensitive===!0,childrenIndex:m,route:h};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(l)&&p)return;ke(x.relativePath.startsWith(l),`Absolute route path "${x.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(l.length)}let _=Ss([l,x.relativePath]),T=a.concat(x);h.children&&h.children.length>0&&(ke(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${_}".`),qx(h.children,t,T,_,p)),!(h.path==null&&!h.index)&&t.push({path:_,score:o_(_,h.index),routesMeta:T})};return n.forEach((h,m)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))c(h,m);else for(let y of Lx(h.path))c(h,m,!0,y)}),t}function Lx(n){let t=n.split("/");if(t.length===0)return[];let[a,...l]=t,o=a.endsWith("?"),c=a.replace(/\?$/,"");if(l.length===0)return o?[c,""]:[c];let h=Lx(l.join("/")),m=[];return m.push(...h.map(p=>p===""?c:[c,p].join("/"))),o&&m.push(...h),m.map(p=>n.startsWith("/")&&p===""?"/":p)}function n_(n){n.sort((t,a)=>t.score!==a.score?a.score-t.score:c_(t.routesMeta.map(l=>l.childrenIndex),a.routesMeta.map(l=>l.childrenIndex)))}var a_=/^:[\w-]+$/,i_=3,l_=2,s_=1,r_=10,u_=-2,Uv=n=>n==="*";function o_(n,t){let a=n.split("/"),l=a.length;return a.some(Uv)&&(l+=u_),t&&(l+=l_),a.filter(o=>!Uv(o)).reduce((o,c)=>o+(a_.test(c)?i_:c===""?s_:r_),l)}function c_(n,t){return n.length===t.length&&n.slice(0,-1).every((l,o)=>l===t[o])?n[n.length-1]-t[t.length-1]:0}function f_(n,t,a=!1){let{routesMeta:l}=n,o={},c="/",h=[];for(let m=0;m<l.length;++m){let p=l[m],y=m===l.length-1,x=c==="/"?t:t.slice(c.length)||"/",_=zp({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},x),T=p.route;if(!_&&y&&a&&!l[l.length-1].route.index&&(_=zp({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},x)),!_)return null;Object.assign(o,_.params),h.push({params:o,pathname:Ss([c,_.pathname]),pathnameBase:g_(Ss([c,_.pathnameBase])),route:T}),_.pathnameBase!=="/"&&(c=Ss([c,_.pathnameBase]))}return h}function zp(n,t){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[a,l]=h_(n.path,n.caseSensitive,n.end),o=t.match(a);if(!o)return null;let c=o[0],h=c.replace(/(.)\/+$/,"$1"),m=o.slice(1);return{params:l.reduce((y,{paramName:x,isOptional:_},T)=>{if(x==="*"){let M=m[T]||"";h=c.slice(0,c.length-M.length).replace(/(.)\/+$/,"$1")}const C=m[T];return _&&!C?y[x]=void 0:y[x]=(C||"").replace(/%2F/g,"/"),y},{}),pathname:c,pathnameBase:h,pattern:n}}function h_(n,t=!1,a=!0){Nl(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],o="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,m,p,y,x)=>{if(l.push({paramName:m,isOptional:p!=null}),p){let _=x.charAt(y+h.length);return _&&_!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),o+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":n!==""&&n!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,t?void 0:"i"),l]}function d_(n){try{return n.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Nl(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),n}}function fr(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let a=t.endsWith("/")?t.length-1:t.length,l=n.charAt(a);return l&&l!=="/"?null:n.slice(a)||"/"}var m_=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function p_(n,t="/"){let{pathname:a,search:l="",hash:o=""}=typeof n=="string"?cf(n):n,c;return a?(a=a.replace(/\/\/+/g,"/"),a.startsWith("/")?c=Hv(a.substring(1),"/"):c=Hv(a,t)):c=t,{pathname:c,search:v_(l),hash:x_(o)}}function Hv(n,t){let a=t.replace(/\/+$/,"").split("/");return n.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function qy(n,t,a,l){return`Cannot include a '${n}' character in a manually specified \`to.${t}\` field [${JSON.stringify(l)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function y_(n){return n.filter((t,a)=>a===0||t.route.path&&t.route.path.length>0)}function ag(n){let t=y_(n);return t.map((a,l)=>l===t.length-1?a.pathname:a.pathnameBase)}function qp(n,t,a,l=!1){let o;typeof n=="string"?o=cf(n):(o={...n},ke(!o.pathname||!o.pathname.includes("?"),qy("?","pathname","search",o)),ke(!o.pathname||!o.pathname.includes("#"),qy("#","pathname","hash",o)),ke(!o.search||!o.search.includes("#"),qy("#","search","hash",o)));let c=n===""||o.pathname==="",h=c?"/":o.pathname,m;if(h==null)m=a;else{let _=t.length-1;if(!l&&h.startsWith("..")){let T=h.split("/");for(;T[0]==="..";)T.shift(),_-=1;o.pathname=T.join("/")}m=_>=0?t[_]:"/"}let p=p_(o,m),y=h&&h!=="/"&&h.endsWith("/"),x=(c||h===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(y||x)&&(p.pathname+="/"),p}var Ss=n=>n.join("/").replace(/\/\/+/g,"/"),g_=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),v_=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,x_=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,b_=class{constructor(n,t,a,l=!1){this.status=n,this.statusText=t||"",this.internal=l,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function S_(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function __(n){return n.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Xx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Vx(n,t){let a=n;if(typeof a!="string"||!m_.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let l=a,o=!1;if(Xx)try{let c=new URL(window.location.href),h=a.startsWith("//")?new URL(c.protocol+a):new URL(a),m=fr(h.pathname,t);h.origin===c.origin&&m!=null?a=m+h.search+h.hash:o=!0}catch{Nl(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var kx=["POST","PUT","PATCH","DELETE"];new Set(kx);var T_=["GET",...kx];new Set(T_);var ff=Y.createContext(null);ff.displayName="DataRouter";var Lp=Y.createContext(null);Lp.displayName="DataRouterState";var E_=Y.createContext(!1),Qx=Y.createContext({isTransitioning:!1});Qx.displayName="ViewTransition";var C_=Y.createContext(new Map);C_.displayName="Fetchers";var A_=Y.createContext(null);A_.displayName="Await";var Ei=Y.createContext(null);Ei.displayName="Navigation";var xd=Y.createContext(null);xd.displayName="Location";var Bl=Y.createContext({outlet:null,matches:[],isDataRoute:!1});Bl.displayName="Route";var ig=Y.createContext(null);ig.displayName="RouteError";var Kx="REACT_ROUTER_ERROR",M_="REDIRECT",R_="ROUTE_ERROR_RESPONSE";function z_(n){if(n.startsWith(`${Kx}:${M_}:{`))try{let t=JSON.parse(n.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function w_(n){if(n.startsWith(`${Kx}:${R_}:{`))try{let t=JSON.parse(n.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new b_(t.status,t.statusText,t.data)}catch{}}function D_(n,{relative:t}={}){ke(hf(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:l}=Y.useContext(Ei),{hash:o,pathname:c,search:h}=bd(n,{relative:t}),m=c;return a!=="/"&&(m=c==="/"?a:Ss([a,c])),l.createHref({pathname:m,search:h,hash:o})}function hf(){return Y.useContext(xd)!=null}function jl(){return ke(hf(),"useLocation() may be used only in the context of a <Router> component."),Y.useContext(xd).location}var Zx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Fx(n){Y.useContext(Ei).static||Y.useLayoutEffect(n)}function Xp(){let{isDataRoute:n}=Y.useContext(Bl);return n?K_():O_()}function O_(){ke(hf(),"useNavigate() may be used only in the context of a <Router> component.");let n=Y.useContext(ff),{basename:t,navigator:a}=Y.useContext(Ei),{matches:l}=Y.useContext(Bl),{pathname:o}=jl(),c=JSON.stringify(ag(l)),h=Y.useRef(!1);return Fx(()=>{h.current=!0}),Y.useCallback((p,y={})=>{if(Nl(h.current,Zx),!h.current)return;if(typeof p=="number"){a.go(p);return}let x=qp(p,JSON.parse(c),o,y.relative==="path");n==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:Ss([t,x.pathname])),(y.replace?a.replace:a.push)(x,y.state,y)},[t,a,c,o,n])}var N_=Y.createContext(null);function B_(n){let t=Y.useContext(Bl).outlet;return Y.useMemo(()=>t&&Y.createElement(N_.Provider,{value:n},t),[t,n])}function bd(n,{relative:t}={}){let{matches:a}=Y.useContext(Bl),{pathname:l}=jl(),o=JSON.stringify(ag(a));return Y.useMemo(()=>qp(n,JSON.parse(o),l,t==="path"),[n,o,l,t])}function j_(n,t){return Wx(n,t)}function Wx(n,t,a){var z;ke(hf(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=Y.useContext(Ei),{matches:o}=Y.useContext(Bl),c=o[o.length-1],h=c?c.params:{},m=c?c.pathname:"/",p=c?c.pathnameBase:"/",y=c&&c.route;{let D=y&&y.path||"";Px(m,!y||D.endsWith("*")||D.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${D}">) 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
-
61
- Please change the parent <Route path="${D}"> to <Route path="${D==="/"?"*":`${D}/*`}">.`)}let x=jl(),_;if(t){let D=typeof t=="string"?cf(t):t;ke(p==="/"||((z=D.pathname)==null?void 0:z.startsWith(p)),`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 "${p}" but pathname "${D.pathname}" was given in the \`location\` prop.`),_=D}else _=x;let T=_.pathname||"/",C=T;if(p!=="/"){let D=p.replace(/^\//,"").split("/");C="/"+T.replace(/^\//,"").split("/").slice(D.length).join("/")}let M=Yx(n,{pathname:C});Nl(y||M!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),Nl(M==null||M[M.length-1].route.element!==void 0||M[M.length-1].route.Component!==void 0||M[M.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.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 w=q_(M&&M.map(D=>Object.assign({},D,{params:Object.assign({},h,D.params),pathname:Ss([p,l.encodeLocation?l.encodeLocation(D.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathname]),pathnameBase:D.pathnameBase==="/"?p:Ss([p,l.encodeLocation?l.encodeLocation(D.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:D.pathnameBase])})),o,a);return t&&w?Y.createElement(xd.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,..._},navigationType:"POP"}},w):w}function U_(){let n=Q_(),t=S_(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),a=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:l},c={padding:"2px 4px",backgroundColor:l},h=null;return console.error("Error handled by React Router default ErrorBoundary:",n),h=Y.createElement(Y.Fragment,null,Y.createElement("p",null,"💿 Hey developer 👋"),Y.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",Y.createElement("code",{style:c},"ErrorBoundary")," or"," ",Y.createElement("code",{style:c},"errorElement")," prop on your route.")),Y.createElement(Y.Fragment,null,Y.createElement("h2",null,"Unexpected Application Error!"),Y.createElement("h3",{style:{fontStyle:"italic"}},t),a?Y.createElement("pre",{style:o},a):null,h)}var H_=Y.createElement(U_,null),Jx=class extends Y.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,t){return t.location!==n.location||t.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:t.error,location:t.location,revalidation:n.revalidation||t.revalidation}}componentDidCatch(n,t){this.props.onError?this.props.onError(n,t):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const a=w_(n.digest);a&&(n=a)}let t=n!==void 0?Y.createElement(Bl.Provider,{value:this.props.routeContext},Y.createElement(ig.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?Y.createElement(G_,{error:n},t):t}};Jx.contextType=E_;var Ly=new WeakMap;function G_({children:n,error:t}){let{basename:a}=Y.useContext(Ei);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let l=z_(t.digest);if(l){let o=Ly.get(t);if(o)throw o;let c=Vx(l.location,a);if(Xx&&!Ly.get(t))if(c.isExternal||l.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:l.replace}));throw Ly.set(t,h),h}return Y.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return n}function Y_({routeContext:n,match:t,children:a}){let l=Y.useContext(ff);return l&&l.static&&l.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=t.route.id),Y.createElement(Bl.Provider,{value:n},a)}function q_(n,t=[],a){let l=a==null?void 0:a.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(t.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let o=n,c=l==null?void 0:l.errors;if(c!=null){let x=o.findIndex(_=>_.route.id&&(c==null?void 0:c[_.route.id])!==void 0);ke(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),o=o.slice(0,Math.min(o.length,x+1))}let h=!1,m=-1;if(a&&l){h=l.renderFallback;for(let x=0;x<o.length;x++){let _=o[x];if((_.route.HydrateFallback||_.route.hydrateFallbackElement)&&(m=x),_.route.id){let{loaderData:T,errors:C}=l,M=_.route.loader&&!T.hasOwnProperty(_.route.id)&&(!C||C[_.route.id]===void 0);if(_.route.lazy||M){a.isStatic&&(h=!0),m>=0?o=o.slice(0,m+1):o=[o[0]];break}}}}let p=a==null?void 0:a.onError,y=l&&p?(x,_)=>{var T,C;p(x,{location:l.location,params:((C=(T=l.matches)==null?void 0:T[0])==null?void 0:C.params)??{},unstable_pattern:__(l.matches),errorInfo:_})}:void 0;return o.reduceRight((x,_,T)=>{let C,M=!1,w=null,z=null;l&&(C=c&&_.route.id?c[_.route.id]:void 0,w=_.route.errorElement||H_,h&&(m<0&&T===0?(Px("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),M=!0,z=null):m===T&&(M=!0,z=_.route.hydrateFallbackElement||null)));let D=t.concat(o.slice(0,T+1)),N=()=>{let j;return C?j=w:M?j=z:_.route.Component?j=Y.createElement(_.route.Component,null):_.route.element?j=_.route.element:j=x,Y.createElement(Y_,{match:_,routeContext:{outlet:x,matches:D,isDataRoute:l!=null},children:j})};return l&&(_.route.ErrorBoundary||_.route.errorElement||T===0)?Y.createElement(Jx,{location:l.location,revalidation:l.revalidation,component:w,error:C,children:N(),routeContext:{outlet:null,matches:D,isDataRoute:!0},onError:y}):N()},null)}function lg(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function L_(n){let t=Y.useContext(ff);return ke(t,lg(n)),t}function X_(n){let t=Y.useContext(Lp);return ke(t,lg(n)),t}function V_(n){let t=Y.useContext(Bl);return ke(t,lg(n)),t}function sg(n){let t=V_(n),a=t.matches[t.matches.length-1];return ke(a.route.id,`${n} can only be used on routes that contain a unique "id"`),a.route.id}function k_(){return sg("useRouteId")}function Q_(){var l;let n=Y.useContext(ig),t=X_("useRouteError"),a=sg("useRouteError");return n!==void 0?n:(l=t.errors)==null?void 0:l[a]}function K_(){let{router:n}=L_("useNavigate"),t=sg("useNavigate"),a=Y.useRef(!1);return Fx(()=>{a.current=!0}),Y.useCallback(async(o,c={})=>{Nl(a.current,Zx),a.current&&(typeof o=="number"?await n.navigate(o):await n.navigate(o,{fromRouteId:t,...c}))},[n,t])}var Gv={};function Px(n,t,a){!t&&!Gv[n]&&(Gv[n]=!0,Nl(!1,a))}Y.memo(Z_);function Z_({routes:n,future:t,state:a,isStatic:l,onError:o}){return Wx(n,void 0,{state:a,isStatic:l,onError:o})}function F_({to:n,replace:t,state:a,relative:l}){ke(hf(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=Y.useContext(Ei);Nl(!o,"<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:c}=Y.useContext(Bl),{pathname:h}=jl(),m=Xp(),p=qp(n,ag(c),h,l==="path"),y=JSON.stringify(p);return Y.useEffect(()=>{m(JSON.parse(y),{replace:t,state:a,relative:l})},[m,y,l,t,a]),null}function Yv(n){return B_(n.context)}function Ji(n){ke(!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 W_({basename:n="/",children:t=null,location:a,navigationType:l="POP",navigator:o,static:c=!1,unstable_useTransitions:h}){ke(!hf(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=n.replace(/^\/*/,"/"),p=Y.useMemo(()=>({basename:m,navigator:o,static:c,unstable_useTransitions:h,future:{}}),[m,o,c,h]);typeof a=="string"&&(a=cf(a));let{pathname:y="/",search:x="",hash:_="",state:T=null,key:C="default",unstable_mask:M}=a,w=Y.useMemo(()=>{let z=fr(y,m);return z==null?null:{location:{pathname:z,search:x,hash:_,state:T,key:C,unstable_mask:M},navigationType:l}},[m,y,x,_,T,C,l,M]);return Nl(w!=null,`<Router basename="${m}"> is not able to match the URL "${y}${x}${_}" because it does not start with the basename, so the <Router> won't render anything.`),w==null?null:Y.createElement(Ei.Provider,{value:p},Y.createElement(xd.Provider,{children:t,value:w}))}function J_({children:n,location:t}){return j_(z0(n),t)}function z0(n,t=[]){let a=[];return Y.Children.forEach(n,(l,o)=>{if(!Y.isValidElement(l))return;let c=[...t,o];if(l.type===Y.Fragment){a.push.apply(a,z0(l.props.children,c));return}ke(l.type===Ji,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ke(!l.props.index||!l.props.children,"An index route cannot have child routes.");let h={id:l.props.id||c.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(h.children=z0(l.props.children,c)),a.push(h)}),a}var Ep="get",Cp="application/x-www-form-urlencoded";function Vp(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function P_(n){return Vp(n)&&n.tagName.toLowerCase()==="button"}function I_(n){return Vp(n)&&n.tagName.toLowerCase()==="form"}function $_(n){return Vp(n)&&n.tagName.toLowerCase()==="input"}function tT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function eT(n,t){return n.button===0&&(!t||t==="_self")&&!tT(n)}var ap=null;function nT(){if(ap===null)try{new FormData(document.createElement("form"),0),ap=!1}catch{ap=!0}return ap}var aT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Xy(n){return n!=null&&!aT.has(n)?(Nl(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Cp}"`),null):n}function iT(n,t){let a,l,o,c,h;if(I_(n)){let m=n.getAttribute("action");l=m?fr(m,t):null,a=n.getAttribute("method")||Ep,o=Xy(n.getAttribute("enctype"))||Cp,c=new FormData(n)}else if(P_(n)||$_(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=n.getAttribute("formaction")||m.getAttribute("action");if(l=p?fr(p,t):null,a=n.getAttribute("formmethod")||m.getAttribute("method")||Ep,o=Xy(n.getAttribute("formenctype"))||Xy(m.getAttribute("enctype"))||Cp,c=new FormData(m,n),!nT()){let{name:y,type:x,value:_}=n;if(x==="image"){let T=y?`${y}.`:"";c.append(`${T}x`,"0"),c.append(`${T}y`,"0")}else y&&c.append(y,_)}}else{if(Vp(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=Ep,l=null,o=Cp,h=n}return c&&o==="text/plain"&&(h=c,c=void 0),{action:l,method:a.toLowerCase(),encType:o,formData:c,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rg(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function lT(n,t,a,l){let o=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${l}`:o.pathname=`${o.pathname}.${l}`:o.pathname==="/"?o.pathname=`_root.${l}`:t&&fr(o.pathname,t)==="/"?o.pathname=`${t.replace(/\/$/,"")}/_root.${l}`:o.pathname=`${o.pathname.replace(/\/$/,"")}.${l}`,o}async function sT(n,t){if(n.id in t)return t[n.id];try{let a=await import(n.module);return t[n.id]=a,a}catch(a){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function rT(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function uT(n,t,a){let l=await Promise.all(n.map(async o=>{let c=t.routes[o.route.id];if(c){let h=await sT(c,a);return h.links?h.links():[]}return[]}));return hT(l.flat(1).filter(rT).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function qv(n,t,a,l,o,c){let h=(p,y)=>a[y]?p.route.id!==a[y].route.id:!0,m=(p,y)=>{var x;return a[y].pathname!==p.pathname||((x=a[y].route.path)==null?void 0:x.endsWith("*"))&&a[y].params["*"]!==p.params["*"]};return c==="assets"?t.filter((p,y)=>h(p,y)||m(p,y)):c==="data"?t.filter((p,y)=>{var _;let x=l.routes[p.route.id];if(!x||!x.hasLoader)return!1;if(h(p,y)||m(p,y))return!0;if(p.route.shouldRevalidate){let T=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((_=a[0])==null?void 0:_.params)||{},nextUrl:new URL(n,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof T=="boolean")return T}return!0}):[]}function oT(n,t,{includeHydrateFallback:a}={}){return cT(n.map(l=>{let o=t.routes[l.route.id];if(!o)return[];let c=[o.module];return o.clientActionModule&&(c=c.concat(o.clientActionModule)),o.clientLoaderModule&&(c=c.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(c=c.concat(o.hydrateFallbackModule)),o.imports&&(c=c.concat(o.imports)),c}).flat(1))}function cT(n){return[...new Set(n)]}function fT(n){let t={},a=Object.keys(n).sort();for(let l of a)t[l]=n[l];return t}function hT(n,t){let a=new Set;return new Set(t),n.reduce((l,o)=>{let c=JSON.stringify(fT(o));return a.has(c)||(a.add(c),l.push({key:c,link:o})),l},[])}function Ix(){let n=Y.useContext(ff);return rg(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function dT(){let n=Y.useContext(Lp);return rg(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var ug=Y.createContext(void 0);ug.displayName="FrameworkContext";function $x(){let n=Y.useContext(ug);return rg(n,"You must render this element inside a <HydratedRouter> element"),n}function mT(n,t){let a=Y.useContext(ug),[l,o]=Y.useState(!1),[c,h]=Y.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:y,onMouseLeave:x,onTouchStart:_}=t,T=Y.useRef(null);Y.useEffect(()=>{if(n==="render"&&h(!0),n==="viewport"){let w=D=>{D.forEach(N=>{h(N.isIntersecting)})},z=new IntersectionObserver(w,{threshold:.5});return T.current&&z.observe(T.current),()=>{z.disconnect()}}},[n]),Y.useEffect(()=>{if(l){let w=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(w)}}},[l]);let C=()=>{o(!0)},M=()=>{o(!1),h(!1)};return a?n!=="intent"?[c,T,{}]:[c,T,{onFocus:Zh(m,C),onBlur:Zh(p,M),onMouseEnter:Zh(y,C),onMouseLeave:Zh(x,M),onTouchStart:Zh(_,C)}]:[!1,T,{}]}function Zh(n,t){return a=>{n&&n(a),a.defaultPrevented||t(a)}}function pT({page:n,...t}){let{router:a}=Ix(),l=Y.useMemo(()=>Yx(a.routes,n,a.basename),[a.routes,n,a.basename]);return l?Y.createElement(gT,{page:n,matches:l,...t}):null}function yT(n){let{manifest:t,routeModules:a}=$x(),[l,o]=Y.useState([]);return Y.useEffect(()=>{let c=!1;return uT(n,t,a).then(h=>{c||o(h)}),()=>{c=!0}},[n,t,a]),l}function gT({page:n,matches:t,...a}){let l=jl(),{future:o,manifest:c,routeModules:h}=$x(),{basename:m}=Ix(),{loaderData:p,matches:y}=dT(),x=Y.useMemo(()=>qv(n,t,y,c,l,"data"),[n,t,y,c,l]),_=Y.useMemo(()=>qv(n,t,y,c,l,"assets"),[n,t,y,c,l]),T=Y.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let w=new Set,z=!1;if(t.forEach(N=>{var G;let j=c.routes[N.route.id];!j||!j.hasLoader||(!x.some(k=>k.route.id===N.route.id)&&N.route.id in p&&((G=h[N.route.id])!=null&&G.shouldRevalidate)||j.hasClientLoader?z=!0:w.add(N.route.id))}),w.size===0)return[];let D=lT(n,m,o.unstable_trailingSlashAwareDataRequests,"data");return z&&w.size>0&&D.searchParams.set("_routes",t.filter(N=>w.has(N.route.id)).map(N=>N.route.id).join(",")),[D.pathname+D.search]},[m,o.unstable_trailingSlashAwareDataRequests,p,l,c,x,t,n,h]),C=Y.useMemo(()=>oT(_,c),[_,c]),M=yT(_);return Y.createElement(Y.Fragment,null,T.map(w=>Y.createElement("link",{key:w,rel:"prefetch",as:"fetch",href:w,...a})),C.map(w=>Y.createElement("link",{key:w,rel:"modulepreload",href:w,...a})),M.map(({key:w,link:z})=>Y.createElement("link",{key:w,nonce:a.nonce,...z,crossOrigin:z.crossOrigin??a.crossOrigin})))}function vT(...n){return t=>{n.forEach(a=>{typeof a=="function"?a(t):a!=null&&(a.current=t)})}}var xT=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{xT&&(window.__reactRouterVersion="7.13.1")}catch{}function bT({basename:n,children:t,unstable_useTransitions:a,window:l}){let o=Y.useRef();o.current==null&&(o.current=P2({window:l,v5Compat:!0}));let c=o.current,[h,m]=Y.useState({action:c.action,location:c.location}),p=Y.useCallback(y=>{a===!1?m(y):Y.startTransition(()=>m(y))},[a]);return Y.useLayoutEffect(()=>c.listen(p),[c,p]),Y.createElement(W_,{basename:n,children:t,location:h.location,navigationType:h.action,navigator:c,unstable_useTransitions:a})}var tb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,eb=Y.forwardRef(function({onClick:t,discover:a="render",prefetch:l="none",relative:o,reloadDocument:c,replace:h,unstable_mask:m,state:p,target:y,to:x,preventScrollReset:_,viewTransition:T,unstable_defaultShouldRevalidate:C,...M},w){let{basename:z,navigator:D,unstable_useTransitions:N}=Y.useContext(Ei),j=typeof x=="string"&&tb.test(x),G=Vx(x,z);x=G.to;let k=D_(x,{relative:o}),q=jl(),Z=null;if(m){let St=qp(m,[],q.unstable_mask?q.unstable_mask.pathname:"/",!0);z!=="/"&&(St.pathname=St.pathname==="/"?z:Ss([z,St.pathname])),Z=D.createHref(St)}let[W,L,$]=mT(l,M),et=TT(x,{replace:h,unstable_mask:m,state:p,target:y,preventScrollReset:_,relative:o,viewTransition:T,unstable_defaultShouldRevalidate:C,unstable_useTransitions:N});function ct(St){t&&t(St),St.defaultPrevented||et(St)}let vt=!(G.isExternal||c),dt=Y.createElement("a",{...M,...$,href:(vt?Z:void 0)||G.absoluteURL||k,onClick:vt?ct:t,ref:vT(w,L),target:y,"data-discover":!j&&a==="render"?"true":void 0});return W&&!j?Y.createElement(Y.Fragment,null,dt,Y.createElement(pT,{page:k})):dt});eb.displayName="Link";var nb=Y.forwardRef(function({"aria-current":t="page",caseSensitive:a=!1,className:l="",end:o=!1,style:c,to:h,viewTransition:m,children:p,...y},x){let _=bd(h,{relative:y.relative}),T=jl(),C=Y.useContext(Lp),{navigator:M,basename:w}=Y.useContext(Ei),z=C!=null&&RT(_)&&m===!0,D=M.encodeLocation?M.encodeLocation(_).pathname:_.pathname,N=T.pathname,j=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;a||(N=N.toLowerCase(),j=j?j.toLowerCase():null,D=D.toLowerCase()),j&&w&&(j=fr(j,w)||j);const G=D!=="/"&&D.endsWith("/")?D.length-1:D.length;let k=N===D||!o&&N.startsWith(D)&&N.charAt(G)==="/",q=j!=null&&(j===D||!o&&j.startsWith(D)&&j.charAt(D.length)==="/"),Z={isActive:k,isPending:q,isTransitioning:z},W=k?t:void 0,L;typeof l=="function"?L=l(Z):L=[l,k?"active":null,q?"pending":null,z?"transitioning":null].filter(Boolean).join(" ");let $=typeof c=="function"?c(Z):c;return Y.createElement(eb,{...y,"aria-current":W,className:L,ref:x,style:$,to:h,viewTransition:m},typeof p=="function"?p(Z):p)});nb.displayName="NavLink";var ST=Y.forwardRef(({discover:n="render",fetcherKey:t,navigate:a,reloadDocument:l,replace:o,state:c,method:h=Ep,action:m,onSubmit:p,relative:y,preventScrollReset:x,viewTransition:_,unstable_defaultShouldRevalidate:T,...C},M)=>{let{unstable_useTransitions:w}=Y.useContext(Ei),z=AT(),D=MT(m,{relative:y}),N=h.toLowerCase()==="get"?"get":"post",j=typeof m=="string"&&tb.test(m),G=k=>{if(p&&p(k),k.defaultPrevented)return;k.preventDefault();let q=k.nativeEvent.submitter,Z=(q==null?void 0:q.getAttribute("formmethod"))||h,W=()=>z(q||k.currentTarget,{fetcherKey:t,method:Z,navigate:a,replace:o,state:c,relative:y,preventScrollReset:x,viewTransition:_,unstable_defaultShouldRevalidate:T});w&&a!==!1?Y.startTransition(()=>W()):W()};return Y.createElement("form",{ref:M,method:N,action:D,onSubmit:l?p:G,...C,"data-discover":!j&&n==="render"?"true":void 0})});ST.displayName="Form";function _T(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ab(n){let t=Y.useContext(ff);return ke(t,_T(n)),t}function TT(n,{target:t,replace:a,unstable_mask:l,state:o,preventScrollReset:c,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:p,unstable_useTransitions:y}={}){let x=Xp(),_=jl(),T=bd(n,{relative:h});return Y.useCallback(C=>{if(eT(C,t)){C.preventDefault();let M=a!==void 0?a:hd(_)===hd(T),w=()=>x(n,{replace:M,unstable_mask:l,state:o,preventScrollReset:c,relative:h,viewTransition:m,unstable_defaultShouldRevalidate:p});y?Y.startTransition(()=>w()):w()}},[_,x,T,a,l,o,t,n,c,h,m,p,y])}var ET=0,CT=()=>`__${String(++ET)}__`;function AT(){let{router:n}=ab("useSubmit"),{basename:t}=Y.useContext(Ei),a=k_(),l=n.fetch,o=n.navigate;return Y.useCallback(async(c,h={})=>{let{action:m,method:p,encType:y,formData:x,body:_}=iT(c,t);if(h.navigate===!1){let T=h.fetcherKey||CT();await l(T,a,h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:_,formMethod:h.method||p,formEncType:h.encType||y,flushSync:h.flushSync})}else await o(h.action||m,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:x,body:_,formMethod:h.method||p,formEncType:h.encType||y,replace:h.replace,state:h.state,fromRouteId:a,flushSync:h.flushSync,viewTransition:h.viewTransition})},[l,o,t,a])}function MT(n,{relative:t}={}){let{basename:a}=Y.useContext(Ei),l=Y.useContext(Bl);ke(l,"useFormAction must be used inside a RouteContext");let[o]=l.matches.slice(-1),c={...bd(n||".",{relative:t})},h=jl();if(n==null){c.search=h.search;let m=new URLSearchParams(c.search),p=m.getAll("index");if(p.some(x=>x==="")){m.delete("index"),p.filter(_=>_).forEach(_=>m.append("index",_));let x=m.toString();c.search=x?`?${x}`:""}}return(!n||n===".")&&o.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(c.pathname=c.pathname==="/"?a:Ss([a,c.pathname])),hd(c)}function RT(n,{relative:t}={}){let a=Y.useContext(Qx);ke(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=ab("useViewTransitionState"),o=bd(n,{relative:t});if(!a.isTransitioning)return!1;let c=fr(a.currentLocation.pathname,l)||a.currentLocation.pathname,h=fr(a.nextLocation.pathname,l)||a.nextLocation.pathname;return zp(o.pathname,h)!=null||zp(o.pathname,c)!=null}const Lv=n=>{let t;const a=new Set,l=(y,x)=>{const _=typeof y=="function"?y(t):y;if(!Object.is(_,t)){const T=t;t=x??(typeof _!="object"||_===null)?_:Object.assign({},t,_),a.forEach(C=>C(t,T))}},o=()=>t,m={setState:l,getState:o,getInitialState:()=>p,subscribe:y=>(a.add(y),()=>a.delete(y))},p=t=n(l,o,m);return m},zT=(n=>n?Lv(n):Lv),wT=n=>n;function DT(n,t=wT){const a=np.useSyncExternalStore(n.subscribe,np.useCallback(()=>t(n.getState()),[n,t]),np.useCallback(()=>t(n.getInitialState()),[n,t]));return np.useDebugValue(a),a}const Xv=n=>{const t=zT(n),a=l=>DT(t,l);return Object.assign(a,t),a},Eo=(n=>n?Xv(n):Xv),Ol=Eo(n=>({user:null,isAuthenticated:!1,loading:!1,error:null,login:async(t,a)=>{n({loading:!0,error:null});try{const l=await fetch("/api/auth/login",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:t,password:a}),credentials:"include"}),o=await l.json();if(!l.ok){n({loading:!1,error:o.error||"Login failed"});return}n({user:o.user,isAuthenticated:!0,loading:!1,error:null})}catch{n({loading:!1,error:"Network error"})}},logout:async()=>{try{await fetch("/api/auth/logout",{method:"POST",credentials:"include"})}catch{}n({user:null,isAuthenticated:!1,error:null})},checkAuth:async()=>{n({loading:!0});try{const t=await fetch("/api/auth/me",{credentials:"include"});if(t.ok){const a=await t.json();n({user:a.user,isAuthenticated:!0,loading:!1})}else n({user:null,isAuthenticated:!1,loading:!1})}catch{n({user:null,isAuthenticated:!1,loading:!1})}},reset:()=>n({user:null,isAuthenticated:!1,loading:!1,error:null})})),ei=Eo((n,t)=>({squads:[],selectedSquad:null,activeStates:{},fetchSquads:async()=>{try{const a=await fetch("/api/squads",{credentials:"include"});if(a.ok){const l=await a.json();n({squads:l.squads})}}catch{}},selectSquad:a=>n({selectedSquad:a}),setSquadState:(a,l)=>n(o=>({activeStates:{...o.activeStates,[a]:l}})),clearSquadState:a=>n(l=>{const{[a]:o,...c}=l.activeStates;return{activeStates:c}}),reset:()=>n({squads:[],selectedSquad:null,activeStates:{}})}));let OT=0;function Vv(){return`local-${Date.now()}-${++OT}`}const Pi=Eo((n,t)=>({messages:[],conversationId:null,streaming:!1,streamingText:"",error:null,addUserMessage:a=>{const l={id:Vv(),role:"user",content:a,createdAt:new Date().toISOString()};n(o=>({messages:[...o.messages,l],error:null}))},setConversationId:a=>{n({conversationId:a})},startStreaming:()=>{n({streaming:!0,streamingText:"",error:null})},appendChunk:a=>{n(l=>({streamingText:l.streamingText+a}))},finishStreaming:a=>{const{streamingText:l}=t(),o={id:a,role:"assistant",content:l,createdAt:new Date().toISOString()};n(c=>({messages:[...c.messages,o],streaming:!1,streamingText:""}))},addAgentDm:a=>{const l={id:Vv(),role:"agent_dm",content:a.content,agentId:a.agentId,agentName:a.agentName,createdAt:new Date().toISOString()};n(o=>({messages:[...o.messages,l]}))},setError:a=>{n({error:a,streaming:!1,streamingText:""})},loadHistory:async a=>{try{const l=await fetch(`/api/squads/${a}/conversations`,{credentials:"include"});if(!l.ok)return;const o=await l.json();if(!o.data||o.data.length===0){n({conversationId:null,messages:[]});return}const c=o.data[0];n({conversationId:c.id});const h=await fetch(`/api/conversations/${c.id}/messages`,{credentials:"include"});if(!h.ok)return;const p=((await h.json()).data||[]).map(y=>({id:y.id,role:y.role,content:y.content,agentId:y.agent_id??void 0,agentName:y.agent_name??void 0,createdAt:y.created_at}));n({messages:p})}catch{}},reset:()=>n({messages:[],conversationId:null,streaming:!1,streamingText:"",error:null})}));function NT(n){const a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/ws`,l=new WebSocket(a),o=[];let c=!0;function h(m){l.readyState===WebSocket.OPEN?l.send(JSON.stringify(m)):l.readyState===WebSocket.CONNECTING&&o.push(m)}return l.onopen=()=>{var m,p;c||(p=(m=n.current).onReconnect)==null||p.call(m),c=!1;for(const y of o)l.send(JSON.stringify(y));o.length=0},l.onmessage=m=>{var p,y,x,_,T,C,M,w,z,D,N,j,G,k,q,Z;try{const W=JSON.parse(m.data),L=n.current;switch(W.type){case"squad:state":(p=L.onSquadState)==null||p.call(L,W.squadName,W.state);break;case"squad:inactive":(y=L.onSquadInactive)==null||y.call(L,W.squadName,W.reason);break;case"chat:chunk":(x=L.onChatChunk)==null||x.call(L,W.squadName,W.conversationId,W.delta);break;case"chat:done":(_=L.onChatDone)==null||_.call(L,W.squadName,W.conversationId,W.messageId);break;case"chat:error":(T=L.onChatError)==null||T.call(L,W.squadName,W.error);break;case"chat:agent_dm":(C=L.onChatAgentDm)==null||C.call(L,W.squadName,W.conversationId,W.agentId,W.agentName,W.message);break;case"chat:conversation_created":(M=L.onChatConversationCreated)==null||M.call(L,W.squadName,W.conversationId);break;case"agent:output_chunk":(w=L.onAgentOutputChunk)==null||w.call(L,W.squadName,W.agentId,W.agentName,W.delta);break;case"agent:step_start":(z=L.onAgentStepStart)==null||z.call(L,W.squadName,W.agentId,W.agentName,W.stepIndex,W.stepLabel);break;case"agent:step_complete":(D=L.onAgentStepComplete)==null||D.call(L,W.squadName,W.agentId,W.agentName,W.stepIndex,W.stepLabel);break;case"squad:checkpoint":(N=L.onSquadCheckpoint)==null||N.call(L,W.squadName,W.agentId,W.agentName,W.question);break;case"schedule:started":(j=L.onScheduleStarted)==null||j.call(L,W.squadName,W.jobId,W.attempt);break;case"schedule:chunk":(G=L.onScheduleChunk)==null||G.call(L,W.squadName,W.jobId,W.delta);break;case"schedule:done":(k=L.onScheduleDone)==null||k.call(L,W.squadName,W.jobId,W.summary,W.attempt);break;case"schedule:error":(q=L.onScheduleError)==null||q.call(L,W.squadName,W.jobId,W.error,W.attempt,W.willRetry);break;case"schedule:status_changed":(Z=L.onScheduleStatusChanged)==null||Z.call(L,W.squadName,W.status);break}}catch{}},{subscribe:m=>{h({type:"squad:subscribe",squadName:m})},unsubscribe:m=>{h({type:"squad:unsubscribe",squadName:m})},sendChat:(m,p)=>{h({type:"chat:send",squadName:m,message:p})},newConversation:m=>{h({type:"chat:new_conversation",squadName:m})},sendCheckpointResponse:(m,p)=>{h({type:"squad:checkpoint_response",squadName:m,answer:p})},disconnect:()=>{l.close()}}}function BT(n={}){const t=Y.useRef(null),a=Y.useRef(n),l=Y.useRef(new Set);a.current=n,Y.useEffect(()=>{const p=NT(a);t.current=p;for(const y of l.current)p.subscribe(y);return()=>{p.disconnect()}},[]);const o=Y.useCallback(p=>{var y;l.current.add(p),(y=t.current)==null||y.subscribe(p)},[]),c=Y.useCallback(p=>{var y;l.current.delete(p),(y=t.current)==null||y.unsubscribe(p)},[]),h=Y.useCallback((p,y)=>{var x;(x=t.current)==null||x.sendChat(p,y)},[]),m=Y.useCallback((p,y)=>{var x;(x=t.current)==null||x.sendCheckpointResponse(p,y)},[]);return{subscribe:o,unsubscribe:c,sendChat:h,sendCheckpointResponse:m}}const jT={idle:{color:"var(--status-idle)",glow:"none",icon:"○"},working:{color:"var(--status-active)",glow:"0 0 6px var(--status-active-glow)",icon:"●"},delivering:{color:"var(--accent)",glow:"0 0 6px var(--accent-glow)",icon:"→"},done:{color:"var(--status-active)",glow:"none",icon:"✓"},checkpoint:{color:"var(--status-warning)",glow:"0 0 6px var(--status-warning-glow)",icon:"◆"},running:{color:"var(--status-active)",glow:"0 0 6px var(--status-active-glow)",icon:"●"},completed:{color:"var(--status-active)",glow:"none",icon:"✓"}},UT={color:"var(--status-idle)",glow:"none"};function HT({status:n}){if(!n)return null;const t=jT[n]||UT;return R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,fontFamily:"var(--font-mono)",fontSize:"0.68rem",color:t.color,letterSpacing:"0.02em"},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:t.color,boxShadow:t.glow,animation:n==="working"||n==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),n]})}function GT({squad:n,selected:t,onClick:a}){return R.jsxs("div",{onClick:a,style:{padding:"8px 10px",cursor:"pointer",borderRadius:"var(--radius-sm)",background:t?"var(--accent-glow)":"transparent",borderLeft:t?"2px solid var(--accent)":"2px solid transparent",marginBottom:2,transition:"all var(--duration-fast) var(--ease-out)"},children:[R.jsx("div",{style:{fontSize:"0.82rem",fontWeight:t?600:400,color:t?"var(--text-primary)":"var(--text-secondary)",marginBottom:2},children:n.name}),R.jsx(HT,{status:n.status})]})}function YT({squads:n,selectedSquad:t,onSelect:a}){return R.jsxs("div",{style:{padding:"var(--sp-3)"},children:[R.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-2)"},children:"Squads"}),n.length===0&&R.jsx("div",{style:{padding:"8px 10px",color:"var(--text-muted)",fontSize:"0.75rem",fontStyle:"italic"},children:"No squads found"}),n.map(l=>R.jsx(GT,{squad:l,selected:l.code===t,onClick:()=>a(l.code)},l.code))]})}function qT(n){const t=Math.floor(n/3600),a=Math.floor(n%3600/60),l=n%60,o=c=>c.toString().padStart(2,"0");return t>0?`${t}h ${o(a)}m ${o(l)}s`:`${a}m ${o(l)}s`}function LT({state:n}){const[t,a]=Y.useState(0);return Y.useEffect(()=>{if(!(n!=null&&n.startedAt)||n.status!=="running"){a(0);return}const l=new Date(n.startedAt).getTime(),o=()=>a(Math.floor((Date.now()-l)/1e3));o();const c=setInterval(o,1e3);return()=>clearInterval(c)},[n==null?void 0:n.startedAt,n==null?void 0:n.status]),R.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:n?R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:"50%",background:n.status==="running"?"var(--status-active)":n.status==="checkpoint"?"var(--status-warning)":"var(--status-idle)",boxShadow:n.status==="running"?"0 0 8px var(--status-active-glow)":"none",animation:n.status==="running"?"statusPulse 2s ease-in-out infinite":"none"}}),R.jsxs("span",{style:{color:"var(--text-secondary)"},children:["Step ",n.step.current,"/",n.step.total]}),R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("span",{children:n.step.label})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[n.handoff&&R.jsxs("span",{style:{color:"var(--accent)"},children:[n.handoff.from," → ",n.handoff.to]}),n.status==="running"&&R.jsx("span",{style:{color:"var(--text-secondary)"},children:qT(t)})]})]}):R.jsxs(R.Fragment,{children:[R.jsx("span",{children:"Ready"}),R.jsx("span",{children:"ExpxAgents Mission Control"})]})})}let w0=null;function XT(n){w0=n}function VT(n,t){w0&&w0(n,t)}let D0=null;function kT(n){D0=n}function QT(n,t){D0&&D0(n,t)}const Ap=32,zl=96,iu=64,Yt={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},O0=[5227511,5025616,16750592,15022389,9315498,16771899],KT={idle:8947848,working:5025616,delivering:5227511,done:5025616,checkpoint:16750592},pa={counter:4073251,counterTop:6111287,machine:3622735,machineTop:4545124,machineLight:5025616,cup:14142664,cupShadow:12364452,saucer:14735052,sink:7901340,faucet:11583173,menu:5125166},xi={table:6111287,tableTop:7162945,tableEdge:5125166,tableLeg:4073251,chair:3622735,chairSeat:4545124,chairBack:5533306,carpet:2503224,carpetPattern:3030340,whiteboard:15527921,whiteboardFrame:7901340},bo={background:1713022,backgroundGlow:2635155,statusRunning:5025616,statusIdle:8947848,statusCheckpoint:16750592,statusCompleted:5025616},su={floor:11579568,tile:11053224,grout:10066329,stripe:12632256},Ha={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},$a={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},nf={wall:7901340,wallHighlight:10795204,doorFrame:6111287},qn={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},ti={floor:14142664,carpet:6323595,carpetBorder:4545124,sofa:5533306,sofaCushion:6323595,sofaArm:4545124,tv:2171169,tvScreen:2503224,tvStand:4342338,sideTable:7951688,magazine:15684432,magazineAlt:4367861},sr=480,Si=360,co=400,Rn=60,bi=120,Vy=120,kv=160,Qv=120,Kv=160,ZT=64,FT=80,WT=zl+32,JT=iu+48,Zv=2,ib=10,ar=80;function ip(n,t,a){const l=Math.max(0,Math.min(1,a));return n+(t-n)*l}function PT(n){return n<.5?2*n*n:1-Math.pow(-2*n+2,2)/2}const IT=["nw","ne","sw","se"],$T={nw:"right",ne:"left",sw:"top",se:"top"};function wp(n){const t=ib,a=Math.max(1,n),l={nw:0,ne:0,sw:0,se:0},o=[];for(let rt=0;rt<a;rt++){const gt=IT[rt%4];o.push({quadrant:gt,slot:l[gt]}),l[gt]++}const c=Math.max(1,l.nw),h=Math.max(1,l.ne),m=Math.max(1,l.sw),p=Math.max(1,l.se),y=Math.max(co,bi),x=c*(Si+t),_=h*(Si+t),T=Math.max(x+y,_+bi),C=m*(Si+t),M=p*(Si+t),w=Math.max(kv,Kv),z=Math.max(C+w+t,M+w+t),D=Math.max(sr,bi+t+co),N=Math.max(sr,bi),j=Math.max(sr,Vy),G=Math.max(sr,Qv),k=Math.max(D,j),q=Math.max(N,G),Z=t+k+t+Rn+t+q+t,W=t+T+t+Rn+t+z+t,L={x:t+k+t,y:t,width:Rn,height:W-2*t},$={x:t,y:t+T+t,width:Z-2*t,height:Rn},et={x:L.x+L.width/2,y:$.y+$.height/2},ct={x:L.x-t-co,y:$.y-t-co,width:co,height:co},vt={x:ct.x-t-bi,y:$.y-t-bi,width:bi,height:bi},dt={x:L.x+Rn+t,y:$.y-t-bi,width:bi,height:bi},St={x:L.x-t-Vy,y:$.y+Rn+t+m*(Si+t),width:Vy,height:kv},H={x:L.x+Rn+t,y:$.y+Rn+t+p*(Si+t),width:Qv,height:Kv},Q=[],ot={};for(let rt=0;rt<a;rt++){const{quadrant:gt,slot:U}=o[rt],F=$T[gt];let tt;gt==="nw"?tt={x:L.x-t-sr,y:ct.y-t-(U+1)*Si-U*t}:gt==="ne"?tt={x:L.x+Rn+t,y:dt.y-t-(U+1)*Si-U*t}:gt==="sw"?tt={x:L.x-t-sr,y:$.y+Rn+t+U*(Si+t)}:tt={x:L.x+Rn+t,y:$.y+Rn+t+U*(Si+t)},Q.push({origin:tt,width:sr,height:Si,quadrant:gt,doorSide:F}),F==="right"||F==="left"?ot[`squad-${rt}`]={x:L.x+Rn/2,y:tt.y+Si/2}:ot[`squad-${rt}`]={x:tt.x+sr/2,y:$.y+Rn/2}}return ot.ceo={x:L.x+Rn/2,y:ct.y+co/2},ot["bathroom-male"]={x:vt.x+bi/2,y:$.y+Rn/2},ot["bathroom-female"]={x:dt.x+bi/2,y:$.y+Rn/2},ot.kitchen={x:L.x+Rn/2,y:St.y+St.height/2},ot["rest-area"]={x:L.x+Rn/2,y:H.y+H.height/2},{totalWidth:Z,totalHeight:W,squadOrigins:Q,ceoOffice:ct,corridorH:$,corridorV:L,bathroomMale:vt,bathroomFemale:dt,kitchen:St,restArea:H,doorPoints:ot,corridorHub:et}}function ef(n,t,a,l){const o=n%Zv,c=Math.floor(n/Zv);return{x:t.x+ZT+o*WT,y:t.y+FT+c*JT}}function sd(n,t,a){return{x:n.x+t-80,y:n.y+a-80}}function lb(n,t,a){return{x:n.x+t-160,y:n.y+Math.floor(a/2)}}function t3(n,t){const a=t==="male"?n.bathroomMale:n.bathroomFemale;return{x:a.x+a.width/2,y:a.y+a.height/2}}function e3(n){return{x:n.kitchen.x+n.kitchen.width/2,y:n.kitchen.y+n.kitchen.height/2}}function n3(n){return{x:n.restArea.x+n.restArea.width/2,y:n.restArea.y+n.restArea.height/2}}function a3(n){const t=n.corridorV;if(t.height>0&&Math.random()<.5)return{x:t.x+10+Math.random()*Math.max(0,t.width-20),y:t.y+10+Math.random()*Math.max(0,t.height-20)};const a=n.corridorH;return{x:a.x+20+Math.random()*Math.max(0,a.width-40),y:a.y+10+Math.random()*Math.max(0,a.height-20)}}function Fv(n,t){const a=t.corridorH;return n.x>=a.x&&n.x<=a.x+a.width&&n.y>=a.y&&n.y<=a.y+a.height}function Wv(n,t){const a=t.corridorV;return n.x>=a.x&&n.x<=a.x+a.width&&n.y>=a.y&&n.y<=a.y+a.height}function i3(n,t){if(n==="ceo"){const l=t.ceoOffice;return{x:l.x+l.width/2,y:l.y+l.height/2}}if(n==="bathroom-male"){const l=t.bathroomMale;return{x:l.x+l.width/2,y:l.y+l.height/2}}if(n==="bathroom-female"){const l=t.bathroomFemale;return{x:l.x+l.width/2,y:l.y+l.height/2}}if(n==="kitchen"){const l=t.kitchen;return{x:l.x+l.width/2,y:l.y+l.height/2}}if(n==="rest-area"){const l=t.restArea;return{x:l.x+l.width/2,y:l.y+l.height/2}}const a=n.match(/^squad-(\d+)$/);if(a){const l=parseInt(a[1],10),o=t.squadOrigins[l];if(o)return{x:o.origin.x+o.width/2,y:o.origin.y+o.height/2}}return t.corridorHub}function rd(n,t,a,l){const o=l.doorPoints[t],c=l.doorPoints[a];if(!o||!c)return[n];const h=l.corridorHub,m=i3(a,l),p=Fv(o,l)&&Fv(c,l),y=Wv(o,l)&&Wv(c,l);return p||y?[n,o,c,m]:[n,o,h,c,m]}function lp(n,t){const a=n.x-t.x,l=n.y-t.y;return Math.sqrt(a*a+l*l)}const Jv=500,Pv=50;let Iv=0;function $v(n){return{idle:"idle",working:"working",delivering:"walking",done:"idle",checkpoint:"checkpoint"}[n]??"idle"}const Je=Eo(n=>({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{},appendBubble:(t,a,l)=>{const o=`${t}:${a}`;n(c=>{var p;let m=(((p=c.bubbles[o])==null?void 0:p.text)??"")+l;return m.length>Jv&&(m=m.slice(m.length-Jv)),{bubbles:{...c.bubbles,[o]:{text:m,updatedAt:Date.now()}}}})},clearBubble:(t,a)=>{const l=`${t}:${a}`;n(o=>{const{[l]:c,...h}=o.bubbles;return{bubbles:h}})},clearAllBubbles:()=>n({bubbles:{}}),addActivity:(t,a,l)=>{const c={id:++Iv,agentName:a,action:l,timestamp:Date.now()};n(h=>{var x;const p=[...((x=h.activityLog[t])==null?void 0:x.entries)??[],c],y=p.length>Pv?p.slice(p.length-Pv):p;return{activityLog:{...h.activityLog,[t]:{entries:y}}}})},setCheckpoint:(t,a,l,o)=>n(c=>({checkpoints:{...c.checkpoints,[t]:{agentId:a,agentName:l,question:o}}})),clearCheckpoint:t=>n(a=>{const{[t]:l,...o}=a.checkpoints;return{checkpoints:o}}),setActiveRoom:t=>n({activeRoom:t}),syncRooms:t=>n(a=>{const l=t;let o;return l.length===0?o=null:a.activeRoom===null||!l.includes(a.activeRoom)?o=l[0]:o=a.activeRoom,{rooms:l,activeRoom:o}}),setAgents:(t,a)=>n(l=>{const o=l.agentVisuals[t]??[],c=new Map(o.map(C=>[C.id,C])),h={x:0,y:0},m=wp(l.rooms.length),p=l.rooms.indexOf(t),y=m.squadOrigins[p],x=(y==null?void 0:y.width)??480,_=(y==null?void 0:y.height)??360,T=a.map((C,M)=>{const w=c.get(C.id);if(w){const N=C.status?$v(C.status):w.status,j=N!==w.status;let G=w.targetPosition;return j&&(N==="working"||N==="checkpoint"?G=ef(M,h):G=sd(h,x,_)),{...w,name:C.name,deskIndex:M,status:N,targetPosition:G}}const z=C.status?$v(C.status):"idle",D=z==="working"||z==="checkpoint"?ef(M,h):sd(h,x,_);return{id:C.id,name:C.name,colorIndex:M%6,status:z,deskIndex:M,position:D,targetPosition:null}});return{agentVisuals:{...l.agentVisuals,[t]:T}}}),setAgentStatus:(t,a,l)=>n(o=>{const c=o.agentVisuals[t];if(!c)return o;const h={x:0,y:0},m=wp(o.rooms.length),p=o.rooms.indexOf(t),y=m.squadOrigins[p],x=(y==null?void 0:y.width)??480,_=(y==null?void 0:y.height)??360,T=c.map(C=>{if(C.id!==a)return C;let M;return l==="working"||l==="checkpoint"?M=ef(C.deskIndex,h):M=sd(h,x,_),{...C,status:l,targetPosition:M}});return{agentVisuals:{...o.agentVisuals,[t]:T}}}),reset:()=>{Iv=0,n({rooms:[],activeRoom:null,bubbles:{},activityLog:{},checkpoints:{},agentVisuals:{}})}})),iM={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"},l3={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 sb=0;function s3(){return`jarvis-${Date.now()}-${++sb}`}let gs=null;const ky=Eo((n,t)=>({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:"",setMode:a=>n({mode:a}),addMessage:(a,l)=>{const o={id:s3(),role:a,content:l,createdAt:new Date().toISOString()};n(c=>({messages:[...c.messages,o]}))},appendChunk:a=>{n(l=>({streamingText:l.streamingText+a}))},finalizeMessage:a=>{const{streamingText:l}=t(),o={id:a,role:"assistant",content:l,createdAt:new Date().toISOString()};n(c=>({messages:[...c.messages,o],streamingText:""}))},selectSquad:a=>n({selectedSquad:a}),setUserName:a=>n({userName:a}),startStandbyTimer:()=>{gs&&clearTimeout(gs),gs=setTimeout(()=>{n({mode:"STANDBY"}),gs=null},l3.standbyTimeoutMs)},resetStandbyTimer:()=>{t().startStandbyTimer()},clearStandbyTimer:()=>{gs&&(clearTimeout(gs),gs=null)},reset:()=>{gs&&(clearTimeout(gs),gs=null),sb=0,n({mode:"STANDBY",messages:[],streamingText:"",selectedSquad:null,userName:""})}})),bs=Eo((n,t)=>({jobs:[],loading:!1,fetchJobs:async()=>{n({loading:!0});try{const a=await fetch("/api/scheduler",{credentials:"include"});if(a.ok){const l=await a.json();n({jobs:l.data,loading:!1})}else n({loading:!1})}catch{n({loading:!1})}},pauseJob:async a=>{await fetch(`/api/scheduler/${a}/pause`,{method:"POST",credentials:"include"}),t().fetchJobs()},resumeJob:async a=>{await fetch(`/api/scheduler/${a}/resume`,{method:"POST",credentials:"include"}),t().fetchJobs()},triggerJob:async a=>{await fetch(`/api/scheduler/${a}/trigger`,{method:"POST",credentials:"include"})},updateJobStatus:(a,l)=>{n(o=>({jobs:o.jobs.map(c=>c.squad_name===a?{...c,status:l}:c)}))}})),r3=[{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:"/settings",label:"Settings",icon:"⚙"}];function u3(){const n=Ol(U=>U.user),t=Ol(U=>U.isAuthenticated),a=Ol(U=>U.loading),l=Ol(U=>U.logout),o=Ol(U=>U.checkAuth),c=Xp(),h=jl(),m=h.pathname==="/office"||h.pathname==="/",p=h.pathname==="/jarvis",y=ei(U=>U.squads),x=ei(U=>U.selectedSquad),_=ei(U=>x?U.activeStates[x]:null),T=ei(U=>U.fetchSquads),C=ei(U=>U.selectSquad),M=ei(U=>U.setSquadState),w=ei(U=>U.clearSquadState),z=Y.useCallback((U,F)=>{M(U,F);const tt=Je.getState();tt.rooms.includes(U)||tt.syncRooms([...tt.rooms,U]),F.status!=="checkpoint"&&tt.clearCheckpoint(U),F.agents&&tt.setAgents(U,F.agents.map(pt=>({id:pt.id,name:pt.name,status:pt.status})))},[M]),D=Y.useCallback(U=>{w(U);const F=Je.getState(),tt=F.agentVisuals[U];if(tt)for(const pt of tt)F.setAgentStatus(U,pt.id,"idle")},[w]),N=Y.useCallback((U,F)=>{Pi.getState().setConversationId(F)},[]),j=Y.useCallback((U,F,tt)=>{if(U==="_jarvis"){ky.getState().appendChunk(tt);return}const pt=Pi.getState();pt.streaming||pt.startStreaming(),pt.appendChunk(tt)},[]),G=Y.useCallback((U,F,tt)=>{if(U==="_jarvis"){ky.getState().finalizeMessage(tt);return}Pi.getState().finishStreaming(tt)},[]),k=Y.useCallback((U,F)=>{if(U==="_jarvis"){ky.getState().setMode("LISTENING");return}Pi.getState().setError(F)},[]),q=Y.useCallback((U,F,tt,pt,_t)=>{Pi.getState().addAgentDm({agentId:tt,agentName:pt,content:_t})},[]),Z=Y.useCallback((U,F,tt,pt)=>{Je.getState().appendBubble(U,F,pt)},[]),W=Y.useCallback((U,F,tt,pt,_t)=>{Je.getState().addActivity(U,tt,`started "${_t}"`),Je.getState().setAgentStatus(U,F,"working")},[]),L=Y.useCallback((U,F,tt,pt,_t)=>{Je.getState().addActivity(U,tt,`completed "${_t}"`),Je.getState().setAgentStatus(U,F,"idle")},[]),$=Y.useCallback((U,F,tt,pt)=>{Je.getState().setCheckpoint(U,F,tt,pt),Je.getState().setAgentStatus(U,F,"checkpoint")},[]),et=Y.useCallback(()=>{Je.getState().clearAllBubbles()},[]),ct=Y.useCallback((U,F,tt)=>{bs.getState().fetchJobs()},[]),vt=Y.useCallback((U,F,tt,pt)=>{bs.getState().fetchJobs()},[]),dt=Y.useCallback((U,F,tt,pt,_t)=>{bs.getState().fetchJobs()},[]),St=Y.useCallback((U,F)=>{bs.getState().updateJobStatus(U,F)},[]),{subscribe:H,unsubscribe:Q,sendChat:ot,sendCheckpointResponse:rt}=BT({onSquadState:z,onSquadInactive:D,onChatConversationCreated:N,onChatChunk:j,onChatDone:G,onChatError:k,onChatAgentDm:q,onAgentOutputChunk:Z,onAgentStepStart:W,onAgentStepComplete:L,onSquadCheckpoint:$,onReconnect:et,onScheduleStarted:ct,onScheduleDone:vt,onScheduleError:dt,onScheduleStatusChanged:St});Y.useEffect(()=>{XT(ot)},[ot]),Y.useEffect(()=>{kT(rt)},[rt]),Y.useEffect(()=>{T().then(()=>{const{squads:U}=ei.getState();if(U.length>0){const F=Je.getState(),tt=U.map(At=>At.code),pt=F.rooms,_t=[...new Set([...pt,...tt])];F.syncRooms(_t);for(const At of U)!F.agentVisuals[At.code]&&At.agents&&At.agents.length>0&&F.setAgents(At.code,At.agents.map(Ot=>({id:Ot.id,name:Ot.name,status:"idle"})))}})},[T]);const gt=Je(U=>U.rooms);return Y.useEffect(()=>{for(const U of gt)H(U);return()=>{for(const U of gt)Q(U)}},[gt,H,Q]),Y.useEffect(()=>{if(p)return H("_jarvis"),()=>Q("_jarvis")},[p,H,Q]),Y.useEffect(()=>{t||o()},[]),Y.useEffect(()=>{!a&&!t&&c("/login",{state:{from:h.pathname}})},[a,t,c,h.pathname]),p?R.jsx(Yv,{}):R.jsxs("div",{className:"noise-bg",style:{display:"flex",flexDirection:"column",height:"100vh",background:"var(--surface-0)",color:"var(--text-primary)"},children:[R.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:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.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"}),R.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",letterSpacing:"-0.02em"},children:"ExpxAgents"}),R.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"})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-4)"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:[R.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"}}),R.jsx("span",{children:n==null?void 0:n.username})]}),R.jsx("button",{onClick:l,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:U=>U.currentTarget.style.color="var(--status-error)",onMouseLeave:U=>U.currentTarget.style.color="var(--text-muted)",children:"Logout"})]})]}),R.jsxs("div",{style:{display:"flex",flex:1,overflow:"hidden"},children:[R.jsxs("aside",{style:{width:"var(--sidebar-width)",background:"var(--surface-1)",borderRight:"1px solid var(--border-subtle)",display:"flex",flexDirection:"column",overflowY:"auto"},children:[!m&&R.jsxs(R.Fragment,{children:[R.jsx(YT,{squads:y,selectedSquad:x,onSelect:C}),R.jsx("div",{style:{height:1,margin:"0 var(--sp-3)",background:"var(--border-subtle)"}})]}),R.jsxs("nav",{style:{padding:"var(--sp-3)",display:"flex",flexDirection:"column",gap:"var(--sp-1)",flex:1},children:[R.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"}),r3.map(U=>R.jsxs(nb,{to:U.to,style:({isActive:F})=>({display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",borderRadius:"var(--radius-sm)",textDecoration:"none",fontSize:"0.82rem",fontWeight:F?600:400,color:F?"var(--accent)":"var(--text-secondary)",background:F?"var(--accent-glow)":"transparent",border:F?"1px solid rgba(0, 200, 255, 0.12)":"1px solid transparent",transition:"all var(--duration-fast) var(--ease-out)"}),children:[R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:U.icon}),U.label]},U.to)),R.jsx("div",{style:{height:1,margin:"var(--sp-2) var(--sp-2)",background:"var(--border-subtle)"}}),R.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:[R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.85rem",width:20,textAlign:"center",opacity:.7},children:"◉"}),"Jarvis",R.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",opacity:.6},children:"↗"})]})]}),R.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:[R.jsxs("span",{children:[y.length," squad",y.length!==1?"s":""]}),R.jsx("span",{children:"v0.1.0"})]})]}),R.jsx("main",{className:"grid-bg",style:{flex:1,overflow:"auto",position:"relative"},children:R.jsx(Yv,{})})]}),R.jsx(LT,{state:_})]})}function o3(){var T;const[n,t]=Y.useState(""),[a,l]=Y.useState(""),o=Ol(C=>C.login),c=Ol(C=>C.loading),h=Ol(C=>C.error),m=Ol(C=>C.isAuthenticated),p=Xp(),x=((T=jl().state)==null?void 0:T.from)||"/";Y.useEffect(()=>{m&&p(x,{replace:!0})},[m,p,x]);const _=C=>{C.preventDefault(),o(n,a)};return R.jsx("div",{className:"noise-bg grid-bg",style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",background:"var(--surface-0)"},children:R.jsxs("div",{style:{animation:"fadeInUp 0.6s var(--ease-out) both",width:360},children:[R.jsxs("div",{style:{textAlign:"center",marginBottom:"var(--sp-8)"},children:[R.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"}),R.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"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.15em"},children:"Mission Control"})]}),R.jsxs("form",{onSubmit:_,className:"glass",style:{padding:"var(--sp-6)",borderRadius:"var(--radius-lg)",boxShadow:"var(--shadow-lg)"},children:[h&&R.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:h}),R.jsxs("div",{style:{marginBottom:"var(--sp-3)"},children:[R.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"}),R.jsx("input",{type:"text",className:"input",placeholder:"Enter username",value:n,onChange:C=>t(C.target.value),autoFocus:!0})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.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"}),R.jsx("input",{type:"password",className:"input",placeholder:"Enter password",value:a,onChange:C=>l(C.target.value)})]}),R.jsx("button",{type:"submit",disabled:c,className:"btn btn-accent",style:{width:"100%",padding:"var(--sp-3)",fontSize:"0.85rem",cursor:c?"wait":"pointer",opacity:c?.7:1},children:c?"Authenticating...":"Access Mission Control"})]}),R.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 rb(n,t,a){if(!n)return;if(a(n)===!0)return n;let l=n.child;for(;l;){const o=rb(l,t,a);if(o)return o;l=l.sibling}}function ub(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const og=ub(Y.createContext(null));let ob=class extends Y.Component{render(){return Y.createElement(og.Provider,{value:this._reactInternals},this.props.children)}};function c3(){const n=Y.useContext(og);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const t=Y.useId();return Y.useMemo(()=>{for(const a of[n,n==null?void 0:n.alternate]){if(!a)continue;const l=rb(a,!1,o=>{let c=o.memoizedState;for(;c;){if(c.memoizedState===t)return!0;c=c.next}});if(l)return l}},[n,t])}const f3=Symbol.for("react.context"),h3=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===f3;function d3(){const n=c3(),[t]=Y.useState(()=>new Map);t.clear();let a=n;for(;a;){const l=a.type;h3(l)&&l!==og&&!t.has(l)&&t.set(l,Y.use(ub(l))),a=a.return}return t}function m3(){const n=d3();return Y.useMemo(()=>Array.from(n.keys()).reduce((t,a)=>l=>Y.createElement(t,null,Y.createElement(a.Provider,{...l,value:n.get(a)})),t=>Y.createElement(ob,{...t})),[n])}var Jt=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(Jt||{});const N0=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},sp=(n,t)=>N0(n).priority??t,Ie={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(N0).forEach(t=>{t.type.forEach(a=>{var l,o;return(o=(l=this._removeHandlers)[a])==null?void 0:o.call(l,t)})}),this},add(...n){return n.map(N0).forEach(t=>{t.type.forEach(a=>{var c,h;const l=this._addHandlers,o=this._queue;l[a]?(h=l[a])==null||h.call(l,t):(o[a]=o[a]||[],(c=o[a])==null||c.push(t))})}),this},handle(n,t,a){var h;const l=this._addHandlers,o=this._removeHandlers;if(l[n]||o[n])throw new Error(`Extension type ${n} already has a handler`);l[n]=t,o[n]=a;const c=this._queue;return c[n]&&((h=c[n])==null||h.forEach(m=>t(m)),delete c[n]),this},handleByMap(n,t){return this.handle(n,a=>{a.name&&(t[a.name]=a.ref)},a=>{a.name&&delete t[a.name]})},handleByNamedList(n,t,a=-1){return this.handle(n,l=>{t.findIndex(c=>c.name===l.name)>=0||(t.push({name:l.name,value:l.ref}),t.sort((c,h)=>sp(h.value,a)-sp(c.value,a)))},l=>{const o=t.findIndex(c=>c.name===l.name);o!==-1&&t.splice(o,1)})},handleByList(n,t,a=-1){return this.handle(n,l=>{t.includes(l.ref)||(t.push(l.ref),t.sort((o,c)=>sp(c,a)-sp(o,a)))},l=>{const o=t.indexOf(l.ref);o!==-1&&t.splice(o,1)})},mixin(n,...t){for(const a of t)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(a))}},p3={extension:{type:Jt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await tf(()=>import("./browserAll-DpQDqd5Z.js"),__vite__mapDeps([0,1]))}},y3={extension:{type:Jt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await tf(()=>import("./webworkerAll-DKgN-y6e.js"),[])}};class In{constructor(t,a,l){this._x=a||0,this._y=l||0,this._observer=t}clone(t){return new In(t??this._observer,this._x,this._y)}set(t=0,a=t){return(this._x!==t||this._y!==a)&&(this._x=t,this._y=a,this._observer._onUpdate(this)),this}copyFrom(t){return(this._x!==t.x||this._y!==t.y)&&(this._x=t.x,this._y=t.y,this._observer._onUpdate(this)),this}copyTo(t){return t.set(this._x,this._y),t}equals(t){return t.x===this._x&&t.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(t){this._x!==t&&(this._x=t,this._observer._onUpdate(this))}get y(){return this._y}set y(t){this._y!==t&&(this._y=t,this._observer._onUpdate(this))}}var Qy={exports:{}},t1;function g3(){return t1||(t1=1,(function(n){var t=Object.prototype.hasOwnProperty,a="~";function l(){}Object.create&&(l.prototype=Object.create(null),new l().__proto__||(a=!1));function o(p,y,x){this.fn=p,this.context=y,this.once=x||!1}function c(p,y,x,_,T){if(typeof x!="function")throw new TypeError("The listener must be a function");var C=new o(x,_||p,T),M=a?a+y:y;return p._events[M]?p._events[M].fn?p._events[M]=[p._events[M],C]:p._events[M].push(C):(p._events[M]=C,p._eventsCount++),p}function h(p,y){--p._eventsCount===0?p._events=new l:delete p._events[y]}function m(){this._events=new l,this._eventsCount=0}m.prototype.eventNames=function(){var y=[],x,_;if(this._eventsCount===0)return y;for(_ in x=this._events)t.call(x,_)&&y.push(a?_.slice(1):_);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(x)):y},m.prototype.listeners=function(y){var x=a?a+y:y,_=this._events[x];if(!_)return[];if(_.fn)return[_.fn];for(var T=0,C=_.length,M=new Array(C);T<C;T++)M[T]=_[T].fn;return M},m.prototype.listenerCount=function(y){var x=a?a+y:y,_=this._events[x];return _?_.fn?1:_.length:0},m.prototype.emit=function(y,x,_,T,C,M){var w=a?a+y:y;if(!this._events[w])return!1;var z=this._events[w],D=arguments.length,N,j;if(z.fn){switch(z.once&&this.removeListener(y,z.fn,void 0,!0),D){case 1:return z.fn.call(z.context),!0;case 2:return z.fn.call(z.context,x),!0;case 3:return z.fn.call(z.context,x,_),!0;case 4:return z.fn.call(z.context,x,_,T),!0;case 5:return z.fn.call(z.context,x,_,T,C),!0;case 6:return z.fn.call(z.context,x,_,T,C,M),!0}for(j=1,N=new Array(D-1);j<D;j++)N[j-1]=arguments[j];z.fn.apply(z.context,N)}else{var G=z.length,k;for(j=0;j<G;j++)switch(z[j].once&&this.removeListener(y,z[j].fn,void 0,!0),D){case 1:z[j].fn.call(z[j].context);break;case 2:z[j].fn.call(z[j].context,x);break;case 3:z[j].fn.call(z[j].context,x,_);break;case 4:z[j].fn.call(z[j].context,x,_,T);break;default:if(!N)for(k=1,N=new Array(D-1);k<D;k++)N[k-1]=arguments[k];z[j].fn.apply(z[j].context,N)}}return!0},m.prototype.on=function(y,x,_){return c(this,y,x,_,!1)},m.prototype.once=function(y,x,_){return c(this,y,x,_,!0)},m.prototype.removeListener=function(y,x,_,T){var C=a?a+y:y;if(!this._events[C])return this;if(!x)return h(this,C),this;var M=this._events[C];if(M.fn)M.fn===x&&(!T||M.once)&&(!_||M.context===_)&&h(this,C);else{for(var w=0,z=[],D=M.length;w<D;w++)(M[w].fn!==x||T&&!M[w].once||_&&M[w].context!==_)&&z.push(M[w]);z.length?this._events[C]=z.length===1?z[0]:z:h(this,C)}return this},m.prototype.removeAllListeners=function(y){var x;return y?(x=a?a+y:y,this._events[x]&&h(this,x)):(this._events=new l,this._eventsCount=0),this},m.prototype.off=m.prototype.removeListener,m.prototype.addListener=m.prototype.on,m.prefixed=a,m.EventEmitter=m,n.exports=m})(Qy)),Qy.exports}var v3=g3();const _s=Gp(v3),x3=Math.PI*2,b3=180/Math.PI,S3=Math.PI/180;class ya{constructor(t=0,a=0){this.x=0,this.y=0,this.x=t,this.y=a}clone(){return new ya(this.x,this.y)}copyFrom(t){return this.set(t.x,t.y),this}copyTo(t){return t.set(this.x,this.y),t}equals(t){return t.x===this.x&&t.y===this.y}set(t=0,a=t){return this.x=t,this.y=a,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Ky.x=0,Ky.y=0,Ky}}const Ky=new ya;class le{constructor(t=1,a=0,l=0,o=1,c=0,h=0){this.array=null,this.a=t,this.b=a,this.c=l,this.d=o,this.tx=c,this.ty=h}fromArray(t){this.a=t[0],this.b=t[1],this.c=t[3],this.d=t[4],this.tx=t[2],this.ty=t[5]}set(t,a,l,o,c,h){return this.a=t,this.b=a,this.c=l,this.d=o,this.tx=c,this.ty=h,this}toArray(t,a){this.array||(this.array=new Float32Array(9));const l=a||this.array;return t?(l[0]=this.a,l[1]=this.b,l[2]=0,l[3]=this.c,l[4]=this.d,l[5]=0,l[6]=this.tx,l[7]=this.ty,l[8]=1):(l[0]=this.a,l[1]=this.c,l[2]=this.tx,l[3]=this.b,l[4]=this.d,l[5]=this.ty,l[6]=0,l[7]=0,l[8]=1),l}apply(t,a){a=a||new ya;const l=t.x,o=t.y;return a.x=this.a*l+this.c*o+this.tx,a.y=this.b*l+this.d*o+this.ty,a}applyInverse(t,a){a=a||new ya;const l=this.a,o=this.b,c=this.c,h=this.d,m=this.tx,p=this.ty,y=1/(l*h+c*-o),x=t.x,_=t.y;return a.x=h*y*x+-c*y*_+(p*c-m*h)*y,a.y=l*y*_+-o*y*x+(-p*l+m*o)*y,a}translate(t,a){return this.tx+=t,this.ty+=a,this}scale(t,a){return this.a*=t,this.d*=a,this.c*=t,this.b*=a,this.tx*=t,this.ty*=a,this}rotate(t){const a=Math.cos(t),l=Math.sin(t),o=this.a,c=this.c,h=this.tx;return this.a=o*a-this.b*l,this.b=o*l+this.b*a,this.c=c*a-this.d*l,this.d=c*l+this.d*a,this.tx=h*a-this.ty*l,this.ty=h*l+this.ty*a,this}append(t){const a=this.a,l=this.b,o=this.c,c=this.d;return this.a=t.a*a+t.b*o,this.b=t.a*l+t.b*c,this.c=t.c*a+t.d*o,this.d=t.c*l+t.d*c,this.tx=t.tx*a+t.ty*o+this.tx,this.ty=t.tx*l+t.ty*c+this.ty,this}appendFrom(t,a){const l=t.a,o=t.b,c=t.c,h=t.d,m=t.tx,p=t.ty,y=a.a,x=a.b,_=a.c,T=a.d;return this.a=l*y+o*_,this.b=l*x+o*T,this.c=c*y+h*_,this.d=c*x+h*T,this.tx=m*y+p*_+a.tx,this.ty=m*x+p*T+a.ty,this}setTransform(t,a,l,o,c,h,m,p,y){return this.a=Math.cos(m+y)*c,this.b=Math.sin(m+y)*c,this.c=-Math.sin(m-p)*h,this.d=Math.cos(m-p)*h,this.tx=t-(l*this.a+o*this.c),this.ty=a-(l*this.b+o*this.d),this}prepend(t){const a=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const l=this.a,o=this.c;this.a=l*t.a+this.b*t.c,this.b=l*t.b+this.b*t.d,this.c=o*t.a+this.d*t.c,this.d=o*t.b+this.d*t.d}return this.tx=a*t.a+this.ty*t.c+t.tx,this.ty=a*t.b+this.ty*t.d+t.ty,this}decompose(t){const a=this.a,l=this.b,o=this.c,c=this.d,h=t.pivot,m=-Math.atan2(-o,c),p=Math.atan2(l,a),y=Math.abs(m+p);return y<1e-5||Math.abs(x3-y)<1e-5?(t.rotation=p,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=m,t.skew.y=p),t.scale.x=Math.sqrt(a*a+l*l),t.scale.y=Math.sqrt(o*o+c*c),t.position.x=this.tx+(h.x*a+h.y*o),t.position.y=this.ty+(h.x*l+h.y*c),t}invert(){const t=this.a,a=this.b,l=this.c,o=this.d,c=this.tx,h=t*o-a*l;return this.a=o/h,this.b=-a/h,this.c=-l/h,this.d=t/h,this.tx=(l*this.ty-o*c)/h,this.ty=-(t*this.ty-a*c)/h,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 t=new le;return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyTo(t){return t.a=this.a,t.b=this.b,t.c=this.c,t.d=this.d,t.tx=this.tx,t.ty=this.ty,t}copyFrom(t){return this.a=t.a,this.b=t.b,this.c=t.c,this.d=t.d,this.tx=t.tx,this.ty=t.ty,this}equals(t){return t.a===this.a&&t.b===this.b&&t.c===this.c&&t.d===this.d&&t.tx===this.tx&&t.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 T3.identity()}static get shared(){return _3.identity()}}const _3=new le,T3=new le,mo=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],po=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],yo=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],go=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],B0=[],cb=[],rp=Math.sign;function E3(){for(let n=0;n<16;n++){const t=[];B0.push(t);for(let a=0;a<16;a++){const l=rp(mo[n]*mo[a]+yo[n]*po[a]),o=rp(po[n]*mo[a]+go[n]*po[a]),c=rp(mo[n]*yo[a]+yo[n]*go[a]),h=rp(po[n]*yo[a]+go[n]*go[a]);for(let m=0;m<16;m++)if(mo[m]===l&&po[m]===o&&yo[m]===c&&go[m]===h){t.push(m);break}}}for(let n=0;n<16;n++){const t=new le;t.set(mo[n],po[n],yo[n],go[n],0,0),cb.push(t)}}E3();const je={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:n=>mo[n],uY:n=>po[n],vX:n=>yo[n],vY:n=>go[n],inv:n=>n&8?n&15:-n&7,add:(n,t)=>B0[n][t],sub:(n,t)=>B0[n][je.inv(t)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,t)=>Math.abs(n)*2<=Math.abs(t)?t>=0?je.S:je.N:Math.abs(t)*2<=Math.abs(n)?n>0?je.E:je.W:t>0?n>0?je.SE:je.SW:n>0?je.NE:je.NW,matrixAppendRotationInv:(n,t,a=0,l=0,o=0,c=0)=>{const h=cb[je.inv(t)],m=h.a,p=h.b,y=h.c,x=h.d,_=a-Math.min(0,m*o,y*c,m*o+y*c),T=l-Math.min(0,p*o,x*c,p*o+x*c),C=n.a,M=n.b,w=n.c,z=n.d;n.a=m*C+p*w,n.b=m*M+p*z,n.c=y*C+x*w,n.d=y*M+x*z,n.tx=_*C+T*w+n.tx,n.ty=_*M+T*z+n.ty},transformRectCoords:(n,t,a,l)=>{const{x:o,y:c,width:h,height:m}=n,{x:p,y,width:x,height:_}=t;return a===je.E?(l.set(o+p,c+y,h,m),l):a===je.S?l.set(x-c-m+p,o+y,m,h):a===je.W?l.set(x-o-h+p,_-c-m+y,h,m):a===je.N?l.set(c+p,_-o-h+y,m,h):l.set(o+p,c+y,h,m)}},up=[new ya,new ya,new ya,new ya];class mn{constructor(t=0,a=0,l=0,o=0){this.type="rectangle",this.x=Number(t),this.y=Number(a),this.width=Number(l),this.height=Number(o)}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 mn(0,0,0,0)}clone(){return new mn(this.x,this.y,this.width,this.height)}copyFromBounds(t){return this.x=t.minX,this.y=t.minY,this.width=t.maxX-t.minX,this.height=t.maxY-t.minY,this}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,a){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&a>=this.y&&a<this.y+this.height}strokeContains(t,a,l,o=.5){const{width:c,height:h}=this;if(c<=0||h<=0)return!1;const m=this.x,p=this.y,y=l*(1-o),x=l-y,_=m-y,T=m+c+y,C=p-y,M=p+h+y,w=m+x,z=m+c-x,D=p+x,N=p+h-x;return t>=_&&t<=T&&a>=C&&a<=M&&!(t>w&&t<z&&a>D&&a<N)}intersects(t,a){if(!a){const W=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=W)return!1;const $=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>$}const l=this.left,o=this.right,c=this.top,h=this.bottom;if(o<=l||h<=c)return!1;const m=up[0].set(t.left,t.top),p=up[1].set(t.left,t.bottom),y=up[2].set(t.right,t.top),x=up[3].set(t.right,t.bottom);if(y.x<=m.x||p.y<=m.y)return!1;const _=Math.sign(a.a*a.d-a.b*a.c);if(_===0||(a.apply(m,m),a.apply(p,p),a.apply(y,y),a.apply(x,x),Math.max(m.x,p.x,y.x,x.x)<=l||Math.min(m.x,p.x,y.x,x.x)>=o||Math.max(m.y,p.y,y.y,x.y)<=c||Math.min(m.y,p.y,y.y,x.y)>=h))return!1;const T=_*(p.y-m.y),C=_*(m.x-p.x),M=T*l+C*c,w=T*o+C*c,z=T*l+C*h,D=T*o+C*h;if(Math.max(M,w,z,D)<=T*m.x+C*m.y||Math.min(M,w,z,D)>=T*x.x+C*x.y)return!1;const N=_*(m.y-y.y),j=_*(y.x-m.x),G=N*l+j*c,k=N*o+j*c,q=N*l+j*h,Z=N*o+j*h;return!(Math.max(G,k,q,Z)<=N*m.x+j*m.y||Math.min(G,k,q,Z)>=N*x.x+j*x.y)}pad(t=0,a=t){return this.x-=t,this.y-=a,this.width+=t*2,this.height+=a*2,this}fit(t){const a=Math.max(this.x,t.x),l=Math.min(this.x+this.width,t.x+t.width),o=Math.max(this.y,t.y),c=Math.min(this.y+this.height,t.y+t.height);return this.x=a,this.width=Math.max(l-a,0),this.y=o,this.height=Math.max(c-o,0),this}ceil(t=1,a=.001){const l=Math.ceil((this.x+this.width-a)*t)/t,o=Math.ceil((this.y+this.height-a)*t)/t;return this.x=Math.floor((this.x+a)*t)/t,this.y=Math.floor((this.y+a)*t)/t,this.width=l-this.x,this.height=o-this.y,this}scale(t,a=t){return this.x*=t,this.y*=a,this.width*=t,this.height*=a,this}enlarge(t){const a=Math.min(this.x,t.x),l=Math.max(this.x+this.width,t.x+t.width),o=Math.min(this.y,t.y),c=Math.max(this.y+this.height,t.y+t.height);return this.x=a,this.width=l-a,this.y=o,this.height=c-o,this}getBounds(t){return t||(t=new mn),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const a=t.x,l=t.y,o=t.x+t.width,c=t.y+t.height;return a>=this.x&&a<this.x+this.width&&l>=this.y&&l<this.y+this.height&&o>=this.x&&o<this.x+this.width&&c>=this.y&&c<this.y+this.height}set(t,a,l,o){return this.x=t,this.y=a,this.width=l,this.height=o,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Zy={default:-1};function on(n="default"){return Zy[n]===void 0&&(Zy[n]=-1),++Zy[n]}const e1=new Set,un="8.0.0",C3="8.3.4",Jc={quiet:!1,noColor:!1},de=((n,t,a=3)=>{if(Jc.quiet||e1.has(t))return;let l=new Error().stack;const o=`${t}
62
- Deprecated since v${n}`,c=typeof console.groupCollapsed=="function"&&!Jc.noColor;typeof l>"u"?console.warn("PixiJS Deprecation Warning: ",o):(l=l.split(`
63
- `).splice(a).join(`
64
- `),c?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",o),console.warn(l),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",o),console.warn(l))),e1.add(t)});Object.defineProperties(de,{quiet:{get:()=>Jc.quiet,set:n=>{Jc.quiet=n},enumerable:!0,configurable:!1},noColor:{get:()=>Jc.noColor,set:n=>{Jc.noColor=n},enumerable:!0,configurable:!1}});const fb=()=>{};function af(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function n1(n){return!(n&n-1)&&!!n}function hb(n){const t={};for(const a in n)n[a]!==void 0&&(t[a]=n[a]);return t}const a1=Object.create(null);function A3(n){const t=a1[n];return t===void 0&&(a1[n]=on("resource")),t}const db=class mb extends _s{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...mb.defaultOptions,...t},this.addressMode=t.addressMode,this.addressModeU=t.addressModeU??this.addressModeU,this.addressModeV=t.addressModeV??this.addressModeV,this.addressModeW=t.addressModeW??this.addressModeW,this.scaleMode=t.scaleMode,this.magFilter=t.magFilter??this.magFilter,this.minFilter=t.minFilter??this.minFilter,this.mipmapFilter=t.mipmapFilter??this.mipmapFilter,this.lodMinClamp=t.lodMinClamp,this.lodMaxClamp=t.lodMaxClamp,this.compare=t.compare,this.maxAnisotropy=t.maxAnisotropy??1}set addressMode(t){this.addressModeU=t,this.addressModeV=t,this.addressModeW=t}get addressMode(){return this.addressModeU}set wrapMode(t){de(un,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=t}get wrapMode(){return this.addressMode}set scaleMode(t){this.magFilter=t,this.minFilter=t,this.mipmapFilter=t}get scaleMode(){return this.magFilter}set maxAnisotropy(t){this._maxAnisotropy=Math.min(t,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 t=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=A3(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};db.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let lf=db;const pb=class yb extends _s{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=on("textureSource"),this._resourceType="textureSource",this._resourceId=on("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,t={...yb.defaultOptions,...t},this.label=t.label??"",this.resource=t.resource,this.autoGarbageCollect=t.autoGarbageCollect,this._resolution=t.resolution,t.width?this.pixelWidth=t.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,t.height?this.pixelHeight=t.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=t.format,this.dimension=t.dimensions,this.viewDimension=t.viewDimension??t.dimensions,this.arrayLayerCount=t.arrayLayerCount,this.mipLevelCount=t.mipLevelCount,this.autoGenerateMipmaps=t.autoGenerateMipmaps,this.sampleCount=t.sampleCount,this.antialias=t.antialias,this.alphaMode=t.alphaMode,this.style=new lf(hb(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var a,l;this.style!==t&&((a=this._style)==null||a.off("change",this._onStyleChange,this),this._style=t,(l=this._style)==null||l.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(t){this._style.maxAnisotropy=t}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(t){this._style.addressMode=t}get repeatMode(){return this._style.addressMode}set repeatMode(t){this._style.addressMode=t}get magFilter(){return this._style.magFilter}set magFilter(t){this._style.magFilter=t}get minFilter(){return this._style.minFilter}set minFilter(t){this._style.minFilter=t}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(t){this._style.mipmapFilter=t}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(t){this._style.lodMinClamp=t}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(t){this._style.lodMaxClamp=t}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const t=this._resolution;if(this.resize(this.resourceWidth/t,this.resourceHeight/t))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 t,a;this._resourceId=on("resource"),this.emit("change",this),this.emit("unload",this);for(const l in this._gpuData)(a=(t=this._gpuData[l])==null?void 0:t.destroy)==null||a.call(t);this._gpuData=Object.create(null)}get resourceWidth(){const{resource:t}=this;return t.naturalWidth||t.videoWidth||t.displayWidth||t.width}get resourceHeight(){const{resource:t}=this;return t.naturalHeight||t.videoHeight||t.displayHeight||t.height}get resolution(){return this._resolution}set resolution(t){this._resolution!==t&&(this._resolution=t,this.width=this.pixelWidth/t,this.height=this.pixelHeight/t)}resize(t,a,l){l||(l=this._resolution),t||(t=this.width),a||(a=this.height);const o=Math.round(t*l),c=Math.round(a*l);return this.width=o/l,this.height=c/l,this._resolution=l,this.pixelWidth===o&&this.pixelHeight===c?!1:(this._refreshPOT(),this.pixelWidth=o,this.pixelHeight=c,this.emit("resize",this),this._resourceId=on("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(t){this._style.wrapMode=t}get wrapMode(){return this._style.wrapMode}set scaleMode(t){this._style.scaleMode=t}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=n1(this.pixelWidth)&&n1(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};pb.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 el=pb;class cg extends el{constructor(t){const a=t.resource||new Float32Array(t.width*t.height*4);let l=t.format;l||(a instanceof Float32Array?l="rgba32float":a instanceof Int32Array||a instanceof Uint32Array?l="rgba32uint":a instanceof Int16Array||a instanceof Uint16Array?l="rgba16uint":(a instanceof Int8Array,l="bgra8unorm")),super({...t,resource:a,format:l}),this.uploadMethodId="buffer"}static test(t){return t instanceof Int8Array||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array}}cg.extension=Jt.TextureSource;const i1=new le;class M3{constructor(t,a){this.mapCoord=new le,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof a>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=a,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var a;this.texture!==t&&((a=this._texture)==null||a.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,a){a===void 0&&(a=t);const l=this.mapCoord;for(let o=0;o<t.length;o+=2){const c=t[o],h=t[o+1];a[o]=c*l.a+h*l.c+l.tx,a[o+1]=c*l.b+h*l.d+l.ty}return a}update(){const t=this._texture;this._updateID++;const a=t.uvs;this.mapCoord.set(a.x1-a.x0,a.y1-a.y0,a.x3-a.x0,a.y3-a.y0,a.x0,a.y0);const l=t.orig,o=t.trim;o&&(i1.set(l.width/o.width,0,0,l.height/o.height,-o.x/o.width,-o.y/o.height),this.mapCoord.append(i1));const c=t.source,h=this.uClampFrame,m=this.clampMargin/c._resolution,p=this.clampOffset/c._resolution;return h[0]=(t.frame.x+m+p)/c.width,h[1]=(t.frame.y+m+p)/c.height,h[2]=(t.frame.x+t.frame.width-m+p)/c.width,h[3]=(t.frame.y+t.frame.height-m+p)/c.height,this.uClampOffset[0]=this.clampOffset/c.pixelWidth,this.uClampOffset[1]=this.clampOffset/c.pixelHeight,this.isSimple=t.frame.width===c.width&&t.frame.height===c.height&&t.rotate===0,!0}}class ze extends _s{constructor({source:t,label:a,frame:l,orig:o,trim:c,defaultAnchor:h,defaultBorders:m,rotate:p,dynamic:y}={}){if(super(),this.uid=on("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new mn,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=a,this.source=(t==null?void 0:t.source)??new el,this.noFrame=!l,l)this.frame.copyFrom(l);else{const{width:x,height:_}=this._source;this.frame.width=x,this.frame.height=_}this.orig=o||this.frame,this.trim=c,this.rotate=p??0,this.defaultAnchor=h,this.defaultBorders=m,this.destroyed=!1,this.dynamic=y||!1,this.updateUvs()}set source(t){this._source&&this._source.off("resize",this.update,this),this._source=t,t.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new M3(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:a}=this,{width:l,height:o}=this._source,c=a.x/l,h=a.y/o,m=a.width/l,p=a.height/o;let y=this.rotate;if(y){const x=m/2,_=p/2,T=c+x,C=h+_;y=je.add(y,je.NW),t.x0=T+x*je.uX(y),t.y0=C+_*je.uY(y),y=je.add(y,2),t.x1=T+x*je.uX(y),t.y1=C+_*je.uY(y),y=je.add(y,2),t.x2=T+x*je.uX(y),t.y2=C+_*je.uY(y),y=je.add(y,2),t.x3=T+x*je.uX(y),t.y3=C+_*je.uY(y)}else t.x0=c,t.y0=h,t.x1=c+m,t.y1=h,t.x2=c+m,t.y2=h+p,t.x3=c,t.y3=h+p}destroy(t=!1){this._source&&(this._source.off("resize",this.update,this),t&&(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 de(un,"Texture.baseTexture is now Texture.source"),this._source}}ze.EMPTY=new ze({label:"EMPTY",source:new el({label:"EMPTY"})});ze.EMPTY.destroy=fb;ze.WHITE=new ze({source:new cg({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});ze.WHITE.destroy=fb;function gb(n,t,a){const{width:l,height:o}=a.orig,c=a.trim;if(c){const h=c.width,m=c.height;n.minX=c.x-t._x*l,n.maxX=n.minX+h,n.minY=c.y-t._y*o,n.maxY=n.minY+m}else n.minX=-t._x*l,n.maxX=n.minX+l,n.minY=-t._y*o,n.maxY=n.minY+o}const l1=new le;class tl{constructor(t=1/0,a=1/0,l=-1/0,o=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=l1,this.minX=t,this.minY=a,this.maxX=l,this.maxY=o}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new mn);const t=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(t.x=0,t.y=0,t.width=0,t.height=0):t.copyFromBounds(this),t}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=l1,this}set(t,a,l,o){this.minX=t,this.minY=a,this.maxX=l,this.maxY=o}addFrame(t,a,l,o,c){c||(c=this.matrix);const h=c.a,m=c.b,p=c.c,y=c.d,x=c.tx,_=c.ty;let T=this.minX,C=this.minY,M=this.maxX,w=this.maxY,z=h*t+p*a+x,D=m*t+y*a+_;z<T&&(T=z),D<C&&(C=D),z>M&&(M=z),D>w&&(w=D),z=h*l+p*a+x,D=m*l+y*a+_,z<T&&(T=z),D<C&&(C=D),z>M&&(M=z),D>w&&(w=D),z=h*t+p*o+x,D=m*t+y*o+_,z<T&&(T=z),D<C&&(C=D),z>M&&(M=z),D>w&&(w=D),z=h*l+p*o+x,D=m*l+y*o+_,z<T&&(T=z),D<C&&(C=D),z>M&&(M=z),D>w&&(w=D),this.minX=T,this.minY=C,this.maxX=M,this.maxY=w}addRect(t,a){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,a)}addBounds(t,a){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,a)}addBoundsMask(t){this.minX=this.minX>t.minX?this.minX:t.minX,this.minY=this.minY>t.minY?this.minY:t.minY,this.maxX=this.maxX<t.maxX?this.maxX:t.maxX,this.maxY=this.maxY<t.maxY?this.maxY:t.maxY}applyMatrix(t){const a=this.minX,l=this.minY,o=this.maxX,c=this.maxY,{a:h,b:m,c:p,d:y,tx:x,ty:_}=t;let T=h*a+p*l+x,C=m*a+y*l+_;this.minX=T,this.minY=C,this.maxX=T,this.maxY=C,T=h*o+p*l+x,C=m*o+y*l+_,this.minX=T<this.minX?T:this.minX,this.minY=C<this.minY?C:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=C>this.maxY?C:this.maxY,T=h*a+p*c+x,C=m*a+y*c+_,this.minX=T<this.minX?T:this.minX,this.minY=C<this.minY?C:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=C>this.maxY?C:this.maxY,T=h*o+p*c+x,C=m*o+y*c+_,this.minX=T<this.minX?T:this.minX,this.minY=C<this.minY?C:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=C>this.maxY?C:this.maxY}fit(t){return this.minX<t.left&&(this.minX=t.left),this.maxX>t.right&&(this.maxX=t.right),this.minY<t.top&&(this.minY=t.top),this.maxY>t.bottom&&(this.maxY=t.bottom),this}fitBounds(t,a,l,o){return this.minX<t&&(this.minX=t),this.maxX>a&&(this.maxX=a),this.minY<l&&(this.minY=l),this.maxY>o&&(this.maxY=o),this}pad(t,a=t){return this.minX-=t,this.maxX+=t,this.minY-=a,this.maxY+=a,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 tl(this.minX,this.minY,this.maxX,this.maxY)}scale(t,a=t){return this.minX*=t,this.minY*=a,this.maxX*=t,this.maxY*=a,this}get x(){return this.minX}set x(t){const a=this.maxX-this.minX;this.minX=t,this.maxX=t+a}get y(){return this.minY}set y(t){const a=this.maxY-this.minY;this.minY=t,this.maxY=t+a}get width(){return this.maxX-this.minX}set width(t){this.maxX=this.minX+t}get height(){return this.maxY-this.minY}set height(t){this.maxY=this.minY+t}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(t,a,l,o){let c=this.minX,h=this.minY,m=this.maxX,p=this.maxY;o||(o=this.matrix);const y=o.a,x=o.b,_=o.c,T=o.d,C=o.tx,M=o.ty;for(let w=a;w<l;w+=2){const z=t[w],D=t[w+1],N=y*z+_*D+C,j=x*z+T*D+M;c=N<c?N:c,h=j<h?j:h,m=N>m?N:m,p=j>p?j:p}this.minX=c,this.minY=h,this.maxX=m,this.maxY=p}containsPoint(t,a){return this.minX<=t&&this.minY<=a&&this.maxX>=t&&this.maxY>=a}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var R3={grad:.9,turn:360,rad:360/(2*Math.PI)},ir=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},Ln=function(n,t,a){return t===void 0&&(t=0),a===void 0&&(a=Math.pow(10,t)),Math.round(a*n)/a+0},Ii=function(n,t,a){return t===void 0&&(t=0),a===void 0&&(a=1),n>a?a:n>t?n:t},vb=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},s1=function(n){return{r:Ii(n.r,0,255),g:Ii(n.g,0,255),b:Ii(n.b,0,255),a:Ii(n.a)}},Fy=function(n){return{r:Ln(n.r),g:Ln(n.g),b:Ln(n.b),a:Ln(n.a,3)}},z3=/^#([0-9a-f]{3,8})$/i,op=function(n){var t=n.toString(16);return t.length<2?"0"+t:t},xb=function(n){var t=n.r,a=n.g,l=n.b,o=n.a,c=Math.max(t,a,l),h=c-Math.min(t,a,l),m=h?c===t?(a-l)/h:c===a?2+(l-t)/h:4+(t-a)/h:0;return{h:60*(m<0?m+6:m),s:c?h/c*100:0,v:c/255*100,a:o}},bb=function(n){var t=n.h,a=n.s,l=n.v,o=n.a;t=t/360*6,a/=100,l/=100;var c=Math.floor(t),h=l*(1-a),m=l*(1-(t-c)*a),p=l*(1-(1-t+c)*a),y=c%6;return{r:255*[l,m,h,h,p,l][y],g:255*[p,l,l,m,h,h][y],b:255*[h,h,p,l,l,m][y],a:o}},r1=function(n){return{h:vb(n.h),s:Ii(n.s,0,100),l:Ii(n.l,0,100),a:Ii(n.a)}},u1=function(n){return{h:Ln(n.h),s:Ln(n.s),l:Ln(n.l),a:Ln(n.a,3)}},o1=function(n){return bb((a=(t=n).s,{h:t.h,s:(a*=((l=t.l)<50?l:100-l)/100)>0?2*a/(l+a)*100:0,v:l+a,a:t.a}));var t,a,l},ud=function(n){return{h:(t=xb(n)).h,s:(o=(200-(a=t.s))*(l=t.v)/100)>0&&o<200?a*l/100/(o<=100?o:200-o)*100:0,l:o/2,a:t.a};var t,a,l,o},w3=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,D3=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,O3=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,N3=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,j0={string:[[function(n){var t=z3.exec(n);return t?(n=t[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Ln(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?Ln(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var t=O3.exec(n)||N3.exec(n);return t?t[2]!==t[4]||t[4]!==t[6]?null:s1({r:Number(t[1])/(t[2]?100/255:1),g:Number(t[3])/(t[4]?100/255:1),b:Number(t[5])/(t[6]?100/255:1),a:t[7]===void 0?1:Number(t[7])/(t[8]?100:1)}):null},"rgb"],[function(n){var t=w3.exec(n)||D3.exec(n);if(!t)return null;var a,l,o=r1({h:(a=t[1],l=t[2],l===void 0&&(l="deg"),Number(a)*(R3[l]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return o1(o)},"hsl"]],object:[[function(n){var t=n.r,a=n.g,l=n.b,o=n.a,c=o===void 0?1:o;return ir(t)&&ir(a)&&ir(l)?s1({r:Number(t),g:Number(a),b:Number(l),a:Number(c)}):null},"rgb"],[function(n){var t=n.h,a=n.s,l=n.l,o=n.a,c=o===void 0?1:o;if(!ir(t)||!ir(a)||!ir(l))return null;var h=r1({h:Number(t),s:Number(a),l:Number(l),a:Number(c)});return o1(h)},"hsl"],[function(n){var t=n.h,a=n.s,l=n.v,o=n.a,c=o===void 0?1:o;if(!ir(t)||!ir(a)||!ir(l))return null;var h=(function(m){return{h:vb(m.h),s:Ii(m.s,0,100),v:Ii(m.v,0,100),a:Ii(m.a)}})({h:Number(t),s:Number(a),v:Number(l),a:Number(c)});return bb(h)},"hsv"]]},c1=function(n,t){for(var a=0;a<t.length;a++){var l=t[a][0](n);if(l)return[l,t[a][1]]}return[null,void 0]},B3=function(n){return typeof n=="string"?c1(n.trim(),j0.string):typeof n=="object"&&n!==null?c1(n,j0.object):[null,void 0]},Wy=function(n,t){var a=ud(n);return{h:a.h,s:Ii(a.s+100*t,0,100),l:a.l,a:a.a}},Jy=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},f1=function(n,t){var a=ud(n);return{h:a.h,s:a.s,l:Ii(a.l+100*t,0,100),a:a.a}},U0=(function(){function n(t){this.parsed=B3(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return Ln(Jy(this.rgba),2)},n.prototype.isDark=function(){return Jy(this.rgba)<.5},n.prototype.isLight=function(){return Jy(this.rgba)>=.5},n.prototype.toHex=function(){return t=Fy(this.rgba),a=t.r,l=t.g,o=t.b,h=(c=t.a)<1?op(Ln(255*c)):"","#"+op(a)+op(l)+op(o)+h;var t,a,l,o,c,h},n.prototype.toRgb=function(){return Fy(this.rgba)},n.prototype.toRgbString=function(){return t=Fy(this.rgba),a=t.r,l=t.g,o=t.b,(c=t.a)<1?"rgba("+a+", "+l+", "+o+", "+c+")":"rgb("+a+", "+l+", "+o+")";var t,a,l,o,c},n.prototype.toHsl=function(){return u1(ud(this.rgba))},n.prototype.toHslString=function(){return t=u1(ud(this.rgba)),a=t.h,l=t.s,o=t.l,(c=t.a)<1?"hsla("+a+", "+l+"%, "+o+"%, "+c+")":"hsl("+a+", "+l+"%, "+o+"%)";var t,a,l,o,c},n.prototype.toHsv=function(){return t=xb(this.rgba),{h:Ln(t.h),s:Ln(t.s),v:Ln(t.v),a:Ln(t.a,3)};var t},n.prototype.invert=function(){return vs({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},n.prototype.saturate=function(t){return t===void 0&&(t=.1),vs(Wy(this.rgba,t))},n.prototype.desaturate=function(t){return t===void 0&&(t=.1),vs(Wy(this.rgba,-t))},n.prototype.grayscale=function(){return vs(Wy(this.rgba,-1))},n.prototype.lighten=function(t){return t===void 0&&(t=.1),vs(f1(this.rgba,t))},n.prototype.darken=function(t){return t===void 0&&(t=.1),vs(f1(this.rgba,-t))},n.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},n.prototype.alpha=function(t){return typeof t=="number"?vs({r:(a=this.rgba).r,g:a.g,b:a.b,a:t}):Ln(this.rgba.a,3);var a},n.prototype.hue=function(t){var a=ud(this.rgba);return typeof t=="number"?vs({h:t,s:a.s,l:a.l,a:a.a}):Ln(a.h)},n.prototype.isEqual=function(t){return this.toHex()===vs(t).toHex()},n})(),vs=function(n){return n instanceof U0?n:new U0(n)},h1=[],j3=function(n){n.forEach(function(t){h1.indexOf(t)<0&&(t(U0,j0),h1.push(t))})};function U3(n,t){var a={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"},l={};for(var o in a)l[a[o]]=o;var c={};n.prototype.toName=function(h){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var m,p,y=l[this.toHex()];if(y)return y;if(h!=null&&h.closest){var x=this.toRgb(),_=1/0,T="black";if(!c.length)for(var C in a)c[C]=new n(a[C]).toRgb();for(var M in a){var w=(m=x,p=c[M],Math.pow(m.r-p.r,2)+Math.pow(m.g-p.g,2)+Math.pow(m.b-p.b,2));w<_&&(_=w,T=M)}return T}},t.string.push([function(h){var m=h.toLowerCase(),p=m==="transparent"?"#0000":a[m];return p?new n(p).toRgb():null},"name"])}j3([U3]);const sf=class ad{constructor(t=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=t}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(t){return this.value=t,this}set value(t){if(t instanceof ad)this._value=this._cloneSource(t._value),this._int=t._int,this._components.set(t._components);else{if(t===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,t))&&(this._value=this._cloneSource(t),this._normalize(this._value))}}get value(){return this._value}_cloneSource(t){return typeof t=="string"||typeof t=="number"||t instanceof Number||t===null?t:Array.isArray(t)||ArrayBuffer.isView(t)?t.slice(0):typeof t=="object"&&t!==null?{...t}:t}_isSourceEqual(t,a){const l=typeof t;if(l!==typeof a)return!1;if(l==="number"||l==="string"||t instanceof Number)return t===a;if(Array.isArray(t)&&Array.isArray(a)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(a))return t.length!==a.length?!1:t.every((c,h)=>c===a[h]);if(t!==null&&a!==null){const c=Object.keys(t),h=Object.keys(a);return c.length!==h.length?!1:c.every(m=>t[m]===a[m])}return t===a}toRgba(){const[t,a,l,o]=this._components;return{r:t,g:a,b:l,a:o}}toRgb(){const[t,a,l]=this._components;return{r:t,g:a,b:l}}toRgbaString(){const[t,a,l]=this.toUint8RgbArray();return`rgba(${t},${a},${l},${this.alpha})`}toUint8RgbArray(t){const[a,l,o]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(a*255),t[1]=Math.round(l*255),t[2]=Math.round(o*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[a,l,o,c]=this._components;return t[0]=a,t[1]=l,t[2]=o,t[3]=c,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[a,l,o]=this._components;return t[0]=a,t[1]=l,t[2]=o,t}toNumber(){return this._int}toBgrNumber(){const[t,a,l]=this.toUint8RgbArray();return(l<<16)+(a<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[a,l,o,c]=ad._temp.setValue(t)._components;return this._components[0]*=a,this._components[1]*=l,this._components[2]*=o,this._components[3]*=c,this._refreshInt(),this._value=null,this}premultiply(t,a=!0){return a&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,a=!0){if(t===1)return(255<<24)+this._int;if(t===0)return a?0:this._int;let l=this._int>>16&255,o=this._int>>8&255,c=this._int&255;return a&&(l=l*t+.5|0,o=o*t+.5|0,c=c*t+.5|0),(t*255<<24)+(l<<16)+(o<<8)+c}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const a=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-a.length)+a}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let a,l,o,c;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const h=t;a=(h>>16&255)/255,l=(h>>8&255)/255,o=(h&255)/255,c=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[a,l,o,c=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[a,l,o,c=255]=t,a/=255,l/=255,o/=255,c/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const m=ad.HEX_PATTERN.exec(t);m&&(t=`#${m[2]}`)}const h=vs(t);h.isValid()&&({r:a,g:l,b:o,a:c}=h.rgba,a/=255,l/=255,o/=255)}if(a!==void 0)this._components[0]=a,this._components[1]=l,this._components[2]=o,this._components[3]=c,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,a,l]=this._components;this._int=(t*255<<16)+(a*255<<8)+(l*255|0)}_clamp(t,a=0,l=1){return typeof t=="number"?Math.min(Math.max(t,a),l):(t.forEach((o,c)=>{t[c]=Math.min(Math.max(o,a),l)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof ad||Array.isArray(t)||t instanceof Uint8Array||t instanceof Uint8ClampedArray||t instanceof Float32Array||t.r!==void 0&&t.g!==void 0&&t.b!==void 0||t.r!==void 0&&t.g!==void 0&&t.b!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0||t.h!==void 0&&t.s!==void 0&&t.l!==void 0&&t.a!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0||t.h!==void 0&&t.s!==void 0&&t.v!==void 0&&t.a!==void 0}};sf.shared=new sf;sf._temp=new sf;sf.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let zn=sf;const H3={cullArea:null,cullable:!1,cullableChildren:!0};let Py=0;const d1=500;function qa(...n){Py!==d1&&(Py++,Py===d1?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...n))}const Sd={_registeredResources:new Set,register(n){this._registeredResources.add(n)},unregister(n){this._registeredResources.delete(n)},release(){this._registeredResources.forEach(n=>n.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(n){return this._registeredResources.has(n)},reset(){this._registeredResources.clear()}};class G3{constructor(t,a){this._pool=[],this._count=0,this._index=0,this._classType=t,a&&this.prepopulate(a)}prepopulate(t){for(let a=0;a<t;a++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){var l;let a;return this._index>0?a=this._pool[--this._index]:(a=new this._classType,this._count++),(l=a.init)==null||l.call(a,t),a}return(t){var a;(a=t.reset)==null||a.call(t),this._pool[this._index++]=t}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 t=0;t<this._index;t++)this._pool[t].destroy();this._pool.length=0,this._count=0,this._index=0}}class Y3{constructor(){this._poolsByClass=new Map}prepopulate(t,a){this.getPool(t).prepopulate(a)}get(t,a){return this.getPool(t).get(a)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new G3(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(a=>{const l=t[a._classType.name]?a._classType.name+a._classType.ID:a._classType.name;t[l]={free:a.totalFree,used:a.totalUsed,size:a.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const ii=new Y3;Sd.register(ii);const q3={get isCachedAsTexture(){var n;return!!((n=this.renderGroup)!=null&&n.isCachedAsTexture)},cacheAsTexture(n){typeof n=="boolean"&&n===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(n===!0?{}:n))},updateCacheTexture(){var n;(n=this.renderGroup)==null||n.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(n){de("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(n)}};function L3(n,t,a){const l=n.length;let o;if(t>=l||a===0)return;a=t+a>l?l-t:a;const c=l-a;for(o=t;o<c;++o)n[o]=n[o+a];n.length=c}const X3={allowChildren:!0,removeChildren(n=0,t){var c;const a=t??this.children.length,l=a-n,o=[];if(l>0&&l<=a){for(let m=a-1;m>=n;m--){const p=this.children[m];p&&(o.push(p),p.parent=null)}L3(this.children,n,a);const h=this.renderGroup||this.parentRenderGroup;h&&h.removeChildren(o);for(let m=0;m<o.length;++m){const p=o[m];(c=p.parentRenderLayer)==null||c.detach(p),this.emit("childRemoved",p,this,m),o[m].emit("removed",this)}return o.length>0&&this._didViewChangeTick++,o}else if(l===0&&this.children.length===0)return o;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(n){const t=this.getChildAt(n);return this.removeChild(t)},getChildAt(n){if(n<0||n>=this.children.length)throw new Error(`getChildAt: Index (${n}) does not exist.`);return this.children[n]},setChildIndex(n,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(n),this.addChildAt(n,t)},getChildIndex(n){const t=this.children.indexOf(n);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(n,t){this.allowChildren||de(un,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:a}=this;if(t<0||t>a.length)throw new Error(`${n}addChildAt: The index ${t} supplied is out of bounds ${a.length}`);const l=n.parent===this;if(n.parent){const c=n.parent.children.indexOf(n);if(l){if(c===t)return n;n.parent.children.splice(c,1)}else n.removeFromParent()}t===a.length?a.push(n):a.splice(t,0,n),n.parent=this,n.didChange=!0,n._updateFlags=15;const o=this.renderGroup||this.parentRenderGroup;return o&&o.addChild(n),this.sortableChildren&&(this.sortDirty=!0),l||(this.emit("childAdded",n,this,t),n.emit("added",this)),n},swapChildren(n,t){if(n===t)return;const a=this.getChildIndex(n),l=this.getChildIndex(t);this.children[a]=t,this.children[l]=n;const o=this.renderGroup||this.parentRenderGroup;o&&(o.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var n;(n=this.parent)==null||n.removeChild(this)},reparentChild(...n){return n.length===1?this.reparentChildAt(n[0],this.children.length):(n.forEach(t=>this.reparentChildAt(t,this.children.length)),n[0])},reparentChildAt(n,t){if(n.parent===this)return this.setChildIndex(n,t),n;const a=n.worldTransform.clone();n.removeFromParent(),this.addChildAt(n,t);const l=this.worldTransform.clone();return l.invert(),a.prepend(l),n.setFromMatrix(a),n},replaceChild(n,t){n.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(n)),t.setFromMatrix(n.localTransform),t.updateLocalTransform(),this.removeChild(n)}},V3={collectRenderables(n,t,a){this.parentRenderLayer&&this.parentRenderLayer!==a||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(n,t,a):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,n):this.collectRenderablesWithEffects(n,t,a))},collectRenderablesSimple(n,t,a){const l=this.children,o=l.length;for(let c=0;c<o;c++)l[c].collectRenderables(n,t,a)},collectRenderablesWithEffects(n,t,a){const{renderPipes:l}=t;for(let o=0;o<this.effects.length;o++){const c=this.effects[o];l[c.pipe].push(c,this,n)}this.collectRenderablesSimple(n,t,a);for(let o=this.effects.length-1;o>=0;o--){const c=this.effects[o];l[c.pipe].pop(c,this,n)}}};class m1{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let t=0;t<this.filters.length;t++)this.filters[t].destroy();this.filters=null,this.filterArea=null}}class k3{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(t=>{this.add({test:t.test,maskClass:t})}))}add(t){this._tests.push(t)}getMaskEffect(t){this._initialized||this.init();for(let a=0;a<this._tests.length;a++){const l=this._tests[a];if(l.test(t))return ii.get(l.maskClass,t)}return t}returnMaskEffect(t){ii.return(t)}}const H0=new k3;Ie.handleByList(Jt.MaskEffect,H0._effectClasses);const Q3={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)},addEffect(n){this.effects.indexOf(n)===-1&&(this.effects.push(n),this.effects.sort((a,l)=>a.priority-l.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(n){const t=this.effects.indexOf(n);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(n){const t=this._maskEffect;(t==null?void 0:t.mask)!==n&&(t&&(this.removeEffect(t),H0.returnMaskEffect(t),this._maskEffect=null),n!=null&&(this._maskEffect=H0.getMaskEffect(n),this.addEffect(this._maskEffect)))},get mask(){var n;return(n=this._maskEffect)==null?void 0:n.mask},setMask(n){this._maskOptions={...this._maskOptions,...n},n.mask&&(this.mask=n.mask),this._markStructureAsChanged()},set filters(n){var c;!Array.isArray(n)&&n&&(n=[n]);const t=this._filterEffect||(this._filterEffect=new m1);n=n;const a=(n==null?void 0:n.length)>0,l=((c=t.filters)==null?void 0:c.length)>0,o=a!==l;n=Array.isArray(n)?n.slice(0):n,t.filters=Object.freeze(n),o&&(a?this.addEffect(t):(this.removeEffect(t),t.filters=n??null))},get filters(){var n;return(n=this._filterEffect)==null?void 0:n.filters},set filterArea(n){this._filterEffect||(this._filterEffect=new m1),this._filterEffect.filterArea=n},get filterArea(){var n;return(n=this._filterEffect)==null?void 0:n.filterArea}},K3={label:null,get name(){return de(un,"Container.name property has been removed, use Container.label instead"),this.label},set name(n){de(un,"Container.name property has been removed, use Container.label instead"),this.label=n},getChildByName(n,t=!1){return this.getChildByLabel(n,t)},getChildByLabel(n,t=!1){const a=this.children;for(let l=0;l<a.length;l++){const o=a[l];if(o.label===n||n instanceof RegExp&&n.test(o.label))return o}if(t)for(let l=0;l<a.length;l++){const c=a[l].getChildByLabel(n,!0);if(c)return c}return null},getChildrenByLabel(n,t=!1,a=[]){const l=this.children;for(let o=0;o<l.length;o++){const c=l[o];(c.label===n||n instanceof RegExp&&n.test(c.label))&&a.push(c)}if(t)for(let o=0;o<l.length;o++)l[o].getChildrenByLabel(n,!0,a);return a}},Ya=ii.getPool(le),or=ii.getPool(tl),Z3=new le,F3={getFastGlobalBounds(n,t){t||(t=new tl),t.clear(),this._getGlobalBoundsRecursive(!!n,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const a=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(a.worldTransform),t},_getGlobalBoundsRecursive(n,t,a){let l=t;if(n&&this.parentRenderLayer&&this.parentRenderLayer!==a||this.localDisplayStatus!==7||!this.measurable)return;const o=!!this.effects.length;if((this.renderGroup||o)&&(l=or.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const h=this.bounds;l.addFrame(h.minX,h.minY,h.maxX,h.maxY,this.groupTransform)}const c=this.children;for(let h=0;h<c.length;h++)c[h]._getGlobalBoundsRecursive(n,l,a)}if(o){let c=!1;const h=this.renderGroup||this.parentRenderGroup;for(let m=0;m<this.effects.length;m++)this.effects[m].addBounds&&(c||(c=!0,l.applyMatrix(h.worldTransform)),this.effects[m].addBounds(l,!0));c&&l.applyMatrix(h.worldTransform.copyTo(Z3).invert()),t.addBounds(l),or.return(l)}else this.renderGroup&&(t.addBounds(l,this.relativeGroupTransform),or.return(l))}};function Sb(n,t,a){a.clear();let l,o;return n.parent?t?l=n.parent.worldTransform:(o=Ya.get().identity(),l=fg(n,o)):l=le.IDENTITY,_b(n,a,l,t),o&&Ya.return(o),a.isValid||a.set(0,0,0,0),a}function _b(n,t,a,l){var m,p;if(!n.visible||!n.measurable)return;let o;l?o=n.worldTransform:(n.updateLocalTransform(),o=Ya.get(),o.appendFrom(n.localTransform,a));const c=t,h=!!n.effects.length;if(h&&(t=or.get().clear()),n.boundsArea)t.addRect(n.boundsArea,o);else{const y=n.bounds;y&&!y.isEmpty()&&(t.matrix=o,t.addBounds(y));for(let x=0;x<n.children.length;x++)_b(n.children[x],t,o,l)}if(h){for(let y=0;y<n.effects.length;y++)(p=(m=n.effects[y]).addBounds)==null||p.call(m,t);c.addBounds(t,le.IDENTITY),or.return(t)}l||Ya.return(o)}function fg(n,t){const a=n.parent;return a&&(fg(a,t),a.updateLocalTransform(),t.append(a.localTransform)),t}function Tb(n,t){if(n===16777215||!t)return t;if(t===16777215||!n)return n;const a=n>>16&255,l=n>>8&255,o=n&255,c=t>>16&255,h=t>>8&255,m=t&255,p=a*c/255|0,y=l*h/255|0,x=o*m/255|0;return(p<<16)+(y<<8)+x}const p1=16777215;function y1(n,t){return n===p1?t:t===p1?n:Tb(n,t)}function Mp(n){return((n&255)<<16)+(n&65280)+(n>>16&255)}const W3={getGlobalAlpha(n){if(n)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,a=this.parent;for(;a;)t*=a.alpha,a=a.parent;return t},getGlobalTransform(n=new le,t){if(t)return n.copyFrom(this.worldTransform);this.updateLocalTransform();const a=fg(this,Ya.get().identity());return n.appendFrom(this.localTransform,a),Ya.return(a),n},getGlobalTint(n){if(n)return this.renderGroup?Mp(this.renderGroup.worldColor):this.parentRenderGroup?Mp(y1(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,a=this.parent;for(;a;)t=y1(t,a.localColor),a=a.parent;return Mp(t)}};function Eb(n,t,a){return t.clear(),a||(a=le.IDENTITY),Cb(n,t,a,n,!0),t.isValid||t.set(0,0,0,0),t}function Cb(n,t,a,l,o){var p,y;let c;if(o)c=Ya.get(),c=a.copyTo(c);else{if(!n.visible||!n.measurable)return;n.updateLocalTransform();const x=n.localTransform;c=Ya.get(),c.appendFrom(x,a)}const h=t,m=!!n.effects.length;if(m&&(t=or.get().clear()),n.boundsArea)t.addRect(n.boundsArea,c);else{n.renderPipeId&&(t.matrix=c,t.addBounds(n.bounds));const x=n.children;for(let _=0;_<x.length;_++)Cb(x[_],t,c,l,!1)}if(m){for(let x=0;x<n.effects.length;x++)(y=(p=n.effects[x]).addLocalBounds)==null||y.call(p,t,l);h.addBounds(t,le.IDENTITY),or.return(t)}Ya.return(c)}function Ab(n,t){const a=n.children;for(let l=0;l<a.length;l++){const o=a[l],c=o.uid,h=(o._didViewChangeTick&65535)<<16|o._didContainerChangeTick&65535,m=t.index;(t.data[m]!==c||t.data[m+1]!==h)&&(t.data[t.index]=c,t.data[t.index+1]=h,t.didChange=!0),t.index=m+2,o.children.length&&Ab(o,t)}return t.didChange}const J3=new le,P3={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(n,t){const a=Math.sign(this.scale.x)||1;t!==0?this.scale.x=n/t*a:this.scale.x=a},_setHeight(n,t){const a=Math.sign(this.scale.y)||1;t!==0?this.scale.y=n/t*a:this.scale.y=a},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new tl});const n=this._localBoundsCacheData;return n.index=1,n.didChange=!1,n.data[0]!==this._didViewChangeTick&&(n.didChange=!0,n.data[0]=this._didViewChangeTick),Ab(this,n),n.didChange&&Eb(this,n.localBounds,J3),n.localBounds},getBounds(n,t){return Sb(this,n,t||new tl)}},I3={_onRender:null,set onRender(n){const t=this.renderGroup||this.parentRenderGroup;if(!n){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=n},get onRender(){return this._onRender}},$3={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(n){this._zIndex!==n&&(this._zIndex=n,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(tE))}};function tE(n,t){return n._zIndex-t._zIndex}const eE={getGlobalPosition(n=new ya,t=!1){return this.parent?this.parent.toGlobal(this._position,n,t):(n.x=this._position.x,n.y=this._position.y),n},toGlobal(n,t,a=!1){const l=this.getGlobalTransform(Ya.get(),a);return t=l.apply(n,t),Ya.return(l),t},toLocal(n,t,a,l){t&&(n=t.toGlobal(n,a,l));const o=this.getGlobalTransform(Ya.get(),l);return a=o.applyInverse(n,a),Ya.return(o),a}};class hg{constructor(){this.uid=on("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(t){this.instructions[this.instructionSize++]=t}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let nE=0;class aE{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new lf(this.textureOptions)}createTexture(t,a,l,o){const c=new el({...this.textureOptions,width:t,height:a,resolution:1,antialias:l,autoGarbageCollect:!1,autoGenerateMipmaps:o});return new ze({source:c,label:`texturePool_${nE++}`})}getOptimalTexture(t,a,l=1,o,c=!1){let h=Math.ceil(t*l-1e-6),m=Math.ceil(a*l-1e-6);h=af(h),m=af(m);const p=o?1:0,y=c?1:0,x=(h<<17)+(m<<2)+(y<<1)+p;this._texturePool[x]||(this._texturePool[x]=[]);let _=this._texturePool[x].pop();return _||(_=this.createTexture(h,m,o,c)),_.source._resolution=l,_.source.width=h/l,_.source.height=m/l,_.source.pixelWidth=h,_.source.pixelHeight=m,_.frame.x=0,_.frame.y=0,_.frame.width=t,_.frame.height=a,_.updateUvs(),this._poolKeyHash[_.uid]=x,_}getSameSizeTexture(t,a=!1){const l=t.source;return this.getOptimalTexture(t.width,t.height,l._resolution,a)}returnTexture(t,a=!1){const l=this._poolKeyHash[t.uid];a&&(t.source.style=this.textureStyle),this._texturePool[l].push(t)}clear(t){if(t=t!==!1,t)for(const a in this._texturePool){const l=this._texturePool[a];if(l)for(let o=0;o<l.length;o++)l[o].destroy(!0)}this._texturePool={}}}const kp=new aE;Sd.register(kp);class iE{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new le,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 hg,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(t){this.root=t,t._onRender&&this.addOnRender(t),t.didChange=!0;const a=t.children;for(let l=0;l<a.length;l++){const o=a[l];o._updateFlags=15,this.addChild(o)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(kp.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0;const t=this._parentCacheAsTextureRenderGroup;t&&!t.textureNeedsUpdate&&t.updateCacheTexture()}reset(){this.renderGroupChildren.length=0;for(const t in this.childrenToUpdate){const a=this.childrenToUpdate[t];a.list.fill(null),a.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(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const a=this.renderGroupChildren.indexOf(t);a>-1&&this.renderGroupChildren.splice(a,1),t.renderGroupParent=null}addChild(t){if(this.structureDidChange=!0,t.parentRenderGroup=this,t.updateTick=-1,t.parent===this.root?t.relativeRenderGroupDepth=1:t.relativeRenderGroupDepth=t.parent.relativeRenderGroupDepth+1,t.didChange=!0,this.onChildUpdate(t),t.renderGroup){this.addRenderGroupChild(t.renderGroup);return}t._onRender&&this.addOnRender(t);const a=t.children;for(let l=0;l<a.length;l++)this.addChild(a[l])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const a=t.children;for(let l=0;l<a.length;l++)this.removeChild(a[l])}removeChildren(t){for(let a=0;a<t.length;a++)this.removeChild(t[a])}onChildUpdate(t){let a=this.childrenToUpdate[t.relativeRenderGroupDepth];a||(a=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),a.list[a.index++]=t}updateRenderable(t){t.globalDisplayStatus<7||(this.instructionSet.renderPipes[t.renderPipeId].updateRenderable(t),t.didViewUpdate=!1)}onChildViewUpdate(t){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=t}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(t){this._onRenderContainers.push(t)}removeOnRender(t){this._onRenderContainers.splice(this._onRenderContainers.indexOf(t),1)}runOnRender(t){for(let a=0;a<this._onRenderContainers.length;a++)this._onRenderContainers[a]._onRender(t)}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(t=[]){const a=this.root.children;for(let l=0;l<a.length;l++)this._getChildren(a[l],t);return t}_getChildren(t,a=[]){if(a.push(t),t.renderGroup)return a;const l=t.children;for(let o=0;o<l.length;o++)this._getChildren(l[o],a);return a}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new le),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new le),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 t=this._parentCacheAsTextureRenderGroup;return t?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new le),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(t.inverseWorldTransform).translate(-t._textureBounds.x,-t._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this.isCachedAsTexture?this.textureOffsetInverseTransform:this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function lE(n,t,a={}){for(const l in t)!a[l]&&t[l]!==void 0&&(n[l]=t[l])}const Iy=new In(null),cp=new In(null),$y=new In(null,1,1),fp=new In(null),g1=1,sE=2,t0=4;class $n extends _s{constructor(t={}){var a,l;super(),this.uid=on("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 le,this.relativeGroupTransform=new le,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new In(this,0,0),this._scale=$y,this._pivot=cp,this._origin=fp,this._skew=Iy,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=[],lE(this,t,{children:!0,parent:!0,effects:!0}),(a=t.children)==null||a.forEach(o=>this.addChild(o)),(l=t.parent)==null||l.addChild(this)}static mixin(t){de("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Ie.mixin($n,t)}set _didChangeId(t){this._didViewChangeTick=t>>12&4095,this._didContainerChangeTick=t&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...t){if(this.allowChildren||de(un,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let o=0;o<t.length;o++)this.addChild(t[o]);return t[0]}const a=t[0],l=this.renderGroup||this.parentRenderGroup;return a.parent===this?(this.children.splice(this.children.indexOf(a),1),this.children.push(a),l&&(l.structureDidChange=!0),a):(a.parent&&a.parent.removeChild(a),this.children.push(a),this.sortableChildren&&(this.sortDirty=!0),a.parent=this,a.didChange=!0,a._updateFlags=15,l&&l.addChild(a),this.emit("childAdded",a,this,this.children.length-1),a.emit("added",this),this._didViewChangeTick++,a._zIndex!==0&&a.depthOfChildModified(),a)}removeChild(...t){if(t.length>1){for(let o=0;o<t.length;o++)this.removeChild(t[o]);return t[0]}const a=t[0],l=this.children.indexOf(a);return l>-1&&(this._didViewChangeTick++,this.children.splice(l,1),this.renderGroup?this.renderGroup.removeChild(a):this.parentRenderGroup&&this.parentRenderGroup.removeChild(a),a.parentRenderLayer&&a.parentRenderLayer.detach(a),a.parent=null,this.emit("childRemoved",a,this,l),a.emit("removed",this)),a}_onUpdate(t){t&&t===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(t){!!this.renderGroup!==t&&(t?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),this.renderGroup=ii.get(iE,this),this.groupTransform=le.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),ii.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,t==null||t.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new le),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(t){this._position.x=t}get y(){return this._position.y}set y(t){this._position.y=t}get position(){return this._position}set position(t){this._position.copyFrom(t)}get rotation(){return this._rotation}set rotation(t){this._rotation!==t&&(this._rotation=t,this._onUpdate(this._skew))}get angle(){return this.rotation*b3}set angle(t){this.rotation=t*S3}get pivot(){return this._pivot===cp&&(this._pivot=new In(this,0,0)),this._pivot}set pivot(t){this._pivot===cp&&(this._pivot=new In(this,0,0),this._origin!==fp&&qa("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._pivot.set(t):this._pivot.copyFrom(t)}get skew(){return this._skew===Iy&&(this._skew=new In(this,0,0)),this._skew}set skew(t){this._skew===Iy&&(this._skew=new In(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===$y&&(this._scale=new In(this,1,1)),this._scale}set scale(t){this._scale===$y&&(this._scale=new In(this,0,0)),typeof t=="string"&&(t=parseFloat(t)),typeof t=="number"?this._scale.set(t):this._scale.copyFrom(t)}get origin(){return this._origin===fp&&(this._origin=new In(this,0,0)),this._origin}set origin(t){this._origin===fp&&(this._origin=new In(this,0,0),this._pivot!==cp&&qa("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof t=="number"?this._origin.set(t):this._origin.copyFrom(t)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(t){const a=this.getLocalBounds().width;this._setWidth(t,a)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const a=this.getLocalBounds().height;this._setHeight(t,a)}getSize(t){t||(t={});const a=this.getLocalBounds();return t.width=Math.abs(this.scale.x*a.width),t.height=Math.abs(this.scale.y*a.height),t}setSize(t,a){const l=this.getLocalBounds();typeof t=="object"?(a=t.height??t.width,t=t.width):a??(a=t),t!==void 0&&this._setWidth(t,l.width),a!==void 0&&this._setHeight(a,l.height)}_updateSkew(){const t=this._rotation,a=this._skew;this._cx=Math.cos(t+a._y),this._sx=Math.sin(t+a._y),this._cy=-Math.sin(t-a._x),this._sy=Math.cos(t-a._x)}updateTransform(t){return this.position.set(typeof t.x=="number"?t.x:this.position.x,typeof t.y=="number"?t.y:this.position.y),this.scale.set(typeof t.scaleX=="number"?t.scaleX||1:this.scale.x,typeof t.scaleY=="number"?t.scaleY||1:this.scale.y),this.rotation=typeof t.rotation=="number"?t.rotation:this.rotation,this.skew.set(typeof t.skewX=="number"?t.skewX:this.skew.x,typeof t.skewY=="number"?t.skewY:this.skew.y),this.pivot.set(typeof t.pivotX=="number"?t.pivotX:this.pivot.x,typeof t.pivotY=="number"?t.pivotY:this.pivot.y),this.origin.set(typeof t.originX=="number"?t.originX:this.origin.x,typeof t.originY=="number"?t.originY:this.origin.y),this}setFromMatrix(t){t.decompose(this)}updateLocalTransform(){const t=this._didContainerChangeTick;if(this._didLocalTransformChangeId===t)return;this._didLocalTransformChangeId=t;const a=this.localTransform,l=this._scale,o=this._pivot,c=this._origin,h=this._position,m=l._x,p=l._y,y=o._x,x=o._y,_=-c._x,T=-c._y;a.a=this._cx*m,a.b=this._sx*m,a.c=this._cy*p,a.d=this._sy*p,a.tx=h._x-(y*a.a+x*a.c)+(_*a.a+T*a.c)-_,a.ty=h._y-(y*a.b+x*a.d)+(_*a.b+T*a.d)-T}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=g1,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const l=zn.shared.setValue(t??16777215).toBgrNumber();l!==this.localColor&&(this.localColor=l,this._updateFlags|=g1,this._onUpdate())}get tint(){return Mp(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=sE,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const a=t?2:0;(this.localDisplayStatus&2)!==a&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=t0,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const a=t?0:4;(this.localDisplayStatus&4)!==a&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=t0,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const a=t?1:0;(this.localDisplayStatus&1)!==a&&(this._updateFlags|=t0,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var o;if(this.destroyed)return;this.destroyed=!0;let a;if(this.children.length&&(a=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 t=="boolean"?t:t==null?void 0:t.children)&&a)for(let c=0;c<a.length;++c)a[c].destroy(t);(o=this.renderGroup)==null||o.destroy(),this.renderGroup=null}}Ie.mixin($n,X3,F3,eE,I3,P3,Q3,K3,$3,H3,q3,W3,V3);class dg extends $n{constructor(t){super(t),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 tl(0,1,0,0),this._boundsDirty=!0,this.autoGarbageCollect=t.autoGarbageCollect??!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(t){this._roundPixels=t?1:0}containsPoint(t){const a=this.bounds,{x:l,y:o}=t;return l>=a.minX&&l<=a.maxX&&o>=a.minY&&o<=a.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const t=this.renderGroup||this.parentRenderGroup;t&&t.onChildViewUpdate(this)}unload(){var t;this.emit("unload",this);for(const a in this._gpuData)(t=this._gpuData[a])==null||t.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,a,l){const{renderPipes:o}=a;o.blendMode.pushBlendMode(this,this.groupBlendMode,t);const h=o[this.renderPipeId];h!=null&&h.addRenderable&&h.addRenderable(this,t),this.didViewUpdate=!1;const m=this.children,p=m.length;for(let y=0;y<p;y++)m[y].collectRenderables(t,a,l);o.blendMode.popBlendMode(t)}}class rf extends dg{constructor(t=ze.EMPTY){t instanceof ze&&(t={texture:t});const{texture:a=ze.EMPTY,anchor:l,roundPixels:o,width:c,height:h,...m}=t;super({label:"Sprite",...m}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new In({_onUpdate:()=>{this.onViewUpdate()}}),l?this.anchor=l:a.defaultAnchor&&(this.anchor=a.defaultAnchor),this.texture=a,this.allowChildren=!1,this.roundPixels=o??!1,c!==void 0&&(this.width=c),h!==void 0&&(this.height=h)}static from(t,a=!1){return t instanceof ze?new rf(t):new rf(ze.from(t,a))}set texture(t){t||(t=ze.EMPTY);const a=this._texture;a!==t&&(a&&a.dynamic&&a.off("update",this.onViewUpdate,this),t.dynamic&&t.on("update",this.onViewUpdate,this),this._texture=t,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 gb(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return de("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,a=this._texture,l=this._bounds,{width:o,height:c}=a.orig;l.minX=-t._x*o,l.maxX=l.minX+o,l.minY=-t._y*c,l.maxY=l.minY+c}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const l=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(l)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(t){this._setWidth(t,this._texture.orig.width),this._width=t}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(t){this._setHeight(t,this._texture.orig.height),this._height=t}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this._texture.orig.width,t.height=Math.abs(this.scale.y)*this._texture.orig.height,t}setSize(t,a){typeof t=="object"?(a=t.height??t.width,t=t.width):a??(a=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),a!==void 0&&this._setHeight(a,this._texture.orig.height)}}const rE=new tl;function Mb(n,t,a){const l=rE;n.measurable=!0,Sb(n,a,l),t.addBoundsMask(l),n.measurable=!1}function Rb(n,t,a){const l=or.get();n.measurable=!0;const o=Ya.get().identity(),c=zb(n,a,o);Eb(n,l,c),n.measurable=!1,t.addBoundsMask(l),Ya.return(o),or.return(l)}function zb(n,t,a){return n?(n!==t&&(zb(n.parent,t,a),n.updateLocalTransform(),a.append(n.localTransform)),a):(qa("Mask bounds, renderable is not inside the root container"),a)}class wb{constructor(t){this.priority=0,this.inverse=!1,this.pipe="alphaMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.renderMaskToTexture=!(t instanceof rf),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(t,a){this.inverse||Mb(this.mask,t,a)}addLocalBounds(t,a){Rb(this.mask,t,a)}containsPoint(t,a){const l=this.mask;return a(l,t)}destroy(){this.reset()}static test(t){return t instanceof rf}}wb.extension=Jt.MaskEffect;class Db{constructor(t){this.priority=0,this.pipe="colorMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t}destroy(){}static test(t){return typeof t=="number"}}Db.extension=Jt.MaskEffect;class Ob{constructor(t){this.priority=0,this.pipe="stencilMask",t!=null&&t.mask&&this.init(t.mask)}init(t){this.mask=t,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask!==null&&(this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null)}addBounds(t,a){Mb(this.mask,t,a)}addLocalBounds(t,a){Rb(this.mask,t,a)}containsPoint(t,a){const l=this.mask;return a(l,t)}destroy(){this.reset()}static test(t){return t instanceof $n}}Ob.extension=Jt.MaskEffect;const uE={createCanvas:(n,t)=>{const a=document.createElement("canvas");return a.width=n,a.height=t,a},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,t)=>fetch(n,t),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")};let v1=uE;const Ti={get(){return v1},set(n){v1=n}};class Nb extends el{constructor(t){t.resource||(t.resource=Ti.get().createCanvas()),t.width||(t.width=t.resource.width,t.autoDensity||(t.width/=t.resolution)),t.height||(t.height=t.resource.height,t.autoDensity||(t.height/=t.resolution)),super(t),this.uploadMethodId="image",this.autoDensity=t.autoDensity,this.resizeCanvas(),this.transparent=!!t.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(t=this.width,a=this.height,l=this._resolution){const o=super.resize(t,a,l);return o&&this.resizeCanvas(),o}static test(t){return globalThis.HTMLCanvasElement&&t instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&t instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Nb.extension=Jt.TextureSource;class Dp extends el{constructor(t){super(t),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(t){return globalThis.HTMLImageElement&&t instanceof HTMLImageElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||globalThis.VideoFrame&&t instanceof VideoFrame}}Dp.extension=Jt.TextureSource;var Op=(n=>(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(Op||{});class e0{constructor(t,a=null,l=0,o=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=a,this.priority=l,this._once=o}match(t,a=null){return this._fn===t&&this._context===a}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const a=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),a}connect(t){this.previous=t,t.next&&(t.next.previous=this),this.next=t.next,t.next=this}destroy(t=!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 a=this.next;return this.next=t?null:a,this.previous=null,a}}const Bb=class _i{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 e0(null,null,1/0),this.deltaMS=1/_i.targetFPMS,this.elapsedMS=1/_i.targetFPMS,this._tick=t=>{this._requestId=null,this.started&&(this.update(t),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(t,a,l=Op.NORMAL){return this._addListener(new e0(t,a,l))}addOnce(t,a,l=Op.NORMAL){return this._addListener(new e0(t,a,l,!0))}_addListener(t){let a=this._head.next,l=this._head;if(!a)t.connect(l);else{for(;a;){if(t.priority>a.priority){t.connect(l);break}l=a,a=a.next}t.previous||t.connect(l)}return this._startIfPossible(),this}remove(t,a){let l=this._head.next;for(;l;)l.match(t,a)?l=l.destroy():l=l.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,a=this._head;for(;a=a.next;)t++;return t}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let t=this._head.next;for(;t;)t=t.destroy(!0);this._head.destroy(),this._head=null}}update(t=performance.now()){let a;if(t>this.lastTime){if(a=this.elapsedMS=t-this.lastTime,a>this._maxElapsedMS&&(a=this._maxElapsedMS),a*=this.speed,this._minElapsedMS){const c=t-this._lastFrame|0;if(c<this._minElapsedMS)return;this._lastFrame=t-c%this._minElapsedMS}this.deltaMS=a,this.deltaTime=this.deltaMS*_i.targetFPMS;const l=this._head;let o=l.next;for(;o;)o=o.emit(this);l.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=t}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(t){const a=Math.min(Math.max(0,t)/1e3,_i.targetFPMS);this._maxElapsedMS=1/a,this._minElapsedMS&&t>this.maxFPS&&(this.maxFPS=t)}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(t){t===0?this._minElapsedMS=0:(t<this.minFPS&&(this.minFPS=t),this._minElapsedMS=1/(t/1e3))}static get shared(){if(!_i._shared){const t=_i._shared=new _i;t.autoStart=!0,t._protected=!0}return _i._shared}static get system(){if(!_i._system){const t=_i._system=new _i;t.autoStart=!0,t._protected=!0}return _i._system}};Bb.targetFPMS=.06;let Pc=Bb,n0;async function oE(){return n0??(n0=(async()=>{var h;const t=Ti.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const a=await new Promise(m=>{const p=document.createElement("video");p.onloadeddata=()=>m(p),p.onerror=()=>m(null),p.autoplay=!1,p.crossOrigin="anonymous",p.preload="auto",p.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",p.load()});if(!a)return"premultiply-alpha-on-upload";const l=t.createTexture();t.bindTexture(t.TEXTURE_2D,l);const o=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,o),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,l,0),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,t.NONE),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,t.RGBA,t.UNSIGNED_BYTE,a);const c=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,c),t.deleteFramebuffer(o),t.deleteTexture(l),(h=t.getExtension("WEBGL_lose_context"))==null||h.loseContext(),c[0]<=c[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),n0}const Qp=class jb extends el{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...jb.defaultOptions,...t},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=t.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=t.autoPlay!==!1,this.alphaMode=t.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),t.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const t=Pc.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-t)}(!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 t=this.resource,a=this.options;return(t.readyState===t.HAVE_ENOUGH_DATA||t.readyState===t.HAVE_FUTURE_DATA)&&t.width&&t.height&&(t.complete=!0),t.addEventListener("play",this._onPlayStart),t.addEventListener("pause",this._onPlayStop),t.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(a.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await oE(),this._load=new Promise((l,o)=>{this.isValid?l(this):(this._resolve=l,this._reject=o,a.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${a.preloadTimeoutMs}ms`))})),t.load())}),this._load}_onError(t){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",t),this._reject&&(this._reject(t),this._reject=null,this._resolve=null)}_isSourcePlaying(){const t=this.resource;return!t.paused&&!t.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 t=this.resource;this.isValid&&(this.isReady=!0,this.resize(t.videoWidth,t.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 t=this.resource;t&&(t.removeEventListener("play",this._onPlayStart),t.removeEventListener("pause",this._onPlayStop),t.removeEventListener("seeked",this._onSeeked),t.removeEventListener("canplay",this._onCanPlay),t.removeEventListener("canplaythrough",this._onCanPlayThrough),t.removeEventListener("error",this._onError,!0),t.pause(),t.src="",t.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(t){t!==this._autoUpdate&&(this._autoUpdate=t,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(t){t!==this._updateFPS&&(this._updateFPS=t,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Pc.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||(Pc.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Pc.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};Qp.extension=Jt.TextureSource;Qp.defaultOptions={...el.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};Qp.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let cE=Qp;const Fc=(n,t,a=!1)=>(Array.isArray(n)||(n=[n]),t?n.map(l=>typeof l=="string"||a?t(l):l):n);class fE{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(t){return this._cache.has(t)}get(t){const a=this._cache.get(t);return a||qa(`[Assets] Asset id ${t} was not found in the Cache`),a}set(t,a){const l=Fc(t);let o;for(let p=0;p<this.parsers.length;p++){const y=this.parsers[p];if(y.test(a)){o=y.getCacheableAssets(l,a);break}}const c=new Map(Object.entries(o||{}));o||l.forEach(p=>{c.set(p,a)});const h=[...c.keys()],m={cacheKeys:h,keys:l};l.forEach(p=>{this._cacheMap.set(p,m)}),h.forEach(p=>{const y=o?o[p]:a;this._cache.has(p)&&this._cache.get(p)!==y&&qa("[Cache] already has key:",p),this._cache.set(p,c.get(p))})}remove(t){if(!this._cacheMap.has(t)){qa(`[Assets] Asset id ${t} was not found in the Cache`);return}const a=this._cacheMap.get(t);a.cacheKeys.forEach(o=>{this._cache.delete(o)}),a.keys.forEach(o=>{this._cacheMap.delete(o)})}get parsers(){return this._parsers}}const Wc=new fE,G0=[];Ie.handleByList(Jt.TextureSource,G0);function Ub(n={}){const t=n&&n.resource,a=t?n.resource:n,l=t?n:{resource:n};for(let o=0;o<G0.length;o++){const c=G0[o];if(c.test(a))return new c(l)}throw new Error(`Could not find a source type for resource: ${l.resource}`)}function hE(n={},t=!1){const a=n&&n.resource,l=a?n.resource:n,o=a?n:{resource:n};if(!t&&Wc.has(l))return Wc.get(l);const c=new ze({source:Ub(o)});return c.on("destroy",()=>{Wc.has(l)&&Wc.remove(l)}),t||Wc.set(l,c),c}function dE(n,t=!1){return typeof n=="string"?Wc.get(n):n instanceof el?new ze({source:n}):hE(n,t)}ze.from=dE;el.from=Ub;Ie.add(wb,Db,Ob,cE,Dp,Nb,cg);var Hb=(n=>(n[n.Low=0]="Low",n[n.Normal=1]="Normal",n[n.High=2]="High",n))(Hb||{});function Rl(n){if(typeof n!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(n)}`)}function Fh(n){return n.split("?")[0].split("#")[0]}function mE(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function pE(n,t,a){return n.replace(new RegExp(mE(t),"g"),a)}function yE(n,t){let a="",l=0,o=-1,c=0,h=-1;for(let m=0;m<=n.length;++m){if(m<n.length)h=n.charCodeAt(m);else{if(h===47)break;h=47}if(h===47){if(!(o===m-1||c===1))if(o!==m-1&&c===2){if(a.length<2||l!==2||a.charCodeAt(a.length-1)!==46||a.charCodeAt(a.length-2)!==46){if(a.length>2){const p=a.lastIndexOf("/");if(p!==a.length-1){p===-1?(a="",l=0):(a=a.slice(0,p),l=a.length-1-a.lastIndexOf("/")),o=m,c=0;continue}}else if(a.length===2||a.length===1){a="",l=0,o=m,c=0;continue}}}else a.length>0?a+=`/${n.slice(o+1,m)}`:a=n.slice(o+1,m),l=m-o-1;o=m,c=0}else h===46&&c!==-1?++c:c=-1}return a}const dd={toPosix(n){return pE(n,"\\","/")},isUrl(n){return/^https?:/.test(this.toPosix(n))},isDataUrl(n){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(n)},isBlobUrl(n){return n.startsWith("blob:")},hasProtocol(n){return/^[^/:]+:/.test(this.toPosix(n))},getProtocol(n){Rl(n),n=this.toPosix(n);const t=/^file:\/\/\//.exec(n);if(t)return t[0];const a=/^[^/:]+:\/{0,2}/.exec(n);return a?a[0]:""},toAbsolute(n,t,a){if(Rl(n),this.isDataUrl(n)||this.isBlobUrl(n))return n;const l=Fh(this.toPosix(t??Ti.get().getBaseUrl())),o=Fh(this.toPosix(a??this.rootname(l)));return n=this.toPosix(n),n.startsWith("/")?dd.join(o,n.slice(1)):this.isAbsolute(n)?n:this.join(l,n)},normalize(n){if(Rl(n),n.length===0)return".";if(this.isDataUrl(n)||this.isBlobUrl(n))return n;n=this.toPosix(n);let t="";const a=n.startsWith("/");this.hasProtocol(n)&&(t=this.rootname(n),n=n.slice(t.length));const l=n.endsWith("/");return n=yE(n),n.length>0&&l&&(n+="/"),a?`/${n}`:t+n},isAbsolute(n){return Rl(n),n=this.toPosix(n),this.hasProtocol(n)?!0:n.startsWith("/")},join(...n){if(n.length===0)return".";let t;for(let a=0;a<n.length;++a){const l=n[a];if(Rl(l),l.length>0)if(t===void 0)t=l;else{const o=n[a-1]??"";this.joinExtensions.includes(this.extname(o).toLowerCase())?t+=`/../${l}`:t+=`/${l}`}}return t===void 0?".":this.normalize(t)},dirname(n){if(Rl(n),n.length===0)return".";n=this.toPosix(n);let t=n.charCodeAt(0);const a=t===47;let l=-1,o=!0;const c=this.getProtocol(n),h=n;n=n.slice(c.length);for(let m=n.length-1;m>=1;--m)if(t=n.charCodeAt(m),t===47){if(!o){l=m;break}}else o=!1;return l===-1?a?"/":this.isUrl(h)?c+n:c:a&&l===1?"//":c+n.slice(0,l)},rootname(n){Rl(n),n=this.toPosix(n);let t="";if(n.startsWith("/")?t="/":t=this.getProtocol(n),this.isUrl(n)){const a=n.indexOf("/",t.length);a!==-1?t=n.slice(0,a):t=n,t.endsWith("/")||(t+="/")}return t},basename(n,t){Rl(n),t&&Rl(t),n=Fh(this.toPosix(n));let a=0,l=-1,o=!0,c;if(t!==void 0&&t.length>0&&t.length<=n.length){if(t.length===n.length&&t===n)return"";let h=t.length-1,m=-1;for(c=n.length-1;c>=0;--c){const p=n.charCodeAt(c);if(p===47){if(!o){a=c+1;break}}else m===-1&&(o=!1,m=c+1),h>=0&&(p===t.charCodeAt(h)?--h===-1&&(l=c):(h=-1,l=m))}return a===l?l=m:l===-1&&(l=n.length),n.slice(a,l)}for(c=n.length-1;c>=0;--c)if(n.charCodeAt(c)===47){if(!o){a=c+1;break}}else l===-1&&(o=!1,l=c+1);return l===-1?"":n.slice(a,l)},extname(n){Rl(n),n=Fh(this.toPosix(n));let t=-1,a=0,l=-1,o=!0,c=0;for(let h=n.length-1;h>=0;--h){const m=n.charCodeAt(h);if(m===47){if(!o){a=h+1;break}continue}l===-1&&(o=!1,l=h+1),m===46?t===-1?t=h:c!==1&&(c=1):t!==-1&&(c=-1)}return t===-1||l===-1||c===0||c===1&&t===l-1&&t===a+1?"":n.slice(t,l)},parse(n){Rl(n);const t={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return t;n=Fh(this.toPosix(n));let a=n.charCodeAt(0);const l=this.isAbsolute(n);let o;t.root=this.rootname(n),l||this.hasProtocol(n)?o=1:o=0;let c=-1,h=0,m=-1,p=!0,y=n.length-1,x=0;for(;y>=o;--y){if(a=n.charCodeAt(y),a===47){if(!p){h=y+1;break}continue}m===-1&&(p=!1,m=y+1),a===46?c===-1?c=y:x!==1&&(x=1):c!==-1&&(x=-1)}return c===-1||m===-1||x===0||x===1&&c===m-1&&c===h+1?m!==-1&&(h===0&&l?t.base=t.name=n.slice(1,m):t.base=t.name=n.slice(h,m)):(h===0&&l?(t.name=n.slice(1,c),t.base=n.slice(1,m)):(t.name=n.slice(h,c),t.base=n.slice(h,m)),t.ext=n.slice(c,m)),t.dir=this.dirname(n),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function Gb(n,t,a,l,o){const c=t[a];for(let h=0;h<c.length;h++){const m=c[h];a<t.length-1?Gb(n.replace(l[a],m),t,a+1,l,o):o.push(n.replace(l[a],m))}}function gE(n){const t=/\{(.*?)\}/g,a=n.match(t),l=[];if(a){const o=[];a.forEach(c=>{const h=c.substring(1,c.length-1).split(",");o.push(h)}),Gb(n,o,0,a,l)}else l.push(n);return l}const x1=n=>!Array.isArray(n);class Yb{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,a)=>`${t}${this._bundleIdConnector}${a}`,extractAssetIdFromBundle:(t,a)=>a.replace(`${t}${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(t){if(this._bundleIdConnector=t.connector??this._bundleIdConnector,this._createBundleAssetId=t.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=t.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...t){t.forEach(a=>{this._preferredOrder.push(a),a.priority||(a.priority=Object.keys(a.params))}),this._resolverHash={}}set basePath(t){this._basePath=t}get basePath(){return this._basePath}set rootPath(t){this._rootPath=t}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(t){if(typeof t=="string")this._defaultSearchParams=t;else{const a=t;this._defaultSearchParams=Object.keys(a).map(l=>`${encodeURIComponent(l)}=${encodeURIComponent(a[l])}`).join("&")}}getAlias(t){const{alias:a,src:l}=t;return Fc(a||l,c=>typeof c=="string"?c:Array.isArray(c)?c.map(h=>(h==null?void 0:h.src)??h):c!=null&&c.src?c.src:c,!0)}removeAlias(t,a){this._assetMap[t]&&(a&&a!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&qa("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(a=>{this.addBundle(a.name,a.assets)})}addBundle(t,a){const l=[];let o=a;Array.isArray(a)||(o=Object.entries(a).map(([c,h])=>typeof h=="string"||Array.isArray(h)?{alias:c,src:h}:{alias:c,...h})),o.forEach(c=>{const h=c.src,m=c.alias;let p;if(typeof m=="string"){const y=this._createBundleAssetId(t,m);l.push(y),p=[m,y]}else{const y=m.map(x=>this._createBundleAssetId(t,x));l.push(...y),p=[...m,...y]}this.add({...c,alias:p,src:h})}),this._bundles[t]=l}add(t){const a=[];Array.isArray(t)?a.push(...t):a.push(t);let l;l=c=>{this.hasKey(c)&&qa(`[Resolver] already has key: ${c} overwriting`)},Fc(a).forEach(c=>{const{src:h}=c;let{data:m,format:p,loadParser:y,parser:x}=c;const _=Fc(h).map(w=>typeof w=="string"?gE(w):Array.isArray(w)?w:[w]),T=this.getAlias(c);Array.isArray(T)?T.forEach(l):l(T);const C=[],M=w=>{const z=this._parsers.find(D=>D.test(w));return{src:w,...z==null?void 0:z.parse(w)}};_.forEach(w=>{w.forEach(z=>{let D={};if(typeof z!="object"?D=M(z):(m=z.data??m,p=z.format??p,(z.loadParser||z.parser)&&(y=z.loadParser??y,x=z.parser??x),D={...M(z.src),...z}),!T)throw new Error(`[Resolver] alias is undefined for this asset: ${D.src}`);D=this._buildResolvedAsset(D,{aliases:T,data:m,format:p,loadParser:y,parser:x,progressSize:c.progressSize}),C.push(D)})}),T.forEach(w=>{this._assetMap[w]=C})})}resolveBundle(t){const a=x1(t);t=Fc(t);const l={};return t.forEach(o=>{const c=this._bundles[o];if(c){const h=this.resolve(c),m={};for(const p in h){const y=h[p];m[this._extractAssetIdFromBundle(o,p)]=y}l[o]=m}}),a?l[t[0]]:l}resolveUrl(t){const a=this.resolve(t);if(typeof t!="string"){const l={};for(const o in a)l[o]=a[o].src;return l}return a.src}resolve(t){const a=x1(t);t=Fc(t);const l={};return t.forEach(o=>{if(!this._resolverHash[o])if(this._assetMap[o]){let c=this._assetMap[o];const h=this._getPreferredOrder(c);h==null||h.priority.forEach(m=>{h.params[m].forEach(p=>{const y=c.filter(x=>x[m]?x[m]===p:!1);y.length&&(c=y)})}),this._resolverHash[o]=c[0]}else this._resolverHash[o]=this._buildResolvedAsset({alias:[o],src:o},{});l[o]=this._resolverHash[o]}),a?l[t[0]]:l}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let a=0;a<t.length;a++){const l=t[a],o=this._preferredOrder.find(c=>c.params.format.includes(l.format));if(o)return o}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const a=/\?/.test(t)?"&":"?";return`${t}${a}${this._defaultSearchParams}`}_buildResolvedAsset(t,a){const{aliases:l,data:o,loadParser:c,parser:h,format:m,progressSize:p}=a;return(this._basePath||this._rootPath)&&(t.src=dd.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=l??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...o||{},...t.data},t.loadParser=c??t.loadParser,t.parser=h??t.parser,t.format=m??t.format??vE(t.src),p!==void 0&&(t.progressSize=p),t}}Yb.RETINA_PREFIX=/@([0-9\.]+)x/;function vE(n){return n.split(".").pop().split("?").shift().split("#").shift()}const b1=(n,t)=>{const a=t.split("?")[1];return a&&(n+=`?${a}`),n},qb=class id{constructor(t,a){this.linkedSheets=[];let l=t;(t==null?void 0:t.source)instanceof el&&(l={texture:t,data:a});const{texture:o,data:c,cachePrefix:h=""}=l;this.cachePrefix=h,this._texture=o instanceof ze?o:null,this.textureSource=o.source,this.textures={},this.animations={},this.data=c;const m=parseFloat(c.meta.scale);m?(this.resolution=m,o.source.resolution=this.resolution):this.resolution=o.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(t=>{this._callback=t,this._batchIndex=0,this._frameKeys.length<=id.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,a=!1){let l=t;const o=a?1/0:id.BATCH_SIZE;for(;l-t<o&&l<this._frameKeys.length;){const c=this._frameKeys[l],h=this._frames[c],m=h.frame;if(m){let p=null,y=null;const x=h.trimmed!==!1&&h.sourceSize?h.sourceSize:h.frame,_=new mn(0,0,Math.floor(x.w)/this.resolution,Math.floor(x.h)/this.resolution);h.rotated?p=new mn(Math.floor(m.x)/this.resolution,Math.floor(m.y)/this.resolution,Math.floor(m.h)/this.resolution,Math.floor(m.w)/this.resolution):p=new mn(Math.floor(m.x)/this.resolution,Math.floor(m.y)/this.resolution,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution),h.trimmed!==!1&&h.spriteSourceSize&&(y=new mn(Math.floor(h.spriteSourceSize.x)/this.resolution,Math.floor(h.spriteSourceSize.y)/this.resolution,Math.floor(m.w)/this.resolution,Math.floor(m.h)/this.resolution)),this.textures[c]=new ze({source:this.textureSource,frame:p,orig:_,trim:y,rotate:h.rotated?2:0,defaultAnchor:h.anchor,defaultBorders:h.borders,label:c.toString()})}l++}}_processAnimations(){const t=this.data.animations||{};for(const a in t){this.animations[a]=[];for(let l=0;l<t[a].length;l++){const o=t[a][l];this.animations[a].push(this.textures[o])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*id.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*id.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var a;for(const l in this.textures)this.textures[l].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((a=this._texture)==null||a.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};qb.BATCH_SIZE=1e3;let S1=qb;const xE=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Lb(n,t,a){const l={};if(n.forEach(o=>{l[o]=t}),Object.keys(t.textures).forEach(o=>{l[`${t.cachePrefix}${o}`]=t.textures[o]}),!a){const o=dd.dirname(n[0]);t.linkedSheets.forEach((c,h)=>{const m=Lb([`${o}/${t.data.meta.related_multi_packs[h]}`],c,!0);Object.assign(l,m)})}return l}const bE={extension:Jt.Asset,cache:{test:n=>n instanceof S1,getCacheableAssets:(n,t)=>Lb(n,t,!1)},resolver:{extension:{type:Jt.ResolveParser,name:"resolveSpritesheet"},test:n=>{const a=n.split("?")[0].split("."),l=a.pop(),o=a.pop();return l==="json"&&xE.includes(o)},parse:n=>{var a;const t=n.split(".");return{resolution:parseFloat(((a=Yb.RETINA_PREFIX.exec(n))==null?void 0:a[1])??"1"),format:t[t.length-2],src:n}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Jt.LoadParser,priority:Hb.Normal,name:"spritesheetLoader"},async testParse(n,t){return dd.extname(t.src).toLowerCase()===".json"&&!!n.frames},async parse(n,t,a){var _,T;const{texture:l,imageFilename:o,textureOptions:c,cachePrefix:h}=(t==null?void 0:t.data)??{};let m=dd.dirname(t.src);m&&m.lastIndexOf("/")!==m.length-1&&(m+="/");let p;if(l instanceof ze)p=l;else{const C=b1(m+(o??n.meta.image),t.src);p=(await a.load([{src:C,data:c}]))[C]}const y=new S1({texture:p.source,data:n,cachePrefix:h});await y.parse();const x=(_=n==null?void 0:n.meta)==null?void 0:_.related_multi_packs;if(Array.isArray(x)){const C=[];for(const w of x){if(typeof w!="string")continue;let z=m+w;(T=t.data)!=null&&T.ignoreMultiPack||(z=b1(z,t.src),C.push(a.load({src:z,data:{textureOptions:c,ignoreMultiPack:!0}})))}const M=await Promise.all(C);y.linkedSheets=M,M.forEach(w=>{w.linkedSheets=[y].concat(y.linkedSheets.filter(z=>z!==w))})}return y},async unload(n,t,a){await a.unload(n.textureSource._sourceOrigin),n.destroy(!1)}}};Ie.add(bE);const a0=Object.create(null),_1=Object.create(null);function mg(n,t){let a=_1[n];return a===void 0&&(a0[t]===void 0&&(a0[t]=1),_1[n]=a=a0[t]++),a}let Vc;function Xb(){return(!Vc||Vc!=null&&Vc.isContextLost())&&(Vc=Ti.get().createCanvas().getContext("webgl",{})),Vc}let hp;function SE(){if(!hp){hp="mediump";const n=Xb();n&&n.getShaderPrecisionFormat&&(hp=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision?"highp":"mediump")}return hp}function _E(n,t,a){return t?n:a?(n=n.replace("out vec4 finalColor;",""),`
65
-
66
- #ifdef GL_ES // This checks if it is WebGL1
67
- #define in varying
68
- #define finalColor gl_FragColor
69
- #define texture texture2D
70
- #endif
71
- ${n}
72
- `):`
73
-
74
- #ifdef GL_ES // This checks if it is WebGL1
75
- #define in attribute
76
- #define out varying
77
- #endif
78
- ${n}
79
- `}function TE(n,t,a){const l=a?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(n.substring(0,9)!=="precision"){let o=a?t.requestedFragmentPrecision:t.requestedVertexPrecision;return o==="highp"&&l!=="highp"&&(o="mediump"),`precision ${o} float;
80
- ${n}`}else if(l!=="highp"&&n.substring(0,15)==="precision highp")return n.replace("precision highp","precision mediump");return n}function EE(n,t){return t?`#version 300 es
81
- ${n}`:n}const CE={},AE={};function ME(n,{name:t="pixi-program"},a=!0){t=t.replace(/\s+/g,"-"),t+=a?"-fragment":"-vertex";const l=a?CE:AE;return l[t]?(l[t]++,t+=`-${l[t]}`):l[t]=1,n.indexOf("#define SHADER_NAME")!==-1?n:`${`#define SHADER_NAME ${t}`}
82
- ${n}`}function RE(n,t){return t?n.replace("#version 300 es",""):n}const i0={stripVersion:RE,ensurePrecision:TE,addProgramDefines:_E,setProgramName:ME,insertVersion:EE},Wh=Object.create(null),Vb=class Y0{constructor(t){t={...Y0.defaultOptions,...t};const a=t.fragment.indexOf("#version 300 es")!==-1,l={stripVersion:a,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:SE()},setProgramName:{name:t.name},addProgramDefines:a,insertVersion:a};let o=t.fragment,c=t.vertex;Object.keys(i0).forEach(h=>{const m=l[h];o=i0[h](o,m,!0),c=i0[h](c,m,!1)}),this.fragment=o,this.vertex=c,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=mg(`${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,Wh[this._cacheKey]=null}static from(t){const a=`${t.vertex}:${t.fragment}`;return Wh[a]||(Wh[a]=new Y0(t),Wh[a]._cacheKey=a),Wh[a]}};Vb.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let pg=Vb;const T1={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 zE(n){return T1[n]??T1.float32}const wE={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"},E1=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function C1(n,t){let a;for(;(a=E1.exec(n))!==null;){const l=wE[a[3]]??"float32";t[a[2]]={location:parseInt(a[1],10),format:l,stride:zE(l).stride,offset:0,instance:!1,start:0}}E1.lastIndex=0}function DE(n){return n.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function OE({source:n,entryPoint:t}){const a={},l=DE(n),o=l.indexOf(`fn ${t}(`);if(o===-1)return a;const c=l.indexOf("->",o);if(c===-1)return a;const h=l.substring(o,c);if(C1(h,a),Object.keys(a).length===0){const m=h.match(/\(\s*\w+\s*:\s*(\w+)/);if(m){const p=m[1],y=new RegExp(`struct\\s+${p}\\s*\\{([^}]+)\\}`,"s"),x=l.match(y);x&&C1(x[1],a)}}return a}function l0(n){var _,T;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,a=/@group\((\d+)\)/,l=/@binding\((\d+)\)/,o=/var(<[^>]+>)? (\w+)/,c=/:\s*([\w<>]+)/,h=/struct\s+(\w+)\s*{([^}]+)}/g,m=/(\w+)\s*:\s*([\w\<\>]+)/g,p=/struct\s+(\w+)/,y=(_=n.match(t))==null?void 0:_.map(C=>({group:parseInt(C.match(a)[1],10),binding:parseInt(C.match(l)[1],10),name:C.match(o)[2],isUniform:C.match(o)[1]==="<uniform>",type:C.match(c)[1]}));if(!y)return{groups:[],structs:[]};const x=((T=n.match(h))==null?void 0:T.map(C=>{const M=C.match(p)[1],w=C.match(m).reduce((z,D)=>{const[N,j]=D.split(":");return z[N.trim()]=j.trim(),z},{});return w?{name:M,members:w}:null}).filter(({name:C})=>y.some(M=>M.type===C||M.type.includes(`<${C}>`))))??[];return{groups:y,structs:x}}var vo=(n=>(n[n.VERTEX=1]="VERTEX",n[n.FRAGMENT=2]="FRAGMENT",n[n.COMPUTE=4]="COMPUTE",n))(vo||{});function NE({groups:n}){const t=[];for(let a=0;a<n.length;a++){const l=n[a];t[l.group]||(t[l.group]=[]),l.isUniform?t[l.group].push({binding:l.binding,visibility:vo.VERTEX|vo.FRAGMENT,buffer:{type:"uniform"}}):l.type==="sampler"?t[l.group].push({binding:l.binding,visibility:vo.FRAGMENT,sampler:{type:"filtering"}}):l.type==="texture_2d"||l.type.startsWith("texture_2d<")?t[l.group].push({binding:l.binding,visibility:vo.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):l.type==="texture_2d_array"||l.type.startsWith("texture_2d_array<")?t[l.group].push({binding:l.binding,visibility:vo.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(l.type==="texture_cube"||l.type.startsWith("texture_cube<"))&&t[l.group].push({binding:l.binding,visibility:vo.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let a=0;a<t.length;a++)t[a]||(t[a]=[]);return t}function BE({groups:n}){const t=[];for(let a=0;a<n.length;a++){const l=n[a];t[l.group]||(t[l.group]={}),t[l.group][l.name]=l.binding}return t}function jE(n,t){const a=new Set,l=new Set,o=[...n.structs,...t.structs].filter(h=>a.has(h.name)?!1:(a.add(h.name),!0)),c=[...n.groups,...t.groups].filter(h=>{const m=`${h.name}-${h.binding}`;return l.has(m)?!1:(l.add(m),!0)});return{structs:o,groups:c}}const Jh=Object.create(null);class _d{constructor(t){var m,p;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:a,vertex:l,layout:o,gpuLayout:c,name:h}=t;if(this.name=h,this.fragment=a,this.vertex=l,a.source===l.source){const y=l0(a.source);this.structsAndGroups=y}else{const y=l0(l.source),x=l0(a.source);this.structsAndGroups=jE(y,x)}this.layout=o??BE(this.structsAndGroups),this.gpuLayout=c??NE(this.structsAndGroups),this.autoAssignGlobalUniforms=((m=this.layout[0])==null?void 0:m.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((p=this.layout[1])==null?void 0:p.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:a}=this,l=t.source+a.source+t.entryPoint+a.entryPoint;this._layoutKey=mg(l,"program")}get attributeData(){return this._attributeData??(this._attributeData=OE(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Jh[this._cacheKey]=null}static from(t){const a=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Jh[a]||(Jh[a]=new _d(t),Jh[a]._cacheKey=a),Jh[a]}}const kb=["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>"],UE=kb.reduce((n,t)=>(n[t]=!0,n),{});function HE(n,t){switch(n){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*t);case"vec3<f32>":return new Float32Array(3*t);case"vec4<f32>":return new Float32Array(4*t);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 Qb=class Kb{constructor(t,a){this._touched=0,this.uid=on("uniform"),this._resourceType="uniformGroup",this._resourceId=on("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,a={...Kb.defaultOptions,...a},this.uniformStructures=t;const l={};for(const o in t){const c=t[o];if(c.name=o,c.size=c.size??1,!UE[c.type]){const h=c.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(h){const[,m,p]=h;throw new Error(`Uniform type ${c.type} is not supported. Use type: '${m}', size: ${p} instead.`)}throw new Error(`Uniform type ${c.type} is not supported. Supported uniform types are: ${kb.join(", ")}`)}c.value??(c.value=HE(c.type,c.size)),l[o]=c.value}this.uniforms=l,this._dirtyId=1,this.ubo=a.ubo,this.isStatic=a.isStatic,this._signature=mg(Object.keys(l).map(o=>`${o}-${t[o].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};Qb.defaultOptions={ubo:!1,isStatic:!1};let Zb=Qb;class Rp{constructor(t){this.resources=Object.create(null),this._dirty=!0;let a=0;for(const l in t){const o=t[l];this.setResource(o,a++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let a=0;for(const l in this.resources)t[a++]=this.resources[l]._resourceId;this._key=t.join("|")}setResource(t,a){var o,c;const l=this.resources[a];t!==l&&((o=l==null?void 0:l.off)==null||o.call(l,"change",this.onResourceChange,this),(c=t.on)==null||c.call(t,"change",this.onResourceChange,this),this.resources[a]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,a){const l=this.resources;for(const o in l)l[o]._gcLastUsed=t,l[o]._touched=a}destroy(){var a;const t=this.resources;for(const l in t){const o=t[l];(a=o==null?void 0:o.off)==null||a.call(o,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var q0=(n=>(n[n.WEBGL=1]="WEBGL",n[n.WEBGPU=2]="WEBGPU",n[n.CANVAS=4]="CANVAS",n[n.BOTH=3]="BOTH",n))(q0||{});class Kp extends _s{constructor(t){super(),this.uid=on("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:a,glProgram:l,groups:o,resources:c,compatibleRenderers:h,groupMap:m}=t;this.gpuProgram=a,this.glProgram=l,h===void 0&&(h=0,a&&(h|=q0.WEBGPU),l&&(h|=q0.WEBGL)),this.compatibleRenderers=h;const p={};if(!c&&!o&&(c={}),c&&o)throw new Error("[Shader] Cannot have both resources and groups");if(!a&&o&&!m)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!a&&o&&m)for(const y in m)for(const x in m[y]){const _=m[y][x];p[_]={group:y,binding:x,name:_}}else if(a&&o&&!m){const y=a.structsAndGroups.groups;m={},y.forEach(x=>{m[x.group]=m[x.group]||{},m[x.group][x.binding]=x.name,p[x.name]=x})}else if(c){o={},m={},a&&a.structsAndGroups.groups.forEach(_=>{m[_.group]=m[_.group]||{},m[_.group][_.binding]=_.name,p[_.name]=_});let y=0;for(const x in c)p[x]||(o[99]||(o[99]=new Rp,this._ownedBindGroups.push(o[99])),p[x]={group:99,binding:y,name:x},m[99]=m[99]||{},m[99][y]=x,y++);for(const x in c){const _=x;let T=c[x];!T.source&&!T._resourceType&&(T=new Zb(T));const C=p[_];C&&(o[C.group]||(o[C.group]=new Rp,this._ownedBindGroups.push(o[C.group])),o[C.group].setResource(T,C.binding))}}this.groups=o,this._uniformBindMap=m,this.resources=this._buildResourceAccessor(o,p)}addResource(t,a,l){var o,c;(o=this._uniformBindMap)[a]||(o[a]={}),(c=this._uniformBindMap[a])[l]||(c[l]=t),this.groups[a]||(this.groups[a]=new Rp,this._ownedBindGroups.push(this.groups[a]))}_buildResourceAccessor(t,a){const l={};for(const o in a){const c=a[o];Object.defineProperty(l,c.name,{get(){return t[c.group].getResource(c.binding)},set(h){t[c.group].setResource(h,c.binding)}})}return l}destroy(t=!1){var a,l;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((a=this.gpuProgram)==null||a.destroy(),(l=this.glProgram)==null||l.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(o=>{o.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:a,gl:l,...o}=t;let c,h;return a&&(c=_d.from(a)),l&&(h=pg.from(l)),new Kp({gpuProgram:c,glProgram:h,...o})}}const GE={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},s0=0,r0=1,u0=2,o0=3,c0=4,f0=5,L0=class Fb{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<s0)}set blend(t){!!(this.data&1<<s0)!==t&&(this.data^=1<<s0)}get offsets(){return!!(this.data&1<<r0)}set offsets(t){!!(this.data&1<<r0)!==t&&(this.data^=1<<r0)}set cullMode(t){if(t==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=t==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<u0)}set culling(t){!!(this.data&1<<u0)!==t&&(this.data^=1<<u0)}get depthTest(){return!!(this.data&1<<o0)}set depthTest(t){!!(this.data&1<<o0)!==t&&(this.data^=1<<o0)}get depthMask(){return!!(this.data&1<<f0)}set depthMask(t){!!(this.data&1<<f0)!==t&&(this.data^=1<<f0)}get clockwiseFrontFace(){return!!(this.data&1<<c0)}set clockwiseFrontFace(t){!!(this.data&1<<c0)!==t&&(this.data^=1<<c0)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=GE[t]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(t){this.offsets=!!t,this._polygonOffset=t}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const t=new Fb;return t.depthTest=!1,t.blend=!0,t}};L0.default2d=L0.for2d();let yg=L0;const Wb=class X0 extends Kp{constructor(t){t={...X0.defaultOptions,...t},super(t),this.enabled=!0,this._state=yg.for2d(),this.blendMode=t.blendMode,this.padding=t.padding,typeof t.antialias=="boolean"?this.antialias=t.antialias?"on":"off":this.antialias=t.antialias,this.resolution=t.resolution,this.blendRequired=t.blendRequired,this.clipToViewport=t.clipToViewport,this.addResource("uTexture",0,1),t.blendRequired&&this.addResource("uBackTexture",0,3)}apply(t,a,l,o){t.applyFilter(this,a,l,o)}get blendMode(){return this._state.blendMode}set blendMode(t){this._state.blendMode=t}static from(t){const{gpu:a,gl:l,...o}=t;let c,h;return a&&(c=_d.from(a)),l&&(h=pg.from(l)),new X0({gpuProgram:c,glProgram:h,...o})}};Wb.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Co=Wb;const V0=[];Ie.handleByNamedList(Jt.Environment,V0);async function YE(n){if(!n)for(let t=0;t<V0.length;t++){const a=V0[t];if(a.value.test()){await a.value.load();return}}}let Ph;function qE(){if(typeof Ph=="boolean")return Ph;try{Ph=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Ph=!1}return Ph}function A1(n,t,a=2){const l=t&&t.length,o=l?t[0]*a:n.length;let c=Jb(n,0,o,a,!0);const h=[];if(!c||c.next===c.prev)return h;let m,p,y;if(l&&(c=QE(n,t,c,a)),n.length>80*a){m=n[0],p=n[1];let x=m,_=p;for(let T=a;T<o;T+=a){const C=n[T],M=n[T+1];C<m&&(m=C),M<p&&(p=M),C>x&&(x=C),M>_&&(_=M)}y=Math.max(x-m,_-p),y=y!==0?32767/y:0}return md(c,h,a,m,p,y,0),h}function Jb(n,t,a,l,o){let c;if(o===nC(n,t,a,l)>0)for(let h=t;h<a;h+=l)c=M1(h/l|0,n[h],n[h+1],c);else for(let h=a-l;h>=t;h-=l)c=M1(h/l|0,n[h],n[h+1],c);return c&&uf(c,c.next)&&(yd(c),c=c.next),c}function _o(n,t){if(!n)return n;t||(t=n);let a=n,l;do if(l=!1,!a.steiner&&(uf(a,a.next)||Pe(a.prev,a,a.next)===0)){if(yd(a),a=t=a.prev,a===a.next)break;l=!0}else a=a.next;while(l||a!==t);return t}function md(n,t,a,l,o,c,h){if(!n)return;!h&&c&&JE(n,l,o,c);let m=n;for(;n.prev!==n.next;){const p=n.prev,y=n.next;if(c?XE(n,l,o,c):LE(n)){t.push(p.i,n.i,y.i),yd(n),n=y.next,m=y.next;continue}if(n=y,n===m){h?h===1?(n=VE(_o(n),t),md(n,t,a,l,o,c,2)):h===2&&kE(n,t,a,l,o,c):md(_o(n),t,a,l,o,c,1);break}}}function LE(n){const t=n.prev,a=n,l=n.next;if(Pe(t,a,l)>=0)return!1;const o=t.x,c=a.x,h=l.x,m=t.y,p=a.y,y=l.y,x=Math.min(o,c,h),_=Math.min(m,p,y),T=Math.max(o,c,h),C=Math.max(m,p,y);let M=l.next;for(;M!==t;){if(M.x>=x&&M.x<=T&&M.y>=_&&M.y<=C&&ld(o,m,c,p,h,y,M.x,M.y)&&Pe(M.prev,M,M.next)>=0)return!1;M=M.next}return!0}function XE(n,t,a,l){const o=n.prev,c=n,h=n.next;if(Pe(o,c,h)>=0)return!1;const m=o.x,p=c.x,y=h.x,x=o.y,_=c.y,T=h.y,C=Math.min(m,p,y),M=Math.min(x,_,T),w=Math.max(m,p,y),z=Math.max(x,_,T),D=k0(C,M,t,a,l),N=k0(w,z,t,a,l);let j=n.prevZ,G=n.nextZ;for(;j&&j.z>=D&&G&&G.z<=N;){if(j.x>=C&&j.x<=w&&j.y>=M&&j.y<=z&&j!==o&&j!==h&&ld(m,x,p,_,y,T,j.x,j.y)&&Pe(j.prev,j,j.next)>=0||(j=j.prevZ,G.x>=C&&G.x<=w&&G.y>=M&&G.y<=z&&G!==o&&G!==h&&ld(m,x,p,_,y,T,G.x,G.y)&&Pe(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;j&&j.z>=D;){if(j.x>=C&&j.x<=w&&j.y>=M&&j.y<=z&&j!==o&&j!==h&&ld(m,x,p,_,y,T,j.x,j.y)&&Pe(j.prev,j,j.next)>=0)return!1;j=j.prevZ}for(;G&&G.z<=N;){if(G.x>=C&&G.x<=w&&G.y>=M&&G.y<=z&&G!==o&&G!==h&&ld(m,x,p,_,y,T,G.x,G.y)&&Pe(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function VE(n,t){let a=n;do{const l=a.prev,o=a.next.next;!uf(l,o)&&Ib(l,a,a.next,o)&&pd(l,o)&&pd(o,l)&&(t.push(l.i,a.i,o.i),yd(a),yd(a.next),a=n=o),a=a.next}while(a!==n);return _o(a)}function kE(n,t,a,l,o,c){let h=n;do{let m=h.next.next;for(;m!==h.prev;){if(h.i!==m.i&&$E(h,m)){let p=$b(h,m);h=_o(h,h.next),p=_o(p,p.next),md(h,t,a,l,o,c,0),md(p,t,a,l,o,c,0);return}m=m.next}h=h.next}while(h!==n)}function QE(n,t,a,l){const o=[];for(let c=0,h=t.length;c<h;c++){const m=t[c]*l,p=c<h-1?t[c+1]*l:n.length,y=Jb(n,m,p,l,!1);y===y.next&&(y.steiner=!0),o.push(IE(y))}o.sort(KE);for(let c=0;c<o.length;c++)a=ZE(o[c],a);return a}function KE(n,t){let a=n.x-t.x;if(a===0&&(a=n.y-t.y,a===0)){const l=(n.next.y-n.y)/(n.next.x-n.x),o=(t.next.y-t.y)/(t.next.x-t.x);a=l-o}return a}function ZE(n,t){const a=FE(n,t);if(!a)return t;const l=$b(a,n);return _o(l,l.next),_o(a,a.next)}function FE(n,t){let a=t;const l=n.x,o=n.y;let c=-1/0,h;if(uf(n,a))return a;do{if(uf(n,a.next))return a.next;if(o<=a.y&&o>=a.next.y&&a.next.y!==a.y){const _=a.x+(o-a.y)*(a.next.x-a.x)/(a.next.y-a.y);if(_<=l&&_>c&&(c=_,h=a.x<a.next.x?a:a.next,_===l))return h}a=a.next}while(a!==t);if(!h)return null;const m=h,p=h.x,y=h.y;let x=1/0;a=h;do{if(l>=a.x&&a.x>=p&&l!==a.x&&Pb(o<y?l:c,o,p,y,o<y?c:l,o,a.x,a.y)){const _=Math.abs(o-a.y)/(l-a.x);pd(a,n)&&(_<x||_===x&&(a.x>h.x||a.x===h.x&&WE(h,a)))&&(h=a,x=_)}a=a.next}while(a!==m);return h}function WE(n,t){return Pe(n.prev,n,t.prev)<0&&Pe(t.next,n,n.next)<0}function JE(n,t,a,l){let o=n;do o.z===0&&(o.z=k0(o.x,o.y,t,a,l)),o.prevZ=o.prev,o.nextZ=o.next,o=o.next;while(o!==n);o.prevZ.nextZ=null,o.prevZ=null,PE(o)}function PE(n){let t,a=1;do{let l=n,o;n=null;let c=null;for(t=0;l;){t++;let h=l,m=0;for(let y=0;y<a&&(m++,h=h.nextZ,!!h);y++);let p=a;for(;m>0||p>0&&h;)m!==0&&(p===0||!h||l.z<=h.z)?(o=l,l=l.nextZ,m--):(o=h,h=h.nextZ,p--),c?c.nextZ=o:n=o,o.prevZ=c,c=o;l=h}c.nextZ=null,a*=2}while(t>1);return n}function k0(n,t,a,l,o){return n=(n-a)*o|0,t=(t-l)*o|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,n|t<<1}function IE(n){let t=n,a=n;do(t.x<a.x||t.x===a.x&&t.y<a.y)&&(a=t),t=t.next;while(t!==n);return a}function Pb(n,t,a,l,o,c,h,m){return(o-h)*(t-m)>=(n-h)*(c-m)&&(n-h)*(l-m)>=(a-h)*(t-m)&&(a-h)*(c-m)>=(o-h)*(l-m)}function ld(n,t,a,l,o,c,h,m){return!(n===h&&t===m)&&Pb(n,t,a,l,o,c,h,m)}function $E(n,t){return n.next.i!==t.i&&n.prev.i!==t.i&&!tC(n,t)&&(pd(n,t)&&pd(t,n)&&eC(n,t)&&(Pe(n.prev,n,t.prev)||Pe(n,t.prev,t))||uf(n,t)&&Pe(n.prev,n,n.next)>0&&Pe(t.prev,t,t.next)>0)}function Pe(n,t,a){return(t.y-n.y)*(a.x-t.x)-(t.x-n.x)*(a.y-t.y)}function uf(n,t){return n.x===t.x&&n.y===t.y}function Ib(n,t,a,l){const o=mp(Pe(n,t,a)),c=mp(Pe(n,t,l)),h=mp(Pe(a,l,n)),m=mp(Pe(a,l,t));return!!(o!==c&&h!==m||o===0&&dp(n,a,t)||c===0&&dp(n,l,t)||h===0&&dp(a,n,l)||m===0&&dp(a,t,l))}function dp(n,t,a){return t.x<=Math.max(n.x,a.x)&&t.x>=Math.min(n.x,a.x)&&t.y<=Math.max(n.y,a.y)&&t.y>=Math.min(n.y,a.y)}function mp(n){return n>0?1:n<0?-1:0}function tC(n,t){let a=n;do{if(a.i!==n.i&&a.next.i!==n.i&&a.i!==t.i&&a.next.i!==t.i&&Ib(a,a.next,n,t))return!0;a=a.next}while(a!==n);return!1}function pd(n,t){return Pe(n.prev,n,n.next)<0?Pe(n,t,n.next)>=0&&Pe(n,n.prev,t)>=0:Pe(n,t,n.prev)<0||Pe(n,n.next,t)<0}function eC(n,t){let a=n,l=!1;const o=(n.x+t.x)/2,c=(n.y+t.y)/2;do a.y>c!=a.next.y>c&&a.next.y!==a.y&&o<(a.next.x-a.x)*(c-a.y)/(a.next.y-a.y)+a.x&&(l=!l),a=a.next;while(a!==n);return l}function $b(n,t){const a=Q0(n.i,n.x,n.y),l=Q0(t.i,t.x,t.y),o=n.next,c=t.prev;return n.next=t,t.prev=n,a.next=o,o.prev=a,l.next=a,a.prev=l,c.next=l,l.prev=c,l}function M1(n,t,a,l){const o=Q0(n,t,a);return l?(o.next=l.next,o.prev=l,l.next.prev=o,l.next=o):(o.prev=o,o.next=o),o}function yd(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function Q0(n,t,a){return{i:n,x:t,y:a,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function nC(n,t,a,l){let o=0;for(let c=t,h=a-l;c<a;c+=l)o+=(n[h]-n[c])*(n[c+1]+n[h+1]),h=c;return o}const aC=A1.default||A1;var tS=(n=>(n[n.NONE=0]="NONE",n[n.COLOR=16384]="COLOR",n[n.STENCIL=1024]="STENCIL",n[n.DEPTH=256]="DEPTH",n[n.COLOR_DEPTH=16640]="COLOR_DEPTH",n[n.COLOR_STENCIL=17408]="COLOR_STENCIL",n[n.DEPTH_STENCIL=1280]="DEPTH_STENCIL",n[n.ALL=17664]="ALL",n))(tS||{});class iC{constructor(t){this.items=[],this._name=t}emit(t,a,l,o,c,h,m,p){const{name:y,items:x}=this;for(let _=0,T=x.length;_<T;_++)x[_][y](t,a,l,o,c,h,m,p);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const a=this.items.indexOf(t);return a!==-1&&this.items.splice(a,1),this}contains(t){return this.items.indexOf(t)!==-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 lC=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],eS=class nS extends _s{constructor(t){super(),this.tick=0,this.uid=on("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=t.type,this.name=t.name,this.config=t;const a=[...lC,...this.config.runners??[]];this._addRunners(...a),this._unsafeEvalCheck()}async init(t={}){const a=t.skipExtensionImports===!0?!0:t.manageImports===!1;await YE(a),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const l in this._systemsHash)t={...this._systemsHash[l].constructor.defaultOptions,...t};t={...nS.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let l=0;l<this.runners.init.items.length;l++)await this.runners.init.items[l].init(t);this._initOptions=t}render(t,a){this.tick++;let l=t;if(l instanceof $n&&(l={container:l},a&&(de(un,"passing a second argument is deprecated, please use render options instead"),l.target=a.renderTexture)),l.target||(l.target=this.view.renderTarget),l.target===this.view.renderTarget&&(this._lastObjectRendered=l.container,l.clearColor??(l.clearColor=this.background.colorRgba),l.clear??(l.clear=this.background.clearBeforeRender)),l.clearColor){const o=Array.isArray(l.clearColor)&&l.clearColor.length===4;l.clearColor=o?l.clearColor:zn.shared.setValue(l.clearColor).toArray()}l.transform||(l.container.updateLocalTransform(),l.transform=l.container.localTransform),l.container.visible&&(l.container.enableRenderGroup(),this.runners.prerender.emit(l),this.runners.renderStart.emit(l),this.runners.render.emit(l),this.runners.renderEnd.emit(l),this.runners.postrender.emit(l))}resize(t,a,l){const o=this.view.resolution;this.view.resize(t,a,l),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),l!==void 0&&l!==o&&this.runners.resolutionChange.emit(l)}clear(t={}){const a=this;t.target||(t.target=a.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=tS.ALL);const{clear:l,clearColor:o,target:c,mipLevel:h,layer:m}=t;zn.shared.setValue(o??this.background.colorRgba),a.renderTarget.clear(c,l,zn.shared.toArray(),h??0,m??0)}get resolution(){return this.view.resolution}set resolution(t){this.view.resolution=t,this.runners.resolutionChange.emit(t)}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(...t){t.forEach(a=>{this.runners[a]=new iC(a)})}_addSystems(t){let a;for(a in t){const l=t[a];this._addSystem(l.value,l.name)}}_addSystem(t,a){const l=new t(this);if(this[a])throw new Error(`Whoops! The name "${a}" is already in use`);this[a]=l,this._systemsHash[a]=l;for(const o in this.runners)this.runners[o].add(l);return this}_addPipes(t,a){const l=a.reduce((o,c)=>(o[c.name]=c.value,o),{});t.forEach(o=>{const c=o.value,h=o.name,m=l[h];this.renderPipes[h]=new c(this,m?new m:null),this.runners.destroy.add(this.renderPipes[h])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&Sd.release(),Object.values(this.runners).forEach(a=>{a.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!qE())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()}};eS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let aS=eS,pp;function sC(n){return pp!==void 0||(pp=(()=>{var a;const t={stencil:!0,failIfMajorPerformanceCaveat:n??aS.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Ti.get().getWebGLRenderingContext())return!1;let o=Ti.get().createCanvas().getContext("webgl",t);const c=!!((a=o==null?void 0:o.getContextAttributes())!=null&&a.stencil);if(o){const h=o.getExtension("WEBGL_lose_context");h&&h.loseContext()}return o=null,c}catch{return!1}})()),pp}let yp;async function rC(n={}){return yp!==void 0||(yp=await(async()=>{const t=Ti.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(n)).requestDevice(),!0}catch{return!1}})()),yp}const R1=["webgl","webgpu","canvas"];async function uC(n){let t=[];n.preference?(t.push(n.preference),R1.forEach(c=>{c!==n.preference&&t.push(c)})):t=R1.slice();let a,l={};for(let c=0;c<t.length;c++){const h=t[c];if(h==="webgpu"&&await rC()){const{WebGPURenderer:m}=await tf(async()=>{const{WebGPURenderer:p}=await import("./WebGPURenderer-DKvNGGnd.js");return{WebGPURenderer:p}},__vite__mapDeps([2,3,4]));a=m,l={...n,...n.webgpu};break}else if(h==="webgl"&&sC(n.failIfMajorPerformanceCaveat??aS.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:m}=await tf(async()=>{const{WebGLRenderer:p}=await import("./WebGLRenderer-DZqhYwUo.js");return{WebGLRenderer:p}},__vite__mapDeps([5,3,4]));a=m,l={...n,...n.webgl};break}else if(h==="canvas"){const{CanvasRenderer:m}=await tf(async()=>{const{CanvasRenderer:p}=await import("./CanvasRenderer-RC-R9HHB.js");return{CanvasRenderer:p}},__vite__mapDeps([6,4]));a=m,l={...n,...n.canvasOptions};break}}if(delete l.webgpu,delete l.webgl,delete l.canvasOptions,!a)throw new Error("No available renderer for the current environment");const o=new a;return await o.init(l),o}const iS="8.17.0";class lS{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,iS)}static destroy(){}}lS.extension=Jt.Application;class oC{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,iS)}destroy(){this._renderer=null}}oC.extension={type:[Jt.WebGLSystem,Jt.WebGPUSystem],name:"initHook",priority:-10};class sS{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(a){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=a,a&&(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 a,l;if(this._resizeTo===globalThis.window)a=globalThis.innerWidth,l=globalThis.innerHeight;else{const{clientWidth:o,clientHeight:c}=this._resizeTo;a=o,l=c}this.renderer.resize(a,l),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=t.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}sS.extension=Jt.Application;class rS{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(a){this._ticker&&this._ticker.remove(this.render,this),this._ticker=a,a&&a.add(this.render,this,Op.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Pc.shared:new Pc,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}rS.extension=Jt.Application;Ie.add(sS);Ie.add(rS);const uS=class K0{constructor(...t){this.stage=new $n,t[0]!==void 0&&de(un,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new $n),this.renderer=await uC(t),K0._plugins.forEach(a=>{a.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return de(un,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,a=!1){const l=K0._plugins.slice(0);l.reverse(),l.forEach(o=>{o.destroy.call(this)}),this.stage.destroy(a),this.stage=null,this.renderer.destroy(t),this.renderer=null}};uS._plugins=[];let gg=uS;Ie.handleByList(Jt.Application,gg._plugins);Ie.add(lS);var h0,z1;function cC(){if(z1)return h0;z1=1,h0=a;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},t=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function a(c){var h=[];return c.replace(t,function(m,p,y){var x=p.toLowerCase();for(y=o(y),x=="m"&&y.length>2&&(h.push([p].concat(y.splice(0,2))),x="l",p=p=="m"?"l":"L");;){if(y.length==n[x])return y.unshift(p),h.push(y);if(y.length<n[x])throw new Error("malformed path data");h.push([p].concat(y.splice(0,n[x])))}}),h}var l=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function o(c){var h=c.match(l);return h?h.map(Number):[]}return h0}var fC=cC();const hC=Gp(fC);function dC(n,t){const a=hC(n),l=[];let o=null,c=0,h=0;for(let m=0;m<a.length;m++){const p=a[m],y=p[0],x=p;switch(y){case"M":c=x[1],h=x[2],t.moveTo(c,h);break;case"m":c+=x[1],h+=x[2],t.moveTo(c,h);break;case"H":c=x[1],t.lineTo(c,h);break;case"h":c+=x[1],t.lineTo(c,h);break;case"V":h=x[1],t.lineTo(c,h);break;case"v":h+=x[1],t.lineTo(c,h);break;case"L":c=x[1],h=x[2],t.lineTo(c,h);break;case"l":c+=x[1],h+=x[2],t.lineTo(c,h);break;case"C":c=x[5],h=x[6],t.bezierCurveTo(x[1],x[2],x[3],x[4],c,h);break;case"c":t.bezierCurveTo(c+x[1],h+x[2],c+x[3],h+x[4],c+x[5],h+x[6]),c+=x[5],h+=x[6];break;case"S":c=x[3],h=x[4],t.bezierCurveToShort(x[1],x[2],c,h);break;case"s":t.bezierCurveToShort(c+x[1],h+x[2],c+x[3],h+x[4]),c+=x[3],h+=x[4];break;case"Q":c=x[3],h=x[4],t.quadraticCurveTo(x[1],x[2],c,h);break;case"q":t.quadraticCurveTo(c+x[1],h+x[2],c+x[3],h+x[4]),c+=x[3],h+=x[4];break;case"T":c=x[1],h=x[2],t.quadraticCurveToShort(c,h);break;case"t":c+=x[1],h+=x[2],t.quadraticCurveToShort(c,h);break;case"A":c=x[6],h=x[7],t.arcToSvg(x[1],x[2],x[3],x[4],x[5],c,h);break;case"a":c+=x[6],h+=x[7],t.arcToSvg(x[1],x[2],x[3],x[4],x[5],c,h);break;case"Z":case"z":t.closePath(),l.length>0&&(o=l.pop(),o?(c=o.startX,h=o.startY):(c=0,h=0)),o=null;break;default:qa(`Unknown SVG path command: ${y}`)}y!=="Z"&&y!=="z"&&o===null&&(o={startX:c,startY:h},l.push(o))}return t}class vg{constructor(t=0,a=0,l=0){this.type="circle",this.x=t,this.y=a,this.radius=l}clone(){return new vg(this.x,this.y,this.radius)}contains(t,a){if(this.radius<=0)return!1;const l=this.radius*this.radius;let o=this.x-t,c=this.y-a;return o*=o,c*=c,o+c<=l}strokeContains(t,a,l,o=.5){if(this.radius===0)return!1;const c=this.x-t,h=this.y-a,m=this.radius,p=(1-o)*l,y=Math.sqrt(c*c+h*h);return y<=m+p&&y>m-(l-p)}getBounds(t){return t||(t=new mn),t.x=this.x-this.radius,t.y=this.y-this.radius,t.width=this.radius*2,t.height=this.radius*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.radius=t.radius,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class xg{constructor(t=0,a=0,l=0,o=0){this.type="ellipse",this.x=t,this.y=a,this.halfWidth=l,this.halfHeight=o}clone(){return new xg(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,a){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let l=(t-this.x)/this.halfWidth,o=(a-this.y)/this.halfHeight;return l*=l,o*=o,l+o<=1}strokeContains(t,a,l,o=.5){const{halfWidth:c,halfHeight:h}=this;if(c<=0||h<=0)return!1;const m=l*(1-o),p=l-m,y=c-p,x=h-p,_=c+m,T=h+m,C=t-this.x,M=a-this.y,w=C*C/(y*y)+M*M/(x*x),z=C*C/(_*_)+M*M/(T*T);return w>1&&z<=1}getBounds(t){return t||(t=new mn),t.x=this.x-this.halfWidth,t.y=this.y-this.halfHeight,t.width=this.halfWidth*2,t.height=this.halfHeight*2,t}copyFrom(t){return this.x=t.x,this.y=t.y,this.halfWidth=t.halfWidth,this.halfHeight=t.halfHeight,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function mC(n,t,a,l,o,c){const h=n-a,m=t-l,p=o-a,y=c-l,x=h*p+m*y,_=p*p+y*y;let T=-1;_!==0&&(T=x/_);let C,M;T<0?(C=a,M=l):T>1?(C=o,M=c):(C=a+T*p,M=l+T*y);const w=n-C,z=t-M;return w*w+z*z}let pC,yC;class od{constructor(...t){this.type="polygon";let a=Array.isArray(t[0])?t[0]:t;if(typeof a[0]!="number"){const l=[];for(let o=0,c=a.length;o<c;o++)l.push(a[o].x,a[o].y);a=l}this.points=a,this.closePath=!0}isClockwise(){let t=0;const a=this.points,l=a.length;for(let o=0;o<l;o+=2){const c=a[o],h=a[o+1],m=a[(o+2)%l],p=a[(o+3)%l];t+=(m-c)*(p+h)}return t<0}containsPolygon(t){const a=this.getBounds(pC),l=t.getBounds(yC);if(!a.containsRect(l))return!1;const o=t.points;for(let c=0;c<o.length;c+=2){const h=o[c],m=o[c+1];if(!this.contains(h,m))return!1}return!0}clone(){const t=this.points.slice(),a=new od(t);return a.closePath=this.closePath,a}contains(t,a){let l=!1;const o=this.points.length/2;for(let c=0,h=o-1;c<o;h=c++){const m=this.points[c*2],p=this.points[c*2+1],y=this.points[h*2],x=this.points[h*2+1];p>a!=x>a&&t<(y-m)*((a-p)/(x-p))+m&&(l=!l)}return l}strokeContains(t,a,l,o=.5){const c=l*l,h=c*(1-o),m=c-h,{points:p}=this,y=p.length-(this.closePath?0:2);for(let x=0;x<y;x+=2){const _=p[x],T=p[x+1],C=p[(x+2)%p.length],M=p[(x+3)%p.length],w=mC(t,a,_,T,C,M),z=Math.sign((C-_)*(a-T)-(M-T)*(t-_));if(w<=(z<0?m:h))return!0}return!1}getBounds(t){t||(t=new mn);const a=this.points;let l=1/0,o=-1/0,c=1/0,h=-1/0;for(let m=0,p=a.length;m<p;m+=2){const y=a[m],x=a[m+1];l=y<l?y:l,o=y>o?y:o,c=x<c?x:c,h=x>h?x:h}return t.x=l,t.width=o-l,t.y=c,t.height=h-c,t}copyFrom(t){return this.points=t.points.slice(),this.closePath=t.closePath,this}copyTo(t){return t.copyFrom(this),t}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((t,a)=>`${t}, ${a}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return de("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return de("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 gp=(n,t,a,l,o,c,h)=>{const m=n-a,p=t-l,y=Math.sqrt(m*m+p*p);return y>=o-c&&y<=o+h};class bg{constructor(t=0,a=0,l=0,o=0,c=20){this.type="roundedRectangle",this.x=t,this.y=a,this.width=l,this.height=o,this.radius=c}getBounds(t){return t||(t=new mn),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new bg(this.x,this.y,this.width,this.height,this.radius)}copyFrom(t){return this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height,this}copyTo(t){return t.copyFrom(this),t}contains(t,a){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&a>=this.y&&a<=this.y+this.height){const l=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(a>=this.y+l&&a<=this.y+this.height-l||t>=this.x+l&&t<=this.x+this.width-l)return!0;let o=t-(this.x+l),c=a-(this.y+l);const h=l*l;if(o*o+c*c<=h||(o=t-(this.x+this.width-l),o*o+c*c<=h)||(c=a-(this.y+this.height-l),o*o+c*c<=h)||(o=t-(this.x+l),o*o+c*c<=h))return!0}return!1}strokeContains(t,a,l,o=.5){const{x:c,y:h,width:m,height:p,radius:y}=this,x=l*(1-o),_=l-x,T=c+y,C=h+y,M=m-y*2,w=p-y*2,z=c+m,D=h+p;return(t>=c-x&&t<=c+_||t>=z-_&&t<=z+x)&&a>=C&&a<=C+w||(a>=h-x&&a<=h+_||a>=D-_&&a<=D+x)&&t>=T&&t<=T+M?!0:t<T&&a<C&&gp(t,a,T,C,y,_,x)||t>z-y&&a<C&&gp(t,a,z-y,C,y,_,x)||t>z-y&&a>D-y&&gp(t,a,z-y,D-y,y,_,x)||t<T&&a>D-y&&gp(t,a,T,D-y,y,_,x)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const oS={};function gC(n,t,a){let l=2166136261;for(let o=0;o<t;o++)l^=n[o].uid,l=Math.imul(l,16777619),l>>>=0;return oS[l]||vC(n,t,l,a)}function vC(n,t,a,l){const o={};let c=0;for(let m=0;m<l;m++){const p=m<t?n[m]:ze.EMPTY.source;o[c++]=p.source,o[c++]=p.style}const h=new Rp(o);return oS[a]=h,h}class w1{constructor(t){typeof t=="number"?this.rawBinaryData=new ArrayBuffer(t):t instanceof Uint8Array?this.rawBinaryData=t.buffer:this.rawBinaryData=t,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(t){return this[`${t}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(t){switch(t){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${t} isn't a valid view type`)}}}function D1(n,t,a,l){if(a??(a=0),l??(l=Math.min(n.byteLength-a,t.byteLength)),!(a&7)&&!(l&7)){const o=l/8;new Float64Array(t,0,o).set(new Float64Array(n,a,o))}else if(!(a&3)&&!(l&3)){const o=l/4;new Float32Array(t,0,o).set(new Float32Array(n,a,o))}else new Uint8Array(t).set(new Uint8Array(n,a,l))}const xC={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var bC=(n=>(n[n.DISABLED=0]="DISABLED",n[n.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",n[n.MASK_ACTIVE=2]="MASK_ACTIVE",n[n.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",n[n.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",n[n.NONE=5]="NONE",n))(bC||{});function O1(n,t){return t.alphaMode==="no-premultiply-alpha"&&xC[n]||n}const SC=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
83
- `);function _C(n){let t="";for(let a=0;a<n;++a)a>0&&(t+=`
84
- else `),a<n-1&&(t+=`if(test == ${a}.0){}`);return t}function TC(n,t){if(n===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const a=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const l=SC.replace(/%forloop%/gi,_C(n));if(t.shaderSource(a,l),t.compileShader(a),!t.getShaderParameter(a,t.COMPILE_STATUS))n=n/2|0;else break}}finally{t.deleteShader(a)}return n}let kc=null;function EC(){var t;if(kc)return kc;const n=Xb();return kc=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),kc=TC(kc,n),(t=n.getExtension("WEBGL_lose_context"))==null||t.loseContext(),kc}class CC{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const a=this.textures[t];this.textures[t]=null,this.ids[a.uid]=null}this.count=0}}class AC{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new CC,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 cd=[];let Np=0;Sd.register({clear:()=>{if(cd.length>0)for(const n of cd)n&&n.destroy();cd.length=0,Np=0}});function N1(){return Np>0?cd[--Np]:new AC}function B1(n){n.elements=null,cd[Np++]=n}let Ih=0;const cS=class fS{constructor(t){this.uid=on("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...fS.defaultOptions,...t},t.maxTextures||(de("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=EC());const{maxTextures:a,attributesInitialSize:l,indicesInitialSize:o}=t;this.attributeBuffer=new w1(l*4),this.indexBuffer=new Uint16Array(o),this.maxTextures=a}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)B1(this.batches[t]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(t){this._elements[this.elementSize++]=t,t._indexStart=this.indexSize,t._attributeStart=this.attributeSize,t._batcher=this,this.indexSize+=t.indexSize,this.attributeSize+=t.attributeSize*this.vertexSize}checkAndUpdateTexture(t,a){const l=t._batch.textures.ids[a._source.uid];return!l&&l!==0?!1:(t._textureId=l,t.texture=a,!0)}updateElement(t){this.dirty=!0;const a=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,a.float32View,a.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,a.float32View,a.uint32View,t._attributeStart,t._textureId)}break(t){const a=this._elements;if(!a[this.elementStart])return;let l=N1(),o=l.textures;o.clear();const c=a[this.elementStart];let h=O1(c.blendMode,c.texture._source),m=c.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const p=this.attributeBuffer.float32View,y=this.attributeBuffer.uint32View,x=this.indexBuffer;let _=this._batchIndexSize,T=this._batchIndexStart,C="startBatch",M=[];const w=this.maxTextures;for(let z=this.elementStart;z<this.elementSize;++z){const D=a[z];a[z]=null;const j=D.texture._source,G=O1(D.blendMode,j),k=h!==G||m!==D.topology;if(j._batchTick===Ih&&!k){D._textureId=j._textureBindLocation,_+=D.indexSize,D.packAsQuad?(this.packQuadAttributes(D,p,y,D._attributeStart,D._textureId),this.packQuadIndex(x,D._indexStart,D._attributeStart/this.vertexSize)):(this.packAttributes(D,p,y,D._attributeStart,D._textureId),this.packIndex(D,x,D._indexStart,D._attributeStart/this.vertexSize)),D._batch=l,M.push(D);continue}j._batchTick=Ih,(o.count>=w||k)&&(this._finishBatch(l,T,_-T,o,h,m,t,C,M),C="renderBatch",T=_,h=G,m=D.topology,l=N1(),o=l.textures,o.clear(),M=[],++Ih),D._textureId=j._textureBindLocation=o.count,o.ids[j.uid]=o.count,o.textures[o.count++]=j,D._batch=l,M.push(D),_+=D.indexSize,D.packAsQuad?(this.packQuadAttributes(D,p,y,D._attributeStart,D._textureId),this.packQuadIndex(x,D._indexStart,D._attributeStart/this.vertexSize)):(this.packAttributes(D,p,y,D._attributeStart,D._textureId),this.packIndex(D,x,D._indexStart,D._attributeStart/this.vertexSize))}o.count>0&&(this._finishBatch(l,T,_-T,o,h,m,t,C,M),T=_,++Ih),this.elementStart=this.elementSize,this._batchIndexStart=T,this._batchIndexSize=_}_finishBatch(t,a,l,o,c,h,m,p,y){t.gpuBindGroup=null,t.bindGroup=null,t.action=p,t.batcher=this,t.textures=o,t.blendMode=c,t.topology=h,t.start=a,t.size=l,t.elements=y,++Ih,this.batches[this.batchIndex++]=t,m.add(t)}finish(t){this.break(t)}ensureAttributeBuffer(t){t*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(t*4)}ensureIndexBuffer(t){t<=this.indexBuffer.length||this._resizeIndexBuffer(t)}_resizeAttributeBuffer(t){const a=Math.max(t,this.attributeBuffer.size*2),l=new w1(a);D1(this.attributeBuffer.rawBinaryData,l.rawBinaryData),this.attributeBuffer=l}_resizeIndexBuffer(t){const a=this.indexBuffer;let l=Math.max(t,a.length*1.5);l+=l%2;const o=l>65535?new Uint32Array(l):new Uint16Array(l);if(o.BYTES_PER_ELEMENT!==a.BYTES_PER_ELEMENT)for(let c=0;c<a.length;c++)o[c]=a[c];else D1(a.buffer,o.buffer);this.indexBuffer=o}packQuadIndex(t,a,l){t[a]=l+0,t[a+1]=l+1,t[a+2]=l+2,t[a+3]=l+0,t[a+4]=l+2,t[a+5]=l+3}packIndex(t,a,l,o){const c=t.indices,h=t.indexSize,m=t.indexOffset,p=t.attributeOffset;for(let y=0;y<h;y++)a[l++]=o+c[y+m]-p}destroy(t={}){var a;if(this.batches!==null){for(let l=0;l<this.batchIndex;l++)B1(this.batches[l]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((a=this.shader)==null||a.destroy(),this.shader=null);for(let l=0;l<this._elements.length;l++)this._elements[l]&&(this._elements[l]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};cS.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let MC=cS;var ni=(n=>(n[n.MAP_READ=1]="MAP_READ",n[n.MAP_WRITE=2]="MAP_WRITE",n[n.COPY_SRC=4]="COPY_SRC",n[n.COPY_DST=8]="COPY_DST",n[n.INDEX=16]="INDEX",n[n.VERTEX=32]="VERTEX",n[n.UNIFORM=64]="UNIFORM",n[n.STORAGE=128]="STORAGE",n[n.INDIRECT=256]="INDIRECT",n[n.QUERY_RESOLVE=512]="QUERY_RESOLVE",n[n.STATIC=1024]="STATIC",n))(ni||{});class gd extends _s{constructor(t){let{data:a,size:l}=t;const{usage:o,label:c,shrinkToFit:h}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=on("buffer"),this._resourceType="buffer",this._resourceId=on("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,a instanceof Array&&(a=new Float32Array(a)),this._data=a,l??(l=a==null?void 0:a.byteLength);const m=!!a;this.descriptor={size:l,usage:o,mappedAtCreation:m,label:c},this.shrinkToFit=h??!0}get data(){return this._data}set data(t){this.setDataWithSize(t,t.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&ni.STATIC)}set static(t){t?this.descriptor.usage|=ni.STATIC:this.descriptor.usage&=~ni.STATIC}setDataWithSize(t,a,l){if(this._updateID++,this._updateSize=a*t.BYTES_PER_ELEMENT,this._data===t){l&&this.emit("update",this);return}const o=this._data;if(this._data=t,this._dataInt32=null,!o||o.length!==t.length){!this.shrinkToFit&&o&&t.byteLength<o.byteLength?l&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=on("resource"),this.emit("change",this));return}l&&this.emit("update",this)}update(t){this._updateSize=t??this._updateSize,this._updateID++,this.emit("update",this)}unload(){var t;this.emit("unload",this);for(const a in this._gpuData)(t=this._gpuData[a])==null||t.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 hS(n,t){if(!(n instanceof gd)){let a=t?ni.INDEX:ni.VERTEX;n instanceof Array&&(t?(n=new Uint32Array(n),a=ni.INDEX|ni.COPY_DST):(n=new Float32Array(n),a=ni.VERTEX|ni.COPY_DST)),n=new gd({data:n,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:a})}return n}function RC(n,t,a){const l=n.getAttribute(t);if(!l)return a.minX=0,a.minY=0,a.maxX=0,a.maxY=0,a;const o=l.buffer.data;let c=1/0,h=1/0,m=-1/0,p=-1/0;const y=o.BYTES_PER_ELEMENT,x=(l.offset||0)/y,_=(l.stride||8)/y;for(let T=x;T<o.length;T+=_){const C=o[T],M=o[T+1];C>m&&(m=C),M>p&&(p=M),C<c&&(c=C),M<h&&(h=M)}return a.minX=c,a.minY=h,a.maxX=m,a.maxY=p,a}function zC(n){return(n instanceof gd||Array.isArray(n)||n.BYTES_PER_ELEMENT)&&(n={buffer:n}),n.buffer=hS(n.buffer,!1),n}class wC extends _s{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=on("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new tl,this._boundsDirty=!0;const{attributes:a,indexBuffer:l,topology:o}=t;if(this.buffers=[],this.attributes={},a)for(const c in a)this.addAttribute(c,a[c]);this.instanceCount=t.instanceCount??1,l&&this.addIndex(l),this.topology=o||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(t){return this.attributes[t]}getIndex(){return this.indexBuffer}getBuffer(t){return this.getAttribute(t).buffer}getSize(){for(const t in this.attributes){const a=this.attributes[t];return a.buffer.data.length/(a.stride/4||a.size)}return 0}addAttribute(t,a){const l=zC(a);this.buffers.indexOf(l.buffer)===-1&&(this.buffers.push(l.buffer),l.buffer.on("update",this.onBufferUpdate,this),l.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=l}addIndex(t){this.indexBuffer=hS(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,RC(this,"aPosition",this._bounds)):this._bounds}unload(){var t;this.emit("unload",this);for(const a in this._gpuData)(t=this._gpuData[a])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){var a;this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(l=>l.destroy()),this.unload(),(a=this.indexBuffer)==null||a.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const DC=new Float32Array(1),OC=new Uint32Array(1);class NC extends wC{constructor(){const a=new gd({data:DC,label:"attribute-batch-buffer",usage:ni.VERTEX|ni.COPY_DST,shrinkToFit:!1}),l=new gd({data:OC,label:"index-batch-buffer",usage:ni.INDEX|ni.COPY_DST,shrinkToFit:!1}),o=24;super({attributes:{aPosition:{buffer:a,format:"float32x2",stride:o,offset:0},aUV:{buffer:a,format:"float32x2",stride:o,offset:8},aColor:{buffer:a,format:"unorm8x4",stride:o,offset:16},aTextureIdAndRound:{buffer:a,format:"uint16x2",stride:o,offset:20}},indexBuffer:l})}}function j1(n,t,a){if(n)for(const l in n){const o=l.toLocaleLowerCase(),c=t[o];if(c){let h=n[l];l==="header"&&(h=h.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),a&&c.push(`//----${a}----//`),c.push(h)}else qa(`${l} placement hook does not exist in shader`)}}const BC=/\{\{(.*?)\}\}/g;function U1(n){var l;const t={};return(((l=n.match(BC))==null?void 0:l.map(o=>o.replace(/[{()}]/g,"")))??[]).forEach(o=>{t[o]=[]}),t}function H1(n,t){let a;const l=/@in\s+([^;]+);/g;for(;(a=l.exec(n))!==null;)t.push(a[1])}function G1(n,t,a=!1){const l=[];H1(t,l),n.forEach(m=>{m.header&&H1(m.header,l)});const o=l;a&&o.sort();const c=o.map((m,p)=>` @location(${p}) ${m},`).join(`
85
- `);let h=t.replace(/@in\s+[^;]+;\s*/g,"");return h=h.replace("{{in}}",`
86
- ${c}
87
- `),h}function Y1(n,t){let a;const l=/@out\s+([^;]+);/g;for(;(a=l.exec(n))!==null;)t.push(a[1])}function jC(n){const a=/\b(\w+)\s*:/g.exec(n);return a?a[1]:""}function UC(n){const t=/@.*?\s+/g;return n.replace(t,"")}function HC(n,t){const a=[];Y1(t,a),n.forEach(p=>{p.header&&Y1(p.header,a)});let l=0;const o=a.sort().map(p=>p.indexOf("builtin")>-1?p:`@location(${l++}) ${p}`).join(`,
88
- `),c=a.sort().map(p=>` var ${UC(p)};`).join(`
89
- `),h=`return VSOutput(
90
- ${a.sort().map(p=>` ${jC(p)}`).join(`,
91
- `)});`;let m=t.replace(/@out\s+[^;]+;\s*/g,"");return m=m.replace("{{struct}}",`
92
- ${o}
93
- `),m=m.replace("{{start}}",`
94
- ${c}
95
- `),m=m.replace("{{return}}",`
96
- ${h}
97
- `),m}function q1(n,t){let a=n;for(const l in t){const o=t[l];o.join(`
98
- `).length?a=a.replace(`{{${l}}}`,`//-----${l} START-----//
99
- ${o.join(`
100
- `)}
101
- //----${l} FINISH----//`):a=a.replace(`{{${l}}}`,"")}return a}const ru=Object.create(null),d0=new Map;let GC=0;function YC({template:n,bits:t}){const a=dS(n,t);if(ru[a])return ru[a];const{vertex:l,fragment:o}=LC(n,t);return ru[a]=mS(l,o,t),ru[a]}function qC({template:n,bits:t}){const a=dS(n,t);return ru[a]||(ru[a]=mS(n.vertex,n.fragment,t)),ru[a]}function LC(n,t){const a=t.map(h=>h.vertex).filter(h=>!!h),l=t.map(h=>h.fragment).filter(h=>!!h);let o=G1(a,n.vertex,!0);o=HC(a,o);const c=G1(l,n.fragment,!0);return{vertex:o,fragment:c}}function dS(n,t){return t.map(a=>(d0.has(a)||d0.set(a,GC++),d0.get(a))).sort((a,l)=>a-l).join("-")+n.vertex+n.fragment}function mS(n,t,a){const l=U1(n),o=U1(t);return a.forEach(c=>{j1(c.vertex,l,c.name),j1(c.fragment,o,c.name)}),{vertex:q1(n,l),fragment:q1(t,o)}}const XC=`
102
- @in aPosition: vec2<f32>;
103
- @in aUV: vec2<f32>;
104
-
105
- @out @builtin(position) vPosition: vec4<f32>;
106
- @out vUV : vec2<f32>;
107
- @out vColor : vec4<f32>;
108
-
109
- {{header}}
110
-
111
- struct VSOutput {
112
- {{struct}}
113
- };
114
-
115
- @vertex
116
- fn main( {{in}} ) -> VSOutput {
117
-
118
- var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
119
- var modelMatrix = mat3x3<f32>(
120
- 1.0, 0.0, 0.0,
121
- 0.0, 1.0, 0.0,
122
- 0.0, 0.0, 1.0
123
- );
124
- var position = aPosition;
125
- var uv = aUV;
126
-
127
- {{start}}
128
-
129
- vColor = vec4<f32>(1., 1., 1., 1.);
130
-
131
- {{main}}
132
-
133
- vUV = uv;
134
-
135
- var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
136
-
137
- vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
138
-
139
- vColor *= globalUniforms.uWorldColorAlpha;
140
-
141
- {{end}}
142
-
143
- {{return}}
144
- };
145
- `,VC=`
146
- @in vUV : vec2<f32>;
147
- @in vColor : vec4<f32>;
148
-
149
- {{header}}
150
-
151
- @fragment
152
- fn main(
153
- {{in}}
154
- ) -> @location(0) vec4<f32> {
155
-
156
- {{start}}
157
-
158
- var outColor:vec4<f32>;
159
-
160
- {{main}}
161
-
162
- var finalColor:vec4<f32> = outColor * vColor;
163
-
164
- {{end}}
165
-
166
- return finalColor;
167
- };
168
- `,kC=`
169
- in vec2 aPosition;
170
- in vec2 aUV;
171
-
172
- out vec4 vColor;
173
- out vec2 vUV;
174
-
175
- {{header}}
176
-
177
- void main(void){
178
-
179
- mat3 worldTransformMatrix = uWorldTransformMatrix;
180
- mat3 modelMatrix = mat3(
181
- 1.0, 0.0, 0.0,
182
- 0.0, 1.0, 0.0,
183
- 0.0, 0.0, 1.0
184
- );
185
- vec2 position = aPosition;
186
- vec2 uv = aUV;
187
-
188
- {{start}}
189
-
190
- vColor = vec4(1.);
191
-
192
- {{main}}
193
-
194
- vUV = uv;
195
-
196
- mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
197
-
198
- gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
199
-
200
- vColor *= uWorldColorAlpha;
201
-
202
- {{end}}
203
- }
204
- `,QC=`
205
-
206
- in vec4 vColor;
207
- in vec2 vUV;
208
-
209
- out vec4 finalColor;
210
-
211
- {{header}}
212
-
213
- void main(void) {
214
-
215
- {{start}}
216
-
217
- vec4 outColor;
218
-
219
- {{main}}
220
-
221
- finalColor = outColor * vColor;
222
-
223
- {{end}}
224
- }
225
- `,KC={name:"global-uniforms-bit",vertex:{header:`
226
- struct GlobalUniforms {
227
- uProjectionMatrix:mat3x3<f32>,
228
- uWorldTransformMatrix:mat3x3<f32>,
229
- uWorldColorAlpha: vec4<f32>,
230
- uResolution: vec2<f32>,
231
- }
232
-
233
- @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
234
- `}},ZC={name:"global-uniforms-bit",vertex:{header:`
235
- uniform mat3 uProjectionMatrix;
236
- uniform mat3 uWorldTransformMatrix;
237
- uniform vec4 uWorldColorAlpha;
238
- uniform vec2 uResolution;
239
- `}};function FC({bits:n,name:t}){const a=YC({template:{fragment:VC,vertex:XC},bits:[KC,...n]});return _d.from({name:t,vertex:{source:a.vertex,entryPoint:"main"},fragment:{source:a.fragment,entryPoint:"main"}})}function WC({bits:n,name:t}){return new pg({name:t,...qC({template:{vertex:kC,fragment:QC},bits:[ZC,...n]})})}const JC={name:"color-bit",vertex:{header:`
240
- @in aColor: vec4<f32>;
241
- `,main:`
242
- vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
243
- `}},PC={name:"color-bit",vertex:{header:`
244
- in vec4 aColor;
245
- `,main:`
246
- vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
247
- `}},m0={};function IC(n){const t=[];if(n===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let a=0;for(let l=0;l<n;l++)t.push(`@group(1) @binding(${a++}) var textureSource${l+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${a++}) var textureSampler${l+1}: sampler;`)}return t.join(`
248
- `)}function $C(n){const t=[];if(n===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let a=0;a<n;a++)a===n-1?t.push(" default:{"):t.push(` case ${a}:{`),t.push(` outColor = textureSampleGrad(textureSource${a+1}, textureSampler${a+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
249
- `)}function t4(n){return m0[n]||(m0[n]={name:"texture-batch-bit",vertex:{header:`
250
- @in aTextureIdAndRound: vec2<u32>;
251
- @out @interpolate(flat) vTextureId : u32;
252
- `,main:`
253
- vTextureId = aTextureIdAndRound.y;
254
- `,end:`
255
- if(aTextureIdAndRound.x == 1)
256
- {
257
- vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
258
- }
259
- `},fragment:{header:`
260
- @in @interpolate(flat) vTextureId: u32;
261
-
262
- ${IC(n)}
263
- `,main:`
264
- var uvDx = dpdx(vUV);
265
- var uvDy = dpdy(vUV);
266
-
267
- ${$C(n)}
268
- `}}),m0[n]}const p0={};function e4(n){const t=[];for(let a=0;a<n;a++)a>0&&t.push("else"),a<n-1&&t.push(`if(vTextureId < ${a}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${a}], vUV);`),t.push("}");return t.join(`
269
- `)}function n4(n){return p0[n]||(p0[n]={name:"texture-batch-bit",vertex:{header:`
270
- in vec2 aTextureIdAndRound;
271
- out float vTextureId;
272
-
273
- `,main:`
274
- vTextureId = aTextureIdAndRound.y;
275
- `,end:`
276
- if(aTextureIdAndRound.x == 1.)
277
- {
278
- gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
279
- }
280
- `},fragment:{header:`
281
- in float vTextureId;
282
-
283
- uniform sampler2D uTextures[${n}];
284
-
285
- `,main:`
286
-
287
- ${e4(n)}
288
- `}}),p0[n]}const a4={name:"round-pixels-bit",vertex:{header:`
289
- fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
290
- {
291
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
292
- }
293
- `}},i4={name:"round-pixels-bit",vertex:{header:`
294
- vec2 roundPixels(vec2 position, vec2 targetSize)
295
- {
296
- return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
297
- }
298
- `}},L1={};function l4(n){let t=L1[n];if(t)return t;const a=new Int32Array(n);for(let l=0;l<n;l++)a[l]=l;return t=L1[n]=new Zb({uTextures:{value:a,type:"i32",size:n}},{isStatic:!0}),t}class X1 extends Kp{constructor(t){const a=WC({name:"batch",bits:[PC,n4(t),i4]}),l=FC({name:"batch",bits:[JC,t4(t),a4]});super({glProgram:a,gpuProgram:l,resources:{batchSamplers:l4(t)}}),this.maxTextures=t}}let $h=null;const pS=class yS extends MC{constructor(t){super(t),this.geometry=new NC,this.name=yS.extension.name,this.vertexSize=6,$h??($h=new X1(t.maxTextures)),this.shader=$h}packAttributes(t,a,l,o,c){const h=c<<16|t.roundPixels&65535,m=t.transform,p=m.a,y=m.b,x=m.c,_=m.d,T=m.tx,C=m.ty,{positions:M,uvs:w}=t,z=t.color,D=t.attributeOffset,N=D+t.attributeSize;for(let j=D;j<N;j++){const G=j*2,k=M[G],q=M[G+1];a[o++]=p*k+x*q+T,a[o++]=_*q+y*k+C,a[o++]=w[G],a[o++]=w[G+1],l[o++]=z,l[o++]=h}}packQuadAttributes(t,a,l,o,c){const h=t.texture,m=t.transform,p=m.a,y=m.b,x=m.c,_=m.d,T=m.tx,C=m.ty,M=t.bounds,w=M.maxX,z=M.minX,D=M.maxY,N=M.minY,j=h.uvs,G=t.color,k=c<<16|t.roundPixels&65535;a[o+0]=p*z+x*N+T,a[o+1]=_*N+y*z+C,a[o+2]=j.x0,a[o+3]=j.y0,l[o+4]=G,l[o+5]=k,a[o+6]=p*w+x*N+T,a[o+7]=_*N+y*w+C,a[o+8]=j.x1,a[o+9]=j.y1,l[o+10]=G,l[o+11]=k,a[o+12]=p*w+x*D+T,a[o+13]=_*D+y*w+C,a[o+14]=j.x2,a[o+15]=j.y2,l[o+16]=G,l[o+17]=k,a[o+18]=p*z+x*D+T,a[o+19]=_*D+y*z+C,a[o+20]=j.x3,a[o+21]=j.y3,l[o+22]=G,l[o+23]=k}_updateMaxTextures(t){this.shader.maxTextures!==t&&($h=new X1(t),this.shader=$h)}destroy(){this.shader=null,super.destroy()}};pS.extension={type:[Jt.Batcher],name:"default"};let s4=pS;class Td{constructor(t){this.items=Object.create(null);const{renderer:a,type:l,onUnload:o,priority:c,name:h}=t;this._renderer=a,a.gc.addResourceHash(this,"items",l,c??0),this._onUnload=o,this.name=h}add(t){return this.items[t.uid]?!1:(this.items[t.uid]=t,t.once("unload",this.remove,this),t._gcLastUsed=this._renderer.gc.now,!0)}remove(t,...a){var o;if(!this.items[t.uid])return;const l=t._gpuData[this._renderer.uid];l&&((o=this._onUnload)==null||o.call(this,t,...a),l.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(a=>a&&this.remove(a,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function r4(n,t,a,l,o,c,h,m=null){let p=0;a*=t,o*=c;const y=m.a,x=m.b,_=m.c,T=m.d,C=m.tx,M=m.ty;for(;p<h;){const w=n[a],z=n[a+1];l[o]=y*w+_*z+C,l[o+1]=x*w+T*z+M,o+=c,a+=t,p++}}function u4(n,t,a,l){let o=0;for(t*=a;o<l;)n[t]=0,n[t+1]=0,t+=a,o++}function gS(n,t,a,l,o){const c=t.a,h=t.b,m=t.c,p=t.d,y=t.tx,x=t.ty;a||(a=0),l||(l=2),o||(o=n.length/l-a);let _=a*l;for(let T=0;T<o;T++){const C=n[_],M=n[_+1];n[_]=c*C+m*M+y,n[_+1]=h*C+p*M+x,_+=l}}const o4=new le;class Sg{constructor(){this.packAsQuad=!1,this.batcherName="default",this.topology="triangle-list",this.applyTransform=!0,this.roundPixels=0,this._batcher=null,this._batch=null}get uvs(){return this.geometryData.uvs}get positions(){return this.geometryData.vertices}get indices(){return this.geometryData.indices}get blendMode(){return this.renderable&&this.applyTransform?this.renderable.groupBlendMode:"normal"}get color(){const t=this.baseColor,a=t>>16|t&65280|(t&255)<<16,l=this.renderable;return l?Tb(a,l.groupColor)+(this.alpha*l.groupAlpha*255<<24):a+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||o4}copyTo(t){t.indexOffset=this.indexOffset,t.indexSize=this.indexSize,t.attributeOffset=this.attributeOffset,t.attributeSize=this.attributeSize,t.baseColor=this.baseColor,t.alpha=this.alpha,t.texture=this.texture,t.geometryData=this.geometryData,t.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}destroy(){this.renderable=null,this.texture=null,this.geometryData=null,this._batcher=null,this._batch=null}}const vd={extension:{type:Jt.ShapeBuilder,name:"circle"},build(n,t){let a,l,o,c,h,m;if(n.type==="circle"){const G=n;if(h=m=G.radius,h<=0)return!1;a=G.x,l=G.y,o=c=0}else if(n.type==="ellipse"){const G=n;if(h=G.halfWidth,m=G.halfHeight,h<=0||m<=0)return!1;a=G.x,l=G.y,o=c=0}else{const G=n,k=G.width/2,q=G.height/2;a=G.x+k,l=G.y+q,h=m=Math.max(0,Math.min(G.radius,Math.min(k,q))),o=k-h,c=q-m}if(o<0||c<0)return!1;const p=Math.ceil(2.3*Math.sqrt(h+m)),y=p*8+(o?4:0)+(c?4:0);if(y===0)return!1;if(p===0)return t[0]=t[6]=a+o,t[1]=t[3]=l+c,t[2]=t[4]=a-o,t[5]=t[7]=l-c,!0;let x=0,_=p*4+(o?2:0)+2,T=_,C=y,M=o+h,w=c,z=a+M,D=a-M,N=l+w;if(t[x++]=z,t[x++]=N,t[--_]=N,t[--_]=D,c){const G=l-w;t[T++]=D,t[T++]=G,t[--C]=G,t[--C]=z}for(let G=1;G<p;G++){const k=Math.PI/2*(G/p),q=o+Math.cos(k)*h,Z=c+Math.sin(k)*m,W=a+q,L=a-q,$=l+Z,et=l-Z;t[x++]=W,t[x++]=$,t[--_]=$,t[--_]=L,t[T++]=L,t[T++]=et,t[--C]=et,t[--C]=W}M=o,w=c+m,z=a+M,D=a-M,N=l+w;const j=l-w;return t[x++]=z,t[x++]=N,t[--C]=j,t[--C]=z,o&&(t[x++]=D,t[x++]=N,t[--C]=j,t[--C]=D),!0},triangulate(n,t,a,l,o,c){if(n.length===0)return;let h=0,m=0;for(let x=0;x<n.length;x+=2)h+=n[x],m+=n[x+1];h/=n.length/2,m/=n.length/2;let p=l;t[p*a]=h,t[p*a+1]=m;const y=p++;for(let x=0;x<n.length;x+=2)t[p*a]=n[x],t[p*a+1]=n[x+1],x>0&&(o[c++]=p,o[c++]=y,o[c++]=p-1),p++;o[c++]=y+1,o[c++]=y,o[c++]=p-1}},c4={...vd,extension:{...vd.extension,name:"ellipse"}},f4={...vd,extension:{...vd.extension,name:"roundedRectangle"}},vS=1e-4,V1=1e-4;function h4(n){const t=n.length;if(t<6)return 1;let a=0;for(let l=0,o=n[t-2],c=n[t-1];l<t;l+=2){const h=n[l],m=n[l+1];a+=(h-o)*(m+c),o=h,c=m}return a<0?-1:1}function k1(n,t,a,l,o,c,h,m){const p=n-a*o,y=t-l*o,x=n+a*c,_=t+l*c;let T,C;h?(T=l,C=-a):(T=-l,C=a);const M=p+T,w=y+C,z=x+T,D=_+C;return m.push(M,w),m.push(z,D),2}function fo(n,t,a,l,o,c,h,m){const p=a-n,y=l-t;let x=Math.atan2(p,y),_=Math.atan2(o-n,c-t);m&&x<_?x+=Math.PI*2:!m&&x>_&&(_+=Math.PI*2);let T=x;const C=_-x,M=Math.abs(C),w=Math.sqrt(p*p+y*y),z=(15*M*Math.sqrt(w)/Math.PI>>0)+1,D=C/z;if(T+=D,m){h.push(n,t),h.push(a,l);for(let N=1,j=T;N<z;N++,j+=D)h.push(n,t),h.push(n+Math.sin(j)*w,t+Math.cos(j)*w);h.push(n,t),h.push(o,c)}else{h.push(a,l),h.push(n,t);for(let N=1,j=T;N<z;N++,j+=D)h.push(n+Math.sin(j)*w,t+Math.cos(j)*w),h.push(n,t);h.push(o,c),h.push(n,t)}return z*2}function d4(n,t,a,l,o,c){const h=vS;if(n.length===0)return;const m=t;let p=m.alignment;if(t.alignment!==.5){let rt=h4(n);p=(p-.5)*rt+.5}const y=new ya(n[0],n[1]),x=new ya(n[n.length-2],n[n.length-1]),_=l,T=Math.abs(y.x-x.x)<h&&Math.abs(y.y-x.y)<h;if(_){n=n.slice(),T&&(n.pop(),n.pop(),x.set(n[n.length-2],n[n.length-1]));const rt=(y.x+x.x)*.5,gt=(x.y+y.y)*.5;n.unshift(rt,gt),n.push(rt,gt)}const C=o,M=n.length/2;let w=n.length;const z=C.length/2,D=m.width/2,N=D*D,j=m.miterLimit*m.miterLimit;let G=n[0],k=n[1],q=n[2],Z=n[3],W=0,L=0,$=-(k-Z),et=G-q,ct=0,vt=0,dt=Math.sqrt($*$+et*et);$/=dt,et/=dt,$*=D,et*=D;const St=p,H=(1-St)*2,Q=St*2;_||(m.cap==="round"?w+=fo(G-$*(H-Q)*.5,k-et*(H-Q)*.5,G-$*H,k-et*H,G+$*Q,k+et*Q,C,!0)+2:m.cap==="square"&&(w+=k1(G,k,$,et,H,Q,!0,C))),C.push(G-$*H,k-et*H),C.push(G+$*Q,k+et*Q);for(let rt=1;rt<M-1;++rt){G=n[(rt-1)*2],k=n[(rt-1)*2+1],q=n[rt*2],Z=n[rt*2+1],W=n[(rt+1)*2],L=n[(rt+1)*2+1],$=-(k-Z),et=G-q,dt=Math.sqrt($*$+et*et),$/=dt,et/=dt,$*=D,et*=D,ct=-(Z-L),vt=q-W,dt=Math.sqrt(ct*ct+vt*vt),ct/=dt,vt/=dt,ct*=D,vt*=D;const gt=q-G,U=k-Z,F=q-W,tt=L-Z,pt=gt*F+U*tt,_t=U*F-tt*gt,At=_t<0;if(Math.abs(_t)<.001*Math.abs(pt)){C.push(q-$*H,Z-et*H),C.push(q+$*Q,Z+et*Q),pt>=0&&(m.join==="round"?w+=fo(q,Z,q-$*H,Z-et*H,q-ct*H,Z-vt*H,C,!1)+4:w+=2,C.push(q-ct*Q,Z-vt*Q),C.push(q+ct*H,Z+vt*H));continue}const Ot=(-$+G)*(-et+Z)-(-$+q)*(-et+k),fe=(-ct+W)*(-vt+Z)-(-ct+q)*(-vt+L),ce=(gt*fe-F*Ot)/_t,ga=(tt*Ot-U*fe)/_t,La=(ce-q)*(ce-q)+(ga-Z)*(ga-Z),Xn=q+(ce-q)*H,ta=Z+(ga-Z)*H,pn=q-(ce-q)*Q,ea=Z-(ga-Z)*Q,Ts=Math.min(gt*gt+U*U,F*F+tt*tt),li=At?H:Q,ou=Ts+li*li*N;La<=ou?m.join==="bevel"||La/N>j?(At?(C.push(Xn,ta),C.push(q+$*Q,Z+et*Q),C.push(Xn,ta),C.push(q+ct*Q,Z+vt*Q)):(C.push(q-$*H,Z-et*H),C.push(pn,ea),C.push(q-ct*H,Z-vt*H),C.push(pn,ea)),w+=2):m.join==="round"?At?(C.push(Xn,ta),C.push(q+$*Q,Z+et*Q),w+=fo(q,Z,q+$*Q,Z+et*Q,q+ct*Q,Z+vt*Q,C,!0)+4,C.push(Xn,ta),C.push(q+ct*Q,Z+vt*Q)):(C.push(q-$*H,Z-et*H),C.push(pn,ea),w+=fo(q,Z,q-$*H,Z-et*H,q-ct*H,Z-vt*H,C,!1)+4,C.push(q-ct*H,Z-vt*H),C.push(pn,ea)):(C.push(Xn,ta),C.push(pn,ea)):(C.push(q-$*H,Z-et*H),C.push(q+$*Q,Z+et*Q),m.join==="round"?At?w+=fo(q,Z,q+$*Q,Z+et*Q,q+ct*Q,Z+vt*Q,C,!0)+2:w+=fo(q,Z,q-$*H,Z-et*H,q-ct*H,Z-vt*H,C,!1)+2:m.join==="miter"&&La/N<=j&&(At?(C.push(pn,ea),C.push(pn,ea)):(C.push(Xn,ta),C.push(Xn,ta)),w+=2),C.push(q-ct*H,Z-vt*H),C.push(q+ct*Q,Z+vt*Q),w+=2)}G=n[(M-2)*2],k=n[(M-2)*2+1],q=n[(M-1)*2],Z=n[(M-1)*2+1],$=-(k-Z),et=G-q,dt=Math.sqrt($*$+et*et),$/=dt,et/=dt,$*=D,et*=D,C.push(q-$*H,Z-et*H),C.push(q+$*Q,Z+et*Q),_||(m.cap==="round"?w+=fo(q-$*(H-Q)*.5,Z-et*(H-Q)*.5,q-$*H,Z-et*H,q+$*Q,Z+et*Q,C,!1)+2:m.cap==="square"&&(w+=k1(q,Z,$,et,H,Q,!1,C)));const ot=V1*V1;for(let rt=z;rt<w+z-2;++rt)G=C[rt*2],k=C[rt*2+1],q=C[(rt+1)*2],Z=C[(rt+1)*2+1],W=C[(rt+2)*2],L=C[(rt+2)*2+1],!(Math.abs(G*(Z-L)+q*(L-k)+W*(k-Z))<ot)&&c.push(rt,rt+1,rt+2)}function m4(n,t,a,l){const o=vS;if(n.length===0)return;const c=n[0],h=n[1],m=n[n.length-2],p=n[n.length-1],y=t||Math.abs(c-m)<o&&Math.abs(h-p)<o,x=a,_=n.length/2,T=x.length/2;for(let C=0;C<_;C++)x.push(n[C*2]),x.push(n[C*2+1]);for(let C=0;C<_-1;C++)l.push(T+C,T+C+1);y&&l.push(T+_-1,T)}function xS(n,t,a,l,o,c,h){const m=aC(n,t,2);if(!m)return;for(let y=0;y<m.length;y+=3)c[h++]=m[y]+o,c[h++]=m[y+1]+o,c[h++]=m[y+2]+o;let p=o*l;for(let y=0;y<n.length;y+=2)a[p]=n[y],a[p+1]=n[y+1],p+=l}const p4=[],y4={extension:{type:Jt.ShapeBuilder,name:"polygon"},build(n,t){for(let a=0;a<n.points.length;a++)t[a]=n.points[a];return!0},triangulate(n,t,a,l,o,c){xS(n,p4,t,a,l,o,c)}},g4={extension:{type:Jt.ShapeBuilder,name:"rectangle"},build(n,t){const a=n,l=a.x,o=a.y,c=a.width,h=a.height;return c>0&&h>0?(t[0]=l,t[1]=o,t[2]=l+c,t[3]=o,t[4]=l+c,t[5]=o+h,t[6]=l,t[7]=o+h,!0):!1},triangulate(n,t,a,l,o,c){let h=0;l*=a,t[l+h]=n[0],t[l+h+1]=n[1],h+=a,t[l+h]=n[2],t[l+h+1]=n[3],h+=a,t[l+h]=n[6],t[l+h+1]=n[7],h+=a,t[l+h]=n[4],t[l+h+1]=n[5],h+=a;const m=l/a;o[c++]=m,o[c++]=m+1,o[c++]=m+2,o[c++]=m+1,o[c++]=m+3,o[c++]=m+2}},v4={extension:{type:Jt.ShapeBuilder,name:"triangle"},build(n,t){return t[0]=n.x,t[1]=n.y,t[2]=n.x2,t[3]=n.y2,t[4]=n.x3,t[5]=n.y3,!0},triangulate(n,t,a,l,o,c){let h=0;l*=a,t[l+h]=n[0],t[l+h+1]=n[1],h+=a,t[l+h]=n[2],t[l+h+1]=n[3],h+=a,t[l+h]=n[4],t[l+h+1]=n[5];const m=l/a;o[c++]=m,o[c++]=m+1,o[c++]=m+2}},Q1=[{offset:0,color:"white"},{offset:1,color:"black"}],_g=class Z0{constructor(...t){this.uid=on("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let a=x4(t);a={...a.type==="radial"?Z0.defaultRadialOptions:Z0.defaultLinearOptions,...hb(a)},this._textureSize=a.textureSize,this._wrapMode=a.wrapMode,a.type==="radial"?(this.center=a.center,this.outerCenter=a.outerCenter??this.center,this.innerRadius=a.innerRadius,this.outerRadius=a.outerRadius,this.scale=a.scale,this.rotation=a.rotation):(this.start=a.start,this.end=a.end),this.textureSpace=a.textureSpace,this.type=a.type,a.colorStops.forEach(o=>{this.addColorStop(o.offset,o.color)})}addColorStop(t,a){return this.colorStops.push({offset:t,color:zn.shared.setValue(a).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:a}=this.start,{x:l,y:o}=this.end,c=l-t,h=o-a;const m=c<0||h<0;if(this._wrapMode==="clamp-to-edge"){if(c<0){const z=t;t=l,l=z,c*=-1}if(h<0){const z=a;a=o,o=z,h*=-1}}const p=this.colorStops.length?this.colorStops:Q1,y=this._textureSize,{canvas:x,context:_}=Z1(y,1),T=m?_.createLinearGradient(this._textureSize,0,0,0):_.createLinearGradient(0,0,this._textureSize,0);K1(T,p),_.fillStyle=T,_.fillRect(0,0,y,1),this.texture=new ze({source:new Dp({resource:x,addressMode:this._wrapMode})});const C=Math.sqrt(c*c+h*h),M=Math.atan2(h,c),w=new le;w.scale(C/y,1),w.rotate(M),w.translate(t,a),this.textureSpace==="local"&&w.scale(y,y),this.transform=w}buildGradient(){this.texture||this._tick++,this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const t=this.colorStops.length?this.colorStops:Q1,a=this._textureSize,{canvas:l,context:o}=Z1(a,a),{x:c,y:h}=this.center,{x:m,y:p}=this.outerCenter,y=this.innerRadius,x=this.outerRadius,_=m-x,T=p-x,C=a/(x*2),M=(c-_)*C,w=(h-T)*C,z=o.createRadialGradient(M,w,y*C,(m-_)*C,(p-T)*C,x*C);K1(z,t),o.fillStyle=t[t.length-1].color,o.fillRect(0,0,a,a),o.fillStyle=z,o.translate(M,w),o.rotate(this.rotation),o.scale(1,this.scale),o.translate(-M,-w),o.fillRect(0,0,a,a),this.texture=new ze({source:new Dp({resource:l,addressMode:this._wrapMode})});const D=new le;D.scale(1/C,1/C),D.translate(_,T),this.textureSpace==="local"&&D.scale(a,a),this.transform=D}destroy(){var t;(t=this.texture)==null||t.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}get styleKey(){return`fill-gradient-${this.uid}-${this._tick}`}};_g.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};_g.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let hr=_g;function K1(n,t){for(let a=0;a<t.length;a++){const l=t[a];n.addColorStop(l.offset,l.color)}}function Z1(n,t){const a=Ti.get().createCanvas(n,t),l=a.getContext("2d");return{canvas:a,context:l}}function x4(n){let t=n[0]??{};return(typeof t=="number"||n[1])&&(de("8.5.2","use options object instead"),t={type:"linear",start:{x:n[0],y:n[1]},end:{x:n[2],y:n[3]},textureSpace:n[4],textureSize:n[5]??hr.defaultLinearOptions.textureSize}),t}const b4=new le,S4=new mn;function _4(n,t,a,l){const o=t.matrix?n.copyFrom(t.matrix).invert():n.identity();if(t.textureSpace==="local"){const h=a.getBounds(S4);t.width&&h.pad(t.width);const{x:m,y:p}=h,y=1/h.width,x=1/h.height,_=-m*y,T=-p*x,C=o.a,M=o.b,w=o.c,z=o.d;o.a*=y,o.b*=y,o.c*=x,o.d*=x,o.tx=_*C+T*w+o.tx,o.ty=_*M+T*z+o.ty}else o.translate(t.texture.frame.x,t.texture.frame.y),o.scale(1/t.texture.source.width,1/t.texture.source.height);const c=t.texture.source.style;return!(t.fill instanceof hr)&&c.addressMode==="clamp-to-edge"&&(c.addressMode="repeat",c.update()),l&&o.append(b4.copyFrom(l).invert()),o}const Zp={};Ie.handleByMap(Jt.ShapeBuilder,Zp);Ie.add(g4,y4,v4,vd,c4,f4);const T4=new mn,E4=new le;function C4(n,t){const{geometryData:a,batches:l}=t;l.length=0,a.indices.length=0,a.vertices.length=0,a.uvs.length=0;for(let o=0;o<n.instructions.length;o++){const c=n.instructions[o];if(c.action==="texture")A4(c.data,l,a);else if(c.action==="fill"||c.action==="stroke"){const h=c.action==="stroke",m=c.data.path.shapePath,p=c.data.style,y=c.data.hole;h&&y&&F1(y.shapePath,p,!0,l,a),y&&(m.shapePrimitives[m.shapePrimitives.length-1].holes=y.shapePath.shapePrimitives),F1(m,p,h,l,a)}}}function A4(n,t,a){const l=[],o=Zp.rectangle,c=T4;c.x=n.dx,c.y=n.dy,c.width=n.dw,c.height=n.dh;const h=n.transform;if(!o.build(c,l))return;const{vertices:m,uvs:p,indices:y}=a,x=y.length,_=m.length/2;h&&gS(l,h),o.triangulate(l,m,2,_,y,x);const T=n.image,C=T.uvs;p.push(C.x0,C.y0,C.x1,C.y1,C.x3,C.y3,C.x2,C.y2);const M=ii.get(Sg);M.indexOffset=x,M.indexSize=y.length-x,M.attributeOffset=_,M.attributeSize=m.length/2-_,M.baseColor=n.style,M.alpha=n.alpha,M.texture=T,M.geometryData=a,t.push(M)}function F1(n,t,a,l,o){const{vertices:c,uvs:h,indices:m}=o;n.shapePrimitives.forEach(({shape:p,transform:y,holes:x})=>{const _=[],T=Zp[p.type];if(!T.build(p,_))return;const C=m.length,M=c.length/2;let w="triangle-list";if(y&&gS(_,y),a){const j=p.closePath??!0,G=t;G.pixelLine?(m4(_,j,c,m),w="line-list"):d4(_,G,!1,j,c,m)}else if(x){const j=[],G=_.slice();M4(x).forEach(q=>{j.push(G.length/2),G.push(...q)}),xS(G,j,c,2,M,m,C)}else T.triangulate(_,c,2,M,m,C);const z=h.length/2,D=t.texture;if(D!==ze.WHITE){const j=_4(E4,t,p,y);r4(c,2,M,h,z,2,c.length/2-M,j)}else u4(h,z,2,c.length/2-M);const N=ii.get(Sg);N.indexOffset=C,N.indexSize=m.length-C,N.attributeOffset=M,N.attributeSize=c.length/2-M,N.baseColor=t.color,N.alpha=t.alpha,N.texture=D,N.geometryData=o,N.topology=w,l.push(N)})}function M4(n){const t=[];for(let a=0;a<n.length;a++){const l=n[a].shape,o=[];Zp[l.type].build(l,o)&&t.push(o)}return t}class R4{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{ii.return(t)}),this.graphicsData&&ii.return(this.graphicsData),this.isBatchable=!1,this.context=null,this.batches.length=0,this.geometryData.indices.length=0,this.geometryData.vertices.length=0,this.geometryData.uvs.length=0,this.graphicsData=null}destroy(){this.reset(),this.batches=null,this.geometryData=null}}class z4{constructor(){this.instructions=new hg}init(t){const a=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(a):this.batcher=new s4({maxTextures:a}),this.instructions.reset()}get geometry(){return de(C3,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}destroy(){this.batcher.destroy(),this.instructions.destroy(),this.batcher=null,this.instructions=null}}const Tg=class F0{constructor(t){this._renderer=t,this._managedContexts=new Td({renderer:t,type:"resource",name:"graphicsContext"})}init(t){F0.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??F0.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const a=!!t._gpuData[this._renderer.uid],l=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!a){a&&l.reset(),C4(t,l);const o=t.batchMode;t.customShader||o==="no-batch"?l.isBatchable=!1:o==="auto"?l.isBatchable=l.geometryData.vertices.length<400:l.isBatchable=!0,t.dirty=!1}return l}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const a=ii.get(z4,{maxTextures:this._renderer.limits.maxBatchableTextures}),l=t._gpuData[this._renderer.uid],{batches:o,geometryData:c}=l;l.graphicsData=a;const h=c.vertices.length,m=c.indices.length;for(let _=0;_<o.length;_++)o[_].applyTransform=!1;const p=a.batcher;p.ensureAttributeBuffer(h),p.ensureIndexBuffer(m),p.begin();for(let _=0;_<o.length;_++){const T=o[_];p.add(T)}p.finish(a.instructions);const y=p.geometry;y.indexBuffer.setDataWithSize(p.indexBuffer,p.indexSize,!0),y.buffers[0].setDataWithSize(p.attributeBuffer.float32View,p.attributeSize,!0);const x=p.batches;for(let _=0;_<x.length;_++){const T=x[_];T.bindGroup=gC(T.textures.textures,T.textures.count,this._renderer.limits.maxBatchableTextures)}return a}_initContext(t){const a=new R4;return a.context=t,t._gpuData[this._renderer.uid]=a,this._managedContexts.add(t),a}destroy(){this._managedContexts.destroy(),this._renderer=null}};Tg.extension={type:[Jt.WebGLSystem,Jt.WebGPUSystem],name:"graphicsContext"};Tg.defaultOptions={bezierSmoothness:.5};let Eg=Tg;const w4=8,vp=11920929e-14,D4=1;function bS(n,t,a,l,o,c,h,m,p,y){const _=Math.min(.99,Math.max(0,y??Eg.defaultOptions.bezierSmoothness));let T=(D4-_)/1;return T*=T,O4(t,a,l,o,c,h,m,p,n,T),n}function O4(n,t,a,l,o,c,h,m,p,y){W0(n,t,a,l,o,c,h,m,p,y,0),p.push(h,m)}function W0(n,t,a,l,o,c,h,m,p,y,x){if(x>w4)return;const _=(n+a)/2,T=(t+l)/2,C=(a+o)/2,M=(l+c)/2,w=(o+h)/2,z=(c+m)/2,D=(_+C)/2,N=(T+M)/2,j=(C+w)/2,G=(M+z)/2,k=(D+j)/2,q=(N+G)/2;if(x>0){let Z=h-n,W=m-t;const L=Math.abs((a-h)*W-(l-m)*Z),$=Math.abs((o-h)*W-(c-m)*Z);if(L>vp&&$>vp){if((L+$)*(L+$)<=y*(Z*Z+W*W)){p.push(k,q);return}}else if(L>vp){if(L*L<=y*(Z*Z+W*W)){p.push(k,q);return}}else if($>vp){if($*$<=y*(Z*Z+W*W)){p.push(k,q);return}}else if(Z=k-(n+h)/2,W=q-(t+m)/2,Z*Z+W*W<=y){p.push(k,q);return}}W0(n,t,_,T,D,N,k,q,p,y,x+1),W0(k,q,j,G,w,z,h,m,p,y,x+1)}const N4=8,B4=11920929e-14,j4=1;function U4(n,t,a,l,o,c,h,m){const y=Math.min(.99,Math.max(0,m??Eg.defaultOptions.bezierSmoothness));let x=(j4-y)/1;return x*=x,H4(t,a,l,o,c,h,n,x),n}function H4(n,t,a,l,o,c,h,m){J0(h,n,t,a,l,o,c,m,0),h.push(o,c)}function J0(n,t,a,l,o,c,h,m,p){if(p>N4)return;const y=(t+l)/2,x=(a+o)/2,_=(l+c)/2,T=(o+h)/2,C=(y+_)/2,M=(x+T)/2;let w=c-t,z=h-a;const D=Math.abs((l-c)*z-(o-h)*w);if(D>B4){if(D*D<=m*(w*w+z*z)){n.push(C,M);return}}else if(w=C-(t+c)/2,z=M-(a+h)/2,w*w+z*z<=m){n.push(C,M);return}J0(n,t,a,y,x,C,M,m,p+1),J0(n,C,M,_,T,c,h,m,p+1)}function SS(n,t,a,l,o,c,h,m){let p=Math.abs(o-c);(!h&&o>c||h&&c>o)&&(p=2*Math.PI-p),m||(m=Math.max(6,Math.floor(6*Math.pow(l,1/3)*(p/Math.PI)))),m=Math.max(m,3);let y=p/m,x=o;y*=h?-1:1;for(let _=0;_<m+1;_++){const T=Math.cos(x),C=Math.sin(x),M=t+T*l,w=a+C*l;n.push(M,w),x+=y}}function G4(n,t,a,l,o,c){const h=n[n.length-2],p=n[n.length-1]-a,y=h-t,x=o-a,_=l-t,T=Math.abs(p*_-y*x);if(T<1e-8||c===0){(n[n.length-2]!==t||n[n.length-1]!==a)&&n.push(t,a);return}const C=p*p+y*y,M=x*x+_*_,w=p*x+y*_,z=c*Math.sqrt(C)/T,D=c*Math.sqrt(M)/T,N=z*w/C,j=D*w/M,G=z*_+D*y,k=z*x+D*p,q=y*(D+N),Z=p*(D+N),W=_*(z+j),L=x*(z+j),$=Math.atan2(Z-k,q-G),et=Math.atan2(L-k,W-G);SS(n,G+t,k+a,c,$,et,y*x>_*p)}const fd=Math.PI*2,y0={centerX:0,centerY:0,ang1:0,ang2:0},g0=({x:n,y:t},a,l,o,c,h,m,p)=>{n*=a,t*=l;const y=o*n-c*t,x=c*n+o*t;return p.x=y+h,p.y=x+m,p};function Y4(n,t){const a=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),l=t===1.5707963267948966?.551915024494:a,o=Math.cos(n),c=Math.sin(n),h=Math.cos(n+t),m=Math.sin(n+t);return[{x:o-c*l,y:c+o*l},{x:h+m*l,y:m-h*l},{x:h,y:m}]}const W1=(n,t,a,l)=>{const o=n*l-t*a<0?-1:1;let c=n*a+t*l;return c>1&&(c=1),c<-1&&(c=-1),o*Math.acos(c)},q4=(n,t,a,l,o,c,h,m,p,y,x,_,T)=>{const C=Math.pow(o,2),M=Math.pow(c,2),w=Math.pow(x,2),z=Math.pow(_,2);let D=C*M-C*z-M*w;D<0&&(D=0),D/=C*z+M*w,D=Math.sqrt(D)*(h===m?-1:1);const N=D*o/c*_,j=D*-c/o*x,G=y*N-p*j+(n+a)/2,k=p*N+y*j+(t+l)/2,q=(x-N)/o,Z=(_-j)/c,W=(-x-N)/o,L=(-_-j)/c,$=W1(1,0,q,Z);let et=W1(q,Z,W,L);m===0&&et>0&&(et-=fd),m===1&&et<0&&(et+=fd),T.centerX=G,T.centerY=k,T.ang1=$,T.ang2=et};function L4(n,t,a,l,o,c,h,m=0,p=0,y=0){if(c===0||h===0)return;const x=Math.sin(m*fd/360),_=Math.cos(m*fd/360),T=_*(t-l)/2+x*(a-o)/2,C=-x*(t-l)/2+_*(a-o)/2;if(T===0&&C===0)return;c=Math.abs(c),h=Math.abs(h);const M=Math.pow(T,2)/Math.pow(c,2)+Math.pow(C,2)/Math.pow(h,2);M>1&&(c*=Math.sqrt(M),h*=Math.sqrt(M)),q4(t,a,l,o,c,h,p,y,x,_,T,C,y0);let{ang1:w,ang2:z}=y0;const{centerX:D,centerY:N}=y0;let j=Math.abs(z)/(fd/4);Math.abs(1-j)<1e-7&&(j=1);const G=Math.max(Math.ceil(j),1);z/=G;let k=n[n.length-2],q=n[n.length-1];const Z={x:0,y:0};for(let W=0;W<G;W++){const L=Y4(w,z),{x:$,y:et}=g0(L[0],c,h,_,x,D,N,Z),{x:ct,y:vt}=g0(L[1],c,h,_,x,D,N,Z),{x:dt,y:St}=g0(L[2],c,h,_,x,D,N,Z);bS(n,k,q,$,et,ct,vt,dt,St),k=dt,q=St,w+=z}}function X4(n,t,a){const l=(h,m)=>{const p=m.x-h.x,y=m.y-h.y,x=Math.sqrt(p*p+y*y),_=p/x,T=y/x;return{len:x,nx:_,ny:T}},o=(h,m)=>{h===0?n.moveTo(m.x,m.y):n.lineTo(m.x,m.y)};let c=t[t.length-1];for(let h=0;h<t.length;h++){const m=t[h%t.length],p=m.radius??a;if(p<=0){o(h,m),c=m;continue}const y=t[(h+1)%t.length],x=l(m,c),_=l(m,y);if(x.len<1e-4||_.len<1e-4){o(h,m),c=m;continue}let T=Math.asin(x.nx*_.ny-x.ny*_.nx),C=1,M=!1;x.nx*_.nx-x.ny*-_.ny<0?T<0?T=Math.PI+T:(T=Math.PI-T,C=-1,M=!0):T>0&&(C=-1,M=!0);const w=T/2;let z,D=Math.abs(Math.cos(w)*p/Math.sin(w));D>Math.min(x.len/2,_.len/2)?(D=Math.min(x.len/2,_.len/2),z=Math.abs(D*Math.sin(w)/Math.cos(w))):z=p;const N=m.x+_.nx*D+-_.ny*z*C,j=m.y+_.ny*D+_.nx*z*C,G=Math.atan2(x.ny,x.nx)+Math.PI/2*C,k=Math.atan2(_.ny,_.nx)-Math.PI/2*C;h===0&&n.moveTo(N+Math.cos(G)*z,j+Math.sin(G)*z),n.arc(N,j,z,G,k,M),c=m}}function V4(n,t,a,l){const o=(m,p)=>Math.sqrt((m.x-p.x)**2+(m.y-p.y)**2),c=(m,p,y)=>({x:m.x+(p.x-m.x)*y,y:m.y+(p.y-m.y)*y}),h=t.length;for(let m=0;m<h;m++){const p=t[(m+1)%h],y=p.radius??a;if(y<=0){m===0?n.moveTo(p.x,p.y):n.lineTo(p.x,p.y);continue}const x=t[m],_=t[(m+2)%h],T=o(x,p);let C;if(T<1e-4)C=p;else{const z=Math.min(T/2,y);C=c(p,x,z/T)}const M=o(_,p);let w;if(M<1e-4)w=p;else{const z=Math.min(M/2,y);w=c(p,_,z/M)}m===0?n.moveTo(C.x,C.y):n.lineTo(C.x,C.y),n.quadraticCurveTo(p.x,p.y,w.x,w.y,l)}}const k4=new mn;class Q4{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new tl,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,a){return this.startPoly(t,a),this}lineTo(t,a){this._ensurePoly();const l=this._currentPoly.points,o=l[l.length-2],c=l[l.length-1];return(o!==t||c!==a)&&l.push(t,a),this}arc(t,a,l,o,c,h){this._ensurePoly(!1);const m=this._currentPoly.points;return SS(m,t,a,l,o,c,h),this}arcTo(t,a,l,o,c){this._ensurePoly();const h=this._currentPoly.points;return G4(h,t,a,l,o,c),this}arcToSvg(t,a,l,o,c,h,m){const p=this._currentPoly.points;return L4(p,this._currentPoly.lastX,this._currentPoly.lastY,h,m,t,a,l,o,c),this}bezierCurveTo(t,a,l,o,c,h,m){this._ensurePoly();const p=this._currentPoly;return bS(this._currentPoly.points,p.lastX,p.lastY,t,a,l,o,c,h,m),this}quadraticCurveTo(t,a,l,o,c){this._ensurePoly();const h=this._currentPoly;return U4(this._currentPoly.points,h.lastX,h.lastY,t,a,l,o,c),this}closePath(){return this.endPoly(!0),this}addPath(t,a){this.endPoly(),a&&!a.isIdentity()&&(t=t.clone(!0),t.transform(a));const l=this.shapePrimitives,o=l.length;for(let c=0;c<t.instructions.length;c++){const h=t.instructions[c];this[h.action](...h.data)}if(t.checkForHoles&&l.length-o>1){let c=null;for(let h=o;h<l.length;h++){const m=l[h];if(m.shape.type==="polygon"){const p=m.shape,y=c==null?void 0:c.shape;y&&y.containsPolygon(p)?(c.holes||(c.holes=[]),c.holes.push(m),l.copyWithin(h,h+1),l.length--,h--):c=m}}}return this}finish(t=!1){this.endPoly(t)}rect(t,a,l,o,c){return this.drawShape(new mn(t,a,l,o),c),this}circle(t,a,l,o){return this.drawShape(new vg(t,a,l),o),this}poly(t,a,l){const o=new od(t);return o.closePath=a,this.drawShape(o,l),this}regularPoly(t,a,l,o,c=0,h){o=Math.max(o|0,3);const m=-1*Math.PI/2+c,p=Math.PI*2/o,y=[];for(let x=0;x<o;x++){const _=m-x*p;y.push(t+l*Math.cos(_),a+l*Math.sin(_))}return this.poly(y,!0,h),this}roundPoly(t,a,l,o,c,h=0,m){if(o=Math.max(o|0,3),c<=0)return this.regularPoly(t,a,l,o,h);const p=l*Math.sin(Math.PI/o)-.001;c=Math.min(c,p);const y=-1*Math.PI/2+h,x=Math.PI*2/o,_=(o-2)*Math.PI/o/2;for(let T=0;T<o;T++){const C=T*x+y,M=t+l*Math.cos(C),w=a+l*Math.sin(C),z=C+Math.PI+_,D=C-Math.PI-_,N=M+c*Math.cos(z),j=w+c*Math.sin(z),G=M+c*Math.cos(D),k=w+c*Math.sin(D);T===0?this.moveTo(N,j):this.lineTo(N,j),this.quadraticCurveTo(M,w,G,k,m)}return this.closePath()}roundShape(t,a,l=!1,o){return t.length<3?this:(l?V4(this,t,a,o):X4(this,t,a),this.closePath())}filletRect(t,a,l,o,c){if(c===0)return this.rect(t,a,l,o);const h=Math.min(l,o)/2,m=Math.min(h,Math.max(-h,c)),p=t+l,y=a+o,x=m<0?-m:0,_=Math.abs(m);return this.moveTo(t,a+_).arcTo(t+x,a+x,t+_,a,_).lineTo(p-_,a).arcTo(p-x,a+x,p,a+_,_).lineTo(p,y-_).arcTo(p-x,y-x,t+l-_,y,_).lineTo(t+_,y).arcTo(t+x,y-x,t,y-_,_).closePath()}chamferRect(t,a,l,o,c,h){if(c<=0)return this.rect(t,a,l,o);const m=Math.min(c,Math.min(l,o)/2),p=t+l,y=a+o,x=[t+m,a,p-m,a,p,a+m,p,y-m,p-m,y,t+m,y,t,y-m,t,a+m];for(let _=x.length-1;_>=2;_-=2)x[_]===x[_-2]&&x[_-1]===x[_-3]&&x.splice(_-1,2);return this.poly(x,!0,h)}ellipse(t,a,l,o,c){return this.drawShape(new xg(t,a,l,o),c),this}roundRect(t,a,l,o,c,h){return this.drawShape(new bg(t,a,l,o,c),h),this}drawShape(t,a){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:a}),this}startPoly(t,a){let l=this._currentPoly;return l&&this.endPoly(),l=new od,l.points.push(t,a),this._currentPoly=l,this}endPoly(t=!1){const a=this._currentPoly;return a&&a.points.length>2&&(a.closePath=t,this.shapePrimitives.push({shape:a})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new od,t)){const a=this.shapePrimitives[this.shapePrimitives.length-1];if(a){let l=a.shape.x,o=a.shape.y;if(a.transform&&!a.transform.isIdentity()){const c=a.transform,h=l;l=c.a*l+c.c*o+c.tx,o=c.b*h+c.d*o+c.ty}this._currentPoly.points.push(l,o)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let a=0;a<t.instructions.length;a++){const l=t.instructions[a];this[l.action](...l.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const a=this.shapePrimitives;for(let l=0;l<a.length;l++){const o=a[l],c=o.shape.getBounds(k4);o.transform?t.addRect(c,o.transform):t.addRect(c)}return t}}class cr{constructor(t,a=!1){this.instructions=[],this.uid=on("graphicsPath"),this._dirty=!0,this.checkForHoles=a,typeof t=="string"?dC(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new Q4(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,a){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,a]}),this._dirty=!0,this}arc(...t){return this.instructions.push({action:"arc",data:t}),this._dirty=!0,this}arcTo(...t){return this.instructions.push({action:"arcTo",data:t}),this._dirty=!0,this}arcToSvg(...t){return this.instructions.push({action:"arcToSvg",data:t}),this._dirty=!0,this}bezierCurveTo(...t){return this.instructions.push({action:"bezierCurveTo",data:t}),this._dirty=!0,this}bezierCurveToShort(t,a,l,o,c){const h=this.instructions[this.instructions.length-1],m=this.getLastPoint(ya.shared);let p=0,y=0;if(!h||h.action!=="bezierCurveTo")p=m.x,y=m.y;else{p=h.data[2],y=h.data[3];const x=m.x,_=m.y;p=x+(x-p),y=_+(_-y)}return this.instructions.push({action:"bezierCurveTo",data:[p,y,t,a,l,o,c]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...t){return this.instructions.push({action:"ellipse",data:t}),this._dirty=!0,this}lineTo(...t){return this.instructions.push({action:"lineTo",data:t}),this._dirty=!0,this}moveTo(...t){return this.instructions.push({action:"moveTo",data:t}),this}quadraticCurveTo(...t){return this.instructions.push({action:"quadraticCurveTo",data:t}),this._dirty=!0,this}quadraticCurveToShort(t,a,l){const o=this.instructions[this.instructions.length-1],c=this.getLastPoint(ya.shared);let h=0,m=0;if(!o||o.action!=="quadraticCurveTo")h=c.x,m=c.y;else{h=o.data[0],m=o.data[1];const p=c.x,y=c.y;h=p+(p-h),m=y+(y-m)}return this.instructions.push({action:"quadraticCurveTo",data:[h,m,t,a,l]}),this._dirty=!0,this}rect(t,a,l,o,c){return this.instructions.push({action:"rect",data:[t,a,l,o,c]}),this._dirty=!0,this}circle(t,a,l,o){return this.instructions.push({action:"circle",data:[t,a,l,o]}),this._dirty=!0,this}roundRect(...t){return this.instructions.push({action:"roundRect",data:t}),this._dirty=!0,this}poly(...t){return this.instructions.push({action:"poly",data:t}),this._dirty=!0,this}regularPoly(...t){return this.instructions.push({action:"regularPoly",data:t}),this._dirty=!0,this}roundPoly(...t){return this.instructions.push({action:"roundPoly",data:t}),this._dirty=!0,this}roundShape(...t){return this.instructions.push({action:"roundShape",data:t}),this._dirty=!0,this}filletRect(...t){return this.instructions.push({action:"filletRect",data:t}),this._dirty=!0,this}chamferRect(...t){return this.instructions.push({action:"chamferRect",data:t}),this._dirty=!0,this}star(t,a,l,o,c,h,m){c||(c=o/2);const p=-1*Math.PI/2+h,y=l*2,x=Math.PI*2/y,_=[];for(let T=0;T<y;T++){const C=T%2?c:o,M=T*x+p;_.push(t+C*Math.cos(M),a+C*Math.sin(M))}return this.poly(_,!0,m),this}clone(t=!1){const a=new cr;if(a.checkForHoles=this.checkForHoles,!t)a.instructions=this.instructions.slice();else for(let l=0;l<this.instructions.length;l++){const o=this.instructions[l];a.instructions.push({action:o.action,data:o.data.slice()})}return a}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const a=t.a,l=t.b,o=t.c,c=t.d,h=t.tx,m=t.ty;let p=0,y=0,x=0,_=0,T=0,C=0,M=0,w=0;for(let z=0;z<this.instructions.length;z++){const D=this.instructions[z],N=D.data;switch(D.action){case"moveTo":case"lineTo":p=N[0],y=N[1],N[0]=a*p+o*y+h,N[1]=l*p+c*y+m;break;case"bezierCurveTo":x=N[0],_=N[1],T=N[2],C=N[3],p=N[4],y=N[5],N[0]=a*x+o*_+h,N[1]=l*x+c*_+m,N[2]=a*T+o*C+h,N[3]=l*T+c*C+m,N[4]=a*p+o*y+h,N[5]=l*p+c*y+m;break;case"quadraticCurveTo":x=N[0],_=N[1],p=N[2],y=N[3],N[0]=a*x+o*_+h,N[1]=l*x+c*_+m,N[2]=a*p+o*y+h,N[3]=l*p+c*y+m;break;case"arcToSvg":p=N[5],y=N[6],M=N[0],w=N[1],N[0]=a*M+o*w,N[1]=l*M+c*w,N[5]=a*p+o*y+h,N[6]=l*p+c*y+m;break;case"circle":N[4]=td(N[3],t);break;case"rect":N[4]=td(N[4],t);break;case"ellipse":N[8]=td(N[8],t);break;case"roundRect":N[5]=td(N[5],t);break;case"addPath":N[0].transform(t);break;case"poly":N[2]=td(N[2],t);break;default:qa("unknown transform action",D.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let a=this.instructions.length-1,l=this.instructions[a];if(!l)return t.x=0,t.y=0,t;for(;l.action==="closePath";){if(a--,a<0)return t.x=0,t.y=0,t;l=this.instructions[a]}switch(l.action){case"moveTo":case"lineTo":t.x=l.data[0],t.y=l.data[1];break;case"quadraticCurveTo":t.x=l.data[2],t.y=l.data[3];break;case"bezierCurveTo":t.x=l.data[4],t.y=l.data[5];break;case"arc":case"arcToSvg":t.x=l.data[5],t.y=l.data[6];break;case"addPath":l.data[0].getLastPoint(t);break}return t}}function td(n,t){return n?n.prepend(t):t.clone()}function rn(n,t,a){const l=n.getAttribute(t);return l?Number(l):a}function K4(n,t){const a=n.querySelectorAll("defs");for(let l=0;l<a.length;l++){const o=a[l];for(let c=0;c<o.children.length;c++){const h=o.children[c];switch(h.nodeName.toLowerCase()){case"lineargradient":t.defs[h.id]=Z4(h);break;case"radialgradient":t.defs[h.id]=F4();break}}}}function Z4(n){const t=rn(n,"x1",0),a=rn(n,"y1",0),l=rn(n,"x2",1),o=rn(n,"y2",0),c=n.getAttribute("gradientUnits")||"objectBoundingBox",h=new hr(t,a,l,o,c==="objectBoundingBox"?"local":"global");for(let m=0;m<n.children.length;m++){const p=n.children[m],y=rn(p,"offset",0),x=zn.shared.setValue(p.getAttribute("stop-color")).toNumber();h.addColorStop(y,x)}return h}function F4(n){return qa("[SVG Parser] Radial gradients are not yet supported"),new hr(0,0,1,0)}function J1(n){const t=n.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const P1={fill:{type:"paint",default:0},"fill-opacity":{type:"number",default:1},stroke:{type:"paint",default:0},"stroke-width":{type:"number",default:1},"stroke-opacity":{type:"number",default:1},"stroke-linecap":{type:"string",default:"butt"},"stroke-linejoin":{type:"string",default:"miter"},"stroke-miterlimit":{type:"number",default:10},"stroke-dasharray":{type:"string",default:"none"},"stroke-dashoffset":{type:"number",default:0},opacity:{type:"number",default:1}};function _S(n,t){const a=n.getAttribute("style"),l={},o={},c={strokeStyle:l,fillStyle:o,useFill:!1,useStroke:!1};for(const h in P1){const m=n.getAttribute(h);m&&I1(t,c,h,m.trim())}if(a){const h=a.split(";");for(let m=0;m<h.length;m++){const p=h[m].trim(),[y,x]=p.split(":");P1[y]&&I1(t,c,y,x.trim())}}return{strokeStyle:c.useStroke?l:null,fillStyle:c.useFill?o:null,useFill:c.useFill,useStroke:c.useStroke}}function I1(n,t,a,l){switch(a){case"stroke":if(l!=="none"){if(l.startsWith("url(")){const o=J1(l);t.strokeStyle.fill=n.defs[o]}else t.strokeStyle.color=zn.shared.setValue(l).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(l);break;case"fill":if(l!=="none"){if(l.startsWith("url(")){const o=J1(l);t.fillStyle.fill=n.defs[o]}else t.fillStyle.color=zn.shared.setValue(l).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(l);break;case"stroke-opacity":t.strokeStyle.alpha=Number(l);break;case"opacity":t.fillStyle.alpha=Number(l),t.strokeStyle.alpha=Number(l);break}}function W4(n){if(n.length<=2)return!0;const t=n.map(m=>m.area).sort((m,p)=>p-m),[a,l]=t,o=t[t.length-1],c=a/l,h=l/o;return!(c>3&&h<2)}function J4(n){return n.split(/(?=[Mm])/).filter(l=>l.trim().length>0)}function P4(n){const t=n.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const a=t.map(Number),l=[],o=[];for(let x=0;x<a.length;x+=2)x+1<a.length&&(l.push(a[x]),o.push(a[x+1]));if(l.length===0||o.length===0)return 0;const c=Math.min(...l),h=Math.max(...l),m=Math.min(...o),p=Math.max(...o);return(h-c)*(p-m)}function $1(n,t){const a=new cr(n,!1);for(const l of a.instructions)t.instructions.push(l)}function I4(n,t){if(typeof n=="string"){const h=document.createElement("div");h.innerHTML=n.trim(),n=h.querySelector("svg")}const a={context:t,defs:{},path:new cr};K4(n,a);const l=n.children,{fillStyle:o,strokeStyle:c}=_S(n,a);for(let h=0;h<l.length;h++){const m=l[h];m.nodeName.toLowerCase()!=="defs"&&TS(m,a,o,c)}return t}function TS(n,t,a,l){const o=n.children,{fillStyle:c,strokeStyle:h}=_S(n,t);c&&a?a={...a,...c}:c&&(a=c),h&&l?l={...l,...h}:h&&(l=h);const m=!a&&!l;m&&(a={color:0});let p,y,x,_,T,C,M,w,z,D,N,j,G,k,q,Z,W;switch(n.nodeName.toLowerCase()){case"path":{k=n.getAttribute("d");const L=n.getAttribute("fill-rule"),$=J4(k),et=L==="evenodd",ct=$.length>1;if(et&&ct){const dt=$.map(H=>({path:H,area:P4(H)}));if(dt.sort((H,Q)=>Q.area-H.area),$.length>3||!W4(dt))for(let H=0;H<dt.length;H++){const Q=dt[H],ot=H===0;t.context.beginPath();const rt=new cr(void 0,!0);$1(Q.path,rt),t.context.path(rt),ot?(a&&t.context.fill(a),l&&t.context.stroke(l)):t.context.cut()}else for(let H=0;H<dt.length;H++){const Q=dt[H],ot=H%2===1;t.context.beginPath();const rt=new cr(void 0,!0);$1(Q.path,rt),t.context.path(rt),ot?t.context.cut():(a&&t.context.fill(a),l&&t.context.stroke(l))}}else{const dt=L?L==="evenodd":!0;q=new cr(k,dt),t.context.path(q),a&&t.context.fill(a),l&&t.context.stroke(l)}break}case"circle":M=rn(n,"cx",0),w=rn(n,"cy",0),z=rn(n,"r",0),t.context.ellipse(M,w,z,z),a&&t.context.fill(a),l&&t.context.stroke(l);break;case"rect":p=rn(n,"x",0),y=rn(n,"y",0),Z=rn(n,"width",0),W=rn(n,"height",0),D=rn(n,"rx",0),N=rn(n,"ry",0),D||N?t.context.roundRect(p,y,Z,W,D||N):t.context.rect(p,y,Z,W),a&&t.context.fill(a),l&&t.context.stroke(l);break;case"ellipse":M=rn(n,"cx",0),w=rn(n,"cy",0),D=rn(n,"rx",0),N=rn(n,"ry",0),t.context.beginPath(),t.context.ellipse(M,w,D,N),a&&t.context.fill(a),l&&t.context.stroke(l);break;case"line":x=rn(n,"x1",0),_=rn(n,"y1",0),T=rn(n,"x2",0),C=rn(n,"y2",0),t.context.beginPath(),t.context.moveTo(x,_),t.context.lineTo(T,C),l&&t.context.stroke(l);break;case"polygon":G=n.getAttribute("points"),j=G.match(/-?\d+/g).map(L=>parseInt(L,10)),t.context.poly(j,!0),a&&t.context.fill(a),l&&t.context.stroke(l);break;case"polyline":G=n.getAttribute("points"),j=G.match(/-?\d+/g).map(L=>parseInt(L,10)),t.context.poly(j,!1),l&&t.context.stroke(l);break;case"g":case"svg":break;default:{qa(`[SVG parser] <${n.nodeName}> elements unsupported`);break}}m&&(a=null);for(let L=0;L<o.length;L++)TS(o[L],t,a,l)}const tx={repeat:{addressModeU:"repeat",addressModeV:"repeat"},"repeat-x":{addressModeU:"repeat",addressModeV:"clamp-to-edge"},"repeat-y":{addressModeU:"clamp-to-edge",addressModeV:"repeat"},"no-repeat":{addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}};class Fp{constructor(t,a){this.uid=on("fillPattern"),this._tick=0,this.transform=new le,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),a&&(t.source.style.addressModeU=tx[a].addressModeU,t.source.style.addressModeV=tx[a].addressModeV)}setTransform(t){const a=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/a.frame.width,1/a.frame.height),this._tick++}get texture(){return this._texture}set texture(t){this._texture!==t&&(this._texture=t,this._tick++)}get styleKey(){return`fill-pattern-${this.uid}-${this._tick}`}destroy(){this.texture.destroy(!0),this.texture=null}}function $4(n){return zn.isColorLike(n)}function ex(n){return n instanceof Fp}function nx(n){return n instanceof hr}function tA(n){return n instanceof ze}function eA(n,t,a){const l=zn.shared.setValue(t??0);return n.color=l.toNumber(),n.alpha=l.alpha===1?a.alpha:l.alpha,n.texture=ze.WHITE,{...a,...n}}function nA(n,t,a){return n.texture=t,{...a,...n}}function ax(n,t,a){return n.fill=t,n.color=16777215,n.texture=t.texture,n.matrix=t.transform,{...a,...n}}function ix(n,t,a){return t.buildGradient(),n.fill=t,n.color=16777215,n.texture=t.texture,n.matrix=t.transform,n.textureSpace=t.textureSpace,{...a,...n}}function aA(n,t){const a={...t,...n},l=zn.shared.setValue(a.color);return a.alpha*=l.alpha,a.color=l.toNumber(),a}function So(n,t){if(n==null)return null;const a={},l=n;return $4(n)?eA(a,n,t):tA(n)?nA(a,n,t):ex(n)?ax(a,n,t):nx(n)?ix(a,n,t):l.fill&&ex(l.fill)?ax(l,l.fill,t):l.fill&&nx(l.fill)?ix(l,l.fill,t):aA(l,t)}function Bp(n,t){const{width:a,alignment:l,miterLimit:o,cap:c,join:h,pixelLine:m,...p}=t,y=So(n,p);return y?{width:a,alignment:l,miterLimit:o,cap:c,join:h,pixelLine:m,...y}:null}function iA(n,t){let a=1;const l=n.shapePath.shapePrimitives;for(let o=0;o<l.length;o++){const c=l[o].shape;if(c.type!=="polygon")continue;const h=c.points,m=h.length;if(m<6)continue;const p=c.closePath;for(let y=0;y<m;y+=2){if(!p&&(y===0||y===m-2))continue;const x=(y-2+m)%m,_=(y+2)%m,T=h[x],C=h[x+1],M=h[y],w=h[y+1],z=h[_],D=h[_+1],N=T-M,j=C-w,G=z-M,k=D-w,q=N*N+j*j,Z=G*G+k*k;if(q<1e-12||Z<1e-12)continue;let $=(N*G+j*k)/Math.sqrt(q*Z);$<-1?$=-1:$>1&&($=1);const et=Math.sqrt((1-$)*.5);if(et<1e-6)continue;const ct=Math.min(1/et,t);ct>a&&(a=ct)}}return a}const lA=new ya,lx=new le,Cg=class xs extends _s{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=on("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new cr,this._transform=new le,this._fillStyle={...xs.defaultFillStyle},this._strokeStyle={...xs.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new tl,this._boundsDirty=!0}clone(){const t=new xs;return t.batchMode=this.batchMode,t.instructions=this.instructions.slice(),t._activePath=this._activePath.clone(),t._transform=this._transform.clone(),t._fillStyle={...this._fillStyle},t._strokeStyle={...this._strokeStyle},t._stateStack=this._stateStack.slice(),t._bounds=this._bounds.clone(),t._boundsDirty=!0,t}get fillStyle(){return this._fillStyle}set fillStyle(t){this._fillStyle=So(t,xs.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=Bp(t,xs.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=So(t,xs.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=So(t,xs.defaultStrokeStyle),this}texture(t,a,l,o,c,h){return this.instructions.push({action:"texture",data:{image:t,dx:l||0,dy:o||0,dw:c||t.frame.width,dh:h||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:a||a===0?zn.shared.setValue(a).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new cr,this}fill(t,a){let l;const o=this.instructions[this.instructions.length-1];return this._tick===0&&(o==null?void 0:o.action)==="stroke"?l=o.data.path:l=this._activePath.clone(),l?(t!=null&&(a!==void 0&&typeof t=="number"&&(de(un,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:a}),this._fillStyle=So(t,xs.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:l}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:a}=this._activePath.getLastPoint(ya.shared);this._activePath.clear(),this._activePath.moveTo(t,a)}stroke(t){let a;const l=this.instructions[this.instructions.length-1];return this._tick===0&&(l==null?void 0:l.action)==="fill"?a=l.data.path:a=this._activePath.clone(),a?(t!=null&&(this._strokeStyle=Bp(t,xs.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:a}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const a=this.instructions[this.instructions.length-1-t],l=this._activePath.clone();if(a&&(a.action==="stroke"||a.action==="fill"))if(a.data.hole)a.data.hole.addPath(l);else{a.data.hole=l;break}}return this._initNextPathLocation(),this}arc(t,a,l,o,c,h){this._tick++;const m=this._transform;return this._activePath.arc(m.a*t+m.c*a+m.tx,m.b*t+m.d*a+m.ty,l,o,c,h),this}arcTo(t,a,l,o,c){this._tick++;const h=this._transform;return this._activePath.arcTo(h.a*t+h.c*a+h.tx,h.b*t+h.d*a+h.ty,h.a*l+h.c*o+h.tx,h.b*l+h.d*o+h.ty,c),this}arcToSvg(t,a,l,o,c,h,m){this._tick++;const p=this._transform;return this._activePath.arcToSvg(t,a,l,o,c,p.a*h+p.c*m+p.tx,p.b*h+p.d*m+p.ty),this}bezierCurveTo(t,a,l,o,c,h,m){this._tick++;const p=this._transform;return this._activePath.bezierCurveTo(p.a*t+p.c*a+p.tx,p.b*t+p.d*a+p.ty,p.a*l+p.c*o+p.tx,p.b*l+p.d*o+p.ty,p.a*c+p.c*h+p.tx,p.b*c+p.d*h+p.ty,m),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,a,l,o){return this._tick++,this._activePath.ellipse(t,a,l,o,this._transform.clone()),this}circle(t,a,l){return this._tick++,this._activePath.circle(t,a,l,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,a){this._tick++;const l=this._transform;return this._activePath.lineTo(l.a*t+l.c*a+l.tx,l.b*t+l.d*a+l.ty),this}moveTo(t,a){this._tick++;const l=this._transform,o=this._activePath.instructions,c=l.a*t+l.c*a+l.tx,h=l.b*t+l.d*a+l.ty;return o.length===1&&o[0].action==="moveTo"?(o[0].data[0]=c,o[0].data[1]=h,this):(this._activePath.moveTo(c,h),this)}quadraticCurveTo(t,a,l,o,c){this._tick++;const h=this._transform;return this._activePath.quadraticCurveTo(h.a*t+h.c*a+h.tx,h.b*t+h.d*a+h.ty,h.a*l+h.c*o+h.tx,h.b*l+h.d*o+h.ty,c),this}rect(t,a,l,o){return this._tick++,this._activePath.rect(t,a,l,o,this._transform.clone()),this}roundRect(t,a,l,o,c){return this._tick++,this._activePath.roundRect(t,a,l,o,c,this._transform.clone()),this}poly(t,a){return this._tick++,this._activePath.poly(t,a,this._transform.clone()),this}regularPoly(t,a,l,o,c=0,h){return this._tick++,this._activePath.regularPoly(t,a,l,o,c,h),this}roundPoly(t,a,l,o,c,h){return this._tick++,this._activePath.roundPoly(t,a,l,o,c,h),this}roundShape(t,a,l,o){return this._tick++,this._activePath.roundShape(t,a,l,o),this}filletRect(t,a,l,o,c){return this._tick++,this._activePath.filletRect(t,a,l,o,c),this}chamferRect(t,a,l,o,c,h){return this._tick++,this._activePath.chamferRect(t,a,l,o,c,h),this}star(t,a,l,o,c=0,h=0){return this._tick++,this._activePath.star(t,a,l,o,c,h,this._transform.clone()),this}svg(t){return this._tick++,I4(t,this),this}restore(){const t=this._stateStack.pop();return t&&(this._transform=t.transform,this._fillStyle=t.fillStyle,this._strokeStyle=t.strokeStyle),this}save(){return this._stateStack.push({transform:this._transform.clone(),fillStyle:{...this._fillStyle},strokeStyle:{...this._strokeStyle}}),this}getTransform(){return this._transform}resetTransform(){return this._transform.identity(),this}rotate(t){return this._transform.rotate(t),this}scale(t,a=t){return this._transform.scale(t,a),this}setTransform(t,a,l,o,c,h){return t instanceof le?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,a,l,o,c,h),this)}transform(t,a,l,o,c,h){return t instanceof le?(this._transform.append(t),this):(lx.set(t,a,l,o,c,h),this._transform.append(lx),this)}translate(t,a=t){return this._transform.translate(t,a),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this._boundsDirty=!0,this.dirty=!0,this.emit("update",this,16)}get bounds(){if(!this._boundsDirty)return this._bounds;this._boundsDirty=!1;const t=this._bounds;t.clear();for(let a=0;a<this.instructions.length;a++){const l=this.instructions[a],o=l.action;if(o==="fill"){const c=l.data;t.addBounds(c.path.bounds)}else if(o==="texture"){const c=l.data;t.addFrame(c.dx,c.dy,c.dx+c.dw,c.dy+c.dh,c.transform)}if(o==="stroke"){const c=l.data,h=c.style.alignment;let m=c.style.width*(1-h);c.style.join==="miter"&&(m*=iA(c.path,c.style.miterLimit));const p=c.path.bounds;t.addFrame(p.minX-m,p.minY-m,p.maxX+m,p.maxY+m)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){var o;if(!this.bounds.containsPoint(t.x,t.y))return!1;const a=this.instructions;let l=!1;for(let c=0;c<a.length;c++){const h=a[c],m=h.data,p=m.path;if(!h.action||!p)continue;const y=m.style,x=p.shapePath.shapePrimitives;for(let _=0;_<x.length;_++){const T=x[_].shape;if(!y||!T)continue;const C=x[_].transform,M=C?C.applyInverse(t,lA):t;if(h.action==="fill")l=T.contains(M.x,M.y);else{const z=y;l=T.strokeContains(M.x,M.y,z.width,z.alignment)}const w=m.hole;if(w){const z=(o=w.shapePath)==null?void 0:o.shapePrimitives;if(z)for(let D=0;D<z.length;D++)z[D].shape.contains(M.x,M.y)&&(l=!1)}if(l)return!0}}return l}unload(){var t;this.emit("unload",this);for(const a in this._gpuData)(t=this._gpuData[a])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){if(this.destroyed)return;if(this.destroyed=!0,this._stateStack.length=0,this._transform=null,this.unload(),this.emit("destroy",this),this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const l=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._fillStyle.texture&&(this._fillStyle.fill&&"uid"in this._fillStyle.fill?this._fillStyle.fill.destroy():this._fillStyle.texture.destroy(l)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(l))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Cg.defaultFillStyle={color:16777215,alpha:1,texture:ze.WHITE,matrix:null,fill:null,textureSpace:"local"};Cg.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:ze.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Dl=Cg;class sA{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class rA{constructor(){this.instructions=new hg}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const Ag=class P0{constructor(t){this._renderer=t,this._managedContexts=new Td({renderer:t,type:"resource",name:"graphicsContext"})}init(t){P0.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??P0.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const a=t._gpuData,l=!!a[this._renderer.uid],o=a[this._renderer.uid]||this._initContext(t);return(t.dirty||!l)&&(l&&o.reset(),o.isBatchable=!1,t.dirty=!1),o}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const a=new rA,l=this.getGpuContext(t);return l.graphicsData=a,a.init(),a}_initContext(t){const a=new sA;return a.context=t,t._gpuData[this._renderer.uid]=a,this._managedContexts.add(t),a}destroy(){this._managedContexts.destroy(),this._renderer=null}};Ag.extension={type:[Jt.CanvasSystem],name:"graphicsContext"};Ag.defaultOptions={bezierSmoothness:.5};let uA=Ag;class ES{constructor(t,a){this.state=yg.for2d(),this.renderer=t,this._adaptor=a,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Td({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,a){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(a),a.add(t)}updateRenderable(t){}execute(t){t.isRenderable&&this._adaptor.execute(this,t)}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null}}ES.extension={type:[Jt.CanvasPipes],name:"graphics"};function oA(n,t,a){const l=(n>>24&255)/255;t[a++]=(n&255)/255*l,t[a++]=(n>>8&255)/255*l,t[a++]=(n>>16&255)/255*l,t[a++]=l}class cA{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{ii.return(t)}),this.batches.length=0}}class CS{constructor(t,a){this.state=yg.for2d(),this.renderer=t,this._adaptor=a,this.renderer.runners.contextChange.add(this),this._managedGraphics=new Td({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const a=t.context,l=!!t._gpuData,c=this.renderer.graphicsContext.updateGpuContext(a);return!!(c.isBatchable||l!==c.isBatchable)}addRenderable(t,a){const o=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),o.isBatchable?this._addToBatcher(t,a):(this.renderer.renderPipes.batch.break(a),a.add(t))}updateRenderable(t){const l=this._getGpuDataForRenderable(t).batches;for(let o=0;o<l.length;o++){const c=l[o];c._batcher.updateElement(c)}}execute(t){if(!t.isRenderable)return;const a=this.renderer,l=t.context;if(!a.graphicsContext.getGpuContext(l).batches.length)return;const c=l.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const h=c.resources.localUniforms.uniforms;h.uTransformMatrix=t.groupTransform,h.uRound=a._roundPixels|t._roundPixels,oA(t.groupColorAlpha,h.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const a=this._getGpuDataForRenderable(t),o=this.renderer.graphicsContext.updateGpuContext(t.context);a.destroy(),o.isBatchable&&this._updateBatchesForRenderable(t,a)}_addToBatcher(t,a){const l=this.renderer.renderPipes.batch,o=this._getGpuDataForRenderable(t).batches;for(let c=0;c<o.length;c++){const h=o[c];l.addToBatch(h,a)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const a=new cA;return t._gpuData[this.renderer.uid]=a,this._managedGraphics.add(t),a}_updateBatchesForRenderable(t,a){const l=t.context,c=this.renderer.graphicsContext.getGpuContext(l),h=this.renderer._roundPixels|t._roundPixels;a.batches=c.batches.map(m=>{const p=ii.get(Sg);return m.copyTo(p),p.renderable=t,p.roundPixels=h,p})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}CS.extension={type:[Jt.WebGLPipes,Jt.WebGPUPipes],name:"graphics"};Ie.add(ES);Ie.add(CS);Ie.add(uA);Ie.add(Eg);class ai extends dg{constructor(t){t instanceof Dl&&(t={context:t});const{context:a,roundPixels:l,...o}=t||{};super({label:"Graphics",...o}),this.renderPipeId="graphics",a?this.context=a:(this.context=this._ownedContext=new Dl,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=l??!1}set context(t){t!==this._context&&(this._context&&(this._context.off("update",this.onViewUpdate,this),this._context.off("unload",this.unload,this)),this._context=t,this._context.on("update",this.onViewUpdate,this),this._context.on("unload",this.unload,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(t){return this._context.containsPoint(t)}destroy(t){this._ownedContext&&!t?this._ownedContext.destroy(t):(t===!0||(t==null?void 0:t.context)===!0)&&this._context.destroy(t),this._ownedContext=null,this._context=null,super.destroy(t)}_onTouch(t){this._gcLastUsed=t,this._context._gcLastUsed=t}_callContextMethod(t,a){return this.context[t](...a),this}setFillStyle(...t){return this._callContextMethod("setFillStyle",t)}setStrokeStyle(...t){return this._callContextMethod("setStrokeStyle",t)}fill(...t){return this._callContextMethod("fill",t)}stroke(...t){return this._callContextMethod("stroke",t)}texture(...t){return this._callContextMethod("texture",t)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...t){return this._callContextMethod("arc",t)}arcTo(...t){return this._callContextMethod("arcTo",t)}arcToSvg(...t){return this._callContextMethod("arcToSvg",t)}bezierCurveTo(...t){return this._callContextMethod("bezierCurveTo",t)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...t){return this._callContextMethod("ellipse",t)}circle(...t){return this._callContextMethod("circle",t)}path(...t){return this._callContextMethod("path",t)}lineTo(...t){return this._callContextMethod("lineTo",t)}moveTo(...t){return this._callContextMethod("moveTo",t)}quadraticCurveTo(...t){return this._callContextMethod("quadraticCurveTo",t)}rect(...t){return this._callContextMethod("rect",t)}roundRect(...t){return this._callContextMethod("roundRect",t)}poly(...t){return this._callContextMethod("poly",t)}regularPoly(...t){return this._callContextMethod("regularPoly",t)}roundPoly(...t){return this._callContextMethod("roundPoly",t)}roundShape(...t){return this._callContextMethod("roundShape",t)}filletRect(...t){return this._callContextMethod("filletRect",t)}chamferRect(...t){return this._callContextMethod("chamferRect",t)}star(...t){return this._callContextMethod("star",t)}svg(...t){return this._callContextMethod("svg",t)}restore(...t){return this._callContextMethod("restore",t)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...t){return this._callContextMethod("rotate",t)}scaleTransform(...t){return this._callContextMethod("scale",t)}setTransform(...t){return this._callContextMethod("setTransform",t)}transform(...t){return this._callContextMethod("transform",t)}translateTransform(...t){return this._callContextMethod("translate",t)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(t){this._context.fillStyle=t}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(t){this._context.strokeStyle=t}clone(t=!1){return t?new ai(this._context.clone()):(this._ownedContext=null,new ai(this._context))}lineStyle(t,a,l){de(un,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const o={};return t&&(o.width=t),a&&(o.color=a),l&&(o.alpha=l),this.context.strokeStyle=o,this}beginFill(t,a){de(un,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const l={};return t!==void 0&&(l.color=t),a!==void 0&&(l.alpha=a),this.context.fillStyle=l,this}endFill(){de(un,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const t=this.context.strokeStyle;return(t.width!==Dl.defaultStrokeStyle.width||t.color!==Dl.defaultStrokeStyle.color||t.alpha!==Dl.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return de(un,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return de(un,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return de(un,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return de(un,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return de(un,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return de(un,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class fA extends dg{constructor(t,a){const{text:l,resolution:o,style:c,anchor:h,width:m,height:p,roundPixels:y,...x}=t;super({...x}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=a,this.text=l??"",this.style=c,this.resolution=o??null,this.allowChildren=!1,this._anchor=new In({_onUpdate:()=>{this.onViewUpdate()}}),h&&(this.anchor=h),this.roundPixels=y??!1,m!==void 0&&(this.width=m),p!==void 0&&(this.height=p)}get anchor(){return this._anchor}set anchor(t){typeof t=="number"?this._anchor.set(t):this._anchor.copyFrom(t)}set text(t){t=t.toString(),this._text!==t&&(this._text=t,this.onViewUpdate())}get text(){return this._text}set resolution(t){this._autoResolution=t===null,this._resolution=t,this.onViewUpdate()}get resolution(){return this._resolution}get style(){return this._style}set style(t){var a;t||(t={}),(a=this._style)==null||a.off("update",this.onViewUpdate,this),t instanceof this._styleClass?this._style=t:this._style=new this._styleClass(t),this._style.on("update",this.onViewUpdate,this),this.onViewUpdate()}get width(){return Math.abs(this.scale.x)*this.bounds.width}set width(t){this._setWidth(t,this.bounds.width)}get height(){return Math.abs(this.scale.y)*this.bounds.height}set height(t){this._setHeight(t,this.bounds.height)}getSize(t){return t||(t={}),t.width=Math.abs(this.scale.x)*this.bounds.width,t.height=Math.abs(this.scale.y)*this.bounds.height,t}setSize(t,a){typeof t=="object"?(a=t.height??t.width,t=t.width):a??(a=t),t!==void 0&&this._setWidth(t,this.bounds.width),a!==void 0&&this._setHeight(a,this.bounds.height)}containsPoint(t){const a=this.bounds.width,l=this.bounds.height,o=-a*this.anchor.x;let c=0;return t.x>=o&&t.x<=o+a&&(c=-l*this.anchor.y,t.y>=c&&t.y<=c+l)}onViewUpdate(){this.didViewUpdate||(this._didTextUpdate=!0),super.onViewUpdate()}destroy(t=!1){super.destroy(t),this.owner=null,this._bounds=null,this._anchor=null,(typeof t=="boolean"?t:t!=null&&t.style)&&this._style.destroy(t),this._style=null,this._text=null}get styleKey(){return`${this._text}:${this._style.styleKey}:${this._resolution}`}}function hA(n,t){let a=n[0]??{};return(typeof a=="string"||n[1])&&(de(un,`use new ${t}({ text: "hi!", style }) instead`),a={text:a,style:n[1]}),a}class dA{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,a){const l=Ti.get().createCanvas();l.width=t,l.height=a;const o=l.getContext("2d");return{canvas:l,context:o}}getOptimalCanvasAndContext(t,a,l=1){t=Math.ceil(t*l-1e-6),a=Math.ceil(a*l-1e-6),t=af(t),a=af(a);const o=(t<<17)+(a<<1);this._canvasPool[o]||(this._canvasPool[o]=[]);let c=this._canvasPool[o].pop();return c||(c=this._createCanvasAndContext(t,a)),c}returnCanvasAndContext(t){const a=t.canvas,{width:l,height:o}=a,c=(l<<17)+(o<<1);t.context.resetTransform(),t.context.clearRect(0,0,l,o),this._canvasPool[c].push(t)}clear(){this._canvasPool={}}}const I0=new dA;Sd.register(I0);let ho=null,ur=null;function mA(n,t){ho||(ho=Ti.get().createCanvas(256,128),ur=ho.getContext("2d",{willReadFrequently:!0}),ur.globalCompositeOperation="copy",ur.globalAlpha=1),(ho.width<n||ho.height<t)&&(ho.width=af(n),ho.height=af(t))}function sx(n,t,a){for(let l=0,o=4*a*t;l<t;++l,o+=4)if(n[o+3]!==0)return!1;return!0}function rx(n,t,a,l,o){const c=4*t;for(let h=l,m=l*c+4*a;h<=o;++h,m+=c)if(n[m+3]!==0)return!1;return!0}function pA(...n){let t=n[0];t.canvas||(t={canvas:n[0],resolution:n[1]});const{canvas:a}=t,l=Math.min(t.resolution??1,1),o=t.width??a.width,c=t.height??a.height;let h=t.output;if(mA(o,c),!ur)throw new TypeError("Failed to get canvas 2D context");ur.drawImage(a,0,0,o,c,0,0,o*l,c*l);const p=ur.getImageData(0,0,o,c).data;let y=0,x=0,_=o-1,T=c-1;for(;x<c&&sx(p,o,x);)++x;if(x===c)return mn.EMPTY;for(;sx(p,o,T);)--T;for(;rx(p,o,y,x,T);)++y;for(;rx(p,o,_,x,T);)--_;return++_,++T,ur.globalCompositeOperation="source-over",ur.strokeRect(y,x,_-y,T-x),ur.globalCompositeOperation="copy",h??(h=new mn),h.set(y/l,x/l,(_-y)/l,(T-x)/l),h}/**
299
- * tiny-lru
300
- *
301
- * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
302
- * @license BSD-3-Clause
303
- * @version 11.4.7
304
- */class yA{constructor(t=0,a=0,l=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=l,this.size=0,this.ttl=a}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const a=this.items[t];delete this.items[t],this.size--,a.prev!==null&&(a.prev.next=a.next),a.next!==null&&(a.next.prev=a.prev),this.first===a&&(this.first=a.next),this.last===a&&(this.last=a.prev)}return this}entries(t=this.keys()){const a=new Array(t.length);for(let l=0;l<t.length;l++){const o=t[l];a[l]=[o,this.get(o)]}return a}evict(t=!1){if(t||this.size>0){const a=this.first;delete this.items[a.key],--this.size===0?(this.first=null,this.last=null):(this.first=a.next,this.first.prev=null)}return this}expiresAt(t){let a;return this.has(t)&&(a=this.items[t].expiry),a}get(t){const a=this.items[t];if(a!==void 0){if(this.ttl>0&&a.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(a),a.value}}has(t){return t in this.items}moveToEnd(t){this.last!==t&&(t.prev!==null&&(t.prev.next=t.next),t.next!==null&&(t.next.prev=t.prev),this.first===t&&(this.first=t.next),t.prev=this.last,t.next=null,this.last!==null&&(this.last.next=t),this.last=t,this.first===null&&(this.first=t))}keys(){const t=new Array(this.size);let a=this.first,l=0;for(;a!==null;)t[l++]=a.key,a=a.next;return t}setWithEvicted(t,a,l=this.resetTtl){let o=null;if(this.has(t))this.set(t,a,!0,l);else{this.max>0&&this.size===this.max&&(o={...this.first},this.evict(!0));let c=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:a};++this.size===1?this.first=c:this.last.next=c,this.last=c}return o}set(t,a,l=!1,o=this.resetTtl){let c=this.items[t];return l||c!==void 0?(c.value=a,l===!1&&o&&(c.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(c)):(this.max>0&&this.size===this.max&&this.evict(!0),c=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:a},++this.size===1?this.first=c:this.last.next=c,this.last=c),this}values(t=this.keys()){const a=new Array(t.length);for(let l=0;l<t.length;l++)a[l]=this.get(t[l]);return a}}function gA(n=1e3,t=0,a=!1){if(isNaN(n)||n<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof a!="boolean")throw new TypeError("Invalid resetTtl value");return new yA(n,t,a)}function AS(n){return!!n.tagStyles&&Object.keys(n.tagStyles).length>0}function MS(n){return n.includes("<")}function vA(n,t){return n.clone().assign(t)}function xA(n,t){const a=[],l=t.tagStyles;if(!AS(t)||!MS(n))return a.push({text:n,style:t}),a;const o=[t],c=[];let h="",m=0;for(;m<n.length;){const p=n[m];if(p==="<"){const y=n.indexOf(">",m);if(y===-1){h+=p,m++;continue}const x=n.slice(m+1,y);if(x.startsWith("/")){const _=x.slice(1).trim();if(c.length>0&&c[c.length-1]===_){h.length>0&&(a.push({text:h,style:o[o.length-1]}),h=""),o.pop(),c.pop(),m=y+1;continue}else{h+=n.slice(m,y+1),m=y+1;continue}}else{const _=x.trim();if(l[_]){h.length>0&&(a.push({text:h,style:o[o.length-1]}),h="");const T=o[o.length-1],C=vA(T,l[_]);o.push(C),c.push(_),m=y+1;continue}else{h+=n.slice(m,y+1),m=y+1;continue}}}else h+=p,m++}return h.length>0&&a.push({text:h,style:o[o.length-1]}),a}const bA=[10,13],SA=new Set(bA),_A=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],TA=new Set(_A),EA=[9,32];new Set(EA);const CA=[45,8208,8211,8212,173],AA=new Set(CA),MA=/(\r\n|\r|\n)/,RA=/(?:\r\n|\r|\n)/;function jp(n){return typeof n!="string"?!1:SA.has(n.charCodeAt(0))}function $i(n,t){return typeof n!="string"?!1:TA.has(n.charCodeAt(0))}function zA(n){return typeof n!="string"?!1:AA.has(n.charCodeAt(0))}function RS(n){return n==="normal"||n==="pre-line"}function zS(n){return n==="normal"}function rr(n){if(typeof n!="string")return"";let t=n.length-1;for(;t>=0&&$i(n[t]);)t--;return t<n.length-1?n.slice(0,t+1):n}function wS(n){const t=[],a=[];if(typeof n!="string")return t;for(let l=0;l<n.length;l++){const o=n[l],c=n[l+1];if($i(o)||jp(o)){a.length>0&&(t.push(a.join("")),a.length=0),o==="\r"&&c===`
305
- `?(t.push(`\r
306
- `),l++):t.push(o);continue}a.push(o),zA(o)&&c&&!$i(c)&&!jp(c)&&(t.push(a.join("")),a.length=0)}return a.length>0&&t.push(a.join("")),t}function DS(n,t,a,l){const o=a(n),c=[];for(let h=0;h<o.length;h++){let m=o[h],p=m,y=1;for(;o[h+y];){const x=o[h+y];if(!l(p,x,n,h,t))m+=x,p=x,y++;else break}h+=y-1,c.push(m)}return c}const wA=/\r\n|\r|\n/g;function DA(n,t,a,l,o,c,h,m){var St,H;const p=xA(n,t);if(zS(t.whiteSpace))for(let Q=0;Q<p.length;Q++){const ot=p[Q];p[Q]={text:ot.text.replace(wA," "),style:ot.style}}const x=[];let _=[];for(const Q of p){const ot=Q.text.split(MA);for(let rt=0;rt<ot.length;rt++){const gt=ot[rt];gt===`\r
307
- `||gt==="\r"||gt===`
308
- `?(x.push(_),_=[]):gt.length>0&&_.push({text:gt,style:Q.style})}}(_.length>0||x.length===0)&&x.push(_);const T=a?OA(x,t,l,o,h,m):x,C=[],M=[],w=[],z=[],D=[];let N=0;const j=t._fontString,G=c(j);G.fontSize===0&&(G.fontSize=t.fontSize,G.ascent=t.fontSize);let k="",q=!!t.dropShadow,Z=((St=t._stroke)==null?void 0:St.width)||0;for(const Q of T){let ot=0,rt=G.ascent,gt=G.descent,U="";for(const tt of Q){const pt=tt.style._fontString,_t=c(pt);pt!==k&&(l.font=pt,k=pt);const At=o(tt.text,tt.style.letterSpacing,l);ot+=At,rt=Math.max(rt,_t.ascent),gt=Math.max(gt,_t.descent),U+=tt.text;const Ot=((H=tt.style._stroke)==null?void 0:H.width)||0;Ot>Z&&(Z=Ot),!q&&tt.style.dropShadow&&(q=!0)}Q.length===0&&(rt=G.ascent,gt=G.descent),C.push(ot),M.push(rt),w.push(gt),D.push(U);const F=t.lineHeight||rt+gt;z.push(F+t.leading),N=Math.max(N,ot)}const W=Z,et=(a&&t.align!=="left"?Math.max(N,t.wordWrapWidth):N)+W+(t.dropShadow?t.dropShadow.distance:0);let ct=0;for(let Q=0;Q<z.length;Q++)ct+=z[Q];ct=Math.max(ct,z[0]+W);const vt=ct+(t.dropShadow?t.dropShadow.distance:0),dt=t.lineHeight||G.fontSize;return{width:et,height:vt,lines:D,lineWidths:C,lineHeight:dt+t.leading,maxLineWidth:N,fontProperties:G,runsByLine:T,lineAscents:M,lineDescents:w,lineHeights:z,hasDropShadow:q}}function OA(n,t,a,l,o,c){var z;const{letterSpacing:h,whiteSpace:m,wordWrapWidth:p,breakWords:y}=t,x=RS(m),_=p+h,T={};let C="";const M=(D,N)=>{const j=`${D}|${N.styleKey}`;let G=T[j];if(G===void 0){const k=N._fontString;k!==C&&(a.font=k,C=k),G=l(D,N.letterSpacing,a)+N.letterSpacing,T[j]=G}return G},w=[];for(const D of n){const N=NA(D),j=w.length,G=ct=>{let vt=0,dt=ct;do{const{token:St,style:H}=N[dt];vt+=M(St,H),dt++}while(dt<N.length&&N[dt].continuesFromPrevious);return vt},k=ct=>{const vt=[];let dt=ct;do vt.push({token:N[dt].token,style:N[dt].style}),dt++;while(dt<N.length&&N[dt].continuesFromPrevious);return vt};let q=[],Z=0,W=!x,L=null;const $=()=>{L&&L.text.length>0&&q.push(L),L=null},et=()=>{if($(),q.length>0){const ct=q[q.length-1];ct.text=rr(ct.text),ct.text.length===0&&q.pop()}w.push(q),q=[],Z=0,W=!1};for(let ct=0;ct<N.length;ct++){const{token:vt,style:dt,continuesFromPrevious:St}=N[ct],H=M(vt,dt);if(x){const rt=$i(vt),gt=(L==null?void 0:L.text[L.text.length-1])??((z=q[q.length-1])==null?void 0:z.text.slice(-1))??"",U=gt?$i(gt):!1;if(rt&&U)continue}const Q=!St,ot=Q?G(ct):H;if(ot>_&&Q)if(Z>0&&et(),y){const rt=k(ct);for(let gt=0;gt<rt.length;gt++){const U=rt[gt].token,F=rt[gt].style,tt=DS(U,y,c,o);for(const pt of tt){const _t=M(pt,F);_t+Z>_&&et(),!L||L.style!==F?($(),L={text:pt,style:F}):L.text+=pt,Z+=_t}}ct+=rt.length-1}else{const rt=k(ct);$(),w.push(rt.map(gt=>({text:gt.token,style:gt.style}))),W=!1,ct+=rt.length-1}else if(ot+Z>_&&Q){if($i(vt)){W=!1;continue}et(),L={text:vt,style:dt},Z=H}else if(St&&!y)!L||L.style!==dt?($(),L={text:vt,style:dt}):L.text+=vt,Z+=H;else{const rt=$i(vt);if(Z===0&&rt&&!W)continue;!L||L.style!==dt?($(),L={text:vt,style:dt}):L.text+=vt,Z+=H}}if($(),q.length>0){const ct=q[q.length-1];ct.text=rr(ct.text),ct.text.length===0&&q.pop()}(q.length>0||w.length===j)&&w.push(q)}return w}function NA(n){const t=[];let a=!1;for(const l of n){const o=wS(l.text);let c=!0;for(const h of o){const m=$i(h)||jp(h),p=c&&a&&!m;t.push({token:h,style:l.style,continuesFromPrevious:p}),a=!m,c=!1}}return t}const BA={willReadFrequently:!0};function ux(n,t,a,l,o){let c=a[n];return typeof c!="number"&&(c=o(n,t,l)+t,a[n]=c),c}function jA(n,t,a,l,o,c,h){const m=a.getContext("2d",BA);m.font=t._fontString;let p=0,y="";const x=[],_=Object.create(null),{letterSpacing:T,whiteSpace:C}=t,M=RS(C),w=zS(C);let z=!M;const D=t.wordWrapWidth+T,N=wS(n);for(let G=0;G<N.length;G++){let k=N[G];if(jp(k)){if(!w){x.push(rr(y)),z=!M,y="",p=0;continue}k=" "}if(M){const Z=$i(k),W=$i(y[y.length-1]);if(Z&&W)continue}const q=ux(k,T,_,m,l);if(q>D)if(y!==""&&(x.push(rr(y)),y="",p=0),o(k,t.breakWords)){const Z=DS(k,t.breakWords,h,c);for(const W of Z){const L=ux(W,T,_,m,l);L+p>D&&(x.push(rr(y)),z=!1,y="",p=0),y+=W,p+=L}}else y.length>0&&(x.push(rr(y)),y="",p=0),x.push(rr(k)),z=!1,y="",p=0;else q+p>D&&(z=!1,x.push(rr(y)),y="",p=0),(y.length>0||!$i(k)||z)&&(y+=k,p+=q)}const j=rr(y);return j.length>0&&x.push(j),x.join(`
309
- `)}const ox={willReadFrequently:!0},dr=class Lt{static get experimentalLetterSpacingSupported(){let t=Lt._experimentalLetterSpacingSupported;if(t===void 0){const a=Ti.get().getCanvasRenderingContext2D().prototype;t=Lt._experimentalLetterSpacingSupported="letterSpacing"in a||"textLetterSpacing"in a}return t}constructor(t,a,l,o,c,h,m,p,y,x){this.text=t,this.style=a,this.width=l,this.height=o,this.lines=c,this.lineWidths=h,this.lineHeight=m,this.maxLineWidth=p,this.fontProperties=y,x&&(this.runsByLine=x.runsByLine,this.lineAscents=x.lineAscents,this.lineDescents=x.lineDescents,this.lineHeights=x.lineHeights,this.hasDropShadow=x.hasDropShadow)}static measureText(t=" ",a,l=Lt._canvas,o=a.wordWrap){var k;const c=`${t}-${a.styleKey}-wordWrap-${o}`;if(Lt._measurementCache.has(c))return Lt._measurementCache.get(c);if(AS(a)&&MS(t)){const q=DA(t,a,o,Lt._context,Lt._measureText,Lt.measureFont,Lt.canBreakChars,Lt.wordWrapSplit),Z=new Lt(t,a,q.width,q.height,q.lines,q.lineWidths,q.lineHeight,q.maxLineWidth,q.fontProperties,{runsByLine:q.runsByLine,lineAscents:q.lineAscents,lineDescents:q.lineDescents,lineHeights:q.lineHeights,hasDropShadow:q.hasDropShadow});return Lt._measurementCache.set(c,Z),Z}const m=a._fontString,p=Lt.measureFont(m);p.fontSize===0&&(p.fontSize=a.fontSize,p.ascent=a.fontSize,p.descent=0);const y=Lt._context;y.font=m;const _=(o?Lt._wordWrap(t,a,l):t).split(RA),T=new Array(_.length);let C=0;for(let q=0;q<_.length;q++){const Z=Lt._measureText(_[q],a.letterSpacing,y);T[q]=Z,C=Math.max(C,Z)}const M=((k=a._stroke)==null?void 0:k.width)??0,w=a.lineHeight||p.fontSize,z=Lt._getAlignWidth(C,a,o),D=Lt._adjustWidthForStyle(z,a),N=Math.max(w,p.fontSize+M)+(_.length-1)*(w+a.leading),j=Lt._adjustHeightForStyle(N,a),G=new Lt(t,a,D,j,_,T,w+a.leading,C,p);return Lt._measurementCache.set(c,G),G}static _adjustWidthForStyle(t,a){var c;const l=((c=a._stroke)==null?void 0:c.width)||0;let o=t+l;return a.dropShadow&&(o+=a.dropShadow.distance),o}static _adjustHeightForStyle(t,a){let l=t;return a.dropShadow&&(l+=a.dropShadow.distance),l}static _getAlignWidth(t,a,l){return l&&a.align!=="left"?Math.max(t,a.wordWrapWidth):t}static _measureText(t,a,l){let o=!1;Lt.experimentalLetterSpacingSupported&&(Lt.experimentalLetterSpacing?(l.letterSpacing=`${a}px`,l.textLetterSpacing=`${a}px`,o=!0):(l.letterSpacing="0px",l.textLetterSpacing="0px"));const c=l.measureText(t);let h=c.width;const m=-(c.actualBoundingBoxLeft??0);let y=(c.actualBoundingBoxRight??0)-m;if(h>0)if(o)h-=a,y-=a;else{const x=(Lt.graphemeSegmenter(t).length-1)*a;h+=x,y+=x}return Math.max(h,y)}static _wordWrap(t,a,l=Lt._canvas){return jA(t,a,l,Lt._measureText,Lt.canBreakWords,Lt.canBreakChars,Lt.wordWrapSplit)}static isBreakingSpace(t,a){return $i(t)}static canBreakWords(t,a){return a}static canBreakChars(t,a,l,o,c){return!0}static wordWrapSplit(t){return Lt.graphemeSegmenter(t)}static measureFont(t){if(Lt._fonts[t])return Lt._fonts[t];const a=Lt._context;a.font=t;const l=a.measureText(Lt.METRICS_STRING+Lt.BASELINE_SYMBOL),o=l.actualBoundingBoxAscent??0,c=l.actualBoundingBoxDescent??0,h={ascent:o,descent:c,fontSize:o+c};return Lt._fonts[t]=h,h}static clearMetrics(t=""){t?delete Lt._fonts[t]:Lt._fonts={}}static get _canvas(){if(!Lt.__canvas){let t;try{const a=new OffscreenCanvas(0,0),l=a.getContext("2d",ox);if(l!=null&&l.measureText)return Lt.__canvas=a,a;t=Ti.get().createCanvas()}catch{t=Ti.get().createCanvas()}t.width=t.height=10,Lt.__canvas=t}return Lt.__canvas}static get _context(){return Lt.__context||(Lt.__context=Lt._canvas.getContext("2d",ox)),Lt.__context}};dr.METRICS_STRING="|ÉqÅ";dr.BASELINE_SYMBOL="M";dr.BASELINE_MULTIPLIER=1.4;dr.HEIGHT_MULTIPLIER=2;dr.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return t=>{const a=n.segment(t),l=[];let o=0;for(const c of a)l[o++]=c.segment;return l}}return n=>[...n]})();dr.experimentalLetterSpacing=!1;dr._fonts={};dr._measurementCache=gA(1e3);let lu=dr;const UA=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function $0(n){const t=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let a=n.fontFamily;Array.isArray(n.fontFamily)||(a=n.fontFamily.split(","));for(let l=a.length-1;l>=0;l--){let o=a[l].trim();!/([\"\'])[^\'\"]+\1/.test(o)&&!UA.includes(o)&&(o=`"${o}"`),a[l]=o}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${t} ${a.join(",")}`}const cx=1e5;function xp(n,t,a,l=0,o=0,c=0){if(n.texture===ze.WHITE&&!n.fill)return zn.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof Fp){const h=n.fill,m=t.createPattern(h.texture.source.resource,"repeat"),p=h.transform.copyTo(le.shared);return p.scale(h.texture.source.pixelWidth,h.texture.source.pixelHeight),m.setTransform(p),m}else if(n.fill instanceof hr){const h=n.fill,m=h.type==="linear",p=h.textureSpace==="local";let y=1,x=1;p&&a&&(y=a.width+l,x=a.height+l);let _,T=!1;if(m){const{start:C,end:M}=h;_=t.createLinearGradient(C.x*y+o,C.y*x+c,M.x*y+o,M.y*x+c),T=Math.abs(M.x-C.x)<Math.abs((M.y-C.y)*.1)}else{const{center:C,innerRadius:M,outerCenter:w,outerRadius:z}=h;_=t.createRadialGradient(C.x*y+o,C.y*x+c,M*y,w.x*y+o,w.y*x+c,z*y)}if(T&&p&&a){const C=a.lineHeight/x;for(let M=0;M<a.lines.length;M++){const w=(M*a.lineHeight+l/2)/x;h.colorStops.forEach(z=>{let D=w+z.offset*C;D=Math.max(0,Math.min(1,D)),_.addColorStop(Math.floor(D*cx)/cx,zn.shared.setValue(z.color).toHex())})}}else h.colorStops.forEach(C=>{_.addColorStop(C.offset,zn.shared.setValue(C.color).toHex())});return _}}else{const h=t.createPattern(n.texture.source.resource,"repeat"),m=n.matrix.copyTo(le.shared);return m.scale(n.texture.source.pixelWidth,n.texture.source.pixelHeight),h.setTransform(m),h}return qa("FillStyle not recognised",n),"red"}const fx=new mn;function Qc(n){let t=0;for(let a=0;a<n.length;a++)n.charCodeAt(a)===32&&t++;return t}class HA{getCanvasAndContext(t){const{text:a,style:l,resolution:o=1}=t,c=l._getFinalPadding(),h=lu.measureText(a||" ",l),m=Math.ceil(Math.ceil(Math.max(1,h.width)+c*2)*o),p=Math.ceil(Math.ceil(Math.max(1,h.height)+c*2)*o),y=I0.getOptimalCanvasAndContext(m,p);this._renderTextToCanvas(l,c,o,y,h);const x=l.trim?pA({canvas:y.canvas,width:m,height:p,resolution:1,output:fx}):fx.set(0,0,m,p);return{canvasAndContext:y,frame:x}}returnCanvasAndContext(t){I0.returnCanvasAndContext(t)}_renderTextToCanvas(t,a,l,o,c){var q,Z,W;if(c.runsByLine&&c.runsByLine.length>0){this._renderTaggedTextToCanvas(c,t,a,l,o);return}const{canvas:h,context:m}=o,p=$0(t),y=c.lines,x=c.lineHeight,_=c.lineWidths,T=c.maxLineWidth,C=c.fontProperties,M=h.height;if(m.resetTransform(),m.scale(l,l),m.textBaseline=t.textBaseline,(q=t._stroke)!=null&&q.width){const L=t._stroke;m.lineWidth=L.width,m.miterLimit=L.miterLimit,m.lineJoin=L.join,m.lineCap=L.cap}m.font=p;let w,z;const D=t.dropShadow?2:1,N=t.wordWrap?t.wordWrapWidth:T,G=(((Z=t._stroke)==null?void 0:Z.width)??0)/2;let k=(x-C.fontSize)/2;x-C.fontSize<0&&(k=0);for(let L=0;L<D;++L){const $=t.dropShadow&&L===0,et=$?Math.ceil(Math.max(1,M)+a*2):0,ct=et*l;if($)this._setupDropShadow(m,t,l,ct);else{const vt=t._gradientBounds,dt=t._gradientOffset;if(vt){const St={width:vt.width,height:vt.height,lineHeight:vt.height,lines:c.lines};this._setFillAndStrokeStyles(m,t,St,a,G,(dt==null?void 0:dt.x)??0,(dt==null?void 0:dt.y)??0)}else dt?this._setFillAndStrokeStyles(m,t,c,a,G,dt.x,dt.y):this._setFillAndStrokeStyles(m,t,c,a,G);m.shadowColor="rgba(0,0,0,0)"}for(let vt=0;vt<y.length;vt++){w=G,z=G+vt*x+C.ascent+k,w+=this._getAlignmentOffset(_[vt],N,t.align);let dt=0;if(t.align==="justify"&&t.wordWrap&&vt<y.length-1){const St=Qc(y[vt]);St>0&&(dt=(N-_[vt])/St)}(W=t._stroke)!=null&&W.width&&this._drawLetterSpacing(y[vt],t,o,w+a,z+a-et,!0,dt),t._fill!==void 0&&this._drawLetterSpacing(y[vt],t,o,w+a,z+a-et,!1,dt)}}}_renderTaggedTextToCanvas(t,a,l,o,c){var G,k,q;const{canvas:h,context:m}=c,{runsByLine:p,lineWidths:y,maxLineWidth:x,lineAscents:_,lineHeights:T,hasDropShadow:C}=t,M=h.height;m.resetTransform(),m.scale(o,o),m.textBaseline=a.textBaseline;const w=C?2:1,z=a.wordWrap?a.wordWrapWidth:x;let D=((G=a._stroke)==null?void 0:G.width)??0;for(const Z of p)for(const W of Z){const L=((k=W.style._stroke)==null?void 0:k.width)??0;L>D&&(D=L)}const N=D/2,j=[];for(let Z=0;Z<p.length;Z++){const W=p[Z],L=[];for(const $ of W){const et=$0($.style);m.font=et,L.push({width:lu._measureText($.text,$.style.letterSpacing,m),font:et})}j.push(L)}for(let Z=0;Z<w;++Z){const W=C&&Z===0,L=W?Math.ceil(Math.max(1,M)+l*2):0,$=L*o;W||(m.shadowColor="rgba(0,0,0,0)");let et=N;for(let ct=0;ct<p.length;ct++){const vt=p[ct],dt=y[ct],St=_[ct],H=T[ct],Q=j[ct];let ot=N;ot+=this._getAlignmentOffset(dt,z,a.align);let rt=0;if(a.align==="justify"&&a.wordWrap&&ct<p.length-1){let F=0;for(const tt of vt)F+=Qc(tt.text);F>0&&(rt=(z-dt)/F)}const gt=et+St;let U=ot+l;for(let F=0;F<vt.length;F++){const tt=vt[F],{width:pt,font:_t}=Q[F];if(m.font=_t,m.textBaseline=tt.style.textBaseline,(q=tt.style._stroke)!=null&&q.width){const Ot=tt.style._stroke;if(m.lineWidth=Ot.width,m.miterLimit=Ot.miterLimit,m.lineJoin=Ot.join,m.lineCap=Ot.cap,W)if(tt.style.dropShadow)this._setupDropShadow(m,tt.style,o,$);else{const fe=Qc(tt.text);U+=pt+fe*rt;continue}else{const fe=lu.measureFont(_t),ce=tt.style.lineHeight||fe.fontSize,ga={width:pt,height:ce,lineHeight:ce,lines:[tt.text]};m.strokeStyle=xp(Ot,m,ga,l*2,U-l,et)}this._drawLetterSpacing(tt.text,tt.style,c,U,gt+l-L,!0,rt)}const At=Qc(tt.text);U+=pt+At*rt}U=ot+l;for(let F=0;F<vt.length;F++){const tt=vt[F],{width:pt,font:_t}=Q[F];if(m.font=_t,m.textBaseline=tt.style.textBaseline,tt.style._fill!==void 0){if(W)if(tt.style.dropShadow)this._setupDropShadow(m,tt.style,o,$);else{const Ot=Qc(tt.text);U+=pt+Ot*rt;continue}else{const Ot=lu.measureFont(_t),fe=tt.style.lineHeight||Ot.fontSize,ce={width:pt,height:fe,lineHeight:fe,lines:[tt.text]};m.fillStyle=xp(tt.style._fill,m,ce,l*2,U-l,et)}this._drawLetterSpacing(tt.text,tt.style,c,U,gt+l-L,!1,rt)}const At=Qc(tt.text);U+=pt+At*rt}et+=H}}}_setFillAndStrokeStyles(t,a,l,o,c,h=0,m=0){var p;if(t.fillStyle=a._fill?xp(a._fill,t,l,o*2,h,m):null,(p=a._stroke)!=null&&p.width){const y=c+o*2;t.strokeStyle=xp(a._stroke,t,l,y,h,m)}}_setupDropShadow(t,a,l,o){t.fillStyle="black",t.strokeStyle="black";const c=a.dropShadow,h=c.color,m=c.alpha;t.shadowColor=zn.shared.setValue(h).setAlpha(m).toRgbaString();const p=c.blur*l,y=c.distance*l;t.shadowBlur=p,t.shadowOffsetX=Math.cos(c.angle)*y,t.shadowOffsetY=Math.sin(c.angle)*y+o}_getAlignmentOffset(t,a,l){return l==="right"?a-t:l==="center"?(a-t)/2:0}_drawLetterSpacing(t,a,l,o,c,h=!1,m=0){const{context:p}=l,y=a.letterSpacing;let x=!1;if(lu.experimentalLetterSpacingSupported&&(lu.experimentalLetterSpacing?(p.letterSpacing=`${y}px`,p.textLetterSpacing=`${y}px`,x=!0):(p.letterSpacing="0px",p.textLetterSpacing="0px")),(y===0||x)&&m===0){h?p.strokeText(t,o,c):p.fillText(t,o,c);return}if(m!==0&&(y===0||x)){const w=t.split(" ");let z=o;const D=p.measureText(" ").width;for(let N=0;N<w.length;N++)h?p.strokeText(w[N],z,c):p.fillText(w[N],z,c),z+=p.measureText(w[N]).width+D+m;return}let _=o;const T=lu.graphemeSegmenter(t);let C=p.measureText(t).width,M=0;for(let w=0;w<T.length;++w){const z=T[w];h?p.strokeText(z,_,c):p.fillText(z,_,c);let D="";for(let N=w+1;N<T.length;++N)D+=T[N];M=p.measureText(D).width,_+=C-M+y,z===" "&&(_+=m),C=M}}}const Ic=new HA,Mg=class xo extends _s{constructor(t={}){super(),this.uid=on("textStyle"),this._tick=0,this._cachedFontString=null,GA(t),t instanceof xo&&(t=t._toObject());const o={...xo.defaultTextStyle,...t};for(const c in o){const h=c;this[h]=o[c]}this._tagStyles=t.tagStyles??void 0,this.update(),this._tick=0}get align(){return this._align}set align(t){this._align!==t&&(this._align=t,this.update())}get breakWords(){return this._breakWords}set breakWords(t){this._breakWords!==t&&(this._breakWords=t,this.update())}get dropShadow(){return this._dropShadow}set dropShadow(t){this._dropShadow!==t&&(t!==null&&typeof t=="object"?this._dropShadow=this._createProxy({...xo.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...xo.defaultDropShadow}):null,this.update())}get fontFamily(){return this._fontFamily}set fontFamily(t){this._fontFamily!==t&&(this._fontFamily=t,this.update())}get fontSize(){return this._fontSize}set fontSize(t){this._fontSize!==t&&(typeof t=="string"?this._fontSize=parseInt(t,10):this._fontSize=t,this.update())}get fontStyle(){return this._fontStyle}set fontStyle(t){this._fontStyle!==t&&(this._fontStyle=t.toLowerCase(),this.update())}get fontVariant(){return this._fontVariant}set fontVariant(t){this._fontVariant!==t&&(this._fontVariant=t,this.update())}get fontWeight(){return this._fontWeight}set fontWeight(t){this._fontWeight!==t&&(this._fontWeight=t,this.update())}get leading(){return this._leading}set leading(t){this._leading!==t&&(this._leading=t,this.update())}get letterSpacing(){return this._letterSpacing}set letterSpacing(t){this._letterSpacing!==t&&(this._letterSpacing=t,this.update())}get lineHeight(){return this._lineHeight}set lineHeight(t){this._lineHeight!==t&&(this._lineHeight=t,this.update())}get padding(){return this._padding}set padding(t){this._padding!==t&&(this._padding=t,this.update())}get filters(){return this._filters}set filters(t){this._filters!==t&&(this._filters=Object.freeze(t),this.update())}get trim(){return this._trim}set trim(t){this._trim!==t&&(this._trim=t,this.update())}get textBaseline(){return this._textBaseline}set textBaseline(t){this._textBaseline!==t&&(this._textBaseline=t,this.update())}get whiteSpace(){return this._whiteSpace}set whiteSpace(t){this._whiteSpace!==t&&(this._whiteSpace=t,this.update())}get wordWrap(){return this._wordWrap}set wordWrap(t){this._wordWrap!==t&&(this._wordWrap=t,this.update())}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(t){this._wordWrapWidth!==t&&(this._wordWrapWidth=t,this.update())}get fill(){return this._originalFill}set fill(t){t!==this._originalFill&&(this._originalFill=t,this._isFillStyle(t)&&(this._originalFill=this._createProxy({...Dl.defaultFillStyle,...t},()=>{this._fill=So({...this._originalFill},Dl.defaultFillStyle)})),this._fill=So(t===0?"black":t,Dl.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...Dl.defaultStrokeStyle,...t},()=>{this._stroke=Bp({...this._originalStroke},Dl.defaultStrokeStyle)})),this._stroke=Bp(t,Dl.defaultStrokeStyle),this.update())}get tagStyles(){return this._tagStyles}set tagStyles(t){this._tagStyles!==t&&(this._tagStyles=t??void 0,this.update())}update(){this._tick++,this._cachedFontString=null,this.emit("update",this)}reset(){const t=xo.defaultTextStyle;for(const a in t)this[a]=t[a]}assign(t){for(const a in t){const l=a;this[l]=t[a]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=$0(this)),this._cachedFontString}_toObject(){return{align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill?{...this._fill}:void 0,fontFamily:this.fontFamily,fontSize:this.fontSize,fontStyle:this.fontStyle,fontVariant:this.fontVariant,fontWeight:this.fontWeight,leading:this.leading,letterSpacing:this.letterSpacing,lineHeight:this.lineHeight,padding:this.padding,stroke:this._stroke?{...this._stroke}:void 0,textBaseline:this.textBaseline,trim:this.trim,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0,tagStyles:this._tagStyles?{...this._tagStyles}:void 0}}clone(){return new xo(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let a=0;a<this._filters.length;a++)t+=this._filters[a].padding;return Math.max(this._padding,t)}destroy(t=!1){var l,o,c,h;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const m=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(l=this._fill)!=null&&l.texture&&this._fill.texture.destroy(m),(o=this._originalFill)!=null&&o.texture&&this._originalFill.texture.destroy(m),(c=this._stroke)!=null&&c.texture&&this._stroke.texture.destroy(m),(h=this._originalStroke)!=null&&h.texture&&this._originalStroke.texture.destroy(m)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,a){return new Proxy(t,{set:(l,o,c)=>(l[o]===c||(l[o]=c,a==null||a(o,c),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(zn.isColorLike(t)||t instanceof hr||t instanceof Fp)}};Mg.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Mg.defaultTextStyle={align:"left",breakWords:!1,dropShadow:null,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,padding:0,stroke:null,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let To=Mg;function GA(n){const t=n;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const a=To.defaultDropShadow;n.dropShadow={alpha:t.dropShadowAlpha??a.alpha,angle:t.dropShadowAngle??a.angle,blur:t.dropShadowBlur??a.blur,color:t.dropShadowColor??a.color,distance:t.dropShadowDistance??a.distance}}if(t.strokeThickness!==void 0){de(un,"strokeThickness is now a part of stroke");const a=t.stroke;let l={};if(zn.isColorLike(a))l.color=a;else if(a instanceof hr||a instanceof Fp)l.fill=a;else if(Object.hasOwnProperty.call(a,"color")||Object.hasOwnProperty.call(a,"fill"))l=a;else throw new Error("Invalid stroke value.");n.stroke={...l,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(de(un,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(t.fill)||t.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");t.fill.length!==t.fillGradientStops.length&&qa("The number of fill colors must match the number of fill gradient stops.");const a=new hr({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),l=t.fillGradientStops.slice(),o=t.fill.map(c=>zn.shared.setValue(c).toNumber());l.forEach((c,h)=>{a.addColorStop(c,o[h])}),n.fill={fill:a}}}function YA(n,t){const{texture:a,bounds:l}=n,o=t._style._getFinalPadding();gb(l,t._anchor,a);const c=t._anchor._x*o*2,h=t._anchor._y*o*2;l.minX-=o-c,l.minY-=o-h,l.maxX-=o-c,l.maxY-=o-h}class qA{constructor(){this.batcherName="default",this.topology="triangle-list",this.attributeSize=4,this.indexSize=6,this.packAsQuad=!0,this.roundPixels=0,this._attributeStart=0,this._batcher=null,this._batch=null}get blendMode(){return this.renderable.groupBlendMode}get color(){return this.renderable.groupColorAlpha}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.bounds=null}destroy(){this.reset()}}class LA extends qA{}class OS{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new Td({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const a=this._managedTexts.items[t];a!=null&&a._autoResolution&&a.onViewUpdate()}}validateRenderable(t){const a=this._getGpuText(t),l=t.styleKey;return a.currentKey!==l?!0:t._didTextUpdate}addRenderable(t,a){const l=this._getGpuText(t);if(t._didTextUpdate){const o=t._autoResolution?this._renderer.resolution:t.resolution;(l.currentKey!==t.styleKey||t._resolution!==o)&&this._updateGpuText(t),t._didTextUpdate=!1,YA(l,t)}this._renderer.renderPipes.batch.addToBatch(l,a)}updateRenderable(t){const a=this._getGpuText(t);a._batcher.updateElement(a)}_updateGpuText(t){const a=this._getGpuText(t);a.texture&&this._renderer.canvasText.decreaseReferenceCount(a.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,a.texture=this._renderer.canvasText.getManagedTexture(t),a.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const a=new LA;return a.currentKey="--",a.renderable=t,a.transform=t.groupTransform,a.bounds={minX:0,maxX:1,minY:0,maxY:0},a.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=a,this._managedTexts.add(t),a}onTextUnload(t){const a=t._gpuData[this._renderer.uid];if(!a)return;const{canvasText:l}=this._renderer;l.getReferenceCount(a.currentKey)>0?l.decreaseReferenceCount(a.currentKey):a.texture&&l.returnTexture(a.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}OS.extension={type:[Jt.WebGLPipes,Jt.WebGPUPipes,Jt.CanvasPipes],name:"text"};const XA=new tl;function VA(n,t,a,l,o=!1){const c=XA;c.minX=0,c.minY=0,c.maxX=n.width/l|0,c.maxY=n.height/l|0;const h=kp.getOptimalTexture(c.width,c.height,l,!1,o);return h.source.uploadMethodId="image",h.source.resource=n,h.source.alphaMode="premultiply-alpha-on-upload",h.frame.width=t/l,h.frame.height=a/l,h.source.emit("update",h.source),h.updateUvs(),h}class NS{constructor(t,a){this._activeTextures={},this._renderer=t,this._retainCanvasContext=a}getTexture(t,a,l,o){typeof t=="string"&&(de("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:l,resolution:a}),t.style instanceof To||(t.style=new To(t.style)),t.textureStyle instanceof lf||(t.textureStyle=new lf(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());const{text:c,style:h,textureStyle:m,autoGenerateMipmaps:p}=t,y=t.resolution??this._renderer.resolution,{frame:x,canvasAndContext:_}=Ic.getCanvasAndContext({text:c,style:h,resolution:y}),T=VA(_.canvas,x.width,x.height,y,p);if(m&&(T.source.style=m),h.trim&&(x.pad(h.padding),T.frame.copyFrom(x),T.frame.scale(1/y),T.updateUvs()),h.filters){const C=this._applyFilters(T,h.filters);return this.returnTexture(T),Ic.returnCanvasAndContext(_),C}return this._renderer.texture.initSource(T._source),this._retainCanvasContext||Ic.returnCanvasAndContext(_),T}returnTexture(t){const a=t.source,l=a.resource;if(this._retainCanvasContext&&(l!=null&&l.getContext)){const o=l.getContext("2d");o&&Ic.returnCanvasAndContext({canvas:l,context:o})}a.resource=null,a.uploadMethodId="unknown",a.alphaMode="no-premultiply-alpha",kp.returnTexture(t,!0)}renderTextToCanvas(){de("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const a=t.styleKey;if(this._activeTextures[a])return this._increaseReferenceCount(a),this._activeTextures[a].texture;const l=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[a]={texture:l,usageCount:1},l}decreaseReferenceCount(t){const a=this._activeTextures[t];a&&(a.usageCount--,a.usageCount===0&&(this.returnTexture(a.texture),this._activeTextures[t]=null))}getReferenceCount(t){var a;return((a=this._activeTextures[t])==null?void 0:a.usageCount)??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,a){const l=this._renderer.renderTarget.renderTarget,o=this._renderer.filter.generateFilteredTexture({texture:t,filters:a});return this._renderer.renderTarget.bind(l,!1),o}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class BS extends NS{constructor(t){super(t,!0)}}BS.extension={type:[Jt.CanvasSystem],name:"canvasText"};class jS extends NS{constructor(t){super(t,!1)}}jS.extension={type:[Jt.WebGLSystem,Jt.WebGPUSystem],name:"canvasText"};Ie.add(BS);Ie.add(jS);Ie.add(OS);class Wp extends fA{constructor(...t){const a=hA(t,"Text");super(a,To),this.renderPipeId="text",a.textureStyle&&(this.textureStyle=a.textureStyle instanceof lf?a.textureStyle:new lf(a.textureStyle)),this.autoGenerateMipmaps=a.autoGenerateMipmaps??el.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,a=this._anchor;let l=0,o=0;if(this._style.trim){const{frame:c,canvasAndContext:h}=Ic.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Ic.returnCanvasAndContext(h),l=c.width,o=c.height}else{const c=lu.measureText(this._text,this._style);l=c.width,o=c.height}t.minX=-a._x*l,t.maxX=t.minX+l,t.minY=-a._y*o,t.maxY=t.minY+o}}Ie.add(p3,y3);var v0={exports:{}},lr={};/**
310
- * @license React
311
- * react-reconciler-constants.production.js
312
- *
313
- * Copyright (c) Meta Platforms, Inc. and affiliates.
314
- *
315
- * This source code is licensed under the MIT license found in the
316
- * LICENSE file in the root directory of this source tree.
317
- */var hx;function kA(){return hx||(hx=1,lr.ConcurrentRoot=1,lr.ContinuousEventPriority=8,lr.DefaultEventPriority=32,lr.DiscreteEventPriority=2,lr.IdleEventPriority=268435456,lr.LegacyRoot=0,lr.NoEventPriority=0),lr}var dx;function QA(){return dx||(dx=1,v0.exports=kA()),v0.exports}var $c=QA();const Rg=Y.createContext({}),KA=Rg.Provider;Rg.Consumer;function US(n,t){const a=Object.getPrototypeOf(n),l=Object.getOwnPropertyDescriptor(a,t);return!(typeof l>"u"||l.writable||l.set)}const uu={currentUpdatePriority:$c.DefaultEventPriority,unmountQueue:new Set};function mx(n,...t){}function HS(n,t={}){const a=n;return a.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},t),a}var ZA="0.0.0-development",FA={version:ZA};function WA(){}function GS(n,t,a){t instanceof Co&&(t.__pixireact.parent=n,typeof a=="number"?n.__pixireact.filters.splice(a,0,t):n.__pixireact.filters.push(t),n.filters=n.__pixireact.filters)}function x0(n,t){t&&(t instanceof $n?n.addChild(t):t instanceof Co&&GS(n,t))}function JA(){}function PA(){return!1}const tg=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),Up=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function YS(n){return Array.isArray(n)}function qS(n,t,a={arrays:"reference",objects:"reference",strict:!0}){const{arrays:l,objects:o,strict:c}=a;if(typeof n!=typeof t||!!n!=!!t)return!1;if(e5(n)||$A(n))return n===t;const h=t5(n);if(h&&o==="reference")return n===t;const m=YS(n);if(m&&l==="reference")return n===t;if((m||h)&&n===t)return!0;let p;for(p in n)if(!(p in t))return!1;let y=n;if(c&&(y=t),h&&l==="shallow"&&o==="shallow"){for(p in y)if(!qS(n[p],t[p],{strict:c,objects:"reference"}))return!1}else for(p in y)if(n[p]!==t[p])return!1;if(LS(p)){if(m&&n.length===0&&t.length===0||h&&Object.keys(n).length===0&&Object.keys(t).length===0)return!0;if(n!==t)return!1}return!0}function IA(n){return n===null}function $A(n){return typeof n=="number"}function t5(n){return!(n!==Object(n)||YS(n)||typeof n=="function")}function e5(n){return typeof n=="string"}function LS(n){return n===void 0}const n5=Object.freeze(["children","key","ref"]);function a5(n,t=[]){const a={};return Object.entries(n).reduce((l,[o,c])=>(t.includes(o)||(l[o]=c),l),a)}function eg(n,t=[]){return a5(n,n5.concat(t))}const i5="__default";function XS(n,t={},a=!1){const l=eg(n),o=eg(t),c=Object.entries(l),h=[];if(a){const m=Object.keys(o);let p=0;for(;p<m.length;){const y=m[p];!(y in l)&&c.unshift([y,`${i5}remove`]),p+=1}}return c.forEach(([m,p])=>{if(qS(p,o[m]))return;if(m in Up){h.push([m,p,!0,[]]);return}let y=[];m.includes("-")&&(y=m.split("-")),h.push([m,p,!1,y]);for(const x in l){const _=l[x];x.startsWith(`${m}-`)&&h.push([x,_,!1,x.split("-")])}}),{changes:h}}function l5(n){const t=n;return!(!t||!t.changes)}const s5="__default",px=new Map,yx={};function gx(n,t){if(n){const a=n[t];if(!LS(a)&&!IA(a))return a}return n}function VS(n,t){const{__pixireact:a={},...l}=n;let o;l5(t)?o=t:o=XS(t,l);const{changes:c}=o;let h=0;for(;h<c.length;){const m=c[h];let p=!1,y=m[0],x=m[1];const _=m[2],T=m[3];let C=n,M=C[y];if(y==="draw"&&typeof x=="function"&&(n instanceof ai?x(n):(p=!0,mx("warn",`The \`draw\` prop was used on a \`${a.type}\` component, but it's only valid on \`graphics\` components.`))),y in tg){const w=y;p=!0,yx[y]||(yx[y]=!0,mx("warn",`Event names must be pascal case; instead of \`${y}\`, you probably want \`${tg[w]}\`.`))}if(!p){if(T.length&&(M=T.reduce(gx,C),!(M&&M.set))){const[w,...z]=T.reverse();C=z.reverse().reduce(gx,C),y=w}if(x===`${s5}remove`)if(C instanceof $n){let w=px.get(C.constructor);w||(w=C.constructor,w=new w,px.set(C.constructor,w)),x=w[y]}else x=0;if(_&&a){const z=Up[y];x?C[z]=x:delete C[z]}else US(C,y)||(C[y]=x)}h+=1}return n}function r5(n,t,a,l){const{children:o,...c}=l,{children:h,...m}=a,p=XS(c,m,!0);return p.changes.length?p:null}function u5(n,t,a,l){const o=r5(n,t,a,l);o&&VS(n,o)}const o5=Object.freeze([...Object.keys(tg),"draw"]),ng={};function c5(n){const t=n.charAt(0),a=n.substring(1);return`${t.toUpperCase()}${a}`}function f5(n,t){return t.toLowerCase()}function h5(n){let t=n;return n.startsWith("pixi")&&(t=n.replace(/^pixi([A-Z])/,f5)),t}function d5(n,t,a){const l=h5(n),o=c5(l);if(!(o in ng))throw new Error(`${o} is not part of the PIXI namespace! Did you forget to extend?`);const c=ng[o],h=eg(t,o5);Object.entries(t).forEach(([p,y])=>{if(p in Up){const x=Up[p];h[x]=y}});const m=HS(new c(h),{root:a,type:l});return VS(m,t),m}var b0={exports:{}},S0={exports:{}},_0={exports:{}},T0={};/**
318
- * @license React
319
- * scheduler.production.js
320
- *
321
- * Copyright (c) Meta Platforms, Inc. and affiliates.
322
- *
323
- * This source code is licensed under the MIT license found in the
324
- * LICENSE file in the root directory of this source tree.
325
- */var vx;function m5(){return vx||(vx=1,(function(n){function t(H,Q){var ot=H.length;H.push(Q);t:for(;0<ot;){var rt=ot-1>>>1,gt=H[rt];if(0<o(gt,Q))H[rt]=Q,H[ot]=gt,ot=rt;else break t}}function a(H){return H.length===0?null:H[0]}function l(H){if(H.length===0)return null;var Q=H[0],ot=H.pop();if(ot!==Q){H[0]=ot;t:for(var rt=0,gt=H.length,U=gt>>>1;rt<U;){var F=2*(rt+1)-1,tt=H[F],pt=F+1,_t=H[pt];if(0>o(tt,ot))pt<gt&&0>o(_t,tt)?(H[rt]=_t,H[pt]=ot,rt=pt):(H[rt]=tt,H[F]=ot,rt=F);else if(pt<gt&&0>o(_t,ot))H[rt]=_t,H[pt]=ot,rt=pt;else break t}}return Q}function o(H,Q){var ot=H.sortIndex-Q.sortIndex;return ot!==0?ot:H.id-Q.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var h=Date,m=h.now();n.unstable_now=function(){return h.now()-m}}var p=[],y=[],x=1,_=null,T=3,C=!1,M=!1,w=!1,z=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function j(H){for(var Q=a(y);Q!==null;){if(Q.callback===null)l(y);else if(Q.startTime<=H)l(y),Q.sortIndex=Q.expirationTime,t(p,Q);else break;Q=a(y)}}function G(H){if(w=!1,j(H),!M)if(a(p)!==null)M=!0,dt();else{var Q=a(y);Q!==null&&St(G,Q.startTime-H)}}var k=!1,q=-1,Z=5,W=-1;function L(){return!(n.unstable_now()-W<Z)}function $(){if(k){var H=n.unstable_now();W=H;var Q=!0;try{t:{M=!1,w&&(w=!1,D(q),q=-1),C=!0;var ot=T;try{e:{for(j(H),_=a(p);_!==null&&!(_.expirationTime>H&&L());){var rt=_.callback;if(typeof rt=="function"){_.callback=null,T=_.priorityLevel;var gt=rt(_.expirationTime<=H);if(H=n.unstable_now(),typeof gt=="function"){_.callback=gt,j(H),Q=!0;break e}_===a(p)&&l(p),j(H)}else l(p);_=a(p)}if(_!==null)Q=!0;else{var U=a(y);U!==null&&St(G,U.startTime-H),Q=!1}}break t}finally{_=null,T=ot,C=!1}Q=void 0}}finally{Q?et():k=!1}}}var et;if(typeof N=="function")et=function(){N($)};else if(typeof MessageChannel<"u"){var ct=new MessageChannel,vt=ct.port2;ct.port1.onmessage=$,et=function(){vt.postMessage(null)}}else et=function(){z($,0)};function dt(){k||(k=!0,et())}function St(H,Q){q=z(function(){H(n.unstable_now())},Q)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(H){H.callback=null},n.unstable_continueExecution=function(){M||C||(M=!0,dt())},n.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<H?Math.floor(1e3/H):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_getFirstCallbackNode=function(){return a(p)},n.unstable_next=function(H){switch(T){case 1:case 2:case 3:var Q=3;break;default:Q=T}var ot=T;T=Q;try{return H()}finally{T=ot}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(H,Q){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ot=T;T=H;try{return Q()}finally{T=ot}},n.unstable_scheduleCallback=function(H,Q,ot){var rt=n.unstable_now();switch(typeof ot=="object"&&ot!==null?(ot=ot.delay,ot=typeof ot=="number"&&0<ot?rt+ot:rt):ot=rt,H){case 1:var gt=-1;break;case 2:gt=250;break;case 5:gt=1073741823;break;case 4:gt=1e4;break;default:gt=5e3}return gt=ot+gt,H={id:x++,callback:Q,priorityLevel:H,startTime:ot,expirationTime:gt,sortIndex:-1},ot>rt?(H.sortIndex=ot,t(y,H),a(p)===null&&H===a(y)&&(w?(D(q),q=-1):w=!0,St(G,ot-rt))):(H.sortIndex=gt,t(p,H),M||C||(M=!0,dt())),H},n.unstable_shouldYield=L,n.unstable_wrapCallback=function(H){var Q=T;return function(){var ot=T;T=Q;try{return H.apply(this,arguments)}finally{T=ot}}}})(T0)),T0}var xx;function p5(){return xx||(xx=1,_0.exports=m5()),_0.exports}/**
326
- * @license React
327
- * react-reconciler.production.js
328
- *
329
- * Copyright (c) Meta Platforms, Inc. and affiliates.
330
- *
331
- * This source code is licensed under the MIT license found in the
332
- * LICENSE file in the root directory of this source tree.
333
- */var bx;function y5(){return bx||(bx=1,(function(n){n.exports=function(t){function a(s,r,d,v){return new Kf(s,r,d,v)}function l(){}function o(s){var r="https://react.dev/errors/"+s;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)r+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+s+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function c(s){return s===null||typeof s!="object"?null:(s=$f&&s[$f]||s["@@iterator"],typeof s=="function"?s:null)}function h(s){if(s==null)return null;if(typeof s=="function")return s.$$typeof===Xs?null:s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case jr:return"Fragment";case fi:return"Portal";case If:return"Profiler";case Pf:return"StrictMode";case oc:return"Suspense";case as:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case Ui:return(s.displayName||"Context")+".Provider";case ns:return(s._context.displayName||"Context")+".Consumer";case Ur:var r=s.render;return s=s.displayName,s||(s=r.displayName||r.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case qu:return r=s.displayName||null,r!==null?r:h(s.type)||"Memo";case hi:r=s._payload,s=s._init;try{return h(s(r))}catch{}}return null}function m(s){if(cc===void 0)try{throw Error()}catch(d){var r=d.stack.trim().match(/\n( *(at )?)/);cc=r&&r[1]||"",th=-1<d.stack.indexOf(`
334
- at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
335
- `+cc+s+th}function p(s,r){if(!s||is)return"";is=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var v={DetermineComponentFrameRoot:function(){try{if(r){var Tt=function(){throw Error()};if(Object.defineProperty(Tt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Tt,[])}catch(qt){var Et=qt}Reflect.construct(s,[],Tt)}else{try{Tt.call()}catch(qt){Et=qt}s.call(Tt.prototype)}}else{try{throw Error()}catch(qt){Et=qt}(Tt=s())&&typeof Tt.catch=="function"&&Tt.catch(function(){})}}catch(qt){if(qt&&Et&&typeof qt.stack=="string")return[qt.stack,Et.stack]}return[null,null]}};v.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(v.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(v.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=v.DetermineComponentFrameRoot(),B=E[0],X=E[1];if(B&&X){var I=B.split(`
336
- `),ht=X.split(`
337
- `);for(S=v=0;v<I.length&&!I[v].includes("DetermineComponentFrameRoot");)v++;for(;S<ht.length&&!ht[S].includes("DetermineComponentFrameRoot");)S++;if(v===I.length||S===ht.length)for(v=I.length-1,S=ht.length-1;1<=v&&0<=S&&I[v]!==ht[S];)S--;for(;1<=v&&0<=S;v--,S--)if(I[v]!==ht[S]){if(v!==1||S!==1)do if(v--,S--,0>S||I[v]!==ht[S]){var bt=`
338
- `+I[v].replace(" at new "," at ");return s.displayName&&bt.includes("<anonymous>")&&(bt=bt.replace("<anonymous>",s.displayName)),bt}while(1<=v&&0<=S);break}}}finally{is=!1,Error.prepareStackTrace=d}return(d=s?s.displayName||s.name:"")?m(d):""}function y(s){switch(s.tag){case 26:case 27:case 5:return m(s.type);case 16:return m("Lazy");case 13:return m("Suspense");case 19:return m("SuspenseList");case 0:case 15:return s=p(s.type,!1),s;case 11:return s=p(s.type.render,!1),s;case 1:return s=p(s.type,!0),s;default:return""}}function x(s){try{var r="";do r+=y(s),s=s.return;while(s);return r}catch(d){return`
339
- Error generating stack: `+d.message+`
340
- `+d.stack}}function _(s){var r=s,d=s;if(s.alternate)for(;r.return;)r=r.return;else{s=r;do r=s,(r.flags&4098)!==0&&(d=r.return),s=r.return;while(s)}return r.tag===3?d:null}function T(s){if(_(s)!==s)throw Error(o(188))}function C(s){var r=s.alternate;if(!r){if(r=_(s),r===null)throw Error(o(188));return r!==s?null:s}for(var d=s,v=r;;){var S=d.return;if(S===null)break;var E=S.alternate;if(E===null){if(v=S.return,v!==null){d=v;continue}break}if(S.child===E.child){for(E=S.child;E;){if(E===d)return T(S),s;if(E===v)return T(S),r;E=E.sibling}throw Error(o(188))}if(d.return!==v.return)d=S,v=E;else{for(var B=!1,X=S.child;X;){if(X===d){B=!0,d=S,v=E;break}if(X===v){B=!0,v=S,d=E;break}X=X.sibling}if(!B){for(X=E.child;X;){if(X===d){B=!0,d=E,v=S;break}if(X===v){B=!0,v=E,d=S;break}X=X.sibling}if(!B)throw Error(o(189))}}if(d.alternate!==v)throw Error(o(190))}if(d.tag!==3)throw Error(o(188));return d.stateNode.current===d?s:r}function M(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(r=M(s),r!==null)return r;s=s.sibling}return null}function w(s){var r=s.tag;if(r===5||r===26||r===27||r===6)return s;for(s=s.child;s!==null;){if(s.tag!==4&&(r=w(s),r!==null))return r;s=s.sibling}return null}function z(s){return{current:s}}function D(s){0>xl||(s.current=Wu[xl],Wu[xl]=null,xl--)}function N(s,r){xl++,Wu[xl]=s.current,s.current=r}function j(s){return s>>>=0,s===0?32:31-(Ju(s)/wm|0)|0}function G(s){var r=s&42;if(r!==0)return r;switch(s&-s){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return s&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return s}}function k(s,r){var d=s.pendingLanes;if(d===0)return 0;var v=0,S=s.suspendedLanes,E=s.pingedLanes,B=s.warmLanes;s=s.finishedLanes!==0;var X=d&134217727;return X!==0?(d=X&~S,d!==0?v=G(d):(E&=X,E!==0?v=G(E):s||(B=X&~B,B!==0&&(v=G(B))))):(X=d&~S,X!==0?v=G(X):E!==0?v=G(E):s||(B=d&~B,B!==0&&(v=G(B)))),v===0?0:r!==0&&r!==v&&(r&S)===0&&(S=v&-v,B=r&-r,S>=B||S===32&&(B&4194176)!==0)?r:v}function q(s,r){return(s.pendingLanes&~(s.suspendedLanes&~s.pingedLanes)&r)===0}function Z(s,r){switch(s){case 1:case 2:case 4:case 8:return r+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function W(){var s=qr;return qr<<=1,(qr&4194176)===0&&(qr=128),s}function L(){var s=Pu;return Pu<<=1,(Pu&62914560)===0&&(Pu=4194304),s}function $(s){for(var r=[],d=0;31>d;d++)r.push(s);return r}function et(s,r){s.pendingLanes|=r,r!==268435456&&(s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0)}function ct(s,r,d,v,S,E){var B=s.pendingLanes;s.pendingLanes=d,s.suspendedLanes=0,s.pingedLanes=0,s.warmLanes=0,s.expiredLanes&=d,s.entangledLanes&=d,s.errorRecoveryDisabledLanes&=d,s.shellSuspendCounter=0;var X=s.entanglements,I=s.expirationTimes,ht=s.hiddenUpdates;for(d=B&~d;0<d;){var bt=31-ra(d),Tt=1<<bt;X[bt]=0,I[bt]=-1;var Et=ht[bt];if(Et!==null)for(ht[bt]=null,bt=0;bt<Et.length;bt++){var qt=Et[bt];qt!==null&&(qt.lane&=-536870913)}d&=~Tt}v!==0&&vt(s,v,0),E!==0&&S===0&&s.tag!==0&&(s.suspendedLanes|=E&~(B&~r))}function vt(s,r,d){s.pendingLanes|=r,s.suspendedLanes&=~r;var v=31-ra(r);s.entangledLanes|=r,s.entanglements[v]=s.entanglements[v]|1073741824|d&4194218}function dt(s,r){var d=s.entangledLanes|=r;for(s=s.entanglements;d;){var v=31-ra(d),S=1<<v;S&r|s[v]&r&&(s[v]|=r),d&=~S}}function St(s){return s&=-s,2<s?8<s?(s&134217727)!==0?32:268435456:8:2}function H(s){if(ua&&typeof ua.onCommitFiberRoot=="function")try{ua.onCommitFiberRoot(Xr,s,void 0,(s.current.flags&128)===128)}catch{}}function Q(s){if(typeof Bm=="function"&&Dh(s),ua&&typeof ua.setStrictMode=="function")try{ua.setStrictMode(Xr,s)}catch{}}function ot(s,r){return s===r&&(s!==0||1/s===1/r)||s!==s&&r!==r}function rt(s,r){if(typeof s=="object"&&s!==null){var d=Mc.get(s);return d!==void 0?d:(r={value:s,source:r,stack:x(r)},Mc.set(s,r),r)}return{value:s,source:r,stack:x(r)}}function gt(s,r){Ne[qe++]=to,Ne[qe++]=$u,$u=s,to=r}function U(s,r,d){Ma[Ra++]=Li,Ma[Ra++]=Za,Ma[Ra++]=di,di=s;var v=Li;s=Za;var S=32-ra(v)-1;v&=~(1<<S),d+=1;var E=32-ra(r)+S;if(30<E){var B=S-S%5;E=(v&(1<<B)-1).toString(32),v>>=B,S-=B,Li=1<<32-ra(r)+S|d<<S|v,Za=E+s}else Li=1<<E|d<<S|v,Za=s}function F(s){s.return!==null&&(gt(s,1),U(s,1,0))}function tt(s){for(;s===$u;)$u=Ne[--qe],Ne[qe]=null,to=Ne[--qe],Ne[qe]=null;for(;s===di;)di=Ma[--Ra],Ma[Ra]=null,Za=Ma[--Ra],Ma[Ra]=null,Li=Ma[--Ra],Ma[Ra]=null}function pt(s,r){N(mi,r),N(eo,s),N(bn,null),s=Vs(r),D(bn),N(bn,s)}function _t(){D(bn),D(eo),D(mi)}function At(s){s.memoizedState!==null&&N(Vr,s);var r=bn.current,d=om(r,s.type);r!==d&&(N(eo,s),N(bn,d))}function Ot(s){eo.current===s&&(D(bn),D(eo)),Vr.current===s&&(D(Vr),Gi?Ut._currentValue=sa:Ut._currentValue2=sa)}function fe(s){var r=Error(o(418,""));throw ta(rt(r,s)),no}function ce(s,r){if(!Zn)throw Error(o(175));ay(s.stateNode,s.type,s.memoizedProps,r,s)||fe(s)}function ga(s){for(Un=s.return;Un;)switch(Un.tag){case 3:case 27:Fa=!0;return;case 5:case 13:Fa=!1;return;default:Un=Un.return}}function La(s){if(!Zn||s!==Un)return!1;if(!se)return ga(s),se=!0,!1;var r=!1;if(Cn?s.tag!==3&&s.tag!==27&&(s.tag!==5||Cm(s.type)&&!rs(s.type,s.memoizedProps))&&(r=!0):s.tag!==3&&(s.tag!==5||Cm(s.type)&&!rs(s.type,s.memoizedProps))&&(r=!0),r&&Mn&&fe(s),ga(s),s.tag===13){if(!Zn)throw Error(o(316));if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(o(317));Mn=Tm(s)}else Mn=Un?vh(s.stateNode):null;return!0}function Xn(){Zn&&(Mn=Un=null,se=!1)}function ta(s){za===null?za=[s]:za.push(s)}function pn(){for(var s=os,r=kr=os=0;r<s;){var d=wa[r];wa[r++]=null;var v=wa[r];wa[r++]=null;var S=wa[r];wa[r++]=null;var E=wa[r];if(wa[r++]=null,v!==null&&S!==null){var B=v.pending;B===null?S.next=S:(S.next=B.next,B.next=S),v.pending=S}E!==0&&ou(d,S,E)}}function ea(s,r,d,v){wa[os++]=s,wa[os++]=r,wa[os++]=d,wa[os++]=v,kr|=v,s.lanes|=v,s=s.alternate,s!==null&&(s.lanes|=v)}function Ts(s,r,d,v){return ea(s,r,d,v),Es(s)}function li(s,r){return ea(s,null,null,r),Es(s)}function ou(s,r,d){s.lanes|=d;var v=s.alternate;v!==null&&(v.lanes|=d);for(var S=!1,E=s.return;E!==null;)E.childLanes|=d,v=E.alternate,v!==null&&(v.childLanes|=d),E.tag===22&&(s=E.stateNode,s===null||s._visibility&1||(S=!0)),s=E,E=E.return;S&&r!==null&&s.tag===3&&(E=s.stateNode,S=31-ra(d),E=E.hiddenUpdates,s=E[S],s===null?E[S]=[r]:s.push(r),r.lane=d|536870912)}function Es(s){if(50<tr)throw tr=0,Jn=null,Error(o(185));for(var r=s.return;r!==null;)s=r,r=s.return;return s.tag===3?s.stateNode:null}function Xa(s){s!==Zs&&s.next===null&&(Zs===null?Qr=Zs=s:Zs=Zs.next=s),io=!0,ao||(ao=!0,Ad(Pp))}function Ul(s,r){if(!pi&&io){pi=!0;do for(var d=!1,v=Qr;v!==null;){if(s!==0){var S=v.pendingLanes;if(S===0)var E=0;else{var B=v.suspendedLanes,X=v.pingedLanes;E=(1<<31-ra(42|s)+1)-1,E&=S&~(B&~X),E=E&201326677?E&201326677|1:E?E|2:0}E!==0&&(d=!0,Cd(v,E))}else E=Kt,E=k(v,v===Wt?E:0),(E&3)===0||q(v,E)||(d=!0,Cd(v,E));v=v.next}while(d);pi=!1}}function Pp(){io=ao=!1;var s=0;cs!==0&&(us()&&(s=cs),cs=0);for(var r=An(),d=null,v=Qr;v!==null;){var S=v.next,E=Ed(v,r);E===0?(v.next=null,d===null?Qr=S:d.next=S,S===null&&(Zs=d)):(d=v,(s!==0||(E&3)!==0)&&(io=!0)),v=S}Ul(s)}function Ed(s,r){for(var d=s.suspendedLanes,v=s.pingedLanes,S=s.expirationTimes,E=s.pendingLanes&-62914561;0<E;){var B=31-ra(E),X=1<<B,I=S[B];I===-1?((X&d)===0||(X&v)!==0)&&(S[B]=Z(X,r)):I<=r&&(s.expiredLanes|=X),E&=~X}if(r=Wt,d=Kt,d=k(s,s===r?d:0),v=s.callbackNode,d===0||s===r&&_e===2||s.cancelPendingCommit!==null)return v!==null&&v!==null&&Iu(v),s.callbackNode=null,s.callbackPriority=0;if((d&3)===0||q(s,d)){if(r=d&-d,r===s.callbackPriority)return r;switch(v!==null&&Iu(v),St(d)){case 2:case 8:d=Nm;break;case 32:d=Cc;break;case 268435456:d=Ac;break;default:d=Cc}return v=na.bind(null,s),d=Lr(d,v),s.callbackPriority=r,s.callbackNode=d,r}return v!==null&&v!==null&&Iu(v),s.callbackPriority=2,s.callbackNode=null,2}function na(s,r){var d=s.callbackNode;if(vn()&&s.callbackNode!==d)return null;var v=Kt;return v=k(s,s===Wt?v:0),v===0?null:(ju(s,v,r),Ed(s,An()),s.callbackNode!=null&&s.callbackNode===d?na.bind(null,s):null)}function Cd(s,r){if(vn())return null;ju(s,r,!0)}function Ad(s){en?mc(function(){(wt&6)!==0?Lr(wh,s):s()}):Lr(wh,s)}function Ao(){return cs===0&&(cs=W()),cs}function Mo(s,r){if(lo===null){var d=lo=[];Rc=0,oa=Ao(),fs={status:"pending",value:void 0,then:function(v){d.push(v)}}}return Rc++,r.then(Md,Md),r}function Md(){if(--Rc===0&&lo!==null){fs!==null&&(fs.status="fulfilled");var s=lo;lo=null,oa=0,fs=null;for(var r=0;r<s.length;r++)(0,s[r])()}}function Rd(s,r){var d=[],v={status:"pending",value:null,reason:null,then:function(S){d.push(S)}};return s.then(function(){v.status="fulfilled",v.value=r;for(var S=0;S<d.length;S++)(0,d[S])(r)},function(S){for(v.status="rejected",v.reason=S,S=0;S<d.length;S++)(0,d[S])(void 0)}),v}function df(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mf(s,r){s=s.updateQueue,r.updateQueue===s&&(r.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,callbacks:null})}function Va(s){return{lane:s,tag:0,payload:null,callback:null,next:null}}function $e(s,r,d){var v=s.updateQueue;if(v===null)return null;if(v=v.shared,(wt&2)!==0){var S=v.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),v.pending=r,r=Es(s),ou(s,null,d),r}return ea(s,v,r,d),Es(s)}function ka(s,r,d){if(r=r.updateQueue,r!==null&&(r=r.shared,(d&4194176)!==0)){var v=r.lanes;v&=s.pendingLanes,d|=v,r.lanes=d,dt(s,d)}}function Vn(s,r){var d=s.updateQueue,v=s.alternate;if(v!==null&&(v=v.updateQueue,d===v)){var S=null,E=null;if(d=d.firstBaseUpdate,d!==null){do{var B={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};E===null?S=E=B:E=E.next=B,d=d.next}while(d!==null);E===null?S=E=r:E=E.next=r}else S=E=r;d={baseState:v.baseState,firstBaseUpdate:S,lastBaseUpdate:E,shared:v.shared,callbacks:v.callbacks},s.updateQueue=d;return}s=d.lastBaseUpdate,s===null?d.firstBaseUpdate=r:s.next=r,d.lastBaseUpdate=r}function cu(){if(Kr){var s=fs;if(s!==null)throw s}}function fu(s,r,d,v){Kr=!1;var S=s.updateQueue;bl=!1;var E=S.firstBaseUpdate,B=S.lastBaseUpdate,X=S.shared.pending;if(X!==null){S.shared.pending=null;var I=X,ht=I.next;I.next=null,B===null?E=ht:B.next=ht,B=I;var bt=s.alternate;bt!==null&&(bt=bt.updateQueue,X=bt.lastBaseUpdate,X!==B&&(X===null?bt.firstBaseUpdate=ht:X.next=ht,bt.lastBaseUpdate=I))}if(E!==null){var Tt=S.baseState;B=0,bt=ht=I=null,X=E;do{var Et=X.lane&-536870913,qt=Et!==X.lane;if(qt?(Kt&Et)===Et:(v&Et)===Et){Et!==0&&Et===oa&&(Kr=!0),bt!==null&&(bt=bt.next={lane:0,tag:X.tag,payload:X.payload,callback:null,next:null});t:{var da=s,oo=X;Et=r;var er=d;switch(oo.tag){case 1:if(da=oo.payload,typeof da=="function"){Tt=da.call(er,Tt,Et);break t}Tt=da;break t;case 3:da.flags=da.flags&-65537|128;case 0:if(da=oo.payload,Et=typeof da=="function"?da.call(er,Tt,Et):da,Et==null)break t;Tt=Ls({},Tt,Et);break t;case 2:bl=!0}}Et=X.callback,Et!==null&&(s.flags|=64,qt&&(s.flags|=8192),qt=S.callbacks,qt===null?S.callbacks=[Et]:qt.push(Et))}else qt={lane:Et,tag:X.tag,payload:X.payload,callback:X.callback,next:null},bt===null?(ht=bt=qt,I=Tt):bt=bt.next=qt,B|=Et;if(X=X.next,X===null){if(X=S.shared.pending,X===null)break;qt=X,X=qt.next,qt.next=null,S.lastBaseUpdate=qt,S.shared.pending=null}}while(!0);bt===null&&(I=Tt),S.baseState=I,S.firstBaseUpdate=ht,S.lastBaseUpdate=bt,E===null&&(S.shared.lanes=0),Ba|=B,s.lanes=B,s.memoizedState=Tt}}function zd(s,r){if(typeof s!="function")throw Error(o(191,s));s.call(r)}function hu(s,r){var d=s.callbacks;if(d!==null)for(s.callbacks=null,s=0;s<d.length;s++)zd(d[s],r)}function Cs(s,r){if(Aa(s,r))return!0;if(typeof s!="object"||s===null||typeof r!="object"||r===null)return!1;var d=Object.keys(s),v=Object.keys(r);if(d.length!==v.length)return!1;for(v=0;v<d.length;v++){var S=d[v];if(!so.call(r,S)||!Aa(s[S],r[S]))return!1}return!0}function du(s){return s=s.status,s==="fulfilled"||s==="rejected"}function Ci(){}function mu(s,r,d){switch(d=s[d],d===void 0?s.push(r):d!==r&&(r.then(Ci,Ci),r=d),r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,s===xe?Error(o(483)):s;default:if(typeof r.status=="string")r.then(Ci,Ci);else{if(s=Wt,s!==null&&100<s.shellSuspendCounter)throw Error(o(482));s=r,s.status="pending",s.then(function(v){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=v}},function(v){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=v}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw s=r.reason,s===xe?Error(o(483)):s}throw Fs=r,xe}}function mr(){if(Fs===null)throw Error(o(459));var s=Fs;return Fs=null,s}function Ro(s){var r=Wa;return Wa+=1,Xi===null&&(Xi=[]),mu(Xi,s,r)}function pr(s,r){r=r.props.ref,s.ref=r!==void 0?r:null}function yr(s,r){throw r.$$typeof===Jf?Error(o(525)):(s=Object.prototype.toString.call(r),Error(o(31,s==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":s)))}function gr(s){var r=s._init;return r(s._payload)}function wd(s){function r(it,J){if(s){var st=it.deletions;st===null?(it.deletions=[J],it.flags|=16):st.push(J)}}function d(it,J){if(!s)return null;for(;J!==null;)r(it,J),J=J.sibling;return null}function v(it){for(var J=new Map;it!==null;)it.key!==null?J.set(it.key,it):J.set(it.index,it),it=it.sibling;return J}function S(it,J){return it=Bn(it,J),it.index=0,it.sibling=null,it}function E(it,J,st){return it.index=st,s?(st=it.alternate,st!==null?(st=st.index,st<J?(it.flags|=33554434,J):st):(it.flags|=33554434,J)):(it.flags|=1048576,J)}function B(it){return s&&it.alternate===null&&(it.flags|=33554434),it}function X(it,J,st,xt){return J===null||J.tag!==6?(J=es(st,it.mode,xt),J.return=it,J):(J=S(J,st),J.return=it,J)}function I(it,J,st,xt){var Rt=st.type;return Rt===jr?bt(it,J,st.props.children,xt,st.key):J!==null&&(J.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===hi&&gr(Rt)===J.type)?(J=S(J,st.props),pr(J,st),J.return=it,J):(J=Qa(st.type,st.key,st.props,null,it.mode,xt),pr(J,st),J.return=it,J)}function ht(it,J,st,xt){return J===null||J.tag!==4||J.stateNode.containerInfo!==st.containerInfo||J.stateNode.implementation!==st.implementation?(J=Br(st,it.mode,xt),J.return=it,J):(J=S(J,st.children||[]),J.return=it,J)}function bt(it,J,st,xt,Rt){return J===null||J.tag!==7?(J=ml(st,it.mode,xt,Rt),J.return=it,J):(J=S(J,st),J.return=it,J)}function Tt(it,J,st){if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return J=es(""+J,it.mode,st),J.return=it,J;if(typeof J=="object"&&J!==null){switch(J.$$typeof){case pl:return st=Qa(J.type,J.key,J.props,null,it.mode,st),pr(st,J),st.return=it,st;case fi:return J=Br(J,it.mode,st),J.return=it,J;case hi:var xt=J._init;return J=xt(J._payload),Tt(it,J,st)}if(ls(J)||c(J))return J=ml(J,it.mode,st,null),J.return=it,J;if(typeof J.then=="function")return Tt(it,Ro(J),st);if(J.$$typeof===Ui)return Tt(it,wu(it,J),st);yr(it,J)}return null}function Et(it,J,st,xt){var Rt=J!==null?J.key:null;if(typeof st=="string"&&st!==""||typeof st=="number"||typeof st=="bigint")return Rt!==null?null:X(it,J,""+st,xt);if(typeof st=="object"&&st!==null){switch(st.$$typeof){case pl:return st.key===Rt?I(it,J,st,xt):null;case fi:return st.key===Rt?ht(it,J,st,xt):null;case hi:return Rt=st._init,st=Rt(st._payload),Et(it,J,st,xt)}if(ls(st)||c(st))return Rt!==null?null:bt(it,J,st,xt,null);if(typeof st.then=="function")return Et(it,J,Ro(st),xt);if(st.$$typeof===Ui)return Et(it,J,wu(it,st),xt);yr(it,st)}return null}function qt(it,J,st,xt,Rt){if(typeof xt=="string"&&xt!==""||typeof xt=="number"||typeof xt=="bigint")return it=it.get(st)||null,X(J,it,""+xt,Rt);if(typeof xt=="object"&&xt!==null){switch(xt.$$typeof){case pl:return it=it.get(xt.key===null?st:xt.key)||null,I(J,it,xt,Rt);case fi:return it=it.get(xt.key===null?st:xt.key)||null,ht(J,it,xt,Rt);case hi:var Ae=xt._init;return xt=Ae(xt._payload),qt(it,J,st,xt,Rt)}if(ls(xt)||c(xt))return it=it.get(st)||null,bt(J,it,xt,Rt,null);if(typeof xt.then=="function")return qt(it,J,st,Ro(xt),Rt);if(xt.$$typeof===Ui)return qt(it,J,st,wu(J,xt),Rt);yr(J,xt)}return null}function da(it,J,st,xt){for(var Rt=null,Ae=null,Ht=J,ue=J=0,dn=null;Ht!==null&&ue<st.length;ue++){Ht.index>ue?(dn=Ht,Ht=null):dn=Ht.sibling;var oe=Et(it,Ht,st[ue],xt);if(oe===null){Ht===null&&(Ht=dn);break}s&&Ht&&oe.alternate===null&&r(it,Ht),J=E(oe,J,ue),Ae===null?Rt=oe:Ae.sibling=oe,Ae=oe,Ht=dn}if(ue===st.length)return d(it,Ht),se&&gt(it,ue),Rt;if(Ht===null){for(;ue<st.length;ue++)Ht=Tt(it,st[ue],xt),Ht!==null&&(J=E(Ht,J,ue),Ae===null?Rt=Ht:Ae.sibling=Ht,Ae=Ht);return se&&gt(it,ue),Rt}for(Ht=v(Ht);ue<st.length;ue++)dn=qt(Ht,it,ue,st[ue],xt),dn!==null&&(s&&dn.alternate!==null&&Ht.delete(dn.key===null?ue:dn.key),J=E(dn,J,ue),Ae===null?Rt=dn:Ae.sibling=dn,Ae=dn);return s&&Ht.forEach(function(Ml){return r(it,Ml)}),se&&gt(it,ue),Rt}function oo(it,J,st,xt){if(st==null)throw Error(o(151));for(var Rt=null,Ae=null,Ht=J,ue=J=0,dn=null,oe=st.next();Ht!==null&&!oe.done;ue++,oe=st.next()){Ht.index>ue?(dn=Ht,Ht=null):dn=Ht.sibling;var Ml=Et(it,Ht,oe.value,xt);if(Ml===null){Ht===null&&(Ht=dn);break}s&&Ht&&Ml.alternate===null&&r(it,Ht),J=E(Ml,J,ue),Ae===null?Rt=Ml:Ae.sibling=Ml,Ae=Ml,Ht=dn}if(oe.done)return d(it,Ht),se&&gt(it,ue),Rt;if(Ht===null){for(;!oe.done;ue++,oe=st.next())oe=Tt(it,oe.value,xt),oe!==null&&(J=E(oe,J,ue),Ae===null?Rt=oe:Ae.sibling=oe,Ae=oe);return se&&gt(it,ue),Rt}for(Ht=v(Ht);!oe.done;ue++,oe=st.next())oe=qt(Ht,it,ue,oe.value,xt),oe!==null&&(s&&oe.alternate!==null&&Ht.delete(oe.key===null?ue:oe.key),J=E(oe,J,ue),Ae===null?Rt=oe:Ae.sibling=oe,Ae=oe);return s&&Ht.forEach(function(Hc){return r(it,Hc)}),se&&gt(it,ue),Rt}function er(it,J,st,xt){if(typeof st=="object"&&st!==null&&st.type===jr&&st.key===null&&(st=st.props.children),typeof st=="object"&&st!==null){switch(st.$$typeof){case pl:t:{for(var Rt=st.key;J!==null;){if(J.key===Rt){if(Rt=st.type,Rt===jr){if(J.tag===7){d(it,J.sibling),xt=S(J,st.props.children),xt.return=it,it=xt;break t}}else if(J.elementType===Rt||typeof Rt=="object"&&Rt!==null&&Rt.$$typeof===hi&&gr(Rt)===J.type){d(it,J.sibling),xt=S(J,st.props),pr(xt,st),xt.return=it,it=xt;break t}d(it,J);break}else r(it,J);J=J.sibling}st.type===jr?(xt=ml(st.props.children,it.mode,xt,st.key),xt.return=it,it=xt):(xt=Qa(st.type,st.key,st.props,null,it.mode,xt),pr(xt,st),xt.return=it,it=xt)}return B(it);case fi:t:{for(Rt=st.key;J!==null;){if(J.key===Rt)if(J.tag===4&&J.stateNode.containerInfo===st.containerInfo&&J.stateNode.implementation===st.implementation){d(it,J.sibling),xt=S(J,st.children||[]),xt.return=it,it=xt;break t}else{d(it,J);break}else r(it,J);J=J.sibling}xt=Br(st,it.mode,xt),xt.return=it,it=xt}return B(it);case hi:return Rt=st._init,st=Rt(st._payload),er(it,J,st,xt)}if(ls(st))return da(it,J,st,xt);if(c(st)){if(Rt=c(st),typeof Rt!="function")throw Error(o(150));return st=Rt.call(st),oo(it,J,st,xt)}if(typeof st.then=="function")return er(it,J,Ro(st),xt);if(st.$$typeof===Ui)return er(it,J,wu(it,st),xt);yr(it,st)}return typeof st=="string"&&st!==""||typeof st=="number"||typeof st=="bigint"?(st=""+st,J!==null&&J.tag===6?(d(it,J.sibling),xt=S(J,st),xt.return=it,it=xt):(d(it,J),xt=es(st,it.mode,xt),xt.return=it,it=xt),B(it)):d(it,J)}return function(it,J,st,xt){try{Wa=0;var Rt=er(it,J,st,xt);return Xi=null,Rt}catch(Ht){if(Ht===xe)throw Ht;var Ae=a(29,Ht,null,it.mode);return Ae.lanes=xt,Ae.return=it,Ae}finally{}}}function pf(s,r){s=yi,N(Da,s),N(Vi,r),yi=s|r.baseLanes}function zo(){N(Da,yi),N(Vi,Vi.current)}function wo(){yi=Da.current,D(Vi),D(Da)}function Ai(s){var r=s.alternate;N(nn,nn.current&1),N(Oa,s),Ja===null&&(r===null||Vi.current!==null||r.memoizedState!==null)&&(Ja=s)}function Do(s){if(s.tag===22){if(N(nn,nn.current),N(Oa,s),Ja===null){var r=s.alternate;r!==null&&r.memoizedState!==null&&(Ja=s)}}else nl()}function nl(){N(nn,nn.current),N(Oa,Oa.current)}function Mi(s){D(Oa),Ja===s&&(Ja=null),D(nn)}function si(s){for(var r=s;r!==null;){if(r.tag===13){var d=r.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||xc(d)||Fu(d)))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}function Pt(){throw Error(o(321))}function wn(s,r){if(r===null)return!1;for(var d=0;d<r.length&&d<s.length;d++)if(!Aa(s[d],r[d]))return!1;return!0}function Hl(s,r,d,v,S,E){return ki=E,kt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Nt.H=s===null||s.memoizedState===null?an:Hn,Sl=!1,E=d(v,S),Sl=!1,Be&&(E=Dd(r,d,v,S)),Oo(s),E}function Oo(s){Nt.H=re;var r=he!==null&&he.next!==null;if(ki=0,Ke=he=kt=null,Pa=!1,Le=0,Zr=null,r)throw Error(o(300));s===null||Ze||(s=s.dependencies,s!==null&&kl(s)&&(Ze=!0))}function Dd(s,r,d,v){kt=s;var S=0;do{if(Be&&(Zr=null),Le=0,Be=!1,25<=S)throw Error(o(301));if(S+=1,Ke=he=null,s.updateQueue!=null){var E=s.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Nt.H=ds,E=r(d,v)}while(Be);return E}function Ip(){var s=Nt.H,r=s.useState()[0];return r=typeof r.then=="function"?al(r):r,s=s.useState()[0],(he!==null?he.memoizedState:null)!==s&&(kt.flags|=1024),r}function No(){var s=ro!==0;return ro=0,s}function As(s,r,d){r.updateQueue=s.updateQueue,r.flags&=-2053,s.lanes&=~d}function pu(s){if(Pa){for(s=s.memoizedState;s!==null;){var r=s.queue;r!==null&&(r.pending=null),s=s.next}Pa=!1}ki=0,Ke=he=kt=null,Be=!1,Le=ro=0,Zr=null}function cn(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ke===null?kt.memoizedState=Ke=s:Ke=Ke.next=s,Ke}function we(){if(he===null){var s=kt.alternate;s=s!==null?s.memoizedState:null}else s=he.next;var r=Ke===null?kt.memoizedState:Ke.next;if(r!==null)Ke=r,he=s;else{if(s===null)throw kt.alternate===null?Error(o(467)):Error(o(310));he=s,s={memoizedState:he.memoizedState,baseState:he.baseState,baseQueue:he.baseQueue,queue:he.queue,next:null},Ke===null?kt.memoizedState=Ke=s:Ke=Ke.next=s}return Ke}function al(s){var r=Le;return Le+=1,Zr===null&&(Zr=[]),s=mu(Zr,s,r),r=kt,(Ke===null?r.memoizedState:Ke.next)===null&&(r=r.alternate,Nt.H=r===null||r.memoizedState===null?an:Hn),s}function il(s){if(s!==null&&typeof s=="object"){if(typeof s.then=="function")return al(s);if(s.$$typeof===Ui)return _n(s)}throw Error(o(438,String(s)))}function tn(s){var r=null,d=kt.updateQueue;if(d!==null&&(r=d.memoCache),r==null){var v=kt.alternate;v!==null&&(v=v.updateQueue,v!==null&&(v=v.memoCache,v!=null&&(r={data:v.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),d===null&&(d=wc(),kt.updateQueue=d),d.memoCache=r,d=r.data[r.index],d===void 0)for(d=r.data[r.index]=Array(s),v=0;v<s;v++)d[v]=um;return r.index++,d}function Ri(s,r){return typeof r=="function"?r(s):r}function yu(s){var r=we();return ll(r,he,s)}function ll(s,r,d){var v=s.queue;if(v===null)throw Error(o(311));v.lastRenderedReducer=d;var S=s.baseQueue,E=v.pending;if(E!==null){if(S!==null){var B=S.next;S.next=E.next,E.next=B}r.baseQueue=S=E,v.pending=null}if(E=s.baseState,S===null)s.memoizedState=E;else{r=S.next;var X=B=null,I=null,ht=r,bt=!1;do{var Tt=ht.lane&-536870913;if(Tt!==ht.lane?(Kt&Tt)===Tt:(ki&Tt)===Tt){var Et=ht.revertLane;if(Et===0)I!==null&&(I=I.next={lane:0,revertLane:0,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null}),Tt===oa&&(bt=!0);else if((ki&Et)===Et){ht=ht.next,Et===oa&&(bt=!0);continue}else Tt={lane:0,revertLane:ht.revertLane,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null},I===null?(X=I=Tt,B=E):I=I.next=Tt,kt.lanes|=Et,Ba|=Et;Tt=ht.action,Sl&&d(E,Tt),E=ht.hasEagerState?ht.eagerState:d(E,Tt)}else Et={lane:Tt,revertLane:ht.revertLane,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null},I===null?(X=I=Et,B=E):I=I.next=Et,kt.lanes|=Tt,Ba|=Tt;ht=ht.next}while(ht!==null&&ht!==r);if(I===null?B=E:I.next=X,!Aa(E,s.memoizedState)&&(Ze=!0,bt&&(d=fs,d!==null)))throw d;s.memoizedState=E,s.baseState=B,s.baseQueue=I,v.lastRenderedState=E}return S===null&&(v.lanes=0),[s.memoizedState,v.dispatch]}function Gl(s){var r=we(),d=r.queue;if(d===null)throw Error(o(311));d.lastRenderedReducer=s;var v=d.dispatch,S=d.pending,E=r.memoizedState;if(S!==null){d.pending=null;var B=S=S.next;do E=s(E,B.action),B=B.next;while(B!==S);Aa(E,r.memoizedState)||(Ze=!0),r.memoizedState=E,r.baseQueue===null&&(r.baseState=E),d.lastRenderedState=E}return[E,v]}function Od(s,r,d){var v=kt,S=we(),E=se;if(E){if(d===void 0)throw Error(o(407));d=d()}else d=r();var B=!Aa((he||S).memoizedState,d);if(B&&(S.memoizedState=d,Ze=!0),S=S.queue,bu(Nd.bind(null,v,S,s),[s]),S.getSnapshot!==r||B||Ke!==null&&Ke.memoizedState.tag&1){if(v.flags|=2048,Ms(9,gf.bind(null,v,S,d,r),{destroy:void 0},null),Wt===null)throw Error(o(349));E||(ki&60)!==0||yf(v,r,d)}return d}function yf(s,r,d){s.flags|=16384,s={getSnapshot:r,value:d},r=kt.updateQueue,r===null?(r=wc(),kt.updateQueue=r,r.stores=[s]):(d=r.stores,d===null?r.stores=[s]:d.push(s))}function gf(s,r,d,v){r.value=d,r.getSnapshot=v,gu(r)&&vu(s)}function Nd(s,r,d){return d(function(){gu(r)&&vu(s)})}function gu(s){var r=s.getSnapshot;s=s.value;try{var d=r();return!Aa(s,d)}catch{return!0}}function vu(s){var r=li(s,2);r!==null&&Nn(r,s,2)}function ri(s){var r=cn();if(typeof s=="function"){var d=s;if(s=d(),Sl){Q(!0);try{d()}finally{Q(!1)}}}return r.memoizedState=r.baseState=s,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:s},r}function va(s,r,d,v){return s.baseState=d,ll(s,he,typeof v=="function"?v:Ri)}function Bd(s,r,d,v,S){if(Ds(s))throw Error(o(485));if(s=r.action,s!==null){var E={payload:S,action:s,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(B){E.listeners.push(B)}};Nt.T!==null?d(!0):E.isTransition=!1,v(E),d=r.pending,d===null?(E.next=r.pending=E,jd(r,E)):(E.next=d.next,r.pending=d.next=E)}}function jd(s,r){var d=r.action,v=r.payload,S=s.state;if(r.isTransition){var E=Nt.T,B={};Nt.T=B;try{var X=d(S,v),I=Nt.S;I!==null&&I(B,X),Bo(s,r,X)}catch(ht){vr(s,r,ht)}finally{Nt.T=E}}else try{E=d(S,v),Bo(s,r,E)}catch(ht){vr(s,r,ht)}}function Bo(s,r,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(v){vf(s,r,v)},function(v){return vr(s,r,v)}):vf(s,r,d)}function vf(s,r,d){r.status="fulfilled",r.value=d,Ud(r),s.state=d,r=s.pending,r!==null&&(d=r.next,d===r?s.pending=null:(d=d.next,r.next=d,jd(s,d)))}function vr(s,r,d){var v=s.pending;if(s.pending=null,v!==null){v=v.next;do r.status="rejected",r.reason=d,Ud(r),r=r.next;while(r!==v)}s.action=null}function Ud(s){s=s.listeners;for(var r=0;r<s.length;r++)(0,s[r])()}function xa(s,r){return r}function jo(s,r){if(se){var d=Wt.formState;if(d!==null){t:{var v=kt;if(se){if(Mn){var S=pm(Mn,Fa);if(S){Mn=vh(S),v=ym(S);break t}}fe(v)}v=!1}v&&(r=d[0])}}d=cn(),d.memoizedState=d.baseState=r,v={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xa,lastRenderedState:r},d.queue=v,d=Lo.bind(null,kt,v),v.dispatch=d,v=ri(!1);var E=Xo.bind(null,kt,!1,v.queue);return v=cn(),S={state:r,dispatch:null,action:s,pending:null},v.queue=S,d=Bd.bind(null,kt,S,E,d),S.dispatch=d,v.memoizedState=s,[r,d,!1]}function xf(s){var r=we();return Uo(r,he,s)}function Uo(s,r,d){r=ll(s,r,xa)[0],s=yu(Ri)[0],r=typeof r=="object"&&r!==null&&typeof r.then=="function"?al(r):r;var v=we(),S=v.queue,E=S.dispatch;return d!==v.memoizedState&&(kt.flags|=2048,Ms(9,xr.bind(null,S,d),{destroy:void 0},null)),[r,E,s]}function xr(s,r){s.action=r}function bf(s){var r=we(),d=he;if(d!==null)return Uo(r,d,s);we(),r=r.memoizedState,d=we();var v=d.queue.dispatch;return d.memoizedState=s,[r,v,!1]}function Ms(s,r,d,v){return s={tag:s,create:r,inst:d,deps:v,next:null},r=kt.updateQueue,r===null&&(r=wc(),kt.updateQueue=r),d=r.lastEffect,d===null?r.lastEffect=s.next=s:(v=d.next,d.next=s,s.next=v,r.lastEffect=s),s}function Rs(){return we().memoizedState}function Ho(s,r,d,v){var S=cn();kt.flags|=s,S.memoizedState=Ms(1|r,d,{destroy:void 0},v===void 0?null:v)}function xu(s,r,d,v){var S=we();v=v===void 0?null:v;var E=S.memoizedState.inst;he!==null&&v!==null&&wn(v,he.memoizedState.deps)?S.memoizedState=Ms(r,d,E,v):(kt.flags|=s,S.memoizedState=Ms(1|r,d,E,v))}function Sf(s,r){Ho(8390656,8,s,r)}function bu(s,r){xu(2048,8,s,r)}function Hd(s,r){return xu(4,2,s,r)}function Gd(s,r){return xu(4,4,s,r)}function Su(s,r){if(typeof r=="function"){s=s();var d=r(s);return function(){typeof d=="function"?d():r(null)}}if(r!=null)return s=s(),r.current=s,function(){r.current=null}}function zi(s,r,d){d=d!=null?d.concat([s]):null,xu(4,4,Su.bind(null,r,s),d)}function _u(){}function Go(s,r){var d=we();r=r===void 0?null:r;var v=d.memoizedState;return r!==null&&wn(r,v[1])?v[0]:(d.memoizedState=[s,r],s)}function zs(s,r){var d=we();r=r===void 0?null:r;var v=d.memoizedState;if(r!==null&&wn(r,v[1]))return v[0];if(v=s(),Sl){Q(!0);try{s()}finally{Q(!1)}}return d.memoizedState=[v,r],v}function Yl(s,r,d){return d===void 0||(ki&1073741824)!==0?s.memoizedState=r:(s.memoizedState=d,s=Oi(),kt.lanes|=s,Ba|=s,d)}function _f(s,r,d,v){return Aa(d,r)?d:Vi.current!==null?(s=Yl(s,d,v),Aa(s,r)||(Ze=!0),s):(ki&42)===0?(Ze=!0,s.memoizedState=d):(s=Oi(),kt.lanes|=s,Ba|=s,r)}function Yo(s,r,d,v,S){var E=fn();jn(E!==0&&8>E?E:8);var B=Nt.T,X={};Nt.T=X,Xo(s,!1,r,d);try{var I=S(),ht=Nt.S;if(ht!==null&&ht(X,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var bt=Rd(I,v);Ll(s,r,bt,Kn(s))}else Ll(s,r,v,Kn(s))}catch(Tt){Ll(s,r,{then:function(){},status:"rejected",reason:Tt},Kn())}finally{jn(E),Nt.T=B}}function Tf(s){var r=s.memoizedState;if(r!==null)return r;r={memoizedState:sa,baseState:sa,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:sa},next:null};var d={};return r.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ri,lastRenderedState:d},next:null},s.memoizedState=r,s=s.alternate,s!==null&&(s.memoizedState=r),r}function ws(){return _n(Ut)}function wi(){return we().memoizedState}function qo(){return we().memoizedState}function Tu(s){for(var r=s.return;r!==null;){switch(r.tag){case 24:case 3:var d=Kn();s=Va(d);var v=$e(r,s,d);v!==null&&(Nn(v,r,d),ka(v,r,d)),r={cache:Zo()},s.payload=r;return}r=r.return}}function ql(s,r,d){var v=Kn();d={lane:v,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null},Ds(s)?Eu(r,d):(d=Ts(s,r,d,v),d!==null&&(Nn(d,s,v),Ef(d,r,v)))}function Lo(s,r,d){var v=Kn();Ll(s,r,d,v)}function Ll(s,r,d,v){var S={lane:v,revertLane:0,action:d,hasEagerState:!1,eagerState:null,next:null};if(Ds(s))Eu(r,S);else{var E=s.alternate;if(s.lanes===0&&(E===null||E.lanes===0)&&(E=r.lastRenderedReducer,E!==null))try{var B=r.lastRenderedState,X=E(B,d);if(S.hasEagerState=!0,S.eagerState=X,Aa(X,B))return ea(s,r,S,0),Wt===null&&pn(),!1}catch{}finally{}if(d=Ts(s,r,S,v),d!==null)return Nn(d,s,v),Ef(d,r,v),!0}return!1}function Xo(s,r,d,v){if(v={lane:2,revertLane:Ao(),action:v,hasEagerState:!1,eagerState:null,next:null},Ds(s)){if(r)throw Error(o(479))}else r=Ts(s,d,v,2),r!==null&&Nn(r,s,2)}function Ds(s){var r=s.alternate;return s===kt||r!==null&&r===kt}function Eu(s,r){Be=Pa=!0;var d=s.pending;d===null?r.next=r:(r.next=d.next,d.next=r),s.pending=r}function Ef(s,r,d){if((d&4194176)!==0){var v=r.lanes;v&=s.pendingLanes,d|=v,r.lanes=d,dt(s,d)}}function Dn(s,r,d,v){r=s.memoizedState,d=d(v,r),d=d==null?r:Ls({},r,d),s.memoizedState=d,s.lanes===0&&(s.updateQueue.baseState=d)}function Xl(s,r,d,v,S,E,B){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(v,E,B):r.prototype&&r.prototype.isPureReactComponent?!Cs(d,v)||!Cs(S,E):!0}function Cu(s,r,d,v){s=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(d,v),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(d,v),r.state!==s&&Dc.enqueueReplaceState(r,r.state,null)}function ui(s,r){var d=r;if("ref"in r){d={};for(var v in r)v!=="ref"&&(d[v]=r[v])}if(s=s.defaultProps){d===r&&(d=Ls({},d));for(var S in s)d[S]===void 0&&(d[S]=s[S])}return d}function Vo(s,r){try{var d=s.onUncaughtError;d(r.value,{componentStack:r.stack})}catch(v){setTimeout(function(){throw v})}}function ko(s,r,d){try{var v=s.onCaughtError;v(d.value,{componentStack:d.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Au(s,r,d){return d=Va(d),d.tag=3,d.payload={element:null},d.callback=function(){Vo(s,r)},d}function br(s){return s=Va(s),s.tag=3,s}function Mu(s,r,d,v){var S=d.type.getDerivedStateFromError;if(typeof S=="function"){var E=v.value;s.payload=function(){return S(E)},s.callback=function(){ko(r,d,v)}}var B=d.stateNode;B!==null&&typeof B.componentDidCatch=="function"&&(s.callback=function(){ko(r,d,v),typeof S!="function"&&(Ua===null?Ua=new Set([this]):Ua.add(this));var X=v.stack;this.componentDidCatch(v.value,{componentStack:X!==null?X:""})})}function Yd(s,r,d,v,S){if(d.flags|=32768,v!==null&&typeof v=="object"&&typeof v.then=="function"){if(r=d.alternate,r!==null&&Os(r,d,S,!0),d=Oa.current,d!==null){switch(d.tag){case 13:return Ja===null?la():d.alternate===null&&ae===0&&(ae=3),d.flags&=-257,d.flags|=65536,d.lanes=S,v===zc?d.flags|=16384:(r=d.updateQueue,r===null?d.updateQueue=new Set([v]):r.add(v),rc(s,v,S)),!1;case 22:return d.flags|=65536,v===zc?d.flags|=16384:(r=d.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([v])},d.updateQueue=r):(d=r.retryQueue,d===null?r.retryQueue=new Set([v]):d.add(v)),rc(s,v,S)),!1}throw Error(o(435,d.tag))}return rc(s,v,S),la(),!1}if(se)return r=Oa.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,v!==no&&(s=Error(o(422),{cause:v}),ta(rt(s,d)))):(v!==no&&(r=Error(o(423),{cause:v}),ta(rt(r,d))),s=s.current.alternate,s.flags|=65536,S&=-S,s.lanes|=S,v=rt(v,d),S=Au(s.stateNode,v,S),Vn(s,S),ae!==4&&(ae=2)),!1;var E=Error(o(520),{cause:v});if(E=rt(E,d),Wr===null?Wr=[E]:Wr.push(E),ae!==4&&(ae=2),r===null)return!0;v=rt(v,d),d=r;do{switch(d.tag){case 3:return d.flags|=65536,s=S&-S,d.lanes|=s,s=Au(d.stateNode,v,s),Vn(d,s),!1;case 1:if(r=d.type,E=d.stateNode,(d.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(Ua===null||!Ua.has(E))))return d.flags|=65536,S&=-S,d.lanes|=S,S=br(S),Mu(S,s,d,v),Vn(d,S),!1}d=d.return}while(d!==null);return!1}function Sn(s,r,d,v){r.child=s===null?Nh(r,null,d,v):hs(r,s.child,d,v)}function qd(s,r,d,v,S){d=d.render;var E=r.ref;if("ref"in v){var B={};for(var X in v)X!=="ref"&&(B[X]=v[X])}else B=v;return Ns(r),v=Hl(s,r,d,B,E,S),X=No(),s!==null&&!Ze?(As(s,r,S),sl(s,r,S)):(se&&X&&F(r),r.flags|=1,Sn(s,r,v,S),r.child)}function Ld(s,r,d,v,S){if(s===null){var E=d.type;return typeof E=="function"&&!hl(E)&&E.defaultProps===void 0&&d.compare===null?(r.tag=15,r.type=E,Qo(s,r,E,v,S)):(s=Qa(d.type,null,v,r,r.mode,S),s.ref=r.ref,s.return=r,r.child=s)}if(E=s.child,!Df(s,S)){var B=E.memoizedProps;if(d=d.compare,d=d!==null?d:Cs,d(B,v)&&s.ref===r.ref)return sl(s,r,S)}return r.flags|=1,s=Bn(E,v),s.ref=r.ref,s.return=r,r.child=s}function Qo(s,r,d,v,S){if(s!==null){var E=s.memoizedProps;if(Cs(E,v)&&s.ref===r.ref)if(Ze=!1,r.pendingProps=v=E,Df(s,S))(s.flags&131072)!==0&&(Ze=!0);else return r.lanes=s.lanes,sl(s,r,S)}return Cf(s,r,d,v,S)}function Xd(s,r,d){var v=r.pendingProps,S=v.children,E=(r.stateNode._pendingVisibility&2)!==0,B=s!==null?s.memoizedState:null;if(Ru(s,r),v.mode==="hidden"||E){if((r.flags&128)!==0){if(v=B!==null?B.baseLanes|d:d,s!==null){for(S=r.child=s.child,E=0;S!==null;)E=E|S.lanes|S.childLanes,S=S.sibling;r.childLanes=E&~v}else r.childLanes=0,r.child=null;return Vd(s,r,v,d)}if((d&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},s!==null&&Fo(r,B!==null?B.cachePool:null),B!==null?pf(r,B):zo(),Do(r);else return r.lanes=r.childLanes=536870912,Vd(s,r,B!==null?B.baseLanes|d:d,d)}else B!==null?(Fo(r,B.cachePool),pf(r,B),nl(),r.memoizedState=null):(s!==null&&Fo(r,null),zo(),nl());return Sn(s,r,S,d),r.child}function Vd(s,r,d,v){var S=Ql();return S=S===null?null:{parent:Gi?me._currentValue:me._currentValue2,pool:S},r.memoizedState={baseLanes:d,cachePool:S},s!==null&&Fo(r,null),zo(),Do(r),s!==null&&Os(s,r,v,!0),null}function Ru(s,r){var d=r.ref;if(d===null)s!==null&&s.ref!==null&&(r.flags|=2097664);else{if(typeof d!="function"&&typeof d!="object")throw Error(o(284));(s===null||s.ref!==d)&&(r.flags|=2097664)}}function Cf(s,r,d,v,S){return Ns(r),d=Hl(s,r,d,v,void 0,S),v=No(),s!==null&&!Ze?(As(s,r,S),sl(s,r,S)):(se&&v&&F(r),r.flags|=1,Sn(s,r,d,S),r.child)}function kd(s,r,d,v,S,E){return Ns(r),r.updateQueue=null,d=Dd(r,v,d,S),Oo(s),v=No(),s!==null&&!Ze?(As(s,r,E),sl(s,r,E)):(se&&v&&F(r),r.flags|=1,Sn(s,r,d,E),r.child)}function Af(s,r,d,v,S){if(Ns(r),r.stateNode===null){var E=Ks,B=d.contextType;typeof B=="object"&&B!==null&&(E=_n(B)),E=new d(v,E),r.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Dc,r.stateNode=E,E._reactInternals=r,E=r.stateNode,E.props=v,E.state=r.memoizedState,E.refs={},df(r),B=d.contextType,E.context=typeof B=="object"&&B!==null?_n(B):Ks,E.state=r.memoizedState,B=d.getDerivedStateFromProps,typeof B=="function"&&(Dn(r,d,B,v),E.state=r.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(B=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),B!==E.state&&Dc.enqueueReplaceState(E,E.state,null),fu(r,v,E,S),cu(),E.state=r.memoizedState),typeof E.componentDidMount=="function"&&(r.flags|=4194308),v=!0}else if(s===null){E=r.stateNode;var X=r.memoizedProps,I=ui(d,X);E.props=I;var ht=E.context,bt=d.contextType;B=Ks,typeof bt=="object"&&bt!==null&&(B=_n(bt));var Tt=d.getDerivedStateFromProps;bt=typeof Tt=="function"||typeof E.getSnapshotBeforeUpdate=="function",X=r.pendingProps!==X,bt||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(X||ht!==B)&&Cu(r,E,v,B),bl=!1;var Et=r.memoizedState;E.state=Et,fu(r,v,E,S),cu(),ht=r.memoizedState,X||Et!==ht||bl?(typeof Tt=="function"&&(Dn(r,d,Tt,v),ht=r.memoizedState),(I=bl||Xl(r,d,I,v,Et,ht,B))?(bt||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(r.flags|=4194308)):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=v,r.memoizedState=ht),E.props=v,E.state=ht,E.context=B,v=I):(typeof E.componentDidMount=="function"&&(r.flags|=4194308),v=!1)}else{E=r.stateNode,mf(s,r),B=r.memoizedProps,bt=ui(d,B),E.props=bt,Tt=r.pendingProps,Et=E.context,ht=d.contextType,I=Ks,typeof ht=="object"&&ht!==null&&(I=_n(ht)),X=d.getDerivedStateFromProps,(ht=typeof X=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(B!==Tt||Et!==I)&&Cu(r,E,v,I),bl=!1,Et=r.memoizedState,E.state=Et,fu(r,v,E,S),cu();var qt=r.memoizedState;B!==Tt||Et!==qt||bl||s!==null&&s.dependencies!==null&&kl(s.dependencies)?(typeof X=="function"&&(Dn(r,d,X,v),qt=r.memoizedState),(bt=bl||Xl(r,d,bt,v,Et,qt,I)||s!==null&&s.dependencies!==null&&kl(s.dependencies))?(ht||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(v,qt,I),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(v,qt,I)),typeof E.componentDidUpdate=="function"&&(r.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof E.componentDidUpdate!="function"||B===s.memoizedProps&&Et===s.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===s.memoizedProps&&Et===s.memoizedState||(r.flags|=1024),r.memoizedProps=v,r.memoizedState=qt),E.props=v,E.state=qt,E.context=I,v=bt):(typeof E.componentDidUpdate!="function"||B===s.memoizedProps&&Et===s.memoizedState||(r.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||B===s.memoizedProps&&Et===s.memoizedState||(r.flags|=1024),v=!1)}return E=v,Ru(s,r),v=(r.flags&128)!==0,E||v?(E=r.stateNode,d=v&&typeof d.getDerivedStateFromError!="function"?null:E.render(),r.flags|=1,s!==null&&v?(r.child=hs(r,s.child,null,S),r.child=hs(r,null,d,S)):Sn(s,r,d,S),r.memoizedState=E.state,s=r.child):s=sl(s,r,S),s}function Qd(s,r,d,v){return Xn(),r.flags|=256,Sn(s,r,d,v),r.child}function Mf(s){return{baseLanes:s,cachePool:Jd()}}function Rf(s,r,d){return s=s!==null?s.childLanes&~d:0,r&&(s|=ha),s}function Kd(s,r,d){var v=r.pendingProps,S=!1,E=(r.flags&128)!==0,B;if((B=E)||(B=s!==null&&s.memoizedState===null?!1:(nn.current&2)!==0),B&&(S=!0,r.flags&=-129),B=(r.flags&32)!==0,r.flags&=-33,s===null){if(se){if(S?Ai(r):nl(),se){var X=Mn,I;(I=X)&&(X=Sm(X,Fa),X!==null?(r.memoizedState={dehydrated:X,treeContext:di!==null?{id:Li,overflow:Za}:null,retryLane:536870912},I=a(18,null,null,0),I.stateNode=X,I.return=r,r.child=I,Un=r,Mn=null,I=!0):I=!1),I||fe(r)}if(X=r.memoizedState,X!==null&&(X=X.dehydrated,X!==null))return Fu(X)?r.lanes=16:r.lanes=536870912,null;Mi(r)}return X=v.children,v=v.fallback,S?(nl(),S=r.mode,X=zf({mode:"hidden",children:X},S),v=ml(v,S,d,null),X.return=r,v.return=r,X.sibling=v,r.child=X,S=r.child,S.memoizedState=Mf(d),S.childLanes=Rf(s,B,d),r.memoizedState=Gn,v):(Ai(r),zu(r,X))}if(I=s.memoizedState,I!==null&&(X=I.dehydrated,X!==null)){if(E)r.flags&256?(Ai(r),r.flags&=-257,r=wf(s,r,d)):r.memoizedState!==null?(nl(),r.child=s.child,r.flags|=128,r=null):(nl(),S=v.fallback,X=r.mode,v=zf({mode:"visible",children:v.children},X),S=ml(S,X,d,null),S.flags|=2,v.return=r,S.return=r,v.sibling=S,r.child=v,hs(r,s.child,null,d),v=r.child,v.memoizedState=Mf(d),v.childLanes=Rf(s,B,d),r.memoizedState=Gn,r=S);else if(Ai(r),Fu(X))B=mm(X).digest,v=Error(o(419)),v.stack="",v.digest=B,ta({value:v,source:null,stack:null}),r=wf(s,r,d);else if(Ze||Os(s,r,d,!1),B=(d&s.childLanes)!==0,Ze||B){if(B=Wt,B!==null){if(v=d&-d,(v&42)!==0)v=1;else switch(v){case 2:v=1;break;case 8:v=4;break;case 32:v=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:v=64;break;case 268435456:v=134217728;break;default:v=0}if(v=(v&(B.suspendedLanes|d))!==0?0:v,v!==0&&v!==I.retryLane)throw I.retryLane=v,li(s,v),Nn(B,s,v),Um}xc(X)||la(),r=wf(s,r,d)}else xc(X)?(r.flags|=128,r.child=s.child,r=Ys.bind(null,s),ny(X,r),r=null):(s=I.treeContext,Zn&&(Mn=vm(X),Un=r,se=!0,za=null,Fa=!1,s!==null&&(Ma[Ra++]=Li,Ma[Ra++]=Za,Ma[Ra++]=di,Li=s.id,Za=s.overflow,di=r)),r=zu(r,v.children),r.flags|=4096);return r}return S?(nl(),S=v.fallback,X=r.mode,I=s.child,E=I.sibling,v=Bn(I,{mode:"hidden",children:v.children}),v.subtreeFlags=I.subtreeFlags&31457280,E!==null?S=Bn(E,S):(S=ml(S,X,d,null),S.flags|=2),S.return=r,v.return=r,v.sibling=S,r.child=v,v=S,S=r.child,X=s.child.memoizedState,X===null?X=Mf(d):(I=X.cachePool,I!==null?(E=Gi?me._currentValue:me._currentValue2,I=I.parent!==E?{parent:E,pool:E}:I):I=Jd(),X={baseLanes:X.baseLanes|d,cachePool:I}),S.memoizedState=X,S.childLanes=Rf(s,B,d),r.memoizedState=Gn,v):(Ai(r),d=s.child,s=d.sibling,d=Bn(d,{mode:"visible",children:v.children}),d.return=r,d.sibling=null,s!==null&&(B=r.deletions,B===null?(r.deletions=[s],r.flags|=16):B.push(s)),r.child=d,r.memoizedState=null,d)}function zu(s,r){return r=zf({mode:"visible",children:r},s.mode),r.return=s,s.child=r}function zf(s,r){return uc(s,r,0,null)}function wf(s,r,d){return hs(r,s.child,null,d),s=zu(r,r.pendingProps.children),s.flags|=2,r.memoizedState=null,s}function Zd(s,r,d){s.lanes|=r;var v=s.alternate;v!==null&&(v.lanes|=r),Of(s.return,r,d)}function Ko(s,r,d,v,S){var E=s.memoizedState;E===null?s.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:v,tail:d,tailMode:S}:(E.isBackwards=r,E.rendering=null,E.renderingStartTime=0,E.last=v,E.tail=d,E.tailMode=S)}function Fd(s,r,d){var v=r.pendingProps,S=v.revealOrder,E=v.tail;if(Sn(s,r,v.children,d),v=nn.current,(v&2)!==0)v=v&1|2,r.flags|=128;else{if(s!==null&&(s.flags&128)!==0)t:for(s=r.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&Zd(s,d,r);else if(s.tag===19)Zd(s,d,r);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break t;for(;s.sibling===null;){if(s.return===null||s.return===r)break t;s=s.return}s.sibling.return=s.return,s=s.sibling}v&=1}switch(N(nn,v),S){case"forwards":for(d=r.child,S=null;d!==null;)s=d.alternate,s!==null&&si(s)===null&&(S=d),d=d.sibling;d=S,d===null?(S=r.child,r.child=null):(S=d.sibling,d.sibling=null),Ko(r,!1,S,d,E);break;case"backwards":for(d=null,S=r.child,r.child=null;S!==null;){if(s=S.alternate,s!==null&&si(s)===null){r.child=S;break}s=S.sibling,S.sibling=d,d=S,S=s}Ko(r,!0,d,null,E);break;case"together":Ko(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function sl(s,r,d){if(s!==null&&(r.dependencies=s.dependencies),Ba|=r.lanes,(d&r.childLanes)===0)if(s!==null){if(Os(s,r,d,!1),(d&r.childLanes)===0)return null}else return null;if(s!==null&&r.child!==s.child)throw Error(o(153));if(r.child!==null){for(s=r.child,d=Bn(s,s.pendingProps),r.child=d,d.return=r;s.sibling!==null;)s=s.sibling,d=d.sibling=Bn(s,s.pendingProps),d.return=r;d.sibling=null}return r.child}function Df(s,r){return(s.lanes&r)!==0?!0:(s=s.dependencies,!!(s!==null&&kl(s)))}function $p(s,r,d){switch(r.tag){case 3:pt(r,r.stateNode.containerInfo),Vl(r,me,s.memoizedState.cache),Xn();break;case 27:case 5:At(r);break;case 4:pt(r,r.stateNode.containerInfo);break;case 10:Vl(r,r.type,r.memoizedProps.value);break;case 13:var v=r.memoizedState;if(v!==null)return v.dehydrated!==null?(Ai(r),r.flags|=128,null):(d&r.child.childLanes)!==0?Kd(s,r,d):(Ai(r),s=sl(s,r,d),s!==null?s.sibling:null);Ai(r);break;case 19:var S=(s.flags&128)!==0;if(v=(d&r.childLanes)!==0,v||(Os(s,r,d,!1),v=(d&r.childLanes)!==0),S){if(v)return Fd(s,r,d);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),N(nn,nn.current),v)break;return null;case 22:case 23:return r.lanes=0,Xd(s,r,d);case 24:Vl(r,me,s.memoizedState.cache)}return sl(s,r,d)}function Wd(s,r,d){if(s!==null)if(s.memoizedProps!==r.pendingProps)Ze=!0;else{if(!Df(s,d)&&(r.flags&128)===0)return Ze=!1,$p(s,r,d);Ze=(s.flags&131072)!==0}else Ze=!1,se&&(r.flags&1048576)!==0&&U(r,to,r.index);switch(r.lanes=0,r.tag){case 16:t:{s=r.pendingProps;var v=r.elementType,S=v._init;if(v=S(v._payload),r.type=v,typeof v=="function")hl(v)?(s=ui(v,s),r.tag=1,r=Af(null,r,v,s,d)):(r.tag=0,r=Cf(null,r,v,s,d));else{if(v!=null){if(S=v.$$typeof,S===Ur){r.tag=11,r=qd(null,r,v,s,d);break t}else if(S===qu){r.tag=14,r=Ld(null,r,v,s,d);break t}}throw r=h(v)||v,Error(o(306,r,""))}}return r;case 0:return Cf(s,r,r.type,r.pendingProps,d);case 1:return v=r.type,S=ui(v,r.pendingProps),Af(s,r,v,S,d);case 3:t:{if(pt(r,r.stateNode.containerInfo),s===null)throw Error(o(387));var E=r.pendingProps;S=r.memoizedState,v=S.element,mf(s,r),fu(r,E,null,d);var B=r.memoizedState;if(E=B.cache,Vl(r,me,E),E!==S.cache&&Nf(r,[me],d,!0),cu(),E=B.element,Zn&&S.isDehydrated)if(S={element:E,isDehydrated:!1,cache:B.cache},r.updateQueue.baseState=S,r.memoizedState=S,r.flags&256){r=Qd(s,r,E,d);break t}else if(E!==v){v=rt(Error(o(424)),r),ta(v),r=Qd(s,r,E,d);break t}else for(Zn&&(Mn=gm(r.stateNode.containerInfo),Un=r,se=!0,za=null,Fa=!0),d=Nh(r,null,E,d),r.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling;else{if(Xn(),E===v){r=sl(s,r,d);break t}Sn(s,r,E,d)}r=r.child}return r;case 26:if(Ca)return Ru(s,r),s===null?(d=Ec(r.type,null,r.pendingProps,null))?r.memoizedState=d:se||(r.stateNode=iy(r.type,r.pendingProps,mi.current,r)):r.memoizedState=Ec(r.type,s.memoizedProps,r.pendingProps,s.memoizedState),null;case 27:if(Cn)return At(r),s===null&&Cn&&se&&(v=r.stateNode=zh(r.type,r.pendingProps,mi.current,bn.current,!1),Un=r,Fa=!0,Mn=bc(v)),v=r.pendingProps.children,s!==null||se?Sn(s,r,v,d):r.child=hs(r,null,v,d),Ru(s,r),r.child;case 5:return s===null&&se&&(Am(r.type,r.pendingProps,bn.current),(S=v=Mn)&&(v=xm(v,r.type,r.pendingProps,Fa),v!==null?(r.stateNode=v,Un=r,Mn=bc(v),Fa=!1,S=!0):S=!1),S||fe(r)),At(r),S=r.type,E=r.pendingProps,B=s!==null?s.memoizedProps:null,v=E.children,rs(S,E)?v=null:B!==null&&rs(S,B)&&(r.flags|=32),r.memoizedState!==null&&(S=Hl(s,r,Ip,null,null,d),Gi?Ut._currentValue=S:Ut._currentValue2=S),Ru(s,r),Sn(s,r,v,d),r.child;case 6:return s===null&&se&&(Mm(r.pendingProps,bn.current),(s=d=Mn)&&(d=bm(d,r.pendingProps,Fa),d!==null?(r.stateNode=d,Un=r,Mn=null,s=!0):s=!1),s||fe(r)),null;case 13:return Kd(s,r,d);case 4:return pt(r,r.stateNode.containerInfo),v=r.pendingProps,s===null?r.child=hs(r,null,v,d):Sn(s,r,v,d),r.child;case 11:return qd(s,r,r.type,r.pendingProps,d);case 7:return Sn(s,r,r.pendingProps,d),r.child;case 8:return Sn(s,r,r.pendingProps.children,d),r.child;case 12:return Sn(s,r,r.pendingProps.children,d),r.child;case 10:return v=r.pendingProps,Vl(r,r.type,v.value),Sn(s,r,v.children,d),r.child;case 9:return S=r.type._context,v=r.pendingProps.children,Ns(r),S=_n(S),v=v(S),r.flags|=1,Sn(s,r,v,d),r.child;case 14:return Ld(s,r,r.type,r.pendingProps,d);case 15:return Qo(s,r,r.type,r.pendingProps,d);case 19:return Fd(s,r,d);case 22:return Xd(s,r,d);case 24:return Ns(r),v=_n(me),s===null?(S=Ql(),S===null&&(S=Wt,E=Zo(),S.pooledCache=E,E.refCount++,E!==null&&(S.pooledCacheLanes|=d),S=E),r.memoizedState={parent:v,cache:S},df(r),Vl(r,me,S)):((s.lanes&d)!==0&&(mf(s,r),fu(r,null,null,d),cu()),S=s.memoizedState,E=r.memoizedState,S.parent!==v?(S={parent:v,cache:v},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),Vl(r,me,v)):(v=E.cache,Vl(r,me,v),v!==S.cache&&Nf(r,[me],d,!0))),Sn(s,r,r.pendingProps.children,d),r.child;case 29:throw r.pendingProps}throw Error(o(156,r.tag))}function Vl(s,r,d){Gi?(N(ca,r._currentValue),r._currentValue=d):(N(ca,r._currentValue2),r._currentValue2=d)}function rl(s){var r=ca.current;Gi?s._currentValue=r:s._currentValue2=r,D(ca)}function Of(s,r,d){for(;s!==null;){var v=s.alternate;if((s.childLanes&r)!==r?(s.childLanes|=r,v!==null&&(v.childLanes|=r)):v!==null&&(v.childLanes&r)!==r&&(v.childLanes|=r),s===d)break;s=s.return}}function Nf(s,r,d,v){var S=s.child;for(S!==null&&(S.return=s);S!==null;){var E=S.dependencies;if(E!==null){var B=S.child;E=E.firstContext;t:for(;E!==null;){var X=E;E=S;for(var I=0;I<r.length;I++)if(X.context===r[I]){E.lanes|=d,X=E.alternate,X!==null&&(X.lanes|=d),Of(E.return,d,s),v||(B=null);break t}E=X.next}}else if(S.tag===18){if(B=S.return,B===null)throw Error(o(341));B.lanes|=d,E=B.alternate,E!==null&&(E.lanes|=d),Of(B,d,s),B=null}else B=S.child;if(B!==null)B.return=S;else for(B=S;B!==null;){if(B===s){B=null;break}if(S=B.sibling,S!==null){S.return=B.return,B=S;break}B=B.return}S=B}}function Os(s,r,d,v){s=null;for(var S=r,E=!1;S!==null;){if(!E){if((S.flags&524288)!==0)E=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var B=S.alternate;if(B===null)throw Error(o(387));if(B=B.memoizedProps,B!==null){var X=S.type;Aa(S.pendingProps.value,B.value)||(s!==null?s.push(X):s=[X])}}else if(S===Vr.current){if(B=S.alternate,B===null)throw Error(o(387));B.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(s!==null?s.push(Ut):s=[Ut])}S=S.return}s!==null&&Nf(r,s,d,v),r.flags|=262144}function kl(s){for(s=s.firstContext;s!==null;){var r=s.context;if(!Aa(Gi?r._currentValue:r._currentValue2,s.memoizedValue))return!0;s=s.next}return!1}function Ns(s){ms=s,Xe=null,s=s.dependencies,s!==null&&(s.firstContext=null)}function _n(s){return Bf(ms,s)}function wu(s,r){return ms===null&&Ns(s),Bf(s,r)}function Bf(s,r){var d=Gi?r._currentValue:r._currentValue2;if(r={context:r,memoizedValue:d,next:null},Xe===null){if(s===null)throw Error(o(308));Xe=r,s.dependencies={lanes:0,firstContext:r},s.flags|=524288}else Xe=Xe.next=r;return d}function Zo(){return{controller:new Hm,data:new Map,refCount:0}}function Sr(s){s.refCount--,s.refCount===0&&_l(Ws,function(){s.controller.abort()})}function Ql(){var s=Tl.current;return s!==null?s:Wt.pooledCache}function Fo(s,r){r===null?N(Tl,Tl.current):N(Tl,r.pool)}function Jd(){var s=Ql();return s===null?null:{parent:Gi?me._currentValue:me._currentValue2,pool:s}}function ba(s){s.flags|=4}function jf(s,r){if(s!==null&&s.child===r.child)return!1;if((r.flags&16)!==0)return!0;for(s=r.child;s!==null;){if((s.flags&13878)!==0||(s.subtreeFlags&13878)!==0)return!0;s=s.sibling}return!1}function Wo(s,r,d,v){if(En)for(d=r.child;d!==null;){if(d.tag===5||d.tag===6)Hi(s,d.stateNode);else if(!(d.tag===4||Cn&&d.tag===27)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===r)break;for(;d.sibling===null;){if(d.return===null||d.return===r)return;d=d.return}d.sibling.return=d.return,d=d.sibling}else if(Ta)for(var S=r.child;S!==null;){if(S.tag===5){var E=S.stateNode;d&&v&&(E=yh(E,S.type,S.memoizedProps)),Hi(s,E)}else if(S.tag===6)E=S.stateNode,d&&v&&(E=gh(E,S.memoizedProps)),Hi(s,E);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)E=S.child,E!==null&&(E.return=S),Wo(s,S,!0,!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===r)break;for(;S.sibling===null;){if(S.return===null||S.return===r)return;S=S.return}S.sibling.return=S.return,S=S.sibling}}function _r(s,r,d,v){if(Ta)for(var S=r.child;S!==null;){if(S.tag===5){var E=S.stateNode;d&&v&&(E=yh(E,S.type,S.memoizedProps)),mh(s,E)}else if(S.tag===6)E=S.stateNode,d&&v&&(E=gh(E,S.memoizedProps)),mh(s,E);else if(S.tag!==4){if(S.tag===22&&S.memoizedState!==null)E=S.child,E!==null&&(E.return=S),_r(s,S,!(S.memoizedProps!==null&&S.memoizedProps.mode==="manual"),!0);else if(S.child!==null){S.child.return=S,S=S.child;continue}}if(S===r)break;for(;S.sibling===null;){if(S.return===null||S.return===r)return;S=S.return}S.sibling.return=S.return,S=S.sibling}}function Tr(s,r){if(Ta&&jf(s,r)){s=r.stateNode;var d=s.containerInfo,v=vc();_r(v,r,!1,!1),s.pendingChildren=v,ba(r),dm(d,v)}}function Uf(s,r,d,v){if(En)s.memoizedProps!==v&&ba(r);else if(Ta){var S=s.stateNode,E=s.memoizedProps;if((s=jf(s,r))||E!==v){var B=bn.current;E=dh(S,d,E,v,!s,null),E===S?r.stateNode=S:(yl(E,d,v,B)&&ba(r),r.stateNode=E,s?Wo(E,r,!1,!1):ba(r))}else r.stateNode=S}}function Er(s,r,d){if(cm(r,d)){if(s.flags|=16777216,!gl(r,d))if(Uu())s.flags|=8192;else throw Fs=zc,Oh}else s.flags&=-16777217}function Hf(s,r){if(Rm(r)){if(s.flags|=16777216,!Mh(r))if(Uu())s.flags|=8192;else throw Fs=zc,Oh}else s.flags&=-16777217}function Du(s,r){r!==null&&(s.flags|=4),s.flags&16384&&(r=s.tag!==22?L():536870912,s.lanes|=r,Cl|=r)}function Bs(s,r){if(!se)switch(s.tailMode){case"hidden":r=s.tail;for(var d=null;r!==null;)r.alternate!==null&&(d=r),r=r.sibling;d===null?s.tail=null:d.sibling=null;break;case"collapsed":d=s.tail;for(var v=null;d!==null;)d.alternate!==null&&(v=d),d=d.sibling;v===null?r||s.tail===null?s.tail=null:s.tail.sibling=null:v.sibling=null}}function De(s){var r=s.alternate!==null&&s.alternate.child===s.child,d=0,v=0;if(r)for(var S=s.child;S!==null;)d|=S.lanes|S.childLanes,v|=S.subtreeFlags&31457280,v|=S.flags&31457280,S.return=s,S=S.sibling;else for(S=s.child;S!==null;)d|=S.lanes|S.childLanes,v|=S.subtreeFlags,v|=S.flags,S.return=s,S=S.sibling;return s.subtreeFlags|=v,s.childLanes=d,r}function Pd(s,r,d){var v=r.pendingProps;switch(tt(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return De(r),null;case 1:return De(r),null;case 3:return d=r.stateNode,v=null,s!==null&&(v=s.memoizedState.cache),r.memoizedState.cache!==v&&(r.flags|=2048),rl(me),_t(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(s===null||s.child===null)&&(La(r)?ba(r):s===null||s.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,za!==null&&(ol(za),za=null))),Tr(s,r),De(r),null;case 26:if(Ca){d=r.type;var S=r.memoizedState;return s===null?(ba(r),S!==null?(De(r),Hf(r,S)):(De(r),Er(r,d,v))):S?S!==s.memoizedState?(ba(r),De(r),Hf(r,S)):(De(r),r.flags&=-16777217):(En?s.memoizedProps!==v&&ba(r):Uf(s,r,d,v),De(r),Er(r,d,v)),null}case 27:if(Cn){if(Ot(r),d=mi.current,S=r.type,s!==null&&r.stateNode!=null)En?s.memoizedProps!==v&&ba(r):Uf(s,r,S,v);else{if(!v){if(r.stateNode===null)throw Error(o(166));return De(r),null}s=bn.current,La(r)?ce(r,s):(s=zh(S,v,d,s,!0),r.stateNode=s,ba(r))}return De(r),null}case 5:if(Ot(r),d=r.type,s!==null&&r.stateNode!=null)Uf(s,r,d,v);else{if(!v){if(r.stateNode===null)throw Error(o(166));return De(r),null}s=bn.current,La(r)?ce(r,s):(S=nh(d,v,mi.current,s,r),Wo(S,r,!1,!1),r.stateNode=S,yl(S,d,v,s)&&ba(r))}return De(r),Er(r,r.type,r.pendingProps),null;case 6:if(s&&r.stateNode!=null)d=s.memoizedProps,En?d!==v&&ba(r):Ta&&(d!==v?(r.stateNode=hc(v,mi.current,bn.current,r),ba(r)):r.stateNode=s.stateNode);else{if(typeof v!="string"&&r.stateNode===null)throw Error(o(166));if(s=mi.current,d=bn.current,La(r)){if(!Zn)throw Error(o(176));if(s=r.stateNode,d=r.memoizedProps,v=null,S=Un,S!==null)switch(S.tag){case 27:case 5:v=S.memoizedProps}_m(s,d,r,v)||fe(r)}else r.stateNode=hc(v,s,d,r)}return De(r),null;case 13:if(v=r.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(S=La(r),v!==null&&v.dehydrated!==null){if(s===null){if(!S)throw Error(o(318));if(!Zn)throw Error(o(344));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(o(317));Gr(S,r)}else Xn(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;De(r),S=!1}else za!==null&&(ol(za),za=null),S=!0;if(!S)return r.flags&256?(Mi(r),r):(Mi(r),null)}if(Mi(r),(r.flags&128)!==0)return r.lanes=d,r;if(d=v!==null,s=s!==null&&s.memoizedState!==null,d){v=r.child,S=null,v.alternate!==null&&v.alternate.memoizedState!==null&&v.alternate.memoizedState.cachePool!==null&&(S=v.alternate.memoizedState.cachePool.pool);var E=null;v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(E=v.memoizedState.cachePool.pool),E!==S&&(v.flags|=2048)}return d!==s&&d&&(r.child.flags|=8192),Du(r,r.updateQueue),De(r),null;case 4:return _t(),Tr(s,r),s===null&&lh(r.stateNode.containerInfo),De(r),null;case 10:return rl(r.type),De(r),null;case 19:if(D(nn),S=r.memoizedState,S===null)return De(r),null;if(v=(r.flags&128)!==0,E=S.rendering,E===null)if(v)Bs(S,!1);else{if(ae!==0||s!==null&&(s.flags&128)!==0)for(s=r.child;s!==null;){if(E=si(s),E!==null){for(r.flags|=128,Bs(S,!1),s=E.updateQueue,r.updateQueue=s,Du(r,s),r.subtreeFlags=0,s=d,d=r.child;d!==null;)dl(d,s),d=d.sibling;return N(nn,nn.current&1|2),r.child}s=s.sibling}S.tail!==null&&An()>He&&(r.flags|=128,v=!0,Bs(S,!1),r.lanes=4194304)}else{if(!v)if(s=si(E),s!==null){if(r.flags|=128,v=!0,s=s.updateQueue,r.updateQueue=s,Du(r,s),Bs(S,!0),S.tail===null&&S.tailMode==="hidden"&&!E.alternate&&!se)return De(r),null}else 2*An()-S.renderingStartTime>He&&d!==536870912&&(r.flags|=128,v=!0,Bs(S,!1),r.lanes=4194304);S.isBackwards?(E.sibling=r.child,r.child=E):(s=S.last,s!==null?s.sibling=E:r.child=E,S.last=E)}return S.tail!==null?(r=S.tail,S.rendering=r,S.tail=r.sibling,S.renderingStartTime=An(),r.sibling=null,s=nn.current,N(nn,v?s&1|2:s&1),r):(De(r),null);case 22:case 23:return Mi(r),wo(),v=r.memoizedState!==null,s!==null?s.memoizedState!==null!==v&&(r.flags|=8192):v&&(r.flags|=8192),v?(d&536870912)!==0&&(r.flags&128)===0&&(De(r),r.subtreeFlags&6&&(r.flags|=8192)):De(r),d=r.updateQueue,d!==null&&Du(r,d.retryQueue),d=null,s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),v=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(v=r.memoizedState.cachePool.pool),v!==d&&(r.flags|=2048),s!==null&&D(Tl),null;case 24:return d=null,s!==null&&(d=s.memoizedState.cache),r.memoizedState.cache!==d&&(r.flags|=2048),rl(me),De(r),null;case 25:return null}throw Error(o(156,r.tag))}function Id(s,r){switch(tt(r),r.tag){case 1:return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 3:return rl(me),_t(),s=r.flags,(s&65536)!==0&&(s&128)===0?(r.flags=s&-65537|128,r):null;case 26:case 27:case 5:return Ot(r),null;case 13:if(Mi(r),s=r.memoizedState,s!==null&&s.dehydrated!==null){if(r.alternate===null)throw Error(o(340));Xn()}return s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 19:return D(nn),null;case 4:return _t(),null;case 10:return rl(r.type),null;case 22:case 23:return Mi(r),wo(),s!==null&&D(Tl),s=r.flags,s&65536?(r.flags=s&-65537|128,r):null;case 24:return rl(me),null;case 25:return null;default:return null}}function Gf(s,r){switch(tt(r),r.tag){case 3:rl(me),_t();break;case 26:case 27:case 5:Ot(r);break;case 4:_t();break;case 13:Mi(r);break;case 19:D(nn);break;case 10:rl(r.type);break;case 22:case 23:Mi(r),wo(),s!==null&&D(Tl);break;case 24:rl(me)}}function Ou(s,r){try{var d=r.updateQueue,v=d!==null?d.lastEffect:null;if(v!==null){var S=v.next;d=S;do{if((d.tag&s)===s){v=void 0;var E=d.create,B=d.inst;v=E(),B.destroy=v}d=d.next}while(d!==S)}}catch(X){It(r,r.return,X)}}function Kl(s,r,d){try{var v=r.updateQueue,S=v!==null?v.lastEffect:null;if(S!==null){var E=S.next;v=E;do{if((v.tag&s)===s){var B=v.inst,X=B.destroy;if(X!==void 0){B.destroy=void 0,S=r;var I=d;try{X()}catch(ht){It(S,I,ht)}}}v=v.next}while(v!==E)}}catch(ht){It(r,r.return,ht)}}function $d(s){var r=s.updateQueue;if(r!==null){var d=s.stateNode;try{hu(r,d)}catch(v){It(s,s.return,v)}}}function tm(s,r,d){d.props=ui(s.type,s.memoizedProps),d.state=s.memoizedState;try{d.componentWillUnmount()}catch(v){It(s,r,v)}}function js(s,r){try{var d=s.ref;if(d!==null){var v=s.stateNode;switch(s.tag){case 26:case 27:case 5:var S=Hr(v);break;default:S=v}typeof d=="function"?s.refCleanup=d(S):d.current=S}}catch(E){It(s,r,E)}}function Oe(s,r){var d=s.ref,v=s.refCleanup;if(d!==null)if(typeof v=="function")try{v()}catch(S){It(s,r,S)}finally{s.refCleanup=null,s=s.alternate,s!=null&&(s.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(S){It(s,r,S)}else d.current=null}function Cr(s){var r=s.type,d=s.memoizedProps,v=s.stateNode;try{ey(v,r,d,s)}catch(S){It(s,s.return,S)}}function Yf(s,r,d){try{oh(s.stateNode,s.type,d,r,s)}catch(v){It(s,s.return,v)}}function qf(s){return s.tag===5||s.tag===3||(Ca?s.tag===26:!1)||(Cn?s.tag===27:!1)||s.tag===4}function Jo(s){t:for(;;){for(;s.sibling===null;){if(s.return===null||qf(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&(!Cn||s.tag!==27)&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue t;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Po(s,r,d){var v=s.tag;if(v===5||v===6)s=s.stateNode,r?fh(d,s,r):fm(d,s);else if(!(v===4||Cn&&v===27)&&(s=s.child,s!==null))for(Po(s,r,d),s=s.sibling;s!==null;)Po(s,r,d),s=s.sibling}function Ar(s,r,d){var v=s.tag;if(v===5||v===6)s=s.stateNode,r?ch(d,s,r):uh(d,s);else if(!(v===4||Cn&&v===27)&&(s=s.child,s!==null))for(Ar(s,r,d),s=s.sibling;s!==null;)Ar(s,r,d),s=s.sibling}function em(s,r,d){s=s.containerInfo;try{ph(s,d)}catch(v){It(r,r.return,v)}}function Mr(s,r){for(ss(s.containerInfo),Ve=r;Ve!==null;)if(s=Ve,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,Ve=r;else for(;Ve!==null;){s=Ve;var d=s.alternate;switch(r=s.flags,s.tag){case 0:break;case 11:case 15:break;case 1:if((r&1024)!==0&&d!==null){r=void 0;var v=s,S=d.memoizedProps;d=d.memoizedState;var E=v.stateNode;try{var B=ui(v.type,S,v.elementType===v.type);r=E.getSnapshotBeforeUpdate(B,d),E.__reactInternalSnapshotBeforeUpdate=r}catch(X){It(v,v.return,X)}}break;case 3:(r&1024)!==0&&En&&gc(s.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(o(163))}if(r=s.sibling,r!==null){r.return=s.return,Ve=r;break}Ve=s.return}return B=Js,Js=!1,B}function Io(s,r,d){var v=d.flags;switch(d.tag){case 0:case 11:case 15:Di(s,d),v&4&&Ou(5,d);break;case 1:if(Di(s,d),v&4)if(s=d.stateNode,r===null)try{s.componentDidMount()}catch(X){It(d,d.return,X)}else{var S=ui(d.type,r.memoizedProps);r=r.memoizedState;try{s.componentDidUpdate(S,r,s.__reactInternalSnapshotBeforeUpdate)}catch(X){It(d,d.return,X)}}v&64&&$d(d),v&512&&js(d,d.return);break;case 3:if(Di(s,d),v&64&&(v=d.updateQueue,v!==null)){if(s=null,d.child!==null)switch(d.child.tag){case 27:case 5:s=Hr(d.child.stateNode);break;case 1:s=d.child.stateNode}try{hu(v,s)}catch(X){It(d,d.return,X)}}break;case 26:if(Ca){Di(s,d),v&512&&js(d,d.return);break}case 27:case 5:Di(s,d),r===null&&v&4&&Cr(d),v&512&&js(d,d.return);break;case 12:Di(s,d);break;case 13:Di(s,d),v&4&&Zl(s,d);break;case 22:if(S=d.memoizedState!==null||hn,!S){r=r!==null&&r.memoizedState!==null||Ue;var E=hn,B=Ue;hn=S,(Ue=r)&&!B?Wl(s,d,(d.subtreeFlags&8772)!==0):Di(s,d),hn=E,Ue=B}v&512&&(d.memoizedProps.mode==="manual"?js(d,d.return):Oe(d,d.return));break;default:Di(s,d)}}function Rr(s){var r=s.alternate;r!==null&&(s.alternate=null,Rr(r)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(r=s.stateNode,r!==null&&sh(r)),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Sa(s,r,d){for(d=d.child;d!==null;)$o(s,r,d),d=d.sibling}function $o(s,r,d){if(ua&&typeof ua.onCommitFiberUnmount=="function")try{ua.onCommitFiberUnmount(Xr,d)}catch{}switch(d.tag){case 26:if(Ca){Ue||Oe(d,r),Sa(s,r,d),d.memoizedState?_h(d.memoizedState):d.stateNode&&Ch(d.stateNode);break}case 27:if(Cn){Ue||Oe(d,r);var v=Fe,S=fa;Fe=d.stateNode,Sa(s,r,d),zm(d.stateNode),Fe=v,fa=S;break}case 5:Ue||Oe(d,r);case 6:if(En){if(v=Fe,S=fa,Fe=null,Sa(s,r,d),Fe=v,fa=S,Fe!==null)if(fa)try{Qe(Fe,d.stateNode)}catch(E){It(d,r,E)}else try{Fn(Fe,d.stateNode)}catch(E){It(d,r,E)}}else Sa(s,r,d);break;case 18:En&&Fe!==null&&(fa?xh(Fe,d.stateNode):Em(Fe,d.stateNode));break;case 4:En?(v=Fe,S=fa,Fe=d.stateNode.containerInfo,fa=!0,Sa(s,r,d),Fe=v,fa=S):(Ta&&em(d.stateNode,d,vc()),Sa(s,r,d));break;case 0:case 11:case 14:case 15:Ue||Kl(2,d,r),Ue||Kl(4,d,r),Sa(s,r,d);break;case 1:Ue||(Oe(d,r),v=d.stateNode,typeof v.componentWillUnmount=="function"&&tm(d,r,v)),Sa(s,r,d);break;case 21:Sa(s,r,d);break;case 22:Ue||Oe(d,r),Ue=(v=Ue)||d.memoizedState!==null,Sa(s,r,d),Ue=v;break;default:Sa(s,r,d)}}function Zl(s,r){if(Zn&&r.memoizedState===null&&(s=r.alternate,s!==null&&(s=s.memoizedState,s!==null&&(s=s.dehydrated,s!==null))))try{_c(s)}catch(d){It(r,r.return,d)}}function zr(s){switch(s.tag){case 13:case 19:var r=s.stateNode;return r===null&&(r=s.stateNode=new Fr),r;case 22:return s=s.stateNode,r=s._retryCache,r===null&&(r=s._retryCache=new Fr),r;default:throw Error(o(435,s.tag))}}function Nu(s,r){var d=zr(s);r.forEach(function(v){var S=Qf.bind(null,s,v);d.has(v)||(d.add(v),v.then(S,S))})}function kn(s,r){var d=r.deletions;if(d!==null)for(var v=0;v<d.length;v++){var S=d[v],E=s,B=r;if(En){var X=B;t:for(;X!==null;){switch(X.tag){case 27:case 5:Fe=X.stateNode,fa=!1;break t;case 3:Fe=X.stateNode.containerInfo,fa=!0;break t;case 4:Fe=X.stateNode.containerInfo,fa=!0;break t}X=X.return}if(Fe===null)throw Error(o(160));$o(E,B,S),Fe=null,fa=!1}else $o(E,B,S);E=S.alternate,E!==null&&(E.return=null),S.return=null}if(r.subtreeFlags&13878)for(r=r.child;r!==null;)Fl(r,s),r=r.sibling}function Fl(s,r){var d=s.alternate,v=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:kn(r,s),aa(s),v&4&&(Kl(3,s,s.return),Ou(3,s),Kl(5,s,s.return));break;case 1:kn(r,s),aa(s),v&512&&(Ue||d===null||Oe(d,d.return)),v&64&&hn&&(s=s.updateQueue,s!==null&&(v=s.callbacks,v!==null&&(d=s.shared.hiddenCallbacks,s.shared.hiddenCallbacks=d===null?v:d.concat(v))));break;case 26:if(Ca){var S=Wn;kn(r,s),aa(s),v&512&&(Ue||d===null||Oe(d,d.return)),v&4&&(v=d!==null?d.memoizedState:null,r=s.memoizedState,d===null?r===null?s.stateNode===null?s.stateNode=Th(S,s.type,s.memoizedProps,s):Eh(S,s.type,s.stateNode):s.stateNode=Sh(S,r,s.memoizedProps):v!==r?(v===null?d.stateNode!==null&&Ch(d.stateNode):_h(v),r===null?Eh(S,s.type,s.stateNode):Sh(S,r,s.memoizedProps)):r===null&&s.stateNode!==null&&Yf(s,s.memoizedProps,d.memoizedProps));break}case 27:if(Cn&&v&4&&s.alternate===null){S=s.stateNode;var E=s.memoizedProps;try{ly(S),sy(s.type,E,S,s)}catch(bt){It(s,s.return,bt)}}case 5:if(kn(r,s),aa(s),v&512&&(Ue||d===null||Oe(d,d.return)),En){if(s.flags&32){r=s.stateNode;try{Ku(r)}catch(bt){It(s,s.return,bt)}}v&4&&s.stateNode!=null&&(r=s.memoizedProps,Yf(s,r,d!==null?d.memoizedProps:r)),v&1024&&(ps=!0)}break;case 6:if(kn(r,s),aa(s),v&4&&En){if(s.stateNode===null)throw Error(o(162));v=s.memoizedProps,d=d!==null?d.memoizedProps:v,r=s.stateNode;try{hm(r,d,v)}catch(bt){It(s,s.return,bt)}}break;case 3:if(Ca?(Ah(),S=Wn,Wn=Tc(r.containerInfo),kn(r,s),Wn=S):kn(r,s),aa(s),v&4){if(En&&Zn&&d!==null&&d.memoizedState.isDehydrated)try{Sc(r.containerInfo)}catch(bt){It(s,s.return,bt)}if(Ta){v=r.containerInfo,d=r.pendingChildren;try{ph(v,d)}catch(bt){It(s,s.return,bt)}}}ps&&(ps=!1,Lf(s));break;case 4:Ca?(d=Wn,Wn=Tc(s.stateNode.containerInfo),kn(r,s),aa(s),Wn=d):(kn(r,s),aa(s)),v&4&&Ta&&em(s.stateNode,s,s.stateNode.pendingChildren);break;case 12:kn(r,s),aa(s);break;case 13:kn(r,s),aa(s),s.child.flags&8192&&s.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(Qi=An()),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Nu(s,v)));break;case 22:v&512&&(Ue||d===null||Oe(d,d.return)),S=s.memoizedState!==null;var B=d!==null&&d.memoizedState!==null,X=hn,I=Ue;if(hn=X||S,Ue=I||B,kn(r,s),Ue=I,hn=X,aa(s),r=s.stateNode,r._current=s,r._visibility&=-3,r._visibility|=r._pendingVisibility&2,v&8192&&(r._visibility=S?r._visibility&-2:r._visibility|1,S&&(r=hn||Ue,d===null||B||r||wr(s)),En&&(s.memoizedProps===null||s.memoizedProps.mode!=="manual"))){t:if(d=null,En)for(r=s;;){if(r.tag===5||Ca&&r.tag===26||Cn&&r.tag===27){if(d===null){B=d=r;try{E=B.stateNode,S?Zu(E):hh(B.stateNode,B.memoizedProps)}catch(bt){It(B,B.return,bt)}}}else if(r.tag===6){if(d===null){B=r;try{var ht=B.stateNode;S?yc(ht):vl(ht,B.memoizedProps)}catch(bt){It(B,B.return,bt)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===s)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break t;for(;r.sibling===null;){if(r.return===null||r.return===s)break t;d===r&&(d=null),r=r.return}d===r&&(d=null),r.sibling.return=r.return,r=r.sibling}}v&4&&(v=s.updateQueue,v!==null&&(d=v.retryQueue,d!==null&&(v.retryQueue=null,Nu(s,d))));break;case 19:kn(r,s),aa(s),v&4&&(v=s.updateQueue,v!==null&&(s.updateQueue=null,Nu(s,v)));break;case 21:break;default:kn(r,s),aa(s)}}function aa(s){var r=s.flags;if(r&2){try{if(En&&(!Cn||s.tag!==27)){t:{for(var d=s.return;d!==null;){if(qf(d)){var v=d;break t}d=d.return}throw Error(o(160))}switch(v.tag){case 27:if(Cn){var S=v.stateNode,E=Jo(s);Ar(s,E,S);break}case 5:var B=v.stateNode;v.flags&32&&(Ku(B),v.flags&=-33);var X=Jo(s);Ar(s,X,B);break;case 3:case 4:var I=v.stateNode.containerInfo,ht=Jo(s);Po(s,ht,I);break;default:throw Error(o(161))}}}catch(bt){It(s,s.return,bt)}s.flags&=-3}r&4096&&(s.flags&=-4097)}function Lf(s){if(s.subtreeFlags&1024)for(s=s.child;s!==null;){var r=s;Lf(r),r.tag===5&&r.flags&1024&&Se(r.stateNode),s=s.sibling}}function Di(s,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Io(s,r.alternate,r),r=r.sibling}function wr(s){for(s=s.child;s!==null;){var r=s;switch(r.tag){case 0:case 11:case 14:case 15:Kl(4,r,r.return),wr(r);break;case 1:Oe(r,r.return);var d=r.stateNode;typeof d.componentWillUnmount=="function"&&tm(r,r.return,d),wr(r);break;case 26:case 27:case 5:Oe(r,r.return),wr(r);break;case 22:Oe(r,r.return),r.memoizedState===null&&wr(r);break;default:wr(r)}s=s.sibling}}function Wl(s,r,d){for(d=d&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var v=r.alternate,S=s,E=r,B=E.flags;switch(E.tag){case 0:case 11:case 15:Wl(S,E,d),Ou(4,E);break;case 1:if(Wl(S,E,d),v=E,S=v.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(ht){It(v,v.return,ht)}if(v=E,S=v.updateQueue,S!==null){var X=v.stateNode;try{var I=S.shared.hiddenCallbacks;if(I!==null)for(S.shared.hiddenCallbacks=null,S=0;S<I.length;S++)zd(I[S],X)}catch(ht){It(v,v.return,ht)}}d&&B&64&&$d(E),js(E,E.return);break;case 26:case 27:case 5:Wl(S,E,d),d&&v===null&&B&4&&Cr(E),js(E,E.return);break;case 12:Wl(S,E,d);break;case 13:Wl(S,E,d),d&&B&4&&Zl(S,E);break;case 22:E.memoizedState===null&&Wl(S,E,d),js(E,E.return);break;default:Wl(S,E,d)}r=r.sibling}}function Xf(s,r){var d=null;s!==null&&s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(d=s.memoizedState.cachePool.pool),s=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(s=r.memoizedState.cachePool.pool),s!==d&&(s!=null&&s.refCount++,d!=null&&Sr(d))}function tc(s,r){s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Sr(s))}function ul(s,r,d,v){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)ec(s,r,d,v),r=r.sibling}function ec(s,r,d,v){var S=r.flags;switch(r.tag){case 0:case 11:case 15:ul(s,r,d,v),S&2048&&Ou(9,r);break;case 3:ul(s,r,d,v),S&2048&&(s=null,r.alternate!==null&&(s=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==s&&(r.refCount++,s!=null&&Sr(s)));break;case 12:if(S&2048){ul(s,r,d,v),s=r.stateNode;try{var E=r.memoizedProps,B=E.id,X=E.onPostCommit;typeof X=="function"&&X(B,r.alternate===null?"mount":"update",s.passiveEffectDuration,-0)}catch(I){It(r,r.return,I)}}else ul(s,r,d,v);break;case 23:break;case 22:E=r.stateNode,r.memoizedState!==null?E._visibility&4?ul(s,r,d,v):Jl(s,r):E._visibility&4?ul(s,r,d,v):(E._visibility|=4,On(s,r,d,v,(r.subtreeFlags&10256)!==0)),S&2048&&Xf(r.alternate,r);break;case 24:ul(s,r,d,v),S&2048&&tc(r.alternate,r);break;default:ul(s,r,d,v)}}function On(s,r,d,v,S){for(S=S&&(r.subtreeFlags&10256)!==0,r=r.child;r!==null;){var E=s,B=r,X=d,I=v,ht=B.flags;switch(B.tag){case 0:case 11:case 15:On(E,B,X,I,S),Ou(8,B);break;case 23:break;case 22:var bt=B.stateNode;B.memoizedState!==null?bt._visibility&4?On(E,B,X,I,S):Jl(E,B):(bt._visibility|=4,On(E,B,X,I,S)),S&&ht&2048&&Xf(B.alternate,B);break;case 24:On(E,B,X,I,S),S&&ht&2048&&tc(B.alternate,B);break;default:On(E,B,X,I,S)}r=r.sibling}}function Jl(s,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var d=s,v=r,S=v.flags;switch(v.tag){case 22:Jl(d,v),S&2048&&Xf(v.alternate,v);break;case 24:Jl(d,v),S&2048&&tc(v.alternate,v);break;default:Jl(d,v)}r=r.sibling}}function yn(s){if(s.subtreeFlags&Ps)for(s=s.child;s!==null;)Us(s),s=s.sibling}function Us(s){switch(s.tag){case 26:yn(s),s.flags&Ps&&(s.memoizedState!==null?Rh(Wn,s.memoizedState,s.memoizedProps):Ge(s.type,s.memoizedProps));break;case 5:yn(s),s.flags&Ps&&Ge(s.type,s.memoizedProps);break;case 3:case 4:if(Ca){var r=Wn;Wn=Tc(s.stateNode.containerInfo),yn(s),Wn=r}else yn(s);break;case 22:s.memoizedState===null&&(r=s.alternate,r!==null&&r.memoizedState!==null?(r=Ps,Ps=16777216,yn(s),Ps=r):yn(s));break;default:yn(s)}}function nc(s){var r=s.alternate;if(r!==null&&(s=r.child,s!==null)){r.child=null;do r=s.sibling,s.sibling=null,s=r;while(s!==null)}}function Pl(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var d=0;d<r.length;d++){var v=r[d];Ve=v,Il(v,s)}nc(s)}if(s.subtreeFlags&10256)for(s=s.child;s!==null;)Bu(s),s=s.sibling}function Bu(s){switch(s.tag){case 0:case 11:case 15:Pl(s),s.flags&2048&&Kl(9,s,s.return);break;case 3:Pl(s);break;case 12:Pl(s);break;case 22:var r=s.stateNode;s.memoizedState!==null&&r._visibility&4&&(s.return===null||s.return.tag!==13)?(r._visibility&=-5,Dr(s)):Pl(s);break;default:Pl(s)}}function Dr(s){var r=s.deletions;if((s.flags&16)!==0){if(r!==null)for(var d=0;d<r.length;d++){var v=r[d];Ve=v,Il(v,s)}nc(s)}for(s=s.child;s!==null;){switch(r=s,r.tag){case 0:case 11:case 15:Kl(8,r,r.return),Dr(r);break;case 22:d=r.stateNode,d._visibility&4&&(d._visibility&=-5,Dr(r));break;default:Dr(r)}s=s.sibling}}function Il(s,r){for(;Ve!==null;){var d=Ve;switch(d.tag){case 0:case 11:case 15:Kl(8,d,r);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var v=d.memoizedState.cachePool.pool;v!=null&&v.refCount++}break;case 24:Sr(d.memoizedState.cache)}if(v=d.child,v!==null)v.return=d,Ve=v;else t:for(d=s;Ve!==null;){v=Ve;var S=v.sibling,E=v.return;if(Rr(v),v===d){Ve=null;break t}if(S!==null){S.return=E,Ve=S;break t}Ve=E}}}function ac(s){var r=ih(s);if(r!=null){if(typeof r.memoizedProps["data-testname"]!="string")throw Error(o(364));return r}if(s=Qs(s),s===null)throw Error(o(362));return s.stateNode.current}function Or(s,r){var d=s.tag;switch(r.$$typeof){case uo:if(s.type===r.value)return!0;break;case Bc:t:{for(r=r.value,s=[s,0],d=0;d<s.length;){var v=s[d++],S=v.tag,E=s[d++],B=r[E];if(S!==5&&S!==26&&S!==27||!qi(v)){for(;B!=null&&Or(v,B);)E++,B=r[E];if(E===r.length){r=!0;break t}else for(v=v.child;v!==null;)s.push(v,E),v=v.sibling}}r=!1}return r;case jc:if((d===5||d===26||d===27)&&ty(s.stateNode,r.value))return!0;break;case pe:if((d===5||d===6||d===26||d===27)&&(s=Qu(s),s!==null&&0<=s.indexOf(r.value)))return!0;break;case ne:if((d===5||d===26||d===27)&&(s=s.memoizedProps["data-testname"],typeof s=="string"&&s.toLowerCase()===r.value.toLowerCase()))return!0;break;default:throw Error(o(365))}return!1}function $l(s){switch(s.$$typeof){case uo:return"<"+(h(s.value)||"Unknown")+">";case Bc:return":has("+($l(s)||"")+")";case jc:return'[role="'+s.value+'"]';case pe:return'"'+s.value+'"';case ne:return'[data-testname="'+s.value+'"]';default:throw Error(o(365))}}function nm(s,r){var d=[];s=[s,0];for(var v=0;v<s.length;){var S=s[v++],E=S.tag,B=s[v++],X=r[B];if(E!==5&&E!==26&&E!==27||!qi(S)){for(;X!=null&&Or(S,X);)B++,X=r[B];if(B===r.length)d.push(S);else for(S=S.child;S!==null;)s.push(S,B),S=S.sibling}}return d}function Qn(s,r){if(!Yi)throw Error(o(363));s=ac(s),s=nm(s,r),r=[],s=Array.from(s);for(var d=0;d<s.length;){var v=s[d++],S=v.tag;if(S===5||S===26||S===27)qi(v)||r.push(v.stateNode);else for(v=v.child;v!==null;)s.push(v),v=v.sibling}return r}function Kn(){if((wt&2)!==0&&Kt!==0)return Kt&-Kt;if(Nt.T!==null){var s=oa;return s!==0?s:Ao()}return Ka()}function Oi(){ha===0&&(ha=(Kt&536870912)===0||se?W():536870912);var s=Oa.current;return s!==null&&(s.flags|=32),ha}function Nn(s,r,d){(s===Wt&&_e===2||s.cancelPendingCommit!==null)&&(ci(s,0),oi(s,Kt,ha,!1)),et(s,d),((wt&2)===0||s!==Wt)&&(s===Wt&&((wt&2)===0&&(gi|=d),ae===4&&oi(s,Kt,ha,!1)),Xa(s))}function ju(s,r,d){if((wt&6)!==0)throw Error(o(327));var v=!d&&(r&60)===0&&(r&s.expiredLanes)===0||q(s,r),S=v?ji(s,r):Ni(s,r,!0),E=v;do{if(S===0){Na&&!v&&oi(s,r,0,!1);break}else if(S===6)oi(s,r,0,!ye);else{if(d=s.current.alternate,E&&!am(d)){S=Ni(s,r,!1),E=!1;continue}if(S===2){if(E=r,s.errorRecoveryDisabledLanes&E)var B=0;else B=s.pendingLanes&-536870913,B=B!==0?B:B&536870912?536870912:0;if(B!==0){r=B;t:{var X=s;S=Wr;var I=Zn&&X.current.memoizedState.isDehydrated;if(I&&(ci(X,B).flags|=256),B=Ni(X,B,!1),B!==2){if(El&&!I){X.errorRecoveryDisabledLanes|=E,gi|=E,S=4;break t}E=ja,ja=S,E!==null&&ol(E)}S=B}if(E=!1,S!==2)continue}}if(S===1){ci(s,0),oi(s,r,0,!0);break}t:{switch(v=s,S){case 0:case 1:throw Error(o(345));case 4:if((r&4194176)===r){oi(v,r,ha,!ye);break t}break;case 2:ja=null;break;case 3:case 5:break;default:throw Error(o(329))}if(v.finishedWork=d,v.finishedLanes=r,(r&62914560)===r&&(E=Qi+300-An(),10<E)){if(oi(v,r,ha,!ye),k(v,0)!==0)break t;v.timeoutHandle=ah(ic.bind(null,v,d,ja,vi,Jr,r,ha,gi,Cl,ye,2,-0,0),E);break t}ic(v,d,ja,vi,Jr,r,ha,gi,Cl,ye,0,-0,0)}}break}while(!0);Xa(s)}function ol(s){ja===null?ja=s:ja.push.apply(ja,s)}function ic(s,r,d,v,S,E,B,X,I,ht,bt,Tt,Et){var qt=r.subtreeFlags;if((qt&8192||(qt&16785408)===16785408)&&(Ea(),Us(r),r=dc(),r!==null)){s.cancelPendingCommit=r(Ce.bind(null,s,d,v,S,B,X,I,1,Tt,Et)),oi(s,E,B,!ht);return}Ce(s,d,v,S,B,X,I,bt,Tt,Et)}function am(s){for(var r=s;;){var d=r.tag;if((d===0||d===11||d===15)&&r.flags&16384&&(d=r.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var v=0;v<d.length;v++){var S=d[v],E=S.getSnapshot;S=S.value;try{if(!Aa(E(),S))return!1}catch{return!1}}if(d=r.child,r.subtreeFlags&16384&&d!==null)d.return=r,r=d;else{if(r===s)break;for(;r.sibling===null;){if(r.return===null||r.return===s)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function oi(s,r,d,v){r&=~Yn,r&=~gi,s.suspendedLanes|=r,s.pingedLanes&=~r,v&&(s.warmLanes|=r),v=s.expirationTimes;for(var S=r;0<S;){var E=31-ra(S),B=1<<E;v[E]=-1,S&=~B}d!==0&&vt(s,d,r)}function Vf(){return(wt&6)===0?(Ul(0),!1):!0}function ia(){if(Xt!==null){if(_e===0)var s=Xt.return;else s=Xt,Xe=ms=null,pu(s),Xi=null,Wa=0,s=Xt;for(;s!==null;)Gf(s.alternate,s),s=s.return;Xt=null}}function ci(s,r){s.finishedWork=null,s.finishedLanes=0;var d=s.timeoutHandle;d!==ks&&(s.timeoutHandle=ks,ku(d)),d=s.cancelPendingCommit,d!==null&&(s.cancelPendingCommit=null,d()),ia(),Wt=s,Xt=d=Bn(s.current,null),Kt=r,_e=0,We=null,ye=!1,Na=q(s,r),El=!1,Cl=ha=Yn=gi=Ba=ae=0,ja=Wr=null,Jr=!1,(r&8)!==0&&(r|=r&32);var v=s.entangledLanes;if(v!==0)for(s=s.entanglements,v&=r;0<v;){var S=31-ra(v),E=1<<S;r|=s[S],v&=~E}return yi=r,pn(),d}function Hs(s,r){kt=null,Nt.H=re,r===xe?(r=mr(),_e=3):r===Oh?(r=mr(),_e=4):_e=r===Um?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,We=r,Xt===null&&(ae=1,Vo(s,rt(r,s.current)))}function Uu(){var s=Oa.current;return s===null?!0:(Kt&4194176)===Kt?Ja===null:(Kt&62914560)===Kt||(Kt&536870912)!==0?s===Ja:!1}function Nr(){var s=Nt.H;return Nt.H=re,s===null?re:s}function _a(){var s=Nt.A;return Nt.A=Nc,s}function la(){ae=4,ye||(Kt&4194176)!==Kt&&Oa.current!==null||(Na=!0),(Ba&134217727)===0&&(gi&134217727)===0||Wt===null||oi(Wt,Kt,ha,!1)}function Ni(s,r,d){var v=wt;wt|=2;var S=Nr(),E=_a();(Wt!==s||Kt!==r)&&(vi=null,ci(s,r)),r=!1;var B=ae;t:do try{if(_e!==0&&Xt!==null){var X=Xt,I=We;switch(_e){case 8:ia(),B=6;break t;case 3:case 2:case 6:Oa.current===null&&(r=!0);var ht=_e;if(_e=0,We=null,ts(s,X,I,ht),d&&Na){B=0;break t}break;default:ht=_e,_e=0,We=null,ts(s,X,I,ht)}}Bi(),B=ae;break}catch(bt){Hs(s,bt)}while(!0);return r&&s.shellSuspendCounter++,Xe=ms=null,wt=v,Nt.H=S,Nt.A=E,Xt===null&&(Wt=null,Kt=0,pn()),B}function Bi(){for(;Xt!==null;)kf(Xt)}function ji(s,r){var d=wt;wt|=2;var v=Nr(),S=_a();Wt!==s||Kt!==r?(vi=null,He=An()+500,ci(s,r)):Na=q(s,r);t:do try{if(_e!==0&&Xt!==null){r=Xt;var E=We;e:switch(_e){case 1:_e=0,We=null,ts(s,r,E,1);break;case 2:if(du(E)){_e=0,We=null,lc(r);break}r=function(){_e===2&&Wt===s&&(_e=7),Xa(s)},E.then(r,r);break t;case 3:_e=7;break t;case 4:_e=5;break t;case 7:du(E)?(_e=0,We=null,lc(r)):(_e=0,We=null,ts(s,r,E,7));break;case 5:var B=null;switch(Xt.tag){case 26:B=Xt.memoizedState;case 5:case 27:var X=Xt,I=X.type,ht=X.pendingProps;if(B?Mh(B):gl(I,ht)){_e=0,We=null;var bt=X.sibling;if(bt!==null)Xt=bt;else{var Tt=X.return;Tt!==null?(Xt=Tt,Hu(Tt)):Xt=null}break e}}_e=0,We=null,ts(s,r,E,5);break;case 6:_e=0,We=null,ts(s,r,E,6);break;case 8:ia(),ae=6;break t;default:throw Error(o(462))}}cl();break}catch(Et){Hs(s,Et)}while(!0);return Xe=ms=null,Nt.H=v,Nt.A=S,wt=d,Xt!==null?0:(Wt=null,Kt=0,pn(),ae)}function cl(){for(;Xt!==null&&!Dm();)kf(Xt)}function kf(s){var r=Wd(s.alternate,s,yi);s.memoizedProps=s.pendingProps,r===null?Hu(s):Xt=r}function lc(s){var r=s,d=r.alternate;switch(r.tag){case 15:case 0:r=kd(d,r,r.pendingProps,r.type,void 0,Kt);break;case 11:r=kd(d,r,r.pendingProps,r.type.render,r.ref,Kt);break;case 5:pu(r);default:Gf(d,r),r=Xt=dl(r,yi),r=Wd(d,r,yi)}s.memoizedProps=s.pendingProps,r===null?Hu(s):Xt=r}function ts(s,r,d,v){Xe=ms=null,pu(r),Xi=null,Wa=0;var S=r.return;try{if(Yd(s,S,r,d,Kt)){ae=1,Vo(s,rt(d,s.current)),Xt=null;return}}catch(E){if(S!==null)throw Xt=S,E;ae=1,Vo(s,rt(d,s.current)),Xt=null;return}r.flags&32768?(se||v===1?s=!0:Na||(Kt&536870912)!==0?s=!1:(ye=s=!0,(v===2||v===3||v===6)&&(v=Oa.current,v!==null&&v.tag===13&&(v.flags|=16384))),gn(r,s)):Hu(r)}function Hu(s){var r=s;do{if((r.flags&32768)!==0){gn(r,ye);return}s=r.return;var d=Pd(r.alternate,r,yi);if(d!==null){Xt=d;return}if(r=r.sibling,r!==null){Xt=r;return}Xt=r=s}while(r!==null);ae===0&&(ae=5)}function gn(s,r){do{var d=Id(s.alternate,s);if(d!==null){d.flags&=32767,Xt=d;return}if(d=s.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!r&&(s=s.sibling,s!==null)){Xt=s;return}Xt=s=d}while(s!==null);ae=6,Xt=null}function Ce(s,r,d,v,S,E,B,X,I,ht){var bt=Nt.T,Tt=fn();try{jn(2),Nt.T=null,te(s,r,d,v,Tt,S,E,B,X,I,ht)}finally{Nt.T=bt,jn(Tt)}}function te(s,r,d,v,S,E,B,X){do vn();while(Al!==null);if((wt&6)!==0)throw Error(o(327));var I=s.finishedWork;if(v=s.finishedLanes,I===null)return null;if(s.finishedWork=null,s.finishedLanes=0,I===s.current)throw Error(o(177));s.callbackNode=null,s.callbackPriority=0,s.cancelPendingCommit=null;var ht=I.lanes|I.childLanes;if(ht|=kr,ct(s,v,ht,E,B,X),s===Wt&&(Xt=Wt=null,Kt=0),(I.subtreeFlags&10256)===0&&(I.flags&10256)===0||Ia||(Ia=!0,Uc=ht,$s=d,Gu(Cc,function(){return vn(),null})),d=(I.flags&15990)!==0,(I.subtreeFlags&15990)!==0||d?(d=Nt.T,Nt.T=null,E=fn(),jn(2),B=wt,wt|=4,Mr(s,I),Fl(I,s),eh(s.containerInfo),s.current=I,Io(s,I.alternate,I),Om(),wt=B,jn(E),Nt.T=d):s.current=I,Ia?(Ia=!1,Al=s,Is=v):fl(s,ht),ht=s.pendingLanes,ht===0&&(Ua=null),H(I.stateNode),Xa(s),r!==null)for(S=s.onRecoverableError,I=0;I<r.length;I++)ht=r[I],S(ht.value,{componentStack:ht.stack});return(Is&3)!==0&&vn(),ht=s.pendingLanes,(v&4194218)!==0&&(ht&42)!==0?s===Jn?tr++:(tr=0,Jn=s):tr=0,Ul(0),null}function fl(s,r){(s.pooledCacheLanes&=r)===0&&(r=s.pooledCache,r!=null&&(s.pooledCache=null,Sr(r)))}function vn(){if(Al!==null){var s=Al,r=Uc;Uc=0;var d=St(Is),v=32>d?32:d;d=Nt.T;var S=fn();try{if(jn(v),Nt.T=null,Al===null)var E=!1;else{v=$s,$s=null;var B=Al,X=Is;if(Al=null,Is=0,(wt&6)!==0)throw Error(o(331));var I=wt;if(wt|=4,Bu(B.current),ec(B,B.current,X,v),wt=I,Ul(0,!1),ua&&typeof ua.onPostCommitFiberRoot=="function")try{ua.onPostCommitFiberRoot(Xr,B)}catch{}E=!0}return E}finally{jn(S),Nt.T=d,fl(s,r)}}return!1}function sc(s,r,d){r=rt(d,r),r=Au(s.stateNode,r,2),s=$e(s,r,2),s!==null&&(et(s,2),Xa(s))}function It(s,r,d){if(s.tag===3)sc(s,s,d);else for(;r!==null;){if(r.tag===3){sc(r,s,d);break}else if(r.tag===1){var v=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof v.componentDidCatch=="function"&&(Ua===null||!Ua.has(v))){s=rt(d,s),d=br(2),v=$e(r,d,2),v!==null&&(Mu(d,v,r,s),et(v,2),Xa(v));break}}r=r.return}}function rc(s,r,d){var v=s.pingCache;if(v===null){v=s.pingCache=new $t;var S=new Set;v.set(r,S)}else S=v.get(r),S===void 0&&(S=new Set,v.set(r,S));S.has(d)||(El=!0,S.add(d),s=im.bind(null,s,r,d),r.then(s,s))}function im(s,r,d){var v=s.pingCache;v!==null&&v.delete(r),s.pingedLanes|=s.suspendedLanes&d,s.warmLanes&=~d,Wt===s&&(Kt&d)===d&&(ae===4||ae===3&&(Kt&62914560)===Kt&&300>An()-Qi?(wt&2)===0&&ci(s,0):Yn|=d,Cl===Kt&&(Cl=0)),Xa(s)}function Gs(s,r){r===0&&(r=L()),s=li(s,r),s!==null&&(et(s,r),Xa(s))}function Ys(s){var r=s.memoizedState,d=0;r!==null&&(d=r.retryLane),Gs(s,d)}function Qf(s,r){var d=0;switch(s.tag){case 13:var v=s.stateNode,S=s.memoizedState;S!==null&&(d=S.retryLane);break;case 19:v=s.stateNode;break;case 22:v=s.stateNode._retryCache;break;default:throw Error(o(314))}v!==null&&v.delete(r),Gs(s,d)}function Gu(s,r){return Lr(s,r)}function Kf(s,r,d,v){this.tag=s,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=v,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function hl(s){return s=s.prototype,!(!s||!s.isReactComponent)}function Bn(s,r){var d=s.alternate;return d===null?(d=a(s.tag,r,s.key,s.mode),d.elementType=s.elementType,d.type=s.type,d.stateNode=s.stateNode,d.alternate=s,s.alternate=d):(d.pendingProps=r,d.type=s.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=s.flags&31457280,d.childLanes=s.childLanes,d.lanes=s.lanes,d.child=s.child,d.memoizedProps=s.memoizedProps,d.memoizedState=s.memoizedState,d.updateQueue=s.updateQueue,r=s.dependencies,d.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},d.sibling=s.sibling,d.index=s.index,d.ref=s.ref,d.refCleanup=s.refCleanup,d}function dl(s,r){s.flags&=31457282;var d=s.alternate;return d===null?(s.childLanes=0,s.lanes=r,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=d.childLanes,s.lanes=d.lanes,s.child=d.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=d.memoizedProps,s.memoizedState=d.memoizedState,s.updateQueue=d.updateQueue,s.type=d.type,r=d.dependencies,s.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),s}function Qa(s,r,d,v,S,E){var B=0;if(v=s,typeof s=="function")hl(s)&&(B=1);else if(typeof s=="string")B=Ca&&Cn?bh(s,d,bn.current)?26:Yr(s)?27:5:Ca?bh(s,d,bn.current)?26:5:Cn&&Yr(s)?27:5;else t:switch(s){case jr:return ml(d.children,S,E,r);case Pf:B=8,S|=24;break;case If:return s=a(12,d,r,S|2),s.elementType=If,s.lanes=E,s;case oc:return s=a(13,d,r,S),s.elementType=oc,s.lanes=E,s;case as:return s=a(19,d,r,S),s.elementType=as,s.lanes=E,s;case Lu:return uc(d,S,E,r);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case rm:case Ui:B=10;break t;case ns:B=9;break t;case Ur:B=11;break t;case qu:B=14;break t;case hi:B=16,v=null;break t}B=29,d=Error(o(130,s===null?"null":typeof s,"")),v=null}return r=a(B,d,r,S),r.elementType=s,r.type=v,r.lanes=E,r}function ml(s,r,d,v){return s=a(7,s,v,r),s.lanes=d,s}function uc(s,r,d,v){s=a(22,s,v,r),s.elementType=Lu,s.lanes=d;var S={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var E=S._current;if(E===null)throw Error(o(456));if((S._pendingVisibility&2)===0){var B=li(E,2);B!==null&&(S._pendingVisibility|=2,Nn(B,E,2))}},attach:function(){var E=S._current;if(E===null)throw Error(o(456));if((S._pendingVisibility&2)!==0){var B=li(E,2);B!==null&&(S._pendingVisibility&=-3,Nn(B,E,2))}}};return s.stateNode=S,s}function es(s,r,d){return s=a(6,s,null,r),s.lanes=d,s}function Br(s,r,d){return r=a(4,s.children!==null?s.children:[],s.key,r),r.lanes=d,r.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},r}function qs(s,r,d,v,S,E,B,X){this.tag=1,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ks,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=$(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=$(0),this.hiddenUpdates=$(null),this.identifierPrefix=v,this.onUncaughtError=S,this.onCaughtError=E,this.onRecoverableError=B,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function xn(s,r,d,v,S,E,B,X,I,ht,bt,Tt){return s=new qs(s,r,d,B,X,I,ht,Tt),r=1,E===!0&&(r|=24),E=a(3,null,null,r),s.current=E,E.stateNode=s,r=Zo(),r.refCount++,s.pooledCache=r,r.refCount++,E.memoizedState={element:v,isDehydrated:d,cache:r},df(E),s}function Yu(s){return s?(s=Ks,s):Ks}function Zf(s){var r=s._reactInternals;if(r===void 0)throw typeof s.render=="function"?Error(o(188)):(s=Object.keys(s).join(","),Error(o(268,s)));return s=C(r),s=s!==null?M(s):null,s===null?null:Hr(s.stateNode)}function lm(s,r,d,v,S,E){S=Yu(S),v.context===null?v.context=S:v.pendingContext=S,v=Va(r),v.payload={element:d},E=E===void 0?null:E,E!==null&&(v.callback=E),d=$e(s,v,r),d!==null&&(Nn(d,s,r),ka(d,s,r))}function sm(s,r){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var d=s.retryLane;s.retryLane=d!==0&&d<r?d:r}}function Ff(s,r){sm(s,r),(s=s.alternate)&&sm(s,r)}var zt={},Wf=Yp(),Tn=p5(),Ls=Object.assign,Jf=Symbol.for("react.element"),pl=Symbol.for("react.transitional.element"),fi=Symbol.for("react.portal"),jr=Symbol.for("react.fragment"),Pf=Symbol.for("react.strict_mode"),If=Symbol.for("react.profiler"),rm=Symbol.for("react.provider"),ns=Symbol.for("react.consumer"),Ui=Symbol.for("react.context"),Ur=Symbol.for("react.forward_ref"),oc=Symbol.for("react.suspense"),as=Symbol.for("react.suspense_list"),qu=Symbol.for("react.memo"),hi=Symbol.for("react.lazy"),Lu=Symbol.for("react.offscreen"),um=Symbol.for("react.memo_cache_sentinel"),$f=Symbol.iterator,Xs=Symbol.for("react.client.reference"),Nt=Wf.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,cc,th,is=!1,ls=Array.isArray,fc=t.rendererVersion,Xu=t.rendererPackageName,Vu=t.extraDevToolsConfig,Hr=t.getPublicInstance,Vs=t.getRootHostContext,om=t.getChildHostContext,ss=t.prepareForCommit,eh=t.resetAfterCommit,nh=t.createInstance,Hi=t.appendInitialChild,yl=t.finalizeInitialChildren,rs=t.shouldSetTextContent,hc=t.createTextInstance,ah=t.scheduleTimeout,ku=t.cancelTimeout,ks=t.noTimeout,Gi=t.isPrimaryRenderer;t.warnsIfNotActing;var En=t.supportsMutation,Ta=t.supportsPersistence,Zn=t.supportsHydration,ih=t.getInstanceFromNode;t.beforeActiveInstanceBlur,t.afterActiveInstanceBlur;var lh=t.preparePortalMount;t.prepareScopeUpdate,t.getInstanceFromScope;var jn=t.setCurrentUpdatePriority,fn=t.getCurrentUpdatePriority,Ka=t.resolveUpdatePriority;t.resolveEventType,t.resolveEventTimeStamp;var us=t.shouldAttemptEagerTransition,sh=t.detachDeletedInstance;t.requestPostPaintCallback;var cm=t.maySuspendCommit,gl=t.preloadInstance,Ea=t.startSuspendingCommit,Ge=t.suspendInstance,dc=t.waitForCommitToBeReady,sa=t.NotPendingTransition,Ut=t.HostTransitionContext,Se=t.resetFormInstance;t.bindToConsole;var en=t.supportsMicrotasks,mc=t.scheduleMicrotask,Yi=t.supportsTestSelectors,Qs=t.findFiberRoot,pc=t.getBoundingRect,Qu=t.getTextContent,qi=t.isHiddenSubtree,ty=t.matchAccessibilityRole,Ye=t.setFocusIfFocusable,rh=t.setupIntersectionObserver,uh=t.appendChild,fm=t.appendChildToContainer,hm=t.commitTextUpdate,ey=t.commitMount,oh=t.commitUpdate,ch=t.insertBefore,fh=t.insertInContainerBefore,Fn=t.removeChild,Qe=t.removeChildFromContainer,Ku=t.resetTextContent,Zu=t.hideInstance,yc=t.hideTextInstance,hh=t.unhideInstance,vl=t.unhideTextInstance,gc=t.clearContainer,dh=t.cloneInstance,vc=t.createContainerChildSet,mh=t.appendChildToContainerChildSet,dm=t.finalizeContainerChildren,ph=t.replaceContainerChildren,yh=t.cloneHiddenInstance,gh=t.cloneHiddenTextInstance,xc=t.isSuspenseInstancePending,Fu=t.isSuspenseInstanceFallback,mm=t.getSuspenseInstanceFallbackErrorDetails,ny=t.registerSuspenseInstanceRetry,pm=t.canHydrateFormStateMarker,ym=t.isFormStateMarkerMatching,vh=t.getNextHydratableSibling,bc=t.getFirstHydratableChild,gm=t.getFirstHydratableChildWithinContainer,vm=t.getFirstHydratableChildWithinSuspenseInstance,xm=t.canHydrateInstance,bm=t.canHydrateTextInstance,Sm=t.canHydrateSuspenseInstance,ay=t.hydrateInstance,_m=t.hydrateTextInstance,Gr=t.hydrateSuspenseInstance,Tm=t.getNextHydratableInstanceAfterSuspenseInstance,Sc=t.commitHydratedContainer,_c=t.commitHydratedSuspenseInstance,Em=t.clearSuspenseBoundary,xh=t.clearSuspenseBoundaryFromContainer,Cm=t.shouldDeleteUnhydratedTailInstances;t.diffHydratedPropsForDevWarnings,t.diffHydratedTextForDevWarnings,t.describeHydratableInstanceForDevWarnings;var Am=t.validateHydratableInstance,Mm=t.validateHydratableTextInstance,Ca=t.supportsResources,bh=t.isHostHoistableType,Tc=t.getHoistableRoot,Ec=t.getResource,Sh=t.acquireResource,_h=t.releaseResource,Th=t.hydrateHoistable,Eh=t.mountHoistable,Ch=t.unmountHoistable,iy=t.createHoistableInstance,Ah=t.prepareToCommitHoistables,Rm=t.mayResourceSuspendCommit,Mh=t.preloadResource,Rh=t.suspendResource,Cn=t.supportsSingletons,zh=t.resolveSingletonInstance,ly=t.clearSingleton,sy=t.acquireSingletonInstance,zm=t.releaseSingletonInstance,Yr=t.isHostSingletonType,Wu=[],xl=-1,Ks={},ra=Math.clz32?Math.clz32:j,Ju=Math.log,wm=Math.LN2,qr=128,Pu=4194304,Lr=Tn.unstable_scheduleCallback,Iu=Tn.unstable_cancelCallback,Dm=Tn.unstable_shouldYield,Om=Tn.unstable_requestPaint,An=Tn.unstable_now,wh=Tn.unstable_ImmediatePriority,Nm=Tn.unstable_UserBlockingPriority,Cc=Tn.unstable_NormalPriority,Ac=Tn.unstable_IdlePriority,Bm=Tn.log,Dh=Tn.unstable_setDisableYieldValue,Xr=null,ua=null,Aa=typeof Object.is=="function"?Object.is:ot,Mc=new WeakMap,Ne=[],qe=0,$u=null,to=0,Ma=[],Ra=0,di=null,Li=1,Za="",bn=z(null),eo=z(null),mi=z(null),Vr=z(null),Un=null,Mn=null,se=!1,za=null,Fa=!1,no=Error(o(519)),wa=[],os=0,kr=0,Qr=null,Zs=null,ao=!1,io=!1,pi=!1,cs=0,lo=null,Rc=0,oa=0,fs=null,bl=!1,Kr=!1,so=Object.prototype.hasOwnProperty,xe=Error(o(460)),Oh=Error(o(474)),zc={then:function(){}},Fs=null,Xi=null,Wa=0,hs=wd(!0),Nh=wd(!1),Vi=z(null),Da=z(0),Oa=z(null),Ja=null,nn=z(0),ki=0,kt=null,he=null,Ke=null,Pa=!1,Be=!1,Sl=!1,ro=0,Le=0,Zr=null,jm=0,wc=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},re={readContext:_n,use:il,useCallback:Pt,useContext:Pt,useEffect:Pt,useImperativeHandle:Pt,useLayoutEffect:Pt,useInsertionEffect:Pt,useMemo:Pt,useReducer:Pt,useRef:Pt,useState:Pt,useDebugValue:Pt,useDeferredValue:Pt,useTransition:Pt,useSyncExternalStore:Pt,useId:Pt};re.useCacheRefresh=Pt,re.useMemoCache=Pt,re.useHostTransitionStatus=Pt,re.useFormState=Pt,re.useActionState=Pt,re.useOptimistic=Pt;var an={readContext:_n,use:il,useCallback:function(s,r){return cn().memoizedState=[s,r===void 0?null:r],s},useContext:_n,useEffect:Sf,useImperativeHandle:function(s,r,d){d=d!=null?d.concat([s]):null,Ho(4194308,4,Su.bind(null,r,s),d)},useLayoutEffect:function(s,r){return Ho(4194308,4,s,r)},useInsertionEffect:function(s,r){Ho(4,2,s,r)},useMemo:function(s,r){var d=cn();r=r===void 0?null:r;var v=s();if(Sl){Q(!0);try{s()}finally{Q(!1)}}return d.memoizedState=[v,r],v},useReducer:function(s,r,d){var v=cn();if(d!==void 0){var S=d(r);if(Sl){Q(!0);try{d(r)}finally{Q(!1)}}}else S=r;return v.memoizedState=v.baseState=S,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:S},v.queue=s,s=s.dispatch=ql.bind(null,kt,s),[v.memoizedState,s]},useRef:function(s){var r=cn();return s={current:s},r.memoizedState=s},useState:function(s){s=ri(s);var r=s.queue,d=Lo.bind(null,kt,r);return r.dispatch=d,[s.memoizedState,d]},useDebugValue:_u,useDeferredValue:function(s,r){var d=cn();return Yl(d,s,r)},useTransition:function(){var s=ri(!1);return s=Yo.bind(null,kt,s.queue,!0,!1),cn().memoizedState=s,[!1,s]},useSyncExternalStore:function(s,r,d){var v=kt,S=cn();if(se){if(d===void 0)throw Error(o(407));d=d()}else{if(d=r(),Wt===null)throw Error(o(349));(Kt&60)!==0||yf(v,r,d)}S.memoizedState=d;var E={value:d,getSnapshot:r};return S.queue=E,Sf(Nd.bind(null,v,E,s),[s]),v.flags|=2048,Ms(9,gf.bind(null,v,E,d,r),{destroy:void 0},null),d},useId:function(){var s=cn(),r=Wt.identifierPrefix;if(se){var d=Za,v=Li;d=(v&~(1<<32-ra(v)-1)).toString(32)+d,r=":"+r+"R"+d,d=ro++,0<d&&(r+="H"+d.toString(32)),r+=":"}else d=jm++,r=":"+r+"r"+d.toString(32)+":";return s.memoizedState=r},useCacheRefresh:function(){return cn().memoizedState=Tu.bind(null,kt)}};an.useMemoCache=tn,an.useHostTransitionStatus=ws,an.useFormState=jo,an.useActionState=jo,an.useOptimistic=function(s){var r=cn();r.memoizedState=r.baseState=s;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=d,r=Xo.bind(null,kt,!0,d),d.dispatch=r,[s,r]};var Hn={readContext:_n,use:il,useCallback:Go,useContext:_n,useEffect:bu,useImperativeHandle:zi,useInsertionEffect:Hd,useLayoutEffect:Gd,useMemo:zs,useReducer:yu,useRef:Rs,useState:function(){return yu(Ri)},useDebugValue:_u,useDeferredValue:function(s,r){var d=we();return _f(d,he.memoizedState,s,r)},useTransition:function(){var s=yu(Ri)[0],r=we().memoizedState;return[typeof s=="boolean"?s:al(s),r]},useSyncExternalStore:Od,useId:wi};Hn.useCacheRefresh=qo,Hn.useMemoCache=tn,Hn.useHostTransitionStatus=ws,Hn.useFormState=xf,Hn.useActionState=xf,Hn.useOptimistic=function(s,r){var d=we();return va(d,he,s,r)};var ds={readContext:_n,use:il,useCallback:Go,useContext:_n,useEffect:bu,useImperativeHandle:zi,useInsertionEffect:Hd,useLayoutEffect:Gd,useMemo:zs,useReducer:Gl,useRef:Rs,useState:function(){return Gl(Ri)},useDebugValue:_u,useDeferredValue:function(s,r){var d=we();return he===null?Yl(d,s,r):_f(d,he.memoizedState,s,r)},useTransition:function(){var s=Gl(Ri)[0],r=we().memoizedState;return[typeof s=="boolean"?s:al(s),r]},useSyncExternalStore:Od,useId:wi};ds.useCacheRefresh=qo,ds.useMemoCache=tn,ds.useHostTransitionStatus=ws,ds.useFormState=bf,ds.useActionState=bf,ds.useOptimistic=function(s,r){var d=we();return he!==null?va(d,he,s,r):(d.baseState=s,[s,d.queue.dispatch])};var Dc={isMounted:function(s){return(s=s._reactInternals)?_(s)===s:!1},enqueueSetState:function(s,r,d){s=s._reactInternals;var v=Kn(),S=Va(v);S.payload=r,d!=null&&(S.callback=d),r=$e(s,S,v),r!==null&&(Nn(r,s,v),ka(r,s,v))},enqueueReplaceState:function(s,r,d){s=s._reactInternals;var v=Kn(),S=Va(v);S.tag=1,S.payload=r,d!=null&&(S.callback=d),r=$e(s,S,v),r!==null&&(Nn(r,s,v),ka(r,s,v))},enqueueForceUpdate:function(s,r){s=s._reactInternals;var d=Kn(),v=Va(d);v.tag=2,r!=null&&(v.callback=r),r=$e(s,v,d),r!==null&&(Nn(r,s,d),ka(r,s,d))}},Bh=typeof reportError=="function"?reportError:function(s){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof s=="object"&&s!==null&&typeof s.message=="string"?String(s.message):String(s),error:s});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",s);return}console.error(s)},Um=Error(o(461)),Ze=!1,Gn={dehydrated:null,treeContext:null,retryLane:0},ca=z(null),ms=null,Xe=null,Hm=typeof AbortController<"u"?AbortController:function(){var s=[],r=this.signal={aborted:!1,addEventListener:function(d,v){s.push(v)}};this.abort=function(){r.aborted=!0,s.forEach(function(d){return d()})}},_l=Tn.unstable_scheduleCallback,Ws=Tn.unstable_NormalPriority,me={$$typeof:Ui,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Oc=Nt.S;Nt.S=function(s,r){typeof r=="object"&&r!==null&&typeof r.then=="function"&&Mo(s,r),Oc!==null&&Oc(s,r)};var Tl=z(null),hn=!1,Ue=!1,ps=!1,Fr=typeof WeakSet=="function"?WeakSet:Set,Ve=null,Js=!1,Fe=null,fa=!1,Wn=null,Ps=8192,Nc={getCacheForType:function(s){var r=_n(me),d=r.data.get(s);return d===void 0&&(d=s(),r.data.set(s,d)),d}},uo=0,Bc=1,jc=2,ne=3,pe=4;if(typeof Symbol=="function"&&Symbol.for){var Qt=Symbol.for;uo=Qt("selector.component"),Bc=Qt("selector.has_pseudo_class"),jc=Qt("selector.role"),ne=Qt("selector.test_id"),pe=Qt("selector.text")}var $t=typeof WeakMap=="function"?WeakMap:Map,wt=0,Wt=null,Xt=null,Kt=0,_e=0,We=null,ye=!1,Na=!1,El=!1,yi=0,ae=0,Ba=0,gi=0,Yn=0,ha=0,Cl=0,Wr=null,ja=null,Jr=!1,Qi=0,He=1/0,vi=null,Ua=null,Ia=!1,Al=null,Is=0,Uc=0,$s=null,tr=0,Jn=null;return zt.attemptContinuousHydration=function(s){if(s.tag===13){var r=li(s,67108864);r!==null&&Nn(r,s,67108864),Ff(s,67108864)}},zt.attemptHydrationAtCurrentPriority=function(s){if(s.tag===13){var r=Kn(),d=li(s,r);d!==null&&Nn(d,s,r),Ff(s,r)}},zt.attemptSynchronousHydration=function(s){switch(s.tag){case 3:if(s=s.stateNode,s.current.memoizedState.isDehydrated){var r=G(s.pendingLanes);if(r!==0){for(s.pendingLanes|=2,s.entangledLanes|=2;r;){var d=1<<31-ra(r);s.entanglements[1]|=d,r&=~d}Xa(s),(wt&6)===0&&(He=An()+500,Ul(0))}}break;case 13:r=li(s,2),r!==null&&Nn(r,s,2),Vf(),Ff(s,2)}},zt.batchedUpdates=function(s,r){return s(r)},zt.createComponentSelector=function(s){return{$$typeof:uo,value:s}},zt.createContainer=function(s,r,d,v,S,E,B,X,I,ht){return xn(s,r,!1,null,d,v,E,B,X,I,ht,null)},zt.createHasPseudoClassSelector=function(s){return{$$typeof:Bc,value:s}},zt.createHydrationContainer=function(s,r,d,v,S,E,B,X,I,ht,bt,Tt,Et){return s=xn(d,v,!0,s,S,E,X,I,ht,bt,Tt,Et),s.context=Yu(null),d=s.current,v=Kn(),S=Va(v),S.callback=r??null,$e(d,S,v),s.current.lanes=v,et(s,v),Xa(s),s},zt.createPortal=function(s,r,d){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:fi,key:v==null?null:""+v,children:s,containerInfo:r,implementation:d}},zt.createRoleSelector=function(s){return{$$typeof:jc,value:s}},zt.createTestNameSelector=function(s){return{$$typeof:ne,value:s}},zt.createTextSelector=function(s){return{$$typeof:pe,value:s}},zt.defaultOnCaughtError=function(s){console.error(s)},zt.defaultOnRecoverableError=function(s){Bh(s)},zt.defaultOnUncaughtError=function(s){Bh(s)},zt.deferredUpdates=function(s){var r=Nt.T,d=fn();try{return jn(32),Nt.T=null,s()}finally{jn(d),Nt.T=r}},zt.discreteUpdates=function(s,r,d,v,S){var E=Nt.T,B=fn();try{return jn(2),Nt.T=null,s(r,d,v,S)}finally{jn(B),Nt.T=E,wt===0&&(He=An()+500)}},zt.findAllNodes=Qn,zt.findBoundingRects=function(s,r){if(!Yi)throw Error(o(363));r=Qn(s,r),s=[];for(var d=0;d<r.length;d++)s.push(pc(r[d]));for(r=s.length-1;0<r;r--){d=s[r];for(var v=d.x,S=v+d.width,E=d.y,B=E+d.height,X=r-1;0<=X;X--)if(r!==X){var I=s[X],ht=I.x,bt=ht+I.width,Tt=I.y,Et=Tt+I.height;if(v>=ht&&E>=Tt&&S<=bt&&B<=Et){s.splice(r,1);break}else if(v!==ht||d.width!==I.width||Et<E||Tt>B){if(!(E!==Tt||d.height!==I.height||bt<v||ht>S)){ht>v&&(I.width+=ht-v,I.x=v),bt<S&&(I.width=S-ht),s.splice(r,1);break}}else{Tt>E&&(I.height+=Tt-E,I.y=E),Et<B&&(I.height=B-Tt),s.splice(r,1);break}}}return s},zt.findHostInstance=Zf,zt.findHostInstanceWithNoPortals=function(s){return s=C(s),s=s!==null?w(s):null,s===null?null:Hr(s.stateNode)},zt.findHostInstanceWithWarning=function(s){return Zf(s)},zt.flushPassiveEffects=vn,zt.flushSyncFromReconciler=function(s){var r=wt;wt|=1;var d=Nt.T,v=fn();try{if(jn(2),Nt.T=null,s)return s()}finally{jn(v),Nt.T=d,wt=r,(wt&6)===0&&Ul(0)}},zt.flushSyncWork=Vf,zt.focusWithin=function(s,r){if(!Yi)throw Error(o(363));for(s=ac(s),r=nm(s,r),r=Array.from(r),s=0;s<r.length;){var d=r[s++],v=d.tag;if(!qi(d)){if((v===5||v===26||v===27)&&Ye(d.stateNode))return!0;for(d=d.child;d!==null;)r.push(d),d=d.sibling}}return!1},zt.getFindAllNodesFailureDescription=function(s,r){if(!Yi)throw Error(o(363));var d=0,v=[];s=[ac(s),0];for(var S=0;S<s.length;){var E=s[S++],B=E.tag,X=s[S++],I=r[X];if((B!==5&&B!==26&&B!==27||!qi(E))&&(Or(E,I)&&(v.push($l(I)),X++,X>d&&(d=X)),X<r.length))for(E=E.child;E!==null;)s.push(E,X),E=E.sibling}if(d<r.length){for(s=[];d<r.length;d++)s.push($l(r[d]));return`findAllNodes was able to match part of the selector:
341
- `+(v.join(" > ")+`
342
-
343
- No matching component was found for:
344
- `)+s.join(" > ")}return null},zt.getPublicRootInstance=function(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 27:case 5:return Hr(s.child.stateNode);default:return s.child.stateNode}},zt.injectIntoDevTools=function(){var s={bundleType:0,version:fc,rendererPackageName:Xu,currentDispatcherRef:Nt,findFiberByHostInstance:ih,reconcilerVersion:"19.0.0"};if(Vu!==null&&(s.rendererConfig=Vu),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")s=!1;else{var r=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(r.isDisabled||!r.supportsFiber)s=!0;else{try{Xr=r.inject(s),ua=r}catch{}s=!!r.checkDCE}}return s},zt.isAlreadyRendering=function(){return!1},zt.observeVisibleRects=function(s,r,d,v){if(!Yi)throw Error(o(363));s=Qn(s,r);var S=rh(s,d,v).disconnect;return{disconnect:function(){S()}}},zt.shouldError=function(){return null},zt.shouldSuspend=function(){return!1},zt.startHostTransition=function(s,r,d,v){if(s.tag!==5)throw Error(o(476));var S=Tf(s).queue;Yo(s,S,r,sa,d===null?l:function(){var E=Tf(s).next.queue;return Ll(s,E,{},Kn()),d(v)})},zt.updateContainer=function(s,r,d,v){var S=r.current,E=Kn();return lm(S,E,s,r,d,v),E},zt.updateContainerSync=function(s,r,d,v){return r.tag===0&&vn(),lm(r.current,2,s,r,d,v),2},zt},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})})(S0)),S0.exports}var Sx;function g5(){return Sx||(Sx=1,b0.exports=y5()),b0.exports}var v5=g5();const x5=Gp(v5),b5=x5;function S5(n,t,a,l){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function _5(){}function T5(){return!1}const kS={};function E5(n){return n??kS}function C5(){return uu.currentUpdatePriority}function A5(){return null}function M5(n){throw new Error("Not yet implemented.")}function R5(n){return n}function z5(){return kS}function w5(n){n instanceof $n?n.visible=!1:n instanceof Co&&(n.enabled=!1)}function D5(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function QS(n){if(n instanceof Co){const t=n.__pixireact.parent;if(t){const a=t.__pixireact.filters.indexOf(n);t.__pixireact.filters.splice(a,1),t.filters=t.__pixireact.filters}n.__pixireact.parent=null}}function KS(n,t,...a){}function _x(n,t,a){if(KS(),t instanceof $n){const l=t,o=t,c=a;l.parent===n&&n.removeChild(o);const h=n.getChildIndex(c);n.addChildAt(o,h)}else if(t instanceof Co){const c=t.__pixireact.filters.indexOf(a);QS(t),GS(n,t,c)}}function O5(){return!1}function N5(){return!0}function B5(){return null}function j5(){}function U5(){}function Tx(n,t){t instanceof Co&&QS(t),t.destroy()}function H5(n){}function G5(){}function Y5(){}function q5(){return-1.1}function L5(){return null}function X5(){var a;if(uu.currentUpdatePriority)return uu.currentUpdatePriority;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return $c.DefaultEventPriority;switch((a=n.event)==null?void 0:a.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return $c.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return $c.ContinuousEventPriority;default:return $c.DefaultEventPriority}}function V5(n){uu.currentUpdatePriority=n}function k5(){return!1}function Q5(){return!1}function K5(){}function Z5(){}function F5(){}function W5(n){n instanceof $n?n.visible=!0:n instanceof Co&&(n.enabled=!0)}function J5(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function P5(){return null}const I5={isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:WA,appendChild:x0,appendChildToContainer:x0,appendInitialChild:x0,beforeActiveInstanceBlur:JA,cancelTimeout:clearTimeout,clearContainer:PA,commitUpdate:u5,createInstance:d5,createTextInstance:S5,hideTextInstance:D5,unhideTextInstance:J5,detachDeletedInstance:_5,finalizeInitialChildren:T5,getChildHostContext:E5,getCurrentUpdatePriority:C5,getInstanceFromNode:A5,getInstanceFromScope:M5,getPublicInstance:R5,getRootHostContext:z5,hideInstance:w5,insertBefore:_x,insertInContainerBefore:_x,maySuspendCommit:O5,preloadInstance:N5,prepareForCommit:B5,preparePortalMount:j5,prepareScopeUpdate:U5,removeChild:Tx,removeChildFromContainer:Tx,requestPostPaintCallback:H5,resetAfterCommit:G5,resetFormInstance:Y5,resolveEventTimeStamp:q5,resolveEventType:L5,resolveUpdatePriority:X5,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:k5,setCurrentUpdatePriority:V5,shouldSetTextContent:Q5,startSuspendingCommit:K5,suspendInstance:Z5,trackSchedulerEvent:F5,unhideInstance:W5,waitForCommitToBeReady:P5,rendererPackageName:"@pixi/react",rendererVersion:FA.version},Hp=b5(I5);Hp.injectIntoDevTools();const of=new Map;function $5(n,t={}){let a=of.get(n),l=(a==null?void 0:a.applicationState)??{isInitialised:!1,isInitialising:!1};const o=(a==null?void 0:a.internalState)??{};a||(l.app=new gg,o.rootContainer=HS(l.app.stage));const c=(a==null?void 0:a.fiber)??Hp.createContainer(o.rootContainer,$c.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!a){let h;n instanceof HTMLCanvasElement&&(h=n),h||(h=document.createElement("canvas"),n.innerHTML="",n.appendChild(h)),o.canvas=h,a={applicationState:l,fiber:c,internalState:o,render:async(p,y)=>{var x;return!l.app.renderer&&!l.isInitialised&&!l.isInitialising&&(l.isInitialising=!0,await l.app.init({...y,canvas:h}),l.isInitialising=!1,l.isInitialised=!0,l={...l},(x=t.onInit)==null||x.call(t,l.app)),Object.entries(y).forEach(([_,T])=>{const C=_;US(y,C)||(l.app[C]=T)}),Hp.updateContainer(R.jsx(KA,{value:l,children:p}),c,null,()=>{}),l.app}},of.set(h,a)}return a}function ZS(n){uu.unmountQueue.delete(n);const t=n.fiber;t&&Hp.updateContainer(null,t,null,()=>{n.applicationState.app&&n.applicationState.app.destroy(),of.delete(n.internalState.canvas)})}function t6(){for(const n of uu.unmountQueue)ZS(n)}function e6(n){const t=of.get(n);t&&(t.applicationState.isInitialised?ZS(t):uu.unmountQueue.add(t))}function n6(n){const t=of.get(n);t&&uu.unmountQueue.delete(t)}var Hx,Gx;const bp=typeof window<"u"&&((Hx=window.document)!=null&&Hx.createElement||((Gx=window.navigator)==null?void 0:Gx.product)==="ReactNative")?Y.useLayoutEffect:Y.useEffect,a6={...To.defaultTextStyle},i6=Y.forwardRef(function(t,a){const{children:l,className:o,defaultTextStyle:c,extensions:h,onInit:m,resizeTo:p,...y}=t,x=m3(),_=Y.useRef(null),T=Y.useRef(null),C=Y.useRef(new Set);Y.useImperativeHandle(a,()=>({getApplication(){return _.current},getCanvas(){return T.current}}));const M=Y.useCallback(()=>{const z=_.current;z&&(p?"current"in p?p.current instanceof HTMLElement&&(z.resizeTo=p.current):z.resizeTo=p:z.resizeTo=void 0)},[p]),w=Y.useCallback(z=>{t6(),_.current=z,M(),m==null||m(z)},[m]);return bp(()=>{if(h){const z=[...h],D=C.current;for(const N of D.values()){const j=z.indexOf(N);j===-1&&(Ie.remove(N),D.delete(N)),z.splice(j,1)}for(const N of z)Ie.add(N),D.add(N)}},[h]),bp(()=>{const z=T.current;if(z){let D=of.get(z);D||(D=$5(z,{onInit:w})),D.render(R.jsx(x,{children:l}),y)}},[y,l,w,p]),bp(()=>{M()},[p]),bp(()=>{c?Object.assign(To.defaultTextStyle,c):Object.assign(To.defaultTextStyle,a6)},[c]),Y.useEffect(()=>{const z=T.current;if(z)return n6(z),()=>{e6(z)}},[]),R.jsx("canvas",{ref:T,className:o})}),l6=Y.forwardRef(function(t,a){return R.jsx(ob,{children:R.jsx(i6,{ref:a,...t})})});function Jp(n){Object.assign(ng,n)}function s6(){const n=Y.useContext(Rg);return KS(n.app instanceof gg,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),n}function r6({agentName:n,question:t,onRespond:a}){const[l,o]=Y.useState(""),c=()=>{const m=l.trim();m&&(a(m),o(""))},h=m=>{m.key==="Enter"&&c()};return R.jsx("div",{style:{position:"fixed",inset:0,background:"rgba(7, 8, 14, 0.8)",backdropFilter:"blur(8px)",WebkitBackdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:50,animation:"fadeIn 0.2s var(--ease-out) both"},children:R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--status-warning)",borderRadius:"var(--radius-lg)",boxShadow:"0 0 40px var(--status-warning-glow), var(--shadow-lg)",padding:"var(--sp-6)",maxWidth:440,width:"100%",margin:"0 var(--sp-4)",animation:"scaleIn 0.3s var(--ease-spring) both"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-4)"},children:[R.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:24,height:24,borderRadius:"var(--radius-full)",background:"var(--status-warning-glow)",border:"1px solid var(--status-warning)",color:"var(--status-warning)",fontSize:"0.7rem",fontWeight:700},children:"◆"}),R.jsxs("h2",{style:{fontFamily:"var(--font-mono)",fontSize:"0.78rem",fontWeight:700,color:"var(--status-warning)",textTransform:"uppercase",letterSpacing:"0.08em"},children:["Checkpoint — ",n]})]}),R.jsx("p",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.6,marginBottom:"var(--sp-5)"},children:t}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[R.jsx("input",{type:"text",className:"input",placeholder:"Type your response...",value:l,onChange:m=>o(m.target.value),onKeyPress:h,autoFocus:!0,style:{flex:1}}),R.jsx("button",{onClick:c,className:"btn",style:{background:"var(--status-warning)",color:"var(--text-inverse)",border:"1px solid var(--status-warning)",fontWeight:600,padding:"0 var(--sp-4)"},children:"Send"})]})]})})}const Ex=[16109737,15251594,13935988,13012574,10515018,9133628],Cx=[2890510,4861722,9136404,12886874,1710618,9118976],u6=Ap,Bt=u6/2,Gt=7,be=14,ln=12,sn=5,Fi=10,Te=4,Wi=9,Ft=8;function Kc(n,t,a,l,o){n.circle(t,a-1,Gt+1),n.fill(o),n.circle(t,a,Gt),n.fill(l),n.circle(t-3,a-1,1.5),n.fill(1710618),n.circle(t+3,a-1,1.5),n.fill(1710618),n.circle(t-2.5,a-1.5,.6),n.fill(16777215),n.circle(t+3.5,a-1.5,.6),n.fill(16777215)}function Zc(n,t,a,l,o,c){n.roundRect(t-l/2,a,l,o,3),n.fill(c),n.moveTo(t-3,a),n.lineTo(t,a+4),n.lineTo(t+3,a),n.stroke({width:1,color:o6(c,.15)})}function Ax(n,t,a,l,o){n.roundRect(t-l-1,a,l,o,2),n.fill(2899536),n.roundRect(t+1,a,l,o,2),n.fill(2899536)}function Mx(n,t,a,l){n.roundRect(t-l-2,a,l+2,3,1),n.fill(1710618),n.roundRect(t,a,l+2,3,1),n.fill(1710618)}function o6(n,t){const a=Math.max(0,(n>>16&255)*(1-t)),l=Math.max(0,(n>>8&255)*(1-t)),o=Math.max(0,(n&255)*(1-t));return Math.floor(a)<<16|Math.floor(l)<<8|Math.floor(o)}function c6(n){const t=new Map;for(let a=0;a<O0.length;a++){const l=O0[a],o=Ex[a%Ex.length],c=Cx[a%Cx.length],h=new ai;Kc(h,Bt,Ft,o,c),Zc(h,Bt,Ft+Gt,be,ln,l),h.roundRect(Bt-be/2-Te,Ft+Gt+1,Te,Wi,2),h.fill(l),h.roundRect(Bt+be/2,Ft+Gt+1,Te,Wi,2),h.fill(l),h.circle(Bt-be/2-Te/2,Ft+Gt+Wi+1,2),h.fill(o),h.circle(Bt+be/2+Te/2,Ft+Gt+Wi+1,2),h.fill(o),Ax(h,Bt,Ft+Gt+ln,sn,Fi),Mx(h,Bt,Ft+Gt+ln+Fi,sn),t.set(`agent-${a}-standing`,n.renderer.generateTexture(h));const m=new ai,p=Ft+4;Kc(m,Bt,p,o,c),Zc(m,Bt,p+Gt,be,ln-2,l),m.roundRect(Bt-be/2-Te+1,p+Gt+2,Te,Wi-3,2),m.fill(l),m.roundRect(Bt+be/2-1,p+Gt+2,Te,Wi-3,2),m.fill(l);const y=6;m.roundRect(Bt-sn-1,p+Gt+ln-2,sn+1,y,2),m.fill(2899536),m.roundRect(Bt,p+Gt+ln-2,sn+1,y,2),m.fill(2899536),t.set(`agent-${a}-seated`,n.renderer.generateTexture(m));const x=new ai,_=Ft+4;Kc(x,Bt+2,_,o,c),Zc(x,Bt+1,_+Gt,be,ln-2,l),x.roundRect(Bt+be/2,_+Gt+2,Te+4,4,2),x.fill(l),x.roundRect(Bt+be/2-2,_+Gt+2,Te+4,4,2),x.fill(l),x.circle(Bt+be/2+Te+3,_+Gt+4,2),x.fill(o),x.circle(Bt+be/2+Te+1,_+Gt+4,2),x.fill(o),m.roundRect(Bt-sn-1,_+Gt+ln-2,sn+1,y,2),m.fill(2899536),x.roundRect(Bt,_+Gt+ln-2,sn+1,y,2),x.fill(2899536),t.set(`agent-${a}-typing`,n.renderer.generateTexture(x));const T=new ai;Kc(T,Bt,Ft,o,c),Zc(T,Bt,Ft+Gt,be,ln,l),T.roundRect(Bt-be/2-Te,Ft+Gt-1,Te,Wi+2,2),T.fill(l),T.roundRect(Bt+be/2,Ft+Gt+3,Te,Wi-2,2),T.fill(l),T.roundRect(Bt+1,Ft+Gt+ln,sn,Fi+2,2),T.fill(2899536),T.roundRect(Bt-sn-1,Ft+Gt+ln-2,sn,Fi,2),T.fill(2899536),T.roundRect(Bt,Ft+Gt+ln+Fi+1,sn+2,3,1),T.fill(1710618),T.roundRect(Bt-sn-2,Ft+Gt+ln+Fi-3,sn+1,3,1),T.fill(1710618),t.set(`agent-${a}-walk-right`,n.renderer.generateTexture(T));const C=new ai;Kc(C,Bt,Ft,o,c),Zc(C,Bt,Ft+Gt,be,ln,l),C.roundRect(Bt+be/2,Ft+Gt-1,Te,Wi+2,2),C.fill(l),C.roundRect(Bt-be/2-Te,Ft+Gt+3,Te,Wi-2,2),C.fill(l),C.roundRect(Bt-sn-1,Ft+Gt+ln,sn,Fi+2,2),C.fill(2899536),C.roundRect(Bt+1,Ft+Gt+ln-2,sn,Fi,2),C.fill(2899536),C.roundRect(Bt-sn-2,Ft+Gt+ln+Fi+1,sn+2,3,1),C.fill(1710618),C.roundRect(Bt,Ft+Gt+ln+Fi-3,sn+1,3,1),C.fill(1710618),t.set(`agent-${a}-walk-left`,n.renderer.generateTexture(C));const M=new ai;Kc(M,Bt,Ft,o,c),Zc(M,Bt,Ft+Gt,be,ln,l),M.roundRect(Bt-be/2-Te,Ft+Gt+1,Te,Wi,2),M.fill(l),M.circle(Bt-be/2-Te/2,Ft+Gt+Wi+1,2),M.fill(o),M.roundRect(Bt+be/2,Ft+Gt,Te,6,2),M.fill(l),M.circle(Bt+be/2+Te/2+1,Ft+Gt,2),M.fill(o),M.roundRect(Bt+be/2+Te/2-1,Ft+Gt-6,6,7,1),M.fill(14142664),M.moveTo(Bt+be/2+Te/2,Ft+Gt-7),M.quadraticCurveTo(Bt+be/2+Te/2+2,Ft+Gt-11,Bt+be/2+Te/2,Ft+Gt-14),M.stroke({width:1,color:16777215,alpha:.4}),M.moveTo(Bt+be/2+Te/2+3,Ft+Gt-7),M.quadraticCurveTo(Bt+be/2+Te/2+5,Ft+Gt-10,Bt+be/2+Te/2+3,Ft+Gt-13),M.stroke({width:1,color:16777215,alpha:.3}),Ax(M,Bt,Ft+Gt+ln,sn,Fi),Mx(M,Bt,Ft+Gt+ln+Fi,sn),t.set(`agent-${a}-coffee`,n.renderer.generateTexture(M))}return t}function f6(n,t){const a=n%O0.length;let l;switch(t){case"working":l="typing";break;case"typing":l="typing";break;case"standing":l="standing";break;case"coffee":l="coffee";break;case"walk-right":l="walk-right";break;case"walk-left":l="walk-left";break;case"delivering":l="walk-right";break;case"idle":l="standing";break;case"seated":l="seated";break;case"checkpoint":case"done":default:l="seated";break}return`agent-${a}-${l}`}function h6(n,t){const a=ib;n.roundRect(0,0,t.totalWidth,t.totalHeight,4),n.fill(nf.wall),n.rect(0,0,t.totalWidth,3),n.fill({color:nf.wallHighlight,alpha:.5}),zx(n,t.corridorH.x,t.corridorH.y,t.corridorH.width,t.corridorH.height,"horizontal"),zx(n,t.corridorV.x,t.corridorV.y,t.corridorV.width,t.corridorV.height,"vertical");for(const T of t.squadOrigins){const{origin:C,width:M,height:w,doorSide:z}=T;z==="right"?nd(n,C.x+M,C.y+w/2-ar/2,a,ar):z==="left"?nd(n,C.x-a,C.y+w/2-ar/2,a,ar):z==="top"?ed(n,C.x+M/2-ar/2,C.y-a,ar,a):ed(n,C.x+M/2-ar/2,C.y+w,ar,a)}const l=t.ceoOffice,o=Math.min(ar,60);nd(n,l.x+l.width,l.y+l.height/2-o/2,a,o),ed(n,l.x+l.width/2-o/2,l.y+l.height,o,a);const c=t.bathroomMale;ed(n,c.x+c.width/2-30,c.y+c.height,60,a);const h=t.bathroomFemale;ed(n,h.x+h.width/2-30,h.y+h.height,60,a);const m=t.kitchen;nd(n,m.x+m.width,m.y+m.height/2-30,a,60);const p=t.restArea;nd(n,p.x-a,p.y+p.height/2-30,a,60);const y=t.corridorV;if(y.height>100){const T=y.x+y.width/2;for(let C=y.y+60;C<y.y+y.height-40;C+=200)Rx(n,T,C)}const x=t.corridorH,_=x.y+x.height/2;for(let T=x.x+80;T<x.x+x.width-80;T+=220)Rx(n,T,_);n.roundRect(0,0,t.totalWidth,t.totalHeight,4),n.stroke({width:2,color:5533306,alpha:.6})}function ed(n,t,a,l,o){n.rect(t,a,l,o),n.fill(su.floor),n.rect(t-2,a,2,o),n.fill(nf.doorFrame),n.rect(t+l,a,2,o),n.fill(nf.doorFrame)}function nd(n,t,a,l,o){n.rect(t,a,l,o),n.fill(su.floor),n.rect(t,a-2,l,2),n.fill(nf.doorFrame),n.rect(t,a+o,l,2),n.fill(nf.doorFrame)}function Rx(n,t,a){n.roundRect(t-8,a-12,16,12,2),n.fill(9133628),n.circle(t,a-16,8),n.fill(5025616),n.circle(t-4,a-20,5),n.fill(3706428),n.circle(t+4,a-18,6),n.fill(6732650)}function zx(n,t,a,l,o,c){n.rect(t,a,l,o),n.fill(su.floor);const h=40;for(let m=0;m<Math.ceil(o/h);m++){for(let p=0;p<Math.ceil(l/h);p++){const y=t+p*h,x=a+m*h;(m+p)%2===0&&(n.rect(y,x,h,h),n.fill({color:su.tile,alpha:.5})),n.moveTo(y,a),n.lineTo(y,a+o),n.stroke({width:.5,color:su.grout,alpha:.3})}n.moveTo(t,a+m*h),n.lineTo(t+l,a+m*h),n.stroke({width:.5,color:su.grout,alpha:.3})}c==="horizontal"?(n.rect(t+10,a+o/2-2,l-20,4),n.fill({color:su.stripe,alpha:.3})):(n.rect(t+l/2-2,a+10,4,o-20),n.fill({color:su.stripe,alpha:.3}))}function wx(n,t,a,l,o,c){n.rect(t,a,l,o),n.fill(Ha.floor);const h=20;for(let z=0;z<Math.ceil(o/h);z++)for(let D=0;D<Math.ceil(l/h);D++)if((z+D)%2===0){const N=t+D*h,j=a+z*h;n.rect(N,j,h,h),n.fill({color:Ha.tile,alpha:.4})}for(let z=0;z<=Math.ceil(o/h);z++)n.moveTo(t,a+z*h),n.lineTo(t+l,a+z*h),n.stroke({width:.5,color:Ha.tileGrout,alpha:.3});for(let z=0;z<=Math.ceil(l/h);z++)n.moveTo(t+z*h,a),n.lineTo(t+z*h,a+o),n.stroke({width:.5,color:Ha.tileGrout,alpha:.3});const m=Math.min(6,Math.max(2,Math.floor((l-20)/70))),p=(l-20)/m,y=80,x=a+o-y-10;for(let z=0;z<m;z++){const D=t+10+z*p;n.rect(D,x,3,y),n.fill(Ha.stall),n.rect(D+p-3,x,3,y),n.fill(Ha.stall),n.roundRect(D+6,x,p-12,y-4,2),n.fill({color:Ha.stallDoor,alpha:.6}),n.circle(D+p-16,x+y/2,2),n.fill({color:7901340,alpha:.8});const N=D+p/2,j=x+y-24;n.roundRect(N-8,j,16,20,4),n.fill(Ha.toilet),n.roundRect(N-6,j+2,12,14,3),n.fill(Ha.toiletSeat),n.roundRect(N-6,j+2,12,14,3),n.stroke({width:.5,color:12434877,alpha:.5})}const _=Math.min(4,Math.max(2,Math.floor(l/100))),T=l/(_+1),C=a+30;n.rect(t+4,a+4,l-8,60),n.fill({color:Ha.wall,alpha:.3});for(let z=0;z<_;z++){const D=t+T*(z+1);n.roundRect(D-12,a+8,24,20,3),n.fill(Ha.mirrorFrame),n.roundRect(D-10,a+10,20,16,2),n.fill(Ha.mirror),n.roundRect(D-6,a+12,6,10,1),n.fill({color:16777215,alpha:.15}),n.roundRect(D-14,C,28,16,3),n.fill(Ha.sink),n.ellipse(D,C+8,8,5),n.fill(Ha.sinkBowl),n.ellipse(D,C+8,8,5),n.stroke({width:.5,color:12434877,alpha:.4}),n.roundRect(D-2,C+1,4,6,1),n.fill(Ha.pipe)}const M=t+l/2,w=a+o-20;n.roundRect(M-12,w-6,24,14,3),n.fill({color:3622735,alpha:.7}),c==="male"?(n.circle(M,w-2,3),n.fill({color:16777215,alpha:.8}),n.rect(M-3,w+1,6,4),n.fill({color:4367861,alpha:.8})):(n.circle(M,w-2,3),n.fill({color:16777215,alpha:.8}),n.moveTo(M-5,w+5),n.lineTo(M+5,w+5),n.lineTo(M,w+1),n.closePath(),n.fill({color:15684432,alpha:.8})),n.rect(t,a,l,o),n.stroke({width:1,color:0,alpha:.08})}function d6(n,t,a,l,o){n.rect(t,a,l,o),n.fill(qn.floor);const c=24;for(let y=0;y<Math.ceil(o/c);y++)for(let x=0;x<Math.ceil(l/c);x++)(y+x)%2===0&&(n.rect(t+x*c,a+y*c,c,c),n.fill({color:qn.tile,alpha:.4}));for(let y=0;y<=Math.ceil(o/c);y++)n.moveTo(t,a+y*c),n.lineTo(t+l,a+y*c),n.stroke({width:.5,color:qn.tileGrout,alpha:.3});for(let y=0;y<=Math.ceil(l/c);y++)n.moveTo(t+y*c,a),n.lineTo(t+y*c,a+o),n.stroke({width:.5,color:qn.tileGrout,alpha:.3});n.roundRect(t+6,a+10,24,o-20,3),n.fill(qn.counter),n.roundRect(t+7,a+11,22,o-22,2),n.fill(qn.counterTop),n.roundRect(t+6,a+10,24,40,3),n.fill(qn.fridge),n.roundRect(t+8,a+12,20,18,2),n.fill(qn.fridgeDoor),n.roundRect(t+8,a+32,20,16,2),n.fill(qn.fridgeDoor),n.roundRect(t+26,a+20,2,8,1),n.fill(qn.fridgeHandle),n.roundRect(t+26,a+36,2,8,1),n.fill(qn.fridgeHandle),n.roundRect(t+10,a+60,16,20,2),n.fill(qn.coffeeMaker),n.circle(t+18,a+64,2),n.fill({color:qn.coffeeMakerLight,alpha:.9});const h=t+l/2-16,m=a+o/2-12;n.roundRect(h,m,32,24,4),n.fill(qn.table),n.roundRect(h+2,m+2,28,20,3),n.fill(qn.tableTop);const p=[{cx:h-6,cy:m+12},{cx:h+38,cy:m+12},{cx:h+16,cy:m+30}];for(const y of p)n.roundRect(y.cx-5,y.cy-5,10,10,3),n.fill(qn.chair);n.circle(t+l/2,a+8,4),n.fill({color:qn.lamp,alpha:.6}),n.circle(t+l/2,a+8,8),n.fill({color:qn.lamp,alpha:.1}),n.rect(t,a,l,o),n.stroke({width:1,color:0,alpha:.08})}function m6(n,t,a,l,o){n.rect(t,a,l,o),n.fill(ti.floor),n.roundRect(t+8,a+8,l-16,o-16,6),n.fill({color:ti.carpet,alpha:.2}),n.roundRect(t+12,a+12,l-24,o-24,4),n.stroke({width:1,color:ti.carpetBorder,alpha:.15});const c=t+10,h=a+10,m=l-20,p=28;n.roundRect(c,h,m,10,3),n.fill(ti.sofaArm),n.roundRect(c,h+8,m,p-8,4),n.fill(ti.sofa);const y=(m-12)/3;for(let M=0;M<3;M++)n.roundRect(c+4+M*(y+2),h+10,y,p-14,3),n.fill(ti.sofaCushion);n.roundRect(c-2,h+6,6,p-4,2),n.fill(ti.sofaArm),n.roundRect(c+m-4,h+6,6,p-4,2),n.fill(ti.sofaArm);const x=t+l/2,_=a+o-20;n.roundRect(x-12,_+8,24,10,2),n.fill(ti.tvStand),n.roundRect(x-20,_-12,40,22,2),n.fill(ti.tv),n.roundRect(x-18,_-10,36,18,1),n.fill(ti.tvScreen),n.roundRect(x-14,_-8,10,6,1),n.fill({color:16777215,alpha:.05});const T=t+l-30,C=a+o/2-8;n.roundRect(T,C,20,16,3),n.fill(ti.sideTable),n.rect(T+3,C+2,8,11),n.fill({color:ti.magazine,alpha:.7}),n.rect(T+8,C+4,8,10),n.fill({color:ti.magazineAlt,alpha:.6}),n.roundRect(t+8,a+o-40,12,10,2),n.fill(9133628),n.circle(t+14,a+o-34,7),n.fill(5025616),n.circle(t+11,a+o-38,4),n.fill(3706428),n.rect(t,a,l,o),n.stroke({width:1,color:0,alpha:.08})}function p6(n,t,a){n.rect(0,0,t,a),n.fill(Yt.floor);const l=20,o=80;for(let _=0;_<Math.ceil(a/l);_++){const T=_%2*(o/2),C=_*l;n.moveTo(0,C),n.lineTo(t,C),n.stroke({width:1,color:Yt.floorGrout,alpha:.4});for(let M=0;M<Math.ceil(t/o)+1;M++){const w=M*o-T;w>0&&w<t&&(n.moveTo(w,C),n.lineTo(w,C+l),n.stroke({width:1,color:Yt.floorGrout,alpha:.25}))}_%3===0&&(n.rect(0,C+2,t,l-4),n.fill({color:Yt.floorHighlight,alpha:.08}))}const c=42;n.rect(0,c,t,4),n.fill({color:0,alpha:.1}),n.rect(0,0,t,c),n.fill({color:Yt.wall,alpha:.2}),n.rect(0,0,t,3),n.fill({color:Yt.wallTrim,alpha:.15}),n.rect(0,c-4,t,4),n.fill({color:Yt.baseboard,alpha:.2});const h=120,m=t-h*2,p=a-200,y=h,x=100;m>100&&p>60&&(n.roundRect(y+3,x+3,m,p,6),n.fill({color:0,alpha:.08}),n.roundRect(y,x,m,p,6),n.fill({color:Yt.rug,alpha:.15}),n.roundRect(y+4,x+4,m-8,p-8,4),n.stroke({width:1.5,color:Yt.rugBorder,alpha:.12}),n.roundRect(y+12,x+12,m-24,p-24,3),n.stroke({width:1,color:Yt.rugPattern,alpha:.1}))}function y6(n,t,a){const l=t+zl/2,o=a+iu+8;for(let w=0;w<5;w++){const z=w/5*Math.PI*2-Math.PI/2,D=l+Math.cos(z)*10,N=o+14+Math.sin(z)*5;n.circle(D,N,2),n.fill(Yt.chairWheel)}n.rect(l-1.5,o+4,3,12),n.fill(Yt.chairBase),n.roundRect(l-14,o,28,10,4),n.fill(Yt.chairSeat),n.roundRect(l-12,o+1,24,4,3),n.fill({color:Yt.chairBack,alpha:.5}),n.roundRect(l-12,o-16,24,18,5),n.fill(Yt.chairBack),n.roundRect(l-10,o-14,20,8,3),n.fill({color:16777215,alpha:.05}),n.roundRect(t+3,a+3,zl,iu,4),n.fill({color:0,alpha:.12}),n.roundRect(t,a,zl,iu,4),n.fill(Yt.desk),n.roundRect(t+2,a+2,zl-4,iu-4,3),n.fill(Yt.deskTop);for(let w=0;w<3;w++){const z=a+10+w*16;n.moveTo(t+6,z),n.lineTo(t+zl-6,z),n.stroke({width:.5,color:Yt.deskShadow,alpha:.2})}n.rect(t+2,a+iu-6,zl-4,4),n.fill(Yt.deskEdge);const c=4,h=8;n.rect(t+4,a+iu,c,h),n.fill(Yt.deskLeg),n.rect(t+zl-4-c,a+iu,c,h),n.fill(Yt.deskLeg);const m=32,p=22,y=t+(zl-m)/2,x=a+8;n.roundRect(y+m/2-10,x+p+4,20,4,2),n.fill(Yt.monitorStand),n.rect(y+m/2-2,x+p,4,6),n.fill(Yt.monitorStand),n.roundRect(y,x,m,p,2),n.fill(Yt.monitor),n.roundRect(y+2,x+2,m-4,p-5,1),n.fill(Yt.monitorScreen),n.roundRect(y+3,x+3,m-6,6,1),n.fill({color:Yt.monitorScreenGlow,alpha:.3});const _=24,T=8,C=y+(m-_)/2,M=x+p+10;n.roundRect(C,M,_,T,2),n.fill(Yt.keyboard);for(let w=0;w<3;w++)for(let z=0;z<6;z++)n.rect(C+2+z*3.5,M+1.5+w*2.5,2.5,1.5),n.fill(Yt.keyboardKey);n.roundRect(t+zl-18,a+14,7,8,2),n.fill(14142664),n.roundRect(t+zl-11,a+16,3,4,1),n.fill(14142664),n.rect(t+8,a+20,14,18),n.fill(16775620),n.rect(t+8,a+20,14,2),n.fill(16635957),n.rect(t+10,a+24,10,1.5),n.fill(1402304)}function g6(n,t,a){n.roundRect(t+2,a+2,44,64,3),n.fill({color:0,alpha:.1}),n.roundRect(t,a,44,64,3),n.fill(Yt.bookshelf),n.roundRect(t+1,a+1,42,62,2),n.stroke({width:1,color:Yt.bookshelfEdge,alpha:.3}),n.rect(t+3,a+3,38,58),n.fill({color:6048310,alpha:.5});for(let l=0;l<3;l++){const o=a+8+l*20;n.rect(t+3,o+14,38,3),n.fill(Yt.bookshelfEdge),n.rect(t+3,o+17,38,1),n.fill({color:0,alpha:.1});const c=4+l%2;for(let h=0;h<c;h++){const m=t+5+h*(34/c),p=Math.max(4,34/c-2),y=10+(h*3+l*2)%5,x=(h+l*3)%Yt.bookColors.length;n.rect(m,o+14-y,p,y),n.fill(Yt.bookColors[x]),n.rect(m+1,o+14-y+2,.8,y-4),n.fill({color:16777215,alpha:.15})}l===1&&(n.circle(t+38,o+8,4),n.fill({color:4367861,alpha:.6}),n.circle(t+38,o+8,4),n.stroke({width:.5,color:2001125,alpha:.4}))}n.roundRect(t+14,a-4,8,6,1),n.fill(Yt.pot),n.circle(t+18,a-6,5),n.fill(Yt.plantLight),n.circle(t+15,a-8,3),n.fill(Yt.plant)}function Dx(n,t,a){n.ellipse(t+12,a+34,12,3),n.fill({color:0,alpha:.1}),n.moveTo(t+2,a+16),n.lineTo(t+4,a+32),n.lineTo(t+20,a+32),n.lineTo(t+22,a+16),n.closePath(),n.fill(Yt.pot),n.roundRect(t,a+14,24,5,2),n.fill(Yt.potRim),n.roundRect(t+2,a+14,20,2,1),n.fill({color:16777215,alpha:.08}),n.ellipse(t+12,a+16,10,3),n.fill(Yt.soil),n.rect(t+11,a+2,2,14),n.fill(Yt.plantDark),n.ellipse(t+6,a+4,7,5),n.fill(Yt.plantDark),n.ellipse(t+18,a+2,6,5),n.fill(Yt.plantDark),n.ellipse(t+12,a+1,8,6),n.fill(Yt.plant),n.ellipse(t+4,a+8,6,4),n.fill(Yt.plant),n.ellipse(t+20,a+8,6,4),n.fill(Yt.plant),n.ellipse(t+9,a+5,5,4),n.fill(Yt.plantLight),n.ellipse(t+15,a+3,5,4),n.fill(Yt.plantLight),n.moveTo(t+12,a-2),n.lineTo(t+12,a+6),n.stroke({width:.5,color:Yt.plantDark,alpha:.3})}function v6(n,t,a){n.roundRect(t+2,a+2,80,40,4),n.fill({color:0,alpha:.1}),n.roundRect(t,a,80,40,4),n.fill(pa.counter),n.roundRect(t+1,a+1,78,8,3),n.fill(pa.counterTop),n.roundRect(t+2,a+2,76,3,2),n.fill({color:16777215,alpha:.06}),n.roundRect(t+4,a-14,28,38,3),n.fill(pa.machine),n.roundRect(t+5,a-14,26,6,2),n.fill(pa.machineTop),n.roundRect(t+8,a+16,20,4,1),n.fill({color:2503224,alpha:.8}),n.rect(t+13,a+8,3,8),n.fill(pa.machineTop),n.rect(t+20,a+8,3,8),n.fill(pa.machineTop),n.circle(t+18,a-8,2.5),n.fill({color:pa.machineLight,alpha:.9}),n.circle(t+18,a-8,5),n.fill({color:pa.machineLight,alpha:.15}),n.roundRect(t+38,a+8,8,10,2),n.fill(pa.cup),n.roundRect(t+46,a+10,3,5,1),n.fill(pa.cup),n.roundRect(t+48,a+6,8,10,2),n.fill(pa.cupShadow),n.ellipse(t+42,a+20,10,3),n.fill(pa.saucer),n.roundRect(t+60,a+6,16,14,3),n.fill(pa.sink),n.roundRect(t+62,a+8,12,10,2),n.fill({color:5533306,alpha:.8}),n.rect(t+66,a-2,3,10),n.fill(pa.faucet),n.roundRect(t+65,a-4,8,3,1),n.fill(pa.faucet),n.roundRect(t+10,a-30,30,14,2),n.fill(pa.menu),n.rect(t+14,a-27,22,2),n.fill({color:16777215,alpha:.5}),n.rect(t+14,a-23,16,1.5),n.fill({color:16777215,alpha:.3}),n.rect(t+14,a-20,18,1.5),n.fill({color:16777215,alpha:.3})}function x6(n,t,a){n.roundRect(t-16,a-24,128,96,6),n.fill({color:xi.carpet,alpha:.25}),n.roundRect(t-12,a-20,120,88,4),n.stroke({width:1,color:xi.carpetPattern,alpha:.2});const l=t+10,o=a-20;n.roundRect(l+2,o+2,76,16,2),n.fill({color:0,alpha:.1}),n.roundRect(l,o,76,16,2),n.fill(xi.whiteboardFrame),n.roundRect(l+2,o+2,72,12,1),n.fill(xi.whiteboard),n.rect(l+6,o+4,18,8),n.fill({color:16775620,alpha:.6}),n.rect(l+28,o+4,18,8),n.fill({color:12312315,alpha:.6}),n.rect(l+50,o+4,18,8),n.fill({color:13166281,alpha:.6}),n.roundRect(l+20,o+14,36,3,1),n.fill(xi.whiteboardFrame),n.roundRect(t+3,a+3,96,48,6),n.fill({color:0,alpha:.1}),n.roundRect(t,a,96,48,6),n.fill(xi.table),n.roundRect(t+2,a+2,92,44,5),n.fill(xi.tableTop),n.roundRect(t+6,a+4,40,10,3),n.fill({color:16777215,alpha:.04}),n.roundRect(t+1,a+1,94,46,5),n.stroke({width:1,color:xi.tableEdge,alpha:.4});const c=4,h=6;n.rect(t+8,a+48,c,h),n.fill(xi.tableLeg),n.rect(t+84,a+48,c,h),n.fill(xi.tableLeg);const m=[{cx:t+16,cy:a-10},{cx:t+48,cy:a-10},{cx:t+80,cy:a-10},{cx:t+16,cy:a+56},{cx:t+48,cy:a+56},{cx:t+80,cy:a+56}];for(const p of m){const x=p.cy<a?p.cy-6:p.cy+6;n.roundRect(p.cx-8,x-4,16,10,3),n.fill(xi.chairBack),n.roundRect(p.cx-7,p.cy-4,14,8,3),n.fill(xi.chairSeat),n.roundRect(p.cx-5,p.cy-3,10,3,2),n.fill({color:16777215,alpha:.06}),n.circle(p.cx,p.cy+5,2),n.fill(xi.chair)}n.roundRect(t+10,a+8,18,12,2),n.fill(3622735),n.roundRect(t+11,a+9,16,8,1),n.fill(4545124),n.rect(t+60,a+12,12,16),n.fill({color:16777215,alpha:.7}),n.rect(t+62,a+14,8,1),n.fill({color:3355443,alpha:.3}),n.rect(t+62,a+17,6,1),n.fill({color:3355443,alpha:.3}),n.roundRect(t+40,a+10,6,14,2),n.fill({color:4367861,alpha:.6}),n.roundRect(t+41,a+7,4,4,1),n.fill({color:9489145,alpha:.5})}const b6={running:bo.statusRunning,idle:bo.statusIdle,completed:bo.statusCompleted,checkpoint:bo.statusCheckpoint};function S6(n,t,a,l){const o=a*.85,c=t+(a-o)/2,h=6,m=30;n.roundRect(c+2,h+2,o,m,8),n.fill({color:0,alpha:.15}),n.roundRect(c,h,o,m,8),n.fill({color:bo.background,alpha:.85}),n.roundRect(c+2,h+1,o-4,8,6),n.fill({color:bo.backgroundGlow,alpha:.4}),n.roundRect(c,h,o,m,8),n.stroke({width:1,color:16777215,alpha:.08});const p=b6[l]??bo.statusIdle,y=c+o-18,x=h+m/2;n.circle(y,x,7),n.fill({color:p,alpha:.2}),n.circle(y,x,4),n.fill(p),n.circle(y-1,x-1,1.5),n.fill({color:16777215,alpha:.3}),n.circle(c+14,x,2),n.fill({color:16777215,alpha:.1})}Jp({Container:$n,Graphics:ai,Sprite:rf,Text:Wp});function zg({agent:n,textures:t,bubbleText:a,animX:l,animY:o,animPose:c}){const h=f6(n.colorIndex,c),m=t.get(h),p=KT[n.status==="walking"?"idle":n.status]??8947848,y=n.status==="checkpoint",x=Y.useCallback(T=>{T.clear(),T.circle(0,0,Ap/2+6),T.fill({color:p,alpha:y?.4:.15})},[p,y]),_=Y.useCallback(T=>{if(T.clear(),!a)return;const C=Math.min(a.length*5+16,160);T.roundRect(-C/2,-42,C,22,6),T.fill({color:1710638,alpha:.9}),T.moveTo(-4,-20),T.lineTo(4,-20),T.lineTo(0,-15),T.closePath(),T.fill({color:1710638,alpha:.9})},[a]);return R.jsxs("container",{x:l,y:o,children:[R.jsx("graphics",{draw:x}),m&&R.jsx("sprite",{texture:m,anchor:.5}),R.jsx("text",{text:n.name,y:Ap/2+4,anchor:{x:.5,y:0},style:{fontSize:9,fill:"#cccccc",fontFamily:"sans-serif"}}),y&&R.jsx("text",{text:"⚠",y:-Ap/2-12,anchor:.5,style:{fontSize:14,fill:"#ff9800",fontFamily:"sans-serif"}}),a&&R.jsxs(R.Fragment,{children:[R.jsx("graphics",{draw:_}),R.jsx("text",{text:a.length>80?a.slice(-80)+"…":a,y:-31,anchor:{x:.5,y:.5},style:{fontSize:8,fill:"#ffffff",fontFamily:"sans-serif",wordWrap:!0,wordWrapWidth:140}})]})]})}Jp({Container:$n,Graphics:ai,Text:Wp});function _6({squadName:n,status:t,agents:a,textures:l,bubbles:o,animStates:c,originX:h,originY:m,roomWidth:p,roomHeight:y}){const x={x:0,y:0},_=sd(x,p,y),T=lb(x,p,y),C=Y.useCallback(M=>{M.clear(),p6(M,p,y),S6(M,0,p,t);for(let w=0;w<a.length;w++){const z=ef(w,x);y6(M,z.x-48,z.y-32)}v6(M,_.x,_.y),x6(M,T.x,T.y),g6(M,p-60,44),Dx(M,10,y-50),Dx(M,p-40,50)},[a.length,t,p,y]);return R.jsxs("container",{x:h,y:m,children:[R.jsx("graphics",{draw:C}),R.jsx("text",{text:n,x:p/2,y:22,anchor:.5,style:{fontSize:14,fill:"#ffffff",fontFamily:"sans-serif",fontWeight:"bold"}}),a.map(M=>{const w=`${n}:${M.id}`,z=o[w],D=c[M.id];return D!=null&&D.isExternalTransit?null:R.jsx(zg,{agent:M,textures:l,bubbleText:(z==null?void 0:z.text)??null,animX:(D==null?void 0:D.x)??M.position.x,animY:(D==null?void 0:D.y)??M.position.y,animPose:(D==null?void 0:D.pose)??(M.status==="working"?"typing":"seated")},M.id)})]})}function T6(n,t,a,l,o){n.rect(t,a,l,o),n.fill($a.floor);const c=16,h=60;for(let et=0;et<Math.ceil(o/c);et++){const ct=et%2*(h/2),vt=a+et*c;n.moveTo(t,vt),n.lineTo(t+l,vt),n.stroke({width:.5,color:4861984,alpha:.3});for(let dt=0;dt<Math.ceil(l/h)+1;dt++){const St=t+dt*h-ct;St>t&&St<t+l&&(n.moveTo(St,vt),n.lineTo(St,vt+c),n.stroke({width:.5,color:4861984,alpha:.2}))}}const m=30,p=l-m*2,y=o-m*2,x=t+m,_=a+m;n.roundRect(x+2,_+2,p,y,6),n.fill({color:0,alpha:.1}),n.roundRect(x,_,p,y,6),n.fill({color:$a.carpet,alpha:.6}),n.roundRect(x+6,_+6,p-12,y-12,4),n.stroke({width:1.5,color:$a.carpetBorder,alpha:.4}),n.roundRect(x+14,_+14,p-28,y-28,3),n.stroke({width:1,color:16766287,alpha:.15});const T=t+8,C=a+40,M=6,w=80;n.roundRect(T-2,C-2,M+4,w+4,2),n.fill($a.windowFrame),n.roundRect(T,C,M,w,1),n.fill($a.window),n.rect(T+1,C+4,2,w/3),n.fill({color:16777215,alpha:.2}),n.roundRect(T-4,C+w+2,M+8,3,1),n.fill($a.windowSill);const z=120,D=60,N=t+l/2-z/2,j=a+o/2-D/2-10;n.roundRect(N+3,j+3,z,D,4),n.fill({color:0,alpha:.12}),n.roundRect(N,j,z,D,4),n.fill($a.desk),n.roundRect(N+3,j+3,z-6,D-6,3),n.fill($a.deskTop),n.roundRect(N+1,j+1,z-2,D-2,4),n.stroke({width:1,color:$a.deskEdge,alpha:.3}),n.roundRect(N+20,j+8,32,22,2),n.fill(2236976),n.roundRect(N+22,j+10,28,16,1),n.fill(1981020),n.roundRect(N+18,j+34,36,10,2),n.fill(3355456),n.rect(N+70,j+10,16,22),n.fill({color:16777215,alpha:.7}),n.rect(N+72,j+14,10,1),n.fill({color:3355443,alpha:.3}),n.rect(N+72,j+17,8,1),n.fill({color:3355443,alpha:.3}),n.roundRect(N+90,j+12,10,14,2),n.fill(3622735),n.circle(N+100,j+42,5),n.fill(14142664),n.circle(N+100,j+42,3),n.fill(7951688);const G=N+z/2,k=j+D+16;n.roundRect(G-14,k-4,28,16,6),n.fill($a.chair),n.roundRect(G-12,k-8,24,12,4),n.fill($a.chairSeat),n.roundRect(G-8,k-6,16,4,2),n.fill({color:16777215,alpha:.06}),n.circle(G,k+14,3),n.fill(4473924);for(const et of[-8,0,8])n.circle(G+et,k+18,1.5),n.fill(3355443);const q=t+l-54,Z=a+20;n.roundRect(q,Z,44,80,3),n.fill($a.bookshelf);const W=[15022389,2001125,4431943,16750592,9315498,35195];for(let et=0;et<3;et++){const ct=Z+8+et*26;n.rect(q+3,ct+18,38,3),n.fill(9139029);for(let vt=0;vt<5;vt++){const dt=q+5+vt*7,St=12+(vt*3+et*2)%6;n.rect(dt,ct+18-St,5,St),n.fill(W[(vt+et*2)%W.length])}}const L=t+l-54,$=a+o-60;n.roundRect(L,$+10,24,16,2),n.fill(6111287),n.rect(L+10,$+4,4,8),n.fill(7901340),n.circle(L+12,$,10),n.fill($a.globe),n.circle(L+12,$,10),n.stroke({width:.5,color:2001125,alpha:.4}),n.circle(L+9,$-3,3),n.fill({color:16777215,alpha:.15}),n.roundRect(N+44,j+38,36,10,2),n.fill($a.nameplate),n.roundRect(N+44,j+38,36,10,2),n.stroke({width:.5,color:13215744,alpha:.5}),n.rect(t,a,l,o),n.stroke({width:1,color:0,alpha:.08})}Jp({Container:$n,Graphics:ai,Text:Wp});const Ox=["Precisamos escalar o time de vendas...","O Q4 vai ser decisivo.","Investir mais em marketing digital.","Meta trimestral no caminho certo.","Revisar budget de R&D...","Nova parceria pode mudar tudo.","Churn rate precisa cair 20%.","Hora de expandir para LATAM.","Reunião com investidores amanhã.","NPS subiu 15 pontos!","Cultura da empresa vem primeiro.","Mais dados antes de decidir.","Vamos automatizar esse processo.","Roadmap do próximo quarter...","Reter talentos é prioridade.","Revenue cresceu 30% no trimestre.","Precisamos de mais diversidade no time.","O mercado está mudando rápido.","Foco no cliente sempre.","Inovação é nosso diferencial."],Sp=900,Nx=2400,E6=6e3,C6={id:"ceo",name:"CEO",colorIndex:3,status:"working",deskIndex:0,position:{x:0,y:0},targetPosition:null};function A6({x:n,y:t,width:a,height:l,textures:o,ticker:c}){const[h,m]=Y.useState(null),[p,y]=Y.useState("seated"),x=Y.useRef(0),_=Y.useRef(Sp+Math.floor(Math.random()*(Nx-Sp))),T=Y.useRef(null),C=a/2,M=l/2+10,w=Y.useCallback(z=>{z.clear(),T6(z,0,0,a,l)},[a,l]);return Y.useEffect(()=>{if(!c)return;const z=()=>{x.current++;const D=x.current,N=Math.floor(D/48)%2===0?"typing":"seated";if(y(N),_.current--,_.current<=0){const j=Ox[Math.floor(Math.random()*Ox.length)];m(j),y("standing"),T.current&&clearTimeout(T.current),T.current=setTimeout(()=>{m(null)},E6),_.current=Sp+Math.floor(Math.random()*(Nx-Sp))}};return c.add(z),()=>{c.remove(z),T.current&&clearTimeout(T.current)}},[c]),R.jsxs("container",{x:n,y:t,children:[R.jsx("graphics",{draw:w}),R.jsx("text",{text:"CEO",x:a/2,y:12,anchor:.5,style:{fontSize:13,fill:"#ffd700",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx(zg,{agent:C6,textures:o,bubbleText:h,animX:C,animY:M,animPose:p})]})}const E0=150,M6=48,C0=30,_p=3,R6=4e3,Tp=600,A0=1800,z6=60,Bx=900,jx=5e3,Ux=[["Cafe novo?","Sim, colombiano!"],["Viu o deploy?","Passou nos testes!"],["Reuniao as 3?","Vou confirmar."],["Bug no login?","Ja corrigi."],["Almoco onde?","Sushi hoje?"],["PR aprovado?","Mergeei agora."],["Ta ocupado?","Pode falar."],["Deadline?","Sexta-feira."],["Novo feature?","Ficou muito bom!"],["Ajuda aqui?","Claro, mostra."],["Sprint review?","Amanha cedo."],["Stand-up?","Ja comecou!"],["Refatorei aquele modulo.","Ficou mais limpo."],["Testes passando?","Todos verdes!"],["Viu o Figma?","Design top!"],["Pipeline rodou?","Em 2 min."],["Code review?","Ja olhei, aprovo."],["Qual branch?","feature/office."],["Bom dia!","Bom dia! Tudo bem?"],["Feriado proximo?","Semana que vem!"]];function w6(n,t,a,l,o,c){const h={x:0,y:0},m=Math.random();if(m<.2){const p={x:o+n.x,y:c+n.y},y=rd(p,`squad-${l}`,"kitchen",a),x=e3(a);return{x:x.x,y:x.y,destination:"kitchen",waypoints:y,isExternal:!0}}else if(m<.35){const p={x:o+n.x,y:c+n.y},y=rd(p,`squad-${l}`,"rest-area",a),x=n3(a);return{x:x.x,y:x.y,destination:"restArea",waypoints:y,isExternal:!0}}else if(m<.45){const p=Math.random()<.5?"male":"female",y={x:o+n.x,y:c+n.y},x=p==="male"?"bathroom-male":"bathroom-female",_=rd(y,`squad-${l}`,x,a),T=t3(a,p);return{x:T.x,y:T.y,destination:x,waypoints:_,isExternal:!0}}else if(m<.6){const p=lb(h,t.width,t.height);return{x:p.x+(Math.random()-.5)*40,y:p.y+(Math.random()-.5)*30,destination:"meeting"}}else if(m<.75){const p=sd(h,t.width,t.height);return{x:p.x+(Math.random()-.5)*30,y:p.y+(Math.random()-.5)*20,destination:"coffee"}}else if(m<.9){const p={x:o+n.x,y:c+n.y},y=a3(a),x=[p,a.doorPoints[`squad-${l}`],y];return{x:y.x,y:y.y,destination:"corridor",waypoints:x,isExternal:!0}}else{const p=Math.floor(Math.random()*4),y=ef(p,h,t.width,t.height);return{x:y.x+(Math.random()-.5)*40,y:y.y+(Math.random()-.5)*20,destination:"neighbor"}}}function D6(n){const[t,a]=Y.useState({}),l=Y.useRef({}),o=Y.useRef({}),c=Y.useRef({}),h=Y.useRef({}),m=Y.useRef(0),p=Y.useRef({}),y=Y.useRef({});Y.useEffect(()=>{const _=Je.subscribe((T,C)=>{var z,D;const M=T.bubbles,w=C.bubbles;for(const N of Object.keys(M))if(((z=M[N])==null?void 0:z.updatedAt)!==((D=w[N])==null?void 0:D.updatedAt)){p.current[N]&&clearTimeout(p.current[N]);const[j,G]=N.split(":");p.current[N]=setTimeout(()=>{Je.getState().clearBubble(j,G),delete p.current[N]},R6)}});return()=>{_();for(const T of Object.values(p.current))clearTimeout(T);p.current={}}},[]);const x=Y.useCallback(()=>{m.current++;const _=m.current,T=Je.getState(),C={},M=wp(T.rooms.length);for(const[w,z]of Object.entries(T.agentVisuals)){l.current[w]||(l.current[w]={}),o.current[w]||(o.current[w]={}),C[w]={};const D=T.rooms.indexOf(w),N=M.squadOrigins[D],j=(N==null?void 0:N.origin)??{x:0,y:0},G=[];for(const k of z){const q=l.current[w],Z=o.current[w],W=`${w}:${k.id}`;Z[k.id]||(Z[k.id]={x:k.position.x,y:k.position.y,baseY:k.position.y},c.current[W]=Math.floor(Math.random()*A0));const L=Z[k.id];if(k.targetPosition&&(!q[k.id]||q[k.id].progress>=1)){const et=q[k.id];if(et!=null&&et.isExternalTransit){const ct=et.globalX??L.x+j.x,vt=et.globalY??L.y+j.y,dt={x:ct,y:vt},St={x:k.targetPosition.x+j.x,y:k.targetPosition.y+j.y},H=h.current[W],Q=H==="kitchen"?"kitchen":H==="restArea"?"rest-area":H==="bathroom-male"?"bathroom-male":H==="bathroom-female"?"bathroom-female":`squad-${D}`,ot=rd(dt,Q,`squad-${D}`,M);ot[ot.length-1]=St;const rt=ot.shift(),gt=ot.length>0?ot.shift():rt,U=lp(rt,gt);q[k.id]={startX:rt.x,startY:rt.y,targetX:gt.x,targetY:gt.y,progress:0,duration:Math.max(30,Math.ceil(U/_p)),baseY:k.targetPosition.y,waypointQueue:ot,isExternalTransit:!0,globalX:ct,globalY:vt}}else q[k.id]={startX:L.x,startY:L.baseY,targetX:k.targetPosition.x,targetY:k.targetPosition.y,progress:0,duration:E0,baseY:k.targetPosition.y,waypointQueue:[],isExternalTransit:!1}}if(k.status==="idle"&&(!q[k.id]||q[k.id].progress>=1)){const et=q[k.id];if(et!=null&&et.isExternalTransit&&et.waypointQueue.length===0&&et.progress>=1&&(et.globalX!==void 0&&et.globalY!==void 0&&(L.x=et.globalX-j.x,L.y=et.globalY-j.y,L.baseY=L.y),et.isExternalTransit=!1,et.globalX=void 0,et.globalY=void 0),c.current[W]===void 0&&(c.current[W]=Tp+Math.floor(Math.random()*(A0-Tp))),c.current[W]--,c.current[W]<=0){const ct=q[k.id];if(ct!=null&&ct.isExternalTransit){const vt=ct.globalX??L.x+j.x,dt=ct.globalY??L.y+j.y,St={x:vt,y:dt},H=ef(k.deskIndex,{x:0,y:0}),Q={x:H.x+j.x,y:H.y+j.y},ot=h.current[W],rt=ot==="kitchen"?"kitchen":ot==="restArea"?"rest-area":ot==="bathroom-male"?"bathroom-male":ot==="bathroom-female"?"bathroom-female":`squad-${D}`,gt=rd(St,rt,`squad-${D}`,M);gt[gt.length-1]=Q;const U=gt.shift(),F=gt.length>0?gt.shift():U,tt=lp(U,F);h.current[W]="neighbor",q[k.id]={startX:U.x,startY:U.y,targetX:F.x,targetY:F.y,progress:0,duration:Math.max(30,Math.ceil(tt/_p)),baseY:H.y,waypointQueue:gt,isExternalTransit:!0,globalX:vt,globalY:dt}}else{const dt=w6(j,N??{width:sr,height:Si},M,D,L.x,L.baseY);if(h.current[W]=dt.destination,dt.isExternal&&dt.waypoints&&dt.waypoints.length>1){const St=[...dt.waypoints],H=St.shift(),Q=St.length>0?St.shift():H,ot=lp(H,Q);q[k.id]={startX:H.x,startY:H.y,targetX:Q.x,targetY:Q.y,progress:0,duration:Math.max(30,Math.ceil(ot/_p)),baseY:dt.y-j.y,waypointQueue:St,isExternalTransit:!0,globalX:H.x,globalY:H.y}}else q[k.id]={startX:L.x,startY:L.baseY,targetX:dt.x,targetY:dt.y,progress:0,duration:E0+Math.floor(Math.random()*30),baseY:dt.y,waypointQueue:[],isExternalTransit:!1}}c.current[W]=Tp+Math.floor(Math.random()*(A0-Tp))}}const $=q[k.id];if($&&$.progress<1){$.progress=Math.min(1,$.progress+1/$.duration);const et=PT($.progress);if($.isExternalTransit){const ct=ip($.startX,$.targetX,et),vt=ip($.startY,$.targetY,et);$.globalX=ct,$.globalY=vt,L.x=ct-j.x,L.y=vt-j.y;const dt=Math.floor(_/C0)%2===0?"walk-right":"walk-left";C[w][k.id]={x:L.x,y:L.y,pose:dt,isExternalTransit:!0,globalX:ct,globalY:vt}}else{L.x=ip($.startX,$.targetX,et),L.y=ip($.startY,$.targetY,et),L.baseY=$.baseY;const ct=Math.floor(_/C0)%2===0?"walk-right":"walk-left";C[w][k.id]={x:L.x,y:L.y,pose:ct}}}else if($&&$.progress>=1&&$.waypointQueue.length>0){const et=$.waypointQueue.shift(),ct={x:$.targetX,y:$.targetY},vt=lp(ct,et);$.startX=$.targetX,$.startY=$.targetY,$.targetX=et.x,$.targetY=et.y,$.progress=0,$.duration=$.isExternalTransit?Math.max(30,Math.ceil(vt/_p)):E0,$.isExternalTransit&&($.globalX=$.startX,$.globalY=$.startY);const dt=Math.floor(_/C0)%2===0?"walk-right":"walk-left";$.isExternalTransit?C[w][k.id]={x:L.x,y:L.y,pose:dt,isExternalTransit:!0,globalX:$.startX,globalY:$.startY}:C[w][k.id]={x:L.x,y:L.y,pose:dt}}else if(k.status==="working"){const et=Math.floor(_/M6)%2===0?"typing":"seated";C[w][k.id]={x:L.x,y:L.baseY,pose:et}}else if(k.status==="idle"){const et=h.current[W]??"coffee",ct=q[k.id];if((ct==null?void 0:ct.isExternalTransit)??!1)C[w][k.id]={x:L.x,y:L.y,pose:"standing",isExternalTransit:!0,globalX:(ct==null?void 0:ct.globalX)??L.x+j.x,globalY:(ct==null?void 0:ct.globalY)??L.y+j.y};else{const dt=Math.sin(_*.07+k.deskIndex*1.5)*2;let St;et==="coffee"||et==="kitchen"?St="coffee":et==="meeting"||et==="neighbor"?St=Math.floor(_/90)%2===0?"standing":"coffee":et==="restArea"?St="seated":(et.startsWith("bathroom"),St="standing"),C[w][k.id]={x:L.x,y:L.baseY+dt,pose:St},G.push({agentKey:W,agentId:k.id,agentName:k.name,x:L.x,y:L.baseY})}}else k.status==="checkpoint"?C[w][k.id]={x:L.x,y:L.baseY,pose:"seated"}:C[w][k.id]={x:L.x,y:L.baseY,pose:"seated"}}if(_%60===0&&G.length>=2)for(let k=0;k<G.length;k++){const q=G[k];if(!(y.current[q.agentKey]&&_-y.current[q.agentKey]<Bx)&&!T.bubbles[q.agentKey])for(let Z=k+1;Z<G.length;Z++){const W=G[Z];if(y.current[W.agentKey]&&_-y.current[W.agentKey]<Bx||T.bubbles[W.agentKey])continue;const L=q.x-W.x,$=q.y-W.y;if(Math.sqrt(L*L+$*$)<z6){const[ct,vt]=Ux[Math.floor(Math.random()*Ux.length)];T.appendBubble(w,q.agentId,ct),setTimeout(()=>{Je.getState().appendBubble(w,W.agentId,vt)},1500),y.current[q.agentKey]=_,y.current[W.agentKey]=_;const dt=`${w}:${q.agentId}`,St=`${w}:${W.agentId}`;p.current[dt]&&clearTimeout(p.current[dt]),p.current[St]&&clearTimeout(p.current[St]),p.current[dt]=setTimeout(()=>{Je.getState().clearBubble(w,q.agentId),delete p.current[dt]},jx),p.current[St]=setTimeout(()=>{Je.getState().clearBubble(w,W.agentId),delete p.current[St]},jx+1500);break}}}}a(C)},[]);return Y.useEffect(()=>{if(n)return n.add(x),()=>{n.remove(x)}},[n,x]),t}Jp({Container:$n,Graphics:ai,Text:Wp});const O6=.3,N6=2;function B6(){const{app:n}=s6(),t=Y.useRef(null),[a,l]=Y.useState(new Map),o=Y.useRef(null),c=Je(T=>T.rooms),h=Je(T=>T.agentVisuals),m=Je(T=>T.bubbles),p=ei(T=>T.activeStates),y=D6((n==null?void 0:n.ticker)??null),x=Y.useMemo(()=>wp(c.length),[c.length]);Y.useEffect(()=>{n!=null&&n.renderer&&l(c6(n))},[n]);const _=Y.useCallback(T=>{T.clear(),h6(T,x),wx(T,x.bathroomMale.x,x.bathroomMale.y,x.bathroomMale.width,x.bathroomMale.height,"male"),wx(T,x.bathroomFemale.x,x.bathroomFemale.y,x.bathroomFemale.width,x.bathroomFemale.height,"female"),d6(T,x.kitchen.x,x.kitchen.y,x.kitchen.width,x.kitchen.height),m6(T,x.restArea.x,x.restArea.y,x.restArea.width,x.restArea.height)},[x]);return Y.useEffect(()=>{const T=n==null?void 0:n.canvas;if(!T)return;const C=D=>{const N=t.current;N&&(o.current={startX:D.clientX,startY:D.clientY,pivotX:N.position.x,pivotY:N.position.y},T.setPointerCapture(D.pointerId))},M=D=>{const N=t.current,j=o.current;!N||!j||(N.position.x=j.pivotX+(D.clientX-j.startX),N.position.y=j.pivotY+(D.clientY-j.startY))},w=D=>{o.current=null,T.releasePointerCapture(D.pointerId)},z=D=>{D.preventDefault();const N=t.current;if(!N)return;const j=N.scale.x,G=D.deltaY>0?.9:1.1,k=Math.max(O6,Math.min(N6,j*G)),q=T.getBoundingClientRect(),Z=D.clientX-q.left,W=D.clientY-q.top,L=k/j;N.position.x=Z-(Z-N.position.x)*L,N.position.y=W-(W-N.position.y)*L,N.scale.set(k)};return T.addEventListener("pointerdown",C),T.addEventListener("pointermove",M),T.addEventListener("pointerup",w),T.addEventListener("pointerleave",w),T.addEventListener("wheel",z,{passive:!1}),()=>{T.removeEventListener("pointerdown",C),T.removeEventListener("pointermove",M),T.removeEventListener("pointerup",w),T.removeEventListener("pointerleave",w),T.removeEventListener("wheel",z)}},[n]),R.jsxs("container",{ref:t,children:[R.jsx("graphics",{draw:_}),x.corridorV.height>0&&R.jsx("text",{text:"Corredor",x:x.corridorV.x+x.corridorV.width/2,y:x.corridorV.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Corredor",x:x.corridorH.x+x.corridorH.width/2,y:x.corridorH.y+8,anchor:{x:.5,y:0},style:{fontSize:11,fill:"#666666",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"WC ♂",x:x.bathroomMale.x+x.bathroomMale.width/2,y:x.bathroomMale.y+x.bathroomMale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"WC ♀",x:x.bathroomFemale.x+x.bathroomFemale.width/2,y:x.bathroomFemale.y+x.bathroomFemale.height-8,anchor:{x:.5,y:1},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Cozinha",x:x.kitchen.x+x.kitchen.width/2,y:x.kitchen.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#795548",fontFamily:"sans-serif",fontWeight:"bold"}}),R.jsx("text",{text:"Descanso",x:x.restArea.x+x.restArea.width/2,y:x.restArea.y+12,anchor:{x:.5,y:0},style:{fontSize:10,fill:"#546e7a",fontFamily:"sans-serif",fontWeight:"bold"}}),c.map((T,C)=>{var N;const M=x.squadOrigins[C];if(!M)return null;const w=h[T]??[],z=((N=p[T])==null?void 0:N.status)??"idle",D=y[T]??{};return R.jsx(_6,{squadName:T,status:z,agents:w,textures:a,bubbles:m,animStates:D,originX:M.origin.x,originY:M.origin.y,roomWidth:M.width,roomHeight:M.height},T)}),c.map((T,C)=>{const M=h[T]??[],w=y[T]??{};return M.filter(z=>{const D=w[z.id];return(D==null?void 0:D.isExternalTransit)&&D.globalX!==void 0&&D.globalY!==void 0}).map(z=>{const D=w[z.id],N=`${T}:${z.id}`,j=m[N];return R.jsx(zg,{agent:z,textures:a,bubbleText:(j==null?void 0:j.text)??null,animX:D.globalX,animY:D.globalY,animPose:D.pose},`transit-${z.id}`)})}),R.jsx(A6,{x:x.ceoOffice.x,y:x.ceoOffice.y,width:x.ceoOffice.width,height:x.ceoOffice.height,textures:a,ticker:(n==null?void 0:n.ticker)??null})]})}function j6(){const n=Je(l=>l.activeRoom),t=Je(l=>l.checkpoints),a=n?t[n]:void 0;return R.jsx("div",{style:{display:"flex",height:"100%"},children:R.jsxs("div",{style:{flex:1,position:"relative",overflow:"hidden"},children:[R.jsx(l6,{background:13158600,antialias:!0,resizeTo:window,style:{width:"100%",height:"100%"},children:R.jsx(B6,{})}),a&&R.jsx(r6,{agentName:a.agentName,question:a.question,onRespond:l=>QT(n,l)})]})})}function U6({message:n}){if(n.role==="agent_dm")return R.jsxs("div",{"data-role":"agent_dm",style:{alignSelf:"flex-start",background:"var(--surface-3)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"75%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--accent)",fontWeight:600,marginBottom:4,letterSpacing:"0.02em"},children:n.agentName}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.55},children:n.content})]});const t=n.role==="user";return R.jsx("div",{"data-role":n.role,style:{alignSelf:t?"flex-end":"flex-start",background:t?"var(--user-bubble)":"var(--agent-bubble)",border:t?"1px solid rgba(100, 160, 255, 0.15)":"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"75%",marginBottom:"var(--sp-2)",animation:"fadeInUp 0.3s var(--ease-out) both"},children:R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.55,whiteSpace:"pre-wrap"},children:n.content})})}function H6(){const[n,t]=Y.useState(""),a=Y.useRef(null),l=ei(M=>M.selectedSquad),o=Pi(M=>M.messages),c=Pi(M=>M.streaming),h=Pi(M=>M.streamingText),m=Pi(M=>M.error),p=Pi(M=>M.addUserMessage),y=Pi(M=>M.startStreaming),x=Pi(M=>M.loadHistory);if(Y.useEffect(()=>{l&&x(l)},[l,x]),Y.useEffect(()=>{var M,w;(w=(M=a.current)==null?void 0:M.scrollIntoView)==null||w.call(M,{behavior:"smooth"})},[o,h]),!l)return R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[R.jsx("div",{style:{width:48,height:48,borderRadius:"var(--radius-md)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"1.2rem",color:"var(--text-muted)"},children:"◈"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to start chatting"})]});const _=()=>{const M=n.trim();!M||c||(p(M),y(),VT(l,M),t(""))},T=M=>{M.key==="Enter"&&!M.shiftKey&&(M.preventDefault(),_())},C=n.trim()&&!c;return R.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[R.jsxs("div",{style:{flex:1,overflowY:"auto",padding:"var(--sp-4)",display:"flex",flexDirection:"column"},children:[o.map(M=>R.jsx(U6,{message:M},M.id)),c&&h&&R.jsx("div",{"data-role":"assistant",style:{alignSelf:"flex-start",background:"var(--agent-bubble)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"10px 14px",maxWidth:"75%",marginBottom:"var(--sp-2)"},children:R.jsxs("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.55,whiteSpace:"pre-wrap"},children:[h,R.jsx("span",{style:{display:"inline-block",width:6,height:14,background:"var(--accent)",marginLeft:2,animation:"pulse 1s ease-in-out infinite",borderRadius:1,verticalAlign:"text-bottom"}})]})}),m&&R.jsx("div",{style:{alignSelf:"center",background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.25)",borderRadius:"var(--radius-sm)",padding:"8px 14px",color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",marginBottom:"var(--sp-2)"},children:m}),R.jsx("div",{ref:a})]}),R.jsxs("div",{style:{display:"flex",padding:"var(--sp-3) var(--sp-4)",borderTop:"1px solid var(--border-subtle)",gap:"var(--sp-2)",background:"var(--surface-1)"},children:[R.jsx("input",{type:"text",className:"input",value:n,onChange:M=>t(M.target.value),onKeyDown:T,placeholder:"Type a message...",disabled:c,style:{flex:1}}),R.jsx("button",{onClick:_,disabled:!C,"aria-label":"Send",className:C?"btn btn-accent":"btn",style:{padding:"0 var(--sp-5)",cursor:C?"pointer":"not-allowed",opacity:C?1:.4},children:"Send"})]})]})}const G6={idle:"var(--status-idle)",working:"var(--accent)",delivering:"var(--accent-dim)",done:"var(--status-active)",checkpoint:"var(--status-warning)"};function Y6({agent:n}){const t=G6[n.status];return R.jsxs("div",{style:{background:"var(--surface-3)",borderRadius:"var(--radius-sm)",padding:"10px 12px",marginBottom:"var(--sp-2)",border:"1px solid var(--border-subtle)",transition:"border-color var(--duration-fast) var(--ease-out)"},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:4},children:[R.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:n.name}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.62rem",fontWeight:600,color:t,padding:"2px 6px",borderRadius:"var(--radius-full)",border:`1px solid ${t}`,textTransform:"lowercase",letterSpacing:"0.02em"},children:n.status})]}),n.stepLabel&&R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.4},children:n.stepLabel})]})}const q6=[{key:"pending",label:"Pending",color:"var(--status-idle)",glow:"none",filter:n=>n.status==="idle"},{key:"running",label:"Running",color:"var(--accent)",glow:"var(--accent-glow)",filter:n=>n.status==="working"||n.status==="checkpoint"||n.status==="delivering"},{key:"done",label:"Done",color:"var(--status-active)",glow:"var(--status-active-glow)",filter:n=>n.status==="done"}];function L6(){const n=ei(o=>o.selectedSquad),t=ei(o=>o.activeStates),a=n?t[n]:null,l=Y.useMemo(()=>a?q6.map(o=>({...o,agents:a.agents.filter(o.filter)})):null,[a]);return n?a?R.jsx("div",{style:{display:"flex",gap:"var(--sp-4)",padding:"var(--sp-5)",height:"100%",overflow:"auto"},children:l.map((o,c)=>R.jsxs("div",{"data-testid":`column-${o.key}`,style:{flex:1,background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",flexDirection:"column",minWidth:220,animation:`fadeInUp 0.4s var(--ease-out) ${c*80}ms both`},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)",paddingBottom:"var(--sp-3)",borderBottom:`2px solid ${o.color}`},children:[R.jsx("span",{style:{fontWeight:600,fontSize:"0.82rem",color:"var(--text-primary)"},children:o.label}),R.jsx("span",{"data-testid":`count-${o.key}`,style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,color:o.color,background:o.glow,width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",border:`1px solid ${o.color}`},children:o.agents.length})]}),R.jsx("div",{style:{flex:1,overflowY:"auto"},children:o.agents.map(h=>R.jsx(Y6,{agent:h},h.id))})]},o.key))}):R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[R.jsx("span",{style:{fontSize:"1.2rem",color:"var(--text-muted)"},children:"▦"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"No active state for this squad"})]}):R.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",height:"100%",gap:"var(--sp-3)",animation:"fadeIn 0.5s var(--ease-out) both"},children:[R.jsx("span",{style:{fontSize:"1.2rem",color:"var(--text-muted)"},children:"▦"}),R.jsx("span",{style:{color:"var(--text-muted)",fontSize:"0.85rem"},children:"Select a squad to view the kanban board"})]})}function X6(){const n=Ol(j=>j.user),[t,a]=Y.useState([]),[l,o]=Y.useState(!0),[c,h]=Y.useState(""),[m,p]=Y.useState(""),[y,x]=Y.useState("viewer"),[_,T]=Y.useState(null),[C,M]=Y.useState(null),w=Y.useCallback(async()=>{try{const j=await fetch("/api/users",{credentials:"include"});if(j.ok){const G=await j.json();a(G.users)}}catch{T("Failed to load users")}finally{o(!1)}},[]);Y.useEffect(()=>{w()},[w]);const z=async()=>{if(!(!c.trim()||!m.trim())){T(null);try{const j=await fetch("/api/auth/register",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({username:c,password:m,role:y}),credentials:"include"});if(!j.ok){const G=await j.json();T(G.error||"Failed to create user");return}h(""),p(""),x("viewer"),await w()}catch{T("Network error")}}},D=async(j,G)=>{try{(await fetch(`/api/users/${j}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({role:G}),credentials:"include"})).ok&&await w()}catch{T("Failed to update role")}},N=async j=>{try{(await fetch(`/api/users/${j}`,{method:"DELETE",credentials:"include"})).ok&&(M(null),await w())}catch{T("Failed to delete user")}};return l?R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading users..."}):R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"User Management"}),_&&R.jsx("div",{style:{background:"var(--status-error-glow)",border:"1px solid rgba(255, 64, 112, 0.2)",color:"var(--status-error)",padding:"var(--sp-2) var(--sp-3)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-3)",fontFamily:"var(--font-mono)",fontSize:"0.78rem"},children:_}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginBottom:"var(--sp-5)",flexWrap:"wrap",alignItems:"center"},children:[R.jsx("input",{className:"input",placeholder:"Username",value:c,onChange:j=>h(j.target.value),style:{flex:1,minWidth:120}}),R.jsx("input",{className:"input",placeholder:"Password",type:"password",value:m,onChange:j=>p(j.target.value),style:{flex:1,minWidth:120}}),R.jsxs("select",{className:"input",value:y,onChange:j=>x(j.target.value),style:{minWidth:100},children:[R.jsx("option",{value:"viewer",children:"viewer"}),R.jsx("option",{value:"operator",children:"operator"}),R.jsx("option",{value:"admin",children:"admin"})]}),R.jsx("button",{onClick:z,className:"btn btn-accent",children:"Create User"})]}),R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-default)"},children:["Username","Email","Role","Last Login","Actions"].map((j,G)=>R.jsx("th",{style:{textAlign:G===4?"right":"left",padding:"8px 12px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.08em"},children:j},j))})}),R.jsx("tbody",{children:t.map(j=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-primary)",fontSize:"0.82rem"},children:j.username}),R.jsx("td",{style:{padding:"10px 12px",color:"var(--text-secondary)",fontSize:"0.82rem"},children:j.email||"—"}),R.jsx("td",{style:{padding:"10px 12px"},children:j.id===(n==null?void 0:n.id)?R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-secondary)"},children:j.role}):R.jsxs("select",{className:"input",value:j.role,onChange:G=>D(j.id,G.target.value),style:{padding:"4px 8px",fontSize:"0.75rem"},children:[R.jsx("option",{value:"viewer",children:"viewer"}),R.jsx("option",{value:"operator",children:"operator"}),R.jsx("option",{value:"admin",children:"admin"})]})}),R.jsx("td",{style:{padding:"10px 12px",fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:j.last_login?new Date(j.last_login).toLocaleDateString():"—"}),R.jsx("td",{style:{padding:"10px 12px",textAlign:"right"},children:j.id!==(n==null?void 0:n.id)&&(C===j.id?R.jsxs("span",{style:{display:"inline-flex",gap:"var(--sp-2)",alignItems:"center"},children:[R.jsx("span",{style:{color:"var(--status-error)",fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:"Confirm?"}),R.jsx("button",{onClick:()=>N(j.id),className:"btn btn-sm btn-danger",children:"Yes"}),R.jsx("button",{onClick:()=>M(null),className:"btn btn-sm",children:"No"})]}):R.jsx("button",{onClick:()=>M(j.id),className:"btn btn-sm btn-danger",children:"Delete"}))})]},j.id))})]})]})}function V6(){const n=ei(p=>p.selectedSquad),t=ei(p=>p.activeStates),[a,l]=Y.useState(null),[o,c]=Y.useState(!1),h=n?t[n]:null;if(Y.useEffect(()=>{if(!n){l(null);return}c(!0),fetch(`/api/squads/${n}`,{credentials:"include"}).then(p=>p.ok?p.json():null).then(p=>{p&&l(p.data)}).finally(()=>c(!1))},[n]),!n)return R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontSize:"0.85rem"},children:"Select a squad to view details"});if(o)return R.jsx("div",{style:{color:"var(--text-muted)",padding:"var(--sp-5)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading squad details..."});const m={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"};return R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)",marginBottom:"var(--sp-4)"},children:"Squad Info"}),a&&R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:m,children:"Name"}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.9rem",fontWeight:600},children:a.name})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:m,children:"Description"}),R.jsx("div",{style:{color:"var(--text-primary)",fontSize:"0.85rem",lineHeight:1.5},children:a.description})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:m,children:"Agents"}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-2)",flexWrap:"wrap"},children:a.agents.map(p=>R.jsx("span",{style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"4px 10px",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--text-primary)"},children:p.name},p.id))})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:m,children:"Pipeline Steps"}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:a.pipeline.steps.map((p,y)=>R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"8px 12px",fontSize:"0.82rem"},children:[R.jsx("span",{style:{background:"var(--accent)",color:"var(--text-inverse)",width:22,height:22,borderRadius:"var(--radius-full)",display:"flex",alignItems:"center",justifyContent:"center",fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:700,flexShrink:0},children:y+1}),R.jsx("span",{style:{color:"var(--text-primary)"},children:p.label}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",color:"var(--text-muted)",fontSize:"0.68rem",marginLeft:"auto"},children:p.agent})]},p.id))})]})]}),h&&R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:m,children:"Current State"}),R.jsx("pre",{"data-testid":"state-json",style:{background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",padding:"var(--sp-4)",fontFamily:"var(--font-mono)",fontSize:"0.72rem",color:"var(--accent)",overflow:"auto",maxHeight:400,lineHeight:1.5},children:JSON.stringify(h,null,2)})]})]})}function k6(){const[n,t]=Y.useState(null),[a,l]=Y.useState(null),[o,c]=Y.useState(!0),[h,m]=Y.useState(null),p=Y.useCallback(async()=>{c(!0);try{const _=await fetch("/api/health",{credentials:"include"});if(_.ok){const T=await _.json();t(T),l(T.status==="ok")}else l(!1)}catch{l(!1)}finally{c(!1),m(new Date().toLocaleTimeString())}},[]);Y.useEffect(()=>{p()},[p]);const y={fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",fontWeight:600,marginBottom:"var(--sp-2)",textTransform:"uppercase",letterSpacing:"0.08em"},x={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"10px 12px",background:"var(--surface-3)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",marginBottom:"var(--sp-2)",fontSize:"0.82rem"};return R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:"var(--sp-4)"},children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:"Server Info"}),R.jsx("button",{onClick:p,className:"btn btn-sm",children:"Refresh"})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:y,children:"Health Status"}),R.jsxs("div",{style:x,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"API Server"}),o?R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",animation:"pulse 1.5s ease-in-out infinite"},children:"Checking..."}):R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"var(--sp-1)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",fontWeight:600,color:a?"var(--status-active)":"var(--status-error)"},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:a?"var(--status-active)":"var(--status-error)",display:"inline-block",boxShadow:a?"0 0 8px var(--status-active-glow)":"0 0 8px var(--status-error-glow)"}}),a?"Healthy":"Unhealthy"]})]})]}),R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("div",{style:y,children:"Environment"}),R.jsxs("div",{style:x,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"API Port"}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"3001"})]}),R.jsxs("div",{style:x,children:[R.jsx("span",{style:{color:"var(--text-primary)"},children:"Dashboard Port (dev)"}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)"},children:"5173"})]})]}),h&&R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textAlign:"right"},children:["Last checked: ",h]})]})}const Q6=[{key:"AWS_ACCESS_KEY_ID",label:"AWS Access Key ID",type:"password",hint:"Your AWS IAM access key"},{key:"AWS_SECRET_ACCESS_KEY",label:"AWS Secret Access Key",type:"password",hint:"Your AWS IAM secret key"},{key:"AWS_REGION",label:"AWS Region",type:"text",hint:"e.g. us-east-1, eu-west-1"},{key:"SES_FROM_EMAIL",label:"SES From Email",type:"text",hint:"Verified sender email in SES"},{key:"SES_RATE_LIMIT",label:"SES Rate Limit",type:"text",hint:"Max emails per second (default: 14)"},{key:"SERVER_URL",label:"Server URL",type:"text",hint:"Public URL for unsubscribe links"},{key:"PORT",label:"Port",type:"text",hint:"Server port (requires restart)"},{key:"CORS_ORIGIN",label:"CORS Origin",type:"text",hint:"Allowed origin for CORS"},{key:"NODE_ENV",label:"Node Environment",type:"text",hint:"development or production"}];function K6(){const[n,t]=Y.useState({}),[a,l]=Y.useState(!0),[o,c]=Y.useState(!1),[h,m]=Y.useState(null),[p,y]=Y.useState(new Set);Y.useEffect(()=>{fetch("/api/settings/env").then(T=>T.json()).then(T=>{t(T.settings||{}),l(!1)}).catch(()=>l(!1))},[]);const x=(T,C)=>{t(M=>({...M,[T]:C})),y(M=>new Set(M).add(T)),m(null)},_=async()=>{if(p.size===0)return;c(!0),m(null);const T={};for(const C of p)T[C]=n[C]||"";try{const C=await fetch("/api/settings/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(T)});if(C.ok){const M=await C.json();t(M.settings),y(new Set),m({type:"success",text:"Settings saved successfully"})}else{const M=await C.json();m({type:"error",text:M.error||"Failed to save"})}}catch{m({type:"error",text:"Network error"})}finally{c(!1)}};return a?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsxs("div",{style:{maxWidth:640},children:[R.jsx("div",{style:{marginBottom:"var(--sp-4)"},children:R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",lineHeight:1.6},children:"Server environment variables. Secret values are masked. Changes to PORT or NODE_ENV require a server restart."})}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:Q6.map(T=>R.jsxs("div",{children:[R.jsx("label",{style:{display:"block",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-secondary)",fontWeight:600,letterSpacing:"0.04em",marginBottom:4},children:T.label}),R.jsx("input",{type:T.type,value:n[T.key]||"",onChange:C=>x(T.key,C.target.value),placeholder:T.hint,style:{width:"100%",padding:"8px 12px",background:"var(--surface-2)",border:p.has(T.key)?"1px solid var(--accent)":"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.78rem",boxSizing:"border-box"}}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:T.hint})]},T.key))}),R.jsxs("div",{style:{marginTop:"var(--sp-4)",display:"flex",alignItems:"center",gap:"var(--sp-3)"},children:[R.jsx("button",{onClick:_,disabled:p.size===0||o,style:{padding:"8px 24px",background:p.size>0?"var(--accent)":"var(--surface-3)",border:"none",borderRadius:"var(--radius-sm)",color:p.size>0?"var(--text-inverse)":"var(--text-muted)",cursor:p.size>0?"pointer":"default",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,opacity:o?.6:1},children:o?"Saving...":`Save ${p.size>0?`(${p.size})`:""}`}),h&&R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:h.type==="success"?"var(--status-active)":"var(--status-error)"},children:h.text})]})]})}function Z6(){const n=Ol(h=>h.user),t=(n==null?void 0:n.role)==="admin",[a,l]=Y.useState(t?"users":"squad"),c=[{key:"users",label:"Users",icon:"◉",adminOnly:!0},{key:"squad",label:"Squad",icon:"⬡"},{key:"server",label:"Server",icon:"⚙"},{key:"env",label:"Environment",icon:"◆",adminOnly:!0}].filter(h=>!h.adminOnly||t);return R.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Settings"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Configuration and management"})]}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-5)",borderBottom:"1px solid var(--border-subtle)"},children:c.map(h=>R.jsxs("button",{onClick:()=>l(h.key),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"10px 16px",border:"none",borderBottom:a===h.key?"2px solid var(--accent)":"2px solid transparent",background:"transparent",color:a===h.key?"var(--text-primary)":"var(--text-muted)",fontFamily:"var(--font-display)",fontWeight:a===h.key?600:400,fontSize:"0.82rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:[R.jsx("span",{style:{fontSize:"0.75rem",opacity:.7},children:h.icon}),h.label]},h.key))}),R.jsxs("div",{style:{flex:1,overflow:"auto"},children:[a==="users"&&t&&R.jsx(X6,{}),a==="squad"&&R.jsx(V6,{}),a==="server"&&R.jsx(k6,{}),a==="env"&&t&&R.jsx(K6,{})]})]})}function F6(){const n=bs(p=>p.jobs),t=bs(p=>p.loading),a=bs(p=>p.fetchJobs),l=bs(p=>p.pauseJob),o=bs(p=>p.resumeJob),c=bs(p=>p.triggerJob);Y.useEffect(()=>{a()},[a]);const h=p=>p==="active"?"var(--status-active)":p==="paused"?"var(--status-warning)":"var(--status-error)",m=p=>p==="active"?"var(--status-active-glow)":p==="paused"?"var(--status-warning-glow)":"var(--status-error-glow)";return R.jsxs("div",{style:{padding:"var(--sp-6)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-5)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Scheduler"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Autonomous job execution and monitoring"})]}),t&&R.jsx("p",{style:{color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.8rem",animation:"pulse 1.5s ease-in-out infinite"},children:"Loading jobs..."}),!t&&n.length===0&&R.jsxs("div",{style:{padding:"var(--sp-8)",textAlign:"center",color:"var(--text-muted)"},children:[R.jsx("div",{style:{fontSize:"1.5rem",marginBottom:"var(--sp-3)"},children:"⏣"}),R.jsx("p",{style:{fontSize:"0.85rem",marginBottom:"var(--sp-2)"},children:"No scheduled jobs"}),R.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:["Add ",R.jsx("code",{style:{background:"var(--surface-3)",padding:"2px 6px",borderRadius:"var(--radius-xs)"},children:"schedule.enabled: true"})," to a squad.yaml to get started."]})]}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-3)"},children:n.map((p,y)=>R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"border-color var(--duration-fast) var(--ease-out)",animation:`fadeInUp 0.4s var(--ease-out) ${y*60}ms both`},children:[R.jsxs("div",{style:{flex:1,minWidth:0},children:[R.jsx("div",{style:{fontWeight:600,fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:p.squad_name}),R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-secondary)",display:"flex",alignItems:"center",gap:"var(--sp-3)",flexWrap:"wrap"},children:[R.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:4,color:h(p.status)},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:h(p.status),boxShadow:`0 0 8px ${m(p.status)}`,display:"inline-block",animation:p.status==="active"?"statusPulse 2s ease-in-out infinite":"none"}}),p.status]}),R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("code",{style:{background:"var(--surface-3)",padding:"1px 5px",borderRadius:"var(--radius-xs)",fontSize:"0.65rem"},children:p.cron_expression}),p.last_run_at&&R.jsxs(R.Fragment,{children:[R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsxs("span",{children:["Last: ",new Date(p.last_run_at).toLocaleString()]})]}),p.last_result&&R.jsxs(R.Fragment,{children:[R.jsx("span",{style:{color:"var(--border-strong)"},children:"│"}),R.jsx("span",{children:p.last_result})]})]})]}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)",marginLeft:"var(--sp-3)"},children:[p.status==="active"?R.jsx("button",{onClick:()=>l(p.squad_name),className:"btn btn-sm",children:"Pause"}):R.jsx("button",{onClick:()=>o(p.squad_name),className:"btn btn-sm",children:"Resume"}),R.jsx("button",{onClick:()=>c(p.squad_name),className:"btn btn-sm btn-accent",children:"Trigger"})]})]},p.squad_name))})]})}const wl=Eo(n=>({leads:[],campaigns:[],lists:[],tags:[],total:0,loading:!1,fetchLeads:async(t={})=>{n({loading:!0});try{const a=new URLSearchParams(t),l=await fetch(`/api/email/leads?${a}`);if(l.ok){const o=await l.json();n({leads:o.data,total:o.total})}}finally{n({loading:!1})}},fetchCampaigns:async(t={})=>{n({loading:!0});try{const a=new URLSearchParams(t),l=await fetch(`/api/email/campaigns?${a}`);if(l.ok){const o=await l.json();n({campaigns:o.data})}}finally{n({loading:!1})}},fetchLists:async()=>{const t=await fetch("/api/email/leads/lists");if(t.ok){const a=await t.json();n({lists:a.lists})}},fetchTags:async()=>{const t=await fetch("/api/email/leads/tags");if(t.ok){const a=await t.json();n({tags:a.tags})}}}));function W6(){const n=wl(_=>_.leads),t=wl(_=>_.total),a=wl(_=>_.lists),l=wl(_=>_.tags),o=wl(_=>_.loading),c=wl(_=>_.fetchLeads),h=wl(_=>_.fetchLists),m=wl(_=>_.fetchTags),[p,y]=Y.useState("");Y.useEffect(()=>{c(),h(),m()},[c,h,m]);const x=()=>{c(p?{search:p}:{})};return R.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:[R.jsxs("div",{style:{display:"flex",gap:"var(--sp-3)"},children:[R.jsx(M0,{label:"Total Leads",value:t}),R.jsx(M0,{label:"Lists",value:a.length}),R.jsx(M0,{label:"Tags",value:l.length})]}),R.jsxs("div",{style:{display:"flex",gap:"var(--sp-2)"},children:[R.jsx("input",{type:"text",placeholder:"Search leads...",value:p,onChange:_=>y(_.target.value),onKeyDown:_=>_.key==="Enter"&&x(),style:{flex:1,padding:"8px 12px",background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",color:"var(--text-primary)",fontFamily:"var(--font-body)",fontSize:"0.82rem"}}),R.jsx("button",{onClick:x,className:"btn-ghost",style:{padding:"8px 16px",background:"var(--accent-glow)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:"var(--radius-sm)",color:"var(--accent)",cursor:"pointer",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Search"})]}),o?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Email","Name","Company","Status","Source","Created"].map(_=>R.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:_},_))})}),R.jsxs("tbody",{children:[n.map(_=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:Ga,children:_.email}),R.jsx("td",{style:Ga,children:_.name||"—"}),R.jsx("td",{style:Ga,children:_.company||"—"}),R.jsx("td",{style:Ga,children:R.jsx(FS,{status:_.status})}),R.jsx("td",{style:Ga,children:_.source||"—"}),R.jsx("td",{style:{...Ga,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(_.created_at).toLocaleDateString()})]},_.id)),n.length===0&&R.jsx("tr",{children:R.jsx("td",{colSpan:6,style:{...Ga,textAlign:"center",color:"var(--text-muted)"},children:"No leads found"})})]})]})})]})}function J6(){const n=wl(l=>l.campaigns),t=wl(l=>l.loading),a=wl(l=>l.fetchCampaigns);return Y.useEffect(()=>{a()},[a]),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-4)"},children:t?R.jsx("div",{style:{textAlign:"center",padding:"var(--sp-6)",color:"var(--text-muted)",fontFamily:"var(--font-mono)",fontSize:"0.75rem"},children:"Loading..."}):R.jsx("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",overflow:"hidden"},children:R.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[R.jsx("thead",{children:R.jsx("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:["Name","Subject","Status","Recipients","Sent","Bounced","Created"].map(l=>R.jsx("th",{style:{textAlign:"left",padding:"10px 14px",fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",fontWeight:600},children:l},l))})}),R.jsxs("tbody",{children:[n.map(l=>R.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)"},children:[R.jsx("td",{style:Ga,children:l.name}),R.jsx("td",{style:Ga,children:l.subject}),R.jsx("td",{style:Ga,children:R.jsx(FS,{status:l.status})}),R.jsx("td",{style:{...Ga,fontFamily:"var(--font-mono)"},children:l.total_recipients}),R.jsx("td",{style:{...Ga,fontFamily:"var(--font-mono)"},children:l.sent_count}),R.jsx("td",{style:{...Ga,fontFamily:"var(--font-mono)"},children:l.bounce_count}),R.jsx("td",{style:{...Ga,fontFamily:"var(--font-mono)",fontSize:"0.7rem"},children:new Date(l.created_at).toLocaleDateString()})]},l.id)),n.length===0&&R.jsx("tr",{children:R.jsx("td",{colSpan:7,style:{...Ga,textAlign:"center",color:"var(--text-muted)"},children:"No campaigns yet"})})]})]})})})}function P6(){return R.jsxs("div",{style:{background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-4)"},children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontSize:"0.9rem",color:"var(--text-primary)",marginBottom:"var(--sp-3)"},children:"Amazon SES Configuration"}),R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-secondary)",lineHeight:1.8},children:[R.jsx("p",{children:"Configure these environment variables on the server:"}),R.jsxs("div",{style:{background:"var(--surface-2)",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",padding:"var(--sp-3)",marginTop:"var(--sp-2)"},children:[R.jsx("code",{children:"AWS_ACCESS_KEY_ID=..."}),R.jsx("br",{}),R.jsx("code",{children:"AWS_SECRET_ACCESS_KEY=..."}),R.jsx("br",{}),R.jsx("code",{children:"AWS_REGION=us-east-1"}),R.jsx("br",{}),R.jsx("code",{children:"SES_FROM_EMAIL=noreply@yourdomain.com"}),R.jsx("br",{}),R.jsx("code",{children:"SES_RATE_LIMIT=14"}),R.jsx("br",{}),R.jsx("code",{children:"SERVER_URL=https://yourdomain.com"})]})]})]})}function M0({label:n,value:t}){return R.jsxs("div",{style:{flex:1,background:"var(--surface-1)",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-md)",padding:"var(--sp-3)"},children:[R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.08em",marginBottom:"var(--sp-1)"},children:n}),R.jsx("div",{style:{fontFamily:"var(--font-display)",fontSize:"1.4rem",fontWeight:700,color:"var(--accent)"},children:t})]})}function FS({status:n}){const a={active:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},unsubscribed:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"},draft:{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"},queued:{bg:"rgba(0, 200, 255, 0.1)",text:"var(--accent)"},sending:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},sent:{bg:"rgba(0, 230, 138, 0.1)",text:"var(--status-active)"},paused:{bg:"rgba(255, 180, 0, 0.1)",text:"var(--status-warning)"},cancelled:{bg:"rgba(255, 100, 100, 0.1)",text:"var(--status-error)"}}[n]||{bg:"rgba(150, 150, 150, 0.1)",text:"var(--text-muted)"};return R.jsx("span",{style:{display:"inline-block",padding:"2px 8px",borderRadius:"var(--radius-xs)",background:a.bg,color:a.text,fontFamily:"var(--font-mono)",fontSize:"0.65rem",fontWeight:600,textTransform:"uppercase",letterSpacing:"0.05em"},children:n})}const Ga={padding:"10px 14px",fontSize:"0.82rem",color:"var(--text-secondary)"};function I6(){const[n,t]=Y.useState("leads"),a=[{key:"leads",label:"Leads"},{key:"campaigns",label:"Campaigns"},{key:"settings",label:"Settings"}];return R.jsxs("div",{style:{padding:"var(--sp-4)",maxWidth:1100,margin:"0 auto"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontSize:"1.1rem",fontWeight:700,color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:"Email Engine"}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:"Lead management, campaigns, and Amazon SES integration"})]}),R.jsx("div",{style:{display:"flex",gap:"var(--sp-1)",marginBottom:"var(--sp-4)",borderBottom:"1px solid var(--border-subtle)",paddingBottom:"var(--sp-1)"},children:a.map(l=>R.jsx("button",{onClick:()=>t(l.key),style:{padding:"8px 16px",background:n===l.key?"var(--accent-glow)":"transparent",border:n===l.key?"1px solid rgba(0, 200, 255, 0.15)":"1px solid transparent",borderRadius:"var(--radius-sm)",color:n===l.key?"var(--accent)":"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:n===l.key?600:400,transition:"all var(--duration-fast) var(--ease-out)"},children:l.label},l.key))}),n==="leads"&&R.jsx(W6,{}),n==="campaigns"&&R.jsx(J6,{}),n==="settings"&&R.jsx(P6,{})]})}function $6({node:n,expanded:t,onToggle:a,onSelectAgent:l}){var o;return R.jsxs("div",{style:{marginBottom:"var(--sp-2)"},children:[R.jsxs("button",{onClick:a,style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",width:"100%",padding:"10px 14px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:t?"var(--surface-3)":"var(--surface-2)",color:"var(--text-primary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.82rem",fontWeight:600,transition:"all var(--duration-fast) var(--ease-out)",textAlign:"left"},children:[R.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:22,height:22,borderRadius:"var(--radius-xs)",background:"linear-gradient(135deg, var(--accent-dim), var(--accent))",fontSize:"0.6rem",color:"var(--text-inverse)",fontWeight:700,flexShrink:0},children:n.name.slice(0,2).toUpperCase()}),R.jsx("span",{style:{flex:1},children:n.name}),R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",background:"var(--surface-4)",padding:"2px 6px",borderRadius:"var(--radius-xs)"},children:n.agentCount??((o=n.children)==null?void 0:o.length)??0}),R.jsx("span",{style:{fontSize:"0.7rem",color:"var(--text-muted)",transform:t?"rotate(90deg)":"rotate(0deg)",transition:"transform var(--duration-fast) var(--ease-out)"},children:"▸"})]}),t&&n.children&&R.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(200px, 1fr))",gap:"var(--sp-2)",padding:"var(--sp-2) 0 0 28px",borderLeft:"1px solid var(--border-subtle)",marginLeft:11},children:n.children.map(c=>R.jsxs("button",{onClick:()=>l(c),style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",padding:"8px 10px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--surface-2)",color:"var(--text-secondary)",cursor:"pointer",fontFamily:"var(--font-display)",fontSize:"0.75rem",textAlign:"left",transition:"all var(--duration-fast) var(--ease-out)"},onMouseEnter:h=>{h.currentTarget.style.borderColor="var(--accent-dim)",h.currentTarget.style.color="var(--text-primary)"},onMouseLeave:h=>{h.currentTarget.style.borderColor="var(--border-subtle)",h.currentTarget.style.color="var(--text-secondary)"},children:[R.jsx("span",{style:{width:6,height:6,borderRadius:"50%",background:c.squads&&c.squads.length>0?"var(--status-active)":"var(--status-idle)",boxShadow:c.squads&&c.squads.length>0?"0 0 6px var(--status-active-glow)":"none",flexShrink:0}}),R.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:c.name}),c.squads&&c.squads.length>0&&R.jsx("span",{style:{marginLeft:"auto",fontFamily:"var(--font-mono)",fontSize:"0.55rem",color:"var(--accent)",background:"var(--accent-glow)",padding:"1px 4px",borderRadius:"var(--radius-xs)",flexShrink:0},children:c.squads.length})]},c.id))})]})}function tM({agent:n,squads:t,onClose:a}){const l=t.filter(o=>o.agents.some(c=>c.id===n.id));return R.jsxs("div",{style:{border:"1px solid var(--border-default)",borderRadius:"var(--radius-md)",background:"var(--surface-2)",padding:"var(--sp-5)",animation:"fadeIn 0.3s var(--ease-out) both"},children:[R.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",marginBottom:"var(--sp-4)"},children:[R.jsxs("div",{children:[R.jsx("h3",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:n.name}),R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:n.id})]}),R.jsx("button",{onClick:a,style:{background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",fontSize:"1rem",padding:"4px"},children:"x"})]}),l.length>0?R.jsxs(R.Fragment,{children:[R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"var(--sp-2)"},children:["Assigned to ",l.length," squad",l.length!==1?"s":""]}),R.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"var(--sp-2)"},children:l.map(o=>R.jsxs("div",{style:{padding:"10px 12px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--surface-3)"},children:[R.jsx("div",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.8rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:o.name}),R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)"},children:o.description||o.code}),R.jsx("div",{style:{marginTop:"var(--sp-2)",display:"flex",flexWrap:"wrap",gap:"var(--sp-1)"},children:o.agents.map(c=>R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",padding:"2px 6px",borderRadius:"var(--radius-xs)",background:c.id===n.id?"var(--accent-glow)":"var(--surface-4)",color:c.id===n.id?"var(--accent)":"var(--text-muted)",border:c.id===n.id?"1px solid rgba(0, 200, 255, 0.2)":"1px solid transparent"},children:c.name},c.id))})]},o.code))})]}):R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)",padding:"var(--sp-4)",textAlign:"center",border:"1px dashed var(--border-subtle)",borderRadius:"var(--radius-sm)"},children:"Not assigned to any squad"})]})}function eM({squad:n}){return R.jsxs("div",{style:{padding:"12px 14px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--surface-2)",transition:"border-color var(--duration-fast) var(--ease-out)"},children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-2)",marginBottom:"var(--sp-2)"},children:[R.jsx("span",{style:{display:"inline-flex",alignItems:"center",justifyContent:"center",width:20,height:20,borderRadius:"var(--radius-xs)",background:"var(--status-active-glow)",border:"1px solid rgba(0, 230, 138, 0.15)",fontSize:"0.6rem",color:"var(--status-active)",fontWeight:700},children:n.name.slice(0,1).toUpperCase()}),R.jsx("span",{style:{fontFamily:"var(--font-display)",fontWeight:600,fontSize:"0.8rem",color:"var(--text-primary)"},children:n.name})]}),n.description&&R.jsx("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.65rem",color:"var(--text-muted)",marginBottom:"var(--sp-2)",lineHeight:1.4},children:n.description}),R.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:"var(--sp-1)"},children:n.agents.map(t=>R.jsx("span",{style:{fontFamily:"var(--font-mono)",fontSize:"0.55rem",padding:"2px 5px",borderRadius:"var(--radius-xs)",background:"var(--surface-4)",color:"var(--text-muted)"},children:t.name},t.id))})]})}function nM(){const[n,t]=Y.useState(null),[a,l]=Y.useState(!0),[o,c]=Y.useState(null),[h,m]=Y.useState(new Set),[p,y]=Y.useState(null),[x,_]=Y.useState("");Y.useEffect(()=>{fetch("/api/orgchart",{credentials:"include"}).then(G=>{if(!G.ok)throw new Error(`HTTP ${G.status}`);return G.json()}).then(G=>{t(G),l(!1)}).catch(G=>{c(G.message),l(!1)})},[]);const T=Y.useCallback(G=>{m(k=>{const q=new Set(k);return q.has(G)?q.delete(G):q.add(G),q})},[]),C=Y.useCallback(()=>{if(!n)return;const G=new Set((n.tree.children||[]).map(k=>k.id));m(G)},[n]),M=Y.useCallback(()=>{m(new Set)},[]);if(a)return R.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)"},children:"Loading org chart..."});if(o||!n)return R.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--status-error)"},children:o||"Failed to load org chart"});const{tree:w,squads:z}=n,D=w.children||[],N=x.trim()?D.map(G=>{var k;return{...G,children:(k=G.children)==null?void 0:k.filter(q=>q.name.toLowerCase().includes(x.toLowerCase())||q.id.toLowerCase().includes(x.toLowerCase())||(q.squads||[]).some(Z=>Z.toLowerCase().includes(x.toLowerCase())))}}).filter(G=>G.name.toLowerCase().includes(x.toLowerCase())||G.children&&G.children.length>0):D,j=D.reduce((G,k)=>{var q;return G+(k.agentCount??((q=k.children)==null?void 0:q.length)??0)},0);return R.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",padding:"var(--sp-5)",animation:"fadeIn 0.4s var(--ease-out) both"},children:[R.jsxs("div",{style:{marginBottom:"var(--sp-4)"},children:[R.jsx("h2",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"1.1rem",color:"var(--text-primary)",marginBottom:"var(--sp-1)"},children:w.name}),R.jsxs("p",{style:{fontFamily:"var(--font-mono)",fontSize:"0.7rem",color:"var(--text-muted)"},children:[D.length," sectors / ",j," agents / ",z.length," squads"]})]}),R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",marginBottom:"var(--sp-4)"},children:[R.jsx("input",{type:"text",placeholder:"Search agents, sectors, squads...",value:x,onChange:G=>_(G.target.value),style:{flex:1,maxWidth:360,padding:"8px 12px",border:"1px solid var(--border-default)",borderRadius:"var(--radius-sm)",background:"var(--surface-2)",color:"var(--text-primary)",fontFamily:"var(--font-mono)",fontSize:"0.75rem",outline:"none",transition:"border-color var(--duration-fast) var(--ease-out)"},onFocus:G=>G.currentTarget.style.borderColor="var(--accent-dim)",onBlur:G=>G.currentTarget.style.borderColor="var(--border-default)"}),R.jsx("button",{onClick:C,style:{padding:"7px 12px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:"Expand All"}),R.jsx("button",{onClick:M,style:{padding:"7px 12px",border:"1px solid var(--border-subtle)",borderRadius:"var(--radius-sm)",background:"var(--surface-2)",color:"var(--text-secondary)",fontFamily:"var(--font-mono)",fontSize:"0.7rem",cursor:"pointer",transition:"all var(--duration-fast) var(--ease-out)"},children:"Collapse All"})]}),R.jsxs("div",{style:{flex:1,overflow:"auto",display:"grid",gridTemplateColumns:p?"1fr 340px":"1fr",gap:"var(--sp-5)",alignContent:"start"},children:[R.jsxs("div",{children:[R.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"var(--sp-3)",padding:"12px 16px",marginBottom:"var(--sp-3)",border:"1px solid var(--border-glow)",borderRadius:"var(--radius-md)",background:"linear-gradient(135deg, var(--surface-3), var(--surface-2))",boxShadow:"var(--shadow-glow)"},children:[R.jsx("div",{style:{width:32,height:32,borderRadius:"var(--radius-sm)",background:"linear-gradient(135deg, var(--accent), var(--accent-dim))",display:"flex",alignItems:"center",justifyContent:"center",fontSize:"0.85rem",fontWeight:700,color:"var(--text-inverse)",boxShadow:"0 0 12px var(--accent-glow-strong)"},children:w.name.slice(0,2).toUpperCase()}),R.jsxs("div",{children:[R.jsx("div",{style:{fontFamily:"var(--font-display)",fontWeight:700,fontSize:"0.95rem",color:"var(--text-primary)"},children:w.name}),R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)"},children:"CEO"})]})]}),R.jsx("div",{style:{paddingLeft:16},children:N.length===0?R.jsx("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.75rem",color:"var(--text-muted)",padding:"var(--sp-4)",textAlign:"center"},children:"No results found"}):N.map(G=>R.jsx($6,{node:G,expanded:h.has(G.id)||x.trim().length>0,onToggle:()=>T(G.id),onSelectAgent:y},G.id))}),z.length>0&&R.jsxs("div",{style:{marginTop:"var(--sp-6)",paddingLeft:16},children:[R.jsxs("div",{style:{fontFamily:"var(--font-mono)",fontSize:"0.6rem",color:"var(--text-muted)",textTransform:"uppercase",letterSpacing:"0.1em",marginBottom:"var(--sp-3)",paddingBottom:"var(--sp-2)",borderBottom:"1px solid var(--border-subtle)"},children:["Active Squads (",z.length,")"]}),R.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(260px, 1fr))",gap:"var(--sp-2)"},children:z.map(G=>R.jsx(eM,{squad:G},G.code))})]})]}),p&&R.jsx(tM,{agent:p,squads:z,onClose:()=>y(null)})]})]})}const aM=Y.lazy(()=>tf(()=>import("./JarvisView-BxEaO5CE.js"),[]).then(n=>({default:n.JarvisView})));J2.createRoot(document.getElementById("root")).render(R.jsx(Y.StrictMode,{children:R.jsx(bT,{children:R.jsxs(J_,{children:[R.jsx(Ji,{path:"/login",element:R.jsx(o3,{})}),R.jsxs(Ji,{path:"/",element:R.jsx(u3,{}),children:[R.jsx(Ji,{index:!0,element:R.jsx(F_,{to:"/office",replace:!0})}),R.jsx(Ji,{path:"office",element:R.jsx(j6,{})}),R.jsx(Ji,{path:"chat",element:R.jsx(H6,{})}),R.jsx(Ji,{path:"kanban",element:R.jsx(L6,{})}),R.jsx(Ji,{path:"settings",element:R.jsx(Z6,{})}),R.jsx(Ji,{path:"scheduler",element:R.jsx(F6,{})}),R.jsx(Ji,{path:"email",element:R.jsx(I6,{})}),R.jsx(Ji,{path:"orgchart",element:R.jsx(nM,{})}),R.jsx(Ji,{path:"jarvis",element:R.jsx(Y.Suspense,{fallback:null,children:R.jsx(aM,{})})})]})]})})}));export{Kp as $,aS as A,gd as B,zn as C,Ti as D,_s as E,hr as F,ai as G,yg as H,Td as I,l3 as J,D1 as K,Rp as L,le as M,mg as N,tS as O,ya as P,el as Q,q0 as R,bC as S,ze as T,Op as U,Zb as V,I0 as W,FC as X,JC as Y,a4 as Z,t4 as _,iM as a,Co as a0,M3 as a1,_d as a2,pg as a3,s4 as a4,ii as a5,Sb as a6,tl as a7,kp as a8,m1 as a9,rf as aa,qA as ab,iE as ac,y1 as ad,t0 as ae,g1 as af,sE as ag,lf as ah,mn as ai,Eb as aj,oA as ak,iS as al,de as am,Sd as an,un as ao,oC as ap,iC as aq,wC as ar,TC as as,WC as at,PC as au,i4 as av,n4 as aw,l4 as ax,Ol as b,ei as c,qE as d,ni as e,on as f,zE as g,je as h,Mp as i,R as j,Jt as k,_4 as l,Tb as m,Zp as n,d4 as o,Fp as p,Nb as q,Y as r,VT as s,Ie as t,ky as u,Pc as v,qa as w,L3 as x,$n as y,gC as z};