sage-team 3.3.3 → 3.4.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.
@@ -0,0 +1,298 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/browserAll-XFxdM5KU.js","assets/webworkerAll-DU2TvyX8.js","assets/Filter-DOuiTHq_.js","assets/WebGPURenderer-BuJedD5Q.js","assets/BufferResource-Bct1-zq7.js","assets/RenderTargetSystem-BFGmN4oB.js","assets/WebGLRenderer-Bnd2tXK6.js","assets/CanvasRenderer-CKwE0kc4.js"])))=>i.map(i=>d[i]);
2
+ var y1=Object.defineProperty;var g1=(l,t,n)=>t in l?y1(l,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):l[t]=n;var Kt=(l,t,n)=>g1(l,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const c of o.addedNodes)c.tagName==="LINK"&&c.rel==="modulepreload"&&a(c)}).observe(document,{childList:!0,subtree:!0});function n(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function a(u){if(u.ep)return;u.ep=!0;const o=n(u);fetch(u.href,o)}})();function Ch(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var Cc={exports:{}},qa={};/**
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 Vp;function x1(){if(Vp)return qa;Vp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(a,u,o){var c=null;if(o!==void 0&&(c=""+o),u.key!==void 0&&(c=""+u.key),"key"in u){o={};for(var f in u)f!=="key"&&(o[f]=u[f])}else o=u;return u=o.ref,{$$typeof:l,type:a,key:c,ref:u!==void 0?u:null,props:o}}return qa.Fragment=t,qa.jsx=n,qa.jsxs=n,qa}var Pp;function _1(){return Pp||(Pp=1,Cc.exports=x1()),Cc.exports}var J=_1(),Mc={exports:{}},dt={};/**
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 Fp;function b1(){if(Fp)return dt;Fp=1;var l=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),c=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),x=Symbol.for("react.activity"),b=Symbol.iterator;function _(M){return M===null||typeof M!="object"?null:(M=b&&M[b]||M["@@iterator"],typeof M=="function"?M:null)}var T={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,S={};function A(M,Y,Q){this.props=M,this.context=Y,this.refs=S,this.updater=Q||T}A.prototype.isReactComponent={},A.prototype.setState=function(M,Y){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,Y,"setState")},A.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function z(){}z.prototype=A.prototype;function D(M,Y,Q){this.props=M,this.context=Y,this.refs=S,this.updater=Q||T}var G=D.prototype=new z;G.constructor=D,w(G,A.prototype),G.isPureReactComponent=!0;var P=Array.isArray;function N(){}var O={H:null,A:null,T:null,S:null},et=Object.prototype.hasOwnProperty;function Z(M,Y,Q){var $=Q.ref;return{$$typeof:l,type:M,key:Y,ref:$!==void 0?$:null,props:Q}}function X(M,Y){return Z(M.type,Y,M.props)}function W(M){return typeof M=="object"&&M!==null&&M.$$typeof===l}function I(M){var Y={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Q){return Y[Q]})}var tt=/\/+/g;function it(M,Y){return typeof M=="object"&&M!==null&&M.key!=null?I(""+M.key):Y.toString(36)}function St(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(N,N):(M.status="pending",M.then(function(Y){M.status==="pending"&&(M.status="fulfilled",M.value=Y)},function(Y){M.status==="pending"&&(M.status="rejected",M.reason=Y)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function R(M,Y,Q,$,rt){var ct=typeof M;(ct==="undefined"||ct==="boolean")&&(M=null);var ft=!1;if(M===null)ft=!0;else switch(ct){case"bigint":case"string":case"number":ft=!0;break;case"object":switch(M.$$typeof){case l:case t:ft=!0;break;case y:return ft=M._init,R(ft(M._payload),Y,Q,$,rt)}}if(ft)return rt=rt(M),ft=$===""?"."+it(M,0):$,P(rt)?(Q="",ft!=null&&(Q=ft.replace(tt,"$&/")+"/"),R(rt,Y,Q,"",function(Ve){return Ve})):rt!=null&&(W(rt)&&(rt=X(rt,Q+(rt.key==null||M&&M.key===rt.key?"":(""+rt.key).replace(tt,"$&/")+"/")+ft)),Y.push(rt)),1;ft=0;var Ht=$===""?".":$+":";if(P(M))for(var Et=0;Et<M.length;Et++)$=M[Et],ct=Ht+it($,Et),ft+=R($,Y,Q,ct,rt);else if(Et=_(M),typeof Et=="function")for(M=Et.call(M),Et=0;!($=M.next()).done;)$=$.value,ct=Ht+it($,Et++),ft+=R($,Y,Q,ct,rt);else if(ct==="object"){if(typeof M.then=="function")return R(St(M),Y,Q,$,rt);throw Y=String(M),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return ft}function L(M,Y,Q){if(M==null)return M;var $=[],rt=0;return R(M,$,"","",function(ct){return Y.call(Q,ct,rt++)}),$}function nt(M){if(M._status===-1){var Y=M._result;Y=Y(),Y.then(function(Q){(M._status===0||M._status===-1)&&(M._status=1,M._result=Q)},function(Q){(M._status===0||M._status===-1)&&(M._status=2,M._result=Q)}),M._status===-1&&(M._status=0,M._result=Y)}if(M._status===1)return M._result.default;throw M._result}var K=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},at={map:L,forEach:function(M,Y,Q){L(M,function(){Y.apply(this,arguments)},Q)},count:function(M){var Y=0;return L(M,function(){Y++}),Y},toArray:function(M){return L(M,function(Y){return Y})||[]},only:function(M){if(!W(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return dt.Activity=x,dt.Children=at,dt.Component=A,dt.Fragment=n,dt.Profiler=u,dt.PureComponent=D,dt.StrictMode=a,dt.Suspense=m,dt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=O,dt.__COMPILER_RUNTIME={__proto__:null,c:function(M){return O.H.useMemoCache(M)}},dt.cache=function(M){return function(){return M.apply(null,arguments)}},dt.cacheSignal=function(){return null},dt.cloneElement=function(M,Y,Q){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var $=w({},M.props),rt=M.key;if(Y!=null)for(ct in Y.key!==void 0&&(rt=""+Y.key),Y)!et.call(Y,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&Y.ref===void 0||($[ct]=Y[ct]);var ct=arguments.length-2;if(ct===1)$.children=Q;else if(1<ct){for(var ft=Array(ct),Ht=0;Ht<ct;Ht++)ft[Ht]=arguments[Ht+2];$.children=ft}return Z(M.type,rt,$)},dt.createContext=function(M){return M={$$typeof:c,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:o,_context:M},M},dt.createElement=function(M,Y,Q){var $,rt={},ct=null;if(Y!=null)for($ in Y.key!==void 0&&(ct=""+Y.key),Y)et.call(Y,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(rt[$]=Y[$]);var ft=arguments.length-2;if(ft===1)rt.children=Q;else if(1<ft){for(var Ht=Array(ft),Et=0;Et<ft;Et++)Ht[Et]=arguments[Et+2];rt.children=Ht}if(M&&M.defaultProps)for($ in ft=M.defaultProps,ft)rt[$]===void 0&&(rt[$]=ft[$]);return Z(M,ct,rt)},dt.createRef=function(){return{current:null}},dt.forwardRef=function(M){return{$$typeof:f,render:M}},dt.isValidElement=W,dt.lazy=function(M){return{$$typeof:y,_payload:{_status:-1,_result:M},_init:nt}},dt.memo=function(M,Y){return{$$typeof:p,type:M,compare:Y===void 0?null:Y}},dt.startTransition=function(M){var Y=O.T,Q={};O.T=Q;try{var $=M(),rt=O.S;rt!==null&&rt(Q,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(N,K)}catch(ct){K(ct)}finally{Y!==null&&Q.types!==null&&(Y.types=Q.types),O.T=Y}},dt.unstable_useCacheRefresh=function(){return O.H.useCacheRefresh()},dt.use=function(M){return O.H.use(M)},dt.useActionState=function(M,Y,Q){return O.H.useActionState(M,Y,Q)},dt.useCallback=function(M,Y){return O.H.useCallback(M,Y)},dt.useContext=function(M){return O.H.useContext(M)},dt.useDebugValue=function(){},dt.useDeferredValue=function(M,Y){return O.H.useDeferredValue(M,Y)},dt.useEffect=function(M,Y){return O.H.useEffect(M,Y)},dt.useEffectEvent=function(M){return O.H.useEffectEvent(M)},dt.useId=function(){return O.H.useId()},dt.useImperativeHandle=function(M,Y,Q){return O.H.useImperativeHandle(M,Y,Q)},dt.useInsertionEffect=function(M,Y){return O.H.useInsertionEffect(M,Y)},dt.useLayoutEffect=function(M,Y){return O.H.useLayoutEffect(M,Y)},dt.useMemo=function(M,Y){return O.H.useMemo(M,Y)},dt.useOptimistic=function(M,Y){return O.H.useOptimistic(M,Y)},dt.useReducer=function(M,Y,Q){return O.H.useReducer(M,Y,Q)},dt.useRef=function(M){return O.H.useRef(M)},dt.useState=function(M){return O.H.useState(M)},dt.useSyncExternalStore=function(M,Y,Q){return O.H.useSyncExternalStore(M,Y,Q)},dt.useTransition=function(){return O.H.useTransition()},dt.version="19.2.4",dt}var Qp;function Mh(){return Qp||(Qp=1,Mc.exports=b1()),Mc.exports}var ni=Mh();const Ur=Ch(ni);var Ec={exports:{}},Xa={},Rc={exports:{}},zc={};/**
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 Wp;function v1(){return Wp||(Wp=1,(function(l){function t(R,L){var nt=R.length;R.push(L);t:for(;0<nt;){var K=nt-1>>>1,at=R[K];if(0<u(at,L))R[K]=L,R[nt]=at,nt=K;else break t}}function n(R){return R.length===0?null:R[0]}function a(R){if(R.length===0)return null;var L=R[0],nt=R.pop();if(nt!==L){R[0]=nt;t:for(var K=0,at=R.length,M=at>>>1;K<M;){var Y=2*(K+1)-1,Q=R[Y],$=Y+1,rt=R[$];if(0>u(Q,nt))$<at&&0>u(rt,Q)?(R[K]=rt,R[$]=nt,K=$):(R[K]=Q,R[Y]=nt,K=Y);else if($<at&&0>u(rt,nt))R[K]=rt,R[$]=nt,K=$;else break t}}return L}function u(R,L){var nt=R.sortIndex-L.sortIndex;return nt!==0?nt:R.id-L.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;l.unstable_now=function(){return o.now()}}else{var c=Date,f=c.now();l.unstable_now=function(){return c.now()-f}}var m=[],p=[],y=1,x=null,b=3,_=!1,T=!1,w=!1,S=!1,A=typeof setTimeout=="function"?setTimeout:null,z=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function G(R){for(var L=n(p);L!==null;){if(L.callback===null)a(p);else if(L.startTime<=R)a(p),L.sortIndex=L.expirationTime,t(m,L);else break;L=n(p)}}function P(R){if(w=!1,G(R),!T)if(n(m)!==null)T=!0,N||(N=!0,I());else{var L=n(p);L!==null&&St(P,L.startTime-R)}}var N=!1,O=-1,et=5,Z=-1;function X(){return S?!0:!(l.unstable_now()-Z<et)}function W(){if(S=!1,N){var R=l.unstable_now();Z=R;var L=!0;try{t:{T=!1,w&&(w=!1,z(O),O=-1),_=!0;var nt=b;try{e:{for(G(R),x=n(m);x!==null&&!(x.expirationTime>R&&X());){var K=x.callback;if(typeof K=="function"){x.callback=null,b=x.priorityLevel;var at=K(x.expirationTime<=R);if(R=l.unstable_now(),typeof at=="function"){x.callback=at,G(R),L=!0;break e}x===n(m)&&a(m),G(R)}else a(m);x=n(m)}if(x!==null)L=!0;else{var M=n(p);M!==null&&St(P,M.startTime-R),L=!1}}break t}finally{x=null,b=nt,_=!1}L=void 0}}finally{L?I():N=!1}}}var I;if(typeof D=="function")I=function(){D(W)};else if(typeof MessageChannel<"u"){var tt=new MessageChannel,it=tt.port2;tt.port1.onmessage=W,I=function(){it.postMessage(null)}}else I=function(){A(W,0)};function St(R,L){O=A(function(){R(l.unstable_now())},L)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(R){R.callback=null},l.unstable_forceFrameRate=function(R){0>R||125<R?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):et=0<R?Math.floor(1e3/R):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_next=function(R){switch(b){case 1:case 2:case 3:var L=3;break;default:L=b}var nt=b;b=L;try{return R()}finally{b=nt}},l.unstable_requestPaint=function(){S=!0},l.unstable_runWithPriority=function(R,L){switch(R){case 1:case 2:case 3:case 4:case 5:break;default:R=3}var nt=b;b=R;try{return L()}finally{b=nt}},l.unstable_scheduleCallback=function(R,L,nt){var K=l.unstable_now();switch(typeof nt=="object"&&nt!==null?(nt=nt.delay,nt=typeof nt=="number"&&0<nt?K+nt:K):nt=K,R){case 1:var at=-1;break;case 2:at=250;break;case 5:at=1073741823;break;case 4:at=1e4;break;default:at=5e3}return at=nt+at,R={id:y++,callback:L,priorityLevel:R,startTime:nt,expirationTime:at,sortIndex:-1},nt>K?(R.sortIndex=nt,t(p,R),n(m)===null&&R===n(p)&&(w?(z(O),O=-1):w=!0,St(P,nt-K))):(R.sortIndex=at,t(m,R),T||_||(T=!0,N||(N=!0,I()))),R},l.unstable_shouldYield=X,l.unstable_wrapCallback=function(R){var L=b;return function(){var nt=b;b=L;try{return R.apply(this,arguments)}finally{b=nt}}}})(zc)),zc}var Zp;function S1(){return Zp||(Zp=1,Rc.exports=v1()),Rc.exports}var Dc={exports:{}},ge={};/**
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 Ip;function T1(){if(Ip)return ge;Ip=1;var l=Mh();function t(m){var p="https://react.dev/errors/"+m;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)p+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+m+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var a={d:{f:n,r:function(){throw Error(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(m,p,y){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:x==null?null:""+x,children:m,containerInfo:p,implementation:y}}var c=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,p){if(m==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return ge.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,ge.createPortal=function(m,p){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return o(m,p,null,y)},ge.flushSync=function(m){var p=c.T,y=a.p;try{if(c.T=null,a.p=2,m)return m()}finally{c.T=p,a.p=y,a.d.f()}},ge.preconnect=function(m,p){typeof m=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(m,p))},ge.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},ge.preinit=function(m,p){if(typeof m=="string"&&p&&typeof p.as=="string"){var y=p.as,x=f(y,p.crossOrigin),b=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;y==="style"?a.d.S(m,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:x,integrity:b,fetchPriority:_}):y==="script"&&a.d.X(m,{crossOrigin:x,integrity:b,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},ge.preinitModule=function(m,p){if(typeof m=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var y=f(p.as,p.crossOrigin);a.d.M(m,{crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(m)},ge.preload=function(m,p){if(typeof m=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var y=p.as,x=f(y,p.crossOrigin);a.d.L(m,y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},ge.preloadModule=function(m,p){if(typeof m=="string")if(p){var y=f(p.as,p.crossOrigin);a.d.m(m,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:y,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(m)},ge.requestFormReset=function(m){a.d.r(m)},ge.unstable_batchedUpdates=function(m,p){return m(p)},ge.useFormState=function(m,p,y){return c.H.useFormState(m,p,y)},ge.useFormStatus=function(){return c.H.useHostTransitionStatus()},ge.version="19.2.4",ge}var Kp;function w1(){if(Kp)return Dc.exports;Kp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),Dc.exports=T1(),Dc.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 Jp;function A1(){if(Jp)return Xa;Jp=1;var l=S1(),t=Mh(),n=w1();function a(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)i+="&args[]="+encodeURIComponent(arguments[s])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var i=e,s=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(s=i.return),e=i.return;while(e)}return i.tag===3?s:null}function c(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 f(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 m(e){if(o(e)!==e)throw Error(a(188))}function p(e){var i=e.alternate;if(!i){if(i=o(e),i===null)throw Error(a(188));return i!==e?null:e}for(var s=e,r=i;;){var h=s.return;if(h===null)break;var d=h.alternate;if(d===null){if(r=h.return,r!==null){s=r;continue}break}if(h.child===d.child){for(d=h.child;d;){if(d===s)return m(h),e;if(d===r)return m(h),i;d=d.sibling}throw Error(a(188))}if(s.return!==r.return)s=h,r=d;else{for(var g=!1,v=h.child;v;){if(v===s){g=!0,s=h,r=d;break}if(v===r){g=!0,r=h,s=d;break}v=v.sibling}if(!g){for(v=d.child;v;){if(v===s){g=!0,s=d,r=h;break}if(v===r){g=!0,r=d,s=h;break}v=v.sibling}if(!g)throw Error(a(189))}}if(s.alternate!==r)throw Error(a(190))}if(s.tag!==3)throw Error(a(188));return s.stateNode.current===s?e:i}function y(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=y(e),i!==null)return i;e=e.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),T=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),A=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),D=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),N=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),et=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),X=Symbol.for("react.memo_cache_sentinel"),W=Symbol.iterator;function I(e){return e===null||typeof e!="object"?null:(e=W&&e[W]||e["@@iterator"],typeof e=="function"?e:null)}var tt=Symbol.for("react.client.reference");function it(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===tt?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case w:return"Fragment";case A:return"Profiler";case S:return"StrictMode";case P:return"Suspense";case N:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case T:return"Portal";case D:return e.displayName||"Context";case z: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 O:return i=e.displayName||null,i!==null?i:it(e.type)||"Memo";case et:i=e._payload,e=e._init;try{return it(e(i))}catch{}}return null}var St=Array.isArray,R=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,L=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,nt={pending:!1,data:null,method:null,action:null},K=[],at=-1;function M(e){return{current:e}}function Y(e){0>at||(e.current=K[at],K[at]=null,at--)}function Q(e,i){at++,K[at]=e.current,e.current=i}var $=M(null),rt=M(null),ct=M(null),ft=M(null);function Ht(e,i){switch(Q(ct,i),Q(rt,e),Q($,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?dp(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=dp(i),e=mp(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Y($),Q($,e)}function Et(){Y($),Y(rt),Y(ct)}function Ve(e){e.memoizedState!==null&&Q(ft,e);var i=$.current,s=mp(i,e.type);i!==s&&(Q(rt,e),Q($,s))}function Qi(e){rt.current===e&&(Y($),Y(rt)),ft.current===e&&(Y(ft),Ha._currentValue=nt)}var ri,mi;function _e(e){if(ri===void 0)try{throw Error()}catch(s){var i=s.stack.trim().match(/\n( *(at )?)/);ri=i&&i[1]||"",mi=-1<s.stack.indexOf(`
43
+ at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
44
+ `+ri+e+mi}var oi=!1;function Zs(e,i){if(!e||oi)return"";oi=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(j){var H=j}Reflect.construct(e,[],F)}else{try{F.call()}catch(j){H=j}e.call(F.prototype)}}else{try{throw Error()}catch(j){H=j}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(j){if(j&&H&&typeof j.stack=="string")return[j.stack,H.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),g=d[0],v=d[1];if(g&&v){var C=g.split(`
45
+ `),k=v.split(`
46
+ `);for(h=r=0;r<C.length&&!C[r].includes("DetermineComponentFrameRoot");)r++;for(;h<k.length&&!k[h].includes("DetermineComponentFrameRoot");)h++;if(r===C.length||h===k.length)for(r=C.length-1,h=k.length-1;1<=r&&0<=h&&C[r]!==k[h];)h--;for(;1<=r&&0<=h;r--,h--)if(C[r]!==k[h]){if(r!==1||h!==1)do if(r--,h--,0>h||C[r]!==k[h]){var q=`
47
+ `+C[r].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=r&&0<=h);break}}}finally{oi=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?_e(s):""}function pl(e,i){switch(e.tag){case 26:case 27:case 5:return _e(e.type);case 16:return _e("Lazy");case 13:return e.child!==i&&i!==null?_e("Suspense Fallback"):_e("Suspense");case 19:return _e("SuspenseList");case 0:case 15:return Zs(e.type,!1);case 11:return Zs(e.type.render,!1);case 1:return Zs(e.type,!0);case 31:return _e("Activity");default:return""}}function yl(e){try{var i="",s=null;do i+=pl(e,s),s=e,e=e.return;while(e);return i}catch(r){return`
48
+ Error generating stack: `+r.message+`
49
+ `+r.stack}}var gl=Object.prototype.hasOwnProperty,ho=l.unstable_scheduleCallback,fo=l.unstable_cancelCallback,W0=l.unstable_shouldYield,Z0=l.unstable_requestPaint,Be=l.unstable_now,I0=l.unstable_getCurrentPriorityLevel,Vh=l.unstable_ImmediatePriority,Ph=l.unstable_UserBlockingPriority,xl=l.unstable_NormalPriority,K0=l.unstable_LowPriority,Fh=l.unstable_IdlePriority,J0=l.log,$0=l.unstable_setDisableYieldValue,Is=null,Oe=null;function Wi(e){if(typeof J0=="function"&&$0(e),Oe&&typeof Oe.setStrictMode=="function")try{Oe.setStrictMode(Is,e)}catch{}}var Ge=Math.clz32?Math.clz32:ix,tx=Math.log,ex=Math.LN2;function ix(e){return e>>>=0,e===0?32:31-(tx(e)/ex|0)|0}var _l=256,bl=262144,vl=4194304;function Tn(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 Sl(e,i,s){var r=e.pendingLanes;if(r===0)return 0;var h=0,d=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=r&134217727;return v!==0?(r=v&~d,r!==0?h=Tn(r):(g&=v,g!==0?h=Tn(g):s||(s=v&~e,s!==0&&(h=Tn(s))))):(v=r&~d,v!==0?h=Tn(v):g!==0?h=Tn(g):s||(s=r&~e,s!==0&&(h=Tn(s)))),h===0?0:i!==0&&i!==h&&(i&d)===0&&(d=h&-h,s=i&-i,d>=s||d===32&&(s&4194048)!==0)?i:h}function Ks(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function nx(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 Qh(){var e=vl;return vl<<=1,(vl&62914560)===0&&(vl=4194304),e}function mo(e){for(var i=[],s=0;31>s;s++)i.push(e);return i}function Js(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sx(e,i,s,r,h,d){var g=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var v=e.entanglements,C=e.expirationTimes,k=e.hiddenUpdates;for(s=g&~s;0<s;){var q=31-Ge(s),F=1<<q;v[q]=0,C[q]=-1;var H=k[q];if(H!==null)for(k[q]=null,q=0;q<H.length;q++){var j=H[q];j!==null&&(j.lane&=-536870913)}s&=~F}r!==0&&Wh(e,r,0),d!==0&&h===0&&e.tag!==0&&(e.suspendedLanes|=d&~(g&~i))}function Wh(e,i,s){e.pendingLanes|=i,e.suspendedLanes&=~i;var r=31-Ge(i);e.entangledLanes|=i,e.entanglements[r]=e.entanglements[r]|1073741824|s&261930}function Zh(e,i){var s=e.entangledLanes|=i;for(e=e.entanglements;s;){var r=31-Ge(s),h=1<<r;h&i|e[r]&i&&(e[r]|=i),s&=~h}}function Ih(e,i){var s=i&-i;return s=(s&42)!==0?1:po(s),(s&(e.suspendedLanes|i))!==0?0:s}function po(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 yo(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Kh(){var e=L.p;return e!==0?e:(e=window.event,e===void 0?32:kp(e.type))}function Jh(e,i){var s=L.p;try{return L.p=e,i()}finally{L.p=s}}var Zi=Math.random().toString(36).slice(2),he="__reactFiber$"+Zi,Te="__reactProps$"+Zi,Jn="__reactContainer$"+Zi,go="__reactEvents$"+Zi,ax="__reactListeners$"+Zi,lx="__reactHandles$"+Zi,$h="__reactResources$"+Zi,$s="__reactMarker$"+Zi;function xo(e){delete e[he],delete e[Te],delete e[go],delete e[ax],delete e[lx]}function $n(e){var i=e[he];if(i)return i;for(var s=e.parentNode;s;){if(i=s[Jn]||s[he]){if(s=i.alternate,i.child!==null||s!==null&&s.child!==null)for(e=vp(e);e!==null;){if(s=e[he])return s;e=vp(e)}return i}e=s,s=e.parentNode}return null}function ts(e){if(e=e[he]||e[Jn]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function ta(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(a(33))}function es(e){var i=e[$h];return i||(i=e[$h]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function oe(e){e[$s]=!0}var tf=new Set,ef={};function wn(e,i){is(e,i),is(e+"Capture",i)}function is(e,i){for(ef[e]=i,e=0;e<i.length;e++)tf.add(i[e])}var rx=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]*$"),nf={},sf={};function ox(e){return gl.call(sf,e)?!0:gl.call(nf,e)?!1:rx.test(e)?sf[e]=!0:(nf[e]=!0,!1)}function Tl(e,i,s){if(ox(i))if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+s)}}function wl(e,i,s){if(s===null)e.removeAttribute(i);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+s)}}function Si(e,i,s,r){if(r===null)e.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(i,s,""+r)}}function Pe(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function af(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ux(e,i,s){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var h=r.get,d=r.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return h.call(this)},set:function(g){s=""+g,d.call(this,g)}}),Object.defineProperty(e,i,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(g){s=""+g},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function _o(e){if(!e._valueTracker){var i=af(e)?"checked":"value";e._valueTracker=ux(e,i,""+e[i])}}function lf(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var s=i.getValue(),r="";return e&&(r=af(e)?e.checked?"true":"false":e.value),e=r,e!==s?(i.setValue(e),!0):!1}function Al(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 cx=/[\n"\\]/g;function Fe(e){return e.replace(cx,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function bo(e,i,s,r,h,d,g,v){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),i!=null?g==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+Pe(i)):e.value!==""+Pe(i)&&(e.value=""+Pe(i)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),i!=null?vo(e,g,Pe(i)):s!=null?vo(e,g,Pe(s)):r!=null&&e.removeAttribute("value"),h==null&&d!=null&&(e.defaultChecked=!!d),h!=null&&(e.checked=h&&typeof h!="function"&&typeof h!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+Pe(v):e.removeAttribute("name")}function rf(e,i,s,r,h,d,g,v){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),i!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||i!=null)){_o(e);return}s=s!=null?""+Pe(s):"",i=i!=null?""+Pe(i):s,v||i===e.value||(e.value=i),e.defaultValue=i}r=r??h,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=v?e.checked:!!r,e.defaultChecked=!!r,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),_o(e)}function vo(e,i,s){i==="number"&&Al(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function ns(e,i,s,r){if(e=e.options,i){i={};for(var h=0;h<s.length;h++)i["$"+s[h]]=!0;for(s=0;s<e.length;s++)h=i.hasOwnProperty("$"+e[s].value),e[s].selected!==h&&(e[s].selected=h),h&&r&&(e[s].defaultSelected=!0)}else{for(s=""+Pe(s),i=null,h=0;h<e.length;h++){if(e[h].value===s){e[h].selected=!0,r&&(e[h].defaultSelected=!0);return}i!==null||e[h].disabled||(i=e[h])}i!==null&&(i.selected=!0)}}function of(e,i,s){if(i!=null&&(i=""+Pe(i),i!==e.value&&(e.value=i),s==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=s!=null?""+Pe(s):""}function uf(e,i,s,r){if(i==null){if(r!=null){if(s!=null)throw Error(a(92));if(St(r)){if(1<r.length)throw Error(a(93));r=r[0]}s=r}s==null&&(s=""),i=s}s=Pe(i),e.defaultValue=s,r=e.textContent,r===s&&r!==""&&r!==null&&(e.value=r),_o(e)}function ss(e,i){if(i){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=i;return}}e.textContent=i}var hx=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 cf(e,i,s){var r=i.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?r?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":r?e.setProperty(i,s):typeof s!="number"||s===0||hx.has(i)?i==="float"?e.cssFloat=s:e[i]=(""+s).trim():e[i]=s+"px"}function hf(e,i,s){if(i!=null&&typeof i!="object")throw Error(a(62));if(e=e.style,s!=null){for(var r in s)!s.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var h in i)r=i[h],i.hasOwnProperty(h)&&s[h]!==r&&cf(e,h,r)}else for(var d in i)i.hasOwnProperty(d)&&cf(e,d,i[d])}function So(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 fx=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"]]),dx=/^[\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 Cl(e){return dx.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ti(){}var To=null;function wo(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var as=null,ls=null;function ff(e){var i=ts(e);if(i&&(e=i.stateNode)){var s=e[Te]||null;t:switch(e=i.stateNode,i.type){case"input":if(bo(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),i=s.name,s.type==="radio"&&i!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+Fe(""+i)+'"][type="radio"]'),i=0;i<s.length;i++){var r=s[i];if(r!==e&&r.form===e.form){var h=r[Te]||null;if(!h)throw Error(a(90));bo(r,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<s.length;i++)r=s[i],r.form===e.form&&lf(r)}break t;case"textarea":of(e,s.value,s.defaultValue);break t;case"select":i=s.value,i!=null&&ns(e,!!s.multiple,i,!1)}}}var Ao=!1;function df(e,i,s){if(Ao)return e(i,s);Ao=!0;try{var r=e(i);return r}finally{if(Ao=!1,(as!==null||ls!==null)&&(dr(),as&&(i=as,e=ls,ls=as=null,ff(i),e)))for(i=0;i<e.length;i++)ff(e[i])}}function ea(e,i){var s=e.stateNode;if(s===null)return null;var r=s[Te]||null;if(r===null)return null;s=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break t;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(a(231,i,typeof s));return s}var wi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Co=!1;if(wi)try{var ia={};Object.defineProperty(ia,"passive",{get:function(){Co=!0}}),window.addEventListener("test",ia,ia),window.removeEventListener("test",ia,ia)}catch{Co=!1}var Ii=null,Mo=null,Ml=null;function mf(){if(Ml)return Ml;var e,i=Mo,s=i.length,r,h="value"in Ii?Ii.value:Ii.textContent,d=h.length;for(e=0;e<s&&i[e]===h[e];e++);var g=s-e;for(r=1;r<=g&&i[s-r]===h[d-r];r++);return Ml=h.slice(e,1<r?1-r:void 0)}function El(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 Rl(){return!0}function pf(){return!1}function we(e){function i(s,r,h,d,g){this._reactName=s,this._targetInst=h,this.type=r,this.nativeEvent=d,this.target=g,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(s=e[v],this[v]=s?s(d):d[v]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?Rl:pf,this.isPropagationStopped=pf,this}return x(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=Rl)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=Rl)},persist:function(){},isPersistent:Rl}),i}var An={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},zl=we(An),na=x({},An,{view:0,detail:0}),mx=we(na),Eo,Ro,sa,Dl=x({},na,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Do,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!==sa&&(sa&&e.type==="mousemove"?(Eo=e.screenX-sa.screenX,Ro=e.screenY-sa.screenY):Ro=Eo=0,sa=e),Eo)},movementY:function(e){return"movementY"in e?e.movementY:Ro}}),yf=we(Dl),px=x({},Dl,{dataTransfer:0}),yx=we(px),gx=x({},na,{relatedTarget:0}),zo=we(gx),xx=x({},An,{animationName:0,elapsedTime:0,pseudoElement:0}),_x=we(xx),bx=x({},An,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),vx=we(bx),Sx=x({},An,{data:0}),gf=we(Sx),Tx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wx={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"},Ax={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Cx(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=Ax[e])?!!i[e]:!1}function Do(){return Cx}var Mx=x({},na,{key:function(e){if(e.key){var i=Tx[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=El(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wx[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Do,charCode:function(e){return e.type==="keypress"?El(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?El(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ex=we(Mx),Rx=x({},Dl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xf=we(Rx),zx=x({},na,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Do}),Dx=we(zx),Bx=x({},An,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ox=we(Bx),Gx=x({},Dl,{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}),Ux=we(Gx),Nx=x({},An,{newState:0,oldState:0}),kx=we(Nx),Hx=[9,13,27,32],Bo=wi&&"CompositionEvent"in window,aa=null;wi&&"documentMode"in document&&(aa=document.documentMode);var Lx=wi&&"TextEvent"in window&&!aa,_f=wi&&(!Bo||aa&&8<aa&&11>=aa),bf=" ",vf=!1;function Sf(e,i){switch(e){case"keyup":return Hx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var rs=!1;function jx(e,i){switch(e){case"compositionend":return Tf(i);case"keypress":return i.which!==32?null:(vf=!0,bf);case"textInput":return e=i.data,e===bf&&vf?null:e;default:return null}}function Yx(e,i){if(rs)return e==="compositionend"||!Bo&&Sf(e,i)?(e=mf(),Ml=Mo=Ii=null,rs=!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 _f&&i.locale!=="ko"?null:i.data;default:return null}}var qx={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 wf(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!qx[e.type]:i==="textarea"}function Af(e,i,s,r){as?ls?ls.push(r):ls=[r]:as=r,i=br(i,"onChange"),0<i.length&&(s=new zl("onChange","change",null,s,r),e.push({event:s,listeners:i}))}var la=null,ra=null;function Xx(e){rp(e,0)}function Bl(e){var i=ta(e);if(lf(i))return e}function Cf(e,i){if(e==="change")return i}var Mf=!1;if(wi){var Oo;if(wi){var Go="oninput"in document;if(!Go){var Ef=document.createElement("div");Ef.setAttribute("oninput","return;"),Go=typeof Ef.oninput=="function"}Oo=Go}else Oo=!1;Mf=Oo&&(!document.documentMode||9<document.documentMode)}function Rf(){la&&(la.detachEvent("onpropertychange",zf),ra=la=null)}function zf(e){if(e.propertyName==="value"&&Bl(ra)){var i=[];Af(i,ra,e,wo(e)),df(Xx,i)}}function Vx(e,i,s){e==="focusin"?(Rf(),la=i,ra=s,la.attachEvent("onpropertychange",zf)):e==="focusout"&&Rf()}function Px(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Bl(ra)}function Fx(e,i){if(e==="click")return Bl(i)}function Qx(e,i){if(e==="input"||e==="change")return Bl(i)}function Wx(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var Ue=typeof Object.is=="function"?Object.is:Wx;function oa(e,i){if(Ue(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var s=Object.keys(e),r=Object.keys(i);if(s.length!==r.length)return!1;for(r=0;r<s.length;r++){var h=s[r];if(!gl.call(i,h)||!Ue(e[h],i[h]))return!1}return!0}function Df(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Bf(e,i){var s=Df(e);e=0;for(var r;s;){if(s.nodeType===3){if(r=e+s.textContent.length,e<=i&&r>=i)return{node:s,offset:i-e};e=r}t:{for(;s;){if(s.nextSibling){s=s.nextSibling;break t}s=s.parentNode}s=void 0}s=Df(s)}}function Of(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Of(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Gf(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Al(e.document);i instanceof e.HTMLIFrameElement;){try{var s=typeof i.contentWindow.location.href=="string"}catch{s=!1}if(s)e=i.contentWindow;else break;i=Al(e.document)}return i}function Uo(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 Zx=wi&&"documentMode"in document&&11>=document.documentMode,os=null,No=null,ua=null,ko=!1;function Uf(e,i,s){var r=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;ko||os==null||os!==Al(r)||(r=os,"selectionStart"in r&&Uo(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ua&&oa(ua,r)||(ua=r,r=br(No,"onSelect"),0<r.length&&(i=new zl("onSelect","select",null,i,s),e.push({event:i,listeners:r}),i.target=os)))}function Cn(e,i){var s={};return s[e.toLowerCase()]=i.toLowerCase(),s["Webkit"+e]="webkit"+i,s["Moz"+e]="moz"+i,s}var us={animationend:Cn("Animation","AnimationEnd"),animationiteration:Cn("Animation","AnimationIteration"),animationstart:Cn("Animation","AnimationStart"),transitionrun:Cn("Transition","TransitionRun"),transitionstart:Cn("Transition","TransitionStart"),transitioncancel:Cn("Transition","TransitionCancel"),transitionend:Cn("Transition","TransitionEnd")},Ho={},Nf={};wi&&(Nf=document.createElement("div").style,"AnimationEvent"in window||(delete us.animationend.animation,delete us.animationiteration.animation,delete us.animationstart.animation),"TransitionEvent"in window||delete us.transitionend.transition);function Mn(e){if(Ho[e])return Ho[e];if(!us[e])return e;var i=us[e],s;for(s in i)if(i.hasOwnProperty(s)&&s in Nf)return Ho[e]=i[s];return e}var kf=Mn("animationend"),Hf=Mn("animationiteration"),Lf=Mn("animationstart"),Ix=Mn("transitionrun"),Kx=Mn("transitionstart"),Jx=Mn("transitioncancel"),jf=Mn("transitionend"),Yf=new Map,Lo="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(" ");Lo.push("scrollEnd");function ui(e,i){Yf.set(e,i),wn(i,[e])}var Ol=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)},Qe=[],cs=0,jo=0;function Gl(){for(var e=cs,i=jo=cs=0;i<e;){var s=Qe[i];Qe[i++]=null;var r=Qe[i];Qe[i++]=null;var h=Qe[i];Qe[i++]=null;var d=Qe[i];if(Qe[i++]=null,r!==null&&h!==null){var g=r.pending;g===null?h.next=h:(h.next=g.next,g.next=h),r.pending=h}d!==0&&qf(s,h,d)}}function Ul(e,i,s,r){Qe[cs++]=e,Qe[cs++]=i,Qe[cs++]=s,Qe[cs++]=r,jo|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Yo(e,i,s,r){return Ul(e,i,s,r),Nl(e)}function En(e,i){return Ul(e,null,null,i),Nl(e)}function qf(e,i,s){e.lanes|=s;var r=e.alternate;r!==null&&(r.lanes|=s);for(var h=!1,d=e.return;d!==null;)d.childLanes|=s,r=d.alternate,r!==null&&(r.childLanes|=s),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(h=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,h&&i!==null&&(h=31-Ge(s),e=d.hiddenUpdates,r=e[h],r===null?e[h]=[i]:r.push(i),i.lane=s|536870912),d):null}function Nl(e){if(50<Da)throw Da=0,Iu=null,Error(a(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var hs={};function $x(e,i,s,r){this.tag=e,this.key=s,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ne(e,i,s,r){return new $x(e,i,s,r)}function qo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Ai(e,i){var s=e.alternate;return s===null?(s=Ne(e.tag,i,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=i,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,i=e.dependencies,s.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Xf(e,i){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,i=s.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function kl(e,i,s,r,h,d){var g=0;if(r=e,typeof e=="function")qo(e)&&(g=1);else if(typeof e=="string")g=s1(e,s,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else t:switch(e){case Z:return e=Ne(31,s,i,h),e.elementType=Z,e.lanes=d,e;case w:return Rn(s.children,h,d,i);case S:g=8,h|=24;break;case A:return e=Ne(12,s,i,h|2),e.elementType=A,e.lanes=d,e;case P:return e=Ne(13,s,i,h),e.elementType=P,e.lanes=d,e;case N:return e=Ne(19,s,i,h),e.elementType=N,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:g=10;break t;case z:g=9;break t;case G:g=11;break t;case O:g=14;break t;case et:g=16,r=null;break t}g=29,s=Error(a(130,e===null?"null":typeof e,"")),r=null}return i=Ne(g,s,i,h),i.elementType=e,i.type=r,i.lanes=d,i}function Rn(e,i,s,r){return e=Ne(7,e,r,i),e.lanes=s,e}function Xo(e,i,s){return e=Ne(6,e,null,i),e.lanes=s,e}function Vf(e){var i=Ne(18,null,null,0);return i.stateNode=e,i}function Vo(e,i,s){return i=Ne(4,e.children!==null?e.children:[],e.key,i),i.lanes=s,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Pf=new WeakMap;function We(e,i){if(typeof e=="object"&&e!==null){var s=Pf.get(e);return s!==void 0?s:(i={value:e,source:i,stack:yl(i)},Pf.set(e,i),i)}return{value:e,source:i,stack:yl(i)}}var fs=[],ds=0,Hl=null,ca=0,Ze=[],Ie=0,Ki=null,pi=1,yi="";function Ci(e,i){fs[ds++]=ca,fs[ds++]=Hl,Hl=e,ca=i}function Ff(e,i,s){Ze[Ie++]=pi,Ze[Ie++]=yi,Ze[Ie++]=Ki,Ki=e;var r=pi;e=yi;var h=32-Ge(r)-1;r&=~(1<<h),s+=1;var d=32-Ge(i)+h;if(30<d){var g=h-h%5;d=(r&(1<<g)-1).toString(32),r>>=g,h-=g,pi=1<<32-Ge(i)+h|s<<h|r,yi=d+e}else pi=1<<d|s<<h|r,yi=e}function Po(e){e.return!==null&&(Ci(e,1),Ff(e,1,0))}function Fo(e){for(;e===Hl;)Hl=fs[--ds],fs[ds]=null,ca=fs[--ds],fs[ds]=null;for(;e===Ki;)Ki=Ze[--Ie],Ze[Ie]=null,yi=Ze[--Ie],Ze[Ie]=null,pi=Ze[--Ie],Ze[Ie]=null}function Qf(e,i){Ze[Ie++]=pi,Ze[Ie++]=yi,Ze[Ie++]=Ki,pi=i.id,yi=i.overflow,Ki=e}var fe=null,Lt=null,Tt=!1,Ji=null,Ke=!1,Qo=Error(a(519));function $i(e){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ha(We(i,e)),Qo}function Wf(e){var i=e.stateNode,s=e.type,r=e.memoizedProps;switch(i[he]=e,i[Te]=r,s){case"dialog":xt("cancel",i),xt("close",i);break;case"iframe":case"object":case"embed":xt("load",i);break;case"video":case"audio":for(s=0;s<Oa.length;s++)xt(Oa[s],i);break;case"source":xt("error",i);break;case"img":case"image":case"link":xt("error",i),xt("load",i);break;case"details":xt("toggle",i);break;case"input":xt("invalid",i),rf(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":xt("invalid",i);break;case"textarea":xt("invalid",i),uf(i,r.value,r.defaultValue,r.children)}s=r.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||i.textContent===""+s||r.suppressHydrationWarning===!0||hp(i.textContent,s)?(r.popover!=null&&(xt("beforetoggle",i),xt("toggle",i)),r.onScroll!=null&&xt("scroll",i),r.onScrollEnd!=null&&xt("scrollend",i),r.onClick!=null&&(i.onclick=Ti),i=!0):i=!1,i||$i(e,!0)}function Zf(e){for(fe=e.return;fe;)switch(fe.tag){case 5:case 31:case 13:Ke=!1;return;case 27:case 3:Ke=!0;return;default:fe=fe.return}}function ms(e){if(e!==fe)return!1;if(!Tt)return Zf(e),Tt=!0,!1;var i=e.tag,s;if((s=i!==3&&i!==27)&&((s=i===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||hc(e.type,e.memoizedProps)),s=!s),s&&Lt&&$i(e),Zf(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Lt=bp(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Lt=bp(e)}else i===27?(i=Lt,mn(e.type)?(e=yc,yc=null,Lt=e):Lt=i):Lt=fe?$e(e.stateNode.nextSibling):null;return!0}function zn(){Lt=fe=null,Tt=!1}function Wo(){var e=Ji;return e!==null&&(Ee===null?Ee=e:Ee.push.apply(Ee,e),Ji=null),e}function ha(e){Ji===null?Ji=[e]:Ji.push(e)}var Zo=M(null),Dn=null,Mi=null;function tn(e,i,s){Q(Zo,i._currentValue),i._currentValue=s}function Ei(e){e._currentValue=Zo.current,Y(Zo)}function Io(e,i,s){for(;e!==null;){var r=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),e===s)break;e=e.return}}function Ko(e,i,s,r){var h=e.child;for(h!==null&&(h.return=e);h!==null;){var d=h.dependencies;if(d!==null){var g=h.child;d=d.firstContext;t:for(;d!==null;){var v=d;d=h;for(var C=0;C<i.length;C++)if(v.context===i[C]){d.lanes|=s,v=d.alternate,v!==null&&(v.lanes|=s),Io(d.return,s,e),r||(g=null);break t}d=v.next}}else if(h.tag===18){if(g=h.return,g===null)throw Error(a(341));g.lanes|=s,d=g.alternate,d!==null&&(d.lanes|=s),Io(g,s,e),g=null}else g=h.child;if(g!==null)g.return=h;else for(g=h;g!==null;){if(g===e){g=null;break}if(h=g.sibling,h!==null){h.return=g.return,g=h;break}g=g.return}h=g}}function ps(e,i,s,r){e=null;for(var h=i,d=!1;h!==null;){if(!d){if((h.flags&524288)!==0)d=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var g=h.alternate;if(g===null)throw Error(a(387));if(g=g.memoizedProps,g!==null){var v=h.type;Ue(h.pendingProps.value,g.value)||(e!==null?e.push(v):e=[v])}}else if(h===ft.current){if(g=h.alternate,g===null)throw Error(a(387));g.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(e!==null?e.push(Ha):e=[Ha])}h=h.return}e!==null&&Ko(i,e,s,r),i.flags|=262144}function Ll(e){for(e=e.firstContext;e!==null;){if(!Ue(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Bn(e){Dn=e,Mi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function de(e){return If(Dn,e)}function jl(e,i){return Dn===null&&Bn(e),If(e,i)}function If(e,i){var s=i._currentValue;if(i={context:i,memoizedValue:s,next:null},Mi===null){if(e===null)throw Error(a(308));Mi=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else Mi=Mi.next=i;return s}var t_=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(s,r){e.push(r)}};this.abort=function(){i.aborted=!0,e.forEach(function(s){return s()})}},e_=l.unstable_scheduleCallback,i_=l.unstable_NormalPriority,ee={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Jo(){return{controller:new t_,data:new Map,refCount:0}}function fa(e){e.refCount--,e.refCount===0&&e_(i_,function(){e.controller.abort()})}var da=null,$o=0,ys=0,gs=null;function n_(e,i){if(da===null){var s=da=[];$o=0,ys=ic(),gs={status:"pending",value:void 0,then:function(r){s.push(r)}}}return $o++,i.then(Kf,Kf),i}function Kf(){if(--$o===0&&da!==null){gs!==null&&(gs.status="fulfilled");var e=da;da=null,ys=0,gs=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function s_(e,i){var s=[],r={status:"pending",value:null,reason:null,then:function(h){s.push(h)}};return e.then(function(){r.status="fulfilled",r.value=i;for(var h=0;h<s.length;h++)(0,s[h])(i)},function(h){for(r.status="rejected",r.reason=h,h=0;h<s.length;h++)(0,s[h])(void 0)}),r}var Jf=R.S;R.S=function(e,i){Um=Be(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&n_(e,i),Jf!==null&&Jf(e,i)};var On=M(null);function tu(){var e=On.current;return e!==null?e:Nt.pooledCache}function Yl(e,i){i===null?Q(On,On.current):Q(On,i.pool)}function $f(){var e=tu();return e===null?null:{parent:ee._currentValue,pool:e}}var xs=Error(a(460)),eu=Error(a(474)),ql=Error(a(542)),Xl={then:function(){}};function td(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ed(e,i,s){switch(s=e[s],s===void 0?e.push(i):s!==i&&(i.then(Ti,Ti),i=s),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nd(e),e;default:if(typeof i.status=="string")i.then(Ti,Ti);else{if(e=Nt,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=i,e.status="pending",e.then(function(r){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=r}},function(r){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nd(e),e}throw Un=i,xs}}function Gn(e){try{var i=e._init;return i(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(Un=s,xs):s}}var Un=null;function id(){if(Un===null)throw Error(a(459));var e=Un;return Un=null,e}function nd(e){if(e===xs||e===ql)throw Error(a(483))}var _s=null,ma=0;function Vl(e){var i=ma;return ma+=1,_s===null&&(_s=[]),ed(_s,e,i)}function pa(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Pl(e,i){throw i.$$typeof===b?Error(a(525)):(e=Object.prototype.toString.call(i),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function sd(e){function i(B,E){if(e){var U=B.deletions;U===null?(B.deletions=[E],B.flags|=16):U.push(E)}}function s(B,E){if(!e)return null;for(;E!==null;)i(B,E),E=E.sibling;return null}function r(B){for(var E=new Map;B!==null;)B.key!==null?E.set(B.key,B):E.set(B.index,B),B=B.sibling;return E}function h(B,E){return B=Ai(B,E),B.index=0,B.sibling=null,B}function d(B,E,U){return B.index=U,e?(U=B.alternate,U!==null?(U=U.index,U<E?(B.flags|=67108866,E):U):(B.flags|=67108866,E)):(B.flags|=1048576,E)}function g(B){return e&&B.alternate===null&&(B.flags|=67108866),B}function v(B,E,U,V){return E===null||E.tag!==6?(E=Xo(U,B.mode,V),E.return=B,E):(E=h(E,U),E.return=B,E)}function C(B,E,U,V){var ot=U.type;return ot===w?q(B,E,U.props.children,V,U.key):E!==null&&(E.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===et&&Gn(ot)===E.type)?(E=h(E,U.props),pa(E,U),E.return=B,E):(E=kl(U.type,U.key,U.props,null,B.mode,V),pa(E,U),E.return=B,E)}function k(B,E,U,V){return E===null||E.tag!==4||E.stateNode.containerInfo!==U.containerInfo||E.stateNode.implementation!==U.implementation?(E=Vo(U,B.mode,V),E.return=B,E):(E=h(E,U.children||[]),E.return=B,E)}function q(B,E,U,V,ot){return E===null||E.tag!==7?(E=Rn(U,B.mode,V,ot),E.return=B,E):(E=h(E,U),E.return=B,E)}function F(B,E,U){if(typeof E=="string"&&E!==""||typeof E=="number"||typeof E=="bigint")return E=Xo(""+E,B.mode,U),E.return=B,E;if(typeof E=="object"&&E!==null){switch(E.$$typeof){case _:return U=kl(E.type,E.key,E.props,null,B.mode,U),pa(U,E),U.return=B,U;case T:return E=Vo(E,B.mode,U),E.return=B,E;case et:return E=Gn(E),F(B,E,U)}if(St(E)||I(E))return E=Rn(E,B.mode,U,null),E.return=B,E;if(typeof E.then=="function")return F(B,Vl(E),U);if(E.$$typeof===D)return F(B,jl(B,E),U);Pl(B,E)}return null}function H(B,E,U,V){var ot=E!==null?E.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ot!==null?null:v(B,E,""+U,V);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case _:return U.key===ot?C(B,E,U,V):null;case T:return U.key===ot?k(B,E,U,V):null;case et:return U=Gn(U),H(B,E,U,V)}if(St(U)||I(U))return ot!==null?null:q(B,E,U,V,null);if(typeof U.then=="function")return H(B,E,Vl(U),V);if(U.$$typeof===D)return H(B,E,jl(B,U),V);Pl(B,U)}return null}function j(B,E,U,V,ot){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return B=B.get(U)||null,v(E,B,""+V,ot);if(typeof V=="object"&&V!==null){switch(V.$$typeof){case _:return B=B.get(V.key===null?U:V.key)||null,C(E,B,V,ot);case T:return B=B.get(V.key===null?U:V.key)||null,k(E,B,V,ot);case et:return V=Gn(V),j(B,E,U,V,ot)}if(St(V)||I(V))return B=B.get(U)||null,q(E,B,V,ot,null);if(typeof V.then=="function")return j(B,E,U,Vl(V),ot);if(V.$$typeof===D)return j(B,E,U,jl(E,V),ot);Pl(E,V)}return null}function st(B,E,U,V){for(var ot=null,At=null,lt=E,pt=E=0,bt=null;lt!==null&&pt<U.length;pt++){lt.index>pt?(bt=lt,lt=null):bt=lt.sibling;var Ct=H(B,lt,U[pt],V);if(Ct===null){lt===null&&(lt=bt);break}e&&lt&&Ct.alternate===null&&i(B,lt),E=d(Ct,E,pt),At===null?ot=Ct:At.sibling=Ct,At=Ct,lt=bt}if(pt===U.length)return s(B,lt),Tt&&Ci(B,pt),ot;if(lt===null){for(;pt<U.length;pt++)lt=F(B,U[pt],V),lt!==null&&(E=d(lt,E,pt),At===null?ot=lt:At.sibling=lt,At=lt);return Tt&&Ci(B,pt),ot}for(lt=r(lt);pt<U.length;pt++)bt=j(lt,B,pt,U[pt],V),bt!==null&&(e&&bt.alternate!==null&&lt.delete(bt.key===null?pt:bt.key),E=d(bt,E,pt),At===null?ot=bt:At.sibling=bt,At=bt);return e&&lt.forEach(function(_n){return i(B,_n)}),Tt&&Ci(B,pt),ot}function ut(B,E,U,V){if(U==null)throw Error(a(151));for(var ot=null,At=null,lt=E,pt=E=0,bt=null,Ct=U.next();lt!==null&&!Ct.done;pt++,Ct=U.next()){lt.index>pt?(bt=lt,lt=null):bt=lt.sibling;var _n=H(B,lt,Ct.value,V);if(_n===null){lt===null&&(lt=bt);break}e&&lt&&_n.alternate===null&&i(B,lt),E=d(_n,E,pt),At===null?ot=_n:At.sibling=_n,At=_n,lt=bt}if(Ct.done)return s(B,lt),Tt&&Ci(B,pt),ot;if(lt===null){for(;!Ct.done;pt++,Ct=U.next())Ct=F(B,Ct.value,V),Ct!==null&&(E=d(Ct,E,pt),At===null?ot=Ct:At.sibling=Ct,At=Ct);return Tt&&Ci(B,pt),ot}for(lt=r(lt);!Ct.done;pt++,Ct=U.next())Ct=j(lt,B,pt,Ct.value,V),Ct!==null&&(e&&Ct.alternate!==null&&lt.delete(Ct.key===null?pt:Ct.key),E=d(Ct,E,pt),At===null?ot=Ct:At.sibling=Ct,At=Ct);return e&&lt.forEach(function(p1){return i(B,p1)}),Tt&&Ci(B,pt),ot}function Gt(B,E,U,V){if(typeof U=="object"&&U!==null&&U.type===w&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case _:t:{for(var ot=U.key;E!==null;){if(E.key===ot){if(ot=U.type,ot===w){if(E.tag===7){s(B,E.sibling),V=h(E,U.props.children),V.return=B,B=V;break t}}else if(E.elementType===ot||typeof ot=="object"&&ot!==null&&ot.$$typeof===et&&Gn(ot)===E.type){s(B,E.sibling),V=h(E,U.props),pa(V,U),V.return=B,B=V;break t}s(B,E);break}else i(B,E);E=E.sibling}U.type===w?(V=Rn(U.props.children,B.mode,V,U.key),V.return=B,B=V):(V=kl(U.type,U.key,U.props,null,B.mode,V),pa(V,U),V.return=B,B=V)}return g(B);case T:t:{for(ot=U.key;E!==null;){if(E.key===ot)if(E.tag===4&&E.stateNode.containerInfo===U.containerInfo&&E.stateNode.implementation===U.implementation){s(B,E.sibling),V=h(E,U.children||[]),V.return=B,B=V;break t}else{s(B,E);break}else i(B,E);E=E.sibling}V=Vo(U,B.mode,V),V.return=B,B=V}return g(B);case et:return U=Gn(U),Gt(B,E,U,V)}if(St(U))return st(B,E,U,V);if(I(U)){if(ot=I(U),typeof ot!="function")throw Error(a(150));return U=ot.call(U),ut(B,E,U,V)}if(typeof U.then=="function")return Gt(B,E,Vl(U),V);if(U.$$typeof===D)return Gt(B,E,jl(B,U),V);Pl(B,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,E!==null&&E.tag===6?(s(B,E.sibling),V=h(E,U),V.return=B,B=V):(s(B,E),V=Xo(U,B.mode,V),V.return=B,B=V),g(B)):s(B,E)}return function(B,E,U,V){try{ma=0;var ot=Gt(B,E,U,V);return _s=null,ot}catch(lt){if(lt===xs||lt===ql)throw lt;var At=Ne(29,lt,null,B.mode);return At.lanes=V,At.return=B,At}finally{}}}var Nn=sd(!0),ad=sd(!1),en=!1;function iu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nu(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 nn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function sn(e,i,s){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Rt&2)!==0){var h=r.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),r.pending=i,i=Nl(e),qf(e,null,s),i}return Ul(e,r,i,s),Nl(e)}function ya(e,i,s){if(i=i.updateQueue,i!==null&&(i=i.shared,(s&4194048)!==0)){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Zh(e,s)}}function su(e,i){var s=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,s===r)){var h=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var g={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?h=d=g:d=d.next=g,s=s.next}while(s!==null);d===null?h=d=i:d=d.next=i}else h=d=i;s={baseState:r.baseState,firstBaseUpdate:h,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=i:e.next=i,s.lastBaseUpdate=i}var au=!1;function ga(){if(au){var e=gs;if(e!==null)throw e}}function xa(e,i,s,r){au=!1;var h=e.updateQueue;en=!1;var d=h.firstBaseUpdate,g=h.lastBaseUpdate,v=h.shared.pending;if(v!==null){h.shared.pending=null;var C=v,k=C.next;C.next=null,g===null?d=k:g.next=k,g=C;var q=e.alternate;q!==null&&(q=q.updateQueue,v=q.lastBaseUpdate,v!==g&&(v===null?q.firstBaseUpdate=k:v.next=k,q.lastBaseUpdate=C))}if(d!==null){var F=h.baseState;g=0,q=k=C=null,v=d;do{var H=v.lane&-536870913,j=H!==v.lane;if(j?(_t&H)===H:(r&H)===H){H!==0&&H===ys&&(au=!0),q!==null&&(q=q.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});t:{var st=e,ut=v;H=i;var Gt=s;switch(ut.tag){case 1:if(st=ut.payload,typeof st=="function"){F=st.call(Gt,F,H);break t}F=st;break t;case 3:st.flags=st.flags&-65537|128;case 0:if(st=ut.payload,H=typeof st=="function"?st.call(Gt,F,H):st,H==null)break t;F=x({},F,H);break t;case 2:en=!0}}H=v.callback,H!==null&&(e.flags|=64,j&&(e.flags|=8192),j=h.callbacks,j===null?h.callbacks=[H]:j.push(H))}else j={lane:H,tag:v.tag,payload:v.payload,callback:v.callback,next:null},q===null?(k=q=j,C=F):q=q.next=j,g|=H;if(v=v.next,v===null){if(v=h.shared.pending,v===null)break;j=v,v=j.next,j.next=null,h.lastBaseUpdate=j,h.shared.pending=null}}while(!0);q===null&&(C=F),h.baseState=C,h.firstBaseUpdate=k,h.lastBaseUpdate=q,d===null&&(h.shared.lanes=0),un|=g,e.lanes=g,e.memoizedState=F}}function ld(e,i){if(typeof e!="function")throw Error(a(191,e));e.call(i)}function rd(e,i){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)ld(s[e],i)}var bs=M(null),Fl=M(0);function od(e,i){e=ki,Q(Fl,e),Q(bs,i),ki=e|i.baseLanes}function lu(){Q(Fl,ki),Q(bs,bs.current)}function ru(){ki=Fl.current,Y(bs),Y(Fl)}var ke=M(null),Je=null;function an(e){var i=e.alternate;Q(Zt,Zt.current&1),Q(ke,e),Je===null&&(i===null||bs.current!==null||i.memoizedState!==null)&&(Je=e)}function ou(e){Q(Zt,Zt.current),Q(ke,e),Je===null&&(Je=e)}function ud(e){e.tag===22?(Q(Zt,Zt.current),Q(ke,e),Je===null&&(Je=e)):ln()}function ln(){Q(Zt,Zt.current),Q(ke,ke.current)}function He(e){Y(ke),Je===e&&(Je=null),Y(Zt)}var Zt=M(0);function Ql(e){for(var i=e;i!==null;){if(i.tag===13){var s=i.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||mc(s)||pc(s)))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 Ri=0,mt=null,Bt=null,ie=null,Wl=!1,vs=!1,kn=!1,Zl=0,_a=0,Ss=null,a_=0;function Xt(){throw Error(a(321))}function uu(e,i){if(i===null)return!1;for(var s=0;s<i.length&&s<e.length;s++)if(!Ue(e[s],i[s]))return!1;return!0}function cu(e,i,s,r,h,d){return Ri=d,mt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,R.H=e===null||e.memoizedState===null?Fd:Au,kn=!1,d=s(r,h),kn=!1,vs&&(d=hd(i,s,r,h)),cd(e),d}function cd(e){R.H=Sa;var i=Bt!==null&&Bt.next!==null;if(Ri=0,ie=Bt=mt=null,Wl=!1,_a=0,Ss=null,i)throw Error(a(300));e===null||ne||(e=e.dependencies,e!==null&&Ll(e)&&(ne=!0))}function hd(e,i,s,r){mt=e;var h=0;do{if(vs&&(Ss=null),_a=0,vs=!1,25<=h)throw Error(a(301));if(h+=1,ie=Bt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}R.H=Qd,d=i(s,r)}while(vs);return d}function l_(){var e=R.H,i=e.useState()[0];return i=typeof i.then=="function"?ba(i):i,e=e.useState()[0],(Bt!==null?Bt.memoizedState:null)!==e&&(mt.flags|=1024),i}function hu(){var e=Zl!==0;return Zl=0,e}function fu(e,i,s){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~s}function du(e){if(Wl){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}Wl=!1}Ri=0,ie=Bt=mt=null,vs=!1,_a=Zl=0,Ss=null}function be(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ie===null?mt.memoizedState=ie=e:ie=ie.next=e,ie}function It(){if(Bt===null){var e=mt.alternate;e=e!==null?e.memoizedState:null}else e=Bt.next;var i=ie===null?mt.memoizedState:ie.next;if(i!==null)ie=i,Bt=e;else{if(e===null)throw mt.alternate===null?Error(a(467)):Error(a(310));Bt=e,e={memoizedState:Bt.memoizedState,baseState:Bt.baseState,baseQueue:Bt.baseQueue,queue:Bt.queue,next:null},ie===null?mt.memoizedState=ie=e:ie=ie.next=e}return ie}function Il(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ba(e){var i=_a;return _a+=1,Ss===null&&(Ss=[]),e=ed(Ss,e,i),i=mt,(ie===null?i.memoizedState:ie.next)===null&&(i=i.alternate,R.H=i===null||i.memoizedState===null?Fd:Au),e}function Kl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ba(e);if(e.$$typeof===D)return de(e)}throw Error(a(438,String(e)))}function mu(e){var i=null,s=mt.updateQueue;if(s!==null&&(i=s.memoCache),i==null){var r=mt.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),s===null&&(s=Il(),mt.updateQueue=s),s.memoCache=i,s=i.data[i.index],s===void 0)for(s=i.data[i.index]=Array(e),r=0;r<e;r++)s[r]=X;return i.index++,s}function zi(e,i){return typeof i=="function"?i(e):i}function Jl(e){var i=It();return pu(i,Bt,e)}function pu(e,i,s){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=s;var h=e.baseQueue,d=r.pending;if(d!==null){if(h!==null){var g=h.next;h.next=d.next,d.next=g}i.baseQueue=h=d,r.pending=null}if(d=e.baseState,h===null)e.memoizedState=d;else{i=h.next;var v=g=null,C=null,k=i,q=!1;do{var F=k.lane&-536870913;if(F!==k.lane?(_t&F)===F:(Ri&F)===F){var H=k.revertLane;if(H===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null}),F===ys&&(q=!0);else if((Ri&H)===H){k=k.next,H===ys&&(q=!0);continue}else F={lane:0,revertLane:k.revertLane,gesture:null,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},C===null?(v=C=F,g=d):C=C.next=F,mt.lanes|=H,un|=H;F=k.action,kn&&s(d,F),d=k.hasEagerState?k.eagerState:s(d,F)}else H={lane:F,revertLane:k.revertLane,gesture:k.gesture,action:k.action,hasEagerState:k.hasEagerState,eagerState:k.eagerState,next:null},C===null?(v=C=H,g=d):C=C.next=H,mt.lanes|=F,un|=F;k=k.next}while(k!==null&&k!==i);if(C===null?g=d:C.next=v,!Ue(d,e.memoizedState)&&(ne=!0,q&&(s=gs,s!==null)))throw s;e.memoizedState=d,e.baseState=g,e.baseQueue=C,r.lastRenderedState=d}return h===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function yu(e){var i=It(),s=i.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=e;var r=s.dispatch,h=s.pending,d=i.memoizedState;if(h!==null){s.pending=null;var g=h=h.next;do d=e(d,g.action),g=g.next;while(g!==h);Ue(d,i.memoizedState)||(ne=!0),i.memoizedState=d,i.baseQueue===null&&(i.baseState=d),s.lastRenderedState=d}return[d,r]}function fd(e,i,s){var r=mt,h=It(),d=Tt;if(d){if(s===void 0)throw Error(a(407));s=s()}else s=i();var g=!Ue((Bt||h).memoizedState,s);if(g&&(h.memoizedState=s,ne=!0),h=h.queue,_u(pd.bind(null,r,h,e),[e]),h.getSnapshot!==i||g||ie!==null&&ie.memoizedState.tag&1){if(r.flags|=2048,Ts(9,{destroy:void 0},md.bind(null,r,h,s,i),null),Nt===null)throw Error(a(349));d||(Ri&127)!==0||dd(r,i,s)}return s}function dd(e,i,s){e.flags|=16384,e={getSnapshot:i,value:s},i=mt.updateQueue,i===null?(i=Il(),mt.updateQueue=i,i.stores=[e]):(s=i.stores,s===null?i.stores=[e]:s.push(e))}function md(e,i,s,r){i.value=s,i.getSnapshot=r,yd(i)&&gd(e)}function pd(e,i,s){return s(function(){yd(i)&&gd(e)})}function yd(e){var i=e.getSnapshot;e=e.value;try{var s=i();return!Ue(e,s)}catch{return!0}}function gd(e){var i=En(e,2);i!==null&&Re(i,e,2)}function gu(e){var i=be();if(typeof e=="function"){var s=e;if(e=s(),kn){Wi(!0);try{s()}finally{Wi(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:e},i}function xd(e,i,s,r){return e.baseState=s,pu(e,Bt,typeof r=="function"?r:zi)}function r_(e,i,s,r,h){if(er(e))throw Error(a(485));if(e=i.action,e!==null){var d={payload:h,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){d.listeners.push(g)}};R.T!==null?s(!0):d.isTransition=!1,r(d),s=i.pending,s===null?(d.next=i.pending=d,_d(i,d)):(d.next=s.next,i.pending=s.next=d)}}function _d(e,i){var s=i.action,r=i.payload,h=e.state;if(i.isTransition){var d=R.T,g={};R.T=g;try{var v=s(h,r),C=R.S;C!==null&&C(g,v),bd(e,i,v)}catch(k){xu(e,i,k)}finally{d!==null&&g.types!==null&&(d.types=g.types),R.T=d}}else try{d=s(h,r),bd(e,i,d)}catch(k){xu(e,i,k)}}function bd(e,i,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(r){vd(e,i,r)},function(r){return xu(e,i,r)}):vd(e,i,s)}function vd(e,i,s){i.status="fulfilled",i.value=s,Sd(i),e.state=s,i=e.pending,i!==null&&(s=i.next,s===i?e.pending=null:(s=s.next,i.next=s,_d(e,s)))}function xu(e,i,s){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=s,Sd(i),i=i.next;while(i!==r)}e.action=null}function Sd(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function Td(e,i){return i}function wd(e,i){if(Tt){var s=Nt.formState;if(s!==null){t:{var r=mt;if(Tt){if(Lt){e:{for(var h=Lt,d=Ke;h.nodeType!==8;){if(!d){h=null;break e}if(h=$e(h.nextSibling),h===null){h=null;break e}}d=h.data,h=d==="F!"||d==="F"?h:null}if(h){Lt=$e(h.nextSibling),r=h.data==="F!";break t}}$i(r)}r=!1}r&&(i=s[0])}}return s=be(),s.memoizedState=s.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Td,lastRenderedState:i},s.queue=r,s=Xd.bind(null,mt,r),r.dispatch=s,r=gu(!1),d=wu.bind(null,mt,!1,r.queue),r=be(),h={state:i,dispatch:null,action:e,pending:null},r.queue=h,s=r_.bind(null,mt,h,d,s),h.dispatch=s,r.memoizedState=e,[i,s,!1]}function Ad(e){var i=It();return Cd(i,Bt,e)}function Cd(e,i,s){if(i=pu(e,i,Td)[0],e=Jl(zi)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=ba(i)}catch(g){throw g===xs?ql:g}else r=i;i=It();var h=i.queue,d=h.dispatch;return s!==i.memoizedState&&(mt.flags|=2048,Ts(9,{destroy:void 0},o_.bind(null,h,s),null)),[r,d,e]}function o_(e,i){e.action=i}function Md(e){var i=It(),s=Bt;if(s!==null)return Cd(i,s,e);It(),i=i.memoizedState,s=It();var r=s.queue.dispatch;return s.memoizedState=e,[i,r,!1]}function Ts(e,i,s,r){return e={tag:e,create:s,deps:r,inst:i,next:null},i=mt.updateQueue,i===null&&(i=Il(),mt.updateQueue=i),s=i.lastEffect,s===null?i.lastEffect=e.next=e:(r=s.next,s.next=e,e.next=r,i.lastEffect=e),e}function Ed(){return It().memoizedState}function $l(e,i,s,r){var h=be();mt.flags|=e,h.memoizedState=Ts(1|i,{destroy:void 0},s,r===void 0?null:r)}function tr(e,i,s,r){var h=It();r=r===void 0?null:r;var d=h.memoizedState.inst;Bt!==null&&r!==null&&uu(r,Bt.memoizedState.deps)?h.memoizedState=Ts(i,d,s,r):(mt.flags|=e,h.memoizedState=Ts(1|i,d,s,r))}function Rd(e,i){$l(8390656,8,e,i)}function _u(e,i){tr(2048,8,e,i)}function u_(e){mt.flags|=4;var i=mt.updateQueue;if(i===null)i=Il(),mt.updateQueue=i,i.events=[e];else{var s=i.events;s===null?i.events=[e]:s.push(e)}}function zd(e){var i=It().memoizedState;return u_({ref:i,nextImpl:e}),function(){if((Rt&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function Dd(e,i){return tr(4,2,e,i)}function Bd(e,i){return tr(4,4,e,i)}function Od(e,i){if(typeof i=="function"){e=e();var s=i(e);return function(){typeof s=="function"?s():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Gd(e,i,s){s=s!=null?s.concat([e]):null,tr(4,4,Od.bind(null,i,e),s)}function bu(){}function Ud(e,i){var s=It();i=i===void 0?null:i;var r=s.memoizedState;return i!==null&&uu(i,r[1])?r[0]:(s.memoizedState=[e,i],e)}function Nd(e,i){var s=It();i=i===void 0?null:i;var r=s.memoizedState;if(i!==null&&uu(i,r[1]))return r[0];if(r=e(),kn){Wi(!0);try{e()}finally{Wi(!1)}}return s.memoizedState=[r,i],r}function vu(e,i,s){return s===void 0||(Ri&1073741824)!==0&&(_t&261930)===0?e.memoizedState=i:(e.memoizedState=s,e=km(),mt.lanes|=e,un|=e,s)}function kd(e,i,s,r){return Ue(s,i)?s:bs.current!==null?(e=vu(e,s,r),Ue(e,i)||(ne=!0),e):(Ri&42)===0||(Ri&1073741824)!==0&&(_t&261930)===0?(ne=!0,e.memoizedState=s):(e=km(),mt.lanes|=e,un|=e,i)}function Hd(e,i,s,r,h){var d=L.p;L.p=d!==0&&8>d?d:8;var g=R.T,v={};R.T=v,wu(e,!1,i,s);try{var C=h(),k=R.S;if(k!==null&&k(v,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var q=s_(C,r);va(e,i,q,Ye(e))}else va(e,i,r,Ye(e))}catch(F){va(e,i,{then:function(){},status:"rejected",reason:F},Ye())}finally{L.p=d,g!==null&&v.types!==null&&(g.types=v.types),R.T=g}}function c_(){}function Su(e,i,s,r){if(e.tag!==5)throw Error(a(476));var h=Ld(e).queue;Hd(e,h,i,nt,s===null?c_:function(){return jd(e),s(r)})}function Ld(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:nt,baseState:nt,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:nt},next:null};var s={};return i.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:zi,lastRenderedState:s},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function jd(e){var i=Ld(e);i.next===null&&(i=e.alternate.memoizedState),va(e,i.next.queue,{},Ye())}function Tu(){return de(Ha)}function Yd(){return It().memoizedState}function qd(){return It().memoizedState}function h_(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var s=Ye();e=nn(s);var r=sn(i,e,s);r!==null&&(Re(r,i,s),ya(r,i,s)),i={cache:Jo()},e.payload=i;return}i=i.return}}function f_(e,i,s){var r=Ye();s={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},er(e)?Vd(i,s):(s=Yo(e,i,s,r),s!==null&&(Re(s,e,r),Pd(s,i,r)))}function Xd(e,i,s){var r=Ye();va(e,i,s,r)}function va(e,i,s,r){var h={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(er(e))Vd(i,h);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=i.lastRenderedReducer,d!==null))try{var g=i.lastRenderedState,v=d(g,s);if(h.hasEagerState=!0,h.eagerState=v,Ue(v,g))return Ul(e,i,h,0),Nt===null&&Gl(),!1}catch{}finally{}if(s=Yo(e,i,h,r),s!==null)return Re(s,e,r),Pd(s,i,r),!0}return!1}function wu(e,i,s,r){if(r={lane:2,revertLane:ic(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},er(e)){if(i)throw Error(a(479))}else i=Yo(e,s,r,2),i!==null&&Re(i,e,2)}function er(e){var i=e.alternate;return e===mt||i!==null&&i===mt}function Vd(e,i){vs=Wl=!0;var s=e.pending;s===null?i.next=i:(i.next=s.next,s.next=i),e.pending=i}function Pd(e,i,s){if((s&4194048)!==0){var r=i.lanes;r&=e.pendingLanes,s|=r,i.lanes=s,Zh(e,s)}}var Sa={readContext:de,use:Kl,useCallback:Xt,useContext:Xt,useEffect:Xt,useImperativeHandle:Xt,useLayoutEffect:Xt,useInsertionEffect:Xt,useMemo:Xt,useReducer:Xt,useRef:Xt,useState:Xt,useDebugValue:Xt,useDeferredValue:Xt,useTransition:Xt,useSyncExternalStore:Xt,useId:Xt,useHostTransitionStatus:Xt,useFormState:Xt,useActionState:Xt,useOptimistic:Xt,useMemoCache:Xt,useCacheRefresh:Xt};Sa.useEffectEvent=Xt;var Fd={readContext:de,use:Kl,useCallback:function(e,i){return be().memoizedState=[e,i===void 0?null:i],e},useContext:de,useEffect:Rd,useImperativeHandle:function(e,i,s){s=s!=null?s.concat([e]):null,$l(4194308,4,Od.bind(null,i,e),s)},useLayoutEffect:function(e,i){return $l(4194308,4,e,i)},useInsertionEffect:function(e,i){$l(4,2,e,i)},useMemo:function(e,i){var s=be();i=i===void 0?null:i;var r=e();if(kn){Wi(!0);try{e()}finally{Wi(!1)}}return s.memoizedState=[r,i],r},useReducer:function(e,i,s){var r=be();if(s!==void 0){var h=s(i);if(kn){Wi(!0);try{s(i)}finally{Wi(!1)}}}else h=i;return r.memoizedState=r.baseState=h,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:h},r.queue=e,e=e.dispatch=f_.bind(null,mt,e),[r.memoizedState,e]},useRef:function(e){var i=be();return e={current:e},i.memoizedState=e},useState:function(e){e=gu(e);var i=e.queue,s=Xd.bind(null,mt,i);return i.dispatch=s,[e.memoizedState,s]},useDebugValue:bu,useDeferredValue:function(e,i){var s=be();return vu(s,e,i)},useTransition:function(){var e=gu(!1);return e=Hd.bind(null,mt,e.queue,!0,!1),be().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,s){var r=mt,h=be();if(Tt){if(s===void 0)throw Error(a(407));s=s()}else{if(s=i(),Nt===null)throw Error(a(349));(_t&127)!==0||dd(r,i,s)}h.memoizedState=s;var d={value:s,getSnapshot:i};return h.queue=d,Rd(pd.bind(null,r,d,e),[e]),r.flags|=2048,Ts(9,{destroy:void 0},md.bind(null,r,d,s,i),null),s},useId:function(){var e=be(),i=Nt.identifierPrefix;if(Tt){var s=yi,r=pi;s=(r&~(1<<32-Ge(r)-1)).toString(32)+s,i="_"+i+"R_"+s,s=Zl++,0<s&&(i+="H"+s.toString(32)),i+="_"}else s=a_++,i="_"+i+"r_"+s.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Tu,useFormState:wd,useActionState:wd,useOptimistic:function(e){var i=be();i.memoizedState=i.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=s,i=wu.bind(null,mt,!0,s),s.dispatch=i,[e,i]},useMemoCache:mu,useCacheRefresh:function(){return be().memoizedState=h_.bind(null,mt)},useEffectEvent:function(e){var i=be(),s={impl:e};return i.memoizedState=s,function(){if((Rt&2)!==0)throw Error(a(440));return s.impl.apply(void 0,arguments)}}},Au={readContext:de,use:Kl,useCallback:Ud,useContext:de,useEffect:_u,useImperativeHandle:Gd,useInsertionEffect:Dd,useLayoutEffect:Bd,useMemo:Nd,useReducer:Jl,useRef:Ed,useState:function(){return Jl(zi)},useDebugValue:bu,useDeferredValue:function(e,i){var s=It();return kd(s,Bt.memoizedState,e,i)},useTransition:function(){var e=Jl(zi)[0],i=It().memoizedState;return[typeof e=="boolean"?e:ba(e),i]},useSyncExternalStore:fd,useId:Yd,useHostTransitionStatus:Tu,useFormState:Ad,useActionState:Ad,useOptimistic:function(e,i){var s=It();return xd(s,Bt,e,i)},useMemoCache:mu,useCacheRefresh:qd};Au.useEffectEvent=zd;var Qd={readContext:de,use:Kl,useCallback:Ud,useContext:de,useEffect:_u,useImperativeHandle:Gd,useInsertionEffect:Dd,useLayoutEffect:Bd,useMemo:Nd,useReducer:yu,useRef:Ed,useState:function(){return yu(zi)},useDebugValue:bu,useDeferredValue:function(e,i){var s=It();return Bt===null?vu(s,e,i):kd(s,Bt.memoizedState,e,i)},useTransition:function(){var e=yu(zi)[0],i=It().memoizedState;return[typeof e=="boolean"?e:ba(e),i]},useSyncExternalStore:fd,useId:Yd,useHostTransitionStatus:Tu,useFormState:Md,useActionState:Md,useOptimistic:function(e,i){var s=It();return Bt!==null?xd(s,Bt,e,i):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:mu,useCacheRefresh:qd};Qd.useEffectEvent=zd;function Cu(e,i,s,r){i=e.memoizedState,s=s(r,i),s=s==null?i:x({},i,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Mu={enqueueSetState:function(e,i,s){e=e._reactInternals;var r=Ye(),h=nn(r);h.payload=i,s!=null&&(h.callback=s),i=sn(e,h,r),i!==null&&(Re(i,e,r),ya(i,e,r))},enqueueReplaceState:function(e,i,s){e=e._reactInternals;var r=Ye(),h=nn(r);h.tag=1,h.payload=i,s!=null&&(h.callback=s),i=sn(e,h,r),i!==null&&(Re(i,e,r),ya(i,e,r))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var s=Ye(),r=nn(s);r.tag=2,i!=null&&(r.callback=i),i=sn(e,r,s),i!==null&&(Re(i,e,s),ya(i,e,s))}};function Wd(e,i,s,r,h,d,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,g):i.prototype&&i.prototype.isPureReactComponent?!oa(s,r)||!oa(h,d):!0}function Zd(e,i,s,r){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(s,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(s,r),i.state!==e&&Mu.enqueueReplaceState(i,i.state,null)}function Hn(e,i){var s=i;if("ref"in i){s={};for(var r in i)r!=="ref"&&(s[r]=i[r])}if(e=e.defaultProps){s===i&&(s=x({},s));for(var h in e)s[h]===void 0&&(s[h]=e[h])}return s}function Id(e){Ol(e)}function Kd(e){console.error(e)}function Jd(e){Ol(e)}function ir(e,i){try{var s=e.onUncaughtError;s(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function $d(e,i,s){try{var r=e.onCaughtError;r(s.value,{componentStack:s.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Eu(e,i,s){return s=nn(s),s.tag=3,s.payload={element:null},s.callback=function(){ir(e,i)},s}function tm(e){return e=nn(e),e.tag=3,e}function em(e,i,s,r){var h=s.type.getDerivedStateFromError;if(typeof h=="function"){var d=r.value;e.payload=function(){return h(d)},e.callback=function(){$d(i,s,r)}}var g=s.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){$d(i,s,r),typeof h!="function"&&(cn===null?cn=new Set([this]):cn.add(this));var v=r.stack;this.componentDidCatch(r.value,{componentStack:v!==null?v:""})})}function d_(e,i,s,r,h){if(s.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=s.alternate,i!==null&&ps(i,s,h,!0),s=ke.current,s!==null){switch(s.tag){case 31:case 13:return Je===null?mr():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=h,r===Xl?s.flags|=16384:(i=s.updateQueue,i===null?s.updateQueue=new Set([r]):i.add(r),$u(e,r,h)),!1;case 22:return s.flags|=65536,r===Xl?s.flags|=16384:(i=s.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},s.updateQueue=i):(s=i.retryQueue,s===null?i.retryQueue=new Set([r]):s.add(r)),$u(e,r,h)),!1}throw Error(a(435,s.tag))}return $u(e,r,h),mr(),!1}if(Tt)return i=ke.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,r!==Qo&&(e=Error(a(422),{cause:r}),ha(We(e,s)))):(r!==Qo&&(i=Error(a(423),{cause:r}),ha(We(i,s))),e=e.current.alternate,e.flags|=65536,h&=-h,e.lanes|=h,r=We(r,s),h=Eu(e.stateNode,r,h),su(e,h),Vt!==4&&(Vt=2)),!1;var d=Error(a(520),{cause:r});if(d=We(d,s),za===null?za=[d]:za.push(d),Vt!==4&&(Vt=2),i===null)return!0;r=We(r,s),s=i;do{switch(s.tag){case 3:return s.flags|=65536,e=h&-h,s.lanes|=e,e=Eu(s.stateNode,r,e),su(s,e),!1;case 1:if(i=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(cn===null||!cn.has(d))))return s.flags|=65536,h&=-h,s.lanes|=h,h=tm(h),em(h,e,s,r),su(s,h),!1}s=s.return}while(s!==null);return!1}var Ru=Error(a(461)),ne=!1;function me(e,i,s,r){i.child=e===null?ad(i,null,s,r):Nn(i,e.child,s,r)}function im(e,i,s,r,h){s=s.render;var d=i.ref;if("ref"in r){var g={};for(var v in r)v!=="ref"&&(g[v]=r[v])}else g=r;return Bn(i),r=cu(e,i,s,g,d,h),v=hu(),e!==null&&!ne?(fu(e,i,h),Di(e,i,h)):(Tt&&v&&Po(i),i.flags|=1,me(e,i,r,h),i.child)}function nm(e,i,s,r,h){if(e===null){var d=s.type;return typeof d=="function"&&!qo(d)&&d.defaultProps===void 0&&s.compare===null?(i.tag=15,i.type=d,sm(e,i,d,r,h)):(e=kl(s.type,null,r,i,i.mode,h),e.ref=i.ref,e.return=i,i.child=e)}if(d=e.child,!ku(e,h)){var g=d.memoizedProps;if(s=s.compare,s=s!==null?s:oa,s(g,r)&&e.ref===i.ref)return Di(e,i,h)}return i.flags|=1,e=Ai(d,r),e.ref=i.ref,e.return=i,i.child=e}function sm(e,i,s,r,h){if(e!==null){var d=e.memoizedProps;if(oa(d,r)&&e.ref===i.ref)if(ne=!1,i.pendingProps=r=d,ku(e,h))(e.flags&131072)!==0&&(ne=!0);else return i.lanes=e.lanes,Di(e,i,h)}return zu(e,i,s,r,h)}function am(e,i,s,r){var h=r.children,d=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(r=i.child=e.child,h=0;r!==null;)h=h|r.lanes|r.childLanes,r=r.sibling;r=h&~d}else r=0,i.child=null;return lm(e,i,d,s,r)}if((s&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Yl(i,d!==null?d.cachePool:null),d!==null?od(i,d):lu(),ud(i);else return r=i.lanes=536870912,lm(e,i,d!==null?d.baseLanes|s:s,s,r)}else d!==null?(Yl(i,d.cachePool),od(i,d),ln(),i.memoizedState=null):(e!==null&&Yl(i,null),lu(),ln());return me(e,i,h,s),i.child}function Ta(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function lm(e,i,s,r,h){var d=tu();return d=d===null?null:{parent:ee._currentValue,pool:d},i.memoizedState={baseLanes:s,cachePool:d},e!==null&&Yl(i,null),lu(),ud(i),e!==null&&ps(e,i,r,!0),i.childLanes=h,null}function nr(e,i){return i=ar({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function rm(e,i,s){return Nn(i,e.child,null,s),e=nr(i,i.pendingProps),e.flags|=2,He(i),i.memoizedState=null,e}function m_(e,i,s){var r=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(Tt){if(r.mode==="hidden")return e=nr(i,r),i.lanes=536870912,Ta(null,e);if(ou(i),(e=Lt)?(e=_p(e,Ke),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:pi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},s=Vf(e),s.return=i,i.child=s,fe=i,Lt=null)):e=null,e===null)throw $i(i);return i.lanes=536870912,null}return nr(i,r)}var d=e.memoizedState;if(d!==null){var g=d.dehydrated;if(ou(i),h)if(i.flags&256)i.flags&=-257,i=rm(e,i,s);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(a(558));else if(ne||ps(e,i,s,!1),h=(s&e.childLanes)!==0,ne||h){if(r=Nt,r!==null&&(g=Ih(r,s),g!==0&&g!==d.retryLane))throw d.retryLane=g,En(e,g),Re(r,e,g),Ru;mr(),i=rm(e,i,s)}else e=d.treeContext,Lt=$e(g.nextSibling),fe=i,Tt=!0,Ji=null,Ke=!1,e!==null&&Qf(i,e),i=nr(i,r),i.flags|=4096;return i}return e=Ai(e.child,{mode:r.mode,children:r.children}),e.ref=i.ref,i.child=e,e.return=i,e}function sr(e,i){var s=i.ref;if(s===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(a(284));(e===null||e.ref!==s)&&(i.flags|=4194816)}}function zu(e,i,s,r,h){return Bn(i),s=cu(e,i,s,r,void 0,h),r=hu(),e!==null&&!ne?(fu(e,i,h),Di(e,i,h)):(Tt&&r&&Po(i),i.flags|=1,me(e,i,s,h),i.child)}function om(e,i,s,r,h,d){return Bn(i),i.updateQueue=null,s=hd(i,r,s,h),cd(e),r=hu(),e!==null&&!ne?(fu(e,i,d),Di(e,i,d)):(Tt&&r&&Po(i),i.flags|=1,me(e,i,s,d),i.child)}function um(e,i,s,r,h){if(Bn(i),i.stateNode===null){var d=hs,g=s.contextType;typeof g=="object"&&g!==null&&(d=de(g)),d=new s(r,d),i.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Mu,i.stateNode=d,d._reactInternals=i,d=i.stateNode,d.props=r,d.state=i.memoizedState,d.refs={},iu(i),g=s.contextType,d.context=typeof g=="object"&&g!==null?de(g):hs,d.state=i.memoizedState,g=s.getDerivedStateFromProps,typeof g=="function"&&(Cu(i,s,g,r),d.state=i.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(g=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),g!==d.state&&Mu.enqueueReplaceState(d,d.state,null),xa(i,r,d,h),ga(),d.state=i.memoizedState),typeof d.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(e===null){d=i.stateNode;var v=i.memoizedProps,C=Hn(s,v);d.props=C;var k=d.context,q=s.contextType;g=hs,typeof q=="object"&&q!==null&&(g=de(q));var F=s.getDerivedStateFromProps;q=typeof F=="function"||typeof d.getSnapshotBeforeUpdate=="function",v=i.pendingProps!==v,q||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(v||k!==g)&&Zd(i,d,r,g),en=!1;var H=i.memoizedState;d.state=H,xa(i,r,d,h),ga(),k=i.memoizedState,v||H!==k||en?(typeof F=="function"&&(Cu(i,s,F,r),k=i.memoizedState),(C=en||Wd(i,s,C,r,H,k,g))?(q||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(i.flags|=4194308)):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=k),d.props=r,d.state=k,d.context=g,r=C):(typeof d.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{d=i.stateNode,nu(e,i),g=i.memoizedProps,q=Hn(s,g),d.props=q,F=i.pendingProps,H=d.context,k=s.contextType,C=hs,typeof k=="object"&&k!==null&&(C=de(k)),v=s.getDerivedStateFromProps,(k=typeof v=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(g!==F||H!==C)&&Zd(i,d,r,C),en=!1,H=i.memoizedState,d.state=H,xa(i,r,d,h),ga();var j=i.memoizedState;g!==F||H!==j||en||e!==null&&e.dependencies!==null&&Ll(e.dependencies)?(typeof v=="function"&&(Cu(i,s,v,r),j=i.memoizedState),(q=en||Wd(i,s,q,r,H,j,C)||e!==null&&e.dependencies!==null&&Ll(e.dependencies))?(k||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,j,C),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,j,C)),typeof d.componentDidUpdate=="function"&&(i.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=j),d.props=r,d.state=j,d.context=C,r=q):(typeof d.componentDidUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(i.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&H===e.memoizedState||(i.flags|=1024),r=!1)}return d=r,sr(e,i),r=(i.flags&128)!==0,d||r?(d=i.stateNode,s=r&&typeof s.getDerivedStateFromError!="function"?null:d.render(),i.flags|=1,e!==null&&r?(i.child=Nn(i,e.child,null,h),i.child=Nn(i,null,s,h)):me(e,i,s,h),i.memoizedState=d.state,e=i.child):e=Di(e,i,h),e}function cm(e,i,s,r){return zn(),i.flags|=256,me(e,i,s,r),i.child}var Du={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Bu(e){return{baseLanes:e,cachePool:$f()}}function Ou(e,i,s){return e=e!==null?e.childLanes&~s:0,i&&(e|=je),e}function hm(e,i,s){var r=i.pendingProps,h=!1,d=(i.flags&128)!==0,g;if((g=d)||(g=e!==null&&e.memoizedState===null?!1:(Zt.current&2)!==0),g&&(h=!0,i.flags&=-129),g=(i.flags&32)!==0,i.flags&=-33,e===null){if(Tt){if(h?an(i):ln(),(e=Lt)?(e=_p(e,Ke),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:Ki!==null?{id:pi,overflow:yi}:null,retryLane:536870912,hydrationErrors:null},s=Vf(e),s.return=i,i.child=s,fe=i,Lt=null)):e=null,e===null)throw $i(i);return pc(e)?i.lanes=32:i.lanes=536870912,null}var v=r.children;return r=r.fallback,h?(ln(),h=i.mode,v=ar({mode:"hidden",children:v},h),r=Rn(r,h,s,null),v.return=i,r.return=i,v.sibling=r,i.child=v,r=i.child,r.memoizedState=Bu(s),r.childLanes=Ou(e,g,s),i.memoizedState=Du,Ta(null,r)):(an(i),Gu(i,v))}var C=e.memoizedState;if(C!==null&&(v=C.dehydrated,v!==null)){if(d)i.flags&256?(an(i),i.flags&=-257,i=Uu(e,i,s)):i.memoizedState!==null?(ln(),i.child=e.child,i.flags|=128,i=null):(ln(),v=r.fallback,h=i.mode,r=ar({mode:"visible",children:r.children},h),v=Rn(v,h,s,null),v.flags|=2,r.return=i,v.return=i,r.sibling=v,i.child=r,Nn(i,e.child,null,s),r=i.child,r.memoizedState=Bu(s),r.childLanes=Ou(e,g,s),i.memoizedState=Du,i=Ta(null,r));else if(an(i),pc(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var k=g.dgst;g=k,r=Error(a(419)),r.stack="",r.digest=g,ha({value:r,source:null,stack:null}),i=Uu(e,i,s)}else if(ne||ps(e,i,s,!1),g=(s&e.childLanes)!==0,ne||g){if(g=Nt,g!==null&&(r=Ih(g,s),r!==0&&r!==C.retryLane))throw C.retryLane=r,En(e,r),Re(g,e,r),Ru;mc(v)||mr(),i=Uu(e,i,s)}else mc(v)?(i.flags|=192,i.child=e.child,i=null):(e=C.treeContext,Lt=$e(v.nextSibling),fe=i,Tt=!0,Ji=null,Ke=!1,e!==null&&Qf(i,e),i=Gu(i,r.children),i.flags|=4096);return i}return h?(ln(),v=r.fallback,h=i.mode,C=e.child,k=C.sibling,r=Ai(C,{mode:"hidden",children:r.children}),r.subtreeFlags=C.subtreeFlags&65011712,k!==null?v=Ai(k,v):(v=Rn(v,h,s,null),v.flags|=2),v.return=i,r.return=i,r.sibling=v,i.child=r,Ta(null,r),r=i.child,v=e.child.memoizedState,v===null?v=Bu(s):(h=v.cachePool,h!==null?(C=ee._currentValue,h=h.parent!==C?{parent:C,pool:C}:h):h=$f(),v={baseLanes:v.baseLanes|s,cachePool:h}),r.memoizedState=v,r.childLanes=Ou(e,g,s),i.memoizedState=Du,Ta(e.child,r)):(an(i),s=e.child,e=s.sibling,s=Ai(s,{mode:"visible",children:r.children}),s.return=i,s.sibling=null,e!==null&&(g=i.deletions,g===null?(i.deletions=[e],i.flags|=16):g.push(e)),i.child=s,i.memoizedState=null,s)}function Gu(e,i){return i=ar({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function ar(e,i){return e=Ne(22,e,null,i),e.lanes=0,e}function Uu(e,i,s){return Nn(i,e.child,null,s),e=Gu(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function fm(e,i,s){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i),Io(e.return,i,s)}function Nu(e,i,s,r,h,d){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:s,tailMode:h,treeForkCount:d}:(g.isBackwards=i,g.rendering=null,g.renderingStartTime=0,g.last=r,g.tail=s,g.tailMode=h,g.treeForkCount=d)}function dm(e,i,s){var r=i.pendingProps,h=r.revealOrder,d=r.tail;r=r.children;var g=Zt.current,v=(g&2)!==0;if(v?(g=g&1|2,i.flags|=128):g&=1,Q(Zt,g),me(e,i,r,s),r=Tt?ca:0,!v&&e!==null&&(e.flags&128)!==0)t:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fm(e,s,i);else if(e.tag===19)fm(e,s,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(h){case"forwards":for(s=i.child,h=null;s!==null;)e=s.alternate,e!==null&&Ql(e)===null&&(h=s),s=s.sibling;s=h,s===null?(h=i.child,i.child=null):(h=s.sibling,s.sibling=null),Nu(i,!1,h,s,d,r);break;case"backwards":case"unstable_legacy-backwards":for(s=null,h=i.child,i.child=null;h!==null;){if(e=h.alternate,e!==null&&Ql(e)===null){i.child=h;break}e=h.sibling,h.sibling=s,s=h,h=e}Nu(i,!0,s,null,d,r);break;case"together":Nu(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function Di(e,i,s){if(e!==null&&(i.dependencies=e.dependencies),un|=i.lanes,(s&i.childLanes)===0)if(e!==null){if(ps(e,i,s,!1),(s&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(a(153));if(i.child!==null){for(e=i.child,s=Ai(e,e.pendingProps),i.child=s,s.return=i;e.sibling!==null;)e=e.sibling,s=s.sibling=Ai(e,e.pendingProps),s.return=i;s.sibling=null}return i.child}function ku(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&Ll(e)))}function p_(e,i,s){switch(i.tag){case 3:Ht(i,i.stateNode.containerInfo),tn(i,ee,e.memoizedState.cache),zn();break;case 27:case 5:Ve(i);break;case 4:Ht(i,i.stateNode.containerInfo);break;case 10:tn(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ou(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(an(i),i.flags|=128,null):(s&i.child.childLanes)!==0?hm(e,i,s):(an(i),e=Di(e,i,s),e!==null?e.sibling:null);an(i);break;case 19:var h=(e.flags&128)!==0;if(r=(s&i.childLanes)!==0,r||(ps(e,i,s,!1),r=(s&i.childLanes)!==0),h){if(r)return dm(e,i,s);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Q(Zt,Zt.current),r)break;return null;case 22:return i.lanes=0,am(e,i,s,i.pendingProps);case 24:tn(i,ee,e.memoizedState.cache)}return Di(e,i,s)}function mm(e,i,s){if(e!==null)if(e.memoizedProps!==i.pendingProps)ne=!0;else{if(!ku(e,s)&&(i.flags&128)===0)return ne=!1,p_(e,i,s);ne=(e.flags&131072)!==0}else ne=!1,Tt&&(i.flags&1048576)!==0&&Ff(i,ca,i.index);switch(i.lanes=0,i.tag){case 16:t:{var r=i.pendingProps;if(e=Gn(i.elementType),i.type=e,typeof e=="function")qo(e)?(r=Hn(e,r),i.tag=1,i=um(null,i,e,r,s)):(i.tag=0,i=zu(null,i,e,r,s));else{if(e!=null){var h=e.$$typeof;if(h===G){i.tag=11,i=im(null,i,e,r,s);break t}else if(h===O){i.tag=14,i=nm(null,i,e,r,s);break t}}throw i=it(e)||e,Error(a(306,i,""))}}return i;case 0:return zu(e,i,i.type,i.pendingProps,s);case 1:return r=i.type,h=Hn(r,i.pendingProps),um(e,i,r,h,s);case 3:t:{if(Ht(i,i.stateNode.containerInfo),e===null)throw Error(a(387));r=i.pendingProps;var d=i.memoizedState;h=d.element,nu(e,i),xa(i,r,null,s);var g=i.memoizedState;if(r=g.cache,tn(i,ee,r),r!==d.cache&&Ko(i,[ee],s,!0),ga(),r=g.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:g.cache},i.updateQueue.baseState=d,i.memoizedState=d,i.flags&256){i=cm(e,i,r,s);break t}else if(r!==h){h=We(Error(a(424)),i),ha(h),i=cm(e,i,r,s);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(Lt=$e(e.firstChild),fe=i,Tt=!0,Ji=null,Ke=!0,s=ad(i,null,r,s),i.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(zn(),r===h){i=Di(e,i,s);break t}me(e,i,r,s)}i=i.child}return i;case 26:return sr(e,i),e===null?(s=Ap(i.type,null,i.pendingProps,null))?i.memoizedState=s:Tt||(s=i.type,e=i.pendingProps,r=vr(ct.current).createElement(s),r[he]=i,r[Te]=e,pe(r,s,e),oe(r),i.stateNode=r):i.memoizedState=Ap(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return Ve(i),e===null&&Tt&&(r=i.stateNode=Sp(i.type,i.pendingProps,ct.current),fe=i,Ke=!0,h=Lt,mn(i.type)?(yc=h,Lt=$e(r.firstChild)):Lt=h),me(e,i,i.pendingProps.children,s),sr(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&Tt&&((h=r=Lt)&&(r=P_(r,i.type,i.pendingProps,Ke),r!==null?(i.stateNode=r,fe=i,Lt=$e(r.firstChild),Ke=!1,h=!0):h=!1),h||$i(i)),Ve(i),h=i.type,d=i.pendingProps,g=e!==null?e.memoizedProps:null,r=d.children,hc(h,d)?r=null:g!==null&&hc(h,g)&&(i.flags|=32),i.memoizedState!==null&&(h=cu(e,i,l_,null,null,s),Ha._currentValue=h),sr(e,i),me(e,i,r,s),i.child;case 6:return e===null&&Tt&&((e=s=Lt)&&(s=F_(s,i.pendingProps,Ke),s!==null?(i.stateNode=s,fe=i,Lt=null,e=!0):e=!1),e||$i(i)),null;case 13:return hm(e,i,s);case 4:return Ht(i,i.stateNode.containerInfo),r=i.pendingProps,e===null?i.child=Nn(i,null,r,s):me(e,i,r,s),i.child;case 11:return im(e,i,i.type,i.pendingProps,s);case 7:return me(e,i,i.pendingProps,s),i.child;case 8:return me(e,i,i.pendingProps.children,s),i.child;case 12:return me(e,i,i.pendingProps.children,s),i.child;case 10:return r=i.pendingProps,tn(i,i.type,r.value),me(e,i,r.children,s),i.child;case 9:return h=i.type._context,r=i.pendingProps.children,Bn(i),h=de(h),r=r(h),i.flags|=1,me(e,i,r,s),i.child;case 14:return nm(e,i,i.type,i.pendingProps,s);case 15:return sm(e,i,i.type,i.pendingProps,s);case 19:return dm(e,i,s);case 31:return m_(e,i,s);case 22:return am(e,i,s,i.pendingProps);case 24:return Bn(i),r=de(ee),e===null?(h=tu(),h===null&&(h=Nt,d=Jo(),h.pooledCache=d,d.refCount++,d!==null&&(h.pooledCacheLanes|=s),h=d),i.memoizedState={parent:r,cache:h},iu(i),tn(i,ee,h)):((e.lanes&s)!==0&&(nu(e,i),xa(i,null,null,s),ga()),h=e.memoizedState,d=i.memoizedState,h.parent!==r?(h={parent:r,cache:r},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),tn(i,ee,r)):(r=d.cache,tn(i,ee,r),r!==h.cache&&Ko(i,[ee],s,!0))),me(e,i,i.pendingProps.children,s),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function Bi(e){e.flags|=4}function Hu(e,i,s,r,h){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(h&335544128)===h)if(e.stateNode.complete)e.flags|=8192;else if(Ym())e.flags|=8192;else throw Un=Xl,eu}else e.flags&=-16777217}function pm(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!zp(i))if(Ym())e.flags|=8192;else throw Un=Xl,eu}function lr(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?Qh():536870912,e.lanes|=i,Ms|=i)}function wa(e,i){if(!Tt)switch(e.tailMode){case"hidden":i=e.tail;for(var s=null;i!==null;)i.alternate!==null&&(s=i),i=i.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function jt(e){var i=e.alternate!==null&&e.alternate.child===e.child,s=0,r=0;if(i)for(var h=e.child;h!==null;)s|=h.lanes|h.childLanes,r|=h.subtreeFlags&65011712,r|=h.flags&65011712,h.return=e,h=h.sibling;else for(h=e.child;h!==null;)s|=h.lanes|h.childLanes,r|=h.subtreeFlags,r|=h.flags,h.return=e,h=h.sibling;return e.subtreeFlags|=r,e.childLanes=s,i}function y_(e,i,s){var r=i.pendingProps;switch(Fo(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(i),null;case 1:return jt(i),null;case 3:return s=i.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),Ei(ee),Et(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(ms(i)?Bi(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wo())),jt(i),null;case 26:var h=i.type,d=i.memoizedState;return e===null?(Bi(i),d!==null?(jt(i),pm(i,d)):(jt(i),Hu(i,h,null,r,s))):d?d!==e.memoizedState?(Bi(i),jt(i),pm(i,d)):(jt(i),i.flags&=-16777217):(e=e.memoizedProps,e!==r&&Bi(i),jt(i),Hu(i,h,e,r,s)),null;case 27:if(Qi(i),s=ct.current,h=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return jt(i),null}e=$.current,ms(i)?Wf(i):(e=Sp(h,r,s),i.stateNode=e,Bi(i))}return jt(i),null;case 5:if(Qi(i),h=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return jt(i),null}if(d=$.current,ms(i))Wf(i);else{var g=vr(ct.current);switch(d){case 1:d=g.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:d=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":d=g.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":d=g.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":d=g.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?g.createElement("select",{is:r.is}):g.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?g.createElement(h,{is:r.is}):g.createElement(h)}}d[he]=i,d[Te]=r;t:for(g=i.child;g!==null;){if(g.tag===5||g.tag===6)d.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===i)break t;for(;g.sibling===null;){if(g.return===null||g.return===i)break t;g=g.return}g.sibling.return=g.return,g=g.sibling}i.stateNode=d;t:switch(pe(d,h,r),h){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break t;case"img":r=!0;break t;default:r=!1}r&&Bi(i)}}return jt(i),Hu(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,s),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==r&&Bi(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(e=ct.current,ms(i)){if(e=i.stateNode,s=i.memoizedProps,r=null,h=fe,h!==null)switch(h.tag){case 27:case 5:r=h.memoizedProps}e[he]=i,e=!!(e.nodeValue===s||r!==null&&r.suppressHydrationWarning===!0||hp(e.nodeValue,s)),e||$i(i,!0)}else e=vr(e).createTextNode(r),e[he]=i,i.stateNode=e}return jt(i),null;case 31:if(s=i.memoizedState,e===null||e.memoizedState!==null){if(r=ms(i),s!==null){if(e===null){if(!r)throw Error(a(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[he]=i}else zn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),e=!1}else s=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return i.flags&256?(He(i),i):(He(i),null);if((i.flags&128)!==0)throw Error(a(558))}return jt(i),null;case 13:if(r=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(h=ms(i),r!==null&&r.dehydrated!==null){if(e===null){if(!h)throw Error(a(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(a(317));h[he]=i}else zn(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;jt(i),h=!1}else h=Wo(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(He(i),i):(He(i),null)}return He(i),(i.flags&128)!==0?(i.lanes=s,i):(s=r!==null,e=e!==null&&e.memoizedState!==null,s&&(r=i.child,h=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(h=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==h&&(r.flags|=2048)),s!==e&&s&&(i.child.flags|=8192),lr(i,i.updateQueue),jt(i),null);case 4:return Et(),e===null&&lc(i.stateNode.containerInfo),jt(i),null;case 10:return Ei(i.type),jt(i),null;case 19:if(Y(Zt),r=i.memoizedState,r===null)return jt(i),null;if(h=(i.flags&128)!==0,d=r.rendering,d===null)if(h)wa(r,!1);else{if(Vt!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(d=Ql(e),d!==null){for(i.flags|=128,wa(r,!1),e=d.updateQueue,i.updateQueue=e,lr(i,e),i.subtreeFlags=0,e=s,s=i.child;s!==null;)Xf(s,e),s=s.sibling;return Q(Zt,Zt.current&1|2),Tt&&Ci(i,r.treeForkCount),i.child}e=e.sibling}r.tail!==null&&Be()>hr&&(i.flags|=128,h=!0,wa(r,!1),i.lanes=4194304)}else{if(!h)if(e=Ql(d),e!==null){if(i.flags|=128,h=!0,e=e.updateQueue,i.updateQueue=e,lr(i,e),wa(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!Tt)return jt(i),null}else 2*Be()-r.renderingStartTime>hr&&s!==536870912&&(i.flags|=128,h=!0,wa(r,!1),i.lanes=4194304);r.isBackwards?(d.sibling=i.child,i.child=d):(e=r.last,e!==null?e.sibling=d:i.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Be(),e.sibling=null,s=Zt.current,Q(Zt,h?s&1|2:s&1),Tt&&Ci(i,r.treeForkCount),e):(jt(i),null);case 22:case 23:return He(i),ru(),r=i.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(s&536870912)!==0&&(i.flags&128)===0&&(jt(i),i.subtreeFlags&6&&(i.flags|=8192)):jt(i),s=i.updateQueue,s!==null&&lr(i,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==s&&(i.flags|=2048),e!==null&&Y(On),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),i.memoizedState.cache!==s&&(i.flags|=2048),Ei(ee),jt(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function g_(e,i){switch(Fo(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return Ei(ee),Et(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return Qi(i),null;case 31:if(i.memoizedState!==null){if(He(i),i.alternate===null)throw Error(a(340));zn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(He(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(a(340));zn()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return Y(Zt),null;case 4:return Et(),null;case 10:return Ei(i.type),null;case 22:case 23:return He(i),ru(),e!==null&&Y(On),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return Ei(ee),null;case 25:return null;default:return null}}function ym(e,i){switch(Fo(i),i.tag){case 3:Ei(ee),Et();break;case 26:case 27:case 5:Qi(i);break;case 4:Et();break;case 31:i.memoizedState!==null&&He(i);break;case 13:He(i);break;case 19:Y(Zt);break;case 10:Ei(i.type);break;case 22:case 23:He(i),ru(),e!==null&&Y(On);break;case 24:Ei(ee)}}function Aa(e,i){try{var s=i.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var h=r.next;s=h;do{if((s.tag&e)===e){r=void 0;var d=s.create,g=s.inst;r=d(),g.destroy=r}s=s.next}while(s!==h)}}catch(v){Dt(i,i.return,v)}}function rn(e,i,s){try{var r=i.updateQueue,h=r!==null?r.lastEffect:null;if(h!==null){var d=h.next;r=d;do{if((r.tag&e)===e){var g=r.inst,v=g.destroy;if(v!==void 0){g.destroy=void 0,h=i;var C=s,k=v;try{k()}catch(q){Dt(h,C,q)}}}r=r.next}while(r!==d)}}catch(q){Dt(i,i.return,q)}}function gm(e){var i=e.updateQueue;if(i!==null){var s=e.stateNode;try{rd(i,s)}catch(r){Dt(e,e.return,r)}}}function xm(e,i,s){s.props=Hn(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(r){Dt(e,i,r)}}function Ca(e,i){try{var s=e.ref;if(s!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof s=="function"?e.refCleanup=s(r):s.current=r}}catch(h){Dt(e,i,h)}}function gi(e,i){var s=e.ref,r=e.refCleanup;if(s!==null)if(typeof r=="function")try{r()}catch(h){Dt(e,i,h)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(h){Dt(e,i,h)}else s.current=null}function _m(e){var i=e.type,s=e.memoizedProps,r=e.stateNode;try{t:switch(i){case"button":case"input":case"select":case"textarea":s.autoFocus&&r.focus();break t;case"img":s.src?r.src=s.src:s.srcSet&&(r.srcset=s.srcSet)}}catch(h){Dt(e,e.return,h)}}function Lu(e,i,s){try{var r=e.stateNode;L_(r,e.type,s,i),r[Te]=i}catch(h){Dt(e,e.return,h)}}function bm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&mn(e.type)||e.tag===4}function ju(e){t:for(;;){for(;e.sibling===null;){if(e.return===null||bm(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&&mn(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 Yu(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,i):(i=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,i.appendChild(e),s=s._reactRootContainer,s!=null||i.onclick!==null||(i.onclick=Ti));else if(r!==4&&(r===27&&mn(e.type)&&(s=e.stateNode,i=null),e=e.child,e!==null))for(Yu(e,i,s),e=e.sibling;e!==null;)Yu(e,i,s),e=e.sibling}function rr(e,i,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?s.insertBefore(e,i):s.appendChild(e);else if(r!==4&&(r===27&&mn(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(rr(e,i,s),e=e.sibling;e!==null;)rr(e,i,s),e=e.sibling}function vm(e){var i=e.stateNode,s=e.memoizedProps;try{for(var r=e.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);pe(i,r,s),i[he]=e,i[Te]=s}catch(d){Dt(e,e.return,d)}}var Oi=!1,se=!1,qu=!1,Sm=typeof WeakSet=="function"?WeakSet:Set,ue=null;function x_(e,i){if(e=e.containerInfo,uc=Er,e=Gf(e),Uo(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else t:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var h=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break t}var g=0,v=-1,C=-1,k=0,q=0,F=e,H=null;e:for(;;){for(var j;F!==s||h!==0&&F.nodeType!==3||(v=g+h),F!==d||r!==0&&F.nodeType!==3||(C=g+r),F.nodeType===3&&(g+=F.nodeValue.length),(j=F.firstChild)!==null;)H=F,F=j;for(;;){if(F===e)break e;if(H===s&&++k===h&&(v=g),H===d&&++q===r&&(C=g),(j=F.nextSibling)!==null)break;F=H,H=F.parentNode}F=j}s=v===-1||C===-1?null:{start:v,end:C}}else s=null}s=s||{start:0,end:0}}else s=null;for(cc={focusedElem:e,selectionRange:s},Er=!1,ue=i;ue!==null;)if(i=ue,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,ue=e;else for(;ue!==null;){switch(i=ue,d=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(s=0;s<e.length;s++)h=e[s],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=i,h=d.memoizedProps,d=d.memoizedState,r=s.stateNode;try{var st=Hn(s.type,h);e=r.getSnapshotBeforeUpdate(st,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(ut){Dt(s,s.return,ut)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,s=e.nodeType,s===9)dc(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":dc(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(a(163))}if(e=i.sibling,e!==null){e.return=i.return,ue=e;break}ue=i.return}}function Tm(e,i,s){var r=s.flags;switch(s.tag){case 0:case 11:case 15:Ui(e,s),r&4&&Aa(5,s);break;case 1:if(Ui(e,s),r&4)if(e=s.stateNode,i===null)try{e.componentDidMount()}catch(g){Dt(s,s.return,g)}else{var h=Hn(s.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(h,i,e.__reactInternalSnapshotBeforeUpdate)}catch(g){Dt(s,s.return,g)}}r&64&&gm(s),r&512&&Ca(s,s.return);break;case 3:if(Ui(e,s),r&64&&(e=s.updateQueue,e!==null)){if(i=null,s.child!==null)switch(s.child.tag){case 27:case 5:i=s.child.stateNode;break;case 1:i=s.child.stateNode}try{rd(e,i)}catch(g){Dt(s,s.return,g)}}break;case 27:i===null&&r&4&&vm(s);case 26:case 5:Ui(e,s),i===null&&r&4&&_m(s),r&512&&Ca(s,s.return);break;case 12:Ui(e,s);break;case 31:Ui(e,s),r&4&&Cm(e,s);break;case 13:Ui(e,s),r&4&&Mm(e,s),r&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=M_.bind(null,s),Q_(e,s))));break;case 22:if(r=s.memoizedState!==null||Oi,!r){i=i!==null&&i.memoizedState!==null||se,h=Oi;var d=se;Oi=r,(se=i)&&!d?Ni(e,s,(s.subtreeFlags&8772)!==0):Ui(e,s),Oi=h,se=d}break;case 30:break;default:Ui(e,s)}}function wm(e){var i=e.alternate;i!==null&&(e.alternate=null,wm(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&xo(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 Yt=null,Ae=!1;function Gi(e,i,s){for(s=s.child;s!==null;)Am(e,i,s),s=s.sibling}function Am(e,i,s){if(Oe&&typeof Oe.onCommitFiberUnmount=="function")try{Oe.onCommitFiberUnmount(Is,s)}catch{}switch(s.tag){case 26:se||gi(s,i),Gi(e,i,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:se||gi(s,i);var r=Yt,h=Ae;mn(s.type)&&(Yt=s.stateNode,Ae=!1),Gi(e,i,s),Ua(s.stateNode),Yt=r,Ae=h;break;case 5:se||gi(s,i);case 6:if(r=Yt,h=Ae,Yt=null,Gi(e,i,s),Yt=r,Ae=h,Yt!==null)if(Ae)try{(Yt.nodeType===9?Yt.body:Yt.nodeName==="HTML"?Yt.ownerDocument.body:Yt).removeChild(s.stateNode)}catch(d){Dt(s,i,d)}else try{Yt.removeChild(s.stateNode)}catch(d){Dt(s,i,d)}break;case 18:Yt!==null&&(Ae?(e=Yt,gp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Us(e)):gp(Yt,s.stateNode));break;case 4:r=Yt,h=Ae,Yt=s.stateNode.containerInfo,Ae=!0,Gi(e,i,s),Yt=r,Ae=h;break;case 0:case 11:case 14:case 15:rn(2,s,i),se||rn(4,s,i),Gi(e,i,s);break;case 1:se||(gi(s,i),r=s.stateNode,typeof r.componentWillUnmount=="function"&&xm(s,i,r)),Gi(e,i,s);break;case 21:Gi(e,i,s);break;case 22:se=(r=se)||s.memoizedState!==null,Gi(e,i,s),se=r;break;default:Gi(e,i,s)}}function Cm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Us(e)}catch(s){Dt(i,i.return,s)}}}function Mm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Us(e)}catch(s){Dt(i,i.return,s)}}function __(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Sm),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Sm),i;default:throw Error(a(435,e.tag))}}function or(e,i){var s=__(e);i.forEach(function(r){if(!s.has(r)){s.add(r);var h=E_.bind(null,e,r);r.then(h,h)}})}function Ce(e,i){var s=i.deletions;if(s!==null)for(var r=0;r<s.length;r++){var h=s[r],d=e,g=i,v=g;t:for(;v!==null;){switch(v.tag){case 27:if(mn(v.type)){Yt=v.stateNode,Ae=!1;break t}break;case 5:Yt=v.stateNode,Ae=!1;break t;case 3:case 4:Yt=v.stateNode.containerInfo,Ae=!0;break t}v=v.return}if(Yt===null)throw Error(a(160));Am(d,g,h),Yt=null,Ae=!1,d=h.alternate,d!==null&&(d.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Em(i,e),i=i.sibling}var ci=null;function Em(e,i){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ce(i,e),Me(e),r&4&&(rn(3,e,e.return),Aa(3,e),rn(5,e,e.return));break;case 1:Ce(i,e),Me(e),r&512&&(se||s===null||gi(s,s.return)),r&64&&Oi&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?r:s.concat(r))));break;case 26:var h=ci;if(Ce(i,e),Me(e),r&512&&(se||s===null||gi(s,s.return)),r&4){var d=s!==null?s.memoizedState:null;if(r=e.memoizedState,s===null)if(r===null)if(e.stateNode===null){t:{r=e.type,s=e.memoizedProps,h=h.ownerDocument||h;e:switch(r){case"title":d=h.getElementsByTagName("title")[0],(!d||d[$s]||d[he]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=h.createElement(r),h.head.insertBefore(d,h.querySelector("head > title"))),pe(d,r,s),d[he]=e,oe(d),r=d;break t;case"link":var g=Ep("link","href",h).get(r+(s.href||""));if(g){for(var v=0;v<g.length;v++)if(d=g[v],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){g.splice(v,1);break e}}d=h.createElement(r),pe(d,r,s),h.head.appendChild(d);break;case"meta":if(g=Ep("meta","content",h).get(r+(s.content||""))){for(v=0;v<g.length;v++)if(d=g[v],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){g.splice(v,1);break e}}d=h.createElement(r),pe(d,r,s),h.head.appendChild(d);break;default:throw Error(a(468,r))}d[he]=e,oe(d),r=d}e.stateNode=r}else Rp(h,e.type,e.stateNode);else e.stateNode=Mp(h,r,e.memoizedProps);else d!==r?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,r===null?Rp(h,e.type,e.stateNode):Mp(h,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Lu(e,e.memoizedProps,s.memoizedProps)}break;case 27:Ce(i,e),Me(e),r&512&&(se||s===null||gi(s,s.return)),s!==null&&r&4&&Lu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Ce(i,e),Me(e),r&512&&(se||s===null||gi(s,s.return)),e.flags&32){h=e.stateNode;try{ss(h,"")}catch(st){Dt(e,e.return,st)}}r&4&&e.stateNode!=null&&(h=e.memoizedProps,Lu(e,h,s!==null?s.memoizedProps:h)),r&1024&&(qu=!0);break;case 6:if(Ce(i,e),Me(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,s=e.stateNode;try{s.nodeValue=r}catch(st){Dt(e,e.return,st)}}break;case 3:if(wr=null,h=ci,ci=Sr(i.containerInfo),Ce(i,e),ci=h,Me(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{Us(i.containerInfo)}catch(st){Dt(e,e.return,st)}qu&&(qu=!1,Rm(e));break;case 4:r=ci,ci=Sr(e.stateNode.containerInfo),Ce(i,e),Me(e),ci=r;break;case 12:Ce(i,e),Me(e);break;case 31:Ce(i,e),Me(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 13:Ce(i,e),Me(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(cr=Be()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 22:h=e.memoizedState!==null;var C=s!==null&&s.memoizedState!==null,k=Oi,q=se;if(Oi=k||h,se=q||C,Ce(i,e),se=q,Oi=k,Me(e),r&8192)t:for(i=e.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(s===null||C||Oi||se||Ln(e)),s=null,i=e;;){if(i.tag===5||i.tag===26){if(s===null){C=s=i;try{if(d=C.stateNode,h)g=d.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=C.stateNode;var F=C.memoizedProps.style,H=F!=null&&F.hasOwnProperty("display")?F.display:null;v.style.display=H==null||typeof H=="boolean"?"":(""+H).trim()}}catch(st){Dt(C,C.return,st)}}}else if(i.tag===6){if(s===null){C=i;try{C.stateNode.nodeValue=h?"":C.memoizedProps}catch(st){Dt(C,C.return,st)}}}else if(i.tag===18){if(s===null){C=i;try{var j=C.stateNode;h?xp(j,!0):xp(C.stateNode,!1)}catch(st){Dt(C,C.return,st)}}}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;s===i&&(s=null),i=i.return}s===i&&(s=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=e.updateQueue,r!==null&&(s=r.retryQueue,s!==null&&(r.retryQueue=null,or(e,s))));break;case 19:Ce(i,e),Me(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,or(e,r)));break;case 30:break;case 21:break;default:Ce(i,e),Me(e)}}function Me(e){var i=e.flags;if(i&2){try{for(var s,r=e.return;r!==null;){if(bm(r)){s=r;break}r=r.return}if(s==null)throw Error(a(160));switch(s.tag){case 27:var h=s.stateNode,d=ju(e);rr(e,d,h);break;case 5:var g=s.stateNode;s.flags&32&&(ss(g,""),s.flags&=-33);var v=ju(e);rr(e,v,g);break;case 3:case 4:var C=s.stateNode.containerInfo,k=ju(e);Yu(e,k,C);break;default:throw Error(a(161))}}catch(q){Dt(e,e.return,q)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Rm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Rm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function Ui(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Tm(e,i.alternate,i),i=i.sibling}function Ln(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:rn(4,i,i.return),Ln(i);break;case 1:gi(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&xm(i,i.return,s),Ln(i);break;case 27:Ua(i.stateNode);case 26:case 5:gi(i,i.return),Ln(i);break;case 22:i.memoizedState===null&&Ln(i);break;case 30:Ln(i);break;default:Ln(i)}e=e.sibling}}function Ni(e,i,s){for(s=s&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,h=e,d=i,g=d.flags;switch(d.tag){case 0:case 11:case 15:Ni(h,d,s),Aa(4,d);break;case 1:if(Ni(h,d,s),r=d,h=r.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(k){Dt(r,r.return,k)}if(r=d,h=r.updateQueue,h!==null){var v=r.stateNode;try{var C=h.shared.hiddenCallbacks;if(C!==null)for(h.shared.hiddenCallbacks=null,h=0;h<C.length;h++)ld(C[h],v)}catch(k){Dt(r,r.return,k)}}s&&g&64&&gm(d),Ca(d,d.return);break;case 27:vm(d);case 26:case 5:Ni(h,d,s),s&&r===null&&g&4&&_m(d),Ca(d,d.return);break;case 12:Ni(h,d,s);break;case 31:Ni(h,d,s),s&&g&4&&Cm(h,d);break;case 13:Ni(h,d,s),s&&g&4&&Mm(h,d);break;case 22:d.memoizedState===null&&Ni(h,d,s),Ca(d,d.return);break;case 30:break;default:Ni(h,d,s)}i=i.sibling}}function Xu(e,i){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&fa(s))}function Vu(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&fa(e))}function hi(e,i,s,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)zm(e,i,s,r),i=i.sibling}function zm(e,i,s,r){var h=i.flags;switch(i.tag){case 0:case 11:case 15:hi(e,i,s,r),h&2048&&Aa(9,i);break;case 1:hi(e,i,s,r);break;case 3:hi(e,i,s,r),h&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&fa(e)));break;case 12:if(h&2048){hi(e,i,s,r),e=i.stateNode;try{var d=i.memoizedProps,g=d.id,v=d.onPostCommit;typeof v=="function"&&v(g,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){Dt(i,i.return,C)}}else hi(e,i,s,r);break;case 31:hi(e,i,s,r);break;case 13:hi(e,i,s,r);break;case 23:break;case 22:d=i.stateNode,g=i.alternate,i.memoizedState!==null?d._visibility&2?hi(e,i,s,r):Ma(e,i):d._visibility&2?hi(e,i,s,r):(d._visibility|=2,ws(e,i,s,r,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Xu(g,i);break;case 24:hi(e,i,s,r),h&2048&&Vu(i.alternate,i);break;default:hi(e,i,s,r)}}function ws(e,i,s,r,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var d=e,g=i,v=s,C=r,k=g.flags;switch(g.tag){case 0:case 11:case 15:ws(d,g,v,C,h),Aa(8,g);break;case 23:break;case 22:var q=g.stateNode;g.memoizedState!==null?q._visibility&2?ws(d,g,v,C,h):Ma(d,g):(q._visibility|=2,ws(d,g,v,C,h)),h&&k&2048&&Xu(g.alternate,g);break;case 24:ws(d,g,v,C,h),h&&k&2048&&Vu(g.alternate,g);break;default:ws(d,g,v,C,h)}i=i.sibling}}function Ma(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var s=e,r=i,h=r.flags;switch(r.tag){case 22:Ma(s,r),h&2048&&Xu(r.alternate,r);break;case 24:Ma(s,r),h&2048&&Vu(r.alternate,r);break;default:Ma(s,r)}i=i.sibling}}var Ea=8192;function As(e,i,s){if(e.subtreeFlags&Ea)for(e=e.child;e!==null;)Dm(e,i,s),e=e.sibling}function Dm(e,i,s){switch(e.tag){case 26:As(e,i,s),e.flags&Ea&&e.memoizedState!==null&&a1(s,ci,e.memoizedState,e.memoizedProps);break;case 5:As(e,i,s);break;case 3:case 4:var r=ci;ci=Sr(e.stateNode.containerInfo),As(e,i,s),ci=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ea,Ea=16777216,As(e,i,s),Ea=r):As(e,i,s));break;default:As(e,i,s)}}function Bm(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 Ra(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];ue=r,Gm(r,e)}Bm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Om(e),e=e.sibling}function Om(e){switch(e.tag){case 0:case 11:case 15:Ra(e),e.flags&2048&&rn(9,e,e.return);break;case 3:Ra(e);break;case 12:Ra(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,ur(e)):Ra(e);break;default:Ra(e)}}function ur(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var s=0;s<i.length;s++){var r=i[s];ue=r,Gm(r,e)}Bm(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:rn(8,i,i.return),ur(i);break;case 22:s=i.stateNode,s._visibility&2&&(s._visibility&=-3,ur(i));break;default:ur(i)}e=e.sibling}}function Gm(e,i){for(;ue!==null;){var s=ue;switch(s.tag){case 0:case 11:case 15:rn(8,s,i);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var r=s.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:fa(s.memoizedState.cache)}if(r=s.child,r!==null)r.return=s,ue=r;else t:for(s=e;ue!==null;){r=ue;var h=r.sibling,d=r.return;if(wm(r),r===s){ue=null;break t}if(h!==null){h.return=d,ue=h;break t}ue=d}}}var b_={getCacheForType:function(e){var i=de(ee),s=i.data.get(e);return s===void 0&&(s=e(),i.data.set(e,s)),s},cacheSignal:function(){return de(ee).controller.signal}},v_=typeof WeakMap=="function"?WeakMap:Map,Rt=0,Nt=null,gt=null,_t=0,zt=0,Le=null,on=!1,Cs=!1,Pu=!1,ki=0,Vt=0,un=0,jn=0,Fu=0,je=0,Ms=0,za=null,Ee=null,Qu=!1,cr=0,Um=0,hr=1/0,fr=null,cn=null,le=0,hn=null,Es=null,Hi=0,Wu=0,Zu=null,Nm=null,Da=0,Iu=null;function Ye(){return(Rt&2)!==0&&_t!==0?_t&-_t:R.T!==null?ic():Kh()}function km(){if(je===0)if((_t&536870912)===0||Tt){var e=bl;bl<<=1,(bl&3932160)===0&&(bl=262144),je=e}else je=536870912;return e=ke.current,e!==null&&(e.flags|=32),je}function Re(e,i,s){(e===Nt&&(zt===2||zt===9)||e.cancelPendingCommit!==null)&&(Rs(e,0),fn(e,_t,je,!1)),Js(e,s),((Rt&2)===0||e!==Nt)&&(e===Nt&&((Rt&2)===0&&(jn|=s),Vt===4&&fn(e,_t,je,!1)),xi(e))}function Hm(e,i,s){if((Rt&6)!==0)throw Error(a(327));var r=!s&&(i&127)===0&&(i&e.expiredLanes)===0||Ks(e,i),h=r?w_(e,i):Ju(e,i,!0),d=r;do{if(h===0){Cs&&!r&&fn(e,i,0,!1);break}else{if(s=e.current.alternate,d&&!S_(s)){h=Ju(e,i,!1),d=!1;continue}if(h===2){if(d=i,e.errorRecoveryDisabledLanes&d)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){i=g;t:{var v=e;h=za;var C=v.current.memoizedState.isDehydrated;if(C&&(Rs(v,g).flags|=256),g=Ju(v,g,!1),g!==2){if(Pu&&!C){v.errorRecoveryDisabledLanes|=d,jn|=d,h=4;break t}d=Ee,Ee=h,d!==null&&(Ee===null?Ee=d:Ee.push.apply(Ee,d))}h=g}if(d=!1,h!==2)continue}}if(h===1){Rs(e,0),fn(e,i,0,!0);break}t:{switch(r=e,d=h,d){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:fn(r,i,je,!on);break t;case 2:Ee=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(h=cr+300-Be(),10<h)){if(fn(r,i,je,!on),Sl(r,0,!0)!==0)break t;Hi=i,r.timeoutHandle=pp(Lm.bind(null,r,s,Ee,fr,Qu,i,je,jn,Ms,on,d,"Throttled",-0,0),h);break t}Lm(r,s,Ee,fr,Qu,i,je,jn,Ms,on,d,null,-0,0)}}break}while(!0);xi(e)}function Lm(e,i,s,r,h,d,g,v,C,k,q,F,H,j){if(e.timeoutHandle=-1,F=i.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ti},Dm(i,d,F);var st=(d&62914560)===d?cr-Be():(d&4194048)===d?Um-Be():0;if(st=l1(F,st),st!==null){Hi=d,e.cancelPendingCommit=st(Qm.bind(null,e,i,d,s,r,h,g,v,C,q,F,null,H,j)),fn(e,d,g,!k);return}}Qm(e,i,d,s,r,h,g,v,C)}function S_(e){for(var i=e;;){var s=i.tag;if((s===0||s===11||s===15)&&i.flags&16384&&(s=i.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var r=0;r<s.length;r++){var h=s[r],d=h.getSnapshot;h=h.value;try{if(!Ue(d(),h))return!1}catch{return!1}}if(s=i.child,i.subtreeFlags&16384&&s!==null)s.return=i,i=s;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 fn(e,i,s,r){i&=~Fu,i&=~jn,e.suspendedLanes|=i,e.pingedLanes&=~i,r&&(e.warmLanes|=i),r=e.expirationTimes;for(var h=i;0<h;){var d=31-Ge(h),g=1<<d;r[d]=-1,h&=~g}s!==0&&Wh(e,s,i)}function dr(){return(Rt&6)===0?(Ba(0),!1):!0}function Ku(){if(gt!==null){if(zt===0)var e=gt.return;else e=gt,Mi=Dn=null,du(e),_s=null,ma=0,e=gt;for(;e!==null;)ym(e.alternate,e),e=e.return;gt=null}}function Rs(e,i){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,q_(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Hi=0,Ku(),Nt=e,gt=s=Ai(e.current,null),_t=i,zt=0,Le=null,on=!1,Cs=Ks(e,i),Pu=!1,Ms=je=Fu=jn=un=Vt=0,Ee=za=null,Qu=!1,(i&8)!==0&&(i|=i&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=i;0<r;){var h=31-Ge(r),d=1<<h;i|=e[h],r&=~d}return ki=i,Gl(),s}function jm(e,i){mt=null,R.H=Sa,i===xs||i===ql?(i=id(),zt=3):i===eu?(i=id(),zt=4):zt=i===Ru?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Le=i,gt===null&&(Vt=1,ir(e,We(i,e.current)))}function Ym(){var e=ke.current;return e===null?!0:(_t&4194048)===_t?Je===null:(_t&62914560)===_t||(_t&536870912)!==0?e===Je:!1}function qm(){var e=R.H;return R.H=Sa,e===null?Sa:e}function Xm(){var e=R.A;return R.A=b_,e}function mr(){Vt=4,on||(_t&4194048)!==_t&&ke.current!==null||(Cs=!0),(un&134217727)===0&&(jn&134217727)===0||Nt===null||fn(Nt,_t,je,!1)}function Ju(e,i,s){var r=Rt;Rt|=2;var h=qm(),d=Xm();(Nt!==e||_t!==i)&&(fr=null,Rs(e,i)),i=!1;var g=Vt;t:do try{if(zt!==0&&gt!==null){var v=gt,C=Le;switch(zt){case 8:Ku(),g=6;break t;case 3:case 2:case 9:case 6:ke.current===null&&(i=!0);var k=zt;if(zt=0,Le=null,zs(e,v,C,k),s&&Cs){g=0;break t}break;default:k=zt,zt=0,Le=null,zs(e,v,C,k)}}T_(),g=Vt;break}catch(q){jm(e,q)}while(!0);return i&&e.shellSuspendCounter++,Mi=Dn=null,Rt=r,R.H=h,R.A=d,gt===null&&(Nt=null,_t=0,Gl()),g}function T_(){for(;gt!==null;)Vm(gt)}function w_(e,i){var s=Rt;Rt|=2;var r=qm(),h=Xm();Nt!==e||_t!==i?(fr=null,hr=Be()+500,Rs(e,i)):Cs=Ks(e,i);t:do try{if(zt!==0&&gt!==null){i=gt;var d=Le;e:switch(zt){case 1:zt=0,Le=null,zs(e,i,d,1);break;case 2:case 9:if(td(d)){zt=0,Le=null,Pm(i);break}i=function(){zt!==2&&zt!==9||Nt!==e||(zt=7),xi(e)},d.then(i,i);break t;case 3:zt=7;break t;case 4:zt=5;break t;case 7:td(d)?(zt=0,Le=null,Pm(i)):(zt=0,Le=null,zs(e,i,d,7));break;case 5:var g=null;switch(gt.tag){case 26:g=gt.memoizedState;case 5:case 27:var v=gt;if(g?zp(g):v.stateNode.complete){zt=0,Le=null;var C=v.sibling;if(C!==null)gt=C;else{var k=v.return;k!==null?(gt=k,pr(k)):gt=null}break e}}zt=0,Le=null,zs(e,i,d,5);break;case 6:zt=0,Le=null,zs(e,i,d,6);break;case 8:Ku(),Vt=6;break t;default:throw Error(a(462))}}A_();break}catch(q){jm(e,q)}while(!0);return Mi=Dn=null,R.H=r,R.A=h,Rt=s,gt!==null?0:(Nt=null,_t=0,Gl(),Vt)}function A_(){for(;gt!==null&&!W0();)Vm(gt)}function Vm(e){var i=mm(e.alternate,e,ki);e.memoizedProps=e.pendingProps,i===null?pr(e):gt=i}function Pm(e){var i=e,s=i.alternate;switch(i.tag){case 15:case 0:i=om(s,i,i.pendingProps,i.type,void 0,_t);break;case 11:i=om(s,i,i.pendingProps,i.type.render,i.ref,_t);break;case 5:du(i);default:ym(s,i),i=gt=Xf(i,ki),i=mm(s,i,ki)}e.memoizedProps=e.pendingProps,i===null?pr(e):gt=i}function zs(e,i,s,r){Mi=Dn=null,du(i),_s=null,ma=0;var h=i.return;try{if(d_(e,h,i,s,_t)){Vt=1,ir(e,We(s,e.current)),gt=null;return}}catch(d){if(h!==null)throw gt=h,d;Vt=1,ir(e,We(s,e.current)),gt=null;return}i.flags&32768?(Tt||r===1?e=!0:Cs||(_t&536870912)!==0?e=!1:(on=e=!0,(r===2||r===9||r===3||r===6)&&(r=ke.current,r!==null&&r.tag===13&&(r.flags|=16384))),Fm(i,e)):pr(i)}function pr(e){var i=e;do{if((i.flags&32768)!==0){Fm(i,on);return}e=i.return;var s=y_(i.alternate,i,ki);if(s!==null){gt=s;return}if(i=i.sibling,i!==null){gt=i;return}gt=i=e}while(i!==null);Vt===0&&(Vt=5)}function Fm(e,i){do{var s=g_(e.alternate,e);if(s!==null){s.flags&=32767,gt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!i&&(e=e.sibling,e!==null)){gt=e;return}gt=e=s}while(e!==null);Vt=6,gt=null}function Qm(e,i,s,r,h,d,g,v,C){e.cancelPendingCommit=null;do yr();while(le!==0);if((Rt&6)!==0)throw Error(a(327));if(i!==null){if(i===e.current)throw Error(a(177));if(d=i.lanes|i.childLanes,d|=jo,sx(e,s,d,g,v,C),e===Nt&&(gt=Nt=null,_t=0),Es=i,hn=e,Hi=s,Wu=d,Zu=h,Nm=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,R_(xl,function(){return Jm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=R.T,R.T=null,h=L.p,L.p=2,g=Rt,Rt|=4;try{x_(e,i,s)}finally{Rt=g,L.p=h,R.T=r}}le=1,Wm(),Zm(),Im()}}function Wm(){if(le===1){le=0;var e=hn,i=Es,s=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||s){s=R.T,R.T=null;var r=L.p;L.p=2;var h=Rt;Rt|=4;try{Em(i,e);var d=cc,g=Gf(e.containerInfo),v=d.focusedElem,C=d.selectionRange;if(g!==v&&v&&v.ownerDocument&&Of(v.ownerDocument.documentElement,v)){if(C!==null&&Uo(v)){var k=C.start,q=C.end;if(q===void 0&&(q=k),"selectionStart"in v)v.selectionStart=k,v.selectionEnd=Math.min(q,v.value.length);else{var F=v.ownerDocument||document,H=F&&F.defaultView||window;if(H.getSelection){var j=H.getSelection(),st=v.textContent.length,ut=Math.min(C.start,st),Gt=C.end===void 0?ut:Math.min(C.end,st);!j.extend&&ut>Gt&&(g=Gt,Gt=ut,ut=g);var B=Bf(v,ut),E=Bf(v,Gt);if(B&&E&&(j.rangeCount!==1||j.anchorNode!==B.node||j.anchorOffset!==B.offset||j.focusNode!==E.node||j.focusOffset!==E.offset)){var U=F.createRange();U.setStart(B.node,B.offset),j.removeAllRanges(),ut>Gt?(j.addRange(U),j.extend(E.node,E.offset)):(U.setEnd(E.node,E.offset),j.addRange(U))}}}}for(F=[],j=v;j=j.parentNode;)j.nodeType===1&&F.push({element:j,left:j.scrollLeft,top:j.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<F.length;v++){var V=F[v];V.element.scrollLeft=V.left,V.element.scrollTop=V.top}}Er=!!uc,cc=uc=null}finally{Rt=h,L.p=r,R.T=s}}e.current=i,le=2}}function Zm(){if(le===2){le=0;var e=hn,i=Es,s=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||s){s=R.T,R.T=null;var r=L.p;L.p=2;var h=Rt;Rt|=4;try{Tm(e,i.alternate,i)}finally{Rt=h,L.p=r,R.T=s}}le=3}}function Im(){if(le===4||le===3){le=0,Z0();var e=hn,i=Es,s=Hi,r=Nm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?le=5:(le=0,Es=hn=null,Km(e,e.pendingLanes));var h=e.pendingLanes;if(h===0&&(cn=null),yo(s),i=i.stateNode,Oe&&typeof Oe.onCommitFiberRoot=="function")try{Oe.onCommitFiberRoot(Is,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=R.T,h=L.p,L.p=2,R.T=null;try{for(var d=e.onRecoverableError,g=0;g<r.length;g++){var v=r[g];d(v.value,{componentStack:v.stack})}}finally{R.T=i,L.p=h}}(Hi&3)!==0&&yr(),xi(e),h=e.pendingLanes,(s&261930)!==0&&(h&42)!==0?e===Iu?Da++:(Da=0,Iu=e):Da=0,Ba(0)}}function Km(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,fa(i)))}function yr(){return Wm(),Zm(),Im(),Jm()}function Jm(){if(le!==5)return!1;var e=hn,i=Wu;Wu=0;var s=yo(Hi),r=R.T,h=L.p;try{L.p=32>s?32:s,R.T=null,s=Zu,Zu=null;var d=hn,g=Hi;if(le=0,Es=hn=null,Hi=0,(Rt&6)!==0)throw Error(a(331));var v=Rt;if(Rt|=4,Om(d.current),zm(d,d.current,g,s),Rt=v,Ba(0,!1),Oe&&typeof Oe.onPostCommitFiberRoot=="function")try{Oe.onPostCommitFiberRoot(Is,d)}catch{}return!0}finally{L.p=h,R.T=r,Km(e,i)}}function $m(e,i,s){i=We(s,i),i=Eu(e.stateNode,i,2),e=sn(e,i,2),e!==null&&(Js(e,2),xi(e))}function Dt(e,i,s){if(e.tag===3)$m(e,e,s);else for(;i!==null;){if(i.tag===3){$m(i,e,s);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(cn===null||!cn.has(r))){e=We(s,e),s=tm(2),r=sn(i,s,2),r!==null&&(em(s,r,i,e),Js(r,2),xi(r));break}}i=i.return}}function $u(e,i,s){var r=e.pingCache;if(r===null){r=e.pingCache=new v_;var h=new Set;r.set(i,h)}else h=r.get(i),h===void 0&&(h=new Set,r.set(i,h));h.has(s)||(Pu=!0,h.add(s),e=C_.bind(null,e,i,s),i.then(e,e))}function C_(e,i,s){var r=e.pingCache;r!==null&&r.delete(i),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Nt===e&&(_t&s)===s&&(Vt===4||Vt===3&&(_t&62914560)===_t&&300>Be()-cr?(Rt&2)===0&&Rs(e,0):Fu|=s,Ms===_t&&(Ms=0)),xi(e)}function tp(e,i){i===0&&(i=Qh()),e=En(e,i),e!==null&&(Js(e,i),xi(e))}function M_(e){var i=e.memoizedState,s=0;i!==null&&(s=i.retryLane),tp(e,s)}function E_(e,i){var s=0;switch(e.tag){case 31:case 13:var r=e.stateNode,h=e.memoizedState;h!==null&&(s=h.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),tp(e,s)}function R_(e,i){return ho(e,i)}var gr=null,Ds=null,tc=!1,xr=!1,ec=!1,dn=0;function xi(e){e!==Ds&&e.next===null&&(Ds===null?gr=Ds=e:Ds=Ds.next=e),xr=!0,tc||(tc=!0,D_())}function Ba(e,i){if(!ec&&xr){ec=!0;do for(var s=!1,r=gr;r!==null;){if(e!==0){var h=r.pendingLanes;if(h===0)var d=0;else{var g=r.suspendedLanes,v=r.pingedLanes;d=(1<<31-Ge(42|e)+1)-1,d&=h&~(g&~v),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(s=!0,sp(r,d))}else d=_t,d=Sl(r,r===Nt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Ks(r,d)||(s=!0,sp(r,d));r=r.next}while(s);ec=!1}}function z_(){ep()}function ep(){xr=tc=!1;var e=0;dn!==0&&Y_()&&(e=dn);for(var i=Be(),s=null,r=gr;r!==null;){var h=r.next,d=ip(r,i);d===0?(r.next=null,s===null?gr=h:s.next=h,h===null&&(Ds=s)):(s=r,(e!==0||(d&3)!==0)&&(xr=!0)),r=h}le!==0&&le!==5||Ba(e),dn!==0&&(dn=0)}function ip(e,i){for(var s=e.suspendedLanes,r=e.pingedLanes,h=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var g=31-Ge(d),v=1<<g,C=h[g];C===-1?((v&s)===0||(v&r)!==0)&&(h[g]=nx(v,i)):C<=i&&(e.expiredLanes|=v),d&=~v}if(i=Nt,s=_t,s=Sl(e,e===i?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,s===0||e===i&&(zt===2||zt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&fo(r),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Ks(e,s)){if(i=s&-s,i===e.callbackPriority)return i;switch(r!==null&&fo(r),yo(s)){case 2:case 8:s=Ph;break;case 32:s=xl;break;case 268435456:s=Fh;break;default:s=xl}return r=np.bind(null,e),s=ho(s,r),e.callbackPriority=i,e.callbackNode=s,i}return r!==null&&r!==null&&fo(r),e.callbackPriority=2,e.callbackNode=null,2}function np(e,i){if(le!==0&&le!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(yr()&&e.callbackNode!==s)return null;var r=_t;return r=Sl(e,e===Nt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Hm(e,r,i),ip(e,Be()),e.callbackNode!=null&&e.callbackNode===s?np.bind(null,e):null)}function sp(e,i){if(yr())return null;Hm(e,i,!0)}function D_(){X_(function(){(Rt&6)!==0?ho(Vh,z_):ep()})}function ic(){if(dn===0){var e=ys;e===0&&(e=_l,_l<<=1,(_l&261888)===0&&(_l=256)),dn=e}return dn}function ap(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Cl(""+e)}function lp(e,i){var s=i.ownerDocument.createElement("input");return s.name=i.name,s.value=i.value,e.id&&s.setAttribute("form",e.id),i.parentNode.insertBefore(s,i),e=new FormData(e),s.parentNode.removeChild(s),e}function B_(e,i,s,r,h){if(i==="submit"&&s&&s.stateNode===h){var d=ap((h[Te]||null).action),g=r.submitter;g&&(i=(i=g[Te]||null)?ap(i.formAction):g.getAttribute("formAction"),i!==null&&(d=i,g=null));var v=new zl("action","action",null,r,h);e.push({event:v,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(dn!==0){var C=g?lp(h,g):new FormData(h);Su(s,{pending:!0,data:C,method:h.method,action:d},null,C)}}else typeof d=="function"&&(v.preventDefault(),C=g?lp(h,g):new FormData(h),Su(s,{pending:!0,data:C,method:h.method,action:d},d,C))},currentTarget:h}]})}}for(var nc=0;nc<Lo.length;nc++){var sc=Lo[nc],O_=sc.toLowerCase(),G_=sc[0].toUpperCase()+sc.slice(1);ui(O_,"on"+G_)}ui(kf,"onAnimationEnd"),ui(Hf,"onAnimationIteration"),ui(Lf,"onAnimationStart"),ui("dblclick","onDoubleClick"),ui("focusin","onFocus"),ui("focusout","onBlur"),ui(Ix,"onTransitionRun"),ui(Kx,"onTransitionStart"),ui(Jx,"onTransitionCancel"),ui(jf,"onTransitionEnd"),is("onMouseEnter",["mouseout","mouseover"]),is("onMouseLeave",["mouseout","mouseover"]),is("onPointerEnter",["pointerout","pointerover"]),is("onPointerLeave",["pointerout","pointerover"]),wn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),wn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),wn("onBeforeInput",["compositionend","keypress","textInput","paste"]),wn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),wn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Oa="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(" "),U_=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Oa));function rp(e,i){i=(i&4)!==0;for(var s=0;s<e.length;s++){var r=e[s],h=r.event;r=r.listeners;t:{var d=void 0;if(i)for(var g=r.length-1;0<=g;g--){var v=r[g],C=v.instance,k=v.currentTarget;if(v=v.listener,C!==d&&h.isPropagationStopped())break t;d=v,h.currentTarget=k;try{d(h)}catch(q){Ol(q)}h.currentTarget=null,d=C}else for(g=0;g<r.length;g++){if(v=r[g],C=v.instance,k=v.currentTarget,v=v.listener,C!==d&&h.isPropagationStopped())break t;d=v,h.currentTarget=k;try{d(h)}catch(q){Ol(q)}h.currentTarget=null,d=C}}}}function xt(e,i){var s=i[go];s===void 0&&(s=i[go]=new Set);var r=e+"__bubble";s.has(r)||(op(i,e,2,!1),s.add(r))}function ac(e,i,s){var r=0;i&&(r|=4),op(s,e,r,i)}var _r="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[_r]){e[_r]=!0,tf.forEach(function(s){s!=="selectionchange"&&(U_.has(s)||ac(s,!1,e),ac(s,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[_r]||(i[_r]=!0,ac("selectionchange",!1,i))}}function op(e,i,s,r){switch(kp(i)){case 2:var h=u1;break;case 8:h=c1;break;default:h=vc}s=h.bind(null,i,s,e),h=void 0,!Co||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),r?h!==void 0?e.addEventListener(i,s,{capture:!0,passive:h}):e.addEventListener(i,s,!0):h!==void 0?e.addEventListener(i,s,{passive:h}):e.addEventListener(i,s,!1)}function rc(e,i,s,r,h){var d=r;if((i&1)===0&&(i&2)===0&&r!==null)t:for(;;){if(r===null)return;var g=r.tag;if(g===3||g===4){var v=r.stateNode.containerInfo;if(v===h)break;if(g===4)for(g=r.return;g!==null;){var C=g.tag;if((C===3||C===4)&&g.stateNode.containerInfo===h)return;g=g.return}for(;v!==null;){if(g=$n(v),g===null)return;if(C=g.tag,C===5||C===6||C===26||C===27){r=d=g;continue t}v=v.parentNode}}r=r.return}df(function(){var k=d,q=wo(s),F=[];t:{var H=Yf.get(e);if(H!==void 0){var j=zl,st=e;switch(e){case"keypress":if(El(s)===0)break t;case"keydown":case"keyup":j=Ex;break;case"focusin":st="focus",j=zo;break;case"focusout":st="blur",j=zo;break;case"beforeblur":case"afterblur":j=zo;break;case"click":if(s.button===2)break t;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":j=yf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":j=yx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":j=Dx;break;case kf:case Hf:case Lf:j=_x;break;case jf:j=Ox;break;case"scroll":case"scrollend":j=mx;break;case"wheel":j=Ux;break;case"copy":case"cut":case"paste":j=vx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":j=xf;break;case"toggle":case"beforetoggle":j=kx}var ut=(i&4)!==0,Gt=!ut&&(e==="scroll"||e==="scrollend"),B=ut?H!==null?H+"Capture":null:H;ut=[];for(var E=k,U;E!==null;){var V=E;if(U=V.stateNode,V=V.tag,V!==5&&V!==26&&V!==27||U===null||B===null||(V=ea(E,B),V!=null&&ut.push(Ga(E,V,U))),Gt)break;E=E.return}0<ut.length&&(H=new j(H,st,null,s,q),F.push({event:H,listeners:ut}))}}if((i&7)===0){t:{if(H=e==="mouseover"||e==="pointerover",j=e==="mouseout"||e==="pointerout",H&&s!==To&&(st=s.relatedTarget||s.fromElement)&&($n(st)||st[Jn]))break t;if((j||H)&&(H=q.window===q?q:(H=q.ownerDocument)?H.defaultView||H.parentWindow:window,j?(st=s.relatedTarget||s.toElement,j=k,st=st?$n(st):null,st!==null&&(Gt=o(st),ut=st.tag,st!==Gt||ut!==5&&ut!==27&&ut!==6)&&(st=null)):(j=null,st=k),j!==st)){if(ut=yf,V="onMouseLeave",B="onMouseEnter",E="mouse",(e==="pointerout"||e==="pointerover")&&(ut=xf,V="onPointerLeave",B="onPointerEnter",E="pointer"),Gt=j==null?H:ta(j),U=st==null?H:ta(st),H=new ut(V,E+"leave",j,s,q),H.target=Gt,H.relatedTarget=U,V=null,$n(q)===k&&(ut=new ut(B,E+"enter",st,s,q),ut.target=U,ut.relatedTarget=Gt,V=ut),Gt=V,j&&st)e:{for(ut=N_,B=j,E=st,U=0,V=B;V;V=ut(V))U++;V=0;for(var ot=E;ot;ot=ut(ot))V++;for(;0<U-V;)B=ut(B),U--;for(;0<V-U;)E=ut(E),V--;for(;U--;){if(B===E||E!==null&&B===E.alternate){ut=B;break e}B=ut(B),E=ut(E)}ut=null}else ut=null;j!==null&&up(F,H,j,ut,!1),st!==null&&Gt!==null&&up(F,Gt,st,ut,!0)}}t:{if(H=k?ta(k):window,j=H.nodeName&&H.nodeName.toLowerCase(),j==="select"||j==="input"&&H.type==="file")var At=Cf;else if(wf(H))if(Mf)At=Qx;else{At=Px;var lt=Vx}else j=H.nodeName,!j||j.toLowerCase()!=="input"||H.type!=="checkbox"&&H.type!=="radio"?k&&So(k.elementType)&&(At=Cf):At=Fx;if(At&&(At=At(e,k))){Af(F,At,s,q);break t}lt&&lt(e,H,k),e==="focusout"&&k&&H.type==="number"&&k.memoizedProps.value!=null&&vo(H,"number",H.value)}switch(lt=k?ta(k):window,e){case"focusin":(wf(lt)||lt.contentEditable==="true")&&(os=lt,No=k,ua=null);break;case"focusout":ua=No=os=null;break;case"mousedown":ko=!0;break;case"contextmenu":case"mouseup":case"dragend":ko=!1,Uf(F,s,q);break;case"selectionchange":if(Zx)break;case"keydown":case"keyup":Uf(F,s,q)}var pt;if(Bo)t:{switch(e){case"compositionstart":var bt="onCompositionStart";break t;case"compositionend":bt="onCompositionEnd";break t;case"compositionupdate":bt="onCompositionUpdate";break t}bt=void 0}else rs?Sf(e,s)&&(bt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(bt="onCompositionStart");bt&&(_f&&s.locale!=="ko"&&(rs||bt!=="onCompositionStart"?bt==="onCompositionEnd"&&rs&&(pt=mf()):(Ii=q,Mo="value"in Ii?Ii.value:Ii.textContent,rs=!0)),lt=br(k,bt),0<lt.length&&(bt=new gf(bt,e,null,s,q),F.push({event:bt,listeners:lt}),pt?bt.data=pt:(pt=Tf(s),pt!==null&&(bt.data=pt)))),(pt=Lx?jx(e,s):Yx(e,s))&&(bt=br(k,"onBeforeInput"),0<bt.length&&(lt=new gf("onBeforeInput","beforeinput",null,s,q),F.push({event:lt,listeners:bt}),lt.data=pt)),B_(F,e,k,s,q)}rp(F,i)})}function Ga(e,i,s){return{instance:e,listener:i,currentTarget:s}}function br(e,i){for(var s=i+"Capture",r=[];e!==null;){var h=e,d=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||d===null||(h=ea(e,s),h!=null&&r.unshift(Ga(e,h,d)),h=ea(e,i),h!=null&&r.push(Ga(e,h,d))),e.tag===3)return r;e=e.return}return[]}function N_(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function up(e,i,s,r,h){for(var d=i._reactName,g=[];s!==null&&s!==r;){var v=s,C=v.alternate,k=v.stateNode;if(v=v.tag,C!==null&&C===r)break;v!==5&&v!==26&&v!==27||k===null||(C=k,h?(k=ea(s,d),k!=null&&g.unshift(Ga(s,k,C))):h||(k=ea(s,d),k!=null&&g.push(Ga(s,k,C)))),s=s.return}g.length!==0&&e.push({event:i,listeners:g})}var k_=/\r\n?/g,H_=/\u0000|\uFFFD/g;function cp(e){return(typeof e=="string"?e:""+e).replace(k_,`
50
+ `).replace(H_,"")}function hp(e,i){return i=cp(i),cp(e)===i}function Ot(e,i,s,r,h,d){switch(s){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||ss(e,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&ss(e,""+r);break;case"className":wl(e,"class",r);break;case"tabIndex":wl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":wl(e,s,r);break;case"style":hf(e,r,d);break;case"data":if(i!=="object"){wl(e,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||s!=="href")){e.removeAttribute(s);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Cl(""+r),e.setAttribute(s,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(s,"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 d=="function"&&(s==="formAction"?(i!=="input"&&Ot(e,i,"name",h.name,h,null),Ot(e,i,"formEncType",h.formEncType,h,null),Ot(e,i,"formMethod",h.formMethod,h,null),Ot(e,i,"formTarget",h.formTarget,h,null)):(Ot(e,i,"encType",h.encType,h,null),Ot(e,i,"method",h.method,h,null),Ot(e,i,"target",h.target,h,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=Cl(""+r),e.setAttribute(s,r);break;case"onClick":r!=null&&(e.onclick=Ti);break;case"onScroll":r!=null&&xt("scroll",e);break;case"onScrollEnd":r!=null&&xt("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(s=r.__html,s!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}s=Cl(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""+r):e.removeAttribute(s);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,""):e.removeAttribute(s);break;case"capture":case"download":r===!0?e.setAttribute(s,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,r):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(s,r):e.removeAttribute(s);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(s):e.setAttribute(s,r);break;case"popover":xt("beforetoggle",e),xt("toggle",e),Tl(e,"popover",r);break;case"xlinkActuate":Si(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Si(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Si(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Si(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Si(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Si(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Si(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Si(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Si(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Tl(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=fx.get(s)||s,Tl(e,s,r))}}function oc(e,i,s,r,h,d){switch(s){case"style":hf(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(s=r.__html,s!=null){if(h.children!=null)throw Error(a(60));e.innerHTML=s}}break;case"children":typeof r=="string"?ss(e,r):(typeof r=="number"||typeof r=="bigint")&&ss(e,""+r);break;case"onScroll":r!=null&&xt("scroll",e);break;case"onScrollEnd":r!=null&&xt("scrollend",e);break;case"onClick":r!=null&&(e.onclick=Ti);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ef.hasOwnProperty(s))t:{if(s[0]==="o"&&s[1]==="n"&&(h=s.endsWith("Capture"),i=s.slice(2,h?s.length-7:void 0),d=e[Te]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(i,d,h),typeof r=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(i,r,h);break t}s in e?e[s]=r:r===!0?e.setAttribute(s,""):Tl(e,s,r)}}}function pe(e,i,s){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":xt("error",e),xt("load",e);var r=!1,h=!1,d;for(d in s)if(s.hasOwnProperty(d)){var g=s[d];if(g!=null)switch(d){case"src":r=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(e,i,d,g,s,null)}}h&&Ot(e,i,"srcSet",s.srcSet,s,null),r&&Ot(e,i,"src",s.src,s,null);return;case"input":xt("invalid",e);var v=d=g=h=null,C=null,k=null;for(r in s)if(s.hasOwnProperty(r)){var q=s[r];if(q!=null)switch(r){case"name":h=q;break;case"type":g=q;break;case"checked":C=q;break;case"defaultChecked":k=q;break;case"value":d=q;break;case"defaultValue":v=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:Ot(e,i,r,q,s,null)}}rf(e,d,v,C,k,g,h,!1);return;case"select":xt("invalid",e),r=g=d=null;for(h in s)if(s.hasOwnProperty(h)&&(v=s[h],v!=null))switch(h){case"value":d=v;break;case"defaultValue":g=v;break;case"multiple":r=v;default:Ot(e,i,h,v,s,null)}i=d,s=g,e.multiple=!!r,i!=null?ns(e,!!r,i,!1):s!=null&&ns(e,!!r,s,!0);return;case"textarea":xt("invalid",e),d=h=r=null;for(g in s)if(s.hasOwnProperty(g)&&(v=s[g],v!=null))switch(g){case"value":r=v;break;case"defaultValue":h=v;break;case"children":d=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(a(91));break;default:Ot(e,i,g,v,s,null)}uf(e,r,h,d);return;case"option":for(C in s)if(s.hasOwnProperty(C)&&(r=s[C],r!=null))switch(C){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ot(e,i,C,r,s,null)}return;case"dialog":xt("beforetoggle",e),xt("toggle",e),xt("cancel",e),xt("close",e);break;case"iframe":case"object":xt("load",e);break;case"video":case"audio":for(r=0;r<Oa.length;r++)xt(Oa[r],e);break;case"image":xt("error",e),xt("load",e);break;case"details":xt("toggle",e);break;case"embed":case"source":case"link":xt("error",e),xt("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(k in s)if(s.hasOwnProperty(k)&&(r=s[k],r!=null))switch(k){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ot(e,i,k,r,s,null)}return;default:if(So(i)){for(q in s)s.hasOwnProperty(q)&&(r=s[q],r!==void 0&&oc(e,i,q,r,s,void 0));return}}for(v in s)s.hasOwnProperty(v)&&(r=s[v],r!=null&&Ot(e,i,v,r,s,null))}function L_(e,i,s,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,d=null,g=null,v=null,C=null,k=null,q=null;for(j in s){var F=s[j];if(s.hasOwnProperty(j)&&F!=null)switch(j){case"checked":break;case"value":break;case"defaultValue":C=F;default:r.hasOwnProperty(j)||Ot(e,i,j,null,r,F)}}for(var H in r){var j=r[H];if(F=s[H],r.hasOwnProperty(H)&&(j!=null||F!=null))switch(H){case"type":d=j;break;case"name":h=j;break;case"checked":k=j;break;case"defaultChecked":q=j;break;case"value":g=j;break;case"defaultValue":v=j;break;case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(a(137,i));break;default:j!==F&&Ot(e,i,H,j,r,F)}}bo(e,g,v,C,k,q,d,h);return;case"select":j=g=v=H=null;for(d in s)if(C=s[d],s.hasOwnProperty(d)&&C!=null)switch(d){case"value":break;case"multiple":j=C;default:r.hasOwnProperty(d)||Ot(e,i,d,null,r,C)}for(h in r)if(d=r[h],C=s[h],r.hasOwnProperty(h)&&(d!=null||C!=null))switch(h){case"value":H=d;break;case"defaultValue":v=d;break;case"multiple":g=d;default:d!==C&&Ot(e,i,h,d,r,C)}i=v,s=g,r=j,H!=null?ns(e,!!s,H,!1):!!r!=!!s&&(i!=null?ns(e,!!s,i,!0):ns(e,!!s,s?[]:"",!1));return;case"textarea":j=H=null;for(v in s)if(h=s[v],s.hasOwnProperty(v)&&h!=null&&!r.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ot(e,i,v,null,r,h)}for(g in r)if(h=r[g],d=s[g],r.hasOwnProperty(g)&&(h!=null||d!=null))switch(g){case"value":H=h;break;case"defaultValue":j=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(a(91));break;default:h!==d&&Ot(e,i,g,h,r,d)}of(e,H,j);return;case"option":for(var st in s)if(H=s[st],s.hasOwnProperty(st)&&H!=null&&!r.hasOwnProperty(st))switch(st){case"selected":e.selected=!1;break;default:Ot(e,i,st,null,r,H)}for(C in r)if(H=r[C],j=s[C],r.hasOwnProperty(C)&&H!==j&&(H!=null||j!=null))switch(C){case"selected":e.selected=H&&typeof H!="function"&&typeof H!="symbol";break;default:Ot(e,i,C,H,r,j)}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 ut in s)H=s[ut],s.hasOwnProperty(ut)&&H!=null&&!r.hasOwnProperty(ut)&&Ot(e,i,ut,null,r,H);for(k in r)if(H=r[k],j=s[k],r.hasOwnProperty(k)&&H!==j&&(H!=null||j!=null))switch(k){case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(a(137,i));break;default:Ot(e,i,k,H,r,j)}return;default:if(So(i)){for(var Gt in s)H=s[Gt],s.hasOwnProperty(Gt)&&H!==void 0&&!r.hasOwnProperty(Gt)&&oc(e,i,Gt,void 0,r,H);for(q in r)H=r[q],j=s[q],!r.hasOwnProperty(q)||H===j||H===void 0&&j===void 0||oc(e,i,q,H,r,j);return}}for(var B in s)H=s[B],s.hasOwnProperty(B)&&H!=null&&!r.hasOwnProperty(B)&&Ot(e,i,B,null,r,H);for(F in r)H=r[F],j=s[F],!r.hasOwnProperty(F)||H===j||H==null&&j==null||Ot(e,i,F,H,r,j)}function fp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function j_(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,s=performance.getEntriesByType("resource"),r=0;r<s.length;r++){var h=s[r],d=h.transferSize,g=h.initiatorType,v=h.duration;if(d&&v&&fp(g)){for(g=0,v=h.responseEnd,r+=1;r<s.length;r++){var C=s[r],k=C.startTime;if(k>v)break;var q=C.transferSize,F=C.initiatorType;q&&fp(F)&&(C=C.responseEnd,g+=q*(C<v?1:(v-k)/(C-k)))}if(--r,i+=8*(d+g)/(h.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 uc=null,cc=null;function vr(e){return e.nodeType===9?e:e.ownerDocument}function dp(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 mp(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 hc(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 fc=null;function Y_(){var e=window.event;return e&&e.type==="popstate"?e===fc?!1:(fc=e,!0):(fc=null,!1)}var pp=typeof setTimeout=="function"?setTimeout:void 0,q_=typeof clearTimeout=="function"?clearTimeout:void 0,yp=typeof Promise=="function"?Promise:void 0,X_=typeof queueMicrotask=="function"?queueMicrotask:typeof yp<"u"?function(e){return yp.resolve(null).then(e).catch(V_)}:pp;function V_(e){setTimeout(function(){throw e})}function mn(e){return e==="head"}function gp(e,i){var s=i,r=0;do{var h=s.nextSibling;if(e.removeChild(s),h&&h.nodeType===8)if(s=h.data,s==="/$"||s==="/&"){if(r===0){e.removeChild(h),Us(i);return}r--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")r++;else if(s==="html")Ua(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,Ua(s);for(var d=s.firstChild;d;){var g=d.nextSibling,v=d.nodeName;d[$s]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=g}}else s==="body"&&Ua(e.ownerDocument.body);s=h}while(s);Us(i)}function xp(e,i){var s=e;e=0;do{var r=s.nextSibling;if(s.nodeType===1?i?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(i?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),r&&r.nodeType===8)if(s=r.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=r}while(s)}function dc(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var s=i;switch(i=i.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":dc(s),xo(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function P_(e,i,s,r){for(;e.nodeType===1;){var h=s;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[$s])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==h.rel||e.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||e.getAttribute("title")!==(h.title==null?null:h.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(h.src==null?null:h.src)||e.getAttribute("type")!==(h.type==null?null:h.type)||e.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var d=h.name==null?null:""+h.name;if(h.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=$e(e.nextSibling),e===null)break}return null}function F_(e,i,s){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=$e(e.nextSibling),e===null))return null;return e}function _p(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=$e(e.nextSibling),e===null))return null;return e}function mc(e){return e.data==="$?"||e.data==="$~"}function pc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Q_(e,i){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||s.readyState!=="loading")i();else{var r=function(){i(),s.removeEventListener("DOMContentLoaded",r)};s.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function $e(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 yc=null;function bp(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(i===0)return $e(e.nextSibling);i--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||i++}e=e.nextSibling}return null}function vp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(i===0)return e;i--}else s!=="/$"&&s!=="/&"||i++}e=e.previousSibling}return null}function Sp(e,i,s){switch(i=vr(s),e){case"html":if(e=i.documentElement,!e)throw Error(a(452));return e;case"head":if(e=i.head,!e)throw Error(a(453));return e;case"body":if(e=i.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Ua(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);xo(e)}var ti=new Map,Tp=new Set;function Sr(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Li=L.d;L.d={f:W_,r:Z_,D:I_,C:K_,L:J_,m:$_,X:e1,S:t1,M:i1};function W_(){var e=Li.f(),i=dr();return e||i}function Z_(e){var i=ts(e);i!==null&&i.tag===5&&i.type==="form"?jd(i):Li.r(e)}var Bs=typeof document>"u"?null:document;function wp(e,i,s){var r=Bs;if(r&&typeof i=="string"&&i){var h=Fe(i);h='link[rel="'+e+'"][href="'+h+'"]',typeof s=="string"&&(h+='[crossorigin="'+s+'"]'),Tp.has(h)||(Tp.add(h),e={rel:e,crossOrigin:s,href:i},r.querySelector(h)===null&&(i=r.createElement("link"),pe(i,"link",e),oe(i),r.head.appendChild(i)))}}function I_(e){Li.D(e),wp("dns-prefetch",e,null)}function K_(e,i){Li.C(e,i),wp("preconnect",e,i)}function J_(e,i,s){Li.L(e,i,s);var r=Bs;if(r&&e&&i){var h='link[rel="preload"][as="'+Fe(i)+'"]';i==="image"&&s&&s.imageSrcSet?(h+='[imagesrcset="'+Fe(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(h+='[imagesizes="'+Fe(s.imageSizes)+'"]')):h+='[href="'+Fe(e)+'"]';var d=h;switch(i){case"style":d=Os(e);break;case"script":d=Gs(e)}ti.has(d)||(e=x({rel:"preload",href:i==="image"&&s&&s.imageSrcSet?void 0:e,as:i},s),ti.set(d,e),r.querySelector(h)!==null||i==="style"&&r.querySelector(Na(d))||i==="script"&&r.querySelector(ka(d))||(i=r.createElement("link"),pe(i,"link",e),oe(i),r.head.appendChild(i)))}}function $_(e,i){Li.m(e,i);var s=Bs;if(s&&e){var r=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Fe(r)+'"][href="'+Fe(e)+'"]',d=h;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Gs(e)}if(!ti.has(d)&&(e=x({rel:"modulepreload",href:e},i),ti.set(d,e),s.querySelector(h)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(ka(d)))return}r=s.createElement("link"),pe(r,"link",e),oe(r),s.head.appendChild(r)}}}function t1(e,i,s){Li.S(e,i,s);var r=Bs;if(r&&e){var h=es(r).hoistableStyles,d=Os(e);i=i||"default";var g=h.get(d);if(!g){var v={loading:0,preload:null};if(g=r.querySelector(Na(d)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":i},s),(s=ti.get(d))&&gc(e,s);var C=g=r.createElement("link");oe(C),pe(C,"link",e),C._p=new Promise(function(k,q){C.onload=k,C.onerror=q}),C.addEventListener("load",function(){v.loading|=1}),C.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Tr(g,i,r)}g={type:"stylesheet",instance:g,count:1,state:v},h.set(d,g)}}}function e1(e,i){Li.X(e,i);var s=Bs;if(s&&e){var r=es(s).hoistableScripts,h=Gs(e),d=r.get(h);d||(d=s.querySelector(ka(h)),d||(e=x({src:e,async:!0},i),(i=ti.get(h))&&xc(e,i),d=s.createElement("script"),oe(d),pe(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(h,d))}}function i1(e,i){Li.M(e,i);var s=Bs;if(s&&e){var r=es(s).hoistableScripts,h=Gs(e),d=r.get(h);d||(d=s.querySelector(ka(h)),d||(e=x({src:e,async:!0,type:"module"},i),(i=ti.get(h))&&xc(e,i),d=s.createElement("script"),oe(d),pe(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(h,d))}}function Ap(e,i,s,r){var h=(h=ct.current)?Sr(h):null;if(!h)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(i=Os(s.href),s=es(h).hoistableStyles,r=s.get(i),r||(r={type:"style",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Os(s.href);var d=es(h).hoistableStyles,g=d.get(e);if(g||(h=h.ownerDocument||h,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,g),(d=h.querySelector(Na(e)))&&!d._p&&(g.instance=d,g.state.loading=5),ti.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},ti.set(e,s),d||n1(h,e,s,g.state))),i&&r===null)throw Error(a(528,""));return g}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=s.async,s=s.src,typeof s=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Gs(s),s=es(h).hoistableScripts,r=s.get(i),r||(r={type:"script",instance:null,count:0,state:null},s.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Os(e){return'href="'+Fe(e)+'"'}function Na(e){return'link[rel="stylesheet"]['+e+"]"}function Cp(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function n1(e,i,s,r){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=e.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),pe(i,"link",s),oe(i),e.head.appendChild(i))}function Gs(e){return'[src="'+Fe(e)+'"]'}function ka(e){return"script[async]"+e}function Mp(e,i,s){if(i.count++,i.instance===null)switch(i.type){case"style":var r=e.querySelector('style[data-href~="'+Fe(s.href)+'"]');if(r)return i.instance=r,oe(r),r;var h=x({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),oe(r),pe(r,"style",h),Tr(r,s.precedence,e),i.instance=r;case"stylesheet":h=Os(s.href);var d=e.querySelector(Na(h));if(d)return i.state.loading|=4,i.instance=d,oe(d),d;r=Cp(s),(h=ti.get(h))&&gc(r,h),d=(e.ownerDocument||e).createElement("link"),oe(d);var g=d;return g._p=new Promise(function(v,C){g.onload=v,g.onerror=C}),pe(d,"link",r),i.state.loading|=4,Tr(d,s.precedence,e),i.instance=d;case"script":return d=Gs(s.src),(h=e.querySelector(ka(d)))?(i.instance=h,oe(h),h):(r=s,(h=ti.get(d))&&(r=x({},s),xc(r,h)),e=e.ownerDocument||e,h=e.createElement("script"),oe(h),pe(h,"link",r),e.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,Tr(r,s.precedence,e));return i.instance}function Tr(e,i,s){for(var r=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=r.length?r[r.length-1]:null,d=h,g=0;g<r.length;g++){var v=r[g];if(v.dataset.precedence===i)d=v;else if(d!==h)break}d?d.parentNode.insertBefore(e,d.nextSibling):(i=s.nodeType===9?s.head:s,i.insertBefore(e,i.firstChild))}function gc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function xc(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var wr=null;function Ep(e,i,s){if(wr===null){var r=new Map,h=wr=new Map;h.set(s,r)}else h=wr,r=h.get(s),r||(r=new Map,h.set(s,r));if(r.has(e))return r;for(r.set(e,null),s=s.getElementsByTagName(e),h=0;h<s.length;h++){var d=s[h];if(!(d[$s]||d[he]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var g=d.getAttribute(i)||"";g=e+g;var v=r.get(g);v?v.push(d):r.set(g,[d])}}return r}function Rp(e,i,s){e=e.ownerDocument||e,e.head.insertBefore(s,i==="title"?e.querySelector("head > title"):null)}function s1(e,i,s){if(s===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 zp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function a1(e,i,s,r){if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var h=Os(r.href),d=i.querySelector(Na(h));if(d){i=d._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Ar.bind(e),i.then(e,e)),s.state.loading|=4,s.instance=d,oe(d);return}d=i.ownerDocument||i,r=Cp(r),(h=ti.get(h))&&gc(r,h),d=d.createElement("link"),oe(d);var g=d;g._p=new Promise(function(v,C){g.onload=v,g.onerror=C}),pe(d,"link",r),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,i),(i=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Ar.bind(e),i.addEventListener("load",s),i.addEventListener("error",s))}}var _c=0;function l1(e,i){return e.stylesheets&&e.count===0&&Mr(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var r=setTimeout(function(){if(e.stylesheets&&Mr(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+i);0<e.imgBytes&&_c===0&&(_c=62500*j_());var h=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Mr(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>_c?50:800)+i);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(h)}}:null}function Ar(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Mr(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Cr=null;function Mr(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Cr=new Map,i.forEach(r1,e),Cr=null,Ar.call(e))}function r1(e,i){if(!(i.state.loading&4)){var s=Cr.get(e);if(s)var r=s.get(null);else{s=new Map,Cr.set(e,s);for(var h=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<h.length;d++){var g=h[d];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(s.set(g.dataset.precedence,g),r=g)}r&&s.set(null,r)}h=i.instance,g=h.getAttribute("data-precedence"),d=s.get(g)||r,d===r&&s.set(null,h),s.set(g,h),this.count++,r=Ar.bind(this),h.addEventListener("load",r),h.addEventListener("error",r),d?d.parentNode.insertBefore(h,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(h,e.firstChild)),i.state.loading|=4}}var Ha={$$typeof:D,Provider:null,Consumer:null,_currentValue:nt,_currentValue2:nt,_threadCount:0};function o1(e,i,s,r,h,d,g,v,C){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=mo(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=mo(0),this.hiddenUpdates=mo(null),this.identifierPrefix=r,this.onUncaughtError=h,this.onCaughtError=d,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Dp(e,i,s,r,h,d,g,v,C,k,q,F){return e=new o1(e,i,s,g,C,k,q,F,v),i=1,d===!0&&(i|=24),d=Ne(3,null,null,i),e.current=d,d.stateNode=e,i=Jo(),i.refCount++,e.pooledCache=i,i.refCount++,d.memoizedState={element:r,isDehydrated:s,cache:i},iu(d),e}function Bp(e){return e?(e=hs,e):hs}function Op(e,i,s,r,h,d){h=Bp(h),r.context===null?r.context=h:r.pendingContext=h,r=nn(i),r.payload={element:s},d=d===void 0?null:d,d!==null&&(r.callback=d),s=sn(e,r,i),s!==null&&(Re(s,e,i),ya(s,e,i))}function Gp(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<i?s:i}}function bc(e,i){Gp(e,i),(e=e.alternate)&&Gp(e,i)}function Up(e){if(e.tag===13||e.tag===31){var i=En(e,67108864);i!==null&&Re(i,e,67108864),bc(e,67108864)}}function Np(e){if(e.tag===13||e.tag===31){var i=Ye();i=po(i);var s=En(e,i);s!==null&&Re(s,e,i),bc(e,i)}}var Er=!0;function u1(e,i,s,r){var h=R.T;R.T=null;var d=L.p;try{L.p=2,vc(e,i,s,r)}finally{L.p=d,R.T=h}}function c1(e,i,s,r){var h=R.T;R.T=null;var d=L.p;try{L.p=8,vc(e,i,s,r)}finally{L.p=d,R.T=h}}function vc(e,i,s,r){if(Er){var h=Sc(r);if(h===null)rc(e,i,r,Rr,s),Hp(e,r);else if(f1(h,e,i,s,r))r.stopPropagation();else if(Hp(e,r),i&4&&-1<h1.indexOf(e)){for(;h!==null;){var d=ts(h);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var g=Tn(d.pendingLanes);if(g!==0){var v=d;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var C=1<<31-Ge(g);v.entanglements[1]|=C,g&=~C}xi(d),(Rt&6)===0&&(hr=Be()+500,Ba(0))}}break;case 31:case 13:v=En(d,2),v!==null&&Re(v,d,2),dr(),bc(d,2)}if(d=Sc(r),d===null&&rc(e,i,r,Rr,s),d===h)break;h=d}h!==null&&r.stopPropagation()}else rc(e,i,r,null,s)}}function Sc(e){return e=wo(e),Tc(e)}var Rr=null;function Tc(e){if(Rr=null,e=$n(e),e!==null){var i=o(e);if(i===null)e=null;else{var s=i.tag;if(s===13){if(e=c(i),e!==null)return e;e=null}else if(s===31){if(e=f(i),e!==null)return e;e=null}else if(s===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Rr=e,null}function kp(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(I0()){case Vh:return 2;case Ph:return 8;case xl:case K0:return 32;case Fh:return 268435456;default:return 32}default:return 32}}var wc=!1,pn=null,yn=null,gn=null,La=new Map,ja=new Map,xn=[],h1="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 Hp(e,i){switch(e){case"focusin":case"focusout":pn=null;break;case"dragenter":case"dragleave":yn=null;break;case"mouseover":case"mouseout":gn=null;break;case"pointerover":case"pointerout":La.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ja.delete(i.pointerId)}}function Ya(e,i,s,r,h,d){return e===null||e.nativeEvent!==d?(e={blockedOn:i,domEventName:s,eventSystemFlags:r,nativeEvent:d,targetContainers:[h]},i!==null&&(i=ts(i),i!==null&&Up(i)),e):(e.eventSystemFlags|=r,i=e.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),e)}function f1(e,i,s,r,h){switch(i){case"focusin":return pn=Ya(pn,e,i,s,r,h),!0;case"dragenter":return yn=Ya(yn,e,i,s,r,h),!0;case"mouseover":return gn=Ya(gn,e,i,s,r,h),!0;case"pointerover":var d=h.pointerId;return La.set(d,Ya(La.get(d)||null,e,i,s,r,h)),!0;case"gotpointercapture":return d=h.pointerId,ja.set(d,Ya(ja.get(d)||null,e,i,s,r,h)),!0}return!1}function Lp(e){var i=$n(e.target);if(i!==null){var s=o(i);if(s!==null){if(i=s.tag,i===13){if(i=c(s),i!==null){e.blockedOn=i,Jh(e.priority,function(){Np(s)});return}}else if(i===31){if(i=f(s),i!==null){e.blockedOn=i,Jh(e.priority,function(){Np(s)});return}}else if(i===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function zr(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var s=Sc(e.nativeEvent);if(s===null){s=e.nativeEvent;var r=new s.constructor(s.type,s);To=r,s.target.dispatchEvent(r),To=null}else return i=ts(s),i!==null&&Up(i),e.blockedOn=s,!1;i.shift()}return!0}function jp(e,i,s){zr(e)&&s.delete(i)}function d1(){wc=!1,pn!==null&&zr(pn)&&(pn=null),yn!==null&&zr(yn)&&(yn=null),gn!==null&&zr(gn)&&(gn=null),La.forEach(jp),ja.forEach(jp)}function Dr(e,i){e.blockedOn===i&&(e.blockedOn=null,wc||(wc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,d1)))}var Br=null;function Yp(e){Br!==e&&(Br=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){Br===e&&(Br=null);for(var i=0;i<e.length;i+=3){var s=e[i],r=e[i+1],h=e[i+2];if(typeof r!="function"){if(Tc(r||s)===null)continue;break}var d=ts(s);d!==null&&(e.splice(i,3),i-=3,Su(d,{pending:!0,data:h,method:s.method,action:r},r,h))}}))}function Us(e){function i(C){return Dr(C,e)}pn!==null&&Dr(pn,e),yn!==null&&Dr(yn,e),gn!==null&&Dr(gn,e),La.forEach(i),ja.forEach(i);for(var s=0;s<xn.length;s++){var r=xn[s];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xn.length&&(s=xn[0],s.blockedOn===null);)Lp(s),s.blockedOn===null&&xn.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(r=0;r<s.length;r+=3){var h=s[r],d=s[r+1],g=h[Te]||null;if(typeof d=="function")g||Yp(s);else if(g){var v=null;if(d&&d.hasAttribute("formAction")){if(h=d,g=d[Te]||null)v=g.formAction;else if(Tc(h)!==null)continue}else v=g.action;typeof v=="function"?s[r+1]=v:(s.splice(r,3),r-=3),Yp(s)}}}function qp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(g){return h=g})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),r||setTimeout(s,20)}function s(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,h=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(s,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function Ac(e){this._internalRoot=e}Or.prototype.render=Ac.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(a(409));var s=i.current,r=Ye();Op(s,r,e,i,null,null)},Or.prototype.unmount=Ac.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;Op(e.current,2,null,e,null,null),dr(),i[Jn]=null}};function Or(e){this._internalRoot=e}Or.prototype.unstable_scheduleHydration=function(e){if(e){var i=Kh();e={blockedOn:null,target:e,priority:i};for(var s=0;s<xn.length&&i!==0&&i<xn[s].priority;s++);xn.splice(s,0,e),s===0&&Lp(e)}};var Xp=t.version;if(Xp!=="19.2.4")throw Error(a(527,Xp,"19.2.4"));L.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(i),e=e!==null?y(e):null,e=e===null?null:e.stateNode,e};var m1={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:R,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gr=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gr.isDisabled&&Gr.supportsFiber)try{Is=Gr.inject(m1),Oe=Gr}catch{}}return Xa.createRoot=function(e,i){if(!u(e))throw Error(a(299));var s=!1,r="",h=Id,d=Kd,g=Jd;return i!=null&&(i.unstable_strictMode===!0&&(s=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(d=i.onCaughtError),i.onRecoverableError!==void 0&&(g=i.onRecoverableError)),i=Dp(e,1,!1,null,null,s,r,null,h,d,g,qp),e[Jn]=i.current,lc(e),new Ac(i)},Xa.hydrateRoot=function(e,i,s){if(!u(e))throw Error(a(299));var r=!1,h="",d=Id,g=Kd,v=Jd,C=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(h=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(g=s.onCaughtError),s.onRecoverableError!==void 0&&(v=s.onRecoverableError),s.formState!==void 0&&(C=s.formState)),i=Dp(e,1,!0,i,s??null,r,h,C,d,g,v,qp),i.context=Bp(null),s=i.current,r=Ye(),r=po(r),h=nn(r),h.callback=null,sn(s,h,r),s=r,i.current.lanes=s,Js(i,s),xi(i),e[Jn]=i.current,lc(e),new Or(i)},Xa.version="19.2.4",Xa}var $p;function C1(){if($p)return Ec.exports;$p=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(t){console.error(t)}}return l(),Ec.exports=A1(),Ec.exports}var M1=C1();const ty=l=>{let t;const n=new Set,a=(p,y)=>{const x=typeof p=="function"?p(t):p;if(!Object.is(x,t)){const b=t;t=y??(typeof x!="object"||x===null)?x:Object.assign({},t,x),n.forEach(_=>_(t,b))}},u=()=>t,f={setState:a,getState:u,getInitialState:()=>m,subscribe:p=>(n.add(p),()=>n.delete(p))},m=t=l(a,u,f);return f},E1=(l=>l?ty(l):ty),R1=l=>l;function z1(l,t=R1){const n=Ur.useSyncExternalStore(l.subscribe,Ur.useCallback(()=>t(l.getState()),[l,t]),Ur.useCallback(()=>t(l.getInitialState()),[l,t]));return Ur.useDebugValue(n),n}const ey=l=>{const t=E1(l),n=a=>z1(t,a);return Object.assign(n,t),n},D1=(l=>l?ey(l):ey);let B1=0;const Mt=D1(l=>({connected:!1,agents:[],tasks:[],messages:[],prs:[],sprint:null,selectedPR:null,wowEvents:[],activity:[],setConnected:t=>l({connected:t}),setAgents:t=>l({agents:t}),setTasks:t=>l({tasks:t}),setSprint:t=>l({sprint:t}),setPRs:t=>l({prs:t}),setSelectedPR:t=>l({selectedPR:t}),addMessage:t=>l(n=>({messages:[...n.messages.slice(-199),t]})),updateAgent:(t,n)=>l(a=>({agents:a.agents.map(u=>u.id===t?{...u,...n}:u)})),updateTask:(t,n)=>l(a=>({tasks:a.tasks.map(u=>u.id===t?{...u,...n}:u)})),addPR:t=>l(n=>({prs:[...n.prs,t]})),updatePR:(t,n)=>l(a=>({prs:a.prs.map(u=>u.id===t?{...u,...n}:u)})),pushWow:t=>l(n=>({wowEvents:[...n.wowEvents,t]})),popWow:()=>{const n=Mt.getState().wowEvents;if(n.length===0)return;const a=n[0];return Mt.setState({wowEvents:n.slice(1)}),a},pushActivity:t=>l(n=>({activity:[...n.activity.slice(-299),{...t,id:`act-${++B1}`,time:new Date().toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}]}))})),iy={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},O1={coding:"is writing code",reviewing:"is reviewing files",testing:"is running tests",planning:"is planning the sprint",blocked:"is blocked!",deploying:"is deploying",thinking:"is thinking...",idle:"finished and is idle"};function G1(){const l=ni.useRef(null),{setAgents:t,setTasks:n,setPRs:a,addMessage:u,updateAgent:o,updateTask:c,addPR:f,updatePR:m,pushActivity:p}=Mt.getState();ni.useEffect(()=>{function y(){const _=window.location.protocol==="https:"?"wss:":"ws:",T=new WebSocket(`${_}//${window.location.host}`);l.current=T,T.onopen=()=>{Mt.setState({connected:!0}),p({agentId:null,icon:"🟢",text:"Connected to Sage Team server",type:"system"})},T.onclose=()=>{Mt.setState({connected:!1}),setTimeout(y,2e3)},T.onerror=()=>{T.close()},T.onmessage=w=>{try{const S=JSON.parse(w.data);b(S)}catch{}}}function x(_){return`${iy[_]||"🤖"} ${_}`}function b(_){var A,z;const T=_.type,w=_.agentId,S=_.data||{};switch(T){case"snapshot":_.agents&&t(_.agents),_.tasks&&n(_.tasks),_.prs&&a(_.prs),p({agentId:null,icon:"📡",text:`Loaded ${((A=_.agents)==null?void 0:A.length)||0} agents, ${((z=_.tasks)==null?void 0:z.length)||0} tasks`,type:"system"});break;case"agent:status":if(o(w,{status:S.status||_.status}),S.status&&S.status!=="idle"){const D=O1[S.status]||`is ${S.status}`;p({agentId:w,icon:iy[w]||"🤖",text:`${w} ${D}`,type:"agent"})}break;case"agent:move":o(w,{position_room:S.room||_.room,position_seat:S.seat||_.seat});break;case"task:status":c(S.taskId||_.taskId,{status:S.status||_.status});break;case"task:assigned":c(S.taskId||_.taskId,{assigned_to:w,status:"in_progress"}),o(w,{current_task_id:S.taskId||_.taskId,status:"coding"}),p({agentId:w,icon:"📝",text:`Task assigned to ${x(w)}`,type:"task"});break;case"task:completed":c(S.taskId||_.taskId,{status:"done"}),p({agentId:w,icon:"✅",text:`${x(w)} completed a task`,type:"success"});break;case"task:failed":p({agentId:w,icon:"❌",text:`${x(w)} task failed`,type:"warning"});break;case"message":u(_.message||S);break;case"pr:created":f(_.pr||S),p({agentId:S.agentId||w,icon:"📦",text:`${x(w)} opened a pull request (branch: ${S.branch||"?"})`,type:"info"});break;case"pr:updated":m(_.prId||S.prId,_.updates||S);break;case"pr:merged":Mt.getState().pushWow({type:"pr:merged",agentId:w||S.agentId,title:S.title||_.title||""}),p({agentId:w,icon:"🎉",text:`PR merged! ${S.title||""}`,type:"success"});break;case"sprint:created":Mt.setState({sprint:_.sprint||S});break;case"sprint:completed":Mt.setState(D=>({sprint:D.sprint?{...D.sprint,status:"completed"}:null})),Mt.getState().pushWow({type:"sprint:complete"}),p({agentId:null,icon:"🏆",text:"Sprint completed!",type:"success"});break;case"system":p({agentId:w,icon:"💬",text:S.message||"System event",type:"system"});break;case"meeting:start":Mt.getState().pushWow({type:"meeting:start",agents:_.agents||S.agents||[]}),p({agentId:null,icon:"🤝",text:"Meeting started",type:"info"});break;case"meeting:end":Mt.getState().pushWow({type:"meeting:end"});break;case"crisis:start":Mt.getState().pushWow({type:"crisis:start",reason:_.reason||S.reason||""}),p({agentId:null,icon:"🚨",text:`Crisis: ${S.reason||_.reason||"unknown"}`,type:"warning"});break;case"crisis:resolved":Mt.getState().pushWow({type:"crisis:resolved"}),p({agentId:null,icon:"✅",text:"Crisis resolved",type:"success"});break;case"deploy:success":Mt.getState().pushWow({type:"deploy:success"}),p({agentId:null,icon:"🚀",text:"Deployment successful!",type:"success"});break;case"pair:start":Mt.getState().pushWow({type:"pair:start",agents:_.agents||S.agents||[]});break;case"pair:end":Mt.getState().pushWow({type:"pair:end"});break}}return y(),()=>{var _;(_=l.current)==null||_.close()}},[])}const U1="modulepreload",N1=function(l){return"/"+l},ny={},el=function(t,n,a){let u=Promise.resolve();if(n&&n.length>0){let c=function(p){return Promise.all(p.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),m=(f==null?void 0:f.nonce)||(f==null?void 0:f.getAttribute("nonce"));u=c(n.map(p=>{if(p=N1(p),p in ny)return;ny[p]=!0;const y=p.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${x}`))return;const b=document.createElement("link");if(b.rel=y?"stylesheet":U1,y||(b.as="script"),b.crossOrigin="",b.href=p,m&&b.setAttribute("nonce",m),document.head.appendChild(b),y)return new Promise((_,T)=>{b.addEventListener("load",_),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${p}`)))})}))}function o(c){const f=new Event("vite:preloadError",{cancelable:!0});if(f.payload=c,window.dispatchEvent(f),!f.defaultPrevented)throw c}return u.then(c=>{for(const f of c||[])f.status==="rejected"&&o(f.reason);return t().catch(o)})};var yt=(l=>(l.Application="application",l.WebGLPipes="webgl-pipes",l.WebGLPipesAdaptor="webgl-pipes-adaptor",l.WebGLSystem="webgl-system",l.WebGPUPipes="webgpu-pipes",l.WebGPUPipesAdaptor="webgpu-pipes-adaptor",l.WebGPUSystem="webgpu-system",l.CanvasSystem="canvas-system",l.CanvasPipesAdaptor="canvas-pipes-adaptor",l.CanvasPipes="canvas-pipes",l.Asset="asset",l.LoadParser="load-parser",l.ResolveParser="resolve-parser",l.CacheParser="cache-parser",l.DetectionParser="detection-parser",l.MaskEffect="mask-effect",l.BlendMode="blend-mode",l.TextureSource="texture-source",l.Environment="environment",l.ShapeBuilder="shape-builder",l.Batcher="batcher",l))(yt||{});const lh=l=>{if(typeof l=="function"||typeof l=="object"&&l.extension){if(!l.extension)throw new Error("Extension class must have an extension object");l={...typeof l.extension!="object"?{type:l.extension}:l.extension,ref:l}}if(typeof l=="object")l={...l};else throw new Error("Invalid extension type");return typeof l.type=="string"&&(l.type=[l.type]),l},Nr=(l,t)=>lh(l).priority??t,te={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...l){return l.map(lh).forEach(t=>{t.type.forEach(n=>{var a,u;return(u=(a=this._removeHandlers)[n])==null?void 0:u.call(a,t)})}),this},add(...l){return l.map(lh).forEach(t=>{t.type.forEach(n=>{var o,c;const a=this._addHandlers,u=this._queue;a[n]?(c=a[n])==null||c.call(a,t):(u[n]=u[n]||[],(o=u[n])==null||o.push(t))})}),this},handle(l,t,n){var c;const a=this._addHandlers,u=this._removeHandlers;if(a[l]||u[l])throw new Error(`Extension type ${l} already has a handler`);a[l]=t,u[l]=n;const o=this._queue;return o[l]&&((c=o[l])==null||c.forEach(f=>t(f)),delete o[l]),this},handleByMap(l,t){return this.handle(l,n=>{n.name&&(t[n.name]=n.ref)},n=>{n.name&&delete t[n.name]})},handleByNamedList(l,t,n=-1){return this.handle(l,a=>{t.findIndex(o=>o.name===a.name)>=0||(t.push({name:a.name,value:a.ref}),t.sort((o,c)=>Nr(c.value,n)-Nr(o.value,n)))},a=>{const u=t.findIndex(o=>o.name===a.name);u!==-1&&t.splice(u,1)})},handleByList(l,t,n=-1){return this.handle(l,a=>{t.includes(a.ref)||(t.push(a.ref),t.sort((u,o)=>Nr(o,n)-Nr(u,n)))},a=>{const u=t.indexOf(a.ref);u!==-1&&t.splice(u,1)})},mixin(l,...t){for(const n of t)Object.defineProperties(l.prototype,Object.getOwnPropertyDescriptors(n))}},k1={extension:{type:yt.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await el(()=>import("./browserAll-XFxdM5KU.js"),__vite__mapDeps([0,1,2]))}},H1={extension:{type:yt.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await el(()=>import("./webworkerAll-DU2TvyX8.js"),__vite__mapDeps([1,2]))}};class ye{constructor(t,n,a){this._x=n||0,this._y=a||0,this._observer=t}clone(t){return new ye(t??this._observer,this._x,this._y)}set(t=0,n=t){return(this._x!==t||this._y!==n)&&(this._x=t,this._y=n,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 Bc={exports:{}},sy;function L1(){return sy||(sy=1,(function(l){var t=Object.prototype.hasOwnProperty,n="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(n=!1));function u(m,p,y){this.fn=m,this.context=p,this.once=y||!1}function o(m,p,y,x,b){if(typeof y!="function")throw new TypeError("The listener must be a function");var _=new u(y,x||m,b),T=n?n+p:p;return m._events[T]?m._events[T].fn?m._events[T]=[m._events[T],_]:m._events[T].push(_):(m._events[T]=_,m._eventsCount++),m}function c(m,p){--m._eventsCount===0?m._events=new a:delete m._events[p]}function f(){this._events=new a,this._eventsCount=0}f.prototype.eventNames=function(){var p=[],y,x;if(this._eventsCount===0)return p;for(x in y=this._events)t.call(y,x)&&p.push(n?x.slice(1):x);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(y)):p},f.prototype.listeners=function(p){var y=n?n+p:p,x=this._events[y];if(!x)return[];if(x.fn)return[x.fn];for(var b=0,_=x.length,T=new Array(_);b<_;b++)T[b]=x[b].fn;return T},f.prototype.listenerCount=function(p){var y=n?n+p:p,x=this._events[y];return x?x.fn?1:x.length:0},f.prototype.emit=function(p,y,x,b,_,T){var w=n?n+p:p;if(!this._events[w])return!1;var S=this._events[w],A=arguments.length,z,D;if(S.fn){switch(S.once&&this.removeListener(p,S.fn,void 0,!0),A){case 1:return S.fn.call(S.context),!0;case 2:return S.fn.call(S.context,y),!0;case 3:return S.fn.call(S.context,y,x),!0;case 4:return S.fn.call(S.context,y,x,b),!0;case 5:return S.fn.call(S.context,y,x,b,_),!0;case 6:return S.fn.call(S.context,y,x,b,_,T),!0}for(D=1,z=new Array(A-1);D<A;D++)z[D-1]=arguments[D];S.fn.apply(S.context,z)}else{var G=S.length,P;for(D=0;D<G;D++)switch(S[D].once&&this.removeListener(p,S[D].fn,void 0,!0),A){case 1:S[D].fn.call(S[D].context);break;case 2:S[D].fn.call(S[D].context,y);break;case 3:S[D].fn.call(S[D].context,y,x);break;case 4:S[D].fn.call(S[D].context,y,x,b);break;default:if(!z)for(P=1,z=new Array(A-1);P<A;P++)z[P-1]=arguments[P];S[D].fn.apply(S[D].context,z)}}return!0},f.prototype.on=function(p,y,x){return o(this,p,y,x,!1)},f.prototype.once=function(p,y,x){return o(this,p,y,x,!0)},f.prototype.removeListener=function(p,y,x,b){var _=n?n+p:p;if(!this._events[_])return this;if(!y)return c(this,_),this;var T=this._events[_];if(T.fn)T.fn===y&&(!b||T.once)&&(!x||T.context===x)&&c(this,_);else{for(var w=0,S=[],A=T.length;w<A;w++)(T[w].fn!==y||b&&!T[w].once||x&&T[w].context!==x)&&S.push(T[w]);S.length?this._events[_]=S.length===1?S[0]:S:c(this,_)}return this},f.prototype.removeAllListeners=function(p){var y;return p?(y=n?n+p:p,this._events[y]&&c(this,y)):(this._events=new a,this._eventsCount=0),this},f.prototype.off=f.prototype.removeListener,f.prototype.addListener=f.prototype.on,f.prefixed=n,f.EventEmitter=f,l.exports=f})(Bc)),Bc.exports}var j1=L1();const vi=Ch(j1),Y1=Math.PI*2,q1=180/Math.PI,X1=Math.PI/180;class xe{constructor(t=0,n=0){this.x=0,this.y=0,this.x=t,this.y=n}clone(){return new xe(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,n=t){return this.x=t,this.y=n,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return Oc.x=0,Oc.y=0,Oc}}const Oc=new xe;class vt{constructor(t=1,n=0,a=0,u=1,o=0,c=0){this.array=null,this.a=t,this.b=n,this.c=a,this.d=u,this.tx=o,this.ty=c}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,n,a,u,o,c){return this.a=t,this.b=n,this.c=a,this.d=u,this.tx=o,this.ty=c,this}toArray(t,n){this.array||(this.array=new Float32Array(9));const a=n||this.array;return t?(a[0]=this.a,a[1]=this.b,a[2]=0,a[3]=this.c,a[4]=this.d,a[5]=0,a[6]=this.tx,a[7]=this.ty,a[8]=1):(a[0]=this.a,a[1]=this.c,a[2]=this.tx,a[3]=this.b,a[4]=this.d,a[5]=this.ty,a[6]=0,a[7]=0,a[8]=1),a}apply(t,n){n=n||new xe;const a=t.x,u=t.y;return n.x=this.a*a+this.c*u+this.tx,n.y=this.b*a+this.d*u+this.ty,n}applyInverse(t,n){n=n||new xe;const a=this.a,u=this.b,o=this.c,c=this.d,f=this.tx,m=this.ty,p=1/(a*c+o*-u),y=t.x,x=t.y;return n.x=c*p*y+-o*p*x+(m*o-f*c)*p,n.y=a*p*x+-u*p*y+(-m*a+f*u)*p,n}translate(t,n){return this.tx+=t,this.ty+=n,this}scale(t,n){return this.a*=t,this.d*=n,this.c*=t,this.b*=n,this.tx*=t,this.ty*=n,this}rotate(t){const n=Math.cos(t),a=Math.sin(t),u=this.a,o=this.c,c=this.tx;return this.a=u*n-this.b*a,this.b=u*a+this.b*n,this.c=o*n-this.d*a,this.d=o*a+this.d*n,this.tx=c*n-this.ty*a,this.ty=c*a+this.ty*n,this}append(t){const n=this.a,a=this.b,u=this.c,o=this.d;return this.a=t.a*n+t.b*u,this.b=t.a*a+t.b*o,this.c=t.c*n+t.d*u,this.d=t.c*a+t.d*o,this.tx=t.tx*n+t.ty*u+this.tx,this.ty=t.tx*a+t.ty*o+this.ty,this}appendFrom(t,n){const a=t.a,u=t.b,o=t.c,c=t.d,f=t.tx,m=t.ty,p=n.a,y=n.b,x=n.c,b=n.d;return this.a=a*p+u*x,this.b=a*y+u*b,this.c=o*p+c*x,this.d=o*y+c*b,this.tx=f*p+m*x+n.tx,this.ty=f*y+m*b+n.ty,this}setTransform(t,n,a,u,o,c,f,m,p){return this.a=Math.cos(f+p)*o,this.b=Math.sin(f+p)*o,this.c=-Math.sin(f-m)*c,this.d=Math.cos(f-m)*c,this.tx=t-(a*this.a+u*this.c),this.ty=n-(a*this.b+u*this.d),this}prepend(t){const n=this.tx;if(t.a!==1||t.b!==0||t.c!==0||t.d!==1){const a=this.a,u=this.c;this.a=a*t.a+this.b*t.c,this.b=a*t.b+this.b*t.d,this.c=u*t.a+this.d*t.c,this.d=u*t.b+this.d*t.d}return this.tx=n*t.a+this.ty*t.c+t.tx,this.ty=n*t.b+this.ty*t.d+t.ty,this}decompose(t){const n=this.a,a=this.b,u=this.c,o=this.d,c=t.pivot,f=-Math.atan2(-u,o),m=Math.atan2(a,n),p=Math.abs(f+m);return p<1e-5||Math.abs(Y1-p)<1e-5?(t.rotation=m,t.skew.x=t.skew.y=0):(t.rotation=0,t.skew.x=f,t.skew.y=m),t.scale.x=Math.sqrt(n*n+a*a),t.scale.y=Math.sqrt(u*u+o*o),t.position.x=this.tx+(c.x*n+c.y*u),t.position.y=this.ty+(c.x*a+c.y*o),t}invert(){const t=this.a,n=this.b,a=this.c,u=this.d,o=this.tx,c=t*u-n*a;return this.a=u/c,this.b=-n/c,this.c=-a/c,this.d=t/c,this.tx=(a*this.ty-u*o)/c,this.ty=-(t*this.ty-n*o)/c,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 vt;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 P1.identity()}static get shared(){return V1.identity()}}const V1=new vt,P1=new vt,Xn=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],Vn=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],Pn=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],Fn=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],rh=[],xg=[],kr=Math.sign;function F1(){for(let l=0;l<16;l++){const t=[];rh.push(t);for(let n=0;n<16;n++){const a=kr(Xn[l]*Xn[n]+Pn[l]*Vn[n]),u=kr(Vn[l]*Xn[n]+Fn[l]*Vn[n]),o=kr(Xn[l]*Pn[n]+Pn[l]*Fn[n]),c=kr(Vn[l]*Pn[n]+Fn[l]*Fn[n]);for(let f=0;f<16;f++)if(Xn[f]===a&&Vn[f]===u&&Pn[f]===o&&Fn[f]===c){t.push(f);break}}}for(let l=0;l<16;l++){const t=new vt;t.set(Xn[l],Vn[l],Pn[l],Fn[l],0,0),xg.push(t)}}F1();const kt={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:l=>Xn[l],uY:l=>Vn[l],vX:l=>Pn[l],vY:l=>Fn[l],inv:l=>l&8?l&15:-l&7,add:(l,t)=>rh[l][t],sub:(l,t)=>rh[l][kt.inv(t)],rotate180:l=>l^4,isVertical:l=>(l&3)===2,byDirection:(l,t)=>Math.abs(l)*2<=Math.abs(t)?t>=0?kt.S:kt.N:Math.abs(t)*2<=Math.abs(l)?l>0?kt.E:kt.W:t>0?l>0?kt.SE:kt.SW:l>0?kt.NE:kt.NW,matrixAppendRotationInv:(l,t,n=0,a=0,u=0,o=0)=>{const c=xg[kt.inv(t)],f=c.a,m=c.b,p=c.c,y=c.d,x=n-Math.min(0,f*u,p*o,f*u+p*o),b=a-Math.min(0,m*u,y*o,m*u+y*o),_=l.a,T=l.b,w=l.c,S=l.d;l.a=f*_+m*w,l.b=f*T+m*S,l.c=p*_+y*w,l.d=p*T+y*S,l.tx=x*_+b*w+l.tx,l.ty=x*T+b*S+l.ty},transformRectCoords:(l,t,n,a)=>{const{x:u,y:o,width:c,height:f}=l,{x:m,y:p,width:y,height:x}=t;return n===kt.E?(a.set(u+m,o+p,c,f),a):n===kt.S?a.set(y-o-f+m,u+p,f,c):n===kt.W?a.set(y-u-c+m,x-o-f+p,c,f):n===kt.N?a.set(o+m,x-u-c+p,f,c):a.set(u+m,o+p,c,f)}},Hr=[new xe,new xe,new xe,new xe];class $t{constructor(t=0,n=0,a=0,u=0){this.type="rectangle",this.x=Number(t),this.y=Number(n),this.width=Number(a),this.height=Number(u)}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 $t(0,0,0,0)}clone(){return new $t(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,n){return this.width<=0||this.height<=0?!1:t>=this.x&&t<this.x+this.width&&n>=this.y&&n<this.y+this.height}strokeContains(t,n,a,u=.5){const{width:o,height:c}=this;if(o<=0||c<=0)return!1;const f=this.x,m=this.y,p=a*(1-u),y=a-p,x=f-p,b=f+o+p,_=m-p,T=m+c+p,w=f+y,S=f+o-y,A=m+y,z=m+c-y;return t>=x&&t<=b&&n>=_&&n<=T&&!(t>w&&t<S&&n>A&&n<z)}intersects(t,n){if(!n){const et=this.x<t.x?t.x:this.x;if((this.right>t.right?t.right:this.right)<=et)return!1;const X=this.y<t.y?t.y:this.y;return(this.bottom>t.bottom?t.bottom:this.bottom)>X}const a=this.left,u=this.right,o=this.top,c=this.bottom;if(u<=a||c<=o)return!1;const f=Hr[0].set(t.left,t.top),m=Hr[1].set(t.left,t.bottom),p=Hr[2].set(t.right,t.top),y=Hr[3].set(t.right,t.bottom);if(p.x<=f.x||m.y<=f.y)return!1;const x=Math.sign(n.a*n.d-n.b*n.c);if(x===0||(n.apply(f,f),n.apply(m,m),n.apply(p,p),n.apply(y,y),Math.max(f.x,m.x,p.x,y.x)<=a||Math.min(f.x,m.x,p.x,y.x)>=u||Math.max(f.y,m.y,p.y,y.y)<=o||Math.min(f.y,m.y,p.y,y.y)>=c))return!1;const b=x*(m.y-f.y),_=x*(f.x-m.x),T=b*a+_*o,w=b*u+_*o,S=b*a+_*c,A=b*u+_*c;if(Math.max(T,w,S,A)<=b*f.x+_*f.y||Math.min(T,w,S,A)>=b*y.x+_*y.y)return!1;const z=x*(f.y-p.y),D=x*(p.x-f.x),G=z*a+D*o,P=z*u+D*o,N=z*a+D*c,O=z*u+D*c;return!(Math.max(G,P,N,O)<=z*f.x+D*f.y||Math.min(G,P,N,O)>=z*y.x+D*y.y)}pad(t=0,n=t){return this.x-=t,this.y-=n,this.width+=t*2,this.height+=n*2,this}fit(t){const n=Math.max(this.x,t.x),a=Math.min(this.x+this.width,t.x+t.width),u=Math.max(this.y,t.y),o=Math.min(this.y+this.height,t.y+t.height);return this.x=n,this.width=Math.max(a-n,0),this.y=u,this.height=Math.max(o-u,0),this}ceil(t=1,n=.001){const a=Math.ceil((this.x+this.width-n)*t)/t,u=Math.ceil((this.y+this.height-n)*t)/t;return this.x=Math.floor((this.x+n)*t)/t,this.y=Math.floor((this.y+n)*t)/t,this.width=a-this.x,this.height=u-this.y,this}scale(t,n=t){return this.x*=t,this.y*=n,this.width*=t,this.height*=n,this}enlarge(t){const n=Math.min(this.x,t.x),a=Math.max(this.x+this.width,t.x+t.width),u=Math.min(this.y,t.y),o=Math.max(this.y+this.height,t.y+t.height);return this.x=n,this.width=a-n,this.y=u,this.height=o-u,this}getBounds(t){return t||(t=new $t),t.copyFrom(this),t}containsRect(t){if(this.width<=0||this.height<=0)return!1;const n=t.x,a=t.y,u=t.x+t.width,o=t.y+t.height;return n>=this.x&&n<this.x+this.width&&a>=this.y&&a<this.y+this.height&&u>=this.x&&u<this.x+this.width&&o>=this.y&&o<this.y+this.height}set(t,n,a,u){return this.x=t,this.y=n,this.width=a,this.height=u,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const Gc={default:-1};function Wt(l="default"){return Gc[l]===void 0&&(Gc[l]=-1),++Gc[l]}const ay=new Set,Qt="8.0.0",Q1="8.3.4",qs={quiet:!1,noColor:!1},wt=((l,t,n=3)=>{if(qs.quiet||ay.has(t))return;let a=new Error().stack;const u=`${t}
51
+ Deprecated since v${l}`,o=typeof console.groupCollapsed=="function"&&!qs.noColor;typeof a>"u"?console.warn("PixiJS Deprecation Warning: ",u):(a=a.split(`
52
+ `).splice(n).join(`
53
+ `),o?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",u),console.warn(a),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",u),console.warn(a))),ay.add(t)});Object.defineProperties(wt,{quiet:{get:()=>qs.quiet,set:l=>{qs.quiet=l},enumerable:!0,configurable:!1},noColor:{get:()=>qs.noColor,set:l=>{qs.noColor=l},enumerable:!0,configurable:!1}});const _g=()=>{};function Ps(l){return l+=l===0?1:0,--l,l|=l>>>1,l|=l>>>2,l|=l>>>4,l|=l>>>8,l|=l>>>16,l+1}function ly(l){return!(l&l-1)&&!!l}function bg(l){const t={};for(const n in l)l[n]!==void 0&&(t[n]=l[n]);return t}const ry=Object.create(null);function W1(l){const t=ry[l];return t===void 0&&(ry[l]=Wt("resource")),t}const vg=class Sg extends vi{constructor(t={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,t={...Sg.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){wt(Qt,"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=W1(t),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};vg.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Fs=vg;const Tg=class wg extends vi{constructor(t={}){super(),this.options=t,this._gpuData=Object.create(null),this._gcLastUsed=-1,this.uid=Wt("textureSource"),this._resourceType="textureSource",this._resourceId=Wt("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={...wg.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 Fs(bg(t)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(t){var n,a;this.style!==t&&((n=this._style)==null||n.off("change",this._onStyleChange,this),this._style=t,(a=this._style)==null||a.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,n;this._resourceId=Wt("resource"),this.emit("change",this),this.emit("unload",this);for(const a in this._gpuData)(n=(t=this._gpuData[a])==null?void 0:t.destroy)==null||n.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,n,a){a||(a=this._resolution),t||(t=this.width),n||(n=this.height);const u=Math.round(t*a),o=Math.round(n*a);return this.width=u/a,this.height=o/a,this._resolution=a,this.pixelWidth===u&&this.pixelHeight===o?!1:(this._refreshPOT(),this.pixelWidth=u,this.pixelHeight=o,this.emit("resize",this),this._resourceId=Wt("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=ly(this.pixelWidth)&&ly(this.pixelHeight)}static test(t){throw new Error("Unimplemented")}};Tg.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 li=Tg;class Eh extends li{constructor(t){const n=t.resource||new Float32Array(t.width*t.height*4);let a=t.format;a||(n instanceof Float32Array?a="rgba32float":n instanceof Int32Array||n instanceof Uint32Array?a="rgba32uint":n instanceof Int16Array||n instanceof Uint16Array?a="rgba16uint":(n instanceof Int8Array,a="bgra8unorm")),super({...t,resource:n,format:a}),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}}Eh.extension=yt.TextureSource;const oy=new vt;class Z1{constructor(t,n){this.mapCoord=new vt,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof n>"u"?this.clampMargin=t.width<10?0:.5:this.clampMargin=n,this.isSimple=!1,this.texture=t}get texture(){return this._texture}set texture(t){var n;this.texture!==t&&((n=this._texture)==null||n.removeListener("update",this.update,this),this._texture=t,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(t,n){n===void 0&&(n=t);const a=this.mapCoord;for(let u=0;u<t.length;u+=2){const o=t[u],c=t[u+1];n[u]=o*a.a+c*a.c+a.tx,n[u+1]=o*a.b+c*a.d+a.ty}return n}update(){const t=this._texture;this._updateID++;const n=t.uvs;this.mapCoord.set(n.x1-n.x0,n.y1-n.y0,n.x3-n.x0,n.y3-n.y0,n.x0,n.y0);const a=t.orig,u=t.trim;u&&(oy.set(a.width/u.width,0,0,a.height/u.height,-u.x/u.width,-u.y/u.height),this.mapCoord.append(oy));const o=t.source,c=this.uClampFrame,f=this.clampMargin/o._resolution,m=this.clampOffset/o._resolution;return c[0]=(t.frame.x+f+m)/o.width,c[1]=(t.frame.y+f+m)/o.height,c[2]=(t.frame.x+t.frame.width-f+m)/o.width,c[3]=(t.frame.y+t.frame.height-f+m)/o.height,this.uClampOffset[0]=this.clampOffset/o.pixelWidth,this.uClampOffset[1]=this.clampOffset/o.pixelHeight,this.isSimple=t.frame.width===o.width&&t.frame.height===o.height&&t.rotate===0,!0}}class Ut extends vi{constructor({source:t,label:n,frame:a,orig:u,trim:o,defaultAnchor:c,defaultBorders:f,rotate:m,dynamic:p}={}){if(super(),this.uid=Wt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new $t,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=n,this.source=(t==null?void 0:t.source)??new li,this.noFrame=!a,a)this.frame.copyFrom(a);else{const{width:y,height:x}=this._source;this.frame.width=y,this.frame.height=x}this.orig=u||this.frame,this.trim=o,this.rotate=m??0,this.defaultAnchor=c,this.defaultBorders=f,this.destroyed=!1,this.dynamic=p||!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 Z1(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:t,frame:n}=this,{width:a,height:u}=this._source,o=n.x/a,c=n.y/u,f=n.width/a,m=n.height/u;let p=this.rotate;if(p){const y=f/2,x=m/2,b=o+y,_=c+x;p=kt.add(p,kt.NW),t.x0=b+y*kt.uX(p),t.y0=_+x*kt.uY(p),p=kt.add(p,2),t.x1=b+y*kt.uX(p),t.y1=_+x*kt.uY(p),p=kt.add(p,2),t.x2=b+y*kt.uX(p),t.y2=_+x*kt.uY(p),p=kt.add(p,2),t.x3=b+y*kt.uX(p),t.y3=_+x*kt.uY(p)}else t.x0=o,t.y0=c,t.x1=o+f,t.y1=c,t.x2=o+f,t.y2=c+m,t.x3=o,t.y3=c+m}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 wt(Qt,"Texture.baseTexture is now Texture.source"),this._source}}Ut.EMPTY=new Ut({label:"EMPTY",source:new li({label:"EMPTY"})});Ut.EMPTY.destroy=_g;Ut.WHITE=new Ut({source:new Eh({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"});Ut.WHITE.destroy=_g;function Ag(l,t,n){const{width:a,height:u}=n.orig,o=n.trim;if(o){const c=o.width,f=o.height;l.minX=o.x-t._x*a,l.maxX=l.minX+c,l.minY=o.y-t._y*u,l.maxY=l.minY+f}else l.minX=-t._x*a,l.maxX=l.minX+a,l.minY=-t._y*u,l.maxY=l.minY+u}const uy=new vt;class si{constructor(t=1/0,n=1/0,a=-1/0,u=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=uy,this.minX=t,this.minY=n,this.maxX=a,this.maxY=u}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new $t);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=uy,this}set(t,n,a,u){this.minX=t,this.minY=n,this.maxX=a,this.maxY=u}addFrame(t,n,a,u,o){o||(o=this.matrix);const c=o.a,f=o.b,m=o.c,p=o.d,y=o.tx,x=o.ty;let b=this.minX,_=this.minY,T=this.maxX,w=this.maxY,S=c*t+m*n+y,A=f*t+p*n+x;S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*a+m*n+y,A=f*a+p*n+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*t+m*u+y,A=f*t+p*u+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),S=c*a+m*u+y,A=f*a+p*u+x,S<b&&(b=S),A<_&&(_=A),S>T&&(T=S),A>w&&(w=A),this.minX=b,this.minY=_,this.maxX=T,this.maxY=w}addRect(t,n){this.addFrame(t.x,t.y,t.x+t.width,t.y+t.height,n)}addBounds(t,n){this.addFrame(t.minX,t.minY,t.maxX,t.maxY,n)}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 n=this.minX,a=this.minY,u=this.maxX,o=this.maxY,{a:c,b:f,c:m,d:p,tx:y,ty:x}=t;let b=c*n+m*a+y,_=f*n+p*a+x;this.minX=b,this.minY=_,this.maxX=b,this.maxY=_,b=c*u+m*a+y,_=f*u+p*a+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=c*n+m*o+y,_=f*n+p*o+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_:this.maxY,b=c*u+m*o+y,_=f*u+p*o+x,this.minX=b<this.minX?b:this.minX,this.minY=_<this.minY?_:this.minY,this.maxX=b>this.maxX?b:this.maxX,this.maxY=_>this.maxY?_: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,n,a,u){return this.minX<t&&(this.minX=t),this.maxX>n&&(this.maxX=n),this.minY<a&&(this.minY=a),this.maxY>u&&(this.maxY=u),this}pad(t,n=t){return this.minX-=t,this.maxX+=t,this.minY-=n,this.maxY+=n,this}ceil(){return this.minX=Math.floor(this.minX),this.minY=Math.floor(this.minY),this.maxX=Math.ceil(this.maxX),this.maxY=Math.ceil(this.maxY),this}clone(){return new si(this.minX,this.minY,this.maxX,this.maxY)}scale(t,n=t){return this.minX*=t,this.minY*=n,this.maxX*=t,this.maxY*=n,this}get x(){return this.minX}set x(t){const n=this.maxX-this.minX;this.minX=t,this.maxX=t+n}get y(){return this.minY}set y(t){const n=this.maxY-this.minY;this.minY=t,this.maxY=t+n}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,n,a,u){let o=this.minX,c=this.minY,f=this.maxX,m=this.maxY;u||(u=this.matrix);const p=u.a,y=u.b,x=u.c,b=u.d,_=u.tx,T=u.ty;for(let w=n;w<a;w+=2){const S=t[w],A=t[w+1],z=p*S+x*A+_,D=y*S+b*A+T;o=z<o?z:o,c=D<c?D:c,f=z>f?z:f,m=D>m?D:m}this.minX=o,this.minY=c,this.maxX=f,this.maxY=m}containsPoint(t,n){return this.minX<=t&&this.minY<=n&&this.maxX>=t&&this.maxY>=n}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(t){return this.minX=t.minX,this.minY=t.minY,this.maxX=t.maxX,this.maxY=t.maxY,this}}var I1={grad:.9,turn:360,rad:360/(2*Math.PI)},ji=function(l){return typeof l=="string"?l.length>0:typeof l=="number"},ce=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=Math.pow(10,t)),Math.round(n*l)/n+0},ei=function(l,t,n){return t===void 0&&(t=0),n===void 0&&(n=1),l>n?n:l>t?l:t},Cg=function(l){return(l=isFinite(l)?l%360:0)>0?l:l+360},cy=function(l){return{r:ei(l.r,0,255),g:ei(l.g,0,255),b:ei(l.b,0,255),a:ei(l.a)}},Uc=function(l){return{r:ce(l.r),g:ce(l.g),b:ce(l.b),a:ce(l.a,3)}},K1=/^#([0-9a-f]{3,8})$/i,Lr=function(l){var t=l.toString(16);return t.length<2?"0"+t:t},Mg=function(l){var t=l.r,n=l.g,a=l.b,u=l.a,o=Math.max(t,n,a),c=o-Math.min(t,n,a),f=c?o===t?(n-a)/c:o===n?2+(a-t)/c:4+(t-n)/c:0;return{h:60*(f<0?f+6:f),s:o?c/o*100:0,v:o/255*100,a:u}},Eg=function(l){var t=l.h,n=l.s,a=l.v,u=l.a;t=t/360*6,n/=100,a/=100;var o=Math.floor(t),c=a*(1-n),f=a*(1-(t-o)*n),m=a*(1-(1-t+o)*n),p=o%6;return{r:255*[a,f,c,c,m,a][p],g:255*[m,a,a,f,c,c][p],b:255*[c,c,m,a,a,f][p],a:u}},hy=function(l){return{h:Cg(l.h),s:ei(l.s,0,100),l:ei(l.l,0,100),a:ei(l.a)}},fy=function(l){return{h:ce(l.h),s:ce(l.s),l:ce(l.l),a:ce(l.a,3)}},dy=function(l){return Eg((n=(t=l).s,{h:t.h,s:(n*=((a=t.l)<50?a:100-a)/100)>0?2*n/(a+n)*100:0,v:a+n,a:t.a}));var t,n,a},il=function(l){return{h:(t=Mg(l)).h,s:(u=(200-(n=t.s))*(a=t.v)/100)>0&&u<200?n*a/100/(u<=100?u:200-u)*100:0,l:u/2,a:t.a};var t,n,a,u},J1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,$1=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,tb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,eb=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,oh={string:[[function(l){var t=K1.exec(l);return t?(l=t[1]).length<=4?{r:parseInt(l[0]+l[0],16),g:parseInt(l[1]+l[1],16),b:parseInt(l[2]+l[2],16),a:l.length===4?ce(parseInt(l[3]+l[3],16)/255,2):1}:l.length===6||l.length===8?{r:parseInt(l.substr(0,2),16),g:parseInt(l.substr(2,2),16),b:parseInt(l.substr(4,2),16),a:l.length===8?ce(parseInt(l.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(l){var t=tb.exec(l)||eb.exec(l);return t?t[2]!==t[4]||t[4]!==t[6]?null:cy({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(l){var t=J1.exec(l)||$1.exec(l);if(!t)return null;var n,a,u=hy({h:(n=t[1],a=t[2],a===void 0&&(a="deg"),Number(n)*(I1[a]||1)),s:Number(t[3]),l:Number(t[4]),a:t[5]===void 0?1:Number(t[5])/(t[6]?100:1)});return dy(u)},"hsl"]],object:[[function(l){var t=l.r,n=l.g,a=l.b,u=l.a,o=u===void 0?1:u;return ji(t)&&ji(n)&&ji(a)?cy({r:Number(t),g:Number(n),b:Number(a),a:Number(o)}):null},"rgb"],[function(l){var t=l.h,n=l.s,a=l.l,u=l.a,o=u===void 0?1:u;if(!ji(t)||!ji(n)||!ji(a))return null;var c=hy({h:Number(t),s:Number(n),l:Number(a),a:Number(o)});return dy(c)},"hsl"],[function(l){var t=l.h,n=l.s,a=l.v,u=l.a,o=u===void 0?1:u;if(!ji(t)||!ji(n)||!ji(a))return null;var c=(function(f){return{h:Cg(f.h),s:ei(f.s,0,100),v:ei(f.v,0,100),a:ei(f.a)}})({h:Number(t),s:Number(n),v:Number(a),a:Number(o)});return Eg(c)},"hsv"]]},my=function(l,t){for(var n=0;n<t.length;n++){var a=t[n][0](l);if(a)return[a,t[n][1]]}return[null,void 0]},ib=function(l){return typeof l=="string"?my(l.trim(),oh.string):typeof l=="object"&&l!==null?my(l,oh.object):[null,void 0]},Nc=function(l,t){var n=il(l);return{h:n.h,s:ei(n.s+100*t,0,100),l:n.l,a:n.a}},kc=function(l){return(299*l.r+587*l.g+114*l.b)/1e3/255},py=function(l,t){var n=il(l);return{h:n.h,s:n.s,l:ei(n.l+100*t,0,100),a:n.a}},uh=(function(){function l(t){this.parsed=ib(t)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return l.prototype.isValid=function(){return this.parsed!==null},l.prototype.brightness=function(){return ce(kc(this.rgba),2)},l.prototype.isDark=function(){return kc(this.rgba)<.5},l.prototype.isLight=function(){return kc(this.rgba)>=.5},l.prototype.toHex=function(){return t=Uc(this.rgba),n=t.r,a=t.g,u=t.b,c=(o=t.a)<1?Lr(ce(255*o)):"","#"+Lr(n)+Lr(a)+Lr(u)+c;var t,n,a,u,o,c},l.prototype.toRgb=function(){return Uc(this.rgba)},l.prototype.toRgbString=function(){return t=Uc(this.rgba),n=t.r,a=t.g,u=t.b,(o=t.a)<1?"rgba("+n+", "+a+", "+u+", "+o+")":"rgb("+n+", "+a+", "+u+")";var t,n,a,u,o},l.prototype.toHsl=function(){return fy(il(this.rgba))},l.prototype.toHslString=function(){return t=fy(il(this.rgba)),n=t.h,a=t.s,u=t.l,(o=t.a)<1?"hsla("+n+", "+a+"%, "+u+"%, "+o+")":"hsl("+n+", "+a+"%, "+u+"%)";var t,n,a,u,o},l.prototype.toHsv=function(){return t=Mg(this.rgba),{h:ce(t.h),s:ce(t.s),v:ce(t.v),a:ce(t.a,3)};var t},l.prototype.invert=function(){return _i({r:255-(t=this.rgba).r,g:255-t.g,b:255-t.b,a:t.a});var t},l.prototype.saturate=function(t){return t===void 0&&(t=.1),_i(Nc(this.rgba,t))},l.prototype.desaturate=function(t){return t===void 0&&(t=.1),_i(Nc(this.rgba,-t))},l.prototype.grayscale=function(){return _i(Nc(this.rgba,-1))},l.prototype.lighten=function(t){return t===void 0&&(t=.1),_i(py(this.rgba,t))},l.prototype.darken=function(t){return t===void 0&&(t=.1),_i(py(this.rgba,-t))},l.prototype.rotate=function(t){return t===void 0&&(t=15),this.hue(this.hue()+t)},l.prototype.alpha=function(t){return typeof t=="number"?_i({r:(n=this.rgba).r,g:n.g,b:n.b,a:t}):ce(this.rgba.a,3);var n},l.prototype.hue=function(t){var n=il(this.rgba);return typeof t=="number"?_i({h:t,s:n.s,l:n.l,a:n.a}):ce(n.h)},l.prototype.isEqual=function(t){return this.toHex()===_i(t).toHex()},l})(),_i=function(l){return l instanceof uh?l:new uh(l)},yy=[],nb=function(l){l.forEach(function(t){yy.indexOf(t)<0&&(t(uh,oh),yy.push(t))})};function sb(l,t){var n={white:"#ffffff",bisque:"#ffe4c4",blue:"#0000ff",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",antiquewhite:"#faebd7",aqua:"#00ffff",azure:"#f0ffff",whitesmoke:"#f5f5f5",papayawhip:"#ffefd5",plum:"#dda0dd",blanchedalmond:"#ffebcd",black:"#000000",gold:"#ffd700",goldenrod:"#daa520",gainsboro:"#dcdcdc",cornsilk:"#fff8dc",cornflowerblue:"#6495ed",burlywood:"#deb887",aquamarine:"#7fffd4",beige:"#f5f5dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkkhaki:"#bdb76b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",peachpuff:"#ffdab9",darkmagenta:"#8b008b",darkred:"#8b0000",darkorchid:"#9932cc",darkorange:"#ff8c00",darkslateblue:"#483d8b",gray:"#808080",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",deeppink:"#ff1493",deepskyblue:"#00bfff",wheat:"#f5deb3",firebrick:"#b22222",floralwhite:"#fffaf0",ghostwhite:"#f8f8ff",darkviolet:"#9400d3",magenta:"#ff00ff",green:"#008000",dodgerblue:"#1e90ff",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",blueviolet:"#8a2be2",forestgreen:"#228b22",lawngreen:"#7cfc00",indianred:"#cd5c5c",indigo:"#4b0082",fuchsia:"#ff00ff",brown:"#a52a2a",maroon:"#800000",mediumblue:"#0000cd",lightcoral:"#f08080",darkturquoise:"#00ced1",lightcyan:"#e0ffff",ivory:"#fffff0",lightyellow:"#ffffe0",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",linen:"#faf0e6",mediumaquamarine:"#66cdaa",lemonchiffon:"#fffacd",lime:"#00ff00",khaki:"#f0e68c",mediumseagreen:"#3cb371",limegreen:"#32cd32",mediumspringgreen:"#00fa9a",lightskyblue:"#87cefa",lightblue:"#add8e6",midnightblue:"#191970",lightpink:"#ffb6c1",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",mintcream:"#f5fffa",lightslategray:"#778899",lightslategrey:"#778899",navajowhite:"#ffdead",navy:"#000080",mediumvioletred:"#c71585",powderblue:"#b0e0e6",palegoldenrod:"#eee8aa",oldlace:"#fdf5e6",paleturquoise:"#afeeee",mediumturquoise:"#48d1cc",mediumorchid:"#ba55d3",rebeccapurple:"#663399",lightsteelblue:"#b0c4de",mediumslateblue:"#7b68ee",thistle:"#d8bfd8",tan:"#d2b48c",orchid:"#da70d6",mediumpurple:"#9370db",purple:"#800080",pink:"#ffc0cb",skyblue:"#87ceeb",springgreen:"#00ff7f",palegreen:"#98fb98",red:"#ff0000",yellow:"#ffff00",slateblue:"#6a5acd",lavenderblush:"#fff0f5",peru:"#cd853f",palevioletred:"#db7093",violet:"#ee82ee",teal:"#008080",slategray:"#708090",slategrey:"#708090",aliceblue:"#f0f8ff",darkseagreen:"#8fbc8f",darkolivegreen:"#556b2f",greenyellow:"#adff2f",seagreen:"#2e8b57",seashell:"#fff5ee",tomato:"#ff6347",silver:"#c0c0c0",sienna:"#a0522d",lavender:"#e6e6fa",lightgreen:"#90ee90",orange:"#ffa500",orangered:"#ff4500",steelblue:"#4682b4",royalblue:"#4169e1",turquoise:"#40e0d0",yellowgreen:"#9acd32",salmon:"#fa8072",saddlebrown:"#8b4513",sandybrown:"#f4a460",rosybrown:"#bc8f8f",darksalmon:"#e9967a",lightgoldenrodyellow:"#fafad2",snow:"#fffafa",lightgrey:"#d3d3d3",lightgray:"#d3d3d3",dimgray:"#696969",dimgrey:"#696969",olivedrab:"#6b8e23",olive:"#808000"},a={};for(var u in n)a[n[u]]=u;var o={};l.prototype.toName=function(c){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var f,m,p=a[this.toHex()];if(p)return p;if(c!=null&&c.closest){var y=this.toRgb(),x=1/0,b="black";if(!o.length)for(var _ in n)o[_]=new l(n[_]).toRgb();for(var T in n){var w=(f=y,m=o[T],Math.pow(f.r-m.r,2)+Math.pow(f.g-m.g,2)+Math.pow(f.b-m.b,2));w<x&&(x=w,b=T)}return b}},t.string.push([function(c){var f=c.toLowerCase(),m=f==="transparent"?"#0000":n[f];return m?new l(m).toRgb():null},"name"])}nb([sb]);const Qs=class Ka{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 Ka)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,n){const a=typeof t;if(a!==typeof n)return!1;if(a==="number"||a==="string"||t instanceof Number)return t===n;if(Array.isArray(t)&&Array.isArray(n)||ArrayBuffer.isView(t)&&ArrayBuffer.isView(n))return t.length!==n.length?!1:t.every((o,c)=>o===n[c]);if(t!==null&&n!==null){const o=Object.keys(t),c=Object.keys(n);return o.length!==c.length?!1:o.every(f=>t[f]===n[f])}return t===n}toRgba(){const[t,n,a,u]=this._components;return{r:t,g:n,b:a,a:u}}toRgb(){const[t,n,a]=this._components;return{r:t,g:n,b:a}}toRgbaString(){const[t,n,a]=this.toUint8RgbArray();return`rgba(${t},${n},${a},${this.alpha})`}toUint8RgbArray(t){const[n,a,u]=this._components;return this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb),t[0]=Math.round(n*255),t[1]=Math.round(a*255),t[2]=Math.round(u*255),t}toArray(t){this._arrayRgba||(this._arrayRgba=[]),t||(t=this._arrayRgba);const[n,a,u,o]=this._components;return t[0]=n,t[1]=a,t[2]=u,t[3]=o,t}toRgbArray(t){this._arrayRgb||(this._arrayRgb=[]),t||(t=this._arrayRgb);const[n,a,u]=this._components;return t[0]=n,t[1]=a,t[2]=u,t}toNumber(){return this._int}toBgrNumber(){const[t,n,a]=this.toUint8RgbArray();return(a<<16)+(n<<8)+t}toLittleEndianNumber(){const t=this._int;return(t>>16)+(t&65280)+((t&255)<<16)}multiply(t){const[n,a,u,o]=Ka._temp.setValue(t)._components;return this._components[0]*=n,this._components[1]*=a,this._components[2]*=u,this._components[3]*=o,this._refreshInt(),this._value=null,this}premultiply(t,n=!0){return n&&(this._components[0]*=t,this._components[1]*=t,this._components[2]*=t),this._components[3]=t,this._refreshInt(),this._value=null,this}toPremultiplied(t,n=!0){if(t===1)return(255<<24)+this._int;if(t===0)return n?0:this._int;let a=this._int>>16&255,u=this._int>>8&255,o=this._int&255;return n&&(a=a*t+.5|0,u=u*t+.5|0,o=o*t+.5|0),(t*255<<24)+(a<<16)+(u<<8)+o}toHex(){const t=this._int.toString(16);return`#${"000000".substring(0,6-t.length)+t}`}toHexa(){const n=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-n.length)+n}setAlpha(t){return this._components[3]=this._clamp(t),this._value=null,this}_normalize(t){let n,a,u,o;if((typeof t=="number"||t instanceof Number)&&t>=0&&t<=16777215){const c=t;n=(c>>16&255)/255,a=(c>>8&255)/255,u=(c&255)/255,o=1}else if((Array.isArray(t)||t instanceof Float32Array)&&t.length>=3&&t.length<=4)t=this._clamp(t),[n,a,u,o=1]=t;else if((t instanceof Uint8Array||t instanceof Uint8ClampedArray)&&t.length>=3&&t.length<=4)t=this._clamp(t,0,255),[n,a,u,o=255]=t,n/=255,a/=255,u/=255,o/=255;else if(typeof t=="string"||typeof t=="object"){if(typeof t=="string"){const f=Ka.HEX_PATTERN.exec(t);f&&(t=`#${f[2]}`)}const c=_i(t);c.isValid()&&({r:n,g:a,b:u,a:o}=c.rgba,n/=255,a/=255,u/=255)}if(n!==void 0)this._components[0]=n,this._components[1]=a,this._components[2]=u,this._components[3]=o,this._refreshInt();else throw new Error(`Unable to convert color ${t}`)}_refreshInt(){this._clamp(this._components);const[t,n,a]=this._components;this._int=(t*255<<16)+(n*255<<8)+(a*255|0)}_clamp(t,n=0,a=1){return typeof t=="number"?Math.min(Math.max(t,n),a):(t.forEach((u,o)=>{t[o]=Math.min(Math.max(u,n),a)}),t)}static isColorLike(t){return typeof t=="number"||typeof t=="string"||t instanceof Number||t instanceof Ka||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}};Qs.shared=new Qs;Qs._temp=new Qs;Qs.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let re=Qs;const ab={cullArea:null,cullable:!1,cullableChildren:!0};let Hc=0;const gy=500;function Se(...l){Hc!==gy&&(Hc++,Hc===gy?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...l))}const dl={_registeredResources:new Set,register(l){this._registeredResources.add(l)},unregister(l){this._registeredResources.delete(l)},release(){this._registeredResources.forEach(l=>l.clear())},get registeredCount(){return this._registeredResources.size},isRegistered(l){return this._registeredResources.has(l)},reset(){this._registeredResources.clear()}};class lb{constructor(t,n){this._pool=[],this._count=0,this._index=0,this._classType=t,n&&this.prepopulate(n)}prepopulate(t){for(let n=0;n<t;n++)this._pool[this._index++]=new this._classType;this._count+=t}get(t){var a;let n;return this._index>0?n=this._pool[--this._index]:(n=new this._classType,this._count++),(a=n.init)==null||a.call(n,t),n}return(t){var n;(n=t.reset)==null||n.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 rb{constructor(){this._poolsByClass=new Map}prepopulate(t,n){this.getPool(t).prepopulate(n)}get(t,n){return this.getPool(t).get(n)}return(t){this.getPool(t.constructor).return(t)}getPool(t){return this._poolsByClass.has(t)||this._poolsByClass.set(t,new lb(t)),this._poolsByClass.get(t)}stats(){const t={};return this._poolsByClass.forEach(n=>{const a=t[n._classType.name]?n._classType.name+n._classType.ID:n._classType.name;t[a]={free:n.totalFree,used:n.totalUsed,size:n.totalSize}}),t}clear(){this._poolsByClass.forEach(t=>t.clear()),this._poolsByClass.clear()}}const De=new rb;dl.register(De);const ob={get isCachedAsTexture(){var l;return!!((l=this.renderGroup)!=null&&l.isCachedAsTexture)},cacheAsTexture(l){typeof l=="boolean"&&l===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(l===!0?{}:l))},updateCacheTexture(){var l;(l=this.renderGroup)==null||l.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(l){wt("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(l)}};function ub(l,t,n){const a=l.length;let u;if(t>=a||n===0)return;n=t+n>a?a-t:n;const o=a-n;for(u=t;u<o;++u)l[u]=l[u+n];l.length=o}const cb={allowChildren:!0,removeChildren(l=0,t){var o;const n=t??this.children.length,a=n-l,u=[];if(a>0&&a<=n){for(let f=n-1;f>=l;f--){const m=this.children[f];m&&(u.push(m),m.parent=null)}ub(this.children,l,n);const c=this.renderGroup||this.parentRenderGroup;c&&c.removeChildren(u);for(let f=0;f<u.length;++f){const m=u[f];(o=m.parentRenderLayer)==null||o.detach(m),this.emit("childRemoved",m,this,f),u[f].emit("removed",this)}return u.length>0&&this._didViewChangeTick++,u}else if(a===0&&this.children.length===0)return u;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(l){const t=this.getChildAt(l);return this.removeChild(t)},getChildAt(l){if(l<0||l>=this.children.length)throw new Error(`getChildAt: Index (${l}) does not exist.`);return this.children[l]},setChildIndex(l,t){if(t<0||t>=this.children.length)throw new Error(`The index ${t} supplied is out of bounds ${this.children.length}`);this.getChildIndex(l),this.addChildAt(l,t)},getChildIndex(l){const t=this.children.indexOf(l);if(t===-1)throw new Error("The supplied Container must be a child of the caller");return t},addChildAt(l,t){this.allowChildren||wt(Qt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:n}=this;if(t<0||t>n.length)throw new Error(`${l}addChildAt: The index ${t} supplied is out of bounds ${n.length}`);const a=l.parent===this;if(l.parent){const o=l.parent.children.indexOf(l);if(a){if(o===t)return l;l.parent.children.splice(o,1)}else l.removeFromParent()}t===n.length?n.push(l):n.splice(t,0,l),l.parent=this,l.didChange=!0,l._updateFlags=15;const u=this.renderGroup||this.parentRenderGroup;return u&&u.addChild(l),this.sortableChildren&&(this.sortDirty=!0),a||(this.emit("childAdded",l,this,t),l.emit("added",this)),l},swapChildren(l,t){if(l===t)return;const n=this.getChildIndex(l),a=this.getChildIndex(t);this.children[n]=t,this.children[a]=l;const u=this.renderGroup||this.parentRenderGroup;u&&(u.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var l;(l=this.parent)==null||l.removeChild(this)},reparentChild(...l){return l.length===1?this.reparentChildAt(l[0],this.children.length):(l.forEach(t=>this.reparentChildAt(t,this.children.length)),l[0])},reparentChildAt(l,t){if(l.parent===this)return this.setChildIndex(l,t),l;const n=l.worldTransform.clone();l.removeFromParent(),this.addChildAt(l,t);const a=this.worldTransform.clone();return a.invert(),n.prepend(a),l.setFromMatrix(n),l},replaceChild(l,t){l.updateLocalTransform(),this.addChildAt(t,this.getChildIndex(l)),t.setFromMatrix(l.localTransform),t.updateLocalTransform(),this.removeChild(l)}},hb={collectRenderables(l,t,n){this.parentRenderLayer&&this.parentRenderLayer!==n||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(l,t,n):this.renderGroup?t.renderPipes.renderGroup.addRenderGroup(this.renderGroup,l):this.collectRenderablesWithEffects(l,t,n))},collectRenderablesSimple(l,t,n){const a=this.children,u=a.length;for(let o=0;o<u;o++)a[o].collectRenderables(l,t,n)},collectRenderablesWithEffects(l,t,n){const{renderPipes:a}=t;for(let u=0;u<this.effects.length;u++){const o=this.effects[u];a[o.pipe].push(o,this,l)}this.collectRenderablesSimple(l,t,n);for(let u=this.effects.length-1;u>=0;u--){const o=this.effects[u];a[o.pipe].pop(o,this,l)}}};class xy{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 fb{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 n=0;n<this._tests.length;n++){const a=this._tests[n];if(a.test(t))return De.get(a.maskClass,t)}return t}returnMaskEffect(t){De.return(t)}}const ch=new fb;te.handleByList(yt.MaskEffect,ch._effectClasses);const db={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const l=this.renderGroup||this.parentRenderGroup;l&&(l.structureDidChange=!0)},addEffect(l){this.effects.indexOf(l)===-1&&(this.effects.push(l),this.effects.sort((n,a)=>n.priority-a.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(l){const t=this.effects.indexOf(l);t!==-1&&(this.effects.splice(t,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(l){const t=this._maskEffect;(t==null?void 0:t.mask)!==l&&(t&&(this.removeEffect(t),ch.returnMaskEffect(t),this._maskEffect=null),l!=null&&(this._maskEffect=ch.getMaskEffect(l),this.addEffect(this._maskEffect)))},get mask(){var l;return(l=this._maskEffect)==null?void 0:l.mask},setMask(l){this._maskOptions={...this._maskOptions,...l},l.mask&&(this.mask=l.mask),this._markStructureAsChanged()},set filters(l){var o;!Array.isArray(l)&&l&&(l=[l]);const t=this._filterEffect||(this._filterEffect=new xy);l=l;const n=(l==null?void 0:l.length)>0,a=((o=t.filters)==null?void 0:o.length)>0,u=n!==a;l=Array.isArray(l)?l.slice(0):l,t.filters=Object.freeze(l),u&&(n?this.addEffect(t):(this.removeEffect(t),t.filters=l??null))},get filters(){var l;return(l=this._filterEffect)==null?void 0:l.filters},set filterArea(l){this._filterEffect||(this._filterEffect=new xy),this._filterEffect.filterArea=l},get filterArea(){var l;return(l=this._filterEffect)==null?void 0:l.filterArea}},mb={label:null,get name(){return wt(Qt,"Container.name property has been removed, use Container.label instead"),this.label},set name(l){wt(Qt,"Container.name property has been removed, use Container.label instead"),this.label=l},getChildByName(l,t=!1){return this.getChildByLabel(l,t)},getChildByLabel(l,t=!1){const n=this.children;for(let a=0;a<n.length;a++){const u=n[a];if(u.label===l||l instanceof RegExp&&l.test(u.label))return u}if(t)for(let a=0;a<n.length;a++){const o=n[a].getChildByLabel(l,!0);if(o)return o}return null},getChildrenByLabel(l,t=!1,n=[]){const a=this.children;for(let u=0;u<a.length;u++){const o=a[u];(o.label===l||l instanceof RegExp&&l.test(o.label))&&n.push(o)}if(t)for(let u=0;u<a.length;u++)a[u].getChildrenByLabel(l,!0,n);return n}},ve=De.getPool(vt),Xi=De.getPool(si),pb=new vt,yb={getFastGlobalBounds(l,t){t||(t=new si),t.clear(),this._getGlobalBoundsRecursive(!!l,t,this.parentRenderLayer),t.isValid||t.set(0,0,0,0);const n=this.renderGroup||this.parentRenderGroup;return t.applyMatrix(n.worldTransform),t},_getGlobalBoundsRecursive(l,t,n){let a=t;if(l&&this.parentRenderLayer&&this.parentRenderLayer!==n||this.localDisplayStatus!==7||!this.measurable)return;const u=!!this.effects.length;if((this.renderGroup||u)&&(a=Xi.get().clear()),this.boundsArea)t.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const c=this.bounds;a.addFrame(c.minX,c.minY,c.maxX,c.maxY,this.groupTransform)}const o=this.children;for(let c=0;c<o.length;c++)o[c]._getGlobalBoundsRecursive(l,a,n)}if(u){let o=!1;const c=this.renderGroup||this.parentRenderGroup;for(let f=0;f<this.effects.length;f++)this.effects[f].addBounds&&(o||(o=!0,a.applyMatrix(c.worldTransform)),this.effects[f].addBounds(a,!0));o&&a.applyMatrix(c.worldTransform.copyTo(pb).invert()),t.addBounds(a),Xi.return(a)}else this.renderGroup&&(t.addBounds(a,this.relativeGroupTransform),Xi.return(a))}};function Rg(l,t,n){n.clear();let a,u;return l.parent?t?a=l.parent.worldTransform:(u=ve.get().identity(),a=Rh(l,u)):a=vt.IDENTITY,zg(l,n,a,t),u&&ve.return(u),n.isValid||n.set(0,0,0,0),n}function zg(l,t,n,a){var f,m;if(!l.visible||!l.measurable)return;let u;a?u=l.worldTransform:(l.updateLocalTransform(),u=ve.get(),u.appendFrom(l.localTransform,n));const o=t,c=!!l.effects.length;if(c&&(t=Xi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,u);else{const p=l.bounds;p&&!p.isEmpty()&&(t.matrix=u,t.addBounds(p));for(let y=0;y<l.children.length;y++)zg(l.children[y],t,u,a)}if(c){for(let p=0;p<l.effects.length;p++)(m=(f=l.effects[p]).addBounds)==null||m.call(f,t);o.addBounds(t,vt.IDENTITY),Xi.return(t)}a||ve.return(u)}function Rh(l,t){const n=l.parent;return n&&(Rh(n,t),n.updateLocalTransform(),t.append(n.localTransform)),t}function Dg(l,t){if(l===16777215||!t)return t;if(t===16777215||!l)return l;const n=l>>16&255,a=l>>8&255,u=l&255,o=t>>16&255,c=t>>8&255,f=t&255,m=n*o/255|0,p=a*c/255|0,y=u*f/255|0;return(m<<16)+(p<<8)+y}const _y=16777215;function by(l,t){return l===_y?t:t===_y?l:Dg(l,t)}function Jr(l){return((l&255)<<16)+(l&65280)+(l>>16&255)}const gb={getGlobalAlpha(l){if(l)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let t=this.alpha,n=this.parent;for(;n;)t*=n.alpha,n=n.parent;return t},getGlobalTransform(l=new vt,t){if(t)return l.copyFrom(this.worldTransform);this.updateLocalTransform();const n=Rh(this,ve.get().identity());return l.appendFrom(this.localTransform,n),ve.return(n),l},getGlobalTint(l){if(l)return this.renderGroup?Jr(this.renderGroup.worldColor):this.parentRenderGroup?Jr(by(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let t=this.localColor,n=this.parent;for(;n;)t=by(t,n.localColor),n=n.parent;return Jr(t)}};function Bg(l,t,n){return t.clear(),n||(n=vt.IDENTITY),Og(l,t,n,l,!0),t.isValid||t.set(0,0,0,0),t}function Og(l,t,n,a,u){var m,p;let o;if(u)o=ve.get(),o=n.copyTo(o);else{if(!l.visible||!l.measurable)return;l.updateLocalTransform();const y=l.localTransform;o=ve.get(),o.appendFrom(y,n)}const c=t,f=!!l.effects.length;if(f&&(t=Xi.get().clear()),l.boundsArea)t.addRect(l.boundsArea,o);else{l.renderPipeId&&(t.matrix=o,t.addBounds(l.bounds));const y=l.children;for(let x=0;x<y.length;x++)Og(y[x],t,o,a,!1)}if(f){for(let y=0;y<l.effects.length;y++)(p=(m=l.effects[y]).addLocalBounds)==null||p.call(m,t,a);c.addBounds(t,vt.IDENTITY),Xi.return(t)}ve.return(o)}function Gg(l,t){const n=l.children;for(let a=0;a<n.length;a++){const u=n[a],o=u.uid,c=(u._didViewChangeTick&65535)<<16|u._didContainerChangeTick&65535,f=t.index;(t.data[f]!==o||t.data[f+1]!==c)&&(t.data[t.index]=o,t.data[t.index+1]=c,t.didChange=!0),t.index=f+2,u.children.length&&Gg(u,t)}return t.didChange}const xb=new vt,_b={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(l,t){const n=Math.sign(this.scale.x)||1;t!==0?this.scale.x=l/t*n:this.scale.x=n},_setHeight(l,t){const n=Math.sign(this.scale.y)||1;t!==0?this.scale.y=l/t*n:this.scale.y=n},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new si});const l=this._localBoundsCacheData;return l.index=1,l.didChange=!1,l.data[0]!==this._didViewChangeTick&&(l.didChange=!0,l.data[0]=this._didViewChangeTick),Gg(this,l),l.didChange&&Bg(this,l.localBounds,xb),l.localBounds},getBounds(l,t){return Rg(this,l,t||new si)}},bb={_onRender:null,set onRender(l){const t=this.renderGroup||this.parentRenderGroup;if(!l){this._onRender&&(t==null||t.removeOnRender(this)),this._onRender=null;return}this._onRender||t==null||t.addOnRender(this),this._onRender=l},get onRender(){return this._onRender}},vb={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(l){this._zIndex!==l&&(this._zIndex=l,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(Sb))}};function Sb(l,t){return l._zIndex-t._zIndex}const Tb={getGlobalPosition(l=new xe,t=!1){return this.parent?this.parent.toGlobal(this._position,l,t):(l.x=this._position.x,l.y=this._position.y),l},toGlobal(l,t,n=!1){const a=this.getGlobalTransform(ve.get(),n);return t=a.apply(l,t),ve.return(a),t},toLocal(l,t,n,a){t&&(l=t.toGlobal(l,n,a));const u=this.getGlobalTransform(ve.get(),a);return n=u.applyInverse(l,n),ve.return(u),n}};class zh{constructor(){this.uid=Wt("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 wb=0;class Ab{constructor(t){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=t||{},this.enableFullScreen=!1,this.textureStyle=new Fs(this.textureOptions)}createTexture(t,n,a,u){const o=new li({...this.textureOptions,width:t,height:n,resolution:1,antialias:a,autoGarbageCollect:!1,autoGenerateMipmaps:u});return new Ut({source:o,label:`texturePool_${wb++}`})}getOptimalTexture(t,n,a=1,u,o=!1){let c=Math.ceil(t*a-1e-6),f=Math.ceil(n*a-1e-6);c=Ps(c),f=Ps(f);const m=u?1:0,p=o?1:0,y=(c<<17)+(f<<2)+(p<<1)+m;this._texturePool[y]||(this._texturePool[y]=[]);let x=this._texturePool[y].pop();return x||(x=this.createTexture(c,f,u,o)),x.source._resolution=a,x.source.width=c/a,x.source.height=f/a,x.source.pixelWidth=c,x.source.pixelHeight=f,x.frame.x=0,x.frame.y=0,x.frame.width=t,x.frame.height=n,x.updateUvs(),this._poolKeyHash[x.uid]=y,x}getSameSizeTexture(t,n=!1){const a=t.source;return this.getOptimalTexture(t.width,t.height,a._resolution,n)}returnTexture(t,n=!1){const a=this._poolKeyHash[t.uid];n&&(t.source.style=this.textureStyle),this._texturePool[a].push(t)}clear(t){if(t=t!==!1,t)for(const n in this._texturePool){const a=this._texturePool[n];if(a)for(let u=0;u<a.length;u++)a[u].destroy(!0)}this._texturePool={}}}const lo=new Ab;dl.register(lo);class Cb{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new vt,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 zh,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 n=t.children;for(let a=0;a<n.length;a++){const u=n[a];u._updateFlags=15,this.addChild(u)}}enableCacheAsTexture(t={}){this.textureOptions=t,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(lo.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 n=this.childrenToUpdate[t];n.list.fill(null),n.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(t){t.renderGroupParent&&t.renderGroupParent._removeRenderGroupChild(t),t.renderGroupParent=this,this.renderGroupChildren.push(t)}_removeRenderGroupChild(t){const n=this.renderGroupChildren.indexOf(t);n>-1&&this.renderGroupChildren.splice(n,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 n=t.children;for(let a=0;a<n.length;a++)this.addChild(n[a])}removeChild(t){if(this.structureDidChange=!0,t._onRender&&(t.renderGroup||this.removeOnRender(t)),t.parentRenderGroup=null,t.renderGroup){this._removeRenderGroupChild(t.renderGroup);return}const n=t.children;for(let a=0;a<n.length;a++)this.removeChild(n[a])}removeChildren(t){for(let n=0;n<t.length;n++)this.removeChild(t[n])}onChildUpdate(t){let n=this.childrenToUpdate[t.relativeRenderGroupDepth];n||(n=this.childrenToUpdate[t.relativeRenderGroupDepth]={index:0,list:[]}),n.list[n.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 n=0;n<this._onRenderContainers.length;n++)this._onRenderContainers[n]._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 n=this.root.children;for(let a=0;a<n.length;a++)this._getChildren(n[a],t);return t}_getChildren(t,n=[]){if(n.push(t),t.renderGroup)return n;const a=t.children;for(let u=0;u<a.length;u++)this._getChildren(a[u],n);return n}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new vt),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new vt),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 vt),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 Mb(l,t,n={}){for(const a in t)!n[a]&&t[a]!==void 0&&(l[a]=t[a])}const Lc=new ye(null),jr=new ye(null),jc=new ye(null,1,1),Yr=new ye(null),vy=1,Eb=2,Yc=4;class ai extends vi{constructor(t={}){var n,a;super(),this.uid=Wt("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 vt,this.relativeGroupTransform=new vt,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new ye(this,0,0),this._scale=jc,this._pivot=jr,this._origin=Yr,this._skew=Lc,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=[],Mb(this,t,{children:!0,parent:!0,effects:!0}),(n=t.children)==null||n.forEach(u=>this.addChild(u)),(a=t.parent)==null||a.addChild(this)}static mixin(t){wt("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),te.mixin(ai,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||wt(Qt,"addChild: Only Containers will be allowed to add children in v8.0.0"),t.length>1){for(let u=0;u<t.length;u++)this.addChild(t[u]);return t[0]}const n=t[0],a=this.renderGroup||this.parentRenderGroup;return n.parent===this?(this.children.splice(this.children.indexOf(n),1),this.children.push(n),a&&(a.structureDidChange=!0),n):(n.parent&&n.parent.removeChild(n),this.children.push(n),this.sortableChildren&&(this.sortDirty=!0),n.parent=this,n.didChange=!0,n._updateFlags=15,a&&a.addChild(n),this.emit("childAdded",n,this,this.children.length-1),n.emit("added",this),this._didViewChangeTick++,n._zIndex!==0&&n.depthOfChildModified(),n)}removeChild(...t){if(t.length>1){for(let u=0;u<t.length;u++)this.removeChild(t[u]);return t[0]}const n=t[0],a=this.children.indexOf(n);return a>-1&&(this._didViewChangeTick++,this.children.splice(a,1),this.renderGroup?this.renderGroup.removeChild(n):this.parentRenderGroup&&this.parentRenderGroup.removeChild(n),n.parentRenderLayer&&n.parentRenderLayer.detach(n),n.parent=null,this.emit("childRemoved",n,this,a),n.emit("removed",this)),n}_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=De.get(Cb,this),this.groupTransform=vt.IDENTITY,t==null||t.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const t=this.parentRenderGroup;t==null||t.removeChild(this),De.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 vt),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*q1}set angle(t){this.rotation=t*X1}get pivot(){return this._pivot===jr&&(this._pivot=new ye(this,0,0)),this._pivot}set pivot(t){this._pivot===jr&&(this._pivot=new ye(this,0,0),this._origin!==Yr&&Se("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===Lc&&(this._skew=new ye(this,0,0)),this._skew}set skew(t){this._skew===Lc&&(this._skew=new ye(this,0,0)),this._skew.copyFrom(t)}get scale(){return this._scale===jc&&(this._scale=new ye(this,1,1)),this._scale}set scale(t){this._scale===jc&&(this._scale=new ye(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===Yr&&(this._origin=new ye(this,0,0)),this._origin}set origin(t){this._origin===Yr&&(this._origin=new ye(this,0,0),this._pivot!==jr&&Se("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 n=this.getLocalBounds().width;this._setWidth(t,n)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(t){const n=this.getLocalBounds().height;this._setHeight(t,n)}getSize(t){t||(t={});const n=this.getLocalBounds();return t.width=Math.abs(this.scale.x*n.width),t.height=Math.abs(this.scale.y*n.height),t}setSize(t,n){const a=this.getLocalBounds();typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,a.width),n!==void 0&&this._setHeight(n,a.height)}_updateSkew(){const t=this._rotation,n=this._skew;this._cx=Math.cos(t+n._y),this._sx=Math.sin(t+n._y),this._cy=-Math.sin(t-n._x),this._sy=Math.cos(t-n._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 n=this.localTransform,a=this._scale,u=this._pivot,o=this._origin,c=this._position,f=a._x,m=a._y,p=u._x,y=u._y,x=-o._x,b=-o._y;n.a=this._cx*f,n.b=this._sx*f,n.c=this._cy*m,n.d=this._sy*m,n.tx=c._x-(p*n.a+y*n.c)+(x*n.a+b*n.c)-x,n.ty=c._y-(p*n.b+y*n.d)+(x*n.b+b*n.d)-b}set alpha(t){t!==this.localAlpha&&(this.localAlpha=t,this._updateFlags|=vy,this._onUpdate())}get alpha(){return this.localAlpha}set tint(t){const a=re.shared.setValue(t??16777215).toBgrNumber();a!==this.localColor&&(this.localColor=a,this._updateFlags|=vy,this._onUpdate())}get tint(){return Jr(this.localColor)}set blendMode(t){this.localBlendMode!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Eb,this.localBlendMode=t,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(t){const n=t?2:0;(this.localDisplayStatus&2)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Yc,this.localDisplayStatus^=2,this._onUpdate(),this.emit("visibleChanged",t))}get culled(){return!(this.localDisplayStatus&4)}set culled(t){const n=t?0:4;(this.localDisplayStatus&4)!==n&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=Yc,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(t){const n=t?1:0;(this.localDisplayStatus&1)!==n&&(this._updateFlags|=Yc,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(t=!1){var u;if(this.destroyed)return;this.destroyed=!0;let n;if(this.children.length&&(n=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof t=="boolean"?t:t==null?void 0:t.children)&&n)for(let o=0;o<n.length;++o)n[o].destroy(t);(u=this.renderGroup)==null||u.destroy(),this.renderGroup=null}}te.mixin(ai,cb,yb,Tb,bb,_b,db,mb,vb,ab,ob,gb,hb);class Dh extends ai{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 si(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 n=this.bounds,{x:a,y:u}=t;return a>=n.minX&&a<=n.maxX&&u>=n.minY&&u<=n.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 n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null),this.onViewUpdate()}destroy(t){this.unload(),super.destroy(t),this._bounds=null}collectRenderablesSimple(t,n,a){const{renderPipes:u}=n;u.blendMode.pushBlendMode(this,this.groupBlendMode,t);const c=u[this.renderPipeId];c!=null&&c.addRenderable&&c.addRenderable(this,t),this.didViewUpdate=!1;const f=this.children,m=f.length;for(let p=0;p<m;p++)f[p].collectRenderables(t,n,a);u.blendMode.popBlendMode(t)}}class ll extends Dh{constructor(t=Ut.EMPTY){t instanceof Ut&&(t={texture:t});const{texture:n=Ut.EMPTY,anchor:a,roundPixels:u,width:o,height:c,...f}=t;super({label:"Sprite",...f}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new ye({_onUpdate:()=>{this.onViewUpdate()}}),a?this.anchor=a:n.defaultAnchor&&(this.anchor=n.defaultAnchor),this.texture=n,this.allowChildren=!1,this.roundPixels=u??!1,o!==void 0&&(this.width=o),c!==void 0&&(this.height=c)}static from(t,n=!1){return t instanceof Ut?new ll(t):new ll(Ut.from(t,n))}set texture(t){t||(t=Ut.EMPTY);const n=this._texture;n!==t&&(n&&n.dynamic&&n.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 Ag(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return wt("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const t=this._anchor,n=this._texture,a=this._bounds,{width:u,height:o}=n.orig;a.minX=-t._x*u,a.maxX=a.minX+u,a.minY=-t._y*o,a.maxY=a.minY+o}destroy(t=!1){if(super.destroy(t),typeof t=="boolean"?t:t==null?void 0:t.texture){const a=typeof t=="boolean"?t:t==null?void 0:t.textureSource;this._texture.destroy(a)}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,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this._texture.orig.width),n!==void 0&&this._setHeight(n,this._texture.orig.height)}}const Rb=new si;function Ug(l,t,n){const a=Rb;l.measurable=!0,Rg(l,n,a),t.addBoundsMask(a),l.measurable=!1}function Ng(l,t,n){const a=Xi.get();l.measurable=!0;const u=ve.get().identity(),o=kg(l,n,u);Bg(l,a,o),l.measurable=!1,t.addBoundsMask(a),ve.return(u),Xi.return(a)}function kg(l,t,n){return l?(l!==t&&(kg(l.parent,t,n),l.updateLocalTransform(),n.append(l.localTransform)),n):(Se("Mask bounds, renderable is not inside the root container"),n)}class Hg{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 ll),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,n){this.inverse||Ug(this.mask,t,n)}addLocalBounds(t,n){Ng(this.mask,t,n)}containsPoint(t,n){const a=this.mask;return n(a,t)}destroy(){this.reset()}static test(t){return t instanceof ll}}Hg.extension=yt.MaskEffect;class Lg{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"}}Lg.extension=yt.MaskEffect;class jg{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,n){Ug(this.mask,t,n)}addLocalBounds(t,n){Ng(this.mask,t,n)}containsPoint(t,n){const a=this.mask;return n(a,t)}destroy(){this.reset()}static test(t){return t instanceof ai}}jg.extension=yt.MaskEffect;const zb={createCanvas:(l,t)=>{const n=document.createElement("canvas");return n.width=l,n.height=t,n},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(l,t)=>fetch(l,t),parseXML:l=>new DOMParser().parseFromString(l,"text/xml")};let Sy=zb;const Xe={get(){return Sy},set(l){Sy=l}};class Yg extends li{constructor(t){t.resource||(t.resource=Xe.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,n=this.height,a=this._resolution){const u=super.resize(t,n,a);return u&&this.resizeCanvas(),u}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"))}}Yg.extension=yt.TextureSource;class eo extends li{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}}eo.extension=yt.TextureSource;var io=(l=>(l[l.INTERACTION=50]="INTERACTION",l[l.HIGH=25]="HIGH",l[l.NORMAL=0]="NORMAL",l[l.LOW=-25]="LOW",l[l.UTILITY=-50]="UTILITY",l))(io||{});class qc{constructor(t,n=null,a=0,u=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=t,this._context=n,this.priority=a,this._once=u}match(t,n=null){return this._fn===t&&this._context===n}emit(t){this._fn&&(this._context?this._fn.call(this._context,t):this._fn(t));const n=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),n}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 n=this.next;return this.next=t?null:n,this.previous=null,n}}const qg=class qe{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 qc(null,null,1/0),this.deltaMS=1/qe.targetFPMS,this.elapsedMS=1/qe.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,n,a=io.NORMAL){return this._addListener(new qc(t,n,a))}addOnce(t,n,a=io.NORMAL){return this._addListener(new qc(t,n,a,!0))}_addListener(t){let n=this._head.next,a=this._head;if(!n)t.connect(a);else{for(;n;){if(t.priority>n.priority){t.connect(a);break}a=n,n=n.next}t.previous||t.connect(a)}return this._startIfPossible(),this}remove(t,n){let a=this._head.next;for(;a;)a.match(t,n)?a=a.destroy():a=a.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let t=0,n=this._head;for(;n=n.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 n;if(t>this.lastTime){if(n=this.elapsedMS=t-this.lastTime,n>this._maxElapsedMS&&(n=this._maxElapsedMS),n*=this.speed,this._minElapsedMS){const o=t-this._lastFrame|0;if(o<this._minElapsedMS)return;this._lastFrame=t-o%this._minElapsedMS}this.deltaMS=n,this.deltaTime=this.deltaMS*qe.targetFPMS;const a=this._head;let u=a.next;for(;u;)u=u.emit(this);a.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 n=Math.min(Math.max(0,t)/1e3,qe.targetFPMS);this._maxElapsedMS=1/n,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(!qe._shared){const t=qe._shared=new qe;t.autoStart=!0,t._protected=!0}return qe._shared}static get system(){if(!qe._system){const t=qe._system=new qe;t.autoStart=!0,t._protected=!0}return qe._system}};qg.targetFPMS=.06;let Xs=qg,Xc;async function Db(){return Xc??(Xc=(async()=>{var c;const t=Xe.get().createCanvas(1,1).getContext("webgl");if(!t)return"premultiply-alpha-on-upload";const n=await new Promise(f=>{const m=document.createElement("video");m.onloadeddata=()=>f(m),m.onerror=()=>f(null),m.autoplay=!1,m.crossOrigin="anonymous",m.preload="auto",m.src="data:video/webm;base64,GkXfo59ChoEBQveBAULygQRC84EIQoKEd2VibUKHgQJChYECGFOAZwEAAAAAAAHTEU2bdLpNu4tTq4QVSalmU6yBoU27i1OrhBZUrmtTrIHGTbuMU6uEElTDZ1OsggEXTbuMU6uEHFO7a1OsggG97AEAAAAAAABZAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAVSalmoCrXsYMPQkBNgIRMYXZmV0GETGF2ZkSJiEBEAAAAAAAAFlSua8yuAQAAAAAAAEPXgQFzxYgAAAAAAAAAAZyBACK1nIN1bmSIgQCGhVZfVlA5g4EBI+ODhAJiWgDglLCBArqBApqBAlPAgQFVsIRVuYEBElTDZ9Vzc9JjwItjxYgAAAAAAAAAAWfInEWjh0VOQ09ERVJEh49MYXZjIGxpYnZweC12cDlnyKJFo4hEVVJBVElPTkSHlDAwOjAwOjAwLjA0MDAwMDAwMAAAH0O2dcfngQCgwqGggQAAAIJJg0IAABAAFgA4JBwYSgAAICAAEb///4r+AAB1oZ2mm+6BAaWWgkmDQgAAEAAWADgkHBhKAAAgIABIQBxTu2uRu4+zgQC3iveBAfGCAXHwgQM=",m.load()});if(!n)return"premultiply-alpha-on-upload";const a=t.createTexture();t.bindTexture(t.TEXTURE_2D,a);const u=t.createFramebuffer();t.bindFramebuffer(t.FRAMEBUFFER,u),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,a,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,n);const o=new Uint8Array(4);return t.readPixels(0,0,1,1,t.RGBA,t.UNSIGNED_BYTE,o),t.deleteFramebuffer(u),t.deleteTexture(a),(c=t.getExtension("WEBGL_lose_context"))==null||c.loseContext(),o[0]<=o[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),Xc}const ro=class Xg extends li{constructor(t){super(t),this.isReady=!1,this.uploadMethodId="video",t={...Xg.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=Xs.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,n=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():(n.preload||t.addEventListener("canplay",this._onCanPlay),t.addEventListener("canplaythrough",this._onCanPlayThrough),t.addEventListener("error",this._onError,!0)),this.alphaMode=await Db(),this._load=new Promise((a,u)=>{this.isValid?a(this):(this._resolve=a,this._reject=u,n.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${n.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&&(Xs.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||(Xs.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Xs.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(t){return globalThis.HTMLVideoElement&&t instanceof HTMLVideoElement}};ro.extension=yt.TextureSource;ro.defaultOptions={...li.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1};ro.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let Bb=ro;const Ls=(l,t,n=!1)=>(Array.isArray(l)||(l=[l]),t?l.map(a=>typeof a=="string"||n?t(a):a):l);class Ob{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 n=this._cache.get(t);return n||Se(`[Assets] Asset id ${t} was not found in the Cache`),n}set(t,n){const a=Ls(t);let u;for(let m=0;m<this.parsers.length;m++){const p=this.parsers[m];if(p.test(n)){u=p.getCacheableAssets(a,n);break}}const o=new Map(Object.entries(u||{}));u||a.forEach(m=>{o.set(m,n)});const c=[...o.keys()],f={cacheKeys:c,keys:a};a.forEach(m=>{this._cacheMap.set(m,f)}),c.forEach(m=>{const p=u?u[m]:n;this._cache.has(m)&&this._cache.get(m)!==p&&Se("[Cache] already has key:",m),this._cache.set(m,o.get(m))})}remove(t){if(!this._cacheMap.has(t)){Se(`[Assets] Asset id ${t} was not found in the Cache`);return}const n=this._cacheMap.get(t);n.cacheKeys.forEach(u=>{this._cache.delete(u)}),n.keys.forEach(u=>{this._cacheMap.delete(u)})}get parsers(){return this._parsers}}const js=new Ob,hh=[];te.handleByList(yt.TextureSource,hh);function Vg(l={}){const t=l&&l.resource,n=t?l.resource:l,a=t?l:{resource:l};for(let u=0;u<hh.length;u++){const o=hh[u];if(o.test(n))return new o(a)}throw new Error(`Could not find a source type for resource: ${a.resource}`)}function Gb(l={},t=!1){const n=l&&l.resource,a=n?l.resource:l,u=n?l:{resource:l};if(!t&&js.has(a))return js.get(a);const o=new Ut({source:Vg(u)});return o.on("destroy",()=>{js.has(a)&&js.remove(a)}),t||js.set(a,o),o}function Ub(l,t=!1){return typeof l=="string"?js.get(l):l instanceof li?new Ut({source:l}):Gb(l,t)}Ut.from=Ub;li.from=Vg;te.add(Hg,Lg,jg,Bb,eo,Yg,Eh);var Pg=(l=>(l[l.Low=0]="Low",l[l.Normal=1]="Normal",l[l.High=2]="High",l))(Pg||{});function fi(l){if(typeof l!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(l)}`)}function Va(l){return l.split("?")[0].split("#")[0]}function Nb(l){return l.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function kb(l,t,n){return l.replace(new RegExp(Nb(t),"g"),n)}function Hb(l,t){let n="",a=0,u=-1,o=0,c=-1;for(let f=0;f<=l.length;++f){if(f<l.length)c=l.charCodeAt(f);else{if(c===47)break;c=47}if(c===47){if(!(u===f-1||o===1))if(u!==f-1&&o===2){if(n.length<2||a!==2||n.charCodeAt(n.length-1)!==46||n.charCodeAt(n.length-2)!==46){if(n.length>2){const m=n.lastIndexOf("/");if(m!==n.length-1){m===-1?(n="",a=0):(n=n.slice(0,m),a=n.length-1-n.lastIndexOf("/")),u=f,o=0;continue}}else if(n.length===2||n.length===1){n="",a=0,u=f,o=0;continue}}}else n.length>0?n+=`/${l.slice(u+1,f)}`:n=l.slice(u+1,f),a=f-u-1;u=f,o=0}else c===46&&o!==-1?++o:o=-1}return n}const rl={toPosix(l){return kb(l,"\\","/")},isUrl(l){return/^https?:/.test(this.toPosix(l))},isDataUrl(l){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(l)},isBlobUrl(l){return l.startsWith("blob:")},hasProtocol(l){return/^[^/:]+:/.test(this.toPosix(l))},getProtocol(l){fi(l),l=this.toPosix(l);const t=/^file:\/\/\//.exec(l);if(t)return t[0];const n=/^[^/:]+:\/{0,2}/.exec(l);return n?n[0]:""},toAbsolute(l,t,n){if(fi(l),this.isDataUrl(l)||this.isBlobUrl(l))return l;const a=Va(this.toPosix(t??Xe.get().getBaseUrl())),u=Va(this.toPosix(n??this.rootname(a)));return l=this.toPosix(l),l.startsWith("/")?rl.join(u,l.slice(1)):this.isAbsolute(l)?l:this.join(a,l)},normalize(l){if(fi(l),l.length===0)return".";if(this.isDataUrl(l)||this.isBlobUrl(l))return l;l=this.toPosix(l);let t="";const n=l.startsWith("/");this.hasProtocol(l)&&(t=this.rootname(l),l=l.slice(t.length));const a=l.endsWith("/");return l=Hb(l),l.length>0&&a&&(l+="/"),n?`/${l}`:t+l},isAbsolute(l){return fi(l),l=this.toPosix(l),this.hasProtocol(l)?!0:l.startsWith("/")},join(...l){if(l.length===0)return".";let t;for(let n=0;n<l.length;++n){const a=l[n];if(fi(a),a.length>0)if(t===void 0)t=a;else{const u=l[n-1]??"";this.joinExtensions.includes(this.extname(u).toLowerCase())?t+=`/../${a}`:t+=`/${a}`}}return t===void 0?".":this.normalize(t)},dirname(l){if(fi(l),l.length===0)return".";l=this.toPosix(l);let t=l.charCodeAt(0);const n=t===47;let a=-1,u=!0;const o=this.getProtocol(l),c=l;l=l.slice(o.length);for(let f=l.length-1;f>=1;--f)if(t=l.charCodeAt(f),t===47){if(!u){a=f;break}}else u=!1;return a===-1?n?"/":this.isUrl(c)?o+l:o:n&&a===1?"//":o+l.slice(0,a)},rootname(l){fi(l),l=this.toPosix(l);let t="";if(l.startsWith("/")?t="/":t=this.getProtocol(l),this.isUrl(l)){const n=l.indexOf("/",t.length);n!==-1?t=l.slice(0,n):t=l,t.endsWith("/")||(t+="/")}return t},basename(l,t){fi(l),t&&fi(t),l=Va(this.toPosix(l));let n=0,a=-1,u=!0,o;if(t!==void 0&&t.length>0&&t.length<=l.length){if(t.length===l.length&&t===l)return"";let c=t.length-1,f=-1;for(o=l.length-1;o>=0;--o){const m=l.charCodeAt(o);if(m===47){if(!u){n=o+1;break}}else f===-1&&(u=!1,f=o+1),c>=0&&(m===t.charCodeAt(c)?--c===-1&&(a=o):(c=-1,a=f))}return n===a?a=f:a===-1&&(a=l.length),l.slice(n,a)}for(o=l.length-1;o>=0;--o)if(l.charCodeAt(o)===47){if(!u){n=o+1;break}}else a===-1&&(u=!1,a=o+1);return a===-1?"":l.slice(n,a)},extname(l){fi(l),l=Va(this.toPosix(l));let t=-1,n=0,a=-1,u=!0,o=0;for(let c=l.length-1;c>=0;--c){const f=l.charCodeAt(c);if(f===47){if(!u){n=c+1;break}continue}a===-1&&(u=!1,a=c+1),f===46?t===-1?t=c:o!==1&&(o=1):t!==-1&&(o=-1)}return t===-1||a===-1||o===0||o===1&&t===a-1&&t===n+1?"":l.slice(t,a)},parse(l){fi(l);const t={root:"",dir:"",base:"",ext:"",name:""};if(l.length===0)return t;l=Va(this.toPosix(l));let n=l.charCodeAt(0);const a=this.isAbsolute(l);let u;t.root=this.rootname(l),a||this.hasProtocol(l)?u=1:u=0;let o=-1,c=0,f=-1,m=!0,p=l.length-1,y=0;for(;p>=u;--p){if(n=l.charCodeAt(p),n===47){if(!m){c=p+1;break}continue}f===-1&&(m=!1,f=p+1),n===46?o===-1?o=p:y!==1&&(y=1):o!==-1&&(y=-1)}return o===-1||f===-1||y===0||y===1&&o===f-1&&o===c+1?f!==-1&&(c===0&&a?t.base=t.name=l.slice(1,f):t.base=t.name=l.slice(c,f)):(c===0&&a?(t.name=l.slice(1,o),t.base=l.slice(1,f)):(t.name=l.slice(c,o),t.base=l.slice(c,f)),t.ext=l.slice(o,f)),t.dir=this.dirname(l),t},sep:"/",delimiter:":",joinExtensions:[".html"]};function Fg(l,t,n,a,u){const o=t[n];for(let c=0;c<o.length;c++){const f=o[c];n<t.length-1?Fg(l.replace(a[n],f),t,n+1,a,u):u.push(l.replace(a[n],f))}}function Lb(l){const t=/\{(.*?)\}/g,n=l.match(t),a=[];if(n){const u=[];n.forEach(o=>{const c=o.substring(1,o.length-1).split(",");u.push(c)}),Fg(l,u,0,n,a)}else a.push(l);return a}const Ty=l=>!Array.isArray(l);class Qg{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(t,n)=>`${t}${this._bundleIdConnector}${n}`,extractAssetIdFromBundle:(t,n)=>n.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(n=>{this._preferredOrder.push(n),n.priority||(n.priority=Object.keys(n.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 n=t;this._defaultSearchParams=Object.keys(n).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(n[a])}`).join("&")}}getAlias(t){const{alias:n,src:a}=t;return Ls(n||a,o=>typeof o=="string"?o:Array.isArray(o)?o.map(c=>(c==null?void 0:c.src)??c):o!=null&&o.src?o.src:o,!0)}removeAlias(t,n){this._assetMap[t]&&(n&&n!==this._resolverHash[t]||(delete this._resolverHash[t],delete this._assetMap[t]))}addManifest(t){this._manifest&&Se("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=t,t.bundles.forEach(n=>{this.addBundle(n.name,n.assets)})}addBundle(t,n){const a=[];let u=n;Array.isArray(n)||(u=Object.entries(n).map(([o,c])=>typeof c=="string"||Array.isArray(c)?{alias:o,src:c}:{alias:o,...c})),u.forEach(o=>{const c=o.src,f=o.alias;let m;if(typeof f=="string"){const p=this._createBundleAssetId(t,f);a.push(p),m=[f,p]}else{const p=f.map(y=>this._createBundleAssetId(t,y));a.push(...p),m=[...f,...p]}this.add({...o,alias:m,src:c})}),this._bundles[t]=a}add(t){const n=[];Array.isArray(t)?n.push(...t):n.push(t);let a;a=o=>{this.hasKey(o)&&Se(`[Resolver] already has key: ${o} overwriting`)},Ls(n).forEach(o=>{const{src:c}=o;let{data:f,format:m,loadParser:p,parser:y}=o;const x=Ls(c).map(w=>typeof w=="string"?Lb(w):Array.isArray(w)?w:[w]),b=this.getAlias(o);Array.isArray(b)?b.forEach(a):a(b);const _=[],T=w=>{const S=this._parsers.find(A=>A.test(w));return{src:w,...S==null?void 0:S.parse(w)}};x.forEach(w=>{w.forEach(S=>{let A={};if(typeof S!="object"?A=T(S):(f=S.data??f,m=S.format??m,(S.loadParser||S.parser)&&(p=S.loadParser??p,y=S.parser??y),A={...T(S.src),...S}),!b)throw new Error(`[Resolver] alias is undefined for this asset: ${A.src}`);A=this._buildResolvedAsset(A,{aliases:b,data:f,format:m,loadParser:p,parser:y,progressSize:o.progressSize}),_.push(A)})}),b.forEach(w=>{this._assetMap[w]=_})})}resolveBundle(t){const n=Ty(t);t=Ls(t);const a={};return t.forEach(u=>{const o=this._bundles[u];if(o){const c=this.resolve(o),f={};for(const m in c){const p=c[m];f[this._extractAssetIdFromBundle(u,m)]=p}a[u]=f}}),n?a[t[0]]:a}resolveUrl(t){const n=this.resolve(t);if(typeof t!="string"){const a={};for(const u in n)a[u]=n[u].src;return a}return n.src}resolve(t){const n=Ty(t);t=Ls(t);const a={};return t.forEach(u=>{if(!this._resolverHash[u])if(this._assetMap[u]){let o=this._assetMap[u];const c=this._getPreferredOrder(o);c==null||c.priority.forEach(f=>{c.params[f].forEach(m=>{const p=o.filter(y=>y[f]?y[f]===m:!1);p.length&&(o=p)})}),this._resolverHash[u]=o[0]}else this._resolverHash[u]=this._buildResolvedAsset({alias:[u],src:u},{});a[u]=this._resolverHash[u]}),n?a[t[0]]:a}hasKey(t){return!!this._assetMap[t]}hasBundle(t){return!!this._bundles[t]}_getPreferredOrder(t){for(let n=0;n<t.length;n++){const a=t[n],u=this._preferredOrder.find(o=>o.params.format.includes(a.format));if(u)return u}return this._preferredOrder[0]}_appendDefaultSearchParams(t){if(!this._defaultSearchParams)return t;const n=/\?/.test(t)?"&":"?";return`${t}${n}${this._defaultSearchParams}`}_buildResolvedAsset(t,n){const{aliases:a,data:u,loadParser:o,parser:c,format:f,progressSize:m}=n;return(this._basePath||this._rootPath)&&(t.src=rl.toAbsolute(t.src,this._basePath,this._rootPath)),t.alias=a??t.alias??[t.src],t.src=this._appendDefaultSearchParams(t.src),t.data={...u||{},...t.data},t.loadParser=o??t.loadParser,t.parser=c??t.parser,t.format=f??t.format??jb(t.src),m!==void 0&&(t.progressSize=m),t}}Qg.RETINA_PREFIX=/@([0-9\.]+)x/;function jb(l){return l.split(".").pop().split("?").shift().split("#").shift()}const wy=(l,t)=>{const n=t.split("?")[1];return n&&(l+=`?${n}`),l},Wg=class Ja{constructor(t,n){this.linkedSheets=[];let a=t;(t==null?void 0:t.source)instanceof li&&(a={texture:t,data:n});const{texture:u,data:o,cachePrefix:c=""}=a;this.cachePrefix=c,this._texture=u instanceof Ut?u:null,this.textureSource=u.source,this.textures={},this.animations={},this.data=o;const f=parseFloat(o.meta.scale);f?(this.resolution=f,u.source.resolution=this.resolution):this.resolution=u.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<=Ja.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}parseSync(){return this._processFrames(0,!0),this._processAnimations(),this.textures}_processFrames(t,n=!1){let a=t;const u=n?1/0:Ja.BATCH_SIZE;for(;a-t<u&&a<this._frameKeys.length;){const o=this._frameKeys[a],c=this._frames[o],f=c.frame;if(f){let m=null,p=null;const y=c.trimmed!==!1&&c.sourceSize?c.sourceSize:c.frame,x=new $t(0,0,Math.floor(y.w)/this.resolution,Math.floor(y.h)/this.resolution);c.rotated?m=new $t(Math.floor(f.x)/this.resolution,Math.floor(f.y)/this.resolution,Math.floor(f.h)/this.resolution,Math.floor(f.w)/this.resolution):m=new $t(Math.floor(f.x)/this.resolution,Math.floor(f.y)/this.resolution,Math.floor(f.w)/this.resolution,Math.floor(f.h)/this.resolution),c.trimmed!==!1&&c.spriteSourceSize&&(p=new $t(Math.floor(c.spriteSourceSize.x)/this.resolution,Math.floor(c.spriteSourceSize.y)/this.resolution,Math.floor(f.w)/this.resolution,Math.floor(f.h)/this.resolution)),this.textures[o]=new Ut({source:this.textureSource,frame:m,orig:x,trim:p,rotate:c.rotated?2:0,defaultAnchor:c.anchor,defaultBorders:c.borders,label:o.toString()})}a++}}_processAnimations(){const t=this.data.animations||{};for(const n in t){this.animations[n]=[];for(let a=0;a<t[n].length;a++){const u=t[n][a];this.animations[n].push(this.textures[u])}}}_parseComplete(){const t=this._callback;this._callback=null,this._batchIndex=0,t.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Ja.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Ja.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(t=!1){var n;for(const a in this.textures)this.textures[a].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,t&&((n=this._texture)==null||n.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};Wg.BATCH_SIZE=1e3;let Ay=Wg;const Yb=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function Zg(l,t,n){const a={};if(l.forEach(u=>{a[u]=t}),Object.keys(t.textures).forEach(u=>{a[`${t.cachePrefix}${u}`]=t.textures[u]}),!n){const u=rl.dirname(l[0]);t.linkedSheets.forEach((o,c)=>{const f=Zg([`${u}/${t.data.meta.related_multi_packs[c]}`],o,!0);Object.assign(a,f)})}return a}const qb={extension:yt.Asset,cache:{test:l=>l instanceof Ay,getCacheableAssets:(l,t)=>Zg(l,t,!1)},resolver:{extension:{type:yt.ResolveParser,name:"resolveSpritesheet"},test:l=>{const n=l.split("?")[0].split("."),a=n.pop(),u=n.pop();return a==="json"&&Yb.includes(u)},parse:l=>{var n;const t=l.split(".");return{resolution:parseFloat(((n=Qg.RETINA_PREFIX.exec(l))==null?void 0:n[1])??"1"),format:t[t.length-2],src:l}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:yt.LoadParser,priority:Pg.Normal,name:"spritesheetLoader"},async testParse(l,t){return rl.extname(t.src).toLowerCase()===".json"&&!!l.frames},async parse(l,t,n){var x,b;const{texture:a,imageFilename:u,textureOptions:o,cachePrefix:c}=(t==null?void 0:t.data)??{};let f=rl.dirname(t.src);f&&f.lastIndexOf("/")!==f.length-1&&(f+="/");let m;if(a instanceof Ut)m=a;else{const _=wy(f+(u??l.meta.image),t.src);m=(await n.load([{src:_,data:o}]))[_]}const p=new Ay({texture:m.source,data:l,cachePrefix:c});await p.parse();const y=(x=l==null?void 0:l.meta)==null?void 0:x.related_multi_packs;if(Array.isArray(y)){const _=[];for(const w of y){if(typeof w!="string")continue;let S=f+w;(b=t.data)!=null&&b.ignoreMultiPack||(S=wy(S,t.src),_.push(n.load({src:S,data:{textureOptions:o,ignoreMultiPack:!0}})))}const T=await Promise.all(_);p.linkedSheets=T,T.forEach(w=>{w.linkedSheets=[p].concat(p.linkedSheets.filter(S=>S!==w))})}return p},async unload(l,t,n){await n.unload(l.textureSource._sourceOrigin),l.destroy(!1)}}};te.add(qb);const Vc=Object.create(null),Cy=Object.create(null);function Bh(l,t){let n=Cy[l];return n===void 0&&(Vc[t]===void 0&&(Vc[t]=1),Cy[l]=n=Vc[t]++),n}let Ns;function Ig(){return(!Ns||Ns!=null&&Ns.isContextLost())&&(Ns=Xe.get().createCanvas().getContext("webgl",{})),Ns}let qr;function Xb(){if(!qr){qr="mediump";const l=Ig();l&&l.getShaderPrecisionFormat&&(qr=l.getShaderPrecisionFormat(l.FRAGMENT_SHADER,l.HIGH_FLOAT).precision?"highp":"mediump")}return qr}function Vb(l,t,n){return t?l:n?(l=l.replace("out vec4 finalColor;",""),`
54
+
55
+ #ifdef GL_ES // This checks if it is WebGL1
56
+ #define in varying
57
+ #define finalColor gl_FragColor
58
+ #define texture texture2D
59
+ #endif
60
+ ${l}
61
+ `):`
62
+
63
+ #ifdef GL_ES // This checks if it is WebGL1
64
+ #define in attribute
65
+ #define out varying
66
+ #endif
67
+ ${l}
68
+ `}function Pb(l,t,n){const a=n?t.maxSupportedFragmentPrecision:t.maxSupportedVertexPrecision;if(l.substring(0,9)!=="precision"){let u=n?t.requestedFragmentPrecision:t.requestedVertexPrecision;return u==="highp"&&a!=="highp"&&(u="mediump"),`precision ${u} float;
69
+ ${l}`}else if(a!=="highp"&&l.substring(0,15)==="precision highp")return l.replace("precision highp","precision mediump");return l}function Fb(l,t){return t?`#version 300 es
70
+ ${l}`:l}const Qb={},Wb={};function Zb(l,{name:t="pixi-program"},n=!0){t=t.replace(/\s+/g,"-"),t+=n?"-fragment":"-vertex";const a=n?Qb:Wb;return a[t]?(a[t]++,t+=`-${a[t]}`):a[t]=1,l.indexOf("#define SHADER_NAME")!==-1?l:`${`#define SHADER_NAME ${t}`}
71
+ ${l}`}function Ib(l,t){return t?l.replace("#version 300 es",""):l}const Pc={stripVersion:Ib,ensurePrecision:Pb,addProgramDefines:Vb,setProgramName:Zb,insertVersion:Fb},Pa=Object.create(null),Kg=class fh{constructor(t){t={...fh.defaultOptions,...t};const n=t.fragment.indexOf("#version 300 es")!==-1,a={stripVersion:n,ensurePrecision:{requestedFragmentPrecision:t.preferredFragmentPrecision,requestedVertexPrecision:t.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:Xb()},setProgramName:{name:t.name},addProgramDefines:n,insertVersion:n};let u=t.fragment,o=t.vertex;Object.keys(Pc).forEach(c=>{const f=a[c];u=Pc[c](u,f,!0),o=Pc[c](o,f,!1)}),this.fragment=u,this.vertex=o,this.transformFeedbackVaryings=t.transformFeedbackVaryings,this._key=Bh(`${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,Pa[this._cacheKey]=null}static from(t){const n=`${t.vertex}:${t.fragment}`;return Pa[n]||(Pa[n]=new fh(t),Pa[n]._cacheKey=n),Pa[n]}};Kg.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Jg=Kg;const My={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 Kb(l){return My[l]??My.float32}const Jb={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"},Ey=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|\)|$)/g;function Ry(l,t){let n;for(;(n=Ey.exec(l))!==null;){const a=Jb[n[3]]??"float32";t[n[2]]={location:parseInt(n[1],10),format:a,stride:Kb(a).stride,offset:0,instance:!1,start:0}}Ey.lastIndex=0}function $b(l){return l.replace(/\/\/.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"")}function tv({source:l,entryPoint:t}){const n={},a=$b(l),u=a.indexOf(`fn ${t}(`);if(u===-1)return n;const o=a.indexOf("->",u);if(o===-1)return n;const c=a.substring(u,o);if(Ry(c,n),Object.keys(n).length===0){const f=c.match(/\(\s*\w+\s*:\s*(\w+)/);if(f){const m=f[1],p=new RegExp(`struct\\s+${m}\\s*\\{([^}]+)\\}`,"s"),y=a.match(p);y&&Ry(y[1],n)}}return n}function Fc(l){var x,b;const t=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,n=/@group\((\d+)\)/,a=/@binding\((\d+)\)/,u=/var(<[^>]+>)? (\w+)/,o=/:\s*([\w<>]+)/,c=/struct\s+(\w+)\s*{([^}]+)}/g,f=/(\w+)\s*:\s*([\w\<\>]+)/g,m=/struct\s+(\w+)/,p=(x=l.match(t))==null?void 0:x.map(_=>({group:parseInt(_.match(n)[1],10),binding:parseInt(_.match(a)[1],10),name:_.match(u)[2],isUniform:_.match(u)[1]==="<uniform>",type:_.match(o)[1]}));if(!p)return{groups:[],structs:[]};const y=((b=l.match(c))==null?void 0:b.map(_=>{const T=_.match(m)[1],w=_.match(f).reduce((S,A)=>{const[z,D]=A.split(":");return S[z.trim()]=D.trim(),S},{});return w?{name:T,members:w}:null}).filter(({name:_})=>p.some(T=>T.type===_||T.type.includes(`<${_}>`))))??[];return{groups:p,structs:y}}var Qn=(l=>(l[l.VERTEX=1]="VERTEX",l[l.FRAGMENT=2]="FRAGMENT",l[l.COMPUTE=4]="COMPUTE",l))(Qn||{});function ev({groups:l}){const t=[];for(let n=0;n<l.length;n++){const a=l[n];t[a.group]||(t[a.group]=[]),a.isUniform?t[a.group].push({binding:a.binding,visibility:Qn.VERTEX|Qn.FRAGMENT,buffer:{type:"uniform"}}):a.type==="sampler"?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,sampler:{type:"filtering"}}):a.type==="texture_2d"||a.type.startsWith("texture_2d<")?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}}):a.type==="texture_2d_array"||a.type.startsWith("texture_2d_array<")?t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d-array",multisampled:!1}}):(a.type==="texture_cube"||a.type.startsWith("texture_cube<"))&&t[a.group].push({binding:a.binding,visibility:Qn.FRAGMENT,texture:{sampleType:"float",viewDimension:"cube",multisampled:!1}})}for(let n=0;n<t.length;n++)t[n]||(t[n]=[]);return t}function iv({groups:l}){const t=[];for(let n=0;n<l.length;n++){const a=l[n];t[a.group]||(t[a.group]={}),t[a.group][a.name]=a.binding}return t}function nv(l,t){const n=new Set,a=new Set,u=[...l.structs,...t.structs].filter(c=>n.has(c.name)?!1:(n.add(c.name),!0)),o=[...l.groups,...t.groups].filter(c=>{const f=`${c.name}-${c.binding}`;return a.has(f)?!1:(a.add(f),!0)});return{structs:u,groups:o}}const Fa=Object.create(null);class oo{constructor(t){var f,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:n,vertex:a,layout:u,gpuLayout:o,name:c}=t;if(this.name=c,this.fragment=n,this.vertex=a,n.source===a.source){const p=Fc(n.source);this.structsAndGroups=p}else{const p=Fc(a.source),y=Fc(n.source);this.structsAndGroups=nv(p,y)}this.layout=u??iv(this.structsAndGroups),this.gpuLayout=o??ev(this.structsAndGroups),this.autoAssignGlobalUniforms=((f=this.layout[0])==null?void 0:f.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((m=this.layout[1])==null?void 0:m.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:t,fragment:n}=this,a=t.source+n.source+t.entryPoint+n.entryPoint;this._layoutKey=Bh(a,"program")}get attributeData(){return this._attributeData??(this._attributeData=tv(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null,Fa[this._cacheKey]=null}static from(t){const n=`${t.vertex.source}:${t.fragment.source}:${t.fragment.entryPoint}:${t.vertex.entryPoint}`;return Fa[n]||(Fa[n]=new oo(t),Fa[n]._cacheKey=n),Fa[n]}}const $g=["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>"],sv=$g.reduce((l,t)=>(l[t]=!0,l),{});function av(l,t){switch(l){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 t0=class e0{constructor(t,n){this._touched=0,this.uid=Wt("uniform"),this._resourceType="uniformGroup",this._resourceId=Wt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,n={...e0.defaultOptions,...n},this.uniformStructures=t;const a={};for(const u in t){const o=t[u];if(o.name=u,o.size=o.size??1,!sv[o.type]){const c=o.type.match(/^array<(\w+(?:<\w+>)?),\s*(\d+)>$/);if(c){const[,f,m]=c;throw new Error(`Uniform type ${o.type} is not supported. Use type: '${f}', size: ${m} instead.`)}throw new Error(`Uniform type ${o.type} is not supported. Supported uniform types are: ${$g.join(", ")}`)}o.value??(o.value=av(o.type,o.size)),a[u]=o.value}this.uniforms=a,this._dirtyId=1,this.ubo=n.ubo,this.isStatic=n.isStatic,this._signature=Bh(Object.keys(a).map(u=>`${u}-${t[u].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};t0.defaultOptions={ubo:!1,isStatic:!1};let i0=t0;class $r{constructor(t){this.resources=Object.create(null),this._dirty=!0;let n=0;for(const a in t){const u=t[a];this.setResource(u,n++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const t=[];let n=0;for(const a in this.resources)t[n++]=this.resources[a]._resourceId;this._key=t.join("|")}setResource(t,n){var u,o;const a=this.resources[n];t!==a&&((u=a==null?void 0:a.off)==null||u.call(a,"change",this.onResourceChange,this),(o=t.on)==null||o.call(t,"change",this.onResourceChange,this),this.resources[n]=t,this._dirty=!0)}getResource(t){return this.resources[t]}_touch(t,n){const a=this.resources;for(const u in a)a[u]._gcLastUsed=t,a[u]._touched=n}destroy(){var n;const t=this.resources;for(const a in t){const u=t[a];(n=u==null?void 0:u.off)==null||n.call(u,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(t){this._dirty=!0,t.destroyed?this.destroy():this._updateKey()}}var dh=(l=>(l[l.WEBGL=1]="WEBGL",l[l.WEBGPU=2]="WEBGPU",l[l.CANVAS=4]="CANVAS",l[l.BOTH=3]="BOTH",l))(dh||{});class Oh extends vi{constructor(t){super(),this.uid=Wt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[],this._destroyed=!1;let{gpuProgram:n,glProgram:a,groups:u,resources:o,compatibleRenderers:c,groupMap:f}=t;this.gpuProgram=n,this.glProgram=a,c===void 0&&(c=0,n&&(c|=dh.WEBGPU),a&&(c|=dh.WEBGL)),this.compatibleRenderers=c;const m={};if(!o&&!u&&(o={}),o&&u)throw new Error("[Shader] Cannot have both resources and groups");if(!n&&u&&!f)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!n&&u&&f)for(const p in f)for(const y in f[p]){const x=f[p][y];m[x]={group:p,binding:y,name:x}}else if(n&&u&&!f){const p=n.structsAndGroups.groups;f={},p.forEach(y=>{f[y.group]=f[y.group]||{},f[y.group][y.binding]=y.name,m[y.name]=y})}else if(o){u={},f={},n&&n.structsAndGroups.groups.forEach(x=>{f[x.group]=f[x.group]||{},f[x.group][x.binding]=x.name,m[x.name]=x});let p=0;for(const y in o)m[y]||(u[99]||(u[99]=new $r,this._ownedBindGroups.push(u[99])),m[y]={group:99,binding:p,name:y},f[99]=f[99]||{},f[99][p]=y,p++);for(const y in o){const x=y;let b=o[y];!b.source&&!b._resourceType&&(b=new i0(b));const _=m[x];_&&(u[_.group]||(u[_.group]=new $r,this._ownedBindGroups.push(u[_.group])),u[_.group].setResource(b,_.binding))}}this.groups=u,this._uniformBindMap=f,this.resources=this._buildResourceAccessor(u,m)}addResource(t,n,a){var u,o;(u=this._uniformBindMap)[n]||(u[n]={}),(o=this._uniformBindMap[n])[a]||(o[a]=t),this.groups[n]||(this.groups[n]=new $r,this._ownedBindGroups.push(this.groups[n]))}_buildResourceAccessor(t,n){const a={};for(const u in n){const o=n[u];Object.defineProperty(a,o.name,{get(){return t[o.group].getResource(o.binding)},set(c){t[o.group].setResource(c,o.binding)}})}return a}destroy(t=!1){var n,a;this._destroyed||(this._destroyed=!0,this.emit("destroy",this),t&&((n=this.gpuProgram)==null||n.destroy(),(a=this.glProgram)==null||a.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(u=>{u.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null)}static from(t){const{gpu:n,gl:a,...u}=t;let o,c;return n&&(o=oo.from(n)),a&&(c=Jg.from(a)),new Oh({gpuProgram:o,glProgram:c,...u})}}const lv={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},Qc=0,Wc=1,Zc=2,Ic=3,Kc=4,Jc=5,mh=class n0{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<Qc)}set blend(t){!!(this.data&1<<Qc)!==t&&(this.data^=1<<Qc)}get offsets(){return!!(this.data&1<<Wc)}set offsets(t){!!(this.data&1<<Wc)!==t&&(this.data^=1<<Wc)}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<<Zc)}set culling(t){!!(this.data&1<<Zc)!==t&&(this.data^=1<<Zc)}get depthTest(){return!!(this.data&1<<Ic)}set depthTest(t){!!(this.data&1<<Ic)!==t&&(this.data^=1<<Ic)}get depthMask(){return!!(this.data&1<<Jc)}set depthMask(t){!!(this.data&1<<Jc)!==t&&(this.data^=1<<Jc)}get clockwiseFrontFace(){return!!(this.data&1<<Kc)}set clockwiseFrontFace(t){!!(this.data&1<<Kc)!==t&&(this.data^=1<<Kc)}get blendMode(){return this._blendMode}set blendMode(t){this.blend=t!=="none",this._blendMode=t,this._blendModeId=lv[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 n0;return t.depthTest=!1,t.blend=!0,t}};mh.default2d=mh.for2d();let s0=mh;const ph=[];te.handleByNamedList(yt.Environment,ph);async function rv(l){if(!l)for(let t=0;t<ph.length;t++){const n=ph[t];if(n.value.test()){await n.value.load();return}}}let Qa;function ov(){if(typeof Qa=="boolean")return Qa;try{Qa=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{Qa=!1}return Qa}function zy(l,t,n=2){const a=t&&t.length,u=a?t[0]*n:l.length;let o=a0(l,0,u,n,!0);const c=[];if(!o||o.next===o.prev)return c;let f,m,p;if(a&&(o=dv(l,t,o,n)),l.length>80*n){f=l[0],m=l[1];let y=f,x=m;for(let b=n;b<u;b+=n){const _=l[b],T=l[b+1];_<f&&(f=_),T<m&&(m=T),_>y&&(y=_),T>x&&(x=T)}p=Math.max(y-f,x-m),p=p!==0?32767/p:0}return ol(o,c,n,f,m,p,0),c}function a0(l,t,n,a,u){let o;if(u===wv(l,t,n,a)>0)for(let c=t;c<n;c+=a)o=Dy(c/a|0,l[c],l[c+1],o);else for(let c=n-a;c>=t;c-=a)o=Dy(c/a|0,l[c],l[c+1],o);return o&&Ws(o,o.next)&&(cl(o),o=o.next),o}function Kn(l,t){if(!l)return l;t||(t=l);let n=l,a;do if(a=!1,!n.steiner&&(Ws(n,n.next)||qt(n.prev,n,n.next)===0)){if(cl(n),n=t=n.prev,n===n.next)break;a=!0}else n=n.next;while(a||n!==t);return t}function ol(l,t,n,a,u,o,c){if(!l)return;!c&&o&&xv(l,a,u,o);let f=l;for(;l.prev!==l.next;){const m=l.prev,p=l.next;if(o?cv(l,a,u,o):uv(l)){t.push(m.i,l.i,p.i),cl(l),l=p.next,f=p.next;continue}if(l=p,l===f){c?c===1?(l=hv(Kn(l),t),ol(l,t,n,a,u,o,2)):c===2&&fv(l,t,n,a,u,o):ol(Kn(l),t,n,a,u,o,1);break}}}function uv(l){const t=l.prev,n=l,a=l.next;if(qt(t,n,a)>=0)return!1;const u=t.x,o=n.x,c=a.x,f=t.y,m=n.y,p=a.y,y=Math.min(u,o,c),x=Math.min(f,m,p),b=Math.max(u,o,c),_=Math.max(f,m,p);let T=a.next;for(;T!==t;){if(T.x>=y&&T.x<=b&&T.y>=x&&T.y<=_&&$a(u,f,o,m,c,p,T.x,T.y)&&qt(T.prev,T,T.next)>=0)return!1;T=T.next}return!0}function cv(l,t,n,a){const u=l.prev,o=l,c=l.next;if(qt(u,o,c)>=0)return!1;const f=u.x,m=o.x,p=c.x,y=u.y,x=o.y,b=c.y,_=Math.min(f,m,p),T=Math.min(y,x,b),w=Math.max(f,m,p),S=Math.max(y,x,b),A=yh(_,T,t,n,a),z=yh(w,S,t,n,a);let D=l.prevZ,G=l.nextZ;for(;D&&D.z>=A&&G&&G.z<=z;){if(D.x>=_&&D.x<=w&&D.y>=T&&D.y<=S&&D!==u&&D!==c&&$a(f,y,m,x,p,b,D.x,D.y)&&qt(D.prev,D,D.next)>=0||(D=D.prevZ,G.x>=_&&G.x<=w&&G.y>=T&&G.y<=S&&G!==u&&G!==c&&$a(f,y,m,x,p,b,G.x,G.y)&&qt(G.prev,G,G.next)>=0))return!1;G=G.nextZ}for(;D&&D.z>=A;){if(D.x>=_&&D.x<=w&&D.y>=T&&D.y<=S&&D!==u&&D!==c&&$a(f,y,m,x,p,b,D.x,D.y)&&qt(D.prev,D,D.next)>=0)return!1;D=D.prevZ}for(;G&&G.z<=z;){if(G.x>=_&&G.x<=w&&G.y>=T&&G.y<=S&&G!==u&&G!==c&&$a(f,y,m,x,p,b,G.x,G.y)&&qt(G.prev,G,G.next)>=0)return!1;G=G.nextZ}return!0}function hv(l,t){let n=l;do{const a=n.prev,u=n.next.next;!Ws(a,u)&&r0(a,n,n.next,u)&&ul(a,u)&&ul(u,a)&&(t.push(a.i,n.i,u.i),cl(n),cl(n.next),n=l=u),n=n.next}while(n!==l);return Kn(n)}function fv(l,t,n,a,u,o){let c=l;do{let f=c.next.next;for(;f!==c.prev;){if(c.i!==f.i&&vv(c,f)){let m=o0(c,f);c=Kn(c,c.next),m=Kn(m,m.next),ol(c,t,n,a,u,o,0),ol(m,t,n,a,u,o,0);return}f=f.next}c=c.next}while(c!==l)}function dv(l,t,n,a){const u=[];for(let o=0,c=t.length;o<c;o++){const f=t[o]*a,m=o<c-1?t[o+1]*a:l.length,p=a0(l,f,m,a,!1);p===p.next&&(p.steiner=!0),u.push(bv(p))}u.sort(mv);for(let o=0;o<u.length;o++)n=pv(u[o],n);return n}function mv(l,t){let n=l.x-t.x;if(n===0&&(n=l.y-t.y,n===0)){const a=(l.next.y-l.y)/(l.next.x-l.x),u=(t.next.y-t.y)/(t.next.x-t.x);n=a-u}return n}function pv(l,t){const n=yv(l,t);if(!n)return t;const a=o0(n,l);return Kn(a,a.next),Kn(n,n.next)}function yv(l,t){let n=t;const a=l.x,u=l.y;let o=-1/0,c;if(Ws(l,n))return n;do{if(Ws(l,n.next))return n.next;if(u<=n.y&&u>=n.next.y&&n.next.y!==n.y){const x=n.x+(u-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(x<=a&&x>o&&(o=x,c=n.x<n.next.x?n:n.next,x===a))return c}n=n.next}while(n!==t);if(!c)return null;const f=c,m=c.x,p=c.y;let y=1/0;n=c;do{if(a>=n.x&&n.x>=m&&a!==n.x&&l0(u<p?a:o,u,m,p,u<p?o:a,u,n.x,n.y)){const x=Math.abs(u-n.y)/(a-n.x);ul(n,l)&&(x<y||x===y&&(n.x>c.x||n.x===c.x&&gv(c,n)))&&(c=n,y=x)}n=n.next}while(n!==f);return c}function gv(l,t){return qt(l.prev,l,t.prev)<0&&qt(t.next,l,l.next)<0}function xv(l,t,n,a){let u=l;do u.z===0&&(u.z=yh(u.x,u.y,t,n,a)),u.prevZ=u.prev,u.nextZ=u.next,u=u.next;while(u!==l);u.prevZ.nextZ=null,u.prevZ=null,_v(u)}function _v(l){let t,n=1;do{let a=l,u;l=null;let o=null;for(t=0;a;){t++;let c=a,f=0;for(let p=0;p<n&&(f++,c=c.nextZ,!!c);p++);let m=n;for(;f>0||m>0&&c;)f!==0&&(m===0||!c||a.z<=c.z)?(u=a,a=a.nextZ,f--):(u=c,c=c.nextZ,m--),o?o.nextZ=u:l=u,u.prevZ=o,o=u;a=c}o.nextZ=null,n*=2}while(t>1);return l}function yh(l,t,n,a,u){return l=(l-n)*u|0,t=(t-a)*u|0,l=(l|l<<8)&16711935,l=(l|l<<4)&252645135,l=(l|l<<2)&858993459,l=(l|l<<1)&1431655765,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,l|t<<1}function bv(l){let t=l,n=l;do(t.x<n.x||t.x===n.x&&t.y<n.y)&&(n=t),t=t.next;while(t!==l);return n}function l0(l,t,n,a,u,o,c,f){return(u-c)*(t-f)>=(l-c)*(o-f)&&(l-c)*(a-f)>=(n-c)*(t-f)&&(n-c)*(o-f)>=(u-c)*(a-f)}function $a(l,t,n,a,u,o,c,f){return!(l===c&&t===f)&&l0(l,t,n,a,u,o,c,f)}function vv(l,t){return l.next.i!==t.i&&l.prev.i!==t.i&&!Sv(l,t)&&(ul(l,t)&&ul(t,l)&&Tv(l,t)&&(qt(l.prev,l,t.prev)||qt(l,t.prev,t))||Ws(l,t)&&qt(l.prev,l,l.next)>0&&qt(t.prev,t,t.next)>0)}function qt(l,t,n){return(t.y-l.y)*(n.x-t.x)-(t.x-l.x)*(n.y-t.y)}function Ws(l,t){return l.x===t.x&&l.y===t.y}function r0(l,t,n,a){const u=Vr(qt(l,t,n)),o=Vr(qt(l,t,a)),c=Vr(qt(n,a,l)),f=Vr(qt(n,a,t));return!!(u!==o&&c!==f||u===0&&Xr(l,n,t)||o===0&&Xr(l,a,t)||c===0&&Xr(n,l,a)||f===0&&Xr(n,t,a))}function Xr(l,t,n){return t.x<=Math.max(l.x,n.x)&&t.x>=Math.min(l.x,n.x)&&t.y<=Math.max(l.y,n.y)&&t.y>=Math.min(l.y,n.y)}function Vr(l){return l>0?1:l<0?-1:0}function Sv(l,t){let n=l;do{if(n.i!==l.i&&n.next.i!==l.i&&n.i!==t.i&&n.next.i!==t.i&&r0(n,n.next,l,t))return!0;n=n.next}while(n!==l);return!1}function ul(l,t){return qt(l.prev,l,l.next)<0?qt(l,t,l.next)>=0&&qt(l,l.prev,t)>=0:qt(l,t,l.prev)<0||qt(l,l.next,t)<0}function Tv(l,t){let n=l,a=!1;const u=(l.x+t.x)/2,o=(l.y+t.y)/2;do n.y>o!=n.next.y>o&&n.next.y!==n.y&&u<(n.next.x-n.x)*(o-n.y)/(n.next.y-n.y)+n.x&&(a=!a),n=n.next;while(n!==l);return a}function o0(l,t){const n=gh(l.i,l.x,l.y),a=gh(t.i,t.x,t.y),u=l.next,o=t.prev;return l.next=t,t.prev=l,n.next=u,u.prev=n,a.next=n,n.prev=a,o.next=a,a.prev=o,a}function Dy(l,t,n,a){const u=gh(l,t,n);return a?(u.next=a.next,u.prev=a,a.next.prev=u,a.next=u):(u.prev=u,u.next=u),u}function cl(l){l.next.prev=l.prev,l.prev.next=l.next,l.prevZ&&(l.prevZ.nextZ=l.nextZ),l.nextZ&&(l.nextZ.prevZ=l.prevZ)}function gh(l,t,n){return{i:l,x:t,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function wv(l,t,n,a){let u=0;for(let o=t,c=n-a;o<n;o+=a)u+=(l[c]-l[o])*(l[o+1]+l[c+1]),c=o;return u}const Av=zy.default||zy;var u0=(l=>(l[l.NONE=0]="NONE",l[l.COLOR=16384]="COLOR",l[l.STENCIL=1024]="STENCIL",l[l.DEPTH=256]="DEPTH",l[l.COLOR_DEPTH=16640]="COLOR_DEPTH",l[l.COLOR_STENCIL=17408]="COLOR_STENCIL",l[l.DEPTH_STENCIL=1280]="DEPTH_STENCIL",l[l.ALL=17664]="ALL",l))(u0||{});class Cv{constructor(t){this.items=[],this._name=t}emit(t,n,a,u,o,c,f,m){const{name:p,items:y}=this;for(let x=0,b=y.length;x<b;x++)y[x][p](t,n,a,u,o,c,f,m);return this}add(t){return t[this._name]&&(this.remove(t),this.items.push(t)),this}remove(t){const n=this.items.indexOf(t);return n!==-1&&this.items.splice(n,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 Mv=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],c0=class h0 extends vi{constructor(t){super(),this.tick=0,this.uid=Wt("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 n=[...Mv,...this.config.runners??[]];this._addRunners(...n),this._unsafeEvalCheck()}async init(t={}){const n=t.skipExtensionImports===!0?!0:t.manageImports===!1;await rv(n),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const a in this._systemsHash)t={...this._systemsHash[a].constructor.defaultOptions,...t};t={...h0.defaultOptions,...t},this._roundPixels=t.roundPixels?1:0;for(let a=0;a<this.runners.init.items.length;a++)await this.runners.init.items[a].init(t);this._initOptions=t}render(t,n){this.tick++;let a=t;if(a instanceof ai&&(a={container:a},n&&(wt(Qt,"passing a second argument is deprecated, please use render options instead"),a.target=n.renderTexture)),a.target||(a.target=this.view.renderTarget),a.target===this.view.renderTarget&&(this._lastObjectRendered=a.container,a.clearColor??(a.clearColor=this.background.colorRgba),a.clear??(a.clear=this.background.clearBeforeRender)),a.clearColor){const u=Array.isArray(a.clearColor)&&a.clearColor.length===4;a.clearColor=u?a.clearColor:re.shared.setValue(a.clearColor).toArray()}a.transform||(a.container.updateLocalTransform(),a.transform=a.container.localTransform),a.container.visible&&(a.container.enableRenderGroup(),this.runners.prerender.emit(a),this.runners.renderStart.emit(a),this.runners.render.emit(a),this.runners.renderEnd.emit(a),this.runners.postrender.emit(a))}resize(t,n,a){const u=this.view.resolution;this.view.resize(t,n,a),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),a!==void 0&&a!==u&&this.runners.resolutionChange.emit(a)}clear(t={}){const n=this;t.target||(t.target=n.renderTarget.renderTarget),t.clearColor||(t.clearColor=this.background.colorRgba),t.clear??(t.clear=u0.ALL);const{clear:a,clearColor:u,target:o,mipLevel:c,layer:f}=t;re.shared.setValue(u??this.background.colorRgba),n.renderTarget.clear(o,a,re.shared.toArray(),c??0,f??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(n=>{this.runners[n]=new Cv(n)})}_addSystems(t){let n;for(n in t){const a=t[n];this._addSystem(a.value,a.name)}}_addSystem(t,n){const a=new t(this);if(this[n])throw new Error(`Whoops! The name "${n}" is already in use`);this[n]=a,this._systemsHash[n]=a;for(const u in this.runners)this.runners[u].add(a);return this}_addPipes(t,n){const a=n.reduce((u,o)=>(u[o.name]=o.value,u),{});t.forEach(u=>{const o=u.value,c=u.name,f=a[c];this.renderPipes[c]=new o(this,f?new f:null),this.runners.destroy.add(this.renderPipes[c])})}destroy(t=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(t),(t===!0||typeof t=="object"&&t.releaseGlobalResources)&&dl.release(),Object.values(this.runners).forEach(n=>{n.destroy()}),this._systemsHash=null,this.renderPipes=null,this.removeAllListeners()}generateTexture(t){return this.textureGenerator.generateTexture(t)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!ov())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()}};c0.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let f0=c0,Pr;function Ev(l){return Pr!==void 0||(Pr=(()=>{var n;const t={stencil:!0,failIfMajorPerformanceCaveat:l??f0.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Xe.get().getWebGLRenderingContext())return!1;let u=Xe.get().createCanvas().getContext("webgl",t);const o=!!((n=u==null?void 0:u.getContextAttributes())!=null&&n.stencil);if(u){const c=u.getExtension("WEBGL_lose_context");c&&c.loseContext()}return u=null,o}catch{return!1}})()),Pr}let Fr;async function Rv(l={}){return Fr!==void 0||(Fr=await(async()=>{const t=Xe.get().getNavigator().gpu;if(!t)return!1;try{return await(await t.requestAdapter(l)).requestDevice(),!0}catch{return!1}})()),Fr}const By=["webgl","webgpu","canvas"];async function zv(l){let t=[];l.preference?(t.push(l.preference),By.forEach(o=>{o!==l.preference&&t.push(o)})):t=By.slice();let n,a={};for(let o=0;o<t.length;o++){const c=t[o];if(c==="webgpu"&&await Rv()){const{WebGPURenderer:f}=await el(async()=>{const{WebGPURenderer:m}=await import("./WebGPURenderer-BuJedD5Q.js");return{WebGPURenderer:m}},__vite__mapDeps([3,4,5,2]));n=f,a={...l,...l.webgpu};break}else if(c==="webgl"&&Ev(l.failIfMajorPerformanceCaveat??f0.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:f}=await el(async()=>{const{WebGLRenderer:m}=await import("./WebGLRenderer-Bnd2tXK6.js");return{WebGLRenderer:m}},__vite__mapDeps([6,4,5,2]));n=f,a={...l,...l.webgl};break}else if(c==="canvas"){const{CanvasRenderer:f}=await el(async()=>{const{CanvasRenderer:m}=await import("./CanvasRenderer-CKwE0kc4.js");return{CanvasRenderer:m}},__vite__mapDeps([7,5,2]));n=f,a={...l,...l.canvasOptions};break}}if(delete a.webgpu,delete a.webgl,delete a.canvasOptions,!n)throw new Error("No available renderer for the current environment");const u=new n;return await u.init(a),u}const d0="8.17.1";class m0{static init(){var t;(t=globalThis.__PIXI_APP_INIT__)==null||t.call(globalThis,this,d0)}static destroy(){}}m0.extension=yt.Application;class Dv{constructor(t){this._renderer=t}init(){var t;(t=globalThis.__PIXI_RENDERER_INIT__)==null||t.call(globalThis,this._renderer,d0)}destroy(){this._renderer=null}}Dv.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"initHook",priority:-10};class p0{static init(t){Object.defineProperty(this,"resizeTo",{configurable:!0,set(n){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=n,n&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this._cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this._cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this._cancelResize();let n,a;if(this._resizeTo===globalThis.window)n=globalThis.innerWidth,a=globalThis.innerHeight;else{const{clientWidth:u,clientHeight:o}=this._resizeTo;n=u,a=o}this.renderer.resize(n,a),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}}p0.extension=yt.Application;class y0{static init(t){t=Object.assign({autoStart:!0,sharedTicker:!1},t),Object.defineProperty(this,"ticker",{configurable:!0,set(n){this._ticker&&this._ticker.remove(this.render,this),this._ticker=n,n&&n.add(this.render,this,io.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=t.sharedTicker?Xs.shared:new Xs,t.autoStart&&this.start()}static destroy(){if(this._ticker){const t=this._ticker;this.ticker=null,t.destroy()}}}y0.extension=yt.Application;te.add(p0);te.add(y0);const g0=class xh{constructor(...t){this.stage=new ai,t[0]!==void 0&&wt(Qt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(t){t={...t},this.stage||(this.stage=new ai),this.renderer=await zv(t),xh._plugins.forEach(n=>{n.init.call(this,t)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return wt(Qt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(t=!1,n=!1){const a=xh._plugins.slice(0);a.reverse(),a.forEach(u=>{u.destroy.call(this)}),this.stage.destroy(n),this.stage=null,this.renderer.destroy(t),this.renderer=null}};g0._plugins=[];let x0=g0;te.handleByList(yt.Application,x0._plugins);te.add(m0);var $c,Oy;function Bv(){if(Oy)return $c;Oy=1,$c=n;var l={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 n(o){var c=[];return o.replace(t,function(f,m,p){var y=m.toLowerCase();for(p=u(p),y=="m"&&p.length>2&&(c.push([m].concat(p.splice(0,2))),y="l",m=m=="m"?"l":"L");;){if(p.length==l[y])return p.unshift(m),c.push(p);if(p.length<l[y])throw new Error("malformed path data");c.push([m].concat(p.splice(0,l[y])))}}),c}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function u(o){var c=o.match(a);return c?c.map(Number):[]}return $c}var Ov=Bv();const Gv=Ch(Ov);function Uv(l,t){const n=Gv(l),a=[];let u=null,o=0,c=0;for(let f=0;f<n.length;f++){const m=n[f],p=m[0],y=m;switch(p){case"M":o=y[1],c=y[2],t.moveTo(o,c);break;case"m":o+=y[1],c+=y[2],t.moveTo(o,c);break;case"H":o=y[1],t.lineTo(o,c);break;case"h":o+=y[1],t.lineTo(o,c);break;case"V":c=y[1],t.lineTo(o,c);break;case"v":c+=y[1],t.lineTo(o,c);break;case"L":o=y[1],c=y[2],t.lineTo(o,c);break;case"l":o+=y[1],c+=y[2],t.lineTo(o,c);break;case"C":o=y[5],c=y[6],t.bezierCurveTo(y[1],y[2],y[3],y[4],o,c);break;case"c":t.bezierCurveTo(o+y[1],c+y[2],o+y[3],c+y[4],o+y[5],c+y[6]),o+=y[5],c+=y[6];break;case"S":o=y[3],c=y[4],t.bezierCurveToShort(y[1],y[2],o,c);break;case"s":t.bezierCurveToShort(o+y[1],c+y[2],o+y[3],c+y[4]),o+=y[3],c+=y[4];break;case"Q":o=y[3],c=y[4],t.quadraticCurveTo(y[1],y[2],o,c);break;case"q":t.quadraticCurveTo(o+y[1],c+y[2],o+y[3],c+y[4]),o+=y[3],c+=y[4];break;case"T":o=y[1],c=y[2],t.quadraticCurveToShort(o,c);break;case"t":o+=y[1],c+=y[2],t.quadraticCurveToShort(o,c);break;case"A":o=y[6],c=y[7],t.arcToSvg(y[1],y[2],y[3],y[4],y[5],o,c);break;case"a":o+=y[6],c+=y[7],t.arcToSvg(y[1],y[2],y[3],y[4],y[5],o,c);break;case"Z":case"z":t.closePath(),a.length>0&&(u=a.pop(),u?(o=u.startX,c=u.startY):(o=0,c=0)),u=null;break;default:Se(`Unknown SVG path command: ${p}`)}p!=="Z"&&p!=="z"&&u===null&&(u={startX:o,startY:c},a.push(u))}return t}class Gh{constructor(t=0,n=0,a=0){this.type="circle",this.x=t,this.y=n,this.radius=a}clone(){return new Gh(this.x,this.y,this.radius)}contains(t,n){if(this.radius<=0)return!1;const a=this.radius*this.radius;let u=this.x-t,o=this.y-n;return u*=u,o*=o,u+o<=a}strokeContains(t,n,a,u=.5){if(this.radius===0)return!1;const o=this.x-t,c=this.y-n,f=this.radius,m=(1-u)*a,p=Math.sqrt(o*o+c*c);return p<=f+m&&p>f-(a-m)}getBounds(t){return t||(t=new $t),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 Uh{constructor(t=0,n=0,a=0,u=0){this.type="ellipse",this.x=t,this.y=n,this.halfWidth=a,this.halfHeight=u}clone(){return new Uh(this.x,this.y,this.halfWidth,this.halfHeight)}contains(t,n){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let a=(t-this.x)/this.halfWidth,u=(n-this.y)/this.halfHeight;return a*=a,u*=u,a+u<=1}strokeContains(t,n,a,u=.5){const{halfWidth:o,halfHeight:c}=this;if(o<=0||c<=0)return!1;const f=a*(1-u),m=a-f,p=o-m,y=c-m,x=o+f,b=c+f,_=t-this.x,T=n-this.y,w=_*_/(p*p)+T*T/(y*y),S=_*_/(x*x)+T*T/(b*b);return w>1&&S<=1}getBounds(t){return t||(t=new $t),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 Nv(l,t,n,a,u,o){const c=l-n,f=t-a,m=u-n,p=o-a,y=c*m+f*p,x=m*m+p*p;let b=-1;x!==0&&(b=y/x);let _,T;b<0?(_=n,T=a):b>1?(_=u,T=o):(_=n+b*m,T=a+b*p);const w=l-_,S=t-T;return w*w+S*S}let kv,Hv;class nl{constructor(...t){this.type="polygon";let n=Array.isArray(t[0])?t[0]:t;if(typeof n[0]!="number"){const a=[];for(let u=0,o=n.length;u<o;u++)a.push(n[u].x,n[u].y);n=a}this.points=n,this.closePath=!0}isClockwise(){let t=0;const n=this.points,a=n.length;for(let u=0;u<a;u+=2){const o=n[u],c=n[u+1],f=n[(u+2)%a],m=n[(u+3)%a];t+=(f-o)*(m+c)}return t<0}containsPolygon(t){const n=this.getBounds(kv),a=t.getBounds(Hv);if(!n.containsRect(a))return!1;const u=t.points;for(let o=0;o<u.length;o+=2){const c=u[o],f=u[o+1];if(!this.contains(c,f))return!1}return!0}clone(){const t=this.points.slice(),n=new nl(t);return n.closePath=this.closePath,n}contains(t,n){let a=!1;const u=this.points.length/2;for(let o=0,c=u-1;o<u;c=o++){const f=this.points[o*2],m=this.points[o*2+1],p=this.points[c*2],y=this.points[c*2+1];m>n!=y>n&&t<(p-f)*((n-m)/(y-m))+f&&(a=!a)}return a}strokeContains(t,n,a,u=.5){const o=a*a,c=o*(1-u),f=o-c,{points:m}=this,p=m.length-(this.closePath?0:2);for(let y=0;y<p;y+=2){const x=m[y],b=m[y+1],_=m[(y+2)%m.length],T=m[(y+3)%m.length],w=Nv(t,n,x,b,_,T),S=Math.sign((_-x)*(n-b)-(T-b)*(t-x));if(w<=(S<0?f:c))return!0}return!1}getBounds(t){t||(t=new $t);const n=this.points;let a=1/0,u=-1/0,o=1/0,c=-1/0;for(let f=0,m=n.length;f<m;f+=2){const p=n[f],y=n[f+1];a=p<a?p:a,u=p>u?p:u,o=y<o?y:o,c=y>c?y:c}return t.x=a,t.width=u-a,t.y=o,t.height=c-o,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,n)=>`${t}, ${n}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return wt("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return wt("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 Qr=(l,t,n,a,u,o,c)=>{const f=l-n,m=t-a,p=Math.sqrt(f*f+m*m);return p>=u-o&&p<=u+c};class Nh{constructor(t=0,n=0,a=0,u=0,o=20){this.type="roundedRectangle",this.x=t,this.y=n,this.width=a,this.height=u,this.radius=o}getBounds(t){return t||(t=new $t),t.x=this.x,t.y=this.y,t.width=this.width,t.height=this.height,t}clone(){return new Nh(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,n){if(this.width<=0||this.height<=0)return!1;if(t>=this.x&&t<=this.x+this.width&&n>=this.y&&n<=this.y+this.height){const a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(n>=this.y+a&&n<=this.y+this.height-a||t>=this.x+a&&t<=this.x+this.width-a)return!0;let u=t-(this.x+a),o=n-(this.y+a);const c=a*a;if(u*u+o*o<=c||(u=t-(this.x+this.width-a),u*u+o*o<=c)||(o=n-(this.y+this.height-a),u*u+o*o<=c)||(u=t-(this.x+a),u*u+o*o<=c))return!0}return!1}strokeContains(t,n,a,u=.5){const{x:o,y:c,width:f,height:m,radius:p}=this,y=a*(1-u),x=a-y,b=o+p,_=c+p,T=f-p*2,w=m-p*2,S=o+f,A=c+m;return(t>=o-y&&t<=o+x||t>=S-x&&t<=S+y)&&n>=_&&n<=_+w||(n>=c-y&&n<=c+x||n>=A-x&&n<=A+y)&&t>=b&&t<=b+T?!0:t<b&&n<_&&Qr(t,n,b,_,p,x,y)||t>S-p&&n<_&&Qr(t,n,S-p,_,p,x,y)||t>S-p&&n>A-p&&Qr(t,n,S-p,A-p,p,x,y)||t<b&&n>A-p&&Qr(t,n,b,A-p,p,x,y)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const _0={};function Lv(l,t,n){let a=2166136261;for(let u=0;u<t;u++)a^=l[u].uid,a=Math.imul(a,16777619),a>>>=0;return _0[a]||jv(l,t,a,n)}function jv(l,t,n,a){const u={};let o=0;for(let f=0;f<a;f++){const m=f<t?l[f]:Ut.EMPTY.source;u[o++]=m.source,u[o++]=m.style}const c=new $r(u);return _0[n]=c,c}class Gy{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 Uy(l,t,n,a){if(n??(n=0),a??(a=Math.min(l.byteLength-n,t.byteLength)),!(n&7)&&!(a&7)){const u=a/8;new Float64Array(t,0,u).set(new Float64Array(l,n,u))}else if(!(n&3)&&!(a&3)){const u=a/4;new Float32Array(t,0,u).set(new Float32Array(l,n,u))}else new Uint8Array(t).set(new Uint8Array(l,n,a))}const Yv={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var qv=(l=>(l[l.DISABLED=0]="DISABLED",l[l.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",l[l.MASK_ACTIVE=2]="MASK_ACTIVE",l[l.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",l[l.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",l[l.NONE=5]="NONE",l))(qv||{});function Ny(l,t){return t.alphaMode==="no-premultiply-alpha"&&Yv[l]||l}const Xv=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
72
+ `);function Vv(l){let t="";for(let n=0;n<l;++n)n>0&&(t+=`
73
+ else `),n<l-1&&(t+=`if(test == ${n}.0){}`);return t}function Pv(l,t){if(l===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const n=t.createShader(t.FRAGMENT_SHADER);try{for(;;){const a=Xv.replace(/%forloop%/gi,Vv(l));if(t.shaderSource(n,a),t.compileShader(n),!t.getShaderParameter(n,t.COMPILE_STATUS))l=l/2|0;else break}}finally{t.deleteShader(n)}return l}let ks=null;function Fv(){var t;if(ks)return ks;const l=Ig();return ks=l.getParameter(l.MAX_TEXTURE_IMAGE_UNITS),ks=Pv(ks,l),(t=l.getExtension("WEBGL_lose_context"))==null||t.loseContext(),ks}class Qv{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let t=0;t<this.count;t++){const n=this.textures[t];this.textures[t]=null,this.ids[n.uid]=null}this.count=0}}class Wv{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new Qv,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 sl=[];let no=0;dl.register({clear:()=>{if(sl.length>0)for(const l of sl)l&&l.destroy();sl.length=0,no=0}});function ky(){return no>0?sl[--no]:new Wv}function Hy(l){l.elements=null,sl[no++]=l}let Wa=0;const b0=class v0{constructor(t){this.uid=Wt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],t={...v0.defaultOptions,...t},t.maxTextures||(wt("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),t.maxTextures=Fv());const{maxTextures:n,attributesInitialSize:a,indicesInitialSize:u}=t;this.attributeBuffer=new Gy(a*4),this.indexBuffer=new Uint16Array(u),this.maxTextures=n}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let t=0;t<this.batchIndex;t++)Hy(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,n){const a=t._batch.textures.ids[n._source.uid];return!a&&a!==0?!1:(t._textureId=a,t.texture=n,!0)}updateElement(t){this.dirty=!0;const n=this.attributeBuffer;t.packAsQuad?this.packQuadAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId):this.packAttributes(t,n.float32View,n.uint32View,t._attributeStart,t._textureId)}break(t){const n=this._elements;if(!n[this.elementStart])return;let a=ky(),u=a.textures;u.clear();const o=n[this.elementStart];let c=Ny(o.blendMode,o.texture._source),f=o.topology;this.attributeSize*4>this.attributeBuffer.size&&this._resizeAttributeBuffer(this.attributeSize*4),this.indexSize>this.indexBuffer.length&&this._resizeIndexBuffer(this.indexSize);const m=this.attributeBuffer.float32View,p=this.attributeBuffer.uint32View,y=this.indexBuffer;let x=this._batchIndexSize,b=this._batchIndexStart,_="startBatch",T=[];const w=this.maxTextures;for(let S=this.elementStart;S<this.elementSize;++S){const A=n[S];n[S]=null;const D=A.texture._source,G=Ny(A.blendMode,D),P=c!==G||f!==A.topology;if(D._batchTick===Wa&&!P){A._textureId=D._textureBindLocation,x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,p,A._attributeStart,A._textureId),this.packQuadIndex(y,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,p,A._attributeStart,A._textureId),this.packIndex(A,y,A._indexStart,A._attributeStart/this.vertexSize)),A._batch=a,T.push(A);continue}D._batchTick=Wa,(u.count>=w||P)&&(this._finishBatch(a,b,x-b,u,c,f,t,_,T),_="renderBatch",b=x,c=G,f=A.topology,a=ky(),u=a.textures,u.clear(),T=[],++Wa),A._textureId=D._textureBindLocation=u.count,u.ids[D.uid]=u.count,u.textures[u.count++]=D,A._batch=a,T.push(A),x+=A.indexSize,A.packAsQuad?(this.packQuadAttributes(A,m,p,A._attributeStart,A._textureId),this.packQuadIndex(y,A._indexStart,A._attributeStart/this.vertexSize)):(this.packAttributes(A,m,p,A._attributeStart,A._textureId),this.packIndex(A,y,A._indexStart,A._attributeStart/this.vertexSize))}u.count>0&&(this._finishBatch(a,b,x-b,u,c,f,t,_,T),b=x,++Wa),this.elementStart=this.elementSize,this._batchIndexStart=b,this._batchIndexSize=x}_finishBatch(t,n,a,u,o,c,f,m,p){t.gpuBindGroup=null,t.bindGroup=null,t.action=m,t.batcher=this,t.textures=u,t.blendMode=o,t.topology=c,t.start=n,t.size=a,t.elements=p,++Wa,this.batches[this.batchIndex++]=t,f.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 n=Math.max(t,this.attributeBuffer.size*2),a=new Gy(n);Uy(this.attributeBuffer.rawBinaryData,a.rawBinaryData),this.attributeBuffer=a}_resizeIndexBuffer(t){const n=this.indexBuffer;let a=Math.max(t,n.length*1.5);a+=a%2;const u=a>65535?new Uint32Array(a):new Uint16Array(a);if(u.BYTES_PER_ELEMENT!==n.BYTES_PER_ELEMENT)for(let o=0;o<n.length;o++)u[o]=n[o];else Uy(n.buffer,u.buffer);this.indexBuffer=u}packQuadIndex(t,n,a){t[n]=a+0,t[n+1]=a+1,t[n+2]=a+2,t[n+3]=a+0,t[n+4]=a+2,t[n+5]=a+3}packIndex(t,n,a,u){const o=t.indices,c=t.indexSize,f=t.indexOffset,m=t.attributeOffset;for(let p=0;p<c;p++)n[a++]=u+o[p+f]-m}destroy(t={}){var n;if(this.batches!==null){for(let a=0;a<this.batchIndex;a++)Hy(this.batches[a]);this.batches=null,this.geometry.destroy(!0),this.geometry=null,t.shader&&((n=this.shader)==null||n.destroy(),this.shader=null);for(let a=0;a<this._elements.length;a++)this._elements[a]&&(this._elements[a]._batch=null);this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}}};b0.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let Zv=b0;var ze=(l=>(l[l.MAP_READ=1]="MAP_READ",l[l.MAP_WRITE=2]="MAP_WRITE",l[l.COPY_SRC=4]="COPY_SRC",l[l.COPY_DST=8]="COPY_DST",l[l.INDEX=16]="INDEX",l[l.VERTEX=32]="VERTEX",l[l.UNIFORM=64]="UNIFORM",l[l.STORAGE=128]="STORAGE",l[l.INDIRECT=256]="INDIRECT",l[l.QUERY_RESOLVE=512]="QUERY_RESOLVE",l[l.STATIC=1024]="STATIC",l))(ze||{});class hl extends vi{constructor(t){let{data:n,size:a}=t;const{usage:u,label:o,shrinkToFit:c}=t;super(),this._gpuData=Object.create(null),this._gcLastUsed=-1,this.autoGarbageCollect=!0,this.uid=Wt("buffer"),this._resourceType="buffer",this._resourceId=Wt("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,n instanceof Array&&(n=new Float32Array(n)),this._data=n,a??(a=n==null?void 0:n.byteLength);const f=!!n;this.descriptor={size:a,usage:u,mappedAtCreation:f,label:o},this.shrinkToFit=c??!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&ze.STATIC)}set static(t){t?this.descriptor.usage|=ze.STATIC:this.descriptor.usage&=~ze.STATIC}setDataWithSize(t,n,a){if(this._updateID++,this._updateSize=n*t.BYTES_PER_ELEMENT,this._data===t){a&&this.emit("update",this);return}const u=this._data;if(this._data=t,this._dataInt32=null,!u||u.length!==t.length){!this.shrinkToFit&&u&&t.byteLength<u.byteLength?a&&this.emit("update",this):(this.descriptor.size=t.byteLength,this._resourceId=Wt("resource"),this.emit("change",this));return}a&&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 n in this._gpuData)(t=this._gpuData[n])==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 S0(l,t){if(!(l instanceof hl)){let n=t?ze.INDEX:ze.VERTEX;l instanceof Array&&(t?(l=new Uint32Array(l),n=ze.INDEX|ze.COPY_DST):(l=new Float32Array(l),n=ze.VERTEX|ze.COPY_DST)),l=new hl({data:l,label:t?"index-mesh-buffer":"vertex-mesh-buffer",usage:n})}return l}function Iv(l,t,n){const a=l.getAttribute(t);if(!a)return n.minX=0,n.minY=0,n.maxX=0,n.maxY=0,n;const u=a.buffer.data;let o=1/0,c=1/0,f=-1/0,m=-1/0;const p=u.BYTES_PER_ELEMENT,y=(a.offset||0)/p,x=(a.stride||8)/p;for(let b=y;b<u.length;b+=x){const _=u[b],T=u[b+1];_>f&&(f=_),T>m&&(m=T),_<o&&(o=_),T<c&&(c=T)}return n.minX=o,n.minY=c,n.maxX=f,n.maxY=m,n}function Kv(l){return(l instanceof hl||Array.isArray(l)||l.BYTES_PER_ELEMENT)&&(l={buffer:l}),l.buffer=S0(l.buffer,!1),l}class Jv extends vi{constructor(t={}){super(),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Wt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new si,this._boundsDirty=!0;const{attributes:n,indexBuffer:a,topology:u}=t;if(this.buffers=[],this.attributes={},n)for(const o in n)this.addAttribute(o,n[o]);this.instanceCount=t.instanceCount??1,a&&this.addIndex(a),this.topology=u||"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 n=this.attributes[t];return n.buffer.data.length/(n.stride/4||n.size)}return 0}addAttribute(t,n){const a=Kv(n);this.buffers.indexOf(a.buffer)===-1&&(this.buffers.push(a.buffer),a.buffer.on("update",this.onBufferUpdate,this),a.buffer.on("change",this.onBufferUpdate,this)),this.attributes[t]=a}addIndex(t){this.indexBuffer=S0(t,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,Iv(this,"aPosition",this._bounds)):this._bounds}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==null||t.destroy();this._gpuData=Object.create(null)}destroy(t=!1){var n;this.emit("destroy",this),this.removeAllListeners(),t&&this.buffers.forEach(a=>a.destroy()),this.unload(),(n=this.indexBuffer)==null||n.destroy(),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const $v=new Float32Array(1),tS=new Uint32Array(1);class eS extends Jv{constructor(){const n=new hl({data:$v,label:"attribute-batch-buffer",usage:ze.VERTEX|ze.COPY_DST,shrinkToFit:!1}),a=new hl({data:tS,label:"index-batch-buffer",usage:ze.INDEX|ze.COPY_DST,shrinkToFit:!1}),u=24;super({attributes:{aPosition:{buffer:n,format:"float32x2",stride:u,offset:0},aUV:{buffer:n,format:"float32x2",stride:u,offset:8},aColor:{buffer:n,format:"unorm8x4",stride:u,offset:16},aTextureIdAndRound:{buffer:n,format:"uint16x2",stride:u,offset:20}},indexBuffer:a})}}function Ly(l,t,n){if(l)for(const a in l){const u=a.toLocaleLowerCase(),o=t[u];if(o){let c=l[a];a==="header"&&(c=c.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),n&&o.push(`//----${n}----//`),o.push(c)}else Se(`${a} placement hook does not exist in shader`)}}const iS=/\{\{(.*?)\}\}/g;function jy(l){var a;const t={};return(((a=l.match(iS))==null?void 0:a.map(u=>u.replace(/[{()}]/g,"")))??[]).forEach(u=>{t[u]=[]}),t}function Yy(l,t){let n;const a=/@in\s+([^;]+);/g;for(;(n=a.exec(l))!==null;)t.push(n[1])}function qy(l,t,n=!1){const a=[];Yy(t,a),l.forEach(f=>{f.header&&Yy(f.header,a)});const u=a;n&&u.sort();const o=u.map((f,m)=>` @location(${m}) ${f},`).join(`
74
+ `);let c=t.replace(/@in\s+[^;]+;\s*/g,"");return c=c.replace("{{in}}",`
75
+ ${o}
76
+ `),c}function Xy(l,t){let n;const a=/@out\s+([^;]+);/g;for(;(n=a.exec(l))!==null;)t.push(n[1])}function nS(l){const n=/\b(\w+)\s*:/g.exec(l);return n?n[1]:""}function sS(l){const t=/@.*?\s+/g;return l.replace(t,"")}function aS(l,t){const n=[];Xy(t,n),l.forEach(m=>{m.header&&Xy(m.header,n)});let a=0;const u=n.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${a++}) ${m}`).join(`,
77
+ `),o=n.sort().map(m=>` var ${sS(m)};`).join(`
78
+ `),c=`return VSOutput(
79
+ ${n.sort().map(m=>` ${nS(m)}`).join(`,
80
+ `)});`;let f=t.replace(/@out\s+[^;]+;\s*/g,"");return f=f.replace("{{struct}}",`
81
+ ${u}
82
+ `),f=f.replace("{{start}}",`
83
+ ${o}
84
+ `),f=f.replace("{{return}}",`
85
+ ${c}
86
+ `),f}function Vy(l,t){let n=l;for(const a in t){const u=t[a];u.join(`
87
+ `).length?n=n.replace(`{{${a}}}`,`//-----${a} START-----//
88
+ ${u.join(`
89
+ `)}
90
+ //----${a} FINISH----//`):n=n.replace(`{{${a}}}`,"")}return n}const vn=Object.create(null),th=new Map;let lS=0;function rS({template:l,bits:t}){const n=T0(l,t);if(vn[n])return vn[n];const{vertex:a,fragment:u}=uS(l,t);return vn[n]=w0(a,u,t),vn[n]}function oS({template:l,bits:t}){const n=T0(l,t);return vn[n]||(vn[n]=w0(l.vertex,l.fragment,t)),vn[n]}function uS(l,t){const n=t.map(c=>c.vertex).filter(c=>!!c),a=t.map(c=>c.fragment).filter(c=>!!c);let u=qy(n,l.vertex,!0);u=aS(n,u);const o=qy(a,l.fragment,!0);return{vertex:u,fragment:o}}function T0(l,t){return t.map(n=>(th.has(n)||th.set(n,lS++),th.get(n))).sort((n,a)=>n-a).join("-")+l.vertex+l.fragment}function w0(l,t,n){const a=jy(l),u=jy(t);return n.forEach(o=>{Ly(o.vertex,a,o.name),Ly(o.fragment,u,o.name)}),{vertex:Vy(l,a),fragment:Vy(t,u)}}const cS=`
91
+ @in aPosition: vec2<f32>;
92
+ @in aUV: vec2<f32>;
93
+
94
+ @out @builtin(position) vPosition: vec4<f32>;
95
+ @out vUV : vec2<f32>;
96
+ @out vColor : vec4<f32>;
97
+
98
+ {{header}}
99
+
100
+ struct VSOutput {
101
+ {{struct}}
102
+ };
103
+
104
+ @vertex
105
+ fn main( {{in}} ) -> VSOutput {
106
+
107
+ var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
108
+ var modelMatrix = mat3x3<f32>(
109
+ 1.0, 0.0, 0.0,
110
+ 0.0, 1.0, 0.0,
111
+ 0.0, 0.0, 1.0
112
+ );
113
+ var position = aPosition;
114
+ var uv = aUV;
115
+
116
+ {{start}}
117
+
118
+ vColor = vec4<f32>(1., 1., 1., 1.);
119
+
120
+ {{main}}
121
+
122
+ vUV = uv;
123
+
124
+ var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
125
+
126
+ vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
127
+
128
+ vColor *= globalUniforms.uWorldColorAlpha;
129
+
130
+ {{end}}
131
+
132
+ {{return}}
133
+ };
134
+ `,hS=`
135
+ @in vUV : vec2<f32>;
136
+ @in vColor : vec4<f32>;
137
+
138
+ {{header}}
139
+
140
+ @fragment
141
+ fn main(
142
+ {{in}}
143
+ ) -> @location(0) vec4<f32> {
144
+
145
+ {{start}}
146
+
147
+ var outColor:vec4<f32>;
148
+
149
+ {{main}}
150
+
151
+ var finalColor:vec4<f32> = outColor * vColor;
152
+
153
+ {{end}}
154
+
155
+ return finalColor;
156
+ };
157
+ `,fS=`
158
+ in vec2 aPosition;
159
+ in vec2 aUV;
160
+
161
+ out vec4 vColor;
162
+ out vec2 vUV;
163
+
164
+ {{header}}
165
+
166
+ void main(void){
167
+
168
+ mat3 worldTransformMatrix = uWorldTransformMatrix;
169
+ mat3 modelMatrix = mat3(
170
+ 1.0, 0.0, 0.0,
171
+ 0.0, 1.0, 0.0,
172
+ 0.0, 0.0, 1.0
173
+ );
174
+ vec2 position = aPosition;
175
+ vec2 uv = aUV;
176
+
177
+ {{start}}
178
+
179
+ vColor = vec4(1.);
180
+
181
+ {{main}}
182
+
183
+ vUV = uv;
184
+
185
+ mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
186
+
187
+ gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
188
+
189
+ vColor *= uWorldColorAlpha;
190
+
191
+ {{end}}
192
+ }
193
+ `,dS=`
194
+
195
+ in vec4 vColor;
196
+ in vec2 vUV;
197
+
198
+ out vec4 finalColor;
199
+
200
+ {{header}}
201
+
202
+ void main(void) {
203
+
204
+ {{start}}
205
+
206
+ vec4 outColor;
207
+
208
+ {{main}}
209
+
210
+ finalColor = outColor * vColor;
211
+
212
+ {{end}}
213
+ }
214
+ `,mS={name:"global-uniforms-bit",vertex:{header:`
215
+ struct GlobalUniforms {
216
+ uProjectionMatrix:mat3x3<f32>,
217
+ uWorldTransformMatrix:mat3x3<f32>,
218
+ uWorldColorAlpha: vec4<f32>,
219
+ uResolution: vec2<f32>,
220
+ }
221
+
222
+ @group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
223
+ `}},pS={name:"global-uniforms-bit",vertex:{header:`
224
+ uniform mat3 uProjectionMatrix;
225
+ uniform mat3 uWorldTransformMatrix;
226
+ uniform vec4 uWorldColorAlpha;
227
+ uniform vec2 uResolution;
228
+ `}};function yS({bits:l,name:t}){const n=rS({template:{fragment:hS,vertex:cS},bits:[mS,...l]});return oo.from({name:t,vertex:{source:n.vertex,entryPoint:"main"},fragment:{source:n.fragment,entryPoint:"main"}})}function gS({bits:l,name:t}){return new Jg({name:t,...oS({template:{vertex:fS,fragment:dS},bits:[pS,...l]})})}const xS={name:"color-bit",vertex:{header:`
229
+ @in aColor: vec4<f32>;
230
+ `,main:`
231
+ vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
232
+ `}},_S={name:"color-bit",vertex:{header:`
233
+ in vec4 aColor;
234
+ `,main:`
235
+ vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
236
+ `}},eh={};function bS(l){const t=[];if(l===1)t.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),t.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let n=0;for(let a=0;a<l;a++)t.push(`@group(1) @binding(${n++}) var textureSource${a+1}: texture_2d<f32>;`),t.push(`@group(1) @binding(${n++}) var textureSampler${a+1}: sampler;`)}return t.join(`
237
+ `)}function vS(l){const t=[];if(l===1)t.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{t.push("switch vTextureId {");for(let n=0;n<l;n++)n===l-1?t.push(" default:{"):t.push(` case ${n}:{`),t.push(` outColor = textureSampleGrad(textureSource${n+1}, textureSampler${n+1}, vUV, uvDx, uvDy);`),t.push(" break;}");t.push("}")}return t.join(`
238
+ `)}function SS(l){return eh[l]||(eh[l]={name:"texture-batch-bit",vertex:{header:`
239
+ @in aTextureIdAndRound: vec2<u32>;
240
+ @out @interpolate(flat) vTextureId : u32;
241
+ `,main:`
242
+ vTextureId = aTextureIdAndRound.y;
243
+ `,end:`
244
+ if(aTextureIdAndRound.x == 1)
245
+ {
246
+ vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
247
+ }
248
+ `},fragment:{header:`
249
+ @in @interpolate(flat) vTextureId: u32;
250
+
251
+ ${bS(l)}
252
+ `,main:`
253
+ var uvDx = dpdx(vUV);
254
+ var uvDy = dpdy(vUV);
255
+
256
+ ${vS(l)}
257
+ `}}),eh[l]}const ih={};function TS(l){const t=[];for(let n=0;n<l;n++)n>0&&t.push("else"),n<l-1&&t.push(`if(vTextureId < ${n}.5)`),t.push("{"),t.push(` outColor = texture(uTextures[${n}], vUV);`),t.push("}");return t.join(`
258
+ `)}function wS(l){return ih[l]||(ih[l]={name:"texture-batch-bit",vertex:{header:`
259
+ in vec2 aTextureIdAndRound;
260
+ out float vTextureId;
261
+
262
+ `,main:`
263
+ vTextureId = aTextureIdAndRound.y;
264
+ `,end:`
265
+ if(aTextureIdAndRound.x == 1.)
266
+ {
267
+ gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
268
+ }
269
+ `},fragment:{header:`
270
+ in float vTextureId;
271
+
272
+ uniform sampler2D uTextures[${l}];
273
+
274
+ `,main:`
275
+
276
+ ${TS(l)}
277
+ `}}),ih[l]}const AS={name:"round-pixels-bit",vertex:{header:`
278
+ fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
279
+ {
280
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
281
+ }
282
+ `}},CS={name:"round-pixels-bit",vertex:{header:`
283
+ vec2 roundPixels(vec2 position, vec2 targetSize)
284
+ {
285
+ return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
286
+ }
287
+ `}},Py={};function MS(l){let t=Py[l];if(t)return t;const n=new Int32Array(l);for(let a=0;a<l;a++)n[a]=a;return t=Py[l]=new i0({uTextures:{value:n,type:"i32",size:l}},{isStatic:!0}),t}class Fy extends Oh{constructor(t){const n=gS({name:"batch",bits:[_S,wS(t),CS]}),a=yS({name:"batch",bits:[xS,SS(t),AS]});super({glProgram:n,gpuProgram:a,resources:{batchSamplers:MS(t)}}),this.maxTextures=t}}let Za=null;const A0=class C0 extends Zv{constructor(t){super(t),this.geometry=new eS,this.name=C0.extension.name,this.vertexSize=6,Za??(Za=new Fy(t.maxTextures)),this.shader=Za}packAttributes(t,n,a,u,o){const c=o<<16|t.roundPixels&65535,f=t.transform,m=f.a,p=f.b,y=f.c,x=f.d,b=f.tx,_=f.ty,{positions:T,uvs:w}=t,S=t.color,A=t.attributeOffset,z=A+t.attributeSize;for(let D=A;D<z;D++){const G=D*2,P=T[G],N=T[G+1];n[u++]=m*P+y*N+b,n[u++]=x*N+p*P+_,n[u++]=w[G],n[u++]=w[G+1],a[u++]=S,a[u++]=c}}packQuadAttributes(t,n,a,u,o){const c=t.texture,f=t.transform,m=f.a,p=f.b,y=f.c,x=f.d,b=f.tx,_=f.ty,T=t.bounds,w=T.maxX,S=T.minX,A=T.maxY,z=T.minY,D=c.uvs,G=t.color,P=o<<16|t.roundPixels&65535;n[u+0]=m*S+y*z+b,n[u+1]=x*z+p*S+_,n[u+2]=D.x0,n[u+3]=D.y0,a[u+4]=G,a[u+5]=P,n[u+6]=m*w+y*z+b,n[u+7]=x*z+p*w+_,n[u+8]=D.x1,n[u+9]=D.y1,a[u+10]=G,a[u+11]=P,n[u+12]=m*w+y*A+b,n[u+13]=x*A+p*w+_,n[u+14]=D.x2,n[u+15]=D.y2,a[u+16]=G,a[u+17]=P,n[u+18]=m*S+y*A+b,n[u+19]=x*A+p*S+_,n[u+20]=D.x3,n[u+21]=D.y3,a[u+22]=G,a[u+23]=P}_updateMaxTextures(t){this.shader.maxTextures!==t&&(Za=new Fy(t),this.shader=Za)}destroy(){this.shader=null,super.destroy()}};A0.extension={type:[yt.Batcher],name:"default"};let ES=A0;class ml{constructor(t){this.items=Object.create(null);const{renderer:n,type:a,onUnload:u,priority:o,name:c}=t;this._renderer=n,n.gc.addResourceHash(this,"items",a,o??0),this._onUnload=u,this.name=c}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,...n){var u;if(!this.items[t.uid])return;const a=t._gpuData[this._renderer.uid];a&&((u=this._onUnload)==null||u.call(this,t,...n),a.destroy(),t._gpuData[this._renderer.uid]=null,this.items[t.uid]=null)}removeAll(...t){Object.values(this.items).forEach(n=>n&&this.remove(n,...t))}destroy(...t){this.removeAll(...t),this.items=Object.create(null),this._renderer=null,this._onUnload=null}}function RS(l,t,n,a,u,o,c,f=null){let m=0;n*=t,u*=o;const p=f.a,y=f.b,x=f.c,b=f.d,_=f.tx,T=f.ty;for(;m<c;){const w=l[n],S=l[n+1];a[u]=p*w+x*S+_,a[u+1]=y*w+b*S+T,u+=o,n+=t,m++}}function zS(l,t,n,a){let u=0;for(t*=n;u<a;)l[t]=0,l[t+1]=0,t+=n,u++}function M0(l,t,n,a,u){const o=t.a,c=t.b,f=t.c,m=t.d,p=t.tx,y=t.ty;n||(n=0),a||(a=2),u||(u=l.length/a-n);let x=n*a;for(let b=0;b<u;b++){const _=l[x],T=l[x+1];l[x]=o*_+f*T+p,l[x+1]=c*_+m*T+y,x+=a}}const DS=new vt;class kh{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,n=t>>16|t&65280|(t&255)<<16,a=this.renderable;return a?Dg(n,a.groupColor)+(this.alpha*a.groupAlpha*255<<24):n+(this.alpha*255<<24)}get transform(){var t;return((t=this.renderable)==null?void 0:t.groupTransform)||DS}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 fl={extension:{type:yt.ShapeBuilder,name:"circle"},build(l,t){let n,a,u,o,c,f;if(l.type==="circle"){const G=l;if(c=f=G.radius,c<=0)return!1;n=G.x,a=G.y,u=o=0}else if(l.type==="ellipse"){const G=l;if(c=G.halfWidth,f=G.halfHeight,c<=0||f<=0)return!1;n=G.x,a=G.y,u=o=0}else{const G=l,P=G.width/2,N=G.height/2;n=G.x+P,a=G.y+N,c=f=Math.max(0,Math.min(G.radius,Math.min(P,N))),u=P-c,o=N-f}if(u<0||o<0)return!1;const m=Math.ceil(2.3*Math.sqrt(c+f)),p=m*8+(u?4:0)+(o?4:0);if(p===0)return!1;if(m===0)return t[0]=t[6]=n+u,t[1]=t[3]=a+o,t[2]=t[4]=n-u,t[5]=t[7]=a-o,!0;let y=0,x=m*4+(u?2:0)+2,b=x,_=p,T=u+c,w=o,S=n+T,A=n-T,z=a+w;if(t[y++]=S,t[y++]=z,t[--x]=z,t[--x]=A,o){const G=a-w;t[b++]=A,t[b++]=G,t[--_]=G,t[--_]=S}for(let G=1;G<m;G++){const P=Math.PI/2*(G/m),N=u+Math.cos(P)*c,O=o+Math.sin(P)*f,et=n+N,Z=n-N,X=a+O,W=a-O;t[y++]=et,t[y++]=X,t[--x]=X,t[--x]=Z,t[b++]=Z,t[b++]=W,t[--_]=W,t[--_]=et}T=u,w=o+f,S=n+T,A=n-T,z=a+w;const D=a-w;return t[y++]=S,t[y++]=z,t[--_]=D,t[--_]=S,u&&(t[y++]=A,t[y++]=z,t[--_]=D,t[--_]=A),!0},triangulate(l,t,n,a,u,o){if(l.length===0)return;let c=0,f=0;for(let y=0;y<l.length;y+=2)c+=l[y],f+=l[y+1];c/=l.length/2,f/=l.length/2;let m=a;t[m*n]=c,t[m*n+1]=f;const p=m++;for(let y=0;y<l.length;y+=2)t[m*n]=l[y],t[m*n+1]=l[y+1],y>0&&(u[o++]=m,u[o++]=p,u[o++]=m-1),m++;u[o++]=p+1,u[o++]=p,u[o++]=m-1}},BS={...fl,extension:{...fl.extension,name:"ellipse"}},OS={...fl,extension:{...fl.extension,name:"roundedRectangle"}},E0=1e-4,Qy=1e-4;function GS(l){const t=l.length;if(t<6)return 1;let n=0;for(let a=0,u=l[t-2],o=l[t-1];a<t;a+=2){const c=l[a],f=l[a+1];n+=(c-u)*(f+o),u=c,o=f}return n<0?-1:1}function Wy(l,t,n,a,u,o,c,f){const m=l-n*u,p=t-a*u,y=l+n*o,x=t+a*o;let b,_;c?(b=a,_=-n):(b=-a,_=n);const T=m+b,w=p+_,S=y+b,A=x+_;return f.push(T,w),f.push(S,A),2}function Yn(l,t,n,a,u,o,c,f){const m=n-l,p=a-t;let y=Math.atan2(m,p),x=Math.atan2(u-l,o-t);f&&y<x?y+=Math.PI*2:!f&&y>x&&(x+=Math.PI*2);let b=y;const _=x-y,T=Math.abs(_),w=Math.sqrt(m*m+p*p),S=(15*T*Math.sqrt(w)/Math.PI>>0)+1,A=_/S;if(b+=A,f){c.push(l,t),c.push(n,a);for(let z=1,D=b;z<S;z++,D+=A)c.push(l,t),c.push(l+Math.sin(D)*w,t+Math.cos(D)*w);c.push(l,t),c.push(u,o)}else{c.push(n,a),c.push(l,t);for(let z=1,D=b;z<S;z++,D+=A)c.push(l+Math.sin(D)*w,t+Math.cos(D)*w),c.push(l,t);c.push(u,o),c.push(l,t)}return S*2}function US(l,t,n,a,u,o){const c=E0;if(l.length===0)return;const f=t;let m=f.alignment;if(t.alignment!==.5){let K=GS(l);m=(m-.5)*K+.5}const p=new xe(l[0],l[1]),y=new xe(l[l.length-2],l[l.length-1]),x=a,b=Math.abs(p.x-y.x)<c&&Math.abs(p.y-y.y)<c;if(x){l=l.slice(),b&&(l.pop(),l.pop(),y.set(l[l.length-2],l[l.length-1]));const K=(p.x+y.x)*.5,at=(y.y+p.y)*.5;l.unshift(K,at),l.push(K,at)}const _=u,T=l.length/2;let w=l.length;const S=_.length/2,A=f.width/2,z=A*A,D=f.miterLimit*f.miterLimit;let G=l[0],P=l[1],N=l[2],O=l[3],et=0,Z=0,X=-(P-O),W=G-N,I=0,tt=0,it=Math.sqrt(X*X+W*W);X/=it,W/=it,X*=A,W*=A;const St=m,R=(1-St)*2,L=St*2;x||(f.cap==="round"?w+=Yn(G-X*(R-L)*.5,P-W*(R-L)*.5,G-X*R,P-W*R,G+X*L,P+W*L,_,!0)+2:f.cap==="square"&&(w+=Wy(G,P,X,W,R,L,!0,_))),_.push(G-X*R,P-W*R),_.push(G+X*L,P+W*L);for(let K=1;K<T-1;++K){G=l[(K-1)*2],P=l[(K-1)*2+1],N=l[K*2],O=l[K*2+1],et=l[(K+1)*2],Z=l[(K+1)*2+1],X=-(P-O),W=G-N,it=Math.sqrt(X*X+W*W),X/=it,W/=it,X*=A,W*=A,I=-(O-Z),tt=N-et,it=Math.sqrt(I*I+tt*tt),I/=it,tt/=it,I*=A,tt*=A;const at=N-G,M=P-O,Y=N-et,Q=Z-O,$=at*Y+M*Q,rt=M*Y-Q*at,ct=rt<0;if(Math.abs(rt)<.001*Math.abs($)){_.push(N-X*R,O-W*R),_.push(N+X*L,O+W*L),$>=0&&(f.join==="round"?w+=Yn(N,O,N-X*R,O-W*R,N-I*R,O-tt*R,_,!1)+4:w+=2,_.push(N-I*L,O-tt*L),_.push(N+I*R,O+tt*R));continue}const ft=(-X+G)*(-W+O)-(-X+N)*(-W+P),Ht=(-I+et)*(-tt+O)-(-I+N)*(-tt+Z),Et=(at*Ht-Y*ft)/rt,Ve=(Q*ft-M*Ht)/rt,Qi=(Et-N)*(Et-N)+(Ve-O)*(Ve-O),ri=N+(Et-N)*R,mi=O+(Ve-O)*R,_e=N-(Et-N)*L,oi=O-(Ve-O)*L,Zs=Math.min(at*at+M*M,Y*Y+Q*Q),pl=ct?R:L,yl=Zs+pl*pl*z;Qi<=yl?f.join==="bevel"||Qi/z>D?(ct?(_.push(ri,mi),_.push(N+X*L,O+W*L),_.push(ri,mi),_.push(N+I*L,O+tt*L)):(_.push(N-X*R,O-W*R),_.push(_e,oi),_.push(N-I*R,O-tt*R),_.push(_e,oi)),w+=2):f.join==="round"?ct?(_.push(ri,mi),_.push(N+X*L,O+W*L),w+=Yn(N,O,N+X*L,O+W*L,N+I*L,O+tt*L,_,!0)+4,_.push(ri,mi),_.push(N+I*L,O+tt*L)):(_.push(N-X*R,O-W*R),_.push(_e,oi),w+=Yn(N,O,N-X*R,O-W*R,N-I*R,O-tt*R,_,!1)+4,_.push(N-I*R,O-tt*R),_.push(_e,oi)):(_.push(ri,mi),_.push(_e,oi)):(_.push(N-X*R,O-W*R),_.push(N+X*L,O+W*L),f.join==="round"?ct?w+=Yn(N,O,N+X*L,O+W*L,N+I*L,O+tt*L,_,!0)+2:w+=Yn(N,O,N-X*R,O-W*R,N-I*R,O-tt*R,_,!1)+2:f.join==="miter"&&Qi/z<=D&&(ct?(_.push(_e,oi),_.push(_e,oi)):(_.push(ri,mi),_.push(ri,mi)),w+=2),_.push(N-I*R,O-tt*R),_.push(N+I*L,O+tt*L),w+=2)}G=l[(T-2)*2],P=l[(T-2)*2+1],N=l[(T-1)*2],O=l[(T-1)*2+1],X=-(P-O),W=G-N,it=Math.sqrt(X*X+W*W),X/=it,W/=it,X*=A,W*=A,_.push(N-X*R,O-W*R),_.push(N+X*L,O+W*L),x||(f.cap==="round"?w+=Yn(N-X*(R-L)*.5,O-W*(R-L)*.5,N-X*R,O-W*R,N+X*L,O+W*L,_,!1)+2:f.cap==="square"&&(w+=Wy(N,O,X,W,R,L,!1,_)));const nt=Qy*Qy;for(let K=S;K<w+S-2;++K)G=_[K*2],P=_[K*2+1],N=_[(K+1)*2],O=_[(K+1)*2+1],et=_[(K+2)*2],Z=_[(K+2)*2+1],!(Math.abs(G*(O-Z)+N*(Z-P)+et*(P-O))<nt)&&o.push(K,K+1,K+2)}function NS(l,t,n,a){const u=E0;if(l.length===0)return;const o=l[0],c=l[1],f=l[l.length-2],m=l[l.length-1],p=t||Math.abs(o-f)<u&&Math.abs(c-m)<u,y=n,x=l.length/2,b=y.length/2;for(let _=0;_<x;_++)y.push(l[_*2]),y.push(l[_*2+1]);for(let _=0;_<x-1;_++)a.push(b+_,b+_+1);p&&a.push(b+x-1,b)}function R0(l,t,n,a,u,o,c){const f=Av(l,t,2);if(!f)return;for(let p=0;p<f.length;p+=3)o[c++]=f[p]+u,o[c++]=f[p+1]+u,o[c++]=f[p+2]+u;let m=u*a;for(let p=0;p<l.length;p+=2)n[m]=l[p],n[m+1]=l[p+1],m+=a}const kS=[],HS={extension:{type:yt.ShapeBuilder,name:"polygon"},build(l,t){for(let n=0;n<l.points.length;n++)t[n]=l.points[n];return!0},triangulate(l,t,n,a,u,o){R0(l,kS,t,n,a,u,o)}},LS={extension:{type:yt.ShapeBuilder,name:"rectangle"},build(l,t){const n=l,a=n.x,u=n.y,o=n.width,c=n.height;return o>0&&c>0?(t[0]=a,t[1]=u,t[2]=a+o,t[3]=u,t[4]=a+o,t[5]=u+c,t[6]=a,t[7]=u+c,!0):!1},triangulate(l,t,n,a,u,o){let c=0;a*=n,t[a+c]=l[0],t[a+c+1]=l[1],c+=n,t[a+c]=l[2],t[a+c+1]=l[3],c+=n,t[a+c]=l[6],t[a+c+1]=l[7],c+=n,t[a+c]=l[4],t[a+c+1]=l[5],c+=n;const f=a/n;u[o++]=f,u[o++]=f+1,u[o++]=f+2,u[o++]=f+1,u[o++]=f+3,u[o++]=f+2}},jS={extension:{type:yt.ShapeBuilder,name:"triangle"},build(l,t){return t[0]=l.x,t[1]=l.y,t[2]=l.x2,t[3]=l.y2,t[4]=l.x3,t[5]=l.y3,!0},triangulate(l,t,n,a,u,o){let c=0;a*=n,t[a+c]=l[0],t[a+c+1]=l[1],c+=n,t[a+c]=l[2],t[a+c+1]=l[3],c+=n,t[a+c]=l[4],t[a+c+1]=l[5];const f=a/n;u[o++]=f,u[o++]=f+1,u[o++]=f+2}},Zy=[{offset:0,color:"white"},{offset:1,color:"black"}],Hh=class _h{constructor(...t){this.uid=Wt("fillGradient"),this._tick=0,this.type="linear",this.colorStops=[];let n=YS(t);n={...n.type==="radial"?_h.defaultRadialOptions:_h.defaultLinearOptions,...bg(n)},this._textureSize=n.textureSize,this._wrapMode=n.wrapMode,n.type==="radial"?(this.center=n.center,this.outerCenter=n.outerCenter??this.center,this.innerRadius=n.innerRadius,this.outerRadius=n.outerRadius,this.scale=n.scale,this.rotation=n.rotation):(this.start=n.start,this.end=n.end),this.textureSpace=n.textureSpace,this.type=n.type,n.colorStops.forEach(u=>{this.addColorStop(u.offset,u.color)})}addColorStop(t,n){return this.colorStops.push({offset:t,color:re.shared.setValue(n).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:t,y:n}=this.start,{x:a,y:u}=this.end,o=a-t,c=u-n;const f=o<0||c<0;if(this._wrapMode==="clamp-to-edge"){if(o<0){const S=t;t=a,a=S,o*=-1}if(c<0){const S=n;n=u,u=S,c*=-1}}const m=this.colorStops.length?this.colorStops:Zy,p=this._textureSize,{canvas:y,context:x}=Ky(p,1),b=f?x.createLinearGradient(this._textureSize,0,0,0):x.createLinearGradient(0,0,this._textureSize,0);Iy(b,m),x.fillStyle=b,x.fillRect(0,0,p,1),this.texture=new Ut({source:new eo({resource:y,addressMode:this._wrapMode})});const _=Math.sqrt(o*o+c*c),T=Math.atan2(c,o),w=new vt;w.scale(_/p,1),w.rotate(T),w.translate(t,n),this.textureSpace==="local"&&w.scale(p,p),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:Zy,n=this._textureSize,{canvas:a,context:u}=Ky(n,n),{x:o,y:c}=this.center,{x:f,y:m}=this.outerCenter,p=this.innerRadius,y=this.outerRadius,x=f-y,b=m-y,_=n/(y*2),T=(o-x)*_,w=(c-b)*_,S=u.createRadialGradient(T,w,p*_,(f-x)*_,(m-b)*_,y*_);Iy(S,t),u.fillStyle=t[t.length-1].color,u.fillRect(0,0,n,n),u.fillStyle=S,u.translate(T,w),u.rotate(this.rotation),u.scale(1,this.scale),u.translate(-T,-w),u.fillRect(0,0,n,n),this.texture=new Ut({source:new eo({resource:a,addressMode:this._wrapMode})});const A=new vt;A.scale(1/_,1/_),A.translate(x,b),this.textureSpace==="local"&&A.scale(n,n),this.transform=A}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}`}};Hh.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"};Hh.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let Pi=Hh;function Iy(l,t){for(let n=0;n<t.length;n++){const a=t[n];l.addColorStop(a.offset,a.color)}}function Ky(l,t){const n=Xe.get().createCanvas(l,t),a=n.getContext("2d");return{canvas:n,context:a}}function YS(l){let t=l[0]??{};return(typeof t=="number"||l[1])&&(wt("8.5.2","use options object instead"),t={type:"linear",start:{x:l[0],y:l[1]},end:{x:l[2],y:l[3]},textureSpace:l[4],textureSize:l[5]??Pi.defaultLinearOptions.textureSize}),t}const qS=new vt,XS=new $t;function VS(l,t,n,a){const u=t.matrix?l.copyFrom(t.matrix).invert():l.identity();if(t.textureSpace==="local"){const c=n.getBounds(XS);t.width&&c.pad(t.width);const{x:f,y:m}=c,p=1/c.width,y=1/c.height,x=-f*p,b=-m*y,_=u.a,T=u.b,w=u.c,S=u.d;u.a*=p,u.b*=p,u.c*=y,u.d*=y,u.tx=x*_+b*w+u.tx,u.ty=x*T+b*S+u.ty}else u.translate(t.texture.frame.x,t.texture.frame.y),u.scale(1/t.texture.source.width,1/t.texture.source.height);const o=t.texture.source.style;return!(t.fill instanceof Pi)&&o.addressMode==="clamp-to-edge"&&(o.addressMode="repeat",o.update()),a&&u.append(qS.copyFrom(a).invert()),u}const uo={};te.handleByMap(yt.ShapeBuilder,uo);te.add(LS,HS,jS,fl,BS,OS);const PS=new $t,FS=new vt;function QS(l,t){const{geometryData:n,batches:a}=t;a.length=0,n.indices.length=0,n.vertices.length=0,n.uvs.length=0;for(let u=0;u<l.instructions.length;u++){const o=l.instructions[u];if(o.action==="texture")WS(o.data,a,n);else if(o.action==="fill"||o.action==="stroke"){const c=o.action==="stroke",f=o.data.path.shapePath,m=o.data.style,p=o.data.hole;c&&p&&Jy(p.shapePath,m,!0,a,n),p&&(f.shapePrimitives[f.shapePrimitives.length-1].holes=p.shapePath.shapePrimitives),Jy(f,m,c,a,n)}}}function WS(l,t,n){const a=[],u=uo.rectangle,o=PS;o.x=l.dx,o.y=l.dy,o.width=l.dw,o.height=l.dh;const c=l.transform;if(!u.build(o,a))return;const{vertices:f,uvs:m,indices:p}=n,y=p.length,x=f.length/2;c&&M0(a,c),u.triangulate(a,f,2,x,p,y);const b=l.image,_=b.uvs;m.push(_.x0,_.y0,_.x1,_.y1,_.x3,_.y3,_.x2,_.y2);const T=De.get(kh);T.indexOffset=y,T.indexSize=p.length-y,T.attributeOffset=x,T.attributeSize=f.length/2-x,T.baseColor=l.style,T.alpha=l.alpha,T.texture=b,T.geometryData=n,t.push(T)}function Jy(l,t,n,a,u){const{vertices:o,uvs:c,indices:f}=u;l.shapePrimitives.forEach(({shape:m,transform:p,holes:y})=>{const x=[],b=uo[m.type];if(!b.build(m,x))return;const _=f.length,T=o.length/2;let w="triangle-list";if(p&&M0(x,p),n){const D=m.closePath??!0,G=t;G.pixelLine?(NS(x,D,o,f),w="line-list"):US(x,G,!1,D,o,f)}else if(y){const D=[],G=x.slice();ZS(y).forEach(N=>{D.push(G.length/2),G.push(...N)}),R0(G,D,o,2,T,f,_)}else b.triangulate(x,o,2,T,f,_);const S=c.length/2,A=t.texture;if(A!==Ut.WHITE){const D=VS(FS,t,m,p);RS(o,2,T,c,S,2,o.length/2-T,D)}else zS(c,S,2,o.length/2-T);const z=De.get(kh);z.indexOffset=_,z.indexSize=f.length-_,z.attributeOffset=T,z.attributeSize=o.length/2-T,z.baseColor=t.color,z.alpha=t.alpha,z.texture=A,z.geometryData=u,z.topology=w,a.push(z)})}function ZS(l){const t=[];for(let n=0;n<l.length;n++){const a=l[n].shape,u=[];uo[a.type].build(a,u)&&t.push(u)}return t}class IS{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}reset(){this.batches&&this.batches.forEach(t=>{De.return(t)}),this.graphicsData&&De.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 KS{constructor(){this.instructions=new zh}init(t){const n=t.maxTextures;this.batcher?this.batcher._updateMaxTextures(n):this.batcher=new ES({maxTextures:n}),this.instructions.reset()}get geometry(){return wt(Q1,"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 Lh=class bh{constructor(t){this._renderer=t,this._managedContexts=new ml({renderer:t,type:"resource",name:"graphicsContext"})}init(t){bh.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??bh.defaultOptions.bezierSmoothness}getContextRenderData(t){return t._gpuData[this._renderer.uid].graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=!!t._gpuData[this._renderer.uid],a=t._gpuData[this._renderer.uid]||this._initContext(t);if(t.dirty||!n){n&&a.reset(),QS(t,a);const u=t.batchMode;t.customShader||u==="no-batch"?a.isBatchable=!1:u==="auto"?a.isBatchable=a.geometryData.vertices.length<400:a.isBatchable=!0,t.dirty=!1}return a}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=De.get(KS,{maxTextures:this._renderer.limits.maxBatchableTextures}),a=t._gpuData[this._renderer.uid],{batches:u,geometryData:o}=a;a.graphicsData=n;const c=o.vertices.length,f=o.indices.length;for(let x=0;x<u.length;x++)u[x].applyTransform=!1;const m=n.batcher;m.ensureAttributeBuffer(c),m.ensureIndexBuffer(f),m.begin();for(let x=0;x<u.length;x++){const b=u[x];m.add(b)}m.finish(n.instructions);const p=m.geometry;p.indexBuffer.setDataWithSize(m.indexBuffer,m.indexSize,!0),p.buffers[0].setDataWithSize(m.attributeBuffer.float32View,m.attributeSize,!0);const y=m.batches;for(let x=0;x<y.length;x++){const b=y[x];b.bindGroup=Lv(b.textures.textures,b.textures.count,this._renderer.limits.maxBatchableTextures)}return n}_initContext(t){const n=new IS;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};Lh.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"graphicsContext"};Lh.defaultOptions={bezierSmoothness:.5};let jh=Lh;const JS=8,Wr=11920929e-14,$S=1;function z0(l,t,n,a,u,o,c,f,m,p){const x=Math.min(.99,Math.max(0,p??jh.defaultOptions.bezierSmoothness));let b=($S-x)/1;return b*=b,t2(t,n,a,u,o,c,f,m,l,b),l}function t2(l,t,n,a,u,o,c,f,m,p){vh(l,t,n,a,u,o,c,f,m,p,0),m.push(c,f)}function vh(l,t,n,a,u,o,c,f,m,p,y){if(y>JS)return;const x=(l+n)/2,b=(t+a)/2,_=(n+u)/2,T=(a+o)/2,w=(u+c)/2,S=(o+f)/2,A=(x+_)/2,z=(b+T)/2,D=(_+w)/2,G=(T+S)/2,P=(A+D)/2,N=(z+G)/2;if(y>0){let O=c-l,et=f-t;const Z=Math.abs((n-c)*et-(a-f)*O),X=Math.abs((u-c)*et-(o-f)*O);if(Z>Wr&&X>Wr){if((Z+X)*(Z+X)<=p*(O*O+et*et)){m.push(P,N);return}}else if(Z>Wr){if(Z*Z<=p*(O*O+et*et)){m.push(P,N);return}}else if(X>Wr){if(X*X<=p*(O*O+et*et)){m.push(P,N);return}}else if(O=P-(l+c)/2,et=N-(t+f)/2,O*O+et*et<=p){m.push(P,N);return}}vh(l,t,x,b,A,z,P,N,m,p,y+1),vh(P,N,D,G,w,S,c,f,m,p,y+1)}const e2=8,i2=11920929e-14,n2=1;function s2(l,t,n,a,u,o,c,f){const p=Math.min(.99,Math.max(0,f??jh.defaultOptions.bezierSmoothness));let y=(n2-p)/1;return y*=y,a2(t,n,a,u,o,c,l,y),l}function a2(l,t,n,a,u,o,c,f){Sh(c,l,t,n,a,u,o,f,0),c.push(u,o)}function Sh(l,t,n,a,u,o,c,f,m){if(m>e2)return;const p=(t+a)/2,y=(n+u)/2,x=(a+o)/2,b=(u+c)/2,_=(p+x)/2,T=(y+b)/2;let w=o-t,S=c-n;const A=Math.abs((a-o)*S-(u-c)*w);if(A>i2){if(A*A<=f*(w*w+S*S)){l.push(_,T);return}}else if(w=_-(t+o)/2,S=T-(n+c)/2,w*w+S*S<=f){l.push(_,T);return}Sh(l,t,n,p,y,_,T,f,m+1),Sh(l,_,T,x,b,o,c,f,m+1)}function D0(l,t,n,a,u,o,c,f){let m=Math.abs(u-o);(!c&&u>o||c&&o>u)&&(m=2*Math.PI-m),f||(f=Math.max(6,Math.floor(6*Math.pow(a,1/3)*(m/Math.PI)))),f=Math.max(f,3);let p=m/f,y=u;p*=c?-1:1;for(let x=0;x<f+1;x++){const b=Math.cos(y),_=Math.sin(y),T=t+b*a,w=n+_*a;l.push(T,w),y+=p}}function l2(l,t,n,a,u,o){const c=l[l.length-2],m=l[l.length-1]-n,p=c-t,y=u-n,x=a-t,b=Math.abs(m*x-p*y);if(b<1e-8||o===0){(l[l.length-2]!==t||l[l.length-1]!==n)&&l.push(t,n);return}const _=m*m+p*p,T=y*y+x*x,w=m*y+p*x,S=o*Math.sqrt(_)/b,A=o*Math.sqrt(T)/b,z=S*w/_,D=A*w/T,G=S*x+A*p,P=S*y+A*m,N=p*(A+z),O=m*(A+z),et=x*(S+D),Z=y*(S+D),X=Math.atan2(O-P,N-G),W=Math.atan2(Z-P,et-G);D0(l,G+t,P+n,o,X,W,p*y>x*m)}const al=Math.PI*2,nh={centerX:0,centerY:0,ang1:0,ang2:0},sh=({x:l,y:t},n,a,u,o,c,f,m)=>{l*=n,t*=a;const p=u*l-o*t,y=o*l+u*t;return m.x=p+c,m.y=y+f,m};function r2(l,t){const n=t===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(t/4),a=t===1.5707963267948966?.551915024494:n,u=Math.cos(l),o=Math.sin(l),c=Math.cos(l+t),f=Math.sin(l+t);return[{x:u-o*a,y:o+u*a},{x:c+f*a,y:f-c*a},{x:c,y:f}]}const $y=(l,t,n,a)=>{const u=l*a-t*n<0?-1:1;let o=l*n+t*a;return o>1&&(o=1),o<-1&&(o=-1),u*Math.acos(o)},o2=(l,t,n,a,u,o,c,f,m,p,y,x,b)=>{const _=Math.pow(u,2),T=Math.pow(o,2),w=Math.pow(y,2),S=Math.pow(x,2);let A=_*T-_*S-T*w;A<0&&(A=0),A/=_*S+T*w,A=Math.sqrt(A)*(c===f?-1:1);const z=A*u/o*x,D=A*-o/u*y,G=p*z-m*D+(l+n)/2,P=m*z+p*D+(t+a)/2,N=(y-z)/u,O=(x-D)/o,et=(-y-z)/u,Z=(-x-D)/o,X=$y(1,0,N,O);let W=$y(N,O,et,Z);f===0&&W>0&&(W-=al),f===1&&W<0&&(W+=al),b.centerX=G,b.centerY=P,b.ang1=X,b.ang2=W};function u2(l,t,n,a,u,o,c,f=0,m=0,p=0){if(o===0||c===0)return;const y=Math.sin(f*al/360),x=Math.cos(f*al/360),b=x*(t-a)/2+y*(n-u)/2,_=-y*(t-a)/2+x*(n-u)/2;if(b===0&&_===0)return;o=Math.abs(o),c=Math.abs(c);const T=Math.pow(b,2)/Math.pow(o,2)+Math.pow(_,2)/Math.pow(c,2);T>1&&(o*=Math.sqrt(T),c*=Math.sqrt(T)),o2(t,n,a,u,o,c,m,p,y,x,b,_,nh);let{ang1:w,ang2:S}=nh;const{centerX:A,centerY:z}=nh;let D=Math.abs(S)/(al/4);Math.abs(1-D)<1e-7&&(D=1);const G=Math.max(Math.ceil(D),1);S/=G;let P=l[l.length-2],N=l[l.length-1];const O={x:0,y:0};for(let et=0;et<G;et++){const Z=r2(w,S),{x:X,y:W}=sh(Z[0],o,c,x,y,A,z,O),{x:I,y:tt}=sh(Z[1],o,c,x,y,A,z,O),{x:it,y:St}=sh(Z[2],o,c,x,y,A,z,O);z0(l,P,N,X,W,I,tt,it,St),P=it,N=St,w+=S}}function c2(l,t,n){const a=(c,f)=>{const m=f.x-c.x,p=f.y-c.y,y=Math.sqrt(m*m+p*p),x=m/y,b=p/y;return{len:y,nx:x,ny:b}},u=(c,f)=>{c===0?l.moveTo(f.x,f.y):l.lineTo(f.x,f.y)};let o=t[t.length-1];for(let c=0;c<t.length;c++){const f=t[c%t.length],m=f.radius??n;if(m<=0){u(c,f),o=f;continue}const p=t[(c+1)%t.length],y=a(f,o),x=a(f,p);if(y.len<1e-4||x.len<1e-4){u(c,f),o=f;continue}let b=Math.asin(y.nx*x.ny-y.ny*x.nx),_=1,T=!1;y.nx*x.nx-y.ny*-x.ny<0?b<0?b=Math.PI+b:(b=Math.PI-b,_=-1,T=!0):b>0&&(_=-1,T=!0);const w=b/2;let S,A=Math.abs(Math.cos(w)*m/Math.sin(w));A>Math.min(y.len/2,x.len/2)?(A=Math.min(y.len/2,x.len/2),S=Math.abs(A*Math.sin(w)/Math.cos(w))):S=m;const z=f.x+x.nx*A+-x.ny*S*_,D=f.y+x.ny*A+x.nx*S*_,G=Math.atan2(y.ny,y.nx)+Math.PI/2*_,P=Math.atan2(x.ny,x.nx)-Math.PI/2*_;c===0&&l.moveTo(z+Math.cos(G)*S,D+Math.sin(G)*S),l.arc(z,D,S,G,P,T),o=f}}function h2(l,t,n,a){const u=(f,m)=>Math.sqrt((f.x-m.x)**2+(f.y-m.y)**2),o=(f,m,p)=>({x:f.x+(m.x-f.x)*p,y:f.y+(m.y-f.y)*p}),c=t.length;for(let f=0;f<c;f++){const m=t[(f+1)%c],p=m.radius??n;if(p<=0){f===0?l.moveTo(m.x,m.y):l.lineTo(m.x,m.y);continue}const y=t[f],x=t[(f+2)%c],b=u(y,m);let _;if(b<1e-4)_=m;else{const S=Math.min(b/2,p);_=o(m,y,S/b)}const T=u(x,m);let w;if(T<1e-4)w=m;else{const S=Math.min(T/2,p);w=o(m,x,S/T)}f===0?l.moveTo(_.x,_.y):l.lineTo(_.x,_.y),l.quadraticCurveTo(m.x,m.y,w.x,w.y,a)}}const f2=new $t;class d2{constructor(t){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new si,this._graphicsPath2D=t,this.signed=t.checkForHoles}moveTo(t,n){return this.startPoly(t,n),this}lineTo(t,n){this._ensurePoly();const a=this._currentPoly.points,u=a[a.length-2],o=a[a.length-1];return(u!==t||o!==n)&&a.push(t,n),this}arc(t,n,a,u,o,c){this._ensurePoly(!1);const f=this._currentPoly.points;return D0(f,t,n,a,u,o,c),this}arcTo(t,n,a,u,o){this._ensurePoly();const c=this._currentPoly.points;return l2(c,t,n,a,u,o),this}arcToSvg(t,n,a,u,o,c,f){const m=this._currentPoly.points;return u2(m,this._currentPoly.lastX,this._currentPoly.lastY,c,f,t,n,a,u,o),this}bezierCurveTo(t,n,a,u,o,c,f){this._ensurePoly();const m=this._currentPoly;return z0(this._currentPoly.points,m.lastX,m.lastY,t,n,a,u,o,c,f),this}quadraticCurveTo(t,n,a,u,o){this._ensurePoly();const c=this._currentPoly;return s2(this._currentPoly.points,c.lastX,c.lastY,t,n,a,u,o),this}closePath(){return this.endPoly(!0),this}addPath(t,n){this.endPoly(),n&&!n.isIdentity()&&(t=t.clone(!0),t.transform(n));const a=this.shapePrimitives,u=a.length;for(let o=0;o<t.instructions.length;o++){const c=t.instructions[o];this[c.action](...c.data)}if(t.checkForHoles&&a.length-u>1){let o=null;for(let c=u;c<a.length;c++){const f=a[c];if(f.shape.type==="polygon"){const m=f.shape,p=o==null?void 0:o.shape;p&&p.containsPolygon(m)?(o.holes||(o.holes=[]),o.holes.push(f),a.copyWithin(c,c+1),a.length--,c--):o=f}}}return this}finish(t=!1){this.endPoly(t)}rect(t,n,a,u,o){return this.drawShape(new $t(t,n,a,u),o),this}circle(t,n,a,u){return this.drawShape(new Gh(t,n,a),u),this}poly(t,n,a){const u=new nl(t);return u.closePath=n,this.drawShape(u,a),this}regularPoly(t,n,a,u,o=0,c){u=Math.max(u|0,3);const f=-1*Math.PI/2+o,m=Math.PI*2/u,p=[];for(let y=0;y<u;y++){const x=f-y*m;p.push(t+a*Math.cos(x),n+a*Math.sin(x))}return this.poly(p,!0,c),this}roundPoly(t,n,a,u,o,c=0,f){if(u=Math.max(u|0,3),o<=0)return this.regularPoly(t,n,a,u,c);const m=a*Math.sin(Math.PI/u)-.001;o=Math.min(o,m);const p=-1*Math.PI/2+c,y=Math.PI*2/u,x=(u-2)*Math.PI/u/2;for(let b=0;b<u;b++){const _=b*y+p,T=t+a*Math.cos(_),w=n+a*Math.sin(_),S=_+Math.PI+x,A=_-Math.PI-x,z=T+o*Math.cos(S),D=w+o*Math.sin(S),G=T+o*Math.cos(A),P=w+o*Math.sin(A);b===0?this.moveTo(z,D):this.lineTo(z,D),this.quadraticCurveTo(T,w,G,P,f)}return this.closePath()}roundShape(t,n,a=!1,u){return t.length<3?this:(a?h2(this,t,n,u):c2(this,t,n),this.closePath())}filletRect(t,n,a,u,o){if(o===0)return this.rect(t,n,a,u);const c=Math.min(a,u)/2,f=Math.min(c,Math.max(-c,o)),m=t+a,p=n+u,y=f<0?-f:0,x=Math.abs(f);return this.moveTo(t,n+x).arcTo(t+y,n+y,t+x,n,x).lineTo(m-x,n).arcTo(m-y,n+y,m,n+x,x).lineTo(m,p-x).arcTo(m-y,p-y,t+a-x,p,x).lineTo(t+x,p).arcTo(t+y,p-y,t,p-x,x).closePath()}chamferRect(t,n,a,u,o,c){if(o<=0)return this.rect(t,n,a,u);const f=Math.min(o,Math.min(a,u)/2),m=t+a,p=n+u,y=[t+f,n,m-f,n,m,n+f,m,p-f,m-f,p,t+f,p,t,p-f,t,n+f];for(let x=y.length-1;x>=2;x-=2)y[x]===y[x-2]&&y[x-1]===y[x-3]&&y.splice(x-1,2);return this.poly(y,!0,c)}ellipse(t,n,a,u,o){return this.drawShape(new Uh(t,n,a,u),o),this}roundRect(t,n,a,u,o,c){return this.drawShape(new Nh(t,n,a,u,o),c),this}drawShape(t,n){return this.endPoly(),this.shapePrimitives.push({shape:t,transform:n}),this}startPoly(t,n){let a=this._currentPoly;return a&&this.endPoly(),a=new nl,a.points.push(t,n),this._currentPoly=a,this}endPoly(t=!1){const n=this._currentPoly;return n&&n.points.length>2&&(n.closePath=t,this.shapePrimitives.push({shape:n})),this._currentPoly=null,this}_ensurePoly(t=!0){if(!this._currentPoly&&(this._currentPoly=new nl,t)){const n=this.shapePrimitives[this.shapePrimitives.length-1];if(n){let a=n.shape.x,u=n.shape.y;if(n.transform&&!n.transform.isIdentity()){const o=n.transform,c=a;a=o.a*a+o.c*u+o.tx,u=o.b*c+o.d*u+o.ty}this._currentPoly.points.push(a,u)}else this._currentPoly.points.push(0,0)}}buildPath(){const t=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let n=0;n<t.instructions.length;n++){const a=t.instructions[n];this[a.action](...a.data)}this.finish()}get bounds(){const t=this._bounds;t.clear();const n=this.shapePrimitives;for(let a=0;a<n.length;a++){const u=n[a],o=u.shape.getBounds(f2);u.transform?t.addRect(o,u.transform):t.addRect(o)}return t}}class Vi{constructor(t,n=!1){this.instructions=[],this.uid=Wt("graphicsPath"),this._dirty=!0,this.checkForHoles=n,typeof t=="string"?Uv(t,this):this.instructions=(t==null?void 0:t.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new d2(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(t,n){return t=t.clone(),this.instructions.push({action:"addPath",data:[t,n]}),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,n,a,u,o){const c=this.instructions[this.instructions.length-1],f=this.getLastPoint(xe.shared);let m=0,p=0;if(!c||c.action!=="bezierCurveTo")m=f.x,p=f.y;else{m=c.data[2],p=c.data[3];const y=f.x,x=f.y;m=y+(y-m),p=x+(x-p)}return this.instructions.push({action:"bezierCurveTo",data:[m,p,t,n,a,u,o]}),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,n,a){const u=this.instructions[this.instructions.length-1],o=this.getLastPoint(xe.shared);let c=0,f=0;if(!u||u.action!=="quadraticCurveTo")c=o.x,f=o.y;else{c=u.data[0],f=u.data[1];const m=o.x,p=o.y;c=m+(m-c),f=p+(p-f)}return this.instructions.push({action:"quadraticCurveTo",data:[c,f,t,n,a]}),this._dirty=!0,this}rect(t,n,a,u,o){return this.instructions.push({action:"rect",data:[t,n,a,u,o]}),this._dirty=!0,this}circle(t,n,a,u){return this.instructions.push({action:"circle",data:[t,n,a,u]}),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,n,a,u,o,c,f){o||(o=u/2);const m=-1*Math.PI/2+c,p=a*2,y=Math.PI*2/p,x=[];for(let b=0;b<p;b++){const _=b%2?o:u,T=b*y+m;x.push(t+_*Math.cos(T),n+_*Math.sin(T))}return this.poly(x,!0,f),this}clone(t=!1){const n=new Vi;if(n.checkForHoles=this.checkForHoles,!t)n.instructions=this.instructions.slice();else for(let a=0;a<this.instructions.length;a++){const u=this.instructions[a];n.instructions.push({action:u.action,data:u.data.slice()})}return n}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(t){if(t.isIdentity())return this;const n=t.a,a=t.b,u=t.c,o=t.d,c=t.tx,f=t.ty;let m=0,p=0,y=0,x=0,b=0,_=0,T=0,w=0;for(let S=0;S<this.instructions.length;S++){const A=this.instructions[S],z=A.data;switch(A.action){case"moveTo":case"lineTo":m=z[0],p=z[1],z[0]=n*m+u*p+c,z[1]=a*m+o*p+f;break;case"bezierCurveTo":y=z[0],x=z[1],b=z[2],_=z[3],m=z[4],p=z[5],z[0]=n*y+u*x+c,z[1]=a*y+o*x+f,z[2]=n*b+u*_+c,z[3]=a*b+o*_+f,z[4]=n*m+u*p+c,z[5]=a*m+o*p+f;break;case"quadraticCurveTo":y=z[0],x=z[1],m=z[2],p=z[3],z[0]=n*y+u*x+c,z[1]=a*y+o*x+f,z[2]=n*m+u*p+c,z[3]=a*m+o*p+f;break;case"arcToSvg":m=z[5],p=z[6],T=z[0],w=z[1],z[0]=n*T+u*w,z[1]=a*T+o*w,z[5]=n*m+u*p+c,z[6]=a*m+o*p+f;break;case"circle":z[4]=Ia(z[3],t);break;case"rect":z[4]=Ia(z[4],t);break;case"ellipse":z[8]=Ia(z[8],t);break;case"roundRect":z[5]=Ia(z[5],t);break;case"addPath":z[0].transform(t);break;case"poly":z[2]=Ia(z[2],t);break;default:Se("unknown transform action",A.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(t){let n=this.instructions.length-1,a=this.instructions[n];if(!a)return t.x=0,t.y=0,t;for(;a.action==="closePath";){if(n--,n<0)return t.x=0,t.y=0,t;a=this.instructions[n]}switch(a.action){case"moveTo":case"lineTo":t.x=a.data[0],t.y=a.data[1];break;case"quadraticCurveTo":t.x=a.data[2],t.y=a.data[3];break;case"bezierCurveTo":t.x=a.data[4],t.y=a.data[5];break;case"arc":case"arcToSvg":t.x=a.data[5],t.y=a.data[6];break;case"addPath":a.data[0].getLastPoint(t);break}return t}}function Ia(l,t){return l?l.prepend(t):t.clone()}function Pt(l,t,n){const a=l.getAttribute(t);return a?Number(a):n}function m2(l,t){const n=l.querySelectorAll("defs");for(let a=0;a<n.length;a++){const u=n[a];for(let o=0;o<u.children.length;o++){const c=u.children[o];switch(c.nodeName.toLowerCase()){case"lineargradient":t.defs[c.id]=p2(c);break;case"radialgradient":t.defs[c.id]=y2();break}}}}function p2(l){const t=Pt(l,"x1",0),n=Pt(l,"y1",0),a=Pt(l,"x2",1),u=Pt(l,"y2",0),o=l.getAttribute("gradientUnits")||"objectBoundingBox",c=new Pi(t,n,a,u,o==="objectBoundingBox"?"local":"global");for(let f=0;f<l.children.length;f++){const m=l.children[f],p=Pt(m,"offset",0),y=re.shared.setValue(m.getAttribute("stop-color")).toNumber();c.addColorStop(p,y)}return c}function y2(l){return Se("[SVG Parser] Radial gradients are not yet supported"),new Pi(0,0,1,0)}function tg(l){const t=l.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return t?t[1]:""}const eg={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 B0(l,t){const n=l.getAttribute("style"),a={},u={},o={strokeStyle:a,fillStyle:u,useFill:!1,useStroke:!1};for(const c in eg){const f=l.getAttribute(c);f&&ig(t,o,c,f.trim())}if(n){const c=n.split(";");for(let f=0;f<c.length;f++){const m=c[f].trim(),[p,y]=m.split(":");eg[p]&&ig(t,o,p,y.trim())}}return{strokeStyle:o.useStroke?a:null,fillStyle:o.useFill?u:null,useFill:o.useFill,useStroke:o.useStroke}}function ig(l,t,n,a){switch(n){case"stroke":if(a!=="none"){if(a.startsWith("url(")){const u=tg(a);t.strokeStyle.fill=l.defs[u]}else t.strokeStyle.color=re.shared.setValue(a).toNumber();t.useStroke=!0}break;case"stroke-width":t.strokeStyle.width=Number(a);break;case"fill":if(a!=="none"){if(a.startsWith("url(")){const u=tg(a);t.fillStyle.fill=l.defs[u]}else t.fillStyle.color=re.shared.setValue(a).toNumber();t.useFill=!0}break;case"fill-opacity":t.fillStyle.alpha=Number(a);break;case"stroke-opacity":t.strokeStyle.alpha=Number(a);break;case"opacity":t.fillStyle.alpha=Number(a),t.strokeStyle.alpha=Number(a);break}}function g2(l){if(l.length<=2)return!0;const t=l.map(f=>f.area).sort((f,m)=>m-f),[n,a]=t,u=t[t.length-1],o=n/a,c=a/u;return!(o>3&&c<2)}function x2(l){return l.split(/(?=[Mm])/).filter(a=>a.trim().length>0)}function _2(l){const t=l.match(/[-+]?[0-9]*\.?[0-9]+/g);if(!t||t.length<4)return 0;const n=t.map(Number),a=[],u=[];for(let y=0;y<n.length;y+=2)y+1<n.length&&(a.push(n[y]),u.push(n[y+1]));if(a.length===0||u.length===0)return 0;const o=Math.min(...a),c=Math.max(...a),f=Math.min(...u),m=Math.max(...u);return(c-o)*(m-f)}function ng(l,t){const n=new Vi(l,!1);for(const a of n.instructions)t.instructions.push(a)}function b2(l,t){if(typeof l=="string"){const c=document.createElement("div");c.innerHTML=l.trim(),l=c.querySelector("svg")}const n={context:t,defs:{},path:new Vi};m2(l,n);const a=l.children,{fillStyle:u,strokeStyle:o}=B0(l,n);for(let c=0;c<a.length;c++){const f=a[c];f.nodeName.toLowerCase()!=="defs"&&O0(f,n,u,o)}return t}function O0(l,t,n,a){const u=l.children,{fillStyle:o,strokeStyle:c}=B0(l,t);o&&n?n={...n,...o}:o&&(n=o),c&&a?a={...a,...c}:c&&(a=c);const f=!n&&!a;f&&(n={color:0});let m,p,y,x,b,_,T,w,S,A,z,D,G,P,N,O,et;switch(l.nodeName.toLowerCase()){case"path":{P=l.getAttribute("d");const Z=l.getAttribute("fill-rule"),X=x2(P),W=Z==="evenodd",I=X.length>1;if(W&&I){const it=X.map(R=>({path:R,area:_2(R)}));if(it.sort((R,L)=>L.area-R.area),X.length>3||!g2(it))for(let R=0;R<it.length;R++){const L=it[R],nt=R===0;t.context.beginPath();const K=new Vi(void 0,!0);ng(L.path,K),t.context.path(K),nt?(n&&t.context.fill(n),a&&t.context.stroke(a)):t.context.cut()}else for(let R=0;R<it.length;R++){const L=it[R],nt=R%2===1;t.context.beginPath();const K=new Vi(void 0,!0);ng(L.path,K),t.context.path(K),nt?t.context.cut():(n&&t.context.fill(n),a&&t.context.stroke(a))}}else{const it=Z?Z==="evenodd":!0;N=new Vi(P,it),t.context.path(N),n&&t.context.fill(n),a&&t.context.stroke(a)}break}case"circle":T=Pt(l,"cx",0),w=Pt(l,"cy",0),S=Pt(l,"r",0),t.context.ellipse(T,w,S,S),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"rect":m=Pt(l,"x",0),p=Pt(l,"y",0),O=Pt(l,"width",0),et=Pt(l,"height",0),A=Pt(l,"rx",0),z=Pt(l,"ry",0),A||z?t.context.roundRect(m,p,O,et,A||z):t.context.rect(m,p,O,et),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"ellipse":T=Pt(l,"cx",0),w=Pt(l,"cy",0),A=Pt(l,"rx",0),z=Pt(l,"ry",0),t.context.beginPath(),t.context.ellipse(T,w,A,z),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"line":y=Pt(l,"x1",0),x=Pt(l,"y1",0),b=Pt(l,"x2",0),_=Pt(l,"y2",0),t.context.beginPath(),t.context.moveTo(y,x),t.context.lineTo(b,_),a&&t.context.stroke(a);break;case"polygon":G=l.getAttribute("points"),D=G.match(/-?\d+/g).map(Z=>parseInt(Z,10)),t.context.poly(D,!0),n&&t.context.fill(n),a&&t.context.stroke(a);break;case"polyline":G=l.getAttribute("points"),D=G.match(/-?\d+/g).map(Z=>parseInt(Z,10)),t.context.poly(D,!1),a&&t.context.stroke(a);break;case"g":case"svg":break;default:{Se(`[SVG parser] <${l.nodeName}> elements unsupported`);break}}f&&(n=null);for(let Z=0;Z<u.length;Z++)O0(u[Z],t,n,a)}const sg={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 co{constructor(t,n){this.uid=Wt("fillPattern"),this._tick=0,this.transform=new vt,this.texture=t,this.transform.scale(1/t.frame.width,1/t.frame.height),n&&(t.source.style.addressModeU=sg[n].addressModeU,t.source.style.addressModeV=sg[n].addressModeV)}setTransform(t){const n=this.texture;this.transform.copyFrom(t),this.transform.invert(),this.transform.scale(1/n.frame.width,1/n.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 v2(l){return re.isColorLike(l)}function ag(l){return l instanceof co}function lg(l){return l instanceof Pi}function S2(l){return l instanceof Ut}function T2(l,t,n){const a=re.shared.setValue(t??0);return l.color=a.toNumber(),l.alpha=a.alpha===1?n.alpha:a.alpha,l.texture=Ut.WHITE,{...n,...l}}function w2(l,t,n){return l.texture=t,{...n,...l}}function rg(l,t,n){return l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,{...n,...l}}function og(l,t,n){return t.buildGradient(),l.fill=t,l.color=16777215,l.texture=t.texture,l.matrix=t.transform,l.textureSpace=t.textureSpace,{...n,...l}}function A2(l,t){const n={...t,...l},a=re.shared.setValue(n.color);return n.alpha*=a.alpha,n.color=a.toNumber(),n}function In(l,t){if(l==null)return null;const n={},a=l;return v2(l)?T2(n,l,t):S2(l)?w2(n,l,t):ag(l)?rg(n,l,t):lg(l)?og(n,l,t):a.fill&&ag(a.fill)?rg(a,a.fill,t):a.fill&&lg(a.fill)?og(a,a.fill,t):A2(a,t)}function so(l,t){const{width:n,alignment:a,miterLimit:u,cap:o,join:c,pixelLine:f,...m}=t,p=In(l,m);return p?{width:n,alignment:a,miterLimit:u,cap:o,join:c,pixelLine:f,...p}:null}function C2(l,t){let n=1;const a=l.shapePath.shapePrimitives;for(let u=0;u<a.length;u++){const o=a[u].shape;if(o.type!=="polygon")continue;const c=o.points,f=c.length;if(f<6)continue;const m=o.closePath;for(let p=0;p<f;p+=2){if(!m&&(p===0||p===f-2))continue;const y=(p-2+f)%f,x=(p+2)%f,b=c[y],_=c[y+1],T=c[p],w=c[p+1],S=c[x],A=c[x+1],z=b-T,D=_-w,G=S-T,P=A-w,N=z*z+D*D,O=G*G+P*P;if(N<1e-12||O<1e-12)continue;let X=(z*G+D*P)/Math.sqrt(N*O);X<-1?X=-1:X>1&&(X=1);const W=Math.sqrt((1-X)*.5);if(W<1e-6)continue;const I=Math.min(1/W,t);I>n&&(n=I)}}return n}const M2=new xe,ug=new vt,Yh=class bi extends vi{constructor(){super(...arguments),this._gpuData=Object.create(null),this.autoGarbageCollect=!0,this._gcLastUsed=-1,this.uid=Wt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this.destroyed=!1,this._activePath=new Vi,this._transform=new vt,this._fillStyle={...bi.defaultFillStyle},this._strokeStyle={...bi.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new si,this._boundsDirty=!0}clone(){const t=new bi;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=In(t,bi.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(t){this._strokeStyle=so(t,bi.defaultStrokeStyle)}setFillStyle(t){return this._fillStyle=In(t,bi.defaultFillStyle),this}setStrokeStyle(t){return this._strokeStyle=In(t,bi.defaultStrokeStyle),this}texture(t,n,a,u,o,c){return this.instructions.push({action:"texture",data:{image:t,dx:a||0,dy:u||0,dw:o||t.frame.width,dh:c||t.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:n||n===0?re.shared.setValue(n).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Vi,this}fill(t,n){let a;const u=this.instructions[this.instructions.length-1];return this._tick===0&&(u==null?void 0:u.action)==="stroke"?a=u.data.path:a=this._activePath.clone(),a?(t!=null&&(n!==void 0&&typeof t=="number"&&(wt(Qt,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),t={color:t,alpha:n}),this._fillStyle=In(t,bi.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:a}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:t,y:n}=this._activePath.getLastPoint(xe.shared);this._activePath.clear(),this._activePath.moveTo(t,n)}stroke(t){let n;const a=this.instructions[this.instructions.length-1];return this._tick===0&&(a==null?void 0:a.action)==="fill"?n=a.data.path:n=this._activePath.clone(),n?(t!=null&&(this._strokeStyle=so(t,bi.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:n}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let t=0;t<2;t++){const n=this.instructions[this.instructions.length-1-t],a=this._activePath.clone();if(n&&(n.action==="stroke"||n.action==="fill"))if(n.data.hole)n.data.hole.addPath(a);else{n.data.hole=a;break}}return this._initNextPathLocation(),this}arc(t,n,a,u,o,c){this._tick++;const f=this._transform;return this._activePath.arc(f.a*t+f.c*n+f.tx,f.b*t+f.d*n+f.ty,a,u,o,c),this}arcTo(t,n,a,u,o){this._tick++;const c=this._transform;return this._activePath.arcTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*a+c.c*u+c.tx,c.b*a+c.d*u+c.ty,o),this}arcToSvg(t,n,a,u,o,c,f){this._tick++;const m=this._transform;return this._activePath.arcToSvg(t,n,a,u,o,m.a*c+m.c*f+m.tx,m.b*c+m.d*f+m.ty),this}bezierCurveTo(t,n,a,u,o,c,f){this._tick++;const m=this._transform;return this._activePath.bezierCurveTo(m.a*t+m.c*n+m.tx,m.b*t+m.d*n+m.ty,m.a*a+m.c*u+m.tx,m.b*a+m.d*u+m.ty,m.a*o+m.c*c+m.tx,m.b*o+m.d*c+m.ty,f),this}closePath(){var t;return this._tick++,(t=this._activePath)==null||t.closePath(),this}ellipse(t,n,a,u){return this._tick++,this._activePath.ellipse(t,n,a,u,this._transform.clone()),this}circle(t,n,a){return this._tick++,this._activePath.circle(t,n,a,this._transform.clone()),this}path(t){return this._tick++,this._activePath.addPath(t,this._transform.clone()),this}lineTo(t,n){this._tick++;const a=this._transform;return this._activePath.lineTo(a.a*t+a.c*n+a.tx,a.b*t+a.d*n+a.ty),this}moveTo(t,n){this._tick++;const a=this._transform,u=this._activePath.instructions,o=a.a*t+a.c*n+a.tx,c=a.b*t+a.d*n+a.ty;return u.length===1&&u[0].action==="moveTo"?(u[0].data[0]=o,u[0].data[1]=c,this):(this._activePath.moveTo(o,c),this)}quadraticCurveTo(t,n,a,u,o){this._tick++;const c=this._transform;return this._activePath.quadraticCurveTo(c.a*t+c.c*n+c.tx,c.b*t+c.d*n+c.ty,c.a*a+c.c*u+c.tx,c.b*a+c.d*u+c.ty,o),this}rect(t,n,a,u){return this._tick++,this._activePath.rect(t,n,a,u,this._transform.clone()),this}roundRect(t,n,a,u,o){return this._tick++,this._activePath.roundRect(t,n,a,u,o,this._transform.clone()),this}poly(t,n){return this._tick++,this._activePath.poly(t,n,this._transform.clone()),this}regularPoly(t,n,a,u,o=0,c){return this._tick++,this._activePath.regularPoly(t,n,a,u,o,c),this}roundPoly(t,n,a,u,o,c){return this._tick++,this._activePath.roundPoly(t,n,a,u,o,c),this}roundShape(t,n,a,u){return this._tick++,this._activePath.roundShape(t,n,a,u),this}filletRect(t,n,a,u,o){return this._tick++,this._activePath.filletRect(t,n,a,u,o),this}chamferRect(t,n,a,u,o,c){return this._tick++,this._activePath.chamferRect(t,n,a,u,o,c),this}star(t,n,a,u,o=0,c=0){return this._tick++,this._activePath.star(t,n,a,u,o,c,this._transform.clone()),this}svg(t){return this._tick++,b2(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,n=t){return this._transform.scale(t,n),this}setTransform(t,n,a,u,o,c){return t instanceof vt?(this._transform.set(t.a,t.b,t.c,t.d,t.tx,t.ty),this):(this._transform.set(t,n,a,u,o,c),this)}transform(t,n,a,u,o,c){return t instanceof vt?(this._transform.append(t),this):(ug.set(t,n,a,u,o,c),this._transform.append(ug),this)}translate(t,n=t){return this._transform.translate(t,n),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 n=0;n<this.instructions.length;n++){const a=this.instructions[n],u=a.action;if(u==="fill"){const o=a.data;t.addBounds(o.path.bounds)}else if(u==="texture"){const o=a.data;t.addFrame(o.dx,o.dy,o.dx+o.dw,o.dy+o.dh,o.transform)}if(u==="stroke"){const o=a.data,c=o.style.alignment;let f=o.style.width*(1-c);o.style.join==="miter"&&(f*=C2(o.path,o.style.miterLimit));const m=o.path.bounds;t.addFrame(m.minX-f,m.minY-f,m.maxX+f,m.maxY+f)}}return t.isValid||t.set(0,0,0,0),t}containsPoint(t){var u;if(!this.bounds.containsPoint(t.x,t.y))return!1;const n=this.instructions;let a=!1;for(let o=0;o<n.length;o++){const c=n[o],f=c.data,m=f.path;if(!c.action||!m)continue;const p=f.style,y=m.shapePath.shapePrimitives;for(let x=0;x<y.length;x++){const b=y[x].shape;if(!p||!b)continue;const _=y[x].transform,T=_?_.applyInverse(t,M2):t;if(c.action==="fill")a=b.contains(T.x,T.y);else{const S=p;a=b.strokeContains(T.x,T.y,S.width,S.alignment)}const w=f.hole;if(w){const S=(u=w.shapePath)==null?void 0:u.shapePrimitives;if(S)for(let A=0;A<S.length;A++)S[A].shape.contains(T.x,T.y)&&(a=!1)}if(a)return!0}}return a}unload(){var t;this.emit("unload",this);for(const n in this._gpuData)(t=this._gpuData[n])==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 a=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(a)),this._strokeStyle.texture&&(this._strokeStyle.fill&&"uid"in this._strokeStyle.fill?this._strokeStyle.fill.destroy():this._strokeStyle.texture.destroy(a))}this._fillStyle=null,this._strokeStyle=null,this.instructions=null,this._activePath=null,this._bounds=null,this._stateStack=null,this.customShader=null,this._transform=null}};Yh.defaultFillStyle={color:16777215,alpha:1,texture:Ut.WHITE,matrix:null,fill:null,textureSpace:"local"};Yh.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Ut.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let di=Yh;class E2{constructor(){this.isBatchable=!1}reset(){this.isBatchable=!1,this.context=null,this.graphicsData&&(this.graphicsData.destroy(),this.graphicsData=null)}destroy(){this.reset()}}class R2{constructor(){this.instructions=new zh}init(){this.instructions.reset()}destroy(){this.instructions.destroy(),this.instructions=null}}const qh=class Th{constructor(t){this._renderer=t,this._managedContexts=new ml({renderer:t,type:"resource",name:"graphicsContext"})}init(t){Th.defaultOptions.bezierSmoothness=(t==null?void 0:t.bezierSmoothness)??Th.defaultOptions.bezierSmoothness}getContextRenderData(t){return this.getGpuContext(t).graphicsData||this._initContextRenderData(t)}updateGpuContext(t){const n=t._gpuData,a=!!n[this._renderer.uid],u=n[this._renderer.uid]||this._initContext(t);return(t.dirty||!a)&&(a&&u.reset(),u.isBatchable=!1,t.dirty=!1),u}getGpuContext(t){return t._gpuData[this._renderer.uid]||this._initContext(t)}_initContextRenderData(t){const n=new R2,a=this.getGpuContext(t);return a.graphicsData=n,n.init(),n}_initContext(t){const n=new E2;return n.context=t,t._gpuData[this._renderer.uid]=n,this._managedContexts.add(t),n}destroy(){this._managedContexts.destroy(),this._renderer=null}};qh.extension={type:[yt.CanvasSystem],name:"graphicsContext"};qh.defaultOptions={bezierSmoothness:.5};let z2=qh;class G0{constructor(t,n){this.state=s0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ml({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){return!1}addRenderable(t,n){this._managedGraphics.add(t),this.renderer.renderPipes.batch.break(n),n.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}}G0.extension={type:[yt.CanvasPipes],name:"graphics"};function D2(l,t,n){const a=(l>>24&255)/255;t[n++]=(l&255)/255*a,t[n++]=(l>>8&255)/255*a,t[n++]=(l>>16&255)/255*a,t[n++]=a}class B2{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(t=>{De.return(t)}),this.batches.length=0}}class U0{constructor(t,n){this.state=s0.for2d(),this.renderer=t,this._adaptor=n,this.renderer.runners.contextChange.add(this),this._managedGraphics=new ml({renderer:t,type:"renderable",priority:-1,name:"graphics"})}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(t){const n=t.context,a=!!t._gpuData,o=this.renderer.graphicsContext.updateGpuContext(n);return!!(o.isBatchable||a!==o.isBatchable)}addRenderable(t,n){const u=this.renderer.graphicsContext.updateGpuContext(t.context);t.didViewUpdate&&this._rebuild(t),u.isBatchable?this._addToBatcher(t,n):(this.renderer.renderPipes.batch.break(n),n.add(t))}updateRenderable(t){const a=this._getGpuDataForRenderable(t).batches;for(let u=0;u<a.length;u++){const o=a[u];o._batcher.updateElement(o)}}execute(t){if(!t.isRenderable)return;const n=this.renderer,a=t.context;if(!n.graphicsContext.getGpuContext(a).batches.length)return;const o=a.customShader||this._adaptor.shader;this.state.blendMode=t.groupBlendMode;const c=o.resources.localUniforms.uniforms;c.uTransformMatrix=t.groupTransform,c.uRound=n._roundPixels|t._roundPixels,D2(t.groupColorAlpha,c.uColor,0),this._adaptor.execute(this,t)}_rebuild(t){const n=this._getGpuDataForRenderable(t),u=this.renderer.graphicsContext.updateGpuContext(t.context);n.destroy(),u.isBatchable&&this._updateBatchesForRenderable(t,n)}_addToBatcher(t,n){const a=this.renderer.renderPipes.batch,u=this._getGpuDataForRenderable(t).batches;for(let o=0;o<u.length;o++){const c=u[o];a.addToBatch(c,n)}}_getGpuDataForRenderable(t){return t._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(t)}_initGpuDataForRenderable(t){const n=new B2;return t._gpuData[this.renderer.uid]=n,this._managedGraphics.add(t),n}_updateBatchesForRenderable(t,n){const a=t.context,o=this.renderer.graphicsContext.getGpuContext(a),c=this.renderer._roundPixels|t._roundPixels;n.batches=o.batches.map(f=>{const m=De.get(kh);return f.copyTo(m),m.renderable=t,m.roundPixels=c,m})}destroy(){this._managedGraphics.destroy(),this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}U0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes],name:"graphics"};te.add(G0);te.add(U0);te.add(z2);te.add(jh);class ae extends Dh{constructor(t){t instanceof di&&(t={context:t});const{context:n,roundPixels:a,...u}=t||{};super({label:"Graphics",...u}),this.renderPipeId="graphics",n?this.context=n:(this.context=this._ownedContext=new di,this.context.autoGarbageCollect=this.autoGarbageCollect),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=a??!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,n){return this.context[t](...n),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 ae(this._context.clone()):(this._ownedContext=null,new ae(this._context))}lineStyle(t,n,a){wt(Qt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const u={};return t&&(u.width=t),n&&(u.color=n),a&&(u.alpha=a),this.context.strokeStyle=u,this}beginFill(t,n){wt(Qt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const a={};return t!==void 0&&(a.color=t),n!==void 0&&(a.alpha=n),this.context.fillStyle=a,this}endFill(){wt(Qt,"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!==di.defaultStrokeStyle.width||t.color!==di.defaultStrokeStyle.color||t.alpha!==di.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...t){return wt(Qt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",t)}drawEllipse(...t){return wt(Qt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",t)}drawPolygon(...t){return wt(Qt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",t)}drawRect(...t){return wt(Qt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",t)}drawRoundedRect(...t){return wt(Qt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",t)}drawStar(...t){return wt(Qt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",t)}}class O2 extends Dh{constructor(t,n){const{text:a,resolution:u,style:o,anchor:c,width:f,height:m,roundPixels:p,...y}=t;super({...y}),this.batched=!0,this._resolution=null,this._autoResolution=!0,this._didTextUpdate=!0,this._styleClass=n,this.text=a??"",this.style=o,this.resolution=u??null,this.allowChildren=!1,this._anchor=new ye({_onUpdate:()=>{this.onViewUpdate()}}),c&&(this.anchor=c),this.roundPixels=p??!1,f!==void 0&&(this.width=f),m!==void 0&&(this.height=m)}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 n;t||(t={}),(n=this._style)==null||n.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,n){typeof t=="object"?(n=t.height??t.width,t=t.width):n??(n=t),t!==void 0&&this._setWidth(t,this.bounds.width),n!==void 0&&this._setHeight(n,this.bounds.height)}containsPoint(t){const n=this.bounds.width,a=this.bounds.height,u=-n*this.anchor.x;let o=0;return t.x>=u&&t.x<=u+n&&(o=-a*this.anchor.y,t.y>=o&&t.y<=o+a)}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 G2(l,t){let n=l[0]??{};return(typeof n=="string"||l[1])&&(wt(Qt,`use new ${t}({ text: "hi!", style }) instead`),n={text:n,style:l[1]}),n}class U2{constructor(t){this._canvasPool=Object.create(null),this.canvasOptions=t||{},this.enableFullScreen=!1}_createCanvasAndContext(t,n){const a=Xe.get().createCanvas();a.width=t,a.height=n;const u=a.getContext("2d");return{canvas:a,context:u}}getOptimalCanvasAndContext(t,n,a=1){t=Math.ceil(t*a-1e-6),n=Math.ceil(n*a-1e-6),t=Ps(t),n=Ps(n);const u=(t<<17)+(n<<1);this._canvasPool[u]||(this._canvasPool[u]=[]);let o=this._canvasPool[u].pop();return o||(o=this._createCanvasAndContext(t,n)),o}returnCanvasAndContext(t){const n=t.canvas,{width:a,height:u}=n,o=(a<<17)+(u<<1);t.context.resetTransform(),t.context.clearRect(0,0,a,u),this._canvasPool[o].push(t)}clear(){this._canvasPool={}}}const wh=new U2;dl.register(wh);let qn=null,qi=null;function N2(l,t){qn||(qn=Xe.get().createCanvas(256,128),qi=qn.getContext("2d",{willReadFrequently:!0}),qi.globalCompositeOperation="copy",qi.globalAlpha=1),(qn.width<l||qn.height<t)&&(qn.width=Ps(l),qn.height=Ps(t))}function cg(l,t,n){for(let a=0,u=4*n*t;a<t;++a,u+=4)if(l[u+3]!==0)return!1;return!0}function hg(l,t,n,a,u){const o=4*t;for(let c=a,f=a*o+4*n;c<=u;++c,f+=o)if(l[f+3]!==0)return!1;return!0}function k2(...l){let t=l[0];t.canvas||(t={canvas:l[0],resolution:l[1]});const{canvas:n}=t,a=Math.min(t.resolution??1,1),u=t.width??n.width,o=t.height??n.height;let c=t.output;if(N2(u,o),!qi)throw new TypeError("Failed to get canvas 2D context");qi.drawImage(n,0,0,u,o,0,0,u*a,o*a);const m=qi.getImageData(0,0,u,o).data;let p=0,y=0,x=u-1,b=o-1;for(;y<o&&cg(m,u,y);)++y;if(y===o)return $t.EMPTY;for(;cg(m,u,b);)--b;for(;hg(m,u,p,y,b);)++p;for(;hg(m,u,x,y,b);)--x;return++x,++b,qi.globalCompositeOperation="source-over",qi.strokeRect(p,y,x-p,b-y),qi.globalCompositeOperation="copy",c??(c=new $t),c.set(p/a,y/a,(x-p)/a,(b-y)/a),c}/**
288
+ * tiny-lru
289
+ *
290
+ * @copyright 2026 Jason Mulligan <jason.mulligan@avoidwork.com>
291
+ * @license BSD-3-Clause
292
+ * @version 11.4.7
293
+ */class H2{constructor(t=0,n=0,a=!1){this.first=null,this.items=Object.create(null),this.last=null,this.max=t,this.resetTtl=a,this.size=0,this.ttl=n}clear(){return this.first=null,this.items=Object.create(null),this.last=null,this.size=0,this}delete(t){if(this.has(t)){const n=this.items[t];delete this.items[t],this.size--,n.prev!==null&&(n.prev.next=n.next),n.next!==null&&(n.next.prev=n.prev),this.first===n&&(this.first=n.next),this.last===n&&(this.last=n.prev)}return this}entries(t=this.keys()){const n=new Array(t.length);for(let a=0;a<t.length;a++){const u=t[a];n[a]=[u,this.get(u)]}return n}evict(t=!1){if(t||this.size>0){const n=this.first;delete this.items[n.key],--this.size===0?(this.first=null,this.last=null):(this.first=n.next,this.first.prev=null)}return this}expiresAt(t){let n;return this.has(t)&&(n=this.items[t].expiry),n}get(t){const n=this.items[t];if(n!==void 0){if(this.ttl>0&&n.expiry<=Date.now()){this.delete(t);return}return this.moveToEnd(n),n.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 n=this.first,a=0;for(;n!==null;)t[a++]=n.key,n=n.next;return t}setWithEvicted(t,n,a=this.resetTtl){let u=null;if(this.has(t))this.set(t,n,!0,a);else{this.max>0&&this.size===this.max&&(u={...this.first},this.evict(!0));let o=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n};++this.size===1?this.first=o:this.last.next=o,this.last=o}return u}set(t,n,a=!1,u=this.resetTtl){let o=this.items[t];return a||o!==void 0?(o.value=n,a===!1&&u&&(o.expiry=this.ttl>0?Date.now()+this.ttl:this.ttl),this.moveToEnd(o)):(this.max>0&&this.size===this.max&&this.evict(!0),o=this.items[t]={expiry:this.ttl>0?Date.now()+this.ttl:this.ttl,key:t,prev:this.last,next:null,value:n},++this.size===1?this.first=o:this.last.next=o,this.last=o),this}values(t=this.keys()){const n=new Array(t.length);for(let a=0;a<t.length;a++)n[a]=this.get(t[a]);return n}}function L2(l=1e3,t=0,n=!1){if(isNaN(l)||l<0)throw new TypeError("Invalid max value");if(isNaN(t)||t<0)throw new TypeError("Invalid ttl value");if(typeof n!="boolean")throw new TypeError("Invalid resetTtl value");return new H2(l,t,n)}function N0(l){return!!l.tagStyles&&Object.keys(l.tagStyles).length>0}function k0(l){return l.includes("<")}function j2(l,t){return l.clone().assign(t)}function Y2(l,t){const n=[],a=t.tagStyles;if(!N0(t)||!k0(l))return n.push({text:l,style:t}),n;const u=[t],o=[];let c="",f=0;for(;f<l.length;){const m=l[f];if(m==="<"){const p=l.indexOf(">",f);if(p===-1){c+=m,f++;continue}const y=l.slice(f+1,p);if(y.startsWith("/")){const x=y.slice(1).trim();if(o.length>0&&o[o.length-1]===x){c.length>0&&(n.push({text:c,style:u[u.length-1]}),c=""),u.pop(),o.pop(),f=p+1;continue}else{c+=l.slice(f,p+1),f=p+1;continue}}else{const x=y.trim();if(a[x]){c.length>0&&(n.push({text:c,style:u[u.length-1]}),c="");const b=u[u.length-1],_=j2(b,a[x]);u.push(_),o.push(x),f=p+1;continue}else{c+=l.slice(f,p+1),f=p+1;continue}}}else c+=m,f++}return c.length>0&&n.push({text:c,style:u[u.length-1]}),n}const q2=[10,13],X2=new Set(q2),V2=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288],P2=new Set(V2),F2=[9,32];new Set(F2);const Q2=[45,8208,8211,8212,173],W2=new Set(Q2),Z2=/(\r\n|\r|\n)/,I2=/(?:\r\n|\r|\n)/;function ao(l){return typeof l!="string"?!1:X2.has(l.charCodeAt(0))}function ii(l,t){return typeof l!="string"?!1:P2.has(l.charCodeAt(0))}function K2(l){return typeof l!="string"?!1:W2.has(l.charCodeAt(0))}function H0(l){return l==="normal"||l==="pre-line"}function L0(l){return l==="normal"}function Yi(l){if(typeof l!="string")return"";let t=l.length-1;for(;t>=0&&ii(l[t]);)t--;return t<l.length-1?l.slice(0,t+1):l}function j0(l){const t=[],n=[];if(typeof l!="string")return t;for(let a=0;a<l.length;a++){const u=l[a],o=l[a+1];if(ii(u)||ao(u)){n.length>0&&(t.push(n.join("")),n.length=0),u==="\r"&&o===`
294
+ `?(t.push(`\r
295
+ `),a++):t.push(u);continue}n.push(u),K2(u)&&o&&!ii(o)&&!ao(o)&&(t.push(n.join("")),n.length=0)}return n.length>0&&t.push(n.join("")),t}function Y0(l,t,n,a){const u=n(l),o=[];for(let c=0;c<u.length;c++){let f=u[c],m=f,p=1;for(;u[c+p];){const y=u[c+p];if(!a(m,y,l,c,t))f+=y,m=y,p++;else break}c+=p-1,o.push(f)}return o}const J2=/\r\n|\r|\n/g;function $2(l,t,n,a,u,o,c,f){var St,R;const m=Y2(l,t);if(L0(t.whiteSpace))for(let L=0;L<m.length;L++){const nt=m[L];m[L]={text:nt.text.replace(J2," "),style:nt.style}}const y=[];let x=[];for(const L of m){const nt=L.text.split(Z2);for(let K=0;K<nt.length;K++){const at=nt[K];at===`\r
296
+ `||at==="\r"||at===`
297
+ `?(y.push(x),x=[]):at.length>0&&x.push({text:at,style:L.style})}}(x.length>0||y.length===0)&&y.push(x);const b=n?tT(y,t,a,u,c,f):y,_=[],T=[],w=[],S=[],A=[];let z=0;const D=t._fontString,G=o(D);G.fontSize===0&&(G.fontSize=t.fontSize,G.ascent=t.fontSize);let P="",N=!!t.dropShadow,O=((St=t._stroke)==null?void 0:St.width)||0;for(const L of b){let nt=0,K=G.ascent,at=G.descent,M="";for(const Q of L){const $=Q.style._fontString,rt=o($);$!==P&&(a.font=$,P=$);const ct=u(Q.text,Q.style.letterSpacing,a);nt+=ct,K=Math.max(K,rt.ascent),at=Math.max(at,rt.descent),M+=Q.text;const ft=((R=Q.style._stroke)==null?void 0:R.width)||0;ft>O&&(O=ft),!N&&Q.style.dropShadow&&(N=!0)}L.length===0&&(K=G.ascent,at=G.descent),_.push(nt),T.push(K),w.push(at),A.push(M);const Y=t.lineHeight||K+at;S.push(Y+t.leading),z=Math.max(z,nt)}const et=O,W=(n&&t.align!=="left"?Math.max(z,t.wordWrapWidth):z)+et+(t.dropShadow?t.dropShadow.distance:0);let I=0;for(let L=0;L<S.length;L++)I+=S[L];I=Math.max(I,S[0]+et);const tt=I+(t.dropShadow?t.dropShadow.distance:0),it=t.lineHeight||G.fontSize;return{width:W,height:tt,lines:A,lineWidths:_,lineHeight:it+t.leading,maxLineWidth:z,fontProperties:G,runsByLine:b,lineAscents:T,lineDescents:w,lineHeights:S,hasDropShadow:N}}function tT(l,t,n,a,u,o){var S;const{letterSpacing:c,whiteSpace:f,wordWrapWidth:m,breakWords:p}=t,y=H0(f),x=m+c,b={};let _="";const T=(A,z)=>{const D=`${A}|${z.styleKey}`;let G=b[D];if(G===void 0){const P=z._fontString;P!==_&&(n.font=P,_=P),G=a(A,z.letterSpacing,n)+z.letterSpacing,b[D]=G}return G},w=[];for(const A of l){const z=eT(A),D=w.length,G=I=>{let tt=0,it=I;do{const{token:St,style:R}=z[it];tt+=T(St,R),it++}while(it<z.length&&z[it].continuesFromPrevious);return tt},P=I=>{const tt=[];let it=I;do tt.push({token:z[it].token,style:z[it].style}),it++;while(it<z.length&&z[it].continuesFromPrevious);return tt};let N=[],O=0,et=!y,Z=null;const X=()=>{Z&&Z.text.length>0&&N.push(Z),Z=null},W=()=>{if(X(),N.length>0){const I=N[N.length-1];I.text=Yi(I.text),I.text.length===0&&N.pop()}w.push(N),N=[],O=0,et=!1};for(let I=0;I<z.length;I++){const{token:tt,style:it,continuesFromPrevious:St}=z[I],R=T(tt,it);if(y){const K=ii(tt),at=(Z==null?void 0:Z.text[Z.text.length-1])??((S=N[N.length-1])==null?void 0:S.text.slice(-1))??"",M=at?ii(at):!1;if(K&&M)continue}const L=!St,nt=L?G(I):R;if(nt>x&&L)if(O>0&&W(),p){const K=P(I);for(let at=0;at<K.length;at++){const M=K[at].token,Y=K[at].style,Q=Y0(M,p,o,u);for(const $ of Q){const rt=T($,Y);rt+O>x&&W(),!Z||Z.style!==Y?(X(),Z={text:$,style:Y}):Z.text+=$,O+=rt}}I+=K.length-1}else{const K=P(I);X(),w.push(K.map(at=>({text:at.token,style:at.style}))),et=!1,I+=K.length-1}else if(nt+O>x&&L){if(ii(tt)){et=!1;continue}W(),Z={text:tt,style:it},O=R}else if(St&&!p)!Z||Z.style!==it?(X(),Z={text:tt,style:it}):Z.text+=tt,O+=R;else{const K=ii(tt);if(O===0&&K&&!et)continue;!Z||Z.style!==it?(X(),Z={text:tt,style:it}):Z.text+=tt,O+=R}}if(X(),N.length>0){const I=N[N.length-1];I.text=Yi(I.text),I.text.length===0&&N.pop()}(N.length>0||w.length===D)&&w.push(N)}return w}function eT(l){const t=[];let n=!1;for(const a of l){const u=j0(a.text);let o=!0;for(const c of u){const f=ii(c)||ao(c),m=o&&n&&!f;t.push({token:c,style:a.style,continuesFromPrevious:m}),n=!f,o=!1}}return t}const iT={willReadFrequently:!0};function fg(l,t,n,a,u){let o=n[l];return typeof o!="number"&&(o=u(l,t,a)+t,n[l]=o),o}function nT(l,t,n,a,u,o,c){const f=n.getContext("2d",iT);f.font=t._fontString;let m=0,p="";const y=[],x=Object.create(null),{letterSpacing:b,whiteSpace:_}=t,T=H0(_),w=L0(_);let S=!T;const A=t.wordWrapWidth+b,z=j0(l);for(let G=0;G<z.length;G++){let P=z[G];if(ao(P)){if(!w){y.push(Yi(p)),S=!T,p="",m=0;continue}P=" "}if(T){const O=ii(P),et=ii(p[p.length-1]);if(O&&et)continue}const N=fg(P,b,x,f,a);if(N>A)if(p!==""&&(y.push(Yi(p)),p="",m=0),u(P,t.breakWords)){const O=Y0(P,t.breakWords,c,o);for(const et of O){const Z=fg(et,b,x,f,a);Z+m>A&&(y.push(Yi(p)),S=!1,p="",m=0),p+=et,m+=Z}}else p.length>0&&(y.push(Yi(p)),p="",m=0),y.push(Yi(P)),S=!1,p="",m=0;else N+m>A&&(S=!1,y.push(Yi(p)),p="",m=0),(p.length>0||!ii(P)||S)&&(p+=P,m+=N)}const D=Yi(p);return D.length>0&&y.push(D),y.join(`
298
+ `)}const dg={willReadFrequently:!0},Fi=class ht{static get experimentalLetterSpacingSupported(){let t=ht._experimentalLetterSpacingSupported;if(t===void 0){const n=Xe.get().getCanvasRenderingContext2D().prototype;t=ht._experimentalLetterSpacingSupported="letterSpacing"in n||"textLetterSpacing"in n}return t}constructor(t,n,a,u,o,c,f,m,p,y){this.text=t,this.style=n,this.width=a,this.height=u,this.lines=o,this.lineWidths=c,this.lineHeight=f,this.maxLineWidth=m,this.fontProperties=p,y&&(this.runsByLine=y.runsByLine,this.lineAscents=y.lineAscents,this.lineDescents=y.lineDescents,this.lineHeights=y.lineHeights,this.hasDropShadow=y.hasDropShadow)}static measureText(t=" ",n,a=ht._canvas,u=n.wordWrap){var P;const o=`${t}-${n.styleKey}-wordWrap-${u}`;if(ht._measurementCache.has(o))return ht._measurementCache.get(o);if(N0(n)&&k0(t)){const N=$2(t,n,u,ht._context,ht._measureText,ht.measureFont,ht.canBreakChars,ht.wordWrapSplit),O=new ht(t,n,N.width,N.height,N.lines,N.lineWidths,N.lineHeight,N.maxLineWidth,N.fontProperties,{runsByLine:N.runsByLine,lineAscents:N.lineAscents,lineDescents:N.lineDescents,lineHeights:N.lineHeights,hasDropShadow:N.hasDropShadow});return ht._measurementCache.set(o,O),O}const f=n._fontString,m=ht.measureFont(f);m.fontSize===0&&(m.fontSize=n.fontSize,m.ascent=n.fontSize,m.descent=0);const p=ht._context;p.font=f;const x=(u?ht._wordWrap(t,n,a):t).split(I2),b=new Array(x.length);let _=0;for(let N=0;N<x.length;N++){const O=ht._measureText(x[N],n.letterSpacing,p);b[N]=O,_=Math.max(_,O)}const T=((P=n._stroke)==null?void 0:P.width)??0,w=n.lineHeight||m.fontSize,S=ht._getAlignWidth(_,n,u),A=ht._adjustWidthForStyle(S,n),z=Math.max(w,m.fontSize+T)+(x.length-1)*(w+n.leading),D=ht._adjustHeightForStyle(z,n),G=new ht(t,n,A,D,x,b,w+n.leading,_,m);return ht._measurementCache.set(o,G),G}static _adjustWidthForStyle(t,n){var o;const a=((o=n._stroke)==null?void 0:o.width)||0;let u=t+a;return n.dropShadow&&(u+=n.dropShadow.distance),u}static _adjustHeightForStyle(t,n){let a=t;return n.dropShadow&&(a+=n.dropShadow.distance),a}static _getAlignWidth(t,n,a){return a&&n.align!=="left"?Math.max(t,n.wordWrapWidth):t}static _measureText(t,n,a){let u=!1;ht.experimentalLetterSpacingSupported&&(ht.experimentalLetterSpacing?(a.letterSpacing=`${n}px`,a.textLetterSpacing=`${n}px`,u=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px"));const o=a.measureText(t);let c=o.width;const f=-(o.actualBoundingBoxLeft??0);let p=(o.actualBoundingBoxRight??0)-f;if(c>0)if(u)c-=n,p-=n;else{const y=(ht.graphemeSegmenter(t).length-1)*n;c+=y,p+=y}return Math.max(c,p)}static _wordWrap(t,n,a=ht._canvas){return nT(t,n,a,ht._measureText,ht.canBreakWords,ht.canBreakChars,ht.wordWrapSplit)}static isBreakingSpace(t,n){return ii(t)}static canBreakWords(t,n){return n}static canBreakChars(t,n,a,u,o){return!0}static wordWrapSplit(t){return ht.graphemeSegmenter(t)}static measureFont(t){if(ht._fonts[t])return ht._fonts[t];const n=ht._context;n.font=t;const a=n.measureText(ht.METRICS_STRING+ht.BASELINE_SYMBOL),u=a.actualBoundingBoxAscent??0,o=a.actualBoundingBoxDescent??0,c={ascent:u,descent:o,fontSize:u+o};return ht._fonts[t]=c,c}static clearMetrics(t=""){t?delete ht._fonts[t]:ht._fonts={}}static get _canvas(){if(!ht.__canvas){let t;try{const n=new OffscreenCanvas(0,0),a=n.getContext("2d",dg);if(a!=null&&a.measureText)return ht.__canvas=n,n;t=Xe.get().createCanvas()}catch{t=Xe.get().createCanvas()}t.width=t.height=10,ht.__canvas=t}return ht.__canvas}static get _context(){return ht.__context||(ht.__context=ht._canvas.getContext("2d",dg)),ht.__context}};Fi.METRICS_STRING="|ÉqÅ";Fi.BASELINE_SYMBOL="M";Fi.BASELINE_MULTIPLIER=1.4;Fi.HEIGHT_MULTIPLIER=2;Fi.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const l=new Intl.Segmenter;return t=>{const n=l.segment(t),a=[];let u=0;for(const o of n)a[u++]=o.segment;return a}}return l=>[...l]})();Fi.experimentalLetterSpacing=!1;Fi._fonts={};Fi._measurementCache=L2(1e3);let bn=Fi;const sT=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function Ah(l){const t=typeof l.fontSize=="number"?`${l.fontSize}px`:l.fontSize;let n=l.fontFamily;Array.isArray(l.fontFamily)||(n=l.fontFamily.split(","));for(let a=n.length-1;a>=0;a--){let u=n[a].trim();!/([\"\'])[^\'\"]+\1/.test(u)&&!sT.includes(u)&&(u=`"${u}"`),n[a]=u}return`${l.fontStyle} ${l.fontVariant} ${l.fontWeight} ${t} ${n.join(",")}`}const mg=1e5;function Zr(l,t,n,a=0,u=0,o=0){if(l.texture===Ut.WHITE&&!l.fill)return re.shared.setValue(l.color).setAlpha(l.alpha??1).toHexa();if(l.fill){if(l.fill instanceof co){const c=l.fill,f=t.createPattern(c.texture.source.resource,"repeat"),m=c.transform.copyTo(vt.shared);return m.scale(c.texture.source.pixelWidth,c.texture.source.pixelHeight),f.setTransform(m),f}else if(l.fill instanceof Pi){const c=l.fill,f=c.type==="linear",m=c.textureSpace==="local";let p=1,y=1;m&&n&&(p=n.width+a,y=n.height+a);let x,b=!1;if(f){const{start:_,end:T}=c;x=t.createLinearGradient(_.x*p+u,_.y*y+o,T.x*p+u,T.y*y+o),b=Math.abs(T.x-_.x)<Math.abs((T.y-_.y)*.1)}else{const{center:_,innerRadius:T,outerCenter:w,outerRadius:S}=c;x=t.createRadialGradient(_.x*p+u,_.y*y+o,T*p,w.x*p+u,w.y*y+o,S*p)}if(b&&m&&n){const _=n.lineHeight/y;for(let T=0;T<n.lines.length;T++){const w=(T*n.lineHeight+a/2)/y;c.colorStops.forEach(S=>{let A=w+S.offset*_;A=Math.max(0,Math.min(1,A)),x.addColorStop(Math.floor(A*mg)/mg,re.shared.setValue(S.color).toHex())})}}else c.colorStops.forEach(_=>{x.addColorStop(_.offset,re.shared.setValue(_.color).toHex())});return x}}else{const c=t.createPattern(l.texture.source.resource,"repeat"),f=l.matrix.copyTo(vt.shared);return f.scale(l.texture.source.pixelWidth,l.texture.source.pixelHeight),c.setTransform(f),c}return Se("FillStyle not recognised",l),"red"}const pg=new $t;function Hs(l){let t=0;for(let n=0;n<l.length;n++)l.charCodeAt(n)===32&&t++;return t}class aT{getCanvasAndContext(t){const{text:n,style:a,resolution:u=1}=t,o=a._getFinalPadding(),c=bn.measureText(n||" ",a),f=Math.ceil(Math.ceil(Math.max(1,c.width)+o*2)*u),m=Math.ceil(Math.ceil(Math.max(1,c.height)+o*2)*u),p=wh.getOptimalCanvasAndContext(f,m);this._renderTextToCanvas(a,o,u,p,c);const y=a.trim?k2({canvas:p.canvas,width:f,height:m,resolution:1,output:pg}):pg.set(0,0,f,m);return{canvasAndContext:p,frame:y}}returnCanvasAndContext(t){wh.returnCanvasAndContext(t)}_renderTextToCanvas(t,n,a,u,o){var N,O,et;if(o.runsByLine&&o.runsByLine.length>0){this._renderTaggedTextToCanvas(o,t,n,a,u);return}const{canvas:c,context:f}=u,m=Ah(t),p=o.lines,y=o.lineHeight,x=o.lineWidths,b=o.maxLineWidth,_=o.fontProperties,T=c.height;if(f.resetTransform(),f.scale(a,a),f.textBaseline=t.textBaseline,(N=t._stroke)!=null&&N.width){const Z=t._stroke;f.lineWidth=Z.width,f.miterLimit=Z.miterLimit,f.lineJoin=Z.join,f.lineCap=Z.cap}f.font=m;let w,S;const A=t.dropShadow?2:1,z=t.wordWrap?Math.max(t.wordWrapWidth,b):b,G=(((O=t._stroke)==null?void 0:O.width)??0)/2;let P=(y-_.fontSize)/2;y-_.fontSize<0&&(P=0);for(let Z=0;Z<A;++Z){const X=t.dropShadow&&Z===0,W=X?Math.ceil(Math.max(1,T)+n*2):0,I=W*a;if(X)this._setupDropShadow(f,t,a,I);else{const tt=t._gradientBounds,it=t._gradientOffset;if(tt){const St={width:tt.width,height:tt.height,lineHeight:tt.height,lines:o.lines};this._setFillAndStrokeStyles(f,t,St,n,G,(it==null?void 0:it.x)??0,(it==null?void 0:it.y)??0)}else it?this._setFillAndStrokeStyles(f,t,o,n,G,it.x,it.y):this._setFillAndStrokeStyles(f,t,o,n,G);f.shadowColor="rgba(0,0,0,0)"}for(let tt=0;tt<p.length;tt++){w=G,S=G+tt*y+_.ascent+P,w+=this._getAlignmentOffset(x[tt],z,t.align);let it=0;if(t.align==="justify"&&t.wordWrap&&tt<p.length-1){const St=Hs(p[tt]);St>0&&(it=(z-x[tt])/St)}(et=t._stroke)!=null&&et.width&&this._drawLetterSpacing(p[tt],t,u,w+n,S+n-W,!0,it),t._fill!==void 0&&this._drawLetterSpacing(p[tt],t,u,w+n,S+n-W,!1,it)}}}_renderTaggedTextToCanvas(t,n,a,u,o){var G,P,N;const{canvas:c,context:f}=o,{runsByLine:m,lineWidths:p,maxLineWidth:y,lineAscents:x,lineHeights:b,hasDropShadow:_}=t,T=c.height;f.resetTransform(),f.scale(u,u),f.textBaseline=n.textBaseline;const w=_?2:1,S=n.wordWrap?Math.max(n.wordWrapWidth,y):y;let A=((G=n._stroke)==null?void 0:G.width)??0;for(const O of m)for(const et of O){const Z=((P=et.style._stroke)==null?void 0:P.width)??0;Z>A&&(A=Z)}const z=A/2,D=[];for(let O=0;O<m.length;O++){const et=m[O],Z=[];for(const X of et){const W=Ah(X.style);f.font=W,Z.push({width:bn._measureText(X.text,X.style.letterSpacing,f),font:W})}D.push(Z)}for(let O=0;O<w;++O){const et=_&&O===0,Z=et?Math.ceil(Math.max(1,T)+a*2):0,X=Z*u;et||(f.shadowColor="rgba(0,0,0,0)");let W=z;for(let I=0;I<m.length;I++){const tt=m[I],it=p[I],St=x[I],R=b[I],L=D[I];let nt=z;nt+=this._getAlignmentOffset(it,S,n.align);let K=0;if(n.align==="justify"&&n.wordWrap&&I<m.length-1){let Y=0;for(const Q of tt)Y+=Hs(Q.text);Y>0&&(K=(S-it)/Y)}const at=W+St;let M=nt+a;for(let Y=0;Y<tt.length;Y++){const Q=tt[Y],{width:$,font:rt}=L[Y];if(f.font=rt,f.textBaseline=Q.style.textBaseline,(N=Q.style._stroke)!=null&&N.width){const ft=Q.style._stroke;if(f.lineWidth=ft.width,f.miterLimit=ft.miterLimit,f.lineJoin=ft.join,f.lineCap=ft.cap,et)if(Q.style.dropShadow)this._setupDropShadow(f,Q.style,u,X);else{const Ht=Hs(Q.text);M+=$+Ht*K;continue}else{const Ht=bn.measureFont(rt),Et=Q.style.lineHeight||Ht.fontSize,Ve={width:$,height:Et,lineHeight:Et,lines:[Q.text]};f.strokeStyle=Zr(ft,f,Ve,a*2,M-a,W)}this._drawLetterSpacing(Q.text,Q.style,o,M,at+a-Z,!0,K)}const ct=Hs(Q.text);M+=$+ct*K}M=nt+a;for(let Y=0;Y<tt.length;Y++){const Q=tt[Y],{width:$,font:rt}=L[Y];if(f.font=rt,f.textBaseline=Q.style.textBaseline,Q.style._fill!==void 0){if(et)if(Q.style.dropShadow)this._setupDropShadow(f,Q.style,u,X);else{const ft=Hs(Q.text);M+=$+ft*K;continue}else{const ft=bn.measureFont(rt),Ht=Q.style.lineHeight||ft.fontSize,Et={width:$,height:Ht,lineHeight:Ht,lines:[Q.text]};f.fillStyle=Zr(Q.style._fill,f,Et,a*2,M-a,W)}this._drawLetterSpacing(Q.text,Q.style,o,M,at+a-Z,!1,K)}const ct=Hs(Q.text);M+=$+ct*K}W+=R}}}_setFillAndStrokeStyles(t,n,a,u,o,c=0,f=0){var m;if(t.fillStyle=n._fill?Zr(n._fill,t,a,u*2,c,f):null,(m=n._stroke)!=null&&m.width){const p=o+u*2;t.strokeStyle=Zr(n._stroke,t,a,p,c,f)}}_setupDropShadow(t,n,a,u){t.fillStyle="black",t.strokeStyle="black";const o=n.dropShadow,c=o.color,f=o.alpha;t.shadowColor=re.shared.setValue(c).setAlpha(f).toRgbaString();const m=o.blur*a,p=o.distance*a;t.shadowBlur=m,t.shadowOffsetX=Math.cos(o.angle)*p,t.shadowOffsetY=Math.sin(o.angle)*p+u}_getAlignmentOffset(t,n,a){return a==="right"?n-t:a==="center"?(n-t)/2:0}_drawLetterSpacing(t,n,a,u,o,c=!1,f=0){const{context:m}=a,p=n.letterSpacing;let y=!1;if(bn.experimentalLetterSpacingSupported&&(bn.experimentalLetterSpacing?(m.letterSpacing=`${p}px`,m.textLetterSpacing=`${p}px`,y=!0):(m.letterSpacing="0px",m.textLetterSpacing="0px")),(p===0||y)&&f===0){c?m.strokeText(t,u,o):m.fillText(t,u,o);return}if(f!==0&&(p===0||y)){const w=t.split(" ");let S=u;const A=m.measureText(" ").width;for(let z=0;z<w.length;z++)c?m.strokeText(w[z],S,o):m.fillText(w[z],S,o),S+=m.measureText(w[z]).width+A+f;return}let x=u;const b=bn.graphemeSegmenter(t);let _=m.measureText(t).width,T=0;for(let w=0;w<b.length;++w){const S=b[w];c?m.strokeText(S,x,o):m.fillText(S,x,o);let A="";for(let z=w+1;z<b.length;++z)A+=b[z];T=m.measureText(A).width,x+=_-T+p,S===" "&&(x+=f),_=T}}}const Vs=new aT,Xh=class Wn extends vi{constructor(t={}){super(),this.uid=Wt("textStyle"),this._tick=0,this._cachedFontString=null,lT(t),t instanceof Wn&&(t=t._toObject());const u={...Wn.defaultTextStyle,...t};for(const o in u){const c=o;this[c]=u[o]}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({...Wn.defaultDropShadow,...t}):this._dropShadow=t?this._createProxy({...Wn.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({...di.defaultFillStyle,...t},()=>{this._fill=In({...this._originalFill},di.defaultFillStyle)})),this._fill=In(t===0?"black":t,di.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(t){t!==this._originalStroke&&(this._originalStroke=t,this._isFillStyle(t)&&(this._originalStroke=this._createProxy({...di.defaultStrokeStyle,...t},()=>{this._stroke=so({...this._originalStroke},di.defaultStrokeStyle)})),this._stroke=so(t,di.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=Wn.defaultTextStyle;for(const n in t)this[n]=t[n]}assign(t){for(const n in t){const a=n;this[a]=t[n]}return this}get styleKey(){return`${this.uid}-${this._tick}`}get _fontString(){return this._cachedFontString===null&&(this._cachedFontString=Ah(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 Wn(this._toObject())}_getFinalPadding(){let t=0;if(this._filters)for(let n=0;n<this._filters.length;n++)t+=this._filters[n].padding;return Math.max(this._padding,t)}destroy(t=!1){var a,u,o,c;if(this.removeAllListeners(),typeof t=="boolean"?t:t==null?void 0:t.texture){const f=typeof t=="boolean"?t:t==null?void 0:t.textureSource;(a=this._fill)!=null&&a.texture&&this._fill.texture.destroy(f),(u=this._originalFill)!=null&&u.texture&&this._originalFill.texture.destroy(f),(o=this._stroke)!=null&&o.texture&&this._stroke.texture.destroy(f),(c=this._originalStroke)!=null&&c.texture&&this._originalStroke.texture.destroy(f)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(t,n){return new Proxy(t,{set:(a,u,o)=>(a[u]===o||(a[u]=o,n==null||n(u,o),this.update()),!0)})}_isFillStyle(t){return(t??null)!==null&&!(re.isColorLike(t)||t instanceof Pi||t instanceof co)}};Xh.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5};Xh.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 Sn=Xh;function lT(l){const t=l;if(typeof t.dropShadow=="boolean"&&t.dropShadow){const n=Sn.defaultDropShadow;l.dropShadow={alpha:t.dropShadowAlpha??n.alpha,angle:t.dropShadowAngle??n.angle,blur:t.dropShadowBlur??n.blur,color:t.dropShadowColor??n.color,distance:t.dropShadowDistance??n.distance}}if(t.strokeThickness!==void 0){wt(Qt,"strokeThickness is now a part of stroke");const n=t.stroke;let a={};if(re.isColorLike(n))a.color=n;else if(n instanceof Pi||n instanceof co)a.fill=n;else if(Object.hasOwnProperty.call(n,"color")||Object.hasOwnProperty.call(n,"fill"))a=n;else throw new Error("Invalid stroke value.");l.stroke={...a,width:t.strokeThickness}}if(Array.isArray(t.fillGradientStops)){if(wt(Qt,"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&&Se("The number of fill colors must match the number of fill gradient stops.");const n=new Pi({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),a=t.fillGradientStops.slice(),u=t.fill.map(o=>re.shared.setValue(o).toNumber());a.forEach((o,c)=>{n.addColorStop(o,u[c])}),l.fill={fill:n}}}function rT(l,t){const{texture:n,bounds:a}=l,u=t._style._getFinalPadding();Ag(a,t._anchor,n);const o=t._anchor._x*u*2,c=t._anchor._y*u*2;a.minX-=u-o,a.minY-=u-c,a.maxX-=u-o,a.maxY-=u-c}class oT{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 uT extends oT{}class q0{constructor(t){this._renderer=t,t.runners.resolutionChange.add(this),this._managedTexts=new ml({renderer:t,type:"renderable",onUnload:this.onTextUnload.bind(this),name:"canvasText"})}resolutionChange(){for(const t in this._managedTexts.items){const n=this._managedTexts.items[t];n!=null&&n._autoResolution&&n.onViewUpdate()}}validateRenderable(t){const n=this._getGpuText(t),a=t.styleKey;return n.currentKey!==a?!0:t._didTextUpdate}addRenderable(t,n){const a=this._getGpuText(t);if(t._didTextUpdate){const u=t._autoResolution?this._renderer.resolution:t.resolution;(a.currentKey!==t.styleKey||t._resolution!==u)&&this._updateGpuText(t),t._didTextUpdate=!1,rT(a,t)}this._renderer.renderPipes.batch.addToBatch(a,n)}updateRenderable(t){const n=this._getGpuText(t);n._batcher.updateElement(n)}_updateGpuText(t){const n=this._getGpuText(t);n.texture&&this._renderer.canvasText.decreaseReferenceCount(n.currentKey),t._resolution=t._autoResolution?this._renderer.resolution:t.resolution,n.texture=this._renderer.canvasText.getManagedTexture(t),n.currentKey=t.styleKey}_getGpuText(t){return t._gpuData[this._renderer.uid]||this.initGpuText(t)}initGpuText(t){const n=new uT;return n.currentKey="--",n.renderable=t,n.transform=t.groupTransform,n.bounds={minX:0,maxX:1,minY:0,maxY:0},n.roundPixels=this._renderer._roundPixels|t._roundPixels,t._gpuData[this._renderer.uid]=n,this._managedTexts.add(t),n}onTextUnload(t){const n=t._gpuData[this._renderer.uid];if(!n)return;const{canvasText:a}=this._renderer;a.getReferenceCount(n.currentKey)>0?a.decreaseReferenceCount(n.currentKey):n.texture&&a.returnTexture(n.texture)}destroy(){this._managedTexts.destroy(),this._renderer=null}}q0.extension={type:[yt.WebGLPipes,yt.WebGPUPipes,yt.CanvasPipes],name:"text"};const cT=new si;function hT(l,t,n,a,u=!1){const o=cT;o.minX=0,o.minY=0,o.maxX=l.width/a|0,o.maxY=l.height/a|0;const c=lo.getOptimalTexture(o.width,o.height,a,!1,u);return c.source.uploadMethodId="image",c.source.resource=l,c.source.alphaMode="premultiply-alpha-on-upload",c.frame.width=t/a,c.frame.height=n/a,c.source.emit("update",c.source),c.updateUvs(),c}class X0{constructor(t,n){this._activeTextures={},this._renderer=t,this._retainCanvasContext=n}getTexture(t,n,a,u){typeof t=="string"&&(wt("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),t={text:t,style:a,resolution:n}),t.style instanceof Sn||(t.style=new Sn(t.style)),t.textureStyle instanceof Fs||(t.textureStyle=new Fs(t.textureStyle)),typeof t.text!="string"&&(t.text=t.text.toString());const{text:o,style:c,textureStyle:f,autoGenerateMipmaps:m}=t,p=t.resolution??this._renderer.resolution,{frame:y,canvasAndContext:x}=Vs.getCanvasAndContext({text:o,style:c,resolution:p}),b=hT(x.canvas,y.width,y.height,p,m);if(f&&(b.source.style=f),c.trim&&(y.pad(c.padding),b.frame.copyFrom(y),b.frame.scale(1/p),b.updateUvs()),c.filters){const _=this._applyFilters(b,c.filters);return this.returnTexture(b),Vs.returnCanvasAndContext(x),_}return this._renderer.texture.initSource(b._source),this._retainCanvasContext||Vs.returnCanvasAndContext(x),b}returnTexture(t){const n=t.source,a=n.resource;if(this._retainCanvasContext&&(a!=null&&a.getContext)){const u=a.getContext("2d");u&&Vs.returnCanvasAndContext({canvas:a,context:u})}n.resource=null,n.uploadMethodId="unknown",n.alphaMode="no-premultiply-alpha",lo.returnTexture(t,!0)}renderTextToCanvas(){wt("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}getManagedTexture(t){t._resolution=t._autoResolution?this._renderer.resolution:t.resolution;const n=t.styleKey;if(this._activeTextures[n])return this._increaseReferenceCount(n),this._activeTextures[n].texture;const a=this.getTexture({text:t.text,style:t.style,resolution:t._resolution,textureStyle:t.textureStyle,autoGenerateMipmaps:t.autoGenerateMipmaps});return this._activeTextures[n]={texture:a,usageCount:1},a}decreaseReferenceCount(t){const n=this._activeTextures[t];n&&(n.usageCount--,n.usageCount===0&&(this.returnTexture(n.texture),this._activeTextures[t]=null))}getReferenceCount(t){var n;return((n=this._activeTextures[t])==null?void 0:n.usageCount)??0}_increaseReferenceCount(t){this._activeTextures[t].usageCount++}_applyFilters(t,n){const a=this._renderer.renderTarget.renderTarget,u=this._renderer.filter.generateFilteredTexture({texture:t,filters:n});return this._renderer.renderTarget.bind(a,!1),u}destroy(){this._renderer=null;for(const t in this._activeTextures)this._activeTextures[t]&&this.returnTexture(this._activeTextures[t].texture);this._activeTextures=null}}class V0 extends X0{constructor(t){super(t,!0)}}V0.extension={type:[yt.CanvasSystem],name:"canvasText"};class P0 extends X0{constructor(t){super(t,!1)}}P0.extension={type:[yt.WebGLSystem,yt.WebGPUSystem],name:"canvasText"};te.add(V0);te.add(P0);te.add(q0);class to extends O2{constructor(...t){const n=G2(t,"Text");super(n,Sn),this.renderPipeId="text",n.textureStyle&&(this.textureStyle=n.textureStyle instanceof Fs?n.textureStyle:new Fs(n.textureStyle)),this.autoGenerateMipmaps=n.autoGenerateMipmaps??li.defaultOptions.autoGenerateMipmaps}updateBounds(){const t=this._bounds,n=this._anchor;let a=0,u=0;if(this._style.trim){const{frame:o,canvasAndContext:c}=Vs.getCanvasAndContext({text:this.text,style:this._style,resolution:1});Vs.returnCanvasAndContext(c),a=o.width,u=o.height}else{const o=bn.measureText(this._text,this._style);a=o.width,u=o.height}t.minX=-n._x*a,t.maxX=t.minX+a,t.minY=-n._y*u,t.maxY=t.minY+u}}te.add(k1,H1);const tl=64,Zn=32;function Ft(l,t){return{x:(l-t)*(tl/2),y:(l+t)*(Zn/2)}}const Ys=[{id:"ceo-office",label:"CEO Office",col:0,row:0,w:4,h:3,color:"#ffd700",floorColor:"#2a2010",wallColor:"#3d3018",icon:"👑"},{id:"cto-office",label:"CTO Office",col:5,row:0,w:4,h:3,color:"#00bfff",floorColor:"#0f1e28",wallColor:"#183040",icon:"🔬"},{id:"arch-lab",label:"Arch Lab",col:10,row:0,w:4,h:3,color:"#b57edc",floorColor:"#1e1028",wallColor:"#2d1840",icon:"🏛️"},{id:"dev-bullpen",label:"Dev Bullpen",col:0,row:4,w:6,h:4,color:"#50c878",floorColor:"#102a18",wallColor:"#184020",icon:"⚡"},{id:"qa-lab",label:"QA Lab",col:7,row:4,w:4,h:4,color:"#ff8c00",floorColor:"#281a08",wallColor:"#402810",icon:"🔍"},{id:"design-studio",label:"Design Studio",col:12,row:4,w:4,h:4,color:"#8a2be2",floorColor:"#1a1028",wallColor:"#2a1840",icon:"🎨"},{id:"data-lab",label:"Data Lab",col:0,row:9,w:4,h:3,color:"#708090",floorColor:"#181c20",wallColor:"#283038",icon:"📊"},{id:"meeting-room",label:"Meeting Room",col:5,row:9,w:5,h:3,color:"#4169e1",floorColor:"#101828",wallColor:"#182840",icon:"🤝"},{id:"lounge",label:"Lounge",col:11,row:9,w:5,h:3,color:"#00ced1",floorColor:"#0a2028",wallColor:"#103038",icon:"☕"},{id:"crisis-room",label:"Crisis Room",col:5,row:13,w:5,h:3,color:"#dc143c",floorColor:"#280a0a",wallColor:"#401010",icon:"🚨"}],F0=[{room:"ceo-office",seat:0,col:2,row:1},{room:"cto-office",seat:0,col:7,row:1},{room:"arch-lab",seat:0,col:12,row:1},{room:"dev-bullpen",seat:0,col:2,row:5},{room:"dev-bullpen",seat:1,col:4,row:6},{room:"qa-lab",seat:0,col:8,row:5},{room:"qa-lab",seat:1,col:10,row:6},{room:"design-studio",seat:0,col:13,row:5},{room:"design-studio",seat:1,col:15,row:6},{room:"data-lab",seat:0,col:2,row:10},{room:"meeting-room",seat:0,col:7,row:10},{room:"lounge",seat:0,col:13,row:10},{room:"crisis-room",seat:0,col:7,row:14}],fT=[{room:"ceo-office",type:"desk",col:1.5,row:1},{room:"ceo-office",type:"monitor",col:1.8,row:.8},{room:"ceo-office",type:"plant",col:.5,row:.3},{room:"ceo-office",type:"shelf",col:3.2,row:.3},{room:"cto-office",type:"desk",col:6.5,row:1},{room:"cto-office",type:"monitor",col:6.8,row:.8},{room:"cto-office",type:"monitor",col:7.3,row:.8},{room:"cto-office",type:"server",col:8.3,row:.3},{room:"arch-lab",type:"desk",col:11.5,row:1},{room:"arch-lab",type:"monitor",col:11.8,row:.8},{room:"arch-lab",type:"whiteboard",col:13,row:.3},{room:"dev-bullpen",type:"desk",col:1.5,row:5},{room:"dev-bullpen",type:"monitor",col:1.8,row:4.8},{room:"dev-bullpen",type:"desk",col:3.5,row:6},{room:"dev-bullpen",type:"monitor",col:3.8,row:5.8},{room:"dev-bullpen",type:"plant",col:5,row:4.3},{room:"qa-lab",type:"desk",col:7.5,row:5},{room:"qa-lab",type:"monitor",col:7.8,row:4.8},{room:"qa-lab",type:"desk",col:9.5,row:6},{room:"qa-lab",type:"monitor",col:9.8,row:5.8},{room:"qa-lab",type:"server",col:10.5,row:4.3},{room:"design-studio",type:"desk",col:12.5,row:5},{room:"design-studio",type:"monitor",col:12.8,row:4.8},{room:"design-studio",type:"desk",col:14.5,row:6},{room:"design-studio",type:"whiteboard",col:15,row:4.3},{room:"data-lab",type:"desk",col:1.5,row:10},{room:"data-lab",type:"monitor",col:1.8,row:9.8},{room:"data-lab",type:"server",col:3,row:9.3},{room:"data-lab",type:"server",col:3.5,row:9.3},{room:"meeting-room",type:"table",col:7,row:10},{room:"meeting-room",type:"whiteboard",col:5.5,row:9.3},{room:"meeting-room",type:"plant",col:9.2,row:9.3},{room:"lounge",type:"couch",col:12,row:10},{room:"lounge",type:"couch",col:14,row:10},{room:"lounge",type:"coffee",col:13,row:10.5},{room:"lounge",type:"plant",col:15,row:9.3},{room:"lounge",type:"plant",col:11.3,row:9.3},{room:"crisis-room",type:"table",col:7,row:14},{room:"crisis-room",type:"monitor",col:5.5,row:13.3},{room:"crisis-room",type:"monitor",col:6.5,row:13.3},{room:"crisis-room",type:"monitor",col:7.5,row:13.3}];function Q0(l,t){return F0.find(n=>n.room===l&&n.seat===t)}const yg={sage:16766720,nova:49151,aria:11894492,dex:5294200,flux:4286945,quinn:16747520,gage:2142890,morgan:16738740,uma:9055202,river:52945,atlas:7372944},dT={sage:15782048,nova:13935988,aria:16111299,dex:13010498,flux:15782048,quinn:14729376,gage:13010498,morgan:16111299,uma:13935988,river:15782048,atlas:14729376},mT={sage:2763306,nova:1710650,aria:9062954,dex:1710618,flux:3815962,quinn:4860442,gage:1710618,morgan:6957594,uma:2759226,river:3815994,atlas:5921370},pT={sage:"👑",nova:"🔬",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"🚀",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},yT={coding:65416,reviewing:49151,testing:10181046,planning:16766720,blocked:16729156,deploying:16739125,thinking:13421772};class gT{constructor(t){Kt(this,"container");Kt(this,"body");Kt(this,"glow");Kt(this,"statusRing");Kt(this,"statusLabel");Kt(this,"label");Kt(this,"emojiLabel");Kt(this,"shadow");Kt(this,"bobOffset",Math.random()*Math.PI*2);Kt(this,"targetX",0);Kt(this,"targetY",0);Kt(this,"currentX",0);Kt(this,"currentY",0);Kt(this,"lastStatus","");this.container=new ai,this.container.sortableChildren=!0;const n=yg[t.id]||13421772;this.shadow=new ae,this.shadow.ellipse(0,8,10,4),this.shadow.fill({color:0,alpha:.35}),this.shadow.zIndex=0,this.container.addChild(this.shadow),this.glow=new ae,this.glow.zIndex=1,this.glow.visible=!1,this.container.addChild(this.glow),this.body=new ae,this.drawPerson(this.body,t.id),this.body.zIndex=2,this.container.addChild(this.body),this.statusRing=new ae,this.statusRing.zIndex=3,this.statusRing.visible=!1,this.container.addChild(this.statusRing),this.emojiLabel=new to({text:pT[t.id]||"●",style:new Sn({fontSize:14,fontFamily:"Apple Color Emoji, Segoe UI Emoji, sans-serif"})}),this.emojiLabel.anchor.set(.5,.5),this.emojiLabel.y=-30,this.emojiLabel.zIndex=4,this.container.addChild(this.emojiLabel),this.label=new to({text:t.name,style:new Sn({fontSize:8,fill:n,fontFamily:"'Segoe UI', Arial, sans-serif",fontWeight:"700",letterSpacing:.5,dropShadow:{color:"#000000",blur:4,distance:0}})}),this.label.anchor.set(.5,0),this.label.y=13,this.label.zIndex=5,this.container.addChild(this.label),this.statusLabel=new to({text:"",style:new Sn({fontSize:7,fill:8947848,fontFamily:"'Segoe UI', Arial, sans-serif",fontWeight:"400",dropShadow:{color:"#000000",blur:3,distance:0}})}),this.statusLabel.anchor.set(.5,0),this.statusLabel.y=22,this.statusLabel.zIndex=5,this.statusLabel.visible=!1,this.container.addChild(this.statusLabel),this.setPositionFromRoom(t.position_room,t.position_seat),this.currentX=this.targetX,this.currentY=this.targetY,this.container.x=this.currentX,this.container.y=this.currentY}drawPerson(t,n){const a=yg[n]||13421772,u=dT[n]||15782048,o=mT[n]||2763306;t.circle(0,-15,5.5),t.fill({color:o,alpha:.9}),t.circle(0,-14,5),t.fill({color:u}),t.stroke({color:Ir(u,.2),width:.5,alpha:.4}),t.circle(-1.5,-14.5,.6),t.fill({color:2236962,alpha:.8}),t.circle(1.5,-14.5,.6),t.fill({color:2236962,alpha:.8}),t.rect(-1.5,-9.5,3,2),t.fill({color:u,alpha:.9}),t.poly([{x:-7,y:-8},{x:7,y:-8},{x:6,y:3},{x:-6,y:3}]),t.fill({color:a}),t.poly([{x:-3,y:-8},{x:0,y:-6},{x:3,y:-8}]),t.fill({color:Ir(a,.15),alpha:.5}),t.poly([{x:-7,y:-8},{x:-1,y:-8},{x:-1,y:3},{x:-6,y:3}]),t.fill({color:0,alpha:.1}),t.poly([{x:-7,y:-7},{x:-9,y:-5},{x:-8,y:0},{x:-6,y:0}]),t.fill({color:Ir(a,.1)}),t.circle(-7,.5,1.5),t.fill({color:u,alpha:.9}),t.poly([{x:7,y:-7},{x:9,y:-5},{x:8,y:0},{x:6,y:0}]),t.fill({color:Ir(a,.1)}),t.circle(7,.5,1.5),t.fill({color:u,alpha:.9}),t.poly([{x:-5,y:3},{x:-1,y:3},{x:-1.5,y:10},{x:-5,y:10}]),t.fill({color:2236979,alpha:.9}),t.poly([{x:1,y:3},{x:5,y:3},{x:5,y:10},{x:1.5,y:10}]),t.fill({color:2763322,alpha:.9}),t.ellipse(-3,10.5,2.5,1.2),t.fill({color:1710618,alpha:.8}),t.ellipse(3,10.5,2.5,1.2),t.fill({color:1710618,alpha:.8})}setPositionFromRoom(t,n){const a=Q0(t,n);if(a){const u=Ft(a.col,a.row);this.targetX=u.x,this.targetY=u.y}}update(t){this.setPositionFromRoom(t.position_room,t.position_seat);const n=this.targetX-this.currentX,a=this.targetY-this.currentY,u=Math.sqrt(n*n+a*a);if(u>1){const y=Math.min(u*.08,3);this.currentX+=n/u*y,this.currentY+=a/u*y}else this.currentX=this.targetX,this.currentY=this.targetY;this.bobOffset+=.03;const o=t.status!=="idle",c=o?0:Math.sin(this.bobOffset)*1,f=o?Math.sin(this.bobOffset*3)*.6:0;this.container.x=this.currentX,this.container.y=this.currentY+c+f,this.container.zIndex=this.currentY+100,this.shadow.clear();const m=o?.85:1;this.shadow.ellipse(0,8,10*m,4*m),this.shadow.fill({color:0,alpha:o?.25:.35});const p=yT[t.status];if(p&&o){this.glow.visible=!0,this.glow.clear();const y=16+Math.sin(this.bobOffset*2)*3;this.glow.circle(0,-4,y),this.glow.fill({color:p,alpha:.1+Math.sin(this.bobOffset*2)*.05}),this.glow.circle(0,-4,y*.6),this.glow.fill({color:p,alpha:.06}),this.statusRing.visible=!0,this.statusRing.clear(),this.statusRing.ellipse(0,8,10,4),this.statusRing.stroke({color:p,width:1.5,alpha:.35+Math.sin(this.bobOffset*2)*.15}),this.statusRing.ellipse(0,8,7,3),this.statusRing.stroke({color:p,width:.5,alpha:.2})}else this.glow.visible=!1,this.statusRing.visible=!1;o&&t.status!==this.lastStatus?(this.statusLabel.text=t.status,this.statusLabel.style.fill=p||8947848,this.statusLabel.visible=!0):o||(this.statusLabel.visible=!1),this.lastStatus=t.status}}function Ir(l,t){const n=Math.max(0,(l>>16&255)*(1-t)),a=Math.max(0,(l>>8&255)*(1-t)),u=Math.max(0,(l&255)*(1-t));return Math.round(n)<<16|Math.round(a)<<8|Math.round(u)}const Jt=24,Kr=3;class xT{constructor(){Kt(this,"app");Kt(this,"world");Kt(this,"agentSprites",new Map);Kt(this,"initialized",!1);this.app=new x0,this.world=new ai}async init(t){this.initialized||(this.initialized=!0,await this.app.init({canvas:t,resizeTo:t.parentElement,background:394766,antialias:!0,autoDensity:!0,resolution:window.devicePixelRatio||1}),this.app.stage.addChild(this.world),this.world.sortableChildren=!0,this.centerCamera(),this.drawAmbient(),this.drawRooms(),window.addEventListener("resize",()=>this.centerCamera()))}centerCamera(){const t=this.app.screen.width,n=this.app.screen.height,a=Ft(8,8);this.world.x=t/2-a.x,this.world.y=n/3.2-a.y}drawAmbient(){const t=new ae,n=Ft(8,8);t.ellipse(n.x,n.y+20,450,200),t.fill({color:659488,alpha:.5}),t.zIndex=-10,this.world.addChild(t)}drawRooms(){for(const t of Ys)this.drawRoom(t)}drawRoom(t){const n=new ai;n.sortableChildren=!0;const a=Ft(t.col,t.row);n.zIndex=a.y;const u=parseInt(t.floorColor.slice(1),16),o=parseInt(t.wallColor.slice(1),16),c=parseInt(t.color.slice(1),16),f=Ft(t.col,t.row),m=Ft(t.col+t.w,t.row),p=Ft(t.col+t.w,t.row+t.h),y=Ft(t.col,t.row+t.h),x=new ae;x.poly([{x:f.x,y:f.y+3},{x:m.x,y:m.y+3},{x:p.x,y:p.y+3},{x:y.x,y:y.y+3}]),x.fill({color:0,alpha:.35}),x.zIndex=-2,n.addChild(x);for(let X=0;X<t.w;X++)for(let W=0;W<t.h;W++){const I=Ft(t.col+X,t.row+W),tt=new ae,it=(X+W)%2===0,St=it?1:.82;tt.poly([{x:0,y:0},{x:tl/2,y:Zn/2},{x:0,y:Zn},{x:-tl/2,y:Zn/2}]),tt.fill({color:u,alpha:St}),it&&(tt.poly([{x:0,y:2},{x:tl/2-3,y:Zn/2},{x:0,y:Zn-2},{x:-tl/2+3,y:Zn/2}]),tt.fill({color:16777215,alpha:.03})),tt.x=I.x,tt.y=I.y,n.addChild(tt)}const b=new ae;b.poly([{x:f.x,y:f.y},{x:f.x,y:f.y-Jt},{x:y.x,y:y.y-Jt},{x:y.x,y:y.y}]),b.fill({color:o,alpha:.8});for(let X=1;X<4;X++){const W=f.y-Jt+Jt/4*X,I=y.y-Jt+Jt/4*X;b.moveTo(f.x,W),b.lineTo(y.x,I),b.stroke({color:0,width:.5,alpha:.15})}b.zIndex=-1,n.addChild(b);const _=new ae;_.poly([{x:f.x,y:f.y-Jt},{x:f.x+Kr,y:f.y-Jt-1},{x:y.x+Kr,y:y.y-Jt-1},{x:y.x,y:y.y-Jt}]),_.fill({color:c,alpha:.25}),_.zIndex=-1,n.addChild(_);const T=new ae;T.poly([{x:f.x,y:f.y},{x:f.x,y:f.y-Jt},{x:m.x,y:m.y-Jt},{x:m.x,y:m.y}]),T.fill({color:o,alpha:.55});for(let X=1;X<4;X++){const W=f.y-Jt+Jt/4*X,I=m.y-Jt+Jt/4*X;T.moveTo(f.x,W),T.lineTo(m.x,I),T.stroke({color:0,width:.5,alpha:.1})}T.zIndex=-1,n.addChild(T);const w=new ae;w.poly([{x:f.x,y:f.y-Jt},{x:f.x,y:f.y-Jt-Kr},{x:m.x,y:m.y-Jt-Kr},{x:m.x,y:m.y-Jt}]),w.fill({color:c,alpha:.2}),w.zIndex=-1,n.addChild(w);const S=new ae;S.poly([f,m,p,y]),S.stroke({color:c,width:1.5,alpha:.3}),n.addChild(S);const A=Ft(t.col+.15,t.row+.15),z=Ft(t.col+t.w-.15,t.row+.15),D=Ft(t.col+t.w-.15,t.row+t.h-.15),G=Ft(t.col+.15,t.row+t.h-.15),P=new ae;P.poly([A,z,D,G]),P.stroke({color:c,width:.5,alpha:.12}),n.addChild(P);for(const X of[f,m,p,y]){const W=new ae;W.circle(X.x,X.y,4),W.fill({color:c,alpha:.15}),W.circle(X.x,X.y,1.5),W.fill({color:c,alpha:.7}),n.addChild(W)}const N=Ft(t.col+t.w/2,t.row+.3),O=new to({text:`${t.icon} ${t.label.toUpperCase()}`,style:new Sn({fontSize:9,fill:t.color,fontFamily:"'Segoe UI', 'Helvetica Neue', Arial, sans-serif",fontWeight:"700",letterSpacing:2,align:"center",dropShadow:{color:"#000000",blur:6,distance:0}})});O.anchor.set(.5,.5),O.x=N.x,O.y=N.y-Jt-6,O.alpha=.75,n.addChild(O);const et=fT.filter(X=>X.room===t.id);for(const X of et)this.drawFurniture(n,X,c,t);const Z=F0.filter(X=>X.room===t.id);for(const X of Z){const W=Ft(X.col,X.row),I=new ae;I.circle(W.x,W.y+2,6),I.fill({color:c,alpha:.06}),I.circle(W.x,W.y+2,3),I.fill({color:c,alpha:.08}),n.addChild(I)}this.world.addChild(n)}drawFurniture(t,n,a,u){const o=Ft(n.col,n.row),c=new ae;switch(n.type){case"desk":{c.poly([{x:o.x+2,y:o.y-3},{x:o.x+22,y:o.y+7},{x:o.x+2,y:o.y+17},{x:o.x-18,y:o.y+7}]),c.fill({color:0,alpha:.2}),c.poly([{x:o.x,y:o.y-6},{x:o.x+22,y:o.y+5},{x:o.x,y:o.y+16},{x:o.x-22,y:o.y+5}]),c.fill({color:4864040,alpha:.95}),c.poly([{x:o.x,y:o.y-5},{x:o.x+18,y:o.y+4},{x:o.x,y:o.y+13},{x:o.x-18,y:o.y+4}]),c.fill({color:5916728,alpha:.5}),c.poly([{x:o.x+22,y:o.y+5},{x:o.x,y:o.y+16},{x:o.x,y:o.y+19},{x:o.x+22,y:o.y+8}]),c.fill({color:3811352,alpha:.9}),c.poly([{x:o.x,y:o.y+16},{x:o.x-22,y:o.y+5},{x:o.x-22,y:o.y+8},{x:o.x,y:o.y+19}]),c.fill({color:2758664,alpha:.9}),c.rect(o.x+16,o.y+6,2,8),c.fill({color:2758664,alpha:.7}),c.rect(o.x-18,o.y+6,2,8),c.fill({color:2758664,alpha:.7});break}case"monitor":{c.rect(o.x-7,o.y-16,14,11),c.fill({color:1118481,alpha:.95}),c.stroke({color:3355443,width:.5,alpha:.5}),c.rect(o.x-6,o.y-15,12,9),c.fill({color:662058,alpha:.95});const f=[a,65416,49151,16766720];for(let m=0;m<4;m++){const p=3+Math.random()*6;c.rect(o.x-5,o.y-14+m*2,p,1),c.fill({color:f[m%f.length],alpha:.4+Math.random()*.3})}c.rect(o.x-6,o.y-15,12,9),c.fill({color:a,alpha:.06}),c.poly([{x:o.x-1,y:o.y-5},{x:o.x+1,y:o.y-5},{x:o.x+2,y:o.y-1},{x:o.x-2,y:o.y-1}]),c.fill({color:2236962,alpha:.9}),c.ellipse(o.x,o.y-1,4,1.5),c.fill({color:2236962,alpha:.8});break}case"chair":{c.ellipse(o.x,o.y+1,5,3),c.fill({color:2763322,alpha:.7}),c.rect(o.x-4,o.y-4,8,2),c.fill({color:2236976,alpha:.6});for(let f=0;f<5;f++){const m=f/5*Math.PI+Math.PI;c.circle(o.x+Math.cos(m)*5,o.y+4+Math.sin(m)*2,.8),c.fill({color:3355456,alpha:.5})}break}case"table":{c.poly([{x:o.x+2,y:o.y-3},{x:o.x+32,y:o.y+11},{x:o.x+2,y:o.y+25},{x:o.x-28,y:o.y+11}]),c.fill({color:0,alpha:.2}),c.poly([{x:o.x,y:o.y-6},{x:o.x+30,y:o.y+9},{x:o.x,y:o.y+24},{x:o.x-30,y:o.y+9}]),c.fill({color:3814696,alpha:.9}),c.stroke({color:4867384,width:.5,alpha:.3}),c.poly([{x:o.x-20,y:o.y+4},{x:o.x+20,y:o.y+4},{x:o.x+18,y:o.y+6},{x:o.x-18,y:o.y+6}]),c.fill({color:16777215,alpha:.04}),c.poly([{x:o.x+30,y:o.y+9},{x:o.x,y:o.y+24},{x:o.x,y:o.y+27},{x:o.x+30,y:o.y+12}]),c.fill({color:2762008,alpha:.8});break}case"plant":{c.ellipse(o.x,o.y+9,5,2),c.fill({color:0,alpha:.2}),c.poly([{x:o.x-5,y:o.y+2},{x:o.x+5,y:o.y+2},{x:o.x+4,y:o.y+9},{x:o.x-4,y:o.y+9}]),c.fill({color:8014378,alpha:.9}),c.poly([{x:o.x-5.5,y:o.y+1},{x:o.x+5.5,y:o.y+1},{x:o.x+5,y:o.y+3},{x:o.x-5,y:o.y+3}]),c.fill({color:9067066,alpha:.9}),c.ellipse(o.x,o.y+2,4,1.5),c.fill({color:3811866,alpha:.8}),c.circle(o.x+4,o.y-1,5),c.fill({color:1727018,alpha:.7}),c.circle(o.x-4,o.y,4.5),c.fill({color:1993530,alpha:.75}),c.circle(o.x,o.y-4,6),c.fill({color:2984526,alpha:.85}),c.circle(o.x+2,o.y-6,4),c.fill({color:3908957,alpha:.8}),c.circle(o.x-2,o.y-3,3.5),c.fill({color:4569192,alpha:.7}),c.circle(o.x+1,o.y-5,2),c.fill({color:6281338,alpha:.3});break}case"shelf":{c.rect(o.x-11,o.y-11,22,20),c.fill({color:0,alpha:.15}),c.rect(o.x-10,o.y-10,20,18),c.fill({color:2760728,alpha:.9}),c.stroke({color:3813416,width:.5,alpha:.5}),c.rect(o.x-9,o.y-5,18,1.5),c.fill({color:3813412,alpha:.9}),c.rect(o.x-9,o.y+2,18,1.5),c.fill({color:3813412,alpha:.9});const f=[4878245,12865106,9419919,13935988,8087790];for(let m=0;m<5;m++){const p=o.x-8+m*4,y=3+Math.random()*3;c.rect(p,o.y-10+(6-y),2.5,y),c.fill({color:f[m],alpha:.7+Math.random()*.2})}for(let m=0;m<4;m++){const p=o.x-7+m*5,y=2+Math.random()*3;c.rect(p,o.y-4+(5-y),3,y),c.fill({color:f[(m+2)%5],alpha:.6+Math.random()*.2})}break}case"server":{c.rect(o.x-6,o.y-12,14,22),c.fill({color:0,alpha:.2}),c.rect(o.x-6,o.y-16,12,22),c.fill({color:1118498,alpha:.95}),c.stroke({color:2236996,width:.8,alpha:.6});for(let f=0;f<5;f++){const m=o.y-14+f*4;c.rect(o.x-5,m,10,3),c.fill({color:1710643,alpha:.8}),c.stroke({color:2236996,width:.3,alpha:.3})}for(let f=0;f<5;f++){const m=o.y-13.5+f*4;c.circle(o.x-3,m+.5,1),c.fill({color:f<3?65416:49151,alpha:.9}),c.circle(o.x+3,m+.5,.8),c.fill({color:16747520,alpha:.3+f*.15})}c.rect(o.x-4,o.y+2,8,3),c.fill({color:657946,alpha:.8});for(let f=0;f<4;f++)c.rect(o.x-3+f*2.2,o.y+2.5,1.2,2),c.fill({color:2236996,alpha:.4});break}case"whiteboard":{c.rect(o.x-14,o.y-10,28,20),c.fill({color:0,alpha:.15}),c.rect(o.x-13,o.y-12,26,18),c.fill({color:4473924,alpha:.6}),c.rect(o.x-12,o.y-11,24,16),c.fill({color:15790320,alpha:.18}),c.moveTo(o.x-9,o.y-8),c.lineTo(o.x+4,o.y-6),c.stroke({color:a,width:1,alpha:.35}),c.moveTo(o.x-8,o.y-4),c.lineTo(o.x+8,o.y-3),c.stroke({color:49151,width:.8,alpha:.25}),c.moveTo(o.x-6,o.y),c.lineTo(o.x+6,o.y+1),c.stroke({color:65416,width:.8,alpha:.2}),c.rect(o.x-4,o.y+2,8,4),c.stroke({color:a,width:.5,alpha:.2}),c.moveTo(o.x+5,o.y+4),c.lineTo(o.x+10,o.y+4),c.stroke({color:a,width:.5,alpha:.2}),c.rect(o.x-8,o.y+5,16,1.5),c.fill({color:4473924,alpha:.5}),c.rect(o.x-4,o.y+4,1.5,1.5),c.fill({color:16729156,alpha:.6}),c.rect(o.x-1,o.y+4,1.5,1.5),c.fill({color:65416,alpha:.6}),c.rect(o.x+2,o.y+4,1.5,1.5),c.fill({color:49151,alpha:.6});break}case"couch":{c.poly([{x:o.x-13,y:o.y+4},{x:o.x+13,y:o.y+4},{x:o.x+11,y:o.y+12},{x:o.x-11,y:o.y+12}]),c.fill({color:0,alpha:.2}),c.roundRect(o.x-14,o.y-6,28,6,2),c.fill({color:1714232,alpha:.9}),c.roundRect(o.x-13,o.y-1,12,8,2),c.fill({color:2439240,alpha:.85}),c.roundRect(o.x+1,o.y-1,12,8,2),c.fill({color:2439240,alpha:.85}),c.roundRect(o.x-15,o.y-4,3,10,1),c.fill({color:1714232,alpha:.85}),c.roundRect(o.x+12,o.y-4,3,10,1),c.fill({color:1714232,alpha:.85}),c.moveTo(o.x-1,o.y),c.lineTo(o.x-1,o.y+6),c.stroke({color:661544,width:.5,alpha:.4}),c.roundRect(o.x-10,o.y-3,6,4,1),c.fill({color:a,alpha:.2});break}case"coffee":{c.ellipse(o.x,o.y+6,12,5),c.fill({color:0,alpha:.15}),c.poly([{x:o.x,y:o.y-2},{x:o.x+12,y:o.y+4},{x:o.x,y:o.y+10},{x:o.x-12,y:o.y+4}]),c.fill({color:3813412,alpha:.85}),c.stroke({color:4866100,width:.5,alpha:.3}),c.poly([{x:o.x+12,y:o.y+4},{x:o.x,y:o.y+10},{x:o.x,y:o.y+12},{x:o.x+12,y:o.y+6}]),c.fill({color:2760724,alpha:.7}),c.circle(o.x+2,o.y+3,2.5),c.fill({color:15790320,alpha:.5}),c.circle(o.x+2,o.y+3,1.8),c.fill({color:4860432,alpha:.6}),c.moveTo(o.x+4.5,o.y+2),c.bezierCurveTo(o.x+6,o.y+2,o.x+6,o.y+4.5,o.x+4.5,o.y+4.5),c.stroke({color:15790320,width:.5,alpha:.4}),c.ellipse(o.x-4,o.y+4,3,1.2),c.fill({color:15790320,alpha:.2});break}}t.addChild(c)}updateAgents(t){for(const n of t){let a=this.agentSprites.get(n.id);a||(a=new gT(n),this.agentSprites.set(n.id,a),this.world.addChild(a.container)),a.update(n)}}destroy(){window.removeEventListener("resize",()=>this.centerCamera()),this.app.destroy(!0)}}class _T{constructor(){Kt(this,"container");Kt(this,"particles",[]);this.container=new ai}confetti(t,n){const a=[16766720,65416,49151,16738740,16739125];for(let u=0;u<30;u++){const o=Math.random()*Math.PI*2,c=1+Math.random()*3;this.addParticle(t,n,Math.cos(o)*c,Math.sin(o)*c-2,60+Math.random()*40,a[Math.floor(Math.random()*a.length)],2+Math.random()*3)}}redPulse(t,n){for(let a=0;a<12;a++){const u=a/12*Math.PI*2;this.addParticle(t,n,Math.cos(u)*1.5,Math.sin(u)*1.5,50,16729156,4)}}greenFlash(t,n){for(let a=0;a<8;a++){const u=a/8*Math.PI*2;this.addParticle(t,n,Math.cos(u)*2,Math.sin(u)*2-1,40,65416,3)}}addParticle(t,n,a,u,o,c,f){const m=new ae;m.rect(-f/2,-f/2,f,f),m.fill({color:c}),m.x=t,m.y=n,this.container.addChild(m),this.particles.push({x:t,y:n,vx:a,vy:u,life:o,maxLife:o,color:c,size:f,gfx:m})}tick(){for(let t=this.particles.length-1;t>=0;t--){const n=this.particles[t];n.x+=n.vx,n.y+=n.vy,n.vy+=.05,n.life--,n.gfx.x=n.x,n.gfx.y=n.y,n.gfx.alpha=n.life/n.maxLife,n.life<=0&&(this.container.removeChild(n.gfx),n.gfx.destroy(),this.particles.splice(t,1))}}}function bT(l){const t=ni.useRef(null),n=ni.useRef(null);return ni.useEffect(()=>{const a=document.getElementById(l);if(!a)return;const u=new xT,o=new _T;return t.current=u,n.current=o,u.init(a).then(()=>{u.world.addChild(o.container),u.app.ticker.add(()=>{const c=Mt.getState();u.updateAgents(c.agents.map(m=>({id:m.id,name:m.name,status:m.status,position_room:m.position_room,position_seat:m.position_seat})));let f=c.popWow();for(;f;)vT(f,o),f=c.popWow();o.tick()})}),()=>{u.destroy()}},[l]),{officeRef:t,effectsRef:n}}function vT(l,t){if(l)switch(l.type){case"pr:merged":{const n=Ys.find(a=>a.id==="dev-bullpen");if(n){const a=Ft(n.col+n.w/2,n.row+n.h/2);t.confetti(a.x,a.y)}break}case"crisis:start":{const n=Ys.find(a=>a.id==="crisis-room");if(n){const a=Ft(n.col+n.w/2,n.row+n.h/2);t.redPulse(a.x,a.y)}break}case"crisis:resolved":{const n=Ys.find(a=>a.id==="crisis-room");if(n){const a=Ft(n.col+n.w/2,n.row+n.h/2);t.greenFlash(a.x,a.y)}break}case"deploy:success":{const n=Q0("qa-lab",1);if(n){const a=Ft(n.col,n.row);t.confetti(a.x,a.y),t.greenFlash(a.x,a.y)}break}case"sprint:complete":{const n=Ys.find(a=>a.id==="lounge");if(n){const a=Ft(n.col+n.w/2,n.row+n.h/2);t.confetti(a.x,a.y),t.confetti(a.x+30,a.y-10),t.confetti(a.x-30,a.y+10)}break}case"meeting:start":{const n=Ys.find(a=>a.id==="meeting-room");if(n){const a=Ft(n.col+n.w/2,n.row+n.h/2);t.greenFlash(a.x,a.y)}break}}}const ST={sage:"👑",nova:"🔮",aria:"🏛️",dex:"⚡",flux:"🌊",quinn:"🔍",gage:"⚙️",morgan:"📋",uma:"🎨",river:"🌀",atlas:"📊"},TT={sage:"#FFD700",nova:"#00BFFF",aria:"#FF69B4",dex:"#00FF88",flux:"#FF6B35",quinn:"#9B59B6",gage:"#34495E",morgan:"#E74C3C",uma:"#1ABC9C",river:"#3498DB",atlas:"#F39C12"},wT={idle:"#555",coding:"#00ff88",reviewing:"#00bfff",testing:"#9b59b6",planning:"#ffd700",meeting:"#ff69b4",blocked:"#ff4444",deploying:"#ff6b35"};function AT(){const l=Mt(t=>t.agents);return J.jsxs("div",{className:"agent-bar",children:[J.jsx("div",{className:"agent-bar-logo",children:"SAGE TEAM"}),J.jsx("div",{className:"agent-bar-list",children:l.map(t=>J.jsxs("div",{className:"agent-bar-item",title:`${t.name} — ${t.role} (${t.status})`,children:[J.jsx("span",{className:"agent-emoji",children:ST[t.id]||"🤖"}),J.jsx("span",{className:"agent-name",style:{color:TT[t.id]||"#aaa"},children:t.name}),J.jsx("span",{className:"status-dot",style:{background:wT[t.status]||"#555"}})]},t.id))})]})}const gg={success:"#00ff88",warning:"#ff6b35",info:"#00bfff",agent:"#b0b0c0",task:"#ffd700",system:"#666"},ah={sage:"#FFD700",nova:"#00BFFF",aria:"#b57edc",dex:"#50c878",flux:"#4169e1",quinn:"#ff8c00",gage:"#20b2aa",morgan:"#ff69b4",uma:"#8a2be2",river:"#00ced1",atlas:"#708090"};function CT(){const l=Mt(f=>f.activity),t=Mt(f=>f.agents),n=Mt(f=>f.tasks),a=ni.useRef(null);ni.useEffect(()=>{var f;(f=a.current)==null||f.scrollIntoView({behavior:"smooth"})},[l.length]);const u=t.filter(f=>f.status!=="idle"),o=n.filter(f=>f.status==="done"||f.status==="completed").length,c=n.length;return J.jsxs("div",{className:"chat-panel",children:[J.jsxs("div",{className:"chat-header",children:[J.jsx("span",{className:"chat-header-title",children:"Live Activity"}),c>0&&J.jsxs("span",{className:"chat-header-stats",children:[o,"/",c," tasks"]})]}),u.length>0&&J.jsx("div",{className:"active-agents-strip",children:u.map(f=>J.jsxs("div",{className:"active-agent-chip",style:{borderColor:ah[f.id]||"#444"},children:[J.jsx("span",{className:"agent-dot",style:{background:ah[f.id]||"#888"}}),J.jsx("span",{className:"agent-chip-name",children:f.id}),J.jsx("span",{className:"agent-chip-status",children:f.status})]},f.id))}),J.jsxs("div",{className:"chat-messages",children:[l.length===0&&J.jsxs("div",{className:"chat-empty",children:[J.jsx("div",{className:"empty-icon",children:"🏢"}),J.jsx("div",{children:"Waiting for activity..."}),J.jsx("div",{className:"empty-hint",children:"Start a session to see agents at work"})]}),l.map(f=>J.jsxs("div",{className:`activity-entry activity-${f.type}`,children:[J.jsx("span",{className:"activity-time",children:f.time}),J.jsx("span",{className:"activity-icon",children:f.icon}),J.jsx("span",{className:"activity-text",style:{color:f.agentId&&ah[f.agentId]||gg[f.type]},children:f.text})]},f.id)),J.jsx("div",{ref:a})]})]})}function MT(){const l=Mt(m=>m.agents),t=Mt(m=>m.tasks),n=Mt(m=>m.sprint),a=l.filter(m=>m.status!=="idle"),u=t.filter(m=>m.status==="done").length,o=t.length,c=o>0?u/o:0,f=l.reduce((m,p)=>{const y=p.position_room;return m[y]||(m[y]=[]),m[y].push(p),m},{});return{agents:l,activeAgents:a,agentsByRoom:f,completedTasks:u,totalTasks:o,progress:c,sprint:n}}const ET={pending:"⏳",in_progress:"🔨",done:"✅",blocked:"🚫",review:"👀"};function RT(){const l=Mt(o=>o.tasks),{sprint:t,progress:n}=MT(),[a,u]=ni.useState(!1);return a?J.jsx("div",{className:"task-board collapsed",onClick:()=>u(!1),children:J.jsx("span",{className:"collapse-icon",children:"▶"})}):J.jsxs("div",{className:"task-board",children:[J.jsxs("div",{className:"task-board-header",onClick:()=>u(!0),children:[J.jsx("span",{className:"collapse-icon",children:"◀"}),J.jsx("span",{className:"task-board-title",children:"Sprint"})]}),t&&J.jsxs("div",{className:"sprint-info",children:[J.jsx("div",{className:"sprint-name",children:t.name}),J.jsx("div",{className:"sprint-progress-bar",children:J.jsx("div",{className:"sprint-progress-fill",style:{width:`${n*100}%`}})}),J.jsxs("div",{className:"sprint-progress-text",children:[Math.round(n*100),"% complete"]})]}),J.jsxs("div",{className:"task-list",children:[l.length===0&&J.jsx("div",{className:"task-empty",children:"No tasks yet. Submit a goal to start."}),l.map(o=>J.jsxs("div",{className:`task-item status-${o.status}`,children:[J.jsx("span",{className:"task-status-icon",children:ET[o.status]||"📦"}),J.jsxs("div",{className:"task-info",children:[J.jsx("div",{className:"task-title",children:o.title}),o.assigned_to&&J.jsx("div",{className:"task-assignee",children:o.assigned_to})]})]},o.id))]})]})}function zT(){const l=Mt(o=>o.prs),t=Mt(o=>o.selectedPR),n=Mt(o=>o.setSelectedPR),a=l.find(o=>o.id===t);if(!a)return null;async function u(o){try{await fetch(`/api/pr/${a.id}/${o}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({feedback:""})}),n(null)}catch{}}return J.jsx("div",{className:"pr-overlay",onClick:()=>n(null),children:J.jsxs("div",{className:"pr-modal",onClick:o=>o.stopPropagation(),children:[J.jsxs("div",{className:"pr-modal-header",children:[J.jsx("h3",{children:"Pull Request Review"}),J.jsx("button",{className:"pr-close",onClick:()=>n(null),children:"×"})]}),J.jsxs("div",{className:"pr-modal-body",children:[J.jsxs("div",{className:"pr-field",children:[J.jsx("span",{className:"pr-label",children:"Title:"})," ",a.title]}),J.jsxs("div",{className:"pr-field",children:[J.jsx("span",{className:"pr-label",children:"Branch:"})," ",J.jsx("code",{children:a.branch})]}),J.jsxs("div",{className:"pr-field",children:[J.jsx("span",{className:"pr-label",children:"Author:"})," ",a.author_agent]}),J.jsxs("div",{className:"pr-field",children:[J.jsx("span",{className:"pr-label",children:"Status:"})," ",a.status]}),a.review_notes&&J.jsxs("div",{className:"pr-review-notes",children:[J.jsx("div",{className:"pr-label",children:"Review Notes:"}),J.jsx("pre",{children:a.review_notes})]})]}),J.jsxs("div",{className:"pr-modal-actions",children:[J.jsx("button",{className:"pr-btn approve",onClick:()=>u("approve"),children:"Approve & Merge"}),J.jsx("button",{className:"pr-btn reject",onClick:()=>u("reject"),children:"Request Changes"})]})]})})}function DT(){const[l,t]=ni.useState(""),[n,a]=ni.useState(!1),u=Mt(p=>p.connected),o=Mt(p=>p.prs),c=Mt(p=>p.setSelectedPR),f=o.filter(p=>p.status==="pending_review"||p.status==="agent_reviewed");async function m(p){if(p.preventDefault(),!(!l.trim()||n)){a(!0);try{await fetch("/api/goal",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({goal:l.trim()})}),t("")}catch{}finally{a(!1)}}}return J.jsxs("div",{className:"goal-bar",children:[f.length>0&&J.jsx("div",{className:"pr-badges",children:f.map(p=>J.jsxs("button",{className:"pr-badge",onClick:()=>c(p.id),children:["PR: ",p.title]},p.id))}),J.jsxs("form",{className:"goal-form",onSubmit:m,children:[J.jsx("input",{className:"goal-input",type:"text",placeholder:u?"Enter a goal for your team...":"Connecting...",value:l,onChange:p=>t(p.target.value),disabled:!u||n}),J.jsx("button",{className:"goal-submit",type:"submit",disabled:!u||n||!l.trim(),children:n?"...":"Go"})]})]})}function BT(){const l=Mt(t=>t.connected);return G1(),bT("office-canvas"),J.jsxs("div",{className:"app",children:[J.jsx(AT,{}),J.jsxs("div",{className:"main-area",children:[J.jsx(RT,{}),J.jsxs("div",{className:"canvas-container",children:[J.jsx("canvas",{id:"office-canvas"}),!l&&J.jsx("div",{className:"connection-overlay",children:J.jsx("span",{children:"Connecting to Sage Team..."})})]}),J.jsx(CT,{})]}),J.jsx(DT,{}),J.jsx(zT,{})]})}M1.createRoot(document.getElementById("root")).render(J.jsx(ni.StrictMode,{children:J.jsx(BT,{})}));export{lo as $,f0 as A,hl as B,re as C,Xe as D,vi as E,Pi as F,oo as G,Bh as H,u0 as I,li as J,i0 as K,wh as L,vt as M,yS as N,xS as O,xe as P,AS as Q,dh as R,Oh as S,Ut as T,io as U,SS as V,Z1 as W,ES as X,De as Y,Rg as Z,si as _,s0 as a,xy as a0,ll as a1,oT as a2,Cb as a3,by as a4,Yc as a5,vy as a6,Eb as a7,Fs as a8,$t as a9,Bg as aa,D2 as ab,d0 as ac,wt as ad,dl as ae,Qt as af,Dv as ag,Cv as ah,Jv as ai,Pv as aj,gS as ak,_S as al,CS as am,wS as an,MS as ao,Jg as b,qv as c,ze as d,Wt as e,kt as f,Kb as g,Jr as h,yt as i,ae as j,VS as k,US as l,Dg as m,co as n,Yg as o,te as p,Xs as q,ub as r,uo as s,ai as t,ov as u,Lv as v,Se as w,ml as x,Uy as y,$r as z};