@micjanic/recursive-grid 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/CanvasPool-BvJplAOp.js +47 -0
- package/dist/CanvasPool-BvJplAOp.js.map +1 -0
- package/dist/PixiApp-D4xu0PT4.js +37810 -0
- package/dist/PixiApp-D4xu0PT4.js.map +1 -0
- package/dist/SharedSystems-CZFehVPl.js +2690 -0
- package/dist/SharedSystems-CZFehVPl.js.map +1 -0
- package/dist/WebGLRenderer-BYTBSbn-.js +2642 -0
- package/dist/WebGLRenderer-BYTBSbn-.js.map +1 -0
- package/dist/WebGPURenderer-fP-CMMNL.js +1656 -0
- package/dist/WebGPURenderer-fP-CMMNL.js.map +1 -0
- package/dist/browserAll-qgahyZIY.js +1866 -0
- package/dist/browserAll-qgahyZIY.js.map +1 -0
- package/dist/colorToUniform-C2jGzNe1.js +98 -0
- package/dist/colorToUniform-C2jGzNe1.js.map +1 -0
- package/dist/recursive-grid.es.js +5 -0
- package/dist/recursive-grid.es.js.map +1 -0
- package/dist/recursive-grid.umd.js +1490 -0
- package/dist/recursive-grid.umd.js.map +1 -0
- package/dist/webworkerAll-CI8_Z7rX.js +3321 -0
- package/dist/webworkerAll-CI8_Z7rX.js.map +1 -0
- package/package.json +85 -0
|
@@ -0,0 +1,1490 @@
|
|
|
1
|
+
(function(xa,Ri){typeof exports=="object"&&typeof module<"u"?module.exports=Ri():typeof define=="function"&&define.amd?define(Ri):(xa=typeof globalThis<"u"?globalThis:xa||self,xa["@micjanic/recursive-grid"]=Ri())})(this,function(){"use strict";var o5=Object.defineProperty;var u5=(xa,Ri,cr)=>Ri in xa?o5(xa,Ri,{enumerable:!0,configurable:!0,writable:!0,value:cr}):xa[Ri]=cr;var $o=(xa,Ri,cr)=>u5(xa,typeof Ri!="symbol"?Ri+"":Ri,cr);var EC,CC;function xa(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ri={exports:{}},cr={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var ix;function hA(){if(ix)return cr;ix=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(a,r,u){var h=null;if(u!==void 0&&(h=""+u),r.key!==void 0&&(h=""+r.key),"key"in r){u={};for(var d in r)d!=="key"&&(u[d]=r[d])}else u=r;return r=u.ref,{$$typeof:n,type:a,key:h,ref:r!==void 0?r:null,props:u}}return cr.Fragment=e,cr.jsx=t,cr.jsxs=t,cr}var Xf={},qm={exports:{}},at={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react.production.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var ax;function fA(){if(ax)return at;ax=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),u=Symbol.for("react.consumer"),h=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),S=Symbol.iterator;function T(U){return U===null||typeof U!="object"?null:(U=S&&U[S]||U["@@iterator"],typeof U=="function"?U:null)}var E={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},A=Object.assign,B={};function M(U,k,oe){this.props=U,this.context=k,this.refs=B,this.updater=oe||E}M.prototype.isReactComponent={},M.prototype.setState=function(U,k){if(typeof U!="object"&&typeof U!="function"&&U!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,U,k,"setState")},M.prototype.forceUpdate=function(U){this.updater.enqueueForceUpdate(this,U,"forceUpdate")};function G(){}G.prototype=M.prototype;function w(U,k,oe){this.props=U,this.context=k,this.refs=B,this.updater=oe||E}var P=w.prototype=new G;P.constructor=w,A(P,M.prototype),P.isPureReactComponent=!0;var z=Array.isArray,Z={H:null,A:null,T:null,S:null,V:null},ie=Object.prototype.hasOwnProperty;function ne(U,k,oe,be,Ae,De){return oe=De.ref,{$$typeof:n,type:U,key:k,ref:oe!==void 0?oe:null,props:De}}function Se(U,k){return ne(U.type,k,void 0,void 0,void 0,U.props)}function _e(U){return typeof U=="object"&&U!==null&&U.$$typeof===n}function me(U){var k={"=":"=0",":":"=2"};return"$"+U.replace(/[=:]/g,function(oe){return k[oe]})}var se=/\/+/g;function Le(U,k){return typeof U=="object"&&U!==null&&U.key!=null?me(""+U.key):k.toString(36)}function ae(){}function We(U){switch(U.status){case"fulfilled":return U.value;case"rejected":throw U.reason;default:switch(typeof U.status=="string"?U.then(ae,ae):(U.status="pending",U.then(function(k){U.status==="pending"&&(U.status="fulfilled",U.value=k)},function(k){U.status==="pending"&&(U.status="rejected",U.reason=k)})),U.status){case"fulfilled":return U.value;case"rejected":throw U.reason}}throw U}function St(U,k,oe,be,Ae){var De=typeof U;(De==="undefined"||De==="boolean")&&(U=null);var ze=!1;if(U===null)ze=!0;else switch(De){case"bigint":case"string":case"number":ze=!0;break;case"object":switch(U.$$typeof){case n:case e:ze=!0;break;case b:return ze=U._init,St(ze(U._payload),k,oe,be,Ae)}}if(ze)return Ae=Ae(U),ze=be===""?"."+Le(U,0):be,z(Ae)?(oe="",ze!=null&&(oe=ze.replace(se,"$&/")+"/"),St(Ae,k,oe,"",function($t){return $t})):Ae!=null&&(_e(Ae)&&(Ae=Se(Ae,oe+(Ae.key==null||U&&U.key===Ae.key?"":(""+Ae.key).replace(se,"$&/")+"/")+ze)),k.push(Ae)),1;ze=0;var wt=be===""?".":be+":";if(z(U))for(var je=0;je<U.length;je++)be=U[je],De=wt+Le(be,je),ze+=St(be,k,oe,De,Ae);else if(je=T(U),typeof je=="function")for(U=je.call(U),je=0;!(be=U.next()).done;)be=be.value,De=wt+Le(be,je++),ze+=St(be,k,oe,De,Ae);else if(De==="object"){if(typeof U.then=="function")return St(We(U),k,oe,be,Ae);throw k=String(U),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(U).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return ze}function j(U,k,oe){if(U==null)return U;var be=[],Ae=0;return St(U,be,"","",function(De){return k.call(oe,De,Ae++)}),be}function ee(U){if(U._status===-1){var k=U._result;k=k(),k.then(function(oe){(U._status===0||U._status===-1)&&(U._status=1,U._result=oe)},function(oe){(U._status===0||U._status===-1)&&(U._status=2,U._result=oe)}),U._status===-1&&(U._status=0,U._result=k)}if(U._status===1)return U._result.default;throw U._result}var de=typeof reportError=="function"?reportError:function(U){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof U=="object"&&U!==null&&typeof U.message=="string"?String(U.message):String(U),error:U});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",U);return}console.error(U)};function pe(){}return at.Children={map:j,forEach:function(U,k,oe){j(U,function(){k.apply(this,arguments)},oe)},count:function(U){var k=0;return j(U,function(){k++}),k},toArray:function(U){return j(U,function(k){return k})||[]},only:function(U){if(!_e(U))throw Error("React.Children.only expected to receive a single React element child.");return U}},at.Component=M,at.Fragment=t,at.Profiler=r,at.PureComponent=w,at.StrictMode=a,at.Suspense=m,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Z,at.__COMPILER_RUNTIME={__proto__:null,c:function(U){return Z.H.useMemoCache(U)}},at.cache=function(U){return function(){return U.apply(null,arguments)}},at.cloneElement=function(U,k,oe){if(U==null)throw Error("The argument must be a React element, but you passed "+U+".");var be=A({},U.props),Ae=U.key,De=void 0;if(k!=null)for(ze in k.ref!==void 0&&(De=void 0),k.key!==void 0&&(Ae=""+k.key),k)!ie.call(k,ze)||ze==="key"||ze==="__self"||ze==="__source"||ze==="ref"&&k.ref===void 0||(be[ze]=k[ze]);var ze=arguments.length-2;if(ze===1)be.children=oe;else if(1<ze){for(var wt=Array(ze),je=0;je<ze;je++)wt[je]=arguments[je+2];be.children=wt}return ne(U.type,Ae,void 0,void 0,De,be)},at.createContext=function(U){return U={$$typeof:h,_currentValue:U,_currentValue2:U,_threadCount:0,Provider:null,Consumer:null},U.Provider=U,U.Consumer={$$typeof:u,_context:U},U},at.createElement=function(U,k,oe){var be,Ae={},De=null;if(k!=null)for(be in k.key!==void 0&&(De=""+k.key),k)ie.call(k,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(Ae[be]=k[be]);var ze=arguments.length-2;if(ze===1)Ae.children=oe;else if(1<ze){for(var wt=Array(ze),je=0;je<ze;je++)wt[je]=arguments[je+2];Ae.children=wt}if(U&&U.defaultProps)for(be in ze=U.defaultProps,ze)Ae[be]===void 0&&(Ae[be]=ze[be]);return ne(U,De,void 0,void 0,null,Ae)},at.createRef=function(){return{current:null}},at.forwardRef=function(U){return{$$typeof:d,render:U}},at.isValidElement=_e,at.lazy=function(U){return{$$typeof:b,_payload:{_status:-1,_result:U},_init:ee}},at.memo=function(U,k){return{$$typeof:y,type:U,compare:k===void 0?null:k}},at.startTransition=function(U){var k=Z.T,oe={};Z.T=oe;try{var be=U(),Ae=Z.S;Ae!==null&&Ae(oe,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(pe,de)}catch(De){de(De)}finally{Z.T=k}},at.unstable_useCacheRefresh=function(){return Z.H.useCacheRefresh()},at.use=function(U){return Z.H.use(U)},at.useActionState=function(U,k,oe){return Z.H.useActionState(U,k,oe)},at.useCallback=function(U,k){return Z.H.useCallback(U,k)},at.useContext=function(U){return Z.H.useContext(U)},at.useDebugValue=function(){},at.useDeferredValue=function(U,k){return Z.H.useDeferredValue(U,k)},at.useEffect=function(U,k,oe){var be=Z.H;if(typeof oe=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return be.useEffect(U,k)},at.useId=function(){return Z.H.useId()},at.useImperativeHandle=function(U,k,oe){return Z.H.useImperativeHandle(U,k,oe)},at.useInsertionEffect=function(U,k){return Z.H.useInsertionEffect(U,k)},at.useLayoutEffect=function(U,k){return Z.H.useLayoutEffect(U,k)},at.useMemo=function(U,k){return Z.H.useMemo(U,k)},at.useOptimistic=function(U,k){return Z.H.useOptimistic(U,k)},at.useReducer=function(U,k,oe){return Z.H.useReducer(U,k,oe)},at.useRef=function(U){return Z.H.useRef(U)},at.useState=function(U){return Z.H.useState(U)},at.useSyncExternalStore=function(U,k,oe){return Z.H.useSyncExternalStore(U,k,oe)},at.useTransition=function(){return Z.H.useTransition()},at.version="19.1.1",at}var qf={exports:{}};/**
|
|
18
|
+
* @license React
|
|
19
|
+
* react.development.js
|
|
20
|
+
*
|
|
21
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
+
*
|
|
23
|
+
* This source code is licensed under the MIT license found in the
|
|
24
|
+
* LICENSE file in the root directory of this source tree.
|
|
25
|
+
*/qf.exports;var sx;function dA(){return sx||(sx=1,function(n,e){process.env.NODE_ENV!=="production"&&function(){function t(D,F){Object.defineProperty(u.prototype,D,{get:function(){console.warn("%s(...) is deprecated in plain JavaScript React classes. %s",F[0],F[1])}})}function a(D){return D===null||typeof D!="object"?null:(D=Wn&&D[Wn]||D["@@iterator"],typeof D=="function"?D:null)}function r(D,F){D=(D=D.constructor)&&(D.displayName||D.name)||"ReactClass";var he=D+"."+F;cn[he]||(console.error("Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",F,D),cn[he]=!0)}function u(D,F,he){this.props=D,this.context=F,this.refs=wn,this.updater=he||Jn}function h(){}function d(D,F,he){this.props=D,this.context=F,this.refs=wn,this.updater=he||Jn}function m(D){return""+D}function y(D){try{m(D);var F=!1}catch{F=!0}if(F){F=console;var he=F.error,Te=typeof Symbol=="function"&&Symbol.toStringTag&&D[Symbol.toStringTag]||D.constructor.name||"Object";return he.call(F,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Te),m(D)}}function b(D){if(D==null)return null;if(typeof D=="function")return D.$$typeof===ll?null:D.displayName||D.name||null;if(typeof D=="string")return D;switch(D){case U:return"Fragment";case oe:return"Profiler";case k:return"StrictMode";case ze:return"Suspense";case wt:return"SuspenseList";case Ni:return"Activity"}if(typeof D=="object")switch(typeof D.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),D.$$typeof){case pe:return"Portal";case Ae:return(D.displayName||"Context")+".Provider";case be:return(D._context.displayName||"Context")+".Consumer";case De:var F=D.render;return D=D.displayName,D||(D=F.displayName||F.name||"",D=D!==""?"ForwardRef("+D+")":"ForwardRef"),D;case je:return F=D.displayName||null,F!==null?F:b(D.type)||"Memo";case $t:F=D._payload,D=D._init;try{return b(D(F))}catch{}}return null}function S(D){if(D===U)return"<>";if(typeof D=="object"&&D!==null&&D.$$typeof===$t)return"<...>";try{var F=b(D);return F?"<"+F+">":"<...>"}catch{return"<...>"}}function T(){var D=Xe.A;return D===null?null:D.getOwner()}function E(){return Error("react-stack-top-frame")}function A(D){if(yt.call(D,"key")){var F=Object.getOwnPropertyDescriptor(D,"key").get;if(F&&F.isReactWarning)return!1}return D.key!==void 0}function B(D,F){function he(){no||(no=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",F))}he.isReactWarning=!0,Object.defineProperty(D,"key",{get:he,configurable:!0})}function M(){var D=b(this.type);return Za[D]||(Za[D]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),D=this.props.ref,D!==void 0?D:null}function G(D,F,he,Te,Ue,tt,we,ct){return he=tt.ref,D={$$typeof:de,type:D,key:F,props:tt,_owner:Ue},(he!==void 0?he:null)!==null?Object.defineProperty(D,"ref",{enumerable:!1,get:M}):Object.defineProperty(D,"ref",{enumerable:!1,value:null}),D._store={},Object.defineProperty(D._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(D,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(D,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:we}),Object.defineProperty(D,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:ct}),Object.freeze&&(Object.freeze(D.props),Object.freeze(D)),D}function w(D,F){return F=G(D.type,F,void 0,void 0,D._owner,D.props,D._debugStack,D._debugTask),D._store&&(F._store.validated=D._store.validated),F}function P(D){return typeof D=="object"&&D!==null&&D.$$typeof===de}function z(D){var F={"=":"=0",":":"=2"};return"$"+D.replace(/[=:]/g,function(he){return F[he]})}function Z(D,F){return typeof D=="object"&&D!==null&&D.key!=null?(y(D.key),z(""+D.key)):F.toString(36)}function ie(){}function ne(D){switch(D.status){case"fulfilled":return D.value;case"rejected":throw D.reason;default:switch(typeof D.status=="string"?D.then(ie,ie):(D.status="pending",D.then(function(F){D.status==="pending"&&(D.status="fulfilled",D.value=F)},function(F){D.status==="pending"&&(D.status="rejected",D.reason=F)})),D.status){case"fulfilled":return D.value;case"rejected":throw D.reason}}throw D}function Se(D,F,he,Te,Ue){var tt=typeof D;(tt==="undefined"||tt==="boolean")&&(D=null);var we=!1;if(D===null)we=!0;else switch(tt){case"bigint":case"string":case"number":we=!0;break;case"object":switch(D.$$typeof){case de:case pe:we=!0;break;case $t:return we=D._init,Se(we(D._payload),F,he,Te,Ue)}}if(we){we=D,Ue=Ue(we);var ct=Te===""?"."+Z(we,0):Te;return yr(Ue)?(he="",ct!=null&&(he=ct.replace(pu,"$&/")+"/"),Se(Ue,F,he,"",function(Gi){return Gi})):Ue!=null&&(P(Ue)&&(Ue.key!=null&&(we&&we.key===Ue.key||y(Ue.key)),he=w(Ue,he+(Ue.key==null||we&&we.key===Ue.key?"":(""+Ue.key).replace(pu,"$&/")+"/")+ct),Te!==""&&we!=null&&P(we)&&we.key==null&&we._store&&!we._store.validated&&(he._store.validated=2),Ue=he),F.push(Ue)),1}if(we=0,ct=Te===""?".":Te+":",yr(D))for(var Fe=0;Fe<D.length;Fe++)Te=D[Fe],tt=ct+Z(Te,Fe),we+=Se(Te,F,he,tt,Ue);else if(Fe=a(D),typeof Fe=="function")for(Fe===D.entries&&(gr||console.warn("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),gr=!0),D=Fe.call(D),Fe=0;!(Te=D.next()).done;)Te=Te.value,tt=ct+Z(Te,Fe++),we+=Se(Te,F,he,tt,Ue);else if(tt==="object"){if(typeof D.then=="function")return Se(ne(D),F,he,Te,Ue);throw F=String(D),Error("Objects are not valid as a React child (found: "+(F==="[object Object]"?"object with keys {"+Object.keys(D).join(", ")+"}":F)+"). If you meant to render a collection of children, use an array instead.")}return we}function _e(D,F,he){if(D==null)return D;var Te=[],Ue=0;return Se(D,Te,"","",function(tt){return F.call(he,tt,Ue++)}),Te}function me(D){if(D._status===-1){var F=D._result;F=F(),F.then(function(he){(D._status===0||D._status===-1)&&(D._status=1,D._result=he)},function(he){(D._status===0||D._status===-1)&&(D._status=2,D._result=he)}),D._status===-1&&(D._status=0,D._result=F)}if(D._status===1)return F=D._result,F===void 0&&console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
26
|
+
|
|
27
|
+
Your code should look like:
|
|
28
|
+
const MyComponent = lazy(() => import('./MyComponent'))
|
|
29
|
+
|
|
30
|
+
Did you accidentally put curly braces around the import?`,F),"default"in F||console.error(`lazy: Expected the result of a dynamic import() call. Instead received: %s
|
|
31
|
+
|
|
32
|
+
Your code should look like:
|
|
33
|
+
const MyComponent = lazy(() => import('./MyComponent'))`,F),F.default;throw D._result}function se(){var D=Xe.H;return D===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
34
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
35
|
+
2. You might be breaking the Rules of Hooks
|
|
36
|
+
3. You might have more than one copy of React in the same app
|
|
37
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),D}function Le(){}function ae(D){if(zs===null)try{var F=("require"+Math.random()).slice(0,7);zs=(n&&n[F]).call(n,"timers").setImmediate}catch{zs=function(Te){la===!1&&(la=!0,typeof MessageChannel>"u"&&console.error("This browser does not have a MessageChannel implementation, so enqueuing tasks via await act(async () => ...) will fail. Please file an issue at https://github.com/facebook/react/issues if you encounter this warning."));var Ue=new MessageChannel;Ue.port1.onmessage=Te,Ue.port2.postMessage(void 0)}}return zs(D)}function We(D){return 1<D.length&&typeof AggregateError=="function"?new AggregateError(D):D[0]}function St(D,F){F!==fi-1&&console.error("You seem to have overlapping act() calls, this is not supported. Be sure to await previous act() calls before making a new one. "),fi=F}function j(D,F,he){var Te=Xe.actQueue;if(Te!==null)if(Te.length!==0)try{ee(Te),ae(function(){return j(D,F,he)});return}catch(Ue){Xe.thrownErrors.push(Ue)}else Xe.actQueue=null;0<Xe.thrownErrors.length?(Te=We(Xe.thrownErrors),Xe.thrownErrors.length=0,he(Te)):F(D)}function ee(D){if(!pi){pi=!0;var F=0;try{for(;F<D.length;F++){var he=D[F];do{Xe.didUsePromise=!1;var Te=he(!1);if(Te!==null){if(Xe.didUsePromise){D[F]=he,D.splice(0,F);return}he=Te}else break}while(!0)}D.length=0}catch(Ue){D.splice(0,F+1),Xe.thrownErrors.push(Ue)}finally{pi=!1}}}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var de=Symbol.for("react.transitional.element"),pe=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),be=Symbol.for("react.consumer"),Ae=Symbol.for("react.context"),De=Symbol.for("react.forward_ref"),ze=Symbol.for("react.suspense"),wt=Symbol.for("react.suspense_list"),je=Symbol.for("react.memo"),$t=Symbol.for("react.lazy"),Ni=Symbol.for("react.activity"),Wn=Symbol.iterator,cn={},Jn={isMounted:function(){return!1},enqueueForceUpdate:function(D){r(D,"forceUpdate")},enqueueReplaceState:function(D){r(D,"replaceState")},enqueueSetState:function(D){r(D,"setState")}},$n=Object.assign,wn={};Object.freeze(wn),u.prototype.isReactComponent={},u.prototype.setState=function(D,F){if(typeof D!="object"&&typeof D!="function"&&D!=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,D,F,"setState")},u.prototype.forceUpdate=function(D){this.updater.enqueueForceUpdate(this,D,"forceUpdate")};var xn={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},Pn;for(Pn in xn)xn.hasOwnProperty(Pn)&&t(Pn,xn[Pn]);h.prototype=u.prototype,xn=d.prototype=new h,xn.constructor=d,$n(xn,u.prototype),xn.isPureReactComponent=!0;var yr=Array.isArray,ll=Symbol.for("react.client.reference"),Xe={H:null,A:null,T:null,S:null,V:null,actQueue:null,isBatchingLegacy:!1,didScheduleLegacyUpdate:!1,didUsePromise:!1,thrownErrors:[],getCurrentStack:null,recentlyCreatedOwnerStacks:0},yt=Object.prototype.hasOwnProperty,Vc=console.createTask?console.createTask:function(){return null};xn={react_stack_bottom_frame:function(D){return D()}};var no,Ps,Za={},Lc=xn.react_stack_bottom_frame.bind(xn,E)(),io=Vc(S(E)),gr=!1,pu=/\/+/g,ei=typeof reportError=="function"?reportError:function(D){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var F=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof D=="object"&&D!==null&&typeof D.message=="string"?String(D.message):String(D),error:D});if(!window.dispatchEvent(F))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",D);return}console.error(D)},la=!1,zs=null,fi=0,di=!1,pi=!1,Xi=typeof queueMicrotask=="function"?function(D){queueMicrotask(function(){return queueMicrotask(D)})}:ae;xn=Object.freeze({__proto__:null,c:function(D){return se().useMemoCache(D)}}),e.Children={map:_e,forEach:function(D,F,he){_e(D,function(){F.apply(this,arguments)},he)},count:function(D){var F=0;return _e(D,function(){F++}),F},toArray:function(D){return _e(D,function(F){return F})||[]},only:function(D){if(!P(D))throw Error("React.Children.only expected to receive a single React element child.");return D}},e.Component=u,e.Fragment=U,e.Profiler=oe,e.PureComponent=d,e.StrictMode=k,e.Suspense=ze,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Xe,e.__COMPILER_RUNTIME=xn,e.act=function(D){var F=Xe.actQueue,he=fi;fi++;var Te=Xe.actQueue=F!==null?F:[],Ue=!1;try{var tt=D()}catch(Fe){Xe.thrownErrors.push(Fe)}if(0<Xe.thrownErrors.length)throw St(F,he),D=We(Xe.thrownErrors),Xe.thrownErrors.length=0,D;if(tt!==null&&typeof tt=="object"&&typeof tt.then=="function"){var we=tt;return Xi(function(){Ue||di||(di=!0,console.error("You called act(async () => ...) without await. This could lead to unexpected testing behaviour, interleaving multiple act calls and mixing their scopes. You should - await act(async () => ...);"))}),{then:function(Fe,Gi){Ue=!0,we.then(function(ti){if(St(F,he),he===0){try{ee(Te),ae(function(){return j(ti,Fe,Gi)})}catch(ao){Xe.thrownErrors.push(ao)}if(0<Xe.thrownErrors.length){var Hs=We(Xe.thrownErrors);Xe.thrownErrors.length=0,Gi(Hs)}}else Fe(ti)},function(ti){St(F,he),0<Xe.thrownErrors.length&&(ti=We(Xe.thrownErrors),Xe.thrownErrors.length=0),Gi(ti)})}}}var ct=tt;if(St(F,he),he===0&&(ee(Te),Te.length!==0&&Xi(function(){Ue||di||(di=!0,console.error("A component suspended inside an `act` scope, but the `act` call was not awaited. When testing React components that depend on asynchronous data, you must await the result:\n\nawait act(() => ...)"))}),Xe.actQueue=null),0<Xe.thrownErrors.length)throw D=We(Xe.thrownErrors),Xe.thrownErrors.length=0,D;return{then:function(Fe,Gi){Ue=!0,he===0?(Xe.actQueue=Te,ae(function(){return j(ct,Fe,Gi)})):Fe(ct)}}},e.cache=function(D){return function(){return D.apply(null,arguments)}},e.captureOwnerStack=function(){var D=Xe.getCurrentStack;return D===null?null:D()},e.cloneElement=function(D,F,he){if(D==null)throw Error("The argument must be a React element, but you passed "+D+".");var Te=$n({},D.props),Ue=D.key,tt=D._owner;if(F!=null){var we;e:{if(yt.call(F,"ref")&&(we=Object.getOwnPropertyDescriptor(F,"ref").get)&&we.isReactWarning){we=!1;break e}we=F.ref!==void 0}we&&(tt=T()),A(F)&&(y(F.key),Ue=""+F.key);for(ct in F)!yt.call(F,ct)||ct==="key"||ct==="__self"||ct==="__source"||ct==="ref"&&F.ref===void 0||(Te[ct]=F[ct])}var ct=arguments.length-2;if(ct===1)Te.children=he;else if(1<ct){we=Array(ct);for(var Fe=0;Fe<ct;Fe++)we[Fe]=arguments[Fe+2];Te.children=we}for(Te=G(D.type,Ue,void 0,void 0,tt,Te,D._debugStack,D._debugTask),Ue=2;Ue<arguments.length;Ue++)tt=arguments[Ue],P(tt)&&tt._store&&(tt._store.validated=1);return Te},e.createContext=function(D){return D={$$typeof:Ae,_currentValue:D,_currentValue2:D,_threadCount:0,Provider:null,Consumer:null},D.Provider=D,D.Consumer={$$typeof:be,_context:D},D._currentRenderer=null,D._currentRenderer2=null,D},e.createElement=function(D,F,he){for(var Te=2;Te<arguments.length;Te++){var Ue=arguments[Te];P(Ue)&&Ue._store&&(Ue._store.validated=1)}if(Te={},Ue=null,F!=null)for(Fe in Ps||!("__self"in F)||"key"in F||(Ps=!0,console.warn("Your app (or one of its dependencies) is using an outdated JSX transform. Update to the modern JSX transform for faster performance: https://react.dev/link/new-jsx-transform")),A(F)&&(y(F.key),Ue=""+F.key),F)yt.call(F,Fe)&&Fe!=="key"&&Fe!=="__self"&&Fe!=="__source"&&(Te[Fe]=F[Fe]);var tt=arguments.length-2;if(tt===1)Te.children=he;else if(1<tt){for(var we=Array(tt),ct=0;ct<tt;ct++)we[ct]=arguments[ct+2];Object.freeze&&Object.freeze(we),Te.children=we}if(D&&D.defaultProps)for(Fe in tt=D.defaultProps,tt)Te[Fe]===void 0&&(Te[Fe]=tt[Fe]);Ue&&B(Te,typeof D=="function"?D.displayName||D.name||"Unknown":D);var Fe=1e4>Xe.recentlyCreatedOwnerStacks++;return G(D,Ue,void 0,void 0,T(),Te,Fe?Error("react-stack-top-frame"):Lc,Fe?Vc(S(D)):io)},e.createRef=function(){var D={current:null};return Object.seal(D),D},e.forwardRef=function(D){D!=null&&D.$$typeof===je?console.error("forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):typeof D!="function"?console.error("forwardRef requires a render function but was given %s.",D===null?"null":typeof D):D.length!==0&&D.length!==2&&console.error("forwardRef render functions accept exactly two parameters: props and ref. %s",D.length===1?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),D!=null&&D.defaultProps!=null&&console.error("forwardRef render functions do not support defaultProps. Did you accidentally pass a React component?");var F={$$typeof:De,render:D},he;return Object.defineProperty(F,"displayName",{enumerable:!1,configurable:!0,get:function(){return he},set:function(Te){he=Te,D.name||D.displayName||(Object.defineProperty(D,"name",{value:Te}),D.displayName=Te)}}),F},e.isValidElement=P,e.lazy=function(D){return{$$typeof:$t,_payload:{_status:-1,_result:D},_init:me}},e.memo=function(D,F){D==null&&console.error("memo: The first argument must be a component. Instead received: %s",D===null?"null":typeof D),F={$$typeof:je,type:D,compare:F===void 0?null:F};var he;return Object.defineProperty(F,"displayName",{enumerable:!1,configurable:!0,get:function(){return he},set:function(Te){he=Te,D.name||D.displayName||(Object.defineProperty(D,"name",{value:Te}),D.displayName=Te)}}),F},e.startTransition=function(D){var F=Xe.T,he={};Xe.T=he,he._updatedFibers=new Set;try{var Te=D(),Ue=Xe.S;Ue!==null&&Ue(he,Te),typeof Te=="object"&&Te!==null&&typeof Te.then=="function"&&Te.then(Le,ei)}catch(tt){ei(tt)}finally{F===null&&he._updatedFibers&&(D=he._updatedFibers.size,he._updatedFibers.clear(),10<D&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table.")),Xe.T=F}},e.unstable_useCacheRefresh=function(){return se().useCacheRefresh()},e.use=function(D){return se().use(D)},e.useActionState=function(D,F,he){return se().useActionState(D,F,he)},e.useCallback=function(D,F){return se().useCallback(D,F)},e.useContext=function(D){var F=se();return D.$$typeof===be&&console.error("Calling useContext(Context.Consumer) is not supported and will cause bugs. Did you mean to call useContext(Context) instead?"),F.useContext(D)},e.useDebugValue=function(D,F){return se().useDebugValue(D,F)},e.useDeferredValue=function(D,F){return se().useDeferredValue(D,F)},e.useEffect=function(D,F,he){D==null&&console.warn("React Hook useEffect requires an effect callback. Did you forget to pass a callback to the hook?");var Te=se();if(typeof he=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return Te.useEffect(D,F)},e.useId=function(){return se().useId()},e.useImperativeHandle=function(D,F,he){return se().useImperativeHandle(D,F,he)},e.useInsertionEffect=function(D,F){return D==null&&console.warn("React Hook useInsertionEffect requires an effect callback. Did you forget to pass a callback to the hook?"),se().useInsertionEffect(D,F)},e.useLayoutEffect=function(D,F){return D==null&&console.warn("React Hook useLayoutEffect requires an effect callback. Did you forget to pass a callback to the hook?"),se().useLayoutEffect(D,F)},e.useMemo=function(D,F){return se().useMemo(D,F)},e.useOptimistic=function(D,F){return se().useOptimistic(D,F)},e.useReducer=function(D,F,he){return se().useReducer(D,F,he)},e.useRef=function(D){return se().useRef(D)},e.useState=function(D){return se().useState(D)},e.useSyncExternalStore=function(D,F,he){return se().useSyncExternalStore(D,F,he)},e.useTransition=function(){return se().useTransition()},e.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(qf,qf.exports)),qf.exports}var rx;function _c(){return rx||(rx=1,process.env.NODE_ENV==="production"?qm.exports=fA():qm.exports=dA()),qm.exports}/**
|
|
38
|
+
* @license React
|
|
39
|
+
* react-jsx-runtime.development.js
|
|
40
|
+
*
|
|
41
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
42
|
+
*
|
|
43
|
+
* This source code is licensed under the MIT license found in the
|
|
44
|
+
* LICENSE file in the root directory of this source tree.
|
|
45
|
+
*/var lx;function pA(){return lx||(lx=1,process.env.NODE_ENV!=="production"&&function(){function n(U){if(U==null)return null;if(typeof U=="function")return U.$$typeof===me?null:U.displayName||U.name||null;if(typeof U=="string")return U;switch(U){case B:return"Fragment";case G:return"Profiler";case M:return"StrictMode";case Z:return"Suspense";case ie:return"SuspenseList";case _e:return"Activity"}if(typeof U=="object")switch(typeof U.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),U.$$typeof){case A:return"Portal";case P:return(U.displayName||"Context")+".Provider";case w:return(U._context.displayName||"Context")+".Consumer";case z:var k=U.render;return U=U.displayName,U||(U=k.displayName||k.name||"",U=U!==""?"ForwardRef("+U+")":"ForwardRef"),U;case ne:return k=U.displayName||null,k!==null?k:n(U.type)||"Memo";case Se:k=U._payload,U=U._init;try{return n(U(k))}catch{}}return null}function e(U){return""+U}function t(U){try{e(U);var k=!1}catch{k=!0}if(k){k=console;var oe=k.error,be=typeof Symbol=="function"&&Symbol.toStringTag&&U[Symbol.toStringTag]||U.constructor.name||"Object";return oe.call(k,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",be),e(U)}}function a(U){if(U===B)return"<>";if(typeof U=="object"&&U!==null&&U.$$typeof===Se)return"<...>";try{var k=n(U);return k?"<"+k+">":"<...>"}catch{return"<...>"}}function r(){var U=se.A;return U===null?null:U.getOwner()}function u(){return Error("react-stack-top-frame")}function h(U){if(Le.call(U,"key")){var k=Object.getOwnPropertyDescriptor(U,"key").get;if(k&&k.isReactWarning)return!1}return U.key!==void 0}function d(U,k){function oe(){St||(St=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",k))}oe.isReactWarning=!0,Object.defineProperty(U,"key",{get:oe,configurable:!0})}function m(){var U=n(this.type);return j[U]||(j[U]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),U=this.props.ref,U!==void 0?U:null}function y(U,k,oe,be,Ae,De,ze,wt){return oe=De.ref,U={$$typeof:E,type:U,key:k,props:De,_owner:Ae},(oe!==void 0?oe:null)!==null?Object.defineProperty(U,"ref",{enumerable:!1,get:m}):Object.defineProperty(U,"ref",{enumerable:!1,value:null}),U._store={},Object.defineProperty(U._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(U,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(U,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:ze}),Object.defineProperty(U,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:wt}),Object.freeze&&(Object.freeze(U.props),Object.freeze(U)),U}function b(U,k,oe,be,Ae,De,ze,wt){var je=k.children;if(je!==void 0)if(be)if(ae(je)){for(be=0;be<je.length;be++)S(je[be]);Object.freeze&&Object.freeze(je)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else S(je);if(Le.call(k,"key")){je=n(U);var $t=Object.keys(k).filter(function(Wn){return Wn!=="key"});be=0<$t.length?"{key: someKey, "+$t.join(": ..., ")+": ...}":"{key: someKey}",pe[je+be]||($t=0<$t.length?"{"+$t.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
46
|
+
let props = %s;
|
|
47
|
+
<%s {...props} />
|
|
48
|
+
React keys must be passed directly to JSX without using spread:
|
|
49
|
+
let props = %s;
|
|
50
|
+
<%s key={someKey} {...props} />`,be,je,$t,je),pe[je+be]=!0)}if(je=null,oe!==void 0&&(t(oe),je=""+oe),h(k)&&(t(k.key),je=""+k.key),"key"in k){oe={};for(var Ni in k)Ni!=="key"&&(oe[Ni]=k[Ni])}else oe=k;return je&&d(oe,typeof U=="function"?U.displayName||U.name||"Unknown":U),y(U,je,De,Ae,r(),oe,ze,wt)}function S(U){typeof U=="object"&&U!==null&&U.$$typeof===E&&U._store&&(U._store.validated=1)}var T=_c(),E=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),B=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),w=Symbol.for("react.consumer"),P=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),Z=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),ne=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),_e=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),se=T.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Le=Object.prototype.hasOwnProperty,ae=Array.isArray,We=console.createTask?console.createTask:function(){return null};T={react_stack_bottom_frame:function(U){return U()}};var St,j={},ee=T.react_stack_bottom_frame.bind(T,u)(),de=We(a(u)),pe={};Xf.Fragment=B,Xf.jsx=function(U,k,oe,be,Ae){var De=1e4>se.recentlyCreatedOwnerStacks++;return b(U,k,oe,!1,be,Ae,De?Error("react-stack-top-frame"):ee,De?We(a(U)):de)},Xf.jsxs=function(U,k,oe,be,Ae){var De=1e4>se.recentlyCreatedOwnerStacks++;return b(U,k,oe,!0,be,Ae,De?Error("react-stack-top-frame"):ee,De?We(a(U)):de)}}()),Xf}var ox;function mA(){return ox||(ox=1,process.env.NODE_ENV==="production"?Ri.exports=hA():Ri.exports=pA()),Ri.exports}var Ai=mA(),He=_c();function ux(n,e,t){if(!n)return;if(t(n)===!0)return n;let a=n.child;for(;a;){const r=ux(a,e,t);if(r)return r;a=a.sibling}}function cx(n){try{return Object.defineProperties(n,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return n}}const d_=cx(He.createContext(null));let hx=class extends He.Component{render(){return He.createElement(d_.Provider,{value:this._reactInternals},this.props.children)}};function yA(){const n=He.useContext(d_);if(n===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=He.useId();return He.useMemo(()=>{for(const t of[n,n==null?void 0:n.alternate]){if(!t)continue;const a=ux(t,!1,r=>{let u=r.memoizedState;for(;u;){if(u.memoizedState===e)return!0;u=u.next}});if(a)return a}},[n,e])}const gA=Symbol.for("react.context"),_A=n=>n!==null&&typeof n=="object"&&"$$typeof"in n&&n.$$typeof===gA;function vA(){const n=yA(),[e]=He.useState(()=>new Map);e.clear();let t=n;for(;t;){const a=t.type;_A(a)&&a!==d_&&!e.has(a)&&e.set(a,He.use(cx(a))),t=t.return}return e}function bA(){const n=vA();return He.useMemo(()=>Array.from(n.keys()).reduce((e,t)=>a=>He.createElement(e,null,He.createElement(t.Provider,{...a,value:n.get(t)})),e=>He.createElement(hx,{...e})),[n])}var Q=(n=>(n.Application="application",n.WebGLPipes="webgl-pipes",n.WebGLPipesAdaptor="webgl-pipes-adaptor",n.WebGLSystem="webgl-system",n.WebGPUPipes="webgpu-pipes",n.WebGPUPipesAdaptor="webgpu-pipes-adaptor",n.WebGPUSystem="webgpu-system",n.CanvasSystem="canvas-system",n.CanvasPipesAdaptor="canvas-pipes-adaptor",n.CanvasPipes="canvas-pipes",n.Asset="asset",n.LoadParser="load-parser",n.ResolveParser="resolve-parser",n.CacheParser="cache-parser",n.DetectionParser="detection-parser",n.MaskEffect="mask-effect",n.BlendMode="blend-mode",n.TextureSource="texture-source",n.Environment="environment",n.ShapeBuilder="shape-builder",n.Batcher="batcher",n))(Q||{});const p_=n=>{if(typeof n=="function"||typeof n=="object"&&n.extension){if(!n.extension)throw new Error("Extension class must have an extension object");n={...typeof n.extension!="object"?{type:n.extension}:n.extension,ref:n}}if(typeof n=="object")n={...n};else throw new Error("Invalid extension type");return typeof n.type=="string"&&(n.type=[n.type]),n},Fm=(n,e)=>p_(n).priority??e,Ie={_addHandlers:{},_removeHandlers:{},_queue:{},remove(...n){return n.map(p_).forEach(e=>{e.type.forEach(t=>{var a,r;return(r=(a=this._removeHandlers)[t])==null?void 0:r.call(a,e)})}),this},add(...n){return n.map(p_).forEach(e=>{e.type.forEach(t=>{var u,h;const a=this._addHandlers,r=this._queue;a[t]?(h=a[t])==null||h.call(a,e):(r[t]=r[t]||[],(u=r[t])==null||u.push(e))})}),this},handle(n,e,t){var h;const a=this._addHandlers,r=this._removeHandlers;if(a[n]||r[n])throw new Error(`Extension type ${n} already has a handler`);a[n]=e,r[n]=t;const u=this._queue;return u[n]&&((h=u[n])==null||h.forEach(d=>e(d)),delete u[n]),this},handleByMap(n,e){return this.handle(n,t=>{t.name&&(e[t.name]=t.ref)},t=>{t.name&&delete e[t.name]})},handleByNamedList(n,e,t=-1){return this.handle(n,a=>{e.findIndex(u=>u.name===a.name)>=0||(e.push({name:a.name,value:a.ref}),e.sort((u,h)=>Fm(h.value,t)-Fm(u.value,t)))},a=>{const r=e.findIndex(u=>u.name===a.name);r!==-1&&e.splice(r,1)})},handleByList(n,e,t=-1){return this.handle(n,a=>{e.includes(a.ref)||(e.push(a.ref),e.sort((r,u)=>Fm(u,t)-Fm(r,t)))},a=>{const r=e.indexOf(a.ref);r!==-1&&e.splice(r,1)})},mixin(n,...e){for(const t of e)Object.defineProperties(n.prototype,Object.getOwnPropertyDescriptors(t))}},xA={extension:{type:Q.Environment,name:"browser",priority:-1},test:()=>!0,load:async()=>{await Promise.resolve().then(()=>XG)}},SA={extension:{type:Q.Environment,name:"webworker",priority:0},test:()=>typeof self<"u"&&self.WorkerGlobalScope!==void 0,load:async()=>{await Promise.resolve().then(()=>qG)}};class Mi{constructor(e,t,a){this._x=t||0,this._y=a||0,this._observer=e}clone(e){return new Mi(e??this._observer,this._x,this._y)}set(e=0,t=e){return(this._x!==e||this._y!==t)&&(this._x=e,this._y=t,this._observer._onUpdate(this)),this}copyFrom(e){return(this._x!==e.x||this._y!==e.y)&&(this._x=e.x,this._y=e.y,this._observer._onUpdate(this)),this}copyTo(e){return e.set(this._x,this._y),e}equals(e){return e.x===this._x&&e.y===this._y}toString(){return`[pixi.js/math:ObservablePoint x=${this._x} y=${this._y} scope=${this._observer}]`}get x(){return this._x}set x(e){this._x!==e&&(this._x=e,this._observer._onUpdate(this))}get y(){return this._y}set y(e){this._y!==e&&(this._y=e,this._observer._onUpdate(this))}}var m_={exports:{}},fx;function TA(){return fx||(fx=1,function(n){var e=Object.prototype.hasOwnProperty,t="~";function a(){}Object.create&&(a.prototype=Object.create(null),new a().__proto__||(t=!1));function r(m,y,b){this.fn=m,this.context=y,this.once=b||!1}function u(m,y,b,S,T){if(typeof b!="function")throw new TypeError("The listener must be a function");var E=new r(b,S||m,T),A=t?t+y:y;return m._events[A]?m._events[A].fn?m._events[A]=[m._events[A],E]:m._events[A].push(E):(m._events[A]=E,m._eventsCount++),m}function h(m,y){--m._eventsCount===0?m._events=new a:delete m._events[y]}function d(){this._events=new a,this._eventsCount=0}d.prototype.eventNames=function(){var y=[],b,S;if(this._eventsCount===0)return y;for(S in b=this._events)e.call(b,S)&&y.push(t?S.slice(1):S);return Object.getOwnPropertySymbols?y.concat(Object.getOwnPropertySymbols(b)):y},d.prototype.listeners=function(y){var b=t?t+y:y,S=this._events[b];if(!S)return[];if(S.fn)return[S.fn];for(var T=0,E=S.length,A=new Array(E);T<E;T++)A[T]=S[T].fn;return A},d.prototype.listenerCount=function(y){var b=t?t+y:y,S=this._events[b];return S?S.fn?1:S.length:0},d.prototype.emit=function(y,b,S,T,E,A){var B=t?t+y:y;if(!this._events[B])return!1;var M=this._events[B],G=arguments.length,w,P;if(M.fn){switch(M.once&&this.removeListener(y,M.fn,void 0,!0),G){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,b),!0;case 3:return M.fn.call(M.context,b,S),!0;case 4:return M.fn.call(M.context,b,S,T),!0;case 5:return M.fn.call(M.context,b,S,T,E),!0;case 6:return M.fn.call(M.context,b,S,T,E,A),!0}for(P=1,w=new Array(G-1);P<G;P++)w[P-1]=arguments[P];M.fn.apply(M.context,w)}else{var z=M.length,Z;for(P=0;P<z;P++)switch(M[P].once&&this.removeListener(y,M[P].fn,void 0,!0),G){case 1:M[P].fn.call(M[P].context);break;case 2:M[P].fn.call(M[P].context,b);break;case 3:M[P].fn.call(M[P].context,b,S);break;case 4:M[P].fn.call(M[P].context,b,S,T);break;default:if(!w)for(Z=1,w=new Array(G-1);Z<G;Z++)w[Z-1]=arguments[Z];M[P].fn.apply(M[P].context,w)}}return!0},d.prototype.on=function(y,b,S){return u(this,y,b,S,!1)},d.prototype.once=function(y,b,S){return u(this,y,b,S,!0)},d.prototype.removeListener=function(y,b,S,T){var E=t?t+y:y;if(!this._events[E])return this;if(!b)return h(this,E),this;var A=this._events[E];if(A.fn)A.fn===b&&(!T||A.once)&&(!S||A.context===S)&&h(this,E);else{for(var B=0,M=[],G=A.length;B<G;B++)(A[B].fn!==b||T&&!A[B].once||S&&A[B].context!==S)&&M.push(A[B]);M.length?this._events[E]=M.length===1?M[0]:M:h(this,E)}return this},d.prototype.removeAllListeners=function(y){var b;return y?(b=t?t+y:y,this._events[b]&&h(this,b)):(this._events=new a,this._eventsCount=0),this},d.prototype.off=d.prototype.removeListener,d.prototype.addListener=d.prototype.on,d.prefixed=t,d.EventEmitter=d,n.exports=d}(m_)),m_.exports}var EA=TA();const Sa=xa(EA),CA=Math.PI*2,RA=180/Math.PI,AA=Math.PI/180;class qt{constructor(e=0,t=0){this.x=0,this.y=0,this.x=e,this.y=t}clone(){return new qt(this.x,this.y)}copyFrom(e){return this.set(e.x,e.y),this}copyTo(e){return e.set(this.x,this.y),e}equals(e){return e.x===this.x&&e.y===this.y}set(e=0,t=e){return this.x=e,this.y=t,this}toString(){return`[pixi.js/math:Point x=${this.x} y=${this.y}]`}static get shared(){return y_.x=0,y_.y=0,y_}}const y_=new qt;class Pe{constructor(e=1,t=0,a=0,r=1,u=0,h=0){this.array=null,this.a=e,this.b=t,this.c=a,this.d=r,this.tx=u,this.ty=h}fromArray(e){this.a=e[0],this.b=e[1],this.c=e[3],this.d=e[4],this.tx=e[2],this.ty=e[5]}set(e,t,a,r,u,h){return this.a=e,this.b=t,this.c=a,this.d=r,this.tx=u,this.ty=h,this}toArray(e,t){this.array||(this.array=new Float32Array(9));const a=t||this.array;return e?(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(e,t){t=t||new qt;const a=e.x,r=e.y;return t.x=this.a*a+this.c*r+this.tx,t.y=this.b*a+this.d*r+this.ty,t}applyInverse(e,t){t=t||new qt;const a=this.a,r=this.b,u=this.c,h=this.d,d=this.tx,m=this.ty,y=1/(a*h+u*-r),b=e.x,S=e.y;return t.x=h*y*b+-u*y*S+(m*u-d*h)*y,t.y=a*y*S+-r*y*b+(-m*a+d*r)*y,t}translate(e,t){return this.tx+=e,this.ty+=t,this}scale(e,t){return this.a*=e,this.d*=t,this.c*=e,this.b*=t,this.tx*=e,this.ty*=t,this}rotate(e){const t=Math.cos(e),a=Math.sin(e),r=this.a,u=this.c,h=this.tx;return this.a=r*t-this.b*a,this.b=r*a+this.b*t,this.c=u*t-this.d*a,this.d=u*a+this.d*t,this.tx=h*t-this.ty*a,this.ty=h*a+this.ty*t,this}append(e){const t=this.a,a=this.b,r=this.c,u=this.d;return this.a=e.a*t+e.b*r,this.b=e.a*a+e.b*u,this.c=e.c*t+e.d*r,this.d=e.c*a+e.d*u,this.tx=e.tx*t+e.ty*r+this.tx,this.ty=e.tx*a+e.ty*u+this.ty,this}appendFrom(e,t){const a=e.a,r=e.b,u=e.c,h=e.d,d=e.tx,m=e.ty,y=t.a,b=t.b,S=t.c,T=t.d;return this.a=a*y+r*S,this.b=a*b+r*T,this.c=u*y+h*S,this.d=u*b+h*T,this.tx=d*y+m*S+t.tx,this.ty=d*b+m*T+t.ty,this}setTransform(e,t,a,r,u,h,d,m,y){return this.a=Math.cos(d+y)*u,this.b=Math.sin(d+y)*u,this.c=-Math.sin(d-m)*h,this.d=Math.cos(d-m)*h,this.tx=e-(a*this.a+r*this.c),this.ty=t-(a*this.b+r*this.d),this}prepend(e){const t=this.tx;if(e.a!==1||e.b!==0||e.c!==0||e.d!==1){const a=this.a,r=this.c;this.a=a*e.a+this.b*e.c,this.b=a*e.b+this.b*e.d,this.c=r*e.a+this.d*e.c,this.d=r*e.b+this.d*e.d}return this.tx=t*e.a+this.ty*e.c+e.tx,this.ty=t*e.b+this.ty*e.d+e.ty,this}decompose(e){const t=this.a,a=this.b,r=this.c,u=this.d,h=e.pivot,d=-Math.atan2(-r,u),m=Math.atan2(a,t),y=Math.abs(d+m);return y<1e-5||Math.abs(CA-y)<1e-5?(e.rotation=m,e.skew.x=e.skew.y=0):(e.rotation=0,e.skew.x=d,e.skew.y=m),e.scale.x=Math.sqrt(t*t+a*a),e.scale.y=Math.sqrt(r*r+u*u),e.position.x=this.tx+(h.x*t+h.y*r),e.position.y=this.ty+(h.x*a+h.y*u),e}invert(){const e=this.a,t=this.b,a=this.c,r=this.d,u=this.tx,h=e*r-t*a;return this.a=r/h,this.b=-t/h,this.c=-a/h,this.d=e/h,this.tx=(a*this.ty-r*u)/h,this.ty=-(e*this.ty-t*u)/h,this}isIdentity(){return this.a===1&&this.b===0&&this.c===0&&this.d===1&&this.tx===0&&this.ty===0}identity(){return this.a=1,this.b=0,this.c=0,this.d=1,this.tx=0,this.ty=0,this}clone(){const e=new Pe;return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyTo(e){return e.a=this.a,e.b=this.b,e.c=this.c,e.d=this.d,e.tx=this.tx,e.ty=this.ty,e}copyFrom(e){return this.a=e.a,this.b=e.b,this.c=e.c,this.d=e.d,this.tx=e.tx,this.ty=e.ty,this}equals(e){return e.a===this.a&&e.b===this.b&&e.c===this.c&&e.d===this.d&&e.tx===this.tx&&e.ty===this.ty}toString(){return`[pixi.js:Matrix a=${this.a} b=${this.b} c=${this.c} d=${this.d} tx=${this.tx} ty=${this.ty}]`}static get IDENTITY(){return DA.identity()}static get shared(){return MA.identity()}}const MA=new Pe,DA=new Pe,eu=[1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1,0,1],tu=[0,1,1,1,0,-1,-1,-1,0,1,1,1,0,-1,-1,-1],nu=[0,-1,-1,-1,0,1,1,1,0,1,1,1,0,-1,-1,-1],iu=[1,1,0,-1,-1,-1,0,1,-1,-1,0,1,1,1,0,-1],g_=[],dx=[],Im=Math.sign;function UA(){for(let n=0;n<16;n++){const e=[];g_.push(e);for(let t=0;t<16;t++){const a=Im(eu[n]*eu[t]+nu[n]*tu[t]),r=Im(tu[n]*eu[t]+iu[n]*tu[t]),u=Im(eu[n]*nu[t]+nu[n]*iu[t]),h=Im(tu[n]*nu[t]+iu[n]*iu[t]);for(let d=0;d<16;d++)if(eu[d]===a&&tu[d]===r&&nu[d]===u&&iu[d]===h){e.push(d);break}}}for(let n=0;n<16;n++){const e=new Pe;e.set(eu[n],tu[n],nu[n],iu[n],0,0),dx.push(e)}}UA();const Vt={E:0,SE:1,S:2,SW:3,W:4,NW:5,N:6,NE:7,MIRROR_VERTICAL:8,MAIN_DIAGONAL:10,MIRROR_HORIZONTAL:12,REVERSE_DIAGONAL:14,uX:n=>eu[n],uY:n=>tu[n],vX:n=>nu[n],vY:n=>iu[n],inv:n=>n&8?n&15:-n&7,add:(n,e)=>g_[n][e],sub:(n,e)=>g_[n][Vt.inv(e)],rotate180:n=>n^4,isVertical:n=>(n&3)===2,byDirection:(n,e)=>Math.abs(n)*2<=Math.abs(e)?e>=0?Vt.S:Vt.N:Math.abs(e)*2<=Math.abs(n)?n>0?Vt.E:Vt.W:e>0?n>0?Vt.SE:Vt.SW:n>0?Vt.NE:Vt.NW,matrixAppendRotationInv:(n,e,t=0,a=0)=>{const r=dx[Vt.inv(e)];r.tx=t,r.ty=a,n.append(r)},transformRectCoords:(n,e,t,a)=>{const{x:r,y:u,width:h,height:d}=n,{x:m,y,width:b,height:S}=e;return t===Vt.E?(a.set(r+m,u+y,h,d),a):t===Vt.S?a.set(b-u-d+m,r+y,d,h):t===Vt.W?a.set(b-r-h+m,S-u-d+y,h,d):t===Vt.N?a.set(u+m,S-r-h+y,d,h):a.set(r+m,u+y,h,d)}},km=[new qt,new qt,new qt,new qt];class Nt{constructor(e=0,t=0,a=0,r=0){this.type="rectangle",this.x=Number(e),this.y=Number(t),this.width=Number(a),this.height=Number(r)}get left(){return this.x}get right(){return this.x+this.width}get top(){return this.y}get bottom(){return this.y+this.height}isEmpty(){return this.left===this.right||this.top===this.bottom}static get EMPTY(){return new Nt(0,0,0,0)}clone(){return new Nt(this.x,this.y,this.width,this.height)}copyFromBounds(e){return this.x=e.minX,this.y=e.minY,this.width=e.maxX-e.minX,this.height=e.maxY-e.minY,this}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){return this.width<=0||this.height<=0?!1:e>=this.x&&e<this.x+this.width&&t>=this.y&&t<this.y+this.height}strokeContains(e,t,a,r=.5){const{width:u,height:h}=this;if(u<=0||h<=0)return!1;const d=this.x,m=this.y,y=a*(1-r),b=a-y,S=d-y,T=d+u+y,E=m-y,A=m+h+y,B=d+b,M=d+u-b,G=m+b,w=m+h-b;return e>=S&&e<=T&&t>=E&&t<=A&&!(e>B&&e<M&&t>G&&t<w)}intersects(e,t){if(!t){const Se=this.x<e.x?e.x:this.x;if((this.right>e.right?e.right:this.right)<=Se)return!1;const me=this.y<e.y?e.y:this.y;return(this.bottom>e.bottom?e.bottom:this.bottom)>me}const a=this.left,r=this.right,u=this.top,h=this.bottom;if(r<=a||h<=u)return!1;const d=km[0].set(e.left,e.top),m=km[1].set(e.left,e.bottom),y=km[2].set(e.right,e.top),b=km[3].set(e.right,e.bottom);if(y.x<=d.x||m.y<=d.y)return!1;const S=Math.sign(t.a*t.d-t.b*t.c);if(S===0||(t.apply(d,d),t.apply(m,m),t.apply(y,y),t.apply(b,b),Math.max(d.x,m.x,y.x,b.x)<=a||Math.min(d.x,m.x,y.x,b.x)>=r||Math.max(d.y,m.y,y.y,b.y)<=u||Math.min(d.y,m.y,y.y,b.y)>=h))return!1;const T=S*(m.y-d.y),E=S*(d.x-m.x),A=T*a+E*u,B=T*r+E*u,M=T*a+E*h,G=T*r+E*h;if(Math.max(A,B,M,G)<=T*d.x+E*d.y||Math.min(A,B,M,G)>=T*b.x+E*b.y)return!1;const w=S*(d.y-y.y),P=S*(y.x-d.x),z=w*a+P*u,Z=w*r+P*u,ie=w*a+P*h,ne=w*r+P*h;return!(Math.max(z,Z,ie,ne)<=w*d.x+P*d.y||Math.min(z,Z,ie,ne)>=w*b.x+P*b.y)}pad(e=0,t=e){return this.x-=e,this.y-=t,this.width+=e*2,this.height+=t*2,this}fit(e){const t=Math.max(this.x,e.x),a=Math.min(this.x+this.width,e.x+e.width),r=Math.max(this.y,e.y),u=Math.min(this.y+this.height,e.y+e.height);return this.x=t,this.width=Math.max(a-t,0),this.y=r,this.height=Math.max(u-r,0),this}ceil(e=1,t=.001){const a=Math.ceil((this.x+this.width-t)*e)/e,r=Math.ceil((this.y+this.height-t)*e)/e;return this.x=Math.floor((this.x+t)*e)/e,this.y=Math.floor((this.y+t)*e)/e,this.width=a-this.x,this.height=r-this.y,this}scale(e,t=e){return this.x*=e,this.y*=t,this.width*=e,this.height*=t,this}enlarge(e){const t=Math.min(this.x,e.x),a=Math.max(this.x+this.width,e.x+e.width),r=Math.min(this.y,e.y),u=Math.max(this.y+this.height,e.y+e.height);return this.x=t,this.width=a-t,this.y=r,this.height=u-r,this}getBounds(e){return e||(e=new Nt),e.copyFrom(this),e}containsRect(e){if(this.width<=0||this.height<=0)return!1;const t=e.x,a=e.y,r=e.x+e.width,u=e.y+e.height;return t>=this.x&&t<this.x+this.width&&a>=this.y&&a<this.y+this.height&&r>=this.x&&r<this.x+this.width&&u>=this.y&&u<this.y+this.height}set(e,t,a,r){return this.x=e,this.y=t,this.width=a,this.height=r,this}toString(){return`[pixi.js/math:Rectangle x=${this.x} y=${this.y} width=${this.width} height=${this.height}]`}}const __={default:-1};function Kt(n="default"){return __[n]===void 0&&(__[n]=-1),++__[n]}const px={},Rt="8.0.0",BA="8.3.4";function st(n,e,t=3){if(px[e])return;let a=new Error().stack;typeof a>"u"?console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
51
|
+
Deprecated since v${n}`):(a=a.split(`
|
|
52
|
+
`).splice(t).join(`
|
|
53
|
+
`),console.groupCollapsed?(console.groupCollapsed("%cPixiJS Deprecation Warning: %c%s","color:#614108;background:#fffbe6","font-weight:normal;color:#614108;background:#fffbe6",`${e}
|
|
54
|
+
Deprecated since v${n}`),console.warn(a),console.groupEnd()):(console.warn("PixiJS Deprecation Warning: ",`${e}
|
|
55
|
+
Deprecated since v${n}`),console.warn(a))),px[e]=!0}const mx=()=>{};function vc(n){return n+=n===0?1:0,--n,n|=n>>>1,n|=n>>>2,n|=n>>>4,n|=n>>>8,n|=n>>>16,n+1}function yx(n){return!(n&n-1)&&!!n}function gx(n){const e={};for(const t in n)n[t]!==void 0&&(e[t]=n[t]);return e}const _x=Object.create(null);function OA(n){const e=_x[n];return e===void 0&&(_x[n]=Kt("resource")),e}const vx=class LR extends Sa{constructor(e={}){super(),this._resourceType="textureSampler",this._touched=0,this._maxAnisotropy=1,this.destroyed=!1,e={...LR.defaultOptions,...e},this.addressMode=e.addressMode,this.addressModeU=e.addressModeU??this.addressModeU,this.addressModeV=e.addressModeV??this.addressModeV,this.addressModeW=e.addressModeW??this.addressModeW,this.scaleMode=e.scaleMode,this.magFilter=e.magFilter??this.magFilter,this.minFilter=e.minFilter??this.minFilter,this.mipmapFilter=e.mipmapFilter??this.mipmapFilter,this.lodMinClamp=e.lodMinClamp,this.lodMaxClamp=e.lodMaxClamp,this.compare=e.compare,this.maxAnisotropy=e.maxAnisotropy??1}set addressMode(e){this.addressModeU=e,this.addressModeV=e,this.addressModeW=e}get addressMode(){return this.addressModeU}set wrapMode(e){st(Rt,"TextureStyle.wrapMode is now TextureStyle.addressMode"),this.addressMode=e}get wrapMode(){return this.addressMode}set scaleMode(e){this.magFilter=e,this.minFilter=e,this.mipmapFilter=e}get scaleMode(){return this.magFilter}set maxAnisotropy(e){this._maxAnisotropy=Math.min(e,16),this._maxAnisotropy>1&&(this.scaleMode="linear")}get maxAnisotropy(){return this._maxAnisotropy}get _resourceId(){return this._sharedResourceId||this._generateResourceId()}update(){this.emit("change",this),this._sharedResourceId=null}_generateResourceId(){const e=`${this.addressModeU}-${this.addressModeV}-${this.addressModeW}-${this.magFilter}-${this.minFilter}-${this.mipmapFilter}-${this.lodMinClamp}-${this.lodMaxClamp}-${this.compare}-${this._maxAnisotropy}`;return this._sharedResourceId=OA(e),this._resourceId}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this.removeAllListeners()}};vx.defaultOptions={addressMode:"clamp-to-edge",scaleMode:"linear"};let Xl=vx;const bx=class jR extends Sa{constructor(e={}){super(),this.options=e,this.uid=Kt("textureSource"),this._resourceType="textureSource",this._resourceId=Kt("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.antialias=!1,this._touched=0,this._batchTick=-1,this._textureBindLocation=-1,e={...jR.defaultOptions,...e},this.label=e.label??"",this.resource=e.resource,this.autoGarbageCollect=e.autoGarbageCollect,this._resolution=e.resolution,e.width?this.pixelWidth=e.width*this._resolution:this.pixelWidth=this.resource?this.resourceWidth??1:1,e.height?this.pixelHeight=e.height*this._resolution:this.pixelHeight=this.resource?this.resourceHeight??1:1,this.width=this.pixelWidth/this._resolution,this.height=this.pixelHeight/this._resolution,this.format=e.format,this.dimension=e.dimensions,this.mipLevelCount=e.mipLevelCount,this.autoGenerateMipmaps=e.autoGenerateMipmaps,this.sampleCount=e.sampleCount,this.antialias=e.antialias,this.alphaMode=e.alphaMode,this.style=new Xl(gx(e)),this.destroyed=!1,this._refreshPOT()}get source(){return this}get style(){return this._style}set style(e){var t,a;this.style!==e&&((t=this._style)==null||t.off("change",this._onStyleChange,this),this._style=e,(a=this._style)==null||a.on("change",this._onStyleChange,this),this._onStyleChange())}set maxAnisotropy(e){this._style.maxAnisotropy=e}get maxAnisotropy(){return this._style.maxAnisotropy}get addressMode(){return this._style.addressMode}set addressMode(e){this._style.addressMode=e}get repeatMode(){return this._style.addressMode}set repeatMode(e){this._style.addressMode=e}get magFilter(){return this._style.magFilter}set magFilter(e){this._style.magFilter=e}get minFilter(){return this._style.minFilter}set minFilter(e){this._style.minFilter=e}get mipmapFilter(){return this._style.mipmapFilter}set mipmapFilter(e){this._style.mipmapFilter=e}get lodMinClamp(){return this._style.lodMinClamp}set lodMinClamp(e){this._style.lodMinClamp=e}get lodMaxClamp(){return this._style.lodMaxClamp}set lodMaxClamp(e){this._style.lodMaxClamp=e}_onStyleChange(){this.emit("styleChange",this)}update(){if(this.resource){const e=this._resolution;if(this.resize(this.resourceWidth/e,this.resourceHeight/e))return}this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._style&&(this._style.destroy(),this._style=null),this.uploadMethodId=null,this.resource=null,this.removeAllListeners()}unload(){this._resourceId=Kt("resource"),this.emit("change",this),this.emit("unload",this)}get resourceWidth(){const{resource:e}=this;return e.naturalWidth||e.videoWidth||e.displayWidth||e.width}get resourceHeight(){const{resource:e}=this;return e.naturalHeight||e.videoHeight||e.displayHeight||e.height}get resolution(){return this._resolution}set resolution(e){this._resolution!==e&&(this._resolution=e,this.width=this.pixelWidth/e,this.height=this.pixelHeight/e)}resize(e,t,a){a||(a=this._resolution),e||(e=this.width),t||(t=this.height);const r=Math.round(e*a),u=Math.round(t*a);return this.width=r/a,this.height=u/a,this._resolution=a,this.pixelWidth===r&&this.pixelHeight===u?!1:(this._refreshPOT(),this.pixelWidth=r,this.pixelHeight=u,this.emit("resize",this),this._resourceId=Kt("resource"),this.emit("change",this),!0)}updateMipmaps(){this.autoGenerateMipmaps&&this.mipLevelCount>1&&this.emit("updateMipmaps",this)}set wrapMode(e){this._style.wrapMode=e}get wrapMode(){return this._style.wrapMode}set scaleMode(e){this._style.scaleMode=e}get scaleMode(){return this._style.scaleMode}_refreshPOT(){this.isPowerOfTwo=yx(this.pixelWidth)&&yx(this.pixelHeight)}static test(e){throw new Error("Unimplemented")}};bx.defaultOptions={resolution:1,format:"bgra8unorm",alphaMode:"premultiply-alpha-on-upload",dimensions:"2d",mipLevelCount:1,autoGenerateMipmaps:!1,sampleCount:1,antialias:!1,autoGarbageCollect:!1};let Nn=bx;class v_ extends Nn{constructor(e){const t=e.resource||new Float32Array(e.width*e.height*4);let a=e.format;a||(t instanceof Float32Array?a="rgba32float":t instanceof Int32Array||t instanceof Uint32Array?a="rgba32uint":t instanceof Int16Array||t instanceof Uint16Array?a="rgba16uint":(t instanceof Int8Array,a="bgra8unorm")),super({...e,resource:t,format:a}),this.uploadMethodId="buffer"}static test(e){return e instanceof Int8Array||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array}}v_.extension=Q.TextureSource;const xx=new Pe;class Sx{constructor(e,t){this.mapCoord=new Pe,this.uClampFrame=new Float32Array(4),this.uClampOffset=new Float32Array(2),this._textureID=-1,this._updateID=0,this.clampOffset=0,typeof t>"u"?this.clampMargin=e.width<10?0:.5:this.clampMargin=t,this.isSimple=!1,this.texture=e}get texture(){return this._texture}set texture(e){var t;this.texture!==e&&((t=this._texture)==null||t.removeListener("update",this.update,this),this._texture=e,this._texture.addListener("update",this.update,this),this.update())}multiplyUvs(e,t){t===void 0&&(t=e);const a=this.mapCoord;for(let r=0;r<e.length;r+=2){const u=e[r],h=e[r+1];t[r]=u*a.a+h*a.c+a.tx,t[r+1]=u*a.b+h*a.d+a.ty}return t}update(){const e=this._texture;this._updateID++;const t=e.uvs;this.mapCoord.set(t.x1-t.x0,t.y1-t.y0,t.x3-t.x0,t.y3-t.y0,t.x0,t.y0);const a=e.orig,r=e.trim;r&&(xx.set(a.width/r.width,0,0,a.height/r.height,-r.x/r.width,-r.y/r.height),this.mapCoord.append(xx));const u=e.source,h=this.uClampFrame,d=this.clampMargin/u._resolution,m=this.clampOffset/u._resolution;return h[0]=(e.frame.x+d+m)/u.width,h[1]=(e.frame.y+d+m)/u.height,h[2]=(e.frame.x+e.frame.width-d+m)/u.width,h[3]=(e.frame.y+e.frame.height-d+m)/u.height,this.uClampOffset[0]=this.clampOffset/u.pixelWidth,this.uClampOffset[1]=this.clampOffset/u.pixelHeight,this.isSimple=e.frame.width===u.width&&e.frame.height===u.height&&e.rotate===0,!0}}class Ge extends Sa{constructor({source:e,label:t,frame:a,orig:r,trim:u,defaultAnchor:h,defaultBorders:d,rotate:m,dynamic:y}={}){if(super(),this.uid=Kt("texture"),this.uvs={x0:0,y0:0,x1:0,y1:0,x2:0,y2:0,x3:0,y3:0},this.frame=new Nt,this.noFrame=!1,this.dynamic=!1,this.isTexture=!0,this.label=t,this.source=(e==null?void 0:e.source)??new Nn,this.noFrame=!a,a)this.frame.copyFrom(a);else{const{width:b,height:S}=this._source;this.frame.width=b,this.frame.height=S}this.orig=r||this.frame,this.trim=u,this.rotate=m??0,this.defaultAnchor=h,this.defaultBorders=d,this.destroyed=!1,this.dynamic=y||!1,this.updateUvs()}set source(e){this._source&&this._source.off("resize",this.update,this),this._source=e,e.on("resize",this.update,this),this.emit("update",this)}get source(){return this._source}get textureMatrix(){return this._textureMatrix||(this._textureMatrix=new Sx(this)),this._textureMatrix}get width(){return this.orig.width}get height(){return this.orig.height}updateUvs(){const{uvs:e,frame:t}=this,{width:a,height:r}=this._source,u=t.x/a,h=t.y/r,d=t.width/a,m=t.height/r;let y=this.rotate;if(y){const b=d/2,S=m/2,T=u+b,E=h+S;y=Vt.add(y,Vt.NW),e.x0=T+b*Vt.uX(y),e.y0=E+S*Vt.uY(y),y=Vt.add(y,2),e.x1=T+b*Vt.uX(y),e.y1=E+S*Vt.uY(y),y=Vt.add(y,2),e.x2=T+b*Vt.uX(y),e.y2=E+S*Vt.uY(y),y=Vt.add(y,2),e.x3=T+b*Vt.uX(y),e.y3=E+S*Vt.uY(y)}else e.x0=u,e.y0=h,e.x1=u+d,e.y1=h,e.x2=u+d,e.y2=h+m,e.x3=u,e.y3=h+m}destroy(e=!1){this._source&&e&&(this._source.destroy(),this._source=null),this._textureMatrix=null,this.destroyed=!0,this.emit("destroy",this),this.removeAllListeners()}update(){this.noFrame&&(this.frame.width=this._source.width,this.frame.height=this._source.height),this.updateUvs(),this.emit("update",this)}get baseTexture(){return st(Rt,"Texture.baseTexture is now Texture.source"),this._source}}Ge.EMPTY=new Ge({label:"EMPTY",source:new Nn({label:"EMPTY"})}),Ge.EMPTY.destroy=mx,Ge.WHITE=new Ge({source:new v_({resource:new Uint8Array([255,255,255,255]),width:1,height:1,alphaMode:"premultiply-alpha-on-upload",label:"WHITE"}),label:"WHITE"}),Ge.WHITE.destroy=mx;function Tx(n,e,t){const{width:a,height:r}=t.orig,u=t.trim;if(u){const h=u.width,d=u.height;n.minX=u.x-e._x*a,n.maxX=n.minX+h,n.minY=u.y-e._y*r,n.maxY=n.minY+d}else n.minX=-e._x*a,n.maxX=n.minX+a,n.minY=-e._y*r,n.maxY=n.minY+r}const Ex=new Pe;class ci{constructor(e=1/0,t=1/0,a=-1/0,r=-1/0){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ex,this.minX=e,this.minY=t,this.maxX=a,this.maxY=r}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}get rectangle(){this._rectangle||(this._rectangle=new Nt);const e=this._rectangle;return this.minX>this.maxX||this.minY>this.maxY?(e.x=0,e.y=0,e.width=0,e.height=0):e.copyFromBounds(this),e}clear(){return this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.matrix=Ex,this}set(e,t,a,r){this.minX=e,this.minY=t,this.maxX=a,this.maxY=r}addFrame(e,t,a,r,u){u||(u=this.matrix);const h=u.a,d=u.b,m=u.c,y=u.d,b=u.tx,S=u.ty;let T=this.minX,E=this.minY,A=this.maxX,B=this.maxY,M=h*e+m*t+b,G=d*e+y*t+S;M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>B&&(B=G),M=h*a+m*t+b,G=d*a+y*t+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>B&&(B=G),M=h*e+m*r+b,G=d*e+y*r+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>B&&(B=G),M=h*a+m*r+b,G=d*a+y*r+S,M<T&&(T=M),G<E&&(E=G),M>A&&(A=M),G>B&&(B=G),this.minX=T,this.minY=E,this.maxX=A,this.maxY=B}addRect(e,t){this.addFrame(e.x,e.y,e.x+e.width,e.y+e.height,t)}addBounds(e,t){this.addFrame(e.minX,e.minY,e.maxX,e.maxY,t)}addBoundsMask(e){this.minX=this.minX>e.minX?this.minX:e.minX,this.minY=this.minY>e.minY?this.minY:e.minY,this.maxX=this.maxX<e.maxX?this.maxX:e.maxX,this.maxY=this.maxY<e.maxY?this.maxY:e.maxY}applyMatrix(e){const t=this.minX,a=this.minY,r=this.maxX,u=this.maxY,{a:h,b:d,c:m,d:y,tx:b,ty:S}=e;let T=h*t+m*a+b,E=d*t+y*a+S;this.minX=T,this.minY=E,this.maxX=T,this.maxY=E,T=h*r+m*a+b,E=d*r+y*a+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY,T=h*t+m*u+b,E=d*t+y*u+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY,T=h*r+m*u+b,E=d*r+y*u+S,this.minX=T<this.minX?T:this.minX,this.minY=E<this.minY?E:this.minY,this.maxX=T>this.maxX?T:this.maxX,this.maxY=E>this.maxY?E:this.maxY}fit(e){return this.minX<e.left&&(this.minX=e.left),this.maxX>e.right&&(this.maxX=e.right),this.minY<e.top&&(this.minY=e.top),this.maxY>e.bottom&&(this.maxY=e.bottom),this}fitBounds(e,t,a,r){return this.minX<e&&(this.minX=e),this.maxX>t&&(this.maxX=t),this.minY<a&&(this.minY=a),this.maxY>r&&(this.maxY=r),this}pad(e,t=e){return this.minX-=e,this.maxX+=e,this.minY-=t,this.maxY+=t,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 ci(this.minX,this.minY,this.maxX,this.maxY)}scale(e,t=e){return this.minX*=e,this.minY*=t,this.maxX*=e,this.maxY*=t,this}get x(){return this.minX}set x(e){const t=this.maxX-this.minX;this.minX=e,this.maxX=e+t}get y(){return this.minY}set y(e){const t=this.maxY-this.minY;this.minY=e,this.maxY=e+t}get width(){return this.maxX-this.minX}set width(e){this.maxX=this.minX+e}get height(){return this.maxY-this.minY}set height(e){this.maxY=this.minY+e}get left(){return this.minX}get right(){return this.maxX}get top(){return this.minY}get bottom(){return this.maxY}get isPositive(){return this.maxX-this.minX>0&&this.maxY-this.minY>0}get isValid(){return this.minX+this.minY!==1/0}addVertexData(e,t,a,r){let u=this.minX,h=this.minY,d=this.maxX,m=this.maxY;r||(r=this.matrix);const y=r.a,b=r.b,S=r.c,T=r.d,E=r.tx,A=r.ty;for(let B=t;B<a;B+=2){const M=e[B],G=e[B+1],w=y*M+S*G+E,P=b*M+T*G+A;u=w<u?w:u,h=P<h?P:h,d=w>d?w:d,m=P>m?P:m}this.minX=u,this.minY=h,this.maxX=d,this.maxY=m}containsPoint(e,t){return this.minX<=e&&this.minY<=t&&this.maxX>=e&&this.maxY>=t}toString(){return`[pixi.js:Bounds minX=${this.minX} minY=${this.minY} maxX=${this.maxX} maxY=${this.maxY} width=${this.width} height=${this.height}]`}copyFrom(e){return this.minX=e.minX,this.minY=e.minY,this.maxX=e.maxX,this.maxY=e.maxY,this}}var NA={grad:.9,turn:360,rad:360/(2*Math.PI)},Zr=function(n){return typeof n=="string"?n.length>0:typeof n=="number"},Zn=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=Math.pow(10,e)),Math.round(t*n)/t+0},Fa=function(n,e,t){return e===void 0&&(e=0),t===void 0&&(t=1),n>t?t:n>e?n:e},Cx=function(n){return(n=isFinite(n)?n%360:0)>0?n:n+360},Rx=function(n){return{r:Fa(n.r,0,255),g:Fa(n.g,0,255),b:Fa(n.b,0,255),a:Fa(n.a)}},b_=function(n){return{r:Zn(n.r),g:Zn(n.g),b:Zn(n.b),a:Zn(n.a,3)}},GA=/^#([0-9a-f]{3,8})$/i,Km=function(n){var e=n.toString(16);return e.length<2?"0"+e:e},Ax=function(n){var e=n.r,t=n.g,a=n.b,r=n.a,u=Math.max(e,t,a),h=u-Math.min(e,t,a),d=h?u===e?(t-a)/h:u===t?2+(a-e)/h:4+(e-t)/h:0;return{h:60*(d<0?d+6:d),s:u?h/u*100:0,v:u/255*100,a:r}},Mx=function(n){var e=n.h,t=n.s,a=n.v,r=n.a;e=e/360*6,t/=100,a/=100;var u=Math.floor(e),h=a*(1-t),d=a*(1-(e-u)*t),m=a*(1-(1-e+u)*t),y=u%6;return{r:255*[a,d,h,h,m,a][y],g:255*[m,a,a,d,h,h][y],b:255*[h,h,m,a,a,d][y],a:r}},Dx=function(n){return{h:Cx(n.h),s:Fa(n.s,0,100),l:Fa(n.l,0,100),a:Fa(n.a)}},Ux=function(n){return{h:Zn(n.h),s:Zn(n.s),l:Zn(n.l),a:Zn(n.a,3)}},Bx=function(n){return Mx((t=(e=n).s,{h:e.h,s:(t*=((a=e.l)<50?a:100-a)/100)>0?2*t/(a+t)*100:0,v:a+t,a:e.a}));var e,t,a},Ff=function(n){return{h:(e=Ax(n)).h,s:(r=(200-(t=e.s))*(a=e.v)/100)>0&&r<200?t*a/100/(r<=100?r:200-r)*100:0,l:r/2,a:e.a};var e,t,a,r},wA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s*,\s*([+-]?\d*\.?\d+)%\s*,\s*([+-]?\d*\.?\d+)%\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,PA=/^hsla?\(\s*([+-]?\d*\.?\d+)(deg|rad|grad|turn)?\s+([+-]?\d*\.?\d+)%\s+([+-]?\d*\.?\d+)%\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,zA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*,\s*([+-]?\d*\.?\d+)(%)?\s*(?:,\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,HA=/^rgba?\(\s*([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s+([+-]?\d*\.?\d+)(%)?\s*(?:\/\s*([+-]?\d*\.?\d+)(%)?\s*)?\)$/i,x_={string:[[function(n){var e=GA.exec(n);return e?(n=e[1]).length<=4?{r:parseInt(n[0]+n[0],16),g:parseInt(n[1]+n[1],16),b:parseInt(n[2]+n[2],16),a:n.length===4?Zn(parseInt(n[3]+n[3],16)/255,2):1}:n.length===6||n.length===8?{r:parseInt(n.substr(0,2),16),g:parseInt(n.substr(2,2),16),b:parseInt(n.substr(4,2),16),a:n.length===8?Zn(parseInt(n.substr(6,2),16)/255,2):1}:null:null},"hex"],[function(n){var e=zA.exec(n)||HA.exec(n);return e?e[2]!==e[4]||e[4]!==e[6]?null:Rx({r:Number(e[1])/(e[2]?100/255:1),g:Number(e[3])/(e[4]?100/255:1),b:Number(e[5])/(e[6]?100/255:1),a:e[7]===void 0?1:Number(e[7])/(e[8]?100:1)}):null},"rgb"],[function(n){var e=wA.exec(n)||PA.exec(n);if(!e)return null;var t,a,r=Dx({h:(t=e[1],a=e[2],a===void 0&&(a="deg"),Number(t)*(NA[a]||1)),s:Number(e[3]),l:Number(e[4]),a:e[5]===void 0?1:Number(e[5])/(e[6]?100:1)});return Bx(r)},"hsl"]],object:[[function(n){var e=n.r,t=n.g,a=n.b,r=n.a,u=r===void 0?1:r;return Zr(e)&&Zr(t)&&Zr(a)?Rx({r:Number(e),g:Number(t),b:Number(a),a:Number(u)}):null},"rgb"],[function(n){var e=n.h,t=n.s,a=n.l,r=n.a,u=r===void 0?1:r;if(!Zr(e)||!Zr(t)||!Zr(a))return null;var h=Dx({h:Number(e),s:Number(t),l:Number(a),a:Number(u)});return Bx(h)},"hsl"],[function(n){var e=n.h,t=n.s,a=n.v,r=n.a,u=r===void 0?1:r;if(!Zr(e)||!Zr(t)||!Zr(a))return null;var h=function(d){return{h:Cx(d.h),s:Fa(d.s,0,100),v:Fa(d.v,0,100),a:Fa(d.a)}}({h:Number(e),s:Number(t),v:Number(a),a:Number(u)});return Mx(h)},"hsv"]]},Ox=function(n,e){for(var t=0;t<e.length;t++){var a=e[t][0](n);if(a)return[a,e[t][1]]}return[null,void 0]},VA=function(n){return typeof n=="string"?Ox(n.trim(),x_.string):typeof n=="object"&&n!==null?Ox(n,x_.object):[null,void 0]},S_=function(n,e){var t=Ff(n);return{h:t.h,s:Fa(t.s+100*e,0,100),l:t.l,a:t.a}},T_=function(n){return(299*n.r+587*n.g+114*n.b)/1e3/255},Nx=function(n,e){var t=Ff(n);return{h:t.h,s:t.s,l:Fa(t.l+100*e,0,100),a:t.a}},E_=function(){function n(e){this.parsed=VA(e)[0],this.rgba=this.parsed||{r:0,g:0,b:0,a:1}}return n.prototype.isValid=function(){return this.parsed!==null},n.prototype.brightness=function(){return Zn(T_(this.rgba),2)},n.prototype.isDark=function(){return T_(this.rgba)<.5},n.prototype.isLight=function(){return T_(this.rgba)>=.5},n.prototype.toHex=function(){return e=b_(this.rgba),t=e.r,a=e.g,r=e.b,h=(u=e.a)<1?Km(Zn(255*u)):"","#"+Km(t)+Km(a)+Km(r)+h;var e,t,a,r,u,h},n.prototype.toRgb=function(){return b_(this.rgba)},n.prototype.toRgbString=function(){return e=b_(this.rgba),t=e.r,a=e.g,r=e.b,(u=e.a)<1?"rgba("+t+", "+a+", "+r+", "+u+")":"rgb("+t+", "+a+", "+r+")";var e,t,a,r,u},n.prototype.toHsl=function(){return Ux(Ff(this.rgba))},n.prototype.toHslString=function(){return e=Ux(Ff(this.rgba)),t=e.h,a=e.s,r=e.l,(u=e.a)<1?"hsla("+t+", "+a+"%, "+r+"%, "+u+")":"hsl("+t+", "+a+"%, "+r+"%)";var e,t,a,r,u},n.prototype.toHsv=function(){return e=Ax(this.rgba),{h:Zn(e.h),s:Zn(e.s),v:Zn(e.v),a:Zn(e.a,3)};var e},n.prototype.invert=function(){return hr({r:255-(e=this.rgba).r,g:255-e.g,b:255-e.b,a:e.a});var e},n.prototype.saturate=function(e){return e===void 0&&(e=.1),hr(S_(this.rgba,e))},n.prototype.desaturate=function(e){return e===void 0&&(e=.1),hr(S_(this.rgba,-e))},n.prototype.grayscale=function(){return hr(S_(this.rgba,-1))},n.prototype.lighten=function(e){return e===void 0&&(e=.1),hr(Nx(this.rgba,e))},n.prototype.darken=function(e){return e===void 0&&(e=.1),hr(Nx(this.rgba,-e))},n.prototype.rotate=function(e){return e===void 0&&(e=15),this.hue(this.hue()+e)},n.prototype.alpha=function(e){return typeof e=="number"?hr({r:(t=this.rgba).r,g:t.g,b:t.b,a:e}):Zn(this.rgba.a,3);var t},n.prototype.hue=function(e){var t=Ff(this.rgba);return typeof e=="number"?hr({h:e,s:t.s,l:t.l,a:t.a}):Zn(t.h)},n.prototype.isEqual=function(e){return this.toHex()===hr(e).toHex()},n}(),hr=function(n){return n instanceof E_?n:new E_(n)},Gx=[],LA=function(n){n.forEach(function(e){Gx.indexOf(e)<0&&(e(E_,x_),Gx.push(e))})};function jA(n,e){var t={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 r in t)a[t[r]]=r;var u={};n.prototype.toName=function(h){if(!(this.rgba.a||this.rgba.r||this.rgba.g||this.rgba.b))return"transparent";var d,m,y=a[this.toHex()];if(y)return y;if(h!=null&&h.closest){var b=this.toRgb(),S=1/0,T="black";if(!u.length)for(var E in t)u[E]=new n(t[E]).toRgb();for(var A in t){var B=(d=b,m=u[A],Math.pow(d.r-m.r,2)+Math.pow(d.g-m.g,2)+Math.pow(d.b-m.b,2));B<S&&(S=B,T=A)}return T}},e.string.push([function(h){var d=h.toLowerCase(),m=d==="transparent"?"#0000":t[d];return m?new n(m).toRgb():null},"name"])}LA([jA]);const bc=class Ym{constructor(e=16777215){this._value=null,this._components=new Float32Array(4),this._components.fill(1),this._int=16777215,this.value=e}get red(){return this._components[0]}get green(){return this._components[1]}get blue(){return this._components[2]}get alpha(){return this._components[3]}setValue(e){return this.value=e,this}set value(e){if(e instanceof Ym)this._value=this._cloneSource(e._value),this._int=e._int,this._components.set(e._components);else{if(e===null)throw new Error("Cannot set Color#value to null");(this._value===null||!this._isSourceEqual(this._value,e))&&(this._value=this._cloneSource(e),this._normalize(this._value))}}get value(){return this._value}_cloneSource(e){return typeof e=="string"||typeof e=="number"||e instanceof Number||e===null?e:Array.isArray(e)||ArrayBuffer.isView(e)?e.slice(0):typeof e=="object"&&e!==null?{...e}:e}_isSourceEqual(e,t){const a=typeof e;if(a!==typeof t)return!1;if(a==="number"||a==="string"||e instanceof Number)return e===t;if(Array.isArray(e)&&Array.isArray(t)||ArrayBuffer.isView(e)&&ArrayBuffer.isView(t))return e.length!==t.length?!1:e.every((u,h)=>u===t[h]);if(e!==null&&t!==null){const u=Object.keys(e),h=Object.keys(t);return u.length!==h.length?!1:u.every(d=>e[d]===t[d])}return e===t}toRgba(){const[e,t,a,r]=this._components;return{r:e,g:t,b:a,a:r}}toRgb(){const[e,t,a]=this._components;return{r:e,g:t,b:a}}toRgbaString(){const[e,t,a]=this.toUint8RgbArray();return`rgba(${e},${t},${a},${this.alpha})`}toUint8RgbArray(e){const[t,a,r]=this._components;return this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb),e[0]=Math.round(t*255),e[1]=Math.round(a*255),e[2]=Math.round(r*255),e}toArray(e){this._arrayRgba||(this._arrayRgba=[]),e||(e=this._arrayRgba);const[t,a,r,u]=this._components;return e[0]=t,e[1]=a,e[2]=r,e[3]=u,e}toRgbArray(e){this._arrayRgb||(this._arrayRgb=[]),e||(e=this._arrayRgb);const[t,a,r]=this._components;return e[0]=t,e[1]=a,e[2]=r,e}toNumber(){return this._int}toBgrNumber(){const[e,t,a]=this.toUint8RgbArray();return(a<<16)+(t<<8)+e}toLittleEndianNumber(){const e=this._int;return(e>>16)+(e&65280)+((e&255)<<16)}multiply(e){const[t,a,r,u]=Ym._temp.setValue(e)._components;return this._components[0]*=t,this._components[1]*=a,this._components[2]*=r,this._components[3]*=u,this._refreshInt(),this._value=null,this}premultiply(e,t=!0){return t&&(this._components[0]*=e,this._components[1]*=e,this._components[2]*=e),this._components[3]=e,this._refreshInt(),this._value=null,this}toPremultiplied(e,t=!0){if(e===1)return(255<<24)+this._int;if(e===0)return t?0:this._int;let a=this._int>>16&255,r=this._int>>8&255,u=this._int&255;return t&&(a=a*e+.5|0,r=r*e+.5|0,u=u*e+.5|0),(e*255<<24)+(a<<16)+(r<<8)+u}toHex(){const e=this._int.toString(16);return`#${"000000".substring(0,6-e.length)+e}`}toHexa(){const t=Math.round(this._components[3]*255).toString(16);return this.toHex()+"00".substring(0,2-t.length)+t}setAlpha(e){return this._components[3]=this._clamp(e),this}_normalize(e){let t,a,r,u;if((typeof e=="number"||e instanceof Number)&&e>=0&&e<=16777215){const h=e;t=(h>>16&255)/255,a=(h>>8&255)/255,r=(h&255)/255,u=1}else if((Array.isArray(e)||e instanceof Float32Array)&&e.length>=3&&e.length<=4)e=this._clamp(e),[t,a,r,u=1]=e;else if((e instanceof Uint8Array||e instanceof Uint8ClampedArray)&&e.length>=3&&e.length<=4)e=this._clamp(e,0,255),[t,a,r,u=255]=e,t/=255,a/=255,r/=255,u/=255;else if(typeof e=="string"||typeof e=="object"){if(typeof e=="string"){const d=Ym.HEX_PATTERN.exec(e);d&&(e=`#${d[2]}`)}const h=hr(e);h.isValid()&&({r:t,g:a,b:r,a:u}=h.rgba,t/=255,a/=255,r/=255)}if(t!==void 0)this._components[0]=t,this._components[1]=a,this._components[2]=r,this._components[3]=u,this._refreshInt();else throw new Error(`Unable to convert color ${e}`)}_refreshInt(){this._clamp(this._components);const[e,t,a]=this._components;this._int=(e*255<<16)+(t*255<<8)+(a*255|0)}_clamp(e,t=0,a=1){return typeof e=="number"?Math.min(Math.max(e,t),a):(e.forEach((r,u)=>{e[u]=Math.min(Math.max(r,t),a)}),e)}static isColorLike(e){return typeof e=="number"||typeof e=="string"||e instanceof Number||e instanceof Ym||Array.isArray(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof Float32Array||e.r!==void 0&&e.g!==void 0&&e.b!==void 0||e.r!==void 0&&e.g!==void 0&&e.b!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0||e.h!==void 0&&e.s!==void 0&&e.l!==void 0&&e.a!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0||e.h!==void 0&&e.s!==void 0&&e.v!==void 0&&e.a!==void 0}};bc.shared=new bc,bc._temp=new bc,bc.HEX_PATTERN=/^(#|0x)?(([a-f0-9]{3}){1,2}([a-f0-9]{2})?)$/i;let Ft=bc;const YA={cullArea:null,cullable:!1,cullableChildren:!0};let C_=0;const wx=500;function rt(...n){C_!==wx&&(C_++,C_===wx?console.warn("PixiJS Warning: too many warnings, no more warnings will be reported to the console by PixiJS."):console.warn("PixiJS Warning: ",...n))}class R_{constructor(e,t){this._pool=[],this._count=0,this._index=0,this._classType=e,t&&this.prepopulate(t)}prepopulate(e){for(let t=0;t<e;t++)this._pool[this._index++]=new this._classType;this._count+=e}get(e){var a;let t;return this._index>0?t=this._pool[--this._index]:t=new this._classType,(a=t.init)==null||a.call(t,e),t}return(e){var t;(t=e.reset)==null||t.call(e),this._pool[this._index++]=e}get totalSize(){return this._count}get totalFree(){return this._index}get totalUsed(){return this._count-this._index}clear(){this._pool.length=0,this._index=0}}class XA{constructor(){this._poolsByClass=new Map}prepopulate(e,t){this.getPool(e).prepopulate(t)}get(e,t){return this.getPool(e).get(t)}return(e){this.getPool(e.constructor).return(e)}getPool(e){return this._poolsByClass.has(e)||this._poolsByClass.set(e,new R_(e)),this._poolsByClass.get(e)}stats(){const e={};return this._poolsByClass.forEach(t=>{const a=e[t._classType.name]?t._classType.name+t._classType.ID:t._classType.name;e[a]={free:t.totalFree,used:t.totalUsed,size:t.totalSize}}),e}}const hi=new XA,qA={get isCachedAsTexture(){var n;return!!((n=this.renderGroup)!=null&&n.isCachedAsTexture)},cacheAsTexture(n){typeof n=="boolean"&&n===!1?this.disableRenderGroup():(this.enableRenderGroup(),this.renderGroup.enableCacheAsTexture(n===!0?{}:n))},updateCacheTexture(){var n;(n=this.renderGroup)==null||n.updateCacheTexture()},get cacheAsBitmap(){return this.isCachedAsTexture},set cacheAsBitmap(n){st("v8.6.0","cacheAsBitmap is deprecated, use cacheAsTexture instead."),this.cacheAsTexture(n)}};function Px(n,e,t){const a=n.length;let r;if(e>=a||t===0)return;t=e+t>a?a-e:t;const u=a-t;for(r=e;r<u;++r)n[r]=n[r+t];n.length=u}const FA={allowChildren:!0,removeChildren(n=0,e){var u;const t=e??this.children.length,a=t-n,r=[];if(a>0&&a<=t){for(let d=t-1;d>=n;d--){const m=this.children[d];m&&(r.push(m),m.parent=null)}Px(this.children,n,t);const h=this.renderGroup||this.parentRenderGroup;h&&h.removeChildren(r);for(let d=0;d<r.length;++d){const m=r[d];(u=m.parentRenderLayer)==null||u.detach(m),this.emit("childRemoved",m,this,d),r[d].emit("removed",this)}return r.length>0&&this._didViewChangeTick++,r}else if(a===0&&this.children.length===0)return r;throw new RangeError("removeChildren: numeric values are outside the acceptable range.")},removeChildAt(n){const e=this.getChildAt(n);return this.removeChild(e)},getChildAt(n){if(n<0||n>=this.children.length)throw new Error(`getChildAt: Index (${n}) does not exist.`);return this.children[n]},setChildIndex(n,e){if(e<0||e>=this.children.length)throw new Error(`The index ${e} supplied is out of bounds ${this.children.length}`);this.getChildIndex(n),this.addChildAt(n,e)},getChildIndex(n){const e=this.children.indexOf(n);if(e===-1)throw new Error("The supplied Container must be a child of the caller");return e},addChildAt(n,e){this.allowChildren||st(Rt,"addChildAt: Only Containers will be allowed to add children in v8.0.0");const{children:t}=this;if(e<0||e>t.length)throw new Error(`${n}addChildAt: The index ${e} supplied is out of bounds ${t.length}`);if(n.parent){const r=n.parent.children.indexOf(n);if(n.parent===this&&r===e)return n;r!==-1&&n.parent.children.splice(r,1)}e===t.length?t.push(n):t.splice(e,0,n),n.parent=this,n.didChange=!0,n._updateFlags=15;const a=this.renderGroup||this.parentRenderGroup;return a&&a.addChild(n),this.sortableChildren&&(this.sortDirty=!0),this.emit("childAdded",n,this,e),n.emit("added",this),n},swapChildren(n,e){if(n===e)return;const t=this.getChildIndex(n),a=this.getChildIndex(e);this.children[t]=e,this.children[a]=n;const r=this.renderGroup||this.parentRenderGroup;r&&(r.structureDidChange=!0),this._didContainerChangeTick++},removeFromParent(){var n;(n=this.parent)==null||n.removeChild(this)},reparentChild(...n){return n.length===1?this.reparentChildAt(n[0],this.children.length):(n.forEach(e=>this.reparentChildAt(e,this.children.length)),n[0])},reparentChildAt(n,e){if(n.parent===this)return this.setChildIndex(n,e),n;const t=n.worldTransform.clone();n.removeFromParent(),this.addChildAt(n,e);const a=this.worldTransform.clone();return a.invert(),t.prepend(a),n.setFromMatrix(t),n},replaceChild(n,e){n.updateLocalTransform(),this.addChildAt(e,this.getChildIndex(n)),e.setFromMatrix(n.localTransform),e.updateLocalTransform(),this.removeChild(n)}},IA={collectRenderables(n,e,t){this.parentRenderLayer&&this.parentRenderLayer!==t||this.globalDisplayStatus<7||!this.includeInBuild||(this.sortableChildren&&this.sortChildren(),this.isSimple?this.collectRenderablesSimple(n,e,t):this.renderGroup?e.renderPipes.renderGroup.addRenderGroup(this.renderGroup,n):this.collectRenderablesWithEffects(n,e,t))},collectRenderablesSimple(n,e,t){const a=this.children,r=a.length;for(let u=0;u<r;u++)a[u].collectRenderables(n,e,t)},collectRenderablesWithEffects(n,e,t){const{renderPipes:a}=e;for(let r=0;r<this.effects.length;r++){const u=this.effects[r];a[u.pipe].push(u,this,n)}this.collectRenderablesSimple(n,e,t);for(let r=this.effects.length-1;r>=0;r--){const u=this.effects[r];a[u.pipe].pop(u,this,n)}}};class Qm{constructor(){this.pipe="filter",this.priority=1}destroy(){for(let e=0;e<this.filters.length;e++)this.filters[e].destroy();this.filters=null,this.filterArea=null}}class kA{constructor(){this._effectClasses=[],this._tests=[],this._initialized=!1}init(){this._initialized||(this._initialized=!0,this._effectClasses.forEach(e=>{this.add({test:e.test,maskClass:e})}))}add(e){this._tests.push(e)}getMaskEffect(e){this._initialized||this.init();for(let t=0;t<this._tests.length;t++){const a=this._tests[t];if(a.test(e))return hi.get(a.maskClass,e)}return e}returnMaskEffect(e){hi.return(e)}}const A_=new kA;Ie.handleByList(Q.MaskEffect,A_._effectClasses);const KA={_maskEffect:null,_maskOptions:{inverse:!1},_filterEffect:null,effects:[],_markStructureAsChanged(){const n=this.renderGroup||this.parentRenderGroup;n&&(n.structureDidChange=!0)},addEffect(n){this.effects.indexOf(n)===-1&&(this.effects.push(n),this.effects.sort((t,a)=>t.priority-a.priority),this._markStructureAsChanged(),this._updateIsSimple())},removeEffect(n){const e=this.effects.indexOf(n);e!==-1&&(this.effects.splice(e,1),this._markStructureAsChanged(),this._updateIsSimple())},set mask(n){const e=this._maskEffect;(e==null?void 0:e.mask)!==n&&(e&&(this.removeEffect(e),A_.returnMaskEffect(e),this._maskEffect=null),n!=null&&(this._maskEffect=A_.getMaskEffect(n),this.addEffect(this._maskEffect)))},get mask(){var n;return(n=this._maskEffect)==null?void 0:n.mask},setMask(n){this._maskOptions={...this._maskOptions,...n},n.mask&&(this.mask=n.mask),this._markStructureAsChanged()},set filters(n){var u;!Array.isArray(n)&&n&&(n=[n]);const e=this._filterEffect||(this._filterEffect=new Qm);n=n;const t=(n==null?void 0:n.length)>0,a=((u=e.filters)==null?void 0:u.length)>0,r=t!==a;n=Array.isArray(n)?n.slice(0):n,e.filters=Object.freeze(n),r&&(t?this.addEffect(e):(this.removeEffect(e),e.filters=n??null))},get filters(){var n;return(n=this._filterEffect)==null?void 0:n.filters},set filterArea(n){this._filterEffect||(this._filterEffect=new Qm),this._filterEffect.filterArea=n},get filterArea(){var n;return(n=this._filterEffect)==null?void 0:n.filterArea}},QA={label:null,get name(){return st(Rt,"Container.name property has been removed, use Container.label instead"),this.label},set name(n){st(Rt,"Container.name property has been removed, use Container.label instead"),this.label=n},getChildByName(n,e=!1){return this.getChildByLabel(n,e)},getChildByLabel(n,e=!1){const t=this.children;for(let a=0;a<t.length;a++){const r=t[a];if(r.label===n||n instanceof RegExp&&n.test(r.label))return r}if(e)for(let a=0;a<t.length;a++){const u=t[a].getChildByLabel(n,!0);if(u)return u}return null},getChildrenByLabel(n,e=!1,t=[]){const a=this.children;for(let r=0;r<a.length;r++){const u=a[r];(u.label===n||n instanceof RegExp&&n.test(u.label))&&t.push(u)}if(e)for(let r=0;r<a.length;r++)a[r].getChildrenByLabel(n,!0,t);return t}},ji=new R_(Pe),Wr=new R_(ci),ZA=new Pe,WA={getFastGlobalBounds(n,e){e||(e=new ci),e.clear(),this._getGlobalBoundsRecursive(!!n,e,this.parentRenderLayer),e.isValid||e.set(0,0,0,0);const t=this.renderGroup||this.parentRenderGroup;return e.applyMatrix(t.worldTransform),e},_getGlobalBoundsRecursive(n,e,t){let a=e;if(n&&this.parentRenderLayer&&this.parentRenderLayer!==t||this.localDisplayStatus!==7||!this.measurable)return;const r=!!this.effects.length;if((this.renderGroup||r)&&(a=Wr.get().clear()),this.boundsArea)e.addRect(this.boundsArea,this.worldTransform);else{if(this.renderPipeId){const h=this.bounds;a.addFrame(h.minX,h.minY,h.maxX,h.maxY,this.groupTransform)}const u=this.children;for(let h=0;h<u.length;h++)u[h]._getGlobalBoundsRecursive(n,a,t)}if(r){let u=!1;const h=this.renderGroup||this.parentRenderGroup;for(let d=0;d<this.effects.length;d++)this.effects[d].addBounds&&(u||(u=!0,a.applyMatrix(h.worldTransform)),this.effects[d].addBounds(a,!0));u&&a.applyMatrix(h.worldTransform.copyTo(ZA).invert()),e.addBounds(a),Wr.return(a)}else this.renderGroup&&(e.addBounds(a,this.relativeGroupTransform),Wr.return(a))}};function M_(n,e,t){t.clear();let a,r;return n.parent?e?a=n.parent.worldTransform:(r=ji.get().identity(),a=D_(n,r)):a=Pe.IDENTITY,zx(n,t,a,e),r&&ji.return(r),t.isValid||t.set(0,0,0,0),t}function zx(n,e,t,a){var d,m;if(!n.visible||!n.measurable)return;let r;a?r=n.worldTransform:(n.updateLocalTransform(),r=ji.get(),r.appendFrom(n.localTransform,t));const u=e,h=!!n.effects.length;if(h&&(e=Wr.get().clear()),n.boundsArea)e.addRect(n.boundsArea,r);else{n.bounds&&(e.matrix=r,e.addBounds(n.bounds));for(let y=0;y<n.children.length;y++)zx(n.children[y],e,r,a)}if(h){for(let y=0;y<n.effects.length;y++)(m=(d=n.effects[y]).addBounds)==null||m.call(d,e);u.addBounds(e,Pe.IDENTITY),Wr.return(e)}a||ji.return(r)}function D_(n,e){const t=n.parent;return t&&(D_(t,e),t.updateLocalTransform(),e.append(t.localTransform)),e}function Hx(n,e){if(n===16777215||!e)return e;if(e===16777215||!n)return n;const t=n>>16&255,a=n>>8&255,r=n&255,u=e>>16&255,h=e>>8&255,d=e&255,m=t*u/255|0,y=a*h/255|0,b=r*d/255|0;return(m<<16)+(y<<8)+b}const Vx=16777215;function Zm(n,e){return n===Vx?e:e===Vx?n:Hx(n,e)}function If(n){return((n&255)<<16)+(n&65280)+(n>>16&255)}const JA={getGlobalAlpha(n){if(n)return this.renderGroup?this.renderGroup.worldAlpha:this.parentRenderGroup?this.parentRenderGroup.worldAlpha*this.alpha:this.alpha;let e=this.alpha,t=this.parent;for(;t;)e*=t.alpha,t=t.parent;return e},getGlobalTransform(n=new Pe,e){if(e)return n.copyFrom(this.worldTransform);this.updateLocalTransform();const t=D_(this,ji.get().identity());return n.appendFrom(this.localTransform,t),ji.return(t),n},getGlobalTint(n){if(n)return this.renderGroup?If(this.renderGroup.worldColor):this.parentRenderGroup?If(Zm(this.localColor,this.parentRenderGroup.worldColor)):this.tint;let e=this.localColor,t=this.parent;for(;t;)e=Zm(e,t.localColor),t=t.parent;return If(e)}};function U_(n,e,t){return e.clear(),t||(t=Pe.IDENTITY),Lx(n,e,t,n,!0),e.isValid||e.set(0,0,0,0),e}function Lx(n,e,t,a,r){var m,y;let u;if(r)u=ji.get(),u=t.copyTo(u);else{if(!n.visible||!n.measurable)return;n.updateLocalTransform();const b=n.localTransform;u=ji.get(),u.appendFrom(b,t)}const h=e,d=!!n.effects.length;if(d&&(e=Wr.get().clear()),n.boundsArea)e.addRect(n.boundsArea,u);else{n.renderPipeId&&(e.matrix=u,e.addBounds(n.bounds));const b=n.children;for(let S=0;S<b.length;S++)Lx(b[S],e,u,a,!1)}if(d){for(let b=0;b<n.effects.length;b++)(y=(m=n.effects[b]).addLocalBounds)==null||y.call(m,e,a);h.addBounds(e,Pe.IDENTITY),Wr.return(e)}ji.return(u)}function jx(n,e){const t=n.children;for(let a=0;a<t.length;a++){const r=t[a],u=r.uid,h=(r._didViewChangeTick&65535)<<16|r._didContainerChangeTick&65535,d=e.index;(e.data[d]!==u||e.data[d+1]!==h)&&(e.data[e.index]=u,e.data[e.index+1]=h,e.didChange=!0),e.index=d+2,r.children.length&&jx(r,e)}return e.didChange}const $A=new Pe,eM={_localBoundsCacheId:-1,_localBoundsCacheData:null,_setWidth(n,e){const t=Math.sign(this.scale.x)||1;e!==0?this.scale.x=n/e*t:this.scale.x=t},_setHeight(n,e){const t=Math.sign(this.scale.y)||1;e!==0?this.scale.y=n/e*t:this.scale.y=t},getLocalBounds(){this._localBoundsCacheData||(this._localBoundsCacheData={data:[],index:1,didChange:!1,localBounds:new ci});const n=this._localBoundsCacheData;return n.index=1,n.didChange=!1,n.data[0]!==this._didViewChangeTick&&(n.didChange=!0,n.data[0]=this._didViewChangeTick),jx(this,n),n.didChange&&U_(this,n.localBounds,$A),n.localBounds},getBounds(n,e){return M_(this,n,e||new ci)}},tM={_onRender:null,set onRender(n){const e=this.renderGroup||this.parentRenderGroup;if(!n){this._onRender&&(e==null||e.removeOnRender(this)),this._onRender=null;return}this._onRender||e==null||e.addOnRender(this),this._onRender=n},get onRender(){return this._onRender}},nM={_zIndex:0,sortDirty:!1,sortableChildren:!1,get zIndex(){return this._zIndex},set zIndex(n){this._zIndex!==n&&(this._zIndex=n,this.depthOfChildModified())},depthOfChildModified(){this.parent&&(this.parent.sortableChildren=!0,this.parent.sortDirty=!0),this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0)},sortChildren(){this.sortDirty&&(this.sortDirty=!1,this.children.sort(iM))}};function iM(n,e){return n._zIndex-e._zIndex}const aM={getGlobalPosition(n=new qt,e=!1){return this.parent?this.parent.toGlobal(this._position,n,e):(n.x=this._position.x,n.y=this._position.y),n},toGlobal(n,e,t=!1){const a=this.getGlobalTransform(ji.get(),t);return e=a.apply(n,e),ji.return(a),e},toLocal(n,e,t,a){e&&(n=e.toGlobal(n,t,a));const r=this.getGlobalTransform(ji.get(),a);return t=r.applyInverse(n,t),ji.return(r),t}};class Yx{constructor(){this.uid=Kt("instructionSet"),this.instructions=[],this.instructionSize=0,this.renderables=[],this.gcTick=0}reset(){this.instructionSize=0}add(e){this.instructions[this.instructionSize++]=e}log(){this.instructions.length=this.instructionSize,console.table(this.instructions,["type","action"])}}let sM=0;class rM{constructor(e){this._poolKeyHash=Object.create(null),this._texturePool={},this.textureOptions=e||{},this.enableFullScreen=!1,this.textureStyle=new Xl(this.textureOptions)}createTexture(e,t,a){const r=new Nn({...this.textureOptions,width:e,height:t,resolution:1,antialias:a,autoGarbageCollect:!1});return new Ge({source:r,label:`texturePool_${sM++}`})}getOptimalTexture(e,t,a=1,r){let u=Math.ceil(e*a-1e-6),h=Math.ceil(t*a-1e-6);u=vc(u),h=vc(h);const d=(u<<17)+(h<<1)+(r?1:0);this._texturePool[d]||(this._texturePool[d]=[]);let m=this._texturePool[d].pop();return m||(m=this.createTexture(u,h,r)),m.source._resolution=a,m.source.width=u/a,m.source.height=h/a,m.source.pixelWidth=u,m.source.pixelHeight=h,m.frame.x=0,m.frame.y=0,m.frame.width=e,m.frame.height=t,m.updateUvs(),this._poolKeyHash[m.uid]=d,m}getSameSizeTexture(e,t=!1){const a=e.source;return this.getOptimalTexture(e.width,e.height,a._resolution,t)}returnTexture(e,t=!1){const a=this._poolKeyHash[e.uid];t&&(e.source.style=this.textureStyle),this._texturePool[a].push(e)}clear(e){if(e=e!==!1,e)for(const t in this._texturePool){const a=this._texturePool[t];if(a)for(let r=0;r<a.length;r++)a[r].destroy(!0)}this._texturePool={}}}const Di=new rM;class lM{constructor(){this.renderPipeId="renderGroup",this.root=null,this.canBundle=!1,this.renderGroupParent=null,this.renderGroupChildren=[],this.worldTransform=new Pe,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 Yx,this._onRenderContainers=[],this.textureNeedsUpdate=!0,this.isCachedAsTexture=!1,this._matrixDirty=7}init(e){this.root=e,e._onRender&&this.addOnRender(e),e.didChange=!0;const t=e.children;for(let a=0;a<t.length;a++){const r=t[a];r._updateFlags=15,this.addChild(r)}}enableCacheAsTexture(e={}){this.textureOptions=e,this.isCachedAsTexture=!0,this.textureNeedsUpdate=!0}disableCacheAsTexture(){this.isCachedAsTexture=!1,this.texture&&(Di.returnTexture(this.texture,!0),this.texture=null)}updateCacheTexture(){this.textureNeedsUpdate=!0}reset(){this.renderGroupChildren.length=0;for(const e in this.childrenToUpdate){const t=this.childrenToUpdate[e];t.list.fill(null),t.index=0}this.childrenRenderablesToUpdate.index=0,this.childrenRenderablesToUpdate.list.fill(null),this.root=null,this.updateTick=0,this.structureDidChange=!0,this._onRenderContainers.length=0,this.renderGroupParent=null,this.disableCacheAsTexture()}get localTransform(){return this.root.localTransform}addRenderGroupChild(e){e.renderGroupParent&&e.renderGroupParent._removeRenderGroupChild(e),e.renderGroupParent=this,this.renderGroupChildren.push(e)}_removeRenderGroupChild(e){const t=this.renderGroupChildren.indexOf(e);t>-1&&this.renderGroupChildren.splice(t,1),e.renderGroupParent=null}addChild(e){if(this.structureDidChange=!0,e.parentRenderGroup=this,e.updateTick=-1,e.parent===this.root?e.relativeRenderGroupDepth=1:e.relativeRenderGroupDepth=e.parent.relativeRenderGroupDepth+1,e.didChange=!0,this.onChildUpdate(e),e.renderGroup){this.addRenderGroupChild(e.renderGroup);return}e._onRender&&this.addOnRender(e);const t=e.children;for(let a=0;a<t.length;a++)this.addChild(t[a])}removeChild(e){if(this.structureDidChange=!0,e._onRender&&(e.renderGroup||this.removeOnRender(e)),e.parentRenderGroup=null,e.renderGroup){this._removeRenderGroupChild(e.renderGroup);return}const t=e.children;for(let a=0;a<t.length;a++)this.removeChild(t[a])}removeChildren(e){for(let t=0;t<e.length;t++)this.removeChild(e[t])}onChildUpdate(e){let t=this.childrenToUpdate[e.relativeRenderGroupDepth];t||(t=this.childrenToUpdate[e.relativeRenderGroupDepth]={index:0,list:[]}),t.list[t.index++]=e}updateRenderable(e){e.globalDisplayStatus<7||(this.instructionSet.renderPipes[e.renderPipeId].updateRenderable(e),e.didViewUpdate=!1)}onChildViewUpdate(e){this.childrenRenderablesToUpdate.list[this.childrenRenderablesToUpdate.index++]=e}get isRenderable(){return this.root.localDisplayStatus===7&&this.worldAlpha>0}addOnRender(e){this._onRenderContainers.push(e)}removeOnRender(e){this._onRenderContainers.splice(this._onRenderContainers.indexOf(e),1)}runOnRender(e){for(let t=0;t<this._onRenderContainers.length;t++)this._onRenderContainers[t]._onRender(e)}destroy(){this.disableCacheAsTexture(),this.renderGroupParent=null,this.root=null,this.childrenRenderablesToUpdate=null,this.childrenToUpdate=null,this.renderGroupChildren=null,this._onRenderContainers=null,this.instructionSet=null}getChildren(e=[]){const t=this.root.children;for(let a=0;a<t.length;a++)this._getChildren(t[a],e);return e}_getChildren(e,t=[]){if(t.push(e),e.renderGroup)return t;const a=e.children;for(let r=0;r<a.length;r++)this._getChildren(a[r],t);return t}invalidateMatrices(){this._matrixDirty=7}get inverseWorldTransform(){return(this._matrixDirty&1)===0?this._inverseWorldTransform:(this._matrixDirty&=-2,this._inverseWorldTransform||(this._inverseWorldTransform=new Pe),this._inverseWorldTransform.copyFrom(this.worldTransform).invert())}get textureOffsetInverseTransform(){return(this._matrixDirty&2)===0?this._textureOffsetInverseTransform:(this._matrixDirty&=-3,this._textureOffsetInverseTransform||(this._textureOffsetInverseTransform=new Pe),this._textureOffsetInverseTransform.copyFrom(this.inverseWorldTransform).translate(-this._textureBounds.x,-this._textureBounds.y))}get inverseParentTextureTransform(){if((this._matrixDirty&4)===0)return this._inverseParentTextureTransform;this._matrixDirty&=-5;const e=this._parentCacheAsTextureRenderGroup;return e?(this._inverseParentTextureTransform||(this._inverseParentTextureTransform=new Pe),this._inverseParentTextureTransform.copyFrom(this.worldTransform).prepend(e.inverseWorldTransform).translate(-e._textureBounds.x,-e._textureBounds.y)):this.worldTransform}get cacheToLocalTransform(){return this._parentCacheAsTextureRenderGroup?this._parentCacheAsTextureRenderGroup.textureOffsetInverseTransform:null}}function B_(n,e,t={}){for(const a in e)!t[a]&&e[a]!==void 0&&(n[a]=e[a])}const O_=new Mi(null),Wm=new Mi(null),N_=new Mi(null,1,1),Jm=new Mi(null),$m=1,G_=2,kf=4;class Gn extends Sa{constructor(e={}){var t,a;super(),this.uid=Kt("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.updateTick=-1,this.localTransform=new Pe,this.relativeGroupTransform=new Pe,this.groupTransform=this.relativeGroupTransform,this.destroyed=!1,this._position=new Mi(this,0,0),this._scale=N_,this._pivot=Wm,this._origin=Jm,this._skew=O_,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=[],B_(this,e,{children:!0,parent:!0,effects:!0}),(t=e.children)==null||t.forEach(r=>this.addChild(r)),(a=e.parent)==null||a.addChild(this)}static mixin(e){st("8.8.0","Container.mixin is deprecated, please use extensions.mixin instead."),Ie.mixin(Gn,e)}set _didChangeId(e){this._didViewChangeTick=e>>12&4095,this._didContainerChangeTick=e&4095}get _didChangeId(){return this._didContainerChangeTick&4095|(this._didViewChangeTick&4095)<<12}addChild(...e){if(this.allowChildren||st(Rt,"addChild: Only Containers will be allowed to add children in v8.0.0"),e.length>1){for(let r=0;r<e.length;r++)this.addChild(e[r]);return e[0]}const t=e[0],a=this.renderGroup||this.parentRenderGroup;return t.parent===this?(this.children.splice(this.children.indexOf(t),1),this.children.push(t),a&&(a.structureDidChange=!0),t):(t.parent&&t.parent.removeChild(t),this.children.push(t),this.sortableChildren&&(this.sortDirty=!0),t.parent=this,t.didChange=!0,t._updateFlags=15,a&&a.addChild(t),this.emit("childAdded",t,this,this.children.length-1),t.emit("added",this),this._didViewChangeTick++,t._zIndex!==0&&t.depthOfChildModified(),t)}removeChild(...e){if(e.length>1){for(let r=0;r<e.length;r++)this.removeChild(e[r]);return e[0]}const t=e[0],a=this.children.indexOf(t);return a>-1&&(this._didViewChangeTick++,this.children.splice(a,1),this.renderGroup?this.renderGroup.removeChild(t):this.parentRenderGroup&&this.parentRenderGroup.removeChild(t),t.parentRenderLayer&&t.parentRenderLayer.detach(t),t.parent=null,this.emit("childRemoved",t,this,a),t.emit("removed",this)),t}_onUpdate(e){e&&e===this._skew&&this._updateSkew(),this._didContainerChangeTick++,!this.didChange&&(this.didChange=!0,this.parentRenderGroup&&this.parentRenderGroup.onChildUpdate(this))}set isRenderGroup(e){!!this.renderGroup!==e&&(e?this.enableRenderGroup():this.disableRenderGroup())}get isRenderGroup(){return!!this.renderGroup}enableRenderGroup(){if(this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),this.renderGroup=hi.get(lM,this),this.groupTransform=Pe.IDENTITY,e==null||e.addChild(this),this._updateIsSimple()}disableRenderGroup(){if(!this.renderGroup)return;const e=this.parentRenderGroup;e==null||e.removeChild(this),hi.return(this.renderGroup),this.renderGroup=null,this.groupTransform=this.relativeGroupTransform,e==null||e.addChild(this),this._updateIsSimple()}_updateIsSimple(){this.isSimple=!this.renderGroup&&this.effects.length===0}get worldTransform(){return this._worldTransform||(this._worldTransform=new Pe),this.renderGroup?this._worldTransform.copyFrom(this.renderGroup.worldTransform):this.parentRenderGroup&&this._worldTransform.appendFrom(this.relativeGroupTransform,this.parentRenderGroup.worldTransform),this._worldTransform}get x(){return this._position.x}set x(e){this._position.x=e}get y(){return this._position.y}set y(e){this._position.y=e}get position(){return this._position}set position(e){this._position.copyFrom(e)}get rotation(){return this._rotation}set rotation(e){this._rotation!==e&&(this._rotation=e,this._onUpdate(this._skew))}get angle(){return this.rotation*RA}set angle(e){this.rotation=e*AA}get pivot(){return this._pivot===Wm&&(this._pivot=new Mi(this,0,0)),this._pivot}set pivot(e){this._pivot===Wm&&(this._pivot=new Mi(this,0,0),this._origin!==Jm&&rt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._pivot.set(e):this._pivot.copyFrom(e)}get skew(){return this._skew===O_&&(this._skew=new Mi(this,0,0)),this._skew}set skew(e){this._skew===O_&&(this._skew=new Mi(this,0,0)),this._skew.copyFrom(e)}get scale(){return this._scale===N_&&(this._scale=new Mi(this,1,1)),this._scale}set scale(e){this._scale===N_&&(this._scale=new Mi(this,0,0)),typeof e=="string"&&(e=parseFloat(e)),typeof e=="number"?this._scale.set(e):this._scale.copyFrom(e)}get origin(){return this._origin===Jm&&(this._origin=new Mi(this,0,0)),this._origin}set origin(e){this._origin===Jm&&(this._origin=new Mi(this,0,0),this._pivot!==Wm&&rt("Setting both a pivot and origin on a Container is not recommended. This can lead to unexpected behavior if not handled carefully.")),typeof e=="number"?this._origin.set(e):this._origin.copyFrom(e)}get width(){return Math.abs(this.scale.x*this.getLocalBounds().width)}set width(e){const t=this.getLocalBounds().width;this._setWidth(e,t)}get height(){return Math.abs(this.scale.y*this.getLocalBounds().height)}set height(e){const t=this.getLocalBounds().height;this._setHeight(e,t)}getSize(e){e||(e={});const t=this.getLocalBounds();return e.width=Math.abs(this.scale.x*t.width),e.height=Math.abs(this.scale.y*t.height),e}setSize(e,t){const a=this.getLocalBounds();typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,a.width),t!==void 0&&this._setHeight(t,a.height)}_updateSkew(){const e=this._rotation,t=this._skew;this._cx=Math.cos(e+t._y),this._sx=Math.sin(e+t._y),this._cy=-Math.sin(e-t._x),this._sy=Math.cos(e-t._x)}updateTransform(e){return this.position.set(typeof e.x=="number"?e.x:this.position.x,typeof e.y=="number"?e.y:this.position.y),this.scale.set(typeof e.scaleX=="number"?e.scaleX||1:this.scale.x,typeof e.scaleY=="number"?e.scaleY||1:this.scale.y),this.rotation=typeof e.rotation=="number"?e.rotation:this.rotation,this.skew.set(typeof e.skewX=="number"?e.skewX:this.skew.x,typeof e.skewY=="number"?e.skewY:this.skew.y),this.pivot.set(typeof e.pivotX=="number"?e.pivotX:this.pivot.x,typeof e.pivotY=="number"?e.pivotY:this.pivot.y),this.origin.set(typeof e.originX=="number"?e.originX:this.origin.x,typeof e.originY=="number"?e.originY:this.origin.y),this}setFromMatrix(e){e.decompose(this)}updateLocalTransform(){const e=this._didContainerChangeTick;if(this._didLocalTransformChangeId===e)return;this._didLocalTransformChangeId=e;const t=this.localTransform,a=this._scale,r=this._pivot,u=this._origin,h=this._position,d=a._x,m=a._y,y=r._x,b=r._y,S=-u._x,T=-u._y;t.a=this._cx*d,t.b=this._sx*d,t.c=this._cy*m,t.d=this._sy*m,t.tx=h._x-(y*t.a+b*t.c)+(S*t.a+T*t.c)-S,t.ty=h._y-(y*t.b+b*t.d)+(S*t.b+T*t.d)-T}set alpha(e){e!==this.localAlpha&&(this.localAlpha=e,this._updateFlags|=$m,this._onUpdate())}get alpha(){return this.localAlpha}set tint(e){const a=Ft.shared.setValue(e??16777215).toBgrNumber();a!==this.localColor&&(this.localColor=a,this._updateFlags|=$m,this._onUpdate())}get tint(){return If(this.localColor)}set blendMode(e){this.localBlendMode!==e&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=G_,this.localBlendMode=e,this._onUpdate())}get blendMode(){return this.localBlendMode}get visible(){return!!(this.localDisplayStatus&2)}set visible(e){const t=e?2:0;(this.localDisplayStatus&2)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=kf,this.localDisplayStatus^=2,this._onUpdate())}get culled(){return!(this.localDisplayStatus&4)}set culled(e){const t=e?0:4;(this.localDisplayStatus&4)!==t&&(this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._updateFlags|=kf,this.localDisplayStatus^=4,this._onUpdate())}get renderable(){return!!(this.localDisplayStatus&1)}set renderable(e){const t=e?1:0;(this.localDisplayStatus&1)!==t&&(this._updateFlags|=kf,this.localDisplayStatus^=1,this.parentRenderGroup&&(this.parentRenderGroup.structureDidChange=!0),this._onUpdate())}get isRenderable(){return this.localDisplayStatus===7&&this.groupAlpha>0}destroy(e=!1){var r;if(this.destroyed)return;this.destroyed=!0;let t;if(this.children.length&&(t=this.removeChildren(0,this.children.length)),this.removeFromParent(),this.parent=null,this._maskEffect=null,this._filterEffect=null,this.effects=null,this._position=null,this._scale=null,this._pivot=null,this._origin=null,this._skew=null,this.emit("destroyed",this),this.removeAllListeners(),(typeof e=="boolean"?e:e==null?void 0:e.children)&&t)for(let u=0;u<t.length;++u)t[u].destroy(e);(r=this.renderGroup)==null||r.destroy(),this.renderGroup=null}}Ie.mixin(Gn,FA,WA,aM,tM,eM,KA,QA,nM,YA,qA,JA,IA);class w_ extends Gn{constructor(e){super(e),this.canBundle=!0,this.allowChildren=!1,this._roundPixels=0,this._lastUsed=-1,this._gpuData=Object.create(null),this._bounds=new ci(0,1,0,0),this._boundsDirty=!0}get bounds(){return this._boundsDirty?(this.updateBounds(),this._boundsDirty=!1,this._bounds):this._bounds}get roundPixels(){return!!this._roundPixels}set roundPixels(e){this._roundPixels=e?1:0}containsPoint(e){const t=this.bounds,{x:a,y:r}=e;return a>=t.minX&&a<=t.maxX&&r>=t.minY&&r<=t.maxY}onViewUpdate(){if(this._didViewChangeTick++,this._boundsDirty=!0,this.didViewUpdate)return;this.didViewUpdate=!0;const e=this.renderGroup||this.parentRenderGroup;e&&e.onChildViewUpdate(this)}destroy(e){var t,a;super.destroy(e),this._bounds=null;for(const r in this._gpuData)(a=(t=this._gpuData[r]).destroy)==null||a.call(t);this._gpuData=null}collectRenderablesSimple(e,t,a){const{renderPipes:r}=t;r.blendMode.setBlendMode(this,this.groupBlendMode,e),r[this.renderPipeId].addRenderable(this,e),this.didViewUpdate=!1;const h=this.children,d=h.length;for(let m=0;m<d;m++)h[m].collectRenderables(e,t,a)}}class au extends w_{constructor(e=Ge.EMPTY){e instanceof Ge&&(e={texture:e});const{texture:t=Ge.EMPTY,anchor:a,roundPixels:r,width:u,height:h,...d}=e;super({label:"Sprite",...d}),this.renderPipeId="sprite",this.batched=!0,this._visualBounds={minX:0,maxX:1,minY:0,maxY:0},this._anchor=new Mi({_onUpdate:()=>{this.onViewUpdate()}}),a?this.anchor=a:t.defaultAnchor&&(this.anchor=t.defaultAnchor),this.texture=t,this.allowChildren=!1,this.roundPixels=r??!1,u!==void 0&&(this.width=u),h!==void 0&&(this.height=h)}static from(e,t=!1){return e instanceof Ge?new au(e):new au(Ge.from(e,t))}set texture(e){e||(e=Ge.EMPTY);const t=this._texture;t!==e&&(t&&t.dynamic&&t.off("update",this.onViewUpdate,this),e.dynamic&&e.on("update",this.onViewUpdate,this),this._texture=e,this._width&&this._setWidth(this._width,this._texture.orig.width),this._height&&this._setHeight(this._height,this._texture.orig.height),this.onViewUpdate())}get texture(){return this._texture}get visualBounds(){return Tx(this._visualBounds,this._anchor,this._texture),this._visualBounds}get sourceBounds(){return st("8.6.1","Sprite.sourceBounds is deprecated, use visualBounds instead."),this.visualBounds}updateBounds(){const e=this._anchor,t=this._texture,a=this._bounds,{width:r,height:u}=t.orig;a.minX=-e._x*r,a.maxX=a.minX+r,a.minY=-e._y*u,a.maxY=a.minY+u}destroy(e=!1){if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const a=typeof e=="boolean"?e:e==null?void 0:e.textureSource;this._texture.destroy(a)}this._texture=null,this._visualBounds=null,this._bounds=null,this._anchor=null,this._gpuData=null}get anchor(){return this._anchor}set anchor(e){typeof e=="number"?this._anchor.set(e):this._anchor.copyFrom(e)}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(e){this._setWidth(e,this._texture.orig.width),this._width=e}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(e){this._setHeight(e,this._texture.orig.height),this._height=e}getSize(e){return e||(e={}),e.width=Math.abs(this.scale.x)*this._texture.orig.width,e.height=Math.abs(this.scale.y)*this._texture.orig.height,e}setSize(e,t){typeof e=="object"?(t=e.height??e.width,e=e.width):t??(t=e),e!==void 0&&this._setWidth(e,this._texture.orig.width),t!==void 0&&this._setHeight(t,this._texture.orig.height)}}const oM=new ci;function Xx(n,e,t){const a=oM;n.measurable=!0,M_(n,t,a),e.addBoundsMask(a),n.measurable=!1}function qx(n,e,t){const a=Wr.get();n.measurable=!0;const r=ji.get().identity(),u=Fx(n,t,r);U_(n,a,u),n.measurable=!1,e.addBoundsMask(a),ji.return(r),Wr.return(a)}function Fx(n,e,t){return n?(n!==e&&(Fx(n.parent,e,t),n.updateLocalTransform(),t.append(n.localTransform)),t):(rt("Mask bounds, renderable is not inside the root container"),t)}class Ix{constructor(e){this.priority=0,this.inverse=!1,this.pipe="alphaMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.renderMaskToTexture=!(e instanceof au),this.mask.renderable=this.renderMaskToTexture,this.mask.includeInBuild=!this.renderMaskToTexture,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask=null}addBounds(e,t){this.inverse||Xx(this.mask,e,t)}addLocalBounds(e,t){qx(this.mask,e,t)}containsPoint(e,t){const a=this.mask;return t(a,e)}destroy(){this.reset()}static test(e){return e instanceof au}}Ix.extension=Q.MaskEffect;class kx{constructor(e){this.priority=0,this.pipe="colorMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e}destroy(){}static test(e){return typeof e=="number"}}kx.extension=Q.MaskEffect;class Kx{constructor(e){this.priority=0,this.pipe="stencilMask",e!=null&&e.mask&&this.init(e.mask)}init(e){this.mask=e,this.mask.includeInBuild=!1,this.mask.measurable=!1}reset(){this.mask.measurable=!0,this.mask.includeInBuild=!0,this.mask=null}addBounds(e,t){Xx(this.mask,e,t)}addLocalBounds(e,t){qx(this.mask,e,t)}containsPoint(e,t){const a=this.mask;return t(a,e)}destroy(){this.reset()}static test(e){return e instanceof Gn}}Kx.extension=Q.MaskEffect;let Qx={createCanvas:(n,e)=>{const t=document.createElement("canvas");return t.width=n,t.height=e,t},createImage:()=>new Image,getCanvasRenderingContext2D:()=>CanvasRenderingContext2D,getWebGLRenderingContext:()=>WebGLRenderingContext,getNavigator:()=>navigator,getBaseUrl:()=>document.baseURI??window.location.href,getFontFaceSet:()=>document.fonts,fetch:(n,e)=>fetch(n,e),parseXML:n=>new DOMParser().parseFromString(n,"text/xml")};const Gt={get(){return Qx},set(n){Qx=n}};class Jr extends Nn{constructor(e){e.resource||(e.resource=Gt.get().createCanvas()),e.width||(e.width=e.resource.width,e.autoDensity||(e.width/=e.resolution)),e.height||(e.height=e.resource.height,e.autoDensity||(e.height/=e.resolution)),super(e),this.uploadMethodId="image",this.autoDensity=e.autoDensity,this.resizeCanvas(),this.transparent=!!e.transparent}resizeCanvas(){this.autoDensity&&"style"in this.resource&&(this.resource.style.width=`${this.width}px`,this.resource.style.height=`${this.height}px`),(this.resource.width!==this.pixelWidth||this.resource.height!==this.pixelHeight)&&(this.resource.width=this.pixelWidth,this.resource.height=this.pixelHeight)}resize(e=this.width,t=this.height,a=this._resolution){const r=super.resize(e,t,a);return r&&this.resizeCanvas(),r}static test(e){return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement||globalThis.OffscreenCanvas&&e instanceof OffscreenCanvas}get context2D(){return this._context2D||(this._context2D=this.resource.getContext("2d"))}}Jr.extension=Q.TextureSource;class Kf extends Nn{constructor(e){super(e),this.uploadMethodId="image",this.autoGarbageCollect=!0}static test(e){return globalThis.HTMLImageElement&&e instanceof HTMLImageElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap||globalThis.VideoFrame&&e instanceof VideoFrame}}Kf.extension=Q.TextureSource;var xc=(n=>(n[n.INTERACTION=50]="INTERACTION",n[n.HIGH=25]="HIGH",n[n.NORMAL=0]="NORMAL",n[n.LOW=-25]="LOW",n[n.UTILITY=-50]="UTILITY",n))(xc||{});class P_{constructor(e,t=null,a=0,r=!1){this.next=null,this.previous=null,this._destroyed=!1,this._fn=e,this._context=t,this.priority=a,this._once=r}match(e,t=null){return this._fn===e&&this._context===t}emit(e){this._fn&&(this._context?this._fn.call(this._context,e):this._fn(e));const t=this.next;return this._once&&this.destroy(!0),this._destroyed&&(this.next=null),t}connect(e){this.previous=e,e.next&&(e.next.previous=this),this.next=e.next,e.next=this}destroy(e=!1){this._destroyed=!0,this._fn=null,this._context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const t=this.next;return this.next=e?null:t,this.previous=null,t}}const Zx=class qa{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new P_(null,null,1/0),this.deltaMS=1/qa.targetFPMS,this.elapsedMS=1/qa.targetFPMS,this._tick=e=>{this._requestId=null,this.started&&(this.update(e),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(e,t,a=xc.NORMAL){return this._addListener(new P_(e,t,a))}addOnce(e,t,a=xc.NORMAL){return this._addListener(new P_(e,t,a,!0))}_addListener(e){let t=this._head.next,a=this._head;if(!t)e.connect(a);else{for(;t;){if(e.priority>t.priority){e.connect(a);break}a=t,t=t.next}e.previous||e.connect(a)}return this._startIfPossible(),this}remove(e,t){let a=this._head.next;for(;a;)a.match(e,t)?a=a.destroy():a=a.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let e=0,t=this._head;for(;t=t.next;)e++;return e}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let e=this._head.next;for(;e;)e=e.destroy(!0);this._head.destroy(),this._head=null}}update(e=performance.now()){let t;if(e>this.lastTime){if(t=this.elapsedMS=e-this.lastTime,t>this._maxElapsedMS&&(t=this._maxElapsedMS),t*=this.speed,this._minElapsedMS){const u=e-this._lastFrame|0;if(u<this._minElapsedMS)return;this._lastFrame=e-u%this._minElapsedMS}this.deltaMS=t,this.deltaTime=this.deltaMS*qa.targetFPMS;const a=this._head;let r=a.next;for(;r;)r=r.emit(this);a.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=e}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(e){const t=Math.min(this.maxFPS,e),a=Math.min(Math.max(0,t)/1e3,qa.targetFPMS);this._maxElapsedMS=1/a}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(e){if(e===0)this._minElapsedMS=0;else{const t=Math.max(this.minFPS,e);this._minElapsedMS=1/(t/1e3)}}static get shared(){if(!qa._shared){const e=qa._shared=new qa;e.autoStart=!0,e._protected=!0}return qa._shared}static get system(){if(!qa._system){const e=qa._system=new qa;e.autoStart=!0,e._protected=!0}return qa._system}};Zx.targetFPMS=.06;let Ia=Zx,z_;async function uM(){return z_??(z_=(async()=>{var h;const e=Gt.get().createCanvas(1,1).getContext("webgl");if(!e)return"premultiply-alpha-on-upload";const t=await new Promise(d=>{const m=document.createElement("video");m.onloadeddata=()=>d(m),m.onerror=()=>d(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(!t)return"premultiply-alpha-on-upload";const a=e.createTexture();e.bindTexture(e.TEXTURE_2D,a);const r=e.createFramebuffer();e.bindFramebuffer(e.FRAMEBUFFER,r),e.framebufferTexture2D(e.FRAMEBUFFER,e.COLOR_ATTACHMENT0,e.TEXTURE_2D,a,0),e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),e.pixelStorei(e.UNPACK_COLORSPACE_CONVERSION_WEBGL,e.NONE),e.texImage2D(e.TEXTURE_2D,0,e.RGBA,e.RGBA,e.UNSIGNED_BYTE,t);const u=new Uint8Array(4);return e.readPixels(0,0,1,1,e.RGBA,e.UNSIGNED_BYTE,u),e.deleteFramebuffer(r),e.deleteTexture(a),(h=e.getExtension("WEBGL_lose_context"))==null||h.loseContext(),u[0]<=u[3]?"premultiplied-alpha":"premultiply-alpha-on-upload"})()),z_}const ey=class YR extends Nn{constructor(e){super(e),this.isReady=!1,this.uploadMethodId="video",e={...YR.defaultOptions,...e},this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=e.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=e.autoPlay!==!1,this.alphaMode=e.alphaMode??"premultiply-alpha-on-upload",this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onCanPlayThrough=this._onCanPlayThrough.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),e.autoLoad!==!1&&this.load()}updateFrame(){if(!this.destroyed){if(this._updateFPS){const e=Ia.shared.elapsedMS*this.resource.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-e)}(!this._updateFPS||this._msToNextUpdate<=0)&&(this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0),this.isValid&&this.update()}}_videoFrameRequestCallback(){this.updateFrame(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.resource.requestVideoFrameCallback(this._videoFrameRequestCallback)}get isValid(){return!!this.resource.videoWidth&&!!this.resource.videoHeight}async load(){if(this._load)return this._load;const e=this.resource,t=this.options;return(e.readyState===e.HAVE_ENOUGH_DATA||e.readyState===e.HAVE_FUTURE_DATA)&&e.width&&e.height&&(e.complete=!0),e.addEventListener("play",this._onPlayStart),e.addEventListener("pause",this._onPlayStop),e.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._mediaReady():(t.preload||e.addEventListener("canplay",this._onCanPlay),e.addEventListener("canplaythrough",this._onCanPlayThrough),e.addEventListener("error",this._onError,!0)),this.alphaMode=await uM(),this._load=new Promise((a,r)=>{this.isValid?a(this):(this._resolve=a,this._reject=r,t.preloadTimeoutMs!==void 0&&(this._preloadTimeout=setTimeout(()=>{this._onError(new ErrorEvent(`Preload exceeded timeout of ${t.preloadTimeoutMs}ms`))})),e.load())}),this._load}_onError(e){this.resource.removeEventListener("error",this._onError,!0),this.emit("error",e),this._reject&&(this._reject(e),this._reject=null,this._resolve=null)}_isSourcePlaying(){const e=this.resource;return!e.paused&&!e.ended}_isSourceReady(){return this.resource.readyState>2}_onPlayStart(){this.isValid||this._mediaReady(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0)}_onCanPlay(){this.resource.removeEventListener("canplay",this._onCanPlay),this._mediaReady()}_onCanPlayThrough(){this.resource.removeEventListener("canplaythrough",this._onCanPlay),this._preloadTimeout&&(clearTimeout(this._preloadTimeout),this._preloadTimeout=void 0),this._mediaReady()}_mediaReady(){const e=this.resource;this.isValid&&(this.isReady=!0,this.resize(e.videoWidth,e.videoHeight)),this._msToNextUpdate=0,this.updateFrame(),this._msToNextUpdate=0,this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&this.resource.play()}destroy(){this._configureAutoUpdate();const e=this.resource;e&&(e.removeEventListener("play",this._onPlayStart),e.removeEventListener("pause",this._onPlayStop),e.removeEventListener("seeked",this._onSeeked),e.removeEventListener("canplay",this._onCanPlay),e.removeEventListener("canplaythrough",this._onCanPlayThrough),e.removeEventListener("error",this._onError,!0),e.pause(),e.src="",e.load()),super.destroy()}get autoUpdate(){return this._autoUpdate}set autoUpdate(e){e!==this._autoUpdate&&(this._autoUpdate=e,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(e){e!==this._updateFPS&&(this._updateFPS=e,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.resource.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ia.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||(Ia.shared.add(this.updateFrame,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.resource.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ia.shared.remove(this.updateFrame,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(e){return globalThis.HTMLVideoElement&&e instanceof HTMLVideoElement}};ey.extension=Q.TextureSource,ey.defaultOptions={...Nn.defaultOptions,autoLoad:!0,autoPlay:!0,updateFPS:0,crossorigin:!0,loop:!1,muted:!0,playsinline:!0,preload:!1},ey.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let cM=ey;const Sc=(n,e,t=!1)=>(Array.isArray(n)||(n=[n]),e?n.map(a=>typeof a=="string"||t?e(a):a):n);class hM{constructor(){this._parsers=[],this._cache=new Map,this._cacheMap=new Map}reset(){this._cacheMap.clear(),this._cache.clear()}has(e){return this._cache.has(e)}get(e){const t=this._cache.get(e);return t||rt(`[Assets] Asset id ${e} was not found in the Cache`),t}set(e,t){const a=Sc(e);let r;for(let m=0;m<this.parsers.length;m++){const y=this.parsers[m];if(y.test(t)){r=y.getCacheableAssets(a,t);break}}const u=new Map(Object.entries(r||{}));r||a.forEach(m=>{u.set(m,t)});const h=[...u.keys()],d={cacheKeys:h,keys:a};a.forEach(m=>{this._cacheMap.set(m,d)}),h.forEach(m=>{const y=r?r[m]:t;this._cache.has(m)&&this._cache.get(m)!==y&&rt("[Cache] already has key:",m),this._cache.set(m,u.get(m))})}remove(e){if(!this._cacheMap.has(e)){rt(`[Assets] Asset id ${e} was not found in the Cache`);return}const t=this._cacheMap.get(e);t.cacheKeys.forEach(r=>{this._cache.delete(r)}),t.keys.forEach(r=>{this._cacheMap.delete(r)})}get parsers(){return this._parsers}}const Ui=new hM,H_=[];Ie.handleByList(Q.TextureSource,H_);function Wx(n={}){const e=n&&n.resource,t=e?n.resource:n,a=e?n:{resource:n};for(let r=0;r<H_.length;r++){const u=H_[r];if(u.test(t))return new u(a)}throw new Error(`Could not find a source type for resource: ${a.resource}`)}function fM(n={},e=!1){const t=n&&n.resource,a=t?n.resource:n,r=t?n:{resource:n};if(!e&&Ui.has(a))return Ui.get(a);const u=new Ge({source:Wx(r)});return u.on("destroy",()=>{Ui.has(a)&&Ui.remove(a)}),e||Ui.set(a,u),u}function dM(n,e=!1){return typeof n=="string"?Ui.get(n):n instanceof Nn?new Ge({source:n}):fM(n,e)}Ge.from=dM,Nn.from=Wx,Ie.add(Ix,kx,Kx,cM,Kf,Jr,v_);var Jx=(n=>(n[n.Low=0]="Low",n[n.Normal=1]="Normal",n[n.High=2]="High",n))(Jx||{});function Ms(n){if(typeof n!="string")throw new TypeError(`Path must be a string. Received ${JSON.stringify(n)}`)}function Qf(n){return n.split("?")[0].split("#")[0]}function pM(n){return n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function mM(n,e,t){return n.replace(new RegExp(pM(e),"g"),t)}function yM(n,e){let t="",a=0,r=-1,u=0,h=-1;for(let d=0;d<=n.length;++d){if(d<n.length)h=n.charCodeAt(d);else{if(h===47)break;h=47}if(h===47){if(!(r===d-1||u===1))if(r!==d-1&&u===2){if(t.length<2||a!==2||t.charCodeAt(t.length-1)!==46||t.charCodeAt(t.length-2)!==46){if(t.length>2){const m=t.lastIndexOf("/");if(m!==t.length-1){m===-1?(t="",a=0):(t=t.slice(0,m),a=t.length-1-t.lastIndexOf("/")),r=d,u=0;continue}}else if(t.length===2||t.length===1){t="",a=0,r=d,u=0;continue}}}else t.length>0?t+=`/${n.slice(r+1,d)}`:t=n.slice(r+1,d),a=d-r-1;r=d,u=0}else h===46&&u!==-1?++u:u=-1}return t}const Zf={toPosix(n){return mM(n,"\\","/")},isUrl(n){return/^https?:/.test(this.toPosix(n))},isDataUrl(n){return/^data:([a-z]+\/[a-z0-9-+.]+(;[a-z0-9-.!#$%*+.{}|~`]+=[a-z0-9-.!#$%*+.{}()_|~`]+)*)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s<>]*?)$/i.test(n)},isBlobUrl(n){return n.startsWith("blob:")},hasProtocol(n){return/^[^/:]+:/.test(this.toPosix(n))},getProtocol(n){Ms(n),n=this.toPosix(n);const e=/^file:\/\/\//.exec(n);if(e)return e[0];const t=/^[^/:]+:\/{0,2}/.exec(n);return t?t[0]:""},toAbsolute(n,e,t){if(Ms(n),this.isDataUrl(n)||this.isBlobUrl(n))return n;const a=Qf(this.toPosix(e??Gt.get().getBaseUrl())),r=Qf(this.toPosix(t??this.rootname(a)));return n=this.toPosix(n),n.startsWith("/")?Zf.join(r,n.slice(1)):this.isAbsolute(n)?n:this.join(a,n)},normalize(n){if(Ms(n),n.length===0)return".";if(this.isDataUrl(n)||this.isBlobUrl(n))return n;n=this.toPosix(n);let e="";const t=n.startsWith("/");this.hasProtocol(n)&&(e=this.rootname(n),n=n.slice(e.length));const a=n.endsWith("/");return n=yM(n),n.length>0&&a&&(n+="/"),t?`/${n}`:e+n},isAbsolute(n){return Ms(n),n=this.toPosix(n),this.hasProtocol(n)?!0:n.startsWith("/")},join(...n){if(n.length===0)return".";let e;for(let t=0;t<n.length;++t){const a=n[t];if(Ms(a),a.length>0)if(e===void 0)e=a;else{const r=n[t-1]??"";this.joinExtensions.includes(this.extname(r).toLowerCase())?e+=`/../${a}`:e+=`/${a}`}}return e===void 0?".":this.normalize(e)},dirname(n){if(Ms(n),n.length===0)return".";n=this.toPosix(n);let e=n.charCodeAt(0);const t=e===47;let a=-1,r=!0;const u=this.getProtocol(n),h=n;n=n.slice(u.length);for(let d=n.length-1;d>=1;--d)if(e=n.charCodeAt(d),e===47){if(!r){a=d;break}}else r=!1;return a===-1?t?"/":this.isUrl(h)?u+n:u:t&&a===1?"//":u+n.slice(0,a)},rootname(n){Ms(n),n=this.toPosix(n);let e="";if(n.startsWith("/")?e="/":e=this.getProtocol(n),this.isUrl(n)){const t=n.indexOf("/",e.length);t!==-1?e=n.slice(0,t):e=n,e.endsWith("/")||(e+="/")}return e},basename(n,e){Ms(n),e&&Ms(e),n=Qf(this.toPosix(n));let t=0,a=-1,r=!0,u;if(e!==void 0&&e.length>0&&e.length<=n.length){if(e.length===n.length&&e===n)return"";let h=e.length-1,d=-1;for(u=n.length-1;u>=0;--u){const m=n.charCodeAt(u);if(m===47){if(!r){t=u+1;break}}else d===-1&&(r=!1,d=u+1),h>=0&&(m===e.charCodeAt(h)?--h===-1&&(a=u):(h=-1,a=d))}return t===a?a=d:a===-1&&(a=n.length),n.slice(t,a)}for(u=n.length-1;u>=0;--u)if(n.charCodeAt(u)===47){if(!r){t=u+1;break}}else a===-1&&(r=!1,a=u+1);return a===-1?"":n.slice(t,a)},extname(n){Ms(n),n=Qf(this.toPosix(n));let e=-1,t=0,a=-1,r=!0,u=0;for(let h=n.length-1;h>=0;--h){const d=n.charCodeAt(h);if(d===47){if(!r){t=h+1;break}continue}a===-1&&(r=!1,a=h+1),d===46?e===-1?e=h:u!==1&&(u=1):e!==-1&&(u=-1)}return e===-1||a===-1||u===0||u===1&&e===a-1&&e===t+1?"":n.slice(e,a)},parse(n){Ms(n);const e={root:"",dir:"",base:"",ext:"",name:""};if(n.length===0)return e;n=Qf(this.toPosix(n));let t=n.charCodeAt(0);const a=this.isAbsolute(n);let r;e.root=this.rootname(n),a||this.hasProtocol(n)?r=1:r=0;let u=-1,h=0,d=-1,m=!0,y=n.length-1,b=0;for(;y>=r;--y){if(t=n.charCodeAt(y),t===47){if(!m){h=y+1;break}continue}d===-1&&(m=!1,d=y+1),t===46?u===-1?u=y:b!==1&&(b=1):u!==-1&&(b=-1)}return u===-1||d===-1||b===0||b===1&&u===d-1&&u===h+1?d!==-1&&(h===0&&a?e.base=e.name=n.slice(1,d):e.base=e.name=n.slice(h,d)):(h===0&&a?(e.name=n.slice(1,u),e.base=n.slice(1,d)):(e.name=n.slice(h,u),e.base=n.slice(h,d)),e.ext=n.slice(u,d)),e.dir=this.dirname(n),e},sep:"/",delimiter:":",joinExtensions:[".html"]};function $x(n,e,t,a,r){const u=e[t];for(let h=0;h<u.length;h++){const d=u[h];t<e.length-1?$x(n.replace(a[t],d),e,t+1,a,r):r.push(n.replace(a[t],d))}}function gM(n){const e=/\{(.*?)\}/g,t=n.match(e),a=[];if(t){const r=[];t.forEach(u=>{const h=u.substring(1,u.length-1).split(",");r.push(h)}),$x(n,r,0,t,a)}else a.push(n);return a}const eS=n=>!Array.isArray(n);class tS{constructor(){this._defaultBundleIdentifierOptions={connector:"-",createBundleAssetId:(e,t)=>`${e}${this._bundleIdConnector}${t}`,extractAssetIdFromBundle:(e,t)=>t.replace(`${e}${this._bundleIdConnector}`,"")},this._bundleIdConnector=this._defaultBundleIdentifierOptions.connector,this._createBundleAssetId=this._defaultBundleIdentifierOptions.createBundleAssetId,this._extractAssetIdFromBundle=this._defaultBundleIdentifierOptions.extractAssetIdFromBundle,this._assetMap={},this._preferredOrder=[],this._parsers=[],this._resolverHash={},this._bundles={}}setBundleIdentifier(e){if(this._bundleIdConnector=e.connector??this._bundleIdConnector,this._createBundleAssetId=e.createBundleAssetId??this._createBundleAssetId,this._extractAssetIdFromBundle=e.extractAssetIdFromBundle??this._extractAssetIdFromBundle,this._extractAssetIdFromBundle("foo",this._createBundleAssetId("foo","bar"))!=="bar")throw new Error("[Resolver] GenerateBundleAssetId are not working correctly")}prefer(...e){e.forEach(t=>{this._preferredOrder.push(t),t.priority||(t.priority=Object.keys(t.params))}),this._resolverHash={}}set basePath(e){this._basePath=e}get basePath(){return this._basePath}set rootPath(e){this._rootPath=e}get rootPath(){return this._rootPath}get parsers(){return this._parsers}reset(){this.setBundleIdentifier(this._defaultBundleIdentifierOptions),this._assetMap={},this._preferredOrder=[],this._resolverHash={},this._rootPath=null,this._basePath=null,this._manifest=null,this._bundles={},this._defaultSearchParams=null}setDefaultSearchParams(e){if(typeof e=="string")this._defaultSearchParams=e;else{const t=e;this._defaultSearchParams=Object.keys(t).map(a=>`${encodeURIComponent(a)}=${encodeURIComponent(t[a])}`).join("&")}}getAlias(e){const{alias:t,src:a}=e;return Sc(t||a,u=>typeof u=="string"?u:Array.isArray(u)?u.map(h=>(h==null?void 0:h.src)??h):u!=null&&u.src?u.src:u,!0)}addManifest(e){this._manifest&&rt("[Resolver] Manifest already exists, this will be overwritten"),this._manifest=e,e.bundles.forEach(t=>{this.addBundle(t.name,t.assets)})}addBundle(e,t){const a=[];let r=t;Array.isArray(t)||(r=Object.entries(t).map(([u,h])=>typeof h=="string"||Array.isArray(h)?{alias:u,src:h}:{alias:u,...h})),r.forEach(u=>{const h=u.src,d=u.alias;let m;if(typeof d=="string"){const y=this._createBundleAssetId(e,d);a.push(y),m=[d,y]}else{const y=d.map(b=>this._createBundleAssetId(e,b));a.push(...y),m=[...d,...y]}this.add({...u,alias:m,src:h})}),this._bundles[e]=a}add(e){const t=[];Array.isArray(e)?t.push(...e):t.push(e);let a;a=u=>{this.hasKey(u)&&rt(`[Resolver] already has key: ${u} overwriting`)},Sc(t).forEach(u=>{const{src:h}=u;let{data:d,format:m,loadParser:y,parser:b}=u;const S=Sc(h).map(A=>typeof A=="string"?gM(A):Array.isArray(A)?A:[A]),T=this.getAlias(u);Array.isArray(T)?T.forEach(a):a(T);const E=[];S.forEach(A=>{A.forEach(B=>{let M={};if(typeof B!="object"){M.src=B;for(let G=0;G<this._parsers.length;G++){const w=this._parsers[G];if(w.test(B)){M=w.parse(B);break}}}else d=B.data??d,m=B.format??m,(B.loadParser||B.parser)&&(y=B.loadParser??y,b=B.parser??b),M={...M,...B};if(!T)throw new Error(`[Resolver] alias is undefined for this asset: ${M.src}`);M=this._buildResolvedAsset(M,{aliases:T,data:d,format:m,loadParser:y,parser:b}),E.push(M)})}),T.forEach(A=>{this._assetMap[A]=E})})}resolveBundle(e){const t=eS(e);e=Sc(e);const a={};return e.forEach(r=>{const u=this._bundles[r];if(u){const h=this.resolve(u),d={};for(const m in h){const y=h[m];d[this._extractAssetIdFromBundle(r,m)]=y}a[r]=d}}),t?a[e[0]]:a}resolveUrl(e){const t=this.resolve(e);if(typeof e!="string"){const a={};for(const r in t)a[r]=t[r].src;return a}return t.src}resolve(e){const t=eS(e);e=Sc(e);const a={};return e.forEach(r=>{if(!this._resolverHash[r])if(this._assetMap[r]){let u=this._assetMap[r];const h=this._getPreferredOrder(u);h==null||h.priority.forEach(d=>{h.params[d].forEach(m=>{const y=u.filter(b=>b[d]?b[d]===m:!1);y.length&&(u=y)})}),this._resolverHash[r]=u[0]}else this._resolverHash[r]=this._buildResolvedAsset({alias:[r],src:r},{});a[r]=this._resolverHash[r]}),t?a[e[0]]:a}hasKey(e){return!!this._assetMap[e]}hasBundle(e){return!!this._bundles[e]}_getPreferredOrder(e){for(let t=0;t<e.length;t++){const a=e[t],r=this._preferredOrder.find(u=>u.params.format.includes(a.format));if(r)return r}return this._preferredOrder[0]}_appendDefaultSearchParams(e){if(!this._defaultSearchParams)return e;const t=/\?/.test(e)?"&":"?";return`${e}${t}${this._defaultSearchParams}`}_buildResolvedAsset(e,t){const{aliases:a,data:r,loadParser:u,parser:h,format:d}=t;return(this._basePath||this._rootPath)&&(e.src=Zf.toAbsolute(e.src,this._basePath,this._rootPath)),e.alias=a??e.alias??[e.src],e.src=this._appendDefaultSearchParams(e.src),e.data={...r||{},...e.data},e.loadParser=u??e.loadParser,e.parser=h??e.parser,e.format=d??e.format??_M(e.src),e}}tS.RETINA_PREFIX=/@([0-9\.]+)x/;function _M(n){return n.split(".").pop().split("?").shift().split("#").shift()}const nS=(n,e)=>{const t=e.split("?")[1];return t&&(n+=`?${t}`),n},iS=class Xm{constructor(e,t){this.linkedSheets=[];let a=e;(e==null?void 0:e.source)instanceof Nn&&(a={texture:e,data:t});const{texture:r,data:u,cachePrefix:h=""}=a;this.cachePrefix=h,this._texture=r instanceof Ge?r:null,this.textureSource=r.source,this.textures={},this.animations={},this.data=u;const d=parseFloat(u.meta.scale);d?(this.resolution=d,r.source.resolution=this.resolution):this.resolution=r.source._resolution,this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}parse(){return new Promise(e=>{this._callback=e,this._batchIndex=0,this._frameKeys.length<=Xm.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(e){let t=e;const a=Xm.BATCH_SIZE;for(;t-e<a&&t<this._frameKeys.length;){const r=this._frameKeys[t],u=this._frames[r],h=u.frame;if(h){let d=null,m=null;const y=u.trimmed!==!1&&u.sourceSize?u.sourceSize:u.frame,b=new Nt(0,0,Math.floor(y.w)/this.resolution,Math.floor(y.h)/this.resolution);u.rotated?d=new Nt(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.h)/this.resolution,Math.floor(h.w)/this.resolution):d=new Nt(Math.floor(h.x)/this.resolution,Math.floor(h.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution),u.trimmed!==!1&&u.spriteSourceSize&&(m=new Nt(Math.floor(u.spriteSourceSize.x)/this.resolution,Math.floor(u.spriteSourceSize.y)/this.resolution,Math.floor(h.w)/this.resolution,Math.floor(h.h)/this.resolution)),this.textures[r]=new Ge({source:this.textureSource,frame:d,orig:b,trim:m,rotate:u.rotated?2:0,defaultAnchor:u.anchor,defaultBorders:u.borders,label:r.toString()})}t++}}_processAnimations(){const e=this.data.animations||{};for(const t in e){this.animations[t]=[];for(let a=0;a<e[t].length;a++){const r=e[t][a];this.animations[t].push(this.textures[r])}}}_parseComplete(){const e=this._callback;this._callback=null,this._batchIndex=0,e.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*Xm.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*Xm.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(e=!1){var t;for(const a in this.textures)this.textures[a].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,e&&((t=this._texture)==null||t.destroy(),this.textureSource.destroy()),this._texture=null,this.textureSource=null,this.linkedSheets=[]}};iS.BATCH_SIZE=1e3;let aS=iS;const vM=["jpg","png","jpeg","avif","webp","basis","etc2","bc7","bc6h","bc5","bc4","bc3","bc2","bc1","eac","astc"];function sS(n,e,t){const a={};if(n.forEach(r=>{a[r]=e}),Object.keys(e.textures).forEach(r=>{a[`${e.cachePrefix}${r}`]=e.textures[r]}),!t){const r=Zf.dirname(n[0]);e.linkedSheets.forEach((u,h)=>{const d=sS([`${r}/${e.data.meta.related_multi_packs[h]}`],u,!0);Object.assign(a,d)})}return a}const bM={extension:Q.Asset,cache:{test:n=>n instanceof aS,getCacheableAssets:(n,e)=>sS(n,e,!1)},resolver:{extension:{type:Q.ResolveParser,name:"resolveSpritesheet"},test:n=>{const t=n.split("?")[0].split("."),a=t.pop(),r=t.pop();return a==="json"&&vM.includes(r)},parse:n=>{var t;const e=n.split(".");return{resolution:parseFloat(((t=tS.RETINA_PREFIX.exec(n))==null?void 0:t[1])??"1"),format:e[e.length-2],src:n}}},loader:{name:"spritesheetLoader",id:"spritesheet",extension:{type:Q.LoadParser,priority:Jx.Normal,name:"spritesheetLoader"},async testParse(n,e){return Zf.extname(e.src).toLowerCase()===".json"&&!!n.frames},async parse(n,e,t){var S,T;const{texture:a,imageFilename:r,textureOptions:u,cachePrefix:h}=(e==null?void 0:e.data)??{};let d=Zf.dirname(e.src);d&&d.lastIndexOf("/")!==d.length-1&&(d+="/");let m;if(a instanceof Ge)m=a;else{const E=nS(d+(r??n.meta.image),e.src);m=(await t.load([{src:E,data:u}]))[E]}const y=new aS({texture:m.source,data:n,cachePrefix:h});await y.parse();const b=(S=n==null?void 0:n.meta)==null?void 0:S.related_multi_packs;if(Array.isArray(b)){const E=[];for(const B of b){if(typeof B!="string")continue;let M=d+B;(T=e.data)!=null&&T.ignoreMultiPack||(M=nS(M,e.src),E.push(t.load({src:M,data:{textureOptions:u,ignoreMultiPack:!0}})))}const A=await Promise.all(E);y.linkedSheets=A,A.forEach(B=>{B.linkedSheets=[y].concat(y.linkedSheets.filter(M=>M!==B))})}return y},async unload(n,e,t){await t.unload(n.textureSource._sourceOrigin),n.destroy(!1)}}};Ie.add(bM);class rS{constructor(e){this._lastTransform="",this._observer=null,this._tickerAttached=!1,this.updateTranslation=()=>{if(!this._canvas)return;const t=this._canvas.getBoundingClientRect(),a=this._canvas.width,r=this._canvas.height,u=t.width/a*this._renderer.resolution,h=t.height/r*this._renderer.resolution,d=t.left,m=t.top,y=`translate(${d}px, ${m}px) scale(${u}, ${h})`;y!==this._lastTransform&&(this._domElement.style.transform=y,this._lastTransform=y)},this._domElement=e.domElement,this._renderer=e.renderer,!(globalThis.OffscreenCanvas&&this._renderer.canvas instanceof OffscreenCanvas)&&(this._canvas=this._renderer.canvas,this._attachObserver())}get canvas(){return this._canvas}ensureAttached(){!this._domElement.parentNode&&this._canvas.parentNode&&(this._canvas.parentNode.appendChild(this._domElement),this.updateTranslation())}_attachObserver(){"ResizeObserver"in globalThis?(this._observer&&(this._observer.disconnect(),this._observer=null),this._observer=new ResizeObserver(e=>{for(const t of e){if(t.target!==this._canvas)continue;const a=this.canvas.width,r=this.canvas.height,u=t.contentRect.width/a*this._renderer.resolution,h=t.contentRect.height/r*this._renderer.resolution;(this._lastScaleX!==u||this._lastScaleY!==h)&&(this.updateTranslation(),this._lastScaleX=u,this._lastScaleY=h)}}),this._observer.observe(this._canvas)):this._tickerAttached||Ia.shared.add(this.updateTranslation,this,xc.HIGH)}destroy(){this._observer?(this._observer.disconnect(),this._observer=null):this._tickerAttached&&Ia.shared.remove(this.updateTranslation),this._domElement=null,this._renderer=null,this._canvas=null,this._tickerAttached=!1,this._lastTransform="",this._lastScaleX=null,this._lastScaleY=null}}class Wf{constructor(e){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=Wf.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new qt,this.page=new qt,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=e}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(e,t,a){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(e,t,a,r,u){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}var V_=/iPhone/i,lS=/iPod/i,oS=/iPad/i,uS=/\biOS-universal(?:.+)Mac\b/i,L_=/\bAndroid(?:.+)Mobile\b/i,cS=/Android/i,Tc=/(?:SD4930UR|\bSilk(?:.+)Mobile\b)/i,ty=/Silk/i,$r=/Windows Phone/i,hS=/\bWindows(?:.+)ARM\b/i,fS=/BlackBerry/i,dS=/BB10/i,pS=/Opera Mini/i,mS=/\b(CriOS|Chrome)(?:.+)Mobile/i,yS=/Mobile(?:.+)Firefox\b/i,gS=function(n){return typeof n<"u"&&n.platform==="MacIntel"&&typeof n.maxTouchPoints=="number"&&n.maxTouchPoints>1&&typeof MSStream>"u"};function xM(n){return function(e){return e.test(n)}}function _S(n){var e={userAgent:"",platform:"",maxTouchPoints:0};!n&&typeof navigator<"u"?e={userAgent:navigator.userAgent,platform:navigator.platform,maxTouchPoints:navigator.maxTouchPoints||0}:typeof n=="string"?e.userAgent=n:n&&n.userAgent&&(e={userAgent:n.userAgent,platform:n.platform,maxTouchPoints:n.maxTouchPoints||0});var t=e.userAgent,a=t.split("[FBAN");typeof a[1]<"u"&&(t=a[0]),a=t.split("Twitter"),typeof a[1]<"u"&&(t=a[0]);var r=xM(t),u={apple:{phone:r(V_)&&!r($r),ipod:r(lS),tablet:!r(V_)&&(r(oS)||gS(e))&&!r($r),universal:r(uS),device:(r(V_)||r(lS)||r(oS)||r(uS)||gS(e))&&!r($r)},amazon:{phone:r(Tc),tablet:!r(Tc)&&r(ty),device:r(Tc)||r(ty)},android:{phone:!r($r)&&r(Tc)||!r($r)&&r(L_),tablet:!r($r)&&!r(Tc)&&!r(L_)&&(r(ty)||r(cS)),device:!r($r)&&(r(Tc)||r(ty)||r(L_)||r(cS))||r(/\bokhttp\b/i)},windows:{phone:r($r),tablet:r(hS),device:r($r)||r(hS)},other:{blackberry:r(fS),blackberry10:r(dS),opera:r(pS),firefox:r(yS),chrome:r(mS),device:r(fS)||r(dS)||r(pS)||r(yS)||r(mS)},any:!1,phone:!1,tablet:!1};return u.any=u.apple.device||u.android.device||u.windows.device||u.other.device,u.phone=u.apple.phone||u.android.phone||u.windows.phone,u.tablet=u.apple.tablet||u.android.tablet||u.windows.tablet,u}const SM=(_S.default??_S)(globalThis.navigator),TM=9,vS=100,EM=0,CM=0,bS=2,xS=1,RM=-1e3,AM=-1e3,MM=2,j_=class XR{constructor(e,t=SM){this._mobileInfo=t,this.debug=!1,this._activateOnTab=!0,this._deactivateOnMouseMove=!0,this._isActive=!1,this._isMobileAccessibility=!1,this._div=null,this._pool=[],this._renderId=0,this._children=[],this._androidUpdateCount=0,this._androidUpdateFrequency=500,this._hookDiv=null,(t.tablet||t.phone)&&this._createTouchHook(),this._renderer=e}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}get hookDiv(){return this._hookDiv}_createTouchHook(){const e=document.createElement("button");e.style.width=`${xS}px`,e.style.height=`${xS}px`,e.style.position="absolute",e.style.top=`${RM}px`,e.style.left=`${AM}px`,e.style.zIndex=MM.toString(),e.style.backgroundColor="#FF0000",e.title="select to enable accessibility for this content",e.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this._activate(),this._destroyTouchHook()}),document.body.appendChild(e),this._hookDiv=e}_destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}_activate(){if(this._isActive)return;this._isActive=!0,this._div||(this._div=document.createElement("div"),this._div.style.position="absolute",this._div.style.top=`${EM}px`,this._div.style.left=`${CM}px`,this._div.style.pointerEvents="none",this._div.style.zIndex=bS.toString(),this._canvasObserver=new rS({domElement:this._div,renderer:this._renderer})),this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._deactivateOnMouseMove&&(this._onMouseMove=this._onMouseMove.bind(this),globalThis.document.addEventListener("mousemove",this._onMouseMove,!0));const e=this._renderer.view.canvas;if(e.parentNode)this._canvasObserver.ensureAttached(),this._initAccessibilitySetup();else{const t=new MutationObserver(()=>{e.parentNode&&(t.disconnect(),this._canvasObserver.ensureAttached(),this._initAccessibilitySetup())});t.observe(document.body,{childList:!0,subtree:!0})}}_initAccessibilitySetup(){this._renderer.runners.postrender.add(this),this._renderer.lastObjectRendered&&this._updateAccessibleObjects(this._renderer.lastObjectRendered)}_deactivate(){if(!(!this._isActive||this._isMobileAccessibility)){this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),this._activateOnTab&&globalThis.addEventListener("keydown",this._onKeyDown,!1),this._renderer.runners.postrender.remove(this);for(const e of this._children)e._accessibleDiv&&e._accessibleDiv.parentNode&&(e._accessibleDiv.parentNode.removeChild(e._accessibleDiv),e._accessibleDiv=null),e._accessibleActive=!1;this._pool.forEach(e=>{e.parentNode&&e.parentNode.removeChild(e)}),this._div&&this._div.parentNode&&this._div.parentNode.removeChild(this._div),this._pool=[],this._children=[]}}_updateAccessibleObjects(e){if(!e.visible||!e.accessibleChildren)return;e.accessible&&(e._accessibleActive||this._addChild(e),e._renderId=this._renderId);const t=e.children;if(t)for(let a=0;a<t.length;a++)this._updateAccessibleObjects(t[a])}init(e){const a={accessibilityOptions:{...XR.defaultOptions,...(e==null?void 0:e.accessibilityOptions)||{}}};this.debug=a.accessibilityOptions.debug,this._activateOnTab=a.accessibilityOptions.activateOnTab,this._deactivateOnMouseMove=a.accessibilityOptions.deactivateOnMouseMove,a.accessibilityOptions.enabledByDefault?this._activate():this._activateOnTab&&(this._onKeyDown=this._onKeyDown.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)),this._renderer.runners.postrender.remove(this)}postrender(){const e=performance.now();if(this._mobileInfo.android.device&&e<this._androidUpdateCount||(this._androidUpdateCount=e+this._androidUpdateFrequency,!this._renderer.renderingToScreen||!this._renderer.view.canvas))return;const t=new Set;if(this._renderer.lastObjectRendered){this._updateAccessibleObjects(this._renderer.lastObjectRendered);for(const a of this._children)a._renderId===this._renderId&&t.add(this._children.indexOf(a))}for(let a=this._children.length-1;a>=0;a--){const r=this._children[a];t.has(a)||(r._accessibleDiv&&r._accessibleDiv.parentNode&&(r._accessibleDiv.parentNode.removeChild(r._accessibleDiv),this._pool.push(r._accessibleDiv),r._accessibleDiv=null),r._accessibleActive=!1,Px(this._children,a,1))}this._renderer.renderingToScreen&&this._canvasObserver.ensureAttached();for(let a=0;a<this._children.length;a++){const r=this._children[a];if(!r._accessibleActive||!r._accessibleDiv)continue;const u=r._accessibleDiv,h=r.hitArea||r.getBounds().rectangle;if(r.hitArea){const d=r.worldTransform;u.style.left=`${d.tx+h.x*d.a}px`,u.style.top=`${d.ty+h.y*d.d}px`,u.style.width=`${h.width*d.a}px`,u.style.height=`${h.height*d.d}px`}else this._capHitArea(h),u.style.left=`${h.x}px`,u.style.top=`${h.y}px`,u.style.width=`${h.width}px`,u.style.height=`${h.height}px`}this._renderId++}_updateDebugHTML(e){e.innerHTML=`type: ${e.type}</br> title : ${e.title}</br> tabIndex: ${e.tabIndex}`}_capHitArea(e){e.x<0&&(e.width+=e.x,e.x=0),e.y<0&&(e.height+=e.y,e.y=0);const{width:t,height:a}=this._renderer;e.x+e.width>t&&(e.width=t-e.x),e.y+e.height>a&&(e.height=a-e.y)}_addChild(e){let t=this._pool.pop();t||(e.accessibleType==="button"?t=document.createElement("button"):(t=document.createElement(e.accessibleType),t.style.cssText=`
|
|
56
|
+
color: transparent;
|
|
57
|
+
pointer-events: none;
|
|
58
|
+
padding: 0;
|
|
59
|
+
margin: 0;
|
|
60
|
+
border: 0;
|
|
61
|
+
outline: 0;
|
|
62
|
+
background: transparent;
|
|
63
|
+
box-sizing: border-box;
|
|
64
|
+
user-select: none;
|
|
65
|
+
-webkit-user-select: none;
|
|
66
|
+
-moz-user-select: none;
|
|
67
|
+
-ms-user-select: none;
|
|
68
|
+
`,e.accessibleText&&(t.innerText=e.accessibleText)),t.style.width=`${vS}px`,t.style.height=`${vS}px`,t.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",t.style.position="absolute",t.style.zIndex=bS.toString(),t.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?t.setAttribute("aria-live","off"):t.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?t.setAttribute("aria-relevant","additions"):t.setAttribute("aria-relevant","text"),t.addEventListener("click",this._onClick.bind(this)),t.addEventListener("focus",this._onFocus.bind(this)),t.addEventListener("focusout",this._onFocusOut.bind(this))),t.style.pointerEvents=e.accessiblePointerEvents,t.type=e.accessibleType,e.accessibleTitle&&e.accessibleTitle!==null?t.title=e.accessibleTitle:(!e.accessibleHint||e.accessibleHint===null)&&(t.title=`container ${e.tabIndex}`),e.accessibleHint&&e.accessibleHint!==null&&t.setAttribute("aria-label",e.accessibleHint),this.debug&&this._updateDebugHTML(t),e._accessibleActive=!0,e._accessibleDiv=t,t.container=e,this._children.push(e),this._div.appendChild(e._accessibleDiv),e.interactive&&(e._accessibleDiv.tabIndex=e.tabIndex)}_dispatchEvent(e,t){const{container:a}=e.target,r=this._renderer.events.rootBoundary,u=Object.assign(new Wf(r),{target:a});r.rootTarget=this._renderer.lastObjectRendered,t.forEach(h=>r.dispatchEvent(u,h))}_onClick(e){this._dispatchEvent(e,["click","pointertap","tap"])}_onFocus(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","assertive"),this._dispatchEvent(e,["mouseover"])}_onFocusOut(e){e.target.getAttribute("aria-live")||e.target.setAttribute("aria-live","polite"),this._dispatchEvent(e,["mouseout"])}_onKeyDown(e){e.keyCode!==TM||!this._activateOnTab||this._activate()}_onMouseMove(e){e.movementX===0&&e.movementY===0||this._deactivate()}destroy(){var e;this._deactivate(),this._destroyTouchHook(),(e=this._canvasObserver)==null||e.destroy(),this._canvasObserver=null,this._div=null,this._pool=null,this._children=null,this._renderer=null,this._activateOnTab&&globalThis.removeEventListener("keydown",this._onKeyDown)}setAccessibilityEnabled(e){e?this._activate():this._deactivate()}};j_.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"accessibility"},j_.defaultOptions={enabledByDefault:!1,debug:!1,activateOnTab:!0,deactivateOnMouseMove:!0};let DM=j_;const UM={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,accessibleType:"button",accessibleText:null,accessiblePointerEvents:"auto",accessibleChildren:!0,_accessibleActive:!1,_accessibleDiv:null,_renderId:-1},Y_=Object.create(null),SS=Object.create(null);function Jf(n,e){let t=SS[n];return t===void 0&&(Y_[e]===void 0&&(Y_[e]=1),SS[n]=t=Y_[e]++),t}let Ec;function TS(){return(!Ec||Ec!=null&&Ec.isContextLost())&&(Ec=Gt.get().createCanvas().getContext("webgl",{})),Ec}let ny;function BM(){if(!ny){ny="mediump";const n=TS();n&&n.getShaderPrecisionFormat&&(ny=n.getShaderPrecisionFormat(n.FRAGMENT_SHADER,n.HIGH_FLOAT).precision?"highp":"mediump")}return ny}function OM(n,e,t){return e?n:t?(n=n.replace("out vec4 finalColor;",""),`
|
|
69
|
+
|
|
70
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
71
|
+
#define in varying
|
|
72
|
+
#define finalColor gl_FragColor
|
|
73
|
+
#define texture texture2D
|
|
74
|
+
#endif
|
|
75
|
+
${n}
|
|
76
|
+
`):`
|
|
77
|
+
|
|
78
|
+
#ifdef GL_ES // This checks if it is WebGL1
|
|
79
|
+
#define in attribute
|
|
80
|
+
#define out varying
|
|
81
|
+
#endif
|
|
82
|
+
${n}
|
|
83
|
+
`}function NM(n,e,t){const a=t?e.maxSupportedFragmentPrecision:e.maxSupportedVertexPrecision;if(n.substring(0,9)!=="precision"){let r=t?e.requestedFragmentPrecision:e.requestedVertexPrecision;return r==="highp"&&a!=="highp"&&(r="mediump"),`precision ${r} float;
|
|
84
|
+
${n}`}else if(a!=="highp"&&n.substring(0,15)==="precision highp")return n.replace("precision highp","precision mediump");return n}function GM(n,e){return e?`#version 300 es
|
|
85
|
+
${n}`:n}const wM={},PM={};function zM(n,{name:e="pixi-program"},t=!0){e=e.replace(/\s+/g,"-"),e+=t?"-fragment":"-vertex";const a=t?wM:PM;return a[e]?(a[e]++,e+=`-${a[e]}`):a[e]=1,n.indexOf("#define SHADER_NAME")!==-1?n:`${`#define SHADER_NAME ${e}`}
|
|
86
|
+
${n}`}function HM(n,e){return e?n.replace("#version 300 es",""):n}const X_={stripVersion:HM,ensurePrecision:NM,addProgramDefines:OM,setProgramName:zM,insertVersion:GM},q_=Object.create(null),ES=class Kb{constructor(e){e={...Kb.defaultOptions,...e};const t=e.fragment.indexOf("#version 300 es")!==-1,a={stripVersion:t,ensurePrecision:{requestedFragmentPrecision:e.preferredFragmentPrecision,requestedVertexPrecision:e.preferredVertexPrecision,maxSupportedVertexPrecision:"highp",maxSupportedFragmentPrecision:BM()},setProgramName:{name:e.name},addProgramDefines:t,insertVersion:t};let r=e.fragment,u=e.vertex;Object.keys(X_).forEach(h=>{const d=a[h];r=X_[h](r,d,!0),u=X_[h](u,d,!1)}),this.fragment=r,this.vertex=u,this.transformFeedbackVaryings=e.transformFeedbackVaryings,this._key=Jf(`${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}static from(e){const t=`${e.vertex}:${e.fragment}`;return q_[t]||(q_[t]=new Kb(e)),q_[t]}};ES.defaultOptions={preferredVertexPrecision:"highp",preferredFragmentPrecision:"mediump"};let Cc=ES;const CS={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 ql(n){return CS[n]??CS.float32}const VM={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",u32:"uint32","vec2<u32>":"uint32x2","vec3<u32>":"uint32x3","vec4<u32>":"uint32x4",bool:"uint32","vec2<bool>":"uint32x2","vec3<bool>":"uint32x3","vec4<bool>":"uint32x4"};function LM({source:n,entryPoint:e}){const t={},a=n.indexOf(`fn ${e}`);if(a!==-1){const r=n.indexOf("->",a);if(r!==-1){const u=n.substring(a,r),h=/@location\((\d+)\)\s+([a-zA-Z0-9_]+)\s*:\s*([a-zA-Z0-9_<>]+)(?:,|\s|$)/g;let d;for(;(d=h.exec(u))!==null;){const m=VM[d[3]]??"float32";t[d[2]]={location:parseInt(d[1],10),format:m,stride:ql(m).stride,offset:0,instance:!1,start:0}}}}return t}function F_(n){var S,T;const e=/(^|[^/])@(group|binding)\(\d+\)[^;]+;/g,t=/@group\((\d+)\)/,a=/@binding\((\d+)\)/,r=/var(<[^>]+>)? (\w+)/,u=/:\s*(\w+)/,h=/struct\s+(\w+)\s*{([^}]+)}/g,d=/(\w+)\s*:\s*([\w\<\>]+)/g,m=/struct\s+(\w+)/,y=(S=n.match(e))==null?void 0:S.map(E=>({group:parseInt(E.match(t)[1],10),binding:parseInt(E.match(a)[1],10),name:E.match(r)[2],isUniform:E.match(r)[1]==="<uniform>",type:E.match(u)[1]}));if(!y)return{groups:[],structs:[]};const b=((T=n.match(h))==null?void 0:T.map(E=>{const A=E.match(m)[1],B=E.match(d).reduce((M,G)=>{const[w,P]=G.split(":");return M[w.trim()]=P.trim(),M},{});return B?{name:A,members:B}:null}).filter(({name:E})=>y.some(A=>A.type===E)))??[];return{groups:y,structs:b}}var $f=(n=>(n[n.VERTEX=1]="VERTEX",n[n.FRAGMENT=2]="FRAGMENT",n[n.COMPUTE=4]="COMPUTE",n))($f||{});function jM({groups:n}){const e=[];for(let t=0;t<n.length;t++){const a=n[t];e[a.group]||(e[a.group]=[]),a.isUniform?e[a.group].push({binding:a.binding,visibility:$f.VERTEX|$f.FRAGMENT,buffer:{type:"uniform"}}):a.type==="sampler"?e[a.group].push({binding:a.binding,visibility:$f.FRAGMENT,sampler:{type:"filtering"}}):a.type==="texture_2d"&&e[a.group].push({binding:a.binding,visibility:$f.FRAGMENT,texture:{sampleType:"float",viewDimension:"2d",multisampled:!1}})}return e}function YM({groups:n}){const e=[];for(let t=0;t<n.length;t++){const a=n[t];e[a.group]||(e[a.group]={}),e[a.group][a.name]=a.binding}return e}function XM(n,e){const t=new Set,a=new Set,r=[...n.structs,...e.structs].filter(h=>t.has(h.name)?!1:(t.add(h.name),!0)),u=[...n.groups,...e.groups].filter(h=>{const d=`${h.name}-${h.binding}`;return a.has(d)?!1:(a.add(d),!0)});return{structs:r,groups:u}}const I_=Object.create(null);class su{constructor(e){var d,m;this._layoutKey=0,this._attributeLocationsKey=0;const{fragment:t,vertex:a,layout:r,gpuLayout:u,name:h}=e;if(this.name=h,this.fragment=t,this.vertex=a,t.source===a.source){const y=F_(t.source);this.structsAndGroups=y}else{const y=F_(a.source),b=F_(t.source);this.structsAndGroups=XM(y,b)}this.layout=r??YM(this.structsAndGroups),this.gpuLayout=u??jM(this.structsAndGroups),this.autoAssignGlobalUniforms=((d=this.layout[0])==null?void 0:d.globalUniforms)!==void 0,this.autoAssignLocalUniforms=((m=this.layout[1])==null?void 0:m.localUniforms)!==void 0,this._generateProgramKey()}_generateProgramKey(){const{vertex:e,fragment:t}=this,a=e.source+t.source+e.entryPoint+t.entryPoint;this._layoutKey=Jf(a,"program")}get attributeData(){return this._attributeData??(this._attributeData=LM(this.vertex)),this._attributeData}destroy(){this.gpuLayout=null,this.layout=null,this.structsAndGroups=null,this.fragment=null,this.vertex=null}static from(e){const t=`${e.vertex.source}:${e.fragment.source}:${e.fragment.entryPoint}:${e.vertex.entryPoint}`;return I_[t]||(I_[t]=new su(e)),I_[t]}}const RS=["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>"],qM=RS.reduce((n,e)=>(n[e]=!0,n),{});function FM(n,e){switch(n){case"f32":return 0;case"vec2<f32>":return new Float32Array(2*e);case"vec3<f32>":return new Float32Array(3*e);case"vec4<f32>":return new Float32Array(4*e);case"mat2x2<f32>":return new Float32Array([1,0,0,1]);case"mat3x3<f32>":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4x4<f32>":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}const AS=class qR{constructor(e,t){this._touched=0,this.uid=Kt("uniform"),this._resourceType="uniformGroup",this._resourceId=Kt("resource"),this.isUniformGroup=!0,this._dirtyId=0,this.destroyed=!1,t={...qR.defaultOptions,...t},this.uniformStructures=e;const a={};for(const r in e){const u=e[r];if(u.name=r,u.size=u.size??1,!qM[u.type])throw new Error(`Uniform type ${u.type} is not supported. Supported uniform types are: ${RS.join(", ")}`);u.value??(u.value=FM(u.type,u.size)),a[r]=u.value}this.uniforms=a,this._dirtyId=1,this.ubo=t.ubo,this.isStatic=t.isStatic,this._signature=Jf(Object.keys(a).map(r=>`${r}-${e[r].type}`).join("-"),"uniform-group")}update(){this._dirtyId++}};AS.defaultOptions={ubo:!1,isStatic:!1};let Yi=AS;class el{constructor(e){this.resources=Object.create(null),this._dirty=!0;let t=0;for(const a in e){const r=e[a];this.setResource(r,t++)}this._updateKey()}_updateKey(){if(!this._dirty)return;this._dirty=!1;const e=[];let t=0;for(const a in this.resources)e[t++]=this.resources[a]._resourceId;this._key=e.join("|")}setResource(e,t){var r,u;const a=this.resources[t];e!==a&&(a&&((r=e.off)==null||r.call(e,"change",this.onResourceChange,this)),(u=e.on)==null||u.call(e,"change",this.onResourceChange,this),this.resources[t]=e,this._dirty=!0)}getResource(e){return this.resources[e]}_touch(e){const t=this.resources;for(const a in t)t[a]._touched=e}destroy(){var t;const e=this.resources;for(const a in e){const r=e[a];(t=r.off)==null||t.call(r,"change",this.onResourceChange,this)}this.resources=null}onResourceChange(e){if(this._dirty=!0,e.destroyed){const t=this.resources;for(const a in t)t[a]===e&&(t[a]=null)}else this._updateKey()}}var Ds=(n=>(n[n.WEBGL=1]="WEBGL",n[n.WEBGPU=2]="WEBGPU",n[n.BOTH=3]="BOTH",n))(Ds||{});class ka extends Sa{constructor(e){super(),this.uid=Kt("shader"),this._uniformBindMap=Object.create(null),this._ownedBindGroups=[];let{gpuProgram:t,glProgram:a,groups:r,resources:u,compatibleRenderers:h,groupMap:d}=e;this.gpuProgram=t,this.glProgram=a,h===void 0&&(h=0,t&&(h|=Ds.WEBGPU),a&&(h|=Ds.WEBGL)),this.compatibleRenderers=h;const m={};if(!u&&!r&&(u={}),u&&r)throw new Error("[Shader] Cannot have both resources and groups");if(!t&&r&&!d)throw new Error("[Shader] No group map or WebGPU shader provided - consider using resources instead.");if(!t&&r&&d)for(const y in d)for(const b in d[y]){const S=d[y][b];m[S]={group:y,binding:b,name:S}}else if(t&&r&&!d){const y=t.structsAndGroups.groups;d={},y.forEach(b=>{d[b.group]=d[b.group]||{},d[b.group][b.binding]=b.name,m[b.name]=b})}else if(u){r={},d={},t&&t.structsAndGroups.groups.forEach(S=>{d[S.group]=d[S.group]||{},d[S.group][S.binding]=S.name,m[S.name]=S});let y=0;for(const b in u)m[b]||(r[99]||(r[99]=new el,this._ownedBindGroups.push(r[99])),m[b]={group:99,binding:y,name:b},d[99]=d[99]||{},d[99][y]=b,y++);for(const b in u){const S=b;let T=u[b];!T.source&&!T._resourceType&&(T=new Yi(T));const E=m[S];E&&(r[E.group]||(r[E.group]=new el,this._ownedBindGroups.push(r[E.group])),r[E.group].setResource(T,E.binding))}}this.groups=r,this._uniformBindMap=d,this.resources=this._buildResourceAccessor(r,m)}addResource(e,t,a){var r,u;(r=this._uniformBindMap)[t]||(r[t]={}),(u=this._uniformBindMap[t])[a]||(u[a]=e),this.groups[t]||(this.groups[t]=new el,this._ownedBindGroups.push(this.groups[t]))}_buildResourceAccessor(e,t){const a={};for(const r in t){const u=t[r];Object.defineProperty(a,u.name,{get(){return e[u.group].getResource(u.binding)},set(h){e[u.group].setResource(h,u.binding)}})}return a}destroy(e=!1){var t,a;this.emit("destroy",this),e&&((t=this.gpuProgram)==null||t.destroy(),(a=this.glProgram)==null||a.destroy()),this.gpuProgram=null,this.glProgram=null,this.removeAllListeners(),this._uniformBindMap=null,this._ownedBindGroups.forEach(r=>{r.destroy()}),this._ownedBindGroups=null,this.resources=null,this.groups=null}static from(e){const{gpu:t,gl:a,...r}=e;let u,h;return t&&(u=su.from(t)),a&&(h=Cc.from(a)),new ka({gpuProgram:u,glProgram:h,...r})}}const IM={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},k_=0,K_=1,Q_=2,Z_=3,W_=4,J_=5,$_=class FR{constructor(){this.data=0,this.blendMode="normal",this.polygonOffset=0,this.blend=!0,this.depthMask=!0}get blend(){return!!(this.data&1<<k_)}set blend(e){!!(this.data&1<<k_)!==e&&(this.data^=1<<k_)}get offsets(){return!!(this.data&1<<K_)}set offsets(e){!!(this.data&1<<K_)!==e&&(this.data^=1<<K_)}set cullMode(e){if(e==="none"){this.culling=!1;return}this.culling=!0,this.clockwiseFrontFace=e==="front"}get cullMode(){return this.culling?this.clockwiseFrontFace?"front":"back":"none"}get culling(){return!!(this.data&1<<Q_)}set culling(e){!!(this.data&1<<Q_)!==e&&(this.data^=1<<Q_)}get depthTest(){return!!(this.data&1<<Z_)}set depthTest(e){!!(this.data&1<<Z_)!==e&&(this.data^=1<<Z_)}get depthMask(){return!!(this.data&1<<J_)}set depthMask(e){!!(this.data&1<<J_)!==e&&(this.data^=1<<J_)}get clockwiseFrontFace(){return!!(this.data&1<<W_)}set clockwiseFrontFace(e){!!(this.data&1<<W_)!==e&&(this.data^=1<<W_)}get blendMode(){return this._blendMode}set blendMode(e){this.blend=e!=="none",this._blendMode=e,this._blendModeId=IM[e]||0}get polygonOffset(){return this._polygonOffset}set polygonOffset(e){this.offsets=!!e,this._polygonOffset=e}toString(){return`[pixi.js/core:State blendMode=${this.blendMode} clockwiseFrontFace=${this.clockwiseFrontFace} culling=${this.culling} depthMask=${this.depthMask} polygonOffset=${this.polygonOffset}]`}static for2d(){const e=new FR;return e.depthTest=!1,e.blend=!0,e}};$_.default2d=$_.for2d();let Us=$_;const MS=class Qb extends ka{constructor(e){e={...Qb.defaultOptions,...e},super(e),this.enabled=!0,this._state=Us.for2d(),this.blendMode=e.blendMode,this.padding=e.padding,typeof e.antialias=="boolean"?this.antialias=e.antialias?"on":"off":this.antialias=e.antialias,this.resolution=e.resolution,this.blendRequired=e.blendRequired,this.clipToViewport=e.clipToViewport,this.addResource("uTexture",0,1)}apply(e,t,a,r){e.applyFilter(this,t,a,r)}get blendMode(){return this._state.blendMode}set blendMode(e){this._state.blendMode=e}static from(e){const{gpu:t,gl:a,...r}=e;let u,h;return t&&(u=su.from(t)),a&&(h=Cc.from(a)),new Qb({gpuProgram:u,glProgram:h,...r})}};MS.defaultOptions={blendMode:"normal",resolution:1,padding:0,antialias:"off",blendRequired:!1,clipToViewport:!0};let Fl=MS;const ev=[];Ie.handleByNamedList(Q.Environment,ev);async function kM(n){if(!n)for(let e=0;e<ev.length;e++){const t=ev[e];if(t.value.test()){await t.value.load();return}}}let ed;function DS(){if(typeof ed=="boolean")return ed;try{ed=new Function("param1","param2","param3","return param1[param2] === param3;")({a:"b"},"a","b")===!0}catch{ed=!1}return ed}function US(n,e,t=2){const a=e&&e.length,r=a?e[0]*t:n.length;let u=BS(n,0,r,t,!0);const h=[];if(!u||u.next===u.prev)return h;let d,m,y;if(a&&(u=JM(n,e,u,t)),n.length>80*t){d=n[0],m=n[1];let b=d,S=m;for(let T=t;T<r;T+=t){const E=n[T],A=n[T+1];E<d&&(d=E),A<m&&(m=A),E>b&&(b=E),A>S&&(S=A)}y=Math.max(b-d,S-m),y=y!==0?32767/y:0}return td(u,h,t,d,m,y,0),h}function BS(n,e,t,a,r){let u;if(r===u3(n,e,t,a)>0)for(let h=e;h<t;h+=a)u=wS(h/a|0,n[h],n[h+1],u);else for(let h=t-a;h>=e;h-=a)u=wS(h/a|0,n[h],n[h+1],u);return u&&Rc(u,u.next)&&(ad(u),u=u.next),u}function ru(n,e){if(!n)return n;e||(e=n);let t=n,a;do if(a=!1,!t.steiner&&(Rc(t,t.next)||rn(t.prev,t,t.next)===0)){if(ad(t),t=e=t.prev,t===t.next)break;a=!0}else t=t.next;while(a||t!==e);return e}function td(n,e,t,a,r,u,h){if(!n)return;!h&&u&&i3(n,a,r,u);let d=n;for(;n.prev!==n.next;){const m=n.prev,y=n.next;if(u?QM(n,a,r,u):KM(n)){e.push(m.i,n.i,y.i),ad(n),n=y.next,d=y.next;continue}if(n=y,n===d){h?h===1?(n=ZM(ru(n),e),td(n,e,t,a,r,u,2)):h===2&&WM(n,e,t,a,r,u):td(ru(n),e,t,a,r,u,1);break}}}function KM(n){const e=n.prev,t=n,a=n.next;if(rn(e,t,a)>=0)return!1;const r=e.x,u=t.x,h=a.x,d=e.y,m=t.y,y=a.y,b=Math.min(r,u,h),S=Math.min(d,m,y),T=Math.max(r,u,h),E=Math.max(d,m,y);let A=a.next;for(;A!==e;){if(A.x>=b&&A.x<=T&&A.y>=S&&A.y<=E&&nd(r,d,u,m,h,y,A.x,A.y)&&rn(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function QM(n,e,t,a){const r=n.prev,u=n,h=n.next;if(rn(r,u,h)>=0)return!1;const d=r.x,m=u.x,y=h.x,b=r.y,S=u.y,T=h.y,E=Math.min(d,m,y),A=Math.min(b,S,T),B=Math.max(d,m,y),M=Math.max(b,S,T),G=tv(E,A,e,t,a),w=tv(B,M,e,t,a);let P=n.prevZ,z=n.nextZ;for(;P&&P.z>=G&&z&&z.z<=w;){if(P.x>=E&&P.x<=B&&P.y>=A&&P.y<=M&&P!==r&&P!==h&&nd(d,b,m,S,y,T,P.x,P.y)&&rn(P.prev,P,P.next)>=0||(P=P.prevZ,z.x>=E&&z.x<=B&&z.y>=A&&z.y<=M&&z!==r&&z!==h&&nd(d,b,m,S,y,T,z.x,z.y)&&rn(z.prev,z,z.next)>=0))return!1;z=z.nextZ}for(;P&&P.z>=G;){if(P.x>=E&&P.x<=B&&P.y>=A&&P.y<=M&&P!==r&&P!==h&&nd(d,b,m,S,y,T,P.x,P.y)&&rn(P.prev,P,P.next)>=0)return!1;P=P.prevZ}for(;z&&z.z<=w;){if(z.x>=E&&z.x<=B&&z.y>=A&&z.y<=M&&z!==r&&z!==h&&nd(d,b,m,S,y,T,z.x,z.y)&&rn(z.prev,z,z.next)>=0)return!1;z=z.nextZ}return!0}function ZM(n,e){let t=n;do{const a=t.prev,r=t.next.next;!Rc(a,r)&&NS(a,t,t.next,r)&&id(a,r)&&id(r,a)&&(e.push(a.i,t.i,r.i),ad(t),ad(t.next),t=n=r),t=t.next}while(t!==n);return ru(t)}function WM(n,e,t,a,r,u){let h=n;do{let d=h.next.next;for(;d!==h.prev;){if(h.i!==d.i&&r3(h,d)){let m=GS(h,d);h=ru(h,h.next),m=ru(m,m.next),td(h,e,t,a,r,u,0),td(m,e,t,a,r,u,0);return}d=d.next}h=h.next}while(h!==n)}function JM(n,e,t,a){const r=[];for(let u=0,h=e.length;u<h;u++){const d=e[u]*a,m=u<h-1?e[u+1]*a:n.length,y=BS(n,d,m,a,!1);y===y.next&&(y.steiner=!0),r.push(s3(y))}r.sort($M);for(let u=0;u<r.length;u++)t=e3(r[u],t);return t}function $M(n,e){let t=n.x-e.x;if(t===0&&(t=n.y-e.y,t===0)){const a=(n.next.y-n.y)/(n.next.x-n.x),r=(e.next.y-e.y)/(e.next.x-e.x);t=a-r}return t}function e3(n,e){const t=t3(n,e);if(!t)return e;const a=GS(t,n);return ru(a,a.next),ru(t,t.next)}function t3(n,e){let t=e;const a=n.x,r=n.y;let u=-1/0,h;if(Rc(n,t))return t;do{if(Rc(n,t.next))return t.next;if(r<=t.y&&r>=t.next.y&&t.next.y!==t.y){const S=t.x+(r-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(S<=a&&S>u&&(u=S,h=t.x<t.next.x?t:t.next,S===a))return h}t=t.next}while(t!==e);if(!h)return null;const d=h,m=h.x,y=h.y;let b=1/0;t=h;do{if(a>=t.x&&t.x>=m&&a!==t.x&&OS(r<y?a:u,r,m,y,r<y?u:a,r,t.x,t.y)){const S=Math.abs(r-t.y)/(a-t.x);id(t,n)&&(S<b||S===b&&(t.x>h.x||t.x===h.x&&n3(h,t)))&&(h=t,b=S)}t=t.next}while(t!==d);return h}function n3(n,e){return rn(n.prev,n,e.prev)<0&&rn(e.next,n,n.next)<0}function i3(n,e,t,a){let r=n;do r.z===0&&(r.z=tv(r.x,r.y,e,t,a)),r.prevZ=r.prev,r.nextZ=r.next,r=r.next;while(r!==n);r.prevZ.nextZ=null,r.prevZ=null,a3(r)}function a3(n){let e,t=1;do{let a=n,r;n=null;let u=null;for(e=0;a;){e++;let h=a,d=0;for(let y=0;y<t&&(d++,h=h.nextZ,!!h);y++);let m=t;for(;d>0||m>0&&h;)d!==0&&(m===0||!h||a.z<=h.z)?(r=a,a=a.nextZ,d--):(r=h,h=h.nextZ,m--),u?u.nextZ=r:n=r,r.prevZ=u,u=r;a=h}u.nextZ=null,t*=2}while(e>1);return n}function tv(n,e,t,a,r){return n=(n-t)*r|0,e=(e-a)*r|0,n=(n|n<<8)&16711935,n=(n|n<<4)&252645135,n=(n|n<<2)&858993459,n=(n|n<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,n|e<<1}function s3(n){let e=n,t=n;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==n);return t}function OS(n,e,t,a,r,u,h,d){return(r-h)*(e-d)>=(n-h)*(u-d)&&(n-h)*(a-d)>=(t-h)*(e-d)&&(t-h)*(u-d)>=(r-h)*(a-d)}function nd(n,e,t,a,r,u,h,d){return!(n===h&&e===d)&&OS(n,e,t,a,r,u,h,d)}function r3(n,e){return n.next.i!==e.i&&n.prev.i!==e.i&&!l3(n,e)&&(id(n,e)&&id(e,n)&&o3(n,e)&&(rn(n.prev,n,e.prev)||rn(n,e.prev,e))||Rc(n,e)&&rn(n.prev,n,n.next)>0&&rn(e.prev,e,e.next)>0)}function rn(n,e,t){return(e.y-n.y)*(t.x-e.x)-(e.x-n.x)*(t.y-e.y)}function Rc(n,e){return n.x===e.x&&n.y===e.y}function NS(n,e,t,a){const r=ay(rn(n,e,t)),u=ay(rn(n,e,a)),h=ay(rn(t,a,n)),d=ay(rn(t,a,e));return!!(r!==u&&h!==d||r===0&&iy(n,t,e)||u===0&&iy(n,a,e)||h===0&&iy(t,n,a)||d===0&&iy(t,e,a))}function iy(n,e,t){return e.x<=Math.max(n.x,t.x)&&e.x>=Math.min(n.x,t.x)&&e.y<=Math.max(n.y,t.y)&&e.y>=Math.min(n.y,t.y)}function ay(n){return n>0?1:n<0?-1:0}function l3(n,e){let t=n;do{if(t.i!==n.i&&t.next.i!==n.i&&t.i!==e.i&&t.next.i!==e.i&&NS(t,t.next,n,e))return!0;t=t.next}while(t!==n);return!1}function id(n,e){return rn(n.prev,n,n.next)<0?rn(n,e,n.next)>=0&&rn(n,n.prev,e)>=0:rn(n,e,n.prev)<0||rn(n,n.next,e)<0}function o3(n,e){let t=n,a=!1;const r=(n.x+e.x)/2,u=(n.y+e.y)/2;do t.y>u!=t.next.y>u&&t.next.y!==t.y&&r<(t.next.x-t.x)*(u-t.y)/(t.next.y-t.y)+t.x&&(a=!a),t=t.next;while(t!==n);return a}function GS(n,e){const t=nv(n.i,n.x,n.y),a=nv(e.i,e.x,e.y),r=n.next,u=e.prev;return n.next=e,e.prev=n,t.next=r,r.prev=t,a.next=t,t.prev=a,u.next=a,a.prev=u,a}function wS(n,e,t,a){const r=nv(n,e,t);return a?(r.next=a.next,r.prev=a,a.next.prev=r,a.next=r):(r.prev=r,r.next=r),r}function ad(n){n.next.prev=n.prev,n.prev.next=n.next,n.prevZ&&(n.prevZ.nextZ=n.nextZ),n.nextZ&&(n.nextZ.prevZ=n.prevZ)}function nv(n,e,t){return{i:n,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function u3(n,e,t,a){let r=0;for(let u=e,h=t-a;u<t;u+=a)r+=(n[h]-n[u])*(n[u+1]+n[h+1]),h=u;return r}const c3=US.default||US;var Ta=(n=>(n[n.NONE=0]="NONE",n[n.COLOR=16384]="COLOR",n[n.STENCIL=1024]="STENCIL",n[n.DEPTH=256]="DEPTH",n[n.COLOR_DEPTH=16640]="COLOR_DEPTH",n[n.COLOR_STENCIL=17408]="COLOR_STENCIL",n[n.DEPTH_STENCIL=1280]="DEPTH_STENCIL",n[n.ALL=17664]="ALL",n))(Ta||{});class PS{constructor(e){this.items=[],this._name=e}emit(e,t,a,r,u,h,d,m){const{name:y,items:b}=this;for(let S=0,T=b.length;S<T;S++)b[S][y](e,t,a,r,u,h,d,m);return this}add(e){return e[this._name]&&(this.remove(e),this.items.push(e)),this}remove(e){const t=this.items.indexOf(e);return t!==-1&&this.items.splice(t,1),this}contains(e){return this.items.indexOf(e)!==-1}removeAll(){return this.items.length=0,this}destroy(){this.removeAll(),this.items=null,this._name=null}get empty(){return this.items.length===0}get name(){return this._name}}const h3=["init","destroy","contextChange","resolutionChange","resetState","renderEnd","renderStart","render","update","postrender","prerender"],zS=class IR extends Sa{constructor(e){super(),this.uid=Kt("renderer"),this.runners=Object.create(null),this.renderPipes=Object.create(null),this._initOptions={},this._systemsHash=Object.create(null),this.type=e.type,this.name=e.name,this.config=e;const t=[...h3,...this.config.runners??[]];this._addRunners(...t),this._unsafeEvalCheck()}async init(e={}){const t=e.skipExtensionImports===!0?!0:e.manageImports===!1;await kM(t),this._addSystems(this.config.systems),this._addPipes(this.config.renderPipes,this.config.renderPipeAdaptors);for(const a in this._systemsHash)e={...this._systemsHash[a].constructor.defaultOptions,...e};e={...IR.defaultOptions,...e},this._roundPixels=e.roundPixels?1:0;for(let a=0;a<this.runners.init.items.length;a++)await this.runners.init.items[a].init(e);this._initOptions=e}render(e,t){let a=e;if(a instanceof Gn&&(a={container:a},t&&(st(Rt,"passing a second argument is deprecated, please use render options instead"),a.target=t.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 r=Array.isArray(a.clearColor)&&a.clearColor.length===4;a.clearColor=r?a.clearColor:Ft.shared.setValue(a.clearColor).toArray()}a.transform||(a.container.updateLocalTransform(),a.transform=a.container.localTransform),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(e,t,a){const r=this.view.resolution;this.view.resize(e,t,a),this.emit("resize",this.view.screen.width,this.view.screen.height,this.view.resolution),a!==void 0&&a!==r&&this.runners.resolutionChange.emit(a)}clear(e={}){const t=this;e.target||(e.target=t.renderTarget.renderTarget),e.clearColor||(e.clearColor=this.background.colorRgba),e.clear??(e.clear=Ta.ALL);const{clear:a,clearColor:r,target:u}=e;Ft.shared.setValue(r??this.background.colorRgba),t.renderTarget.clear(u,a,Ft.shared.toArray())}get resolution(){return this.view.resolution}set resolution(e){this.view.resolution=e,this.runners.resolutionChange.emit(e)}get width(){return this.view.texture.frame.width}get height(){return this.view.texture.frame.height}get canvas(){return this.view.canvas}get lastObjectRendered(){return this._lastObjectRendered}get renderingToScreen(){return this.renderTarget.renderingToScreen}get screen(){return this.view.screen}_addRunners(...e){e.forEach(t=>{this.runners[t]=new PS(t)})}_addSystems(e){let t;for(t in e){const a=e[t];this._addSystem(a.value,a.name)}}_addSystem(e,t){const a=new e(this);if(this[t])throw new Error(`Whoops! The name "${t}" is already in use`);this[t]=a,this._systemsHash[t]=a;for(const r in this.runners)this.runners[r].add(a);return this}_addPipes(e,t){const a=t.reduce((r,u)=>(r[u.name]=u.value,r),{});e.forEach(r=>{const u=r.value,h=r.name,d=a[h];this.renderPipes[h]=new u(this,d?new d:null)})}destroy(e=!1){this.runners.destroy.items.reverse(),this.runners.destroy.emit(e),Object.values(this.runners).forEach(t=>{t.destroy()}),this._systemsHash=null,this.renderPipes=null}generateTexture(e){return this.textureGenerator.generateTexture(e)}get roundPixels(){return!!this._roundPixels}_unsafeEvalCheck(){if(!DS())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()}};zS.defaultOptions={resolution:1,failIfMajorPerformanceCaveat:!1,roundPixels:!1};let sy=zS,ry;function f3(n){return ry!==void 0||(ry=(()=>{var t;const e={stencil:!0,failIfMajorPerformanceCaveat:n??sy.defaultOptions.failIfMajorPerformanceCaveat};try{if(!Gt.get().getWebGLRenderingContext())return!1;let r=Gt.get().createCanvas().getContext("webgl",e);const u=!!((t=r==null?void 0:r.getContextAttributes())!=null&&t.stencil);if(r){const h=r.getExtension("WEBGL_lose_context");h&&h.loseContext()}return r=null,u}catch{return!1}})()),ry}let ly;async function d3(n={}){return ly!==void 0||(ly=await(async()=>{const e=Gt.get().getNavigator().gpu;if(!e)return!1;try{return await(await e.requestAdapter(n)).requestDevice(),!0}catch{return!1}})()),ly}const HS=["webgl","webgpu","canvas"];async function p3(n){let e=[];n.preference?(e.push(n.preference),HS.forEach(u=>{u!==n.preference&&e.push(u)})):e=HS.slice();let t,a={};for(let u=0;u<e.length;u++){const h=e[u];if(h==="webgpu"&&await d3()){const{WebGPURenderer:d}=await Promise.resolve().then(()=>oB);t=d,a={...n,...n.webgpu};break}else if(h==="webgl"&&f3(n.failIfMajorPerformanceCaveat??sy.defaultOptions.failIfMajorPerformanceCaveat)){const{WebGLRenderer:d}=await Promise.resolve().then(()=>X4);t=d,a={...n,...n.webgl};break}else if(h==="canvas")throw a={...n},new Error("CanvasRenderer is not yet implemented")}if(delete a.webgpu,delete a.webgl,!t)throw new Error("No available renderer for the current environment");const r=new t;return await r.init(a),r}const oy="8.12.0";class VS{static init(){var e;(e=globalThis.__PIXI_APP_INIT__)==null||e.call(globalThis,this,oy)}static destroy(){}}VS.extension=Q.Application;class LS{constructor(e){this._renderer=e}init(){var e;(e=globalThis.__PIXI_RENDERER_INIT__)==null||e.call(globalThis,this._renderer,oy)}destroy(){this._renderer=null}}LS.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"initHook",priority:-10};const jS=class Zb{constructor(...e){this.stage=new Gn,e[0]!==void 0&&st(Rt,"Application constructor options are deprecated, please use Application.init() instead.")}async init(e){e={...e},this.renderer=await p3(e),Zb._plugins.forEach(t=>{t.init.call(this,e)})}render(){this.renderer.render({container:this.stage})}get canvas(){return this.renderer.canvas}get view(){return st(Rt,"Application.view is deprecated, please use Application.canvas instead."),this.renderer.canvas}get screen(){return this.renderer.screen}destroy(e=!1,t=!1){const a=Zb._plugins.slice(0);a.reverse(),a.forEach(r=>{r.destroy.call(this)}),this.stage.destroy(t),this.stage=null,this.renderer.destroy(e),this.renderer=null}};jS._plugins=[];let iv=jS;Ie.handleByList(Q.Application,iv._plugins),Ie.add(VS);class YS{static init(e){Object.defineProperty(this,"resizeTo",{set(t){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=t,t&&(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 t,a;if(this._resizeTo===globalThis.window)t=globalThis.innerWidth,a=globalThis.innerHeight;else{const{clientWidth:r,clientHeight:u}=this._resizeTo;t=r,a=u}this.renderer.resize(t,a),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=e.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this._cancelResize(),this._cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}YS.extension=Q.Application;class XS{static init(e){e=Object.assign({autoStart:!0,sharedTicker:!1},e),Object.defineProperty(this,"ticker",{set(t){this._ticker&&this._ticker.remove(this.render,this),this._ticker=t,t&&t.add(this.render,this,xc.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=e.sharedTicker?Ia.shared:new Ia,e.autoStart&&this.start()}static destroy(){if(this._ticker){const e=this._ticker;this.ticker=null,e.destroy()}}}XS.extension=Q.Application;class m3 extends Sa{constructor(){super(...arguments),this.chars=Object.create(null),this.lineHeight=0,this.fontFamily="",this.fontMetrics={fontSize:0,ascent:0,descent:0},this.baseLineOffset=0,this.distanceField={type:"none",range:0},this.pages=[],this.applyFillAsTint=!0,this.baseMeasurementFontSize=100,this.baseRenderedFontSize=100}get font(){return st(Rt,"BitmapFont.font is deprecated, please use BitmapFont.fontFamily instead."),this.fontFamily}get pageTextures(){return st(Rt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}get size(){return st(Rt,"BitmapFont.size is deprecated, please use BitmapFont.fontMetrics.fontSize instead."),this.fontMetrics.fontSize}get distanceFieldRange(){return st(Rt,"BitmapFont.distanceFieldRange is deprecated, please use BitmapFont.distanceField.range instead."),this.distanceField.range}get distanceFieldType(){return st(Rt,"BitmapFont.distanceFieldType is deprecated, please use BitmapFont.distanceField.type instead."),this.distanceField.type}destroy(e=!1){var t;this.emit("destroy",this),this.removeAllListeners();for(const a in this.chars)(t=this.chars[a].texture)==null||t.destroy();this.chars=null,e&&(this.pages.forEach(a=>a.texture.destroy(!0)),this.pages=null)}}const y3=["serif","sans-serif","monospace","cursive","fantasy","system-ui"];function uy(n){const e=typeof n.fontSize=="number"?`${n.fontSize}px`:n.fontSize;let t=n.fontFamily;Array.isArray(n.fontFamily)||(t=n.fontFamily.split(","));for(let a=t.length-1;a>=0;a--){let r=t[a].trim();!/([\"\'])[^\'\"]+\1/.test(r)&&!y3.includes(r)&&(r=`"${r}"`),t[a]=r}return`${n.fontStyle} ${n.fontVariant} ${n.fontWeight} ${e} ${t.join(",")}`}const av={willReadFrequently:!0},fr=class Ve{static get experimentalLetterSpacingSupported(){let e=Ve._experimentalLetterSpacingSupported;if(e===void 0){const t=Gt.get().getCanvasRenderingContext2D().prototype;e=Ve._experimentalLetterSpacingSupported="letterSpacing"in t||"textLetterSpacing"in t}return e}constructor(e,t,a,r,u,h,d,m,y){this.text=e,this.style=t,this.width=a,this.height=r,this.lines=u,this.lineWidths=h,this.lineHeight=d,this.maxLineWidth=m,this.fontProperties=y}static measureText(e=" ",t,a=Ve._canvas,r=t.wordWrap){var G;const u=uy(t),h=Ve.measureFont(u);h.fontSize===0&&(h.fontSize=t.fontSize,h.ascent=t.fontSize);const d=Ve.__context;d.font=u;const y=(r?Ve._wordWrap(e,t,a):e).split(/(?:\r\n|\r|\n)/),b=new Array(y.length);let S=0;for(let w=0;w<y.length;w++){const P=Ve._measureText(y[w],t.letterSpacing,d);b[w]=P,S=Math.max(S,P)}const T=((G=t._stroke)==null?void 0:G.width)||0;let E=S+T;t.dropShadow&&(E+=t.dropShadow.distance);const A=t.lineHeight||h.fontSize;let B=Math.max(A,h.fontSize+T)+(y.length-1)*(A+t.leading);return t.dropShadow&&(B+=t.dropShadow.distance),new Ve(e,t,E,B,y,b,A+t.leading,S,h)}static _measureText(e,t,a){let r=!1;Ve.experimentalLetterSpacingSupported&&(Ve.experimentalLetterSpacing?(a.letterSpacing=`${t}px`,a.textLetterSpacing=`${t}px`,r=!0):(a.letterSpacing="0px",a.textLetterSpacing="0px"));const u=a.measureText(e);let h=u.width;const d=-u.actualBoundingBoxLeft;let y=u.actualBoundingBoxRight-d;if(h>0)if(r)h-=t,y-=t;else{const b=(Ve.graphemeSegmenter(e).length-1)*t;h+=b,y+=b}return Math.max(h,y)}static _wordWrap(e,t,a=Ve._canvas){const r=a.getContext("2d",av);let u=0,h="",d="";const m=Object.create(null),{letterSpacing:y,whiteSpace:b}=t,S=Ve._collapseSpaces(b),T=Ve._collapseNewlines(b);let E=!S;const A=t.wordWrapWidth+y,B=Ve._tokenize(e);for(let M=0;M<B.length;M++){let G=B[M];if(Ve._isNewline(G)){if(!T){d+=Ve._addLine(h),E=!S,h="",u=0;continue}G=" "}if(S){const P=Ve.isBreakingSpace(G),z=Ve.isBreakingSpace(h[h.length-1]);if(P&&z)continue}const w=Ve._getFromCache(G,y,m,r);if(w>A)if(h!==""&&(d+=Ve._addLine(h),h="",u=0),Ve.canBreakWords(G,t.breakWords)){const P=Ve.wordWrapSplit(G);for(let z=0;z<P.length;z++){let Z=P[z],ie=Z,ne=1;for(;P[z+ne];){const _e=P[z+ne];if(!Ve.canBreakChars(ie,_e,G,z,t.breakWords))Z+=_e;else break;ie=_e,ne++}z+=ne-1;const Se=Ve._getFromCache(Z,y,m,r);Se+u>A&&(d+=Ve._addLine(h),E=!1,h="",u=0),h+=Z,u+=Se}}else{h.length>0&&(d+=Ve._addLine(h),h="",u=0);const P=M===B.length-1;d+=Ve._addLine(G,!P),E=!1,h="",u=0}else w+u>A&&(E=!1,d+=Ve._addLine(h),h="",u=0),(h.length>0||!Ve.isBreakingSpace(G)||E)&&(h+=G,u+=w)}return d+=Ve._addLine(h,!1),d}static _addLine(e,t=!0){return e=Ve._trimRight(e),e=t?`${e}
|
|
87
|
+
`:e,e}static _getFromCache(e,t,a,r){let u=a[e];return typeof u!="number"&&(u=Ve._measureText(e,t,r)+t,a[e]=u),u}static _collapseSpaces(e){return e==="normal"||e==="pre-line"}static _collapseNewlines(e){return e==="normal"}static _trimRight(e){if(typeof e!="string")return"";for(let t=e.length-1;t>=0;t--){const a=e[t];if(!Ve.isBreakingSpace(a))break;e=e.slice(0,-1)}return e}static _isNewline(e){return typeof e!="string"?!1:Ve._newlines.includes(e.charCodeAt(0))}static isBreakingSpace(e,t){return typeof e!="string"?!1:Ve._breakingSpaces.includes(e.charCodeAt(0))}static _tokenize(e){const t=[];let a="";if(typeof e!="string")return t;for(let r=0;r<e.length;r++){const u=e[r],h=e[r+1];if(Ve.isBreakingSpace(u,h)||Ve._isNewline(u)){a!==""&&(t.push(a),a=""),u==="\r"&&h===`
|
|
88
|
+
`?(t.push(`\r
|
|
89
|
+
`),r++):t.push(u);continue}a+=u}return a!==""&&t.push(a),t}static canBreakWords(e,t){return t}static canBreakChars(e,t,a,r,u){return!0}static wordWrapSplit(e){return Ve.graphemeSegmenter(e)}static measureFont(e){if(Ve._fonts[e])return Ve._fonts[e];const t=Ve._context;t.font=e;const a=t.measureText(Ve.METRICS_STRING+Ve.BASELINE_SYMBOL),r={ascent:a.actualBoundingBoxAscent,descent:a.actualBoundingBoxDescent,fontSize:a.actualBoundingBoxAscent+a.actualBoundingBoxDescent};return Ve._fonts[e]=r,r}static clearMetrics(e=""){e?delete Ve._fonts[e]:Ve._fonts={}}static get _canvas(){if(!Ve.__canvas){let e;try{const t=new OffscreenCanvas(0,0),a=t.getContext("2d",av);if(a!=null&&a.measureText)return Ve.__canvas=t,t;e=Gt.get().createCanvas()}catch{e=Gt.get().createCanvas()}e.width=e.height=10,Ve.__canvas=e}return Ve.__canvas}static get _context(){return Ve.__context||(Ve.__context=Ve._canvas.getContext("2d",av)),Ve.__context}};fr.METRICS_STRING="|ÉqÅ",fr.BASELINE_SYMBOL="M",fr.BASELINE_MULTIPLIER=1.4,fr.HEIGHT_MULTIPLIER=2,fr.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const n=new Intl.Segmenter;return e=>{const t=n.segment(e),a=[];let r=0;for(const u of t)a[r++]=u.segment;return a}}return n=>[...n]})(),fr.experimentalLetterSpacing=!1,fr._fonts={},fr._newlines=[10,13],fr._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let dr=fr;const qS=[{offset:0,color:"white"},{offset:1,color:"black"}],sv=class Wb{constructor(...e){this.uid=Kt("fillGradient"),this.type="linear",this.colorStops=[];let t=g3(e);t={...t.type==="radial"?Wb.defaultRadialOptions:Wb.defaultLinearOptions,...gx(t)},this._textureSize=t.textureSize,this._wrapMode=t.wrapMode,t.type==="radial"?(this.center=t.center,this.outerCenter=t.outerCenter??this.center,this.innerRadius=t.innerRadius,this.outerRadius=t.outerRadius,this.scale=t.scale,this.rotation=t.rotation):(this.start=t.start,this.end=t.end),this.textureSpace=t.textureSpace,this.type=t.type,t.colorStops.forEach(r=>{this.addColorStop(r.offset,r.color)})}addColorStop(e,t){return this.colorStops.push({offset:e,color:Ft.shared.setValue(t).toHexa()}),this}buildLinearGradient(){if(this.texture)return;let{x:e,y:t}=this.start,{x:a,y:r}=this.end,u=a-e,h=r-t;const d=u<0||h<0;if(this._wrapMode==="clamp-to-edge"){if(u<0){const M=e;e=a,a=M,u*=-1}if(h<0){const M=t;t=r,r=M,h*=-1}}const m=this.colorStops.length?this.colorStops:qS,y=this._textureSize,{canvas:b,context:S}=IS(y,1),T=d?S.createLinearGradient(this._textureSize,0,0,0):S.createLinearGradient(0,0,this._textureSize,0);FS(T,m),S.fillStyle=T,S.fillRect(0,0,y,1),this.texture=new Ge({source:new Kf({resource:b,addressMode:this._wrapMode})});const E=Math.sqrt(u*u+h*h),A=Math.atan2(h,u),B=new Pe;B.scale(E/y,1),B.rotate(A),B.translate(e,t),this.textureSpace==="local"&&B.scale(y,y),this.transform=B}buildGradient(){this.type==="linear"?this.buildLinearGradient():this.buildRadialGradient()}buildRadialGradient(){if(this.texture)return;const e=this.colorStops.length?this.colorStops:qS,t=this._textureSize,{canvas:a,context:r}=IS(t,t),{x:u,y:h}=this.center,{x:d,y:m}=this.outerCenter,y=this.innerRadius,b=this.outerRadius,S=d-b,T=m-b,E=t/(b*2),A=(u-S)*E,B=(h-T)*E,M=r.createRadialGradient(A,B,y*E,(d-S)*E,(m-T)*E,b*E);FS(M,e),r.fillStyle=e[e.length-1].color,r.fillRect(0,0,t,t),r.fillStyle=M,r.translate(A,B),r.rotate(this.rotation),r.scale(1,this.scale),r.translate(-A,-B),r.fillRect(0,0,t,t),this.texture=new Ge({source:new Kf({resource:a,addressMode:this._wrapMode})});const G=new Pe;G.scale(1/E,1/E),G.translate(S,T),this.textureSpace==="local"&&G.scale(t,t),this.transform=G}get styleKey(){return this.uid}destroy(){var e;(e=this.texture)==null||e.destroy(!0),this.texture=null,this.transform=null,this.colorStops=[],this.start=null,this.end=null,this.center=null,this.outerCenter=null}};sv.defaultLinearOptions={start:{x:0,y:0},end:{x:0,y:1},colorStops:[],textureSpace:"local",type:"linear",textureSize:256,wrapMode:"clamp-to-edge"},sv.defaultRadialOptions={center:{x:.5,y:.5},innerRadius:0,outerRadius:.5,colorStops:[],scale:1,textureSpace:"local",type:"radial",textureSize:256,wrapMode:"clamp-to-edge"};let tl=sv;function FS(n,e){for(let t=0;t<e.length;t++){const a=e[t];n.addColorStop(a.offset,a.color)}}function IS(n,e){const t=Gt.get().createCanvas(n,e),a=t.getContext("2d");return{canvas:t,context:a}}function g3(n){let e=n[0]??{};return(typeof e=="number"||n[1])&&(st("8.5.2","use options object instead"),e={type:"linear",start:{x:n[0],y:n[1]},end:{x:n[2],y:n[3]},textureSpace:n[4],textureSize:n[5]??tl.defaultLinearOptions.textureSize}),e}const kS={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 cy{constructor(e,t){this.uid=Kt("fillPattern"),this.transform=new Pe,this._styleKey=null,this.texture=e,this.transform.scale(1/e.frame.width,1/e.frame.height),t&&(e.source.style.addressModeU=kS[t].addressModeU,e.source.style.addressModeV=kS[t].addressModeV)}setTransform(e){const t=this.texture;this.transform.copyFrom(e),this.transform.invert(),this.transform.scale(1/t.frame.width,1/t.frame.height),this._styleKey=null}get styleKey(){return this._styleKey?this._styleKey:(this._styleKey=`fill-pattern-${this.uid}-${this.texture.uid}-${this.transform.toArray().join("-")}`,this._styleKey)}destroy(){this.texture.destroy(!0),this.texture=null,this._styleKey=null}}var rv,KS;function _3(){if(KS)return rv;KS=1,rv=t;var n={a:7,c:6,h:1,l:2,m:2,q:4,s:4,t:2,v:1,z:0},e=/([astvzqmhlc])([^astvzqmhlc]*)/ig;function t(u){var h=[];return u.replace(e,function(d,m,y){var b=m.toLowerCase();for(y=r(y),b=="m"&&y.length>2&&(h.push([m].concat(y.splice(0,2))),b="l",m=m=="m"?"l":"L");;){if(y.length==n[b])return y.unshift(m),h.push(y);if(y.length<n[b])throw new Error("malformed path data");h.push([m].concat(y.splice(0,n[b])))}}),h}var a=/-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;function r(u){var h=u.match(a);return h?h.map(Number):[]}return rv}var v3=_3();const b3=xa(v3);function x3(n,e){const t=b3(n),a=[];let r=null,u=0,h=0;for(let d=0;d<t.length;d++){const m=t[d],y=m[0],b=m;switch(y){case"M":u=b[1],h=b[2],e.moveTo(u,h);break;case"m":u+=b[1],h+=b[2],e.moveTo(u,h);break;case"H":u=b[1],e.lineTo(u,h);break;case"h":u+=b[1],e.lineTo(u,h);break;case"V":h=b[1],e.lineTo(u,h);break;case"v":h+=b[1],e.lineTo(u,h);break;case"L":u=b[1],h=b[2],e.lineTo(u,h);break;case"l":u+=b[1],h+=b[2],e.lineTo(u,h);break;case"C":u=b[5],h=b[6],e.bezierCurveTo(b[1],b[2],b[3],b[4],u,h);break;case"c":e.bezierCurveTo(u+b[1],h+b[2],u+b[3],h+b[4],u+b[5],h+b[6]),u+=b[5],h+=b[6];break;case"S":u=b[3],h=b[4],e.bezierCurveToShort(b[1],b[2],u,h);break;case"s":e.bezierCurveToShort(u+b[1],h+b[2],u+b[3],h+b[4]),u+=b[3],h+=b[4];break;case"Q":u=b[3],h=b[4],e.quadraticCurveTo(b[1],b[2],u,h);break;case"q":e.quadraticCurveTo(u+b[1],h+b[2],u+b[3],h+b[4]),u+=b[3],h+=b[4];break;case"T":u=b[1],h=b[2],e.quadraticCurveToShort(u,h);break;case"t":u+=b[1],h+=b[2],e.quadraticCurveToShort(u,h);break;case"A":u=b[6],h=b[7],e.arcToSvg(b[1],b[2],b[3],b[4],b[5],u,h);break;case"a":u+=b[6],h+=b[7],e.arcToSvg(b[1],b[2],b[3],b[4],b[5],u,h);break;case"Z":case"z":e.closePath(),a.length>0&&(r=a.pop(),r?(u=r.startX,h=r.startY):(u=0,h=0)),r=null;break;default:rt(`Unknown SVG path command: ${y}`)}y!=="Z"&&y!=="z"&&r===null&&(r={startX:u,startY:h},a.push(r))}return e}class lv{constructor(e=0,t=0,a=0){this.type="circle",this.x=e,this.y=t,this.radius=a}clone(){return new lv(this.x,this.y,this.radius)}contains(e,t){if(this.radius<=0)return!1;const a=this.radius*this.radius;let r=this.x-e,u=this.y-t;return r*=r,u*=u,r+u<=a}strokeContains(e,t,a,r=.5){if(this.radius===0)return!1;const u=this.x-e,h=this.y-t,d=this.radius,m=(1-r)*a,y=Math.sqrt(u*u+h*h);return y<=d+m&&y>d-(a-m)}getBounds(e){return e||(e=new Nt),e.x=this.x-this.radius,e.y=this.y-this.radius,e.width=this.radius*2,e.height=this.radius*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.radius=e.radius,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Circle x=${this.x} y=${this.y} radius=${this.radius}]`}}class ov{constructor(e=0,t=0,a=0,r=0){this.type="ellipse",this.x=e,this.y=t,this.halfWidth=a,this.halfHeight=r}clone(){return new ov(this.x,this.y,this.halfWidth,this.halfHeight)}contains(e,t){if(this.halfWidth<=0||this.halfHeight<=0)return!1;let a=(e-this.x)/this.halfWidth,r=(t-this.y)/this.halfHeight;return a*=a,r*=r,a+r<=1}strokeContains(e,t,a,r=.5){const{halfWidth:u,halfHeight:h}=this;if(u<=0||h<=0)return!1;const d=a*(1-r),m=a-d,y=u-m,b=h-m,S=u+d,T=h+d,E=e-this.x,A=t-this.y,B=E*E/(y*y)+A*A/(b*b),M=E*E/(S*S)+A*A/(T*T);return B>1&&M<=1}getBounds(e){return e||(e=new Nt),e.x=this.x-this.halfWidth,e.y=this.y-this.halfHeight,e.width=this.halfWidth*2,e.height=this.halfHeight*2,e}copyFrom(e){return this.x=e.x,this.y=e.y,this.halfWidth=e.halfWidth,this.halfHeight=e.halfHeight,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:Ellipse x=${this.x} y=${this.y} halfWidth=${this.halfWidth} halfHeight=${this.halfHeight}]`}}function S3(n,e,t,a,r,u){const h=n-t,d=e-a,m=r-t,y=u-a,b=h*m+d*y,S=m*m+y*y;let T=-1;S!==0&&(T=b/S);let E,A;T<0?(E=t,A=a):T>1?(E=r,A=u):(E=t+T*m,A=a+T*y);const B=n-E,M=e-A;return B*B+M*M}let T3,E3;class sd{constructor(...e){this.type="polygon";let t=Array.isArray(e[0])?e[0]:e;if(typeof t[0]!="number"){const a=[];for(let r=0,u=t.length;r<u;r++)a.push(t[r].x,t[r].y);t=a}this.points=t,this.closePath=!0}isClockwise(){let e=0;const t=this.points,a=t.length;for(let r=0;r<a;r+=2){const u=t[r],h=t[r+1],d=t[(r+2)%a],m=t[(r+3)%a];e+=(d-u)*(m+h)}return e<0}containsPolygon(e){const t=this.getBounds(T3),a=e.getBounds(E3);if(!t.containsRect(a))return!1;const r=e.points;for(let u=0;u<r.length;u+=2){const h=r[u],d=r[u+1];if(!this.contains(h,d))return!1}return!0}clone(){const e=this.points.slice(),t=new sd(e);return t.closePath=this.closePath,t}contains(e,t){let a=!1;const r=this.points.length/2;for(let u=0,h=r-1;u<r;h=u++){const d=this.points[u*2],m=this.points[u*2+1],y=this.points[h*2],b=this.points[h*2+1];m>t!=b>t&&e<(y-d)*((t-m)/(b-m))+d&&(a=!a)}return a}strokeContains(e,t,a,r=.5){const u=a*a,h=u*(1-r),d=u-h,{points:m}=this,y=m.length-(this.closePath?0:2);for(let b=0;b<y;b+=2){const S=m[b],T=m[b+1],E=m[(b+2)%m.length],A=m[(b+3)%m.length],B=S3(e,t,S,T,E,A),M=Math.sign((E-S)*(t-T)-(A-T)*(e-S));if(B<=(M<0?d:h))return!0}return!1}getBounds(e){e||(e=new Nt);const t=this.points;let a=1/0,r=-1/0,u=1/0,h=-1/0;for(let d=0,m=t.length;d<m;d+=2){const y=t[d],b=t[d+1];a=y<a?y:a,r=y>r?y:r,u=b<u?b:u,h=b>h?b:h}return e.x=a,e.width=r-a,e.y=u,e.height=h-u,e}copyFrom(e){return this.points=e.points.slice(),this.closePath=e.closePath,this}copyTo(e){return e.copyFrom(this),e}toString(){return`[pixi.js/math:PolygoncloseStroke=${this.closePath}points=${this.points.reduce((e,t)=>`${e}, ${t}`,"")}]`}get lastX(){return this.points[this.points.length-2]}get lastY(){return this.points[this.points.length-1]}get x(){return st("8.11.0","Polygon.lastX is deprecated, please use Polygon.lastX instead."),this.points[this.points.length-2]}get y(){return st("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 hy=(n,e,t,a,r,u,h)=>{const d=n-t,m=e-a,y=Math.sqrt(d*d+m*m);return y>=r-u&&y<=r+h};class uv{constructor(e=0,t=0,a=0,r=0,u=20){this.type="roundedRectangle",this.x=e,this.y=t,this.width=a,this.height=r,this.radius=u}getBounds(e){return e||(e=new Nt),e.x=this.x,e.y=this.y,e.width=this.width,e.height=this.height,e}clone(){return new uv(this.x,this.y,this.width,this.height,this.radius)}copyFrom(e){return this.x=e.x,this.y=e.y,this.width=e.width,this.height=e.height,this}copyTo(e){return e.copyFrom(this),e}contains(e,t){if(this.width<=0||this.height<=0)return!1;if(e>=this.x&&e<=this.x+this.width&&t>=this.y&&t<=this.y+this.height){const a=Math.max(0,Math.min(this.radius,Math.min(this.width,this.height)/2));if(t>=this.y+a&&t<=this.y+this.height-a||e>=this.x+a&&e<=this.x+this.width-a)return!0;let r=e-(this.x+a),u=t-(this.y+a);const h=a*a;if(r*r+u*u<=h||(r=e-(this.x+this.width-a),r*r+u*u<=h)||(u=t-(this.y+this.height-a),r*r+u*u<=h)||(r=e-(this.x+a),r*r+u*u<=h))return!0}return!1}strokeContains(e,t,a,r=.5){const{x:u,y:h,width:d,height:m,radius:y}=this,b=a*(1-r),S=a-b,T=u+y,E=h+y,A=d-y*2,B=m-y*2,M=u+d,G=h+m;return(e>=u-b&&e<=u+S||e>=M-S&&e<=M+b)&&t>=E&&t<=E+B||(t>=h-b&&t<=h+S||t>=G-S&&t<=G+b)&&e>=T&&e<=T+A?!0:e<T&&t<E&&hy(e,t,T,E,y,S,b)||e>M-y&&t<E&&hy(e,t,M-y,E,y,S,b)||e>M-y&&t>G-y&&hy(e,t,M-y,G-y,y,S,b)||e<T&&t>G-y&&hy(e,t,T,G-y,y,S,b)}toString(){return`[pixi.js/math:RoundedRectangle x=${this.x} y=${this.y}width=${this.width} height=${this.height} radius=${this.radius}]`}}const QS={};function cv(n,e,t){let a=2166136261;for(let r=0;r<e;r++)a^=n[r].uid,a=Math.imul(a,16777619),a>>>=0;return QS[a]||C3(n,e,a,t)}function C3(n,e,t,a){const r={};let u=0;for(let d=0;d<a;d++){const m=d<e?n[d]:Ge.EMPTY.source;r[u++]=m.source,r[u++]=m.style}const h=new el(r);return QS[t]=h,h}class Ac{constructor(e){typeof e=="number"?this.rawBinaryData=new ArrayBuffer(e):e instanceof Uint8Array?this.rawBinaryData=e.buffer:this.rawBinaryData=e,this.uint32View=new Uint32Array(this.rawBinaryData),this.float32View=new Float32Array(this.rawBinaryData),this.size=this.rawBinaryData.byteLength}get int8View(){return this._int8View||(this._int8View=new Int8Array(this.rawBinaryData)),this._int8View}get uint8View(){return this._uint8View||(this._uint8View=new Uint8Array(this.rawBinaryData)),this._uint8View}get int16View(){return this._int16View||(this._int16View=new Int16Array(this.rawBinaryData)),this._int16View}get int32View(){return this._int32View||(this._int32View=new Int32Array(this.rawBinaryData)),this._int32View}get float64View(){return this._float64Array||(this._float64Array=new Float64Array(this.rawBinaryData)),this._float64Array}get bigUint64View(){return this._bigUint64Array||(this._bigUint64Array=new BigUint64Array(this.rawBinaryData)),this._bigUint64Array}view(e){return this[`${e}View`]}destroy(){this.rawBinaryData=null,this._int8View=null,this._uint8View=null,this._int16View=null,this.uint16View=null,this._int32View=null,this.uint32View=null,this.float32View=null}static sizeOf(e){switch(e){case"int8":case"uint8":return 1;case"int16":case"uint16":return 2;case"int32":case"uint32":case"float32":return 4;default:throw new Error(`${e} isn't a valid view type`)}}}function hv(n,e){const t=n.byteLength/8|0,a=new Float64Array(n,0,t);new Float64Array(e,0,t).set(a);const u=n.byteLength-t*8;if(u>0){const h=new Uint8Array(n,t*8,u);new Uint8Array(e,t*8,u).set(h)}}const R3={normal:"normal-npm",add:"add-npm",screen:"screen-npm"};var bn=(n=>(n[n.DISABLED=0]="DISABLED",n[n.RENDERING_MASK_ADD=1]="RENDERING_MASK_ADD",n[n.MASK_ACTIVE=2]="MASK_ACTIVE",n[n.INVERSE_MASK_ACTIVE=3]="INVERSE_MASK_ACTIVE",n[n.RENDERING_MASK_REMOVE=4]="RENDERING_MASK_REMOVE",n[n.NONE=5]="NONE",n))(bn||{});function rd(n,e){return e.alphaMode==="no-premultiply-alpha"&&R3[n]||n}const A3=["precision mediump float;","void main(void){","float test = 0.1;","%forloop%","gl_FragColor = vec4(0.0);","}"].join(`
|
|
90
|
+
`);function M3(n){let e="";for(let t=0;t<n;++t)t>0&&(e+=`
|
|
91
|
+
else `),t<n-1&&(e+=`if(test == ${t}.0){}`);return e}function ZS(n,e){if(n===0)throw new Error("Invalid value of `0` passed to `checkMaxIfStatementsInShader`");const t=e.createShader(e.FRAGMENT_SHADER);try{for(;;){const a=A3.replace(/%forloop%/gi,M3(n));if(e.shaderSource(t,a),e.compileShader(t),!e.getShaderParameter(t,e.COMPILE_STATUS))n=n/2|0;else break}}finally{e.deleteShader(t)}return n}let Mc=null;function D3(){var e;if(Mc)return Mc;const n=TS();return Mc=n.getParameter(n.MAX_TEXTURE_IMAGE_UNITS),Mc=ZS(Mc,n),(e=n.getExtension("WEBGL_lose_context"))==null||e.loseContext(),Mc}class U3{constructor(){this.ids=Object.create(null),this.textures=[],this.count=0}clear(){for(let e=0;e<this.count;e++){const t=this.textures[e];this.textures[e]=null,this.ids[t.uid]=null}this.count=0}}class B3{constructor(){this.renderPipeId="batch",this.action="startBatch",this.start=0,this.size=0,this.textures=new U3,this.blendMode="normal",this.topology="triangle-strip",this.canBundle=!0}destroy(){this.textures=null,this.gpuBindGroup=null,this.bindGroup=null,this.batcher=null}}const WS=[];let fv=0;function JS(){return fv>0?WS[--fv]:new B3}function $S(n){WS[fv++]=n}let ld=0;const e1=class kR{constructor(e){this.uid=Kt("batcher"),this.dirty=!0,this.batchIndex=0,this.batches=[],this._elements=[],e={...kR.defaultOptions,...e},e.maxTextures||(st("v8.8.0","maxTextures is a required option for Batcher now, please pass it in the options"),e.maxTextures=D3());const{maxTextures:t,attributesInitialSize:a,indicesInitialSize:r}=e;this.attributeBuffer=new Ac(a*4),this.indexBuffer=new Uint16Array(r),this.maxTextures=t}begin(){this.elementSize=0,this.elementStart=0,this.indexSize=0,this.attributeSize=0;for(let e=0;e<this.batchIndex;e++)$S(this.batches[e]);this.batchIndex=0,this._batchIndexStart=0,this._batchIndexSize=0,this.dirty=!0}add(e){this._elements[this.elementSize++]=e,e._indexStart=this.indexSize,e._attributeStart=this.attributeSize,e._batcher=this,this.indexSize+=e.indexSize,this.attributeSize+=e.attributeSize*this.vertexSize}checkAndUpdateTexture(e,t){const a=e._batch.textures.ids[t._source.uid];return!a&&a!==0?!1:(e._textureId=a,e.texture=t,!0)}updateElement(e){this.dirty=!0;const t=this.attributeBuffer;e.packAsQuad?this.packQuadAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId):this.packAttributes(e,t.float32View,t.uint32View,e._attributeStart,e._textureId)}break(e){const t=this._elements;if(!t[this.elementStart])return;let a=JS(),r=a.textures;r.clear();const u=t[this.elementStart];let h=rd(u.blendMode,u.texture._source),d=u.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,y=this.attributeBuffer.uint32View,b=this.indexBuffer;let S=this._batchIndexSize,T=this._batchIndexStart,E="startBatch";const A=this.maxTextures;for(let B=this.elementStart;B<this.elementSize;++B){const M=t[B];t[B]=null;const w=M.texture._source,P=rd(M.blendMode,w),z=h!==P||d!==M.topology;if(w._batchTick===ld&&!z){M._textureId=w._textureBindLocation,S+=M.indexSize,M.packAsQuad?(this.packQuadAttributes(M,m,y,M._attributeStart,M._textureId),this.packQuadIndex(b,M._indexStart,M._attributeStart/this.vertexSize)):(this.packAttributes(M,m,y,M._attributeStart,M._textureId),this.packIndex(M,b,M._indexStart,M._attributeStart/this.vertexSize)),M._batch=a;continue}w._batchTick=ld,(r.count>=A||z)&&(this._finishBatch(a,T,S-T,r,h,d,e,E),E="renderBatch",T=S,h=P,d=M.topology,a=JS(),r=a.textures,r.clear(),++ld),M._textureId=w._textureBindLocation=r.count,r.ids[w.uid]=r.count,r.textures[r.count++]=w,M._batch=a,S+=M.indexSize,M.packAsQuad?(this.packQuadAttributes(M,m,y,M._attributeStart,M._textureId),this.packQuadIndex(b,M._indexStart,M._attributeStart/this.vertexSize)):(this.packAttributes(M,m,y,M._attributeStart,M._textureId),this.packIndex(M,b,M._indexStart,M._attributeStart/this.vertexSize))}r.count>0&&(this._finishBatch(a,T,S-T,r,h,d,e,E),T=S,++ld),this.elementStart=this.elementSize,this._batchIndexStart=T,this._batchIndexSize=S}_finishBatch(e,t,a,r,u,h,d,m){e.gpuBindGroup=null,e.bindGroup=null,e.action=m,e.batcher=this,e.textures=r,e.blendMode=u,e.topology=h,e.start=t,e.size=a,++ld,this.batches[this.batchIndex++]=e,d.add(e)}finish(e){this.break(e)}ensureAttributeBuffer(e){e*4<=this.attributeBuffer.size||this._resizeAttributeBuffer(e*4)}ensureIndexBuffer(e){e<=this.indexBuffer.length||this._resizeIndexBuffer(e)}_resizeAttributeBuffer(e){const t=Math.max(e,this.attributeBuffer.size*2),a=new Ac(t);hv(this.attributeBuffer.rawBinaryData,a.rawBinaryData),this.attributeBuffer=a}_resizeIndexBuffer(e){const t=this.indexBuffer;let a=Math.max(e,t.length*1.5);a+=a%2;const r=a>65535?new Uint32Array(a):new Uint16Array(a);if(r.BYTES_PER_ELEMENT!==t.BYTES_PER_ELEMENT)for(let u=0;u<t.length;u++)r[u]=t[u];else hv(t.buffer,r.buffer);this.indexBuffer=r}packQuadIndex(e,t,a){e[t]=a+0,e[t+1]=a+1,e[t+2]=a+2,e[t+3]=a+0,e[t+4]=a+2,e[t+5]=a+3}packIndex(e,t,a,r){const u=e.indices,h=e.indexSize,d=e.indexOffset,m=e.attributeOffset;for(let y=0;y<h;y++)t[a++]=r+u[y+d]-m}destroy(){for(let e=0;e<this.batches.length;e++)$S(this.batches[e]);this.batches=null;for(let e=0;e<this._elements.length;e++)this._elements[e]._batch=null;this._elements=null,this.indexBuffer=null,this.attributeBuffer.destroy(),this.attributeBuffer=null}};e1.defaultOptions={maxTextures:null,attributesInitialSize:4,indicesInitialSize:6};let O3=e1;var xt=(n=>(n[n.MAP_READ=1]="MAP_READ",n[n.MAP_WRITE=2]="MAP_WRITE",n[n.COPY_SRC=4]="COPY_SRC",n[n.COPY_DST=8]="COPY_DST",n[n.INDEX=16]="INDEX",n[n.VERTEX=32]="VERTEX",n[n.UNIFORM=64]="UNIFORM",n[n.STORAGE=128]="STORAGE",n[n.INDIRECT=256]="INDIRECT",n[n.QUERY_RESOLVE=512]="QUERY_RESOLVE",n[n.STATIC=1024]="STATIC",n))(xt||{});class Ea extends Sa{constructor(e){let{data:t,size:a}=e;const{usage:r,label:u,shrinkToFit:h}=e;super(),this.uid=Kt("buffer"),this._resourceType="buffer",this._resourceId=Kt("resource"),this._touched=0,this._updateID=1,this._dataInt32=null,this.shrinkToFit=!0,this.destroyed=!1,t instanceof Array&&(t=new Float32Array(t)),this._data=t,a??(a=t==null?void 0:t.byteLength);const d=!!t;this.descriptor={size:a,usage:r,mappedAtCreation:d,label:u},this.shrinkToFit=h??!0}get data(){return this._data}set data(e){this.setDataWithSize(e,e.length,!0)}get dataInt32(){return this._dataInt32||(this._dataInt32=new Int32Array(this.data.buffer)),this._dataInt32}get static(){return!!(this.descriptor.usage&xt.STATIC)}set static(e){e?this.descriptor.usage|=xt.STATIC:this.descriptor.usage&=~xt.STATIC}setDataWithSize(e,t,a){if(this._updateID++,this._updateSize=t*e.BYTES_PER_ELEMENT,this._data===e){a&&this.emit("update",this);return}const r=this._data;if(this._data=e,this._dataInt32=null,!r||r.length!==e.length){!this.shrinkToFit&&r&&e.byteLength<r.byteLength?a&&this.emit("update",this):(this.descriptor.size=e.byteLength,this._resourceId=Kt("resource"),this.emit("change",this));return}a&&this.emit("update",this)}update(e){this._updateSize=e??this._updateSize,this._updateID++,this.emit("update",this)}destroy(){this.destroyed=!0,this.emit("destroy",this),this.emit("change",this),this._data=null,this.descriptor=null,this.removeAllListeners()}}function t1(n,e){if(!(n instanceof Ea)){let t=e?xt.INDEX:xt.VERTEX;n instanceof Array&&(e?(n=new Uint32Array(n),t=xt.INDEX|xt.COPY_DST):(n=new Float32Array(n),t=xt.VERTEX|xt.COPY_DST)),n=new Ea({data:n,label:e?"index-mesh-buffer":"vertex-mesh-buffer",usage:t})}return n}function N3(n,e,t){const a=n.getAttribute(e);if(!a)return t.minX=0,t.minY=0,t.maxX=0,t.maxY=0,t;const r=a.buffer.data;let u=1/0,h=1/0,d=-1/0,m=-1/0;const y=r.BYTES_PER_ELEMENT,b=(a.offset||0)/y,S=(a.stride||8)/y;for(let T=b;T<r.length;T+=S){const E=r[T],A=r[T+1];E>d&&(d=E),A>m&&(m=A),E<u&&(u=E),A<h&&(h=A)}return t.minX=u,t.minY=h,t.maxX=d,t.maxY=m,t}function G3(n){return(n instanceof Ea||Array.isArray(n)||n.BYTES_PER_ELEMENT)&&(n={buffer:n}),n.buffer=t1(n.buffer,!1),n}class od extends Sa{constructor(e={}){super(),this.uid=Kt("geometry"),this._layoutKey=0,this.instanceCount=1,this._bounds=new ci,this._boundsDirty=!0;const{attributes:t,indexBuffer:a,topology:r}=e;if(this.buffers=[],this.attributes={},t)for(const u in t)this.addAttribute(u,t[u]);this.instanceCount=e.instanceCount??1,a&&this.addIndex(a),this.topology=r||"triangle-list"}onBufferUpdate(){this._boundsDirty=!0,this.emit("update",this)}getAttribute(e){return this.attributes[e]}getIndex(){return this.indexBuffer}getBuffer(e){return this.getAttribute(e).buffer}getSize(){for(const e in this.attributes){const t=this.attributes[e];return t.buffer.data.length/(t.stride/4||t.size)}return 0}addAttribute(e,t){const a=G3(t);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[e]=a}addIndex(e){this.indexBuffer=t1(e,!0),this.buffers.push(this.indexBuffer)}get bounds(){return this._boundsDirty?(this._boundsDirty=!1,N3(this,"aPosition",this._bounds)):this._bounds}destroy(e=!1){this.emit("destroy",this),this.removeAllListeners(),e&&this.buffers.forEach(t=>t.destroy()),this.attributes=null,this.buffers=null,this.indexBuffer=null,this._bounds=null}}const w3=new Float32Array(1),P3=new Uint32Array(1);class z3 extends od{constructor(){const t=new Ea({data:w3,label:"attribute-batch-buffer",usage:xt.VERTEX|xt.COPY_DST,shrinkToFit:!1}),a=new Ea({data:P3,label:"index-batch-buffer",usage:xt.INDEX|xt.COPY_DST,shrinkToFit:!1}),r=24;super({attributes:{aPosition:{buffer:t,format:"float32x2",stride:r,offset:0},aUV:{buffer:t,format:"float32x2",stride:r,offset:8},aColor:{buffer:t,format:"unorm8x4",stride:r,offset:16},aTextureIdAndRound:{buffer:t,format:"uint16x2",stride:r,offset:20}},indexBuffer:a})}}function n1(n,e,t){if(n)for(const a in n){const r=a.toLocaleLowerCase(),u=e[r];if(u){let h=n[a];a==="header"&&(h=h.replace(/@in\s+[^;]+;\s*/g,"").replace(/@out\s+[^;]+;\s*/g,"")),t&&u.push(`//----${t}----//`),u.push(h)}else rt(`${a} placement hook does not exist in shader`)}}const H3=/\{\{(.*?)\}\}/g;function i1(n){var a;const e={};return(((a=n.match(H3))==null?void 0:a.map(r=>r.replace(/[{()}]/g,"")))??[]).forEach(r=>{e[r]=[]}),e}function a1(n,e){let t;const a=/@in\s+([^;]+);/g;for(;(t=a.exec(n))!==null;)e.push(t[1])}function s1(n,e,t=!1){const a=[];a1(e,a),n.forEach(d=>{d.header&&a1(d.header,a)});const r=a;t&&r.sort();const u=r.map((d,m)=>` @location(${m}) ${d},`).join(`
|
|
92
|
+
`);let h=e.replace(/@in\s+[^;]+;\s*/g,"");return h=h.replace("{{in}}",`
|
|
93
|
+
${u}
|
|
94
|
+
`),h}function r1(n,e){let t;const a=/@out\s+([^;]+);/g;for(;(t=a.exec(n))!==null;)e.push(t[1])}function V3(n){const t=/\b(\w+)\s*:/g.exec(n);return t?t[1]:""}function L3(n){const e=/@.*?\s+/g;return n.replace(e,"")}function j3(n,e){const t=[];r1(e,t),n.forEach(m=>{m.header&&r1(m.header,t)});let a=0;const r=t.sort().map(m=>m.indexOf("builtin")>-1?m:`@location(${a++}) ${m}`).join(`,
|
|
95
|
+
`),u=t.sort().map(m=>` var ${L3(m)};`).join(`
|
|
96
|
+
`),h=`return VSOutput(
|
|
97
|
+
${t.sort().map(m=>` ${V3(m)}`).join(`,
|
|
98
|
+
`)});`;let d=e.replace(/@out\s+[^;]+;\s*/g,"");return d=d.replace("{{struct}}",`
|
|
99
|
+
${r}
|
|
100
|
+
`),d=d.replace("{{start}}",`
|
|
101
|
+
${u}
|
|
102
|
+
`),d=d.replace("{{return}}",`
|
|
103
|
+
${h}
|
|
104
|
+
`),d}function l1(n,e){let t=n;for(const a in e){const r=e[a];r.join(`
|
|
105
|
+
`).length?t=t.replace(`{{${a}}}`,`//-----${a} START-----//
|
|
106
|
+
${r.join(`
|
|
107
|
+
`)}
|
|
108
|
+
//----${a} FINISH----//`):t=t.replace(`{{${a}}}`,"")}return t}const Il=Object.create(null),dv=new Map;let Y3=0;function X3({template:n,bits:e}){const t=o1(n,e);if(Il[t])return Il[t];const{vertex:a,fragment:r}=F3(n,e);return Il[t]=u1(a,r,e),Il[t]}function q3({template:n,bits:e}){const t=o1(n,e);return Il[t]||(Il[t]=u1(n.vertex,n.fragment,e)),Il[t]}function F3(n,e){const t=e.map(h=>h.vertex).filter(h=>!!h),a=e.map(h=>h.fragment).filter(h=>!!h);let r=s1(t,n.vertex,!0);r=j3(t,r);const u=s1(a,n.fragment,!0);return{vertex:r,fragment:u}}function o1(n,e){return e.map(t=>(dv.has(t)||dv.set(t,Y3++),dv.get(t))).sort((t,a)=>t-a).join("-")+n.vertex+n.fragment}function u1(n,e,t){const a=i1(n),r=i1(e);return t.forEach(u=>{n1(u.vertex,a,u.name),n1(u.fragment,r,u.name)}),{vertex:l1(n,a),fragment:l1(e,r)}}const I3=`
|
|
109
|
+
@in aPosition: vec2<f32>;
|
|
110
|
+
@in aUV: vec2<f32>;
|
|
111
|
+
|
|
112
|
+
@out @builtin(position) vPosition: vec4<f32>;
|
|
113
|
+
@out vUV : vec2<f32>;
|
|
114
|
+
@out vColor : vec4<f32>;
|
|
115
|
+
|
|
116
|
+
{{header}}
|
|
117
|
+
|
|
118
|
+
struct VSOutput {
|
|
119
|
+
{{struct}}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
@vertex
|
|
123
|
+
fn main( {{in}} ) -> VSOutput {
|
|
124
|
+
|
|
125
|
+
var worldTransformMatrix = globalUniforms.uWorldTransformMatrix;
|
|
126
|
+
var modelMatrix = mat3x3<f32>(
|
|
127
|
+
1.0, 0.0, 0.0,
|
|
128
|
+
0.0, 1.0, 0.0,
|
|
129
|
+
0.0, 0.0, 1.0
|
|
130
|
+
);
|
|
131
|
+
var position = aPosition;
|
|
132
|
+
var uv = aUV;
|
|
133
|
+
|
|
134
|
+
{{start}}
|
|
135
|
+
|
|
136
|
+
vColor = vec4<f32>(1., 1., 1., 1.);
|
|
137
|
+
|
|
138
|
+
{{main}}
|
|
139
|
+
|
|
140
|
+
vUV = uv;
|
|
141
|
+
|
|
142
|
+
var modelViewProjectionMatrix = globalUniforms.uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
143
|
+
|
|
144
|
+
vPosition = vec4<f32>((modelViewProjectionMatrix * vec3<f32>(position, 1.0)).xy, 0.0, 1.0);
|
|
145
|
+
|
|
146
|
+
vColor *= globalUniforms.uWorldColorAlpha;
|
|
147
|
+
|
|
148
|
+
{{end}}
|
|
149
|
+
|
|
150
|
+
{{return}}
|
|
151
|
+
};
|
|
152
|
+
`,k3=`
|
|
153
|
+
@in vUV : vec2<f32>;
|
|
154
|
+
@in vColor : vec4<f32>;
|
|
155
|
+
|
|
156
|
+
{{header}}
|
|
157
|
+
|
|
158
|
+
@fragment
|
|
159
|
+
fn main(
|
|
160
|
+
{{in}}
|
|
161
|
+
) -> @location(0) vec4<f32> {
|
|
162
|
+
|
|
163
|
+
{{start}}
|
|
164
|
+
|
|
165
|
+
var outColor:vec4<f32>;
|
|
166
|
+
|
|
167
|
+
{{main}}
|
|
168
|
+
|
|
169
|
+
var finalColor:vec4<f32> = outColor * vColor;
|
|
170
|
+
|
|
171
|
+
{{end}}
|
|
172
|
+
|
|
173
|
+
return finalColor;
|
|
174
|
+
};
|
|
175
|
+
`,K3=`
|
|
176
|
+
in vec2 aPosition;
|
|
177
|
+
in vec2 aUV;
|
|
178
|
+
|
|
179
|
+
out vec4 vColor;
|
|
180
|
+
out vec2 vUV;
|
|
181
|
+
|
|
182
|
+
{{header}}
|
|
183
|
+
|
|
184
|
+
void main(void){
|
|
185
|
+
|
|
186
|
+
mat3 worldTransformMatrix = uWorldTransformMatrix;
|
|
187
|
+
mat3 modelMatrix = mat3(
|
|
188
|
+
1.0, 0.0, 0.0,
|
|
189
|
+
0.0, 1.0, 0.0,
|
|
190
|
+
0.0, 0.0, 1.0
|
|
191
|
+
);
|
|
192
|
+
vec2 position = aPosition;
|
|
193
|
+
vec2 uv = aUV;
|
|
194
|
+
|
|
195
|
+
{{start}}
|
|
196
|
+
|
|
197
|
+
vColor = vec4(1.);
|
|
198
|
+
|
|
199
|
+
{{main}}
|
|
200
|
+
|
|
201
|
+
vUV = uv;
|
|
202
|
+
|
|
203
|
+
mat3 modelViewProjectionMatrix = uProjectionMatrix * worldTransformMatrix * modelMatrix;
|
|
204
|
+
|
|
205
|
+
gl_Position = vec4((modelViewProjectionMatrix * vec3(position, 1.0)).xy, 0.0, 1.0);
|
|
206
|
+
|
|
207
|
+
vColor *= uWorldColorAlpha;
|
|
208
|
+
|
|
209
|
+
{{end}}
|
|
210
|
+
}
|
|
211
|
+
`,Q3=`
|
|
212
|
+
|
|
213
|
+
in vec4 vColor;
|
|
214
|
+
in vec2 vUV;
|
|
215
|
+
|
|
216
|
+
out vec4 finalColor;
|
|
217
|
+
|
|
218
|
+
{{header}}
|
|
219
|
+
|
|
220
|
+
void main(void) {
|
|
221
|
+
|
|
222
|
+
{{start}}
|
|
223
|
+
|
|
224
|
+
vec4 outColor;
|
|
225
|
+
|
|
226
|
+
{{main}}
|
|
227
|
+
|
|
228
|
+
finalColor = outColor * vColor;
|
|
229
|
+
|
|
230
|
+
{{end}}
|
|
231
|
+
}
|
|
232
|
+
`,Z3={name:"global-uniforms-bit",vertex:{header:`
|
|
233
|
+
struct GlobalUniforms {
|
|
234
|
+
uProjectionMatrix:mat3x3<f32>,
|
|
235
|
+
uWorldTransformMatrix:mat3x3<f32>,
|
|
236
|
+
uWorldColorAlpha: vec4<f32>,
|
|
237
|
+
uResolution: vec2<f32>,
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@group(0) @binding(0) var<uniform> globalUniforms : GlobalUniforms;
|
|
241
|
+
`}},W3={name:"global-uniforms-bit",vertex:{header:`
|
|
242
|
+
uniform mat3 uProjectionMatrix;
|
|
243
|
+
uniform mat3 uWorldTransformMatrix;
|
|
244
|
+
uniform vec4 uWorldColorAlpha;
|
|
245
|
+
uniform vec2 uResolution;
|
|
246
|
+
`}};function ud({bits:n,name:e}){const t=X3({template:{fragment:k3,vertex:I3},bits:[Z3,...n]});return su.from({name:e,vertex:{source:t.vertex,entryPoint:"main"},fragment:{source:t.fragment,entryPoint:"main"}})}function cd({bits:n,name:e}){return new Cc({name:e,...q3({template:{vertex:K3,fragment:Q3},bits:[W3,...n]})})}const pv={name:"color-bit",vertex:{header:`
|
|
247
|
+
@in aColor: vec4<f32>;
|
|
248
|
+
`,main:`
|
|
249
|
+
vColor *= vec4<f32>(aColor.rgb * aColor.a, aColor.a);
|
|
250
|
+
`}},mv={name:"color-bit",vertex:{header:`
|
|
251
|
+
in vec4 aColor;
|
|
252
|
+
`,main:`
|
|
253
|
+
vColor *= vec4(aColor.rgb * aColor.a, aColor.a);
|
|
254
|
+
`}},yv={};function J3(n){const e=[];if(n===1)e.push("@group(1) @binding(0) var textureSource1: texture_2d<f32>;"),e.push("@group(1) @binding(1) var textureSampler1: sampler;");else{let t=0;for(let a=0;a<n;a++)e.push(`@group(1) @binding(${t++}) var textureSource${a+1}: texture_2d<f32>;`),e.push(`@group(1) @binding(${t++}) var textureSampler${a+1}: sampler;`)}return e.join(`
|
|
255
|
+
`)}function $3(n){const e=[];if(n===1)e.push("outColor = textureSampleGrad(textureSource1, textureSampler1, vUV, uvDx, uvDy);");else{e.push("switch vTextureId {");for(let t=0;t<n;t++)t===n-1?e.push(" default:{"):e.push(` case ${t}:{`),e.push(` outColor = textureSampleGrad(textureSource${t+1}, textureSampler${t+1}, vUV, uvDx, uvDy);`),e.push(" break;}");e.push("}")}return e.join(`
|
|
256
|
+
`)}function gv(n){return yv[n]||(yv[n]={name:"texture-batch-bit",vertex:{header:`
|
|
257
|
+
@in aTextureIdAndRound: vec2<u32>;
|
|
258
|
+
@out @interpolate(flat) vTextureId : u32;
|
|
259
|
+
`,main:`
|
|
260
|
+
vTextureId = aTextureIdAndRound.y;
|
|
261
|
+
`,end:`
|
|
262
|
+
if(aTextureIdAndRound.x == 1)
|
|
263
|
+
{
|
|
264
|
+
vPosition = vec4<f32>(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
265
|
+
}
|
|
266
|
+
`},fragment:{header:`
|
|
267
|
+
@in @interpolate(flat) vTextureId: u32;
|
|
268
|
+
|
|
269
|
+
${J3(n)}
|
|
270
|
+
`,main:`
|
|
271
|
+
var uvDx = dpdx(vUV);
|
|
272
|
+
var uvDy = dpdy(vUV);
|
|
273
|
+
|
|
274
|
+
${$3(n)}
|
|
275
|
+
`}}),yv[n]}const _v={};function eD(n){const e=[];for(let t=0;t<n;t++)t>0&&e.push("else"),t<n-1&&e.push(`if(vTextureId < ${t}.5)`),e.push("{"),e.push(` outColor = texture(uTextures[${t}], vUV);`),e.push("}");return e.join(`
|
|
276
|
+
`)}function vv(n){return _v[n]||(_v[n]={name:"texture-batch-bit",vertex:{header:`
|
|
277
|
+
in vec2 aTextureIdAndRound;
|
|
278
|
+
out float vTextureId;
|
|
279
|
+
|
|
280
|
+
`,main:`
|
|
281
|
+
vTextureId = aTextureIdAndRound.y;
|
|
282
|
+
`,end:`
|
|
283
|
+
if(aTextureIdAndRound.x == 1.)
|
|
284
|
+
{
|
|
285
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
286
|
+
}
|
|
287
|
+
`},fragment:{header:`
|
|
288
|
+
in float vTextureId;
|
|
289
|
+
|
|
290
|
+
uniform sampler2D uTextures[${n}];
|
|
291
|
+
|
|
292
|
+
`,main:`
|
|
293
|
+
|
|
294
|
+
${eD(n)}
|
|
295
|
+
`}}),_v[n]}const hd={name:"round-pixels-bit",vertex:{header:`
|
|
296
|
+
fn roundPixels(position: vec2<f32>, targetSize: vec2<f32>) -> vec2<f32>
|
|
297
|
+
{
|
|
298
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
299
|
+
}
|
|
300
|
+
`}},fd={name:"round-pixels-bit",vertex:{header:`
|
|
301
|
+
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
302
|
+
{
|
|
303
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
304
|
+
}
|
|
305
|
+
`}},c1={};function bv(n){let e=c1[n];if(e)return e;const t=new Int32Array(n);for(let a=0;a<n;a++)t[a]=a;return e=c1[n]=new Yi({uTextures:{value:t,type:"i32",size:n}},{isStatic:!0}),e}class tD extends ka{constructor(e){const t=cd({name:"batch",bits:[mv,vv(e),fd]}),a=ud({name:"batch",bits:[pv,gv(e),hd]});super({glProgram:t,gpuProgram:a,resources:{batchSamplers:bv(e)}})}}let xv=null;const h1=class KR extends O3{constructor(e){super(e),this.geometry=new z3,this.name=KR.extension.name,this.vertexSize=6,xv??(xv=new tD(e.maxTextures)),this.shader=xv}packAttributes(e,t,a,r,u){const h=u<<16|e.roundPixels&65535,d=e.transform,m=d.a,y=d.b,b=d.c,S=d.d,T=d.tx,E=d.ty,{positions:A,uvs:B}=e,M=e.color,G=e.attributeOffset,w=G+e.attributeSize;for(let P=G;P<w;P++){const z=P*2,Z=A[z],ie=A[z+1];t[r++]=m*Z+b*ie+T,t[r++]=S*ie+y*Z+E,t[r++]=B[z],t[r++]=B[z+1],a[r++]=M,a[r++]=h}}packQuadAttributes(e,t,a,r,u){const h=e.texture,d=e.transform,m=d.a,y=d.b,b=d.c,S=d.d,T=d.tx,E=d.ty,A=e.bounds,B=A.maxX,M=A.minX,G=A.maxY,w=A.minY,P=h.uvs,z=e.color,Z=u<<16|e.roundPixels&65535;t[r+0]=m*M+b*w+T,t[r+1]=S*w+y*M+E,t[r+2]=P.x0,t[r+3]=P.y0,a[r+4]=z,a[r+5]=Z,t[r+6]=m*B+b*w+T,t[r+7]=S*w+y*B+E,t[r+8]=P.x1,t[r+9]=P.y1,a[r+10]=z,a[r+11]=Z,t[r+12]=m*B+b*G+T,t[r+13]=S*G+y*B+E,t[r+14]=P.x2,t[r+15]=P.y2,a[r+16]=z,a[r+17]=Z,t[r+18]=m*M+b*G+T,t[r+19]=S*G+y*M+E,t[r+20]=P.x3,t[r+21]=P.y3,a[r+22]=z,a[r+23]=Z}};h1.extension={type:[Q.Batcher],name:"default"};let Sv=h1;function nD(n,e,t,a,r,u,h,d=null){let m=0;t*=e,r*=u;const y=d.a,b=d.b,S=d.c,T=d.d,E=d.tx,A=d.ty;for(;m<h;){const B=n[t],M=n[t+1];a[r]=y*B+S*M+E,a[r+1]=b*B+T*M+A,r+=u,t+=e,m++}}function iD(n,e,t,a){let r=0;for(e*=t;r<a;)n[e]=0,n[e+1]=0,e+=t,r++}function f1(n,e,t,a,r){const u=e.a,h=e.b,d=e.c,m=e.d,y=e.tx,b=e.ty;t||(t=0),a||(a=2),r||(r=n.length/a-t);let S=t*a;for(let T=0;T<r;T++){const E=n[S],A=n[S+1];n[S]=u*E+d*A+y,n[S+1]=h*E+m*A+b,S+=a}}const aD=new Pe;class Tv{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 e=this.baseColor,t=e>>16|e&65280|(e&255)<<16,a=this.renderable;return a?Hx(t,a.groupColor)+(this.alpha*a.groupAlpha*255<<24):t+(this.alpha*255<<24)}get transform(){var e;return((e=this.renderable)==null?void 0:e.groupTransform)||aD}copyTo(e){e.indexOffset=this.indexOffset,e.indexSize=this.indexSize,e.attributeOffset=this.attributeOffset,e.attributeSize=this.attributeSize,e.baseColor=this.baseColor,e.alpha=this.alpha,e.texture=this.texture,e.geometryData=this.geometryData,e.topology=this.topology}reset(){this.applyTransform=!0,this.renderable=null,this.topology="triangle-list"}}const dd={extension:{type:Q.ShapeBuilder,name:"circle"},build(n,e){let t,a,r,u,h,d;if(n.type==="circle"){const z=n;if(h=d=z.radius,h<=0)return!1;t=z.x,a=z.y,r=u=0}else if(n.type==="ellipse"){const z=n;if(h=z.halfWidth,d=z.halfHeight,h<=0||d<=0)return!1;t=z.x,a=z.y,r=u=0}else{const z=n,Z=z.width/2,ie=z.height/2;t=z.x+Z,a=z.y+ie,h=d=Math.max(0,Math.min(z.radius,Math.min(Z,ie))),r=Z-h,u=ie-d}if(r<0||u<0)return!1;const m=Math.ceil(2.3*Math.sqrt(h+d)),y=m*8+(r?4:0)+(u?4:0);if(y===0)return!1;if(m===0)return e[0]=e[6]=t+r,e[1]=e[3]=a+u,e[2]=e[4]=t-r,e[5]=e[7]=a-u,!0;let b=0,S=m*4+(r?2:0)+2,T=S,E=y,A=r+h,B=u,M=t+A,G=t-A,w=a+B;if(e[b++]=M,e[b++]=w,e[--S]=w,e[--S]=G,u){const z=a-B;e[T++]=G,e[T++]=z,e[--E]=z,e[--E]=M}for(let z=1;z<m;z++){const Z=Math.PI/2*(z/m),ie=r+Math.cos(Z)*h,ne=u+Math.sin(Z)*d,Se=t+ie,_e=t-ie,me=a+ne,se=a-ne;e[b++]=Se,e[b++]=me,e[--S]=me,e[--S]=_e,e[T++]=_e,e[T++]=se,e[--E]=se,e[--E]=Se}A=r,B=u+d,M=t+A,G=t-A,w=a+B;const P=a-B;return e[b++]=M,e[b++]=w,e[--E]=P,e[--E]=M,r&&(e[b++]=G,e[b++]=w,e[--E]=P,e[--E]=G),!0},triangulate(n,e,t,a,r,u){if(n.length===0)return;let h=0,d=0;for(let b=0;b<n.length;b+=2)h+=n[b],d+=n[b+1];h/=n.length/2,d/=n.length/2;let m=a;e[m*t]=h,e[m*t+1]=d;const y=m++;for(let b=0;b<n.length;b+=2)e[m*t]=n[b],e[m*t+1]=n[b+1],b>0&&(r[u++]=m,r[u++]=y,r[u++]=m-1),m++;r[u++]=y+1,r[u++]=y,r[u++]=m-1}},sD={...dd,extension:{...dd.extension,name:"ellipse"}},rD={...dd,extension:{...dd.extension,name:"roundedRectangle"}},d1=1e-4,p1=1e-4;function lD(n){const e=n.length;if(e<6)return 1;let t=0;for(let a=0,r=n[e-2],u=n[e-1];a<e;a+=2){const h=n[a],d=n[a+1];t+=(h-r)*(d+u),r=h,u=d}return t<0?-1:1}function m1(n,e,t,a,r,u,h,d){const m=n-t*r,y=e-a*r,b=n+t*u,S=e+a*u;let T,E;h?(T=a,E=-t):(T=-a,E=t);const A=m+T,B=y+E,M=b+T,G=S+E;return d.push(A,B),d.push(M,G),2}function lu(n,e,t,a,r,u,h,d){const m=t-n,y=a-e;let b=Math.atan2(m,y),S=Math.atan2(r-n,u-e);d&&b<S?b+=Math.PI*2:!d&&b>S&&(S+=Math.PI*2);let T=b;const E=S-b,A=Math.abs(E),B=Math.sqrt(m*m+y*y),M=(15*A*Math.sqrt(B)/Math.PI>>0)+1,G=E/M;if(T+=G,d){h.push(n,e),h.push(t,a);for(let w=1,P=T;w<M;w++,P+=G)h.push(n,e),h.push(n+Math.sin(P)*B,e+Math.cos(P)*B);h.push(n,e),h.push(r,u)}else{h.push(t,a),h.push(n,e);for(let w=1,P=T;w<M;w++,P+=G)h.push(n+Math.sin(P)*B,e+Math.cos(P)*B),h.push(n,e);h.push(r,u),h.push(n,e)}return M*2}function oD(n,e,t,a,r,u){const h=d1;if(n.length===0)return;const d=e;let m=d.alignment;if(e.alignment!==.5){let pe=lD(n);m=(m-.5)*pe+.5}const y=new qt(n[0],n[1]),b=new qt(n[n.length-2],n[n.length-1]),S=a,T=Math.abs(y.x-b.x)<h&&Math.abs(y.y-b.y)<h;if(S){n=n.slice(),T&&(n.pop(),n.pop(),b.set(n[n.length-2],n[n.length-1]));const pe=(y.x+b.x)*.5,U=(b.y+y.y)*.5;n.unshift(pe,U),n.push(pe,U)}const E=r,A=n.length/2;let B=n.length;const M=E.length/2,G=d.width/2,w=G*G,P=d.miterLimit*d.miterLimit;let z=n[0],Z=n[1],ie=n[2],ne=n[3],Se=0,_e=0,me=-(Z-ne),se=z-ie,Le=0,ae=0,We=Math.sqrt(me*me+se*se);me/=We,se/=We,me*=G,se*=G;const St=m,j=(1-St)*2,ee=St*2;S||(d.cap==="round"?B+=lu(z-me*(j-ee)*.5,Z-se*(j-ee)*.5,z-me*j,Z-se*j,z+me*ee,Z+se*ee,E,!0)+2:d.cap==="square"&&(B+=m1(z,Z,me,se,j,ee,!0,E))),E.push(z-me*j,Z-se*j),E.push(z+me*ee,Z+se*ee);for(let pe=1;pe<A-1;++pe){z=n[(pe-1)*2],Z=n[(pe-1)*2+1],ie=n[pe*2],ne=n[pe*2+1],Se=n[(pe+1)*2],_e=n[(pe+1)*2+1],me=-(Z-ne),se=z-ie,We=Math.sqrt(me*me+se*se),me/=We,se/=We,me*=G,se*=G,Le=-(ne-_e),ae=ie-Se,We=Math.sqrt(Le*Le+ae*ae),Le/=We,ae/=We,Le*=G,ae*=G;const U=ie-z,k=Z-ne,oe=ie-Se,be=_e-ne,Ae=U*oe+k*be,De=k*oe-be*U,ze=De<0;if(Math.abs(De)<.001*Math.abs(Ae)){E.push(ie-me*j,ne-se*j),E.push(ie+me*ee,ne+se*ee),Ae>=0&&(d.join==="round"?B+=lu(ie,ne,ie-me*j,ne-se*j,ie-Le*j,ne-ae*j,E,!1)+4:B+=2,E.push(ie-Le*ee,ne-ae*ee),E.push(ie+Le*j,ne+ae*j));continue}const wt=(-me+z)*(-se+ne)-(-me+ie)*(-se+Z),je=(-Le+Se)*(-ae+ne)-(-Le+ie)*(-ae+_e),$t=(U*je-oe*wt)/De,Ni=(be*wt-k*je)/De,Wn=($t-ie)*($t-ie)+(Ni-ne)*(Ni-ne),cn=ie+($t-ie)*j,Jn=ne+(Ni-ne)*j,$n=ie-($t-ie)*ee,wn=ne-(Ni-ne)*ee,xn=Math.min(U*U+k*k,oe*oe+be*be),Pn=ze?j:ee,yr=xn+Pn*Pn*w;Wn<=yr?d.join==="bevel"||Wn/w>P?(ze?(E.push(cn,Jn),E.push(ie+me*ee,ne+se*ee),E.push(cn,Jn),E.push(ie+Le*ee,ne+ae*ee)):(E.push(ie-me*j,ne-se*j),E.push($n,wn),E.push(ie-Le*j,ne-ae*j),E.push($n,wn)),B+=2):d.join==="round"?ze?(E.push(cn,Jn),E.push(ie+me*ee,ne+se*ee),B+=lu(ie,ne,ie+me*ee,ne+se*ee,ie+Le*ee,ne+ae*ee,E,!0)+4,E.push(cn,Jn),E.push(ie+Le*ee,ne+ae*ee)):(E.push(ie-me*j,ne-se*j),E.push($n,wn),B+=lu(ie,ne,ie-me*j,ne-se*j,ie-Le*j,ne-ae*j,E,!1)+4,E.push(ie-Le*j,ne-ae*j),E.push($n,wn)):(E.push(cn,Jn),E.push($n,wn)):(E.push(ie-me*j,ne-se*j),E.push(ie+me*ee,ne+se*ee),d.join==="round"?ze?B+=lu(ie,ne,ie+me*ee,ne+se*ee,ie+Le*ee,ne+ae*ee,E,!0)+2:B+=lu(ie,ne,ie-me*j,ne-se*j,ie-Le*j,ne-ae*j,E,!1)+2:d.join==="miter"&&Wn/w<=P&&(ze?(E.push($n,wn),E.push($n,wn)):(E.push(cn,Jn),E.push(cn,Jn)),B+=2),E.push(ie-Le*j,ne-ae*j),E.push(ie+Le*ee,ne+ae*ee),B+=2)}z=n[(A-2)*2],Z=n[(A-2)*2+1],ie=n[(A-1)*2],ne=n[(A-1)*2+1],me=-(Z-ne),se=z-ie,We=Math.sqrt(me*me+se*se),me/=We,se/=We,me*=G,se*=G,E.push(ie-me*j,ne-se*j),E.push(ie+me*ee,ne+se*ee),S||(d.cap==="round"?B+=lu(ie-me*(j-ee)*.5,ne-se*(j-ee)*.5,ie-me*j,ne-se*j,ie+me*ee,ne+se*ee,E,!1)+2:d.cap==="square"&&(B+=m1(ie,ne,me,se,j,ee,!1,E)));const de=p1*p1;for(let pe=M;pe<B+M-2;++pe)z=E[pe*2],Z=E[pe*2+1],ie=E[(pe+1)*2],ne=E[(pe+1)*2+1],Se=E[(pe+2)*2],_e=E[(pe+2)*2+1],!(Math.abs(z*(ne-_e)+ie*(_e-Z)+Se*(Z-ne))<de)&&u.push(pe,pe+1,pe+2)}function uD(n,e,t,a){const r=d1;if(n.length===0)return;const u=n[0],h=n[1],d=n[n.length-2],m=n[n.length-1],y=e||Math.abs(u-d)<r&&Math.abs(h-m)<r,b=t,S=n.length/2,T=b.length/2;for(let E=0;E<S;E++)b.push(n[E*2]),b.push(n[E*2+1]);for(let E=0;E<S-1;E++)a.push(T+E,T+E+1);y&&a.push(T+S-1,T)}function y1(n,e,t,a,r,u,h){const d=c3(n,e,2);if(!d)return;for(let y=0;y<d.length;y+=3)u[h++]=d[y]+r,u[h++]=d[y+1]+r,u[h++]=d[y+2]+r;let m=r*a;for(let y=0;y<n.length;y+=2)t[m]=n[y],t[m+1]=n[y+1],m+=a}const cD=[],hD={extension:{type:Q.ShapeBuilder,name:"polygon"},build(n,e){for(let t=0;t<n.points.length;t++)e[t]=n.points[t];return!0},triangulate(n,e,t,a,r,u){y1(n,cD,e,t,a,r,u)}},fD={extension:{type:Q.ShapeBuilder,name:"rectangle"},build(n,e){const t=n,a=t.x,r=t.y,u=t.width,h=t.height;return u>0&&h>0?(e[0]=a,e[1]=r,e[2]=a+u,e[3]=r,e[4]=a+u,e[5]=r+h,e[6]=a,e[7]=r+h,!0):!1},triangulate(n,e,t,a,r,u){let h=0;a*=t,e[a+h]=n[0],e[a+h+1]=n[1],h+=t,e[a+h]=n[2],e[a+h+1]=n[3],h+=t,e[a+h]=n[6],e[a+h+1]=n[7],h+=t,e[a+h]=n[4],e[a+h+1]=n[5],h+=t;const d=a/t;r[u++]=d,r[u++]=d+1,r[u++]=d+2,r[u++]=d+1,r[u++]=d+3,r[u++]=d+2}},dD={extension:{type:Q.ShapeBuilder,name:"triangle"},build(n,e){return e[0]=n.x,e[1]=n.y,e[2]=n.x2,e[3]=n.y2,e[4]=n.x3,e[5]=n.y3,!0},triangulate(n,e,t,a,r,u){let h=0;a*=t,e[a+h]=n[0],e[a+h+1]=n[1],h+=t,e[a+h]=n[2],e[a+h+1]=n[3],h+=t,e[a+h]=n[4],e[a+h+1]=n[5];const d=a/t;r[u++]=d,r[u++]=d+1,r[u++]=d+2}},pD=new Pe,mD=new Nt;function yD(n,e,t,a){const r=e.matrix?n.copyFrom(e.matrix).invert():n.identity();if(e.textureSpace==="local"){const h=t.getBounds(mD);e.width&&h.pad(e.width);const{x:d,y:m}=h,y=1/h.width,b=1/h.height,S=-d*y,T=-m*b,E=r.a,A=r.b,B=r.c,M=r.d;r.a*=y,r.b*=y,r.c*=b,r.d*=b,r.tx=S*E+T*B+r.tx,r.ty=S*A+T*M+r.ty}else r.translate(e.texture.frame.x,e.texture.frame.y),r.scale(1/e.texture.source.width,1/e.texture.source.height);const u=e.texture.source.style;return!(e.fill instanceof tl)&&u.addressMode==="clamp-to-edge"&&(u.addressMode="repeat",u.update()),a&&r.append(pD.copyFrom(a).invert()),r}const fy={};Ie.handleByMap(Q.ShapeBuilder,fy),Ie.add(fD,hD,dD,dd,sD,rD);const gD=new Nt,_D=new Pe;function vD(n,e){const{geometryData:t,batches:a}=e;a.length=0,t.indices.length=0,t.vertices.length=0,t.uvs.length=0;for(let r=0;r<n.instructions.length;r++){const u=n.instructions[r];if(u.action==="texture")bD(u.data,a,t);else if(u.action==="fill"||u.action==="stroke"){const h=u.action==="stroke",d=u.data.path.shapePath,m=u.data.style,y=u.data.hole;h&&y&&g1(y.shapePath,m,!0,a,t),y&&(d.shapePrimitives[d.shapePrimitives.length-1].holes=y.shapePath.shapePrimitives),g1(d,m,h,a,t)}}}function bD(n,e,t){const a=[],r=fy.rectangle,u=gD;u.x=n.dx,u.y=n.dy,u.width=n.dw,u.height=n.dh;const h=n.transform;if(!r.build(u,a))return;const{vertices:d,uvs:m,indices:y}=t,b=y.length,S=d.length/2;h&&f1(a,h),r.triangulate(a,d,2,S,y,b);const T=n.image,E=T.uvs;m.push(E.x0,E.y0,E.x1,E.y1,E.x3,E.y3,E.x2,E.y2);const A=hi.get(Tv);A.indexOffset=b,A.indexSize=y.length-b,A.attributeOffset=S,A.attributeSize=d.length/2-S,A.baseColor=n.style,A.alpha=n.alpha,A.texture=T,A.geometryData=t,e.push(A)}function g1(n,e,t,a,r){const{vertices:u,uvs:h,indices:d}=r;n.shapePrimitives.forEach(({shape:m,transform:y,holes:b})=>{const S=[],T=fy[m.type];if(!T.build(m,S))return;const E=d.length,A=u.length/2;let B="triangle-list";if(y&&f1(S,y),t){const P=m.closePath??!0,z=e;z.pixelLine?(uD(S,P,u,d),B="line-list"):oD(S,z,!1,P,u,d)}else if(b){const P=[],z=S.slice();xD(b).forEach(ie=>{P.push(z.length/2),z.push(...ie)}),y1(z,P,u,2,A,d,E)}else T.triangulate(S,u,2,A,d,E);const M=h.length/2,G=e.texture;if(G!==Ge.WHITE){const P=yD(_D,e,m,y);nD(u,2,A,h,M,2,u.length/2-A,P)}else iD(h,M,2,u.length/2-A);const w=hi.get(Tv);w.indexOffset=E,w.indexSize=d.length-E,w.attributeOffset=A,w.attributeSize=u.length/2-A,w.baseColor=e.color,w.alpha=e.alpha,w.texture=G,w.geometryData=r,w.topology=B,a.push(w)})}function xD(n){const e=[];for(let t=0;t<n.length;t++){const a=n[t].shape,r=[];fy[a.type].build(a,r)&&e.push(r)}return e}class SD{constructor(){this.batches=[],this.geometryData={vertices:[],uvs:[],indices:[]}}}class TD{constructor(){this.instructions=new Yx}init(e){this.batcher=new Sv({maxTextures:e}),this.instructions.reset()}get geometry(){return st(BA,"GraphicsContextRenderData#geometry is deprecated, please use batcher.geometry instead."),this.batcher.geometry}}const Ev=class Jb{constructor(e){this._gpuContextHash={},this._graphicsDataContextHash=Object.create(null),this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuContextHash"),e.renderableGC.addManagedHash(this,"_graphicsDataContextHash")}init(e){Jb.defaultOptions.bezierSmoothness=(e==null?void 0:e.bezierSmoothness)??Jb.defaultOptions.bezierSmoothness}getContextRenderData(e){return this._graphicsDataContextHash[e.uid]||this._initContextRenderData(e)}updateGpuContext(e){let t=this._gpuContextHash[e.uid]||this._initContext(e);if(e.dirty){t?this._cleanGraphicsContextData(e):t=this._initContext(e),vD(e,t);const a=e.batchMode;e.customShader||a==="no-batch"?t.isBatchable=!1:a==="auto"?t.isBatchable=t.geometryData.vertices.length<400:t.isBatchable=!0,e.dirty=!1}return t}getGpuContext(e){return this._gpuContextHash[e.uid]||this._initContext(e)}_initContextRenderData(e){const t=hi.get(TD,{maxTextures:this._renderer.limits.maxBatchableTextures}),{batches:a,geometryData:r}=this._gpuContextHash[e.uid],u=r.vertices.length,h=r.indices.length;for(let b=0;b<a.length;b++)a[b].applyTransform=!1;const d=t.batcher;d.ensureAttributeBuffer(u),d.ensureIndexBuffer(h),d.begin();for(let b=0;b<a.length;b++){const S=a[b];d.add(S)}d.finish(t.instructions);const m=d.geometry;m.indexBuffer.setDataWithSize(d.indexBuffer,d.indexSize,!0),m.buffers[0].setDataWithSize(d.attributeBuffer.float32View,d.attributeSize,!0);const y=d.batches;for(let b=0;b<y.length;b++){const S=y[b];S.bindGroup=cv(S.textures.textures,S.textures.count,this._renderer.limits.maxBatchableTextures)}return this._graphicsDataContextHash[e.uid]=t,t}_initContext(e){const t=new SD;return t.context=e,this._gpuContextHash[e.uid]=t,e.on("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]}onGraphicsContextDestroy(e){this._cleanGraphicsContextData(e),e.off("destroy",this.onGraphicsContextDestroy,this),this._gpuContextHash[e.uid]=null}_cleanGraphicsContextData(e){const t=this._gpuContextHash[e.uid];t.isBatchable||this._graphicsDataContextHash[e.uid]&&(hi.return(this.getContextRenderData(e)),this._graphicsDataContextHash[e.uid]=null),t.batches&&t.batches.forEach(a=>{hi.return(a)})}destroy(){for(const e in this._gpuContextHash)this._gpuContextHash[e]&&this.onGraphicsContextDestroy(this._gpuContextHash[e].context)}};Ev.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"graphicsContext"},Ev.defaultOptions={bezierSmoothness:.5};let Cv=Ev;const ED=8,dy=11920929e-14,CD=1;function _1(n,e,t,a,r,u,h,d,m,y){const S=Math.min(.99,Math.max(0,y??Cv.defaultOptions.bezierSmoothness));let T=(CD-S)/1;return T*=T,RD(e,t,a,r,u,h,d,m,n,T),n}function RD(n,e,t,a,r,u,h,d,m,y){Rv(n,e,t,a,r,u,h,d,m,y,0),m.push(h,d)}function Rv(n,e,t,a,r,u,h,d,m,y,b){if(b>ED)return;const S=(n+t)/2,T=(e+a)/2,E=(t+r)/2,A=(a+u)/2,B=(r+h)/2,M=(u+d)/2,G=(S+E)/2,w=(T+A)/2,P=(E+B)/2,z=(A+M)/2,Z=(G+P)/2,ie=(w+z)/2;if(b>0){let ne=h-n,Se=d-e;const _e=Math.abs((t-h)*Se-(a-d)*ne),me=Math.abs((r-h)*Se-(u-d)*ne);if(_e>dy&&me>dy){if((_e+me)*(_e+me)<=y*(ne*ne+Se*Se)){m.push(Z,ie);return}}else if(_e>dy){if(_e*_e<=y*(ne*ne+Se*Se)){m.push(Z,ie);return}}else if(me>dy){if(me*me<=y*(ne*ne+Se*Se)){m.push(Z,ie);return}}else if(ne=Z-(n+h)/2,Se=ie-(e+d)/2,ne*ne+Se*Se<=y){m.push(Z,ie);return}}Rv(n,e,S,T,G,w,Z,ie,m,y,b+1),Rv(Z,ie,P,z,B,M,h,d,m,y,b+1)}const AD=8,MD=11920929e-14,DD=1;function UD(n,e,t,a,r,u,h,d){const y=Math.min(.99,Math.max(0,d??Cv.defaultOptions.bezierSmoothness));let b=(DD-y)/1;return b*=b,BD(e,t,a,r,u,h,n,b),n}function BD(n,e,t,a,r,u,h,d){Av(h,n,e,t,a,r,u,d,0),h.push(r,u)}function Av(n,e,t,a,r,u,h,d,m){if(m>AD)return;const y=(e+a)/2,b=(t+r)/2,S=(a+u)/2,T=(r+h)/2,E=(y+S)/2,A=(b+T)/2;let B=u-e,M=h-t;const G=Math.abs((a-u)*M-(r-h)*B);if(G>MD){if(G*G<=d*(B*B+M*M)){n.push(E,A);return}}else if(B=E-(e+u)/2,M=A-(t+h)/2,B*B+M*M<=d){n.push(E,A);return}Av(n,e,t,y,b,E,A,d,m+1),Av(n,E,A,S,T,u,h,d,m+1)}function v1(n,e,t,a,r,u,h,d){let m=Math.abs(r-u);(!h&&r>u||h&&u>r)&&(m=2*Math.PI-m),d||(d=Math.max(6,Math.floor(6*Math.pow(a,1/3)*(m/Math.PI)))),d=Math.max(d,3);let y=m/d,b=r;y*=h?-1:1;for(let S=0;S<d+1;S++){const T=Math.cos(b),E=Math.sin(b),A=e+T*a,B=t+E*a;n.push(A,B),b+=y}}function OD(n,e,t,a,r,u){const h=n[n.length-2],m=n[n.length-1]-t,y=h-e,b=r-t,S=a-e,T=Math.abs(m*S-y*b);if(T<1e-8||u===0){(n[n.length-2]!==e||n[n.length-1]!==t)&&n.push(e,t);return}const E=m*m+y*y,A=b*b+S*S,B=m*b+y*S,M=u*Math.sqrt(E)/T,G=u*Math.sqrt(A)/T,w=M*B/E,P=G*B/A,z=M*S+G*y,Z=M*b+G*m,ie=y*(G+w),ne=m*(G+w),Se=S*(M+P),_e=b*(M+P),me=Math.atan2(ne-Z,ie-z),se=Math.atan2(_e-Z,Se-z);v1(n,z+e,Z+t,u,me,se,y*b>S*m)}const pd=Math.PI*2,Mv={centerX:0,centerY:0,ang1:0,ang2:0},Dv=({x:n,y:e},t,a,r,u,h,d,m)=>{n*=t,e*=a;const y=r*n-u*e,b=u*n+r*e;return m.x=y+h,m.y=b+d,m};function ND(n,e){const t=e===-1.5707963267948966?-.551915024494:1.3333333333333333*Math.tan(e/4),a=e===1.5707963267948966?.551915024494:t,r=Math.cos(n),u=Math.sin(n),h=Math.cos(n+e),d=Math.sin(n+e);return[{x:r-u*a,y:u+r*a},{x:h+d*a,y:d-h*a},{x:h,y:d}]}const b1=(n,e,t,a)=>{const r=n*a-e*t<0?-1:1;let u=n*t+e*a;return u>1&&(u=1),u<-1&&(u=-1),r*Math.acos(u)},GD=(n,e,t,a,r,u,h,d,m,y,b,S,T)=>{const E=Math.pow(r,2),A=Math.pow(u,2),B=Math.pow(b,2),M=Math.pow(S,2);let G=E*A-E*M-A*B;G<0&&(G=0),G/=E*M+A*B,G=Math.sqrt(G)*(h===d?-1:1);const w=G*r/u*S,P=G*-u/r*b,z=y*w-m*P+(n+t)/2,Z=m*w+y*P+(e+a)/2,ie=(b-w)/r,ne=(S-P)/u,Se=(-b-w)/r,_e=(-S-P)/u,me=b1(1,0,ie,ne);let se=b1(ie,ne,Se,_e);d===0&&se>0&&(se-=pd),d===1&&se<0&&(se+=pd),T.centerX=z,T.centerY=Z,T.ang1=me,T.ang2=se};function wD(n,e,t,a,r,u,h,d=0,m=0,y=0){if(u===0||h===0)return;const b=Math.sin(d*pd/360),S=Math.cos(d*pd/360),T=S*(e-a)/2+b*(t-r)/2,E=-b*(e-a)/2+S*(t-r)/2;if(T===0&&E===0)return;u=Math.abs(u),h=Math.abs(h);const A=Math.pow(T,2)/Math.pow(u,2)+Math.pow(E,2)/Math.pow(h,2);A>1&&(u*=Math.sqrt(A),h*=Math.sqrt(A)),GD(e,t,a,r,u,h,m,y,b,S,T,E,Mv);let{ang1:B,ang2:M}=Mv;const{centerX:G,centerY:w}=Mv;let P=Math.abs(M)/(pd/4);Math.abs(1-P)<1e-7&&(P=1);const z=Math.max(Math.ceil(P),1);M/=z;let Z=n[n.length-2],ie=n[n.length-1];const ne={x:0,y:0};for(let Se=0;Se<z;Se++){const _e=ND(B,M),{x:me,y:se}=Dv(_e[0],u,h,S,b,G,w,ne),{x:Le,y:ae}=Dv(_e[1],u,h,S,b,G,w,ne),{x:We,y:St}=Dv(_e[2],u,h,S,b,G,w,ne);_1(n,Z,ie,me,se,Le,ae,We,St),Z=We,ie=St,B+=M}}function PD(n,e,t){const a=(h,d)=>{const m=d.x-h.x,y=d.y-h.y,b=Math.sqrt(m*m+y*y),S=m/b,T=y/b;return{len:b,nx:S,ny:T}},r=(h,d)=>{h===0?n.moveTo(d.x,d.y):n.lineTo(d.x,d.y)};let u=e[e.length-1];for(let h=0;h<e.length;h++){const d=e[h%e.length],m=d.radius??t;if(m<=0){r(h,d),u=d;continue}const y=e[(h+1)%e.length],b=a(d,u),S=a(d,y);if(b.len<1e-4||S.len<1e-4){r(h,d),u=d;continue}let T=Math.asin(b.nx*S.ny-b.ny*S.nx),E=1,A=!1;b.nx*S.nx-b.ny*-S.ny<0?T<0?T=Math.PI+T:(T=Math.PI-T,E=-1,A=!0):T>0&&(E=-1,A=!0);const B=T/2;let M,G=Math.abs(Math.cos(B)*m/Math.sin(B));G>Math.min(b.len/2,S.len/2)?(G=Math.min(b.len/2,S.len/2),M=Math.abs(G*Math.sin(B)/Math.cos(B))):M=m;const w=d.x+S.nx*G+-S.ny*M*E,P=d.y+S.ny*G+S.nx*M*E,z=Math.atan2(b.ny,b.nx)+Math.PI/2*E,Z=Math.atan2(S.ny,S.nx)-Math.PI/2*E;h===0&&n.moveTo(w+Math.cos(z)*M,P+Math.sin(z)*M),n.arc(w,P,M,z,Z,A),u=d}}function zD(n,e,t,a){const r=(d,m)=>Math.sqrt((d.x-m.x)**2+(d.y-m.y)**2),u=(d,m,y)=>({x:d.x+(m.x-d.x)*y,y:d.y+(m.y-d.y)*y}),h=e.length;for(let d=0;d<h;d++){const m=e[(d+1)%h],y=m.radius??t;if(y<=0){d===0?n.moveTo(m.x,m.y):n.lineTo(m.x,m.y);continue}const b=e[d],S=e[(d+2)%h],T=r(b,m);let E;if(T<1e-4)E=m;else{const M=Math.min(T/2,y);E=u(m,b,M/T)}const A=r(S,m);let B;if(A<1e-4)B=m;else{const M=Math.min(A/2,y);B=u(m,S,M/A)}d===0?n.moveTo(E.x,E.y):n.lineTo(E.x,E.y),n.quadraticCurveTo(m.x,m.y,B.x,B.y,a)}}const HD=new Nt;class VD{constructor(e){this.shapePrimitives=[],this._currentPoly=null,this._bounds=new ci,this._graphicsPath2D=e,this.signed=e.checkForHoles}moveTo(e,t){return this.startPoly(e,t),this}lineTo(e,t){this._ensurePoly();const a=this._currentPoly.points,r=a[a.length-2],u=a[a.length-1];return(r!==e||u!==t)&&a.push(e,t),this}arc(e,t,a,r,u,h){this._ensurePoly(!1);const d=this._currentPoly.points;return v1(d,e,t,a,r,u,h),this}arcTo(e,t,a,r,u){this._ensurePoly();const h=this._currentPoly.points;return OD(h,e,t,a,r,u),this}arcToSvg(e,t,a,r,u,h,d){const m=this._currentPoly.points;return wD(m,this._currentPoly.lastX,this._currentPoly.lastY,h,d,e,t,a,r,u),this}bezierCurveTo(e,t,a,r,u,h,d){this._ensurePoly();const m=this._currentPoly;return _1(this._currentPoly.points,m.lastX,m.lastY,e,t,a,r,u,h,d),this}quadraticCurveTo(e,t,a,r,u){this._ensurePoly();const h=this._currentPoly;return UD(this._currentPoly.points,h.lastX,h.lastY,e,t,a,r,u),this}closePath(){return this.endPoly(!0),this}addPath(e,t){this.endPoly(),t&&!t.isIdentity()&&(e=e.clone(!0),e.transform(t));const a=this.shapePrimitives,r=a.length;for(let u=0;u<e.instructions.length;u++){const h=e.instructions[u];this[h.action](...h.data)}if(e.checkForHoles&&a.length-r>1){let u=null;for(let h=r;h<a.length;h++){const d=a[h];if(d.shape.type==="polygon"){const m=d.shape,y=u==null?void 0:u.shape;y&&y.containsPolygon(m)?(u.holes||(u.holes=[]),u.holes.push(d),a.copyWithin(h,h+1),a.length--,h--):u=d}}}return this}finish(e=!1){this.endPoly(e)}rect(e,t,a,r,u){return this.drawShape(new Nt(e,t,a,r),u),this}circle(e,t,a,r){return this.drawShape(new lv(e,t,a),r),this}poly(e,t,a){const r=new sd(e);return r.closePath=t,this.drawShape(r,a),this}regularPoly(e,t,a,r,u=0,h){r=Math.max(r|0,3);const d=-1*Math.PI/2+u,m=Math.PI*2/r,y=[];for(let b=0;b<r;b++){const S=d-b*m;y.push(e+a*Math.cos(S),t+a*Math.sin(S))}return this.poly(y,!0,h),this}roundPoly(e,t,a,r,u,h=0,d){if(r=Math.max(r|0,3),u<=0)return this.regularPoly(e,t,a,r,h);const m=a*Math.sin(Math.PI/r)-.001;u=Math.min(u,m);const y=-1*Math.PI/2+h,b=Math.PI*2/r,S=(r-2)*Math.PI/r/2;for(let T=0;T<r;T++){const E=T*b+y,A=e+a*Math.cos(E),B=t+a*Math.sin(E),M=E+Math.PI+S,G=E-Math.PI-S,w=A+u*Math.cos(M),P=B+u*Math.sin(M),z=A+u*Math.cos(G),Z=B+u*Math.sin(G);T===0?this.moveTo(w,P):this.lineTo(w,P),this.quadraticCurveTo(A,B,z,Z,d)}return this.closePath()}roundShape(e,t,a=!1,r){return e.length<3?this:(a?zD(this,e,t,r):PD(this,e,t),this.closePath())}filletRect(e,t,a,r,u){if(u===0)return this.rect(e,t,a,r);const h=Math.min(a,r)/2,d=Math.min(h,Math.max(-h,u)),m=e+a,y=t+r,b=d<0?-d:0,S=Math.abs(d);return this.moveTo(e,t+S).arcTo(e+b,t+b,e+S,t,S).lineTo(m-S,t).arcTo(m-b,t+b,m,t+S,S).lineTo(m,y-S).arcTo(m-b,y-b,e+a-S,y,S).lineTo(e+S,y).arcTo(e+b,y-b,e,y-S,S).closePath()}chamferRect(e,t,a,r,u,h){if(u<=0)return this.rect(e,t,a,r);const d=Math.min(u,Math.min(a,r)/2),m=e+a,y=t+r,b=[e+d,t,m-d,t,m,t+d,m,y-d,m-d,y,e+d,y,e,y-d,e,t+d];for(let S=b.length-1;S>=2;S-=2)b[S]===b[S-2]&&b[S-1]===b[S-3]&&b.splice(S-1,2);return this.poly(b,!0,h)}ellipse(e,t,a,r,u){return this.drawShape(new ov(e,t,a,r),u),this}roundRect(e,t,a,r,u,h){return this.drawShape(new uv(e,t,a,r,u),h),this}drawShape(e,t){return this.endPoly(),this.shapePrimitives.push({shape:e,transform:t}),this}startPoly(e,t){let a=this._currentPoly;return a&&this.endPoly(),a=new sd,a.points.push(e,t),this._currentPoly=a,this}endPoly(e=!1){const t=this._currentPoly;return t&&t.points.length>2&&(t.closePath=e,this.shapePrimitives.push({shape:t})),this._currentPoly=null,this}_ensurePoly(e=!0){if(!this._currentPoly&&(this._currentPoly=new sd,e)){const t=this.shapePrimitives[this.shapePrimitives.length-1];if(t){let a=t.shape.x,r=t.shape.y;if(t.transform&&!t.transform.isIdentity()){const u=t.transform,h=a;a=u.a*a+u.c*r+u.tx,r=u.b*h+u.d*r+u.ty}this._currentPoly.points.push(a,r)}else this._currentPoly.points.push(0,0)}}buildPath(){const e=this._graphicsPath2D;this.shapePrimitives.length=0,this._currentPoly=null;for(let t=0;t<e.instructions.length;t++){const a=e.instructions[t];this[a.action](...a.data)}this.finish()}get bounds(){const e=this._bounds;e.clear();const t=this.shapePrimitives;for(let a=0;a<t.length;a++){const r=t[a],u=r.shape.getBounds(HD);r.transform?e.addRect(u,r.transform):e.addRect(u)}return e}}class Dc{constructor(e,t=!1){this.instructions=[],this.uid=Kt("graphicsPath"),this._dirty=!0,this.checkForHoles=t,typeof e=="string"?x3(e,this):this.instructions=(e==null?void 0:e.slice())??[]}get shapePath(){return this._shapePath||(this._shapePath=new VD(this)),this._dirty&&(this._dirty=!1,this._shapePath.buildPath()),this._shapePath}addPath(e,t){return e=e.clone(),this.instructions.push({action:"addPath",data:[e,t]}),this._dirty=!0,this}arc(...e){return this.instructions.push({action:"arc",data:e}),this._dirty=!0,this}arcTo(...e){return this.instructions.push({action:"arcTo",data:e}),this._dirty=!0,this}arcToSvg(...e){return this.instructions.push({action:"arcToSvg",data:e}),this._dirty=!0,this}bezierCurveTo(...e){return this.instructions.push({action:"bezierCurveTo",data:e}),this._dirty=!0,this}bezierCurveToShort(e,t,a,r,u){const h=this.instructions[this.instructions.length-1],d=this.getLastPoint(qt.shared);let m=0,y=0;if(!h||h.action!=="bezierCurveTo")m=d.x,y=d.y;else{m=h.data[2],y=h.data[3];const b=d.x,S=d.y;m=b+(b-m),y=S+(S-y)}return this.instructions.push({action:"bezierCurveTo",data:[m,y,e,t,a,r,u]}),this._dirty=!0,this}closePath(){return this.instructions.push({action:"closePath",data:[]}),this._dirty=!0,this}ellipse(...e){return this.instructions.push({action:"ellipse",data:e}),this._dirty=!0,this}lineTo(...e){return this.instructions.push({action:"lineTo",data:e}),this._dirty=!0,this}moveTo(...e){return this.instructions.push({action:"moveTo",data:e}),this}quadraticCurveTo(...e){return this.instructions.push({action:"quadraticCurveTo",data:e}),this._dirty=!0,this}quadraticCurveToShort(e,t,a){const r=this.instructions[this.instructions.length-1],u=this.getLastPoint(qt.shared);let h=0,d=0;if(!r||r.action!=="quadraticCurveTo")h=u.x,d=u.y;else{h=r.data[0],d=r.data[1];const m=u.x,y=u.y;h=m+(m-h),d=y+(y-d)}return this.instructions.push({action:"quadraticCurveTo",data:[h,d,e,t,a]}),this._dirty=!0,this}rect(e,t,a,r,u){return this.instructions.push({action:"rect",data:[e,t,a,r,u]}),this._dirty=!0,this}circle(e,t,a,r){return this.instructions.push({action:"circle",data:[e,t,a,r]}),this._dirty=!0,this}roundRect(...e){return this.instructions.push({action:"roundRect",data:e}),this._dirty=!0,this}poly(...e){return this.instructions.push({action:"poly",data:e}),this._dirty=!0,this}regularPoly(...e){return this.instructions.push({action:"regularPoly",data:e}),this._dirty=!0,this}roundPoly(...e){return this.instructions.push({action:"roundPoly",data:e}),this._dirty=!0,this}roundShape(...e){return this.instructions.push({action:"roundShape",data:e}),this._dirty=!0,this}filletRect(...e){return this.instructions.push({action:"filletRect",data:e}),this._dirty=!0,this}chamferRect(...e){return this.instructions.push({action:"chamferRect",data:e}),this._dirty=!0,this}star(e,t,a,r,u,h,d){u||(u=r/2);const m=-1*Math.PI/2+h,y=a*2,b=Math.PI*2/y,S=[];for(let T=0;T<y;T++){const E=T%2?u:r,A=T*b+m;S.push(e+E*Math.cos(A),t+E*Math.sin(A))}return this.poly(S,!0,d),this}clone(e=!1){const t=new Dc;if(t.checkForHoles=this.checkForHoles,!e)t.instructions=this.instructions.slice();else for(let a=0;a<this.instructions.length;a++){const r=this.instructions[a];t.instructions.push({action:r.action,data:r.data.slice()})}return t}clear(){return this.instructions.length=0,this._dirty=!0,this}transform(e){if(e.isIdentity())return this;const t=e.a,a=e.b,r=e.c,u=e.d,h=e.tx,d=e.ty;let m=0,y=0,b=0,S=0,T=0,E=0,A=0,B=0;for(let M=0;M<this.instructions.length;M++){const G=this.instructions[M],w=G.data;switch(G.action){case"moveTo":case"lineTo":m=w[0],y=w[1],w[0]=t*m+r*y+h,w[1]=a*m+u*y+d;break;case"bezierCurveTo":b=w[0],S=w[1],T=w[2],E=w[3],m=w[4],y=w[5],w[0]=t*b+r*S+h,w[1]=a*b+u*S+d,w[2]=t*T+r*E+h,w[3]=a*T+u*E+d,w[4]=t*m+r*y+h,w[5]=a*m+u*y+d;break;case"quadraticCurveTo":b=w[0],S=w[1],m=w[2],y=w[3],w[0]=t*b+r*S+h,w[1]=a*b+u*S+d,w[2]=t*m+r*y+h,w[3]=a*m+u*y+d;break;case"arcToSvg":m=w[5],y=w[6],A=w[0],B=w[1],w[0]=t*A+r*B,w[1]=a*A+u*B,w[5]=t*m+r*y+h,w[6]=a*m+u*y+d;break;case"circle":w[4]=md(w[3],e);break;case"rect":w[4]=md(w[4],e);break;case"ellipse":w[8]=md(w[8],e);break;case"roundRect":w[5]=md(w[5],e);break;case"addPath":w[0].transform(e);break;case"poly":w[2]=md(w[2],e);break;default:rt("unknown transform action",G.action);break}}return this._dirty=!0,this}get bounds(){return this.shapePath.bounds}getLastPoint(e){let t=this.instructions.length-1,a=this.instructions[t];if(!a)return e.x=0,e.y=0,e;for(;a.action==="closePath";){if(t--,t<0)return e.x=0,e.y=0,e;a=this.instructions[t]}switch(a.action){case"moveTo":case"lineTo":e.x=a.data[0],e.y=a.data[1];break;case"quadraticCurveTo":e.x=a.data[2],e.y=a.data[3];break;case"bezierCurveTo":e.x=a.data[4],e.y=a.data[5];break;case"arc":case"arcToSvg":e.x=a.data[5],e.y=a.data[6];break;case"addPath":a.data[0].getLastPoint(e);break}return e}}function md(n,e){return n?n.prepend(e):e.clone()}function un(n,e,t){const a=n.getAttribute(e);return a?Number(a):t}function LD(n,e){const t=n.querySelectorAll("defs");for(let a=0;a<t.length;a++){const r=t[a];for(let u=0;u<r.children.length;u++){const h=r.children[u];switch(h.nodeName.toLowerCase()){case"lineargradient":e.defs[h.id]=jD(h);break;case"radialgradient":e.defs[h.id]=YD();break}}}}function jD(n){const e=un(n,"x1",0),t=un(n,"y1",0),a=un(n,"x2",1),r=un(n,"y2",0),u=n.getAttribute("gradientUnits")||"objectBoundingBox",h=new tl(e,t,a,r,u==="objectBoundingBox"?"local":"global");for(let d=0;d<n.children.length;d++){const m=n.children[d],y=un(m,"offset",0),b=Ft.shared.setValue(m.getAttribute("stop-color")).toNumber();h.addColorStop(y,b)}return h}function YD(n){return rt("[SVG Parser] Radial gradients are not yet supported"),new tl(0,0,1,0)}function x1(n){const e=n.match(/url\s*\(\s*['"]?\s*#([^'"\s)]+)\s*['"]?\s*\)/i);return e?e[1]:""}const S1={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 T1(n,e){const t=n.getAttribute("style"),a={},r={},u={strokeStyle:a,fillStyle:r,useFill:!1,useStroke:!1};for(const h in S1){const d=n.getAttribute(h);d&&E1(e,u,h,d.trim())}if(t){const h=t.split(";");for(let d=0;d<h.length;d++){const m=h[d].trim(),[y,b]=m.split(":");S1[y]&&E1(e,u,y,b.trim())}}return{strokeStyle:u.useStroke?a:null,fillStyle:u.useFill?r:null,useFill:u.useFill,useStroke:u.useStroke}}function E1(n,e,t,a){switch(t){case"stroke":if(a!=="none"){if(a.startsWith("url(")){const r=x1(a);e.strokeStyle.fill=n.defs[r]}else e.strokeStyle.color=Ft.shared.setValue(a).toNumber();e.useStroke=!0}break;case"stroke-width":e.strokeStyle.width=Number(a);break;case"fill":if(a!=="none"){if(a.startsWith("url(")){const r=x1(a);e.fillStyle.fill=n.defs[r]}else e.fillStyle.color=Ft.shared.setValue(a).toNumber();e.useFill=!0}break;case"fill-opacity":e.fillStyle.alpha=Number(a);break;case"stroke-opacity":e.strokeStyle.alpha=Number(a);break;case"opacity":e.fillStyle.alpha=Number(a),e.strokeStyle.alpha=Number(a);break}}function XD(n,e){if(typeof n=="string"){const h=document.createElement("div");h.innerHTML=n.trim(),n=h.querySelector("svg")}const t={context:e,defs:{},path:new Dc};LD(n,t);const a=n.children,{fillStyle:r,strokeStyle:u}=T1(n,t);for(let h=0;h<a.length;h++){const d=a[h];d.nodeName.toLowerCase()!=="defs"&&C1(d,t,r,u)}return e}function C1(n,e,t,a){const r=n.children,{fillStyle:u,strokeStyle:h}=T1(n,e);u&&t?t={...t,...u}:u&&(t=u),h&&a?a={...a,...h}:h&&(a=h);const d=!t&&!a;d&&(t={color:0});let m,y,b,S,T,E,A,B,M,G,w,P,z,Z,ie,ne,Se;switch(n.nodeName.toLowerCase()){case"path":Z=n.getAttribute("d"),n.getAttribute("fill-rule")==="evenodd"&&rt("SVG Evenodd fill rule not supported, your svg may render incorrectly"),ie=new Dc(Z,!0),e.context.path(ie),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"circle":A=un(n,"cx",0),B=un(n,"cy",0),M=un(n,"r",0),e.context.ellipse(A,B,M,M),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"rect":m=un(n,"x",0),y=un(n,"y",0),ne=un(n,"width",0),Se=un(n,"height",0),G=un(n,"rx",0),w=un(n,"ry",0),G||w?e.context.roundRect(m,y,ne,Se,G||w):e.context.rect(m,y,ne,Se),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"ellipse":A=un(n,"cx",0),B=un(n,"cy",0),G=un(n,"rx",0),w=un(n,"ry",0),e.context.beginPath(),e.context.ellipse(A,B,G,w),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"line":b=un(n,"x1",0),S=un(n,"y1",0),T=un(n,"x2",0),E=un(n,"y2",0),e.context.beginPath(),e.context.moveTo(b,S),e.context.lineTo(T,E),a&&e.context.stroke(a);break;case"polygon":z=n.getAttribute("points"),P=z.match(/\d+/g).map(_e=>parseInt(_e,10)),e.context.poly(P,!0),t&&e.context.fill(t),a&&e.context.stroke(a);break;case"polyline":z=n.getAttribute("points"),P=z.match(/\d+/g).map(_e=>parseInt(_e,10)),e.context.poly(P,!1),a&&e.context.stroke(a);break;case"g":case"svg":break;default:{rt(`[SVG parser] <${n.nodeName}> elements unsupported`);break}}d&&(t=null);for(let _e=0;_e<r.length;_e++)C1(r[_e],e,t,a)}function qD(n){return Ft.isColorLike(n)}function R1(n){return n instanceof cy}function A1(n){return n instanceof tl}function FD(n){return n instanceof Ge}function ID(n,e,t){const a=Ft.shared.setValue(e??0);return n.color=a.toNumber(),n.alpha=a.alpha===1?t.alpha:a.alpha,n.texture=Ge.WHITE,{...t,...n}}function kD(n,e,t){return n.texture=e,{...t,...n}}function M1(n,e,t){return n.fill=e,n.color=16777215,n.texture=e.texture,n.matrix=e.transform,{...t,...n}}function D1(n,e,t){return e.buildGradient(),n.fill=e,n.color=16777215,n.texture=e.texture,n.matrix=e.transform,n.textureSpace=e.textureSpace,{...t,...n}}function KD(n,e){const t={...e,...n},a=Ft.shared.setValue(t.color);return t.alpha*=a.alpha,t.color=a.toNumber(),t}function ou(n,e){if(n==null)return null;const t={},a=n;return qD(n)?ID(t,n,e):FD(n)?kD(t,n,e):R1(n)?M1(t,n,e):A1(n)?D1(t,n,e):a.fill&&R1(a.fill)?M1(a,a.fill,e):a.fill&&A1(a.fill)?D1(a,a.fill,e):KD(a,e)}function py(n,e){const{width:t,alignment:a,miterLimit:r,cap:u,join:h,pixelLine:d,...m}=e,y=ou(n,m);return y?{width:t,alignment:a,miterLimit:r,cap:u,join:h,pixelLine:d,...y}:null}const QD=new qt,U1=new Pe,Uv=class Qr extends Sa{constructor(){super(...arguments),this.uid=Kt("graphicsContext"),this.dirty=!0,this.batchMode="auto",this.instructions=[],this._activePath=new Dc,this._transform=new Pe,this._fillStyle={...Qr.defaultFillStyle},this._strokeStyle={...Qr.defaultStrokeStyle},this._stateStack=[],this._tick=0,this._bounds=new ci,this._boundsDirty=!0}clone(){const e=new Qr;return e.batchMode=this.batchMode,e.instructions=this.instructions.slice(),e._activePath=this._activePath.clone(),e._transform=this._transform.clone(),e._fillStyle={...this._fillStyle},e._strokeStyle={...this._strokeStyle},e._stateStack=this._stateStack.slice(),e._bounds=this._bounds.clone(),e._boundsDirty=!0,e}get fillStyle(){return this._fillStyle}set fillStyle(e){this._fillStyle=ou(e,Qr.defaultFillStyle)}get strokeStyle(){return this._strokeStyle}set strokeStyle(e){this._strokeStyle=py(e,Qr.defaultStrokeStyle)}setFillStyle(e){return this._fillStyle=ou(e,Qr.defaultFillStyle),this}setStrokeStyle(e){return this._strokeStyle=ou(e,Qr.defaultStrokeStyle),this}texture(e,t,a,r,u,h){return this.instructions.push({action:"texture",data:{image:e,dx:a||0,dy:r||0,dw:u||e.frame.width,dh:h||e.frame.height,transform:this._transform.clone(),alpha:this._fillStyle.alpha,style:t?Ft.shared.setValue(t).toNumber():16777215}}),this.onUpdate(),this}beginPath(){return this._activePath=new Dc,this}fill(e,t){let a;const r=this.instructions[this.instructions.length-1];return this._tick===0&&r&&r.action==="stroke"?a=r.data.path:a=this._activePath.clone(),a?(e!=null&&(t!==void 0&&typeof e=="number"&&(st(Rt,"GraphicsContext.fill(color, alpha) is deprecated, use GraphicsContext.fill({ color, alpha }) instead"),e={color:e,alpha:t}),this._fillStyle=ou(e,Qr.defaultFillStyle)),this.instructions.push({action:"fill",data:{style:this.fillStyle,path:a}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}_initNextPathLocation(){const{x:e,y:t}=this._activePath.getLastPoint(qt.shared);this._activePath.clear(),this._activePath.moveTo(e,t)}stroke(e){let t;const a=this.instructions[this.instructions.length-1];return this._tick===0&&a&&a.action==="fill"?t=a.data.path:t=this._activePath.clone(),t?(e!=null&&(this._strokeStyle=py(e,Qr.defaultStrokeStyle)),this.instructions.push({action:"stroke",data:{style:this.strokeStyle,path:t}}),this.onUpdate(),this._initNextPathLocation(),this._tick=0,this):this}cut(){for(let e=0;e<2;e++){const t=this.instructions[this.instructions.length-1-e],a=this._activePath.clone();if(t&&(t.action==="stroke"||t.action==="fill"))if(t.data.hole)t.data.hole.addPath(a);else{t.data.hole=a;break}}return this._initNextPathLocation(),this}arc(e,t,a,r,u,h){this._tick++;const d=this._transform;return this._activePath.arc(d.a*e+d.c*t+d.tx,d.b*e+d.d*t+d.ty,a,r,u,h),this}arcTo(e,t,a,r,u){this._tick++;const h=this._transform;return this._activePath.arcTo(h.a*e+h.c*t+h.tx,h.b*e+h.d*t+h.ty,h.a*a+h.c*r+h.tx,h.b*a+h.d*r+h.ty,u),this}arcToSvg(e,t,a,r,u,h,d){this._tick++;const m=this._transform;return this._activePath.arcToSvg(e,t,a,r,u,m.a*h+m.c*d+m.tx,m.b*h+m.d*d+m.ty),this}bezierCurveTo(e,t,a,r,u,h,d){this._tick++;const m=this._transform;return this._activePath.bezierCurveTo(m.a*e+m.c*t+m.tx,m.b*e+m.d*t+m.ty,m.a*a+m.c*r+m.tx,m.b*a+m.d*r+m.ty,m.a*u+m.c*h+m.tx,m.b*u+m.d*h+m.ty,d),this}closePath(){var e;return this._tick++,(e=this._activePath)==null||e.closePath(),this}ellipse(e,t,a,r){return this._tick++,this._activePath.ellipse(e,t,a,r,this._transform.clone()),this}circle(e,t,a){return this._tick++,this._activePath.circle(e,t,a,this._transform.clone()),this}path(e){return this._tick++,this._activePath.addPath(e,this._transform.clone()),this}lineTo(e,t){this._tick++;const a=this._transform;return this._activePath.lineTo(a.a*e+a.c*t+a.tx,a.b*e+a.d*t+a.ty),this}moveTo(e,t){this._tick++;const a=this._transform,r=this._activePath.instructions,u=a.a*e+a.c*t+a.tx,h=a.b*e+a.d*t+a.ty;return r.length===1&&r[0].action==="moveTo"?(r[0].data[0]=u,r[0].data[1]=h,this):(this._activePath.moveTo(u,h),this)}quadraticCurveTo(e,t,a,r,u){this._tick++;const h=this._transform;return this._activePath.quadraticCurveTo(h.a*e+h.c*t+h.tx,h.b*e+h.d*t+h.ty,h.a*a+h.c*r+h.tx,h.b*a+h.d*r+h.ty,u),this}rect(e,t,a,r){return this._tick++,this._activePath.rect(e,t,a,r,this._transform.clone()),this}roundRect(e,t,a,r,u){return this._tick++,this._activePath.roundRect(e,t,a,r,u,this._transform.clone()),this}poly(e,t){return this._tick++,this._activePath.poly(e,t,this._transform.clone()),this}regularPoly(e,t,a,r,u=0,h){return this._tick++,this._activePath.regularPoly(e,t,a,r,u,h),this}roundPoly(e,t,a,r,u,h){return this._tick++,this._activePath.roundPoly(e,t,a,r,u,h),this}roundShape(e,t,a,r){return this._tick++,this._activePath.roundShape(e,t,a,r),this}filletRect(e,t,a,r,u){return this._tick++,this._activePath.filletRect(e,t,a,r,u),this}chamferRect(e,t,a,r,u,h){return this._tick++,this._activePath.chamferRect(e,t,a,r,u,h),this}star(e,t,a,r,u=0,h=0){return this._tick++,this._activePath.star(e,t,a,r,u,h,this._transform.clone()),this}svg(e){return this._tick++,XD(e,this),this}restore(){const e=this._stateStack.pop();return e&&(this._transform=e.transform,this._fillStyle=e.fillStyle,this._strokeStyle=e.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(e){return this._transform.rotate(e),this}scale(e,t=e){return this._transform.scale(e,t),this}setTransform(e,t,a,r,u,h){return e instanceof Pe?(this._transform.set(e.a,e.b,e.c,e.d,e.tx,e.ty),this):(this._transform.set(e,t,a,r,u,h),this)}transform(e,t,a,r,u,h){return e instanceof Pe?(this._transform.append(e),this):(U1.set(e,t,a,r,u,h),this._transform.append(U1),this)}translate(e,t=e){return this._transform.translate(e,t),this}clear(){return this._activePath.clear(),this.instructions.length=0,this.resetTransform(),this.onUpdate(),this}onUpdate(){this.dirty||(this.emit("update",this,16),this.dirty=!0,this._boundsDirty=!0)}get bounds(){if(!this._boundsDirty)return this._bounds;const e=this._bounds;e.clear();for(let t=0;t<this.instructions.length;t++){const a=this.instructions[t],r=a.action;if(r==="fill"){const u=a.data;e.addBounds(u.path.bounds)}else if(r==="texture"){const u=a.data;e.addFrame(u.dx,u.dy,u.dx+u.dw,u.dy+u.dh,u.transform)}if(r==="stroke"){const u=a.data,h=u.style.alignment,d=u.style.width*(1-h),m=u.path.bounds;e.addFrame(m.minX-d,m.minY-d,m.maxX+d,m.maxY+d)}}return e}containsPoint(e){var r;if(!this.bounds.containsPoint(e.x,e.y))return!1;const t=this.instructions;let a=!1;for(let u=0;u<t.length;u++){const h=t[u],d=h.data,m=d.path;if(!h.action||!m)continue;const y=d.style,b=m.shapePath.shapePrimitives;for(let S=0;S<b.length;S++){const T=b[S].shape;if(!y||!T)continue;const E=b[S].transform,A=E?E.applyInverse(e,QD):e;if(h.action==="fill")a=T.contains(A.x,A.y);else{const M=y;a=T.strokeContains(A.x,A.y,M.width,M.alignment)}const B=d.hole;if(B){const M=(r=B.shapePath)==null?void 0:r.shapePrimitives;if(M)for(let G=0;G<M.length;G++)M[G].shape.contains(A.x,A.y)&&(a=!1)}if(a)return!0}}return a}destroy(e=!1){if(this._stateStack.length=0,this._transform=null,this.emit("destroy",this),this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const a=typeof e=="boolean"?e:e==null?void 0:e.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}};Uv.defaultFillStyle={color:16777215,alpha:1,texture:Ge.WHITE,matrix:null,fill:null,textureSpace:"local"},Uv.defaultStrokeStyle={width:1,color:16777215,alpha:1,alignment:.5,miterLimit:10,cap:"butt",join:"miter",texture:Ge.WHITE,matrix:null,fill:null,textureSpace:"local",pixelLine:!1};let Bs=Uv;const B1=["align","breakWords","cssOverrides","fontVariant","fontWeight","leading","letterSpacing","lineHeight","padding","textBaseline","trim","whiteSpace","wordWrap","wordWrapWidth","fontFamily","fontStyle","fontSize"];function ZD(n){const e=[];let t=0;for(let a=0;a<B1.length;a++){const r=`_${B1[a]}`;e[t++]=n[r]}return t=O1(n._fill,e,t),t=JD(n._stroke,e,t),t=$D(n.dropShadow,e,t),t=WD(n.filters,e,t),e.join("-")}function WD(n,e,t){if(!n)return t;for(const a of n)e[t++]=a.uid;return t}function O1(n,e,t){var a;return n&&(e[t++]=n.color,e[t++]=n.alpha,e[t++]=(a=n.fill)==null?void 0:a.styleKey),t}function JD(n,e,t){return n&&(t=O1(n,e,t),e[t++]=n.width,e[t++]=n.alignment,e[t++]=n.cap,e[t++]=n.join,e[t++]=n.miterLimit),t}function $D(n,e,t){return n&&(e[t++]=n.alpha,e[t++]=n.angle,e[t++]=n.blur,e[t++]=n.distance,e[t++]=Ft.shared.setValue(n.color).toNumber()),t}const Bv=class Yf extends Sa{constructor(e={}){super(),eU(e);const t={...Yf.defaultTextStyle,...e};for(const a in t){const r=a;this[r]=t[a]}this.update()}get align(){return this._align}set align(e){this._align=e,this.update()}get breakWords(){return this._breakWords}set breakWords(e){this._breakWords=e,this.update()}get dropShadow(){return this._dropShadow}set dropShadow(e){e!==null&&typeof e=="object"?this._dropShadow=this._createProxy({...Yf.defaultDropShadow,...e}):this._dropShadow=e?this._createProxy({...Yf.defaultDropShadow}):null,this.update()}get fontFamily(){return this._fontFamily}set fontFamily(e){this._fontFamily=e,this.update()}get fontSize(){return this._fontSize}set fontSize(e){typeof e=="string"?this._fontSize=parseInt(e,10):this._fontSize=e,this.update()}get fontStyle(){return this._fontStyle}set fontStyle(e){this._fontStyle=e.toLowerCase(),this.update()}get fontVariant(){return this._fontVariant}set fontVariant(e){this._fontVariant=e,this.update()}get fontWeight(){return this._fontWeight}set fontWeight(e){this._fontWeight=e,this.update()}get leading(){return this._leading}set leading(e){this._leading=e,this.update()}get letterSpacing(){return this._letterSpacing}set letterSpacing(e){this._letterSpacing=e,this.update()}get lineHeight(){return this._lineHeight}set lineHeight(e){this._lineHeight=e,this.update()}get padding(){return this._padding}set padding(e){this._padding=e,this.update()}get filters(){return this._filters}set filters(e){this._filters=e,this.update()}get trim(){return this._trim}set trim(e){this._trim=e,this.update()}get textBaseline(){return this._textBaseline}set textBaseline(e){this._textBaseline=e,this.update()}get whiteSpace(){return this._whiteSpace}set whiteSpace(e){this._whiteSpace=e,this.update()}get wordWrap(){return this._wordWrap}set wordWrap(e){this._wordWrap=e,this.update()}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(e){this._wordWrapWidth=e,this.update()}get fill(){return this._originalFill}set fill(e){e!==this._originalFill&&(this._originalFill=e,this._isFillStyle(e)&&(this._originalFill=this._createProxy({...Bs.defaultFillStyle,...e},()=>{this._fill=ou({...this._originalFill},Bs.defaultFillStyle)})),this._fill=ou(e===0?"black":e,Bs.defaultFillStyle),this.update())}get stroke(){return this._originalStroke}set stroke(e){e!==this._originalStroke&&(this._originalStroke=e,this._isFillStyle(e)&&(this._originalStroke=this._createProxy({...Bs.defaultStrokeStyle,...e},()=>{this._stroke=py({...this._originalStroke},Bs.defaultStrokeStyle)})),this._stroke=py(e,Bs.defaultStrokeStyle),this.update())}_generateKey(){return this._styleKey=ZD(this),this._styleKey}update(){this._styleKey=null,this.emit("update",this)}reset(){const e=Yf.defaultTextStyle;for(const t in e)this[t]=e[t]}get styleKey(){return this._styleKey||this._generateKey()}clone(){return new Yf({align:this.align,breakWords:this.breakWords,dropShadow:this._dropShadow?{...this._dropShadow}:null,fill:this._fill,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,textBaseline:this.textBaseline,whiteSpace:this.whiteSpace,wordWrap:this.wordWrap,wordWrapWidth:this.wordWrapWidth,filters:this._filters?[...this._filters]:void 0})}_getFinalPadding(){let e=0;if(this._filters)for(let t=0;t<this._filters.length;t++)e+=this._filters[t].padding;return Math.max(this._padding,e)}destroy(e=!1){var a,r,u,h;if(this.removeAllListeners(),typeof e=="boolean"?e:e==null?void 0:e.texture){const d=typeof e=="boolean"?e:e==null?void 0:e.textureSource;(a=this._fill)!=null&&a.texture&&this._fill.texture.destroy(d),(r=this._originalFill)!=null&&r.texture&&this._originalFill.texture.destroy(d),(u=this._stroke)!=null&&u.texture&&this._stroke.texture.destroy(d),(h=this._originalStroke)!=null&&h.texture&&this._originalStroke.texture.destroy(d)}this._fill=null,this._stroke=null,this.dropShadow=null,this._originalStroke=null,this._originalFill=null}_createProxy(e,t){return new Proxy(e,{set:(a,r,u)=>(a[r]=u,t==null||t(r,u),this.update(),!0)})}_isFillStyle(e){return(e??null)!==null&&!(Ft.isColorLike(e)||e instanceof tl||e instanceof cy)}};Bv.defaultDropShadow={alpha:1,angle:Math.PI/6,blur:0,color:"black",distance:5},Bv.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 nl=Bv;function eU(n){const e=n;if(typeof e.dropShadow=="boolean"&&e.dropShadow){const t=nl.defaultDropShadow;n.dropShadow={alpha:e.dropShadowAlpha??t.alpha,angle:e.dropShadowAngle??t.angle,blur:e.dropShadowBlur??t.blur,color:e.dropShadowColor??t.color,distance:e.dropShadowDistance??t.distance}}if(e.strokeThickness!==void 0){st(Rt,"strokeThickness is now a part of stroke");const t=e.stroke;let a={};if(Ft.isColorLike(t))a.color=t;else if(t instanceof tl||t instanceof cy)a.fill=t;else if(Object.hasOwnProperty.call(t,"color")||Object.hasOwnProperty.call(t,"fill"))a=t;else throw new Error("Invalid stroke value.");n.stroke={...a,width:e.strokeThickness}}if(Array.isArray(e.fillGradientStops)){if(st(Rt,"gradient fill is now a fill pattern: `new FillGradient(...)`"),!Array.isArray(e.fill)||e.fill.length===0)throw new Error("Invalid fill value. Expected an array of colors for gradient fill.");e.fill.length!==e.fillGradientStops.length&&rt("The number of fill colors must match the number of fill gradient stops.");const t=new tl({start:{x:0,y:0},end:{x:0,y:1},textureSpace:"local"}),a=e.fillGradientStops.slice(),r=e.fill.map(u=>Ft.shared.setValue(u).toNumber());a.forEach((u,h)=>{t.addColorStop(u,r[h])}),n.fill={fill:t}}}class tU{constructor(e){this._canvasPool=Object.create(null),this.canvasOptions=e||{},this.enableFullScreen=!1}_createCanvasAndContext(e,t){const a=Gt.get().createCanvas();a.width=e,a.height=t;const r=a.getContext("2d");return{canvas:a,context:r}}getOptimalCanvasAndContext(e,t,a=1){e=Math.ceil(e*a-1e-6),t=Math.ceil(t*a-1e-6),e=vc(e),t=vc(t);const r=(e<<17)+(t<<1);this._canvasPool[r]||(this._canvasPool[r]=[]);let u=this._canvasPool[r].pop();return u||(u=this._createCanvasAndContext(e,t)),u}returnCanvasAndContext(e){const t=e.canvas,{width:a,height:r}=t,u=(a<<17)+(r<<1);e.context.resetTransform(),e.context.clearRect(0,0,a,r),this._canvasPool[u].push(e)}clear(){this._canvasPool={}}}const kl=new tU,N1=1e5;function my(n,e,t,a=0){if(n.texture===Ge.WHITE&&!n.fill)return Ft.shared.setValue(n.color).setAlpha(n.alpha??1).toHexa();if(n.fill){if(n.fill instanceof cy){const r=n.fill,u=e.createPattern(r.texture.source.resource,"repeat"),h=r.transform.copyTo(Pe.shared);return h.scale(r.texture.frame.width,r.texture.frame.height),u.setTransform(h),u}else if(n.fill instanceof tl){const r=n.fill,u=r.type==="linear",h=r.textureSpace==="local";let d=1,m=1;h&&t&&(d=t.width+a,m=t.height+a);let y,b=!1;if(u){const{start:S,end:T}=r;y=e.createLinearGradient(S.x*d,S.y*m,T.x*d,T.y*m),b=Math.abs(T.x-S.x)<Math.abs((T.y-S.y)*.1)}else{const{center:S,innerRadius:T,outerCenter:E,outerRadius:A}=r;y=e.createRadialGradient(S.x*d,S.y*m,T*d,E.x*d,E.y*m,A*d)}if(b&&h&&t){const S=t.lineHeight/m;for(let T=0;T<t.lines.length;T++){const E=(T*t.lineHeight+a/2)/m;r.colorStops.forEach(A=>{const B=E+A.offset*S;y.addColorStop(Math.floor(B*N1)/N1,Ft.shared.setValue(A.color).toHex())})}}else r.colorStops.forEach(S=>{y.addColorStop(S.offset,Ft.shared.setValue(S.color).toHex())});return y}}else{const r=e.createPattern(n.texture.source.resource,"repeat"),u=n.matrix.copyTo(Pe.shared);return u.scale(n.texture.frame.width,n.texture.frame.height),r.setTransform(u),r}return rt("FillStyle not recognised",n),"red"}const G1=class QR extends m3{constructor(e){super(),this.resolution=1,this.pages=[],this._padding=0,this._measureCache=Object.create(null),this._currentChars=[],this._currentX=0,this._currentY=0,this._currentMaxCharHeight=0,this._currentPageIndex=-1,this._skipKerning=!1;const t={...QR.defaultOptions,...e};this._textureSize=t.textureSize,this._mipmap=t.mipmap;const a=t.style.clone();t.overrideFill&&(a._fill.color=16777215,a._fill.alpha=1,a._fill.texture=Ge.WHITE,a._fill.fill=null),this.applyFillAsTint=t.overrideFill;const r=a.fontSize;a.fontSize=this.baseMeasurementFontSize;const u=uy(a);t.overrideSize?a._stroke&&(a._stroke.width*=this.baseRenderedFontSize/r):a.fontSize=this.baseRenderedFontSize=r,this._style=a,this._skipKerning=t.skipKerning??!1,this.resolution=t.resolution??1,this._padding=t.padding??4,t.textureStyle&&(this._textureStyle=t.textureStyle instanceof Xl?t.textureStyle:new Xl(t.textureStyle)),this.fontMetrics=dr.measureFont(u),this.lineHeight=a.lineHeight||this.fontMetrics.fontSize||a.fontSize}ensureCharacters(e){var M,G;const t=dr.graphemeSegmenter(e).filter(w=>!this._currentChars.includes(w)).filter((w,P,z)=>z.indexOf(w)===P);if(!t.length)return;this._currentChars=[...this._currentChars,...t];let a;this._currentPageIndex===-1?a=this._nextPage():a=this.pages[this._currentPageIndex];let{canvas:r,context:u}=a.canvasAndContext,h=a.texture.source;const d=this._style;let m=this._currentX,y=this._currentY,b=this._currentMaxCharHeight;const S=this.baseRenderedFontSize/this.baseMeasurementFontSize,T=this._padding*S;let E=!1;const A=r.width/this.resolution,B=r.height/this.resolution;for(let w=0;w<t.length;w++){const P=t[w],z=dr.measureText(P,d,r,!1);z.lineHeight=z.height;const Z=z.width*S,ie=Math.ceil((d.fontStyle==="italic"?2:1)*Z),ne=z.height*S,Se=ie+T*2,_e=ne+T*2;if(E=!1,P!==`
|
|
306
|
+
`&&P!=="\r"&&P!==" "&&P!==" "&&(E=!0,b=Math.ceil(Math.max(_e,b))),m+Se>A&&(y+=b,b=_e,m=0,y+b>B)){h.update();const se=this._nextPage();r=se.canvasAndContext.canvas,u=se.canvasAndContext.context,h=se.texture.source,m=0,y=0,b=0}const me=Z/S-(((M=d.dropShadow)==null?void 0:M.distance)??0)-(((G=d._stroke)==null?void 0:G.width)??0);if(this.chars[P]={id:P.codePointAt(0),xOffset:-this._padding,yOffset:-this._padding,xAdvance:me,kerning:{}},E){this._drawGlyph(u,z,m+T,y+T,S,d);const se=h.width*S,Le=h.height*S,ae=new Nt(m/se*h.width,y/Le*h.height,Se/se*h.width,_e/Le*h.height);this.chars[P].texture=new Ge({source:h,frame:ae}),m+=Math.ceil(Se)}}h.update(),this._currentX=m,this._currentY=y,this._currentMaxCharHeight=b,this._skipKerning&&this._applyKerning(t,u)}get pageTextures(){return st(Rt,"BitmapFont.pageTextures is deprecated, please use BitmapFont.pages instead."),this.pages}_applyKerning(e,t){const a=this._measureCache;for(let r=0;r<e.length;r++){const u=e[r];for(let h=0;h<this._currentChars.length;h++){const d=this._currentChars[h];let m=a[u];m||(m=a[u]=t.measureText(u).width);let y=a[d];y||(y=a[d]=t.measureText(d).width);let b=t.measureText(u+d).width,S=b-(m+y);S&&(this.chars[u].kerning[d]=S),b=t.measureText(u+d).width,S=b-(m+y),S&&(this.chars[d].kerning[u]=S)}}}_nextPage(){this._currentPageIndex++;const e=this.resolution,t=kl.getOptimalCanvasAndContext(this._textureSize,this._textureSize,e);this._setupContext(t.context,this._style,e);const a=e*(this.baseRenderedFontSize/this.baseMeasurementFontSize),r=new Ge({source:new Kf({resource:t.canvas,resolution:a,alphaMode:"premultiply-alpha-on-upload",autoGenerateMipmaps:this._mipmap})});this._textureStyle&&(r.source.style=this._textureStyle);const u={canvasAndContext:t,texture:r};return this.pages[this._currentPageIndex]=u,u}_setupContext(e,t,a){t.fontSize=this.baseRenderedFontSize,e.scale(a,a),e.font=uy(t),t.fontSize=this.baseMeasurementFontSize,e.textBaseline=t.textBaseline;const r=t._stroke,u=(r==null?void 0:r.width)??0;if(r&&(e.lineWidth=u,e.lineJoin=r.join,e.miterLimit=r.miterLimit,e.strokeStyle=my(r,e)),t._fill&&(e.fillStyle=my(t._fill,e)),t.dropShadow){const h=t.dropShadow,d=Ft.shared.setValue(h.color).toArray(),m=h.blur*a,y=h.distance*a;e.shadowColor=`rgba(${d[0]*255},${d[1]*255},${d[2]*255},${h.alpha})`,e.shadowBlur=m,e.shadowOffsetX=Math.cos(h.angle)*y,e.shadowOffsetY=Math.sin(h.angle)*y}else e.shadowColor="black",e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0}_drawGlyph(e,t,a,r,u,h){const d=t.text,m=t.fontProperties,y=h._stroke,b=((y==null?void 0:y.width)??0)*u,S=a+b/2,T=r-b/2,E=m.descent*u,A=t.lineHeight*u;let B=!1;h.stroke&&b&&(B=!0,e.strokeText(d,S,T+A-E));const{shadowBlur:M,shadowOffsetX:G,shadowOffsetY:w}=e;h._fill&&(B&&(e.shadowBlur=0,e.shadowOffsetX=0,e.shadowOffsetY=0),e.fillText(d,S,T+A-E)),B&&(e.shadowBlur=M,e.shadowOffsetX=G,e.shadowOffsetY=w)}destroy(){super.destroy();for(let e=0;e<this.pages.length;e++){const{canvasAndContext:t,texture:a}=this.pages[e];kl.returnCanvasAndContext(t),a.destroy(!0)}this.pages=null}};G1.defaultOptions={textureSize:512,style:new nl,mipmap:!0};let w1=G1;function P1(n,e,t,a){const r={width:0,height:0,offsetY:0,scale:e.fontSize/t.baseMeasurementFontSize,lines:[{width:0,charPositions:[],spaceWidth:0,spacesIndex:[],chars:[]}]};r.offsetY=t.baseLineOffset;let u=r.lines[0],h=null,d=!0;const m={width:0,start:0,index:0,positions:[],chars:[]},y=t.baseMeasurementFontSize/e.fontSize,b=e.letterSpacing*y,S=e.wordWrapWidth*y,T=e.lineHeight?e.lineHeight*y:t.lineHeight,E=e.wordWrap&&e.breakWords,A=G=>{const w=u.width;for(let P=0;P<m.index;P++){const z=G.positions[P];u.chars.push(G.chars[P]),u.charPositions.push(z+w)}u.width+=G.width,d=!1,m.width=0,m.index=0,m.chars.length=0},B=()=>{let G=u.chars.length-1;if(a){let w=u.chars[G];for(;w===" ";)u.width-=t.chars[w].xAdvance,w=u.chars[--G]}r.width=Math.max(r.width,u.width),u={width:0,charPositions:[],chars:[],spaceWidth:0,spacesIndex:[]},d=!0,r.lines.push(u),r.height+=T},M=G=>G-b>S;for(let G=0;G<n.length+1;G++){let w;const P=G===n.length;P||(w=n[G]);const z=t.chars[w]||t.chars[" "];if(/(?:\s)/.test(w)||w==="\r"||w===`
|
|
307
|
+
`||P){if(!d&&e.wordWrap&&M(u.width+m.width)?(B(),A(m),P||u.charPositions.push(0)):(m.start=u.width,A(m),P||u.charPositions.push(0)),w==="\r"||w===`
|
|
308
|
+
`)u.width!==0&&B();else if(!P){const Se=z.xAdvance+(z.kerning[h]||0)+b;u.width+=Se,u.spaceWidth=Se,u.spacesIndex.push(u.charPositions.length),u.chars.push(w)}}else{const ne=z.kerning[h]||0,Se=z.xAdvance+ne+b;E&&M(u.width+m.width+Se)&&(A(m),B()),m.positions[m.index++]=m.width+ne,m.chars.push(w),m.width+=Se}h=w}return B(),e.align==="center"?nU(r):e.align==="right"?iU(r):e.align==="justify"&&aU(r),r}function nU(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],a=n.width/2-t.width/2;for(let r=0;r<t.charPositions.length;r++)t.charPositions[r]+=a}}function iU(n){for(let e=0;e<n.lines.length;e++){const t=n.lines[e],a=n.width-t.width;for(let r=0;r<t.charPositions.length;r++)t.charPositions[r]+=a}}function aU(n){const e=n.width;for(let t=0;t<n.lines.length;t++){const a=n.lines[t];let r=0,u=a.spacesIndex[r++],h=0;const d=a.spacesIndex.length,y=(e-a.width)/d;for(let b=0;b<a.charPositions.length;b++)b===u&&(u=a.spacesIndex[r++],h+=y),a.charPositions[b]+=h}}function sU(n){if(n==="")return[];typeof n=="string"&&(n=[n]);const e=[];for(let t=0,a=n.length;t<a;t++){const r=n[t];if(Array.isArray(r)){if(r.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${r.length}.`);if(r[0].length===0||r[1].length===0)throw new Error("[BitmapFont]: Invalid character delimiter.");const u=r[0].charCodeAt(0),h=r[1].charCodeAt(0);if(h<u)throw new Error("[BitmapFont]: Invalid character range.");for(let d=u,m=h;d<=m;d++)e.push(String.fromCharCode(d))}else e.push(...Array.from(r))}if(e.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return e}let yy=0;class rU{constructor(){this.ALPHA=[["a","z"],["A","Z"]," "],this.NUMERIC=[["0","9"]],this.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],this.ASCII=[[" ","~"]],this.defaultOptions={chars:this.ALPHANUMERIC,resolution:1,padding:4,skipKerning:!1,textureStyle:null}}getFont(e,t){var h;let a=`${t.fontFamily}-bitmap`,r=!0;if(t._fill.fill&&!t._stroke)a+=t._fill.fill.styleKey,r=!1;else if(t._stroke||t.dropShadow){let d=t.styleKey;d=d.substring(0,d.lastIndexOf("-")),a=`${d}-bitmap`,r=!1}if(!Ui.has(a)){const d=Object.create(t);d.lineHeight=0;const m=new w1({style:d,overrideFill:r,overrideSize:!0,...this.defaultOptions});yy++,yy>50&&rt("BitmapText",`You have dynamically created ${yy} bitmap fonts, this can be inefficient. Try pre installing your font styles using \`BitmapFont.install({name:"style1", style})\``),m.once("destroy",()=>{yy--,Ui.remove(a)}),Ui.set(a,m)}const u=Ui.get(a);return(h=u.ensureCharacters)==null||h.call(u,e),u}getLayout(e,t,a=!0){const r=this.getFont(e,t),u=dr.graphemeSegmenter(e);return P1(u,t,r,a)}measureText(e,t,a=!0){return this.getLayout(e,t,a)}install(...e){var y,b,S,T;let t=e[0];typeof t=="string"&&(t={name:t,style:e[1],chars:(y=e[2])==null?void 0:y.chars,resolution:(b=e[2])==null?void 0:b.resolution,padding:(S=e[2])==null?void 0:S.padding,skipKerning:(T=e[2])==null?void 0:T.skipKerning},st(Rt,"BitmapFontManager.install(name, style, options) is deprecated, use BitmapFontManager.install({name, style, ...options})"));const a=t==null?void 0:t.name;if(!a)throw new Error("[BitmapFontManager] Property `name` is required.");t={...this.defaultOptions,...t};const r=t.style,u=r instanceof nl?r:new nl(r),h=t.dynamicFill??this._canUseTintForStyle(u),d=new w1({style:u,overrideFill:h,skipKerning:t.skipKerning,padding:t.padding,resolution:t.resolution,overrideSize:!1,textureStyle:t.textureStyle}),m=sU(t.chars);return d.ensureCharacters(m.join("")),Ui.set(`${a}-bitmap`,d),d.once("destroy",()=>Ui.remove(`${a}-bitmap`)),d}uninstall(e){const t=`${e}-bitmap`,a=Ui.get(t);a&&a.destroy()}_canUseTintForStyle(e){return!e._stroke&&(!e.dropShadow||e.dropShadow.color===0)&&!e._fill.fill&&e._fill.color===16777215}}const lU=new rU;class z1{constructor(e){this._attachedDomElements=[],this._renderer=e,this._renderer.runners.postrender.add(this),this._renderer.runners.init.add(this),this._domElement=document.createElement("div"),this._domElement.style.position="absolute",this._domElement.style.top="0",this._domElement.style.left="0",this._domElement.style.pointerEvents="none",this._domElement.style.zIndex="1000"}init(){this._canvasObserver=new rS({domElement:this._domElement,renderer:this._renderer})}addRenderable(e,t){this._attachedDomElements.includes(e)||this._attachedDomElements.push(e)}updateRenderable(e){}validateRenderable(e){return!0}postrender(){const e=this._attachedDomElements;if(e.length===0){this._domElement.remove();return}this._canvasObserver.ensureAttached();for(let t=0;t<e.length;t++){const a=e[t],r=a.element;if(!a.parent||a.globalDisplayStatus<7)r==null||r.remove(),e.splice(t,1),t--;else{this._domElement.contains(r)||(r.style.position="absolute",r.style.pointerEvents="auto",this._domElement.appendChild(r));const u=a.worldTransform,h=a._anchor,d=a.width*h.x,m=a.height*h.y;r.style.transformOrigin=`${d}px ${m}px`,r.style.transform=`matrix(${u.a}, ${u.b}, ${u.c}, ${u.d}, ${u.tx-d}, ${u.ty-m})`,r.style.opacity=a.groupAlpha.toString()}}}destroy(){var e;this._renderer.runners.postrender.remove(this);for(let t=0;t<this._attachedDomElements.length;t++)(e=this._attachedDomElements[t].element)==null||e.remove();this._attachedDomElements.length=0,this._domElement.remove(),this._canvasObserver.destroy(),this._renderer=null}}z1.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"dom"};class oU{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}init(e){this.removeTickerListener(),this.events=e,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this._tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(e){this._pauseUpdate=e}addTickerListener(){this._tickerAdded||!this.domElement||(Ia.system.add(this._tickerUpdate,this,xc.INTERACTION),this._tickerAdded=!0)}removeTickerListener(){this._tickerAdded&&(Ia.system.remove(this._tickerUpdate,this),this._tickerAdded=!1)}pointerMoved(){this._didMove=!0}_update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const e=this.events._rootPointerEvent;this.events.supportsTouchEvents&&e.pointerType==="touch"||globalThis.document.dispatchEvent(this.events.supportsPointerEvents?new PointerEvent("pointermove",{clientX:e.clientX,clientY:e.clientY,pointerType:e.pointerType,pointerId:e.pointerId}):new MouseEvent("mousemove",{clientX:e.clientX,clientY:e.clientY}))}_tickerUpdate(e){this._deltaTime+=e.deltaTime,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this._update())}}const Kl=new oU;class gy extends Wf{constructor(){super(...arguments),this.client=new qt,this.movement=new qt,this.offset=new qt,this.global=new qt,this.screen=new qt}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(e,t,a){return e.worldTransform.applyInverse(a||this.global,t)}getModifierState(e){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(e)}initMouseEvent(e,t,a,r,u,h,d,m,y,b,S,T,E,A,B){throw new Error("Method not implemented.")}}class Os extends gy{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class Uc extends gy{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}Uc.DOM_DELTA_PIXEL=0,Uc.DOM_DELTA_LINE=1,Uc.DOM_DELTA_PAGE=2;const uU=2048,cU=new qt,yd=new qt;class hU{constructor(e){this.dispatch=new Sa,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=e,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(e,t){this.mappingTable[e]||(this.mappingTable[e]=[]),this.mappingTable[e].push({fn:t,priority:0}),this.mappingTable[e].sort((a,r)=>a.priority-r.priority)}dispatchEvent(e,t){e.propagationStopped=!1,e.propagationImmediatelyStopped=!1,this.propagate(e,t),this.dispatch.emit(t||e.type,e)}mapEvent(e){if(!this.rootTarget)return;const t=this.mappingTable[e.type];if(t)for(let a=0,r=t.length;a<r;a++)t[a].fn(e);else rt(`[EventBoundary]: Event mapping not defined for ${e.type}`)}hitTest(e,t){Kl.pauseUpdate=!0;const r=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",u=this[r](this.rootTarget,this.rootTarget.eventMode,cU.set(e,t),this.hitTestFn,this.hitPruneFn);return u&&u[0]}propagate(e,t){if(!e.target)return;const a=e.composedPath();e.eventPhase=e.CAPTURING_PHASE;for(let r=0,u=a.length-1;r<u;r++)if(e.currentTarget=a[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return;if(e.eventPhase=e.AT_TARGET,e.currentTarget=e.target,this.notifyTarget(e,t),!(e.propagationStopped||e.propagationImmediatelyStopped)){e.eventPhase=e.BUBBLING_PHASE;for(let r=a.length-2;r>=0;r--)if(e.currentTarget=a[r],this.notifyTarget(e,t),e.propagationStopped||e.propagationImmediatelyStopped)return}}all(e,t,a=this._allInteractiveElements){if(a.length===0)return;e.eventPhase=e.BUBBLING_PHASE;const r=Array.isArray(t)?t:[t];for(let u=a.length-1;u>=0;u--)r.forEach(h=>{e.currentTarget=a[u],this.notifyTarget(e,h)})}propagationPath(e){const t=[e];for(let a=0;a<uU&&e!==this.rootTarget&&e.parent;a++){if(!e.parent)throw new Error("Cannot find propagation path to disconnected target");t.push(e.parent),e=e.parent}return t.reverse(),t}hitTestMoveRecursive(e,t,a,r,u,h=!1){let d=!1;if(this._interactivePrune(e))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Kl.pauseUpdate=!1),e.interactiveChildren&&e.children){const b=e.children;for(let S=b.length-1;S>=0;S--){const T=b[S],E=this.hitTestMoveRecursive(T,this._isInteractive(t)?t:T.eventMode,a,r,u,h||u(e,a));if(E){if(E.length>0&&!E[E.length-1].parent)continue;const A=e.isInteractive();(E.length>0||A)&&(A&&this._allInteractiveElements.push(e),E.push(e)),this._hitElements.length===0&&(this._hitElements=E),d=!0}}}const m=this._isInteractive(t),y=e.isInteractive();return y&&y&&this._allInteractiveElements.push(e),h||this._hitElements.length>0?null:d?this._hitElements:m&&!u(e,a)&&r(e,a)?y?[e]:[]:null}hitTestRecursive(e,t,a,r,u){if(this._interactivePrune(e)||u(e,a))return null;if((e.eventMode==="dynamic"||t==="dynamic")&&(Kl.pauseUpdate=!1),e.interactiveChildren&&e.children){const m=e.children,y=a;for(let b=m.length-1;b>=0;b--){const S=m[b],T=this.hitTestRecursive(S,this._isInteractive(t)?t:S.eventMode,y,r,u);if(T){if(T.length>0&&!T[T.length-1].parent)continue;const E=e.isInteractive();return(T.length>0||E)&&T.push(e),T}}}const h=this._isInteractive(t),d=e.isInteractive();return h&&r(e,a)?d?[e]:[]:null}_isInteractive(e){return e==="static"||e==="dynamic"}_interactivePrune(e){return!e||!e.visible||!e.renderable||!e.measurable||e.eventMode==="none"||e.eventMode==="passive"&&!e.interactiveChildren}hitPruneFn(e,t){if(e.hitArea&&(e.worldTransform.applyInverse(t,yd),!e.hitArea.contains(yd.x,yd.y)))return!0;if(e.effects&&e.effects.length)for(let a=0;a<e.effects.length;a++){const r=e.effects[a];if(r.containsPoint&&!r.containsPoint(t,this.hitTestFn))return!0}return!1}hitTestFn(e,t){return e.hitArea?!0:e!=null&&e.containsPoint?(e.worldTransform.applyInverse(t,yd),e.containsPoint(yd)):!1}notifyTarget(e,t){var u,h;if(!e.currentTarget.isInteractive())return;t??(t=e.type);const a=`on${t}`;(h=(u=e.currentTarget)[a])==null||h.call(u,e);const r=e.eventPhase===e.CAPTURING_PHASE||e.eventPhase===e.AT_TARGET?`${t}capture`:t;this._notifyListeners(e,r),e.eventPhase===e.AT_TARGET&&this._notifyListeners(e,t)}mapPointerDown(e){if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.createPointerEvent(e);if(this.dispatchEvent(t,"pointerdown"),t.pointerType==="touch")this.dispatchEvent(t,"touchstart");else if(t.pointerType==="mouse"||t.pointerType==="pen"){const r=t.button===2;this.dispatchEvent(t,r?"rightdown":"mousedown")}const a=this.trackingData(e.pointerId);a.pressTargetsByButton[e.button]=t.composedPath(),this.freeEvent(t)}mapPointerMove(e){var m,y;if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const t=this.createPointerEvent(e);this._isPointerMoveEvent=!1;const a=t.pointerType==="mouse"||t.pointerType==="pen",r=this.trackingData(e.pointerId),u=this.findMountedTarget(r.overTargets);if(((m=r.overTargets)==null?void 0:m.length)>0&&u!==t.target){const b=e.type==="mousemove"?"mouseout":"pointerout",S=this.createPointerEvent(e,b,u);if(this.dispatchEvent(S,"pointerout"),a&&this.dispatchEvent(S,"mouseout"),!t.composedPath().includes(u)){const T=this.createPointerEvent(e,"pointerleave",u);for(T.eventPhase=T.AT_TARGET;T.target&&!t.composedPath().includes(T.target);)T.currentTarget=T.target,this.notifyTarget(T),a&&this.notifyTarget(T,"mouseleave"),T.target=T.target.parent;this.freeEvent(T)}this.freeEvent(S)}if(u!==t.target){const b=e.type==="mousemove"?"mouseover":"pointerover",S=this.clonePointerEvent(t,b);this.dispatchEvent(S,"pointerover"),a&&this.dispatchEvent(S,"mouseover");let T=u==null?void 0:u.parent;for(;T&&T!==this.rootTarget.parent&&T!==t.target;)T=T.parent;if(!T||T===this.rootTarget.parent){const A=this.clonePointerEvent(t,"pointerenter");for(A.eventPhase=A.AT_TARGET;A.target&&A.target!==u&&A.target!==this.rootTarget.parent;)A.currentTarget=A.target,this.notifyTarget(A),a&&this.notifyTarget(A,"mouseenter"),A.target=A.target.parent;this.freeEvent(A)}this.freeEvent(S)}const h=[],d=this.enableGlobalMoveEvents??!0;this.moveOnAll?h.push("pointermove"):this.dispatchEvent(t,"pointermove"),d&&h.push("globalpointermove"),t.pointerType==="touch"&&(this.moveOnAll?h.splice(1,0,"touchmove"):this.dispatchEvent(t,"touchmove"),d&&h.push("globaltouchmove")),a&&(this.moveOnAll?h.splice(1,0,"mousemove"):this.dispatchEvent(t,"mousemove"),d&&h.push("globalmousemove"),this.cursor=(y=t.target)==null?void 0:y.cursor),h.length>0&&this.all(t,h),this._allInteractiveElements.length=0,this._hitElements.length=0,r.overTargets=t.composedPath(),this.freeEvent(t)}mapPointerOver(e){var h;if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),a=this.createPointerEvent(e),r=a.pointerType==="mouse"||a.pointerType==="pen";this.dispatchEvent(a,"pointerover"),r&&this.dispatchEvent(a,"mouseover"),a.pointerType==="mouse"&&(this.cursor=(h=a.target)==null?void 0:h.cursor);const u=this.clonePointerEvent(a,"pointerenter");for(u.eventPhase=u.AT_TARGET;u.target&&u.target!==this.rootTarget.parent;)u.currentTarget=u.target,this.notifyTarget(u),r&&this.notifyTarget(u,"mouseenter"),u.target=u.target.parent;t.overTargets=a.composedPath(),this.freeEvent(a),this.freeEvent(u)}mapPointerOut(e){if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId);if(t.overTargets){const a=e.pointerType==="mouse"||e.pointerType==="pen",r=this.findMountedTarget(t.overTargets),u=this.createPointerEvent(e,"pointerout",r);this.dispatchEvent(u),a&&this.dispatchEvent(u,"mouseout");const h=this.createPointerEvent(e,"pointerleave",r);for(h.eventPhase=h.AT_TARGET;h.target&&h.target!==this.rootTarget.parent;)h.currentTarget=h.target,this.notifyTarget(h),a&&this.notifyTarget(h,"mouseleave"),h.target=h.target.parent;t.overTargets=null,this.freeEvent(u),this.freeEvent(h)}this.cursor=null}mapPointerUp(e){if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=performance.now(),a=this.createPointerEvent(e);if(this.dispatchEvent(a,"pointerup"),a.pointerType==="touch")this.dispatchEvent(a,"touchend");else if(a.pointerType==="mouse"||a.pointerType==="pen"){const d=a.button===2;this.dispatchEvent(a,d?"rightup":"mouseup")}const r=this.trackingData(e.pointerId),u=this.findMountedTarget(r.pressTargetsByButton[e.button]);let h=u;if(u&&!a.composedPath().includes(u)){let d=u;for(;d&&!a.composedPath().includes(d);){if(a.currentTarget=d,this.notifyTarget(a,"pointerupoutside"),a.pointerType==="touch")this.notifyTarget(a,"touchendoutside");else if(a.pointerType==="mouse"||a.pointerType==="pen"){const m=a.button===2;this.notifyTarget(a,m?"rightupoutside":"mouseupoutside")}d=d.parent}delete r.pressTargetsByButton[e.button],h=d}if(h){const d=this.clonePointerEvent(a,"click");d.target=h,d.path=null,r.clicksByButton[e.button]||(r.clicksByButton[e.button]={clickCount:0,target:d.target,timeStamp:t});const m=r.clicksByButton[e.button];if(m.target===d.target&&t-m.timeStamp<200?++m.clickCount:m.clickCount=1,m.target=d.target,m.timeStamp=t,d.detail=m.clickCount,d.pointerType==="mouse"){const y=d.button===2;this.dispatchEvent(d,y?"rightclick":"click")}else d.pointerType==="touch"&&this.dispatchEvent(d,"tap");this.dispatchEvent(d,"pointertap"),this.freeEvent(d)}this.freeEvent(a)}mapPointerUpOutside(e){if(!(e instanceof Os)){rt("EventBoundary cannot map a non-pointer event as a pointer event");return}const t=this.trackingData(e.pointerId),a=this.findMountedTarget(t.pressTargetsByButton[e.button]),r=this.createPointerEvent(e);if(a){let u=a;for(;u;)r.currentTarget=u,this.notifyTarget(r,"pointerupoutside"),r.pointerType==="touch"?this.notifyTarget(r,"touchendoutside"):(r.pointerType==="mouse"||r.pointerType==="pen")&&this.notifyTarget(r,r.button===2?"rightupoutside":"mouseupoutside"),u=u.parent;delete t.pressTargetsByButton[e.button]}this.freeEvent(r)}mapWheel(e){if(!(e instanceof Uc)){rt("EventBoundary cannot map a non-wheel event as a wheel event");return}const t=this.createWheelEvent(e);this.dispatchEvent(t),this.freeEvent(t)}findMountedTarget(e){if(!e)return null;let t=e[0];for(let a=1;a<e.length&&e[a].parent===t;a++)t=e[a];return t}createPointerEvent(e,t,a){const r=this.allocateEvent(Os);return this.copyPointerData(e,r),this.copyMouseData(e,r),this.copyData(e,r),r.nativeEvent=e.nativeEvent,r.originalEvent=e,r.target=a??this.hitTest(r.global.x,r.global.y)??this._hitElements[0],typeof t=="string"&&(r.type=t),r}createWheelEvent(e){const t=this.allocateEvent(Uc);return this.copyWheelData(e,t),this.copyMouseData(e,t),this.copyData(e,t),t.nativeEvent=e.nativeEvent,t.originalEvent=e,t.target=this.hitTest(t.global.x,t.global.y),t}clonePointerEvent(e,t){const a=this.allocateEvent(Os);return a.nativeEvent=e.nativeEvent,a.originalEvent=e.originalEvent,this.copyPointerData(e,a),this.copyMouseData(e,a),this.copyData(e,a),a.target=e.target,a.path=e.composedPath().slice(),a.type=t??a.type,a}copyWheelData(e,t){t.deltaMode=e.deltaMode,t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ}copyPointerData(e,t){e instanceof Os&&t instanceof Os&&(t.pointerId=e.pointerId,t.width=e.width,t.height=e.height,t.isPrimary=e.isPrimary,t.pointerType=e.pointerType,t.pressure=e.pressure,t.tangentialPressure=e.tangentialPressure,t.tiltX=e.tiltX,t.tiltY=e.tiltY,t.twist=e.twist)}copyMouseData(e,t){e instanceof gy&&t instanceof gy&&(t.altKey=e.altKey,t.button=e.button,t.buttons=e.buttons,t.client.copyFrom(e.client),t.ctrlKey=e.ctrlKey,t.metaKey=e.metaKey,t.movement.copyFrom(e.movement),t.screen.copyFrom(e.screen),t.shiftKey=e.shiftKey,t.global.copyFrom(e.global))}copyData(e,t){t.isTrusted=e.isTrusted,t.srcElement=e.srcElement,t.timeStamp=performance.now(),t.type=e.type,t.detail=e.detail,t.view=e.view,t.which=e.which,t.layer.copyFrom(e.layer),t.page.copyFrom(e.page)}trackingData(e){return this.mappingState.trackingData[e]||(this.mappingState.trackingData[e]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[e]}allocateEvent(e){this.eventPool.has(e)||this.eventPool.set(e,[]);const t=this.eventPool.get(e).pop()||new e(this);return t.eventPhase=t.NONE,t.currentTarget=null,t.defaultPrevented=!1,t.path=null,t.target=null,t}freeEvent(e){if(e.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const t=e.constructor;this.eventPool.has(t)||this.eventPool.set(t,[]),this.eventPool.get(t).push(e)}_notifyListeners(e,t){const a=e.currentTarget._events[t];if(a)if("fn"in a)a.once&&e.currentTarget.removeListener(t,a.fn,void 0,!0),a.fn.call(a.context,e);else for(let r=0,u=a.length;r<u&&!e.propagationImmediatelyStopped;r++)a[r].once&&e.currentTarget.removeListener(t,a[r].fn,void 0,!0),a[r].fn.call(a[r].context,e)}}const fU=1,dU={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},Ov=class $b{constructor(e){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=e,this.rootBoundary=new hU(null),Kl.init(this),this.autoPreventDefault=!0,this._eventsAdded=!1,this._rootPointerEvent=new Os(null),this._rootWheelEvent=new Uc(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...$b.defaultEventFeatures},{set:(t,a,r)=>(a==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=r),t[a]=r,!0)}),this._onPointerDown=this._onPointerDown.bind(this),this._onPointerMove=this._onPointerMove.bind(this),this._onPointerUp=this._onPointerUp.bind(this),this._onPointerOverOut=this._onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(e){const{canvas:t,resolution:a}=this.renderer;this.setTargetElement(t),this.resolution=a,$b._defaultEventMode=e.eventMode??"passive",Object.assign(this.features,e.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(e){this.resolution=e}destroy(){this.setTargetElement(null),this.renderer=null,this._currentCursor=null}setCursor(e){e||(e="default");let t=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(t=!1),this._currentCursor===e)return;this._currentCursor=e;const a=this.cursorStyles[e];if(a)switch(typeof a){case"string":t&&(this.domElement.style.cursor=a);break;case"function":a(e);break;case"object":t&&Object.assign(this.domElement.style,a);break}else t&&typeof e=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,e)&&(this.domElement.style.cursor=e)}get pointer(){return this._rootPointerEvent}_onPointerDown(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);this.autoPreventDefault&&t[0].isNormalized&&(e.cancelable||!("cancelable"in e))&&e.preventDefault();for(let a=0,r=t.length;a<r;a++){const u=t[a],h=this._bootstrapEvent(this._rootPointerEvent,u);this.rootBoundary.mapEvent(h)}this.setCursor(this.rootBoundary.cursor)}_onPointerMove(e){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,Kl.pointerMoved();const t=this._normalizeToPointerData(e);for(let a=0,r=t.length;a<r;a++){const u=this._bootstrapEvent(this._rootPointerEvent,t[a]);this.rootBoundary.mapEvent(u)}this.setCursor(this.rootBoundary.cursor)}_onPointerUp(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let t=e.target;e.composedPath&&e.composedPath().length>0&&(t=e.composedPath()[0]);const a=t!==this.domElement?"outside":"",r=this._normalizeToPointerData(e);for(let u=0,h=r.length;u<h;u++){const d=this._bootstrapEvent(this._rootPointerEvent,r[u]);d.type+=a,this.rootBoundary.mapEvent(d)}this.setCursor(this.rootBoundary.cursor)}_onPointerOverOut(e){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const t=this._normalizeToPointerData(e);for(let a=0,r=t.length;a<r;a++){const u=this._bootstrapEvent(this._rootPointerEvent,t[a]);this.rootBoundary.mapEvent(u)}this.setCursor(this.rootBoundary.cursor)}onWheel(e){if(!this.features.wheel)return;const t=this.normalizeWheelEvent(e);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(t)}setTargetElement(e){this._removeEvents(),this.domElement=e,Kl.domElement=e,this._addEvents()}_addEvents(){if(this._eventsAdded||!this.domElement)return;Kl.addTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="none",e.msTouchAction="none"):this.supportsPointerEvents&&(e.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this._onPointerMove,!0),this.domElement.addEventListener("pointerdown",this._onPointerDown,!0),this.domElement.addEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this._onPointerOverOut,!0),globalThis.addEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this._onPointerMove,!0),this.domElement.addEventListener("mousedown",this._onPointerDown,!0),this.domElement.addEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this._onPointerOverOut,!0),globalThis.addEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this._onPointerDown,!0),this.domElement.addEventListener("touchend",this._onPointerUp,!0),this.domElement.addEventListener("touchmove",this._onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this._eventsAdded=!0}_removeEvents(){if(!this._eventsAdded||!this.domElement)return;Kl.removeTickerListener();const e=this.domElement.style;e&&(globalThis.navigator.msPointerEnabled?(e.msContentZooming="",e.msTouchAction=""):this.supportsPointerEvents&&(e.touchAction="")),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this._onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this._onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this._onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this._onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this._onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this._onPointerMove,!0),this.domElement.removeEventListener("mousedown",this._onPointerDown,!0),this.domElement.removeEventListener("mouseout",this._onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this._onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this._onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this._onPointerDown,!0),this.domElement.removeEventListener("touchend",this._onPointerUp,!0),this.domElement.removeEventListener("touchmove",this._onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this._eventsAdded=!1}mapPositionToPoint(e,t,a){const r=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},u=1/this.resolution;e.x=(t-r.left)*(this.domElement.width/r.width)*u,e.y=(a-r.top)*(this.domElement.height/r.height)*u}_normalizeToPointerData(e){const t=[];if(this.supportsTouchEvents&&e instanceof TouchEvent)for(let a=0,r=e.changedTouches.length;a<r;a++){const u=e.changedTouches[a];typeof u.button>"u"&&(u.button=0),typeof u.buttons>"u"&&(u.buttons=1),typeof u.isPrimary>"u"&&(u.isPrimary=e.touches.length===1&&e.type==="touchstart"),typeof u.width>"u"&&(u.width=u.radiusX||1),typeof u.height>"u"&&(u.height=u.radiusY||1),typeof u.tiltX>"u"&&(u.tiltX=0),typeof u.tiltY>"u"&&(u.tiltY=0),typeof u.pointerType>"u"&&(u.pointerType="touch"),typeof u.pointerId>"u"&&(u.pointerId=u.identifier||0),typeof u.pressure>"u"&&(u.pressure=u.force||.5),typeof u.twist>"u"&&(u.twist=0),typeof u.tangentialPressure>"u"&&(u.tangentialPressure=0),typeof u.layerX>"u"&&(u.layerX=u.offsetX=u.clientX),typeof u.layerY>"u"&&(u.layerY=u.offsetY=u.clientY),u.isNormalized=!0,u.type=e.type,t.push(u)}else if(!globalThis.MouseEvent||e instanceof MouseEvent&&(!this.supportsPointerEvents||!(e instanceof globalThis.PointerEvent))){const a=e;typeof a.isPrimary>"u"&&(a.isPrimary=!0),typeof a.width>"u"&&(a.width=1),typeof a.height>"u"&&(a.height=1),typeof a.tiltX>"u"&&(a.tiltX=0),typeof a.tiltY>"u"&&(a.tiltY=0),typeof a.pointerType>"u"&&(a.pointerType="mouse"),typeof a.pointerId>"u"&&(a.pointerId=fU),typeof a.pressure>"u"&&(a.pressure=.5),typeof a.twist>"u"&&(a.twist=0),typeof a.tangentialPressure>"u"&&(a.tangentialPressure=0),a.isNormalized=!0,t.push(a)}else t.push(e);return t}normalizeWheelEvent(e){const t=this._rootWheelEvent;return this._transferMouseData(t,e),t.deltaX=e.deltaX,t.deltaY=e.deltaY,t.deltaZ=e.deltaZ,t.deltaMode=e.deltaMode,this.mapPositionToPoint(t.screen,e.clientX,e.clientY),t.global.copyFrom(t.screen),t.offset.copyFrom(t.screen),t.nativeEvent=e,t.type=e.type,t}_bootstrapEvent(e,t){return e.originalEvent=null,e.nativeEvent=t,e.pointerId=t.pointerId,e.width=t.width,e.height=t.height,e.isPrimary=t.isPrimary,e.pointerType=t.pointerType,e.pressure=t.pressure,e.tangentialPressure=t.tangentialPressure,e.tiltX=t.tiltX,e.tiltY=t.tiltY,e.twist=t.twist,this._transferMouseData(e,t),this.mapPositionToPoint(e.screen,t.clientX,t.clientY),e.global.copyFrom(e.screen),e.offset.copyFrom(e.screen),e.isTrusted=t.isTrusted,e.type==="pointerleave"&&(e.type="pointerout"),e.type.startsWith("mouse")&&(e.type=e.type.replace("mouse","pointer")),e.type.startsWith("touch")&&(e.type=dU[e.type]||e.type),e}_transferMouseData(e,t){e.isTrusted=t.isTrusted,e.srcElement=t.srcElement,e.timeStamp=performance.now(),e.type=t.type,e.altKey=t.altKey,e.button=t.button,e.buttons=t.buttons,e.client.x=t.clientX,e.client.y=t.clientY,e.ctrlKey=t.ctrlKey,e.metaKey=t.metaKey,e.movement.x=t.movementX,e.movement.y=t.movementY,e.page.x=t.pageX,e.page.y=t.pageY,e.relatedTarget=null,e.shiftKey=t.shiftKey}};Ov.extension={name:"events",type:[Q.WebGLSystem,Q.CanvasSystem,Q.WebGPUSystem],priority:-1},Ov.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let H1=Ov;const pU={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,get interactive(){return this.eventMode==="dynamic"||this.eventMode==="static"},set interactive(n){this.eventMode=n?"static":"passive"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??H1.defaultEventMode},set eventMode(n){this._internalEventMode=n},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(n,e,t){const a=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,r=typeof t=="object"?t.signal:void 0,u=typeof t=="object"?t.once===!0:!1,h=typeof e=="function"?void 0:e;n=a?`${n}capture`:n;const d=typeof e=="function"?e:e.handleEvent,m=this;r&&r.addEventListener("abort",()=>{m.off(n,d,h)}),u?m.once(n,d,h):m.on(n,d,h)},removeEventListener(n,e,t){const a=typeof t=="boolean"&&t||typeof t=="object"&&t.capture,r=typeof e=="function"?void 0:e;n=a?`${n}capture`:n,e=typeof e=="function"?e:e.handleEvent,this.off(n,e,r)},dispatchEvent(n){if(!(n instanceof Wf))throw new Error("Container cannot propagate events outside of the Federated Events API");return n.defaultPrevented=!1,n.path=null,n.target=this,n.manager.dispatchEvent(n),!n.defaultPrevented}};class V1{constructor(e){this._renderer=e}push(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"filter",canBundle:!1,action:"pushFilter",container:t,filterEffect:e})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}execute(e){e.action==="pushFilter"?this._renderer.filter.push(e):e.action==="popFilter"&&this._renderer.filter.pop()}destroy(){this._renderer=null}}V1.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"filter"};function mU(n,e){e.clear();const t=e.matrix;for(let a=0;a<n.length;a++){const r=n[a];r.globalDisplayStatus<7||(e.matrix=r.worldTransform,e.addBounds(r.bounds))}return e.matrix=t,e}const yU=new od({attributes:{aPosition:{buffer:new Float32Array([0,0,1,0,1,1,0,1]),format:"float32x2",stride:8,offset:0}},indexBuffer:new Uint32Array([0,1,2,0,2,3])});class gU{constructor(){this.skip=!1,this.inputTexture=null,this.backTexture=null,this.filters=null,this.bounds=new ci,this.container=null,this.blendRequired=!1,this.outputRenderSurface=null,this.globalFrame={x:0,y:0,width:0,height:0}}}class L1{constructor(e){this._filterStackIndex=0,this._filterStack=[],this._filterGlobalUniforms=new Yi({uInputSize:{value:new Float32Array(4),type:"vec4<f32>"},uInputPixel:{value:new Float32Array(4),type:"vec4<f32>"},uInputClamp:{value:new Float32Array(4),type:"vec4<f32>"},uOutputFrame:{value:new Float32Array(4),type:"vec4<f32>"},uGlobalFrame:{value:new Float32Array(4),type:"vec4<f32>"},uOutputTexture:{value:new Float32Array(4),type:"vec4<f32>"}}),this._globalFilterBindGroup=new el({}),this.renderer=e}get activeBackTexture(){var e;return(e=this._activeFilterData)==null?void 0:e.backTexture}push(e){const t=this.renderer,a=e.filterEffect.filters,r=this._pushFilterData();r.skip=!1,r.filters=a,r.container=e.container,r.outputRenderSurface=t.renderTarget.renderSurface;const u=t.renderTarget.renderTarget.colorTexture.source,h=u.resolution,d=u.antialias;if(a.length===0){r.skip=!0;return}const m=r.bounds;if(this._calculateFilterArea(e,m),this._calculateFilterBounds(r,t.renderTarget.rootViewPort,d,h,1),r.skip)return;const y=this._getPreviousFilterData(),b=this._findFilterResolution(h);let S=0,T=0;y&&(S=y.bounds.minX,T=y.bounds.minY),this._calculateGlobalFrame(r,S,T,b,u.width,u.height),this._setupFilterTextures(r,m,t,y)}generateFilteredTexture({texture:e,filters:t}){const a=this._pushFilterData();this._activeFilterData=a,a.skip=!1,a.filters=t;const r=e.source,u=r.resolution,h=r.antialias;if(t.length===0)return a.skip=!0,e;const d=a.bounds;if(d.addRect(e.frame),this._calculateFilterBounds(a,d.rectangle,h,u,0),a.skip)return e;const m=u;this._calculateGlobalFrame(a,0,0,m,r.width,r.height),a.outputRenderSurface=Di.getOptimalTexture(d.width,d.height,a.resolution,a.antialias),a.backTexture=Ge.EMPTY,a.inputTexture=e,this.renderer.renderTarget.finishRenderPass(),this._applyFiltersToTexture(a,!0);const T=a.outputRenderSurface;return T.source.alphaMode="premultiplied-alpha",T}pop(){const e=this.renderer,t=this._popFilterData();t.skip||(e.globalUniforms.pop(),e.renderTarget.finishRenderPass(),this._activeFilterData=t,this._applyFiltersToTexture(t,!1),t.blendRequired&&Di.returnTexture(t.backTexture),Di.returnTexture(t.inputTexture))}getBackTexture(e,t,a){const r=e.colorTexture.source._resolution,u=Di.getOptimalTexture(t.width,t.height,r,!1);let h=t.minX,d=t.minY;a&&(h-=a.minX,d-=a.minY),h=Math.floor(h*r),d=Math.floor(d*r);const m=Math.ceil(t.width*r),y=Math.ceil(t.height*r);return this.renderer.renderTarget.copyToTexture(e,u,{x:h,y:d},{width:m,height:y},{x:0,y:0}),u}applyFilter(e,t,a,r){const u=this.renderer,h=this._activeFilterData,m=h.outputRenderSurface===a,y=u.renderTarget.rootRenderTarget.colorTexture.source._resolution,b=this._findFilterResolution(y);let S=0,T=0;if(m){const E=this._findPreviousFilterOffset();S=E.x,T=E.y}this._updateFilterUniforms(t,a,h,S,T,b,m,r),this._setupBindGroupsAndRender(e,t,u)}calculateSpriteMatrix(e,t){const a=this._activeFilterData,r=e.set(a.inputTexture._source.width,0,0,a.inputTexture._source.height,a.bounds.minX,a.bounds.minY),u=t.worldTransform.copyTo(Pe.shared),h=t.renderGroup||t.parentRenderGroup;return h&&h.cacheToLocalTransform&&u.prepend(h.cacheToLocalTransform),u.invert(),r.prepend(u),r.scale(1/t.texture.orig.width,1/t.texture.orig.height),r.translate(t.anchor.x,t.anchor.y),r}destroy(){}_setupBindGroupsAndRender(e,t,a){if(a.renderPipes.uniformBatch){const r=a.renderPipes.uniformBatch.getUboResource(this._filterGlobalUniforms);this._globalFilterBindGroup.setResource(r,0)}else this._globalFilterBindGroup.setResource(this._filterGlobalUniforms,0);this._globalFilterBindGroup.setResource(t.source,1),this._globalFilterBindGroup.setResource(t.source.style,2),e.groups[0]=this._globalFilterBindGroup,a.encoder.draw({geometry:yU,shader:e,state:e._state,topology:"triangle-list"}),a.type===Ds.WEBGL&&a.renderTarget.finishRenderPass()}_setupFilterTextures(e,t,a,r){if(e.backTexture=Ge.EMPTY,e.blendRequired){a.renderTarget.finishRenderPass();const u=a.renderTarget.getRenderTarget(e.outputRenderSurface);e.backTexture=this.getBackTexture(u,t,r==null?void 0:r.bounds)}e.inputTexture=Di.getOptimalTexture(t.width,t.height,e.resolution,e.antialias),a.renderTarget.bind(e.inputTexture,!0),a.globalUniforms.push({offset:t})}_calculateGlobalFrame(e,t,a,r,u,h){const d=e.globalFrame;d.x=t*r,d.y=a*r,d.width=u*r,d.height=h*r}_updateFilterUniforms(e,t,a,r,u,h,d,m){const y=this._filterGlobalUniforms.uniforms,b=y.uOutputFrame,S=y.uInputSize,T=y.uInputPixel,E=y.uInputClamp,A=y.uGlobalFrame,B=y.uOutputTexture;d?(b[0]=a.bounds.minX-r,b[1]=a.bounds.minY-u):(b[0]=0,b[1]=0),b[2]=e.frame.width,b[3]=e.frame.height,S[0]=e.source.width,S[1]=e.source.height,S[2]=1/S[0],S[3]=1/S[1],T[0]=e.source.pixelWidth,T[1]=e.source.pixelHeight,T[2]=1/T[0],T[3]=1/T[1],E[0]=.5*T[2],E[1]=.5*T[3],E[2]=e.frame.width*S[2]-.5*T[2],E[3]=e.frame.height*S[3]-.5*T[3];const M=this.renderer.renderTarget.rootRenderTarget.colorTexture;A[0]=r*h,A[1]=u*h,A[2]=M.source.width*h,A[3]=M.source.height*h,t instanceof Ge&&(t.source.resource=null);const G=this.renderer.renderTarget.getRenderTarget(t);this.renderer.renderTarget.bind(t,!!m),t instanceof Ge?(B[0]=t.frame.width,B[1]=t.frame.height):(B[0]=G.width,B[1]=G.height),B[2]=G.isRoot?-1:1,this._filterGlobalUniforms.update()}_findFilterResolution(e){let t=this._filterStackIndex-1;for(;t>0&&this._filterStack[t].skip;)--t;return t>0&&this._filterStack[t].inputTexture?this._filterStack[t].inputTexture.source._resolution:e}_findPreviousFilterOffset(){let e=0,t=0,a=this._filterStackIndex;for(;a>0;){a--;const r=this._filterStack[a];if(!r.skip){e=r.bounds.minX,t=r.bounds.minY;break}}return{x:e,y:t}}_calculateFilterArea(e,t){if(e.renderables?mU(e.renderables,t):e.filterEffect.filterArea?(t.clear(),t.addRect(e.filterEffect.filterArea),t.applyMatrix(e.container.worldTransform)):e.container.getFastGlobalBounds(!0,t),e.container){const r=(e.container.renderGroup||e.container.parentRenderGroup).cacheToLocalTransform;r&&t.applyMatrix(r)}}_applyFiltersToTexture(e,t){const a=e.inputTexture,r=e.bounds,u=e.filters;if(this._globalFilterBindGroup.setResource(a.source.style,2),this._globalFilterBindGroup.setResource(e.backTexture.source,3),u.length===1)u[0].apply(this,a,e.outputRenderSurface,t);else{let h=e.inputTexture;const d=Di.getOptimalTexture(r.width,r.height,h.source._resolution,!1);let m=d,y=0;for(y=0;y<u.length-1;++y){u[y].apply(this,h,m,!0);const S=h;h=m,m=S}u[y].apply(this,h,e.outputRenderSurface,t),Di.returnTexture(d)}}_calculateFilterBounds(e,t,a,r,u){var B;const h=this.renderer,d=e.bounds,m=e.filters;let y=1/0,b=0,S=!0,T=!1,E=!1,A=!0;for(let M=0;M<m.length;M++){const G=m[M];if(y=Math.min(y,G.resolution==="inherit"?r:G.resolution),b+=G.padding,G.antialias==="off"?S=!1:G.antialias==="inherit"&&S&&(S=a),G.clipToViewport||(A=!1),!!!(G.compatibleRenderers&h.type)){E=!1;break}if(G.blendRequired&&!(((B=h.backBuffer)==null?void 0:B.useBackBuffer)??!0)){rt("Blend filter requires backBuffer on WebGL renderer to be enabled. Set `useBackBuffer: true` in the renderer options."),E=!1;break}E=G.enabled||E,T||(T=G.blendRequired)}if(!E){e.skip=!0;return}if(A&&d.fitBounds(0,t.width/r,0,t.height/r),d.scale(y).ceil().scale(1/y).pad((b|0)*u),!d.isPositive){e.skip=!0;return}e.antialias=S,e.resolution=y,e.blendRequired=T}_popFilterData(){return this._filterStackIndex--,this._filterStack[this._filterStackIndex]}_getPreviousFilterData(){let e,t=this._filterStackIndex-1;for(;t>1&&(t--,e=this._filterStack[t],!!e.skip););return e}_pushFilterData(){let e=this._filterStack[this._filterStackIndex];return e||(e=this._filterStack[this._filterStackIndex]=new gU),this._filterStackIndex++,e}}L1.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"filter"};var _U=`in vec2 vMaskCoord;
|
|
309
|
+
in vec2 vTextureCoord;
|
|
310
|
+
|
|
311
|
+
uniform sampler2D uTexture;
|
|
312
|
+
uniform sampler2D uMaskTexture;
|
|
313
|
+
|
|
314
|
+
uniform float uAlpha;
|
|
315
|
+
uniform vec4 uMaskClamp;
|
|
316
|
+
uniform float uInverse;
|
|
317
|
+
|
|
318
|
+
out vec4 finalColor;
|
|
319
|
+
|
|
320
|
+
void main(void)
|
|
321
|
+
{
|
|
322
|
+
float clip = step(3.5,
|
|
323
|
+
step(uMaskClamp.x, vMaskCoord.x) +
|
|
324
|
+
step(uMaskClamp.y, vMaskCoord.y) +
|
|
325
|
+
step(vMaskCoord.x, uMaskClamp.z) +
|
|
326
|
+
step(vMaskCoord.y, uMaskClamp.w));
|
|
327
|
+
|
|
328
|
+
// TODO look into why this is needed
|
|
329
|
+
float npmAlpha = uAlpha;
|
|
330
|
+
vec4 original = texture(uTexture, vTextureCoord);
|
|
331
|
+
vec4 masky = texture(uMaskTexture, vMaskCoord);
|
|
332
|
+
float alphaMul = 1.0 - npmAlpha * (1.0 - masky.a);
|
|
333
|
+
|
|
334
|
+
float a = alphaMul * masky.r * npmAlpha * clip;
|
|
335
|
+
|
|
336
|
+
if (uInverse == 1.0) {
|
|
337
|
+
a = 1.0 - a;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
finalColor = original * a;
|
|
341
|
+
}
|
|
342
|
+
`,vU=`in vec2 aPosition;
|
|
343
|
+
|
|
344
|
+
out vec2 vTextureCoord;
|
|
345
|
+
out vec2 vMaskCoord;
|
|
346
|
+
|
|
347
|
+
|
|
348
|
+
uniform vec4 uInputSize;
|
|
349
|
+
uniform vec4 uOutputFrame;
|
|
350
|
+
uniform vec4 uOutputTexture;
|
|
351
|
+
uniform mat3 uFilterMatrix;
|
|
352
|
+
|
|
353
|
+
vec4 filterVertexPosition( vec2 aPosition )
|
|
354
|
+
{
|
|
355
|
+
vec2 position = aPosition * uOutputFrame.zw + uOutputFrame.xy;
|
|
356
|
+
|
|
357
|
+
position.x = position.x * (2.0 / uOutputTexture.x) - 1.0;
|
|
358
|
+
position.y = position.y * (2.0*uOutputTexture.z / uOutputTexture.y) - uOutputTexture.z;
|
|
359
|
+
|
|
360
|
+
return vec4(position, 0.0, 1.0);
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
vec2 filterTextureCoord( vec2 aPosition )
|
|
364
|
+
{
|
|
365
|
+
return aPosition * (uOutputFrame.zw * uInputSize.zw);
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
vec2 getFilterCoord( vec2 aPosition )
|
|
369
|
+
{
|
|
370
|
+
return ( uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
void main(void)
|
|
374
|
+
{
|
|
375
|
+
gl_Position = filterVertexPosition(aPosition);
|
|
376
|
+
vTextureCoord = filterTextureCoord(aPosition);
|
|
377
|
+
vMaskCoord = getFilterCoord(aPosition);
|
|
378
|
+
}
|
|
379
|
+
`,j1=`struct GlobalFilterUniforms {
|
|
380
|
+
uInputSize:vec4<f32>,
|
|
381
|
+
uInputPixel:vec4<f32>,
|
|
382
|
+
uInputClamp:vec4<f32>,
|
|
383
|
+
uOutputFrame:vec4<f32>,
|
|
384
|
+
uGlobalFrame:vec4<f32>,
|
|
385
|
+
uOutputTexture:vec4<f32>,
|
|
386
|
+
};
|
|
387
|
+
|
|
388
|
+
struct MaskUniforms {
|
|
389
|
+
uFilterMatrix:mat3x3<f32>,
|
|
390
|
+
uMaskClamp:vec4<f32>,
|
|
391
|
+
uAlpha:f32,
|
|
392
|
+
uInverse:f32,
|
|
393
|
+
};
|
|
394
|
+
|
|
395
|
+
@group(0) @binding(0) var<uniform> gfu: GlobalFilterUniforms;
|
|
396
|
+
@group(0) @binding(1) var uTexture: texture_2d<f32>;
|
|
397
|
+
@group(0) @binding(2) var uSampler : sampler;
|
|
398
|
+
|
|
399
|
+
@group(1) @binding(0) var<uniform> filterUniforms : MaskUniforms;
|
|
400
|
+
@group(1) @binding(1) var uMaskTexture: texture_2d<f32>;
|
|
401
|
+
|
|
402
|
+
struct VSOutput {
|
|
403
|
+
@builtin(position) position: vec4<f32>,
|
|
404
|
+
@location(0) uv : vec2<f32>,
|
|
405
|
+
@location(1) filterUv : vec2<f32>,
|
|
406
|
+
};
|
|
407
|
+
|
|
408
|
+
fn filterVertexPosition(aPosition:vec2<f32>) -> vec4<f32>
|
|
409
|
+
{
|
|
410
|
+
var position = aPosition * gfu.uOutputFrame.zw + gfu.uOutputFrame.xy;
|
|
411
|
+
|
|
412
|
+
position.x = position.x * (2.0 / gfu.uOutputTexture.x) - 1.0;
|
|
413
|
+
position.y = position.y * (2.0*gfu.uOutputTexture.z / gfu.uOutputTexture.y) - gfu.uOutputTexture.z;
|
|
414
|
+
|
|
415
|
+
return vec4(position, 0.0, 1.0);
|
|
416
|
+
}
|
|
417
|
+
|
|
418
|
+
fn filterTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
|
419
|
+
{
|
|
420
|
+
return aPosition * (gfu.uOutputFrame.zw * gfu.uInputSize.zw);
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
fn globalTextureCoord( aPosition:vec2<f32> ) -> vec2<f32>
|
|
424
|
+
{
|
|
425
|
+
return (aPosition.xy / gfu.uGlobalFrame.zw) + (gfu.uGlobalFrame.xy / gfu.uGlobalFrame.zw);
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
fn getFilterCoord(aPosition:vec2<f32> ) -> vec2<f32>
|
|
429
|
+
{
|
|
430
|
+
return ( filterUniforms.uFilterMatrix * vec3( filterTextureCoord(aPosition), 1.0) ).xy;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
fn getSize() -> vec2<f32>
|
|
434
|
+
{
|
|
435
|
+
return gfu.uGlobalFrame.zw;
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
@vertex
|
|
439
|
+
fn mainVertex(
|
|
440
|
+
@location(0) aPosition : vec2<f32>,
|
|
441
|
+
) -> VSOutput {
|
|
442
|
+
return VSOutput(
|
|
443
|
+
filterVertexPosition(aPosition),
|
|
444
|
+
filterTextureCoord(aPosition),
|
|
445
|
+
getFilterCoord(aPosition)
|
|
446
|
+
);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
@fragment
|
|
450
|
+
fn mainFragment(
|
|
451
|
+
@location(0) uv: vec2<f32>,
|
|
452
|
+
@location(1) filterUv: vec2<f32>,
|
|
453
|
+
@builtin(position) position: vec4<f32>
|
|
454
|
+
) -> @location(0) vec4<f32> {
|
|
455
|
+
|
|
456
|
+
var maskClamp = filterUniforms.uMaskClamp;
|
|
457
|
+
var uAlpha = filterUniforms.uAlpha;
|
|
458
|
+
|
|
459
|
+
var clip = step(3.5,
|
|
460
|
+
step(maskClamp.x, filterUv.x) +
|
|
461
|
+
step(maskClamp.y, filterUv.y) +
|
|
462
|
+
step(filterUv.x, maskClamp.z) +
|
|
463
|
+
step(filterUv.y, maskClamp.w));
|
|
464
|
+
|
|
465
|
+
var mask = textureSample(uMaskTexture, uSampler, filterUv);
|
|
466
|
+
var source = textureSample(uTexture, uSampler, uv);
|
|
467
|
+
var alphaMul = 1.0 - uAlpha * (1.0 - mask.a);
|
|
468
|
+
|
|
469
|
+
var a: f32 = alphaMul * mask.r * uAlpha * clip;
|
|
470
|
+
|
|
471
|
+
if (filterUniforms.uInverse == 1.0) {
|
|
472
|
+
a = 1.0 - a;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
return source * a;
|
|
476
|
+
}
|
|
477
|
+
`;class bU extends Fl{constructor(e){const{sprite:t,...a}=e,r=new Sx(t.texture),u=new Yi({uFilterMatrix:{value:new Pe,type:"mat3x3<f32>"},uMaskClamp:{value:r.uClampFrame,type:"vec4<f32>"},uAlpha:{value:1,type:"f32"},uInverse:{value:e.inverse?1:0,type:"f32"}}),h=su.from({vertex:{source:j1,entryPoint:"mainVertex"},fragment:{source:j1,entryPoint:"mainFragment"}}),d=Cc.from({vertex:vU,fragment:_U,name:"mask-filter"});super({...a,gpuProgram:h,glProgram:d,clipToViewport:!1,resources:{filterUniforms:u,uMaskTexture:t.texture.source}}),this.sprite=t,this._textureMatrix=r}set inverse(e){this.resources.filterUniforms.uniforms.uInverse=e?1:0}get inverse(){return this.resources.filterUniforms.uniforms.uInverse===1}apply(e,t,a,r){this._textureMatrix.texture=this.sprite.texture,e.calculateSpriteMatrix(this.resources.filterUniforms.uniforms.uFilterMatrix,this.sprite).prepend(this._textureMatrix.mapCoord),this.resources.uMaskTexture=this.sprite.texture.source,e.applyFilter(this,t,a,r)}}class uu extends w_{constructor(e){e instanceof Bs&&(e={context:e});const{context:t,roundPixels:a,...r}=e||{};super({label:"Graphics",...r}),this.renderPipeId="graphics",t?this._context=t:this._context=this._ownedContext=new Bs,this._context.on("update",this.onViewUpdate,this),this.didViewUpdate=!0,this.allowChildren=!1,this.roundPixels=a??!1}set context(e){e!==this._context&&(this._context.off("update",this.onViewUpdate,this),this._context=e,this._context.on("update",this.onViewUpdate,this),this.onViewUpdate())}get context(){return this._context}get bounds(){return this._context.bounds}updateBounds(){}containsPoint(e){return this._context.containsPoint(e)}destroy(e){this._ownedContext&&!e?this._ownedContext.destroy(e):(e===!0||(e==null?void 0:e.context)===!0)&&this._context.destroy(e),this._ownedContext=null,this._context=null,super.destroy(e)}_callContextMethod(e,t){return this.context[e](...t),this}setFillStyle(...e){return this._callContextMethod("setFillStyle",e)}setStrokeStyle(...e){return this._callContextMethod("setStrokeStyle",e)}fill(...e){return this._callContextMethod("fill",e)}stroke(...e){return this._callContextMethod("stroke",e)}texture(...e){return this._callContextMethod("texture",e)}beginPath(){return this._callContextMethod("beginPath",[])}cut(){return this._callContextMethod("cut",[])}arc(...e){return this._callContextMethod("arc",e)}arcTo(...e){return this._callContextMethod("arcTo",e)}arcToSvg(...e){return this._callContextMethod("arcToSvg",e)}bezierCurveTo(...e){return this._callContextMethod("bezierCurveTo",e)}closePath(){return this._callContextMethod("closePath",[])}ellipse(...e){return this._callContextMethod("ellipse",e)}circle(...e){return this._callContextMethod("circle",e)}path(...e){return this._callContextMethod("path",e)}lineTo(...e){return this._callContextMethod("lineTo",e)}moveTo(...e){return this._callContextMethod("moveTo",e)}quadraticCurveTo(...e){return this._callContextMethod("quadraticCurveTo",e)}rect(...e){return this._callContextMethod("rect",e)}roundRect(...e){return this._callContextMethod("roundRect",e)}poly(...e){return this._callContextMethod("poly",e)}regularPoly(...e){return this._callContextMethod("regularPoly",e)}roundPoly(...e){return this._callContextMethod("roundPoly",e)}roundShape(...e){return this._callContextMethod("roundShape",e)}filletRect(...e){return this._callContextMethod("filletRect",e)}chamferRect(...e){return this._callContextMethod("chamferRect",e)}star(...e){return this._callContextMethod("star",e)}svg(...e){return this._callContextMethod("svg",e)}restore(...e){return this._callContextMethod("restore",e)}save(){return this._callContextMethod("save",[])}getTransform(){return this.context.getTransform()}resetTransform(){return this._callContextMethod("resetTransform",[])}rotateTransform(...e){return this._callContextMethod("rotate",e)}scaleTransform(...e){return this._callContextMethod("scale",e)}setTransform(...e){return this._callContextMethod("setTransform",e)}transform(...e){return this._callContextMethod("transform",e)}translateTransform(...e){return this._callContextMethod("translate",e)}clear(){return this._callContextMethod("clear",[])}get fillStyle(){return this._context.fillStyle}set fillStyle(e){this._context.fillStyle=e}get strokeStyle(){return this._context.strokeStyle}set strokeStyle(e){this._context.strokeStyle=e}clone(e=!1){return e?new uu(this._context.clone()):(this._ownedContext=null,new uu(this._context))}lineStyle(e,t,a){st(Rt,"Graphics#lineStyle is no longer needed. Use Graphics#setStrokeStyle to set the stroke style.");const r={};return e&&(r.width=e),t&&(r.color=t),a&&(r.alpha=a),this.context.strokeStyle=r,this}beginFill(e,t){st(Rt,"Graphics#beginFill is no longer needed. Use Graphics#fill to fill the shape with the desired style.");const a={};return e!==void 0&&(a.color=e),t!==void 0&&(a.alpha=t),this.context.fillStyle=a,this}endFill(){st(Rt,"Graphics#endFill is no longer needed. Use Graphics#fill to fill the shape with the desired style."),this.context.fill();const e=this.context.strokeStyle;return(e.width!==Bs.defaultStrokeStyle.width||e.color!==Bs.defaultStrokeStyle.color||e.alpha!==Bs.defaultStrokeStyle.alpha)&&this.context.stroke(),this}drawCircle(...e){return st(Rt,"Graphics#drawCircle has been renamed to Graphics#circle"),this._callContextMethod("circle",e)}drawEllipse(...e){return st(Rt,"Graphics#drawEllipse has been renamed to Graphics#ellipse"),this._callContextMethod("ellipse",e)}drawPolygon(...e){return st(Rt,"Graphics#drawPolygon has been renamed to Graphics#poly"),this._callContextMethod("poly",e)}drawRect(...e){return st(Rt,"Graphics#drawRect has been renamed to Graphics#rect"),this._callContextMethod("rect",e)}drawRoundedRect(...e){return st(Rt,"Graphics#drawRoundedRect has been renamed to Graphics#roundRect"),this._callContextMethod("roundRect",e)}drawStar(...e){return st(Rt,"Graphics#drawStar has been renamed to Graphics#star"),this._callContextMethod("star",e)}}const Y1=class ZR extends od{constructor(...e){let t=e[0]??{};t instanceof Float32Array&&(st(Rt,"use new MeshGeometry({ positions, uvs, indices }) instead"),t={positions:t,uvs:e[1],indices:e[2]}),t={...ZR.defaultOptions,...t};const a=t.positions||new Float32Array([0,0,1,0,1,1,0,1]);let r=t.uvs;r||(t.positions?r=new Float32Array(a.length):r=new Float32Array([0,0,1,0,1,1,0,1]));const u=t.indices||new Uint32Array([0,1,2,0,2,3]),h=t.shrinkBuffersToFit,d=new Ea({data:a,label:"attribute-mesh-positions",shrinkToFit:h,usage:xt.VERTEX|xt.COPY_DST}),m=new Ea({data:r,label:"attribute-mesh-uvs",shrinkToFit:h,usage:xt.VERTEX|xt.COPY_DST}),y=new Ea({data:u,label:"index-mesh-buffer",shrinkToFit:h,usage:xt.INDEX|xt.COPY_DST});super({attributes:{aPosition:{buffer:d,format:"float32x2",stride:8,offset:0},aUV:{buffer:m,format:"float32x2",stride:8,offset:0}},indexBuffer:y,topology:t.topology}),this.batchMode="auto"}get positions(){return this.attributes.aPosition.buffer.data}set positions(e){this.attributes.aPosition.buffer.data=e}get uvs(){return this.attributes.aUV.buffer.data}set uvs(e){this.attributes.aUV.buffer.data=e}get indices(){return this.indexBuffer.data}set indices(e){this.indexBuffer.data=e}};Y1.defaultOptions={topology:"triangle-list",shrinkBuffersToFit:!1};let Nv=Y1,cu=null,il=null;function xU(n,e){cu||(cu=Gt.get().createCanvas(256,128),il=cu.getContext("2d",{willReadFrequently:!0}),il.globalCompositeOperation="copy",il.globalAlpha=1),(cu.width<n||cu.height<e)&&(cu.width=vc(n),cu.height=vc(e))}function X1(n,e,t){for(let a=0,r=4*t*e;a<e;++a,r+=4)if(n[r+3]!==0)return!1;return!0}function q1(n,e,t,a,r){const u=4*e;for(let h=a,d=a*u+4*t;h<=r;++h,d+=u)if(n[d+3]!==0)return!1;return!0}function SU(...n){let e=n[0];e.canvas||(e={canvas:n[0],resolution:n[1]});const{canvas:t}=e,a=Math.min(e.resolution??1,1),r=e.width??t.width,u=e.height??t.height;let h=e.output;if(xU(r,u),!il)throw new TypeError("Failed to get canvas 2D context");il.drawImage(t,0,0,r,u,0,0,r*a,u*a);const m=il.getImageData(0,0,r,u).data;let y=0,b=0,S=r-1,T=u-1;for(;b<u&&X1(m,r,b);)++b;if(b===u)return Nt.EMPTY;for(;X1(m,r,T);)--T;for(;q1(m,r,y,b,T);)++y;for(;q1(m,r,S,b,T);)--S;return++S,++T,il.globalCompositeOperation="source-over",il.strokeRect(y,b,S-y,T-b),il.globalCompositeOperation="copy",h??(h=new Nt),h.set(y/a,b/a,(S-y)/a,(T-b)/a),h}const F1=new Nt;class TU{getCanvasAndContext(e){const{text:t,style:a,resolution:r=1}=e,u=a._getFinalPadding(),h=dr.measureText(t||" ",a),d=Math.ceil(Math.ceil(Math.max(1,h.width)+u*2)*r),m=Math.ceil(Math.ceil(Math.max(1,h.height)+u*2)*r),y=kl.getOptimalCanvasAndContext(d,m);this._renderTextToCanvas(t,a,u,r,y);const b=a.trim?SU({canvas:y.canvas,width:d,height:m,resolution:1,output:F1}):F1.set(0,0,d,m);return{canvasAndContext:y,frame:b}}returnCanvasAndContext(e){kl.returnCanvasAndContext(e)}_renderTextToCanvas(e,t,a,r,u){var P,z,Z,ie;const{canvas:h,context:d}=u,m=uy(t),y=dr.measureText(e||" ",t),b=y.lines,S=y.lineHeight,T=y.lineWidths,E=y.maxLineWidth,A=y.fontProperties,B=h.height;if(d.resetTransform(),d.scale(r,r),d.textBaseline=t.textBaseline,(P=t._stroke)!=null&&P.width){const ne=t._stroke;d.lineWidth=ne.width,d.miterLimit=ne.miterLimit,d.lineJoin=ne.join,d.lineCap=ne.cap}d.font=m;let M,G;const w=t.dropShadow?2:1;for(let ne=0;ne<w;++ne){const Se=t.dropShadow&&ne===0,_e=Se?Math.ceil(Math.max(1,B)+a*2):0,me=_e*r;if(Se){d.fillStyle="black",d.strokeStyle="black";const ae=t.dropShadow,We=ae.color,St=ae.alpha;d.shadowColor=Ft.shared.setValue(We).setAlpha(St).toRgbaString();const j=ae.blur*r,ee=ae.distance*r;d.shadowBlur=j,d.shadowOffsetX=Math.cos(ae.angle)*ee,d.shadowOffsetY=Math.sin(ae.angle)*ee+me}else{if(d.fillStyle=t._fill?my(t._fill,d,y,a*2):null,(z=t._stroke)!=null&&z.width){const ae=t._stroke.width*.5+a*2;d.strokeStyle=my(t._stroke,d,y,ae)}d.shadowColor="black"}let se=(S-A.fontSize)/2;S-A.fontSize<0&&(se=0);const Le=((Z=t._stroke)==null?void 0:Z.width)??0;for(let ae=0;ae<b.length;ae++)M=Le/2,G=Le/2+ae*S+A.ascent+se,t.align==="right"?M+=E-T[ae]:t.align==="center"&&(M+=(E-T[ae])/2),(ie=t._stroke)!=null&&ie.width&&this._drawLetterSpacing(b[ae],t,u,M+a,G+a-_e,!0),t._fill!==void 0&&this._drawLetterSpacing(b[ae],t,u,M+a,G+a-_e)}}_drawLetterSpacing(e,t,a,r,u,h=!1){const{context:d}=a,m=t.letterSpacing;let y=!1;if(dr.experimentalLetterSpacingSupported&&(dr.experimentalLetterSpacing?(d.letterSpacing=`${m}px`,d.textLetterSpacing=`${m}px`,y=!0):(d.letterSpacing="0px",d.textLetterSpacing="0px")),m===0||y){h?d.strokeText(e,r,u):d.fillText(e,r,u);return}let b=r;const S=dr.graphemeSegmenter(e);let T=d.measureText(e).width,E=0;for(let A=0;A<S.length;++A){const B=S[A];h?d.strokeText(B,b,u):d.fillText(B,b,u);let M="";for(let G=A+1;G<S.length;++G)M+=S[G];E=d.measureText(M).width,b+=T-E+m,T=E}}}const Gv=new TU,I1="http://www.w3.org/2000/svg",k1="http://www.w3.org/1999/xhtml";class K1{constructor(){this.svgRoot=document.createElementNS(I1,"svg"),this.foreignObject=document.createElementNS(I1,"foreignObject"),this.domElement=document.createElementNS(k1,"div"),this.styleElement=document.createElementNS(k1,"style");const{foreignObject:e,svgRoot:t,styleElement:a,domElement:r}=this;e.setAttribute("width","10000"),e.setAttribute("height","10000"),e.style.overflow="hidden",t.appendChild(e),e.appendChild(a),e.appendChild(r),this.image=Gt.get().createImage()}}let Q1;function EU(n,e,t,a){a||(a=Q1||(Q1=new K1));const{domElement:r,styleElement:u,svgRoot:h}=a;r.innerHTML=`<style>${e.cssStyle};</style><div style='padding:0'>${n}</div>`,r.setAttribute("style","transform-origin: top left; display: inline-block"),t&&(u.textContent=t),document.body.appendChild(h);const d=r.getBoundingClientRect();h.remove();const m=e.padding*2;return{width:d.width-m,height:d.height-m}}class Z1{constructor(){this._tempState=Us.for2d(),this._didUploadHash={}}init(e){e.renderer.runners.contextChange.add(this)}contextChange(){this._didUploadHash={}}start(e,t,a){const r=e.renderer,u=this._didUploadHash[a.uid];r.shader.bind(a,u),u||(this._didUploadHash[a.uid]=!0),r.shader.updateUniformGroup(r.globalUniforms.uniformGroup),r.geometry.bind(t,a.glProgram)}execute(e,t){const a=e.renderer;this._tempState.blendMode=t.blendMode,a.state.set(this._tempState);const r=t.textures.textures;for(let u=0;u<t.textures.count;u++)a.texture.bind(r[u],u);a.geometry.draw(t.topology,t.size,t.start)}}Z1.extension={type:[Q.WebGLPipesAdaptor],name:"batch"};const _y=Us.for2d();class W1{start(e,t,a){const r=e.renderer,u=r.encoder,h=a.gpuProgram;this._shader=a,this._geometry=t,u.setGeometry(t,h),_y.blendMode="normal",r.pipeline.getPipeline(t,h,_y);const d=r.globalUniforms.bindGroup;u.resetBindGroup(1),u.setBindGroup(0,d,h)}execute(e,t){const a=this._shader.gpuProgram,r=e.renderer,u=r.encoder;if(!t.bindGroup){const m=t.textures;t.bindGroup=cv(m.textures,m.count,r.limits.maxBatchableTextures)}_y.blendMode=t.blendMode;const h=r.bindGroup.getBindGroup(t.bindGroup,a,1),d=r.pipeline.getPipeline(this._geometry,a,_y,t.topology);t.bindGroup._touch(r.textureGC.count),u.setPipeline(d),u.renderPassEncoder.setBindGroup(1,h),u.renderPassEncoder.drawIndexed(t.size,1,t.start)}}W1.extension={type:[Q.WebGPUPipesAdaptor],name:"batch"};const wv=class WR{constructor(e,t){var a,r;this.state=Us.for2d(),this._batchersByInstructionSet=Object.create(null),this._activeBatches=Object.create(null),this.renderer=e,this._adaptor=t,(r=(a=this._adaptor).init)==null||r.call(a,this)}static getBatcher(e){return new this._availableBatchers[e]}buildStart(e){let t=this._batchersByInstructionSet[e.uid];t||(t=this._batchersByInstructionSet[e.uid]=Object.create(null),t.default||(t.default=new Sv({maxTextures:this.renderer.limits.maxBatchableTextures}))),this._activeBatches=t,this._activeBatch=this._activeBatches.default;for(const a in this._activeBatches)this._activeBatches[a].begin()}addToBatch(e,t){if(this._activeBatch.name!==e.batcherName){this._activeBatch.break(t);let a=this._activeBatches[e.batcherName];a||(a=this._activeBatches[e.batcherName]=WR.getBatcher(e.batcherName),a.begin()),this._activeBatch=a}this._activeBatch.add(e)}break(e){this._activeBatch.break(e)}buildEnd(e){this._activeBatch.break(e);const t=this._activeBatches;for(const a in t){const r=t[a],u=r.geometry;u.indexBuffer.setDataWithSize(r.indexBuffer,r.indexSize,!0),u.buffers[0].setDataWithSize(r.attributeBuffer.float32View,r.attributeSize,!1)}}upload(e){const t=this._batchersByInstructionSet[e.uid];for(const a in t){const r=t[a],u=r.geometry;r.dirty&&(r.dirty=!1,u.buffers[0].update(r.attributeSize*4))}}execute(e){if(e.action==="startBatch"){const t=e.batcher,a=t.geometry,r=t.shader;this._adaptor.start(this,a,r)}this._adaptor.execute(this,e)}destroy(){this.state=null,this.renderer=null,this._adaptor=null;for(const e in this._activeBatches)this._activeBatches[e].destroy();this._activeBatches=null}};wv.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"batch"},wv._availableBatchers=Object.create(null);let J1=wv;Ie.handleByMap(Q.Batcher,J1._availableBatchers),Ie.add(Sv);const gd={name:"local-uniform-bit",vertex:{header:`
|
|
478
|
+
|
|
479
|
+
struct LocalUniforms {
|
|
480
|
+
uTransformMatrix:mat3x3<f32>,
|
|
481
|
+
uColor:vec4<f32>,
|
|
482
|
+
uRound:f32,
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
@group(1) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
486
|
+
`,main:`
|
|
487
|
+
vColor *= localUniforms.uColor;
|
|
488
|
+
modelMatrix *= localUniforms.uTransformMatrix;
|
|
489
|
+
`,end:`
|
|
490
|
+
if(localUniforms.uRound == 1)
|
|
491
|
+
{
|
|
492
|
+
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
493
|
+
}
|
|
494
|
+
`}},CU={...gd,vertex:{...gd.vertex,header:gd.vertex.header.replace("group(1)","group(2)")}},Pv={name:"local-uniform-bit",vertex:{header:`
|
|
495
|
+
|
|
496
|
+
uniform mat3 uTransformMatrix;
|
|
497
|
+
uniform vec4 uColor;
|
|
498
|
+
uniform float uRound;
|
|
499
|
+
`,main:`
|
|
500
|
+
vColor *= uColor;
|
|
501
|
+
modelMatrix = uTransformMatrix;
|
|
502
|
+
`,end:`
|
|
503
|
+
if(uRound == 1.)
|
|
504
|
+
{
|
|
505
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
506
|
+
}
|
|
507
|
+
`}},RU={name:"texture-bit",vertex:{header:`
|
|
508
|
+
|
|
509
|
+
struct TextureUniforms {
|
|
510
|
+
uTextureMatrix:mat3x3<f32>,
|
|
511
|
+
}
|
|
512
|
+
|
|
513
|
+
@group(2) @binding(2) var<uniform> textureUniforms : TextureUniforms;
|
|
514
|
+
`,main:`
|
|
515
|
+
uv = (textureUniforms.uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
516
|
+
`},fragment:{header:`
|
|
517
|
+
@group(2) @binding(0) var uTexture: texture_2d<f32>;
|
|
518
|
+
@group(2) @binding(1) var uSampler: sampler;
|
|
519
|
+
|
|
520
|
+
|
|
521
|
+
`,main:`
|
|
522
|
+
outColor = textureSample(uTexture, uSampler, vUV);
|
|
523
|
+
`}},AU={name:"texture-bit",vertex:{header:`
|
|
524
|
+
uniform mat3 uTextureMatrix;
|
|
525
|
+
`,main:`
|
|
526
|
+
uv = (uTextureMatrix * vec3(uv, 1.0)).xy;
|
|
527
|
+
`},fragment:{header:`
|
|
528
|
+
uniform sampler2D uTexture;
|
|
529
|
+
|
|
530
|
+
|
|
531
|
+
`,main:`
|
|
532
|
+
outColor = texture(uTexture, vUV);
|
|
533
|
+
`}},MU=new ci;class DU extends Qm{constructor(){super(),this.filters=[new bU({sprite:new au(Ge.EMPTY),inverse:!1,resolution:"inherit",antialias:"inherit"})]}get sprite(){return this.filters[0].sprite}set sprite(e){this.filters[0].sprite=e}get inverse(){return this.filters[0].inverse}set inverse(e){this.filters[0].inverse=e}}class $1{constructor(e){this._activeMaskStage=[],this._renderer=e}push(e,t,a){const r=this._renderer;if(r.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1,maskedContainer:t}),e.inverse=t._maskOptions.inverse,e.renderMaskToTexture){const u=e.mask;u.includeInBuild=!0,u.collectRenderables(a,r,null),u.includeInBuild=!1}r.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"pushMaskEnd",mask:e,maskedContainer:t,inverse:t._maskOptions.inverse,canBundle:!1})}pop(e,t,a){this._renderer.renderPipes.batch.break(a),a.add({renderPipeId:"alphaMask",action:"popMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1})}execute(e){const t=this._renderer,a=e.mask.renderMaskToTexture;if(e.action==="pushMaskBegin"){const r=hi.get(DU);if(r.inverse=e.inverse,a){e.mask.mask.measurable=!0;const u=M_(e.mask.mask,!0,MU);e.mask.mask.measurable=!1,u.ceil();const h=t.renderTarget.renderTarget.colorTexture.source,d=Di.getOptimalTexture(u.width,u.height,h._resolution,h.antialias);t.renderTarget.push(d,!0),t.globalUniforms.push({offset:u,worldColor:4294967295});const m=r.sprite;m.texture=d,m.worldTransform.tx=u.minX,m.worldTransform.ty=u.minY,this._activeMaskStage.push({filterEffect:r,maskedContainer:e.maskedContainer,filterTexture:d})}else r.sprite=e.mask.mask,this._activeMaskStage.push({filterEffect:r,maskedContainer:e.maskedContainer})}else if(e.action==="pushMaskEnd"){const r=this._activeMaskStage[this._activeMaskStage.length-1];a&&(t.type===Ds.WEBGL&&t.renderTarget.finishRenderPass(),t.renderTarget.pop(),t.globalUniforms.pop()),t.filter.push({renderPipeId:"filter",action:"pushFilter",container:r.maskedContainer,filterEffect:r.filterEffect,canBundle:!1})}else if(e.action==="popMaskEnd"){t.filter.pop();const r=this._activeMaskStage.pop();a&&Di.returnTexture(r.filterTexture),hi.return(r.filterEffect)}}destroy(){this._renderer=null,this._activeMaskStage=null}}$1.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"alphaMask"};class eT{constructor(e){this._colorStack=[],this._colorStackIndex=0,this._currentColor=0,this._renderer=e}buildStart(){this._colorStack[0]=15,this._colorStackIndex=1,this._currentColor=15}push(e,t,a){this._renderer.renderPipes.batch.break(a);const u=this._colorStack;u[this._colorStackIndex]=u[this._colorStackIndex-1]&e.mask;const h=this._colorStack[this._colorStackIndex];h!==this._currentColor&&(this._currentColor=h,a.add({renderPipeId:"colorMask",colorMask:h,canBundle:!1})),this._colorStackIndex++}pop(e,t,a){this._renderer.renderPipes.batch.break(a);const u=this._colorStack;this._colorStackIndex--;const h=u[this._colorStackIndex-1];h!==this._currentColor&&(this._currentColor=h,a.add({renderPipeId:"colorMask",colorMask:h,canBundle:!1}))}execute(e){this._renderer.colorMask.setMask(e.colorMask)}destroy(){this._colorStack=null}}eT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"colorMask"};class tT{constructor(e){this._maskStackHash={},this._maskHash=new WeakMap,this._renderer=e}push(e,t,a){var r;const u=e,h=this._renderer;h.renderPipes.batch.break(a),h.renderPipes.blendMode.setBlendMode(u.mask,"none",a),a.add({renderPipeId:"stencilMask",action:"pushMaskBegin",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const d=u.mask;d.includeInBuild=!0,this._maskHash.has(u)||this._maskHash.set(u,{instructionsStart:0,instructionsLength:0});const m=this._maskHash.get(u);m.instructionsStart=a.instructionSize,d.collectRenderables(a,h,null),d.includeInBuild=!1,h.renderPipes.batch.break(a),a.add({renderPipeId:"stencilMask",action:"pushMaskEnd",mask:e,inverse:t._maskOptions.inverse,canBundle:!1});const y=a.instructionSize-m.instructionsStart-1;m.instructionsLength=y;const b=h.renderTarget.renderTarget.uid;(r=this._maskStackHash)[b]??(r[b]=0)}pop(e,t,a){const r=e,u=this._renderer;u.renderPipes.batch.break(a),u.renderPipes.blendMode.setBlendMode(r.mask,"none",a),a.add({renderPipeId:"stencilMask",action:"popMaskBegin",inverse:t._maskOptions.inverse,canBundle:!1});const h=this._maskHash.get(e);for(let d=0;d<h.instructionsLength;d++)a.instructions[a.instructionSize++]=a.instructions[h.instructionsStart++];a.add({renderPipeId:"stencilMask",action:"popMaskEnd",canBundle:!1})}execute(e){var t;const a=this._renderer,r=a.renderTarget.renderTarget.uid;let u=(t=this._maskStackHash)[r]??(t[r]=0);e.action==="pushMaskBegin"?(a.renderTarget.ensureDepthStencil(),a.stencil.setStencilMode(bn.RENDERING_MASK_ADD,u),u++,a.colorMask.setMask(0)):e.action==="pushMaskEnd"?(e.inverse?a.stencil.setStencilMode(bn.INVERSE_MASK_ACTIVE,u):a.stencil.setStencilMode(bn.MASK_ACTIVE,u),a.colorMask.setMask(15)):e.action==="popMaskBegin"?(a.colorMask.setMask(0),u!==0?a.stencil.setStencilMode(bn.RENDERING_MASK_REMOVE,u):(a.renderTarget.clear(null,Ta.STENCIL),a.stencil.setStencilMode(bn.DISABLED,u)),u--):e.action==="popMaskEnd"&&(e.inverse?a.stencil.setStencilMode(bn.INVERSE_MASK_ACTIVE,u):a.stencil.setStencilMode(bn.MASK_ACTIVE,u),a.colorMask.setMask(15)),this._maskStackHash[r]=u}destroy(){this._renderer=null,this._maskStackHash=null,this._maskHash=null}}tT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"stencilMask"};var vy=(n=>(n[n.ELEMENT_ARRAY_BUFFER=34963]="ELEMENT_ARRAY_BUFFER",n[n.ARRAY_BUFFER=34962]="ARRAY_BUFFER",n[n.UNIFORM_BUFFER=35345]="UNIFORM_BUFFER",n))(vy||{});class UU{constructor(e,t){this._lastBindBaseLocation=-1,this._lastBindCallId=-1,this.buffer=e||null,this.updateID=-1,this.byteLength=-1,this.type=t}}class nT{constructor(e){this._gpuBuffers=Object.create(null),this._boundBufferBases=Object.create(null),this._minBaseLocation=0,this._nextBindBaseIndex=this._minBaseLocation,this._bindCallId=0,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBuffers")}destroy(){this._renderer=null,this._gl=null,this._gpuBuffers=null,this._boundBufferBases=null}contextChange(){this._gl=this._renderer.gl,this._gpuBuffers=Object.create(null),this._maxBindings=this._renderer.limits.maxUniformBindings}getGlBuffer(e){return this._gpuBuffers[e.uid]||this.createGLBuffer(e)}bind(e){const{_gl:t}=this,a=this.getGlBuffer(e);t.bindBuffer(a.type,a.buffer)}bindBufferBase(e,t){const{_gl:a}=this;this._boundBufferBases[t]!==e&&(this._boundBufferBases[t]=e,e._lastBindBaseLocation=t,a.bindBufferBase(a.UNIFORM_BUFFER,t,e.buffer))}nextBindBase(e){this._bindCallId++,this._minBaseLocation=0,e&&(this._boundBufferBases[0]=null,this._minBaseLocation=1,this._nextBindBaseIndex<1&&(this._nextBindBaseIndex=1))}freeLocationForBufferBase(e){let t=this.getLastBindBaseLocation(e);if(t>=this._minBaseLocation)return e._lastBindCallId=this._bindCallId,t;let a=0,r=this._nextBindBaseIndex;for(;a<2;){r>=this._maxBindings&&(r=this._minBaseLocation,a++);const u=this._boundBufferBases[r];if(u&&u._lastBindCallId===this._bindCallId){r++;continue}break}return t=r,this._nextBindBaseIndex=r+1,a>=2?-1:(e._lastBindCallId=this._bindCallId,this._boundBufferBases[t]=null,t)}getLastBindBaseLocation(e){const t=e._lastBindBaseLocation;return this._boundBufferBases[t]===e?t:-1}bindBufferRange(e,t,a,r){const{_gl:u}=this;a||(a=0),t||(t=0),this._boundBufferBases[t]=null,u.bindBufferRange(u.UNIFORM_BUFFER,t||0,e.buffer,a*256,r||256)}updateBuffer(e){const{_gl:t}=this,a=this.getGlBuffer(e);if(e._updateID===a.updateID)return a;a.updateID=e._updateID,t.bindBuffer(a.type,a.buffer);const r=e.data,u=e.descriptor.usage&xt.STATIC?t.STATIC_DRAW:t.DYNAMIC_DRAW;return r?a.byteLength>=r.byteLength?t.bufferSubData(a.type,0,r,0,e._updateSize/r.BYTES_PER_ELEMENT):(a.byteLength=r.byteLength,t.bufferData(a.type,r,u)):(a.byteLength=e.descriptor.size,t.bufferData(a.type,a.byteLength,u)),a}destroyAll(){const e=this._gl;for(const t in this._gpuBuffers)e.deleteBuffer(this._gpuBuffers[t].buffer);this._gpuBuffers=Object.create(null)}onBufferDestroy(e,t){const a=this._gpuBuffers[e.uid],r=this._gl;t||r.deleteBuffer(a.buffer),this._gpuBuffers[e.uid]=null}createGLBuffer(e){const{_gl:t}=this;let a=vy.ARRAY_BUFFER;e.descriptor.usage&xt.INDEX?a=vy.ELEMENT_ARRAY_BUFFER:e.descriptor.usage&xt.UNIFORM&&(a=vy.UNIFORM_BUFFER);const r=new UU(t.createBuffer(),a);return this._gpuBuffers[e.uid]=r,e.on("destroy",this.onBufferDestroy,this),r}resetState(){this._boundBufferBases=Object.create(null)}}nT.extension={type:[Q.WebGLSystem],name:"buffer"};const zv=class JR{constructor(e){this.supports={uint32Indices:!0,uniformBufferObject:!0,vertexArrayObject:!0,srgbTextures:!0,nonPowOf2wrapping:!0,msaa:!0,nonPowOf2mipmaps:!0},this._renderer=e,this.extensions=Object.create(null),this.handleContextLost=this.handleContextLost.bind(this),this.handleContextRestored=this.handleContextRestored.bind(this)}get isLost(){return!this.gl||this.gl.isContextLost()}contextChange(e){this.gl=e,this._renderer.gl=e}init(e){e={...JR.defaultOptions,...e};let t=this.multiView=e.multiView;if(e.context&&t&&(rt("Renderer created with both a context and multiview enabled. Disabling multiView as both cannot work together."),t=!1),t?this.canvas=Gt.get().createCanvas(this._renderer.canvas.width,this._renderer.canvas.height):this.canvas=this._renderer.view.canvas,e.context)this.initFromContext(e.context);else{const a=this._renderer.background.alpha<1,r=e.premultipliedAlpha??!0,u=e.antialias&&!this._renderer.backBuffer.useBackBuffer;this.createContext(e.preferWebGLVersion,{alpha:a,premultipliedAlpha:r,antialias:u,stencil:!0,preserveDrawingBuffer:e.preserveDrawingBuffer,powerPreference:e.powerPreference??"default"})}}ensureCanvasSize(e){if(!this.multiView){e!==this.canvas&&rt("multiView is disabled, but targetCanvas is not the main canvas");return}const{canvas:t}=this;(t.width<e.width||t.height<e.height)&&(t.width=Math.max(e.width,e.width),t.height=Math.max(e.height,e.height))}initFromContext(e){this.gl=e,this.webGLVersion=e instanceof Gt.get().getWebGLRenderingContext()?1:2,this.getExtensions(),this.validateContext(e),this._renderer.runners.contextChange.emit(e);const t=this._renderer.view.canvas;t.addEventListener("webglcontextlost",this.handleContextLost,!1),t.addEventListener("webglcontextrestored",this.handleContextRestored,!1)}createContext(e,t){let a;const r=this.canvas;if(e===2&&(a=r.getContext("webgl2",t)),!a&&(a=r.getContext("webgl",t),!a))throw new Error("This browser does not support WebGL. Try using the canvas renderer");this.gl=a,this.initFromContext(this.gl)}getExtensions(){const{gl:e}=this,t={anisotropicFiltering:e.getExtension("EXT_texture_filter_anisotropic"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),s3tc:e.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:e.getExtension("WEBGL_compressed_texture_s3tc_srgb"),etc:e.getExtension("WEBGL_compressed_texture_etc"),etc1:e.getExtension("WEBGL_compressed_texture_etc1"),pvrtc:e.getExtension("WEBGL_compressed_texture_pvrtc")||e.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),atc:e.getExtension("WEBGL_compressed_texture_atc"),astc:e.getExtension("WEBGL_compressed_texture_astc"),bptc:e.getExtension("EXT_texture_compression_bptc"),rgtc:e.getExtension("EXT_texture_compression_rgtc"),loseContext:e.getExtension("WEBGL_lose_context")};if(this.webGLVersion===1)this.extensions={...t,drawBuffers:e.getExtension("WEBGL_draw_buffers"),depthTexture:e.getExtension("WEBGL_depth_texture"),vertexArrayObject:e.getExtension("OES_vertex_array_object")||e.getExtension("MOZ_OES_vertex_array_object")||e.getExtension("WEBKIT_OES_vertex_array_object"),uint32ElementIndex:e.getExtension("OES_element_index_uint"),floatTexture:e.getExtension("OES_texture_float"),floatTextureLinear:e.getExtension("OES_texture_float_linear"),textureHalfFloat:e.getExtension("OES_texture_half_float"),textureHalfFloatLinear:e.getExtension("OES_texture_half_float_linear"),vertexAttribDivisorANGLE:e.getExtension("ANGLE_instanced_arrays"),srgb:e.getExtension("EXT_sRGB")};else{this.extensions={...t,colorBufferFloat:e.getExtension("EXT_color_buffer_float")};const a=e.getExtension("WEBGL_provoking_vertex");a&&a.provokingVertexWEBGL(a.FIRST_VERTEX_CONVENTION_WEBGL)}}handleContextLost(e){e.preventDefault(),this._contextLossForced&&(this._contextLossForced=!1,setTimeout(()=>{var t;this.gl.isContextLost()&&((t=this.extensions.loseContext)==null||t.restoreContext())},0))}handleContextRestored(){this.getExtensions(),this._renderer.runners.contextChange.emit(this.gl)}destroy(){var t;const e=this._renderer.view.canvas;this._renderer=null,e.removeEventListener("webglcontextlost",this.handleContextLost),e.removeEventListener("webglcontextrestored",this.handleContextRestored),this.gl.useProgram(null),(t=this.extensions.loseContext)==null||t.loseContext()}forceContextLoss(){var e;(e=this.extensions.loseContext)==null||e.loseContext(),this._contextLossForced=!0}validateContext(e){const t=e.getContextAttributes();t&&!t.stencil&&rt("Provided WebGL context does not have a stencil buffer, masks may not render correctly");const a=this.supports,r=this.webGLVersion===2,u=this.extensions;a.uint32Indices=r||!!u.uint32ElementIndex,a.uniformBufferObject=r,a.vertexArrayObject=r||!!u.vertexArrayObject,a.srgbTextures=r||!!u.srgb,a.nonPowOf2wrapping=r,a.nonPowOf2mipmaps=r,a.msaa=r,a.uint32Indices||rt("Provided WebGL context does not support 32 index buffer, large scenes may not render correctly")}};zv.extension={type:[Q.WebGLSystem],name:"context"},zv.defaultOptions={context:null,premultipliedAlpha:!0,preserveDrawingBuffer:!1,powerPreference:void 0,preferWebGLVersion:2,multiView:!1};let BU=zv;function iT(n,e){for(const t in n.attributes){const a=n.attributes[t],r=e[t];r?(a.format??(a.format=r.format),a.offset??(a.offset=r.offset),a.instance??(a.instance=r.instance)):rt(`Attribute ${t} is not present in the shader, but is present in the geometry. Unable to infer attribute details.`)}OU(n)}function OU(n){const{buffers:e,attributes:t}=n,a={},r={};for(const u in e){const h=e[u];a[h.uid]=0,r[h.uid]=0}for(const u in t){const h=t[u];a[h.buffer.uid]+=ql(h.format).stride}for(const u in t){const h=t[u];h.stride??(h.stride=a[h.buffer.uid]),h.start??(h.start=r[h.buffer.uid]),r[h.buffer.uid]+=ql(h.format).stride}}var Hv=(n=>(n[n.RGBA=6408]="RGBA",n[n.RGB=6407]="RGB",n[n.RG=33319]="RG",n[n.RED=6403]="RED",n[n.RGBA_INTEGER=36249]="RGBA_INTEGER",n[n.RGB_INTEGER=36248]="RGB_INTEGER",n[n.RG_INTEGER=33320]="RG_INTEGER",n[n.RED_INTEGER=36244]="RED_INTEGER",n[n.ALPHA=6406]="ALPHA",n[n.LUMINANCE=6409]="LUMINANCE",n[n.LUMINANCE_ALPHA=6410]="LUMINANCE_ALPHA",n[n.DEPTH_COMPONENT=6402]="DEPTH_COMPONENT",n[n.DEPTH_STENCIL=34041]="DEPTH_STENCIL",n))(Hv||{}),aT=(n=>(n[n.TEXTURE_2D=3553]="TEXTURE_2D",n[n.TEXTURE_CUBE_MAP=34067]="TEXTURE_CUBE_MAP",n[n.TEXTURE_2D_ARRAY=35866]="TEXTURE_2D_ARRAY",n[n.TEXTURE_CUBE_MAP_POSITIVE_X=34069]="TEXTURE_CUBE_MAP_POSITIVE_X",n[n.TEXTURE_CUBE_MAP_NEGATIVE_X=34070]="TEXTURE_CUBE_MAP_NEGATIVE_X",n[n.TEXTURE_CUBE_MAP_POSITIVE_Y=34071]="TEXTURE_CUBE_MAP_POSITIVE_Y",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Y=34072]="TEXTURE_CUBE_MAP_NEGATIVE_Y",n[n.TEXTURE_CUBE_MAP_POSITIVE_Z=34073]="TEXTURE_CUBE_MAP_POSITIVE_Z",n[n.TEXTURE_CUBE_MAP_NEGATIVE_Z=34074]="TEXTURE_CUBE_MAP_NEGATIVE_Z",n))(aT||{}),Ct=(n=>(n[n.UNSIGNED_BYTE=5121]="UNSIGNED_BYTE",n[n.UNSIGNED_SHORT=5123]="UNSIGNED_SHORT",n[n.UNSIGNED_SHORT_5_6_5=33635]="UNSIGNED_SHORT_5_6_5",n[n.UNSIGNED_SHORT_4_4_4_4=32819]="UNSIGNED_SHORT_4_4_4_4",n[n.UNSIGNED_SHORT_5_5_5_1=32820]="UNSIGNED_SHORT_5_5_5_1",n[n.UNSIGNED_INT=5125]="UNSIGNED_INT",n[n.UNSIGNED_INT_10F_11F_11F_REV=35899]="UNSIGNED_INT_10F_11F_11F_REV",n[n.UNSIGNED_INT_2_10_10_10_REV=33640]="UNSIGNED_INT_2_10_10_10_REV",n[n.UNSIGNED_INT_24_8=34042]="UNSIGNED_INT_24_8",n[n.UNSIGNED_INT_5_9_9_9_REV=35902]="UNSIGNED_INT_5_9_9_9_REV",n[n.BYTE=5120]="BYTE",n[n.SHORT=5122]="SHORT",n[n.INT=5124]="INT",n[n.FLOAT=5126]="FLOAT",n[n.FLOAT_32_UNSIGNED_INT_24_8_REV=36269]="FLOAT_32_UNSIGNED_INT_24_8_REV",n[n.HALF_FLOAT=36193]="HALF_FLOAT",n))(Ct||{});const sT={uint8x2:Ct.UNSIGNED_BYTE,uint8x4:Ct.UNSIGNED_BYTE,sint8x2:Ct.BYTE,sint8x4:Ct.BYTE,unorm8x2:Ct.UNSIGNED_BYTE,unorm8x4:Ct.UNSIGNED_BYTE,snorm8x2:Ct.BYTE,snorm8x4:Ct.BYTE,uint16x2:Ct.UNSIGNED_SHORT,uint16x4:Ct.UNSIGNED_SHORT,sint16x2:Ct.SHORT,sint16x4:Ct.SHORT,unorm16x2:Ct.UNSIGNED_SHORT,unorm16x4:Ct.UNSIGNED_SHORT,snorm16x2:Ct.SHORT,snorm16x4:Ct.SHORT,float16x2:Ct.HALF_FLOAT,float16x4:Ct.HALF_FLOAT,float32:Ct.FLOAT,float32x2:Ct.FLOAT,float32x3:Ct.FLOAT,float32x4:Ct.FLOAT,uint32:Ct.UNSIGNED_INT,uint32x2:Ct.UNSIGNED_INT,uint32x3:Ct.UNSIGNED_INT,uint32x4:Ct.UNSIGNED_INT,sint32:Ct.INT,sint32x2:Ct.INT,sint32x3:Ct.INT,sint32x4:Ct.INT};function NU(n){return sT[n]??sT.float32}const GU={"point-list":0,"line-list":1,"line-strip":3,"triangle-list":4,"triangle-strip":5};class rT{constructor(e){this._geometryVaoHash=Object.create(null),this._renderer=e,this._activeGeometry=null,this._activeVao=null,this.hasVao=!0,this.hasInstance=!0,this._renderer.renderableGC.addManagedHash(this,"_geometryVaoHash")}contextChange(){const e=this.gl=this._renderer.gl;if(!this._renderer.context.supports.vertexArrayObject)throw new Error("[PixiJS] Vertex Array Objects are not supported on this device");const t=this._renderer.context.extensions.vertexArrayObject;t&&(e.createVertexArray=()=>t.createVertexArrayOES(),e.bindVertexArray=r=>t.bindVertexArrayOES(r),e.deleteVertexArray=r=>t.deleteVertexArrayOES(r));const a=this._renderer.context.extensions.vertexAttribDivisorANGLE;a&&(e.drawArraysInstanced=(r,u,h,d)=>{a.drawArraysInstancedANGLE(r,u,h,d)},e.drawElementsInstanced=(r,u,h,d,m)=>{a.drawElementsInstancedANGLE(r,u,h,d,m)},e.vertexAttribDivisor=(r,u)=>a.vertexAttribDivisorANGLE(r,u)),this._activeGeometry=null,this._activeVao=null,this._geometryVaoHash=Object.create(null)}bind(e,t){const a=this.gl;this._activeGeometry=e;const r=this.getVao(e,t);this._activeVao!==r&&(this._activeVao=r,a.bindVertexArray(r)),this.updateBuffers()}resetState(){this.unbind()}updateBuffers(){const e=this._activeGeometry,t=this._renderer.buffer;for(let a=0;a<e.buffers.length;a++){const r=e.buffers[a];t.updateBuffer(r)}}checkCompatibility(e,t){const a=e.attributes,r=t._attributeData;for(const u in r)if(!a[u])throw new Error(`shader and geometry incompatible, geometry missing the "${u}" attribute`)}getSignature(e,t){const a=e.attributes,r=t._attributeData,u=["g",e.uid];for(const h in a)r[h]&&u.push(h,r[h].location);return u.join("-")}getVao(e,t){var a;return((a=this._geometryVaoHash[e.uid])==null?void 0:a[t._key])||this.initGeometryVao(e,t)}initGeometryVao(e,t,a=!0){const r=this._renderer.gl,u=this._renderer.buffer;this._renderer.shader._getProgramData(t),this.checkCompatibility(e,t);const h=this.getSignature(e,t);this._geometryVaoHash[e.uid]||(this._geometryVaoHash[e.uid]=Object.create(null),e.on("destroy",this.onGeometryDestroy,this));const d=this._geometryVaoHash[e.uid];let m=d[h];if(m)return d[t._key]=m,m;iT(e,t._attributeData);const y=e.buffers;m=r.createVertexArray(),r.bindVertexArray(m);for(let b=0;b<y.length;b++){const S=y[b];u.bind(S)}return this.activateVao(e,t),d[t._key]=m,d[h]=m,r.bindVertexArray(null),m}onGeometryDestroy(e,t){const a=this._geometryVaoHash[e.uid],r=this.gl;if(a){if(t)for(const u in a)this._activeVao!==a[u]&&this.unbind(),r.deleteVertexArray(a[u]);this._geometryVaoHash[e.uid]=null}}destroyAll(e=!1){const t=this.gl;for(const a in this._geometryVaoHash){if(e)for(const r in this._geometryVaoHash[a]){const u=this._geometryVaoHash[a];this._activeVao!==u&&this.unbind(),t.deleteVertexArray(u[r])}this._geometryVaoHash[a]=null}}activateVao(e,t){var d;const a=this._renderer.gl,r=this._renderer.buffer,u=e.attributes;e.indexBuffer&&r.bind(e.indexBuffer);let h=null;for(const m in u){const y=u[m],b=y.buffer,S=r.getGlBuffer(b),T=t._attributeData[m];if(T){h!==S&&(r.bind(b),h=S);const E=T.location;a.enableVertexAttribArray(E);const A=ql(y.format),B=NU(y.format);if(((d=T.format)==null?void 0:d.substring(1,4))==="int"?a.vertexAttribIPointer(E,A.size,B,y.stride,y.offset):a.vertexAttribPointer(E,A.size,B,A.normalised,y.stride,y.offset),y.instance)if(this.hasInstance){const M=y.divisor??1;a.vertexAttribDivisor(E,M)}else throw new Error("geometry error, GPU Instancing is not supported on this device")}}}draw(e,t,a,r){const{gl:u}=this._renderer,h=this._activeGeometry,d=GU[e||h.topology];if(r??(r=h.instanceCount),h.indexBuffer){const m=h.indexBuffer.data.BYTES_PER_ELEMENT,y=m===2?u.UNSIGNED_SHORT:u.UNSIGNED_INT;r>1?u.drawElementsInstanced(d,t||h.indexBuffer.data.length,y,(a||0)*m,r):u.drawElements(d,t||h.indexBuffer.data.length,y,(a||0)*m)}else r>1?u.drawArraysInstanced(d,a||0,t||h.getSize(),r):u.drawArrays(d,a||0,t||h.getSize());return this}unbind(){this.gl.bindVertexArray(null),this._activeVao=null,this._activeGeometry=null}destroy(){this._renderer=null,this.gl=null,this._activeVao=null,this._activeGeometry=null}}rT.extension={type:[Q.WebGLSystem],name:"geometry"};const wU=new od({attributes:{aPosition:[-1,-1,3,-1,-1,3]}}),Vv=class $R{constructor(e){this.useBackBuffer=!1,this._useBackBufferThisRender=!1,this._renderer=e}init(e={}){const{useBackBuffer:t,antialias:a}={...$R.defaultOptions,...e};this.useBackBuffer=t,this._antialias=a,this._renderer.context.supports.msaa||(rt("antialiasing, is not supported on when using the back buffer"),this._antialias=!1),this._state=Us.for2d();const r=new Cc({vertex:`
|
|
534
|
+
attribute vec2 aPosition;
|
|
535
|
+
out vec2 vUv;
|
|
536
|
+
|
|
537
|
+
void main() {
|
|
538
|
+
gl_Position = vec4(aPosition, 0.0, 1.0);
|
|
539
|
+
|
|
540
|
+
vUv = (aPosition + 1.0) / 2.0;
|
|
541
|
+
|
|
542
|
+
// flip dem UVs
|
|
543
|
+
vUv.y = 1.0 - vUv.y;
|
|
544
|
+
}`,fragment:`
|
|
545
|
+
in vec2 vUv;
|
|
546
|
+
out vec4 finalColor;
|
|
547
|
+
|
|
548
|
+
uniform sampler2D uTexture;
|
|
549
|
+
|
|
550
|
+
void main() {
|
|
551
|
+
finalColor = texture(uTexture, vUv);
|
|
552
|
+
}`,name:"big-triangle"});this._bigTriangleShader=new ka({glProgram:r,resources:{uTexture:Ge.WHITE.source}})}renderStart(e){const t=this._renderer.renderTarget.getRenderTarget(e.target);if(this._useBackBufferThisRender=this.useBackBuffer&&!!t.isRoot,this._useBackBufferThisRender){const a=this._renderer.renderTarget.getRenderTarget(e.target);this._targetTexture=a.colorTexture,e.target=this._getBackBufferTexture(a.colorTexture)}}renderEnd(){this._presentBackBuffer()}_presentBackBuffer(){const e=this._renderer;e.renderTarget.finishRenderPass(),this._useBackBufferThisRender&&(e.renderTarget.bind(this._targetTexture,!1),this._bigTriangleShader.resources.uTexture=this._backBufferTexture.source,e.encoder.draw({geometry:wU,shader:this._bigTriangleShader,state:this._state}))}_getBackBufferTexture(e){return this._backBufferTexture=this._backBufferTexture||new Ge({source:new Nn({width:e.width,height:e.height,resolution:e._resolution,antialias:this._antialias})}),this._backBufferTexture.source.resize(e.width,e.height,e._resolution),this._backBufferTexture}destroy(){this._backBufferTexture&&(this._backBufferTexture.destroy(),this._backBufferTexture=null)}};Vv.extension={type:[Q.WebGLSystem],name:"backBuffer",priority:1},Vv.defaultOptions={useBackBuffer:!1};let PU=Vv;class lT{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.gl.colorMask(!!(e&8),!!(e&4),!!(e&2),!!(e&1)))}}lT.extension={type:[Q.WebGLSystem],name:"colorMask"};class oT{constructor(e){this.commandFinished=Promise.resolve(),this._renderer=e}setGeometry(e,t){this._renderer.geometry.bind(e,t.glProgram)}finishRenderPass(){}draw(e){const t=this._renderer,{geometry:a,shader:r,state:u,skipSync:h,topology:d,size:m,start:y,instanceCount:b}=e;t.shader.bind(r,h),t.geometry.bind(a,t.shader._activeProgram),u&&t.state.set(u),t.geometry.draw(d,m,y,b??a.instanceCount)}destroy(){this._renderer=null}}oT.extension={type:[Q.WebGLSystem],name:"encoder"};class uT{constructor(e){this._renderer=e}contextChange(){const e=this._renderer.gl;this.maxTextures=e.getParameter(e.MAX_TEXTURE_IMAGE_UNITS),this.maxBatchableTextures=ZS(this.maxTextures,e),this.maxUniformBindings=e.getParameter(e.MAX_UNIFORM_BUFFER_BINDINGS)}destroy(){}}uT.extension={type:[Q.WebGLSystem],name:"limits"};class zU{constructor(){this.width=-1,this.height=-1,this.msaa=!1,this.msaaRenderBuffer=[]}}const Ql=[];Ql[bn.NONE]=void 0,Ql[bn.DISABLED]={stencilWriteMask:0,stencilReadMask:0},Ql[bn.RENDERING_MASK_ADD]={stencilFront:{compare:"equal",passOp:"increment-clamp"},stencilBack:{compare:"equal",passOp:"increment-clamp"}},Ql[bn.RENDERING_MASK_REMOVE]={stencilFront:{compare:"equal",passOp:"decrement-clamp"},stencilBack:{compare:"equal",passOp:"decrement-clamp"}},Ql[bn.MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"equal",passOp:"keep"},stencilBack:{compare:"equal",passOp:"keep"}},Ql[bn.INVERSE_MASK_ACTIVE]={stencilWriteMask:0,stencilFront:{compare:"not-equal",passOp:"keep"},stencilBack:{compare:"not-equal",passOp:"keep"}};class cT{constructor(e){this._stencilCache={enabled:!1,stencilReference:0,stencilMode:bn.NONE},this._renderTargetStencilState=Object.create(null),e.renderTarget.onRenderTargetChange.add(this)}contextChange(e){this._gl=e,this._comparisonFuncMapping={always:e.ALWAYS,never:e.NEVER,equal:e.EQUAL,"not-equal":e.NOTEQUAL,less:e.LESS,"less-equal":e.LEQUAL,greater:e.GREATER,"greater-equal":e.GEQUAL},this._stencilOpsMapping={keep:e.KEEP,zero:e.ZERO,replace:e.REPLACE,invert:e.INVERT,"increment-clamp":e.INCR,"decrement-clamp":e.DECR,"increment-wrap":e.INCR_WRAP,"decrement-wrap":e.DECR_WRAP},this.resetState()}onRenderTargetChange(e){if(this._activeRenderTarget===e)return;this._activeRenderTarget=e;let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:bn.DISABLED,stencilReference:0}),this.setStencilMode(t.stencilMode,t.stencilReference)}resetState(){this._stencilCache.enabled=!1,this._stencilCache.stencilMode=bn.NONE,this._stencilCache.stencilReference=0}setStencilMode(e,t){const a=this._renderTargetStencilState[this._activeRenderTarget.uid],r=this._gl,u=Ql[e],h=this._stencilCache;if(a.stencilMode=e,a.stencilReference=t,e===bn.DISABLED){this._stencilCache.enabled&&(this._stencilCache.enabled=!1,r.disable(r.STENCIL_TEST));return}this._stencilCache.enabled||(this._stencilCache.enabled=!0,r.enable(r.STENCIL_TEST)),(e!==h.stencilMode||h.stencilReference!==t)&&(h.stencilMode=e,h.stencilReference=t,r.stencilFunc(this._comparisonFuncMapping[u.stencilBack.compare],t,255),r.stencilOp(r.KEEP,r.KEEP,this._stencilOpsMapping[u.stencilBack.passOp]))}}cT.extension={type:[Q.WebGLSystem],name:"stencil"};class hT{constructor(e){this._syncFunctionHash=Object.create(null),this._adaptor=e,this._systemCheck()}_systemCheck(){if(!DS())throw new Error("Current environment does not allow unsafe-eval, please use pixi.js/unsafe-eval module to enable support.")}ensureUniformGroup(e){const t=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ea({data:new Float32Array(t.layout.size/4),usage:xt.UNIFORM|xt.COPY_DST}))}getUniformGroupData(e){return this._syncFunctionHash[e._signature]||this._initUniformGroup(e)}_initUniformGroup(e){const t=e._signature;let a=this._syncFunctionHash[t];if(!a){const r=Object.keys(e.uniformStructures).map(d=>e.uniformStructures[d]),u=this._adaptor.createUboElements(r),h=this._generateUboSync(u.uboElements);a=this._syncFunctionHash[t]={layout:u,syncFunction:h}}return this._syncFunctionHash[t]}_generateUboSync(e){return this._adaptor.generateUboSync(e)}syncUniformGroup(e,t,a){const r=this.getUniformGroupData(e);e.buffer||(e.buffer=new Ea({data:new Float32Array(r.layout.size/4),usage:xt.UNIFORM|xt.COPY_DST}));let u=null;return t||(t=e.buffer.data,u=e.buffer.dataInt32),a||(a=0),r.syncFunction(e.uniforms,t,u,a),!0}updateUniformGroup(e){if(e.isStatic&&!e._dirtyId)return!1;e._dirtyId=0;const t=this.syncUniformGroup(e);return e.buffer.update(),t}destroy(){this._syncFunctionHash=null}}const fT={f32:4,i32:4,"vec2<f32>":8,"vec3<f32>":12,"vec4<f32>":16,"vec2<i32>":8,"vec3<i32>":12,"vec4<i32>":16,"mat2x2<f32>":32,"mat3x3<f32>":48,"mat4x4<f32>":64};function HU(n){const e=n.map(u=>({data:u,offset:0,size:0})),t=16;let a=0,r=0;for(let u=0;u<e.length;u++){const h=e[u];if(a=fT[h.data.type],!a)throw new Error(`Unknown type ${h.data.type}`);h.data.size>1&&(a=Math.max(a,t)*h.data.size);const d=a===12?16:a;h.size=a;const m=r%t;m>0&&t-m<d?r+=(t-m)%16:r+=(a-m%a)%a,h.offset=r,r+=a}return r=Math.ceil(r/16)*16,{uboElements:e,size:r}}const hu=[{type:"mat3x3<f32>",test:n=>n.value.a!==void 0,ubo:`
|
|
553
|
+
var matrix = uv[name].toArray(true);
|
|
554
|
+
data[offset] = matrix[0];
|
|
555
|
+
data[offset + 1] = matrix[1];
|
|
556
|
+
data[offset + 2] = matrix[2];
|
|
557
|
+
data[offset + 4] = matrix[3];
|
|
558
|
+
data[offset + 5] = matrix[4];
|
|
559
|
+
data[offset + 6] = matrix[5];
|
|
560
|
+
data[offset + 8] = matrix[6];
|
|
561
|
+
data[offset + 9] = matrix[7];
|
|
562
|
+
data[offset + 10] = matrix[8];
|
|
563
|
+
`,uniform:`
|
|
564
|
+
gl.uniformMatrix3fv(ud[name].location, false, uv[name].toArray(true));
|
|
565
|
+
`},{type:"vec4<f32>",test:n=>n.type==="vec4<f32>"&&n.size===1&&n.value.width!==void 0,ubo:`
|
|
566
|
+
v = uv[name];
|
|
567
|
+
data[offset] = v.x;
|
|
568
|
+
data[offset + 1] = v.y;
|
|
569
|
+
data[offset + 2] = v.width;
|
|
570
|
+
data[offset + 3] = v.height;
|
|
571
|
+
`,uniform:`
|
|
572
|
+
cv = ud[name].value;
|
|
573
|
+
v = uv[name];
|
|
574
|
+
if (cv[0] !== v.x || cv[1] !== v.y || cv[2] !== v.width || cv[3] !== v.height) {
|
|
575
|
+
cv[0] = v.x;
|
|
576
|
+
cv[1] = v.y;
|
|
577
|
+
cv[2] = v.width;
|
|
578
|
+
cv[3] = v.height;
|
|
579
|
+
gl.uniform4f(ud[name].location, v.x, v.y, v.width, v.height);
|
|
580
|
+
}
|
|
581
|
+
`},{type:"vec2<f32>",test:n=>n.type==="vec2<f32>"&&n.size===1&&n.value.x!==void 0,ubo:`
|
|
582
|
+
v = uv[name];
|
|
583
|
+
data[offset] = v.x;
|
|
584
|
+
data[offset + 1] = v.y;
|
|
585
|
+
`,uniform:`
|
|
586
|
+
cv = ud[name].value;
|
|
587
|
+
v = uv[name];
|
|
588
|
+
if (cv[0] !== v.x || cv[1] !== v.y) {
|
|
589
|
+
cv[0] = v.x;
|
|
590
|
+
cv[1] = v.y;
|
|
591
|
+
gl.uniform2f(ud[name].location, v.x, v.y);
|
|
592
|
+
}
|
|
593
|
+
`},{type:"vec4<f32>",test:n=>n.type==="vec4<f32>"&&n.size===1&&n.value.red!==void 0,ubo:`
|
|
594
|
+
v = uv[name];
|
|
595
|
+
data[offset] = v.red;
|
|
596
|
+
data[offset + 1] = v.green;
|
|
597
|
+
data[offset + 2] = v.blue;
|
|
598
|
+
data[offset + 3] = v.alpha;
|
|
599
|
+
`,uniform:`
|
|
600
|
+
cv = ud[name].value;
|
|
601
|
+
v = uv[name];
|
|
602
|
+
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue || cv[3] !== v.alpha) {
|
|
603
|
+
cv[0] = v.red;
|
|
604
|
+
cv[1] = v.green;
|
|
605
|
+
cv[2] = v.blue;
|
|
606
|
+
cv[3] = v.alpha;
|
|
607
|
+
gl.uniform4f(ud[name].location, v.red, v.green, v.blue, v.alpha);
|
|
608
|
+
}
|
|
609
|
+
`},{type:"vec3<f32>",test:n=>n.type==="vec3<f32>"&&n.size===1&&n.value.red!==void 0,ubo:`
|
|
610
|
+
v = uv[name];
|
|
611
|
+
data[offset] = v.red;
|
|
612
|
+
data[offset + 1] = v.green;
|
|
613
|
+
data[offset + 2] = v.blue;
|
|
614
|
+
`,uniform:`
|
|
615
|
+
cv = ud[name].value;
|
|
616
|
+
v = uv[name];
|
|
617
|
+
if (cv[0] !== v.red || cv[1] !== v.green || cv[2] !== v.blue) {
|
|
618
|
+
cv[0] = v.red;
|
|
619
|
+
cv[1] = v.green;
|
|
620
|
+
cv[2] = v.blue;
|
|
621
|
+
gl.uniform3f(ud[name].location, v.red, v.green, v.blue);
|
|
622
|
+
}
|
|
623
|
+
`}];function dT(n,e,t,a){const r=[`
|
|
624
|
+
var v = null;
|
|
625
|
+
var v2 = null;
|
|
626
|
+
var t = 0;
|
|
627
|
+
var index = 0;
|
|
628
|
+
var name = null;
|
|
629
|
+
var arrayOffset = null;
|
|
630
|
+
`];let u=0;for(let d=0;d<n.length;d++){const m=n[d],y=m.data.name;let b=!1,S=0;for(let T=0;T<hu.length;T++)if(hu[T].test(m.data)){S=m.offset/4,r.push(`name = "${y}";`,`offset += ${S-u};`,hu[T][e]||hu[T].ubo),b=!0;break}if(!b)if(m.data.size>1)S=m.offset/4,r.push(t(m,S-u));else{const T=a[m.data.type];S=m.offset/4,r.push(`
|
|
631
|
+
v = uv.${y};
|
|
632
|
+
offset += ${S-u};
|
|
633
|
+
${T};
|
|
634
|
+
`)}u=S}const h=r.join(`
|
|
635
|
+
`);return new Function("uv","data","dataInt32","offset",h)}function Bc(n,e){return`
|
|
636
|
+
for (let i = 0; i < ${n*e}; i++) {
|
|
637
|
+
data[offset + (((i / ${n})|0) * 4) + (i % ${n})] = v[i];
|
|
638
|
+
}
|
|
639
|
+
`}const pT={f32:`
|
|
640
|
+
data[offset] = v;`,i32:`
|
|
641
|
+
dataInt32[offset] = v;`,"vec2<f32>":`
|
|
642
|
+
data[offset] = v[0];
|
|
643
|
+
data[offset + 1] = v[1];`,"vec3<f32>":`
|
|
644
|
+
data[offset] = v[0];
|
|
645
|
+
data[offset + 1] = v[1];
|
|
646
|
+
data[offset + 2] = v[2];`,"vec4<f32>":`
|
|
647
|
+
data[offset] = v[0];
|
|
648
|
+
data[offset + 1] = v[1];
|
|
649
|
+
data[offset + 2] = v[2];
|
|
650
|
+
data[offset + 3] = v[3];`,"vec2<i32>":`
|
|
651
|
+
dataInt32[offset] = v[0];
|
|
652
|
+
dataInt32[offset + 1] = v[1];`,"vec3<i32>":`
|
|
653
|
+
dataInt32[offset] = v[0];
|
|
654
|
+
dataInt32[offset + 1] = v[1];
|
|
655
|
+
dataInt32[offset + 2] = v[2];`,"vec4<i32>":`
|
|
656
|
+
dataInt32[offset] = v[0];
|
|
657
|
+
dataInt32[offset + 1] = v[1];
|
|
658
|
+
dataInt32[offset + 2] = v[2];
|
|
659
|
+
dataInt32[offset + 3] = v[3];`,"mat2x2<f32>":`
|
|
660
|
+
data[offset] = v[0];
|
|
661
|
+
data[offset + 1] = v[1];
|
|
662
|
+
data[offset + 4] = v[2];
|
|
663
|
+
data[offset + 5] = v[3];`,"mat3x3<f32>":`
|
|
664
|
+
data[offset] = v[0];
|
|
665
|
+
data[offset + 1] = v[1];
|
|
666
|
+
data[offset + 2] = v[2];
|
|
667
|
+
data[offset + 4] = v[3];
|
|
668
|
+
data[offset + 5] = v[4];
|
|
669
|
+
data[offset + 6] = v[5];
|
|
670
|
+
data[offset + 8] = v[6];
|
|
671
|
+
data[offset + 9] = v[7];
|
|
672
|
+
data[offset + 10] = v[8];`,"mat4x4<f32>":`
|
|
673
|
+
for (let i = 0; i < 16; i++) {
|
|
674
|
+
data[offset + i] = v[i];
|
|
675
|
+
}`,"mat3x2<f32>":Bc(3,2),"mat4x2<f32>":Bc(4,2),"mat2x3<f32>":Bc(2,3),"mat4x3<f32>":Bc(4,3),"mat2x4<f32>":Bc(2,4),"mat3x4<f32>":Bc(3,4)},VU={...pT,"mat2x2<f32>":`
|
|
676
|
+
data[offset] = v[0];
|
|
677
|
+
data[offset + 1] = v[1];
|
|
678
|
+
data[offset + 2] = v[2];
|
|
679
|
+
data[offset + 3] = v[3];
|
|
680
|
+
`};function LU(n,e){const t=Math.max(fT[n.data.type]/16,1),a=n.data.value.length/n.data.size,r=(4-a%4)%4,u=n.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
681
|
+
v = uv.${n.data.name};
|
|
682
|
+
offset += ${e};
|
|
683
|
+
|
|
684
|
+
arrayOffset = offset;
|
|
685
|
+
|
|
686
|
+
t = 0;
|
|
687
|
+
|
|
688
|
+
for(var i=0; i < ${n.data.size*t}; i++)
|
|
689
|
+
{
|
|
690
|
+
for(var j = 0; j < ${a}; j++)
|
|
691
|
+
{
|
|
692
|
+
${u}[arrayOffset++] = v[t++];
|
|
693
|
+
}
|
|
694
|
+
${r!==0?`arrayOffset += ${r};`:""}
|
|
695
|
+
}
|
|
696
|
+
`}function jU(n){return dT(n,"uboStd40",LU,pT)}class mT extends hT{constructor(){super({createUboElements:HU,generateUboSync:jU})}}mT.extension={type:[Q.WebGLSystem],name:"ubo"};class YU{constructor(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Nt}init(e,t){this._renderer=e,this._renderTargetSystem=t,e.runners.contextChange.add(this)}contextChange(){this._clearColorCache=[0,0,0,0],this._viewPortCache=new Nt}copyToTexture(e,t,a,r,u){const h=this._renderTargetSystem,d=this._renderer,m=h.getGpuRenderTarget(e),y=d.gl;return this.finishRenderPass(e),y.bindFramebuffer(y.FRAMEBUFFER,m.resolveTargetFramebuffer),d.texture.bind(t,0),y.copyTexSubImage2D(y.TEXTURE_2D,0,u.x,u.y,a.x,a.y,r.width,r.height),t}startRenderPass(e,t=!0,a,r){const u=this._renderTargetSystem,h=e.colorTexture,d=u.getGpuRenderTarget(e);let m=r.y;e.isRoot&&(m=h.pixelHeight-r.height),e.colorTextures.forEach(S=>{this._renderer.texture.unbind(S)});const y=this._renderer.gl;y.bindFramebuffer(y.FRAMEBUFFER,d.framebuffer);const b=this._viewPortCache;(b.x!==r.x||b.y!==m||b.width!==r.width||b.height!==r.height)&&(b.x=r.x,b.y=m,b.width=r.width,b.height=r.height,y.viewport(r.x,m,r.width,r.height)),!d.depthStencilRenderBuffer&&(e.stencil||e.depth)&&this._initStencil(d),this.clear(e,t,a)}finishRenderPass(e){const a=this._renderTargetSystem.getGpuRenderTarget(e);if(!a.msaa)return;const r=this._renderer.gl;r.bindFramebuffer(r.FRAMEBUFFER,a.resolveTargetFramebuffer),r.bindFramebuffer(r.READ_FRAMEBUFFER,a.framebuffer),r.blitFramebuffer(0,0,a.width,a.height,0,0,a.width,a.height,r.COLOR_BUFFER_BIT,r.NEAREST),r.bindFramebuffer(r.FRAMEBUFFER,a.framebuffer)}initGpuRenderTarget(e){const a=this._renderer.gl,r=new zU;return e.colorTexture instanceof Jr?(this._renderer.context.ensureCanvasSize(e.colorTexture.resource),r.framebuffer=null,r):(this._initColor(e,r),a.bindFramebuffer(a.FRAMEBUFFER,null),r)}destroyGpuRenderTarget(e){const t=this._renderer.gl;e.framebuffer&&(t.deleteFramebuffer(e.framebuffer),e.framebuffer=null),e.resolveTargetFramebuffer&&(t.deleteFramebuffer(e.resolveTargetFramebuffer),e.resolveTargetFramebuffer=null),e.depthStencilRenderBuffer&&(t.deleteRenderbuffer(e.depthStencilRenderBuffer),e.depthStencilRenderBuffer=null),e.msaaRenderBuffer.forEach(a=>{t.deleteRenderbuffer(a)}),e.msaaRenderBuffer=null}clear(e,t,a){if(!t)return;const r=this._renderTargetSystem;typeof t=="boolean"&&(t=t?Ta.ALL:Ta.NONE);const u=this._renderer.gl;if(t&Ta.COLOR){a??(a=r.defaultClearColor);const h=this._clearColorCache,d=a;(h[0]!==d[0]||h[1]!==d[1]||h[2]!==d[2]||h[3]!==d[3])&&(h[0]=d[0],h[1]=d[1],h[2]=d[2],h[3]=d[3],u.clearColor(d[0],d[1],d[2],d[3]))}u.clear(t)}resizeGpuRenderTarget(e){if(e.isRoot)return;const a=this._renderTargetSystem.getGpuRenderTarget(e);this._resizeColor(e,a),(e.stencil||e.depth)&&this._resizeStencil(a)}_initColor(e,t){const a=this._renderer,r=a.gl,u=r.createFramebuffer();if(t.resolveTargetFramebuffer=u,r.bindFramebuffer(r.FRAMEBUFFER,u),t.width=e.colorTexture.source.pixelWidth,t.height=e.colorTexture.source.pixelHeight,e.colorTextures.forEach((h,d)=>{const m=h.source;m.antialias&&(a.context.supports.msaa?t.msaa=!0:rt("[RenderTexture] Antialiasing on textures is not supported in WebGL1")),a.texture.bindSource(m,0);const b=a.texture.getGlSource(m).texture;r.framebufferTexture2D(r.FRAMEBUFFER,r.COLOR_ATTACHMENT0+d,3553,b,0)}),t.msaa){const h=r.createFramebuffer();t.framebuffer=h,r.bindFramebuffer(r.FRAMEBUFFER,h),e.colorTextures.forEach((d,m)=>{const y=r.createRenderbuffer();t.msaaRenderBuffer[m]=y})}else t.framebuffer=u;this._resizeColor(e,t)}_resizeColor(e,t){const a=e.colorTexture.source;if(t.width=a.pixelWidth,t.height=a.pixelHeight,e.colorTextures.forEach((r,u)=>{u!==0&&r.source.resize(a.width,a.height,a._resolution)}),t.msaa){const r=this._renderer,u=r.gl,h=t.framebuffer;u.bindFramebuffer(u.FRAMEBUFFER,h),e.colorTextures.forEach((d,m)=>{const y=d.source;r.texture.bindSource(y,0);const S=r.texture.getGlSource(y).internalFormat,T=t.msaaRenderBuffer[m];u.bindRenderbuffer(u.RENDERBUFFER,T),u.renderbufferStorageMultisample(u.RENDERBUFFER,4,S,y.pixelWidth,y.pixelHeight),u.framebufferRenderbuffer(u.FRAMEBUFFER,u.COLOR_ATTACHMENT0+m,u.RENDERBUFFER,T)})}}_initStencil(e){if(e.framebuffer===null)return;const t=this._renderer.gl,a=t.createRenderbuffer();e.depthStencilRenderBuffer=a,t.bindRenderbuffer(t.RENDERBUFFER,a),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.RENDERBUFFER,a),this._resizeStencil(e)}_resizeStencil(e){const t=this._renderer.gl;t.bindRenderbuffer(t.RENDERBUFFER,e.depthStencilRenderBuffer),e.msaa?t.renderbufferStorageMultisample(t.RENDERBUFFER,4,t.DEPTH24_STENCIL8,e.width,e.height):t.renderbufferStorage(t.RENDERBUFFER,this._renderer.context.webGLVersion===2?t.DEPTH24_STENCIL8:t.DEPTH_STENCIL,e.width,e.height)}prerender(e){const t=e.colorTexture.resource;this._renderer.context.multiView&&Jr.test(t)&&this._renderer.context.ensureCanvasSize(t)}postrender(e){if(this._renderer.context.multiView&&Jr.test(e.colorTexture.resource)){const t=this._renderer.context.canvas,a=e.colorTexture;a.context2D.drawImage(t,0,a.pixelHeight-t.height)}}}function XU(n,e,t,a,r,u){const h=u?1:-1;return n.identity(),n.a=1/a*2,n.d=h*(1/r*2),n.tx=-1-e*n.a,n.ty=-h-t*n.d,n}const _d=new Map;function yT(n,e){if(!_d.has(n)){const t=new Ge({source:new Jr({resource:n,...e})}),a=()=>{_d.get(n)===t&&_d.delete(n)};t.once("destroy",a),t.source.once("destroy",a),_d.set(n,t)}return _d.get(n)}function qU(n){const e=n.colorTexture.source.resource;return globalThis.HTMLCanvasElement&&e instanceof HTMLCanvasElement&&document.body.contains(e)}const gT=class eA{constructor(e={}){if(this.uid=Kt("renderTarget"),this.colorTextures=[],this.dirtyId=0,this.isRoot=!1,this._size=new Float32Array(2),this._managedColorTextures=!1,e={...eA.defaultOptions,...e},this.stencil=e.stencil,this.depth=e.depth,this.isRoot=e.isRoot,typeof e.colorTextures=="number"){this._managedColorTextures=!0;for(let t=0;t<e.colorTextures;t++)this.colorTextures.push(new Nn({width:e.width,height:e.height,resolution:e.resolution,antialias:e.antialias}))}else{this.colorTextures=[...e.colorTextures.map(a=>a.source)];const t=this.colorTexture.source;this.resize(t.width,t.height,t._resolution)}this.colorTexture.source.on("resize",this.onSourceResize,this),(e.depthStencilTexture||this.stencil)&&(e.depthStencilTexture instanceof Ge||e.depthStencilTexture instanceof Nn?this.depthStencilTexture=e.depthStencilTexture.source:this.ensureDepthStencilTexture())}get size(){const e=this._size;return e[0]=this.pixelWidth,e[1]=this.pixelHeight,e}get width(){return this.colorTexture.source.width}get height(){return this.colorTexture.source.height}get pixelWidth(){return this.colorTexture.source.pixelWidth}get pixelHeight(){return this.colorTexture.source.pixelHeight}get resolution(){return this.colorTexture.source._resolution}get colorTexture(){return this.colorTextures[0]}onSourceResize(e){this.resize(e.width,e.height,e._resolution,!0)}ensureDepthStencilTexture(){this.depthStencilTexture||(this.depthStencilTexture=new Nn({width:this.width,height:this.height,resolution:this.resolution,format:"depth24plus-stencil8",autoGenerateMipmaps:!1,antialias:!1,mipLevelCount:1}))}resize(e,t,a=this.resolution,r=!1){this.dirtyId++,this.colorTextures.forEach((u,h)=>{r&&h===0||u.source.resize(e,t,a)}),this.depthStencilTexture&&this.depthStencilTexture.source.resize(e,t,a)}destroy(){this.colorTexture.source.off("resize",this.onSourceResize,this),this._managedColorTextures&&this.colorTextures.forEach(e=>{e.destroy()}),this.depthStencilTexture&&(this.depthStencilTexture.destroy(),delete this.depthStencilTexture)}};gT.defaultOptions={width:0,height:0,resolution:1,colorTextures:1,stencil:!1,depth:!1,antialias:!1,isRoot:!1};let Lv=gT;class _T{constructor(e){this.rootViewPort=new Nt,this.viewport=new Nt,this.onRenderTargetChange=new PS("onRenderTargetChange"),this.projectionMatrix=new Pe,this.defaultClearColor=[0,0,0,0],this._renderSurfaceToRenderTargetHash=new Map,this._gpuRenderTargetHash=Object.create(null),this._renderTargetStack=[],this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuRenderTargetHash")}finishRenderPass(){this.adaptor.finishRenderPass(this.renderTarget)}renderStart({target:e,clear:t,clearColor:a,frame:r}){var u,h;this._renderTargetStack.length=0,this.push(e,t,a,r),this.rootViewPort.copyFrom(this.viewport),this.rootRenderTarget=this.renderTarget,this.renderingToScreen=qU(this.rootRenderTarget),(h=(u=this.adaptor).prerender)==null||h.call(u,this.rootRenderTarget)}postrender(){var e,t;(t=(e=this.adaptor).postrender)==null||t.call(e,this.rootRenderTarget)}bind(e,t=!0,a,r){const u=this.getRenderTarget(e),h=this.renderTarget!==u;this.renderTarget=u,this.renderSurface=e;const d=this.getGpuRenderTarget(u);(u.pixelWidth!==d.width||u.pixelHeight!==d.height)&&(this.adaptor.resizeGpuRenderTarget(u),d.width=u.pixelWidth,d.height=u.pixelHeight);const m=u.colorTexture,y=this.viewport,b=m.pixelWidth,S=m.pixelHeight;if(!r&&e instanceof Ge&&(r=e.frame),r){const T=m._resolution;y.x=r.x*T+.5|0,y.y=r.y*T+.5|0,y.width=r.width*T+.5|0,y.height=r.height*T+.5|0}else y.x=0,y.y=0,y.width=b,y.height=S;return XU(this.projectionMatrix,0,0,y.width/m.resolution,y.height/m.resolution,!u.isRoot),this.adaptor.startRenderPass(u,t,a,y),h&&this.onRenderTargetChange.emit(u),u}clear(e,t=Ta.ALL,a){t&&(e&&(e=this.getRenderTarget(e)),this.adaptor.clear(e||this.renderTarget,t,a,this.viewport))}contextChange(){this._gpuRenderTargetHash=Object.create(null)}push(e,t=Ta.ALL,a,r){const u=this.bind(e,t,a,r);return this._renderTargetStack.push({renderTarget:u,frame:r}),u}pop(){this._renderTargetStack.pop();const e=this._renderTargetStack[this._renderTargetStack.length-1];this.bind(e.renderTarget,!1,null,e.frame)}getRenderTarget(e){return e.isTexture&&(e=e.source),this._renderSurfaceToRenderTargetHash.get(e)??this._initRenderTarget(e)}copyToTexture(e,t,a,r,u){a.x<0&&(r.width+=a.x,u.x-=a.x,a.x=0),a.y<0&&(r.height+=a.y,u.y-=a.y,a.y=0);const{pixelWidth:h,pixelHeight:d}=e;return r.width=Math.min(r.width,h-a.x),r.height=Math.min(r.height,d-a.y),this.adaptor.copyToTexture(e,t,a,r,u)}ensureDepthStencil(){this.renderTarget.stencil||(this.renderTarget.stencil=!0,this.adaptor.startRenderPass(this.renderTarget,!1,null,this.viewport))}destroy(){this._renderer=null,this._renderSurfaceToRenderTargetHash.forEach((e,t)=>{e!==t&&e.destroy()}),this._renderSurfaceToRenderTargetHash.clear(),this._gpuRenderTargetHash=Object.create(null)}_initRenderTarget(e){let t=null;return Jr.test(e)&&(e=yT(e).source),e instanceof Lv?t=e:e instanceof Nn&&(t=new Lv({colorTextures:[e]}),e.source instanceof Jr&&(t.isRoot=!0),e.once("destroy",()=>{t.destroy(),this._renderSurfaceToRenderTargetHash.delete(e);const a=this._gpuRenderTargetHash[t.uid];a&&(this._gpuRenderTargetHash[t.uid]=null,this.adaptor.destroyGpuRenderTarget(a))})),this._renderSurfaceToRenderTargetHash.set(e,t),t}getGpuRenderTarget(e){return this._gpuRenderTargetHash[e.uid]||(this._gpuRenderTargetHash[e.uid]=this.adaptor.initGpuRenderTarget(e))}resetState(){this.renderTarget=null,this.renderSurface=null}}class vT extends _T{constructor(e){super(e),this.adaptor=new YU,this.adaptor.init(e,this)}}vT.extension={type:[Q.WebGLSystem],name:"renderTarget"};class jv extends Sa{constructor({buffer:e,offset:t,size:a}){super(),this.uid=Kt("buffer"),this._resourceType="bufferResource",this._touched=0,this._resourceId=Kt("resource"),this._bufferResource=!0,this.destroyed=!1,this.buffer=e,this.offset=t|0,this.size=a,this.buffer.on("change",this.onBufferChange,this)}onBufferChange(){this._resourceId=Kt("resource"),this.emit("change",this)}destroy(e=!1){this.destroyed=!0,e&&this.buffer.destroy(),this.emit("change",this),this.buffer=null}}function FU(n,e){const t=[],a=[`
|
|
697
|
+
var g = s.groups;
|
|
698
|
+
var sS = r.shader;
|
|
699
|
+
var p = s.glProgram;
|
|
700
|
+
var ugS = r.uniformGroup;
|
|
701
|
+
var resources;
|
|
702
|
+
`];let r=!1,u=0;const h=e._getProgramData(n.glProgram);for(const m in n.groups){const y=n.groups[m];t.push(`
|
|
703
|
+
resources = g[${m}].resources;
|
|
704
|
+
`);for(const b in y.resources){const S=y.resources[b];if(S instanceof Yi)if(S.ubo){const T=n._uniformBindMap[m][Number(b)];t.push(`
|
|
705
|
+
sS.bindUniformBlock(
|
|
706
|
+
resources[${b}],
|
|
707
|
+
'${T}',
|
|
708
|
+
${n.glProgram._uniformBlockData[T].index}
|
|
709
|
+
);
|
|
710
|
+
`)}else t.push(`
|
|
711
|
+
ugS.updateUniformGroup(resources[${b}], p, sD);
|
|
712
|
+
`);else if(S instanceof jv){const T=n._uniformBindMap[m][Number(b)];t.push(`
|
|
713
|
+
sS.bindUniformBlock(
|
|
714
|
+
resources[${b}],
|
|
715
|
+
'${T}',
|
|
716
|
+
${n.glProgram._uniformBlockData[T].index}
|
|
717
|
+
);
|
|
718
|
+
`)}else if(S instanceof Nn){const T=n._uniformBindMap[m][b],E=h.uniformData[T];E&&(r||(r=!0,a.push(`
|
|
719
|
+
var tS = r.texture;
|
|
720
|
+
`)),e._gl.uniform1i(E.location,u),t.push(`
|
|
721
|
+
tS.bind(resources[${b}], ${u});
|
|
722
|
+
`),u++)}}}const d=[...a,...t].join(`
|
|
723
|
+
`);return new Function("r","s","sD",d)}class IU{constructor(e,t){this.program=e,this.uniformData=t,this.uniformGroups={},this.uniformDirtyGroups={},this.uniformBlockBindings={}}destroy(){this.uniformData=null,this.uniformGroups=null,this.uniformDirtyGroups=null,this.uniformBlockBindings=null,this.program=null}}function bT(n,e,t){const a=n.createShader(e);return n.shaderSource(a,t),n.compileShader(a),a}function Yv(n){const e=new Array(n);for(let t=0;t<e.length;t++)e[t]=!1;return e}function xT(n,e){switch(n){case"float":return 0;case"vec2":return new Float32Array(2*e);case"vec3":return new Float32Array(3*e);case"vec4":return new Float32Array(4*e);case"int":case"uint":case"sampler2D":case"sampler2DArray":return 0;case"ivec2":return new Int32Array(2*e);case"ivec3":return new Int32Array(3*e);case"ivec4":return new Int32Array(4*e);case"uvec2":return new Uint32Array(2*e);case"uvec3":return new Uint32Array(3*e);case"uvec4":return new Uint32Array(4*e);case"bool":return!1;case"bvec2":return Yv(2*e);case"bvec3":return Yv(3*e);case"bvec4":return Yv(4*e);case"mat2":return new Float32Array([1,0,0,1]);case"mat3":return new Float32Array([1,0,0,0,1,0,0,0,1]);case"mat4":return new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])}return null}let by=null;const ST={FLOAT:"float",FLOAT_VEC2:"vec2",FLOAT_VEC3:"vec3",FLOAT_VEC4:"vec4",INT:"int",INT_VEC2:"ivec2",INT_VEC3:"ivec3",INT_VEC4:"ivec4",UNSIGNED_INT:"uint",UNSIGNED_INT_VEC2:"uvec2",UNSIGNED_INT_VEC3:"uvec3",UNSIGNED_INT_VEC4:"uvec4",BOOL:"bool",BOOL_VEC2:"bvec2",BOOL_VEC3:"bvec3",BOOL_VEC4:"bvec4",FLOAT_MAT2:"mat2",FLOAT_MAT3:"mat3",FLOAT_MAT4:"mat4",SAMPLER_2D:"sampler2D",INT_SAMPLER_2D:"sampler2D",UNSIGNED_INT_SAMPLER_2D:"sampler2D",SAMPLER_CUBE:"samplerCube",INT_SAMPLER_CUBE:"samplerCube",UNSIGNED_INT_SAMPLER_CUBE:"samplerCube",SAMPLER_2D_ARRAY:"sampler2DArray",INT_SAMPLER_2D_ARRAY:"sampler2DArray",UNSIGNED_INT_SAMPLER_2D_ARRAY:"sampler2DArray"},kU={float:"float32",vec2:"float32x2",vec3:"float32x3",vec4:"float32x4",int:"sint32",ivec2:"sint32x2",ivec3:"sint32x3",ivec4:"sint32x4",uint:"uint32",uvec2:"uint32x2",uvec3:"uint32x3",uvec4:"uint32x4",bool:"uint32",bvec2:"uint32x2",bvec3:"uint32x3",bvec4:"uint32x4"};function TT(n,e){if(!by){const t=Object.keys(ST);by={};for(let a=0;a<t.length;++a){const r=t[a];by[n[r]]=ST[r]}}return by[e]}function KU(n,e){const t=TT(n,e);return kU[t]||"float32"}function QU(n,e,t=!1){const a={},r=e.getProgramParameter(n,e.ACTIVE_ATTRIBUTES);for(let h=0;h<r;h++){const d=e.getActiveAttrib(n,h);if(d.name.startsWith("gl_"))continue;const m=KU(e,d.type);a[d.name]={location:0,format:m,stride:ql(m).stride,offset:0,instance:!1,start:0}}const u=Object.keys(a);if(t){u.sort((h,d)=>h>d?1:-1);for(let h=0;h<u.length;h++)a[u[h]].location=h,e.bindAttribLocation(n,h,u[h]);e.linkProgram(n)}else for(let h=0;h<u.length;h++)a[u[h]].location=e.getAttribLocation(n,u[h]);return a}function ZU(n,e){if(!e.ACTIVE_UNIFORM_BLOCKS)return{};const t={},a=e.getProgramParameter(n,e.ACTIVE_UNIFORM_BLOCKS);for(let r=0;r<a;r++){const u=e.getActiveUniformBlockName(n,r),h=e.getUniformBlockIndex(n,u),d=e.getActiveUniformBlockParameter(n,r,e.UNIFORM_BLOCK_DATA_SIZE);t[u]={name:u,index:h,size:d}}return t}function WU(n,e){const t={},a=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let r=0;r<a;r++){const u=e.getActiveUniform(n,r),h=u.name.replace(/\[.*?\]$/,""),d=!!u.name.match(/\[.*?\]$/),m=TT(e,u.type);t[h]={name:h,index:r,type:m,size:u.size,isArray:d,value:xT(m,u.size)}}return t}function ET(n,e){const t=n.getShaderSource(e).split(`
|
|
724
|
+
`).map((y,b)=>`${b}: ${y}`),a=n.getShaderInfoLog(e),r=a.split(`
|
|
725
|
+
`),u={},h=r.map(y=>parseFloat(y.replace(/^ERROR\: 0\:([\d]+)\:.*$/,"$1"))).filter(y=>y&&!u[y]?(u[y]=!0,!0):!1),d=[""];h.forEach(y=>{t[y-1]=`%c${t[y-1]}%c`,d.push("background: #FF0000; color:#FFFFFF; font-size: 10px","font-size: 10px")});const m=t.join(`
|
|
726
|
+
`);d[0]=m,console.error(a),console.groupCollapsed("click to view full shader code"),console.warn(...d),console.groupEnd()}function JU(n,e,t,a){n.getProgramParameter(e,n.LINK_STATUS)||(n.getShaderParameter(t,n.COMPILE_STATUS)||ET(n,t),n.getShaderParameter(a,n.COMPILE_STATUS)||ET(n,a),console.error("PixiJS Error: Could not initialize shader."),n.getProgramInfoLog(e)!==""&&console.warn("PixiJS Warning: gl.getProgramInfoLog()",n.getProgramInfoLog(e)))}function $U(n,e){const t=bT(n,n.VERTEX_SHADER,e.vertex),a=bT(n,n.FRAGMENT_SHADER,e.fragment),r=n.createProgram();n.attachShader(r,t),n.attachShader(r,a);const u=e.transformFeedbackVaryings;u&&(typeof n.transformFeedbackVaryings!="function"?rt("TransformFeedback is not supported but TransformFeedbackVaryings are given."):n.transformFeedbackVaryings(r,u.names,u.bufferMode==="separate"?n.SEPARATE_ATTRIBS:n.INTERLEAVED_ATTRIBS)),n.linkProgram(r),n.getProgramParameter(r,n.LINK_STATUS)||JU(n,r,t,a),e._attributeData=QU(r,n,!/^[ \t]*#[ \t]*version[ \t]+300[ \t]+es[ \t]*$/m.test(e.vertex)),e._uniformData=WU(r,n),e._uniformBlockData=ZU(r,n),n.deleteShader(t),n.deleteShader(a);const h={};for(const m in e._uniformData){const y=e._uniformData[m];h[m]={location:n.getUniformLocation(r,m),value:xT(y.type,y.size)}}return new IU(r,h)}const xy={textureCount:0,blockIndex:0};class CT{constructor(e){this._activeProgram=null,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_programDataHash")}contextChange(e){this._gl=e,this._programDataHash=Object.create(null),this._shaderSyncFunctions=Object.create(null),this._activeProgram=null}bind(e,t){if(this._setProgram(e.glProgram),t)return;xy.textureCount=0,xy.blockIndex=0;let a=this._shaderSyncFunctions[e.glProgram._key];a||(a=this._shaderSyncFunctions[e.glProgram._key]=this._generateShaderSync(e,this)),this._renderer.buffer.nextBindBase(!!e.glProgram.transformFeedbackVaryings),a(this._renderer,e,xy)}updateUniformGroup(e){this._renderer.uniformGroup.updateUniformGroup(e,this._activeProgram,xy)}bindUniformBlock(e,t,a=0){const r=this._renderer.buffer,u=this._getProgramData(this._activeProgram),h=e._bufferResource;h||this._renderer.ubo.updateUniformGroup(e);const d=e.buffer,m=r.updateBuffer(d),y=r.freeLocationForBufferBase(m);if(h){const{offset:S,size:T}=e;S===0&&T===d.data.byteLength?r.bindBufferBase(m,y):r.bindBufferRange(m,y,S)}else r.getLastBindBaseLocation(m)!==y&&r.bindBufferBase(m,y);const b=this._activeProgram._uniformBlockData[t].index;u.uniformBlockBindings[a]!==y&&(u.uniformBlockBindings[a]=y,this._renderer.gl.uniformBlockBinding(u.program,b,y))}_setProgram(e){if(this._activeProgram===e)return;this._activeProgram=e;const t=this._getProgramData(e);this._gl.useProgram(t.program)}_getProgramData(e){return this._programDataHash[e._key]||this._createProgramData(e)}_createProgramData(e){const t=e._key;return this._programDataHash[t]=$U(this._gl,e),this._programDataHash[t]}destroy(){for(const e of Object.keys(this._programDataHash))this._programDataHash[e].destroy(),this._programDataHash[e]=null;this._programDataHash=null}_generateShaderSync(e,t){return FU(e,t)}resetState(){this._activeProgram=null}}CT.extension={type:[Q.WebGLSystem],name:"shader"};const e4={f32:`if (cv !== v) {
|
|
727
|
+
cu.value = v;
|
|
728
|
+
gl.uniform1f(location, v);
|
|
729
|
+
}`,"vec2<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
730
|
+
cv[0] = v[0];
|
|
731
|
+
cv[1] = v[1];
|
|
732
|
+
gl.uniform2f(location, v[0], v[1]);
|
|
733
|
+
}`,"vec3<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
734
|
+
cv[0] = v[0];
|
|
735
|
+
cv[1] = v[1];
|
|
736
|
+
cv[2] = v[2];
|
|
737
|
+
gl.uniform3f(location, v[0], v[1], v[2]);
|
|
738
|
+
}`,"vec4<f32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
739
|
+
cv[0] = v[0];
|
|
740
|
+
cv[1] = v[1];
|
|
741
|
+
cv[2] = v[2];
|
|
742
|
+
cv[3] = v[3];
|
|
743
|
+
gl.uniform4f(location, v[0], v[1], v[2], v[3]);
|
|
744
|
+
}`,i32:`if (cv !== v) {
|
|
745
|
+
cu.value = v;
|
|
746
|
+
gl.uniform1i(location, v);
|
|
747
|
+
}`,"vec2<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
748
|
+
cv[0] = v[0];
|
|
749
|
+
cv[1] = v[1];
|
|
750
|
+
gl.uniform2i(location, v[0], v[1]);
|
|
751
|
+
}`,"vec3<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
752
|
+
cv[0] = v[0];
|
|
753
|
+
cv[1] = v[1];
|
|
754
|
+
cv[2] = v[2];
|
|
755
|
+
gl.uniform3i(location, v[0], v[1], v[2]);
|
|
756
|
+
}`,"vec4<i32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
757
|
+
cv[0] = v[0];
|
|
758
|
+
cv[1] = v[1];
|
|
759
|
+
cv[2] = v[2];
|
|
760
|
+
cv[3] = v[3];
|
|
761
|
+
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
762
|
+
}`,u32:`if (cv !== v) {
|
|
763
|
+
cu.value = v;
|
|
764
|
+
gl.uniform1ui(location, v);
|
|
765
|
+
}`,"vec2<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
766
|
+
cv[0] = v[0];
|
|
767
|
+
cv[1] = v[1];
|
|
768
|
+
gl.uniform2ui(location, v[0], v[1]);
|
|
769
|
+
}`,"vec3<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
770
|
+
cv[0] = v[0];
|
|
771
|
+
cv[1] = v[1];
|
|
772
|
+
cv[2] = v[2];
|
|
773
|
+
gl.uniform3ui(location, v[0], v[1], v[2]);
|
|
774
|
+
}`,"vec4<u32>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
775
|
+
cv[0] = v[0];
|
|
776
|
+
cv[1] = v[1];
|
|
777
|
+
cv[2] = v[2];
|
|
778
|
+
cv[3] = v[3];
|
|
779
|
+
gl.uniform4ui(location, v[0], v[1], v[2], v[3]);
|
|
780
|
+
}`,bool:`if (cv !== v) {
|
|
781
|
+
cu.value = v;
|
|
782
|
+
gl.uniform1i(location, v);
|
|
783
|
+
}`,"vec2<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1]) {
|
|
784
|
+
cv[0] = v[0];
|
|
785
|
+
cv[1] = v[1];
|
|
786
|
+
gl.uniform2i(location, v[0], v[1]);
|
|
787
|
+
}`,"vec3<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2]) {
|
|
788
|
+
cv[0] = v[0];
|
|
789
|
+
cv[1] = v[1];
|
|
790
|
+
cv[2] = v[2];
|
|
791
|
+
gl.uniform3i(location, v[0], v[1], v[2]);
|
|
792
|
+
}`,"vec4<bool>":`if (cv[0] !== v[0] || cv[1] !== v[1] || cv[2] !== v[2] || cv[3] !== v[3]) {
|
|
793
|
+
cv[0] = v[0];
|
|
794
|
+
cv[1] = v[1];
|
|
795
|
+
cv[2] = v[2];
|
|
796
|
+
cv[3] = v[3];
|
|
797
|
+
gl.uniform4i(location, v[0], v[1], v[2], v[3]);
|
|
798
|
+
}`,"mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);"},t4={f32:"gl.uniform1fv(location, v);","vec2<f32>":"gl.uniform2fv(location, v);","vec3<f32>":"gl.uniform3fv(location, v);","vec4<f32>":"gl.uniform4fv(location, v);","mat2x2<f32>":"gl.uniformMatrix2fv(location, false, v);","mat3x3<f32>":"gl.uniformMatrix3fv(location, false, v);","mat4x4<f32>":"gl.uniformMatrix4fv(location, false, v);",i32:"gl.uniform1iv(location, v);","vec2<i32>":"gl.uniform2iv(location, v);","vec3<i32>":"gl.uniform3iv(location, v);","vec4<i32>":"gl.uniform4iv(location, v);",u32:"gl.uniform1iv(location, v);","vec2<u32>":"gl.uniform2iv(location, v);","vec3<u32>":"gl.uniform3iv(location, v);","vec4<u32>":"gl.uniform4iv(location, v);",bool:"gl.uniform1iv(location, v);","vec2<bool>":"gl.uniform2iv(location, v);","vec3<bool>":"gl.uniform3iv(location, v);","vec4<bool>":"gl.uniform4iv(location, v);"};function n4(n,e){const t=[`
|
|
799
|
+
var v = null;
|
|
800
|
+
var cv = null;
|
|
801
|
+
var cu = null;
|
|
802
|
+
var t = 0;
|
|
803
|
+
var gl = renderer.gl;
|
|
804
|
+
var name = null;
|
|
805
|
+
`];for(const a in n.uniforms){if(!e[a]){n.uniforms[a]instanceof Yi?n.uniforms[a].ubo?t.push(`
|
|
806
|
+
renderer.shader.bindUniformBlock(uv.${a}, "${a}");
|
|
807
|
+
`):t.push(`
|
|
808
|
+
renderer.shader.updateUniformGroup(uv.${a});
|
|
809
|
+
`):n.uniforms[a]instanceof jv&&t.push(`
|
|
810
|
+
renderer.shader.bindBufferResource(uv.${a}, "${a}");
|
|
811
|
+
`);continue}const r=n.uniformStructures[a];let u=!1;for(let h=0;h<hu.length;h++){const d=hu[h];if(r.type===d.type&&d.test(r)){t.push(`name = "${a}";`,hu[h].uniform),u=!0;break}}if(!u){const d=(r.size===1?e4:t4)[r.type].replace("location",`ud["${a}"].location`);t.push(`
|
|
812
|
+
cu = ud["${a}"];
|
|
813
|
+
cv = cu.value;
|
|
814
|
+
v = uv["${a}"];
|
|
815
|
+
${d};`)}}return new Function("ud","uv","renderer","syncData",t.join(`
|
|
816
|
+
`))}class RT{constructor(e){this._cache={},this._uniformGroupSyncHash={},this._renderer=e,this.gl=null,this._cache={}}contextChange(e){this.gl=e}updateUniformGroup(e,t,a){const r=this._renderer.shader._getProgramData(t);(!e.isStatic||e._dirtyId!==r.uniformDirtyGroups[e.uid])&&(r.uniformDirtyGroups[e.uid]=e._dirtyId,this._getUniformSyncFunction(e,t)(r.uniformData,e.uniforms,this._renderer,a))}_getUniformSyncFunction(e,t){var a;return((a=this._uniformGroupSyncHash[e._signature])==null?void 0:a[t._key])||this._createUniformSyncFunction(e,t)}_createUniformSyncFunction(e,t){const a=this._uniformGroupSyncHash[e._signature]||(this._uniformGroupSyncHash[e._signature]={}),r=this._getSignature(e,t._uniformData,"u");return this._cache[r]||(this._cache[r]=this._generateUniformsSync(e,t._uniformData)),a[t._key]=this._cache[r],a[t._key]}_generateUniformsSync(e,t){return n4(e,t)}_getSignature(e,t,a){const r=e.uniforms,u=[`${a}-`];for(const h in r)u.push(h),t[h]&&u.push(t[h].type);return u.join("-")}destroy(){this._renderer=null,this._cache=null}}RT.extension={type:[Q.WebGLSystem],name:"uniformGroup"};function i4(n){const e={};if(e.normal=[n.ONE,n.ONE_MINUS_SRC_ALPHA],e.add=[n.ONE,n.ONE],e.multiply=[n.DST_COLOR,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.screen=[n.ONE,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.none=[0,0],e["normal-npm"]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_ALPHA,n.ONE,n.ONE_MINUS_SRC_ALPHA],e["add-npm"]=[n.SRC_ALPHA,n.ONE,n.ONE,n.ONE],e["screen-npm"]=[n.SRC_ALPHA,n.ONE_MINUS_SRC_COLOR,n.ONE,n.ONE_MINUS_SRC_ALPHA],e.erase=[n.ZERO,n.ONE_MINUS_SRC_ALPHA],!(n instanceof Gt.get().getWebGLRenderingContext()))e.min=[n.ONE,n.ONE,n.ONE,n.ONE,n.MIN,n.MIN],e.max=[n.ONE,n.ONE,n.ONE,n.ONE,n.MAX,n.MAX];else{const a=n.getExtension("EXT_blend_minmax");a&&(e.min=[n.ONE,n.ONE,n.ONE,n.ONE,a.MIN_EXT,a.MIN_EXT],e.max=[n.ONE,n.ONE,n.ONE,n.ONE,a.MAX_EXT,a.MAX_EXT])}return e}const a4=0,s4=1,r4=2,l4=3,o4=4,u4=5,AT=class ex{constructor(e){this._invertFrontFace=!1,this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode="none",this._blendEq=!1,this.map=[],this.map[a4]=this.setBlend,this.map[s4]=this.setOffset,this.map[r4]=this.setCullFace,this.map[l4]=this.setDepthTest,this.map[o4]=this.setFrontFace,this.map[u4]=this.setDepthMask,this.checks=[],this.defaultState=Us.for2d(),e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){this._invertFrontFace=!e.isRoot,this._cullFace?this.setFrontFace(this._frontFace):this._frontFaceDirty=!0}contextChange(e){this.gl=e,this.blendModesMap=i4(e),this.resetState()}set(e){if(e||(e=this.defaultState),this.stateId!==e.data){let t=this.stateId^e.data,a=0;for(;t;)t&1&&this.map[a].call(this,!!(e.data&1<<a)),t>>=1,a++;this.stateId=e.data}for(let t=0;t<this.checks.length;t++)this.checks[t](this,e)}forceState(e){e||(e=this.defaultState);for(let t=0;t<this.map.length;t++)this.map[t].call(this,!!(e.data&1<<t));for(let t=0;t<this.checks.length;t++)this.checks[t](this,e);this.stateId=e.data}setBlend(e){this._updateCheck(ex._checkBlendMode,e),this.gl[e?"enable":"disable"](this.gl.BLEND)}setOffset(e){this._updateCheck(ex._checkPolygonOffset,e),this.gl[e?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(e){this.gl[e?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(e){this.gl.depthMask(e)}setCullFace(e){this._cullFace=e,this.gl[e?"enable":"disable"](this.gl.CULL_FACE),this._cullFace&&this._frontFaceDirty&&this.setFrontFace(this._frontFace)}setFrontFace(e){this._frontFace=e,this._frontFaceDirty=!1;const t=this._invertFrontFace?!e:e;this._glFrontFace!==t&&(this._glFrontFace=t,this.gl.frontFace(this.gl[t?"CW":"CCW"]))}setBlendMode(e){if(this.blendModesMap[e]||(e="normal"),e===this.blendMode)return;this.blendMode=e;const t=this.blendModesMap[e],a=this.gl;t.length===2?a.blendFunc(t[0],t[1]):a.blendFuncSeparate(t[0],t[1],t[2],t[3]),t.length===6?(this._blendEq=!0,a.blendEquationSeparate(t[4],t[5])):this._blendEq&&(this._blendEq=!1,a.blendEquationSeparate(a.FUNC_ADD,a.FUNC_ADD))}setPolygonOffset(e,t){this.gl.polygonOffset(e,t)}resetState(){this._glFrontFace=!1,this._frontFace=!1,this._cullFace=!1,this._frontFaceDirty=!1,this._invertFrontFace=!1,this.gl.frontFace(this.gl.CCW),this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode="",this.setBlendMode("normal")}_updateCheck(e,t){const a=this.checks.indexOf(e);t&&a===-1?this.checks.push(e):!t&&a!==-1&&this.checks.splice(a,1)}static _checkBlendMode(e,t){e.setBlendMode(t.blendMode)}static _checkPolygonOffset(e,t){e.setPolygonOffset(1,t.polygonOffset)}destroy(){this.gl=null,this.checks.length=0}};AT.extension={type:[Q.WebGLSystem],name:"state"};let c4=AT;class h4{constructor(e){this.target=aT.TEXTURE_2D,this.texture=e,this.width=-1,this.height=-1,this.type=Ct.UNSIGNED_BYTE,this.internalFormat=Hv.RGBA,this.format=Hv.RGBA,this.samplerType=0}}const f4={id:"buffer",upload(n,e,t){e.width===n.width||e.height===n.height?t.texSubImage2D(t.TEXTURE_2D,0,0,0,n.width,n.height,e.format,e.type,n.resource):t.texImage2D(e.target,0,e.internalFormat,n.width,n.height,0,e.format,e.type,n.resource),e.width=n.width,e.height=n.height}},d4={"bc1-rgba-unorm":!0,"bc1-rgba-unorm-srgb":!0,"bc2-rgba-unorm":!0,"bc2-rgba-unorm-srgb":!0,"bc3-rgba-unorm":!0,"bc3-rgba-unorm-srgb":!0,"bc4-r-unorm":!0,"bc4-r-snorm":!0,"bc5-rg-unorm":!0,"bc5-rg-snorm":!0,"bc6h-rgb-ufloat":!0,"bc6h-rgb-float":!0,"bc7-rgba-unorm":!0,"bc7-rgba-unorm-srgb":!0,"etc2-rgb8unorm":!0,"etc2-rgb8unorm-srgb":!0,"etc2-rgb8a1unorm":!0,"etc2-rgb8a1unorm-srgb":!0,"etc2-rgba8unorm":!0,"etc2-rgba8unorm-srgb":!0,"eac-r11unorm":!0,"eac-r11snorm":!0,"eac-rg11unorm":!0,"eac-rg11snorm":!0,"astc-4x4-unorm":!0,"astc-4x4-unorm-srgb":!0,"astc-5x4-unorm":!0,"astc-5x4-unorm-srgb":!0,"astc-5x5-unorm":!0,"astc-5x5-unorm-srgb":!0,"astc-6x5-unorm":!0,"astc-6x5-unorm-srgb":!0,"astc-6x6-unorm":!0,"astc-6x6-unorm-srgb":!0,"astc-8x5-unorm":!0,"astc-8x5-unorm-srgb":!0,"astc-8x6-unorm":!0,"astc-8x6-unorm-srgb":!0,"astc-8x8-unorm":!0,"astc-8x8-unorm-srgb":!0,"astc-10x5-unorm":!0,"astc-10x5-unorm-srgb":!0,"astc-10x6-unorm":!0,"astc-10x6-unorm-srgb":!0,"astc-10x8-unorm":!0,"astc-10x8-unorm-srgb":!0,"astc-10x10-unorm":!0,"astc-10x10-unorm-srgb":!0,"astc-12x10-unorm":!0,"astc-12x10-unorm-srgb":!0,"astc-12x12-unorm":!0,"astc-12x12-unorm-srgb":!0},p4={id:"compressed",upload(n,e,t){t.pixelStorei(t.UNPACK_ALIGNMENT,4);let a=n.pixelWidth,r=n.pixelHeight;const u=!!d4[n.format];for(let h=0;h<n.resource.length;h++){const d=n.resource[h];u?t.compressedTexImage2D(t.TEXTURE_2D,h,e.internalFormat,a,r,0,d):t.texImage2D(t.TEXTURE_2D,h,e.internalFormat,a,r,0,e.format,e.type,d),a=Math.max(a>>1,1),r=Math.max(r>>1,1)}}},MT={id:"image",upload(n,e,t,a){const r=e.width,u=e.height,h=n.pixelWidth,d=n.pixelHeight,m=n.resourceWidth,y=n.resourceHeight;m<h||y<d?((r!==h||u!==d)&&t.texImage2D(e.target,0,e.internalFormat,h,d,0,e.format,e.type,null),a===2?t.texSubImage2D(t.TEXTURE_2D,0,0,0,m,y,e.format,e.type,n.resource):t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,n.resource)):r===h&&u===d?t.texSubImage2D(t.TEXTURE_2D,0,0,0,e.format,e.type,n.resource):a===2?t.texImage2D(e.target,0,e.internalFormat,h,d,0,e.format,e.type,n.resource):t.texImage2D(e.target,0,e.internalFormat,e.format,e.type,n.resource),e.width=h,e.height=d}},m4={id:"video",upload(n,e,t,a){if(!n.isValid){t.texImage2D(e.target,0,e.internalFormat,1,1,0,e.format,e.type,null);return}MT.upload(n,e,t,a)}},DT={linear:9729,nearest:9728},y4={linear:{linear:9987,nearest:9985},nearest:{linear:9986,nearest:9984}},Xv={"clamp-to-edge":33071,repeat:10497,"mirror-repeat":33648},g4={never:512,less:513,equal:514,"less-equal":515,greater:516,"not-equal":517,"greater-equal":518,always:519};function UT(n,e,t,a,r,u,h,d){const m=u;if(!d||n.addressModeU!=="repeat"||n.addressModeV!=="repeat"||n.addressModeW!=="repeat"){const y=Xv[h?"clamp-to-edge":n.addressModeU],b=Xv[h?"clamp-to-edge":n.addressModeV],S=Xv[h?"clamp-to-edge":n.addressModeW];e[r](m,e.TEXTURE_WRAP_S,y),e[r](m,e.TEXTURE_WRAP_T,b),e.TEXTURE_WRAP_R&&e[r](m,e.TEXTURE_WRAP_R,S)}if((!d||n.magFilter!=="linear")&&e[r](m,e.TEXTURE_MAG_FILTER,DT[n.magFilter]),t){if(!d||n.mipmapFilter!=="linear"){const y=y4[n.minFilter][n.mipmapFilter];e[r](m,e.TEXTURE_MIN_FILTER,y)}}else e[r](m,e.TEXTURE_MIN_FILTER,DT[n.minFilter]);if(a&&n.maxAnisotropy>1){const y=Math.min(n.maxAnisotropy,e.getParameter(a.MAX_TEXTURE_MAX_ANISOTROPY_EXT));e[r](m,a.TEXTURE_MAX_ANISOTROPY_EXT,y)}n.compare&&e[r](m,e.TEXTURE_COMPARE_FUNC,g4[n.compare])}function _4(n){return{r8unorm:n.RED,r8snorm:n.RED,r8uint:n.RED,r8sint:n.RED,r16uint:n.RED,r16sint:n.RED,r16float:n.RED,rg8unorm:n.RG,rg8snorm:n.RG,rg8uint:n.RG,rg8sint:n.RG,r32uint:n.RED,r32sint:n.RED,r32float:n.RED,rg16uint:n.RG,rg16sint:n.RG,rg16float:n.RG,rgba8unorm:n.RGBA,"rgba8unorm-srgb":n.RGBA,rgba8snorm:n.RGBA,rgba8uint:n.RGBA,rgba8sint:n.RGBA,bgra8unorm:n.RGBA,"bgra8unorm-srgb":n.RGBA,rgb9e5ufloat:n.RGB,rgb10a2unorm:n.RGBA,rg11b10ufloat:n.RGB,rg32uint:n.RG,rg32sint:n.RG,rg32float:n.RG,rgba16uint:n.RGBA,rgba16sint:n.RGBA,rgba16float:n.RGBA,rgba32uint:n.RGBA,rgba32sint:n.RGBA,rgba32float:n.RGBA,stencil8:n.STENCIL_INDEX8,depth16unorm:n.DEPTH_COMPONENT,depth24plus:n.DEPTH_COMPONENT,"depth24plus-stencil8":n.DEPTH_STENCIL,depth32float:n.DEPTH_COMPONENT,"depth32float-stencil8":n.DEPTH_STENCIL}}function v4(n,e){let t={},a=n.RGBA;return n instanceof Gt.get().getWebGLRenderingContext()?e.srgb&&(t={"rgba8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT,"bgra8unorm-srgb":e.srgb.SRGB8_ALPHA8_EXT}):(t={"rgba8unorm-srgb":n.SRGB8_ALPHA8,"bgra8unorm-srgb":n.SRGB8_ALPHA8},a=n.RGBA8),{r8unorm:n.R8,r8snorm:n.R8_SNORM,r8uint:n.R8UI,r8sint:n.R8I,r16uint:n.R16UI,r16sint:n.R16I,r16float:n.R16F,rg8unorm:n.RG8,rg8snorm:n.RG8_SNORM,rg8uint:n.RG8UI,rg8sint:n.RG8I,r32uint:n.R32UI,r32sint:n.R32I,r32float:n.R32F,rg16uint:n.RG16UI,rg16sint:n.RG16I,rg16float:n.RG16F,rgba8unorm:n.RGBA,...t,rgba8snorm:n.RGBA8_SNORM,rgba8uint:n.RGBA8UI,rgba8sint:n.RGBA8I,bgra8unorm:a,rgb9e5ufloat:n.RGB9_E5,rgb10a2unorm:n.RGB10_A2,rg11b10ufloat:n.R11F_G11F_B10F,rg32uint:n.RG32UI,rg32sint:n.RG32I,rg32float:n.RG32F,rgba16uint:n.RGBA16UI,rgba16sint:n.RGBA16I,rgba16float:n.RGBA16F,rgba32uint:n.RGBA32UI,rgba32sint:n.RGBA32I,rgba32float:n.RGBA32F,stencil8:n.STENCIL_INDEX8,depth16unorm:n.DEPTH_COMPONENT16,depth24plus:n.DEPTH_COMPONENT24,"depth24plus-stencil8":n.DEPTH24_STENCIL8,depth32float:n.DEPTH_COMPONENT32F,"depth32float-stencil8":n.DEPTH32F_STENCIL8,...e.s3tc?{"bc1-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT1_EXT,"bc2-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT3_EXT,"bc3-rgba-unorm":e.s3tc.COMPRESSED_RGBA_S3TC_DXT5_EXT}:{},...e.s3tc_sRGB?{"bc1-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,"bc2-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,"bc3-rgba-unorm-srgb":e.s3tc_sRGB.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}:{},...e.rgtc?{"bc4-r-unorm":e.rgtc.COMPRESSED_RED_RGTC1_EXT,"bc4-r-snorm":e.rgtc.COMPRESSED_SIGNED_RED_RGTC1_EXT,"bc5-rg-unorm":e.rgtc.COMPRESSED_RED_GREEN_RGTC2_EXT,"bc5-rg-snorm":e.rgtc.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}:{},...e.bptc?{"bc6h-rgb-float":e.bptc.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,"bc6h-rgb-ufloat":e.bptc.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,"bc7-rgba-unorm":e.bptc.COMPRESSED_RGBA_BPTC_UNORM_EXT,"bc7-rgba-unorm-srgb":e.bptc.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT}:{},...e.etc?{"etc2-rgb8unorm":e.etc.COMPRESSED_RGB8_ETC2,"etc2-rgb8unorm-srgb":e.etc.COMPRESSED_SRGB8_ETC2,"etc2-rgb8a1unorm":e.etc.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgb8a1unorm-srgb":e.etc.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2,"etc2-rgba8unorm":e.etc.COMPRESSED_RGBA8_ETC2_EAC,"etc2-rgba8unorm-srgb":e.etc.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC,"eac-r11unorm":e.etc.COMPRESSED_R11_EAC,"eac-rg11unorm":e.etc.COMPRESSED_SIGNED_RG11_EAC}:{},...e.astc?{"astc-4x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_4x4_KHR,"astc-4x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR,"astc-5x4-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x4_KHR,"astc-5x4-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR,"astc-5x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_5x5_KHR,"astc-5x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR,"astc-6x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x5_KHR,"astc-6x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR,"astc-6x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_6x6_KHR,"astc-6x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR,"astc-8x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x5_KHR,"astc-8x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR,"astc-8x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x6_KHR,"astc-8x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR,"astc-8x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_8x8_KHR,"astc-8x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR,"astc-10x5-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x5_KHR,"astc-10x5-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR,"astc-10x6-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x6_KHR,"astc-10x6-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR,"astc-10x8-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x8_KHR,"astc-10x8-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR,"astc-10x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_10x10_KHR,"astc-10x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR,"astc-12x10-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x10_KHR,"astc-12x10-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR,"astc-12x12-unorm":e.astc.COMPRESSED_RGBA_ASTC_12x12_KHR,"astc-12x12-unorm-srgb":e.astc.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR}:{}}}function b4(n){return{r8unorm:n.UNSIGNED_BYTE,r8snorm:n.BYTE,r8uint:n.UNSIGNED_BYTE,r8sint:n.BYTE,r16uint:n.UNSIGNED_SHORT,r16sint:n.SHORT,r16float:n.HALF_FLOAT,rg8unorm:n.UNSIGNED_BYTE,rg8snorm:n.BYTE,rg8uint:n.UNSIGNED_BYTE,rg8sint:n.BYTE,r32uint:n.UNSIGNED_INT,r32sint:n.INT,r32float:n.FLOAT,rg16uint:n.UNSIGNED_SHORT,rg16sint:n.SHORT,rg16float:n.HALF_FLOAT,rgba8unorm:n.UNSIGNED_BYTE,"rgba8unorm-srgb":n.UNSIGNED_BYTE,rgba8snorm:n.BYTE,rgba8uint:n.UNSIGNED_BYTE,rgba8sint:n.BYTE,bgra8unorm:n.UNSIGNED_BYTE,"bgra8unorm-srgb":n.UNSIGNED_BYTE,rgb9e5ufloat:n.UNSIGNED_INT_5_9_9_9_REV,rgb10a2unorm:n.UNSIGNED_INT_2_10_10_10_REV,rg11b10ufloat:n.UNSIGNED_INT_10F_11F_11F_REV,rg32uint:n.UNSIGNED_INT,rg32sint:n.INT,rg32float:n.FLOAT,rgba16uint:n.UNSIGNED_SHORT,rgba16sint:n.SHORT,rgba16float:n.HALF_FLOAT,rgba32uint:n.UNSIGNED_INT,rgba32sint:n.INT,rgba32float:n.FLOAT,stencil8:n.UNSIGNED_BYTE,depth16unorm:n.UNSIGNED_SHORT,depth24plus:n.UNSIGNED_INT,"depth24plus-stencil8":n.UNSIGNED_INT_24_8,depth32float:n.FLOAT,"depth32float-stencil8":n.FLOAT_32_UNSIGNED_INT_24_8_REV}}const x4=4;class BT{constructor(e){this.managedTextures=[],this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundTextures=[],this._activeTextureLocation=-1,this._boundSamplers=Object.create(null),this._uploads={image:MT,buffer:f4,video:m4,compressed:p4},this._premultiplyAlpha=!1,this._useSeparateSamplers=!1,this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_glTextures"),this._renderer.renderableGC.addManagedHash(this,"_glSamplers")}contextChange(e){this._gl=e,this._mapFormatToInternalFormat||(this._mapFormatToInternalFormat=v4(e,this._renderer.context.extensions),this._mapFormatToType=b4(e),this._mapFormatToFormat=_4(e)),this._glTextures=Object.create(null),this._glSamplers=Object.create(null),this._boundSamplers=Object.create(null),this._premultiplyAlpha=!1;for(let t=0;t<16;t++)this.bind(Ge.EMPTY,t)}initSource(e){this.bind(e)}bind(e,t=0){const a=e.source;e?(this.bindSource(a,t),this._useSeparateSamplers&&this._bindSampler(a.style,t)):(this.bindSource(null,t),this._useSeparateSamplers&&this._bindSampler(null,t))}bindSource(e,t=0){const a=this._gl;if(e._touched=this._renderer.textureGC.count,this._boundTextures[t]!==e){this._boundTextures[t]=e,this._activateLocation(t),e||(e=Ge.EMPTY.source);const r=this.getGlSource(e);a.bindTexture(r.target,r.texture)}}_bindSampler(e,t=0){const a=this._gl;if(!e){this._boundSamplers[t]=null,a.bindSampler(t,null);return}const r=this._getGlSampler(e);this._boundSamplers[t]!==r&&(this._boundSamplers[t]=r,a.bindSampler(t,r))}unbind(e){const t=e.source,a=this._boundTextures,r=this._gl;for(let u=0;u<a.length;u++)if(a[u]===t){this._activateLocation(u);const h=this.getGlSource(t);r.bindTexture(h.target,null),a[u]=null}}_activateLocation(e){this._activeTextureLocation!==e&&(this._activeTextureLocation=e,this._gl.activeTexture(this._gl.TEXTURE0+e))}_initSource(e){const t=this._gl,a=new h4(t.createTexture());if(a.type=this._mapFormatToType[e.format],a.internalFormat=this._mapFormatToInternalFormat[e.format],a.format=this._mapFormatToFormat[e.format],e.autoGenerateMipmaps&&(this._renderer.context.supports.nonPowOf2mipmaps||e.isPowerOfTwo)){const r=Math.max(e.width,e.height);e.mipLevelCount=Math.floor(Math.log2(r))+1}return this._glTextures[e.uid]=a,this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceUpdate,this),e.on("styleChange",this.onStyleChange,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),this.updateStyle(e,!1),a}onStyleChange(e){this.updateStyle(e,!1)}updateStyle(e,t){const a=this._gl,r=this.getGlSource(e);a.bindTexture(a.TEXTURE_2D,r.texture),this._boundTextures[this._activeTextureLocation]=e,UT(e.style,a,e.mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"texParameteri",a.TEXTURE_2D,!this._renderer.context.supports.nonPowOf2wrapping&&!e.isPowerOfTwo,t)}onSourceUnload(e){const t=this._glTextures[e.uid];t&&(this.unbind(e),this._glTextures[e.uid]=null,this._gl.deleteTexture(t.texture))}onSourceUpdate(e){const t=this._gl,a=this.getGlSource(e);t.bindTexture(t.TEXTURE_2D,a.texture),this._boundTextures[this._activeTextureLocation]=e;const r=e.alphaMode==="premultiply-alpha-on-upload";this._premultiplyAlpha!==r&&(this._premultiplyAlpha=r,t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,r)),this._uploads[e.uploadMethodId]?this._uploads[e.uploadMethodId].upload(e,a,t,this._renderer.context.webGLVersion):t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e.pixelWidth,e.pixelHeight,0,t.RGBA,t.UNSIGNED_BYTE,null),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e,!1)}onUpdateMipmaps(e,t=!0){t&&this.bindSource(e,0);const a=this.getGlSource(e);this._gl.generateMipmap(a.target)}onSourceDestroy(e){e.off("destroy",this.onSourceDestroy,this),e.off("update",this.onSourceUpdate,this),e.off("resize",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("styleChange",this.onStyleChange,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}_initSampler(e){const t=this._gl,a=this._gl.createSampler();return this._glSamplers[e._resourceId]=a,UT(e,t,this._boundTextures[this._activeTextureLocation].mipLevelCount>1,this._renderer.context.extensions.anisotropicFiltering,"samplerParameteri",a,!1,!0),this._glSamplers[e._resourceId]}_getGlSampler(e){return this._glSamplers[e._resourceId]||this._initSampler(e)}getGlSource(e){return this._glTextures[e.uid]||this._initSource(e)}generateCanvas(e){const{pixels:t,width:a,height:r}=this.getPixels(e),u=Gt.get().createCanvas();u.width=a,u.height=r;const h=u.getContext("2d");if(h){const d=h.createImageData(a,r);d.data.set(t),h.putImageData(d,0,0)}return u}getPixels(e){const t=e.source.resolution,a=e.frame,r=Math.max(Math.round(a.width*t),1),u=Math.max(Math.round(a.height*t),1),h=new Uint8Array(x4*r*u),d=this._renderer,m=d.renderTarget.getRenderTarget(e),y=d.renderTarget.getGpuRenderTarget(m),b=d.gl;return b.bindFramebuffer(b.FRAMEBUFFER,y.resolveTargetFramebuffer),b.readPixels(Math.round(a.x*t),Math.round(a.y*t),r,u,b.RGBA,b.UNSIGNED_BYTE,h),{pixels:new Uint8ClampedArray(h.buffer),width:r,height:u}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null,this._renderer=null}resetState(){this._activeTextureLocation=-1,this._boundTextures.fill(Ge.EMPTY.source),this._boundSamplers=Object.create(null);const e=this._gl;this._premultiplyAlpha=!1,e.pixelStorei(e.UNPACK_PREMULTIPLY_ALPHA_WEBGL,this._premultiplyAlpha)}}BT.extension={type:[Q.WebGLSystem],name:"texture"};class OT{contextChange(e){const t=new Yi({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uRound:{value:0,type:"f32"}}),a=e.limits.maxBatchableTextures,r=cd({name:"graphics",bits:[mv,vv(a),Pv,fd]});this.shader=new ka({glProgram:r,resources:{localUniforms:t,batchSamplers:bv(a)}})}execute(e,t){const a=t.context,r=a.customShader||this.shader,u=e.renderer,h=u.graphicsContext,{batcher:d,instructions:m}=h.getContextRenderData(a);r.groups[0]=u.globalUniforms.bindGroup,u.state.set(e.state),u.shader.bind(r),u.geometry.bind(d.geometry,r.glProgram);const y=m.instructions;for(let b=0;b<m.instructionSize;b++){const S=y[b];if(S.size){for(let T=0;T<S.textures.count;T++)u.texture.bind(S.textures.textures[T],T);u.geometry.draw(S.topology,S.size,S.start)}}}destroy(){this.shader.destroy(!0),this.shader=null}}OT.extension={type:[Q.WebGLPipesAdaptor],name:"graphics"};class NT{init(){const e=cd({name:"mesh",bits:[Pv,AU,fd]});this._shader=new ka({glProgram:e,resources:{uTexture:Ge.EMPTY.source,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new Pe}}}})}execute(e,t){const a=e.renderer;let r=t._shader;if(r){if(!r.glProgram){rt("Mesh shader has no glProgram",t.shader);return}}else{r=this._shader;const u=t.texture,h=u.source;r.resources.uTexture=h,r.resources.uSampler=h.style,r.resources.textureUniforms.uniforms.uTextureMatrix=u.textureMatrix.mapCoord}r.groups[100]=a.globalUniforms.bindGroup,r.groups[101]=e.localUniformsBindGroup,a.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}NT.extension={type:[Q.WebGLPipesAdaptor],name:"mesh"};class GT{constructor(e){this._renderer=e}updateRenderable(){}destroyRenderable(){}validateRenderable(){return!1}addRenderable(e,t){this._renderer.renderPipes.batch.break(t),t.add(e)}execute(e){e.isRenderable&&e.render(this._renderer)}destroy(){this._renderer=null}}GT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"customRender"};class Sy{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(){}}function qv(n,e){const t=n.instructionSet,a=t.instructions;for(let r=0;r<t.instructionSize;r++){const u=a[r];e[u.renderPipeId].execute(u)}}const S4=new Pe;class wT{constructor(e){this._renderer=e}addRenderGroup(e,t){e.isCachedAsTexture?this._addRenderableCacheAsTexture(e,t):this._addRenderableDirect(e,t)}execute(e){e.isRenderable&&(e.isCachedAsTexture?this._executeCacheAsTexture(e):this._executeDirect(e))}destroy(){this._renderer=null}_addRenderableDirect(e,t){this._renderer.renderPipes.batch.break(t),e._batchableRenderGroup&&(hi.return(e._batchableRenderGroup),e._batchableRenderGroup=null),t.add(e)}_addRenderableCacheAsTexture(e,t){const a=e._batchableRenderGroup??(e._batchableRenderGroup=hi.get(Sy));a.renderable=e.root,a.transform=e.root.relativeGroupTransform,a.texture=e.texture,a.bounds=e._textureBounds,t.add(e),this._renderer.renderPipes.batch.addToBatch(a,t)}_executeCacheAsTexture(e){if(e.textureNeedsUpdate){e.textureNeedsUpdate=!1;const t=S4.identity().translate(-e._textureBounds.x,-e._textureBounds.y);this._renderer.renderTarget.push(e.texture,!0,null,e.texture.frame),this._renderer.globalUniforms.push({worldTransformMatrix:t,worldColor:4294967295}),qv(e,this._renderer.renderPipes),this._renderer.renderTarget.finishRenderPass(),this._renderer.renderTarget.pop(),this._renderer.globalUniforms.pop()}e._batchableRenderGroup._batcher.updateElement(e._batchableRenderGroup),e._batchableRenderGroup._batcher.geometry.buffers[0].update()}_executeDirect(e){this._renderer.globalUniforms.push({worldTransformMatrix:e.inverseParentTextureTransform,worldColor:e.worldColorAlpha}),qv(e,this._renderer.renderPipes),this._renderer.globalUniforms.pop()}}wT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"renderGroup"};function Fv(n,e){e||(e=0);for(let t=e;t<n.length&&n[t];t++)n[t]=null}const T4=new Gn,PT=kf|$m|G_;function zT(n,e=!1){E4(n);const t=n.childrenToUpdate,a=n.updateTick++;for(const r in t){const u=Number(r),h=t[r],d=h.list,m=h.index;for(let y=0;y<m;y++){const b=d[y];b.parentRenderGroup===n&&b.relativeRenderGroupDepth===u&&HT(b,a,0)}Fv(d,m),h.index=0}if(e)for(let r=0;r<n.renderGroupChildren.length;r++)zT(n.renderGroupChildren[r],e)}function E4(n){const e=n.root;let t;if(n.renderGroupParent){const a=n.renderGroupParent;n.worldTransform.appendFrom(e.relativeGroupTransform,a.worldTransform),n.worldColor=Zm(e.groupColor,a.worldColor),t=e.groupAlpha*a.worldAlpha}else n.worldTransform.copyFrom(e.localTransform),n.worldColor=e.localColor,t=e.localAlpha;t=t<0?0:t>1?1:t,n.worldAlpha=t,n.worldColorAlpha=n.worldColor+((t*255|0)<<24)}function HT(n,e,t){if(e===n.updateTick)return;n.updateTick=e,n.didChange=!1;const a=n.localTransform;n.updateLocalTransform();const r=n.parent;if(r&&!r.renderGroup?(t|=n._updateFlags,n.relativeGroupTransform.appendFrom(a,r.relativeGroupTransform),t&PT&&VT(n,r,t)):(t=n._updateFlags,n.relativeGroupTransform.copyFrom(a),t&PT&&VT(n,T4,t)),!n.renderGroup){const u=n.children,h=u.length;for(let y=0;y<h;y++)HT(u[y],e,t);const d=n.parentRenderGroup,m=n;m.renderPipeId&&!d.structureDidChange&&d.updateRenderable(m)}}function VT(n,e,t){if(t&$m){n.groupColor=Zm(n.localColor,e.groupColor);let a=n.localAlpha*e.groupAlpha;a=a<0?0:a>1?1:a,n.groupAlpha=a,n.groupColorAlpha=n.groupColor+((a*255|0)<<24)}t&G_&&(n.groupBlendMode=n.localBlendMode==="inherit"?e.groupBlendMode:n.localBlendMode),t&kf&&(n.globalDisplayStatus=n.localDisplayStatus&e.globalDisplayStatus),n._updateFlags=0}function C4(n,e){const{list:t,index:a}=n.childrenRenderablesToUpdate;let r=!1;for(let u=0;u<a;u++){const h=t[u];if(r=e[h.renderPipeId].validateRenderable(h),r)break}return n.structureDidChange=r,r}const R4=new Pe;class LT{constructor(e){this._renderer=e}render({container:e,transform:t}){const a=e.parent,r=e.renderGroup.renderGroupParent;e.parent=null,e.renderGroup.renderGroupParent=null;const u=this._renderer;let h=R4;t&&(h=h.copyFrom(e.renderGroup.localTransform),e.renderGroup.localTransform.copyFrom(t));const d=u.renderPipes;this._updateCachedRenderGroups(e.renderGroup,null),this._updateRenderGroups(e.renderGroup),u.globalUniforms.start({worldTransformMatrix:t?e.renderGroup.localTransform:e.renderGroup.worldTransform,worldColor:e.renderGroup.worldColorAlpha}),qv(e.renderGroup,d),d.uniformBatch&&d.uniformBatch.renderEnd(),t&&e.renderGroup.localTransform.copyFrom(h),e.parent=a,e.renderGroup.renderGroupParent=r}destroy(){this._renderer=null}_updateCachedRenderGroups(e,t){if(e.isCachedAsTexture){if(!e.updateCacheTexture)return;t=e}e._parentCacheAsTextureRenderGroup=t;for(let a=e.renderGroupChildren.length-1;a>=0;a--)this._updateCachedRenderGroups(e.renderGroupChildren[a],t);if(e.invalidateMatrices(),e.isCachedAsTexture){if(e.textureNeedsUpdate){const a=e.root.getLocalBounds();a.ceil();const r=e.texture;e.texture&&Di.returnTexture(e.texture,!0);const u=this._renderer,h=e.textureOptions.resolution||u.view.resolution,d=e.textureOptions.antialias??u.view.antialias,m=e.textureOptions.scaleMode??"linear",y=Di.getOptimalTexture(a.width,a.height,h,d);y._source.style=new Xl({scaleMode:m}),e.texture=y,e._textureBounds||(e._textureBounds=new ci),e._textureBounds.copyFrom(a),r!==e.texture&&e.renderGroupParent&&(e.renderGroupParent.structureDidChange=!0)}}else e.texture&&(Di.returnTexture(e.texture,!0),e.texture=null)}_updateRenderGroups(e){const t=this._renderer,a=t.renderPipes;if(e.runOnRender(t),e.instructionSet.renderPipes=a,e.structureDidChange?Fv(e.childrenRenderablesToUpdate.list,0):C4(e,a),zT(e),e.structureDidChange?(e.structureDidChange=!1,this._buildInstructions(e,t)):this._updateRenderables(e),e.childrenRenderablesToUpdate.index=0,t.renderPipes.batch.upload(e.instructionSet),!(e.isCachedAsTexture&&!e.textureNeedsUpdate))for(let r=0;r<e.renderGroupChildren.length;r++)this._updateRenderGroups(e.renderGroupChildren[r])}_updateRenderables(e){const{list:t,index:a}=e.childrenRenderablesToUpdate;for(let r=0;r<a;r++){const u=t[r];u.didViewUpdate&&e.updateRenderable(u)}Fv(t,a)}_buildInstructions(e,t){const a=e.root,r=e.instructionSet;r.reset();const u=t.renderPipes?t:t.batch.renderer,h=u.renderPipes;h.batch.buildStart(r),h.blendMode.buildStart(),h.colorMask.buildStart(),a.sortableChildren&&a.sortChildren(),a.collectRenderablesWithEffects(r,u,null),h.batch.buildEnd(r),h.blendMode.buildEnd(r)}}LT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"renderGroup"};class jT{constructor(e){this._renderer=e}addRenderable(e,t){const a=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,a),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.bounds=e.visualBounds,t.texture=e._texture}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=new Sy;return t.renderable=e,t.transform=e.groupTransform,t.texture=e._texture,t.bounds=e.visualBounds,t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}jT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"sprite"};const Iv=class tA{constructor(){this.clearBeforeRender=!0,this._backgroundColor=new Ft(0),this.color=this._backgroundColor,this.alpha=1}init(e){e={...tA.defaultOptions,...e},this.clearBeforeRender=e.clearBeforeRender,this.color=e.background||e.backgroundColor||this._backgroundColor,this.alpha=e.backgroundAlpha,this._backgroundColor.setAlpha(e.backgroundAlpha)}get color(){return this._backgroundColor}set color(e){Ft.shared.setValue(e).alpha<1&&this._backgroundColor.alpha===1&&rt("Cannot set a transparent background on an opaque canvas. To enable transparency, set backgroundAlpha < 1 when initializing your Application."),this._backgroundColor.setValue(e)}get alpha(){return this._backgroundColor.alpha}set alpha(e){this._backgroundColor.setAlpha(e)}get colorRgba(){return this._backgroundColor.toArray()}destroy(){}};Iv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"background",priority:0},Iv.defaultOptions={backgroundAlpha:1,backgroundColor:0,clearBeforeRender:!0};let A4=Iv;const vd={};Ie.handle(Q.BlendMode,n=>{if(!n.name)throw new Error("BlendMode extension must have a name property");vd[n.name]=n.ref},n=>{delete vd[n.name]});class YT{constructor(e){this._isAdvanced=!1,this._filterHash=Object.create(null),this._renderer=e,this._renderer.runners.prerender.add(this)}prerender(){this._activeBlendMode="normal",this._isAdvanced=!1}setBlendMode(e,t,a){if(this._activeBlendMode===t){this._isAdvanced&&this._renderableList.push(e);return}this._activeBlendMode=t,this._isAdvanced&&this._endAdvancedBlendMode(a),this._isAdvanced=!!vd[t],this._isAdvanced&&(this._beginAdvancedBlendMode(a),this._renderableList.push(e))}_beginAdvancedBlendMode(e){this._renderer.renderPipes.batch.break(e);const t=this._activeBlendMode;if(!vd[t]){rt(`Unable to assign BlendMode: '${t}'. You may want to include: import 'pixi.js/advanced-blend-modes'`);return}let a=this._filterHash[t];a||(a=this._filterHash[t]=new Qm,a.filters=[new vd[t]]);const r={renderPipeId:"filter",action:"pushFilter",renderables:[],filterEffect:a,canBundle:!1};this._renderableList=r.renderables,e.add(r)}_endAdvancedBlendMode(e){this._renderableList=null,this._renderer.renderPipes.batch.break(e),e.add({renderPipeId:"filter",action:"popFilter",canBundle:!1})}buildStart(){this._isAdvanced=!1}buildEnd(e){this._isAdvanced&&this._endAdvancedBlendMode(e)}destroy(){this._renderer=null,this._renderableList=null;for(const e in this._filterHash)this._filterHash[e].destroy();this._filterHash=null}}YT.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"blendMode"};const kv={png:"image/png",jpg:"image/jpeg",webp:"image/webp"},Kv=class nA{constructor(e){this._renderer=e}_normalizeOptions(e,t={}){return e instanceof Gn||e instanceof Ge?{target:e,...t}:{...t,...e}}async image(e){const t=Gt.get().createImage();return t.src=await this.base64(e),t}async base64(e){e=this._normalizeOptions(e,nA.defaultImageOptions);const{format:t,quality:a}=e,r=this.canvas(e);if(r.toBlob!==void 0)return new Promise((u,h)=>{r.toBlob(d=>{if(!d){h(new Error("ICanvas.toBlob failed!"));return}const m=new FileReader;m.onload=()=>u(m.result),m.onerror=h,m.readAsDataURL(d)},kv[t],a)});if(r.toDataURL!==void 0)return r.toDataURL(kv[t],a);if(r.convertToBlob!==void 0){const u=await r.convertToBlob({type:kv[t],quality:a});return new Promise((h,d)=>{const m=new FileReader;m.onload=()=>h(m.result),m.onerror=d,m.readAsDataURL(u)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(e){e=this._normalizeOptions(e);const t=e.target,a=this._renderer;if(t instanceof Ge)return a.texture.generateCanvas(t);const r=a.textureGenerator.generateTexture(e),u=a.texture.generateCanvas(r);return r.destroy(!0),u}pixels(e){e=this._normalizeOptions(e);const t=e.target,a=this._renderer,r=t instanceof Ge?t:a.textureGenerator.generateTexture(e),u=a.texture.getPixels(r);return t instanceof Gn&&r.destroy(!0),u}texture(e){return e=this._normalizeOptions(e),e.target instanceof Ge?e.target:this._renderer.textureGenerator.generateTexture(e)}download(e){e=this._normalizeOptions(e);const t=this.canvas(e),a=document.createElement("a");a.download=e.filename??"image.png",a.href=t.toDataURL("image/png"),document.body.appendChild(a),a.click(),document.body.removeChild(a)}log(e){const t=e.width??200;e=this._normalizeOptions(e);const a=this.canvas(e),r=a.toDataURL();console.log(`[Pixi Texture] ${a.width}px ${a.height}px`);const u=["font-size: 1px;",`padding: ${t}px 300px;`,`background: url(${r}) no-repeat;`,"background-size: contain;"].join(" ");console.log("%c ",u)}destroy(){this._renderer=null}};Kv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"extract"},Kv.defaultImageOptions={format:"png",quality:1};let M4=Kv;class Qv extends Ge{static create(e){return new Qv({source:new Nn(e)})}resize(e,t,a){return this.source.resize(e,t,a),this}}const D4=new Nt,U4=new ci,B4=[0,0,0,0];class XT{constructor(e){this._renderer=e}generateTexture(e){var y;e instanceof Gn&&(e={target:e,frame:void 0,textureSourceOptions:{},resolution:void 0});const t=e.resolution||this._renderer.resolution,a=e.antialias||this._renderer.view.antialias,r=e.target;let u=e.clearColor;u?u=Array.isArray(u)&&u.length===4?u:Ft.shared.setValue(u).toArray():u=B4;const h=((y=e.frame)==null?void 0:y.copyTo(D4))||U_(r,U4).rectangle;h.width=Math.max(h.width,1/t)|0,h.height=Math.max(h.height,1/t)|0;const d=Qv.create({...e.textureSourceOptions,width:h.width,height:h.height,resolution:t,antialias:a}),m=Pe.shared.translate(-h.x,-h.y);return this._renderer.render({container:r,transform:m,target:d,clearColor:u}),d.source.updateMipmaps(),d}destroy(){this._renderer=null}}XT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"textureGenerator"};function bd(n,e,t){const a=(n>>24&255)/255;e[t++]=(n&255)/255*a,e[t++]=(n>>8&255)/255*a,e[t++]=(n>>16&255)/255*a,e[t++]=a}class qT{constructor(e){this._stackIndex=0,this._globalUniformDataStack=[],this._uniformsPool=[],this._activeUniforms=[],this._bindGroupPool=[],this._activeBindGroups=[],this._renderer=e}reset(){this._stackIndex=0;for(let e=0;e<this._activeUniforms.length;e++)this._uniformsPool.push(this._activeUniforms[e]);for(let e=0;e<this._activeBindGroups.length;e++)this._bindGroupPool.push(this._activeBindGroups[e]);this._activeUniforms.length=0,this._activeBindGroups.length=0}start(e){this.reset(),this.push(e)}bind({size:e,projectionMatrix:t,worldTransformMatrix:a,worldColor:r,offset:u}){const h=this._renderer.renderTarget.renderTarget,d=this._stackIndex?this._globalUniformDataStack[this._stackIndex-1]:{worldTransformMatrix:new Pe,worldColor:4294967295,offset:new qt},m={projectionMatrix:t||this._renderer.renderTarget.projectionMatrix,resolution:e||h.size,worldTransformMatrix:a||d.worldTransformMatrix,worldColor:r||d.worldColor,offset:u||d.offset,bindGroup:null},y=this._uniformsPool.pop()||this._createUniforms();this._activeUniforms.push(y);const b=y.uniforms;b.uProjectionMatrix=m.projectionMatrix,b.uResolution=m.resolution,b.uWorldTransformMatrix.copyFrom(m.worldTransformMatrix),b.uWorldTransformMatrix.tx-=m.offset.x,b.uWorldTransformMatrix.ty-=m.offset.y,bd(m.worldColor,b.uWorldColorAlpha,0),y.update();let S;this._renderer.renderPipes.uniformBatch?S=this._renderer.renderPipes.uniformBatch.getUniformBindGroup(y,!1):(S=this._bindGroupPool.pop()||new el,this._activeBindGroups.push(S),S.setResource(y,0)),m.bindGroup=S,this._currentGlobalUniformData=m}push(e){this.bind(e),this._globalUniformDataStack[this._stackIndex++]=this._currentGlobalUniformData}pop(){this._currentGlobalUniformData=this._globalUniformDataStack[--this._stackIndex-1],this._renderer.type===Ds.WEBGL&&this._currentGlobalUniformData.bindGroup.resources[0].update()}get bindGroup(){return this._currentGlobalUniformData.bindGroup}get globalUniformData(){return this._currentGlobalUniformData}get uniformGroup(){return this._currentGlobalUniformData.bindGroup.resources[0]}_createUniforms(){return new Yi({uProjectionMatrix:{value:new Pe,type:"mat3x3<f32>"},uWorldTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uWorldColorAlpha:{value:new Float32Array(4),type:"vec4<f32>"},uResolution:{value:[0,0],type:"vec2<f32>"}},{isStatic:!0})}destroy(){this._renderer=null}}qT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"globalUniforms"};let O4=1;class FT{constructor(){this._tasks=[],this._offset=0}init(){Ia.system.add(this._update,this)}repeat(e,t,a=!0){const r=O4++;let u=0;return a&&(this._offset+=1e3,u=this._offset),this._tasks.push({func:e,duration:t,start:performance.now(),offset:u,last:performance.now(),repeat:!0,id:r}),r}cancel(e){for(let t=0;t<this._tasks.length;t++)if(this._tasks[t].id===e){this._tasks.splice(t,1);return}}_update(){const e=performance.now();for(let t=0;t<this._tasks.length;t++){const a=this._tasks[t];if(e-a.offset-a.last>=a.duration){const r=e-a.start;a.func(r),a.last=e}}}destroy(){Ia.system.remove(this._update,this),this._tasks.length=0}}FT.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"scheduler",priority:0};let IT=!1;function N4(n){if(!IT){if(Gt.get().getNavigator().userAgent.toLowerCase().indexOf("chrome")>-1){const e=[`%c %c %c %c %c PixiJS %c v${oy} (${n}) http://www.pixijs.com/
|
|
817
|
+
|
|
818
|
+
`,"background: #E72264; padding:5px 0;","background: #6CA2EA; padding:5px 0;","background: #B5D33D; padding:5px 0;","background: #FED23F; padding:5px 0;","color: #FFFFFF; background: #E72264; padding:5px 0;","color: #E72264; background: #FFFFFF; padding:5px 0;"];globalThis.console.log(...e)}else globalThis.console&&globalThis.console.log(`PixiJS ${oy} - ${n} - http://www.pixijs.com/`);IT=!0}}class Zv{constructor(e){this._renderer=e}init(e){if(e.hello){let t=this._renderer.name;this._renderer.type===Ds.WEBGL&&(t+=` ${this._renderer.context.webGLVersion}`),N4(t)}}}Zv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"hello",priority:-2},Zv.defaultOptions={hello:!1};function G4(n){let e=!1;for(const a in n)if(n[a]==null){e=!0;break}if(!e)return n;const t=Object.create(null);for(const a in n){const r=n[a];r&&(t[a]=r)}return t}function w4(n){let e=0;for(let t=0;t<n.length;t++)n[t]==null?e++:n[t-e]=n[t];return n.length-=e,n}let P4=0;const Wv=class iA{constructor(e){this._managedRenderables=[],this._managedHashes=[],this._managedArrays=[],this._renderer=e}init(e){e={...iA.defaultOptions,...e},this.maxUnusedTime=e.renderableGCMaxUnusedTime,this._frequency=e.renderableGCFrequency,this.enabled=e.renderableGCActive}get enabled(){return!!this._handler}set enabled(e){this.enabled!==e&&(e?(this._handler=this._renderer.scheduler.repeat(()=>this.run(),this._frequency,!1),this._hashHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedHashes)t.context[t.hash]=G4(t.context[t.hash])},this._frequency),this._arrayHandler=this._renderer.scheduler.repeat(()=>{for(const t of this._managedArrays)w4(t.context[t.hash])},this._frequency)):(this._renderer.scheduler.cancel(this._handler),this._renderer.scheduler.cancel(this._hashHandler),this._renderer.scheduler.cancel(this._arrayHandler)))}addManagedHash(e,t){this._managedHashes.push({context:e,hash:t})}addManagedArray(e,t){this._managedArrays.push({context:e,hash:t})}prerender({container:e}){this._now=performance.now(),e.renderGroup.gcTick=P4++,this._updateInstructionGCTick(e.renderGroup,e.renderGroup.gcTick)}addRenderable(e){this.enabled&&(e._lastUsed===-1&&(this._managedRenderables.push(e),e.once("destroyed",this._removeRenderable,this)),e._lastUsed=this._now)}run(){var u;const e=this._now,t=this._managedRenderables,a=this._renderer.renderPipes;let r=0;for(let h=0;h<t.length;h++){const d=t[h];if(d===null){r++;continue}const m=d.renderGroup??d.parentRenderGroup,y=((u=m==null?void 0:m.instructionSet)==null?void 0:u.gcTick)??-1;if(((m==null?void 0:m.gcTick)??0)===y&&(d._lastUsed=e),e-d._lastUsed>this.maxUnusedTime){if(!d.destroyed){const b=a;m&&(m.structureDidChange=!0),b[d.renderPipeId].destroyRenderable(d)}d._lastUsed=-1,r++,d.off("destroyed",this._removeRenderable,this)}else t[h-r]=d}t.length-=r}destroy(){this.enabled=!1,this._renderer=null,this._managedRenderables.length=0,this._managedHashes.length=0,this._managedArrays.length=0}_removeRenderable(e){const t=this._managedRenderables.indexOf(e);t>=0&&(e.off("destroyed",this._removeRenderable,this),this._managedRenderables[t]=null)}_updateInstructionGCTick(e,t){e.instructionSet.gcTick=t;for(const a of e.renderGroupChildren)this._updateInstructionGCTick(a,t)}};Wv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"renderableGC",priority:0},Wv.defaultOptions={renderableGCActive:!0,renderableGCMaxUnusedTime:6e4,renderableGCFrequency:3e4};let z4=Wv;const Jv=class aA{constructor(e){this._renderer=e,this.count=0,this.checkCount=0}init(e){e={...aA.defaultOptions,...e},this.checkCountMax=e.textureGCCheckCountMax,this.maxIdle=e.textureGCAMaxIdle??e.textureGCMaxIdle,this.active=e.textureGCActive}postrender(){this._renderer.renderingToScreen&&(this.count++,this.active&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const e=this._renderer.texture.managedTextures;for(let t=0;t<e.length;t++){const a=e[t];a.autoGarbageCollect&&a.resource&&a._touched>-1&&this.count-a._touched>this.maxIdle&&(a._touched=-1,a.unload())}}destroy(){this._renderer=null}};Jv.extension={type:[Q.WebGLSystem,Q.WebGPUSystem],name:"textureGC"},Jv.defaultOptions={textureGCActive:!0,textureGCAMaxIdle:null,textureGCMaxIdle:3600,textureGCCheckCountMax:600};let H4=Jv;const $v=class sA{get autoDensity(){return this.texture.source.autoDensity}set autoDensity(e){this.texture.source.autoDensity=e}get resolution(){return this.texture.source._resolution}set resolution(e){this.texture.source.resize(this.texture.source.width,this.texture.source.height,e)}init(e){e={...sA.defaultOptions,...e},e.view&&(st(Rt,"ViewSystem.view has been renamed to ViewSystem.canvas"),e.canvas=e.view),this.screen=new Nt(0,0,e.width,e.height),this.canvas=e.canvas||Gt.get().createCanvas(),this.antialias=!!e.antialias,this.texture=yT(this.canvas,e),this.renderTarget=new Lv({colorTextures:[this.texture],depth:!!e.depth,isRoot:!0}),this.texture.source.transparent=e.backgroundAlpha<1,this.resolution=e.resolution}resize(e,t,a){this.texture.source.resize(e,t,a),this.screen.width=this.texture.frame.width,this.screen.height=this.texture.frame.height}destroy(e=!1){(typeof e=="boolean"?e:!!(e!=null&&e.removeView))&&this.canvas.parentNode&&this.canvas.parentNode.removeChild(this.canvas)}};$v.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"view",priority:0},$v.defaultOptions={width:800,height:600,autoDensity:!1,antialias:!1};const kT=[A4,qT,Zv,$v,LT,H4,XT,M4,LS,z4,FT],KT=[YT,J1,jT,wT,$1,tT,eT,GT],V4=[...kT,mT,PU,BU,uT,nT,BT,vT,rT,RT,CT,oT,c4,cT,lT],L4=[...KT],j4=[Z1,NT,OT],QT=[],ZT=[],WT=[];Ie.handleByNamedList(Q.WebGLSystem,QT),Ie.handleByNamedList(Q.WebGLPipes,ZT),Ie.handleByNamedList(Q.WebGLPipesAdaptor,WT),Ie.add(...V4,...L4,...j4);class Y4 extends sy{constructor(){const e={name:"webgl",type:Ds.WEBGL,systems:QT,renderPipes:ZT,renderPipeAdaptors:WT};super(e)}}const X4=Object.freeze(Object.defineProperty({__proto__:null,WebGLRenderer:Y4},Symbol.toStringTag,{value:"Module"}));class JT{constructor(e){this._hash=Object.create(null),this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_hash")}contextChange(e){this._gpu=e}getBindGroup(e,t,a){return e._updateKey(),this._hash[e._key]||this._createBindGroup(e,t,a)}_createBindGroup(e,t,a){const r=this._gpu.device,u=t.layout[a],h=[],d=this._renderer;for(const b in u){const S=e.resources[b]??e.resources[u[b]];let T;if(S._resourceType==="uniformGroup"){const E=S;d.ubo.updateUniformGroup(E);const A=E.buffer;T={buffer:d.buffer.getGPUBuffer(A),offset:0,size:A.descriptor.size}}else if(S._resourceType==="buffer"){const E=S;T={buffer:d.buffer.getGPUBuffer(E),offset:0,size:E.descriptor.size}}else if(S._resourceType==="bufferResource"){const E=S;T={buffer:d.buffer.getGPUBuffer(E.buffer),offset:E.offset,size:E.size}}else if(S._resourceType==="textureSampler"){const E=S;T=d.texture.getGpuSampler(E)}else if(S._resourceType==="textureSource"){const E=S;T=d.texture.getGpuSource(E).createView({})}h.push({binding:u[b],resource:T})}const m=d.shader.getProgramData(t).bindGroups[a],y=r.createBindGroup({layout:m,entries:h});return this._hash[e._key]=y,y}destroy(){for(const e of Object.keys(this._hash))this._hash[e]=null;this._hash=null,this._renderer=null}}JT.extension={type:[Q.WebGPUSystem],name:"bindGroup"};class $T{constructor(e){this._gpuBuffers=Object.create(null),this._managedBuffers=[],e.renderableGC.addManagedHash(this,"_gpuBuffers")}contextChange(e){this._gpu=e}getGPUBuffer(e){return this._gpuBuffers[e.uid]||this.createGPUBuffer(e)}updateBuffer(e){const t=this._gpuBuffers[e.uid]||this.createGPUBuffer(e),a=e.data;return e._updateID&&a&&(e._updateID=0,this._gpu.device.queue.writeBuffer(t,0,a.buffer,0,(e._updateSize||a.byteLength)+3&-4)),t}destroyAll(){for(const e in this._gpuBuffers)this._gpuBuffers[e].destroy();this._gpuBuffers={}}createGPUBuffer(e){this._gpuBuffers[e.uid]||(e.on("update",this.updateBuffer,this),e.on("change",this.onBufferChange,this),e.on("destroy",this.onBufferDestroy,this),this._managedBuffers.push(e));const t=this._gpu.device.createBuffer(e.descriptor);return e._updateID=0,e.data&&(hv(e.data.buffer,t.getMappedRange()),t.unmap()),this._gpuBuffers[e.uid]=t,t}onBufferChange(e){this._gpuBuffers[e.uid].destroy(),e._updateID=0,this._gpuBuffers[e.uid]=this.createGPUBuffer(e)}onBufferDestroy(e){this._managedBuffers.splice(this._managedBuffers.indexOf(e),1),this._destroyBuffer(e)}destroy(){this._managedBuffers.forEach(e=>this._destroyBuffer(e)),this._managedBuffers=null,this._gpuBuffers=null}_destroyBuffer(e){this._gpuBuffers[e.uid].destroy(),e.off("update",this.updateBuffer,this),e.off("change",this.onBufferChange,this),e.off("destroy",this.onBufferDestroy,this),this._gpuBuffers[e.uid]=null}}$T.extension={type:[Q.WebGPUSystem],name:"buffer"};class q4{constructor({minUniformOffsetAlignment:e}){this._minUniformOffsetAlignment=256,this.byteIndex=0,this._minUniformOffsetAlignment=e,this.data=new Float32Array(65535)}clear(){this.byteIndex=0}addEmptyGroup(e){if(e>this._minUniformOffsetAlignment/4)throw new Error(`UniformBufferBatch: array is too large: ${e*4}`);const t=this.byteIndex;let a=t+e*4;if(a=Math.ceil(a/this._minUniformOffsetAlignment)*this._minUniformOffsetAlignment,a>this.data.length*4)throw new Error("UniformBufferBatch: ubo batch got too big");return this.byteIndex=a,t}addGroup(e){const t=this.addEmptyGroup(e.length);for(let a=0;a<e.length;a++)this.data[t/4+a]=e[a];return t}destroy(){this.data=null}}class eE{constructor(e){this._colorMaskCache=15,this._renderer=e}setMask(e){this._colorMaskCache!==e&&(this._colorMaskCache=e,this._renderer.pipeline.setColorMask(e))}destroy(){this._renderer=null,this._colorMaskCache=null}}eE.extension={type:[Q.WebGPUSystem],name:"colorMask"};class e0{constructor(e){this._renderer=e}async init(e){return this._initPromise?this._initPromise:(this._initPromise=(e.gpu?Promise.resolve(e.gpu):this._createDeviceAndAdaptor(e)).then(t=>{this.gpu=t,this._renderer.runners.contextChange.emit(this.gpu)}),this._initPromise)}contextChange(e){this._renderer.gpu=e}async _createDeviceAndAdaptor(e){const t=await Gt.get().getNavigator().gpu.requestAdapter({powerPreference:e.powerPreference,forceFallbackAdapter:e.forceFallbackAdapter}),a=["texture-compression-bc","texture-compression-astc","texture-compression-etc2"].filter(u=>t.features.has(u)),r=await t.requestDevice({requiredFeatures:a});return{adapter:t,device:r}}destroy(){this.gpu=null,this._renderer=null}}e0.extension={type:[Q.WebGPUSystem],name:"device"},e0.defaultOptions={powerPreference:void 0,forceFallbackAdapter:!1};class tE{constructor(e){this._boundBindGroup=Object.create(null),this._boundVertexBuffer=Object.create(null),this._renderer=e}renderStart(){this.commandFinished=new Promise(e=>{this._resolveCommandFinished=e}),this.commandEncoder=this._renderer.gpu.device.createCommandEncoder()}beginRenderPass(e){this.endRenderPass(),this._clearCache(),this.renderPassEncoder=this.commandEncoder.beginRenderPass(e.descriptor)}endRenderPass(){this.renderPassEncoder&&this.renderPassEncoder.end(),this.renderPassEncoder=null}setViewport(e){this.renderPassEncoder.setViewport(e.x,e.y,e.width,e.height,0,1)}setPipelineFromGeometryProgramAndState(e,t,a,r){const u=this._renderer.pipeline.getPipeline(e,t,a,r);this.setPipeline(u)}setPipeline(e){this._boundPipeline!==e&&(this._boundPipeline=e,this.renderPassEncoder.setPipeline(e))}_setVertexBuffer(e,t){this._boundVertexBuffer[e]!==t&&(this._boundVertexBuffer[e]=t,this.renderPassEncoder.setVertexBuffer(e,this._renderer.buffer.updateBuffer(t)))}_setIndexBuffer(e){if(this._boundIndexBuffer===e)return;this._boundIndexBuffer=e;const t=e.data.BYTES_PER_ELEMENT===2?"uint16":"uint32";this.renderPassEncoder.setIndexBuffer(this._renderer.buffer.updateBuffer(e),t)}resetBindGroup(e){this._boundBindGroup[e]=null}setBindGroup(e,t,a){if(this._boundBindGroup[e]===t)return;this._boundBindGroup[e]=t,t._touch(this._renderer.textureGC.count);const r=this._renderer.bindGroup.getBindGroup(t,a,e);this.renderPassEncoder.setBindGroup(e,r)}setGeometry(e,t){const a=this._renderer.pipeline.getBufferNamesToBind(e,t);for(const r in a)this._setVertexBuffer(r,e.attributes[a[r]].buffer);e.indexBuffer&&this._setIndexBuffer(e.indexBuffer)}_setShaderBindGroups(e,t){for(const a in e.groups){const r=e.groups[a];t||this._syncBindGroup(r),this.setBindGroup(a,r,e.gpuProgram)}}_syncBindGroup(e){for(const t in e.resources){const a=e.resources[t];a.isUniformGroup&&this._renderer.ubo.updateUniformGroup(a)}}draw(e){const{geometry:t,shader:a,state:r,topology:u,size:h,start:d,instanceCount:m,skipSync:y}=e;this.setPipelineFromGeometryProgramAndState(t,a.gpuProgram,r,u),this.setGeometry(t,a.gpuProgram),this._setShaderBindGroups(a,y),t.indexBuffer?this.renderPassEncoder.drawIndexed(h||t.indexBuffer.data.length,m??t.instanceCount,d||0):this.renderPassEncoder.draw(h||t.getSize(),m??t.instanceCount,d||0)}finishRenderPass(){this.renderPassEncoder&&(this.renderPassEncoder.end(),this.renderPassEncoder=null)}postrender(){this.finishRenderPass(),this._gpu.device.queue.submit([this.commandEncoder.finish()]),this._resolveCommandFinished(),this.commandEncoder=null}restoreRenderPass(){const e=this._renderer.renderTarget.adaptor.getDescriptor(this._renderer.renderTarget.renderTarget,!1,[0,0,0,1]);this.renderPassEncoder=this.commandEncoder.beginRenderPass(e);const t=this._boundPipeline,a={...this._boundVertexBuffer},r=this._boundIndexBuffer,u={...this._boundBindGroup};this._clearCache();const h=this._renderer.renderTarget.viewport;this.renderPassEncoder.setViewport(h.x,h.y,h.width,h.height,0,1),this.setPipeline(t);for(const d in a)this._setVertexBuffer(d,a[d]);for(const d in u)this.setBindGroup(d,u[d],null);this._setIndexBuffer(r)}_clearCache(){for(let e=0;e<16;e++)this._boundBindGroup[e]=null,this._boundVertexBuffer[e]=null;this._boundIndexBuffer=null,this._boundPipeline=null}destroy(){this._renderer=null,this._gpu=null,this._boundBindGroup=null,this._boundVertexBuffer=null,this._boundIndexBuffer=null,this._boundPipeline=null}contextChange(e){this._gpu=e}}tE.extension={type:[Q.WebGPUSystem],name:"encoder",priority:1};class nE{constructor(e){this._renderer=e}contextChange(){this.maxTextures=this._renderer.device.gpu.device.limits.maxSampledTexturesPerShaderStage,this.maxBatchableTextures=this.maxTextures}destroy(){}}nE.extension={type:[Q.WebGPUSystem],name:"limits"};class iE{constructor(e){this._renderTargetStencilState=Object.create(null),this._renderer=e,e.renderTarget.onRenderTargetChange.add(this)}onRenderTargetChange(e){let t=this._renderTargetStencilState[e.uid];t||(t=this._renderTargetStencilState[e.uid]={stencilMode:bn.DISABLED,stencilReference:0}),this._activeRenderTarget=e,this.setStencilMode(t.stencilMode,t.stencilReference)}setStencilMode(e,t){const a=this._renderTargetStencilState[this._activeRenderTarget.uid];a.stencilMode=e,a.stencilReference=t;const r=this._renderer;r.pipeline.setStencilMode(e),r.encoder.renderPassEncoder.setStencilReference(t)}destroy(){this._renderer.renderTarget.onRenderTargetChange.remove(this),this._renderer=null,this._activeRenderTarget=null,this._renderTargetStencilState=null}}iE.extension={type:[Q.WebGPUSystem],name:"stencil"};const Ty={i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},f16:{align:2,size:2},"vec2<i32>":{align:8,size:8},"vec2<u32>":{align:8,size:8},"vec2<f32>":{align:8,size:8},"vec2<f16>":{align:4,size:4},"vec3<i32>":{align:16,size:12},"vec3<u32>":{align:16,size:12},"vec3<f32>":{align:16,size:12},"vec3<f16>":{align:8,size:6},"vec4<i32>":{align:16,size:16},"vec4<u32>":{align:16,size:16},"vec4<f32>":{align:16,size:16},"vec4<f16>":{align:8,size:8},"mat2x2<f32>":{align:8,size:16},"mat2x2<f16>":{align:4,size:8},"mat3x2<f32>":{align:8,size:24},"mat3x2<f16>":{align:4,size:12},"mat4x2<f32>":{align:8,size:32},"mat4x2<f16>":{align:4,size:16},"mat2x3<f32>":{align:16,size:32},"mat2x3<f16>":{align:8,size:16},"mat3x3<f32>":{align:16,size:48},"mat3x3<f16>":{align:8,size:24},"mat4x3<f32>":{align:16,size:64},"mat4x3<f16>":{align:8,size:32},"mat2x4<f32>":{align:16,size:32},"mat2x4<f16>":{align:8,size:16},"mat3x4<f32>":{align:16,size:48},"mat3x4<f16>":{align:8,size:24},"mat4x4<f32>":{align:16,size:64},"mat4x4<f16>":{align:8,size:32}};function F4(n){const e=n.map(a=>({data:a,offset:0,size:0}));let t=0;for(let a=0;a<e.length;a++){const r=e[a];let u=Ty[r.data.type].size;const h=Ty[r.data.type].align;if(!Ty[r.data.type])throw new Error(`[Pixi.js] WebGPU UniformBuffer: Unknown type ${r.data.type}`);r.data.size>1&&(u=Math.max(u,h)*r.data.size),t=Math.ceil(t/h)*h,r.size=u,r.offset=t,t+=u}return t=Math.ceil(t/16)*16,{uboElements:e,size:t}}function I4(n,e){const{size:t,align:a}=Ty[n.data.type],r=(a-t)/4,u=n.data.type.indexOf("i32")>=0?"dataInt32":"data";return`
|
|
819
|
+
v = uv.${n.data.name};
|
|
820
|
+
${e!==0?`offset += ${e};`:""}
|
|
821
|
+
|
|
822
|
+
arrayOffset = offset;
|
|
823
|
+
|
|
824
|
+
t = 0;
|
|
825
|
+
|
|
826
|
+
for(var i=0; i < ${n.data.size*(t/4)}; i++)
|
|
827
|
+
{
|
|
828
|
+
for(var j = 0; j < ${t/4}; j++)
|
|
829
|
+
{
|
|
830
|
+
${u}[arrayOffset++] = v[t++];
|
|
831
|
+
}
|
|
832
|
+
${r!==0?`arrayOffset += ${r};`:""}
|
|
833
|
+
}
|
|
834
|
+
`}function k4(n){return dT(n,"uboWgsl",I4,VU)}class aE extends hT{constructor(){super({createUboElements:F4,generateUboSync:k4})}}aE.extension={type:[Q.WebGPUSystem],name:"ubo"};const Zl=128;class sE{constructor(e){this._bindGroupHash=Object.create(null),this._buffers=[],this._bindGroups=[],this._bufferResources=[],this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_bindGroupHash"),this._batchBuffer=new q4({minUniformOffsetAlignment:Zl});const t=256/Zl;for(let a=0;a<t;a++){let r=xt.UNIFORM|xt.COPY_DST;a===0&&(r|=xt.COPY_SRC),this._buffers.push(new Ea({data:this._batchBuffer.data,usage:r}))}}renderEnd(){this._uploadBindGroups(),this._resetBindGroups()}_resetBindGroups(){for(const e in this._bindGroupHash)this._bindGroupHash[e]=null;this._batchBuffer.clear()}getUniformBindGroup(e,t){if(!t&&this._bindGroupHash[e.uid])return this._bindGroupHash[e.uid];this._renderer.ubo.ensureUniformGroup(e);const a=e.buffer.data,r=this._batchBuffer.addEmptyGroup(a.length);return this._renderer.ubo.syncUniformGroup(e,this._batchBuffer.data,r/4),this._bindGroupHash[e.uid]=this._getBindGroup(r/Zl),this._bindGroupHash[e.uid]}getUboResource(e){this._renderer.ubo.updateUniformGroup(e);const t=e.buffer.data,a=this._batchBuffer.addGroup(t);return this._getBufferResource(a/Zl)}getArrayBindGroup(e){const t=this._batchBuffer.addGroup(e);return this._getBindGroup(t/Zl)}getArrayBufferResource(e){const a=this._batchBuffer.addGroup(e)/Zl;return this._getBufferResource(a)}_getBufferResource(e){if(!this._bufferResources[e]){const t=this._buffers[e%2];this._bufferResources[e]=new jv({buffer:t,offset:(e/2|0)*256,size:Zl})}return this._bufferResources[e]}_getBindGroup(e){if(!this._bindGroups[e]){const t=new el({0:this._getBufferResource(e)});this._bindGroups[e]=t}return this._bindGroups[e]}_uploadBindGroups(){const e=this._renderer.buffer,t=this._buffers[0];t.update(this._batchBuffer.byteIndex),e.updateBuffer(t);const a=this._renderer.gpu.device.createCommandEncoder();for(let r=1;r<this._buffers.length;r++){const u=this._buffers[r];a.copyBufferToBuffer(e.getGPUBuffer(t),Zl,e.getGPUBuffer(u),0,this._batchBuffer.byteIndex)}this._renderer.gpu.device.queue.submit([a.finish()])}destroy(){for(let e=0;e<this._bindGroups.length;e++)this._bindGroups[e].destroy();this._bindGroups=null,this._bindGroupHash=null;for(let e=0;e<this._buffers.length;e++)this._buffers[e].destroy();this._buffers=null;for(let e=0;e<this._bufferResources.length;e++)this._bufferResources[e].destroy();this._bufferResources=null,this._batchBuffer.destroy(),this._bindGroupHash=null,this._renderer=null}}sE.extension={type:[Q.WebGPUPipes],name:"uniformBatch"};const K4={"point-list":0,"line-list":1,"line-strip":2,"triangle-list":3,"triangle-strip":4};function Q4(n,e,t,a,r){return n<<24|e<<16|t<<10|a<<5|r}function Z4(n,e,t,a){return t<<6|n<<3|a<<1|e}class rE{constructor(e){this._moduleCache=Object.create(null),this._bufferLayoutsCache=Object.create(null),this._bindingNamesCache=Object.create(null),this._pipeCache=Object.create(null),this._pipeStateCaches=Object.create(null),this._colorMask=15,this._multisampleCount=1,this._renderer=e}contextChange(e){this._gpu=e,this.setStencilMode(bn.DISABLED),this._updatePipeHash()}setMultisampleCount(e){this._multisampleCount!==e&&(this._multisampleCount=e,this._updatePipeHash())}setRenderTarget(e){this._multisampleCount=e.msaaSamples,this._depthStencilAttachment=e.descriptor.depthStencilAttachment?1:0,this._updatePipeHash()}setColorMask(e){this._colorMask!==e&&(this._colorMask=e,this._updatePipeHash())}setStencilMode(e){this._stencilMode!==e&&(this._stencilMode=e,this._stencilState=Ql[e],this._updatePipeHash())}setPipeline(e,t,a,r){const u=this.getPipeline(e,t,a);r.setPipeline(u)}getPipeline(e,t,a,r){e._layoutKey||(iT(e,t.attributeData),this._generateBufferKey(e)),r||(r=e.topology);const u=Q4(e._layoutKey,t._layoutKey,a.data,a._blendModeId,K4[r]);return this._pipeCache[u]?this._pipeCache[u]:(this._pipeCache[u]=this._createPipeline(e,t,a,r),this._pipeCache[u])}_createPipeline(e,t,a,r){const u=this._gpu.device,h=this._createVertexBufferLayouts(e,t),d=this._renderer.state.getColorTargets(a);d[0].writeMask=this._stencilMode===bn.RENDERING_MASK_ADD?0:this._colorMask;const m=this._renderer.shader.getProgramData(t).pipeline,y={vertex:{module:this._getModule(t.vertex.source),entryPoint:t.vertex.entryPoint,buffers:h},fragment:{module:this._getModule(t.fragment.source),entryPoint:t.fragment.entryPoint,targets:d},primitive:{topology:r,cullMode:a.cullMode},layout:m,multisample:{count:this._multisampleCount},label:"PIXI Pipeline"};return this._depthStencilAttachment&&(y.depthStencil={...this._stencilState,format:"depth24plus-stencil8",depthWriteEnabled:a.depthTest,depthCompare:a.depthTest?"less":"always"}),u.createRenderPipeline(y)}_getModule(e){return this._moduleCache[e]||this._createModule(e)}_createModule(e){const t=this._gpu.device;return this._moduleCache[e]=t.createShaderModule({code:e}),this._moduleCache[e]}_generateBufferKey(e){const t=[];let a=0;const r=Object.keys(e.attributes).sort();for(let h=0;h<r.length;h++){const d=e.attributes[r[h]];t[a++]=d.offset,t[a++]=d.format,t[a++]=d.stride,t[a++]=d.instance}const u=t.join("|");return e._layoutKey=Jf(u,"geometry"),e._layoutKey}_generateAttributeLocationsKey(e){const t=[];let a=0;const r=Object.keys(e.attributeData).sort();for(let h=0;h<r.length;h++){const d=e.attributeData[r[h]];t[a++]=d.location}const u=t.join("|");return e._attributeLocationsKey=Jf(u,"programAttributes"),e._attributeLocationsKey}getBufferNamesToBind(e,t){const a=e._layoutKey<<16|t._attributeLocationsKey;if(this._bindingNamesCache[a])return this._bindingNamesCache[a];const r=this._createVertexBufferLayouts(e,t),u=Object.create(null),h=t.attributeData;for(let d=0;d<r.length;d++){const y=Object.values(r[d].attributes)[0].shaderLocation;for(const b in h)if(h[b].location===y){u[d]=b;break}}return this._bindingNamesCache[a]=u,u}_createVertexBufferLayouts(e,t){t._attributeLocationsKey||this._generateAttributeLocationsKey(t);const a=e._layoutKey<<16|t._attributeLocationsKey;if(this._bufferLayoutsCache[a])return this._bufferLayoutsCache[a];const r=[];return e.buffers.forEach(u=>{const h={arrayStride:0,stepMode:"vertex",attributes:[]},d=h.attributes;for(const m in t.attributeData){const y=e.attributes[m];(y.divisor??1)!==1&&rt(`Attribute ${m} has an invalid divisor value of '${y.divisor}'. WebGPU only supports a divisor value of 1`),y.buffer===u&&(h.arrayStride=y.stride,h.stepMode=y.instance?"instance":"vertex",d.push({shaderLocation:t.attributeData[m].location,offset:y.offset,format:y.format}))}d.length&&r.push(h)}),this._bufferLayoutsCache[a]=r,r}_updatePipeHash(){const e=Z4(this._stencilMode,this._multisampleCount,this._colorMask,this._depthStencilAttachment);this._pipeStateCaches[e]||(this._pipeStateCaches[e]=Object.create(null)),this._pipeCache=this._pipeStateCaches[e]}destroy(){this._renderer=null,this._bufferLayoutsCache=null}}rE.extension={type:[Q.WebGPUSystem],name:"pipeline"};class W4{constructor(){this.contexts=[],this.msaaTextures=[],this.msaaSamples=1}}class J4{init(e,t){this._renderer=e,this._renderTargetSystem=t}copyToTexture(e,t,a,r,u){const h=this._renderer,d=this._getGpuColorTexture(e),m=h.texture.getGpuSource(t.source);return h.encoder.commandEncoder.copyTextureToTexture({texture:d,origin:a},{texture:m,origin:u},r),t}startRenderPass(e,t=!0,a,r){const h=this._renderTargetSystem.getGpuRenderTarget(e),d=this.getDescriptor(e,t,a);h.descriptor=d,this._renderer.pipeline.setRenderTarget(h),this._renderer.encoder.beginRenderPass(h),this._renderer.encoder.setViewport(r)}finishRenderPass(){this._renderer.encoder.endRenderPass()}_getGpuColorTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);return t.contexts[0]?t.contexts[0].getCurrentTexture():this._renderer.texture.getGpuSource(e.colorTextures[0].source)}getDescriptor(e,t,a){typeof t=="boolean"&&(t=t?Ta.ALL:Ta.NONE);const r=this._renderTargetSystem,u=r.getGpuRenderTarget(e),h=e.colorTextures.map((y,b)=>{const S=u.contexts[b];let T,E;S?T=S.getCurrentTexture().createView():T=this._renderer.texture.getGpuSource(y).createView({mipLevelCount:1}),u.msaaTextures[b]&&(E=T,T=this._renderer.texture.getTextureView(u.msaaTextures[b]));const A=t&Ta.COLOR?"clear":"load";return a??(a=r.defaultClearColor),{view:T,resolveTarget:E,clearValue:a,storeOp:"store",loadOp:A}});let d;if((e.stencil||e.depth)&&!e.depthStencilTexture&&(e.ensureDepthStencilTexture(),e.depthStencilTexture.source.sampleCount=u.msaa?4:1),e.depthStencilTexture){const y=t&Ta.STENCIL?"clear":"load",b=t&Ta.DEPTH?"clear":"load";d={view:this._renderer.texture.getGpuSource(e.depthStencilTexture.source).createView(),stencilStoreOp:"store",stencilLoadOp:y,depthClearValue:1,depthLoadOp:b,depthStoreOp:"store"}}return{colorAttachments:h,depthStencilAttachment:d}}clear(e,t=!0,a,r){if(!t)return;const{gpu:u,encoder:h}=this._renderer,d=u.device;if(h.commandEncoder===null){const y=d.createCommandEncoder(),b=this.getDescriptor(e,t,a),S=y.beginRenderPass(b);S.setViewport(r.x,r.y,r.width,r.height,0,1),S.end();const T=y.finish();d.queue.submit([T])}else this.startRenderPass(e,t,a,r)}initGpuRenderTarget(e){e.isRoot=!0;const t=new W4;return e.colorTextures.forEach((a,r)=>{if(a instanceof Jr){const u=a.resource.getContext("webgpu"),h=a.transparent?"premultiplied":"opaque";try{u.configure({device:this._renderer.gpu.device,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST|GPUTextureUsage.RENDER_ATTACHMENT|GPUTextureUsage.COPY_SRC,format:"bgra8unorm",alphaMode:h})}catch(d){console.error(d)}t.contexts[r]=u}if(t.msaa=a.source.antialias,a.source.antialias){const u=new Nn({width:0,height:0,sampleCount:4});t.msaaTextures[r]=u}}),t.msaa&&(t.msaaSamples=4,e.depthStencilTexture&&(e.depthStencilTexture.source.sampleCount=4)),t}destroyGpuRenderTarget(e){e.contexts.forEach(t=>{t.unconfigure()}),e.msaaTextures.forEach(t=>{t.destroy()}),e.msaaTextures.length=0,e.contexts.length=0}ensureDepthStencilTexture(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);e.depthStencilTexture&&t.msaa&&(e.depthStencilTexture.source.sampleCount=4)}resizeGpuRenderTarget(e){const t=this._renderTargetSystem.getGpuRenderTarget(e);t.width=e.width,t.height=e.height,t.msaa&&e.colorTextures.forEach((a,r)=>{const u=t.msaaTextures[r];u==null||u.resize(a.source.width,a.source.height,a.source._resolution)})}}class lE extends _T{constructor(e){super(e),this.adaptor=new J4,this.adaptor.init(e,this)}}lE.extension={type:[Q.WebGPUSystem],name:"renderTarget"};class oE{constructor(){this._gpuProgramData=Object.create(null)}contextChange(e){this._gpu=e}getProgramData(e){return this._gpuProgramData[e._layoutKey]||this._createGPUProgramData(e)}_createGPUProgramData(e){const t=this._gpu.device,a=e.gpuLayout.map(u=>t.createBindGroupLayout({entries:u})),r={bindGroupLayouts:a};return this._gpuProgramData[e._layoutKey]={bindGroups:a,pipeline:t.createPipelineLayout(r)},this._gpuProgramData[e._layoutKey]}destroy(){this._gpu=null,this._gpuProgramData=null}}oE.extension={type:[Q.WebGPUSystem],name:"shader"};const sa={};sa.normal={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"}},sa.add={alpha:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one",operation:"add"}},sa.multiply={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"dst",dstFactor:"one-minus-src-alpha",operation:"add"}},sa.screen={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},sa.overlay={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"one",dstFactor:"one-minus-src",operation:"add"}},sa.none={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"zero",operation:"add"}},sa["normal-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src-alpha",operation:"add"}},sa["add-npm"]={alpha:{srcFactor:"one",dstFactor:"one",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one",operation:"add"}},sa["screen-npm"]={alpha:{srcFactor:"one",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"src-alpha",dstFactor:"one-minus-src",operation:"add"}},sa.erase={alpha:{srcFactor:"zero",dstFactor:"one-minus-src-alpha",operation:"add"},color:{srcFactor:"zero",dstFactor:"one-minus-src",operation:"add"}},sa.min={alpha:{srcFactor:"one",dstFactor:"one",operation:"min"},color:{srcFactor:"one",dstFactor:"one",operation:"min"}},sa.max={alpha:{srcFactor:"one",dstFactor:"one",operation:"max"},color:{srcFactor:"one",dstFactor:"one",operation:"max"}};class uE{constructor(){this.defaultState=new Us,this.defaultState.blend=!0}contextChange(e){this.gpu=e}getColorTargets(e){return[{format:"bgra8unorm",writeMask:0,blend:sa[e.blendMode]||sa.normal}]}destroy(){this.gpu=null}}uE.extension={type:[Q.WebGPUSystem],name:"state"};const $4={type:"image",upload(n,e,t){const a=n.resource,r=(n.pixelWidth|0)*(n.pixelHeight|0),u=a.byteLength/r;t.device.queue.writeTexture({texture:e},a,{offset:0,rowsPerImage:n.pixelHeight,bytesPerRow:n.pixelHeight*u},{width:n.pixelWidth,height:n.pixelHeight,depthOrArrayLayers:1})}},cE={"bc1-rgba-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"bc2-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc3-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"bc7-rgba-unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"etc1-rgb-unorm":{blockBytes:8,blockWidth:4,blockHeight:4},"etc2-rgba8unorm":{blockBytes:16,blockWidth:4,blockHeight:4},"astc-4x4-unorm":{blockBytes:16,blockWidth:4,blockHeight:4}},eB={blockBytes:4,blockWidth:1,blockHeight:1},tB={type:"compressed",upload(n,e,t){let a=n.pixelWidth,r=n.pixelHeight;const u=cE[n.format]||eB;for(let h=0;h<n.resource.length;h++){const d=n.resource[h],m=Math.ceil(a/u.blockWidth)*u.blockBytes;t.device.queue.writeTexture({texture:e,mipLevel:h},d,{offset:0,bytesPerRow:m},{width:Math.ceil(a/u.blockWidth)*u.blockWidth,height:Math.ceil(r/u.blockHeight)*u.blockHeight,depthOrArrayLayers:1}),a=Math.max(a>>1,1),r=Math.max(r>>1,1)}}},hE={type:"image",upload(n,e,t){const a=n.resource;if(!a)return;if(globalThis.HTMLImageElement&&a instanceof HTMLImageElement){const d=Gt.get().createCanvas(a.width,a.height);d.getContext("2d").drawImage(a,0,0,a.width,a.height),n.resource=d,rt("ImageSource: Image element passed, converting to canvas and replacing resource.")}const r=Math.min(e.width,n.resourceWidth||n.pixelWidth),u=Math.min(e.height,n.resourceHeight||n.pixelHeight),h=n.alphaMode==="premultiply-alpha-on-upload";t.device.queue.copyExternalImageToTexture({source:a},{texture:e,premultipliedAlpha:h},{width:r,height:u})}},nB={type:"video",upload(n,e,t){hE.upload(n,e,t)}};class iB{constructor(e){this.device=e,this.sampler=e.createSampler({minFilter:"linear"}),this.pipelines={}}_getMipmapPipeline(e){let t=this.pipelines[e];return t||(this.mipmapShaderModule||(this.mipmapShaderModule=this.device.createShaderModule({code:`
|
|
835
|
+
var<private> pos : array<vec2<f32>, 3> = array<vec2<f32>, 3>(
|
|
836
|
+
vec2<f32>(-1.0, -1.0), vec2<f32>(-1.0, 3.0), vec2<f32>(3.0, -1.0));
|
|
837
|
+
|
|
838
|
+
struct VertexOutput {
|
|
839
|
+
@builtin(position) position : vec4<f32>,
|
|
840
|
+
@location(0) texCoord : vec2<f32>,
|
|
841
|
+
};
|
|
842
|
+
|
|
843
|
+
@vertex
|
|
844
|
+
fn vertexMain(@builtin(vertex_index) vertexIndex : u32) -> VertexOutput {
|
|
845
|
+
var output : VertexOutput;
|
|
846
|
+
output.texCoord = pos[vertexIndex] * vec2<f32>(0.5, -0.5) + vec2<f32>(0.5);
|
|
847
|
+
output.position = vec4<f32>(pos[vertexIndex], 0.0, 1.0);
|
|
848
|
+
return output;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
@group(0) @binding(0) var imgSampler : sampler;
|
|
852
|
+
@group(0) @binding(1) var img : texture_2d<f32>;
|
|
853
|
+
|
|
854
|
+
@fragment
|
|
855
|
+
fn fragmentMain(@location(0) texCoord : vec2<f32>) -> @location(0) vec4<f32> {
|
|
856
|
+
return textureSample(img, imgSampler, texCoord);
|
|
857
|
+
}
|
|
858
|
+
`})),t=this.device.createRenderPipeline({layout:"auto",vertex:{module:this.mipmapShaderModule,entryPoint:"vertexMain"},fragment:{module:this.mipmapShaderModule,entryPoint:"fragmentMain",targets:[{format:e}]}}),this.pipelines[e]=t),t}generateMipmap(e){const t=this._getMipmapPipeline(e.format);if(e.dimension==="3d"||e.dimension==="1d")throw new Error("Generating mipmaps for non-2d textures is currently unsupported!");let a=e;const r=e.depthOrArrayLayers||1,u=e.usage&GPUTextureUsage.RENDER_ATTACHMENT;if(!u){const m={size:{width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r},format:e.format,usage:GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_SRC|GPUTextureUsage.RENDER_ATTACHMENT,mipLevelCount:e.mipLevelCount-1};a=this.device.createTexture(m)}const h=this.device.createCommandEncoder({}),d=t.getBindGroupLayout(0);for(let m=0;m<r;++m){let y=e.createView({baseMipLevel:0,mipLevelCount:1,dimension:"2d",baseArrayLayer:m,arrayLayerCount:1}),b=u?1:0;for(let S=1;S<e.mipLevelCount;++S){const T=a.createView({baseMipLevel:b++,mipLevelCount:1,dimension:"2d",baseArrayLayer:m,arrayLayerCount:1}),E=h.beginRenderPass({colorAttachments:[{view:T,storeOp:"store",loadOp:"clear",clearValue:{r:0,g:0,b:0,a:0}}]}),A=this.device.createBindGroup({layout:d,entries:[{binding:0,resource:this.sampler},{binding:1,resource:y}]});E.setPipeline(t),E.setBindGroup(0,A),E.draw(3,1,0,0),E.end(),y=T}}if(!u){const m={width:Math.ceil(e.width/2),height:Math.ceil(e.height/2),depthOrArrayLayers:r};for(let y=1;y<e.mipLevelCount;++y)h.copyTextureToTexture({texture:a,mipLevel:y-1},{texture:e,mipLevel:y},m),m.width=Math.ceil(m.width/2),m.height=Math.ceil(m.height/2)}return this.device.queue.submit([h.finish()]),u||a.destroy(),e}}class fE{constructor(e){this.managedTextures=[],this._gpuSources=Object.create(null),this._gpuSamplers=Object.create(null),this._bindGroupHash=Object.create(null),this._textureViewHash=Object.create(null),this._uploads={image:hE,buffer:$4,video:nB,compressed:tB},this._renderer=e,e.renderableGC.addManagedHash(this,"_gpuSources"),e.renderableGC.addManagedHash(this,"_gpuSamplers"),e.renderableGC.addManagedHash(this,"_bindGroupHash"),e.renderableGC.addManagedHash(this,"_textureViewHash")}contextChange(e){this._gpu=e}initSource(e){return this._gpuSources[e.uid]?this._gpuSources[e.uid]:this._initSource(e)}_initSource(e){if(e.autoGenerateMipmaps){const m=Math.max(e.pixelWidth,e.pixelHeight);e.mipLevelCount=Math.floor(Math.log2(m))+1}let t=GPUTextureUsage.TEXTURE_BINDING|GPUTextureUsage.COPY_DST;e.uploadMethodId!=="compressed"&&(t|=GPUTextureUsage.RENDER_ATTACHMENT,t|=GPUTextureUsage.COPY_SRC);const a=cE[e.format]||{blockWidth:1,blockHeight:1},r=Math.ceil(e.pixelWidth/a.blockWidth)*a.blockWidth,u=Math.ceil(e.pixelHeight/a.blockHeight)*a.blockHeight,h={label:e.label,size:{width:r,height:u},format:e.format,sampleCount:e.sampleCount,mipLevelCount:e.mipLevelCount,dimension:e.dimension,usage:t},d=this._gpuSources[e.uid]=this._gpu.device.createTexture(h);return this.managedTextures.includes(e)||(e.on("update",this.onSourceUpdate,this),e.on("resize",this.onSourceResize,this),e.on("destroy",this.onSourceDestroy,this),e.on("unload",this.onSourceUnload,this),e.on("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.push(e)),this.onSourceUpdate(e),d}onSourceUpdate(e){const t=this.getGpuSource(e);t&&(this._uploads[e.uploadMethodId]&&this._uploads[e.uploadMethodId].upload(e,t,this._gpu),e.autoGenerateMipmaps&&e.mipLevelCount>1&&this.onUpdateMipmaps(e))}onSourceUnload(e){const t=this._gpuSources[e.uid];t&&(this._gpuSources[e.uid]=null,t.destroy())}onUpdateMipmaps(e){this._mipmapGenerator||(this._mipmapGenerator=new iB(this._gpu.device));const t=this.getGpuSource(e);this._mipmapGenerator.generateMipmap(t)}onSourceDestroy(e){e.off("update",this.onSourceUpdate,this),e.off("unload",this.onSourceUnload,this),e.off("destroy",this.onSourceDestroy,this),e.off("resize",this.onSourceResize,this),e.off("updateMipmaps",this.onUpdateMipmaps,this),this.managedTextures.splice(this.managedTextures.indexOf(e),1),this.onSourceUnload(e)}onSourceResize(e){const t=this._gpuSources[e.uid];t?(t.width!==e.pixelWidth||t.height!==e.pixelHeight)&&(this._textureViewHash[e.uid]=null,this._bindGroupHash[e.uid]=null,this.onSourceUnload(e),this.initSource(e)):this.initSource(e)}_initSampler(e){return this._gpuSamplers[e._resourceId]=this._gpu.device.createSampler(e),this._gpuSamplers[e._resourceId]}getGpuSampler(e){return this._gpuSamplers[e._resourceId]||this._initSampler(e)}getGpuSource(e){return this._gpuSources[e.uid]||this.initSource(e)}getTextureBindGroup(e){return this._bindGroupHash[e.uid]??this._createTextureBindGroup(e)}_createTextureBindGroup(e){const t=e.source;return this._bindGroupHash[e.uid]=new el({0:t,1:t.style,2:new Yi({uTextureMatrix:{type:"mat3x3<f32>",value:e.textureMatrix.mapCoord}})}),this._bindGroupHash[e.uid]}getTextureView(e){const t=e.source;return this._textureViewHash[t.uid]??this._createTextureView(t)}_createTextureView(e){return this._textureViewHash[e.uid]=this.getGpuSource(e).createView(),this._textureViewHash[e.uid]}generateCanvas(e){const t=this._renderer,a=t.gpu.device.createCommandEncoder(),r=Gt.get().createCanvas();r.width=e.source.pixelWidth,r.height=e.source.pixelHeight;const u=r.getContext("webgpu");return u.configure({device:t.gpu.device,usage:GPUTextureUsage.COPY_DST|GPUTextureUsage.COPY_SRC,format:Gt.get().getNavigator().gpu.getPreferredCanvasFormat(),alphaMode:"premultiplied"}),a.copyTextureToTexture({texture:t.texture.getGpuSource(e.source),origin:{x:0,y:0}},{texture:u.getCurrentTexture()},{width:r.width,height:r.height}),t.gpu.device.queue.submit([a.finish()]),r}getPixels(e){const t=this.generateCanvas(e),a=kl.getOptimalCanvasAndContext(t.width,t.height),r=a.context;r.drawImage(t,0,0);const{width:u,height:h}=t,d=r.getImageData(0,0,u,h),m=new Uint8ClampedArray(d.data.buffer);return kl.returnCanvasAndContext(a),{pixels:m,width:u,height:h}}destroy(){this.managedTextures.slice().forEach(e=>this.onSourceDestroy(e)),this.managedTextures=null;for(const e of Object.keys(this._bindGroupHash)){const t=Number(e),a=this._bindGroupHash[t];a==null||a.destroy(),this._bindGroupHash[t]=null}this._gpu=null,this._mipmapGenerator=null,this._gpuSources=null,this._bindGroupHash=null,this._textureViewHash=null,this._gpuSamplers=null}}fE.extension={type:[Q.WebGPUSystem],name:"texture"};class dE{constructor(){this._maxTextures=0}contextChange(e){const t=new Yi({uTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}});this._maxTextures=e.limits.maxBatchableTextures;const a=ud({name:"graphics",bits:[pv,gv(this._maxTextures),CU,hd]});this.shader=new ka({gpuProgram:a,resources:{localUniforms:t}})}execute(e,t){const a=t.context,r=a.customShader||this.shader,u=e.renderer,h=u.graphicsContext,{batcher:d,instructions:m}=h.getContextRenderData(a),y=u.encoder;y.setGeometry(d.geometry,r.gpuProgram);const b=u.globalUniforms.bindGroup;y.setBindGroup(0,b,r.gpuProgram);const S=u.renderPipes.uniformBatch.getUniformBindGroup(r.resources.localUniforms,!0);y.setBindGroup(2,S,r.gpuProgram);const T=m.instructions;let E=null;for(let A=0;A<m.instructionSize;A++){const B=T[A];if(B.topology!==E&&(E=B.topology,y.setPipelineFromGeometryProgramAndState(d.geometry,r.gpuProgram,e.state,B.topology)),r.groups[1]=B.bindGroup,!B.gpuBindGroup){const M=B.textures;B.bindGroup=cv(M.textures,M.count,this._maxTextures),B.gpuBindGroup=u.bindGroup.getBindGroup(B.bindGroup,r.gpuProgram,1)}y.setBindGroup(1,B.bindGroup,r.gpuProgram),y.renderPassEncoder.drawIndexed(B.size,1,B.start)}}destroy(){this.shader.destroy(!0),this.shader=null}}dE.extension={type:[Q.WebGPUPipesAdaptor],name:"graphics"};class pE{init(){const e=ud({name:"mesh",bits:[gd,RU,hd]});this._shader=new ka({gpuProgram:e,resources:{uTexture:Ge.EMPTY._source,uSampler:Ge.EMPTY._source.style,textureUniforms:{uTextureMatrix:{type:"mat3x3<f32>",value:new Pe}}}})}execute(e,t){const a=e.renderer;let r=t._shader;if(!r)r=this._shader,r.groups[2]=a.texture.getTextureBindGroup(t.texture);else if(!r.gpuProgram){rt("Mesh shader has no gpuProgram",t.shader);return}const u=r.gpuProgram;if(u.autoAssignGlobalUniforms&&(r.groups[0]=a.globalUniforms.bindGroup),u.autoAssignLocalUniforms){const h=e.localUniforms;r.groups[1]=a.renderPipes.uniformBatch.getUniformBindGroup(h,!0)}a.encoder.draw({geometry:t._geometry,shader:r,state:t.state})}destroy(){this._shader.destroy(!0),this._shader=null}}pE.extension={type:[Q.WebGPUPipesAdaptor],name:"mesh"};const aB=[...kT,aE,tE,e0,nE,$T,fE,lE,oE,uE,rE,eE,iE,JT],sB=[...KT,sE],rB=[W1,pE,dE],mE=[],yE=[],gE=[];Ie.handleByNamedList(Q.WebGPUSystem,mE),Ie.handleByNamedList(Q.WebGPUPipes,yE),Ie.handleByNamedList(Q.WebGPUPipesAdaptor,gE),Ie.add(...aB,...sB,...rB);class lB extends sy{constructor(){const e={name:"webgpu",type:Ds.WEBGPU,systems:mE,renderPipes:yE,renderPipeAdaptors:gE};super(e)}}const oB=Object.freeze(Object.defineProperty({__proto__:null,WebGPURenderer:lB},Symbol.toStringTag,{value:"Module"}));class uB{constructor(){this.batches=[],this.batched=!1}destroy(){this.batches.forEach(e=>{hi.return(e)}),this.batches.length=0}}class _E{constructor(e,t){this.state=Us.for2d(),this.renderer=e,this._adaptor=t,this.renderer.runners.contextChange.add(this)}contextChange(){this._adaptor.contextChange(this.renderer)}validateRenderable(e){const t=e.context,a=!!e._gpuData,r=this.renderer.graphicsContext.updateGpuContext(t);return!!(r.isBatchable||a!==r.isBatchable)}addRenderable(e,t){const a=this.renderer.graphicsContext.updateGpuContext(e.context);e.didViewUpdate&&this._rebuild(e),a.isBatchable?this._addToBatcher(e,t):(this.renderer.renderPipes.batch.break(t),t.add(e))}updateRenderable(e){const a=this._getGpuDataForRenderable(e).batches;for(let r=0;r<a.length;r++){const u=a[r];u._batcher.updateElement(u)}}execute(e){if(!e.isRenderable)return;const t=this.renderer,a=e.context;if(!t.graphicsContext.getGpuContext(a).batches.length)return;const u=a.customShader||this._adaptor.shader;this.state.blendMode=e.groupBlendMode;const h=u.resources.localUniforms.uniforms;h.uTransformMatrix=e.groupTransform,h.uRound=t._roundPixels|e._roundPixels,bd(e.groupColorAlpha,h.uColor,0),this._adaptor.execute(this,e)}_rebuild(e){const t=this._getGpuDataForRenderable(e),a=this.renderer.graphicsContext.updateGpuContext(e.context);t.destroy(),a.isBatchable&&this._updateBatchesForRenderable(e,t)}_addToBatcher(e,t){const a=this.renderer.renderPipes.batch,r=this._getGpuDataForRenderable(e).batches;for(let u=0;u<r.length;u++){const h=r[u];a.addToBatch(h,t)}}_getGpuDataForRenderable(e){return e._gpuData[this.renderer.uid]||this._initGpuDataForRenderable(e)}_initGpuDataForRenderable(e){const t=new uB;return e._gpuData[this.renderer.uid]=t,t}_updateBatchesForRenderable(e,t){const a=e.context,r=this.renderer.graphicsContext.getGpuContext(a),u=this.renderer._roundPixels|e._roundPixels;t.batches=r.batches.map(h=>{const d=hi.get(Tv);return h.copyTo(d),d.renderable=e,d.roundPixels=u,d})}destroy(){this.renderer=null,this._adaptor.destroy(),this._adaptor=null,this.state=null}}_E.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"graphics"};const vE=class rA extends Nv{constructor(...e){super({});let t=e[0]??{};typeof t=="number"&&(st(Rt,"PlaneGeometry constructor changed please use { width, height, verticesX, verticesY } instead"),t={width:t,height:e[1],verticesX:e[2],verticesY:e[3]}),this.build(t)}build(e){e={...rA.defaultOptions,...e},this.verticesX=this.verticesX??e.verticesX,this.verticesY=this.verticesY??e.verticesY,this.width=this.width??e.width,this.height=this.height??e.height;const t=this.verticesX*this.verticesY,a=[],r=[],u=[],h=this.verticesX-1,d=this.verticesY-1,m=this.width/h,y=this.height/d;for(let S=0;S<t;S++){const T=S%this.verticesX,E=S/this.verticesX|0;a.push(T*m,E*y),r.push(T/h,E/d)}const b=h*d;for(let S=0;S<b;S++){const T=S%h,E=S/h|0,A=E*this.verticesX+T,B=E*this.verticesX+T+1,M=(E+1)*this.verticesX+T,G=(E+1)*this.verticesX+T+1;u.push(A,B,M,B,G,M)}this.buffers[0].data=new Float32Array(a),this.buffers[1].data=new Float32Array(r),this.indexBuffer.data=new Uint32Array(u),this.buffers[0].update(),this.buffers[1].update(),this.indexBuffer.update()}};vE.defaultOptions={width:100,height:100,verticesX:10,verticesY:10};let cB=vE;class t0{constructor(){this.batcherName="default",this.packAsQuad=!1,this.indexOffset=0,this.attributeOffset=0,this.roundPixels=0,this._batcher=null,this._batch=null,this._textureMatrixUpdateId=-1,this._uvUpdateId=-1}get blendMode(){return this.renderable.groupBlendMode}get topology(){return this._topology||this.geometry.topology}set topology(e){this._topology=e}reset(){this.renderable=null,this.texture=null,this._batcher=null,this._batch=null,this.geometry=null,this._uvUpdateId=-1,this._textureMatrixUpdateId=-1}setTexture(e){this.texture!==e&&(this.texture=e,this._textureMatrixUpdateId=-1)}get uvs(){const t=this.geometry.getBuffer("aUV"),a=t.data;let r=a;const u=this.texture.textureMatrix;return u.isSimple||(r=this._transformedUvs,(this._textureMatrixUpdateId!==u._updateID||this._uvUpdateId!==t._updateID)&&((!r||r.length<a.length)&&(r=this._transformedUvs=new Float32Array(a.length)),this._textureMatrixUpdateId=u._updateID,this._uvUpdateId=t._updateID,u.multiplyUvs(a,r))),r}get positions(){return this.geometry.positions}get indices(){return this.geometry.indices}get color(){return this.renderable.groupColorAlpha}get groupTransform(){return this.renderable.groupTransform}get attributeSize(){return this.geometry.positions.length/2}get indexSize(){return this.geometry.indices.length}}class bE{destroy(){}}class xE{constructor(e,t){this.localUniforms=new Yi({uTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),this.localUniformsBindGroup=new el({0:this.localUniforms}),this.renderer=e,this._adaptor=t,this._adaptor.init()}validateRenderable(e){const t=this._getMeshData(e),a=t.batched,r=e.batched;if(t.batched=r,a!==r)return!0;if(r){const u=e._geometry;if(u.indices.length!==t.indexSize||u.positions.length!==t.vertexSize)return t.indexSize=u.indices.length,t.vertexSize=u.positions.length,!0;const h=this._getBatchableMesh(e);return h.texture.uid!==e._texture.uid&&(h._textureMatrixUpdateId=-1),!h._batcher.checkAndUpdateTexture(h,e._texture)}return!1}addRenderable(e,t){var u,h;const a=this.renderer.renderPipes.batch,r=this._getMeshData(e);if(e.didViewUpdate&&(r.indexSize=(u=e._geometry.indices)==null?void 0:u.length,r.vertexSize=(h=e._geometry.positions)==null?void 0:h.length),r.batched){const d=this._getBatchableMesh(e);d.setTexture(e._texture),d.geometry=e._geometry,a.addToBatch(d,t)}else a.break(t),t.add(e)}updateRenderable(e){if(e.batched){const t=this._getBatchableMesh(e);t.setTexture(e._texture),t.geometry=e._geometry,t._batcher.updateElement(t)}}execute(e){if(!e.isRenderable)return;e.state.blendMode=rd(e.groupBlendMode,e.texture._source);const t=this.localUniforms;t.uniforms.uTransformMatrix=e.groupTransform,t.uniforms.uRound=this.renderer._roundPixels|e._roundPixels,t.update(),bd(e.groupColorAlpha,t.uniforms.uColor,0),this._adaptor.execute(this,e)}_getMeshData(e){var t,a;return(t=e._gpuData)[a=this.renderer.uid]||(t[a]=new bE),e._gpuData[this.renderer.uid].meshData||this._initMeshData(e)}_initMeshData(e){return e._gpuData[this.renderer.uid].meshData={batched:e.batched,indexSize:0,vertexSize:0},e._gpuData[this.renderer.uid].meshData}_getBatchableMesh(e){var t,a;return(t=e._gpuData)[a=this.renderer.uid]||(t[a]=new bE),e._gpuData[this.renderer.uid].batchableMesh||this._initBatchableMesh(e)}_initBatchableMesh(e){const t=new t0;return t.renderable=e,t.setTexture(e._texture),t.transform=e.groupTransform,t.roundPixels=this.renderer._roundPixels|e._roundPixels,e._gpuData[this.renderer.uid].batchableMesh=t,t}destroy(){this.localUniforms=null,this.localUniformsBindGroup=null,this._adaptor.destroy(),this._adaptor=null,this.renderer=null}}xE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"mesh"};class hB{execute(e,t){const a=e.state,r=e.renderer,u=t.shader||e.defaultShader;u.resources.uTexture=t.texture._source,u.resources.uniforms=e.localUniforms;const h=r.gl,d=e.getBuffers(t);r.shader.bind(u),r.state.set(a),r.geometry.bind(d.geometry,u.glProgram);const y=d.geometry.indexBuffer.data.BYTES_PER_ELEMENT===2?h.UNSIGNED_SHORT:h.UNSIGNED_INT;h.drawElements(h.TRIANGLES,t.particleChildren.length*6,y,0)}}class fB{execute(e,t){const a=e.renderer,r=t.shader||e.defaultShader;r.groups[0]=a.renderPipes.uniformBatch.getUniformBindGroup(e.localUniforms,!0),r.groups[1]=a.texture.getTextureBindGroup(t.texture);const u=e.state,h=e.getBuffers(t);a.encoder.draw({geometry:h.geometry,shader:t.shader||e.defaultShader,state:u,size:t.particleChildren.length*6})}}function SE(n,e=null){const t=n*6;if(t>65535?e||(e=new Uint32Array(t)):e||(e=new Uint16Array(t)),e.length!==t)throw new Error(`Out buffer length is incorrect, got ${e.length} and expected ${t}`);for(let a=0,r=0;a<t;a+=6,r+=4)e[a+0]=r+0,e[a+1]=r+1,e[a+2]=r+2,e[a+3]=r+0,e[a+4]=r+2,e[a+5]=r+3;return e}function dB(n){return{dynamicUpdate:TE(n,!0),staticUpdate:TE(n,!1)}}function TE(n,e){const t=[];t.push(`
|
|
859
|
+
|
|
860
|
+
var index = 0;
|
|
861
|
+
|
|
862
|
+
for (let i = 0; i < ps.length; ++i)
|
|
863
|
+
{
|
|
864
|
+
const p = ps[i];
|
|
865
|
+
|
|
866
|
+
`);let a=0;for(const u in n){const h=n[u];if(e!==h.dynamic)continue;t.push(`offset = index + ${a}`),t.push(h.code);const d=ql(h.format);a+=d.stride/4}t.push(`
|
|
867
|
+
index += stride * 4;
|
|
868
|
+
}
|
|
869
|
+
`),t.unshift(`
|
|
870
|
+
var stride = ${a};
|
|
871
|
+
`);const r=t.join(`
|
|
872
|
+
`);return new Function("ps","f32v","u32v",r)}class pB{constructor(e){this._size=0,this._generateParticleUpdateCache={};const t=this._size=e.size??1e3,a=e.properties;let r=0,u=0;for(const b in a){const S=a[b],T=ql(S.format);S.dynamic?u+=T.stride:r+=T.stride}this._dynamicStride=u/4,this._staticStride=r/4,this.staticAttributeBuffer=new Ac(t*4*r),this.dynamicAttributeBuffer=new Ac(t*4*u),this.indexBuffer=SE(t);const h=new od;let d=0,m=0;this._staticBuffer=new Ea({data:new Float32Array(1),label:"static-particle-buffer",shrinkToFit:!1,usage:xt.VERTEX|xt.COPY_DST}),this._dynamicBuffer=new Ea({data:new Float32Array(1),label:"dynamic-particle-buffer",shrinkToFit:!1,usage:xt.VERTEX|xt.COPY_DST});for(const b in a){const S=a[b],T=ql(S.format);S.dynamic?(h.addAttribute(S.attributeName,{buffer:this._dynamicBuffer,stride:this._dynamicStride*4,offset:d*4,format:S.format}),d+=T.size):(h.addAttribute(S.attributeName,{buffer:this._staticBuffer,stride:this._staticStride*4,offset:m*4,format:S.format}),m+=T.size)}h.addIndex(this.indexBuffer);const y=this.getParticleUpdate(a);this._dynamicUpload=y.dynamicUpdate,this._staticUpload=y.staticUpdate,this.geometry=h}getParticleUpdate(e){const t=mB(e);return this._generateParticleUpdateCache[t]?this._generateParticleUpdateCache[t]:(this._generateParticleUpdateCache[t]=this.generateParticleUpdate(e),this._generateParticleUpdateCache[t])}generateParticleUpdate(e){return dB(e)}update(e,t){e.length>this._size&&(t=!0,this._size=Math.max(e.length,this._size*1.5|0),this.staticAttributeBuffer=new Ac(this._size*this._staticStride*4*4),this.dynamicAttributeBuffer=new Ac(this._size*this._dynamicStride*4*4),this.indexBuffer=SE(this._size),this.geometry.indexBuffer.setDataWithSize(this.indexBuffer,this.indexBuffer.byteLength,!0));const a=this.dynamicAttributeBuffer;if(this._dynamicUpload(e,a.float32View,a.uint32View),this._dynamicBuffer.setDataWithSize(this.dynamicAttributeBuffer.float32View,e.length*this._dynamicStride*4,!0),t){const r=this.staticAttributeBuffer;this._staticUpload(e,r.float32View,r.uint32View),this._staticBuffer.setDataWithSize(r.float32View,e.length*this._staticStride*4,!0)}}destroy(){this._staticBuffer.destroy(),this._dynamicBuffer.destroy(),this.geometry.destroy()}}function mB(n){const e=[];for(const t in n){const a=n[t];e.push(t,a.code,a.dynamic?"d":"s")}return e.join("_")}var yB=`varying vec2 vUV;
|
|
873
|
+
varying vec4 vColor;
|
|
874
|
+
|
|
875
|
+
uniform sampler2D uTexture;
|
|
876
|
+
|
|
877
|
+
void main(void){
|
|
878
|
+
vec4 color = texture2D(uTexture, vUV) * vColor;
|
|
879
|
+
gl_FragColor = color;
|
|
880
|
+
}`,gB=`attribute vec2 aVertex;
|
|
881
|
+
attribute vec2 aUV;
|
|
882
|
+
attribute vec4 aColor;
|
|
883
|
+
|
|
884
|
+
attribute vec2 aPosition;
|
|
885
|
+
attribute float aRotation;
|
|
886
|
+
|
|
887
|
+
uniform mat3 uTranslationMatrix;
|
|
888
|
+
uniform float uRound;
|
|
889
|
+
uniform vec2 uResolution;
|
|
890
|
+
uniform vec4 uColor;
|
|
891
|
+
|
|
892
|
+
varying vec2 vUV;
|
|
893
|
+
varying vec4 vColor;
|
|
894
|
+
|
|
895
|
+
vec2 roundPixels(vec2 position, vec2 targetSize)
|
|
896
|
+
{
|
|
897
|
+
return (floor(((position * 0.5 + 0.5) * targetSize) + 0.5) / targetSize) * 2.0 - 1.0;
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
void main(void){
|
|
901
|
+
float cosRotation = cos(aRotation);
|
|
902
|
+
float sinRotation = sin(aRotation);
|
|
903
|
+
float x = aVertex.x * cosRotation - aVertex.y * sinRotation;
|
|
904
|
+
float y = aVertex.x * sinRotation + aVertex.y * cosRotation;
|
|
905
|
+
|
|
906
|
+
vec2 v = vec2(x, y);
|
|
907
|
+
v = v + aPosition;
|
|
908
|
+
|
|
909
|
+
gl_Position = vec4((uTranslationMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
|
|
910
|
+
|
|
911
|
+
if(uRound == 1.0)
|
|
912
|
+
{
|
|
913
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
vUV = aUV;
|
|
917
|
+
vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uColor;
|
|
918
|
+
}
|
|
919
|
+
`,EE=`
|
|
920
|
+
struct ParticleUniforms {
|
|
921
|
+
uProjectionMatrix:mat3x3<f32>,
|
|
922
|
+
uColor:vec4<f32>,
|
|
923
|
+
uResolution:vec2<f32>,
|
|
924
|
+
uRoundPixels:f32,
|
|
925
|
+
};
|
|
926
|
+
|
|
927
|
+
@group(0) @binding(0) var<uniform> uniforms: ParticleUniforms;
|
|
928
|
+
|
|
929
|
+
@group(1) @binding(0) var uTexture: texture_2d<f32>;
|
|
930
|
+
@group(1) @binding(1) var uSampler : sampler;
|
|
931
|
+
|
|
932
|
+
struct VSOutput {
|
|
933
|
+
@builtin(position) position: vec4<f32>,
|
|
934
|
+
@location(0) uv : vec2<f32>,
|
|
935
|
+
@location(1) color : vec4<f32>,
|
|
936
|
+
};
|
|
937
|
+
@vertex
|
|
938
|
+
fn mainVertex(
|
|
939
|
+
@location(0) aVertex: vec2<f32>,
|
|
940
|
+
@location(1) aPosition: vec2<f32>,
|
|
941
|
+
@location(2) aUV: vec2<f32>,
|
|
942
|
+
@location(3) aColor: vec4<f32>,
|
|
943
|
+
@location(4) aRotation: f32,
|
|
944
|
+
) -> VSOutput {
|
|
945
|
+
|
|
946
|
+
let v = vec2(
|
|
947
|
+
aVertex.x * cos(aRotation) - aVertex.y * sin(aRotation),
|
|
948
|
+
aVertex.x * sin(aRotation) + aVertex.y * cos(aRotation)
|
|
949
|
+
) + aPosition;
|
|
950
|
+
|
|
951
|
+
let position = vec4((uniforms.uProjectionMatrix * vec3(v, 1.0)).xy, 0.0, 1.0);
|
|
952
|
+
|
|
953
|
+
let vColor = vec4(aColor.rgb * aColor.a, aColor.a) * uniforms.uColor;
|
|
954
|
+
|
|
955
|
+
return VSOutput(
|
|
956
|
+
position,
|
|
957
|
+
aUV,
|
|
958
|
+
vColor,
|
|
959
|
+
);
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
@fragment
|
|
963
|
+
fn mainFragment(
|
|
964
|
+
@location(0) uv: vec2<f32>,
|
|
965
|
+
@location(1) color: vec4<f32>,
|
|
966
|
+
@builtin(position) position: vec4<f32>,
|
|
967
|
+
) -> @location(0) vec4<f32> {
|
|
968
|
+
|
|
969
|
+
var sample = textureSample(uTexture, uSampler, uv) * color;
|
|
970
|
+
|
|
971
|
+
return sample;
|
|
972
|
+
}`;class _B extends ka{constructor(){const e=Cc.from({vertex:gB,fragment:yB}),t=su.from({fragment:{source:EE,entryPoint:"mainFragment"},vertex:{source:EE,entryPoint:"mainVertex"}});super({glProgram:e,gpuProgram:t,resources:{uTexture:Ge.WHITE.source,uSampler:new Xl({}),uniforms:{uTranslationMatrix:{value:new Pe,type:"mat3x3<f32>"},uColor:{value:new Ft(16777215),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}}})}}class CE{constructor(e,t){this.state=Us.for2d(),this.localUniforms=new Yi({uTranslationMatrix:{value:new Pe,type:"mat3x3<f32>"},uColor:{value:new Float32Array(4),type:"vec4<f32>"},uRound:{value:1,type:"f32"},uResolution:{value:[0,0],type:"vec2<f32>"}}),this.renderer=e,this.adaptor=t,this.defaultShader=new _B,this.state=Us.for2d()}validateRenderable(e){return!1}addRenderable(e,t){this.renderer.renderPipes.batch.break(t),t.add(e)}getBuffers(e){return e._gpuData[this.renderer.uid]||this._initBuffer(e)}_initBuffer(e){return e._gpuData[this.renderer.uid]=new pB({size:e.particleChildren.length,properties:e._properties}),e._gpuData[this.renderer.uid]}updateRenderable(e){}execute(e){const t=e.particleChildren;if(t.length===0)return;const a=this.renderer,r=this.getBuffers(e);e.texture||(e.texture=t[0].texture);const u=this.state;r.update(t,e._childrenDirty),e._childrenDirty=!1,u.blendMode=rd(e.blendMode,e.texture._source);const h=this.localUniforms.uniforms,d=h.uTranslationMatrix;e.worldTransform.copyTo(d),d.prepend(a.globalUniforms.globalUniformData.projectionMatrix),h.uResolution=a.globalUniforms.globalUniformData.resolution,h.uRound=a._roundPixels|e._roundPixels,bd(e.groupColorAlpha,h.uColor,0),this.adaptor.execute(this,e)}destroy(){this.defaultShader&&(this.defaultShader.destroy(),this.defaultShader=null)}}class RE extends CE{constructor(e){super(e,new hB)}}RE.extension={type:[Q.WebGLPipes],name:"particle"};class AE extends CE{constructor(e){super(e,new fB)}}AE.extension={type:[Q.WebGPUPipes],name:"particle"};const ME=class tx{constructor(e){if(e instanceof Ge)this.texture=e,B_(this,tx.defaultOptions,{});else{const t={...tx.defaultOptions,...e};B_(this,t,{})}}get alpha(){return this._alpha}set alpha(e){this._alpha=Math.min(Math.max(e,0),1),this._updateColor()}get tint(){return If(this._tint)}set tint(e){this._tint=Ft.shared.setValue(e??16777215).toBgrNumber(),this._updateColor()}_updateColor(){this.color=this._tint+((this._alpha*255|0)<<24)}};ME.defaultOptions={anchorX:0,anchorY:0,x:0,y:0,scaleX:1,scaleY:1,rotation:0,tint:16777215,alpha:1};let DE=ME;const UE={vertex:{attributeName:"aVertex",format:"float32x2",code:`
|
|
973
|
+
const texture = p.texture;
|
|
974
|
+
const sx = p.scaleX;
|
|
975
|
+
const sy = p.scaleY;
|
|
976
|
+
const ax = p.anchorX;
|
|
977
|
+
const ay = p.anchorY;
|
|
978
|
+
const trim = texture.trim;
|
|
979
|
+
const orig = texture.orig;
|
|
980
|
+
|
|
981
|
+
if (trim)
|
|
982
|
+
{
|
|
983
|
+
w1 = trim.x - (ax * orig.width);
|
|
984
|
+
w0 = w1 + trim.width;
|
|
985
|
+
|
|
986
|
+
h1 = trim.y - (ay * orig.height);
|
|
987
|
+
h0 = h1 + trim.height;
|
|
988
|
+
}
|
|
989
|
+
else
|
|
990
|
+
{
|
|
991
|
+
w1 = -ax * (orig.width);
|
|
992
|
+
w0 = w1 + orig.width;
|
|
993
|
+
|
|
994
|
+
h1 = -ay * (orig.height);
|
|
995
|
+
h0 = h1 + orig.height;
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
f32v[offset] = w1 * sx;
|
|
999
|
+
f32v[offset + 1] = h1 * sy;
|
|
1000
|
+
|
|
1001
|
+
f32v[offset + stride] = w0 * sx;
|
|
1002
|
+
f32v[offset + stride + 1] = h1 * sy;
|
|
1003
|
+
|
|
1004
|
+
f32v[offset + (stride * 2)] = w0 * sx;
|
|
1005
|
+
f32v[offset + (stride * 2) + 1] = h0 * sy;
|
|
1006
|
+
|
|
1007
|
+
f32v[offset + (stride * 3)] = w1 * sx;
|
|
1008
|
+
f32v[offset + (stride * 3) + 1] = h0 * sy;
|
|
1009
|
+
`,dynamic:!1},position:{attributeName:"aPosition",format:"float32x2",code:`
|
|
1010
|
+
var x = p.x;
|
|
1011
|
+
var y = p.y;
|
|
1012
|
+
|
|
1013
|
+
f32v[offset] = x;
|
|
1014
|
+
f32v[offset + 1] = y;
|
|
1015
|
+
|
|
1016
|
+
f32v[offset + stride] = x;
|
|
1017
|
+
f32v[offset + stride + 1] = y;
|
|
1018
|
+
|
|
1019
|
+
f32v[offset + (stride * 2)] = x;
|
|
1020
|
+
f32v[offset + (stride * 2) + 1] = y;
|
|
1021
|
+
|
|
1022
|
+
f32v[offset + (stride * 3)] = x;
|
|
1023
|
+
f32v[offset + (stride * 3) + 1] = y;
|
|
1024
|
+
`,dynamic:!0},rotation:{attributeName:"aRotation",format:"float32",code:`
|
|
1025
|
+
var rotation = p.rotation;
|
|
1026
|
+
|
|
1027
|
+
f32v[offset] = rotation;
|
|
1028
|
+
f32v[offset + stride] = rotation;
|
|
1029
|
+
f32v[offset + (stride * 2)] = rotation;
|
|
1030
|
+
f32v[offset + (stride * 3)] = rotation;
|
|
1031
|
+
`,dynamic:!1},uvs:{attributeName:"aUV",format:"float32x2",code:`
|
|
1032
|
+
var uvs = p.texture.uvs;
|
|
1033
|
+
|
|
1034
|
+
f32v[offset] = uvs.x0;
|
|
1035
|
+
f32v[offset + 1] = uvs.y0;
|
|
1036
|
+
|
|
1037
|
+
f32v[offset + stride] = uvs.x1;
|
|
1038
|
+
f32v[offset + stride + 1] = uvs.y1;
|
|
1039
|
+
|
|
1040
|
+
f32v[offset + (stride * 2)] = uvs.x2;
|
|
1041
|
+
f32v[offset + (stride * 2) + 1] = uvs.y2;
|
|
1042
|
+
|
|
1043
|
+
f32v[offset + (stride * 3)] = uvs.x3;
|
|
1044
|
+
f32v[offset + (stride * 3) + 1] = uvs.y3;
|
|
1045
|
+
`,dynamic:!1},color:{attributeName:"aColor",format:"unorm8x4",code:`
|
|
1046
|
+
const c = p.color;
|
|
1047
|
+
|
|
1048
|
+
u32v[offset] = c;
|
|
1049
|
+
u32v[offset + stride] = c;
|
|
1050
|
+
u32v[offset + (stride * 2)] = c;
|
|
1051
|
+
u32v[offset + (stride * 3)] = c;
|
|
1052
|
+
`,dynamic:!1}},vB=new ci(0,0,0,0),BE=class nx extends w_{constructor(e={}){e={...nx.defaultOptions,...e,dynamicProperties:{...nx.defaultOptions.dynamicProperties,...e==null?void 0:e.dynamicProperties}};const{dynamicProperties:t,shader:a,roundPixels:r,texture:u,particles:h,...d}=e;super({label:"ParticleContainer",...d}),this.renderPipeId="particle",this.batched=!1,this._childrenDirty=!1,this.texture=u||null,this.shader=a,this._properties={};for(const m in UE){const y=UE[m],b=t[m];this._properties[m]={...y,dynamic:b}}this.allowChildren=!0,this.roundPixels=r??!1,this.particleChildren=h??[]}addParticle(...e){for(let t=0;t<e.length;t++)this.particleChildren.push(e[t]);return this.onViewUpdate(),e[0]}removeParticle(...e){let t=!1;for(let a=0;a<e.length;a++){const r=this.particleChildren.indexOf(e[a]);r>-1&&(this.particleChildren.splice(r,1),t=!0)}return t&&this.onViewUpdate(),e[0]}update(){this._childrenDirty=!0}onViewUpdate(){this._childrenDirty=!0,super.onViewUpdate()}get bounds(){return vB}updateBounds(){}destroy(e=!1){var a,r;if(super.destroy(e),typeof e=="boolean"?e:e==null?void 0:e.texture){const u=typeof e=="boolean"?e:e==null?void 0:e.textureSource,h=this.texture??((a=this.particleChildren[0])==null?void 0:a.texture);h&&h.destroy(u)}this.texture=null,(r=this.shader)==null||r.destroy()}removeParticles(e,t){e??(e=0),t??(t=this.particleChildren.length);const a=this.particleChildren.splice(e,t-e);return this.onViewUpdate(),a}removeParticleAt(e){const t=this.particleChildren.splice(e,1);return this.onViewUpdate(),t[0]}addParticleAt(e,t){return this.particleChildren.splice(t,0,e),this.onViewUpdate(),e}addChild(...e){throw new Error("ParticleContainer.addChild() is not available. Please use ParticleContainer.addParticle()")}removeChild(...e){throw new Error("ParticleContainer.removeChild() is not available. Please use ParticleContainer.removeParticle()")}removeChildren(e,t){throw new Error("ParticleContainer.removeChildren() is not available. Please use ParticleContainer.removeParticles()")}removeChildAt(e){throw new Error("ParticleContainer.removeChildAt() is not available. Please use ParticleContainer.removeParticleAt()")}getChildAt(e){throw new Error("ParticleContainer.getChildAt() is not available. Please use ParticleContainer.getParticleAt()")}setChildIndex(e,t){throw new Error("ParticleContainer.setChildIndex() is not available. Please use ParticleContainer.setParticleIndex()")}getChildIndex(e){throw new Error("ParticleContainer.getChildIndex() is not available. Please use ParticleContainer.getParticleIndex()")}addChildAt(e,t){throw new Error("ParticleContainer.addChildAt() is not available. Please use ParticleContainer.addParticleAt()")}swapChildren(e,t){throw new Error("ParticleContainer.swapChildren() is not available. Please use ParticleContainer.swapParticles()")}reparentChild(...e){throw new Error("ParticleContainer.reparentChild() is not available with the particle container")}reparentChildAt(e,t){throw new Error("ParticleContainer.reparentChildAt() is not available with the particle container")}};BE.defaultOptions={dynamicProperties:{vertex:!1,position:!0,rotation:!1,uvs:!1,color:!1},roundPixels:!1};let bB=BE;const OE=class lA extends cB{constructor(e={}){e={...lA.defaultOptions,...e},super({width:e.width,height:e.height,verticesX:4,verticesY:4}),this.update(e)}update(e){var t,a;this.width=e.width??this.width,this.height=e.height??this.height,this._originalWidth=e.originalWidth??this._originalWidth,this._originalHeight=e.originalHeight??this._originalHeight,this._leftWidth=e.leftWidth??this._leftWidth,this._rightWidth=e.rightWidth??this._rightWidth,this._topHeight=e.topHeight??this._topHeight,this._bottomHeight=e.bottomHeight??this._bottomHeight,this._anchorX=(t=e.anchor)==null?void 0:t.x,this._anchorY=(a=e.anchor)==null?void 0:a.y,this.updateUvs(),this.updatePositions()}updatePositions(){const e=this.positions,{width:t,height:a,_leftWidth:r,_rightWidth:u,_topHeight:h,_bottomHeight:d,_anchorX:m,_anchorY:y}=this,b=r+u,S=t>b?1:t/b,T=h+d,E=a>T?1:a/T,A=Math.min(S,E),B=m*t,M=y*a;e[0]=e[8]=e[16]=e[24]=-B,e[2]=e[10]=e[18]=e[26]=r*A-B,e[4]=e[12]=e[20]=e[28]=t-u*A-B,e[6]=e[14]=e[22]=e[30]=t-B,e[1]=e[3]=e[5]=e[7]=-M,e[9]=e[11]=e[13]=e[15]=h*A-M,e[17]=e[19]=e[21]=e[23]=a-d*A-M,e[25]=e[27]=e[29]=e[31]=a-M,this.getBuffer("aPosition").update()}updateUvs(){const e=this.uvs;e[0]=e[8]=e[16]=e[24]=0,e[1]=e[3]=e[5]=e[7]=0,e[6]=e[14]=e[22]=e[30]=1,e[25]=e[27]=e[29]=e[31]=1;const t=1/this._originalWidth,a=1/this._originalHeight;e[2]=e[10]=e[18]=e[26]=t*this._leftWidth,e[9]=e[11]=e[13]=e[15]=a*this._topHeight,e[4]=e[12]=e[20]=e[28]=1-t*this._rightWidth,e[17]=e[19]=e[21]=e[23]=1-a*this._bottomHeight,this.getBuffer("aUV").update()}};OE.defaultOptions={width:100,height:100,leftWidth:10,topHeight:10,rightWidth:10,bottomHeight:10,originalWidth:100,originalHeight:100};let xB=OE;class SB extends t0{constructor(){super(),this.geometry=new xB}destroy(){this.geometry.destroy()}}class NE{constructor(e){this._renderer=e}addRenderable(e,t){const a=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,a),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuSprite(e);e.didViewUpdate&&this._updateBatchableSprite(e,t),t._batcher.updateElement(t)}validateRenderable(e){const t=this._getGpuSprite(e);return!t._batcher.checkAndUpdateTexture(t,e._texture)}_updateBatchableSprite(e,t){t.geometry.update(e),t.setTexture(e._texture)}_getGpuSprite(e){return e._gpuData[this._renderer.uid]||this._initGPUSprite(e)}_initGPUSprite(e){const t=e._gpuData[this._renderer.uid]=new SB,a=t;return a.renderable=e,a.transform=e.groupTransform,a.texture=e._texture,a.roundPixels=this._renderer._roundPixels|e._roundPixels,e.didViewUpdate||this._updateBatchableSprite(e,a),t}destroy(){this._renderer=null}}NE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"nineSliceSprite"};const TB={name:"tiling-bit",vertex:{header:`
|
|
1053
|
+
struct TilingUniforms {
|
|
1054
|
+
uMapCoord:mat3x3<f32>,
|
|
1055
|
+
uClampFrame:vec4<f32>,
|
|
1056
|
+
uClampOffset:vec2<f32>,
|
|
1057
|
+
uTextureTransform:mat3x3<f32>,
|
|
1058
|
+
uSizeAnchor:vec4<f32>
|
|
1059
|
+
};
|
|
1060
|
+
|
|
1061
|
+
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
|
1062
|
+
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
|
1063
|
+
@group(2) @binding(2) var uSampler: sampler;
|
|
1064
|
+
`,main:`
|
|
1065
|
+
uv = (tilingUniforms.uTextureTransform * vec3(uv, 1.0)).xy;
|
|
1066
|
+
|
|
1067
|
+
position = (position - tilingUniforms.uSizeAnchor.zw) * tilingUniforms.uSizeAnchor.xy;
|
|
1068
|
+
`},fragment:{header:`
|
|
1069
|
+
struct TilingUniforms {
|
|
1070
|
+
uMapCoord:mat3x3<f32>,
|
|
1071
|
+
uClampFrame:vec4<f32>,
|
|
1072
|
+
uClampOffset:vec2<f32>,
|
|
1073
|
+
uTextureTransform:mat3x3<f32>,
|
|
1074
|
+
uSizeAnchor:vec4<f32>
|
|
1075
|
+
};
|
|
1076
|
+
|
|
1077
|
+
@group(2) @binding(0) var<uniform> tilingUniforms: TilingUniforms;
|
|
1078
|
+
@group(2) @binding(1) var uTexture: texture_2d<f32>;
|
|
1079
|
+
@group(2) @binding(2) var uSampler: sampler;
|
|
1080
|
+
`,main:`
|
|
1081
|
+
|
|
1082
|
+
var coord = vUV + ceil(tilingUniforms.uClampOffset - vUV);
|
|
1083
|
+
coord = (tilingUniforms.uMapCoord * vec3(coord, 1.0)).xy;
|
|
1084
|
+
var unclamped = coord;
|
|
1085
|
+
coord = clamp(coord, tilingUniforms.uClampFrame.xy, tilingUniforms.uClampFrame.zw);
|
|
1086
|
+
|
|
1087
|
+
var bias = 0.;
|
|
1088
|
+
|
|
1089
|
+
if(unclamped.x == coord.x && unclamped.y == coord.y)
|
|
1090
|
+
{
|
|
1091
|
+
bias = -32.;
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
outColor = textureSampleBias(uTexture, uSampler, coord, bias);
|
|
1095
|
+
`}},EB={name:"tiling-bit",vertex:{header:`
|
|
1096
|
+
uniform mat3 uTextureTransform;
|
|
1097
|
+
uniform vec4 uSizeAnchor;
|
|
1098
|
+
|
|
1099
|
+
`,main:`
|
|
1100
|
+
uv = (uTextureTransform * vec3(aUV, 1.0)).xy;
|
|
1101
|
+
|
|
1102
|
+
position = (position - uSizeAnchor.zw) * uSizeAnchor.xy;
|
|
1103
|
+
`},fragment:{header:`
|
|
1104
|
+
uniform sampler2D uTexture;
|
|
1105
|
+
uniform mat3 uMapCoord;
|
|
1106
|
+
uniform vec4 uClampFrame;
|
|
1107
|
+
uniform vec2 uClampOffset;
|
|
1108
|
+
`,main:`
|
|
1109
|
+
|
|
1110
|
+
vec2 coord = vUV + ceil(uClampOffset - vUV);
|
|
1111
|
+
coord = (uMapCoord * vec3(coord, 1.0)).xy;
|
|
1112
|
+
vec2 unclamped = coord;
|
|
1113
|
+
coord = clamp(coord, uClampFrame.xy, uClampFrame.zw);
|
|
1114
|
+
|
|
1115
|
+
outColor = texture(uTexture, coord, unclamped == coord ? 0.0 : -32.0);// lod-bias very negative to force lod 0
|
|
1116
|
+
|
|
1117
|
+
`}};let n0,i0;class CB extends ka{constructor(){n0??(n0=ud({name:"tiling-sprite-shader",bits:[gd,TB,hd]})),i0??(i0=cd({name:"tiling-sprite-shader",bits:[Pv,EB,fd]}));const e=new Yi({uMapCoord:{value:new Pe,type:"mat3x3<f32>"},uClampFrame:{value:new Float32Array([0,0,1,1]),type:"vec4<f32>"},uClampOffset:{value:new Float32Array([0,0]),type:"vec2<f32>"},uTextureTransform:{value:new Pe,type:"mat3x3<f32>"},uSizeAnchor:{value:new Float32Array([100,100,.5,.5]),type:"vec4<f32>"}});super({glProgram:i0,gpuProgram:n0,resources:{localUniforms:new Yi({uTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uRound:{value:0,type:"f32"}}),tilingUniforms:e,uTexture:Ge.EMPTY.source,uSampler:Ge.EMPTY.source.style}})}updateUniforms(e,t,a,r,u,h){const d=this.resources.tilingUniforms,m=h.width,y=h.height,b=h.textureMatrix,S=d.uniforms.uTextureTransform;S.set(a.a*m/e,a.b*m/t,a.c*y/e,a.d*y/t,a.tx/e,a.ty/t),S.invert(),d.uniforms.uMapCoord=b.mapCoord,d.uniforms.uClampFrame=b.uClampFrame,d.uniforms.uClampOffset=b.uClampOffset,d.uniforms.uTextureTransform=S,d.uniforms.uSizeAnchor[0]=e,d.uniforms.uSizeAnchor[1]=t,d.uniforms.uSizeAnchor[2]=r,d.uniforms.uSizeAnchor[3]=u,h&&(this.resources.uTexture=h.source,this.resources.uSampler=h.source.style)}}class RB extends Nv{constructor(){super({positions:new Float32Array([0,0,1,0,1,1,0,1]),uvs:new Float32Array([0,0,1,0,1,1,0,1]),indices:new Uint32Array([0,1,2,0,2,3])})}}function AB(n,e){const t=n.anchor.x,a=n.anchor.y;e[0]=-t*n.width,e[1]=-a*n.height,e[2]=(1-t)*n.width,e[3]=-a*n.height,e[4]=(1-t)*n.width,e[5]=(1-a)*n.height,e[6]=-t*n.width,e[7]=(1-a)*n.height}function MB(n,e,t,a){let r=0;const u=n.length/e,h=a.a,d=a.b,m=a.c,y=a.d,b=a.tx,S=a.ty;for(t*=e;r<u;){const T=n[t],E=n[t+1];n[t]=h*T+m*E+b,n[t+1]=d*T+y*E+S,t+=e,r++}}function DB(n,e){const t=n.texture,a=t.frame.width,r=t.frame.height;let u=0,h=0;n.applyAnchorToTexture&&(u=n.anchor.x,h=n.anchor.y),e[0]=e[6]=-u,e[2]=e[4]=1-u,e[1]=e[3]=-h,e[5]=e[7]=1-h;const d=Pe.shared;d.copyFrom(n._tileTransform.matrix),d.tx/=n.width,d.ty/=n.height,d.invert(),d.scale(n.width/a,n.height/r),MB(e,2,0,d)}const Ey=new RB;class UB{constructor(){this.canBatch=!0,this.geometry=new Nv({indices:Ey.indices.slice(),positions:Ey.positions.slice(),uvs:Ey.uvs.slice()})}destroy(){var e;this.geometry.destroy(),(e=this.shader)==null||e.destroy()}}class GE{constructor(e){this._state=Us.default2d,this._renderer=e}validateRenderable(e){const t=this._getTilingSpriteData(e),a=t.canBatch;this._updateCanBatch(e);const r=t.canBatch;if(r&&r===a){const{batchableMesh:u}=t;return!u._batcher.checkAndUpdateTexture(u,e.texture)}return a!==r}addRenderable(e,t){const a=this._renderer.renderPipes.batch;this._updateCanBatch(e);const r=this._getTilingSpriteData(e),{geometry:u,canBatch:h}=r;if(h){r.batchableMesh||(r.batchableMesh=new t0);const d=r.batchableMesh;e.didViewUpdate&&(this._updateBatchableMesh(e),d.geometry=u,d.renderable=e,d.transform=e.groupTransform,d.setTexture(e._texture)),d.roundPixels=this._renderer._roundPixels|e._roundPixels,a.addToBatch(d,t)}else a.break(t),r.shader||(r.shader=new CB),this.updateRenderable(e),t.add(e)}execute(e){const{shader:t}=this._getTilingSpriteData(e);t.groups[0]=this._renderer.globalUniforms.bindGroup;const a=t.resources.localUniforms.uniforms;a.uTransformMatrix=e.groupTransform,a.uRound=this._renderer._roundPixels|e._roundPixels,bd(e.groupColorAlpha,a.uColor,0),this._state.blendMode=rd(e.groupBlendMode,e.texture._source),this._renderer.encoder.draw({geometry:Ey,shader:t,state:this._state})}updateRenderable(e){const t=this._getTilingSpriteData(e),{canBatch:a}=t;if(a){const{batchableMesh:r}=t;e.didViewUpdate&&this._updateBatchableMesh(e),r._batcher.updateElement(r)}else if(e.didViewUpdate){const{shader:r}=t;r.updateUniforms(e.width,e.height,e._tileTransform.matrix,e.anchor.x,e.anchor.y,e.texture)}}_getTilingSpriteData(e){return e._gpuData[this._renderer.uid]||this._initTilingSpriteData(e)}_initTilingSpriteData(e){const t=new UB;return t.renderable=e,e._gpuData[this._renderer.uid]=t,t}_updateBatchableMesh(e){const t=this._getTilingSpriteData(e),{geometry:a}=t,r=e.texture.source.style;r.addressMode!=="repeat"&&(r.addressMode="repeat",r.update()),DB(e,a.uvs),AB(e,a.positions)}destroy(){this._renderer=null}_updateCanBatch(e){const t=this._getTilingSpriteData(e),a=e.texture;let r=!0;return this._renderer.type===Ds.WEBGL&&(r=this._renderer.context.supports.nonPowOf2wrapping),t.canBatch=a.textureMatrix.isSimple&&(r||a.source.isPowerOfTwo),t.canBatch}}GE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"tilingSprite"};const BB={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
1118
|
+
struct LocalUniforms {
|
|
1119
|
+
uColor:vec4<f32>,
|
|
1120
|
+
uTransformMatrix:mat3x3<f32>,
|
|
1121
|
+
uDistance: f32,
|
|
1122
|
+
uRound:f32,
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
1126
|
+
`,main:`
|
|
1127
|
+
vColor *= localUniforms.uColor;
|
|
1128
|
+
modelMatrix *= localUniforms.uTransformMatrix;
|
|
1129
|
+
`,end:`
|
|
1130
|
+
if(localUniforms.uRound == 1)
|
|
1131
|
+
{
|
|
1132
|
+
vPosition = vec4(roundPixels(vPosition.xy, globalUniforms.uResolution), vPosition.zw);
|
|
1133
|
+
}
|
|
1134
|
+
`},fragment:{header:`
|
|
1135
|
+
struct LocalUniforms {
|
|
1136
|
+
uColor:vec4<f32>,
|
|
1137
|
+
uTransformMatrix:mat3x3<f32>,
|
|
1138
|
+
uDistance: f32
|
|
1139
|
+
}
|
|
1140
|
+
|
|
1141
|
+
@group(2) @binding(0) var<uniform> localUniforms : LocalUniforms;
|
|
1142
|
+
`,main:`
|
|
1143
|
+
outColor = vec4<f32>(calculateMSDFAlpha(outColor, localUniforms.uColor, localUniforms.uDistance));
|
|
1144
|
+
`}},OB={name:"local-uniform-msdf-bit",vertex:{header:`
|
|
1145
|
+
uniform mat3 uTransformMatrix;
|
|
1146
|
+
uniform vec4 uColor;
|
|
1147
|
+
uniform float uRound;
|
|
1148
|
+
`,main:`
|
|
1149
|
+
vColor *= uColor;
|
|
1150
|
+
modelMatrix *= uTransformMatrix;
|
|
1151
|
+
`,end:`
|
|
1152
|
+
if(uRound == 1.)
|
|
1153
|
+
{
|
|
1154
|
+
gl_Position.xy = roundPixels(gl_Position.xy, uResolution);
|
|
1155
|
+
}
|
|
1156
|
+
`},fragment:{header:`
|
|
1157
|
+
uniform float uDistance;
|
|
1158
|
+
`,main:`
|
|
1159
|
+
outColor = vec4(calculateMSDFAlpha(outColor, vColor, uDistance));
|
|
1160
|
+
`}},NB={name:"msdf-bit",fragment:{header:`
|
|
1161
|
+
fn calculateMSDFAlpha(msdfColor:vec4<f32>, shapeColor:vec4<f32>, distance:f32) -> f32 {
|
|
1162
|
+
|
|
1163
|
+
// MSDF
|
|
1164
|
+
var median = msdfColor.r + msdfColor.g + msdfColor.b -
|
|
1165
|
+
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
|
1166
|
+
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
|
1167
|
+
|
|
1168
|
+
// SDF
|
|
1169
|
+
median = min(median, msdfColor.a);
|
|
1170
|
+
|
|
1171
|
+
var screenPxDistance = distance * (median - 0.5);
|
|
1172
|
+
var alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
|
1173
|
+
if (median < 0.01) {
|
|
1174
|
+
alpha = 0.0;
|
|
1175
|
+
} else if (median > 0.99) {
|
|
1176
|
+
alpha = 1.0;
|
|
1177
|
+
}
|
|
1178
|
+
|
|
1179
|
+
// Gamma correction for coverage-like alpha
|
|
1180
|
+
var luma: f32 = dot(shapeColor.rgb, vec3<f32>(0.299, 0.587, 0.114));
|
|
1181
|
+
var gamma: f32 = mix(1.0, 1.0 / 2.2, luma);
|
|
1182
|
+
var coverage: f32 = pow(shapeColor.a * alpha, gamma);
|
|
1183
|
+
|
|
1184
|
+
return coverage;
|
|
1185
|
+
|
|
1186
|
+
}
|
|
1187
|
+
`}},GB={name:"msdf-bit",fragment:{header:`
|
|
1188
|
+
float calculateMSDFAlpha(vec4 msdfColor, vec4 shapeColor, float distance) {
|
|
1189
|
+
|
|
1190
|
+
// MSDF
|
|
1191
|
+
float median = msdfColor.r + msdfColor.g + msdfColor.b -
|
|
1192
|
+
min(msdfColor.r, min(msdfColor.g, msdfColor.b)) -
|
|
1193
|
+
max(msdfColor.r, max(msdfColor.g, msdfColor.b));
|
|
1194
|
+
|
|
1195
|
+
// SDF
|
|
1196
|
+
median = min(median, msdfColor.a);
|
|
1197
|
+
|
|
1198
|
+
float screenPxDistance = distance * (median - 0.5);
|
|
1199
|
+
float alpha = clamp(screenPxDistance + 0.5, 0.0, 1.0);
|
|
1200
|
+
|
|
1201
|
+
if (median < 0.01) {
|
|
1202
|
+
alpha = 0.0;
|
|
1203
|
+
} else if (median > 0.99) {
|
|
1204
|
+
alpha = 1.0;
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// Gamma correction for coverage-like alpha
|
|
1208
|
+
float luma = dot(shapeColor.rgb, vec3(0.299, 0.587, 0.114));
|
|
1209
|
+
float gamma = mix(1.0, 1.0 / 2.2, luma);
|
|
1210
|
+
float coverage = pow(shapeColor.a * alpha, gamma);
|
|
1211
|
+
|
|
1212
|
+
return coverage;
|
|
1213
|
+
}
|
|
1214
|
+
`}};let a0,s0;class wB extends ka{constructor(e){const t=new Yi({uColor:{value:new Float32Array([1,1,1,1]),type:"vec4<f32>"},uTransformMatrix:{value:new Pe,type:"mat3x3<f32>"},uDistance:{value:4,type:"f32"},uRound:{value:0,type:"f32"}});a0??(a0=ud({name:"sdf-shader",bits:[pv,gv(e),BB,NB,hd]})),s0??(s0=cd({name:"sdf-shader",bits:[mv,vv(e),OB,GB,fd]})),super({glProgram:s0,gpuProgram:a0,resources:{localUniforms:t,batchSamplers:bv(e)}})}}class PB extends uu{destroy(){this.context.customShader&&this.context.customShader.destroy(),super.destroy()}}class wE{constructor(e){this._renderer=e,this._renderer.renderableGC.addManagedHash(this,"_gpuBitmapText")}validateRenderable(e){const t=this._getGpuBitmapText(e);return this._renderer.renderPipes.graphics.validateRenderable(t)}addRenderable(e,t){const a=this._getGpuBitmapText(e);PE(e,a),e._didTextUpdate&&(e._didTextUpdate=!1,this._updateContext(e,a)),this._renderer.renderPipes.graphics.addRenderable(a,t),a.context.customShader&&this._updateDistanceField(e)}updateRenderable(e){const t=this._getGpuBitmapText(e);PE(e,t),this._renderer.renderPipes.graphics.updateRenderable(t),t.context.customShader&&this._updateDistanceField(e)}_updateContext(e,t){const{context:a}=t,r=lU.getFont(e.text,e._style);a.clear(),r.distanceField.type!=="none"&&(a.customShader||(a.customShader=new wB(this._renderer.limits.maxBatchableTextures)));const u=dr.graphemeSegmenter(e.text),h=e._style;let d=r.baseLineOffset;const m=P1(u,h,r,!0),y=h.padding,b=m.scale;let S=m.width,T=m.height+m.offsetY;h._stroke&&(S+=h._stroke.width/b,T+=h._stroke.width/b),a.translate(-e._anchor._x*S-y,-e._anchor._y*T-y).scale(b,b);const E=r.applyFillAsTint?h._fill.color:16777215;let A=r.fontMetrics.fontSize,B=r.lineHeight;h.lineHeight&&(A=h.fontSize/b,B=h.lineHeight/b);let M=(B-A)/2;M-r.baseLineOffset<0&&(M=0);for(let G=0;G<m.lines.length;G++){const w=m.lines[G];for(let P=0;P<w.charPositions.length;P++){const z=w.chars[P],Z=r.chars[z];if(Z!=null&&Z.texture){const ie=Z.texture;a.texture(ie,E||"black",Math.round(w.charPositions[P]+Z.xOffset),Math.round(d+Z.yOffset+M),ie.orig.width,ie.orig.height)}}d+=B}}_getGpuBitmapText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new PB;return e._gpuData[this._renderer.uid]=t,this._updateContext(e,t),t}_updateDistanceField(e){const t=this._getGpuBitmapText(e).context,a=e._style.fontFamily,r=Ui.get(`${a}-bitmap`),{a:u,b:h,c:d,d:m}=e.groupTransform,y=Math.sqrt(u*u+h*h),b=Math.sqrt(d*d+m*m),S=(Math.abs(y)+Math.abs(b))/2,T=r.baseRenderedFontSize/e._style.fontSize,E=S*r.distanceField.range*(1/T);t.customShader.resources.localUniforms.uniforms.uDistance=E}destroy(){this._renderer=null}}wE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"bitmapText"};function PE(n,e){e.groupTransform=n.groupTransform,e.groupColorAlpha=n.groupColorAlpha,e.groupColor=n.groupColor,e.groupBlendMode=n.groupBlendMode,e.globalDisplayStatus=n.globalDisplayStatus,e.groupTransform=n.groupTransform,e.localDisplayStatus=n.localDisplayStatus,e.groupAlpha=n.groupAlpha,e._roundPixels=n._roundPixels}class zB extends Sy{constructor(e){super(),this.generatingTexture=!1,this._renderer=e,e.runners.resolutionChange.add(this)}resolutionChange(){const e=this.renderable;e._autoResolution&&e.onViewUpdate()}destroy(){this._renderer.htmlText.returnTexturePromise(this.texturePromise),this.texturePromise=null,this._renderer=null}}function r0(n,e){const{texture:t,bounds:a}=n,r=e._style._getFinalPadding();Tx(a,e._anchor,t);const u=e._anchor._x*r*2,h=e._anchor._y*r*2;a.minX-=r-u,a.minY-=r-h,a.maxX-=r-u,a.maxY-=r-h}class zE{constructor(e){this._renderer=e}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){const a=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e).catch(r=>{console.error(r)}),e._didTextUpdate=!1,r0(a,e)),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}async _updateGpuText(e){e._didTextUpdate=!1;const t=this._getGpuText(e);if(t.generatingTexture)return;t.texturePromise&&(this._renderer.htmlText.returnTexturePromise(t.texturePromise),t.texturePromise=null),t.generatingTexture=!0,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution;const a=this._renderer.htmlText.getTexturePromise(e);t.texturePromise=a,t.texture=await a;const r=e.renderGroup||e.parentRenderGroup;r&&(r.structureDidChange=!0),t.generatingTexture=!1,r0(t,e)}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new zB(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.texture=Ge.EMPTY,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}zE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"htmlText"};function HB(){const{userAgent:n}=Gt.get().getNavigator();return/^((?!chrome|android).)*safari/i.test(n)}const VB=new ci;function HE(n,e,t,a){const r=VB;r.minX=0,r.minY=0,r.maxX=n.width/a|0,r.maxY=n.height/a|0;const u=Di.getOptimalTexture(r.width,r.height,a,!1);return u.source.uploadMethodId="image",u.source.resource=n,u.source.alphaMode="premultiply-alpha-on-upload",u.frame.width=e/a,u.frame.height=t/a,u.source.emit("update",u.source),u.updateUvs(),u}function LB(n,e){const t=e.fontFamily,a=[],r={},u=/font-family:([^;"\s]+)/g,h=n.match(u);function d(m){r[m]||(a.push(m),r[m]=!0)}if(Array.isArray(t))for(let m=0;m<t.length;m++)d(t[m]);else d(t);h&&h.forEach(m=>{const y=m.split(":")[1].trim();d(y)});for(const m in e.tagStyles){const y=e.tagStyles[m].fontFamily;d(y)}return a}async function jB(n){const t=await(await Gt.get().fetch(n)).blob(),a=new FileReader;return await new Promise((u,h)=>{a.onloadend=()=>u(a.result),a.onerror=h,a.readAsDataURL(t)})}async function YB(n,e){const t=await jB(e);return`@font-face {
|
|
1215
|
+
font-family: "${n.fontFamily}";
|
|
1216
|
+
font-weight: ${n.fontWeight};
|
|
1217
|
+
font-style: ${n.fontStyle};
|
|
1218
|
+
src: url('${t}');
|
|
1219
|
+
}`}const l0=new Map;async function XB(n){const e=n.filter(t=>Ui.has(`${t}-and-url`)).map(t=>{if(!l0.has(t)){const{entries:a}=Ui.get(`${t}-and-url`),r=[];a.forEach(u=>{const h=u.url,m=u.faces.map(y=>({weight:y.weight,style:y.style}));r.push(...m.map(y=>YB({fontWeight:y.weight,fontStyle:y.style,fontFamily:t},h)))}),l0.set(t,Promise.all(r).then(u=>u.join(`
|
|
1220
|
+
`)))}return l0.get(t)});return(await Promise.all(e)).join(`
|
|
1221
|
+
`)}function qB(n,e,t,a,r){const{domElement:u,styleElement:h,svgRoot:d}=r;u.innerHTML=`<style>${e.cssStyle}</style><div style='padding:0;'>${n}</div>`,u.setAttribute("style",`transform: scale(${t});transform-origin: top left; display: inline-block`),h.textContent=a;const{width:m,height:y}=r.image;return d.setAttribute("width",m.toString()),d.setAttribute("height",y.toString()),new XMLSerializer().serializeToString(d)}function FB(n,e){const t=kl.getOptimalCanvasAndContext(n.width,n.height,e),{context:a}=t;return a.clearRect(0,0,n.width,n.height),a.drawImage(n,0,0),t}function IB(n,e,t){return new Promise(async a=>{t&&await new Promise(r=>setTimeout(r,100)),n.onload=()=>{a()},n.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(e)}`,n.crossOrigin="anonymous"})}class VE{constructor(e){this._renderer=e,this._createCanvas=e.type===Ds.WEBGPU}getTexture(e){return this.getTexturePromise(e)}getTexturePromise(e){return this._buildTexturePromise(e)}async _buildTexturePromise(e){const{text:t,style:a,resolution:r,textureStyle:u}=e,h=hi.get(K1),d=LB(t,a),m=await XB(d),y=EU(t,a,m,h),b=Math.ceil(Math.ceil(Math.max(1,y.width)+a.padding*2)*r),S=Math.ceil(Math.ceil(Math.max(1,y.height)+a.padding*2)*r),T=h.image,E=2;T.width=(b|0)+E,T.height=(S|0)+E;const A=qB(t,a,r,m,h);await IB(T,A,HB()&&d.length>0);const B=T;let M;this._createCanvas&&(M=FB(T,r));const G=HE(M?M.canvas:B,T.width-E,T.height-E,r);return u&&(G.source.style=u),this._createCanvas&&(this._renderer.texture.initSource(G.source),kl.returnCanvasAndContext(M)),hi.return(h),G}returnTexturePromise(e){e.then(t=>{this._cleanUp(t)}).catch(()=>{rt("HTMLTextSystem: Failed to clean texture")})}_cleanUp(e){Di.returnTexture(e,!0),e.source.resource=null,e.source.uploadMethodId="unknown"}destroy(){this._renderer=null}}VE.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"htmlText"};class kB extends Sy{constructor(e){super(),this._renderer=e,e.runners.resolutionChange.add(this)}resolutionChange(){const e=this.renderable;e._autoResolution&&e.onViewUpdate()}destroy(){this._renderer.canvasText.returnTexture(this.texture),this._renderer=null}}class LE{constructor(e){this._renderer=e}validateRenderable(e){return e._didTextUpdate}addRenderable(e,t){const a=this._getGpuText(e);e._didTextUpdate&&(this._updateGpuText(e),e._didTextUpdate=!1),this._renderer.renderPipes.batch.addToBatch(a,t)}updateRenderable(e){const t=this._getGpuText(e);t._batcher.updateElement(t)}_updateGpuText(e){const t=this._getGpuText(e);t.texture&&this._renderer.canvasText.returnTexture(t.texture),e._resolution=e._autoResolution?this._renderer.resolution:e.resolution,t.texture=this._renderer.canvasText.getTexture(e),r0(t,e)}_getGpuText(e){return e._gpuData[this._renderer.uid]||this.initGpuText(e)}initGpuText(e){const t=new kB(this._renderer);return t.renderable=e,t.transform=e.groupTransform,t.bounds={minX:0,maxX:1,minY:0,maxY:0},t.roundPixels=this._renderer._roundPixels|e._roundPixels,e._gpuData[this._renderer.uid]=t,t}destroy(){this._renderer=null}}LE.extension={type:[Q.WebGLPipes,Q.WebGPUPipes,Q.CanvasPipes],name:"text"};class jE{constructor(e){this._renderer=e}getTexture(e,t,a,r){typeof e=="string"&&(st("8.0.0","CanvasTextSystem.getTexture: Use object TextOptions instead of separate arguments"),e={text:e,style:a,resolution:t}),e.style instanceof nl||(e.style=new nl(e.style)),e.textureStyle instanceof Xl||(e.textureStyle=new Xl(e.textureStyle)),typeof e.text!="string"&&(e.text=e.text.toString());const{text:u,style:h,textureStyle:d}=e,m=e.resolution??this._renderer.resolution,{frame:y,canvasAndContext:b}=Gv.getCanvasAndContext({text:u,style:h,resolution:m}),S=HE(b.canvas,y.width,y.height,m);if(d&&(S.source.style=d),h.trim&&(y.pad(h.padding),S.frame.copyFrom(y),S.frame.scale(1/m),S.updateUvs()),h.filters){const T=this._applyFilters(S,h.filters);return this.returnTexture(S),Gv.returnCanvasAndContext(b),T}return this._renderer.texture.initSource(S._source),Gv.returnCanvasAndContext(b),S}returnTexture(e){const t=e.source;t.resource=null,t.uploadMethodId="unknown",t.alphaMode="no-premultiply-alpha",Di.returnTexture(e,!0)}renderTextToCanvas(){st("8.10.0","CanvasTextSystem.renderTextToCanvas: no longer supported, use CanvasTextSystem.getTexture instead")}_applyFilters(e,t){const a=this._renderer.renderTarget.renderTarget,r=this._renderer.filter.generateFilteredTexture({texture:e,filters:t});return this._renderer.renderTarget.bind(a,!1),r}destroy(){this._renderer=null}}jE.extension={type:[Q.WebGLSystem,Q.WebGPUSystem,Q.CanvasSystem],name:"canvasText"},Ie.add(xA,SA);var Cy={exports:{}},al={};/**
|
|
1222
|
+
* @license React
|
|
1223
|
+
* react-reconciler-constants.production.js
|
|
1224
|
+
*
|
|
1225
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1226
|
+
*
|
|
1227
|
+
* This source code is licensed under the MIT license found in the
|
|
1228
|
+
* LICENSE file in the root directory of this source tree.
|
|
1229
|
+
*/var YE;function KB(){return YE||(YE=1,al.ConcurrentRoot=1,al.ContinuousEventPriority=8,al.DefaultEventPriority=32,al.DiscreteEventPriority=2,al.IdleEventPriority=268435456,al.LegacyRoot=0,al.NoEventPriority=0),al}var sl={};/**
|
|
1230
|
+
* @license React
|
|
1231
|
+
* react-reconciler-constants.development.js
|
|
1232
|
+
*
|
|
1233
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1234
|
+
*
|
|
1235
|
+
* This source code is licensed under the MIT license found in the
|
|
1236
|
+
* LICENSE file in the root directory of this source tree.
|
|
1237
|
+
*/var XE;function QB(){return XE||(XE=1,process.env.NODE_ENV!=="production"&&(sl.ConcurrentRoot=1,sl.ContinuousEventPriority=8,sl.DefaultEventPriority=32,sl.DiscreteEventPriority=2,sl.IdleEventPriority=268435456,sl.LegacyRoot=0,sl.NoEventPriority=0)),sl}var qE;function ZB(){return qE||(qE=1,process.env.NODE_ENV==="production"?Cy.exports=KB():Cy.exports=QB()),Cy.exports}var Oc=ZB();const o0=He.createContext({}),WB=o0.Provider;o0.Consumer;function FE(n,e){const t=Object.getPrototypeOf(n),a=Object.getOwnPropertyDescriptor(t,e);return!(typeof a>"u"||a.writable||a.set)}const Wl={currentUpdatePriority:Oc.DefaultEventPriority,unmountQueue:new Set};function IE(n,...e){}function kE(n,e={}){const t=n;return t.__pixireact=Object.assign({filters:[],parent:null,root:null,type:""},e),t}var JB="0.0.0-development",$B={version:JB};function eO(){}function KE(n,e,t){e instanceof Fl&&(e.__pixireact.parent=n,typeof t=="number"?n.__pixireact.filters.splice(t,0,e):n.__pixireact.filters.push(e),n.filters=n.__pixireact.filters)}function u0(n,e){e&&(e instanceof Gn?n.addChild(e):e instanceof Fl&&KE(n,e))}function tO(){}function nO(){return!1}const c0=Object.freeze({onclick:"onClick",onglobalmousemove:"onGlobalMouseMove",onglobalpointermove:"onGlobalPointerMove",onglobaltouchmove:"onGlobalTouchMove",onmousedown:"onMouseDown",onmouseenter:"onMouseEnter",onmouseleave:"onMouseLeave",onmousemove:"onMouseMove",onmouseout:"onMouseOut",onmouseover:"onMouseOver",onmouseup:"onMouseUp",onmouseupoutside:"onMouseUpOutside",onpointercancel:"onPointerCancel",onpointerdown:"onPointerDown",onpointerenter:"onPointerEnter",onpointerleave:"onPointerLeave",onpointermove:"onPointerMove",onpointerout:"onPointerOut",onpointerover:"onPointerOver",onpointertap:"onPointerTap",onpointerup:"onPointerUp",onpointerupoutside:"onPointerUpOutside",onrightclick:"onRightClick",onrightdown:"onRightDown",onrightup:"onRightUp",onrightupoutside:"onRightUpOutside",ontap:"onTap",ontouchcancel:"onTouchCancel",ontouchend:"onTouchEnd",ontouchendoutside:"onTouchEndOutside",ontouchmove:"onTouchMove",ontouchstart:"onTouchStart",onwheel:"onWheel"}),Ry=Object.freeze({onClick:"onclick",onGlobalMouseMove:"onglobalmousemove",onGlobalPointerMove:"onglobalpointermove",onGlobalTouchMove:"onglobaltouchmove",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseUpOutside:"onmouseupoutside",onPointerCancel:"onpointercancel",onPointerDown:"onpointerdown",onPointerEnter:"onpointerenter",onPointerLeave:"onpointerleave",onPointerMove:"onpointermove",onPointerOut:"onpointerout",onPointerOver:"onpointerover",onPointerTap:"onpointertap",onPointerUp:"onpointerup",onPointerUpOutside:"onpointerupoutside",onRightClick:"onrightclick",onRightDown:"onrightdown",onRightUp:"onrightup",onRightUpOutside:"onrightupoutside",onTap:"ontap",onTouchCancel:"ontouchcancel",onTouchEnd:"ontouchend",onTouchEndOutside:"ontouchendoutside",onTouchMove:"ontouchmove",onTouchStart:"ontouchstart",onWheel:"onwheel"});function QE(n){return Array.isArray(n)}function ZE(n,e,t={arrays:"reference",objects:"reference",strict:!0}){const{arrays:a,objects:r,strict:u}=t;if(typeof n!=typeof e||!!n!=!!e)return!1;if(rO(n)||aO(n))return n===e;const h=sO(n);if(h&&r==="reference")return n===e;const d=QE(n);if(d&&a==="reference")return n===e;if((d||h)&&n===e)return!0;let m;for(m in n)if(!(m in e))return!1;let y=n;if(u&&(y=e),h&&a==="shallow"&&r==="shallow"){for(m in y)if(!ZE(n[m],e[m],{strict:u,objects:"reference"}))return!1}else for(m in y)if(n[m]!==e[m])return!1;if(WE(m)){if(d&&n.length===0&&e.length===0||h&&Object.keys(n).length===0&&Object.keys(e).length===0)return!0;if(n!==e)return!1}return!0}function iO(n){return n===null}function aO(n){return typeof n=="number"}function sO(n){return!(n!==Object(n)||QE(n)||typeof n=="function")}function rO(n){return typeof n=="string"}function WE(n){return n===void 0}const lO=Object.freeze(["children","key","ref"]);function oO(n,e=[]){const t={};return Object.entries(n).reduce((a,[r,u])=>(e.includes(r)||(a[r]=u),a),t)}function h0(n,e=[]){return oO(n,lO.concat(e))}const uO="__default";function JE(n,e={},t=!1){const a=h0(n),r=h0(e),u=Object.entries(a),h=[];if(t){const d=Object.keys(r);let m=0;for(;m<d.length;){const y=d[m];!(y in a)&&u.unshift([y,`${uO}remove`]),m+=1}}return u.forEach(([d,m])=>{if(ZE(m,r[d]))return;if(d in Ry){h.push([d,m,!0,[]]);return}let y=[];d.includes("-")&&(y=d.split("-")),h.push([d,m,!1,y]);for(const b in a){const S=a[b];b.startsWith(`${d}-`)&&h.push([b,S,!1,b.split("-")])}}),{changes:h}}function cO(n){const e=n;return!(!e||!e.changes)}const hO="__default",$E=new Map,e2={};function t2(n,e){if(n){const t=n[e];if(!WE(t)&&!iO(t))return t}return n}function n2(n,e){const{__pixireact:t={},...a}=n;let r;cO(e)?r=e:r=JE(e,a);const{changes:u}=r;let h=0;for(;h<u.length;){const d=u[h];let m=!1,y=d[0],b=d[1];const S=d[2],T=d[3];let E=n,A=E[y];if(y==="draw"&&typeof b=="function"&&(n instanceof uu?b(n):(m=!0,IE("warn",`The \`draw\` prop was used on a \`${t.type}\` component, but it's only valid on \`graphics\` components.`))),y in c0){const B=y;m=!0,e2[y]||(e2[y]=!0,IE("warn",`Event names must be pascal case; instead of \`${y}\`, you probably want \`${c0[B]}\`.`))}if(!m){if(T.length&&(A=T.reduce(t2,E),!(A&&A.set))){const[B,...M]=T.reverse();E=M.reverse().reduce(t2,E),y=B}if(b===`${hO}remove`)if(E instanceof Gn){let B=$E.get(E.constructor);B||(B=E.constructor,B=new B,$E.set(E.constructor,B)),b=B[y]}else b=0;if(S&&t){const M=Ry[y];b?E[M]=b:delete E[M]}else FE(E,y)||(E[y]=b)}h+=1}return n}function fO(n,e,t,a){const{children:r,...u}=a,{children:h,...d}=t,m=JE(u,d,!0);return m.changes.length?m:null}function dO(n,e,t,a){const r=fO(n,e,t,a);r&&n2(n,r)}const pO=Object.freeze([...Object.keys(c0),"draw"]),f0={};function mO(n){const e=n.charAt(0),t=n.substring(1);return`${e.toUpperCase()}${t}`}function yO(n,e){return e.toLowerCase()}function gO(n){let e=n;return n.startsWith("pixi")&&(e=n.replace(/^pixi([A-Z])/,yO)),e}function _O(n,e,t){const a=gO(n),r=mO(a);if(!(r in f0))throw new Error(`${r} is not part of the PIXI namespace! Did you forget to extend?`);const u=f0[r],h=h0(e,pO);Object.entries(e).forEach(([m,y])=>{if(m in Ry){const b=Ry[m];h[b]=y}});const d=kE(new u(h),{root:t,type:a});return n2(d,e),d}var Ay={exports:{}},d0={exports:{}},My={exports:{}},p0={};/**
|
|
1238
|
+
* @license React
|
|
1239
|
+
* scheduler.production.js
|
|
1240
|
+
*
|
|
1241
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1242
|
+
*
|
|
1243
|
+
* This source code is licensed under the MIT license found in the
|
|
1244
|
+
* LICENSE file in the root directory of this source tree.
|
|
1245
|
+
*/var i2;function vO(){return i2||(i2=1,function(n){function e(j,ee){var de=j.length;j.push(ee);e:for(;0<de;){var pe=de-1>>>1,U=j[pe];if(0<r(U,ee))j[pe]=ee,j[de]=U,de=pe;else break e}}function t(j){return j.length===0?null:j[0]}function a(j){if(j.length===0)return null;var ee=j[0],de=j.pop();if(de!==ee){j[0]=de;e:for(var pe=0,U=j.length,k=U>>>1;pe<k;){var oe=2*(pe+1)-1,be=j[oe],Ae=oe+1,De=j[Ae];if(0>r(be,de))Ae<U&&0>r(De,be)?(j[pe]=De,j[Ae]=de,pe=Ae):(j[pe]=be,j[oe]=de,pe=oe);else if(Ae<U&&0>r(De,de))j[pe]=De,j[Ae]=de,pe=Ae;else break e}}return ee}function r(j,ee){var de=j.sortIndex-ee.sortIndex;return de!==0?de:j.id-ee.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;n.unstable_now=function(){return u.now()}}else{var h=Date,d=h.now();n.unstable_now=function(){return h.now()-d}}var m=[],y=[],b=1,S=null,T=3,E=!1,A=!1,B=!1,M=typeof setTimeout=="function"?setTimeout:null,G=typeof clearTimeout=="function"?clearTimeout:null,w=typeof setImmediate<"u"?setImmediate:null;function P(j){for(var ee=t(y);ee!==null;){if(ee.callback===null)a(y);else if(ee.startTime<=j)a(y),ee.sortIndex=ee.expirationTime,e(m,ee);else break;ee=t(y)}}function z(j){if(B=!1,P(j),!A)if(t(m)!==null)A=!0,We();else{var ee=t(y);ee!==null&&St(z,ee.startTime-j)}}var Z=!1,ie=-1,ne=5,Se=-1;function _e(){return!(n.unstable_now()-Se<ne)}function me(){if(Z){var j=n.unstable_now();Se=j;var ee=!0;try{e:{A=!1,B&&(B=!1,G(ie),ie=-1),E=!0;var de=T;try{t:{for(P(j),S=t(m);S!==null&&!(S.expirationTime>j&&_e());){var pe=S.callback;if(typeof pe=="function"){S.callback=null,T=S.priorityLevel;var U=pe(S.expirationTime<=j);if(j=n.unstable_now(),typeof U=="function"){S.callback=U,P(j),ee=!0;break t}S===t(m)&&a(m),P(j)}else a(m);S=t(m)}if(S!==null)ee=!0;else{var k=t(y);k!==null&&St(z,k.startTime-j),ee=!1}}break e}finally{S=null,T=de,E=!1}ee=void 0}}finally{ee?se():Z=!1}}}var se;if(typeof w=="function")se=function(){w(me)};else if(typeof MessageChannel<"u"){var Le=new MessageChannel,ae=Le.port2;Le.port1.onmessage=me,se=function(){ae.postMessage(null)}}else se=function(){M(me,0)};function We(){Z||(Z=!0,se())}function St(j,ee){ie=M(function(){j(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){A||E||(A=!0,We())},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_getFirstCallbackNode=function(){return t(m)},n.unstable_next=function(j){switch(T){case 1:case 2:case 3:var ee=3;break;default:ee=T}var de=T;T=ee;try{return j()}finally{T=de}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,ee){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var de=T;T=j;try{return ee()}finally{T=de}},n.unstable_scheduleCallback=function(j,ee,de){var pe=n.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?pe+de:pe):de=pe,j){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=de+U,j={id:b++,callback:ee,priorityLevel:j,startTime:de,expirationTime:U,sortIndex:-1},de>pe?(j.sortIndex=de,e(y,j),t(m)===null&&j===t(y)&&(B?(G(ie),ie=-1):B=!0,St(z,de-pe))):(j.sortIndex=U,e(m,j),A||E||(A=!0,We())),j},n.unstable_shouldYield=_e,n.unstable_wrapCallback=function(j){var ee=T;return function(){var de=T;T=ee;try{return j.apply(this,arguments)}finally{T=de}}}}(p0)),p0}var m0={};/**
|
|
1246
|
+
* @license React
|
|
1247
|
+
* scheduler.development.js
|
|
1248
|
+
*
|
|
1249
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1250
|
+
*
|
|
1251
|
+
* This source code is licensed under the MIT license found in the
|
|
1252
|
+
* LICENSE file in the root directory of this source tree.
|
|
1253
|
+
*/var a2;function bO(){return a2||(a2=1,function(n){process.env.NODE_ENV!=="production"&&function(){function e(){if(_e){var j=n.unstable_now();Le=j;var ee=!0;try{e:{z=!1,Z&&(Z=!1,ne(me),me=-1),P=!0;var de=w;try{t:{for(h(j),G=a(A);G!==null&&!(G.expirationTime>j&&m());){var pe=G.callback;if(typeof pe=="function"){G.callback=null,w=G.priorityLevel;var U=pe(G.expirationTime<=j);if(j=n.unstable_now(),typeof U=="function"){G.callback=U,h(j),ee=!0;break t}G===a(A)&&r(A),h(j)}else r(A);G=a(A)}if(G!==null)ee=!0;else{var k=a(B);k!==null&&b(d,k.startTime-j),ee=!1}}break e}finally{G=null,w=de,P=!1}ee=void 0}}finally{ee?ae():_e=!1}}}function t(j,ee){var de=j.length;j.push(ee);e:for(;0<de;){var pe=de-1>>>1,U=j[pe];if(0<u(U,ee))j[pe]=ee,j[de]=U,de=pe;else break e}}function a(j){return j.length===0?null:j[0]}function r(j){if(j.length===0)return null;var ee=j[0],de=j.pop();if(de!==ee){j[0]=de;e:for(var pe=0,U=j.length,k=U>>>1;pe<k;){var oe=2*(pe+1)-1,be=j[oe],Ae=oe+1,De=j[Ae];if(0>u(be,de))Ae<U&&0>u(De,be)?(j[pe]=De,j[Ae]=de,pe=Ae):(j[pe]=be,j[oe]=de,pe=oe);else if(Ae<U&&0>u(De,de))j[pe]=De,j[Ae]=de,pe=Ae;else break e}}return ee}function u(j,ee){var de=j.sortIndex-ee.sortIndex;return de!==0?de:j.id-ee.id}function h(j){for(var ee=a(B);ee!==null;){if(ee.callback===null)r(B);else if(ee.startTime<=j)r(B),ee.sortIndex=ee.expirationTime,t(A,ee);else break;ee=a(B)}}function d(j){if(Z=!1,h(j),!z)if(a(A)!==null)z=!0,y();else{var ee=a(B);ee!==null&&b(d,ee.startTime-j)}}function m(){return!(n.unstable_now()-Le<se)}function y(){_e||(_e=!0,ae())}function b(j,ee){me=ie(function(){j(n.unstable_now())},ee)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var S=performance;n.unstable_now=function(){return S.now()}}else{var T=Date,E=T.now();n.unstable_now=function(){return T.now()-E}}var A=[],B=[],M=1,G=null,w=3,P=!1,z=!1,Z=!1,ie=typeof setTimeout=="function"?setTimeout:null,ne=typeof clearTimeout=="function"?clearTimeout:null,Se=typeof setImmediate<"u"?setImmediate:null,_e=!1,me=-1,se=5,Le=-1;if(typeof Se=="function")var ae=function(){Se(e)};else if(typeof MessageChannel<"u"){var We=new MessageChannel,St=We.port2;We.port1.onmessage=e,ae=function(){St.postMessage(null)}}else ae=function(){ie(e,0)};n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(j){j.callback=null},n.unstable_continueExecution=function(){z||P||(z=!0,y())},n.unstable_forceFrameRate=function(j){0>j||125<j?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):se=0<j?Math.floor(1e3/j):5},n.unstable_getCurrentPriorityLevel=function(){return w},n.unstable_getFirstCallbackNode=function(){return a(A)},n.unstable_next=function(j){switch(w){case 1:case 2:case 3:var ee=3;break;default:ee=w}var de=w;w=ee;try{return j()}finally{w=de}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(j,ee){switch(j){case 1:case 2:case 3:case 4:case 5:break;default:j=3}var de=w;w=j;try{return ee()}finally{w=de}},n.unstable_scheduleCallback=function(j,ee,de){var pe=n.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?pe+de:pe):de=pe,j){case 1:var U=-1;break;case 2:U=250;break;case 5:U=1073741823;break;case 4:U=1e4;break;default:U=5e3}return U=de+U,j={id:M++,callback:ee,priorityLevel:j,startTime:de,expirationTime:U,sortIndex:-1},de>pe?(j.sortIndex=de,t(B,j),a(A)===null&&j===a(B)&&(Z?(ne(me),me=-1):Z=!0,b(d,de-pe))):(j.sortIndex=U,t(A,j),z||P||(z=!0,y())),j},n.unstable_shouldYield=m,n.unstable_wrapCallback=function(j){var ee=w;return function(){var de=w;w=ee;try{return j.apply(this,arguments)}finally{w=de}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(m0)),m0}var s2;function r2(){return s2||(s2=1,process.env.NODE_ENV==="production"?My.exports=vO():My.exports=bO()),My.exports}/**
|
|
1254
|
+
* @license React
|
|
1255
|
+
* react-reconciler.production.js
|
|
1256
|
+
*
|
|
1257
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1258
|
+
*
|
|
1259
|
+
* This source code is licensed under the MIT license found in the
|
|
1260
|
+
* LICENSE file in the root directory of this source tree.
|
|
1261
|
+
*/var l2;function xO(){return l2||(l2=1,function(n){n.exports=function(e){function t(l,o,f,_){return new ig(l,o,f,_)}function a(){}function r(l){var o="https://react.dev/errors/"+l;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var f=2;f<arguments.length;f++)o+="&args[]="+encodeURIComponent(arguments[f])}return"Minified React error #"+l+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(l){return l===null||typeof l!="object"?null:(l=Np&&l[Np]||l["@@iterator"],typeof l=="function"?l:null)}function h(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===K0?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case xl:return"Fragment";case Co:return"Portal";case Lh:return"Profiler";case Mp:return"StrictMode";case Yh:return"Suspense";case Bp:return"SuspenseList"}if(typeof l=="object")switch(l.$$typeof){case Ga:return(l.displayName||"Context")+".Provider";case jh:return(l._context.displayName||"Context")+".Consumer";case Up:var o=l.render;return l=l.displayName,l||(l=o.displayName||o.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Xh:return o=l.displayName||null,o!==null?o:h(l.type)||"Memo";case ks:o=l._payload,l=l._init;try{return h(l(o))}catch{}}return null}function d(l){if(Gp===void 0)try{throw Error()}catch(f){var o=f.stack.trim().match(/\n( *(at )?)/);Gp=o&&o[1]||"",_i=-1<f.stack.indexOf(`
|
|
1262
|
+
at`)?" (<anonymous>)":-1<f.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
1263
|
+
`+Gp+l+_i}function m(l,o){if(!l||qh)return"";qh=!0;var f=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var _={DetermineComponentFrameRoot:function(){try{if(o){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(Ne){var Ee=Ne}Reflect.construct(l,[],Ce)}else{try{Ce.call()}catch(Ne){Ee=Ne}l.call(Ce.prototype)}}else{try{throw Error()}catch(Ne){Ee=Ne}(Ce=l())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(Ne){if(Ne&&Ee&&typeof Ne.stack=="string")return[Ne.stack,Ee.stack]}return[null,null]}};_.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(_.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(_.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=_.DetermineComponentFrameRoot(),O=C[0],H=C[1];if(O&&H){var I=O.split(`
|
|
1264
|
+
`),re=H.split(`
|
|
1265
|
+
`);for(x=_=0;_<I.length&&!I[_].includes("DetermineComponentFrameRoot");)_++;for(;x<re.length&&!re[x].includes("DetermineComponentFrameRoot");)x++;if(_===I.length||x===re.length)for(_=I.length-1,x=re.length-1;1<=_&&0<=x&&I[_]!==re[x];)x--;for(;1<=_&&0<=x;_--,x--)if(I[_]!==re[x]){if(_!==1||x!==1)do if(_--,x--,0>x||I[_]!==re[x]){var ye=`
|
|
1266
|
+
`+I[_].replace(" at new "," at ");return l.displayName&&ye.includes("<anonymous>")&&(ye=ye.replace("<anonymous>",l.displayName)),ye}while(1<=_&&0<=x);break}}}finally{qh=!1,Error.prepareStackTrace=f}return(f=l?l.displayName||l.name:"")?d(f):""}function y(l){switch(l.tag){case 26:case 27:case 5:return d(l.type);case 16:return d("Lazy");case 13:return d("Suspense");case 19:return d("SuspenseList");case 0:case 15:return l=m(l.type,!1),l;case 11:return l=m(l.type.render,!1),l;case 1:return l=m(l.type,!0),l;default:return""}}function b(l){try{var o="";do o+=y(l),l=l.return;while(l);return o}catch(f){return`
|
|
1267
|
+
Error generating stack: `+f.message+`
|
|
1268
|
+
`+f.stack}}function S(l){var o=l,f=l;if(l.alternate)for(;o.return;)o=o.return;else{l=o;do o=l,(o.flags&4098)!==0&&(f=o.return),l=o.return;while(l)}return o.tag===3?f:null}function T(l){if(S(l)!==l)throw Error(r(188))}function E(l){var o=l.alternate;if(!o){if(o=S(l),o===null)throw Error(r(188));return o!==l?null:l}for(var f=l,_=o;;){var x=f.return;if(x===null)break;var C=x.alternate;if(C===null){if(_=x.return,_!==null){f=_;continue}break}if(x.child===C.child){for(C=x.child;C;){if(C===f)return T(x),l;if(C===_)return T(x),o;C=C.sibling}throw Error(r(188))}if(f.return!==_.return)f=x,_=C;else{for(var O=!1,H=x.child;H;){if(H===f){O=!0,f=x,_=C;break}if(H===_){O=!0,_=x,f=C;break}H=H.sibling}if(!O){for(H=C.child;H;){if(H===f){O=!0,f=C,_=x;break}if(H===_){O=!0,_=C,f=x;break}H=H.sibling}if(!O)throw Error(r(189))}}if(f.alternate!==_)throw Error(r(190))}if(f.tag!==3)throw Error(r(188));return f.stateNode.current===f?l:o}function A(l){var o=l.tag;if(o===5||o===26||o===27||o===6)return l;for(l=l.child;l!==null;){if(o=A(l),o!==null)return o;l=l.sibling}return null}function B(l){var o=l.tag;if(o===5||o===26||o===27||o===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(o=B(l),o!==null))return o;l=l.sibling}return null}function M(l){return{current:l}}function G(l){0>hs||(l.current=Pa[hs],Pa[hs]=null,hs--)}function w(l,o){hs++,Pa[hs]=l.current,l.current=o}function P(l){return l>>>=0,l===0?32:31-(nf(l)/Wi|0)|0}function z(l){var o=l&42;if(o!==0)return o;switch(l&-l){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return l&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function Z(l,o){var f=l.pendingLanes;if(f===0)return 0;var _=0,x=l.suspendedLanes,C=l.pingedLanes,O=l.warmLanes;l=l.finishedLanes!==0;var H=f&134217727;return H!==0?(f=H&~x,f!==0?_=z(f):(C&=H,C!==0?_=z(C):l||(O=H&~O,O!==0&&(_=z(O))))):(H=f&~x,H!==0?_=z(H):C!==0?_=z(C):l||(O=f&~O,O!==0&&(_=z(O)))),_===0?0:o!==0&&o!==_&&(o&x)===0&&(x=_&-_,O=o&-o,x>=O||x===32&&(O&4194176)!==0)?o:_}function ie(l,o){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&o)===0}function ne(l,o){switch(l){case 1:case 2:case 4:case 8:return o+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+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 Se(){var l=Fu;return Fu<<=1,(Fu&4194176)===0&&(Fu=128),l}function _e(){var l=af;return af<<=1,(af&62914560)===0&&(af=4194304),l}function me(l){for(var o=[],f=0;31>f;f++)o.push(l);return o}function se(l,o){l.pendingLanes|=o,o!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Le(l,o,f,_,x,C){var O=l.pendingLanes;l.pendingLanes=f,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=f,l.entangledLanes&=f,l.errorRecoveryDisabledLanes&=f,l.shellSuspendCounter=0;var H=l.entanglements,I=l.expirationTimes,re=l.hiddenUpdates;for(f=O&~f;0<f;){var ye=31-bi(f),Ce=1<<ye;H[ye]=0,I[ye]=-1;var Ee=re[ye];if(Ee!==null)for(re[ye]=null,ye=0;ye<Ee.length;ye++){var Ne=Ee[ye];Ne!==null&&(Ne.lane&=-536870913)}f&=~Ce}_!==0&&ae(l,_,0),C!==0&&x===0&&l.tag!==0&&(l.suspendedLanes|=C&~(O&~o))}function ae(l,o,f){l.pendingLanes|=o,l.suspendedLanes&=~o;var _=31-bi(o);l.entangledLanes|=o,l.entanglements[_]=l.entanglements[_]|1073741824|f&4194218}function We(l,o){var f=l.entangledLanes|=o;for(l=l.entanglements;f;){var _=31-bi(f),x=1<<_;x&o|l[_]&o&&(l[_]|=o),f&=~x}}function St(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function j(l){if(zi&&typeof zi.onCommitFiberRoot=="function")try{zi.onCommitFiberRoot(Al,l,void 0,(l.current.flags&128)===128)}catch{}}function ee(l){if(typeof Og=="function"&&Ng(l),zi&&typeof zi.setStrictMode=="function")try{zi.setStrictMode(Al,l)}catch{}}function de(l,o){return l===o&&(l!==0||1/l===1/o)||l!==l&&o!==o}function pe(l,o){if(typeof l=="object"&&l!==null){var f=rf.get(l);return f!==void 0?f:(o={value:l,source:o,stack:b(o)},rf.set(l,o),o)}return{value:l,source:o,stack:b(o)}}function U(l,o){Yn[Xn++]=lf,Yn[Xn++]=Mn,Mn=l,lf=o}function k(l,o,f){pa[Ji++]=er,pa[Ji++]=tr,pa[Ji++]=ma,ma=l;var _=er;l=tr;var x=32-bi(_)-1;_&=~(1<<x),f+=1;var C=32-bi(o)+x;if(30<C){var O=x-x%5;C=(_&(1<<O)-1).toString(32),_>>=O,x-=O,er=1<<32-bi(o)+x|f<<x|_,tr=C+l}else er=1<<C|f<<x|_,tr=l}function oe(l){l.return!==null&&(U(l,1),k(l,1,0))}function be(l){for(;l===Mn;)Mn=Yn[--Xn],Yn[Xn]=null,lf=Yn[--Xn],Yn[Xn]=null;for(;l===ma;)ma=pa[--Ji],pa[Ji]=null,tr=pa[--Ji],pa[Ji]=null,er=pa[--Ji],pa[Ji]=null}function Ae(l,o){w(zr,o),w(Ku,l),w(qn,null),l=Ao(o),G(qn),w(qn,l)}function De(){G(qn),G(Ku),G(zr)}function ze(l){l.memoizedState!==null&&w(Bo,l);var o=qn.current,f=rg(o,l.type);o!==f&&(w(Ku,l),w(qn,f))}function wt(l){Ku.current===l&&(G(qn),G(Ku)),Bo.current===l&&(G(Bo),cs?Js._currentValue=Tl:Js._currentValue2=Tl)}function je(l){var o=Error(r(418,""));throw Jn(pe(o,l)),Qu}function $t(l,o){if(!vi)throw Error(r(175));Wp(l.stateNode,l.type,l.memoizedProps,o,l)||je(l)}function Ni(l){for(si=l.return;si;)switch(si.tag){case 3:case 27:fs=!0;return;case 5:case 13:fs=!1;return;default:si=si.return}}function Wn(l){if(!vi||l!==si)return!1;if(!_t)return Ni(l),_t=!0,!1;var o=!1;if(nn?l.tag!==3&&l.tag!==27&&(l.tag!==5||Wh(l.type)&&!Qs(l.type,l.memoizedProps))&&(o=!0):l.tag!==3&&(l.tag!==5||Wh(l.type)&&!Qs(l.type,l.memoizedProps))&&(o=!0),o&&Sn&&je(l),Ni(l),l.tag===13){if(!vi)throw Error(r(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(r(317));Sn=Jp(l)}else Sn=si?Sg(l.stateNode):null;return!0}function cn(){vi&&(Sn=si=null,_t=!1)}function Jn(l){za===null?za=[l]:za.push(l)}function $n(){for(var l=on,o=ds=on=0;o<l;){var f=dn[o];dn[o++]=null;var _=dn[o];dn[o++]=null;var x=dn[o];dn[o++]=null;var C=dn[o];if(dn[o++]=null,_!==null&&x!==null){var O=_.pending;O===null?x.next=x:(x.next=O.next,O.next=x),_.pending=x}C!==0&&yr(f,x,C)}}function wn(l,o,f,_){dn[on++]=l,dn[on++]=o,dn[on++]=f,dn[on++]=_,ds|=_,l.lanes|=_,l=l.alternate,l!==null&&(l.lanes|=_)}function xn(l,o,f,_){return wn(l,o,f,_),ll(l)}function Pn(l,o){return wn(l,null,null,o),ll(l)}function yr(l,o,f){l.lanes|=f;var _=l.alternate;_!==null&&(_.lanes|=f);for(var x=!1,C=l.return;C!==null;)C.childLanes|=f,_=C.alternate,_!==null&&(_.childLanes|=f),C.tag===22&&(l=C.stateNode,l===null||l._visibility&1||(x=!0)),l=C,C=C.return;x&&o!==null&&l.tag===3&&(C=l.stateNode,x=31-bi(f),C=C.hiddenUpdates,l=C[x],l===null?C[x]=[o]:l.push(o),o.lane=f|536870912)}function ll(l){if(50<ac)throw ac=0,Yo=null,Error(r(185));for(var o=l.return;o!==null;)l=o,o=l.return;return l.tag===3?l.stateNode:null}function Xe(l){l!==Ml&&l.next===null&&(Ml===null?Si=Ml=l:Ml=Ml.next=l),Fn=!0,rm||(rm=!0,Lc(Vc))}function yt(l,o){if(!nr&&Fn){nr=!0;do for(var f=!1,_=Si;_!==null;){if(l!==0){var x=_.pendingLanes;if(x===0)var C=0;else{var O=_.suspendedLanes,H=_.pingedLanes;C=(1<<31-bi(42|l)+1)-1,C&=x&~(O&~H),C=C&201326677?C&201326677|1:C?C|2:0}C!==0&&(f=!0,Za(_,C))}else C=pt,C=Z(_,_===zt?C:0),(C&3)===0||ie(_,C)||(f=!0,Za(_,C));_=_.next}while(f);nr=!1}}function Vc(){Fn=rm=!1;var l=0;Oo!==0&&(og()&&(l=Oo),Oo=0);for(var o=da(),f=null,_=Si;_!==null;){var x=_.next,C=no(_,o);C===0?(_.next=null,f===null?Si=x:f.next=x,x===null&&(Ml=f)):(f=_,(l!==0||(C&3)!==0)&&(Fn=!0)),_=x}yt(l)}function no(l,o){for(var f=l.suspendedLanes,_=l.pingedLanes,x=l.expirationTimes,C=l.pendingLanes&-62914561;0<C;){var O=31-bi(C),H=1<<O,I=x[O];I===-1?((H&f)===0||(H&_)!==0)&&(x[O]=ne(H,o)):I<=o&&(l.expiredLanes|=H),C&=~H}if(o=zt,f=pt,f=Z(l,l===o?f:0),_=l.callbackNode,f===0||l===o&&Ut===2||l.cancelPendingCommit!==null)return _!==null&&_!==null&&am(_),l.callbackNode=null,l.callbackPriority=0;if((f&3)===0||ie(l,f)){if(o=f&-f,o===l.callbackPriority)return o;switch(_!==null&&am(_),St(f)){case 2:case 8:f=Ug;break;case 32:f=sf;break;case 268435456:f=Bg;break;default:f=sf}return _=Ps.bind(null,l),f=Iu(f,_),l.callbackPriority=o,l.callbackNode=f,o}return _!==null&&_!==null&&am(_),l.callbackPriority=2,l.callbackNode=null,2}function Ps(l,o){var f=l.callbackNode;if(os()&&l.callbackNode!==f)return null;var _=pt;return _=Z(l,l===zt?_:0),_===0?null:(Bh(l,_,o),no(l,da()),l.callbackNode!=null&&l.callbackNode===f?Ps.bind(null,l):null)}function Za(l,o){if(os())return null;Bh(l,o,!0)}function Lc(l){W0?$s(function(){(Dt&6)!==0?Iu(sm,l):l()}):Iu(sm,l)}function io(){return Oo===0&&(Oo=Se()),Oo}function gr(l,o){if(Zu===null){var f=Zu=[];lm=0,No=io(),Dl={status:"pending",value:void 0,then:function(_){f.push(_)}}}return lm++,o.then(pu,pu),o}function pu(){if(--lm===0&&Zu!==null){Dl!==null&&(Dl.status="fulfilled");var l=Zu;Zu=null,No=0,Dl=null;for(var o=0;o<l.length;o++)(0,l[o])()}}function ei(l,o){var f=[],_={status:"pending",value:null,reason:null,then:function(x){f.push(x)}};return l.then(function(){_.status="fulfilled",_.value=o;for(var x=0;x<f.length;x++)(0,f[x])(o)},function(x){for(_.status="rejected",_.reason=x,x=0;x<f.length;x++)(0,f[x])(void 0)}),_}function la(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function zs(l,o){l=l.updateQueue,o.updateQueue===l&&(o.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function fi(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function di(l,o,f){var _=l.updateQueue;if(_===null)return null;if(_=_.shared,(Dt&2)!==0){var x=_.pending;return x===null?o.next=o:(o.next=x.next,x.next=o),_.pending=o,o=ll(l),yr(l,null,f),o}return wn(l,_,o,f),ll(l)}function pi(l,o,f){if(o=o.updateQueue,o!==null&&(o=o.shared,(f&4194176)!==0)){var _=o.lanes;_&=l.pendingLanes,f|=_,o.lanes=f,We(l,f)}}function Xi(l,o){var f=l.updateQueue,_=l.alternate;if(_!==null&&(_=_.updateQueue,f===_)){var x=null,C=null;if(f=f.firstBaseUpdate,f!==null){do{var O={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};C===null?x=C=O:C=C.next=O,f=f.next}while(f!==null);C===null?x=C=o:C=C.next=o}else x=C=o;f={baseState:_.baseState,firstBaseUpdate:x,lastBaseUpdate:C,shared:_.shared,callbacks:_.callbacks},l.updateQueue=f;return}l=f.lastBaseUpdate,l===null?f.firstBaseUpdate=o:l.next=o,f.lastBaseUpdate=o}function D(){if(of){var l=Dl;if(l!==null)throw l}}function F(l,o,f,_){of=!1;var x=l.updateQueue;Hr=!1;var C=x.firstBaseUpdate,O=x.lastBaseUpdate,H=x.shared.pending;if(H!==null){x.shared.pending=null;var I=H,re=I.next;I.next=null,O===null?C=re:O.next=re,O=I;var ye=l.alternate;ye!==null&&(ye=ye.updateQueue,H=ye.lastBaseUpdate,H!==O&&(H===null?ye.firstBaseUpdate=re:H.next=re,ye.lastBaseUpdate=I))}if(C!==null){var Ce=x.baseState;O=0,ye=re=I=null,H=C;do{var Ee=H.lane&-536870913,Ne=Ee!==H.lane;if(Ne?(pt&Ee)===Ee:(_&Ee)===Ee){Ee!==0&&Ee===No&&(of=!0),ye!==null&&(ye=ye.next={lane:0,tag:H.tag,payload:H.payload,callback:null,next:null});e:{var ve=l,Vi=H;Ee=o;var kn=f;switch(Vi.tag){case 1:if(ve=Vi.payload,typeof ve=="function"){Ce=ve.call(kn,Ce,Ee);break e}Ce=ve;break e;case 3:ve.flags=ve.flags&-65537|128;case 0:if(ve=Vi.payload,Ee=typeof ve=="function"?ve.call(kn,Ce,Ee):ve,Ee==null)break e;Ce=Is({},Ce,Ee);break e;case 2:Hr=!0}}Ee=H.callback,Ee!==null&&(l.flags|=64,Ne&&(l.flags|=8192),Ne=x.callbacks,Ne===null?x.callbacks=[Ee]:Ne.push(Ee))}else Ne={lane:Ee,tag:H.tag,payload:H.payload,callback:H.callback,next:null},ye===null?(re=ye=Ne,I=Ce):ye=ye.next=Ne,O|=Ee;if(H=H.next,H===null){if(H=x.shared.pending,H===null)break;Ne=H,H=Ne.next,Ne.next=null,x.lastBaseUpdate=Ne,x.shared.pending=null}}while(!0);ye===null&&(I=Ce),x.baseState=I,x.firstBaseUpdate=re,x.lastBaseUpdate=ye,C===null&&(x.shared.lanes=0),Yr|=O,l.lanes=O,l.memoizedState=Ce}}function he(l,o){if(typeof l!="function")throw Error(r(191,l));l.call(o)}function Te(l,o){var f=l.callbacks;if(f!==null)for(l.callbacks=null,l=0;l<f.length;l++)he(f[l],o)}function Ue(l,o){if(xi(l,o))return!0;if(typeof l!="object"||l===null||typeof o!="object"||o===null)return!1;var f=Object.keys(l),_=Object.keys(o);if(f.length!==_.length)return!1;for(_=0;_<f.length;_++){var x=f[_];if(!cb.call(o,x)||!xi(l[x],o[x]))return!1}return!0}function tt(l){return l=l.status,l==="fulfilled"||l==="rejected"}function we(){}function ct(l,o,f){switch(f=l[f],f===void 0?l.push(o):f!==o&&(o.then(we,we),o=f),o.status){case"fulfilled":return o.value;case"rejected":throw l=o.reason,l===ps?Error(r(483)):l;default:if(typeof o.status=="string")o.then(we,we);else{if(l=zt,l!==null&&100<l.shellSuspendCounter)throw Error(r(482));l=o,l.status="pending",l.then(function(_){if(o.status==="pending"){var x=o;x.status="fulfilled",x.value=_}},function(_){if(o.status==="pending"){var x=o;x.status="rejected",x.reason=_}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw l=o.reason,l===ps?Error(r(483)):l}throw Go=o,ps}}function Fe(){if(Go===null)throw Error(r(459));var l=Go;return Go=null,l}function Gi(l){var o=Wu;return Wu+=1,wo===null&&(wo=[]),ct(wo,l,o)}function ti(l,o){o=o.props.ref,l.ref=o!==void 0?o:null}function Hs(l,o){throw o.$$typeof===Ki?Error(r(525)):(l=Object.prototype.toString.call(o),Error(r(31,l==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":l)))}function ao(l){var o=l._init;return o(l._payload)}function so(l){function o(K,q){if(l){var W=K.deletions;W===null?(K.deletions=[q],K.flags|=16):W.push(q)}}function f(K,q){if(!l)return null;for(;q!==null;)o(K,q),q=q.sibling;return null}function _(K){for(var q=new Map;K!==null;)K.key!==null?q.set(K.key,K):q.set(K.index,K),K=K.sibling;return q}function x(K,q){return K=ca(K,q),K.index=0,K.sibling=null,K}function C(K,q,W){return K.index=W,l?(W=K.alternate,W!==null?(W=W.index,W<q?(K.flags|=33554434,q):W):(K.flags|=33554434,q)):(K.flags|=1048576,q)}function O(K){return l&&K.alternate===null&&(K.flags|=33554434),K}function H(K,q,W,ce){return q===null||q.tag!==6?(q=ha(W,K.mode,ce),q.return=K,q):(q=x(q,W),q.return=K,q)}function I(K,q,W,ce){var Be=W.type;return Be===xl?ye(K,q,W.props.children,ce,W.key):q!==null&&(q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===ks&&ao(Be)===q.type)?(q=x(q,W.props),ti(q,W),q.return=K,q):(q=zh(W.type,W.key,W.props,null,K.mode,ce),ti(q,W),q.return=K,q)}function re(K,q,W,ce){return q===null||q.tag!==4||q.stateNode.containerInfo!==W.containerInfo||q.stateNode.implementation!==W.implementation?(q=Hh(W,K.mode,ce),q.return=K,q):(q=x(q,W.children||[]),q.return=K,q)}function ye(K,q,W,ce,Be){return q===null||q.tag!==7?(q=vl(W,K.mode,ce,Be),q.return=K,q):(q=x(q,W),q.return=K,q)}function Ce(K,q,W){if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return q=ha(""+q,K.mode,W),q.return=K,q;if(typeof q=="object"&&q!==null){switch(q.$$typeof){case ju:return W=zh(q.type,q.key,q.props,null,K.mode,W),ti(W,q),W.return=K,W;case Co:return q=Hh(q,K.mode,W),q.return=K,q;case ks:var ce=q._init;return q=ce(q._payload),Ce(K,q,W)}if(ii(q)||u(q))return q=vl(q,K.mode,W,null),q.return=K,q;if(typeof q.then=="function")return Ce(K,Gi(q),W);if(q.$$typeof===Ga)return Ce(K,Uu(K,q),W);Hs(K,q)}return null}function Ee(K,q,W,ce){var Be=q!==null?q.key:null;if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return Be!==null?null:H(K,q,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case ju:return W.key===Be?I(K,q,W,ce):null;case Co:return W.key===Be?re(K,q,W,ce):null;case ks:return Be=W._init,W=Be(W._payload),Ee(K,q,W,ce)}if(ii(W)||u(W))return Be!==null?null:ye(K,q,W,ce,null);if(typeof W.then=="function")return Ee(K,q,Gi(W),ce);if(W.$$typeof===Ga)return Ee(K,q,Uu(K,W),ce);Hs(K,W)}return null}function Ne(K,q,W,ce,Be){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return K=K.get(W)||null,H(q,K,""+ce,Be);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case ju:return K=K.get(ce.key===null?W:ce.key)||null,I(q,K,ce,Be);case Co:return K=K.get(ce.key===null?W:ce.key)||null,re(q,K,ce,Be);case ks:var Bt=ce._init;return ce=Bt(ce._payload),Ne(K,q,W,ce,Be)}if(ii(ce)||u(ce))return K=K.get(W)||null,ye(q,K,ce,Be,null);if(typeof ce.then=="function")return Ne(K,q,W,Gi(ce),Be);if(ce.$$typeof===Ga)return Ne(K,q,W,Uu(q,ce),Be);Hs(q,ce)}return null}function ve(K,q,W,ce){for(var Be=null,Bt=null,Oe=q,Ze=q=0,It=null;Oe!==null&&Ze<W.length;Ze++){Oe.index>Ze?(It=Oe,Oe=null):It=Oe.sibling;var nt=Ee(K,Oe,W[Ze],ce);if(nt===null){Oe===null&&(Oe=It);break}l&&Oe&&nt.alternate===null&&o(K,Oe),q=C(nt,q,Ze),Bt===null?Be=nt:Bt.sibling=nt,Bt=nt,Oe=It}if(Ze===W.length)return f(K,Oe),_t&&U(K,Ze),Be;if(Oe===null){for(;Ze<W.length;Ze++)Oe=Ce(K,W[Ze],ce),Oe!==null&&(q=C(Oe,q,Ze),Bt===null?Be=Oe:Bt.sibling=Oe,Bt=Oe);return _t&&U(K,Ze),Be}for(Oe=_(Oe);Ze<W.length;Ze++)It=Ne(Oe,K,Ze,W[Ze],ce),It!==null&&(l&&It.alternate!==null&&Oe.delete(It.key===null?Ze:It.key),q=C(It,q,Ze),Bt===null?Be=It:Bt.sibling=It,Bt=It);return l&&Oe.forEach(function(li){return o(K,li)}),_t&&U(K,Ze),Be}function Vi(K,q,W,ce){if(W==null)throw Error(r(151));for(var Be=null,Bt=null,Oe=q,Ze=q=0,It=null,nt=W.next();Oe!==null&&!nt.done;Ze++,nt=W.next()){Oe.index>Ze?(It=Oe,Oe=null):It=Oe.sibling;var li=Ee(K,Oe,nt.value,ce);if(li===null){Oe===null&&(Oe=It);break}l&&Oe&&li.alternate===null&&o(K,Oe),q=C(li,q,Ze),Bt===null?Be=li:Bt.sibling=li,Bt=li,Oe=It}if(nt.done)return f(K,Oe),_t&&U(K,Ze),Be;if(Oe===null){for(;!nt.done;Ze++,nt=W.next())nt=Ce(K,nt.value,ce),nt!==null&&(q=C(nt,q,Ze),Bt===null?Be=nt:Bt.sibling=nt,Bt=nt);return _t&&U(K,Ze),Be}for(Oe=_(Oe);!nt.done;Ze++,nt=W.next())nt=Ne(Oe,K,Ze,nt.value,ce),nt!==null&&(l&&nt.alternate!==null&&Oe.delete(nt.key===null?Ze:nt.key),q=C(nt,q,Ze),Bt===null?Be=nt:Bt.sibling=nt,Bt=nt);return l&&Oe.forEach(function(Xr){return o(K,Xr)}),_t&&U(K,Ze),Be}function kn(K,q,W,ce){if(typeof W=="object"&&W!==null&&W.type===xl&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case ju:e:{for(var Be=W.key;q!==null;){if(q.key===Be){if(Be=W.type,Be===xl){if(q.tag===7){f(K,q.sibling),ce=x(q,W.props.children),ce.return=K,K=ce;break e}}else if(q.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===ks&&ao(Be)===q.type){f(K,q.sibling),ce=x(q,W.props),ti(ce,W),ce.return=K,K=ce;break e}f(K,q);break}else o(K,q);q=q.sibling}W.type===xl?(ce=vl(W.props.children,K.mode,ce,W.key),ce.return=K,K=ce):(ce=zh(W.type,W.key,W.props,null,K.mode,ce),ti(ce,W),ce.return=K,K=ce)}return O(K);case Co:e:{for(Be=W.key;q!==null;){if(q.key===Be)if(q.tag===4&&q.stateNode.containerInfo===W.containerInfo&&q.stateNode.implementation===W.implementation){f(K,q.sibling),ce=x(q,W.children||[]),ce.return=K,K=ce;break e}else{f(K,q);break}else o(K,q);q=q.sibling}ce=Hh(W,K.mode,ce),ce.return=K,K=ce}return O(K);case ks:return Be=W._init,W=Be(W._payload),kn(K,q,W,ce)}if(ii(W))return ve(K,q,W,ce);if(u(W)){if(Be=u(W),typeof Be!="function")throw Error(r(150));return W=Be.call(W),Vi(K,q,W,ce)}if(typeof W.then=="function")return kn(K,q,Gi(W),ce);if(W.$$typeof===Ga)return kn(K,q,Uu(K,W),ce);Hs(K,W)}return typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint"?(W=""+W,q!==null&&q.tag===6?(f(K,q.sibling),ce=x(q,W),ce.return=K,K=ce):(f(K,q),ce=ha(W,K.mode,ce),ce.return=K,K=ce),O(K)):f(K,q)}return function(K,q,W,ce){try{Wu=0;var Be=kn(K,q,W,ce);return wo=null,Be}catch(Oe){if(Oe===ps)throw Oe;var Bt=t(29,Oe,null,K.mode);return Bt.lanes=ce,Bt.return=K,Bt}finally{}}}function ol(l,o){l=vs,w(cf,l),w(Po,o),vs=l|o.baseLanes}function mu(){w(cf,vs),w(Po,Po.current)}function Ld(){vs=cf.current,G(Po),G(cf)}function _r(l){var o=l.alternate;w(Tn,Tn.current&1),w(ri,l),ms===null&&(o===null||Po.current!==null||o.memoizedState!==null)&&(ms=l)}function jd(l){if(l.tag===22){if(w(Tn,Tn.current),w(ri,l),ms===null){var o=l.alternate;o!==null&&o.memoizedState!==null&&(ms=l)}}else Wa()}function Wa(){w(Tn,Tn.current),w(ri,ri.current)}function Ja(l){G(ri),ms===l&&(ms=null),G(Tn)}function $a(l){for(var o=l;o!==null;){if(o.tag===13){var f=o.memoizedState;if(f!==null&&(f=f.dehydrated,f===null||Xu(f)||Qh(f)))return o}else if(o.tag===19&&o.memoizedProps.revealOrder!==void 0){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break;for(;o.sibling===null;){if(o.return===null||o.return===l)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}function Qt(){throw Error(r(321))}function Vs(l,o){if(o===null)return!1;for(var f=0;f<o.length&&f<l.length;f++)if(!xi(l[f],o[f]))return!1;return!0}function jc(l,o,f,_,x,C){return Vr=C,lt=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,qe.H=l===null||l.memoizedState===null?Bl:Lr,Ul=!1,C=f(_,x),Ul=!1,zo&&(C=ro(o,f,_,x)),Yd(l),C}function Yd(l){qe.H=ys;var o=Mt!==null&&Mt.next!==null;if(Vr=0,pn=Mt=lt=null,hf=!1,Ju=0,Ho=null,o)throw Error(r(300));l===null||Dn||(l=l.dependencies,l!==null&&uh(l)&&(Dn=!0))}function ro(l,o,f,_){lt=l;var x=0;do{if(zo&&(Ho=null),Ju=0,zo=!1,25<=x)throw Error(r(301));if(x+=1,pn=Mt=null,l.updateQueue!=null){var C=l.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}qe.H=Ol,C=o(f,_)}while(zo);return C}function yu(){var l=qe.H,o=l.useState()[0];return o=typeof o.then=="function"?hn(o):o,l=l.useState()[0],(Mt!==null?Mt.memoizedState:null)!==l&&(lt.flags|=1024),o}function ul(){var l=ff!==0;return ff=0,l}function Yc(l,o,f){o.updateQueue=l.updateQueue,o.flags&=-2053,l.lanes&=~f}function lo(l){if(hf){for(l=l.memoizedState;l!==null;){var o=l.queue;o!==null&&(o.pending=null),l=l.next}hf=!1}Vr=0,pn=Mt=lt=null,zo=!1,Ju=ff=0,Ho=null}function zn(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pn===null?lt.memoizedState=pn=l:pn=pn.next=l,pn}function en(){if(Mt===null){var l=lt.alternate;l=l!==null?l.memoizedState:null}else l=Mt.next;var o=pn===null?lt.memoizedState:pn.next;if(o!==null)pn=o,Mt=l;else{if(l===null)throw lt.alternate===null?Error(r(467)):Error(r(310));Mt=l,l={memoizedState:Mt.memoizedState,baseState:Mt.baseState,baseQueue:Mt.baseQueue,queue:Mt.queue,next:null},pn===null?lt.memoizedState=pn=l:pn=pn.next=l}return pn}function hn(l){var o=Ju;return Ju+=1,Ho===null&&(Ho=[]),l=ct(Ho,l,o),o=lt,(pn===null?o.memoizedState:pn.next)===null&&(o=o.alternate,qe.H=o===null||o.memoizedState===null?Bl:Lr),l}function gu(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return hn(l);if(l.$$typeof===Ga)return Vn(l)}throw Error(r(438,String(l)))}function oo(l){var o=null,f=lt.updateQueue;if(f!==null&&(o=f.memoCache),o==null){var _=lt.alternate;_!==null&&(_=_.updateQueue,_!==null&&(_=_.memoCache,_!=null&&(o={data:_.data.map(function(x){return x.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),f===null&&(f=om(),lt.updateQueue=f),f.memoCache=o,f=o.data[o.index],f===void 0)for(f=o.data[o.index]=Array(l),_=0;_<l;_++)f[_]=Op;return o.index++,f}function Hn(l,o){return typeof o=="function"?o(l):o}function cl(l){var o=en();return hl(o,Mt,l)}function hl(l,o,f){var _=l.queue;if(_===null)throw Error(r(311));_.lastRenderedReducer=f;var x=l.baseQueue,C=_.pending;if(C!==null){if(x!==null){var O=x.next;x.next=C.next,C.next=O}o.baseQueue=x=C,_.pending=null}if(C=l.baseState,x===null)l.memoizedState=C;else{o=x.next;var H=O=null,I=null,re=o,ye=!1;do{var Ce=re.lane&-536870913;if(Ce!==re.lane?(pt&Ce)===Ce:(Vr&Ce)===Ce){var Ee=re.revertLane;if(Ee===0)I!==null&&(I=I.next={lane:0,revertLane:0,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null}),Ce===No&&(ye=!0);else if((Vr&Ee)===Ee){re=re.next,Ee===No&&(ye=!0);continue}else Ce={lane:0,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},I===null?(H=I=Ce,O=C):I=I.next=Ce,lt.lanes|=Ee,Yr|=Ee;Ce=re.action,Ul&&f(C,Ce),C=re.hasEagerState?re.eagerState:f(C,Ce)}else Ee={lane:Ce,revertLane:re.revertLane,action:re.action,hasEagerState:re.hasEagerState,eagerState:re.eagerState,next:null},I===null?(H=I=Ee,O=C):I=I.next=Ee,lt.lanes|=Ce,Yr|=Ce;re=re.next}while(re!==null&&re!==o);if(I===null?O=C:I.next=H,!xi(C,l.memoizedState)&&(Dn=!0,ye&&(f=Dl,f!==null)))throw f;l.memoizedState=C,l.baseState=O,l.baseQueue=I,_.lastRenderedState=C}return x===null&&(_.lanes=0),[l.memoizedState,_.dispatch]}function _u(l){var o=en(),f=o.queue;if(f===null)throw Error(r(311));f.lastRenderedReducer=l;var _=f.dispatch,x=f.pending,C=o.memoizedState;if(x!==null){f.pending=null;var O=x=x.next;do C=l(C,O.action),O=O.next;while(O!==x);xi(C,o.memoizedState)||(Dn=!0),o.memoizedState=C,o.baseQueue===null&&(o.baseState=C),f.lastRenderedState=C}return[C,_]}function Xc(l,o,f){var _=lt,x=en(),C=_t;if(C){if(f===void 0)throw Error(r(407));f=f()}else f=o();var O=!xi((Mt||x).memoizedState,f);if(O&&(x.memoizedState=f,Dn=!0),x=x.queue,Kc(Aa.bind(null,_,x,l),[l]),x.getSnapshot!==o||O||pn!==null&&pn.memoizedState.tag&1){if(_.flags|=2048,qi(9,Ra.bind(null,_,x,f,o),{destroy:void 0},null),zt===null)throw Error(r(349));C||(Vr&60)!==0||Xd(_,o,f)}return f}function Xd(l,o,f){l.flags|=16384,l={getSnapshot:o,value:f},o=lt.updateQueue,o===null?(o=om(),lt.updateQueue=o,o.stores=[l]):(f=o.stores,f===null?o.stores=[l]:f.push(l))}function Ra(l,o,f,_){o.value=f,o.getSnapshot=_,vu(o)&&Ma(l)}function Aa(l,o,f){return f(function(){vu(o)&&Ma(l)})}function vu(l){var o=l.getSnapshot;l=l.value;try{var f=o();return!xi(l,f)}catch{return!0}}function Ma(l){var o=Pn(l,2);o!==null&&Ln(o,l,2)}function vr(l){var o=zn();if(typeof l=="function"){var f=l;if(l=f(),Ul){ee(!0);try{f()}finally{ee(!1)}}}return o.memoizedState=o.baseState=l,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hn,lastRenderedState:l},o}function qd(l,o,f,_){return l.baseState=f,hl(l,Mt,typeof _=="function"?_:Hn)}function Iy(l,o,f,_,x){if(mo(l))throw Error(r(485));if(l=o.action,l!==null){var C={payload:x,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(O){C.listeners.push(O)}};qe.T!==null?f(!0):C.isTransition=!1,_(C),f=o.pending,f===null?(C.next=o.pending=C,Fd(o,C)):(C.next=f.next,o.pending=f.next=C)}}function Fd(l,o){var f=o.action,_=o.payload,x=l.state;if(o.isTransition){var C=qe.T,O={};qe.T=O;try{var H=f(x,_),I=qe.S;I!==null&&I(O,H),Id(l,o,H)}catch(re){Fc(l,o,re)}finally{qe.T=C}}else try{C=f(x,_),Id(l,o,C)}catch(re){Fc(l,o,re)}}function Id(l,o,f){f!==null&&typeof f=="object"&&typeof f.then=="function"?f.then(function(_){qc(l,o,_)},function(_){return Fc(l,o,_)}):qc(l,o,f)}function qc(l,o,f){o.status="fulfilled",o.value=f,Ic(o),l.state=f,o=l.pending,o!==null&&(f=o.next,f===o?l.pending=null:(f=f.next,o.next=f,Fd(l,f)))}function Fc(l,o,f){var _=l.pending;if(l.pending=null,_!==null){_=_.next;do o.status="rejected",o.reason=f,Ic(o),o=o.next;while(o!==_)}l.action=null}function Ic(l){l=l.listeners;for(var o=0;o<l.length;o++)(0,l[o])()}function ky(l,o){return o}function kd(l,o){if(_t){var f=zt.formState;if(f!==null){e:{var _=lt;if(_t){if(Sn){var x=qu(Sn,fs);if(x){Sn=Sg(x),_=ab(x);break e}}je(_)}_=!1}_&&(o=f[0])}}f=zn(),f.memoizedState=f.baseState=o,_={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ky,lastRenderedState:o},f.queue=_,f=$d.bind(null,lt,_),_.dispatch=f,_=vr(!1);var C=Eu.bind(null,lt,!1,_.queue);return _=zn(),x={state:o,dispatch:null,action:l,pending:null},_.queue=x,f=Iy.bind(null,lt,x,C,f),x.dispatch=f,_.memoizedState=l,[o,f,!1]}function Ky(l){var o=en();return kc(o,Mt,l)}function kc(l,o,f){o=hl(l,o,ky)[0],l=cl(Hn)[0],o=typeof o=="object"&&o!==null&&typeof o.then=="function"?hn(o):o;var _=en(),x=_.queue,C=x.dispatch;return f!==_.memoizedState&&(lt.flags|=2048,qi(9,Kd.bind(null,x,f),{destroy:void 0},null)),[o,C,l]}function Kd(l,o){l.action=o}function Ls(l){var o=en(),f=Mt;if(f!==null)return kc(o,f,l);en(),o=o.memoizedState,f=en();var _=f.queue.dispatch;return f.memoizedState=l,[o,_,!1]}function qi(l,o,f,_){return l={tag:l,create:o,inst:f,deps:_,next:null},o=lt.updateQueue,o===null&&(o=om(),lt.updateQueue=o),f=o.lastEffect,f===null?o.lastEffect=l.next=l:(_=f.next,f.next=l,l.next=_,o.lastEffect=l),l}function uo(){return en().memoizedState}function fl(l,o,f,_){var x=zn();lt.flags|=l,x.memoizedState=qi(1|o,f,{destroy:void 0},_===void 0?null:_)}function br(l,o,f,_){var x=en();_=_===void 0?null:_;var C=x.memoizedState.inst;Mt!==null&&_!==null&&Vs(_,Mt.memoizedState.deps)?x.memoizedState=qi(o,f,C,_):(lt.flags|=l,x.memoizedState=qi(1|o,f,C,_))}function co(l,o){fl(8390656,8,l,o)}function Kc(l,o){br(2048,8,l,o)}function Qy(l,o){return br(4,2,l,o)}function Qd(l,o){return br(4,4,l,o)}function bu(l,o){if(typeof o=="function"){l=l();var f=o(l);return function(){typeof f=="function"?f():o(null)}}if(o!=null)return l=l(),o.current=l,function(){o.current=null}}function Zd(l,o,f){f=f!=null?f.concat([l]):null,br(4,4,bu.bind(null,o,l),f)}function Qc(){}function xu(l,o){var f=en();o=o===void 0?null:o;var _=f.memoizedState;return o!==null&&Vs(o,_[1])?_[0]:(f.memoizedState=[l,o],l)}function Wd(l,o){var f=en();o=o===void 0?null:o;var _=f.memoizedState;if(o!==null&&Vs(o,_[1]))return _[0];if(_=l(),Ul){ee(!0);try{l()}finally{ee(!1)}}return f.memoizedState=[_,o],_}function Zc(l,o,f){return f===void 0||(Vr&1073741824)!==0?l.memoizedState=o:(l.memoizedState=f,l=pp(),lt.lanes|=l,Yr|=l,f)}function Jd(l,o,f,_){return xi(f,o)?f:Po.current!==null?(l=Zc(l,f,_),xi(l,o)||(Dn=!0),l):(Vr&42)===0?(Dn=!0,l.memoizedState=f):(l=pp(),lt.lanes|=l,Yr|=l,o)}function Cn(l,o,f,_,x){var C=Ws();ai(C!==0&&8>C?C:8);var O=qe.T,H={};qe.T=H,Eu(l,!1,o,f);try{var I=x(),re=qe.S;if(re!==null&&re(H,I),I!==null&&typeof I=="object"&&typeof I.then=="function"){var ye=ei(I,_);po(l,o,ye,gi(l))}else po(l,o,_,gi(l))}catch(Ce){po(l,o,{then:function(){},status:"rejected",reason:Ce},gi())}finally{ai(C),qe.T=O}}function Su(l){var o=l.memoizedState;if(o!==null)return o;o={memoizedState:Tl,baseState:Tl,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hn,lastRenderedState:Tl},next:null};var f={};return o.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Hn,lastRenderedState:f},next:null},l.memoizedState=o,l=l.alternate,l!==null&&(l.memoizedState=o),o}function ho(){return Vn(Js)}function fo(){return en().memoizedState}function Tu(){return en().memoizedState}function Wc(l){for(var o=l.return;o!==null;){switch(o.tag){case 24:case 3:var f=gi();l=fi(f);var _=di(o,l,f);_!==null&&(Ln(_,o,f),pi(_,o,f)),o={cache:hh()},l.payload=o;return}o=o.return}}function Jc(l,o,f){var _=gi();f={lane:_,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null},mo(l)?js(o,f):(f=xn(l,o,f,_),f!==null&&(Ln(f,l,_),ep(f,o,_)))}function $d(l,o,f){var _=gi();po(l,o,f,_)}function po(l,o,f,_){var x={lane:_,revertLane:0,action:f,hasEagerState:!1,eagerState:null,next:null};if(mo(l))js(o,x);else{var C=l.alternate;if(l.lanes===0&&(C===null||C.lanes===0)&&(C=o.lastRenderedReducer,C!==null))try{var O=o.lastRenderedState,H=C(O,f);if(x.hasEagerState=!0,x.eagerState=H,xi(H,O))return wn(l,o,x,0),zt===null&&$n(),!1}catch{}finally{}if(f=xn(l,o,x,_),f!==null)return Ln(f,l,_),ep(f,o,_),!0}return!1}function Eu(l,o,f,_){if(_={lane:2,revertLane:io(),action:_,hasEagerState:!1,eagerState:null,next:null},mo(l)){if(o)throw Error(r(479))}else o=xn(l,f,_,2),o!==null&&Ln(o,l,2)}function mo(l){var o=l.alternate;return l===lt||o!==null&&o===lt}function js(l,o){zo=hf=!0;var f=l.pending;f===null?o.next=o:(o.next=f.next,f.next=o),l.pending=o}function ep(l,o,f){if((f&4194176)!==0){var _=o.lanes;_&=l.pendingLanes,f|=_,o.lanes=f,We(l,f)}}function es(l,o,f,_){o=l.memoizedState,f=f(_,o),f=f==null?o:Is({},o,f),l.memoizedState=f,l.lanes===0&&(l.updateQueue.baseState=f)}function ts(l,o,f,_,x,C,O){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(_,C,O):o.prototype&&o.prototype.isPureReactComponent?!Ue(f,_)||!Ue(x,C):!0}function Cu(l,o,f,_){l=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(f,_),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(f,_),o.state!==l&&um.enqueueReplaceState(o,o.state,null)}function ke(l,o){var f=o;if("ref"in o){f={};for(var _ in o)_!=="ref"&&(f[_]=o[_])}if(l=l.defaultProps){f===o&&(f=Is({},f));for(var x in l)f[x]===void 0&&(f[x]=l[x])}return f}function ue(l,o){try{var f=l.onUncaughtError;f(o.value,{componentStack:o.stack})}catch(_){setTimeout(function(){throw _})}}function dl(l,o,f){try{var _=l.onCaughtError;_(f.value,{componentStack:f.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function yo(l,o,f){return f=fi(f),f.tag=3,f.payload={element:null},f.callback=function(){ue(l,o)},f}function tn(l){return l=fi(l),l.tag=3,l}function $c(l,o,f,_){var x=f.type.getDerivedStateFromError;if(typeof x=="function"){var C=_.value;l.payload=function(){return x(C)},l.callback=function(){dl(o,f,_)}}var O=f.stateNode;O!==null&&typeof O.componentDidCatch=="function"&&(l.callback=function(){dl(o,f,_),typeof x!="function"&&(bs===null?bs=new Set([this]):bs.add(this));var H=_.stack;this.componentDidCatch(_.value,{componentStack:H!==null?H:""})})}function tp(l,o,f,_,x){if(f.flags|=32768,_!==null&&typeof _=="object"&&typeof _.then=="function"){if(o=f.alternate,o!==null&&_o(o,f,x,!0),f=ri.current,f!==null){switch(f.tag){case 13:return ms===null?Na():f.alternate===null&&Wt===0&&(Wt=3),f.flags&=-257,f.flags|=65536,f.lanes=x,_===uf?f.flags|=16384:(o=f.updateQueue,o===null?f.updateQueue=new Set([_]):o.add(_),Ph(l,_,x)),!1;case 22:return f.flags|=65536,_===uf?f.flags|=16384:(o=f.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([_])},f.updateQueue=o):(f=o.retryQueue,f===null?o.retryQueue=new Set([_]):f.add(_)),Ph(l,_,x)),!1}throw Error(r(435,f.tag))}return Ph(l,_,x),Na(),!1}if(_t)return o=ri.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=x,_!==Qu&&(l=Error(r(422),{cause:_}),Jn(pe(l,f)))):(_!==Qu&&(o=Error(r(423),{cause:_}),Jn(pe(o,f))),l=l.current.alternate,l.flags|=65536,x&=-x,l.lanes|=x,_=pe(_,f),x=yo(l.stateNode,_,x),Xi(l,x),Wt!==4&&(Wt=2)),!1;var C=Error(r(520),{cause:_});if(C=pe(C,f),yn===null?yn=[C]:yn.push(C),Wt!==4&&(Wt=2),o===null)return!0;_=pe(_,f),f=o;do{switch(f.tag){case 3:return f.flags|=65536,l=x&-x,f.lanes|=l,l=yo(f.stateNode,_,l),Xi(f,l),!1;case 1:if(o=f.type,C=f.stateNode,(f.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(bs===null||!bs.has(C))))return f.flags|=65536,x&=-x,f.lanes|=x,x=tn(x),$c(x,l,f,_),Xi(f,x),!1}f=f.return}while(f!==null);return!1}function Rn(l,o,f,_){o.child=l===null?Gg(o,null,f,_):ya(o,l.child,f,_)}function eh(l,o,f,_,x){f=f.render;var C=o.ref;if("ref"in _){var O={};for(var H in _)H!=="ref"&&(O[H]=_[H])}else O=_;return Sr(o),_=jc(l,o,f,O,C,x),H=ul(),l!==null&&!Dn?(Yc(l,o,x),ns(l,o,x)):(_t&&H&&oe(o),o.flags|=1,Rn(l,o,_,x),o.child)}function Zy(l,o,f,_,x){if(l===null){var C=f.type;return typeof C=="function"&&!To(C)&&C.defaultProps===void 0&&f.compare===null?(o.tag=15,o.type=C,th(l,o,C,_,x)):(l=zh(f.type,null,_,o,o.mode,x),l.ref=o.ref,l.return=o,o.child=l)}if(C=l.child,!sh(l,x)){var O=C.memoizedProps;if(f=f.compare,f=f!==null?f:Ue,f(O,_)&&l.ref===o.ref)return ns(l,o,x)}return o.flags|=1,l=ca(C,_),l.ref=o.ref,l.return=o,o.child=l}function th(l,o,f,_,x){if(l!==null){var C=l.memoizedProps;if(Ue(C,_)&&l.ref===o.ref)if(Dn=!1,o.pendingProps=_=C,sh(l,x))(l.flags&131072)!==0&&(Dn=!0);else return o.lanes=l.lanes,ns(l,o,x)}return Tt(l,o,f,_,x)}function nh(l,o,f){var _=o.pendingProps,x=_.children,C=(o.stateNode._pendingVisibility&2)!==0,O=l!==null?l.memoizedState:null;if(An(l,o),_.mode==="hidden"||C){if((o.flags&128)!==0){if(_=O!==null?O.baseLanes|f:f,l!==null){for(x=o.child=l.child,C=0;x!==null;)C=C|x.lanes|x.childLanes,x=x.sibling;o.childLanes=C&~_}else o.childLanes=0,o.child=null;return ih(l,o,_,f)}if((f&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},l!==null&&yl(o,O!==null?O.cachePool:null),O!==null?ol(o,O):mu(),jd(o);else return o.lanes=o.childLanes=536870912,ih(l,o,O!==null?O.baseLanes|f:f,f)}else O!==null?(yl(o,O.cachePool),ol(o,O),Wa(),o.memoizedState=null):(l!==null&&yl(o,null),mu(),Wa());return Rn(l,o,x,f),o.child}function ih(l,o,f,_){var x=Tr();return x=x===null?null:{parent:cs?an._currentValue:an._currentValue2,pool:x},o.memoizedState={baseLanes:f,cachePool:x},l!==null&&yl(o,null),mu(),jd(o),l!==null&&_o(l,o,_,!0),null}function An(l,o){var f=o.ref;if(f===null)l!==null&&l.ref!==null&&(o.flags|=2097664);else{if(typeof f!="function"&&typeof f!="object")throw Error(r(284));(l===null||l.ref!==f)&&(o.flags|=2097664)}}function Tt(l,o,f,_,x){return Sr(o),f=jc(l,o,f,_,void 0,x),_=ul(),l!==null&&!Dn?(Yc(l,o,x),ns(l,o,x)):(_t&&_&&oe(o),o.flags|=1,Rn(l,o,f,x),o.child)}function go(l,o,f,_,x,C){return Sr(o),o.updateQueue=null,f=ro(o,_,f,x),Yd(l),_=ul(),l!==null&&!Dn?(Yc(l,o,C),ns(l,o,C)):(_t&&_&&oe(o),o.flags|=1,Rn(l,o,f,C),o.child)}function Ys(l,o,f,_,x){if(Sr(o),o.stateNode===null){var C=Pr,O=f.contextType;typeof O=="object"&&O!==null&&(C=Vn(O)),C=new f(_,C),o.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=um,o.stateNode=C,C._reactInternals=o,C=o.stateNode,C.props=_,C.state=o.memoizedState,C.refs={},la(o),O=f.contextType,C.context=typeof O=="object"&&O!==null?Vn(O):Pr,C.state=o.memoizedState,O=f.getDerivedStateFromProps,typeof O=="function"&&(es(o,f,O,_),C.state=o.memoizedState),typeof f.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(O=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),O!==C.state&&um.enqueueReplaceState(C,C.state,null),F(o,_,C,x),D(),C.state=o.memoizedState),typeof C.componentDidMount=="function"&&(o.flags|=4194308),_=!0}else if(l===null){C=o.stateNode;var H=o.memoizedProps,I=ke(f,H);C.props=I;var re=C.context,ye=f.contextType;O=Pr,typeof ye=="object"&&ye!==null&&(O=Vn(ye));var Ce=f.getDerivedStateFromProps;ye=typeof Ce=="function"||typeof C.getSnapshotBeforeUpdate=="function",H=o.pendingProps!==H,ye||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(H||re!==O)&&Cu(o,C,_,O),Hr=!1;var Ee=o.memoizedState;C.state=Ee,F(o,_,C,x),D(),re=o.memoizedState,H||Ee!==re||Hr?(typeof Ce=="function"&&(es(o,f,Ce,_),re=o.memoizedState),(I=Hr||ts(o,f,I,_,Ee,re,O))?(ye||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=_,o.memoizedState=re),C.props=_,C.state=re,C.context=O,_=I):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),_=!1)}else{C=o.stateNode,zs(l,o),O=o.memoizedProps,ye=ke(f,O),C.props=ye,Ce=o.pendingProps,Ee=C.context,re=f.contextType,I=Pr,typeof re=="object"&&re!==null&&(I=Vn(re)),H=f.getDerivedStateFromProps,(re=typeof H=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(O!==Ce||Ee!==I)&&Cu(o,C,_,I),Hr=!1,Ee=o.memoizedState,C.state=Ee,F(o,_,C,x),D();var Ne=o.memoizedState;O!==Ce||Ee!==Ne||Hr||l!==null&&l.dependencies!==null&&uh(l.dependencies)?(typeof H=="function"&&(es(o,f,H,_),Ne=o.memoizedState),(ye=Hr||ts(o,f,ye,_,Ee,Ne,I)||l!==null&&l.dependencies!==null&&uh(l.dependencies))?(re||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(_,Ne,I),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(_,Ne,I)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||O===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=1024),o.memoizedProps=_,o.memoizedState=Ne),C.props=_,C.state=Ne,C.context=I,_=ye):(typeof C.componentDidUpdate!="function"||O===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||O===l.memoizedProps&&Ee===l.memoizedState||(o.flags|=1024),_=!1)}return C=_,An(l,o),_=(o.flags&128)!==0,C||_?(C=o.stateNode,f=_&&typeof f.getDerivedStateFromError!="function"?null:C.render(),o.flags|=1,l!==null&&_?(o.child=ya(o,l.child,null,x),o.child=ya(o,null,f,x)):Rn(l,o,f,x),o.memoizedState=C.state,l=o.child):l=ns(l,o,x),l}function xr(l,o,f,_){return cn(),o.flags|=256,Rn(l,o,f,_),o.child}function Fi(l){return{baseLanes:l,cachePool:ip()}}function Ru(l,o,f){return l=l!==null?l.childLanes&~f:0,o&&(l|=ea),l}function pl(l,o,f){var _=o.pendingProps,x=!1,C=(o.flags&128)!==0,O;if((O=C)||(O=l!==null&&l.memoizedState===null?!1:(Tn.current&2)!==0),O&&(x=!0,o.flags&=-129),O=(o.flags&32)!==0,o.flags&=-33,l===null){if(_t){if(x?_r(o):Wa(),_t){var H=Sn,I;(I=H)&&(H=sb(H,fs),H!==null?(o.memoizedState={dehydrated:H,treeContext:ma!==null?{id:er,overflow:tr}:null,retryLane:536870912},I=t(18,null,null,0),I.stateNode=H,I.return=o,o.child=I,si=o,Sn=null,I=!0):I=!1),I||je(o)}if(H=o.memoizedState,H!==null&&(H=H.dehydrated,H!==null))return Qh(H)?o.lanes=16:o.lanes=536870912,null;Ja(o)}return H=_.children,_=_.fallback,x?(Wa(),x=o.mode,H=ml({mode:"hidden",children:H},x),_=vl(_,x,f,null),H.return=o,_.return=o,H.sibling=_,o.child=H,x=o.child,x.memoizedState=Fi(f),x.childLanes=Ru(l,O,f),o.memoizedState=df,_):(_r(o),Au(o,H))}if(I=l.memoizedState,I!==null&&(H=I.dehydrated,H!==null)){if(C)o.flags&256?(_r(o),o.flags&=-257,o=Mu(l,o,f)):o.memoizedState!==null?(Wa(),o.child=l.child,o.flags|=128,o=null):(Wa(),x=_.fallback,H=o.mode,_=ml({mode:"visible",children:_.children},H),x=vl(x,H,f,null),x.flags|=2,_.return=o,x.return=o,_.sibling=x,o.child=_,ya(o,l.child,null,f),_=o.child,_.memoizedState=Fi(f),_.childLanes=Ru(l,O,f),o.memoizedState=df,o=x);else if(_r(o),Qh(H))O=bg(H).digest,_=Error(r(419)),_.stack="",_.digest=O,Jn({value:_,source:null,stack:null}),o=Mu(l,o,f);else if(Dn||_o(l,o,f,!1),O=(f&l.childLanes)!==0,Dn||O){if(O=zt,O!==null){if(_=f&-f,(_&42)!==0)_=1;else switch(_){case 2:_=1;break;case 8:_=4;break;case 32:_=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:_=64;break;case 268435456:_=134217728;break;default:_=0}if(_=(_&(O.suspendedLanes|f))!==0?0:_,_!==0&&_!==I.retryLane)throw I.retryLane=_,Pn(l,_),Ln(O,l,_),hm}Xu(H)||Na(),o=Mu(l,o,f)}else Xu(H)?(o.flags|=128,o.child=l.child,o=ng.bind(null,l),xg(H,o),o=null):(l=I.treeContext,vi&&(Sn=Tg(H),si=o,_t=!0,za=null,fs=!1,l!==null&&(pa[Ji++]=er,pa[Ji++]=tr,pa[Ji++]=ma,er=l.id,tr=l.overflow,ma=o)),o=Au(o,_.children),o.flags|=4096);return o}return x?(Wa(),x=_.fallback,H=o.mode,I=l.child,C=I.sibling,_=ca(I,{mode:"hidden",children:_.children}),_.subtreeFlags=I.subtreeFlags&31457280,C!==null?x=ca(C,x):(x=vl(x,H,f,null),x.flags|=2),x.return=o,_.return=o,_.sibling=x,o.child=_,_=x,x=o.child,H=l.child.memoizedState,H===null?H=Fi(f):(I=H.cachePool,I!==null?(C=cs?an._currentValue:an._currentValue2,I=I.parent!==C?{parent:C,pool:C}:I):I=ip(),H={baseLanes:H.baseLanes|f,cachePool:I}),x.memoizedState=H,x.childLanes=Ru(l,O,f),o.memoizedState=df,_):(_r(o),f=l.child,l=f.sibling,f=ca(f,{mode:"visible",children:_.children}),f.return=o,f.sibling=null,l!==null&&(O=o.deletions,O===null?(o.deletions=[l],o.flags|=16):O.push(l)),o.child=f,o.memoizedState=null,f)}function Au(l,o){return o=ml({mode:"visible",children:o},l.mode),o.return=l,l.child=o}function ml(l,o){return Tp(l,o,0,null)}function Mu(l,o,f){return ya(o,l.child,null,f),l=Au(o,o.pendingProps.children),l.flags|=2,o.memoizedState=null,l}function Du(l,o,f){l.lanes|=o;var _=l.alternate;_!==null&&(_.lanes|=o),lh(l.return,o,f)}function ah(l,o,f,_,x){var C=l.memoizedState;C===null?l.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:_,tail:f,tailMode:x}:(C.isBackwards=o,C.rendering=null,C.renderingStartTime=0,C.last=_,C.tail=f,C.tailMode=x)}function np(l,o,f){var _=o.pendingProps,x=_.revealOrder,C=_.tail;if(Rn(l,o,_.children,f),_=Tn.current,(_&2)!==0)_=_&1|2,o.flags|=128;else{if(l!==null&&(l.flags&128)!==0)e:for(l=o.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Du(l,f,o);else if(l.tag===19)Du(l,f,o);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===o)break e;for(;l.sibling===null;){if(l.return===null||l.return===o)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}_&=1}switch(w(Tn,_),x){case"forwards":for(f=o.child,x=null;f!==null;)l=f.alternate,l!==null&&$a(l)===null&&(x=f),f=f.sibling;f=x,f===null?(x=o.child,o.child=null):(x=f.sibling,f.sibling=null),ah(o,!1,x,f,C);break;case"backwards":for(f=null,x=o.child,o.child=null;x!==null;){if(l=x.alternate,l!==null&&$a(l)===null){o.child=x;break}l=x.sibling,x.sibling=f,f=x,x=l}ah(o,!0,f,null,C);break;case"together":ah(o,!1,null,null,void 0);break;default:o.memoizedState=null}return o.child}function ns(l,o,f){if(l!==null&&(o.dependencies=l.dependencies),Yr|=o.lanes,(f&o.childLanes)===0)if(l!==null){if(_o(l,o,f,!1),(f&o.childLanes)===0)return null}else return null;if(l!==null&&o.child!==l.child)throw Error(r(153));if(o.child!==null){for(l=o.child,f=ca(l,l.pendingProps),o.child=f,f.return=o;l.sibling!==null;)l=l.sibling,f=f.sibling=ca(l,l.pendingProps),f.return=o;f.sibling=null}return o.child}function sh(l,o){return(l.lanes&o)!==0?!0:(l=l.dependencies,!!(l!==null&&uh(l)))}function Wy(l,o,f){switch(o.tag){case 3:Ae(o,o.stateNode.containerInfo),is(o,an,l.memoizedState.cache),cn();break;case 27:case 5:ze(o);break;case 4:Ae(o,o.stateNode.containerInfo);break;case 10:is(o,o.type,o.memoizedProps.value);break;case 13:var _=o.memoizedState;if(_!==null)return _.dehydrated!==null?(_r(o),o.flags|=128,null):(f&o.child.childLanes)!==0?pl(l,o,f):(_r(o),l=ns(l,o,f),l!==null?l.sibling:null);_r(o);break;case 19:var x=(l.flags&128)!==0;if(_=(f&o.childLanes)!==0,_||(_o(l,o,f,!1),_=(f&o.childLanes)!==0),x){if(_)return np(l,o,f);o.flags|=128}if(x=o.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),w(Tn,Tn.current),_)break;return null;case 22:case 23:return o.lanes=0,nh(l,o,f);case 24:is(o,an,l.memoizedState.cache)}return ns(l,o,f)}function rh(l,o,f){if(l!==null)if(l.memoizedProps!==o.pendingProps)Dn=!0;else{if(!sh(l,f)&&(o.flags&128)===0)return Dn=!1,Wy(l,o,f);Dn=(l.flags&131072)!==0}else Dn=!1,_t&&(o.flags&1048576)!==0&&k(o,lf,o.index);switch(o.lanes=0,o.tag){case 16:e:{l=o.pendingProps;var _=o.elementType,x=_._init;if(_=x(_._payload),o.type=_,typeof _=="function")To(_)?(l=ke(_,l),o.tag=1,o=Ys(null,o,_,l,f)):(o.tag=0,o=Tt(null,o,_,l,f));else{if(_!=null){if(x=_.$$typeof,x===Up){o.tag=11,o=eh(null,o,_,l,f);break e}else if(x===Xh){o.tag=14,o=Zy(null,o,_,l,f);break e}}throw o=h(_)||_,Error(r(306,o,""))}}return o;case 0:return Tt(l,o,o.type,o.pendingProps,f);case 1:return _=o.type,x=ke(_,o.pendingProps),Ys(l,o,_,x,f);case 3:e:{if(Ae(o,o.stateNode.containerInfo),l===null)throw Error(r(387));var C=o.pendingProps;x=o.memoizedState,_=x.element,zs(l,o),F(o,C,null,f);var O=o.memoizedState;if(C=O.cache,is(o,an,C),C!==x.cache&&oh(o,[an],f,!0),D(),C=O.element,vi&&x.isDehydrated)if(x={element:C,isDehydrated:!1,cache:O.cache},o.updateQueue.baseState=x,o.memoizedState=x,o.flags&256){o=xr(l,o,C,f);break e}else if(C!==_){_=pe(Error(r(424)),o),Jn(_),o=xr(l,o,C,f);break e}else for(vi&&(Sn=Qp(o.stateNode.containerInfo),si=o,_t=!0,za=null,fs=!0),f=Gg(o,null,C,f),o.child=f;f;)f.flags=f.flags&-3|4096,f=f.sibling;else{if(cn(),C===_){o=ns(l,o,f);break e}Rn(l,o,C,f)}o=o.child}return o;case 26:if(Zi)return An(l,o),l===null?(f=tm(o.type,null,o.pendingProps,null))?o.memoizedState=f:_t||(o.stateNode=ob(o.type,o.pendingProps,zr.current,o)):o.memoizedState=tm(o.type,l.memoizedProps,o.pendingProps,l.memoizedState),null;case 27:if(nn)return ze(o),l===null&&nn&&_t&&(_=o.stateNode=Rl(o.type,o.pendingProps,zr.current,qn.current,!1),si=o,fs=!0,Sn=Gr(_)),_=o.pendingProps.children,l!==null||_t?Rn(l,o,_,f):o.child=ya(o,null,_,f),An(l,o),o.child;case 5:return l===null&&_t&&(rb(o.type,o.pendingProps,qn.current),(x=_=Sn)&&(_=Eg(_,o.type,o.pendingProps,fs),_!==null?(o.stateNode=_,si=o,Sn=Gr(_),fs=!1,x=!0):x=!1),x||je(o)),ze(o),x=o.type,C=o.pendingProps,O=l!==null?l.memoizedProps:null,_=C.children,Qs(x,C)?_=null:O!==null&&Qs(x,O)&&(o.flags|=32),o.memoizedState!==null&&(x=jc(l,o,yu,null,null,f),cs?Js._currentValue=x:Js._currentValue2=x),An(l,o),Rn(l,o,_,f),o.child;case 6:return l===null&&_t&&(Ag(o.pendingProps,qn.current),(l=f=Sn)&&(f=Zp(f,o.pendingProps,fs),f!==null?(o.stateNode=f,si=o,Sn=null,l=!0):l=!1),l||je(o)),null;case 13:return pl(l,o,f);case 4:return Ae(o,o.stateNode.containerInfo),_=o.pendingProps,l===null?o.child=ya(o,null,_,f):Rn(l,o,_,f),o.child;case 11:return eh(l,o,o.type,o.pendingProps,f);case 7:return Rn(l,o,o.pendingProps,f),o.child;case 8:return Rn(l,o,o.pendingProps.children,f),o.child;case 12:return Rn(l,o,o.pendingProps.children,f),o.child;case 10:return _=o.pendingProps,is(o,o.type,_.value),Rn(l,o,_.children,f),o.child;case 9:return x=o.type._context,_=o.pendingProps.children,Sr(o),x=Vn(x),_=_(x),o.flags|=1,Rn(l,o,_,f),o.child;case 14:return Zy(l,o,o.type,o.pendingProps,f);case 15:return th(l,o,o.type,o.pendingProps,f);case 19:return np(l,o,f);case 22:return nh(l,o,f);case 24:return Sr(o),_=Vn(an),l===null?(x=Tr(),x===null&&(x=zt,C=hh(),x.pooledCache=C,C.refCount++,C!==null&&(x.pooledCacheLanes|=f),x=C),o.memoizedState={parent:_,cache:x},la(o),is(o,an,x)):((l.lanes&f)!==0&&(zs(l,o),F(o,null,null,f),D()),x=l.memoizedState,C=o.memoizedState,x.parent!==_?(x={parent:_,cache:_},o.memoizedState=x,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=x),is(o,an,_)):(_=C.cache,is(o,an,_),_!==x.cache&&oh(o,[an],f,!0))),Rn(l,o,o.pendingProps.children,f),o.child;case 29:throw o.pendingProps}throw Error(r(156,o.tag))}function is(l,o,f){cs?(w($u,o._currentValue),o._currentValue=f):(w($u,o._currentValue2),o._currentValue2=f)}function Da(l){var o=$u.current;cs?l._currentValue=o:l._currentValue2=o,G($u)}function lh(l,o,f){for(;l!==null;){var _=l.alternate;if((l.childLanes&o)!==o?(l.childLanes|=o,_!==null&&(_.childLanes|=o)):_!==null&&(_.childLanes&o)!==o&&(_.childLanes|=o),l===f)break;l=l.return}}function oh(l,o,f,_){var x=l.child;for(x!==null&&(x.return=l);x!==null;){var C=x.dependencies;if(C!==null){var O=x.child;C=C.firstContext;e:for(;C!==null;){var H=C;C=x;for(var I=0;I<o.length;I++)if(H.context===o[I]){C.lanes|=f,H=C.alternate,H!==null&&(H.lanes|=f),lh(C.return,f,l),_||(O=null);break e}C=H.next}}else if(x.tag===18){if(O=x.return,O===null)throw Error(r(341));O.lanes|=f,C=O.alternate,C!==null&&(C.lanes|=f),lh(O,f,l),O=null}else O=x.child;if(O!==null)O.return=x;else for(O=x;O!==null;){if(O===l){O=null;break}if(x=O.sibling,x!==null){x.return=O.return,O=x;break}O=O.return}x=O}}function _o(l,o,f,_){l=null;for(var x=o,C=!1;x!==null;){if(!C){if((x.flags&524288)!==0)C=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var O=x.alternate;if(O===null)throw Error(r(387));if(O=O.memoizedProps,O!==null){var H=x.type;xi(x.pendingProps.value,O.value)||(l!==null?l.push(H):l=[H])}}else if(x===Bo.current){if(O=x.alternate,O===null)throw Error(r(387));O.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(l!==null?l.push(Js):l=[Js])}x=x.return}l!==null&&oh(o,l,f,_),o.flags|=262144}function uh(l){for(l=l.firstContext;l!==null;){var o=l.context;if(!xi(cs?o._currentValue:o._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function Sr(l){jr=l,Ha=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Vn(l){return ch(jr,l)}function Uu(l,o){return jr===null&&Sr(l),ch(l,o)}function ch(l,o){var f=cs?o._currentValue:o._currentValue2;if(o={context:o,memoizedValue:f,next:null},Ha===null){if(l===null)throw Error(r(308));Ha=o,l.dependencies={lanes:0,firstContext:o},l.flags|=524288}else Ha=Ha.next=o;return f}function hh(){return{controller:new fm,data:new Map,refCount:0}}function vo(l){l.refCount--,l.refCount===0&&hb(fb,function(){l.controller.abort()})}function Tr(){var l=ar.current;return l!==null?l:zt.pooledCache}function yl(l,o){o===null?w(ar,ar.current):w(ar,o.pool)}function ip(){var l=Tr();return l===null?null:{parent:cs?an._currentValue:an._currentValue2,pool:l}}function Ii(l){l.flags|=4}function Bu(l,o){if(l!==null&&l.child===o.child)return!1;if((o.flags&16)!==0)return!0;for(l=o.child;l!==null;){if((l.flags&13878)!==0||(l.subtreeFlags&13878)!==0)return!0;l=l.sibling}return!1}function Er(l,o,f,_){if(fn)for(f=o.child;f!==null;){if(f.tag===5||f.tag===6)us(l,f.stateNode);else if(!(f.tag===4||nn&&f.tag===27)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===o)break;for(;f.sibling===null;){if(f.return===null||f.return===o)return;f=f.return}f.sibling.return=f.return,f=f.sibling}else if(Zs)for(var x=o.child;x!==null;){if(x.tag===5){var C=x.stateNode;f&&_&&(C=_g(C,x.type,x.memoizedProps)),us(l,C)}else if(x.tag===6)C=x.stateNode,f&&_&&(C=vg(C,x.memoizedProps)),us(l,C);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)C=x.child,C!==null&&(C.return=x),Er(l,x,!0,!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===o)break;for(;x.sibling===null;){if(x.return===null||x.return===o)return;x=x.return}x.sibling.return=x.return,x=x.sibling}}function fh(l,o,f,_){if(Zs)for(var x=o.child;x!==null;){if(x.tag===5){var C=x.stateNode;f&&_&&(C=_g(C,x.type,x.memoizedProps)),Kh(l,C)}else if(x.tag===6)C=x.stateNode,f&&_&&(C=vg(C,x.memoizedProps)),Kh(l,C);else if(x.tag!==4){if(x.tag===22&&x.memoizedState!==null)C=x.child,C!==null&&(C.return=x),fh(l,x,!(x.memoizedProps!==null&&x.memoizedProps.mode==="manual"),!0);else if(x.child!==null){x.child.return=x,x=x.child;continue}}if(x===o)break;for(;x.sibling===null;){if(x.return===null||x.return===o)return;x=x.return}x.sibling.return=x.return,x=x.sibling}}function Cr(l,o){if(Zs&&Bu(l,o)){l=o.stateNode;var f=l.containerInfo,_=Et();fh(_,o,!1,!1),l.pendingChildren=_,Ii(o),ib(f,_)}}function ni(l,o,f,_){if(fn)l.memoizedProps!==_&&Ii(o);else if(Zs){var x=l.stateNode,C=l.memoizedProps;if((l=Bu(l,o))||C!==_){var O=qn.current;C=gg(x,f,C,_,!l,null),C===x?o.stateNode=x:(zp(C,f,_,O)&&Ii(o),o.stateNode=C,l?Er(C,o,!1,!1):Ii(o))}else o.stateNode=x}}function bo(l,o,f){if(Z0(o,f)){if(l.flags|=16777216,!jp(o,f))if(Oh())l.flags|=8192;else throw Go=uf,ir}else l.flags&=-16777217}function dh(l,o){if(jn(o)){if(l.flags|=16777216,!Dg(o))if(Oh())l.flags|=8192;else throw Go=uf,ir}else l.flags&=-16777217}function Ou(l,o){o!==null&&(l.flags|=4),l.flags&16384&&(o=l.tag!==22?_e():536870912,l.lanes|=o,Lo|=o)}function gl(l,o){if(!_t)switch(l.tailMode){case"hidden":o=l.tail;for(var f=null;o!==null;)o.alternate!==null&&(f=o),o=o.sibling;f===null?l.tail=null:f.sibling=null;break;case"collapsed":f=l.tail;for(var _=null;f!==null;)f.alternate!==null&&(_=f),f=f.sibling;_===null?o||l.tail===null?l.tail=null:l.tail.sibling=null:_.sibling=null}}function Pt(l){var o=l.alternate!==null&&l.alternate.child===l.child,f=0,_=0;if(o)for(var x=l.child;x!==null;)f|=x.lanes|x.childLanes,_|=x.subtreeFlags&31457280,_|=x.flags&31457280,x.return=l,x=x.sibling;else for(x=l.child;x!==null;)f|=x.lanes|x.childLanes,_|=x.subtreeFlags,_|=x.flags,x.return=l,x=x.sibling;return l.subtreeFlags|=_,l.childLanes=f,o}function ap(l,o,f){var _=o.pendingProps;switch(be(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pt(o),null;case 1:return Pt(o),null;case 3:return f=o.stateNode,_=null,l!==null&&(_=l.memoizedState.cache),o.memoizedState.cache!==_&&(o.flags|=2048),Da(an),De(),f.pendingContext&&(f.context=f.pendingContext,f.pendingContext=null),(l===null||l.child===null)&&(Wn(o)?Ii(o):l===null||l.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,za!==null&&(wu(za),za=null))),Cr(l,o),Pt(o),null;case 26:if(Zi){f=o.type;var x=o.memoizedState;return l===null?(Ii(o),x!==null?(Pt(o),dh(o,x)):(Pt(o),bo(o,f,_))):x?x!==l.memoizedState?(Ii(o),Pt(o),dh(o,x)):(Pt(o),o.flags&=-16777217):(fn?l.memoizedProps!==_&&Ii(o):ni(l,o,f,_),Pt(o),bo(o,f,_)),null}case 27:if(nn){if(wt(o),f=zr.current,x=o.type,l!==null&&o.stateNode!=null)fn?l.memoizedProps!==_&&Ii(o):ni(l,o,x,_);else{if(!_){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}l=qn.current,Wn(o)?$t(o,l):(l=Rl(x,_,f,l,!0),o.stateNode=l,Ii(o))}return Pt(o),null}case 5:if(wt(o),f=o.type,l!==null&&o.stateNode!=null)ni(l,o,f,_);else{if(!_){if(o.stateNode===null)throw Error(r(166));return Pt(o),null}l=qn.current,Wn(o)?$t(o,l):(x=Pp(f,_,zr.current,l,o),Er(x,o,!1,!1),o.stateNode=x,zp(x,f,_,l)&&Ii(o))}return Pt(o),bo(o,o.type,o.pendingProps),null;case 6:if(l&&o.stateNode!=null)f=l.memoizedProps,fn?f!==_&&Ii(o):Zs&&(f!==_?(o.stateNode=Hp(_,zr.current,qn.current,o),Ii(o)):o.stateNode=l.stateNode);else{if(typeof _!="string"&&o.stateNode===null)throw Error(r(166));if(l=zr.current,f=qn.current,Wn(o)){if(!vi)throw Error(r(176));if(l=o.stateNode,f=o.memoizedProps,_=null,x=si,x!==null)switch(x.tag){case 27:case 5:_=x.memoizedProps}wr(l,f,o,_)||je(o)}else o.stateNode=Hp(_,l,f,o)}return Pt(o),null;case 13:if(_=o.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(x=Wn(o),_!==null&&_.dehydrated!==null){if(l===null){if(!x)throw Error(r(318));if(!vi)throw Error(r(344));if(x=o.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));Cg(x,o)}else cn(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Pt(o),x=!1}else za!==null&&(wu(za),za=null),x=!0;if(!x)return o.flags&256?(Ja(o),o):(Ja(o),null)}if(Ja(o),(o.flags&128)!==0)return o.lanes=f,o;if(f=_!==null,l=l!==null&&l.memoizedState!==null,f){_=o.child,x=null,_.alternate!==null&&_.alternate.memoizedState!==null&&_.alternate.memoizedState.cachePool!==null&&(x=_.alternate.memoizedState.cachePool.pool);var C=null;_.memoizedState!==null&&_.memoizedState.cachePool!==null&&(C=_.memoizedState.cachePool.pool),C!==x&&(_.flags|=2048)}return f!==l&&f&&(o.child.flags|=8192),Ou(o,o.updateQueue),Pt(o),null;case 4:return De(),Cr(l,o),l===null&&lg(o.stateNode.containerInfo),Pt(o),null;case 10:return Da(o.type),Pt(o),null;case 19:if(G(Tn),x=o.memoizedState,x===null)return Pt(o),null;if(_=(o.flags&128)!==0,C=x.rendering,C===null)if(_)gl(x,!1);else{if(Wt!==0||l!==null&&(l.flags&128)!==0)for(l=o.child;l!==null;){if(C=$a(l),C!==null){for(o.flags|=128,gl(x,!1),l=C.updateQueue,o.updateQueue=l,Ou(o,l),o.subtreeFlags=0,l=f,f=o.child;f!==null;)jt(f,l),f=f.sibling;return w(Tn,Tn.current&1|2),o.child}l=l.sibling}x.tail!==null&&da()>nc&&(o.flags|=128,_=!0,gl(x,!1),o.lanes=4194304)}else{if(!_)if(l=$a(C),l!==null){if(o.flags|=128,_=!0,l=l.updateQueue,o.updateQueue=l,Ou(o,l),gl(x,!0),x.tail===null&&x.tailMode==="hidden"&&!C.alternate&&!_t)return Pt(o),null}else 2*da()-x.renderingStartTime>nc&&f!==536870912&&(o.flags|=128,_=!0,gl(x,!1),o.lanes=4194304);x.isBackwards?(C.sibling=o.child,o.child=C):(l=x.last,l!==null?l.sibling=C:o.child=C,x.last=C)}return x.tail!==null?(o=x.tail,x.rendering=o,x.tail=o.sibling,x.renderingStartTime=da(),o.sibling=null,l=Tn.current,w(Tn,_?l&1|2:l&1),o):(Pt(o),null);case 22:case 23:return Ja(o),Ld(),_=o.memoizedState!==null,l!==null?l.memoizedState!==null!==_&&(o.flags|=8192):_&&(o.flags|=8192),_?(f&536870912)!==0&&(o.flags&128)===0&&(Pt(o),o.subtreeFlags&6&&(o.flags|=8192)):Pt(o),f=o.updateQueue,f!==null&&Ou(o,f.retryQueue),f=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),_=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(_=o.memoizedState.cachePool.pool),_!==f&&(o.flags|=2048),l!==null&&G(ar),null;case 24:return f=null,l!==null&&(f=l.memoizedState.cache),o.memoizedState.cache!==f&&(o.flags|=2048),Da(an),Pt(o),null;case 25:return null}throw Error(r(156,o.tag))}function ph(l,o){switch(be(o),o.tag){case 1:return l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 3:return Da(an),De(),l=o.flags,(l&65536)!==0&&(l&128)===0?(o.flags=l&-65537|128,o):null;case 26:case 27:case 5:return wt(o),null;case 13:if(Ja(o),l=o.memoizedState,l!==null&&l.dehydrated!==null){if(o.alternate===null)throw Error(r(340));cn()}return l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 19:return G(Tn),null;case 4:return De(),null;case 10:return Da(o.type),null;case 22:case 23:return Ja(o),Ld(),l!==null&&G(ar),l=o.flags,l&65536?(o.flags=l&-65537|128,o):null;case 24:return Da(an),null;case 25:return null;default:return null}}function mh(l,o){switch(be(o),o.tag){case 3:Da(an),De();break;case 26:case 27:case 5:wt(o);break;case 4:De();break;case 13:Ja(o);break;case 19:G(Tn);break;case 10:Da(o.type);break;case 22:case 23:Ja(o),Ld(),l!==null&&G(ar);break;case 24:Da(an)}}function Rr(l,o){try{var f=o.updateQueue,_=f!==null?f.lastEffect:null;if(_!==null){var x=_.next;f=x;do{if((f.tag&l)===l){_=void 0;var C=f.create,O=f.inst;_=C(),O.destroy=_}f=f.next}while(f!==x)}}catch(H){$e(o,o.return,H)}}function as(l,o,f){try{var _=o.updateQueue,x=_!==null?_.lastEffect:null;if(x!==null){var C=x.next;_=C;do{if((_.tag&l)===l){var O=_.inst,H=O.destroy;if(H!==void 0){O.destroy=void 0,x=o;var I=f;try{H()}catch(re){$e(x,I,re)}}}_=_.next}while(_!==C)}}catch(re){$e(o,o.return,re)}}function sp(l){var o=l.updateQueue;if(o!==null){var f=l.stateNode;try{Te(o,f)}catch(_){$e(l,l.return,_)}}}function rp(l,o,f){f.props=ke(l.type,l.memoizedProps),f.state=l.memoizedState;try{f.componentWillUnmount()}catch(_){$e(l,o,_)}}function Xs(l,o){try{var f=l.ref;if(f!==null){var _=l.stateNode;switch(l.tag){case 26:case 27:case 5:var x=Ro(_);break;default:x=_}typeof f=="function"?l.refCleanup=f(x):f.current=x}}catch(C){$e(l,o,C)}}function wi(l,o){var f=l.ref,_=l.refCleanup;if(f!==null)if(typeof _=="function")try{_()}catch(x){$e(l,o,x)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(x){$e(l,o,x)}else f.current=null}function lp(l){var o=l.type,f=l.memoizedProps,_=l.stateNode;try{$0(_,o,f,l)}catch(x){$e(l,l.return,x)}}function op(l,o,f){try{pg(l.stateNode,l.type,f,o,l)}catch(_){$e(l,l.return,_)}}function yh(l){return l.tag===5||l.tag===3||(Zi?l.tag===26:!1)||(nn?l.tag===27:!1)||l.tag===4}function gh(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||yh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&(!nn||l.tag!==27)&&l.tag!==18;){if(l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function _h(l,o,f){var _=l.tag;if(_===5||_===6)l=l.stateNode,o?eb(f,l,o):dg(f,l);else if(!(_===4||nn&&_===27)&&(l=l.child,l!==null))for(_h(l,o,f),l=l.sibling;l!==null;)_h(l,o,f),l=l.sibling}function ss(l,o,f){var _=l.tag;if(_===5||_===6)l=l.stateNode,o?mg(f,l,o):Fp(f,l);else if(!(_===4||nn&&_===27)&&(l=l.child,l!==null))for(ss(l,o,f),l=l.sibling;l!==null;)ss(l,o,f),l=l.sibling}function vh(l,o,f){l=l.containerInfo;try{Kp(l,f)}catch(_){$e(o,o.return,_)}}function up(l,o){for(Ks(l.containerInfo),Un=o;Un!==null;)if(l=Un,o=l.child,(l.subtreeFlags&1028)!==0&&o!==null)o.return=l,Un=o;else for(;Un!==null;){l=Un;var f=l.alternate;switch(o=l.flags,l.tag){case 0:break;case 11:case 15:break;case 1:if((o&1024)!==0&&f!==null){o=void 0;var _=l,x=f.memoizedProps;f=f.memoizedState;var C=_.stateNode;try{var O=ke(_.type,x,_.elementType===_.type);o=C.getSnapshotBeforeUpdate(O,f),C.__reactInternalSnapshotBeforeUpdate=o}catch(H){$e(_,_.return,H)}}break;case 3:(o&1024)!==0&&fn&&Nr(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((o&1024)!==0)throw Error(r(163))}if(o=l.sibling,o!==null){o.return=l.return,Un=o;break}Un=l.return}return O=Hg,Hg=!1,O}function Jy(l,o,f){var _=f.flags;switch(f.tag){case 0:case 11:case 15:rs(l,f),_&4&&Rr(5,f);break;case 1:if(rs(l,f),_&4)if(l=f.stateNode,o===null)try{l.componentDidMount()}catch(H){$e(f,f.return,H)}else{var x=ke(f.type,o.memoizedProps);o=o.memoizedState;try{l.componentDidUpdate(x,o,l.__reactInternalSnapshotBeforeUpdate)}catch(H){$e(f,f.return,H)}}_&64&&sp(f),_&512&&Xs(f,f.return);break;case 3:if(rs(l,f),_&64&&(_=f.updateQueue,_!==null)){if(l=null,f.child!==null)switch(f.child.tag){case 27:case 5:l=Ro(f.child.stateNode);break;case 1:l=f.child.stateNode}try{Te(_,l)}catch(H){$e(f,f.return,H)}}break;case 26:if(Zi){rs(l,f),_&512&&Xs(f,f.return);break}case 27:case 5:rs(l,f),o===null&&_&4&&lp(f),_&512&&Xs(f,f.return);break;case 12:rs(l,f);break;case 13:rs(l,f),_&4&&bh(l,f);break;case 22:if(x=f.memoizedState!==null||gs,!x){o=o!==null&&o.memoizedState!==null||sn;var C=gs,O=sn;gs=x,(sn=o)&&!O?Ua(l,f,(f.subtreeFlags&8772)!==0):rs(l,f),gs=C,sn=O}_&512&&(f.memoizedProps.mode==="manual"?Xs(f,f.return):wi(f,f.return));break;default:rs(l,f)}}function $y(l){var o=l.alternate;o!==null&&(l.alternate=null,$y(o)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(o=l.stateNode,o!==null&&Ih(o)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function oa(l,o,f){for(f=f.child;f!==null;)_l(l,o,f),f=f.sibling}function _l(l,o,f){if(zi&&typeof zi.onCommitFiberUnmount=="function")try{zi.onCommitFiberUnmount(Al,f)}catch{}switch(f.tag){case 26:if(Zi){sn||wi(f,o),oa(l,o,f),f.memoizedState?$h(f.memoizedState):f.stateNode&&ut(f.stateNode);break}case 27:if(nn){sn||wi(f,o);var _=mn,x=$i;mn=f.stateNode,oa(l,o,f),ub(f.stateNode),mn=_,$i=x;break}case 5:sn||wi(f,o);case 6:if(fn){if(_=mn,x=$i,mn=null,oa(l,o,f),mn=_,$i=x,mn!==null)if($i)try{kh(mn,f.stateNode)}catch(C){$e(f,o,C)}else try{Uo(mn,f.stateNode)}catch(C){$e(f,o,C)}}else oa(l,o,f);break;case 18:fn&&mn!==null&&($i?$p(mn,f.stateNode):Rg(mn,f.stateNode));break;case 4:fn?(_=mn,x=$i,mn=f.stateNode.containerInfo,$i=!0,oa(l,o,f),mn=_,$i=x):(Zs&&vh(f.stateNode,f,Et()),oa(l,o,f));break;case 0:case 11:case 14:case 15:sn||as(2,f,o),sn||as(4,f,o),oa(l,o,f);break;case 1:sn||(wi(f,o),_=f.stateNode,typeof _.componentWillUnmount=="function"&&rp(f,o,_)),oa(l,o,f);break;case 21:oa(l,o,f);break;case 22:sn||wi(f,o),sn=(_=sn)||f.memoizedState!==null,oa(l,o,f),sn=_;break;default:oa(l,o,f)}}function bh(l,o){if(vi&&o.memoizedState===null&&(l=o.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{El(l)}catch(f){$e(o,o.return,f)}}function xh(l){switch(l.tag){case 13:case 19:var o=l.stateNode;return o===null&&(o=l.stateNode=new zg),o;case 22:return l=l.stateNode,o=l._retryCache,o===null&&(o=l._retryCache=new zg),o;default:throw Error(r(435,l.tag))}}function Sh(l,o){var f=xh(l);o.forEach(function(_){var x=xp.bind(null,l,_);f.has(_)||(f.add(_),_.then(x,x))})}function mi(l,o){var f=o.deletions;if(f!==null)for(var _=0;_<f.length;_++){var x=f[_],C=l,O=o;if(fn){var H=O;e:for(;H!==null;){switch(H.tag){case 27:case 5:mn=H.stateNode,$i=!1;break e;case 3:mn=H.stateNode.containerInfo,$i=!0;break e;case 4:mn=H.stateNode.containerInfo,$i=!0;break e}H=H.return}if(mn===null)throw Error(r(160));_l(C,O,x),mn=null,$i=!1}else _l(C,O,x);C=x.alternate,C!==null&&(C.return=null),x.return=null}if(o.subtreeFlags&13878)for(o=o.child;o!==null;)Th(o,l),o=o.sibling}function Th(l,o){var f=l.alternate,_=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:mi(o,l),yi(l),_&4&&(as(3,l,l.return),Rr(3,l),as(5,l,l.return));break;case 1:mi(o,l),yi(l),_&512&&(sn||f===null||wi(f,f.return)),_&64&&gs&&(l=l.updateQueue,l!==null&&(_=l.callbacks,_!==null&&(f=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=f===null?_:f.concat(_))));break;case 26:if(Zi){var x=Va;mi(o,l),yi(l),_&512&&(sn||f===null||wi(f,f.return)),_&4&&(_=f!==null?f.memoizedState:null,o=l.memoizedState,f===null?o===null?l.stateNode===null?l.stateNode=lb(x,l.type,l.memoizedProps,l):Mg(x,l.type,l.stateNode):l.stateNode=nm(x,o,l.memoizedProps):_!==o?(_===null?f.stateNode!==null&&ut(f.stateNode):$h(_),o===null?Mg(x,l.type,l.stateNode):nm(x,o,l.memoizedProps)):o===null&&l.stateNode!==null&&op(l,l.memoizedProps,f.memoizedProps));break}case 27:if(nn&&_&4&&l.alternate===null){x=l.stateNode;var C=l.memoizedProps;try{ef(x),im(l.type,C,x,l)}catch(ye){$e(l,l.return,ye)}}case 5:if(mi(o,l),yi(l),_&512&&(sn||f===null||wi(f,f.return)),fn){if(l.flags&32){o=l.stateNode;try{Ip(o)}catch(ye){$e(l,l.return,ye)}}_&4&&l.stateNode!=null&&(o=l.memoizedProps,op(l,o,f!==null?f.memoizedProps:o)),_&1024&&(dm=!0)}break;case 6:if(mi(o,l),yi(l),_&4&&fn){if(l.stateNode===null)throw Error(r(162));_=l.memoizedProps,f=f!==null?f.memoizedProps:_,o=l.stateNode;try{J0(o,f,_)}catch(ye){$e(l,l.return,ye)}}break;case 3:if(Zi?(Pi(),x=Va,Va=Jh(o.containerInfo),mi(o,l),Va=x):mi(o,l),yi(l),_&4){if(fn&&vi&&f!==null&&f.memoizedState.isDehydrated)try{Zh(o.containerInfo)}catch(ye){$e(l,l.return,ye)}if(Zs){_=o.containerInfo,f=o.pendingChildren;try{Kp(_,f)}catch(ye){$e(l,l.return,ye)}}}dm&&(dm=!1,cp(l));break;case 4:Zi?(f=Va,Va=Jh(l.stateNode.containerInfo),mi(o,l),yi(l),Va=f):(mi(o,l),yi(l)),_&4&&Zs&&vh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:mi(o,l),yi(l);break;case 13:mi(o,l),yi(l),l.child.flags&8192&&l.memoizedState!==null!=(f!==null&&f.memoizedState!==null)&&(gm=da()),_&4&&(_=l.updateQueue,_!==null&&(l.updateQueue=null,Sh(l,_)));break;case 22:_&512&&(sn||f===null||wi(f,f.return)),x=l.memoizedState!==null;var O=f!==null&&f.memoizedState!==null,H=gs,I=sn;if(gs=H||x,sn=I||O,mi(o,l),sn=I,gs=H,yi(l),o=l.stateNode,o._current=l,o._visibility&=-3,o._visibility|=o._pendingVisibility&2,_&8192&&(o._visibility=x?o._visibility&-2:o._visibility|1,x&&(o=gs||sn,f===null||O||o||ua(l)),fn&&(l.memoizedProps===null||l.memoizedProps.mode!=="manual"))){e:if(f=null,fn)for(o=l;;){if(o.tag===5||Zi&&o.tag===26||nn&&o.tag===27){if(f===null){O=f=o;try{C=O.stateNode,x?kp(C):nb(O.stateNode,O.memoizedProps)}catch(ye){$e(O,O.return,ye)}}}else if(o.tag===6){if(f===null){O=o;try{var re=O.stateNode;x?tb(re):yg(re,O.memoizedProps)}catch(ye){$e(O,O.return,ye)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===l)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===l)break e;for(;o.sibling===null;){if(o.return===null||o.return===l)break e;f===o&&(f=null),o=o.return}f===o&&(f=null),o.sibling.return=o.return,o=o.sibling}}_&4&&(_=l.updateQueue,_!==null&&(f=_.retryQueue,f!==null&&(_.retryQueue=null,Sh(l,f))));break;case 19:mi(o,l),yi(l),_&4&&(_=l.updateQueue,_!==null&&(l.updateQueue=null,Sh(l,_)));break;case 21:break;default:mi(o,l),yi(l)}}function yi(l){var o=l.flags;if(o&2){try{if(fn&&(!nn||l.tag!==27)){e:{for(var f=l.return;f!==null;){if(yh(f)){var _=f;break e}f=f.return}throw Error(r(160))}switch(_.tag){case 27:if(nn){var x=_.stateNode,C=gh(l);ss(l,C,x);break}case 5:var O=_.stateNode;_.flags&32&&(Ip(O),_.flags&=-33);var H=gh(l);ss(l,H,O);break;case 3:case 4:var I=_.stateNode.containerInfo,re=gh(l);_h(l,re,I);break;default:throw Error(r(161))}}}catch(ye){$e(l,l.return,ye)}l.flags&=-3}o&4096&&(l.flags&=-4097)}function cp(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var o=l;cp(o),o.tag===5&&o.flags&1024&&ug(o.stateNode),l=l.sibling}}function rs(l,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Jy(l,o.alternate,o),o=o.sibling}function ua(l){for(l=l.child;l!==null;){var o=l;switch(o.tag){case 0:case 11:case 14:case 15:as(4,o,o.return),ua(o);break;case 1:wi(o,o.return);var f=o.stateNode;typeof f.componentWillUnmount=="function"&&rp(o,o.return,f),ua(o);break;case 26:case 27:case 5:wi(o,o.return),ua(o);break;case 22:wi(o,o.return),o.memoizedState===null&&ua(o);break;default:ua(o)}l=l.sibling}}function Ua(l,o,f){for(f=f&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var _=o.alternate,x=l,C=o,O=C.flags;switch(C.tag){case 0:case 11:case 15:Ua(x,C,f),Rr(4,C);break;case 1:if(Ua(x,C,f),_=C,x=_.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(re){$e(_,_.return,re)}if(_=C,x=_.updateQueue,x!==null){var H=_.stateNode;try{var I=x.shared.hiddenCallbacks;if(I!==null)for(x.shared.hiddenCallbacks=null,x=0;x<I.length;x++)he(I[x],H)}catch(re){$e(_,_.return,re)}}f&&O&64&&sp(C),Xs(C,C.return);break;case 26:case 27:case 5:Ua(x,C,f),f&&_===null&&O&4&&lp(C),Xs(C,C.return);break;case 12:Ua(x,C,f);break;case 13:Ua(x,C,f),f&&O&4&&bh(x,C);break;case 22:C.memoizedState===null&&Ua(x,C,f),Xs(C,C.return);break;default:Ua(x,C,f)}o=o.sibling}}function Eh(l,o){var f=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(f=l.memoizedState.cachePool.pool),l=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(l=o.memoizedState.cachePool.pool),l!==f&&(l!=null&&l.refCount++,f!=null&&vo(f))}function Nu(l,o){l=null,o.alternate!==null&&(l=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==l&&(o.refCount++,l!=null&&vo(l))}function ls(l,o,f,_){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Ch(l,o,f,_),o=o.sibling}function Ch(l,o,f,_){var x=o.flags;switch(o.tag){case 0:case 11:case 15:ls(l,o,f,_),x&2048&&Rr(9,o);break;case 3:ls(l,o,f,_),x&2048&&(l=null,o.alternate!==null&&(l=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==l&&(o.refCount++,l!=null&&vo(l)));break;case 12:if(x&2048){ls(l,o,f,_),l=o.stateNode;try{var C=o.memoizedProps,O=C.id,H=C.onPostCommit;typeof H=="function"&&H(O,o.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(I){$e(o,o.return,I)}}else ls(l,o,f,_);break;case 23:break;case 22:C=o.stateNode,o.memoizedState!==null?C._visibility&4?ls(l,o,f,_):ln(l,o):C._visibility&4?ls(l,o,f,_):(C._visibility|=4,xo(l,o,f,_,(o.subtreeFlags&10256)!==0)),x&2048&&Eh(o.alternate,o);break;case 24:ls(l,o,f,_),x&2048&&Nu(o.alternate,o);break;default:ls(l,o,f,_)}}function xo(l,o,f,_,x){for(x=x&&(o.subtreeFlags&10256)!==0,o=o.child;o!==null;){var C=l,O=o,H=f,I=_,re=O.flags;switch(O.tag){case 0:case 11:case 15:xo(C,O,H,I,x),Rr(8,O);break;case 23:break;case 22:var ye=O.stateNode;O.memoizedState!==null?ye._visibility&4?xo(C,O,H,I,x):ln(C,O):(ye._visibility|=4,xo(C,O,H,I,x)),x&&re&2048&&Eh(O.alternate,O);break;case 24:xo(C,O,H,I,x),x&&re&2048&&Nu(O.alternate,O);break;default:xo(C,O,H,I,x)}o=o.sibling}}function ln(l,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var f=l,_=o,x=_.flags;switch(_.tag){case 22:ln(f,_),x&2048&&Eh(_.alternate,_);break;case 24:ln(f,_),x&2048&&Nu(_.alternate,_);break;default:ln(f,_)}o=o.sibling}}function Ar(l){if(l.subtreeFlags&Nl)for(l=l.child;l!==null;)hp(l),l=l.sibling}function hp(l){switch(l.tag){case 26:Ar(l),l.flags&Nl&&(l.memoizedState!==null?Cl(Va,l.memoizedState,l.memoizedProps):Yp(l.type,l.memoizedProps));break;case 5:Ar(l),l.flags&Nl&&Yp(l.type,l.memoizedProps);break;case 3:case 4:if(Zi){var o=Va;Va=Jh(l.stateNode.containerInfo),Ar(l),Va=o}else Ar(l);break;case 22:l.memoizedState===null&&(o=l.alternate,o!==null&&o.memoizedState!==null?(o=Nl,Nl=16777216,Ar(l),Nl=o):Ar(l));break;default:Ar(l)}}function fp(l){var o=l.alternate;if(o!==null&&(l=o.child,l!==null)){o.child=null;do o=l.sibling,l.sibling=null,l=o;while(l!==null)}}function So(l){var o=l.deletions;if((l.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var _=o[f];Un=_,Rh(_,l)}fp(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)dp(l),l=l.sibling}function dp(l){switch(l.tag){case 0:case 11:case 15:So(l),l.flags&2048&&as(9,l,l.return);break;case 3:So(l);break;case 12:So(l);break;case 22:var o=l.stateNode;l.memoizedState!==null&&o._visibility&4&&(l.return===null||l.return.tag!==13)?(o._visibility&=-5,Mr(l)):So(l);break;default:So(l)}}function Mr(l){var o=l.deletions;if((l.flags&16)!==0){if(o!==null)for(var f=0;f<o.length;f++){var _=o[f];Un=_,Rh(_,l)}fp(l)}for(l=l.child;l!==null;){switch(o=l,o.tag){case 0:case 11:case 15:as(8,o,o.return),Mr(o);break;case 22:f=o.stateNode,f._visibility&4&&(f._visibility&=-5,Mr(o));break;default:Mr(o)}l=l.sibling}}function Rh(l,o){for(;Un!==null;){var f=Un;switch(f.tag){case 0:case 11:case 15:as(8,f,o);break;case 23:case 22:if(f.memoizedState!==null&&f.memoizedState.cachePool!==null){var _=f.memoizedState.cachePool.pool;_!=null&&_.refCount++}break;case 24:vo(f.memoizedState.cache)}if(_=f.child,_!==null)_.return=f,Un=_;else e:for(f=l;Un!==null;){_=Un;var x=_.sibling,C=_.return;if($y(_),_===f){Un=null;break e}if(x!==null){x.return=C,Un=x;break e}Un=C}}}function Ah(l){var o=Vp(l);if(o!=null){if(typeof o.memoizedProps["data-testname"]!="string")throw Error(r(364));return o}if(l=Xp(l),l===null)throw Error(r(362));return l.stateNode.current}function Mh(l,o){var f=l.tag;switch(o.$$typeof){case pf:if(l.type===o.value)return!0;break;case mf:e:{for(o=o.value,l=[l,0],f=0;f<l.length;){var _=l[f++],x=_.tag,C=l[f++],O=o[C];if(x!==5&&x!==26&&x!==27||!Do(_)){for(;O!=null&&Mh(_,O);)C++,O=o[C];if(C===o.length){o=!0;break e}else for(_=_.child;_!==null;)l.push(_,C),_=_.sibling}}o=!1}return o;case yf:if((f===5||f===26||f===27)&&hg(l.stateNode,o.value))return!0;break;case tc:if((f===5||f===6||f===26||f===27)&&(l=cg(l),l!==null&&0<=l.indexOf(o.value)))return!0;break;case ec:if((f===5||f===26||f===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===o.value.toLowerCase()))return!0;break;default:throw Error(r(365))}return!1}function Dh(l){switch(l.$$typeof){case pf:return"<"+(h(l.value)||"Unknown")+">";case mf:return":has("+(Dh(l)||"")+")";case yf:return'[role="'+l.value+'"]';case tc:return'"'+l.value+'"';case ec:return'[data-testname="'+l.value+'"]';default:throw Error(r(365))}}function Uh(l,o){var f=[];l=[l,0];for(var _=0;_<l.length;){var x=l[_++],C=x.tag,O=l[_++],H=o[O];if(C!==5&&C!==26&&C!==27||!Do(x)){for(;H!=null&&Mh(x,H);)O++,H=o[O];if(O===o.length)f.push(x);else for(x=x.child;x!==null;)l.push(x,O),x=x.sibling}}return f}function Gu(l,o){if(!Or)throw Error(r(363));l=Ah(l),l=Uh(l,o),o=[],l=Array.from(l);for(var f=0;f<l.length;){var _=l[f++],x=_.tag;if(x===5||x===26||x===27)Do(_)||o.push(_.stateNode);else for(_=_.child;_!==null;)l.push(_),_=_.sibling}return o}function gi(){if((Dt&2)!==0&&pt!==0)return pt&-pt;if(qe.T!==null){var l=No;return l!==0?l:io()}return Lp()}function pp(){ea===0&&(ea=(pt&536870912)===0||_t?Se():536870912);var l=ri.current;return l!==null&&(l.flags|=32),ea}function Ln(l,o,f){(l===zt&&Ut===2||l.cancelPendingCommit!==null)&&(Dr(l,0),Ba(l,pt,ea,!1)),se(l,f),((Dt&2)===0||l!==zt)&&(l===zt&&((Dt&2)===0&&(wl|=f),Wt===4&&Ba(l,pt,ea,!1)),Xe(l))}function Bh(l,o,f){if((Dt&6)!==0)throw Error(r(327));var _=!f&&(o&60)===0&&(o&l.expiredLanes)===0||ie(l,o),x=_?Hu(l,o):zu(l,o,!0),C=_;do{if(x===0){Gl&&!_&&Ba(l,o,0,!1);break}else if(x===6)Ba(l,o,0,!_s);else{if(f=l.current.alternate,C&&!eg(f)){x=zu(l,o,!1),C=!1;continue}if(x===2){if(C=o,l.errorRecoveryDisabledLanes&C)var O=0;else O=l.pendingLanes&-536870913,O=O!==0?O:O&536870912?536870912:0;if(O!==0){o=O;e:{var H=l;x=yn;var I=vi&&H.current.memoizedState.isDehydrated;if(I&&(Dr(H,O).flags|=256),O=zu(H,O,!1),O!==2){if(pm&&!I){H.errorRecoveryDisabledLanes|=C,wl|=C,x=4;break e}C=La,La=x,C!==null&&wu(C)}x=O}if(C=!1,x!==2)continue}}if(x===1){Dr(l,0),Ba(l,o,0,!0);break}e:{switch(_=l,x){case 0:case 1:throw Error(r(345));case 4:if((o&4194176)===o){Ba(_,o,ea,!_s);break e}break;case 2:La=null;break;case 3:case 5:break;default:throw Error(r(329))}if(_.finishedWork=f,_.finishedLanes=o,(o&62914560)===o&&(C=gm+300-da(),10<C)){if(Ba(_,o,ea,!_s),Z(_,0)!==0)break e;_.timeoutHandle=Yu(mp.bind(null,_,f,La,ic,ym,o,ea,wl,Lo,_s,2,-0,0),C);break e}mp(_,f,La,ic,ym,o,ea,wl,Lo,_s,0,-0,0)}}break}while(!0);Xe(l)}function wu(l){La===null?La=l:La.push.apply(La,l)}function mp(l,o,f,_,x,C,O,H,I,re,ye,Ce,Ee){var Ne=o.subtreeFlags;if((Ne&8192||(Ne&16785408)===16785408)&&(Qi(),hp(o),o=Zt(),o!==null)){l.cancelPendingCommit=o(Br.bind(null,l,f,_,x,O,H,I,1,Ce,Ee)),Ba(l,C,O,!re);return}Br(l,f,_,x,O,H,I,ye,Ce,Ee)}function eg(l){for(var o=l;;){var f=o.tag;if((f===0||f===11||f===15)&&o.flags&16384&&(f=o.updateQueue,f!==null&&(f=f.stores,f!==null)))for(var _=0;_<f.length;_++){var x=f[_],C=x.getSnapshot;x=x.value;try{if(!xi(C(),x))return!1}catch{return!1}}if(f=o.child,o.subtreeFlags&16384&&f!==null)f.return=o,o=f;else{if(o===l)break;for(;o.sibling===null;){if(o.return===null||o.return===l)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Ba(l,o,f,_){o&=~mm,o&=~wl,l.suspendedLanes|=o,l.pingedLanes&=~o,_&&(l.warmLanes|=o),_=l.expirationTimes;for(var x=o;0<x;){var C=31-bi(x),O=1<<C;_[C]=-1,x&=~O}f!==0&&ae(l,f,o)}function yp(){return(Dt&6)===0?(yt(0),!1):!0}function Oa(){if(Ye!==null){if(Ut===0)var l=Ye.return;else l=Ye,Ha=jr=null,lo(l),wo=null,Wu=0,l=Ye;for(;l!==null;)mh(l.alternate,l),l=l.return;Ye=null}}function Dr(l,o){l.finishedWork=null,l.finishedLanes=0;var f=l.timeoutHandle;f!==Fh&&(l.timeoutHandle=Fh,Sl(f)),f=l.cancelPendingCommit,f!==null&&(l.cancelPendingCommit=null,f()),Oa(),zt=l,Ye=f=ca(l.current,null),pt=o,Ut=0,Hi=null,_s=!1,Gl=ie(l,o),pm=!1,Lo=ea=mm=wl=Yr=Wt=0,La=yn=null,ym=!1,(o&8)!==0&&(o|=o&32);var _=l.entangledLanes;if(_!==0)for(l=l.entanglements,_&=o;0<_;){var x=31-bi(_),C=1<<x;o|=l[x],_&=~C}return vs=o,$n(),f}function tg(l,o){lt=null,qe.H=ys,o===ps?(o=Fe(),Ut=3):o===ir?(o=Fe(),Ut=4):Ut=o===hm?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,Hi=o,Ye===null&&(Wt=1,ue(l,pe(o,l.current)))}function Oh(){var l=ri.current;return l===null?!0:(pt&4194176)===pt?ms===null:(pt&62914560)===pt||(pt&536870912)!==0?l===ms:!1}function Pu(){var l=qe.H;return qe.H=ys,l===null?ys:l}function qs(){var l=qe.A;return qe.A=db,l}function Na(){Wt=4,_s||(pt&4194176)!==pt&&ri.current!==null||(Gl=!0),(Yr&134217727)===0&&(wl&134217727)===0||zt===null||Ba(zt,pt,ea,!1)}function zu(l,o,f){var _=Dt;Dt|=2;var x=Pu(),C=qs();(zt!==l||pt!==o)&&(ic=null,Dr(l,o)),o=!1;var O=Wt;e:do try{if(Ut!==0&&Ye!==null){var H=Ye,I=Hi;switch(Ut){case 8:Oa(),O=6;break e;case 3:case 2:case 6:ri.current===null&&(o=!0);var re=Ut;if(Ut=0,Hi=null,Fs(l,H,I,re),f&&Gl){O=0;break e}break;default:re=Ut,Ut=0,Hi=null,Fs(l,H,I,re)}}gp(),O=Wt;break}catch(ye){tg(l,ye)}while(!0);return o&&l.shellSuspendCounter++,Ha=jr=null,Dt=_,qe.H=x,qe.A=C,Ye===null&&(zt=null,pt=0,$n()),O}function gp(){for(;Ye!==null;)Ur(Ye)}function Hu(l,o){var f=Dt;Dt|=2;var _=Pu(),x=qs();zt!==l||pt!==o?(ic=null,nc=da()+500,Dr(l,o)):Gl=ie(l,o);e:do try{if(Ut!==0&&Ye!==null){o=Ye;var C=Hi;t:switch(Ut){case 1:Ut=0,Hi=null,Fs(l,o,C,1);break;case 2:if(tt(C)){Ut=0,Hi=null,Lt(o);break}o=function(){Ut===2&&zt===l&&(Ut=7),Xe(l)},C.then(o,o);break e;case 3:Ut=7;break e;case 4:Ut=5;break e;case 7:tt(C)?(Ut=0,Hi=null,Lt(o)):(Ut=0,Hi=null,Fs(l,o,C,7));break;case 5:var O=null;switch(Ye.tag){case 26:O=Ye.memoizedState;case 5:case 27:var H=Ye,I=H.type,re=H.pendingProps;if(O?Dg(O):jp(I,re)){Ut=0,Hi=null;var ye=H.sibling;if(ye!==null)Ye=ye;else{var Ce=H.return;Ce!==null?(Ye=Ce,Vu(Ce)):Ye=null}break t}}Ut=0,Hi=null,Fs(l,o,C,5);break;case 6:Ut=0,Hi=null,Fs(l,o,C,6);break;case 8:Oa(),Wt=6;break e;default:throw Error(r(462))}}Nh();break}catch(Ee){tg(l,Ee)}while(!0);return Ha=jr=null,qe.H=_,qe.A=x,Dt=f,Ye!==null?0:(zt=null,pt=0,$n(),Wt)}function Nh(){for(;Ye!==null&&!$();)Ur(Ye)}function Ur(l){var o=rh(l.alternate,l,vs);l.memoizedProps=l.pendingProps,o===null?Vu(l):Ye=o}function Lt(l){var o=l,f=o.alternate;switch(o.tag){case 15:case 0:o=go(f,o,o.pendingProps,o.type,void 0,pt);break;case 11:o=go(f,o,o.pendingProps,o.type.render,o.ref,pt);break;case 5:lo(o);default:mh(f,o),o=Ye=jt(o,vs),o=rh(f,o,vs)}l.memoizedProps=l.pendingProps,o===null?Vu(l):Ye=o}function Fs(l,o,f,_){Ha=jr=null,lo(o),wo=null,Wu=0;var x=o.return;try{if(tp(l,x,o,f,pt)){Wt=1,ue(l,pe(f,l.current)),Ye=null;return}}catch(C){if(x!==null)throw Ye=x,C;Wt=1,ue(l,pe(f,l.current)),Ye=null;return}o.flags&32768?(_t||_===1?l=!0:Gl||(pt&536870912)!==0?l=!1:(_s=l=!0,(_===2||_===3||_===6)&&(_=ri.current,_!==null&&_.tag===13&&(_.flags|=16384))),Gh(o,l)):Vu(o)}function Vu(l){var o=l;do{if((o.flags&32768)!==0){Gh(o,_s);return}l=o.return;var f=ap(o.alternate,o,vs);if(f!==null){Ye=f;return}if(o=o.sibling,o!==null){Ye=o;return}Ye=o=l}while(o!==null);Wt===0&&(Wt=5)}function Gh(l,o){do{var f=ph(l.alternate,l);if(f!==null){f.flags&=32767,Ye=f;return}if(f=l.return,f!==null&&(f.flags|=32768,f.subtreeFlags=0,f.deletions=null),!o&&(l=l.sibling,l!==null)){Ye=l;return}Ye=l=f}while(l!==null);Wt=6,Ye=null}function Br(l,o,f,_,x,C,O,H,I,re){var ye=qe.T,Ce=Ws();try{ai(2),qe.T=null,Lu(l,o,f,_,Ce,x,C,O,H,I,re)}finally{qe.T=ye,ai(Ce)}}function Lu(l,o,f,_,x,C,O,H){do os();while(Ti!==null);if((Dt&6)!==0)throw Error(r(327));var I=l.finishedWork;if(_=l.finishedLanes,I===null)return null;if(l.finishedWork=null,l.finishedLanes=0,I===l.current)throw Error(r(177));l.callbackNode=null,l.callbackPriority=0,l.cancelPendingCommit=null;var re=I.lanes|I.childLanes;if(re|=ds,Le(l,_,re,C,O,H),l===zt&&(Ye=zt=null,pt=0),(I.subtreeFlags&10256)===0&&(I.flags&10256)===0||jo||(jo=!0,In=re,_m=f,Sp(sf,function(){return os(),null})),f=(I.flags&15990)!==0,(I.subtreeFlags&15990)!==0||f?(f=qe.T,qe.T=null,C=Ws(),ai(2),O=Dt,Dt|=4,up(l,I),Th(I,l),wp(l.containerInfo),l.current=I,Jy(l,I.alternate,I),ku(),Dt=O,ai(C),qe.T=f):l.current=I,jo?(jo=!1,Ti=l,ga=_):wh(l,re),re=l.pendingLanes,re===0&&(bs=null),j(I.stateNode),Xe(l),o!==null)for(x=l.onRecoverableError,I=0;I<o.length;I++)re=o[I],x(re.value,{componentStack:re.stack});return(ga&3)!==0&&os(),re=l.pendingLanes,(_&4194218)!==0&&(re&42)!==0?l===Yo?ac++:(ac=0,Yo=l):ac=0,yt(0),null}function wh(l,o){(l.pooledCacheLanes&=o)===0&&(o=l.pooledCache,o!=null&&(l.pooledCache=null,vo(o)))}function os(){if(Ti!==null){var l=Ti,o=In;In=0;var f=St(ga),_=32>f?32:f;f=qe.T;var x=Ws();try{if(ai(_),qe.T=null,Ti===null)var C=!1;else{_=_m,_m=null;var O=Ti,H=ga;if(Ti=null,ga=0,(Dt&6)!==0)throw Error(r(331));var I=Dt;if(Dt|=4,dp(O.current),Ch(O,O.current,H,_),Dt=I,yt(0,!1),zi&&typeof zi.onPostCommitFiberRoot=="function")try{zi.onPostCommitFiberRoot(Al,O)}catch{}C=!0}return C}finally{ai(x),qe.T=f,wh(l,o)}}return!1}function _p(l,o,f){o=pe(f,o),o=yo(l.stateNode,o,2),l=di(l,o,2),l!==null&&(se(l,2),Xe(l))}function $e(l,o,f){if(l.tag===3)_p(l,l,f);else for(;o!==null;){if(o.tag===3){_p(o,l,f);break}else if(o.tag===1){var _=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof _.componentDidCatch=="function"&&(bs===null||!bs.has(_))){l=pe(f,l),f=tn(2),_=di(o,f,2),_!==null&&($c(f,_,o,l),se(_,2),Xe(_));break}}o=o.return}}function Ph(l,o,f){var _=l.pingCache;if(_===null){_=l.pingCache=new Vg;var x=new Set;_.set(o,x)}else x=_.get(o),x===void 0&&(x=new Set,_.set(o,x));x.has(f)||(pm=!0,x.add(f),l=vp.bind(null,l,o,f),o.then(l,l))}function vp(l,o,f){var _=l.pingCache;_!==null&&_.delete(o),l.pingedLanes|=l.suspendedLanes&f,l.warmLanes&=~f,zt===l&&(pt&f)===f&&(Wt===4||Wt===3&&(pt&62914560)===pt&&300>da()-gm?(Dt&2)===0&&Dr(l,0):mm|=f,Lo===pt&&(Lo=0)),Xe(l)}function bp(l,o){o===0&&(o=_e()),l=Pn(l,o),l!==null&&(se(l,o),Xe(l))}function ng(l){var o=l.memoizedState,f=0;o!==null&&(f=o.retryLane),bp(l,f)}function xp(l,o){var f=0;switch(l.tag){case 13:var _=l.stateNode,x=l.memoizedState;x!==null&&(f=x.retryLane);break;case 19:_=l.stateNode;break;case 22:_=l.stateNode._retryCache;break;default:throw Error(r(314))}_!==null&&_.delete(o),bp(l,f)}function Sp(l,o){return Iu(l,o)}function ig(l,o,f,_){this.tag=l,this.key=f,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=_,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function To(l){return l=l.prototype,!(!l||!l.isReactComponent)}function ca(l,o){var f=l.alternate;return f===null?(f=t(l.tag,o,l.key,l.mode),f.elementType=l.elementType,f.type=l.type,f.stateNode=l.stateNode,f.alternate=l,l.alternate=f):(f.pendingProps=o,f.type=l.type,f.flags=0,f.subtreeFlags=0,f.deletions=null),f.flags=l.flags&31457280,f.childLanes=l.childLanes,f.lanes=l.lanes,f.child=l.child,f.memoizedProps=l.memoizedProps,f.memoizedState=l.memoizedState,f.updateQueue=l.updateQueue,o=l.dependencies,f.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},f.sibling=l.sibling,f.index=l.index,f.ref=l.ref,f.refCleanup=l.refCleanup,f}function jt(l,o){l.flags&=31457282;var f=l.alternate;return f===null?(l.childLanes=0,l.lanes=o,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=f.childLanes,l.lanes=f.lanes,l.child=f.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=f.memoizedProps,l.memoizedState=f.memoizedState,l.updateQueue=f.updateQueue,l.type=f.type,o=f.dependencies,l.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),l}function zh(l,o,f,_,x,C){var O=0;if(_=l,typeof l=="function")To(l)&&(O=1);else if(typeof l=="string")O=Zi&&nn?em(l,f,qn.current)?26:tf(l)?27:5:Zi?em(l,f,qn.current)?26:5:nn&&tf(l)?27:5;else e:switch(l){case xl:return vl(f.children,x,C,o);case Mp:O=8,x|=24;break;case Lh:return l=t(12,f,o,x|2),l.elementType=Lh,l.lanes=C,l;case Yh:return l=t(13,f,o,x),l.elementType=Yh,l.lanes=C,l;case Bp:return l=t(19,f,o,x),l.elementType=Bp,l.lanes=C,l;case fa:return Tp(f,x,C,o);default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Dp:case Ga:O=10;break e;case jh:O=9;break e;case Up:O=11;break e;case Xh:O=14;break e;case ks:O=16,_=null;break e}O=29,f=Error(r(130,l===null?"null":typeof l,"")),_=null}return o=t(O,f,o,x),o.elementType=l,o.type=_,o.lanes=C,o}function vl(l,o,f,_){return l=t(7,l,_,o),l.lanes=f,l}function Tp(l,o,f,_){l=t(22,l,_,o),l.elementType=fa,l.lanes=f;var x={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var C=x._current;if(C===null)throw Error(r(456));if((x._pendingVisibility&2)===0){var O=Pn(C,2);O!==null&&(x._pendingVisibility|=2,Ln(O,C,2))}},attach:function(){var C=x._current;if(C===null)throw Error(r(456));if((x._pendingVisibility&2)!==0){var O=Pn(C,2);O!==null&&(x._pendingVisibility&=-3,Ln(O,C,2))}}};return l.stateNode=x,l}function ha(l,o,f){return l=t(6,l,null,o),l.lanes=f,l}function Hh(l,o,f){return o=t(4,l.children!==null?l.children:[],l.key,o),o.lanes=f,o.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},o}function Ep(l,o,f,_,x,C,O,H){this.tag=1,this.containerInfo=l,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Fh,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=me(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=me(0),this.hiddenUpdates=me(null),this.identifierPrefix=_,this.onUncaughtError=x,this.onCaughtError=C,this.onRecoverableError=O,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=H,this.incompleteTransitions=new Map}function Eo(l,o,f,_,x,C,O,H,I,re,ye,Ce){return l=new Ep(l,o,f,O,H,I,re,Ce),o=1,C===!0&&(o|=24),C=t(3,null,null,o),l.current=C,C.stateNode=l,o=hh(),o.refCount++,l.pooledCache=o,o.refCount++,C.memoizedState={element:_,isDehydrated:f,cache:o},la(C),l}function bl(l){return l?(l=Pr,l):Pr}function Cp(l){var o=l._reactInternals;if(o===void 0)throw typeof l.render=="function"?Error(r(188)):(l=Object.keys(l).join(","),Error(r(268,l)));return l=E(o),l=l!==null?A(l):null,l===null?null:Ro(l.stateNode)}function Vh(l,o,f,_,x,C){x=bl(x),_.context===null?_.context=x:_.pendingContext=x,_=fi(o),_.payload={element:f},C=C===void 0?null:C,C!==null&&(_.callback=C),f=di(l,_,o),f!==null&&(Ln(f,l,o),pi(f,l,o))}function Rp(l,o){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var f=l.retryLane;l.retryLane=f!==0&&f<o?f:o}}function Ap(l,o){Rp(l,o),(l=l.alternate)&&Rp(l,o)}var ht={},ag=_c(),ki=r2(),Is=Object.assign,Ki=Symbol.for("react.element"),ju=Symbol.for("react.transitional.element"),Co=Symbol.for("react.portal"),xl=Symbol.for("react.fragment"),Mp=Symbol.for("react.strict_mode"),Lh=Symbol.for("react.profiler"),Dp=Symbol.for("react.provider"),jh=Symbol.for("react.consumer"),Ga=Symbol.for("react.context"),Up=Symbol.for("react.forward_ref"),Yh=Symbol.for("react.suspense"),Bp=Symbol.for("react.suspense_list"),Xh=Symbol.for("react.memo"),ks=Symbol.for("react.lazy"),fa=Symbol.for("react.offscreen"),Op=Symbol.for("react.memo_cache_sentinel"),Np=Symbol.iterator,K0=Symbol.for("react.client.reference"),qe=ag.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Gp,_i,qh=!1,ii=Array.isArray,sg=e.rendererVersion,Q0=e.rendererPackageName,wa=e.extraDevToolsConfig,Ro=e.getPublicInstance,Ao=e.getRootHostContext,rg=e.getChildHostContext,Ks=e.prepareForCommit,wp=e.resetAfterCommit,Pp=e.createInstance,us=e.appendInitialChild,zp=e.finalizeInitialChildren,Qs=e.shouldSetTextContent,Hp=e.createTextInstance,Yu=e.scheduleTimeout,Sl=e.cancelTimeout,Fh=e.noTimeout,cs=e.isPrimaryRenderer;e.warnsIfNotActing;var fn=e.supportsMutation,Zs=e.supportsPersistence,vi=e.supportsHydration,Vp=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var lg=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ai=e.setCurrentUpdatePriority,Ws=e.getCurrentUpdatePriority,Lp=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var og=e.shouldAttemptEagerTransition,Ih=e.detachDeletedInstance;e.requestPostPaintCallback;var Z0=e.maySuspendCommit,jp=e.preloadInstance,Qi=e.startSuspendingCommit,Yp=e.suspendInstance,Zt=e.waitForCommitToBeReady,Tl=e.NotPendingTransition,Js=e.HostTransitionContext,ug=e.resetFormInstance;e.bindToConsole;var W0=e.supportsMicrotasks,$s=e.scheduleMicrotask,Or=e.supportsTestSelectors,Xp=e.findFiberRoot,Mo=e.getBoundingRect,cg=e.getTextContent,Do=e.isHiddenSubtree,hg=e.matchAccessibilityRole,fg=e.setFocusIfFocusable,qp=e.setupIntersectionObserver,Fp=e.appendChild,dg=e.appendChildToContainer,J0=e.commitTextUpdate,$0=e.commitMount,pg=e.commitUpdate,mg=e.insertBefore,eb=e.insertInContainerBefore,Uo=e.removeChild,kh=e.removeChildFromContainer,Ip=e.resetTextContent,kp=e.hideInstance,tb=e.hideTextInstance,nb=e.unhideInstance,yg=e.unhideTextInstance,Nr=e.clearContainer,gg=e.cloneInstance,Et=e.createContainerChildSet,Kh=e.appendChildToContainerChildSet,ib=e.finalizeContainerChildren,Kp=e.replaceContainerChildren,_g=e.cloneHiddenInstance,vg=e.cloneHiddenTextInstance,Xu=e.isSuspenseInstancePending,Qh=e.isSuspenseInstanceFallback,bg=e.getSuspenseInstanceFallbackErrorDetails,xg=e.registerSuspenseInstanceRetry,qu=e.canHydrateFormStateMarker,ab=e.isFormStateMarkerMatching,Sg=e.getNextHydratableSibling,Gr=e.getFirstHydratableChild,Qp=e.getFirstHydratableChildWithinContainer,Tg=e.getFirstHydratableChildWithinSuspenseInstance,Eg=e.canHydrateInstance,Zp=e.canHydrateTextInstance,sb=e.canHydrateSuspenseInstance,Wp=e.hydrateInstance,wr=e.hydrateTextInstance,Cg=e.hydrateSuspenseInstance,Jp=e.getNextHydratableInstanceAfterSuspenseInstance,Zh=e.commitHydratedContainer,El=e.commitHydratedSuspenseInstance,Rg=e.clearSuspenseBoundary,$p=e.clearSuspenseBoundaryFromContainer,Wh=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var rb=e.validateHydratableInstance,Ag=e.validateHydratableTextInstance,Zi=e.supportsResources,em=e.isHostHoistableType,Jh=e.getHoistableRoot,tm=e.getResource,nm=e.acquireResource,$h=e.releaseResource,lb=e.hydrateHoistable,Mg=e.mountHoistable,ut=e.unmountHoistable,ob=e.createHoistableInstance,Pi=e.prepareToCommitHoistables,jn=e.mayResourceSuspendCommit,Dg=e.preloadResource,Cl=e.suspendResource,nn=e.supportsSingletons,Rl=e.resolveSingletonInstance,ef=e.clearSingleton,im=e.acquireSingletonInstance,ub=e.releaseSingletonInstance,tf=e.isHostSingletonType,Pa=[],hs=-1,Pr={},bi=Math.clz32?Math.clz32:P,nf=Math.log,Wi=Math.LN2,Fu=128,af=4194304,Iu=ki.unstable_scheduleCallback,am=ki.unstable_cancelCallback,$=ki.unstable_shouldYield,ku=ki.unstable_requestPaint,da=ki.unstable_now,sm=ki.unstable_ImmediatePriority,Ug=ki.unstable_UserBlockingPriority,sf=ki.unstable_NormalPriority,Bg=ki.unstable_IdlePriority,Og=ki.log,Ng=ki.unstable_setDisableYieldValue,Al=null,zi=null,xi=typeof Object.is=="function"?Object.is:de,rf=new WeakMap,Yn=[],Xn=0,Mn=null,lf=0,pa=[],Ji=0,ma=null,er=1,tr="",qn=M(null),Ku=M(null),zr=M(null),Bo=M(null),si=null,Sn=null,_t=!1,za=null,fs=!1,Qu=Error(r(519)),dn=[],on=0,ds=0,Si=null,Ml=null,rm=!1,Fn=!1,nr=!1,Oo=0,Zu=null,lm=0,No=0,Dl=null,Hr=!1,of=!1,cb=Object.prototype.hasOwnProperty,ps=Error(r(460)),ir=Error(r(474)),uf={then:function(){}},Go=null,wo=null,Wu=0,ya=so(!0),Gg=so(!1),Po=M(null),cf=M(0),ri=M(null),ms=null,Tn=M(0),Vr=0,lt=null,Mt=null,pn=null,hf=!1,zo=!1,Ul=!1,ff=0,Ju=0,Ho=null,wg=0,om=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},ys={readContext:Vn,use:gu,useCallback:Qt,useContext:Qt,useEffect:Qt,useImperativeHandle:Qt,useLayoutEffect:Qt,useInsertionEffect:Qt,useMemo:Qt,useReducer:Qt,useRef:Qt,useState:Qt,useDebugValue:Qt,useDeferredValue:Qt,useTransition:Qt,useSyncExternalStore:Qt,useId:Qt};ys.useCacheRefresh=Qt,ys.useMemoCache=Qt,ys.useHostTransitionStatus=Qt,ys.useFormState=Qt,ys.useActionState=Qt,ys.useOptimistic=Qt;var Bl={readContext:Vn,use:gu,useCallback:function(l,o){return zn().memoizedState=[l,o===void 0?null:o],l},useContext:Vn,useEffect:co,useImperativeHandle:function(l,o,f){f=f!=null?f.concat([l]):null,fl(4194308,4,bu.bind(null,o,l),f)},useLayoutEffect:function(l,o){return fl(4194308,4,l,o)},useInsertionEffect:function(l,o){fl(4,2,l,o)},useMemo:function(l,o){var f=zn();o=o===void 0?null:o;var _=l();if(Ul){ee(!0);try{l()}finally{ee(!1)}}return f.memoizedState=[_,o],_},useReducer:function(l,o,f){var _=zn();if(f!==void 0){var x=f(o);if(Ul){ee(!0);try{f(o)}finally{ee(!1)}}}else x=o;return _.memoizedState=_.baseState=x,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:x},_.queue=l,l=l.dispatch=Jc.bind(null,lt,l),[_.memoizedState,l]},useRef:function(l){var o=zn();return l={current:l},o.memoizedState=l},useState:function(l){l=vr(l);var o=l.queue,f=$d.bind(null,lt,o);return o.dispatch=f,[l.memoizedState,f]},useDebugValue:Qc,useDeferredValue:function(l,o){var f=zn();return Zc(f,l,o)},useTransition:function(){var l=vr(!1);return l=Cn.bind(null,lt,l.queue,!0,!1),zn().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,o,f){var _=lt,x=zn();if(_t){if(f===void 0)throw Error(r(407));f=f()}else{if(f=o(),zt===null)throw Error(r(349));(pt&60)!==0||Xd(_,o,f)}x.memoizedState=f;var C={value:f,getSnapshot:o};return x.queue=C,co(Aa.bind(null,_,C,l),[l]),_.flags|=2048,qi(9,Ra.bind(null,_,C,f,o),{destroy:void 0},null),f},useId:function(){var l=zn(),o=zt.identifierPrefix;if(_t){var f=tr,_=er;f=(_&~(1<<32-bi(_)-1)).toString(32)+f,o=":"+o+"R"+f,f=ff++,0<f&&(o+="H"+f.toString(32)),o+=":"}else f=wg++,o=":"+o+"r"+f.toString(32)+":";return l.memoizedState=o},useCacheRefresh:function(){return zn().memoizedState=Wc.bind(null,lt)}};Bl.useMemoCache=oo,Bl.useHostTransitionStatus=ho,Bl.useFormState=kd,Bl.useActionState=kd,Bl.useOptimistic=function(l){var o=zn();o.memoizedState=o.baseState=l;var f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=f,o=Eu.bind(null,lt,!0,f),f.dispatch=o,[l,o]};var Lr={readContext:Vn,use:gu,useCallback:xu,useContext:Vn,useEffect:Kc,useImperativeHandle:Zd,useInsertionEffect:Qy,useLayoutEffect:Qd,useMemo:Wd,useReducer:cl,useRef:uo,useState:function(){return cl(Hn)},useDebugValue:Qc,useDeferredValue:function(l,o){var f=en();return Jd(f,Mt.memoizedState,l,o)},useTransition:function(){var l=cl(Hn)[0],o=en().memoizedState;return[typeof l=="boolean"?l:hn(l),o]},useSyncExternalStore:Xc,useId:fo};Lr.useCacheRefresh=Tu,Lr.useMemoCache=oo,Lr.useHostTransitionStatus=ho,Lr.useFormState=Ky,Lr.useActionState=Ky,Lr.useOptimistic=function(l,o){var f=en();return qd(f,Mt,l,o)};var Ol={readContext:Vn,use:gu,useCallback:xu,useContext:Vn,useEffect:Kc,useImperativeHandle:Zd,useInsertionEffect:Qy,useLayoutEffect:Qd,useMemo:Wd,useReducer:_u,useRef:uo,useState:function(){return _u(Hn)},useDebugValue:Qc,useDeferredValue:function(l,o){var f=en();return Mt===null?Zc(f,l,o):Jd(f,Mt.memoizedState,l,o)},useTransition:function(){var l=_u(Hn)[0],o=en().memoizedState;return[typeof l=="boolean"?l:hn(l),o]},useSyncExternalStore:Xc,useId:fo};Ol.useCacheRefresh=Tu,Ol.useMemoCache=oo,Ol.useHostTransitionStatus=ho,Ol.useFormState=Ls,Ol.useActionState=Ls,Ol.useOptimistic=function(l,o){var f=en();return Mt!==null?qd(f,Mt,l,o):(f.baseState=l,[l,f.queue.dispatch])};var um={isMounted:function(l){return(l=l._reactInternals)?S(l)===l:!1},enqueueSetState:function(l,o,f){l=l._reactInternals;var _=gi(),x=fi(_);x.payload=o,f!=null&&(x.callback=f),o=di(l,x,_),o!==null&&(Ln(o,l,_),pi(o,l,_))},enqueueReplaceState:function(l,o,f){l=l._reactInternals;var _=gi(),x=fi(_);x.tag=1,x.payload=o,f!=null&&(x.callback=f),o=di(l,x,_),o!==null&&(Ln(o,l,_),pi(o,l,_))},enqueueForceUpdate:function(l,o){l=l._reactInternals;var f=gi(),_=fi(f);_.tag=2,o!=null&&(_.callback=o),o=di(l,_,f),o!==null&&(Ln(o,l,f),pi(o,l,f))}},cm=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof l=="object"&&l!==null&&typeof l.message=="string"?String(l.message):String(l),error:l});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},hm=Error(r(461)),Dn=!1,df={dehydrated:null,treeContext:null,retryLane:0},$u=M(null),jr=null,Ha=null,fm=typeof AbortController<"u"?AbortController:function(){var l=[],o=this.signal={aborted:!1,addEventListener:function(f,_){l.push(_)}};this.abort=function(){o.aborted=!0,l.forEach(function(f){return f()})}},hb=ki.unstable_scheduleCallback,fb=ki.unstable_NormalPriority,an={$$typeof:Ga,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Pg=qe.S;qe.S=function(l,o){typeof o=="object"&&o!==null&&typeof o.then=="function"&&gr(l,o),Pg!==null&&Pg(l,o)};var ar=M(null),gs=!1,sn=!1,dm=!1,zg=typeof WeakSet=="function"?WeakSet:Set,Un=null,Hg=!1,mn=null,$i=!1,Va=null,Nl=8192,db={getCacheForType:function(l){var o=Vn(an),f=o.data.get(l);return f===void 0&&(f=l(),o.data.set(l,f)),f}},pf=0,mf=1,yf=2,ec=3,tc=4;if(typeof Symbol=="function"&&Symbol.for){var Vo=Symbol.for;pf=Vo("selector.component"),mf=Vo("selector.has_pseudo_class"),yf=Vo("selector.role"),ec=Vo("selector.test_id"),tc=Vo("selector.text")}var Vg=typeof WeakMap=="function"?WeakMap:Map,Dt=0,zt=null,Ye=null,pt=0,Ut=0,Hi=null,_s=!1,Gl=!1,pm=!1,vs=0,Wt=0,Yr=0,wl=0,mm=0,ea=0,Lo=0,yn=null,La=null,ym=!1,gm=0,nc=1/0,ic=null,bs=null,jo=!1,Ti=null,ga=0,In=0,_m=null,ac=0,Yo=null;return ht.attemptContinuousHydration=function(l){if(l.tag===13){var o=Pn(l,67108864);o!==null&&Ln(o,l,67108864),Ap(l,67108864)}},ht.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13){var o=gi(),f=Pn(l,o);f!==null&&Ln(f,l,o),Ap(l,o)}},ht.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var o=z(l.pendingLanes);if(o!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;o;){var f=1<<31-bi(o);l.entanglements[1]|=f,o&=~f}Xe(l),(Dt&6)===0&&(nc=da()+500,yt(0))}}break;case 13:o=Pn(l,2),o!==null&&Ln(o,l,2),yp(),Ap(l,2)}},ht.batchedUpdates=function(l,o){return l(o)},ht.createComponentSelector=function(l){return{$$typeof:pf,value:l}},ht.createContainer=function(l,o,f,_,x,C,O,H,I,re){return Eo(l,o,!1,null,f,_,C,O,H,I,re,null)},ht.createHasPseudoClassSelector=function(l){return{$$typeof:mf,value:l}},ht.createHydrationContainer=function(l,o,f,_,x,C,O,H,I,re,ye,Ce,Ee){return l=Eo(f,_,!0,l,x,C,H,I,re,ye,Ce,Ee),l.context=bl(null),f=l.current,_=gi(),x=fi(_),x.callback=o??null,di(f,x,_),l.current.lanes=_,se(l,_),Xe(l),l},ht.createPortal=function(l,o,f){var _=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Co,key:_==null?null:""+_,children:l,containerInfo:o,implementation:f}},ht.createRoleSelector=function(l){return{$$typeof:yf,value:l}},ht.createTestNameSelector=function(l){return{$$typeof:ec,value:l}},ht.createTextSelector=function(l){return{$$typeof:tc,value:l}},ht.defaultOnCaughtError=function(l){console.error(l)},ht.defaultOnRecoverableError=function(l){cm(l)},ht.defaultOnUncaughtError=function(l){cm(l)},ht.deferredUpdates=function(l){var o=qe.T,f=Ws();try{return ai(32),qe.T=null,l()}finally{ai(f),qe.T=o}},ht.discreteUpdates=function(l,o,f,_,x){var C=qe.T,O=Ws();try{return ai(2),qe.T=null,l(o,f,_,x)}finally{ai(O),qe.T=C,Dt===0&&(nc=da()+500)}},ht.findAllNodes=Gu,ht.findBoundingRects=function(l,o){if(!Or)throw Error(r(363));o=Gu(l,o),l=[];for(var f=0;f<o.length;f++)l.push(Mo(o[f]));for(o=l.length-1;0<o;o--){f=l[o];for(var _=f.x,x=_+f.width,C=f.y,O=C+f.height,H=o-1;0<=H;H--)if(o!==H){var I=l[H],re=I.x,ye=re+I.width,Ce=I.y,Ee=Ce+I.height;if(_>=re&&C>=Ce&&x<=ye&&O<=Ee){l.splice(o,1);break}else if(_!==re||f.width!==I.width||Ee<C||Ce>O){if(!(C!==Ce||f.height!==I.height||ye<_||re>x)){re>_&&(I.width+=re-_,I.x=_),ye<x&&(I.width=x-re),l.splice(o,1);break}}else{Ce>C&&(I.height+=Ce-C,I.y=C),Ee<O&&(I.height=O-Ce),l.splice(o,1);break}}}return l},ht.findHostInstance=Cp,ht.findHostInstanceWithNoPortals=function(l){return l=E(l),l=l!==null?B(l):null,l===null?null:Ro(l.stateNode)},ht.findHostInstanceWithWarning=function(l){return Cp(l)},ht.flushPassiveEffects=os,ht.flushSyncFromReconciler=function(l){var o=Dt;Dt|=1;var f=qe.T,_=Ws();try{if(ai(2),qe.T=null,l)return l()}finally{ai(_),qe.T=f,Dt=o,(Dt&6)===0&&yt(0)}},ht.flushSyncWork=yp,ht.focusWithin=function(l,o){if(!Or)throw Error(r(363));for(l=Ah(l),o=Uh(l,o),o=Array.from(o),l=0;l<o.length;){var f=o[l++],_=f.tag;if(!Do(f)){if((_===5||_===26||_===27)&&fg(f.stateNode))return!0;for(f=f.child;f!==null;)o.push(f),f=f.sibling}}return!1},ht.getFindAllNodesFailureDescription=function(l,o){if(!Or)throw Error(r(363));var f=0,_=[];l=[Ah(l),0];for(var x=0;x<l.length;){var C=l[x++],O=C.tag,H=l[x++],I=o[H];if((O!==5&&O!==26&&O!==27||!Do(C))&&(Mh(C,I)&&(_.push(Dh(I)),H++,H>f&&(f=H)),H<o.length))for(C=C.child;C!==null;)l.push(C,H),C=C.sibling}if(f<o.length){for(l=[];f<o.length;f++)l.push(Dh(o[f]));return`findAllNodes was able to match part of the selector:
|
|
1269
|
+
`+(_.join(" > ")+`
|
|
1270
|
+
|
|
1271
|
+
No matching component was found for:
|
|
1272
|
+
`)+l.join(" > ")}return null},ht.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Ro(l.child.stateNode);default:return l.child.stateNode}},ht.injectIntoDevTools=function(){var l={bundleType:0,version:sg,rendererPackageName:Q0,currentDispatcherRef:qe,findFiberByHostInstance:Vp,reconcilerVersion:"19.0.0"};if(wa!==null&&(l.rendererConfig=wa),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var o=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(o.isDisabled||!o.supportsFiber)l=!0;else{try{Al=o.inject(l),zi=o}catch{}l=!!o.checkDCE}}return l},ht.isAlreadyRendering=function(){return!1},ht.observeVisibleRects=function(l,o,f,_){if(!Or)throw Error(r(363));l=Gu(l,o);var x=qp(l,f,_).disconnect;return{disconnect:function(){x()}}},ht.shouldError=function(){return null},ht.shouldSuspend=function(){return!1},ht.startHostTransition=function(l,o,f,_){if(l.tag!==5)throw Error(r(476));var x=Su(l).queue;Cn(l,x,o,Tl,f===null?a:function(){var C=Su(l).next.queue;return po(l,C,{},gi()),f(_)})},ht.updateContainer=function(l,o,f,_){var x=o.current,C=gi();return Vh(x,C,l,o,f,_),C},ht.updateContainerSync=function(l,o,f,_){return o.tag===0&&os(),Vh(o.current,2,l,o,f,_),2},ht},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0})}(d0)),d0.exports}var y0={exports:{}};/**
|
|
1273
|
+
* @license React
|
|
1274
|
+
* react-reconciler.development.js
|
|
1275
|
+
*
|
|
1276
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1277
|
+
*
|
|
1278
|
+
* This source code is licensed under the MIT license found in the
|
|
1279
|
+
* LICENSE file in the root directory of this source tree.
|
|
1280
|
+
*/var o2;function SO(){return o2||(o2=1,function(n){process.env.NODE_ENV!=="production"&&(n.exports=function(e){function t(i,s){for(i=i.memoizedState;i!==null&&0<s;)i=i.next,s--;return i}function a(i,s,c,p){if(c>=s.length)return p;var g=s[c],v=Mn(i)?i.slice():jn({},i);return v[g]=a(i[g],s,c+1,p),v}function r(i,s,c){if(s.length!==c.length)console.warn("copyWithRename() expects paths of the same length");else{for(var p=0;p<c.length-1;p++)if(s[p]!==c[p]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return u(i,s,c,0)}}function u(i,s,c,p){var g=s[p],v=Mn(i)?i.slice():jn({},i);return p+1===s.length?(v[c[p]]=v[g],Mn(v)?v.splice(g,1):delete v[g]):v[g]=u(i[g],s,c,p+1),v}function h(i,s,c){var p=s[c],g=Mn(i)?i.slice():jn({},i);return c+1===s.length?(Mn(g)?g.splice(p,1):delete g[p],g):(g[p]=h(i[p],s,c+1),g)}function d(){return!1}function m(){return null}function y(i,s,c,p){return new sb(i,s,c,p)}function b(i,s){i.context===ga&&(Jh(s,i,null,null),Or())}function S(i,s){if(As!==null){var c=s.staleFamilies;s=s.updatedFamilies,Nr(),Zp(i.current,s,c),Or()}}function T(i){As=i}function E(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function A(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function B(){}function M(){}function G(i){var s=[];return i.forEach(function(c){s.push(c)}),s.sort().join(", ")}function w(i){return i===null||typeof i!="object"?null:(i=Iu&&i[Iu]||i["@@iterator"],typeof i=="function"?i:null)}function P(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===am?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case Rl:return"Fragment";case nn:return"Portal";case im:return"Profiler";case ef:return"StrictMode";case Pr:return"Suspense";case bi:return"SuspenseList"}if(typeof i=="object")switch(typeof i.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),i.$$typeof){case Pa:return(i.displayName||"Context")+".Provider";case tf:return(i._context.displayName||"Context")+".Consumer";case hs:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case nf:return s=i.displayName||null,s!==null?s:P(i.type)||"Memo";case Wi:s=i._payload,i=i._init;try{return P(i(s))}catch{}}return null}function z(i){var s=i.type;switch(i.tag){case 24:return"Cache";case 9:return(s._context.displayName||"Context")+".Consumer";case 10:return(s.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=s.render,i=i.displayName||i.name||"",s.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return P(s);case 8:return s===ef?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;break;case 29:if(s=i._debugInfo,s!=null){for(var c=s.length-1;0<=c;c--)if(typeof s[c].name=="string")return s[c].name}if(i.return!==null)return z(i.return)}return null}function Z(){}function ie(){if(ku===0){da=console.log,sm=console.info,Ug=console.warn,sf=console.error,Bg=console.group,Og=console.groupCollapsed,Ng=console.groupEnd;var i={configurable:!0,enumerable:!0,value:Z,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}ku++}function ne(){if(ku--,ku===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:jn({},i,{value:da}),info:jn({},i,{value:sm}),warn:jn({},i,{value:Ug}),error:jn({},i,{value:sf}),group:jn({},i,{value:Bg}),groupCollapsed:jn({},i,{value:Og}),groupEnd:jn({},i,{value:Ng})})}0>ku&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Se(i){if(Al===void 0)try{throw Error()}catch(c){var s=c.stack.trim().match(/\n( *(at )?)/);Al=s&&s[1]||"",zi=-1<c.stack.indexOf(`
|
|
1281
|
+
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
1282
|
+
`+Al+i+zi}function _e(i,s){if(!i||xi)return"";var c=rf.get(i);if(c!==void 0)return c;xi=!0,c=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var p=null;p=$.H,$.H=null,ie();try{var g={DetermineComponentFrameRoot:function(){try{if(s){var Re=function(){throw Error()};if(Object.defineProperty(Re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Re,[])}catch(At){var mt=At}Reflect.construct(i,[],Re)}else{try{Re.call()}catch(At){mt=At}i.call(Re.prototype)}}else{try{throw Error()}catch(At){mt=At}(Re=i())&&typeof Re.catch=="function"&&Re.catch(function(){})}}catch(At){if(At&&mt&&typeof At.stack=="string")return[At.stack,mt.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var v=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");v&&v.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var R=g.DetermineComponentFrameRoot(),N=R[0],Y=R[1];if(N&&Y){var J=N.split(`
|
|
1283
|
+
`),fe=Y.split(`
|
|
1284
|
+
`);for(R=v=0;v<J.length&&!J[v].includes("DetermineComponentFrameRoot");)v++;for(;R<fe.length&&!fe[R].includes("DetermineComponentFrameRoot");)R++;if(v===J.length||R===fe.length)for(v=J.length-1,R=fe.length-1;1<=v&&0<=R&&J[v]!==fe[R];)R--;for(;1<=v&&0<=R;v--,R--)if(J[v]!==fe[R]){if(v!==1||R!==1)do if(v--,R--,0>R||J[v]!==fe[R]){var xe=`
|
|
1285
|
+
`+J[v].replace(" at new "," at ");return i.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",i.displayName)),typeof i=="function"&&rf.set(i,xe),xe}while(1<=v&&0<=R);break}}}finally{xi=!1,$.H=p,ne(),Error.prepareStackTrace=c}return J=(J=i?i.displayName||i.name:"")?Se(J):"",typeof i=="function"&&rf.set(i,J),J}function me(i){switch(i.tag){case 26:case 27:case 5:return Se(i.type);case 16:return Se("Lazy");case 13:return Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return i=_e(i.type,!1),i;case 11:return i=_e(i.type.render,!1),i;case 1:return i=_e(i.type,!0),i;default:return""}}function se(i){try{var s="";do{s+=me(i);var c=i._debugInfo;if(c)for(var p=c.length-1;0<=p;p--){var g=c[p];if(typeof g.name=="string"){var v=s,R=g.env,N=Se(g.name+(R?" ["+R+"]":""));s=v+N}}i=i.return}while(i);return s}catch(Y){return`
|
|
1286
|
+
Error generating stack: `+Y.message+`
|
|
1287
|
+
`+Y.stack}}function Le(){return Yn===null?"":se(Yn)}function ae(i,s,c,p,g,v,R){var N=Yn;$.getCurrentStack=i===null?null:Le,Xn=!1,Yn=i;try{return s(c,p,g,v,R)}finally{Yn=N}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function We(i){var s=i,c=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(c=s.return),i=s.return;while(i)}return s.tag===3?c:null}function St(i){if(We(i)!==i)throw Error("Unable to find node on an unmounted component.")}function j(i){var s=i.alternate;if(!s){if(s=We(i),s===null)throw Error("Unable to find node on an unmounted component.");return s!==i?null:i}for(var c=i,p=s;;){var g=c.return;if(g===null)break;var v=g.alternate;if(v===null){if(p=g.return,p!==null){c=p;continue}break}if(g.child===v.child){for(v=g.child;v;){if(v===c)return St(g),i;if(v===p)return St(g),s;v=v.sibling}throw Error("Unable to find node on an unmounted component.")}if(c.return!==p.return)c=g,p=v;else{for(var R=!1,N=g.child;N;){if(N===c){R=!0,c=g,p=v;break}if(N===p){R=!0,p=g,c=v;break}N=N.sibling}if(!R){for(N=v.child;N;){if(N===c){R=!0,c=v,p=g;break}if(N===p){R=!0,p=v,c=g;break}N=N.sibling}if(!R)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(c.alternate!==p)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(c.tag!==3)throw Error("Unable to find node on an unmounted component.");return c.stateNode.current===c?i:s}function ee(i){return i=j(i),i!==null?de(i):null}function de(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=de(i),s!==null)return s;i=i.sibling}return null}function pe(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(i.tag!==4&&(s=pe(i),s!==null))return s;i=i.sibling}return null}function U(i){return{current:i}}function k(i,s){0>Ti?console.error("Unexpected pop."):(s!==jo[Ti]&&console.error("Unexpected Fiber popped."),i.current=bs[Ti],bs[Ti]=null,jo[Ti]=null,Ti--)}function oe(i,s,c){Ti++,bs[Ti]=i.current,jo[Ti]=c,i.current=s}function be(i){return i>>>=0,i===0?32:31-(_m(i)/ac|0)|0}function Ae(i){if(i&1)return"SyncHydrationLane";if(i&2)return"Sync";if(i&4)return"InputContinuousHydration";if(i&8)return"InputContinuous";if(i&16)return"DefaultHydration";if(i&32)return"Default";if(i&64)return"TransitionHydration";if(i&4194176)return"Transition";if(i&62914560)return"Retry";if(i&67108864)return"SelectiveHydration";if(i&134217728)return"IdleHydration";if(i&268435456)return"Idle";if(i&536870912)return"Offscreen";if(i&1073741824)return"Deferred"}function De(i){var s=i&42;if(s!==0)return s;switch(i&-i){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),i}}function ze(i,s){var c=i.pendingLanes;if(c===0)return 0;var p=0,g=i.suspendedLanes,v=i.pingedLanes,R=i.warmLanes;i=i.finishedLanes!==0;var N=c&134217727;return N!==0?(c=N&~g,c!==0?p=De(c):(v&=N,v!==0?p=De(v):i||(R=N&~R,R!==0&&(p=De(R))))):(N=c&~g,N!==0?p=De(N):v!==0?p=De(v):i||(R=c&~R,R!==0&&(p=De(R)))),p===0?0:s!==0&&s!==p&&(s&g)===0&&(g=p&-p,R=s&-s,g>=R||g===32&&(R&4194176)!==0)?s:p}function wt(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function je(i,s){switch(i){case 1:case 2:case 4:case 8:return s+250;case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return s+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 console.error("Should have found matching lanes. This is a bug in React."),-1}}function $t(){var i=Yo;return Yo<<=1,(Yo&4194176)===0&&(Yo=128),i}function Ni(){var i=l;return l<<=1,(l&62914560)===0&&(l=4194304),i}function Wn(i){for(var s=[],c=0;31>c;c++)s.push(i);return s}function cn(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Jn(i,s,c,p,g,v){var R=i.pendingLanes;i.pendingLanes=c,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=c,i.entangledLanes&=c,i.errorRecoveryDisabledLanes&=c,i.shellSuspendCounter=0;var N=i.entanglements,Y=i.expirationTimes,J=i.hiddenUpdates;for(c=R&~c;0<c;){var fe=31-In(c),xe=1<<fe;N[fe]=0,Y[fe]=-1;var Re=J[fe];if(Re!==null)for(J[fe]=null,fe=0;fe<Re.length;fe++){var mt=Re[fe];mt!==null&&(mt.lane&=-536870913)}c&=~xe}p!==0&&$n(i,p,0),v!==0&&g===0&&i.tag!==0&&(i.suspendedLanes|=v&~(R&~s))}function $n(i,s,c){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-In(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|c&4194218}function wn(i,s){var c=i.entangledLanes|=s;for(i=i.entanglements;c;){var p=31-In(c),g=1<<p;g&s|i[p]&s&&(i[p]|=s),c&=~g}}function xn(i,s,c){if(kn)for(i=i.pendingUpdatersLaneMap;0<c;){var p=31-In(c),g=1<<p;i[p].add(s),c&=~g}}function Pn(i,s){if(kn)for(var c=i.pendingUpdatersLaneMap,p=i.memoizedUpdaters;0<s;){var g=31-In(s);i=1<<g,g=c[g],0<g.size&&(g.forEach(function(v){var R=v.alternate;R!==null&&p.has(R)||p.add(v)}),g.clear()),s&=~i}}function yr(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ll(i){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var s=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(s.isDisabled)return!0;if(!s.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{Ee=s.inject(i),Ne=s}catch(c){console.error("React instrumentation encountered an error: %s.",c)}return!!s.checkDCE}function Xe(i,s){if(Ne&&typeof Ne.onCommitFiberRoot=="function")try{var c=(i.current.flags&128)===128;switch(s){case 2:var p=O;break;case 8:p=H;break;case 32:p=I;break;case 268435456:p=re;break;default:p=I}Ne.onCommitFiberRoot(Ee,i,p,c)}catch(g){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",g))}}function yt(i){if(typeof ye=="function"&&Ce(i),Ne&&typeof Ne.setStrictMode=="function")try{Ne.setStrictMode(Ee,i)}catch(s){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",s))}}function Vc(i){ve=i}function no(){ve!==null&&typeof ve.markCommitStopped=="function"&&ve.markCommitStopped()}function Ps(i){ve!==null&&typeof ve.markComponentRenderStarted=="function"&&ve.markComponentRenderStarted(i)}function Za(){ve!==null&&typeof ve.markComponentRenderStopped=="function"&&ve.markComponentRenderStopped()}function Lc(i){ve!==null&&typeof ve.markRenderStarted=="function"&&ve.markRenderStarted(i)}function io(){ve!==null&&typeof ve.markRenderStopped=="function"&&ve.markRenderStopped()}function gr(i,s){ve!==null&&typeof ve.markStateUpdateScheduled=="function"&&ve.markStateUpdateScheduled(i,s)}function pu(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}function ei(i,s){if(typeof i=="object"&&i!==null){var c=q.get(i);return c!==void 0?c:(s={value:i,source:s,stack:se(s)},q.set(i,s),s)}return{value:i,source:s,stack:se(s)}}function la(i,s){pi(),W[ce++]=Bt,W[ce++]=Be,Be=i,Bt=s}function zs(i,s,c){pi(),Oe[Ze++]=nt,Oe[Ze++]=li,Oe[Ze++]=It,It=i;var p=nt;i=li;var g=32-In(p)-1;p&=~(1<<g),c+=1;var v=32-In(s)+g;if(30<v){var R=g-g%5;v=(p&(1<<R)-1).toString(32),p>>=R,g-=R,nt=1<<32-In(s)+g|c<<g|p,li=v+i}else nt=1<<v|c<<g|p,li=i}function fi(i){pi(),i.return!==null&&(la(i,1),zs(i,1,0))}function di(i){for(;i===Be;)Be=W[--ce],W[ce]=null,Bt=W[--ce],W[ce]=null;for(;i===It;)It=Oe[--Ze],Oe[Ze]=null,li=Oe[--Ze],Oe[Ze]=null,nt=Oe[--Ze],Oe[Ze]=null}function pi(){vt||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function Xi(i){return i===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),i}function D(i,s){oe(Xo,s,i),oe(vm,i,i),oe(Xr,null,i),s=er(s),k(Xr,i),oe(Xr,s,i)}function F(i){k(Xr,i),k(vm,i),k(Xo,i)}function he(){return Xi(Xr.current)}function Te(i){i.memoizedState!==null&&oe(Lg,i,i);var s=Xi(Xr.current),c=tr(s,i.type);s!==c&&(oe(vm,i,i),oe(Xr,c,i))}function Ue(i){vm.current===i&&(k(Xr,i),k(vm,i)),Lg.current===i&&(k(Lg,i),dn?ir._currentValue=ps:ir._currentValue2=ps)}function tt(i,s){return i.serverProps===void 0&&i.serverTail.length===0&&i.children.length===1&&3<i.distanceFromLeaf&&i.distanceFromLeaf>15-s?tt(i.children[0],s):i}function we(i){return" "+" ".repeat(i)}function ct(i){return"+ "+" ".repeat(i)}function Fe(i){return"- "+" ".repeat(i)}function Gi(i){switch(i.tag){case 26:case 27:case 5:return i.type;case 16:return"Lazy";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return i=i.type,i.displayName||i.name||null;case 11:return i=i.type.render,i.displayName||i.name||null;case 1:return i=i.type,i.displayName||i.name||null;default:return null}}function ti(i,s){return RC.test(i)?(i=JSON.stringify(i),i.length>s-2?8>s?'{"..."}':"{"+i.slice(0,s-7)+'..."}':"{"+i+"}"):i.length>s?5>s?'{"..."}':i.slice(0,s-3)+"...":i}function Hs(i,s,c){var p=120-2*c;if(s===null)return ct(c)+ti(i,p)+`
|
|
1288
|
+
`;if(typeof s=="string"){for(var g=0;g<s.length&&g<i.length&&s.charCodeAt(g)===i.charCodeAt(g);g++);return g>p-8&&10<g&&(i="..."+i.slice(g-8),s="..."+s.slice(g-8)),ct(c)+ti(i,p)+`
|
|
1289
|
+
`+Fe(c)+ti(s,p)+`
|
|
1290
|
+
`}return we(c)+ti(i,p)+`
|
|
1291
|
+
`}function ao(i){return Object.prototype.toString.call(i).replace(/^\[object (.*)\]$/,function(s,c){return c})}function so(i,s){switch(typeof i){case"string":return i=JSON.stringify(i),i.length>s?5>s?'"..."':i.slice(0,s-4)+'..."':i;case"object":if(i===null)return"null";if(Mn(i))return"[...]";if(i.$$typeof===Cl)return(s=P(i.type))?"<"+s+">":"<...>";var c=ao(i);if(c==="Object"){c="",s-=2;for(var p in i)if(i.hasOwnProperty(p)){var g=JSON.stringify(p);if(g!=='"'+p+'"'&&(p=g),s-=p.length-2,g=so(i[p],15>s?s:15),s-=g.length,0>s){c+=c===""?"...":", ...";break}c+=(c===""?"":",")+p+":"+g}return"{"+c+"}"}return c;case"function":return(s=i.displayName||i.name)?"function "+s:"function";default:return String(i)}}function ol(i,s){return typeof i!="string"||RC.test(i)?"{"+so(i,s-2)+"}":i.length>s-2?5>s?'"..."':'"'+i.slice(0,s-5)+'..."':'"'+i+'"'}function mu(i,s,c){var p=120-c.length-i.length,g=[],v;for(v in s)if(s.hasOwnProperty(v)&&v!=="children"){var R=ol(s[v],120-c.length-v.length-1);p-=v.length+R.length+2,g.push(v+"="+R)}return g.length===0?c+"<"+i+`>
|
|
1292
|
+
`:0<p?c+"<"+i+" "+g.join(" ")+`>
|
|
1293
|
+
`:c+"<"+i+`
|
|
1294
|
+
`+c+" "+g.join(`
|
|
1295
|
+
`+c+" ")+`
|
|
1296
|
+
`+c+`>
|
|
1297
|
+
`}function Ld(i,s,c){var p="",g=jn({},s),v;for(v in i)if(i.hasOwnProperty(v)){delete g[v];var R=120-2*c-v.length-2,N=so(i[v],R);s.hasOwnProperty(v)?(R=so(s[v],R),p+=ct(c)+v+": "+N+`
|
|
1298
|
+
`,p+=Fe(c)+v+": "+R+`
|
|
1299
|
+
`):p+=ct(c)+v+": "+N+`
|
|
1300
|
+
`}for(var Y in g)g.hasOwnProperty(Y)&&(i=so(g[Y],120-2*c-Y.length-2),p+=Fe(c)+Y+": "+i+`
|
|
1301
|
+
`);return p}function _r(i,s,c,p){var g="",v=new Map;for(J in c)c.hasOwnProperty(J)&&v.set(J.toLowerCase(),J);if(v.size===1&&v.has("children"))g+=mu(i,s,we(p));else{for(var R in s)if(s.hasOwnProperty(R)&&R!=="children"){var N=120-2*(p+1)-R.length-1,Y=v.get(R.toLowerCase());if(Y!==void 0){v.delete(R.toLowerCase());var J=s[R];Y=c[Y];var fe=ol(J,N);N=ol(Y,N),typeof J=="object"&&J!==null&&typeof Y=="object"&&Y!==null&&ao(J)==="Object"&&ao(Y)==="Object"&&(2<Object.keys(J).length||2<Object.keys(Y).length||-1<fe.indexOf("...")||-1<N.indexOf("..."))?g+=we(p+1)+R+`={{
|
|
1302
|
+
`+Ld(J,Y,p+2)+we(p+1)+`}}
|
|
1303
|
+
`:(g+=ct(p+1)+R+"="+fe+`
|
|
1304
|
+
`,g+=Fe(p+1)+R+"="+N+`
|
|
1305
|
+
`)}else g+=we(p+1)+R+"="+ol(s[R],N)+`
|
|
1306
|
+
`}v.forEach(function(xe){if(xe!=="children"){var Re=120-2*(p+1)-xe.length-1;g+=Fe(p+1)+xe+"="+ol(c[xe],Re)+`
|
|
1307
|
+
`}}),g=g===""?we(p)+"<"+i+`>
|
|
1308
|
+
`:we(p)+"<"+i+`
|
|
1309
|
+
`+g+we(p)+`>
|
|
1310
|
+
`}return i=c.children,s=s.children,typeof i=="string"||typeof i=="number"||typeof i=="bigint"?(v="",(typeof s=="string"||typeof s=="number"||typeof s=="bigint")&&(v=""+s),g+=Hs(v,""+i,p+1)):(typeof s=="string"||typeof s=="number"||typeof s=="bigint")&&(g=i==null?g+Hs(""+s,null,p+1):g+Hs(""+s,void 0,p+1)),g}function jd(i,s){var c=Gi(i);if(c===null){for(c="",i=i.child;i;)c+=jd(i,s),i=i.sibling;return c}return we(s)+"<"+c+`>
|
|
1311
|
+
`}function Wa(i,s){var c=tt(i,s);if(c!==i&&(i.children.length!==1||i.children[0]!==c))return we(s)+`...
|
|
1312
|
+
`+Wa(c,s+1);c="";var p=i.fiber._debugInfo;if(p)for(var g=0;g<p.length;g++){var v=p[g].name;typeof v=="string"&&(c+=we(s)+"<"+v+`>
|
|
1313
|
+
`,s++)}if(p="",g=i.fiber.pendingProps,i.fiber.tag===6)p=Hs(g,i.serverProps,s),s++;else if(v=Gi(i.fiber),v!==null)if(i.serverProps===void 0){p=s;var R=120-2*p-v.length-2,N="";for(J in g)if(g.hasOwnProperty(J)&&J!=="children"){var Y=ol(g[J],15);if(R-=J.length+Y.length+2,0>R){N+=" ...";break}N+=" "+J+"="+Y}p=we(p)+"<"+v+N+`>
|
|
1314
|
+
`,s++}else i.serverProps===null?(p=mu(v,g,ct(s)),s++):typeof i.serverProps=="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(p=_r(v,g,i.serverProps,s),s++);var J="";for(g=i.fiber.child,v=0;g&&v<i.children.length;)R=i.children[v],R.fiber===g?(J+=Wa(R,s),v++):J+=jd(g,s),g=g.sibling;for(g&&0<i.children.length&&(J+=we(s)+`...
|
|
1315
|
+
`),g=i.serverTail,i.serverProps===null&&s--,i=0;i<g.length;i++)v=g[i],J=typeof v=="string"?J+(Fe(s)+ti(v,120-2*s)+`
|
|
1316
|
+
`):J+mu(v.type,v.props,Fe(s));return c+p+J}function Ja(i){try{return`
|
|
1317
|
+
|
|
1318
|
+
`+Wa(i,0)}catch{return""}}function $a(i,s){if(i.return===null){if(xs===null)xs={fiber:i,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:s};else{if(xs.fiber!==i)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");xs.distanceFromLeaf>s&&(xs.distanceFromLeaf=s)}return xs}var c=$a(i.return,s+1).children;return 0<c.length&&c[c.length-1].fiber===i?(c=c[c.length-1],c.distanceFromLeaf>s&&(c.distanceFromLeaf=s),c):(s={fiber:i,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:s},c.push(s),s)}function Qt(i,s){Pl||(i=$a(i,0),i.serverProps=null,s!==null&&(s=Vg(s),i.serverTail.push(s)))}function Vs(i){var s="",c=xs;throw c!==null&&(xs=null,s=Ja(c)),ul(ei(Error(`Hydration failed because the server rendered HTML didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
|
|
1319
|
+
|
|
1320
|
+
- A server/client branch \`if (typeof window !== 'undefined')\`.
|
|
1321
|
+
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
|
|
1322
|
+
- Date formatting in a user's locale which doesn't match the server.
|
|
1323
|
+
- External changing data without sending a snapshot of it along with the HTML.
|
|
1324
|
+
- Invalid HTML tag nesting.
|
|
1325
|
+
|
|
1326
|
+
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
|
|
1327
|
+
|
|
1328
|
+
https://react.dev/link/hydration-mismatch`+s),i)),pb}function jc(i,s){if(!Si)throw Error("Expected prepareToHydrateHostInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");mn(i.stateNode,i.type,i.memoizedProps,s,i)||Vs(i)}function Yd(i){for(ta=i.return;ta;)switch(ta.tag){case 3:case 27:qr=!0;return;case 5:case 13:qr=!1;return;default:ta=ta.return}}function ro(i){if(!Si||i!==ta)return!1;if(!vt)return Yd(i),vt=!0,!1;var s=!1;if(yn?i.tag!==3&&i.tag!==27&&(i.tag!==5||ec(i.type)&&!Sn(i.type,i.memoizedProps))&&(s=!0):i.tag!==3&&(i.tag!==5||ec(i.type)&&!Sn(i.type,i.memoizedProps))&&(s=!0),s&&Ei){for(s=Ei;s;){var c=$a(i,0),p=Vg(s);c.serverTail.push(p),s=p.type==="Suspense"?Nl(s):ar(s)}Vs(i)}if(Yd(i),i.tag===13){if(!Si)throw Error("Expected skipPastDehydratedSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Ei=Nl(i)}else Ei=ta?ar(i.stateNode):null;return!0}function yu(){Si&&(Ei=ta=null,Pl=vt=!1)}function ul(i){sr===null?sr=[i]:sr.push(i)}function Yc(){var i=xs;i!==null&&(xs=null,i=Ja(i),console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
|
|
1329
|
+
|
|
1330
|
+
- A server/client branch \`if (typeof window !== 'undefined')\`.
|
|
1331
|
+
- Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
|
|
1332
|
+
- Date formatting in a user's locale which doesn't match the server.
|
|
1333
|
+
- External changing data without sending a snapshot of it along with the HTML.
|
|
1334
|
+
- Invalid HTML tag nesting.
|
|
1335
|
+
|
|
1336
|
+
It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
|
|
1337
|
+
|
|
1338
|
+
%s%s`,"https://react.dev/link/hydration-mismatch",i))}function lo(){for(var i=gf,s=mb=gf=0;s<i;){var c=Ss[s];Ss[s++]=null;var p=Ss[s];Ss[s++]=null;var g=Ss[s];Ss[s++]=null;var v=Ss[s];if(Ss[s++]=null,p!==null&&g!==null){var R=p.pending;R===null?g.next=g:(g.next=R.next,R.next=g),p.pending=g}v!==0&&gu(c,g,v)}}function zn(i,s,c,p){Ss[gf++]=i,Ss[gf++]=s,Ss[gf++]=c,Ss[gf++]=p,mb|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function en(i,s,c,p){return zn(i,s,c,p),oo(i)}function hn(i,s){return zn(i,null,null,s),oo(i)}function gu(i,s,c){i.lanes|=c;var p=i.alternate;p!==null&&(p.lanes|=c);for(var g=!1,v=i.return;v!==null;)v.childLanes|=c,p=v.alternate,p!==null&&(p.childLanes|=c),v.tag===22&&(i=v.stateNode,i===null||i._visibility&1||(g=!0)),i=v,v=v.return;g&&s!==null&&i.tag===3&&(v=i.stateNode,g=31-In(c),v=v.hiddenUpdates,i=v[g],i===null?v[g]=[s]:i.push(s),s.lane=c|536870912)}function oo(i){if(Lm>n5)throw gc=Lm=0,jm=Ib=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");gc>i5&&(gc=0,jm=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),i.alternate===null&&(i.flags&4098)!==0&&xg(i);for(var s=i,c=s.return;c!==null;)s.alternate===null&&(s.flags&4098)!==0&&xg(i),s=c,c=s.return;return s.tag===3?s.stateNode:null}function Hn(){var i=sc;return sc=0,i}function cl(i){var s=sc;return sc=i,s}function hl(i){var s=sc;return sc+=i,s}function _u(i){_a=_f(),0>i.actualStartTime&&(i.actualStartTime=_a)}function Xc(i){if(0<=_a){var s=_f()-_a;i.actualDuration+=s,i.selfBaseDuration=s,_a=-1}}function Xd(i){if(0<=_a){var s=_f()-_a;i.actualDuration+=s,_a=-1}}function Ra(){if(0<=_a){var i=_f()-_a;_a=-1,sc+=i}}function Aa(){_a=_f()}function vu(i){for(var s=i.child;s;)i.actualDuration+=s.actualDuration,s=s.sibling}function Ma(i){i!==vf&&i.next===null&&(vf===null?qg=vf=i:vf=vf.next=i),Fg=!0,$.actQueue!==null?gb||(gb=!0,Fc(qd)):yb||(yb=!0,Fc(qd))}function vr(i,s){if(!_b&&Fg){_b=!0;do for(var c=!1,p=qg;p!==null;){if(i!==0){var g=p.pendingLanes;if(g===0)var v=0;else{var R=p.suspendedLanes,N=p.pingedLanes;v=(1<<31-In(42|i)+1)-1,v&=g&~(R&~N),v=v&201326677?v&201326677|1:v?v|2:0}v!==0&&(c=!0,Id(p,v))}else v=dt,v=ze(p,p===Yt?v:0),(v&3)===0||wt(p,v)||(c=!0,Id(p,v));p=p.next}while(c);_b=!1}}function qd(){Fg=gb=yb=!1;var i=0;bf!==0&&(Zu()&&(i=bf),bf=0);for(var s=C(),c=null,p=qg;p!==null;){var g=p.next,v=Iy(p,s);v===0?(p.next=null,c===null?qg=g:c.next=g,g===null&&(vf=c)):(c=p,(i!==0||(v&3)!==0)&&(Fg=!0)),p=g}vr(i)}function Iy(i,s){for(var c=i.suspendedLanes,p=i.pingedLanes,g=i.expirationTimes,v=i.pendingLanes&-62914561;0<v;){var R=31-In(v),N=1<<R,Y=g[R];Y===-1?((N&c)===0||(N&p)!==0)&&(g[R]=je(N,s)):Y<=s&&(i.expiredLanes|=N),v&=~N}if(s=Yt,c=dt,c=ze(i,i===s?c:0),p=i.callbackNode,c===0||i===s&&Xt===pc||i.cancelPendingCommit!==null)return p!==null&&qc(p),i.callbackNode=null,i.callbackPriority=0;if((c&3)===0||wt(i,c)){if(s=c&-c,s!==i.callbackPriority||$.actQueue!==null&&p!==vb)qc(p);else return s;switch(yr(c)){case 2:case 8:c=H;break;case 32:c=I;break;case 268435456:c=re;break;default:c=I}return p=Fd.bind(null,i),$.actQueue!==null?($.actQueue.push(p),c=vb):c=o(c,p),i.callbackPriority=s,i.callbackNode=c,s}return p!==null&&qc(p),i.callbackPriority=2,i.callbackNode=null,2}function Fd(i,s){Xg=Yg=!1;var c=i.callbackNode;if(Nr()&&i.callbackNode!==c)return null;var p=dt;return p=ze(i,i===Yt?p:0),p===0?null:(Tl(i,p,s),Iy(i,C()),i.callbackNode!=null&&i.callbackNode===c?Fd.bind(null,i):null)}function Id(i,s){if(Nr())return null;Yg=Xg,Xg=!1,Tl(i,s,!0)}function qc(i){i!==vb&&i!==null&&f(i)}function Fc(i){$.actQueue!==null&&$.actQueue.push(function(){return i(),null}),wo?Wu(function(){(Ot&(Li|kr))!==aa?o(O,i):i()}):o(O,i)}function Ic(){return bf===0&&(bf=$t()),bf}function ky(i,s){if(bm===null){var c=bm=[];bb=0,rc=Ic(),xf={status:"pending",value:void 0,then:function(p){c.push(p)}}}return bb++,s.then(kd,kd),s}function kd(){if(--bb===0&&bm!==null){xf!==null&&(xf.status="fulfilled");var i=bm;bm=null,rc=0,xf=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function Ky(i,s){var c=[],p={status:"pending",value:null,reason:null,then:function(g){c.push(g)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var g=0;g<c.length;g++)(0,c[g])(s)},function(g){for(p.status="rejected",p.reason=g,g=0;g<c.length;g++)(0,c[g])(void 0)}),p}function kc(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kd(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ls(i){return{lane:i,tag:AC,payload:null,callback:null,next:null}}function qi(i,s,c){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,Sb===p&&!UC){var g=z(i);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.
|
|
1339
|
+
|
|
1340
|
+
Please update the following component: %s`,g),UC=!0}return(Ot&Li)!==aa?(g=p.pending,g===null?s.next=s:(s.next=g.next,g.next=s),p.pending=s,s=oo(i),gu(i,null,c),s):(zn(i,p,s,c),oo(i))}function uo(i,s,c){if(s=s.updateQueue,s!==null&&(s=s.shared,(c&4194176)!==0)){var p=s.lanes;p&=i.pendingLanes,c|=p,s.lanes=c,wn(i,c)}}function fl(i,s){var c=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var g=null,v=null;if(c=c.firstBaseUpdate,c!==null){do{var R={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};v===null?g=v=R:v=v.next=R,c=c.next}while(c!==null);v===null?g=v=s:v=v.next=s}else g=v=s;c={baseState:p.baseState,firstBaseUpdate:g,lastBaseUpdate:v,shared:p.shared,callbacks:p.callbacks},i.updateQueue=c;return}i=c.lastBaseUpdate,i===null?c.firstBaseUpdate=s:i.next=s,c.lastBaseUpdate=s}function br(){if(Tb){var i=xf;if(i!==null)throw i}}function co(i,s,c,p){Tb=!1;var g=i.updateQueue;qo=!1,Sb=g.shared;var v=g.firstBaseUpdate,R=g.lastBaseUpdate,N=g.shared.pending;if(N!==null){g.shared.pending=null;var Y=N,J=Y.next;Y.next=null,R===null?v=J:R.next=J,R=Y;var fe=i.alternate;fe!==null&&(fe=fe.updateQueue,N=fe.lastBaseUpdate,N!==R&&(N===null?fe.firstBaseUpdate=J:N.next=J,fe.lastBaseUpdate=Y))}if(v!==null){var xe=g.baseState;R=0,fe=J=Y=null,N=v;do{var Re=N.lane&-536870913,mt=Re!==N.lane;if(mt?(dt&Re)===Re:(p&Re)===Re){Re!==0&&Re===rc&&(Tb=!0),fe!==null&&(fe=fe.next={lane:0,tag:N.tag,payload:N.payload,callback:null,next:null});e:{Re=i;var At=N,Lf=s,jf=c;switch(At.tag){case MC:if(At=At.payload,typeof At=="function"){Bf=!0;var ur=At.call(jf,xe,Lf);if(Re.mode&8){yt(!0);try{At.call(jf,xe,Lf)}finally{yt(!1)}}Bf=!1,xe=ur;break e}xe=At;break e;case xb:Re.flags=Re.flags&-65537|128;case AC:if(ur=At.payload,typeof ur=="function"){if(Bf=!0,At=ur.call(jf,xe,Lf),Re.mode&8){yt(!0);try{ur.call(jf,xe,Lf)}finally{yt(!1)}}Bf=!1}else At=ur;if(At==null)break e;xe=jn({},xe,At);break e;case DC:qo=!0}}Re=N.callback,Re!==null&&(i.flags|=64,mt&&(i.flags|=8192),mt=g.callbacks,mt===null?g.callbacks=[Re]:mt.push(Re))}else mt={lane:Re,tag:N.tag,payload:N.payload,callback:N.callback,next:null},fe===null?(J=fe=mt,Y=xe):fe=fe.next=mt,R|=Re;if(N=N.next,N===null){if(N=g.shared.pending,N===null)break;mt=N,N=mt.next,mt.next=null,g.lastBaseUpdate=mt,g.shared.pending=null}}while(!0);fe===null&&(Y=xe),g.baseState=Y,g.firstBaseUpdate=J,g.lastBaseUpdate=fe,v===null&&(g.shared.lanes=0),Zo|=R,i.lanes=R,i.memoizedState=xe}Sb=null}function Kc(i,s){if(typeof i!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+i);i.call(s)}function Qy(i,s){var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Kc(c[i],s)}function Qd(i,s){var c=i.callbacks;if(c!==null)for(i.callbacks=null,i=0;i<c.length;i++)Kc(c[i],s)}function bu(i,s){if(K(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var c=Object.keys(i),p=Object.keys(s);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var g=c[p];if(!FG.call(s,g)||!K(i[g],s[g]))return!1}return!0}function Zd(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function Qc(i){return i=i.status,i==="fulfilled"||i==="rejected"}function xu(){}function Wd(i,s,c){$.actQueue!==null&&($.didUsePromise=!0);var p=i.thenables;switch(c=p[c],c===void 0?p.push(s):c!==s&&(i.didWarnAboutUncachedPromise||(i.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),s.then(xu,xu),s=c),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Jd(i),i;default:if(typeof s.status=="string")s.then(xu,xu);else{if(i=Yt,i!==null&&100<i.shellSuspendCounter)throw Error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");i=s,i.status="pending",i.then(function(g){if(s.status==="pending"){var v=s;v.status="fulfilled",v.value=g}},function(g){if(s.status==="pending"){var v=s;v.status="rejected",v.reason=g}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Jd(i),i}throw Sf=s,Qg=!0,kg}}function Zc(){if(Sf===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var i=Sf;return Sf=null,Qg=!1,i}function Jd(i){if(i===kg)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function Cn(i){var s=ot;return i!=null&&(ot=s===null?i:s.concat(i)),s}function Su(i,s,c){for(var p=Object.keys(i.props),g=0;g<p.length;g++){var v=p[g];if(v!=="children"&&v!=="key"){s===null&&(s=Zh(i,c.mode,0),s._debugInfo=ot,s.return=c),ae(s,function(R){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",R)},v);break}}}function ho(i){var s=Am;return Am+=1,Tf===null&&(Tf=Zd()),Wd(Tf,i,s)}function fo(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Tu(i,s){throw s.$$typeof===Dg?Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
|
|
1341
|
+
- Multiple copies of the "react" package is used.
|
|
1342
|
+
- A library pre-bundled an old copy of "react" or "react/jsx-runtime".
|
|
1343
|
+
- A compiler tries to "inline" JSX instead of using the runtime.`):(i=Object.prototype.toString.call(s),Error("Objects are not valid as a React child (found: "+(i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)+"). If you meant to render a collection of children, use an array instead."))}function Wc(i,s){var c=z(i)||"Component";IC[c]||(IC[c]=!0,s=s.displayName||s.name||"Component",i.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
|
|
1344
|
+
root.render(%s)`,s,s,s):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
|
|
1345
|
+
<%s>{%s}</%s>`,s,s,c,s,c))}function Jc(i,s){var c=z(i)||"Component";kC[c]||(kC[c]=!0,s=String(s),i.tag===3?console.error(`Symbols are not valid as a React child.
|
|
1346
|
+
root.render(%s)`,s):console.error(`Symbols are not valid as a React child.
|
|
1347
|
+
<%s>%s</%s>`,c,s,c))}function $d(i){function s(L,V){if(i){var X=L.deletions;X===null?(L.deletions=[V],L.flags|=16):X.push(V)}}function c(L,V){if(!i)return null;for(;V!==null;)s(L,V),V=V.sibling;return null}function p(L){for(var V=new Map;L!==null;)L.key!==null?V.set(L.key,L):V.set(L.index,L),L=L.sibling;return V}function g(L,V){return L=wr(L,V),L.index=0,L.sibling=null,L}function v(L,V,X){return L.index=X,i?(X=L.alternate,X!==null?(X=X.index,X<V?(L.flags|=33554434,V):X):(L.flags|=33554434,V)):(L.flags|=1048576,V)}function R(L){return i&&L.alternate===null&&(L.flags|=33554434),L}function N(L,V,X,le){return V===null||V.tag!==6?(V=$p(X,L.mode,le),V.return=L,V._debugOwner=L,V._debugInfo=ot,V):(V=g(V,X),V.return=L,V._debugInfo=ot,V)}function Y(L,V,X,le){var Me=X.type;return Me===Rl?(V=fe(L,V,X.props.children,le,X.key),Su(X,V,L),V):V!==null&&(V.elementType===Me||Tg(V,X)||typeof Me=="object"&&Me!==null&&Me.$$typeof===Wi&&Fo(Me)===V.type)?(V=g(V,X.props),fo(V,X),V.return=L,V._debugOwner=X._owner,V._debugInfo=ot,V):(V=Zh(X,L.mode,le),fo(V,X),V.return=L,V._debugInfo=ot,V)}function J(L,V,X,le){return V===null||V.tag!==4||V.stateNode.containerInfo!==X.containerInfo||V.stateNode.implementation!==X.implementation?(V=Wh(X,L.mode,le),V.return=L,V._debugInfo=ot,V):(V=g(V,X.children||[]),V.return=L,V._debugInfo=ot,V)}function fe(L,V,X,le,Me){return V===null||V.tag!==7?(V=El(X,L.mode,le,Me),V.return=L,V._debugOwner=L,V._debugInfo=ot,V):(V=g(V,X),V.return=L,V._debugInfo=ot,V)}function xe(L,V,X){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=$p(""+V,L.mode,X),V.return=L,V._debugOwner=L,V._debugInfo=ot,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case Cl:return X=Zh(V,L.mode,X),fo(X,V),X.return=L,L=Cn(V._debugInfo),X._debugInfo=ot,ot=L,X;case nn:return V=Wh(V,L.mode,X),V.return=L,V._debugInfo=ot,V;case Wi:var le=Cn(V._debugInfo);return V=Fo(V),L=xe(L,V,X),ot=le,L}if(Mn(V)||w(V))return X=El(V,L.mode,X,null),X.return=L,X._debugOwner=L,L=Cn(V._debugInfo),X._debugInfo=ot,ot=L,X;if(typeof V.then=="function")return le=Cn(V._debugInfo),L=xe(L,ho(V),X),ot=le,L;if(V.$$typeof===Pa)return xe(L,Fs(L,V),X);Tu(L,V)}return typeof V=="function"&&Wc(L,V),typeof V=="symbol"&&Jc(L,V),null}function Re(L,V,X,le){var Me=V!==null?V.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Me!==null?null:N(L,V,""+X,le);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case Cl:return X.key===Me?(Me=Cn(X._debugInfo),L=Y(L,V,X,le),ot=Me,L):null;case nn:return X.key===Me?J(L,V,X,le):null;case Wi:return Me=Cn(X._debugInfo),X=Fo(X),L=Re(L,V,X,le),ot=Me,L}if(Mn(X)||w(X))return Me!==null?null:(Me=Cn(X._debugInfo),L=fe(L,V,X,le,null),ot=Me,L);if(typeof X.then=="function")return Me=Cn(X._debugInfo),L=Re(L,V,ho(X),le),ot=Me,L;if(X.$$typeof===Pa)return Re(L,V,Fs(L,X),le);Tu(L,X)}return typeof X=="function"&&Wc(L,X),typeof X=="symbol"&&Jc(L,X),null}function mt(L,V,X,le,Me){if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return L=L.get(X)||null,N(V,L,""+le,Me);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case Cl:return X=L.get(le.key===null?X:le.key)||null,L=Cn(le._debugInfo),V=Y(V,X,le,Me),ot=L,V;case nn:return L=L.get(le.key===null?X:le.key)||null,J(V,L,le,Me);case Wi:var bt=Cn(le._debugInfo);return le=Fo(le),V=mt(L,V,X,le,Me),ot=bt,V}if(Mn(le)||w(le))return X=L.get(X)||null,L=Cn(le._debugInfo),V=fe(V,X,le,Me,null),ot=L,V;if(typeof le.then=="function")return bt=Cn(le._debugInfo),V=mt(L,V,X,ho(le),Me),ot=bt,V;if(le.$$typeof===Pa)return mt(L,V,X,Fs(V,le),Me);Tu(V,le)}return typeof le=="function"&&Wc(V,le),typeof le=="symbol"&&Jc(V,le),null}function At(L,V,X,le){if(typeof X!="object"||X===null)return le;switch(X.$$typeof){case Cl:case nn:M(L,V,X);var Me=X.key;if(typeof Me!="string")break;if(le===null){le=new Set,le.add(Me);break}if(!le.has(Me)){le.add(Me);break}ae(V,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",Me)});break;case Wi:X=Fo(X),At(L,V,X,le)}return le}function Lf(L,V,X,le){for(var Me=null,bt=null,Qe=null,et=V,it=V=0,Jt=null;et!==null&&it<X.length;it++){et.index>it?(Jt=et,et=null):Jt=et.sibling;var En=Re(L,et,X[it],le);if(En===null){et===null&&(et=Jt);break}Me=At(L,En,X[it],Me),i&&et&&En.alternate===null&&s(L,et),V=v(En,V,it),Qe===null?bt=En:Qe.sibling=En,Qe=En,et=Jt}if(it===X.length)return c(L,et),vt&&la(L,it),bt;if(et===null){for(;it<X.length;it++)et=xe(L,X[it],le),et!==null&&(Me=At(L,et,X[it],Me),V=v(et,V,it),Qe===null?bt=et:Qe.sibling=et,Qe=et);return vt&&la(L,it),bt}for(et=p(et);it<X.length;it++)Jt=mt(et,L,it,X[it],le),Jt!==null&&(Me=At(L,Jt,X[it],Me),i&&Jt.alternate!==null&&et.delete(Jt.key===null?it:Jt.key),V=v(Jt,V,it),Qe===null?bt=Jt:Qe.sibling=Jt,Qe=Jt);return i&&et.forEach(function(Yl){return s(L,Yl)}),vt&&la(L,it),bt}function jf(L,V,X,le){if(X==null)throw Error("An iterable object provided no iterator.");for(var Me=null,bt=null,Qe=V,et=V=0,it=null,Jt=null,En=X.next();Qe!==null&&!En.done;et++,En=X.next()){Qe.index>et?(it=Qe,Qe=null):it=Qe.sibling;var Yl=Re(L,Qe,En.value,le);if(Yl===null){Qe===null&&(Qe=it);break}Jt=At(L,Yl,En.value,Jt),i&&Qe&&Yl.alternate===null&&s(L,Qe),V=v(Yl,V,et),bt===null?Me=Yl:bt.sibling=Yl,bt=Yl,Qe=it}if(En.done)return c(L,Qe),vt&&la(L,et),Me;if(Qe===null){for(;!En.done;et++,En=X.next())Qe=xe(L,En.value,le),Qe!==null&&(Jt=At(L,Qe,En.value,Jt),V=v(Qe,V,et),bt===null?Me=Qe:bt.sibling=Qe,bt=Qe);return vt&&la(L,et),Me}for(Qe=p(Qe);!En.done;et++,En=X.next())it=mt(Qe,L,et,En.value,le),it!==null&&(Jt=At(L,it,En.value,Jt),i&&it.alternate!==null&&Qe.delete(it.key===null?et:it.key),V=v(it,V,et),bt===null?Me=it:bt.sibling=it,bt=it);return i&&Qe.forEach(function(l5){return s(L,l5)}),vt&&la(L,et),Me}function ur(L,V,X,le){if(typeof X=="object"&&X!==null&&X.type===Rl&&X.key===null&&(Su(X,null,L),X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case Cl:var Me=Cn(X._debugInfo);e:{for(var bt=X.key;V!==null;){if(V.key===bt){if(bt=X.type,bt===Rl){if(V.tag===7){c(L,V.sibling),le=g(V,X.props.children),le.return=L,le._debugOwner=X._owner,le._debugInfo=ot,Su(X,le,L),L=le;break e}}else if(V.elementType===bt||Tg(V,X)||typeof bt=="object"&&bt!==null&&bt.$$typeof===Wi&&Fo(bt)===V.type){c(L,V.sibling),le=g(V,X.props),fo(le,X),le.return=L,le._debugOwner=X._owner,le._debugInfo=ot,L=le;break e}c(L,V);break}else s(L,V);V=V.sibling}X.type===Rl?(le=El(X.props.children,L.mode,le,X.key),le.return=L,le._debugOwner=L,le._debugInfo=ot,Su(X,le,L),L=le):(le=Zh(X,L.mode,le),fo(le,X),le.return=L,le._debugInfo=ot,L=le)}return L=R(L),ot=Me,L;case nn:e:{for(Me=X,X=Me.key;V!==null;){if(V.key===X)if(V.tag===4&&V.stateNode.containerInfo===Me.containerInfo&&V.stateNode.implementation===Me.implementation){c(L,V.sibling),le=g(V,Me.children||[]),le.return=L,L=le;break e}else{c(L,V);break}else s(L,V);V=V.sibling}le=Wh(Me,L.mode,le),le.return=L,L=le}return R(L);case Wi:return Me=Cn(X._debugInfo),X=Fo(X),L=ur(L,V,X,le),ot=Me,L}if(Mn(X))return Me=Cn(X._debugInfo),L=Lf(L,V,X,le),ot=Me,L;if(w(X)){if(Me=Cn(X._debugInfo),bt=w(X),typeof bt!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var Qe=bt.call(X);return Qe===X?(L.tag!==0||Object.prototype.toString.call(L.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(Qe)!=="[object Generator]")&&(qC||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),qC=!0):X.entries!==bt||Ab||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),Ab=!0),L=jf(L,V,Qe,le),ot=Me,L}if(typeof X.then=="function")return Me=Cn(X._debugInfo),L=ur(L,V,ho(X),le),ot=Me,L;if(X.$$typeof===Pa)return ur(L,V,Fs(L,X),le);Tu(L,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(Me=""+X,V!==null&&V.tag===6?(c(L,V.sibling),le=g(V,Me),le.return=L,L=le):(c(L,V),le=$p(Me,L.mode,le),le.return=L,le._debugOwner=L,le._debugInfo=ot,L=le),R(L)):(typeof X=="function"&&Wc(L,X),typeof X=="symbol"&&Jc(L,X),c(L,V))}return function(L,V,X,le){var Me=ot;ot=null;try{Am=0;var bt=ur(L,V,X,le);return Tf=null,bt}catch(Jt){if(Jt===kg)throw Jt;var Qe=y(29,Jt,null,L.mode);Qe.lanes=le,Qe.return=L;var et=Qe._debugInfo=ot;if(Qe._debugOwner=L._debugOwner,et!=null){for(var it=et.length-1;0<=it;it--)if(typeof et[it].stack=="string"){Qe._debugOwner=et[it];break}}return Qe}finally{ot=Me}}}function po(i,s){var c=Kr;oe(Zg,c,i),oe(Ef,s,i),Kr=c|s.baseLanes}function Eu(i){oe(Zg,Kr,i),oe(Ef,Ef.current,i)}function mo(i){Kr=Zg.current,k(Ef,i),k(Zg,i)}function js(i){var s=i.alternate;oe(Kn,Kn.current&Cf,i),oe(Ts,i,i),Fr===null&&(s===null||Ef.current!==null||s.memoizedState!==null)&&(Fr=i)}function ep(i){if(i.tag===22){if(oe(Kn,Kn.current,i),oe(Ts,i,i),Fr===null){var s=i.alternate;s!==null&&s.memoizedState!==null&&(Fr=i)}}else es(i)}function es(i){oe(Kn,Kn.current,i),oe(Ts,Ts.current,i)}function ts(i){k(Ts,i),Fr===i&&(Fr=null),k(Kn,i)}function Cu(i){for(var s=i;s!==null;){if(s.tag===13){var c=s.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ha(c)||fm(c)))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}function ke(){var i=te;Rs===null?Rs=[i]:Rs.push(i)}function ue(){var i=te;if(Rs!==null&&(Hl++,Rs[Hl]!==i)){var s=z(Ke);if(!QC.has(s)&&(QC.add(s),Rs!==null)){for(var c="",p=0;p<=Hl;p++){var g=Rs[p],v=p===Hl?i:g;for(g=p+1+". "+g;30>g.length;)g+=" ";g+=v+`
|
|
1348
|
+
`,c+=g}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
|
|
1349
|
+
|
|
1350
|
+
Previous render Next render
|
|
1351
|
+
------------------------------------------------------
|
|
1352
|
+
%s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
|
1353
|
+
`,s,c)}}}function dl(i){i==null||Mn(i)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",te,typeof i)}function yo(){var i=z(Ke);WC.has(i)||(WC.add(i),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",i))}function tn(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
1354
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
1355
|
+
2. You might be breaking the Rules of Hooks
|
|
1356
|
+
3. You might have more than one copy of React in the same app
|
|
1357
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function $c(i,s){if(Um)return!1;if(s===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",te),!1;i.length!==s.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
|
|
1358
|
+
|
|
1359
|
+
Previous: %s
|
|
1360
|
+
Incoming: %s`,te,"["+s.join(", ")+"]","["+i.join(", ")+"]");for(var c=0;c<s.length&&c<i.length;c++)if(!K(i[c],s[c]))return!1;return!0}function tp(i,s,c,p,g,v){Io=v,Ke=s,Rs=i!==null?i._debugHookTypes:null,Hl=-1,Um=i!==null&&i.type!==s.type,(Object.prototype.toString.call(c)==="[object AsyncFunction]"||Object.prototype.toString.call(c)==="[object AsyncGeneratorFunction]")&&(v=z(Ke),Mb.has(v)||(Mb.add(v),console.error("async/await is not yet supported in Client Components, only Server Components. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server."))),s.memoizedState=null,s.updateQueue=null,s.lanes=0,$.H=i!==null&&i.memoizedState!==null?Ko:Rs!==null?cc:ko,uc=v=(s.mode&8)!==kt;var R=Cb(c,p,g);if(uc=!1,Af&&(R=eh(s,c,p,g)),v){yt(!0);try{R=eh(s,c,p,g)}finally{yt(!1)}}return Rn(i,s),R}function Rn(i,s){s._debugHookTypes=Rs,s.dependencies===null?zl!==null&&(s.dependencies={lanes:0,firstContext:null,_debugThenableState:zl}):s.dependencies._debugThenableState=zl,$.H=Ir;var c=Ht!==null&&Ht.next!==null;if(Io=0,Rs=te=Bn=Ht=Ke=null,Hl=-1,i!==null&&(i.flags&31457280)!==(s.flags&31457280)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),Wg=!1,Dm=0,zl=null,c)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");i===null||oi||(i=i.dependencies,i!==null&&Nh(i)&&(oi=!0)),Qg?(Qg=!1,i=!0):i=!1,i&&(s=z(s)||"Unknown",ZC.has(s)||Mb.has(s)||(ZC.add(s),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function eh(i,s,c,p){Ke=i;var g=0;do{if(Af&&(zl=null),Dm=0,Af=!1,g>=ZG)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(g+=1,Um=!1,Bn=Ht=null,i.updateQueue!=null){var v=i.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}Hl=-1,$.H=hc,v=Cb(s,c,p)}while(Af);return v}function Zy(){var i=$.H,s=i.useState()[0];return s=typeof s.then=="function"?go(s):s,i=i.useState()[0],(Ht!==null?Ht.memoizedState:null)!==i&&(Ke.flags|=1024),s}function th(){var i=Jg!==0;return Jg=0,i}function nh(i,s,c){s.updateQueue=i.updateQueue,s.flags=(s.mode&16)!==kt?s.flags&-201328645:s.flags&-2053,i.lanes&=~c}function ih(i){if(Wg){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Wg=!1}Io=0,Rs=Bn=Ht=Ke=null,Hl=-1,te=null,Af=!1,Dm=Jg=0,zl=null}function An(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Bn===null?Ke.memoizedState=Bn=i:Bn=Bn.next=i,Bn}function Tt(){if(Ht===null){var i=Ke.alternate;i=i!==null?i.memoizedState:null}else i=Ht.next;var s=Bn===null?Ke.memoizedState:Bn.next;if(s!==null)Bn=s,Ht=i;else{if(i===null)throw Ke.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");Ht=i,i={memoizedState:Ht.memoizedState,baseState:Ht.baseState,baseQueue:Ht.baseQueue,queue:Ht.queue,next:null},Bn===null?Ke.memoizedState=Bn=i:Bn=Bn.next=i}return Bn}function go(i){var s=Dm;return Dm+=1,zl===null&&(zl=Zd()),i=Wd(zl,i,s),s=Ke,(Bn===null?s.memoizedState:Bn.next)===null&&(s=s.alternate,$.H=s!==null&&s.memoizedState!==null?Ko:ko),i}function Ys(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return go(i);if(i.$$typeof===Pa)return Lt(i)}throw Error("An unsupported type was passed to use(): "+String(i))}function xr(i){var s=null,c=Ke.updateQueue;if(c!==null&&(s=c.memoCache),s==null){var p=Ke.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(g){return g.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),c===null&&(c=Db(),Ke.updateQueue=c),c.memoCache=s,c=s.data[s.index],c===void 0||Um)for(c=s.data[s.index]=Array(i),p=0;p<i;p++)c[p]=af;else c.length!==i&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",c.length,i);return s.index++,c}function Fi(i,s){return typeof s=="function"?s(i):s}function Ru(i,s,c){var p=An();if(c!==void 0){var g=c(s);if(uc){yt(!0);try{c(s)}finally{yt(!1)}}}else g=s;return p.memoizedState=p.baseState=g,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:g},p.queue=i,i=i.dispatch=$y.bind(null,Ke,i),[p.memoizedState,i]}function pl(i){var s=Tt();return Au(s,Ht,i)}function Au(i,s,c){var p=i.queue;if(p===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");p.lastRenderedReducer=c;var g=i.baseQueue,v=p.pending;if(v!==null){if(g!==null){var R=g.next;g.next=v.next,v.next=R}s.baseQueue!==g&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),s.baseQueue=g=v,p.pending=null}if(v=i.baseState,g===null)i.memoizedState=v;else{s=g.next;var N=R=null,Y=null,J=s,fe=!1;do{var xe=J.lane&-536870913;if(xe!==J.lane?(dt&xe)===xe:(Io&xe)===xe){var Re=J.revertLane;if(Re===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null}),xe===rc&&(fe=!0);else if((Io&Re)===Re){J=J.next,Re===rc&&(fe=!0);continue}else xe={lane:0,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},Y===null?(N=Y=xe,R=v):Y=Y.next=xe,Ke.lanes|=Re,Zo|=Re;xe=J.action,uc&&c(v,xe),v=J.hasEagerState?J.eagerState:c(v,xe)}else Re={lane:xe,revertLane:J.revertLane,action:J.action,hasEagerState:J.hasEagerState,eagerState:J.eagerState,next:null},Y===null?(N=Y=Re,R=v):Y=Y.next=Re,Ke.lanes|=xe,Zo|=xe;J=J.next}while(J!==null&&J!==s);if(Y===null?R=v:Y.next=N,!K(v,i.memoizedState)&&(oi=!0,fe&&(c=xf,c!==null)))throw c;i.memoizedState=v,i.baseState=R,i.baseQueue=Y,p.lastRenderedState=v}return g===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function ml(i){var s=Tt(),c=s.queue;if(c===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");c.lastRenderedReducer=i;var p=c.dispatch,g=c.pending,v=s.memoizedState;if(g!==null){c.pending=null;var R=g=g.next;do v=i(v,R.action),R=R.next;while(R!==g);K(v,s.memoizedState)||(oi=!0),s.memoizedState=v,s.baseQueue===null&&(s.baseState=v),c.lastRenderedState=v}return[v,p]}function Mu(i,s,c){var p=Ke,g=An();if(vt){if(c===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var v=c();Rf||v===c()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),Rf=!0)}else{if(v=s(),Rf||(c=s(),K(v,c)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Rf=!0)),Yt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");(dt&60)!==0||ah(p,s,v)}return g.memoizedState=v,c={value:v,getSnapshot:s},g.queue=c,bo(ns.bind(null,p,c,i),[i]),p.flags|=2048,Er(Cs|Qn,np.bind(null,p,c,v,s),{destroy:void 0},null),v}function Du(i,s,c){var p=Ke,g=Tt(),v=vt;if(v){if(c===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");c=c()}else if(c=s(),!Rf){var R=s();K(c,R)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Rf=!0)}(R=!K((Ht||g).memoizedState,c))&&(g.memoizedState=c,oi=!0),g=g.queue;var N=ns.bind(null,p,g,i);if(ni(2048,Qn,N,[i]),g.getSnapshot!==s||R||Bn!==null&&Bn.memoizedState.tag&Cs){if(p.flags|=2048,Er(Cs|Qn,np.bind(null,p,g,c,s),{destroy:void 0},null),Yt===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");v||(Io&60)!==0||ah(p,s,c)}return c}function ah(i,s,c){i.flags|=16384,i={getSnapshot:s,value:c},s=Ke.updateQueue,s===null?(s=Db(),Ke.updateQueue=s,s.stores=[i]):(c=s.stores,c===null?s.stores=[i]:c.push(i))}function np(i,s,c,p){s.value=c,s.getSnapshot=p,sh(s)&&Wy(i)}function ns(i,s,c){return c(function(){sh(s)&&Wy(i)})}function sh(i){var s=i.getSnapshot;i=i.value;try{var c=s();return!K(i,c)}catch{return!0}}function Wy(i){var s=hn(i,2);s!==null&&Zt(s,i,2)}function rh(i){var s=An();if(typeof i=="function"){var c=i;if(i=c(),uc){yt(!0);try{c()}finally{yt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:i},s}function is(i){i=rh(i);var s=i.queue,c=oa.bind(null,Ke,s);return s.dispatch=c,[i.memoizedState,c]}function Da(i){var s=An();s.memoizedState=s.baseState=i;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=c,s=bh.bind(null,Ke,!0,c),c.dispatch=s,[i,s]}function lh(i,s){var c=Tt();return oh(c,Ht,i,s)}function oh(i,s,c,p){return i.baseState=c,Au(i,Ht,typeof p=="function"?p:Fi)}function _o(i,s){var c=Tt();return Ht!==null?oh(c,Ht,i,s):(c.baseState=i,[i,c.queue.dispatch])}function uh(i,s,c,p,g){if(xh(i))throw Error("Cannot update form state while rendering.");if(i=s.action,i!==null){var v={payload:g,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(R){v.listeners.push(R)}};$.T!==null?c(!0):v.isTransition=!1,p(v),c=s.pending,c===null?(v.next=s.pending=v,Sr(s,v)):(v.next=c.next,s.pending=c.next=v)}}function Sr(i,s){var c=s.action,p=s.payload,g=i.state;if(s.isTransition){var v=$.T,R={};$.T=R,$.T._updatedFibers=new Set;try{var N=c(g,p),Y=$.S;Y!==null&&Y(R,N),Vn(i,s,N)}catch(J){ch(i,s,J)}finally{$.T=v,v===null&&R._updatedFibers&&(i=R._updatedFibers.size,R._updatedFibers.clear(),10<i&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{R=c(g,p),Vn(i,s,R)}catch(J){ch(i,s,J)}}function Vn(i,s,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?(c.then(function(p){Uu(i,s,p)},function(p){return ch(i,s,p)}),s.isTransition||console.error("An async function was passed to useActionState, but it was dispatched outside of an action context. This is likely not what you intended. Either pass the dispatch function to an `action` prop, or dispatch manually inside `startTransition`")):Uu(i,s,c)}function Uu(i,s,c){s.status="fulfilled",s.value=c,hh(s),i.state=c,s=i.pending,s!==null&&(c=s.next,c===s?i.pending=null:(c=c.next,s.next=c,Sr(i,c)))}function ch(i,s,c){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=c,hh(s),s=s.next;while(s!==p)}i.action=null}function hh(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function vo(i,s){return s}function Tr(i,s){if(vt){var c=Yt.formState;if(c!==null){e:{var p=Ke;if(vt){if(Ei){var g=an(Ei,qr);if(g){Ei=ar(g),p=Pg(g);break e}}Vs(p)}p=!1}p&&(s=c[0])}}c=An(),c.memoizedState=c.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vo,lastRenderedState:s},c.queue=p,c=oa.bind(null,Ke,p),p.dispatch=c,p=rh(!1);var v=bh.bind(null,Ke,!1,p.queue);return p=An(),g={state:s,dispatch:null,action:i,pending:null},p.queue=g,c=uh.bind(null,Ke,g,v,c),g.dispatch=c,p.memoizedState=i,[s,c,!1]}function yl(i){var s=Tt();return ip(s,Ht,i)}function ip(i,s,c){s=Au(i,s,vo)[0],i=pl(Fi)[0],s=typeof s=="object"&&s!==null&&typeof s.then=="function"?go(s):s;var p=Tt(),g=p.queue,v=g.dispatch;return c!==p.memoizedState&&(Ke.flags|=2048,Er(Cs|Qn,Ii.bind(null,g,c),{destroy:void 0},null)),[s,v,i]}function Ii(i,s){i.action=s}function Bu(i){var s=Tt(),c=Ht;if(c!==null)return ip(s,c,i);Tt(),s=s.memoizedState,c=Tt();var p=c.queue.dispatch;return c.memoizedState=i,[s,p,!1]}function Er(i,s,c,p){return i={tag:i,create:s,inst:c,deps:p,next:null},s=Ke.updateQueue,s===null&&(s=Db(),Ke.updateQueue=s),c=s.lastEffect,c===null?s.lastEffect=i.next=i:(p=c.next,c.next=i,i.next=p,s.lastEffect=i),i}function fh(i){var s=An();return i={current:i},s.memoizedState=i}function Cr(i,s,c,p){var g=An();Ke.flags|=i,g.memoizedState=Er(Cs|s,c,{destroy:void 0},p===void 0?null:p)}function ni(i,s,c,p){var g=Tt();p=p===void 0?null:p;var v=g.memoizedState.inst;Ht!==null&&p!==null&&$c(p,Ht.memoizedState.deps)?g.memoizedState=Er(s,c,v,p):(Ke.flags|=i,g.memoizedState=Er(Cs|s,c,v,p))}function bo(i,s){(Ke.mode&16)!==kt&&(Ke.mode&64)===kt?Cr(142608384,Qn,i,s):Cr(8390656,Qn,i,s)}function dh(i,s){var c=4194308;return(Ke.mode&16)!==kt&&(c|=67108864),Cr(c,Ci,i,s)}function Ou(i,s){if(typeof s=="function"){i=i();var c=s(i);return function(){typeof c=="function"?c():s(null)}}if(s!=null)return s.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(s).join(", ")+"}"),i=i(),s.current=i,function(){s.current=null}}function gl(i,s,c){typeof s!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null"),c=c!=null?c.concat([i]):null;var p=4194308;(Ke.mode&16)!==kt&&(p|=67108864),Cr(p,Ci,Ou.bind(null,s,i),c)}function Pt(i,s,c){typeof s!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",s!==null?typeof s:"null"),c=c!=null?c.concat([i]):null,ni(4,Ci,Ou.bind(null,s,i),c)}function ap(i,s){return An().memoizedState=[i,s===void 0?null:s],i}function ph(i,s){var c=Tt();s=s===void 0?null:s;var p=c.memoizedState;return s!==null&&$c(s,p[1])?p[0]:(c.memoizedState=[i,s],i)}function mh(i,s){var c=An();s=s===void 0?null:s;var p=i();if(uc){yt(!0);try{i()}finally{yt(!1)}}return c.memoizedState=[p,s],p}function Rr(i,s){var c=Tt();s=s===void 0?null:s;var p=c.memoizedState;if(s!==null&&$c(s,p[1]))return p[0];if(p=i(),uc){yt(!0);try{i()}finally{yt(!1)}}return c.memoizedState=[p,s],p}function as(i,s){var c=An();return Xs(c,i,s)}function sp(i,s){var c=Tt();return wi(c,Ht.memoizedState,i,s)}function rp(i,s){var c=Tt();return Ht===null?Xs(c,i,s):wi(c,Ht.memoizedState,i,s)}function Xs(i,s,c){return c===void 0||(Io&1073741824)!==0?i.memoizedState=s:(i.memoizedState=c,i=Yp(),Ke.lanes|=i,Zo|=i,c)}function wi(i,s,c,p){return K(c,s)?c:Ef.current!==null?(i=Xs(i,c,p),K(i,s)||(oi=!0),i):(Io&42)===0?(oi=!0,i.memoizedState=c):(i=Yp(),Ke.lanes|=i,Zo|=i,s)}function lp(i,s,c,p,g){var v=nr();Fn(v!==0&&8>v?v:8);var R=$.T,N={};$.T=N,bh(i,!1,s,c),N._updatedFibers=new Set;try{var Y=g(),J=$.S;if(J!==null&&J(N,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var fe=Ky(Y,p);_l(i,s,fe,Qi(i))}else _l(i,s,p,Qi(i))}catch(xe){_l(i,s,{then:function(){},status:"rejected",reason:xe},Qi(i))}finally{Fn(v),$.T=R,R===null&&N._updatedFibers&&(i=N._updatedFibers.size,N._updatedFibers.clear(),10<i&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function op(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:ps,baseState:ps,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:ps},next:null};var c={};return s.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Fi,lastRenderedState:c},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function yh(){var i=rh(!1);return i=lp.bind(null,Ke,i.queue,!0,!1),An().memoizedState=i,[!1,i]}function gh(){var i=pl(Fi)[0],s=Tt().memoizedState;return[typeof i=="boolean"?i:go(i),s]}function _h(){var i=ml(Fi)[0],s=Tt().memoizedState;return[typeof i=="boolean"?i:go(i),s]}function ss(){return Lt(ir)}function vh(){var i=An(),s=Yt.identifierPrefix;if(vt){var c=li,p=nt;c=(p&~(1<<32-In(p)-1)).toString(32)+c,s=":"+s+"R"+c,c=Jg++,0<c&&(s+="H"+c.toString(32)),s+=":"}else c=QG++,s=":"+s+"r"+c.toString(32)+":";return i.memoizedState=s}function up(){return An().memoizedState=Jy.bind(null,Ke)}function Jy(i,s){for(var c=i.return;c!==null;){switch(c.tag){case 24:case 3:var p=Qi(c);i=Ls(p);var g=qi(c,i,p);g!==null&&(Zt(g,c,p),uo(g,c,p)),c=Gh(),s!=null&&g!==null&&console.error("The seed argument is not enabled outside experimental channels."),i.payload={cache:c};return}c=c.return}}function $y(i,s,c,p){typeof p=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),p=Qi(i),c={lane:p,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null},xh(i)?Sh(s,c):(c=en(i,s,c,p),c!==null&&(Zt(c,i,p),mi(c,s,p))),gr(i,p)}function oa(i,s,c,p){typeof p=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),p=Qi(i),_l(i,s,c,p),gr(i,p)}function _l(i,s,c,p){var g={lane:p,revertLane:0,action:c,hasEagerState:!1,eagerState:null,next:null};if(xh(i))Sh(s,g);else{var v=i.alternate;if(i.lanes===0&&(v===null||v.lanes===0)&&(v=s.lastRenderedReducer,v!==null)){var R=$.H;$.H=ia;try{var N=s.lastRenderedState,Y=v(N,c);if(g.hasEagerState=!0,g.eagerState=Y,K(Y,N))return zn(i,s,g,0),Yt===null&&lo(),!1}catch{}finally{$.H=R}}if(c=en(i,s,g,p),c!==null)return Zt(c,i,p),mi(c,s,p),!0}return!1}function bh(i,s,c,p){if($.T===null&&rc===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),p={lane:2,revertLane:Ic(),action:p,hasEagerState:!1,eagerState:null,next:null},xh(i)){if(s)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else s=en(i,c,p,2),s!==null&&Zt(s,i,2);gr(i,2)}function xh(i){var s=i.alternate;return i===Ke||s!==null&&s===Ke}function Sh(i,s){Af=Wg=!0;var c=i.pending;c===null?s.next=s:(s.next=c.next,c.next=s),i.pending=s}function mi(i,s,c){if((c&4194176)!==0){var p=s.lanes;p&=i.pendingLanes,c|=p,s.lanes=c,wn(i,c)}}function Th(i){if(i!==null&&typeof i!="function"){var s=String(i);oR.has(s)||(oR.add(s),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",i))}}function yi(i,s,c,p){var g=i.memoizedState,v=c(p,g);if(i.mode&8){yt(!0);try{v=c(p,g)}finally{yt(!1)}}v===void 0&&(s=P(s)||"Component",aR.has(s)||(aR.add(s),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",s))),g=v==null?g:jn({},g,v),i.memoizedState=g,i.lanes===0&&(i.updateQueue.baseState=g)}function cp(i,s,c,p,g,v,R){var N=i.stateNode;if(typeof N.shouldComponentUpdate=="function"){if(c=N.shouldComponentUpdate(p,v,R),i.mode&8){yt(!0);try{c=N.shouldComponentUpdate(p,v,R)}finally{yt(!1)}}return c===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",P(s)||"Component"),c}return s.prototype&&s.prototype.isPureReactComponent?!bu(c,p)||!bu(g,v):!0}function rs(i,s,c,p){var g=s.state;typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(c,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(c,p),s.state!==g&&(i=z(i)||"Component",$C.has(i)||($C.add(i),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",i)),Ub.enqueueReplaceState(s,s.state,null))}function ua(i,s){var c=s;if("ref"in s){c={};for(var p in s)p!=="ref"&&(c[p]=s[p])}if(i=i.defaultProps){c===s&&(c=jn({},c));for(var g in i)c[g]===void 0&&(c[g]=i[g])}return c}function Ua(i,s){try{Mf=s.source?z(s.source):null,Bb=null;var c=s.value;if($.actQueue!==null)$.thrownErrors.push(c);else{var p=i.onUncaughtError;p(c,{componentStack:s.stack})}}catch(g){setTimeout(function(){throw g})}}function Eh(i,s,c){try{Mf=c.source?z(c.source):null,Bb=z(s);var p=i.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(g){setTimeout(function(){throw g})}}function Nu(i,s,c){return c=Ls(c),c.tag=xb,c.payload={element:null},c.callback=function(){ae(s.source,Ua,i,s)},c}function ls(i){return i=Ls(i),i.tag=xb,i}function Ch(i,s,c,p){var g=c.type.getDerivedStateFromError;if(typeof g=="function"){var v=p.value;i.payload=function(){return g(v)},i.callback=function(){Eg(c),ae(p.source,Eh,s,c,p)}}var R=c.stateNode;R!==null&&typeof R.componentDidCatch=="function"&&(i.callback=function(){Eg(c),ae(p.source,Eh,s,c,p),typeof g!="function"&&(Jo===null?Jo=new Set([this]):Jo.add(this)),IG(this,p),typeof g=="function"||(c.lanes&2)===0&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",z(c)||"Unknown")})}function xo(i,s,c,p,g){if(c.flags|=32768,kn&&qu(i,g),p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=c.alternate,s!==null&&Hu(s,c,g,!0),vt&&(Pl=!0),c=Ts.current,c!==null){switch(c.tag){case 13:return Fr===null?qp():c.alternate===null&&vn===Ll&&(vn=zb),c.flags&=-257,c.flags|=65536,c.lanes=g,p===Kg?c.flags|=16384:(s=c.updateQueue,s===null?c.updateQueue=new Set([p]):s.add(p),Kh(i,p,g)),!1;case 22:return c.flags|=65536,p===Kg?c.flags|=16384:(s=c.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=s):(c=s.retryQueue,c===null?s.retryQueue=new Set([p]):c.add(p)),Kh(i,p,g)),!1}throw Error("Unexpected Suspense handler tag ("+c.tag+"). This is a bug in React.")}return Kh(i,p,g),qp(),!1}if(vt)return Pl=!0,s=Ts.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=g,p!==pb&&ul(ei(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:p}),c))):(p!==pb&&ul(ei(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:p}),c)),i=i.current.alternate,i.flags|=65536,g&=-g,i.lanes|=g,p=ei(p,c),g=Nu(i.stateNode,p,g),fl(i,g),vn!==dc&&(vn=wf)),!1;var v=ei(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:p}),c);if(Pm===null?Pm=[v]:Pm.push(v),vn!==dc&&(vn=wf),s===null)return!0;p=ei(p,c),c=s;do{switch(c.tag){case 3:return c.flags|=65536,i=g&-g,c.lanes|=i,i=Nu(c.stateNode,p,i),fl(c,i),!1;case 1:if(s=c.type,v=c.stateNode,(c.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(Jo===null||!Jo.has(v))))return c.flags|=65536,g&=-g,c.lanes|=g,g=ls(g),Ch(g,i,c,p),fl(c,g),!1}c=c.return}while(c!==null);return!1}function ln(i,s,c,p){s.child=i===null?KC(s,null,c,p):oc(s,i.child,c,p)}function Ar(i,s,c,p,g){c=c.render;var v=s.ref;if("ref"in p){var R={};for(var N in p)N!=="ref"&&(R[N]=p[N])}else R=p;return Ur(s),Ps(s),p=tp(i,s,c,R,v,g),N=th(),Za(),i!==null&&!oi?(nh(i,s,g),Oa(i,s,g)):(vt&&N&&fi(s),s.flags|=1,ln(i,s,p,g),s.child)}function hp(i,s,c,p,g){if(i===null){var v=c.type;return typeof v=="function"&&!Wp(v)&&v.defaultProps===void 0&&c.compare===null?(c=Gr(v),s.tag=15,s.type=c,Uh(s,v),fp(i,s,c,p,g)):(i=Jp(c.type,null,p,s,s.mode,g),i.ref=s.ref,i.return=s,s.child=i)}if(v=i.child,!Dr(i,g)){var R=v.memoizedProps;if(c=c.compare,c=c!==null?c:bu,c(R,p)&&i.ref===s.ref)return Oa(i,s,g)}return s.flags|=1,i=wr(v,p),i.ref=s.ref,i.return=s,s.child=i}function fp(i,s,c,p,g){if(i!==null){var v=i.memoizedProps;if(bu(v,p)&&i.ref===s.ref&&s.type===i.type)if(oi=!1,s.pendingProps=p=v,Dr(i,g))(i.flags&131072)!==0&&(oi=!0);else return s.lanes=i.lanes,Oa(i,s,g)}return Rh(i,s,c,p,g)}function So(i,s,c){var p=s.pendingProps,g=p.children,v=(s.stateNode._pendingVisibility&2)!==0,R=i!==null?i.memoizedState:null;if(Mr(i,s),p.mode==="hidden"||v){if((s.flags&128)!==0){if(p=R!==null?R.baseLanes|c:c,i!==null){for(g=s.child=i.child,v=0;g!==null;)v=v|g.lanes|g.childLanes,g=g.sibling;s.childLanes=v&~p}else s.childLanes=0,s.child=null;return dp(i,s,p,c)}if((c&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&os(s,R!==null?R.cachePool:null),R!==null?po(s,R):Eu(s),ep(s);else return s.lanes=s.childLanes=536870912,dp(i,s,R!==null?R.baseLanes|c:c,c)}else R!==null?(os(s,R.cachePool),po(s,R),es(s),s.memoizedState=null):(i!==null&&os(s,null),Eu(s),es(s));return ln(i,s,g,c),s.child}function dp(i,s,c,p){var g=wh();return g=g===null?null:{parent:dn?gn._currentValue:gn._currentValue2,pool:g},s.memoizedState={baseLanes:c,cachePool:g},i!==null&&os(s,null),Eu(s),ep(s),i!==null&&Hu(i,s,p,!0),null}function Mr(i,s){var c=s.ref;if(c===null)i!==null&&i.ref!==null&&(s.flags|=2097664);else{if(typeof c!="function"&&typeof c!="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");(i===null||i.ref!==c)&&(s.flags|=2097664)}}function Rh(i,s,c,p,g){if(c.prototype&&typeof c.prototype.render=="function"){var v=P(c)||"Unknown";hR[v]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",v,v),hR[v]=!0)}return s.mode&8&&rr.recordLegacyContextWarning(s,null),i===null&&(Uh(s,s.type),c.contextTypes&&(v=P(c)||"Unknown",dR[v]||(dR[v]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",v)))),Ur(s),Ps(s),c=tp(i,s,c,p,void 0,g),p=th(),Za(),i!==null&&!oi?(nh(i,s,g),Oa(i,s,g)):(vt&&p&&fi(s),s.flags|=1,ln(i,s,c,g),s.child)}function Ah(i,s,c,p,g,v){return Ur(s),Ps(s),Hl=-1,Um=i!==null&&i.type!==s.type,s.updateQueue=null,c=eh(s,p,c,g),Rn(i,s),p=th(),Za(),i!==null&&!oi?(nh(i,s,v),Oa(i,s,v)):(vt&&p&&fi(s),s.flags|=1,ln(i,s,c,v),s.child)}function Mh(i,s,c,p,g){switch(m(s)){case!1:var v=s.stateNode,R=new s.type(s.memoizedProps,v.context).state;v.updater.enqueueSetState(v,R,null);break;case!0:s.flags|=128,s.flags|=65536,v=Error("Simulated error coming from DevTools");var N=g&-g;if(s.lanes|=N,R=Yt,R===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");N=ls(N),Ch(N,R,s,ei(v,s)),fl(s,N)}if(Ur(s),s.stateNode===null){if(R=ga,v=c.contextType,"contextType"in c&&v!==null&&(v===void 0||v.$$typeof!==Pa)&&!lR.has(c)&&(lR.add(c),N=v===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof v!="object"?" However, it is set to a "+typeof v+".":v.$$typeof===tf?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(v).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",P(c)||"Component",N)),typeof v=="object"&&v!==null&&(R=Lt(v)),v=new c(p,R),s.mode&8){yt(!0);try{v=new c(p,R)}finally{yt(!1)}}if(R=s.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Ub,s.stateNode=v,v._reactInternals=s,v._reactInternalInstance=JC,typeof c.getDerivedStateFromProps=="function"&&R===null&&(R=P(c)||"Component",eR.has(R)||(eR.add(R),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",R,v.state===null?"null":"undefined",R))),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"){var Y=N=R=null;if(typeof v.componentWillMount=="function"&&v.componentWillMount.__suppressDeprecationWarning!==!0?R="componentWillMount":typeof v.UNSAFE_componentWillMount=="function"&&(R="UNSAFE_componentWillMount"),typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps.__suppressDeprecationWarning!==!0?N="componentWillReceiveProps":typeof v.UNSAFE_componentWillReceiveProps=="function"&&(N="UNSAFE_componentWillReceiveProps"),typeof v.componentWillUpdate=="function"&&v.componentWillUpdate.__suppressDeprecationWarning!==!0?Y="componentWillUpdate":typeof v.UNSAFE_componentWillUpdate=="function"&&(Y="UNSAFE_componentWillUpdate"),R!==null||N!==null||Y!==null){v=P(c)||"Component";var J=typeof c.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";nR.has(v)||(nR.add(v),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
|
|
1361
|
+
|
|
1362
|
+
%s uses %s but also contains the following legacy lifecycles:%s%s%s
|
|
1363
|
+
|
|
1364
|
+
The above lifecycles should be removed. Learn more about this warning here:
|
|
1365
|
+
https://react.dev/link/unsafe-component-lifecycles`,v,J,R!==null?`
|
|
1366
|
+
`+R:"",N!==null?`
|
|
1367
|
+
`+N:"",Y!==null?`
|
|
1368
|
+
`+Y:""))}}v=s.stateNode,R=P(c)||"Component",v.render||(c.prototype&&typeof c.prototype.render=="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",R):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",R)),!v.getInitialState||v.getInitialState.isReactClassApproved||v.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",R),v.getDefaultProps&&!v.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",R),v.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",R),c.childContextTypes&&!rR.has(c)&&(rR.add(c),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",R)),c.contextTypes&&!sR.has(c)&&(sR.add(c),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",R)),typeof v.componentShouldUpdate=="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",R),c.prototype&&c.prototype.isPureReactComponent&&typeof v.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",P(c)||"A pure component"),typeof v.componentDidUnmount=="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",R),typeof v.componentDidReceiveProps=="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",R),typeof v.componentWillRecieveProps=="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",R),typeof v.UNSAFE_componentWillRecieveProps=="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",R),N=v.props!==p,v.props!==void 0&&N&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",R),v.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",R,R),typeof v.getSnapshotBeforeUpdate!="function"||typeof v.componentDidUpdate=="function"||tR.has(c)||(tR.add(c),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",P(c))),typeof v.getDerivedStateFromProps=="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",R),typeof v.getDerivedStateFromError=="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",R),typeof c.getSnapshotBeforeUpdate=="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",R),(N=v.state)&&(typeof N!="object"||Mn(N))&&console.error("%s.state: must be set to an object or null",R),typeof v.getChildContext=="function"&&typeof c.childContextTypes!="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",R),v=s.stateNode,v.props=p,v.state=s.memoizedState,v.refs={},kc(s),R=c.contextType,v.context=typeof R=="object"&&R!==null?Lt(R):ga,v.state===p&&(R=P(c)||"Component",iR.has(R)||(iR.add(R),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",R))),s.mode&8&&rr.recordLegacyContextWarning(s,v),rr.recordUnsafeLifecycleWarnings(s,v),v.state=s.memoizedState,R=c.getDerivedStateFromProps,typeof R=="function"&&(yi(s,c,R,p),v.state=s.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(R=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),R!==v.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",z(s)||"Component"),Ub.enqueueReplaceState(v,v.state,null)),co(s,p,v,g),br(),v.state=s.memoizedState),typeof v.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==kt&&(s.flags|=67108864),v=!0}else if(i===null){v=s.stateNode;var fe=s.memoizedProps;N=ua(c,fe),v.props=N;var xe=v.context;Y=c.contextType,R=ga,typeof Y=="object"&&Y!==null&&(R=Lt(Y)),J=c.getDerivedStateFromProps,Y=typeof J=="function"||typeof v.getSnapshotBeforeUpdate=="function",fe=s.pendingProps!==fe,Y||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(fe||xe!==R)&&rs(s,v,p,R),qo=!1;var Re=s.memoizedState;v.state=Re,co(s,p,v,g),br(),xe=s.memoizedState,fe||Re!==xe||qo?(typeof J=="function"&&(yi(s,c,J,p),xe=s.memoizedState),(N=qo||cp(s,c,N,p,Re,xe,R))?(Y||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==kt&&(s.flags|=67108864)):(typeof v.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==kt&&(s.flags|=67108864),s.memoizedProps=p,s.memoizedState=xe),v.props=p,v.state=xe,v.context=R,v=N):(typeof v.componentDidMount=="function"&&(s.flags|=4194308),(s.mode&16)!==kt&&(s.flags|=67108864),v=!1)}else{v=s.stateNode,Kd(i,s),R=s.memoizedProps,Y=ua(c,R),v.props=Y,J=s.pendingProps,Re=v.context,xe=c.contextType,N=ga,typeof xe=="object"&&xe!==null&&(N=Lt(xe)),fe=c.getDerivedStateFromProps,(xe=typeof fe=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(R!==J||Re!==N)&&rs(s,v,p,N),qo=!1,Re=s.memoizedState,v.state=Re,co(s,p,v,g),br();var mt=s.memoizedState;R!==J||Re!==mt||qo||i!==null&&i.dependencies!==null&&Nh(i.dependencies)?(typeof fe=="function"&&(yi(s,c,fe,p),mt=s.memoizedState),(Y=qo||cp(s,c,Y,p,Re,mt,N)||i!==null&&i.dependencies!==null&&Nh(i.dependencies))?(xe||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(p,mt,N),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(p,mt,N)),typeof v.componentDidUpdate=="function"&&(s.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof v.componentDidUpdate!="function"||R===i.memoizedProps&&Re===i.memoizedState||(s.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Re===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=mt),v.props=p,v.state=mt,v.context=N,v=Y):(typeof v.componentDidUpdate!="function"||R===i.memoizedProps&&Re===i.memoizedState||(s.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||R===i.memoizedProps&&Re===i.memoizedState||(s.flags|=1024),v=!1)}if(N=v,Mr(i,s),R=(s.flags&128)!==0,N||R){if(N=s.stateNode,$.getCurrentStack=s===null?null:Le,Xn=!1,Yn=s,R&&typeof c.getDerivedStateFromError!="function")c=null,_a=-1;else{if(Ps(s),c=GC(N),s.mode&8){yt(!0);try{GC(N)}finally{yt(!1)}}Za()}s.flags|=1,i!==null&&R?(s.child=oc(s,i.child,null,g),s.child=oc(s,null,c,g)):ln(i,s,c,g),s.memoizedState=N.state,i=s.child}else i=Oa(i,s,g);return g=s.stateNode,v&&g.props!==p&&(Df||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",z(s)||"a component"),Df=!0),i}function Dh(i,s,c,p){return yu(),s.flags|=256,ln(i,s,c,p),s.child}function Uh(i,s){s&&s.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
|
|
1369
|
+
%s.childContextTypes = ...`,s.displayName||s.name||"Component"),typeof s.getDerivedStateFromProps=="function"&&(i=P(s)||"Unknown",pR[i]||(console.error("%s: Function components do not support getDerivedStateFromProps.",i),pR[i]=!0)),typeof s.contextType=="object"&&s.contextType!==null&&(s=P(s)||"Unknown",fR[s]||(console.error("%s: Function components do not support contextType.",s),fR[s]=!0))}function Gu(i){return{baseLanes:i,cachePool:_p()}}function gi(i,s,c){return i=i!==null?i.childLanes&~c:0,s&&(i|=Xa),i}function pp(i,s,c){var p=s.pendingProps;d(s)&&(s.flags|=128);var g=!1,v=(s.flags&128)!==0,R;if((R=v)||(R=i!==null&&i.memoizedState===null?!1:(Kn.current&Mm)!==0),R&&(g=!0,s.flags&=-129),R=(s.flags&32)!==0,s.flags&=-33,i===null){if(vt){if(g?js(s):es(s),vt){var N=Ei,Y;(Y=!N)||(Y=Hg(N,qr),Y!==null?(pi(),s.memoizedState={dehydrated:Y,treeContext:It!==null?{id:nt,overflow:li}:null,retryLane:536870912},v=y(18,null,null,kt),v.stateNode=Y,v.return=s,s.child=v,ta=s,Ei=null,Y=!0):Y=!1,Y=!Y),Y&&(Qt(s,N),Vs(s))}if(N=s.memoizedState,N!==null&&(N=N.dehydrated,N!==null))return fm(N)?s.lanes=16:s.lanes=536870912,null;ts(s)}return N=p.children,p=p.fallback,g?(es(s),g=s.mode,N=Bh({mode:"hidden",children:N},g),p=El(p,g,c,null),N.return=s,p.return=s,N.sibling=p,s.child=N,g=s.child,g.memoizedState=Gu(c),g.childLanes=gi(i,R,c),s.memoizedState=Nb,p):(js(s),Ln(s,N))}if(Y=i.memoizedState,Y!==null&&(N=Y.dehydrated,N!==null)){if(v)s.flags&256?(js(s),s.flags&=-257,s=wu(i,s,c)):s.memoizedState!==null?(es(s),s.child=i.child,s.flags|=128,s=null):(es(s),g=p.fallback,N=s.mode,p=Bh({mode:"visible",children:p.children},N),g=El(g,N,c,null),g.flags|=2,p.return=s,g.return=s,p.sibling=g,s.child=p,oc(s,i.child,null,c),p=s.child,p.memoizedState=Gu(c),p.childLanes=gi(i,R,c),s.memoizedState=Nb,s=g);else if(js(s),vt&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug."),fm(N))N=hb(N),R=N.digest,g=N.message,p=N.stack,N=N.componentStack,g=Error(g||"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),g.stack=p||"",g.digest=R,R=N===void 0?null:N,p={value:g,source:null,stack:R},typeof R=="string"&&q.set(g,p),ul(p),s=wu(i,s,c);else if(oi||Hu(i,s,c,!1),R=(c&i.childLanes)!==0,oi||R){if(R=Yt,R!==null){if(p=c&-c,(p&42)!==0)p=1;else switch(p){case 2:p=1;break;case 8:p=4;break;case 32:p=16;break;case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:p=64;break;case 268435456:p=134217728;break;default:p=0}if(p=(p&(R.suspendedLanes|c))!==0?0:p,p!==0&&p!==Y.retryLane)throw Y.retryLane=p,hn(i,p),Zt(R,i,p),cR}Ha(N)||qp(),s=wu(i,s,c)}else Ha(N)?(s.flags|=128,s.child=i.child,s=_g.bind(null,i),fb(N,s),s=null):(i=Y.treeContext,Si&&(Ei=dm(N),ta=s,vt=!0,sr=null,Pl=!1,xs=null,qr=!1,i!==null&&(pi(),Oe[Ze++]=nt,Oe[Ze++]=li,Oe[Ze++]=It,nt=i.id,li=i.overflow,It=s)),s=Ln(s,p.children),s.flags|=4096);return s}return g?(es(s),g=p.fallback,N=s.mode,Y=i.child,v=Y.sibling,p=wr(Y,{mode:"hidden",children:p.children}),p.subtreeFlags=Y.subtreeFlags&31457280,v!==null?g=wr(v,g):(g=El(g,N,c,null),g.flags|=2),g.return=s,p.return=s,p.sibling=g,s.child=p,p=g,g=s.child,N=i.child.memoizedState,N===null?N=Gu(c):(Y=N.cachePool,Y!==null?(v=dn?gn._currentValue:gn._currentValue2,Y=Y.parent!==v?{parent:v,pool:v}:Y):Y=_p(),N={baseLanes:N.baseLanes|c,cachePool:Y}),g.memoizedState=N,g.childLanes=gi(i,R,c),s.memoizedState=Nb,p):(js(s),c=i.child,i=c.sibling,c=wr(c,{mode:"visible",children:p.children}),c.return=s,c.sibling=null,i!==null&&(R=s.deletions,R===null?(s.deletions=[i],s.flags|=16):R.push(i)),s.child=c,s.memoizedState=null,c)}function Ln(i,s){return s=Bh({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Bh(i,s){return Rg(i,s,0,null)}function wu(i,s,c){return oc(s,i.child,null,c),i=Ln(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function mp(i,s,c){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),zu(i.return,s,c)}function eg(i,s){var c=Mn(i);return i=!c&&typeof w(i)=="function",c||i?(c=c?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",c,s,c),!1):!0}function Ba(i,s,c,p,g){var v=i.memoizedState;v===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:g}:(v.isBackwards=s,v.rendering=null,v.renderingStartTime=0,v.last=p,v.tail=c,v.tailMode=g)}function yp(i,s,c){var p=s.pendingProps,g=p.revealOrder,v=p.tail;if(p=p.children,g!==void 0&&g!=="forwards"&&g!=="backwards"&&g!=="together"&&!mR[g])if(mR[g]=!0,typeof g=="string")switch(g.toLowerCase()){case"together":case"forwards":case"backwards":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',g,g.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',g,g.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',g)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "together", "forwards" or "backwards"?',g);v===void 0||Ob[v]||(v!=="collapsed"&&v!=="hidden"?(Ob[v]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "collapsed" or "hidden"?',v)):g!=="forwards"&&g!=="backwards"&&(Ob[v]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',v)));e:if((g==="forwards"||g==="backwards")&&p!==void 0&&p!==null&&p!==!1)if(Mn(p)){for(var R=0;R<p.length;R++)if(!eg(p[R],R))break e}else if(R=w(p),typeof R=="function"){if(R=R.call(p))for(var N=R.next(),Y=0;!N.done;N=R.next()){if(!eg(N.value,Y))break e;Y++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',g);if(ln(i,s,p,c),p=Kn.current,(p&Mm)!==0)p=p&Cf|Mm,s.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&mp(i,c,s);else if(i.tag===19)mp(i,c,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}p&=Cf}switch(oe(Kn,p,s),g){case"forwards":for(c=s.child,g=null;c!==null;)i=c.alternate,i!==null&&Cu(i)===null&&(g=c),c=c.sibling;c=g,c===null?(g=s.child,s.child=null):(g=c.sibling,c.sibling=null),Ba(s,!1,g,c,v);break;case"backwards":for(c=null,g=s.child,s.child=null;g!==null;){if(i=g.alternate,i!==null&&Cu(i)===null){s.child=g;break}i=g.sibling,g.sibling=c,c=g,g=i}Ba(s,!0,c,null,v);break;case"together":Ba(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function Oa(i,s,c){if(i!==null&&(s.dependencies=i.dependencies),_a=-1,Zo|=s.lanes,(c&s.childLanes)===0)if(i!==null){if(Hu(i,s,c,!1),(c&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error("Resuming work not yet implemented.");if(s.child!==null){for(i=s.child,c=wr(i,i.pendingProps),s.child=c,c.return=s;i.sibling!==null;)i=i.sibling,c=c.sibling=wr(i,i.pendingProps),c.return=s;c.sibling=null}return s.child}function Dr(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&Nh(i)))}function tg(i,s,c){switch(s.tag){case 3:D(s,s.stateNode.containerInfo),qs(s,gn,i.memoizedState.cache),yu();break;case 27:case 5:Te(s);break;case 4:D(s,s.stateNode.containerInfo);break;case 10:qs(s,s.type,s.memoizedProps.value);break;case 12:(c&s.childLanes)!==0&&(s.flags|=4),s.flags|=2048;var p=s.stateNode;p.effectDuration=-0,p.passiveEffectDuration=-0;break;case 13:if(p=s.memoizedState,p!==null)return p.dehydrated!==null?(js(s),s.flags|=128,null):(c&s.child.childLanes)!==0?pp(i,s,c):(js(s),i=Oa(i,s,c),i!==null?i.sibling:null);js(s);break;case 19:var g=(i.flags&128)!==0;if(p=(c&s.childLanes)!==0,p||(Hu(i,s,c,!1),p=(c&s.childLanes)!==0),g){if(p)return yp(i,s,c);s.flags|=128}if(g=s.memoizedState,g!==null&&(g.rendering=null,g.tail=null,g.lastEffect=null),oe(Kn,Kn.current,s),p)break;return null;case 22:case 23:return s.lanes=0,So(i,s,c);case 24:qs(s,gn,i.memoizedState.cache)}return Oa(i,s,c)}function Oh(i,s,c){if(s._debugNeedsRemount&&i!==null){c=Jp(s.type,s.key,s.pendingProps,s._debugOwner||null,s.mode,s.lanes);var p=s.return;if(p===null)throw Error("Cannot swap the root fiber.");if(i.alternate=null,s.alternate=null,c.index=s.index,c.sibling=s.sibling,c.return=s.return,c.ref=s.ref,c._debugInfo=s._debugInfo,s===p.child)p.child=c;else{var g=p.child;if(g===null)throw Error("Expected parent to have a child.");for(;g.sibling!==s;)if(g=g.sibling,g===null)throw Error("Expected to find the previous sibling.");g.sibling=c}return s=p.deletions,s===null?(p.deletions=[i],p.flags|=16):s.push(i),c.flags|=2,c}if(i!==null)if(i.memoizedProps!==s.pendingProps||s.type!==i.type)oi=!0;else{if(!Dr(i,c)&&(s.flags&128)===0)return oi=!1,tg(i,s,c);oi=(i.flags&131072)!==0}else oi=!1,(p=vt)&&(pi(),p=(s.flags&1048576)!==0),p&&(p=s.index,pi(),zs(s,Bt,p));switch(s.lanes=0,s.tag){case 16:e:if(p=s.pendingProps,i=Fo(s.elementType),s.type=i,typeof i=="function")Wp(i)?(p=ua(i,p),s.tag=1,s.type=i=Gr(i),s=Mh(null,s,i,p,c)):(s.tag=0,Uh(s,i),s.type=i=Gr(i),s=Rh(null,s,i,p,c));else{if(i!=null){if(g=i.$$typeof,g===hs){s.tag=11,s.type=i=Qp(i),s=Ar(null,s,i,p,c);break e}else if(g===nf){s.tag=14,s=hp(null,s,i,p,c);break e}}throw s="",i!==null&&typeof i=="object"&&i.$$typeof===Wi&&(s=" Did you wrap a component in React.lazy() more than once?"),i=P(i)||i,Error("Element type is invalid. Received a promise that resolves to: "+i+". Lazy element type must resolve to a class or function."+s)}return s;case 0:return Rh(i,s,s.type,s.pendingProps,c);case 1:return p=s.type,g=ua(p,s.pendingProps),Mh(i,s,p,g,c);case 3:e:{if(D(s,s.stateNode.containerInfo),i===null)throw Error("Should have a current fiber. This is a bug in React.");var v=s.pendingProps;g=s.memoizedState,p=g.element,Kd(i,s),co(s,v,null,c);var R=s.memoizedState;if(v=R.cache,qs(s,gn,v),v!==g.cache&&gp(s,[gn],c,!0),br(),v=R.element,Si&&g.isDehydrated)if(g={element:v,isDehydrated:!1,cache:R.cache},s.updateQueue.baseState=g,s.memoizedState=g,s.flags&256){s=Dh(i,s,v,c);break e}else if(v!==p){p=ei(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),s),ul(p),s=Dh(i,s,v,c);break e}else for(Si&&(Ei=sn(s.stateNode.containerInfo),ta=s,vt=!0,sr=null,Pl=!1,xs=null,qr=!0),i=KC(s,null,v,c),s.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(yu(),v===p){s=Oa(i,s,c);break e}ln(i,s,v,c)}s=s.child}return s;case 26:if(Ye)return Mr(i,s),i===null?(i=Hi(s.type,null,s.pendingProps,null))?s.memoizedState=i:vt||(s.stateNode=Yr(s.type,s.pendingProps,Xi(Xo.current),s)):s.memoizedState=Hi(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:if(yn)return Te(s),i===null&&yn&&vt&&(g=Xi(Xo.current),p=he(),g=s.stateNode=La(s.type,s.pendingProps,g,p,!1),Pl||(p=tc(g,s.type,s.pendingProps,p),p!==null&&($a(s,0).serverProps=p)),ta=s,qr=!0,Ei=gs(g)),p=s.pendingProps.children,i!==null||vt?ln(i,s,p,c):s.child=oc(s,null,p,c),Mr(i,s),s.child;case 5:return i===null&&vt&&(v=he(),p=Dt(s.type,s.pendingProps,v),g=Ei,(R=!g)||(R=zg(g,s.type,s.pendingProps,qr),R!==null?(s.stateNode=R,Pl||(v=tc(R,s.type,s.pendingProps,v),v!==null&&($a(s,0).serverProps=v)),ta=s,Ei=gs(R),qr=!1,v=!0):v=!1,R=!v),R&&(p&&Qt(s,g),Vs(s))),Te(s),g=s.type,v=s.pendingProps,R=i!==null?i.memoizedProps:null,p=v.children,Sn(g,v)?p=null:R!==null&&Sn(g,R)&&(s.flags|=32),s.memoizedState!==null&&(g=tp(i,s,Zy,null,null,c),dn?ir._currentValue=g:ir._currentValue2=g),Mr(i,s),ln(i,s,p,c),s.child;case 6:return i===null&&vt&&(i=s.pendingProps,c=he(),i=zt(i,c),c=Ei,(p=!c)||(p=Un(c,s.pendingProps,qr),p!==null?(s.stateNode=p,ta=s,Ei=null,p=!0):p=!1,p=!p),p&&(i&&Qt(s,c),Vs(s))),null;case 13:return pp(i,s,c);case 4:return D(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=oc(s,null,p,c):ln(i,s,p,c),s.child;case 11:return Ar(i,s,s.type,s.pendingProps,c);case 7:return ln(i,s,s.pendingProps,c),s.child;case 8:return ln(i,s,s.pendingProps.children,c),s.child;case 12:return s.flags|=4,s.flags|=2048,p=s.stateNode,p.effectDuration=-0,p.passiveEffectDuration=-0,ln(i,s,s.pendingProps.children,c),s.child;case 10:return p=s.type,g=s.pendingProps,v=g.value,"value"in g||yR||(yR=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),qs(s,p,v),ln(i,s,g.children,c),s.child;case 9:return g=s.type._context,p=s.pendingProps.children,typeof p!="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Ur(s),g=Lt(g),Ps(s),p=Cb(p,g,void 0),Za(),s.flags|=1,ln(i,s,p,c),s.child;case 14:return hp(i,s,s.type,s.pendingProps,c);case 15:return fp(i,s,s.type,s.pendingProps,c);case 19:return yp(i,s,c);case 22:return So(i,s,c);case 24:return Ur(s),p=Lt(gn),i===null?(g=wh(),g===null&&(g=Yt,v=Gh(),g.pooledCache=v,Br(v),v!==null&&(g.pooledCacheLanes|=c),g=v),s.memoizedState={parent:p,cache:g},kc(s),qs(s,gn,g)):((i.lanes&c)!==0&&(Kd(i,s),co(s,null,null,c),br()),g=i.memoizedState,v=s.memoizedState,g.parent!==p?(g={parent:p,cache:p},s.memoizedState=g,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=g),qs(s,gn,p)):(p=v.cache,qs(s,gn,p),p!==g.cache&&gp(s,[gn],c,!0))),ln(i,s,s.pendingProps.children,c),s.child;case 29:throw s.pendingProps}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function Pu(){Uf=t_=null,Bf=!1}function qs(i,s,c){dn?(oe($g,s._currentValue,i),s._currentValue=c,oe(Gb,s._currentRenderer,i),s._currentRenderer!==void 0&&s._currentRenderer!==null&&s._currentRenderer!==e_&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),s._currentRenderer=e_):(oe($g,s._currentValue2,i),s._currentValue2=c,oe(wb,s._currentRenderer2,i),s._currentRenderer2!==void 0&&s._currentRenderer2!==null&&s._currentRenderer2!==e_&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),s._currentRenderer2=e_)}function Na(i,s){var c=$g.current;dn?(i._currentValue=c,c=Gb.current,k(Gb,s),i._currentRenderer=c):(i._currentValue2=c,c=wb.current,k(wb,s),i._currentRenderer2=c),k($g,s)}function zu(i,s,c){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===c)break;i=i.return}i!==c&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function gp(i,s,c,p){var g=i.child;for(g!==null&&(g.return=i);g!==null;){var v=g.dependencies;if(v!==null){var R=g.child;v=v.firstContext;e:for(;v!==null;){var N=v;v=g;for(var Y=0;Y<s.length;Y++)if(N.context===s[Y]){v.lanes|=c,N=v.alternate,N!==null&&(N.lanes|=c),zu(v.return,c,i),p||(R=null);break e}v=N.next}}else if(g.tag===18){if(R=g.return,R===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");R.lanes|=c,v=R.alternate,v!==null&&(v.lanes|=c),zu(R,c,i),R=null}else R=g.child;if(R!==null)R.return=g;else for(R=g;R!==null;){if(R===i){R=null;break}if(g=R.sibling,g!==null){g.return=R.return,R=g;break}R=R.return}g=R}}function Hu(i,s,c,p){i=null;for(var g=s,v=!1;g!==null;){if(!v){if((g.flags&524288)!==0)v=!0;else if((g.flags&262144)!==0)break}if(g.tag===10){var R=g.alternate;if(R===null)throw Error("Should have a current fiber. This is a bug in React.");if(R=R.memoizedProps,R!==null){var N=g.type;K(g.pendingProps.value,R.value)||(i!==null?i.push(N):i=[N])}}else if(g===Lg.current){if(R=g.alternate,R===null)throw Error("Should have a current fiber. This is a bug in React.");R.memoizedState.memoizedState!==g.memoizedState.memoizedState&&(i!==null?i.push(ir):i=[ir])}g=g.return}i!==null&&gp(s,i,c,p),s.flags|=262144}function Nh(i){for(i=i.firstContext;i!==null;){var s=i.context;if(!K(dn?s._currentValue:s._currentValue2,i.memoizedValue))return!0;i=i.next}return!1}function Ur(i){t_=i,Uf=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function Lt(i){return Bf&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),Vu(t_,i)}function Fs(i,s){return t_===null&&Ur(i),Vu(i,s)}function Vu(i,s){var c=dn?s._currentValue:s._currentValue2;if(s={context:s,memoizedValue:c,next:null},Uf===null){if(i===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Uf=s,i.dependencies={lanes:0,firstContext:s,_debugThenableState:null},i.flags|=524288}else Uf=Uf.next=s;return c}function Gh(){return{controller:new WG,data:new Map,refCount:0}}function Br(i){i.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),i.refCount++}function Lu(i){i.refCount--,0>i.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),i.refCount===0&&JG($G,function(){i.controller.abort()})}function wh(){var i=fc.current;return i!==null?i:Yt.pooledCache}function os(i,s){s===null?oe(fc,fc.current,i):oe(fc,s.pool,i)}function _p(){var i=wh();return i===null?null:{parent:dn?gn._currentValue:gn._currentValue2,pool:i}}function $e(i){i.flags|=4}function Ph(i,s){if(i!==null&&i.child===s.child)return!1;if((s.flags&16)!==0)return!0;for(i=s.child;i!==null;){if((i.flags&13878)!==0||(i.subtreeFlags&13878)!==0)return!0;i=i.sibling}return!1}function vp(i,s,c,p){if(on)for(c=s.child;c!==null;){if(c.tag===5||c.tag===6)Bo(i,c.stateNode);else if(!(c.tag===4||yn&&c.tag===27)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===s)break;for(;c.sibling===null;){if(c.return===null||c.return===s)return;c=c.return}c.sibling.return=c.return,c=c.sibling}else if(ds)for(var g=s.child;g!==null;){if(g.tag===5){var v=g.stateNode;c&&p&&(v=$u(v,g.type,g.memoizedProps)),Bo(i,v)}else if(g.tag===6)v=g.stateNode,c&&p&&(v=jr(v,g.memoizedProps)),Bo(i,v);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)v=g.child,v!==null&&(v.return=g),vp(i,g,!0,!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===s)break;for(;g.sibling===null;){if(g.return===null||g.return===s)return;g=g.return}g.sibling.return=g.return,g=g.sibling}}function bp(i,s,c,p){if(ds)for(var g=s.child;g!==null;){if(g.tag===5){var v=g.stateNode;c&&p&&(v=$u(v,g.type,g.memoizedProps)),hm(i,v)}else if(g.tag===6)v=g.stateNode,c&&p&&(v=jr(v,g.memoizedProps)),hm(i,v);else if(g.tag!==4){if(g.tag===22&&g.memoizedState!==null)v=g.child,v!==null&&(v.return=g),bp(i,g,!(g.memoizedProps!==null&&g.memoizedProps.mode==="manual"),!0);else if(g.child!==null){g.child.return=g,g=g.child;continue}}if(g===s)break;for(;g.sibling===null;){if(g.return===null||g.return===s)return;g=g.return}g.sibling.return=g.return,g=g.sibling}}function ng(i,s){if(ds&&Ph(i,s)){i=s.stateNode;var c=i.containerInfo,p=cm();bp(p,s,!1,!1),i.pendingChildren=p,$e(s),Dn(c,p)}}function xp(i,s,c,p){if(on)i.memoizedProps!==p&&$e(s);else if(ds){var g=i.stateNode,v=i.memoizedProps;if((i=Ph(i,s))||v!==p){var R=he();v=um(g,c,v,p,!i,null),v===g?s.stateNode=g:(si(v,c,p,R)&&$e(s),s.stateNode=v,i?vp(v,s,!1,!1):$e(s))}else s.stateNode=g}}function Sp(i,s,c){if(No(s,c)){if(i.flags|=16777216,!Dl(s,c))if(Do())i.flags|=8192;else throw Sf=Kg,Eb}else i.flags&=-16777217}function ig(i,s){if(mm(s)){if(i.flags|=16777216,!ea(s))if(Do())i.flags|=8192;else throw Sf=Kg,Eb}else i.flags&=-16777217}function To(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?Ni():536870912,i.lanes|=s,mc|=s)}function ca(i,s){if(!vt)switch(i.tailMode){case"hidden":s=i.tail;for(var c=null;s!==null;)s.alternate!==null&&(c=s),s=s.sibling;c===null?i.tail=null:c.sibling=null;break;case"collapsed":c=i.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function jt(i){var s=i.alternate!==null&&i.alternate.child===i.child,c=0,p=0;if(s)if((i.mode&2)!==kt){for(var g=i.selfBaseDuration,v=i.child;v!==null;)c|=v.lanes|v.childLanes,p|=v.subtreeFlags&31457280,p|=v.flags&31457280,g+=v.treeBaseDuration,v=v.sibling;i.treeBaseDuration=g}else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,p|=g.subtreeFlags&31457280,p|=g.flags&31457280,g.return=i,g=g.sibling;else if((i.mode&2)!==kt){g=i.actualDuration,v=i.selfBaseDuration;for(var R=i.child;R!==null;)c|=R.lanes|R.childLanes,p|=R.subtreeFlags,p|=R.flags,g+=R.actualDuration,v+=R.treeBaseDuration,R=R.sibling;i.actualDuration=g,i.treeBaseDuration=v}else for(g=i.child;g!==null;)c|=g.lanes|g.childLanes,p|=g.subtreeFlags,p|=g.flags,g.return=i,g=g.sibling;return i.subtreeFlags|=p,i.childLanes=c,s}function zh(i,s,c){var p=s.pendingProps;switch(di(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return jt(s),null;case 1:return jt(s),null;case 3:return c=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Na(gn,s),F(s),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(i===null||i.child===null)&&(ro(s)?(Yc(),$e(s)):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,sr!==null&&(Js(sr),sr=null))),ng(i,s),jt(s),null;case 26:if(Ye){c=s.type;var g=s.memoizedState;return i===null?($e(s),g!==null?(jt(s),ig(s,g)):(jt(s),Sp(s,c,p))):g?g!==i.memoizedState?($e(s),jt(s),ig(s,g)):(jt(s),s.flags&=-16777217):(on?i.memoizedProps!==p&&$e(s):xp(i,s,c,p),jt(s),Sp(s,c,p)),null}case 27:if(yn){if(Ue(s),c=Xi(Xo.current),g=s.type,i!==null&&s.stateNode!=null)on?i.memoizedProps!==p&&$e(s):xp(i,s,g,p);else{if(!p){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return jt(s),null}i=he(),ro(s)?jc(s,i):(i=La(g,p,c,i,!0),s.stateNode=i,$e(s))}return jt(s),null}case 5:if(Ue(s),c=s.type,i!==null&&s.stateNode!=null)xp(i,s,c,p);else{if(!p){if(s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return jt(s),null}i=he(),ro(s)?jc(s,i):(g=Xi(Xo.current),g=zr(c,p,g,i,s),vp(g,s,!1,!1),s.stateNode=g,si(g,c,p,i)&&$e(s))}return jt(s),Sp(s,s.type,s.pendingProps),null;case 6:if(i&&s.stateNode!=null)c=i.memoizedProps,on?c!==p&&$e(s):ds&&(c!==p?(i=Xi(Xo.current),c=he(),s.stateNode=_t(p,i,c,s),$e(s)):s.stateNode=i.stateNode);else{if(typeof p!="string"&&s.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(i=Xi(Xo.current),c=he(),ro(s)){if(!Si)throw Error("Expected prepareToHydrateHostTextInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");i=s.stateNode,c=s.memoizedProps,g=!Pl,p=null;var v=ta;if(v!==null)switch(v.tag){case 3:g&&(g=Vo(i,c,p),g!==null&&($a(s,0).serverProps=g));break;case 27:case 5:p=v.memoizedProps,g&&(g=Vo(i,c,p),g!==null&&($a(s,0).serverProps=g))}$i(i,c,s,p)||Vs(s)}else s.stateNode=_t(p,i,c,s)}return jt(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(g=ro(s),p!==null&&p.dehydrated!==null){if(i===null){if(!g)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(!Si)throw Error("Expected prepareToHydrateHostSuspenseInstance() to never be called. This error is likely caused by a bug in React. Please file an issue.");if(g=s.memoizedState,g=g!==null?g.dehydrated:null,!g)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");Va(g,s),jt(s),(s.mode&2)!==kt&&p!==null&&(g=s.child,g!==null&&(s.treeBaseDuration-=g.treeBaseDuration))}else Yc(),yu(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4,jt(s),(s.mode&2)!==kt&&p!==null&&(g=s.child,g!==null&&(s.treeBaseDuration-=g.treeBaseDuration));g=!1}else sr!==null&&(Js(sr),sr=null),g=!0;if(!g)return s.flags&256?(ts(s),s):(ts(s),null)}return ts(s),(s.flags&128)!==0?(s.lanes=c,(s.mode&2)!==kt&&vu(s),s):(c=p!==null,i=i!==null&&i.memoizedState!==null,c&&(p=s.child,g=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(g=p.alternate.memoizedState.cachePool.pool),v=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(v=p.memoizedState.cachePool.pool),v!==g&&(p.flags|=2048)),c!==i&&c&&(s.child.flags|=8192),To(s,s.updateQueue),jt(s),(s.mode&2)!==kt&&c&&(i=s.child,i!==null&&(s.treeBaseDuration-=i.treeBaseDuration)),null);case 4:return F(s),ng(i,s),i===null&&rm(s.stateNode.containerInfo),jt(s),null;case 10:return Na(s.type,s),jt(s),null;case 19:if(k(Kn,s),g=s.memoizedState,g===null)return jt(s),null;if(p=(s.flags&128)!==0,v=g.rendering,v===null)if(p)ca(g,!1);else{if(vn!==Ll||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(v=Cu(i),v!==null){for(s.flags|=128,ca(g,!1),i=v.updateQueue,s.updateQueue=i,To(s,i),s.subtreeFlags=0,i=c,c=s.child;c!==null;)Cg(c,i),c=c.sibling;return oe(Kn,Kn.current&Cf|Mm,s),s.child}i=i.sibling}g.tail!==null&&C()>zm&&(s.flags|=128,p=!0,ca(g,!1),s.lanes=4194304)}else{if(!p)if(i=Cu(v),i!==null){if(s.flags|=128,p=!0,i=i.updateQueue,s.updateQueue=i,To(s,i),ca(g,!0),g.tail===null&&g.tailMode==="hidden"&&!v.alternate&&!vt)return jt(s),null}else 2*C()-g.renderingStartTime>zm&&c!==536870912&&(s.flags|=128,p=!0,ca(g,!1),s.lanes=4194304);g.isBackwards?(v.sibling=s.child,s.child=v):(i=g.last,i!==null?i.sibling=v:s.child=v,g.last=v)}return g.tail!==null?(i=g.tail,g.rendering=i,g.tail=i.sibling,g.renderingStartTime=C(),i.sibling=null,c=Kn.current,c=p?c&Cf|Mm:c&Cf,oe(Kn,c,s),i):(jt(s),null);case 22:case 23:return ts(s),mo(s),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(c&536870912)!==0&&(s.flags&128)===0&&(jt(s),s.subtreeFlags&6&&(s.flags|=8192)):jt(s),c=s.updateQueue,c!==null&&To(s,c.retryQueue),c=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==c&&(s.flags|=2048),i!==null&&k(fc,s),null;case 24:return c=null,i!==null&&(c=i.memoizedState.cache),s.memoizedState.cache!==c&&(s.flags|=2048),Na(gn,s),jt(s),null;case 25:return null}throw Error("Unknown unit of work tag ("+s.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function vl(i,s){switch(di(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==kt&&vu(s),s):null;case 3:return Na(gn,s),F(s),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Ue(s),null;case 13:if(ts(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");yu()}return i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==kt&&vu(s),s):null;case 19:return k(Kn,s),null;case 4:return F(s),null;case 10:return Na(s.type,s),null;case 22:case 23:return ts(s),mo(s),i!==null&&k(fc,s),i=s.flags,i&65536?(s.flags=i&-65537|128,(s.mode&2)!==kt&&vu(s),s):null;case 24:return Na(gn,s),null;case 25:return null;default:return null}}function Tp(i,s){switch(di(s),s.tag){case 3:Na(gn,s),F(s);break;case 26:case 27:case 5:Ue(s);break;case 4:F(s);break;case 13:ts(s);break;case 19:k(Kn,s);break;case 10:Na(s.type,s);break;case 22:case 23:ts(s),mo(s),i!==null&&k(fc,s);break;case 24:Na(gn,s)}}function ha(i){return(i.mode&2)!==kt}function Hh(i,s){ha(i)?(Aa(),Eo(s,i),Ra()):Eo(s,i)}function Ep(i,s,c){ha(i)?(Aa(),bl(c,i,s),Ra()):bl(c,i,s)}function Eo(i,s){try{var c=s.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var g=p.next;c=g;do{if((c.tag&i)===i&&((i&Qn)!==Es?ve!==null&&typeof ve.markComponentPassiveEffectMountStarted=="function"&&ve.markComponentPassiveEffectMountStarted(s):(i&Ci)!==Es&&ve!==null&&typeof ve.markComponentLayoutEffectMountStarted=="function"&&ve.markComponentLayoutEffectMountStarted(s),p=void 0,(i&na)!==Es&&(Hf=!0),p=ae(s,kG,c),(i&na)!==Es&&(Hf=!1),(i&Qn)!==Es?ve!==null&&typeof ve.markComponentPassiveEffectMountStopped=="function"&&ve.markComponentPassiveEffectMountStopped():(i&Ci)!==Es&&ve!==null&&typeof ve.markComponentLayoutEffectMountStopped=="function"&&ve.markComponentLayoutEffectMountStopped(),p!==void 0&&typeof p!="function")){var v=void 0;v=(c.tag&Ci)!==0?"useLayoutEffect":(c.tag&na)!==0?"useInsertionEffect":"useEffect";var R=void 0;R=p===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof p.then=="function"?`
|
|
1370
|
+
|
|
1371
|
+
It looks like you wrote `+v+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
|
|
1372
|
+
|
|
1373
|
+
`+v+`(() => {
|
|
1374
|
+
async function fetchData() {
|
|
1375
|
+
// You can await here
|
|
1376
|
+
const response = await MyAPI.getData(someId);
|
|
1377
|
+
// ...
|
|
1378
|
+
}
|
|
1379
|
+
fetchData();
|
|
1380
|
+
}, [someId]); // Or [] if effect doesn't need props or state
|
|
1381
|
+
|
|
1382
|
+
Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+p,ae(s,function(N,Y){console.error("%s must not return anything besides a function, which is used for clean-up.%s",N,Y)},v,R)}c=c.next}while(c!==g)}}catch(N){Et(s,s.return,N)}}function bl(i,s,c){try{var p=s.updateQueue,g=p!==null?p.lastEffect:null;if(g!==null){var v=g.next;p=v;do{if((p.tag&i)===i){var R=p.inst,N=R.destroy;N!==void 0&&(R.destroy=void 0,(i&Qn)!==Es?ve!==null&&typeof ve.markComponentPassiveEffectUnmountStarted=="function"&&ve.markComponentPassiveEffectUnmountStarted(s):(i&Ci)!==Es&&ve!==null&&typeof ve.markComponentLayoutEffectUnmountStarted=="function"&&ve.markComponentLayoutEffectUnmountStarted(s),(i&na)!==Es&&(Hf=!0),ae(s,KG,s,c,N),(i&na)!==Es&&(Hf=!1),(i&Qn)!==Es?ve!==null&&typeof ve.markComponentPassiveEffectUnmountStopped=="function"&&ve.markComponentPassiveEffectUnmountStopped():(i&Ci)!==Es&&ve!==null&&typeof ve.markComponentLayoutEffectUnmountStopped=="function"&&ve.markComponentLayoutEffectUnmountStopped())}p=p.next}while(p!==v)}}catch(Y){Et(s,s.return,Y)}}function Cp(i,s){ha(i)?(Aa(),Eo(s,i),Ra()):Eo(s,i)}function Vh(i,s,c){ha(i)?(Aa(),bl(c,i,s),Ra()):bl(c,i,s)}function Rp(i){var s=i.updateQueue;if(s!==null){var c=i.stateNode;i.type.defaultProps||"ref"in i.memoizedProps||Df||(c.props!==i.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(i)||"instance"),c.state!==i.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(i)||"instance"));try{ae(i,Qd,s,c)}catch(p){Et(i,i.return,p)}}}function Ap(i,s,c){return i.getSnapshotBeforeUpdate(s,c)}function ht(i,s){var c=s.memoizedProps,p=s.memoizedState;s=i.stateNode,i.type.defaultProps||"ref"in i.memoizedProps||Df||(s.props!==i.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(i)||"instance"),s.state!==i.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(i)||"instance"));try{var g=ua(i.type,c,i.elementType===i.type),v=ae(i,Ap,s,g,p);c=_R,v!==void 0||c.has(i.type)||(c.add(i.type),ae(i,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",z(i))})),s.__reactInternalSnapshotBeforeUpdate=v}catch(R){Et(i,i.return,R)}}function ag(i,s,c){c.props=ua(i.type,i.memoizedProps),c.state=i.memoizedState,ha(i)?(Aa(),ae(i,LC,i,s,c),Ra()):ae(i,LC,i,s,c)}function ki(i){var s=i.ref;if(s!==null){var c=i.stateNode;switch(i.tag){case 26:case 27:case 5:c=ma(c)}if(typeof s=="function")if(ha(i))try{Aa(),i.refCleanup=s(c)}finally{Ra()}else i.refCleanup=s(c);else typeof s=="string"?console.error("String refs are no longer supported."):s.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",z(i)),s.current=c}}function Is(i,s){try{ae(i,ki,i)}catch(c){Et(i,s,c)}}function Ki(i,s){var c=i.ref,p=i.refCleanup;if(c!==null)if(typeof p=="function")try{if(ha(i))try{Aa(),ae(i,p)}finally{Ra(i)}else ae(i,p)}catch(g){Et(i,s,g)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof c=="function")try{if(ha(i))try{Aa(),ae(i,c,null)}finally{Ra(i)}else ae(i,c,null)}catch(g){Et(i,s,g)}else c.current=null}function ju(i,s,c,p){var g=i.memoizedProps,v=g.id,R=g.onCommit;g=g.onRender,s=s===null?"mount":"update",Yg&&(s="nested-update"),typeof g=="function"&&g(v,s,i.actualDuration,i.treeBaseDuration,i.actualStartTime,c),typeof R=="function"&&R(i.memoizedProps.id,s,p,c)}function Co(i,s,c,p){var g=i.memoizedProps;i=g.id,g=g.onPostCommit,s=s===null?"mount":"update",Yg&&(s="nested-update"),typeof g=="function"&&g(i,s,p,c)}function xl(i){var s=i.type,c=i.memoizedProps,p=i.stateNode;try{ae(i,hf,p,s,c,i)}catch(g){Et(i,i.return,g)}}function Mp(i,s,c){try{ae(i,zo,i.stateNode,i.type,c,s,i)}catch(p){Et(i,i.return,p)}}function Lh(i){return i.tag===5||i.tag===3||(Ye?i.tag===26:!1)||(yn?i.tag===27:!1)||i.tag===4}function Dp(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||Lh(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&(!yn||i.tag!==27)&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function jh(i,s,c){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?ff(c,i,s):Mt(c,i);else if(!(p===4||yn&&p===27)&&(i=i.child,i!==null))for(jh(i,s,c),i=i.sibling;i!==null;)jh(i,s,c),i=i.sibling}function Ga(i,s,c){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?Ul(c,i,s):lt(c,i);else if(!(p===4||yn&&p===27)&&(i=i.child,i!==null))for(Ga(i,s,c),i=i.sibling;i!==null;)Ga(i,s,c),i=i.sibling}function Up(i){if(on&&(!yn||i.tag!==27)){e:{for(var s=i.return;s!==null;){if(Lh(s)){var c=s;break e}s=s.return}throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.")}switch(c.tag){case 27:if(yn){s=c.stateNode,c=Dp(i),Ga(i,c,s);break}case 5:s=c.stateNode,c.flags&32&&(wg(s),c.flags&=-33),c=Dp(i),Ga(i,c,s);break;case 3:case 4:s=c.stateNode.containerInfo,c=Dp(i),jh(i,c,s);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}}function Yh(i,s,c){i=i.containerInfo;try{ae(s,df,i,c)}catch(p){Et(s,s.return,p)}}function Bp(i,s){for(qn(i.containerInfo),ui=s;ui!==null;)if(i=ui,s=i.child,(i.subtreeFlags&1028)!==0&&s!==null)s.return=i,ui=s;else for(;ui!==null;){s=i=ui;var c=s.alternate,p=s.flags;switch(s.tag){case 0:break;case 11:case 15:break;case 1:(p&1024)!==0&&c!==null&&ht(s,c);break;case 3:(p&1024)!==0&&on&&Ol(s.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((p&1024)!==0)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(s=i.sibling,s!==null){s.return=i.return,ui=s;break}ui=i.return}return i=bR,bR=!1,i}function Xh(i,s,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:wa(i,c),p&4&&Hh(c,Ci|Cs);break;case 1:if(wa(i,c),p&4)if(i=c.stateNode,s===null)c.type.defaultProps||"ref"in c.memoizedProps||Df||(i.props!==c.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(c)||"instance"),i.state!==c.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(c)||"instance")),ha(c)?(Aa(),ae(c,Rb,c,i),Ra()):ae(c,Rb,c,i);else{var g=ua(c.type,s.memoizedProps);s=s.memoizedState,c.type.defaultProps||"ref"in c.memoizedProps||Df||(i.props!==c.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",z(c)||"instance"),i.state!==c.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",z(c)||"instance")),ha(c)?(Aa(),ae(c,zC,c,i,g,s,i.__reactInternalSnapshotBeforeUpdate),Ra()):ae(c,zC,c,i,g,s,i.__reactInternalSnapshotBeforeUpdate)}p&64&&Rp(c),p&512&&Is(c,c.return);break;case 3:if(s=Hn(),wa(i,c),p&64&&(p=c.updateQueue,p!==null)){if(g=null,c.child!==null)switch(c.child.tag){case 27:case 5:g=ma(c.child.stateNode);break;case 1:g=c.child.stateNode}try{ae(c,Qd,p,g)}catch(N){Et(c,c.return,N)}}i.effectDuration+=cl(s);break;case 26:if(Ye){wa(i,c),p&512&&Is(c,c.return);break}case 27:case 5:wa(i,c),s===null&&p&4&&xl(c),p&512&&Is(c,c.return);break;case 12:if(p&4){p=Hn(),wa(i,c),i=c.stateNode,i.effectDuration+=hl(p);try{ae(c,ju,c,s,jg,i.effectDuration)}catch(N){Et(c,c.return,N)}}else wa(i,c);break;case 13:wa(i,c),p&4&&Np(i,c);break;case 22:if(g=c.memoizedState!==null||Vl,!g){s=s!==null&&s.memoizedState!==null||_n;var v=Vl,R=_n;Vl=g,(_n=s)&&!R?Ks(i,c,(c.subtreeFlags&8772)!==0):wa(i,c),Vl=v,_n=R}p&512&&(c.memoizedProps.mode==="manual"?Is(c,c.return):Ki(c,c.return));break;default:wa(i,c)}}function ks(i){var s=i.alternate;s!==null&&(i.alternate=null,ks(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&lm(s)),i.stateNode=null,i._debugOwner=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function fa(i,s,c){for(c=c.child;c!==null;)Op(i,s,c),c=c.sibling}function Op(i,s,c){if(Ne&&typeof Ne.onCommitFiberUnmount=="function")try{Ne.onCommitFiberUnmount(Ee,c)}catch(v){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",v))}switch(c.tag){case 26:if(Ye){_n||Ki(c,s),fa(i,s,c),c.memoizedState?Gl(c.memoizedState):c.stateNode&&Wt(c.stateNode);break}case 27:if(yn){_n||Ki(c,s);var p=On,g=ja;On=c.stateNode,fa(i,s,c),nc(c.stateNode),On=p,ja=g;break}case 5:_n||Ki(c,s);case 6:if(on){if(p=On,g=ja,On=null,fa(i,s,c),On=p,ja=g,On!==null)if(ja)try{ae(c,Ho,On,c.stateNode)}catch(v){Et(c,s,v)}else try{ae(c,Ju,On,c.stateNode)}catch(v){Et(c,s,v)}}else fa(i,s,c);break;case 18:on&&On!==null&&(ja?yf(On,c.stateNode):mf(On,c.stateNode));break;case 4:on?(p=On,g=ja,On=c.stateNode.containerInfo,ja=!0,fa(i,s,c),On=p,ja=g):(ds&&Yh(c.stateNode,c,cm()),fa(i,s,c));break;case 0:case 11:case 14:case 15:_n||bl(na,c,s),_n||Ep(c,s,Ci),fa(i,s,c);break;case 1:_n||(Ki(c,s),p=c.stateNode,typeof p.componentWillUnmount=="function"&&ag(c,s,p)),fa(i,s,c);break;case 21:fa(i,s,c);break;case 22:_n||Ki(c,s),_n=(p=_n)||c.memoizedState!==null,fa(i,s,c),_n=p;break;default:fa(i,s,c)}}function Np(i,s){if(Si&&s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{ae(s,pf,i)}catch(c){Et(s,s.return,c)}}function K0(i){switch(i.tag){case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new vR),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new vR),s;default:throw Error("Unexpected Suspense handler tag ("+i.tag+"). This is a bug in React.")}}function qe(i,s){var c=K0(i);s.forEach(function(p){var g=vg.bind(null,i,p);if(!c.has(p)){if(c.add(p),kn)if(Of!==null&&Nf!==null)qu(Nf,Of);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");p.then(g,g)}})}function Gp(i,s,c){Of=c,Nf=i,qh(s,i),Nf=Of=null}function _i(i,s){var c=s.deletions;if(c!==null)for(var p=0;p<c.length;p++){var g=i,v=s,R=c[p];if(on){var N=v;e:for(;N!==null;){switch(N.tag){case 27:case 5:On=N.stateNode,ja=!1;break e;case 3:On=N.stateNode.containerInfo,ja=!0;break e;case 4:On=N.stateNode.containerInfo,ja=!0;break e}N=N.return}if(On===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");Op(g,v,R),On=null,ja=!1}else Op(g,v,R);g=R,v=g.alternate,v!==null&&(v.return=null),g.return=null}if(s.subtreeFlags&13878)for(s=s.child;s!==null;)qh(s,i),s=s.sibling}function qh(i,s){var c=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:_i(s,i),ii(i),p&4&&(bl(na|Cs,i,i.return),Eo(na|Cs,i),Ep(i,i.return,Ci|Cs));break;case 1:_i(s,i),ii(i),p&512&&(_n||c===null||Ki(c,c.return)),p&64&&Vl&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(c=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:if(Ye){var g=lr;_i(s,i),ii(i),p&512&&(_n||c===null||Ki(c,c.return)),p&4&&(p=c!==null?c.memoizedState:null,s=i.memoizedState,c===null?s===null?i.stateNode===null?i.stateNode=pm(g,i.type,i.memoizedProps,i):vs(g,i.type,i.stateNode):i.stateNode=_s(g,s,i.memoizedProps):p!==s?(p===null?c.stateNode!==null&&Wt(c.stateNode):Gl(p),s===null?vs(g,i.type,i.stateNode):_s(g,s,i.memoizedProps)):s===null&&i.stateNode!==null&&Mp(i,i.memoizedProps,c.memoizedProps));break}case 27:if(yn&&p&4&&i.alternate===null){g=i.stateNode;var v=i.memoizedProps;try{ym(g),ae(i,gm,i.type,v,g,i)}catch(fe){Et(i,i.return,fe)}}case 5:if(_i(s,i),ii(i),p&512&&(_n||c===null||Ki(c,c.return)),on){if(i.flags&32){s=i.stateNode;try{ae(i,wg,s)}catch(fe){Et(i,i.return,fe)}}p&4&&i.stateNode!=null&&(s=i.memoizedProps,Mp(i,s,c!==null?c.memoizedProps:s)),p&1024&&(Pb=!0,i.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."))}break;case 6:if(_i(s,i),ii(i),p&4&&on){if(i.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");p=i.memoizedProps,c=c!==null?c.memoizedProps:p,s=i.stateNode;try{ae(i,pn,s,c,p)}catch(fe){Et(i,i.return,fe)}}break;case 3:if(g=Hn(),Ye?(wl(),v=lr,lr=Ut(s.containerInfo),_i(s,i),lr=v):_i(s,i),ii(i),p&4){if(on&&Si&&c!==null&&c.memoizedState.isDehydrated)try{ae(i,db,s.containerInfo)}catch(fe){Et(i,i.return,fe)}if(ds){p=s.containerInfo,c=s.pendingChildren;try{ae(i,df,p,c)}catch(fe){Et(i,i.return,fe)}}}Pb&&(Pb=!1,sg(i)),s.effectDuration+=cl(g);break;case 4:Ye?(c=lr,lr=Ut(i.stateNode.containerInfo),_i(s,i),ii(i),lr=c):(_i(s,i),ii(i)),p&4&&ds&&Yh(i.stateNode,i,i.stateNode.pendingChildren);break;case 12:p=Hn(),_i(s,i),ii(i),i.stateNode.effectDuration+=hl(p);break;case 13:_i(s,i),ii(i),i.child.flags&8192&&i.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Yb=C()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,qe(i,p)));break;case 22:p&512&&(_n||c===null||Ki(c,c.return)),g=i.memoizedState!==null;var R=c!==null&&c.memoizedState!==null,N=Vl,Y=_n;if(Vl=N||g,_n=Y||R,_i(s,i),_n=Y,Vl=N,ii(i),s=i.stateNode,s._current=i,s._visibility&=-3,s._visibility|=s._pendingVisibility&2,p&8192&&(s._visibility=g?s._visibility&-2:s._visibility|1,g&&(s=Vl||_n,c===null||R||s||Ao(i)),on&&(i.memoizedProps===null||i.memoizedProps.mode!=="manual"))){e:if(c=null,on)for(s=i;;){if(s.tag===5||Ye&&s.tag===26||yn&&s.tag===27){if(c===null){R=c=s;try{v=R.stateNode,g?ae(R,om,v):ae(R,Bl,R.stateNode,R.memoizedProps)}catch(fe){Et(R,R.return,fe)}}}else if(s.tag===6){if(c===null){R=s;try{var J=R.stateNode;g?ae(R,ys,J):ae(R,Lr,J,R.memoizedProps)}catch(fe){Et(R,R.return,fe)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;c===s&&(c=null),s=s.return}c===s&&(c=null),s.sibling.return=s.return,s=s.sibling}}p&4&&(p=i.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,qe(i,c))));break;case 19:_i(s,i),ii(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,qe(i,p)));break;case 21:break;default:_i(s,i),ii(i)}}function ii(i){var s=i.flags;if(s&2){try{ae(i,Up,i)}catch(c){Et(i,i.return,c)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function sg(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;sg(s),s.tag===5&&s.flags&1024&&uf(s.stateNode),i=i.sibling}}function Q0(i,s,c){Of=c,Nf=s,Xh(s,i.alternate,i),Nf=Of=null}function wa(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)Xh(i,s.alternate,s),s=s.sibling}function Ro(i){switch(i.tag){case 0:case 11:case 14:case 15:Ep(i,i.return,Ci),Ao(i);break;case 1:Ki(i,i.return);var s=i.stateNode;typeof s.componentWillUnmount=="function"&&ag(i,i.return,s),Ao(i);break;case 26:case 27:case 5:Ki(i,i.return),Ao(i);break;case 22:Ki(i,i.return),i.memoizedState===null&&Ao(i);break;default:Ao(i)}}function Ao(i){for(i=i.child;i!==null;)Ro(i),i=i.sibling}function rg(i,s,c,p){var g=c.flags;switch(c.tag){case 0:case 11:case 15:Ks(i,c,p),Hh(c,Ci);break;case 1:if(Ks(i,c,p),s=c.stateNode,typeof s.componentDidMount=="function"&&ae(c,Rb,c,s),s=c.updateQueue,s!==null){i=c.stateNode;try{ae(c,Qy,s,i)}catch(v){Et(c,c.return,v)}}p&&g&64&&Rp(c),Is(c,c.return);break;case 26:case 27:case 5:Ks(i,c,p),p&&s===null&&g&4&&xl(c),Is(c,c.return);break;case 12:if(p&&g&4){g=Hn(),Ks(i,c,p),p=c.stateNode,p.effectDuration+=hl(g);try{ae(c,ju,c,s,jg,p.effectDuration)}catch(v){Et(c,c.return,v)}}else Ks(i,c,p);break;case 13:Ks(i,c,p),p&&g&4&&Np(i,c);break;case 22:c.memoizedState===null&&Ks(i,c,p),Is(c,c.return);break;default:Ks(i,c,p)}}function Ks(i,s,c){for(c=c&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;)rg(i,s.alternate,s,c),s=s.sibling}function wp(i,s){var c=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==c&&(i!=null&&Br(i),c!=null&&Lu(c))}function Pp(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(Br(s),i!=null&&Lu(i))}function us(i,s,c,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)zp(i,s,c,p),s=s.sibling}function zp(i,s,c,p){var g=s.flags;switch(s.tag){case 0:case 11:case 15:us(i,s,c,p),g&2048&&Cp(s,Qn|Cs);break;case 3:var v=Hn();us(i,s,c,p),g&2048&&(c=null,s.alternate!==null&&(c=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==c&&(Br(s),c!=null&&Lu(c))),i.passiveEffectDuration+=cl(v);break;case 12:if(g&2048){v=Hn(),us(i,s,c,p),i=s.stateNode,i.passiveEffectDuration+=hl(v);try{ae(s,Co,s,s.alternate,jg,i.passiveEffectDuration)}catch(R){Et(s,s.return,R)}}else us(i,s,c,p);break;case 23:break;case 22:v=s.stateNode,s.memoizedState!==null?v._visibility&4?us(i,s,c,p):Yu(i,s):v._visibility&4?us(i,s,c,p):(v._visibility|=4,Qs(i,s,c,p,(s.subtreeFlags&10256)!==0)),g&2048&&wp(s.alternate,s);break;case 24:us(i,s,c,p),g&2048&&Pp(s.alternate,s);break;default:us(i,s,c,p)}}function Qs(i,s,c,p,g){for(g=g&&(s.subtreeFlags&10256)!==0,s=s.child;s!==null;)Hp(i,s,c,p,g),s=s.sibling}function Hp(i,s,c,p,g){var v=s.flags;switch(s.tag){case 0:case 11:case 15:Qs(i,s,c,p,g),Cp(s,Qn);break;case 23:break;case 22:var R=s.stateNode;s.memoizedState!==null?R._visibility&4?Qs(i,s,c,p,g):Yu(i,s):(R._visibility|=4,Qs(i,s,c,p,g)),g&&v&2048&&wp(s.alternate,s);break;case 24:Qs(i,s,c,p,g),g&&v&2048&&Pp(s.alternate,s);break;default:Qs(i,s,c,p,g)}}function Yu(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var c=i,p=s,g=p.flags;switch(p.tag){case 22:Yu(c,p),g&2048&&wp(p.alternate,p);break;case 24:Yu(c,p),g&2048&&Pp(p.alternate,p);break;default:Yu(c,p)}s=s.sibling}}function Sl(i){if(i.subtreeFlags&Gf)for(i=i.child;i!==null;)Fh(i),i=i.sibling}function Fh(i){switch(i.tag){case 26:Sl(i),i.flags&Gf&&(i.memoizedState!==null?Lo(lr,i.memoizedState,i.memoizedProps):of(i.type,i.memoizedProps));break;case 5:Sl(i),i.flags&Gf&&of(i.type,i.memoizedProps);break;case 3:case 4:if(Ye){var s=lr;lr=Ut(i.stateNode.containerInfo),Sl(i),lr=s}else Sl(i);break;case 22:i.memoizedState===null&&(s=i.alternate,s!==null&&s.memoizedState!==null?(s=Gf,Gf=16777216,Sl(i),Gf=s):Sl(i));break;default:Sl(i)}}function cs(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function fn(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];ui=p,lg(p,i)}cs(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Zs(i),i=i.sibling}function Zs(i){switch(i.tag){case 0:case 11:case 15:fn(i),i.flags&2048&&Vh(i,i.return,Qn|Cs);break;case 3:var s=Hn();fn(i),i.stateNode.passiveEffectDuration+=cl(s);break;case 12:s=Hn(),fn(i),i.stateNode.passiveEffectDuration+=hl(s);break;case 22:s=i.stateNode,i.memoizedState!==null&&s._visibility&4&&(i.return===null||i.return.tag!==13)?(s._visibility&=-5,vi(i)):fn(i);break;default:fn(i)}}function vi(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var c=0;c<s.length;c++){var p=s[c];ui=p,lg(p,i)}cs(i)}for(i=i.child;i!==null;)Vp(i),i=i.sibling}function Vp(i){switch(i.tag){case 0:case 11:case 15:Vh(i,i.return,Qn),vi(i);break;case 22:var s=i.stateNode;s._visibility&4&&(s._visibility&=-5,vi(i));break;default:vi(i)}}function lg(i,s){for(;ui!==null;){var c=ui,p=c;switch(p.tag){case 0:case 11:case 15:Vh(p,s,Qn);break;case 23:case 22:p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(p=p.memoizedState.cachePool.pool,p!=null&&Br(p));break;case 24:Lu(p.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,ui=p;else e:for(c=i;ui!==null;){p=ui;var g=p.sibling,v=p.return;if(ks(p),p===c){ui=null;break e}if(g!==null){g.return=v,ui=g;break e}ui=v}}}function ai(i){var s=Ml(i);if(s!=null){if(typeof s.memoizedProps["data-testname"]!="string")throw Error("Invalid host root specified. Should be either a React container or a node with a testname attribute.");return s}if(i=Gg(i),i===null)throw Error("Could not find React container within specified host subtree.");return i.stateNode.current}function Ws(i,s){var c=i.tag;switch(s.$$typeof){case n_:if(i.type===s.value)return!0;break;case i_:e:{for(s=s.value,i=[i,0],c=0;c<i.length;){var p=i[c++],g=p.tag,v=i[c++],R=s[v];if(g!==5&&g!==26&&g!==27||!ri(p)){for(;R!=null&&Ws(p,R);)v++,R=s[v];if(v===s.length){s=!0;break e}else for(p=p.child;p!==null;)i.push(p,v),p=p.sibling}}s=!1}return s;case a_:if((c===5||c===26||c===27)&&ms(i.stateNode,s.value))return!0;break;case r_:if((c===5||c===6||c===26||c===27)&&(i=cf(i),i!==null&&0<=i.indexOf(s.value)))return!0;break;case s_:if((c===5||c===26||c===27)&&(i=i.memoizedProps["data-testname"],typeof i=="string"&&i.toLowerCase()===s.value.toLowerCase()))return!0;break;default:throw Error("Invalid selector type specified.")}return!1}function Lp(i){switch(i.$$typeof){case n_:return"<"+(P(i.value)||"Unknown")+">";case i_:return":has("+(Lp(i)||"")+")";case a_:return'[role="'+i.value+'"]';case r_:return'"'+i.value+'"';case s_:return'[data-testname="'+i.value+'"]';default:throw Error("Invalid selector type specified.")}}function og(i,s){var c=[];i=[i,0];for(var p=0;p<i.length;){var g=i[p++],v=g.tag,R=i[p++],N=s[R];if(v!==5&&v!==26&&v!==27||!ri(g)){for(;N!=null&&Ws(g,N);)R++,N=s[R];if(R===s.length)c.push(g);else for(g=g.child;g!==null;)i.push(g,R),g=g.sibling}}return c}function Ih(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");i=ai(i),i=og(i,s),s=[],i=Array.from(i);for(var c=0;c<i.length;){var p=i[c++],g=p.tag;if(g===5||g===26||g===27)ri(p)||s.push(p.stateNode);else for(p=p.child;p!==null;)i.push(p),p=p.sibling}return s}function Z0(){ya&&l_.forEach(function(i){return i()})}function jp(){var i=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return i||$.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),i}function Qi(i){if((Ot&Li)!==aa&&dt!==0)return dt&-dt;var s=$.T;return s!==null?(s._updatedFibers||(s._updatedFibers=new Set),s._updatedFibers.add(i),i=rc,i!==0?i:Ic()):Oo()}function Yp(){Xa===0&&(Xa=(dt&536870912)===0||vt?$t():536870912);var i=Ts.current;return i!==null&&(i.flags|=32),Xa}function Zt(i,s,c){if(Hf&&console.error("useInsertionEffect must not schedule updates."),kb&&(h_=!0),(i===Yt&&Xt===pc||i.cancelPendingCommit!==null)&&(Mo(i,0),$s(i,dt,Xa,!1)),cn(i,c),(Ot&Li)!==0&&i===Yt){if(Xn)switch(s.tag){case 0:case 11:case 15:i=ft&&z(ft)||"Unknown",RR.has(i)||(RR.add(i),s=z(s)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",s,i,i));break;case 1:CR||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),CR=!0)}}else kn&&xn(i,s,c),Sg(s),i===Yt&&((Ot&Li)===aa&&(Wo|=c),vn===dc&&$s(i,dt,Xa,!1)),Ma(i)}function Tl(i,s,c){if((Ot&(Li|kr))!==aa)throw Error("Should not already be working.");var p=!c&&(s&60)===0&&(s&i.expiredLanes)===0||wt(i,s),g=p?J0(i,s):Fp(i,s,!0),v=p;do{if(g===Ll){zf&&!p&&$s(i,s,0,!1);break}else if(g===o_)$s(i,s,0,!jl);else{if(c=i.current.alternate,v&&!W0(c)){g=Fp(i,s,!1),v=!1;continue}if(g===wf){if(v=s,i.errorRecoveryDisabledLanes&v)var R=0;else R=i.pendingLanes&-536870913,R=R!==0?R:R&536870912?536870912:0;if(R!==0){s=R;e:{g=i;var N=R;R=Pm;var Y=Si&&g.current.memoizedState.isDehydrated;if(Y&&(Mo(g,N).flags|=256),N=Fp(g,N,!1),N!==wf){if(Lb&&!Y){g.errorRecoveryDisabledLanes|=v,Wo|=v,g=dc;break e}g=or,or=R,g!==null&&Js(g)}g=N}if(v=!1,g!==wf)continue}}if(g===Om){Mo(i,0),$s(i,s,0,!0);break}e:{switch(p=i,g){case Ll:case Om:throw Error("Root did not complete. This is a bug in React.");case dc:if((s&4194176)===s){$s(p,s,Xa,!jl);break e}break;case wf:or=null;break;case zb:case xR:break;default:throw Error("Unknown root exit status.")}if(p.finishedWork=c,p.finishedLanes=s,$.actQueue!==null)kp(p,or,Hm,u_,Xa,Wo,mc,ER,-0,0);else{if((s&62914560)===s&&(g=Yb+TR-C(),10<g)){if($s(p,s,Xa,!jl),ze(p,0)!==0)break e;p.timeoutHandle=za(ug.bind(null,p,c,or,Hm,u_,s,Xa,Wo,mc,jl,s5,-0,0),g);break e}ug(p,c,or,Hm,u_,s,Xa,Wo,mc,jl,ER,-0,0)}}}break}while(!0);Ma(i)}function Js(i){or===null?or=i:or.push.apply(or,i)}function ug(i,s,c,p,g,v,R,N,Y,J,fe,xe,Re){var mt=s.subtreeFlags;if((mt&8192||(mt&16785408)===16785408)&&(Hr(),Fh(s),s=cb(),s!==null)){i.cancelPendingCommit=s(kp.bind(null,i,c,p,g,R,N,Y,a5,xe,Re)),$s(i,v,R,!J);return}kp(i,c,p,g,R,N,Y,fe,xe,Re)}function W0(i){for(var s=i;;){var c=s.tag;if((c===0||c===11||c===15)&&s.flags&16384&&(c=s.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var g=c[p],v=g.getSnapshot;g=g.value;try{if(!K(v(),g))return!1}catch{return!1}}if(c=s.child,s.subtreeFlags&16384&&c!==null)c.return=s,s=c;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function $s(i,s,c,p){s&=~jb,s&=~Wo,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var g=s;0<g;){var v=31-In(g),R=1<<v;p[v]=-1,g&=~R}c!==0&&$n(i,c,s)}function Or(){return(Ot&(Li|kr))===aa?(vr(0),!1):!0}function Xp(){if(ft!==null){if(Xt===ba)var i=ft.return;else i=ft,Pu(),ih(i),Tf=null,Am=0,i=ft;for(;i!==null;)Tp(i.alternate,i),i=i.return;ft=null}}function Mo(i,s){i.finishedWork=null,i.finishedLanes=0;var c=i.timeoutHandle;c!==Qu&&(i.timeoutHandle=Qu,fs(c)),c=i.cancelPendingCommit,c!==null&&(i.cancelPendingCommit=null,c()),Xp(),Yt=i,ft=c=wr(i.current,null),dt=s,Xt=ba,Ya=null,jl=!1,zf=wt(i,s),Lb=!1,vn=Ll,mc=Xa=jb=Wo=Zo=0,or=Pm=null,u_=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var g=31-In(p),v=1<<g;s|=i[g],p&=~v}return Kr=s,lo(),rr.discardPendingWarnings(),c}function cg(i,s){Ke=null,$.H=Ir,$.getCurrentStack=null,Xn=!1,Yn=null,s===kg?(s=Zc(),Xt=Gm):s===Eb?(s=Zc(),Xt=SR):Xt=s===cR?Vb:s!==null&&typeof s=="object"&&typeof s.then=="function"?Pf:Nm,Ya=s;var c=ft;if(c===null)vn=Om,Ua(i,ei(s,i.current));else switch(c.mode&2&&Xc(c),Za(),Xt){case Nm:ve!==null&&typeof ve.markComponentErrored=="function"&&ve.markComponentErrored(c,s,dt);break;case pc:case Gm:case Pf:case wm:ve!==null&&typeof ve.markComponentSuspended=="function"&&ve.markComponentSuspended(c,s,dt)}}function Do(){var i=Ts.current;return i===null?!0:(dt&4194176)===dt?Fr===null:(dt&62914560)===dt||(dt&536870912)!==0?i===Fr:!1}function hg(){var i=$.H;return $.H=Ir,i===null?Ir:i}function fg(){var i=$.A;return $.A=e5,i}function qp(){vn=dc,jl||(dt&4194176)!==dt&&Ts.current!==null||(zf=!0),(Zo&134217727)===0&&(Wo&134217727)===0||Yt===null||$s(Yt,dt,Xa,!1)}function Fp(i,s,c){var p=Ot;Ot|=Li;var g=hg(),v=fg();if(Yt!==i||dt!==s){if(kn){var R=i.memoizedUpdaters;0<R.size&&(qu(i,dt),R.clear()),Pn(i,s)}Hm=null,Mo(i,s)}Lc(s),s=!1,R=vn;e:do try{if(Xt!==ba&&ft!==null){var N=ft,Y=Ya;switch(Xt){case Vb:Xp(),R=o_;break e;case Gm:case pc:case Pf:Ts.current===null&&(s=!0);var J=Xt;if(Xt=ba,Ya=null,Uo(i,N,Y,J),c&&zf){R=Ll;break e}break;default:J=Xt,Xt=ba,Ya=null,Uo(i,N,Y,J)}}dg(),R=vn;break}catch(fe){cg(i,fe)}while(!0);return s&&i.shellSuspendCounter++,Pu(),Ot=p,$.H=g,$.A=v,io(),ft===null&&(Yt=null,dt=0,lo()),R}function dg(){for(;ft!==null;)pg(ft)}function J0(i,s){var c=Ot;Ot|=Li;var p=hg(),g=fg();if(Yt!==i||dt!==s){if(kn){var v=i.memoizedUpdaters;0<v.size&&(qu(i,dt),v.clear()),Pn(i,s)}Hm=null,zm=C()+Xb,Mo(i,s)}else zf=wt(i,s);Lc(s);e:do try{if(Xt!==ba&&ft!==null)t:switch(s=ft,v=Ya,Xt){case Nm:Xt=ba,Ya=null,Uo(i,s,v,Nm);break;case pc:if(Qc(v)){Xt=ba,Ya=null,mg(s);break}s=function(){Xt===pc&&Yt===i&&(Xt=wm),Ma(i)},v.then(s,s);break e;case Gm:Xt=wm;break e;case SR:Xt=Hb;break e;case wm:Qc(v)?(Xt=ba,Ya=null,mg(s)):(Xt=ba,Ya=null,Uo(i,s,v,wm));break;case Hb:var R=null;switch(ft.tag){case 26:R=ft.memoizedState;case 5:case 27:var N=ft,Y=N.type,J=N.pendingProps;if(R?ea(R):Dl(Y,J)){Xt=ba,Ya=null;var fe=N.sibling;if(fe!==null)ft=fe;else{var xe=N.return;xe!==null?(ft=xe,kh(xe)):ft=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Xt=ba,Ya=null,Uo(i,s,v,Hb);break;case Pf:Xt=ba,Ya=null,Uo(i,s,v,Pf);break;case Vb:Xp(),vn=o_;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}$.actQueue!==null?dg():$0();break}catch(Re){cg(i,Re)}while(!0);return Pu(),$.H=p,$.A=g,Ot=c,ft!==null?(ve!==null&&typeof ve.markRenderYielded=="function"&&ve.markRenderYielded(),Ll):(io(),Yt=null,dt=0,lo(),vn)}function $0(){for(;ft!==null&&!_();)pg(ft)}function pg(i){var s=i.alternate;(i.mode&2)!==kt?(_u(i),s=ae(i,Oh,s,i,Kr),Xc(i)):s=ae(i,Oh,s,i,Kr),i.memoizedProps=i.pendingProps,s===null?kh(i):ft=s}function mg(i){var s=ae(i,eb,i);i.memoizedProps=i.pendingProps,s===null?kh(i):ft=s}function eb(i){var s=i.alternate,c=(i.mode&2)!==kt;switch(c&&_u(i),i.tag){case 15:case 0:s=Ah(s,i,i.pendingProps,i.type,void 0,dt);break;case 11:s=Ah(s,i,i.pendingProps,i.type.render,i.ref,dt);break;case 5:ih(i);default:Tp(s,i),i=ft=Cg(i,Kr),s=Oh(s,i,Kr)}return c&&Xc(i),s}function Uo(i,s,c,p){Pu(),ih(s),Tf=null,Am=0;var g=s.return;try{if(xo(i,g,s,c,dt)){vn=Om,Ua(i,ei(c,i.current)),ft=null;return}}catch(v){if(g!==null)throw ft=g,v;vn=Om,Ua(i,ei(c,i.current)),ft=null;return}s.flags&32768?(vt||p===Nm?i=!0:zf||(dt&536870912)!==0?i=!1:(jl=i=!0,(p===pc||p===Gm||p===Pf)&&(p=Ts.current,p!==null&&p.tag===13&&(p.flags|=16384))),Ip(s,i)):kh(s)}function kh(i){var s=i;do{if((s.flags&32768)!==0){Ip(s,jl);return}var c=s.alternate;if(i=s.return,_u(s),c=ae(s,zh,c,s,Kr),(s.mode&2)!==kt&&Xd(s),c!==null){ft=c;return}if(s=s.sibling,s!==null){ft=s;return}ft=s=i}while(s!==null);vn===Ll&&(vn=xR)}function Ip(i,s){do{var c=vl(i.alternate,i);if(c!==null){c.flags&=32767,ft=c;return}if((i.mode&2)!==kt){Xd(i),c=i.actualDuration;for(var p=i.child;p!==null;)c+=p.actualDuration,p=p.sibling;i.actualDuration=c}if(c=i.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!s&&(i=i.sibling,i!==null)){ft=i;return}ft=i=c}while(i!==null);vn=o_,ft=null}function kp(i,s,c,p,g,v,R,N,Y,J){var fe=$.T,xe=nr();try{Fn(2),$.T=null,tb(i,s,c,p,xe,g,v,R,N,Y,J)}finally{$.T=fe,Fn(xe)}}function tb(i,s,c,p,g,v,R,N){do Nr();while(yc!==null);if(rr.flushLegacyContextWarning(),rr.flushPendingUnsafeLifecycleWarnings(),(Ot&(Li|kr))!==aa)throw Error("Should not already be working.");var Y=i.finishedWork;if(p=i.finishedLanes,ve!==null&&typeof ve.markCommitStarted=="function"&&ve.markCommitStarted(p),Y===null)return no(),null;if(p===0&&console.error("root.finishedLanes should not be empty during a commit. This is a bug in React."),i.finishedWork=null,i.finishedLanes=0,Y===i.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");i.callbackNode=null,i.callbackPriority=0,i.cancelPendingCommit=null;var J=Y.lanes|Y.childLanes;if(J|=mb,Jn(i,p,J,v,R,N),i===Yt&&(ft=Yt=null,dt=0),(Y.subtreeFlags&10256)===0&&(Y.flags&10256)===0||c_||(c_=!0,qb=J,Fb=c,ab(I,function(){return Nr(),null})),jg=_f(),c=(Y.flags&15990)!==0,(Y.subtreeFlags&15990)!==0||c?(c=$.T,$.T=null,v=nr(),Fn(2),R=Ot,Ot|=kr,Bp(i,Y),Gp(i,Y,p),Ku(i.containerInfo),i.current=Y,ve!==null&&typeof ve.markLayoutEffectsStarted=="function"&&ve.markLayoutEffectsStarted(p),Q0(Y,i,p),ve!==null&&typeof ve.markLayoutEffectsStopped=="function"&&ve.markLayoutEffectsStopped(),x(),Ot=R,Fn(v),$.T=c):i.current=Y,(c=c_)?(c_=!1,yc=i,Vm=p):(yg(i,J),gc=0,jm=null),J=i.pendingLanes,J===0&&(Jo=null),c||bg(i),Xe(Y.stateNode,g),kn&&i.memoizedUpdaters.clear(),Z0(),Ma(i),s!==null)for(g=i.onRecoverableError,Y=0;Y<s.length;Y++)J=s[Y],c=nb(J.stack),ae(J.source,g,J.value,c);return(Vm&3)!==0&&Nr(),J=i.pendingLanes,(p&4194218)!==0&&(J&42)!==0?(Xg=!0,i===Ib?Lm++:(Lm=0,Ib=i)):Lm=0,vr(0),no(),null}function nb(i){return i={componentStack:i},Object.defineProperty(i,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),i}function yg(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,Lu(s)))}function Nr(){if(yc!==null){var i=yc,s=qb;qb=0;var c=yr(Vm),p=32>c?32:c;c=$.T;var g=nr();try{if(Fn(p),$.T=null,yc===null)var v=!1;else{p=Fb,Fb=null;var R=yc,N=Vm;if(yc=null,Vm=0,(Ot&(Li|kr))!==aa)throw Error("Cannot flush passive effects while already rendering.");kb=!0,h_=!1,ve!==null&&typeof ve.markPassiveEffectsStarted=="function"&&ve.markPassiveEffectsStarted(N);var Y=Ot;if(Ot|=kr,Zs(R.current),zp(R,R.current,N,p),ve!==null&&typeof ve.markPassiveEffectsStopped=="function"&&ve.markPassiveEffectsStopped(),bg(R),Ot=Y,vr(0,!1),h_?R===jm?gc++:(gc=0,jm=R):gc=0,h_=kb=!1,Ne&&typeof Ne.onPostCommitFiberRoot=="function")try{Ne.onPostCommitFiberRoot(Ee,R)}catch(fe){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",fe))}var J=R.current.stateNode;J.effectDuration=0,J.passiveEffectDuration=0,v=!0}return v}finally{Fn(g),$.T=c,yg(i,s)}}return!1}function gg(i,s,c){s=ei(c,s),s=Nu(i.stateNode,s,2),i=qi(i,s,2),i!==null&&(cn(i,2),Ma(i))}function Et(i,s,c){if(Hf=!1,i.tag===3)gg(i,i,c);else{for(;s!==null;){if(s.tag===3){gg(s,i,c);return}if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Jo===null||!Jo.has(p))){i=ei(c,i),c=ls(2),p=qi(s,c,2),p!==null&&(Ch(c,p,s,i),cn(p,2),Ma(p));return}}s=s.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
|
|
1383
|
+
|
|
1384
|
+
Error message:
|
|
1385
|
+
|
|
1386
|
+
%s`,c)}}function Kh(i,s,c){var p=i.pingCache;if(p===null){p=i.pingCache=new t5;var g=new Set;p.set(s,g)}else g=p.get(s),g===void 0&&(g=new Set,p.set(s,g));g.has(c)||(Lb=!0,g.add(c),p=ib.bind(null,i,s,c),kn&&qu(i,c),s.then(p,p))}function ib(i,s,c){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&c,i.warmLanes&=~c,jp()&&$.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
|
|
1387
|
+
|
|
1388
|
+
When testing, code that resolves suspended data should be wrapped into act(...):
|
|
1389
|
+
|
|
1390
|
+
act(() => {
|
|
1391
|
+
/* finish loading suspended data */
|
|
1392
|
+
});
|
|
1393
|
+
/* assert on the output */
|
|
1394
|
+
|
|
1395
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),Yt===i&&(dt&c)===c&&(vn===dc||vn===zb&&(dt&62914560)===dt&&C()-Yb<TR?(Ot&Li)===aa&&Mo(i,0):jb|=c,mc===dt&&(mc=0)),Ma(i)}function Kp(i,s){s===0&&(s=Ni()),i=hn(i,s),i!==null&&(cn(i,s),Ma(i))}function _g(i){var s=i.memoizedState,c=0;s!==null&&(c=s.retryLane),Kp(i,c)}function vg(i,s){var c=0;switch(i.tag){case 13:var p=i.stateNode,g=i.memoizedState;g!==null&&(c=g.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}p!==null&&p.delete(s),Kp(i,c)}function Xu(i,s,c){if((s.subtreeFlags&33562624)!==0)for(s=s.child;s!==null;){var p=i,g=s,v=g.type===ef;v=c||v,g.tag!==22?g.flags&33554432?v&&ae(g,Qh,p,g,(g.mode&64)===kt):Xu(p,g,v):g.memoizedState===null&&(v&&g.flags&8192?ae(g,Qh,p,g):g.subtreeFlags&33554432&&ae(g,Xu,p,g,v)),s=s.sibling}}function Qh(i,s){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:!0;yt(!0);try{Ro(s),c&&Vp(s),rg(i,s.alternate,s,!1),c&&Hp(i,s,0,null,!1)}finally{yt(!1)}}function bg(i){var s=!0;i.current.mode&24||(s=!1),Xu(i,i.current,s)}function xg(i){if((Ot&Li)===aa){var s=i.tag;if(s===3||s===1||s===0||s===11||s===14||s===15){if(s=z(i)||"ReactComponent",f_!==null){if(f_.has(s))return;f_.add(s)}else f_=new Set([s]);ae(i,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously later calls tries to update the component. Move this work to useEffect instead.")})}}}function qu(i,s){kn&&i.memoizedUpdaters.forEach(function(c){xn(i,c,s)})}function ab(i,s){var c=$.actQueue;return c!==null?(c.push(s),r5):o(i,s)}function Sg(i){jp()&&$.actQueue===null&&ae(i,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
|
|
1396
|
+
|
|
1397
|
+
When testing, code that causes React state updates should be wrapped into act(...):
|
|
1398
|
+
|
|
1399
|
+
act(() => {
|
|
1400
|
+
/* fire events that update state */
|
|
1401
|
+
});
|
|
1402
|
+
/* assert on the output */
|
|
1403
|
+
|
|
1404
|
+
This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,z(i))})}function Gr(i){if(As===null)return i;var s=As(i);return s===void 0?i:s.current}function Qp(i){if(As===null)return i;var s=As(i);return s===void 0?i!=null&&typeof i.render=="function"&&(s=Gr(i.render),i.render!==s)?(s={$$typeof:hs,render:s},i.displayName!==void 0&&(s.displayName=i.displayName),s):i:s.current}function Tg(i,s){if(As===null)return!1;var c=i.elementType;s=s.type;var p=!1,g=typeof s=="object"&&s!==null?s.$$typeof:null;switch(i.tag){case 1:typeof s=="function"&&(p=!0);break;case 0:(typeof s=="function"||g===Wi)&&(p=!0);break;case 11:(g===hs||g===Wi)&&(p=!0);break;case 14:case 15:(g===nf||g===Wi)&&(p=!0);break;default:return!1}return!!(p&&(i=As(c),i!==void 0&&i===As(s)))}function Eg(i){As!==null&&typeof WeakSet=="function"&&(Vf===null&&(Vf=new WeakSet),Vf.add(i))}function Zp(i,s,c){var p=i.alternate,g=i.child,v=i.sibling,R=i.tag,N=i.type,Y=null;switch(R){case 0:case 15:case 1:Y=N;break;case 11:Y=N.render}if(As===null)throw Error("Expected resolveFamily to be set during hot reload.");var J=!1;N=!1,Y!==null&&(Y=As(Y),Y!==void 0&&(c.has(Y)?N=!0:s.has(Y)&&(R===1?N=!0:J=!0))),Vf!==null&&(Vf.has(i)||p!==null&&Vf.has(p))&&(N=!0),N&&(i._debugNeedsRemount=!0),(N||J)&&(p=hn(i,2),p!==null&&Zt(p,i,2)),g===null||N||Zp(g,s,c),v!==null&&Zp(v,s,c)}function sb(i,s,c,p){this.tag=i,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,AR||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function Wp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function wr(i,s){var c=i.alternate;switch(c===null?(c=y(i.tag,s,i.key,i.mode),c.elementType=i.elementType,c.type=i.type,c.stateNode=i.stateNode,c._debugOwner=i._debugOwner,c._debugHookTypes=i._debugHookTypes,c.alternate=i,i.alternate=c):(c.pendingProps=s,c.type=i.type,c.flags=0,c.subtreeFlags=0,c.deletions=null,c.actualDuration=-0,c.actualStartTime=-1.1),c.flags=i.flags&31457280,c.childLanes=i.childLanes,c.lanes=i.lanes,c.child=i.child,c.memoizedProps=i.memoizedProps,c.memoizedState=i.memoizedState,c.updateQueue=i.updateQueue,s=i.dependencies,c.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext,_debugThenableState:s._debugThenableState},c.sibling=i.sibling,c.index=i.index,c.ref=i.ref,c.refCleanup=i.refCleanup,c.selfBaseDuration=i.selfBaseDuration,c.treeBaseDuration=i.treeBaseDuration,c._debugInfo=i._debugInfo,c._debugNeedsRemount=i._debugNeedsRemount,c.tag){case 0:case 15:c.type=Gr(i.type);break;case 1:c.type=Gr(i.type);break;case 11:c.type=Qp(i.type)}return c}function Cg(i,s){i.flags&=31457282;var c=i.alternate;return c===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null,i.selfBaseDuration=0,i.treeBaseDuration=0):(i.childLanes=c.childLanes,i.lanes=c.lanes,i.child=c.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=c.memoizedProps,i.memoizedState=c.memoizedState,i.updateQueue=c.updateQueue,i.type=c.type,s=c.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext,_debugThenableState:s._debugThenableState},i.selfBaseDuration=c.selfBaseDuration,i.treeBaseDuration=c.treeBaseDuration),i}function Jp(i,s,c,p,g,v){var R=0,N=i;if(typeof i=="function")Wp(i)&&(R=1),N=Gr(N);else if(typeof i=="string")Ye&&yn?(R=he(),R=pt(i,c,R)?26:ic(i)?27:5):Ye?(R=he(),R=pt(i,c,R)?26:5):R=yn&&ic(i)?27:5;else e:switch(i){case Rl:return El(c.children,g,v,s);case ef:R=8,g|=24;break;case im:return i=c,p=g,typeof i.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof i.id),s=y(12,i,s,p|2),s.elementType=im,s.lanes=v,s.stateNode={effectDuration:0,passiveEffectDuration:0},s;case Pr:return s=y(13,c,s,g),s.elementType=Pr,s.lanes=v,s;case bi:return s=y(19,c,s,g),s.elementType=bi,s.lanes=v,s;case Fu:return Rg(c,g,v,s);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case ub:case Pa:R=10;break e;case tf:R=9;break e;case hs:R=11,N=Qp(N);break e;case nf:R=14;break e;case Wi:R=16,N=null;break e}N="",(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(N+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),i===null?c="null":Mn(i)?c="array":i!==void 0&&i.$$typeof===Cl?(c="<"+(P(i.type)||"Unknown")+" />",N=" Did you accidentally export a JSX literal instead of a component?"):c=typeof i,R=p?typeof p.tag=="number"?z(p):typeof p.name=="string"?p.name:null:null,R&&(N+=`
|
|
1405
|
+
|
|
1406
|
+
Check the render method of \``+R+"`."),R=29,c=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(c+"."+N)),N=null}return s=y(R,c,s,g),s.elementType=i,s.type=N,s.lanes=v,s._debugOwner=p,s}function Zh(i,s,c){return s=Jp(i.type,i.key,i.props,i._owner,s,c),s._debugOwner=i._owner,s}function El(i,s,c,p){return i=y(7,i,p,s),i.lanes=c,i}function Rg(i,s,c,p){i=y(22,i,p,s),i.elementType=Fu,i.lanes=c;var g={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var v=g,R=v._current;if(R===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if((v._pendingVisibility&2)===0){var N=hn(R,2);N!==null&&(v._pendingVisibility|=2,Zt(N,R,2))}},attach:function(){var v=g,R=v._current;if(R===null)throw Error("Calling Offscreen.detach before instance handle has been set.");if((v._pendingVisibility&2)!==0){var N=hn(R,2);N!==null&&(v._pendingVisibility&=-3,Zt(N,R,2))}}};return i.stateNode=g,i}function $p(i,s,c){return i=y(6,i,null,s),i.lanes=c,i}function Wh(i,s,c){return s=y(4,i.children!==null?i.children:[],i.key,s),s.lanes=c,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}function rb(i,s,c,p,g,v,R,N){for(this.tag=1,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Qu,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Wn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wn(0),this.hiddenUpdates=Wn(null),this.identifierPrefix=p,this.onUncaughtError=g,this.onCaughtError=v,this.onRecoverableError=R,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,i=this.pendingUpdatersLaneMap=[],s=0;31>s;s++)i.push(new Set);this._debugRootType=c?"hydrateRoot()":"createRoot()"}function Ag(i,s,c,p,g,v,R,N,Y,J,fe,xe){return i=new rb(i,s,c,R,N,Y,J,xe),s=1,v===!0&&(s|=24),kn&&(s|=2),v=y(3,null,null,s),i.current=v,v.stateNode=i,s=Gh(),Br(s),i.pooledCache=s,Br(s),v.memoizedState={element:p,isDehydrated:c,cache:s},kc(v),i}function Zi(i){return""+i}function em(i){return i?(i=ga,i):ga}function Jh(i,s,c,p){return s.tag===0&&Nr(),tm(s.current,2,i,s,c,p),2}function tm(i,s,c,p,g,v){if(Ne&&typeof Ne.onScheduleFiberRoot=="function")try{Ne.onScheduleFiberRoot(Ee,p,c)}catch(R){Vi||(Vi=!0,console.error("React instrumentation encountered an error: %s",R))}ve!==null&&typeof ve.markRenderScheduled=="function"&&ve.markRenderScheduled(s),g=em(g),p.context===null?p.context=g:p.pendingContext=g,Xn&&Yn!==null&&!DR&&(DR=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
|
|
1407
|
+
|
|
1408
|
+
Check the render method of %s.`,z(Yn)||"Unknown")),p=Ls(s),p.payload={element:c},v=v===void 0?null:v,v!==null&&(typeof v!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",v),p.callback=v),c=qi(i,p,s),c!==null&&(Zt(c,i,s),uo(c,i,s))}function nm(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var c=i.retryLane;i.retryLane=c!==0&&c<s?c:s}}function $h(i,s){nm(i,s),(i=i.alternate)&&nm(i,s)}function lb(){return Yn}function Mg(){for(var i=new Map,s=1,c=0;31>c;c++){var p=Ae(s);i.set(s,p),s*=2}return i}var ut={},ob=_c(),Pi=r2(),jn=Object.assign,Dg=Symbol.for("react.element"),Cl=Symbol.for("react.transitional.element"),nn=Symbol.for("react.portal"),Rl=Symbol.for("react.fragment"),ef=Symbol.for("react.strict_mode"),im=Symbol.for("react.profiler"),ub=Symbol.for("react.provider"),tf=Symbol.for("react.consumer"),Pa=Symbol.for("react.context"),hs=Symbol.for("react.forward_ref"),Pr=Symbol.for("react.suspense"),bi=Symbol.for("react.suspense_list"),nf=Symbol.for("react.memo"),Wi=Symbol.for("react.lazy"),Fu=Symbol.for("react.offscreen"),af=Symbol.for("react.memo_cache_sentinel"),Iu=Symbol.iterator,am=Symbol.for("react.client.reference"),$=ob.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ku=0,da,sm,Ug,sf,Bg,Og,Ng;Z.__reactDisabledLog=!0;var Al,zi,xi=!1,rf=new(typeof WeakMap=="function"?WeakMap:Map),Yn=null,Xn=!1,Mn=Array.isArray,lf=e.rendererVersion,pa=e.rendererPackageName,Ji=e.extraDevToolsConfig,ma=e.getPublicInstance,er=e.getRootHostContext,tr=e.getChildHostContext,qn=e.prepareForCommit,Ku=e.resetAfterCommit,zr=e.createInstance,Bo=e.appendInitialChild,si=e.finalizeInitialChildren,Sn=e.shouldSetTextContent,_t=e.createTextInstance,za=e.scheduleTimeout,fs=e.cancelTimeout,Qu=e.noTimeout,dn=e.isPrimaryRenderer;e.warnsIfNotActing;var on=e.supportsMutation,ds=e.supportsPersistence,Si=e.supportsHydration,Ml=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var rm=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var Fn=e.setCurrentUpdatePriority,nr=e.getCurrentUpdatePriority,Oo=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Zu=e.shouldAttemptEagerTransition,lm=e.detachDeletedInstance;e.requestPostPaintCallback;var No=e.maySuspendCommit,Dl=e.preloadInstance,Hr=e.startSuspendingCommit,of=e.suspendInstance,cb=e.waitForCommitToBeReady,ps=e.NotPendingTransition,ir=e.HostTransitionContext,uf=e.resetFormInstance,Go=e.bindToConsole,wo=e.supportsMicrotasks,Wu=e.scheduleMicrotask,ya=e.supportsTestSelectors,Gg=e.findFiberRoot,Po=e.getBoundingRect,cf=e.getTextContent,ri=e.isHiddenSubtree,ms=e.matchAccessibilityRole,Tn=e.setFocusIfFocusable,Vr=e.setupIntersectionObserver,lt=e.appendChild,Mt=e.appendChildToContainer,pn=e.commitTextUpdate,hf=e.commitMount,zo=e.commitUpdate,Ul=e.insertBefore,ff=e.insertInContainerBefore,Ju=e.removeChild,Ho=e.removeChildFromContainer,wg=e.resetTextContent,om=e.hideInstance,ys=e.hideTextInstance,Bl=e.unhideInstance,Lr=e.unhideTextInstance,Ol=e.clearContainer,um=e.cloneInstance,cm=e.createContainerChildSet,hm=e.appendChildToContainerChildSet,Dn=e.finalizeContainerChildren,df=e.replaceContainerChildren,$u=e.cloneHiddenInstance,jr=e.cloneHiddenTextInstance,Ha=e.isSuspenseInstancePending,fm=e.isSuspenseInstanceFallback,hb=e.getSuspenseInstanceFallbackErrorDetails,fb=e.registerSuspenseInstanceRetry,an=e.canHydrateFormStateMarker,Pg=e.isFormStateMarkerMatching,ar=e.getNextHydratableSibling,gs=e.getFirstHydratableChild,sn=e.getFirstHydratableChildWithinContainer,dm=e.getFirstHydratableChildWithinSuspenseInstance,zg=e.canHydrateInstance,Un=e.canHydrateTextInstance,Hg=e.canHydrateSuspenseInstance,mn=e.hydrateInstance,$i=e.hydrateTextInstance,Va=e.hydrateSuspenseInstance,Nl=e.getNextHydratableInstanceAfterSuspenseInstance,db=e.commitHydratedContainer,pf=e.commitHydratedSuspenseInstance,mf=e.clearSuspenseBoundary,yf=e.clearSuspenseBoundaryFromContainer,ec=e.shouldDeleteUnhydratedTailInstances,tc=e.diffHydratedPropsForDevWarnings,Vo=e.diffHydratedTextForDevWarnings,Vg=e.describeHydratableInstanceForDevWarnings,Dt=e.validateHydratableInstance,zt=e.validateHydratableTextInstance,Ye=e.supportsResources,pt=e.isHostHoistableType,Ut=e.getHoistableRoot,Hi=e.getResource,_s=e.acquireResource,Gl=e.releaseResource,pm=e.hydrateHoistable,vs=e.mountHoistable,Wt=e.unmountHoistable,Yr=e.createHoistableInstance,wl=e.prepareToCommitHoistables,mm=e.mayResourceSuspendCommit,ea=e.preloadResource,Lo=e.suspendResource,yn=e.supportsSingletons,La=e.resolveSingletonInstance,ym=e.clearSingleton,gm=e.acquireSingletonInstance,nc=e.releaseSingletonInstance,ic=e.isHostSingletonType,bs=[],jo=[],Ti=-1,ga={};Object.freeze(ga);var In=Math.clz32?Math.clz32:be,_m=Math.log,ac=Math.LN2,Yo=128,l=4194304,o=Pi.unstable_scheduleCallback,f=Pi.unstable_cancelCallback,_=Pi.unstable_shouldYield,x=Pi.unstable_requestPaint,C=Pi.unstable_now,O=Pi.unstable_ImmediatePriority,H=Pi.unstable_UserBlockingPriority,I=Pi.unstable_NormalPriority,re=Pi.unstable_IdlePriority,ye=Pi.log,Ce=Pi.unstable_setDisableYieldValue,Ee=null,Ne=null,ve=null,Vi=!1,kn=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",K=typeof Object.is=="function"?Object.is:pu,q=new WeakMap,W=[],ce=0,Be=null,Bt=0,Oe=[],Ze=0,It=null,nt=1,li="",Xr=U(null),vm=U(null),Xo=U(null),Lg=U(null),RC=/["'&<>\n\t]|^\s|\s$/,ta=null,Ei=null,vt=!1,Pl=!1,xs=null,sr=null,qr=!1,pb=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),kt=0,Ss=[],gf=0,mb=0,_f=Pi.unstable_now,jg=-0,_a=-1.1,sc=-0,Yg=!1,Xg=!1,qg=null,vf=null,yb=!1,gb=!1,Fg=!1,_b=!1,bf=0,vb={},bm=null,bb=0,rc=0,xf=null,AC=0,MC=1,DC=2,xb=3,qo=!1,UC=!1,Sb=null,Tb=!1,FG=Object.prototype.hasOwnProperty,rr={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},xm=[],Sm=[],Tm=[],Em=[],Cm=[],Rm=[],lc=new Set;rr.recordUnsafeLifecycleWarnings=function(i,s){lc.has(i.type)||(typeof s.componentWillMount=="function"&&s.componentWillMount.__suppressDeprecationWarning!==!0&&xm.push(i),i.mode&8&&typeof s.UNSAFE_componentWillMount=="function"&&Sm.push(i),typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&Tm.push(i),i.mode&8&&typeof s.UNSAFE_componentWillReceiveProps=="function"&&Em.push(i),typeof s.componentWillUpdate=="function"&&s.componentWillUpdate.__suppressDeprecationWarning!==!0&&Cm.push(i),i.mode&8&&typeof s.UNSAFE_componentWillUpdate=="function"&&Rm.push(i))},rr.flushPendingUnsafeLifecycleWarnings=function(){var i=new Set;0<xm.length&&(xm.forEach(function(N){i.add(z(N)||"Component"),lc.add(N.type)}),xm=[]);var s=new Set;0<Sm.length&&(Sm.forEach(function(N){s.add(z(N)||"Component"),lc.add(N.type)}),Sm=[]);var c=new Set;0<Tm.length&&(Tm.forEach(function(N){c.add(z(N)||"Component"),lc.add(N.type)}),Tm=[]);var p=new Set;0<Em.length&&(Em.forEach(function(N){p.add(z(N)||"Component"),lc.add(N.type)}),Em=[]);var g=new Set;0<Cm.length&&(Cm.forEach(function(N){g.add(z(N)||"Component"),lc.add(N.type)}),Cm=[]);var v=new Set;if(0<Rm.length&&(Rm.forEach(function(N){v.add(z(N)||"Component"),lc.add(N.type)}),Rm=[]),0<s.size){var R=G(s);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1409
|
+
|
|
1410
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
1411
|
+
|
|
1412
|
+
Please update the following components: %s`,R)}0<p.size&&(R=G(p),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1413
|
+
|
|
1414
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
1415
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
|
|
1416
|
+
|
|
1417
|
+
Please update the following components: %s`,R)),0<v.size&&(R=G(v),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1418
|
+
|
|
1419
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
1420
|
+
|
|
1421
|
+
Please update the following components: %s`,R)),0<i.size&&(R=G(i),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1422
|
+
|
|
1423
|
+
* Move code with side effects to componentDidMount, and set initial state in the constructor.
|
|
1424
|
+
* Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
1425
|
+
|
|
1426
|
+
Please update the following components: %s`,R)),0<c.size&&(R=G(c),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1427
|
+
|
|
1428
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
1429
|
+
* If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
|
|
1430
|
+
* Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
1431
|
+
|
|
1432
|
+
Please update the following components: %s`,R)),0<g.size&&(R=G(g),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
|
|
1433
|
+
|
|
1434
|
+
* Move data fetching code or side effects to componentDidUpdate.
|
|
1435
|
+
* Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
|
|
1436
|
+
|
|
1437
|
+
Please update the following components: %s`,R))};var Ig=new Map,BC=new Set;rr.recordLegacyContextWarning=function(i,s){for(var c=null,p=i;p!==null;)p.mode&8&&(c=p),p=p.return;c===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!BC.has(i.type)&&(p=Ig.get(c),i.type.contextTypes!=null||i.type.childContextTypes!=null||s!==null&&typeof s.getChildContext=="function")&&(p===void 0&&(p=[],Ig.set(c,p)),p.push(i))},rr.flushLegacyContextWarning=function(){Ig.forEach(function(i){if(i.length!==0){var s=i[0],c=new Set;i.forEach(function(g){c.add(z(g)||"Component"),BC.add(g.type)});var p=G(c);ae(s,function(){console.error(`Legacy context API has been detected within a strict-mode tree.
|
|
1438
|
+
|
|
1439
|
+
The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
|
|
1440
|
+
|
|
1441
|
+
Please update the following components: %s
|
|
1442
|
+
|
|
1443
|
+
Learn more about this warning here: https://react.dev/link/legacy-context`,p)})}})},rr.discardPendingWarnings=function(){xm=[],Sm=[],Tm=[],Em=[],Cm=[],Rm=[],Ig=new Map};var kg=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`"),Eb=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),Kg={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},Sf=null,Qg=!1,OC={"react-stack-bottom-frame":function(i,s,c){var p=Xn;Xn=!0;try{return i(s,c)}finally{Xn=p}}},Cb=OC["react-stack-bottom-frame"].bind(OC),NC={"react-stack-bottom-frame":function(i){var s=Xn;Xn=!0;try{return i.render()}finally{Xn=s}}},GC=NC["react-stack-bottom-frame"].bind(NC),wC={"react-stack-bottom-frame":function(i,s){try{s.componentDidMount()}catch(c){Et(i,i.return,c)}}},Rb=wC["react-stack-bottom-frame"].bind(wC),PC={"react-stack-bottom-frame":function(i,s,c,p,g){try{s.componentDidUpdate(c,p,g)}catch(v){Et(i,i.return,v)}}},zC=PC["react-stack-bottom-frame"].bind(PC),HC={"react-stack-bottom-frame":function(i,s){var c=s.stack;i.componentDidCatch(s.value,{componentStack:c!==null?c:""})}},IG=HC["react-stack-bottom-frame"].bind(HC),VC={"react-stack-bottom-frame":function(i,s,c){try{c.componentWillUnmount()}catch(p){Et(i,s,p)}}},LC=VC["react-stack-bottom-frame"].bind(VC),jC={"react-stack-bottom-frame":function(i){var s=i.create;return i=i.inst,s=s(),i.destroy=s}},kG=jC["react-stack-bottom-frame"].bind(jC),YC={"react-stack-bottom-frame":function(i,s,c){try{c()}catch(p){Et(i,s,p)}}},KG=YC["react-stack-bottom-frame"].bind(YC),XC={"react-stack-bottom-frame":function(i){var s=i._init;return s(i._payload)}},Fo=XC["react-stack-bottom-frame"].bind(XC),Tf=null,Am=0,ot=null,Ab,qC=Ab=!1,FC={},IC={},kC={};M=function(i,s,c){if(c!==null&&typeof c=="object"&&c._store&&(!c._store.validated&&c.key==null||c._store.validated===2)){if(typeof c._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");c._store.validated=1;var p=z(i),g=p||"null";if(!FC[g]){FC[g]=!0,c=c._owner,i=i._debugOwner;var v="";i&&typeof i.tag=="number"&&(g=z(i))&&(v=`
|
|
1444
|
+
|
|
1445
|
+
Check the render method of \``+g+"`."),v||p&&(v=`
|
|
1446
|
+
|
|
1447
|
+
Check the top-level render call using <`+p+">.");var R="";c!=null&&i!==c&&(p=null,typeof c.tag=="number"?p=z(c):typeof c.name=="string"&&(p=c.name),p&&(R=" It was passed a child from "+p+".")),ae(s,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',v,R)})}}};var oc=$d(!0),KC=$d(!1),Ef=U(null),Zg=U(0),Ts=U(null),Fr=null,Cf=1,Mm=2,Kn=U(0),Es=0,Cs=1,na=2,Ci=4,Qn=8,Rf,QC=new Set,ZC=new Set,Mb=new Set,WC=new Set,Io=0,Ke=null,Ht=null,Bn=null,Wg=!1,Af=!1,uc=!1,Jg=0,Dm=0,zl=null,QG=0,ZG=25,te=null,Rs=null,Hl=-1,Um=!1,Db=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},Ir={readContext:Lt,use:Ys,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useLayoutEffect:tn,useInsertionEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useSyncExternalStore:tn,useId:tn};Ir.useCacheRefresh=tn,Ir.useMemoCache=tn,Ir.useHostTransitionStatus=tn,Ir.useFormState=tn,Ir.useActionState=tn,Ir.useOptimistic=tn;var ko=null,cc=null,Ko=null,hc=null,va=null,ia=null,Qo=null;ko={readContext:function(i){return Lt(i)},use:Ys,useCallback:function(i,s){return te="useCallback",ke(),dl(s),ap(i,s)},useContext:function(i){return te="useContext",ke(),Lt(i)},useEffect:function(i,s){return te="useEffect",ke(),dl(s),bo(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ke(),dl(c),gl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",ke(),dl(s),Cr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ke(),dl(s),dh(i,s)},useMemo:function(i,s){te="useMemo",ke(),dl(s);var c=$.H;$.H=va;try{return mh(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",ke();var p=$.H;$.H=va;try{return Ru(i,s,c)}finally{$.H=p}},useRef:function(i){return te="useRef",ke(),fh(i)},useState:function(i){te="useState",ke();var s=$.H;$.H=va;try{return is(i)}finally{$.H=s}},useDebugValue:function(){te="useDebugValue",ke()},useDeferredValue:function(i,s){return te="useDeferredValue",ke(),as(i,s)},useTransition:function(){return te="useTransition",ke(),yh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ke(),Mu(i,s,c)},useId:function(){return te="useId",ke(),vh()},useCacheRefresh:function(){return te="useCacheRefresh",ke(),up()}},ko.useMemoCache=xr,ko.useHostTransitionStatus=ss,ko.useFormState=function(i,s){return te="useFormState",ke(),yo(),Tr(i,s)},ko.useActionState=function(i,s){return te="useActionState",ke(),Tr(i,s)},ko.useOptimistic=function(i){return te="useOptimistic",ke(),Da(i)},cc={readContext:function(i){return Lt(i)},use:Ys,useCallback:function(i,s){return te="useCallback",ue(),ap(i,s)},useContext:function(i){return te="useContext",ue(),Lt(i)},useEffect:function(i,s){return te="useEffect",ue(),bo(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),gl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",ue(),Cr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),dh(i,s)},useMemo:function(i,s){te="useMemo",ue();var c=$.H;$.H=va;try{return mh(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=$.H;$.H=va;try{return Ru(i,s,c)}finally{$.H=p}},useRef:function(i){return te="useRef",ue(),fh(i)},useState:function(i){te="useState",ue();var s=$.H;$.H=va;try{return is(i)}finally{$.H=s}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),as(i,s)},useTransition:function(){return te="useTransition",ue(),yh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Mu(i,s,c)},useId:function(){return te="useId",ue(),vh()},useCacheRefresh:function(){return te="useCacheRefresh",ue(),up()}},cc.useMemoCache=xr,cc.useHostTransitionStatus=ss,cc.useFormState=function(i,s){return te="useFormState",ue(),yo(),Tr(i,s)},cc.useActionState=function(i,s){return te="useActionState",ue(),Tr(i,s)},cc.useOptimistic=function(i){return te="useOptimistic",ue(),Da(i)},Ko={readContext:function(i){return Lt(i)},use:Ys,useCallback:function(i,s){return te="useCallback",ue(),ph(i,s)},useContext:function(i){return te="useContext",ue(),Lt(i)},useEffect:function(i,s){te="useEffect",ue(),ni(2048,Qn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),Pt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",ue();var c=$.H;$.H=ia;try{return Rr(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=$.H;$.H=ia;try{return pl(i,s,c)}finally{$.H=p}},useRef:function(){return te="useRef",ue(),Tt().memoizedState},useState:function(){te="useState",ue();var i=$.H;$.H=ia;try{return pl(Fi)}finally{$.H=i}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),sp(i,s)},useTransition:function(){return te="useTransition",ue(),gh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Du(i,s,c)},useId:function(){return te="useId",ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState}},Ko.useMemoCache=xr,Ko.useHostTransitionStatus=ss,Ko.useFormState=function(i){return te="useFormState",ue(),yo(),yl(i)},Ko.useActionState=function(i){return te="useActionState",ue(),yl(i)},Ko.useOptimistic=function(i,s){return te="useOptimistic",ue(),lh(i,s)},hc={readContext:function(i){return Lt(i)},use:Ys,useCallback:function(i,s){return te="useCallback",ue(),ph(i,s)},useContext:function(i){return te="useContext",ue(),Lt(i)},useEffect:function(i,s){te="useEffect",ue(),ni(2048,Qn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",ue(),Pt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",ue();var c=$.H;$.H=Qo;try{return Rr(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",ue();var p=$.H;$.H=Qo;try{return ml(i,s,c)}finally{$.H=p}},useRef:function(){return te="useRef",ue(),Tt().memoizedState},useState:function(){te="useState",ue();var i=$.H;$.H=Qo;try{return ml(Fi)}finally{$.H=i}},useDebugValue:function(){te="useDebugValue",ue()},useDeferredValue:function(i,s){return te="useDeferredValue",ue(),rp(i,s)},useTransition:function(){return te="useTransition",ue(),_h()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",ue(),Du(i,s,c)},useId:function(){return te="useId",ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState}},hc.useMemoCache=xr,hc.useHostTransitionStatus=ss,hc.useFormState=function(i){return te="useFormState",ue(),yo(),Bu(i)},hc.useActionState=function(i){return te="useActionState",ue(),Bu(i)},hc.useOptimistic=function(i,s){return te="useOptimistic",ue(),_o(i,s)},va={readContext:function(i){return A(),Lt(i)},use:function(i){return E(),Ys(i)},useCallback:function(i,s){return te="useCallback",E(),ke(),ap(i,s)},useContext:function(i){return te="useContext",E(),ke(),Lt(i)},useEffect:function(i,s){return te="useEffect",E(),ke(),bo(i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),ke(),gl(i,s,c)},useInsertionEffect:function(i,s){te="useInsertionEffect",E(),ke(),Cr(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),ke(),dh(i,s)},useMemo:function(i,s){te="useMemo",E(),ke();var c=$.H;$.H=va;try{return mh(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",E(),ke();var p=$.H;$.H=va;try{return Ru(i,s,c)}finally{$.H=p}},useRef:function(i){return te="useRef",E(),ke(),fh(i)},useState:function(i){te="useState",E(),ke();var s=$.H;$.H=va;try{return is(i)}finally{$.H=s}},useDebugValue:function(){te="useDebugValue",E(),ke()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),ke(),as(i,s)},useTransition:function(){return te="useTransition",E(),ke(),yh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),ke(),Mu(i,s,c)},useId:function(){return te="useId",E(),ke(),vh()},useCacheRefresh:function(){return te="useCacheRefresh",ke(),up()},useMemoCache:function(i){return E(),xr(i)}},va.useHostTransitionStatus=ss,va.useFormState=function(i,s){return te="useFormState",E(),ke(),Tr(i,s)},va.useActionState=function(i,s){return te="useActionState",E(),ke(),Tr(i,s)},va.useOptimistic=function(i){return te="useOptimistic",E(),ke(),Da(i)},ia={readContext:function(i){return A(),Lt(i)},use:function(i){return E(),Ys(i)},useCallback:function(i,s){return te="useCallback",E(),ue(),ph(i,s)},useContext:function(i){return te="useContext",E(),ue(),Lt(i)},useEffect:function(i,s){te="useEffect",E(),ue(),ni(2048,Qn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),ue(),Pt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",E(),ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",E(),ue();var c=$.H;$.H=ia;try{return Rr(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",E(),ue();var p=$.H;$.H=ia;try{return pl(i,s,c)}finally{$.H=p}},useRef:function(){return te="useRef",E(),ue(),Tt().memoizedState},useState:function(){te="useState",E(),ue();var i=$.H;$.H=ia;try{return pl(Fi)}finally{$.H=i}},useDebugValue:function(){te="useDebugValue",E(),ue()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),ue(),sp(i,s)},useTransition:function(){return te="useTransition",E(),ue(),gh()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),ue(),Du(i,s,c)},useId:function(){return te="useId",E(),ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState},useMemoCache:function(i){return E(),xr(i)}},ia.useHostTransitionStatus=ss,ia.useFormState=function(i){return te="useFormState",E(),ue(),yl(i)},ia.useActionState=function(i){return te="useActionState",E(),ue(),yl(i)},ia.useOptimistic=function(i,s){return te="useOptimistic",E(),ue(),lh(i,s)},Qo={readContext:function(i){return A(),Lt(i)},use:function(i){return E(),Ys(i)},useCallback:function(i,s){return te="useCallback",E(),ue(),ph(i,s)},useContext:function(i){return te="useContext",E(),ue(),Lt(i)},useEffect:function(i,s){te="useEffect",E(),ue(),ni(2048,Qn,i,s)},useImperativeHandle:function(i,s,c){return te="useImperativeHandle",E(),ue(),Pt(i,s,c)},useInsertionEffect:function(i,s){return te="useInsertionEffect",E(),ue(),ni(4,na,i,s)},useLayoutEffect:function(i,s){return te="useLayoutEffect",E(),ue(),ni(4,Ci,i,s)},useMemo:function(i,s){te="useMemo",E(),ue();var c=$.H;$.H=ia;try{return Rr(i,s)}finally{$.H=c}},useReducer:function(i,s,c){te="useReducer",E(),ue();var p=$.H;$.H=ia;try{return ml(i,s,c)}finally{$.H=p}},useRef:function(){return te="useRef",E(),ue(),Tt().memoizedState},useState:function(){te="useState",E(),ue();var i=$.H;$.H=ia;try{return ml(Fi)}finally{$.H=i}},useDebugValue:function(){te="useDebugValue",E(),ue()},useDeferredValue:function(i,s){return te="useDeferredValue",E(),ue(),rp(i,s)},useTransition:function(){return te="useTransition",E(),ue(),_h()},useSyncExternalStore:function(i,s,c){return te="useSyncExternalStore",E(),ue(),Du(i,s,c)},useId:function(){return te="useId",E(),ue(),Tt().memoizedState},useCacheRefresh:function(){return te="useCacheRefresh",ue(),Tt().memoizedState},useMemoCache:function(i){return E(),xr(i)}},Qo.useHostTransitionStatus=ss,Qo.useFormState=function(i){return te="useFormState",E(),ue(),Bu(i)},Qo.useActionState=function(i){return te="useActionState",E(),ue(),Bu(i)},Qo.useOptimistic=function(i,s){return te="useOptimistic",E(),ue(),_o(i,s)};var JC={},$C=new Set,eR=new Set,tR=new Set,nR=new Set,iR=new Set,aR=new Set,sR=new Set,rR=new Set,lR=new Set,oR=new Set;Object.freeze(JC);var Ub={isMounted:function(i){var s=Yn;if(s!==null&&Xn&&s.tag===1){var c=s.stateNode;c._warnedAboutRefsInRender||console.error("%s is accessing isMounted inside its render() function. render() should be a pure function of props and state. It should never access something that requires stale data from the previous render, such as refs. Move this logic to componentDidMount and componentDidUpdate instead.",z(s)||"A component"),c._warnedAboutRefsInRender=!0}return(i=i._reactInternals)?We(i)===i:!1},enqueueSetState:function(i,s,c){i=i._reactInternals;var p=Qi(i),g=Ls(p);g.payload=s,c!=null&&(Th(c),g.callback=c),s=qi(i,g,p),s!==null&&(Zt(s,i,p),uo(s,i,p)),gr(i,p)},enqueueReplaceState:function(i,s,c){i=i._reactInternals;var p=Qi(i),g=Ls(p);g.tag=MC,g.payload=s,c!=null&&(Th(c),g.callback=c),s=qi(i,g,p),s!==null&&(Zt(s,i,p),uo(s,i,p)),gr(i,p)},enqueueForceUpdate:function(i,s){i=i._reactInternals;var c=Qi(i),p=Ls(c);p.tag=DC,s!=null&&(Th(s),p.callback=s),s=qi(i,p,c),s!==null&&(Zt(s,i,c),uo(s,i,c)),ve!==null&&typeof ve.markForceUpdateScheduled=="function"&&ve.markForceUpdateScheduled(i,c)}},uR=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Mf=null,Bb=null,cR=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),oi=!1,hR={},fR={},dR={},pR={},Df=!1,mR={},Ob={},Nb={dehydrated:null,treeContext:null,retryLane:0},yR=!1,$g=U(null),Gb=U(null),wb=U(null),e_={},t_=null,Uf=null,Bf=!1,WG=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(c,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(c){return c()})}},JG=Pi.unstable_scheduleCallback,$G=Pi.unstable_NormalPriority,gn={$$typeof:Pa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},gR=$.S;$.S=function(i,s){typeof s=="object"&&s!==null&&typeof s.then=="function"&&ky(i,s),gR!==null&&gR(i,s)};var fc=U(null),_R=null;_R=new Set;var Vl=!1,_n=!1,Pb=!1,vR=typeof WeakSet=="function"?WeakSet:Set,ui=null,Of=null,Nf=null,bR=!1,On=null,ja=!1,lr=null,Gf=8192,e5={getCacheForType:function(i){var s=Lt(gn),c=s.data.get(i);return c===void 0&&(c=i(),s.data.set(i,c)),c},getOwner:function(){return Yn}},n_=0,i_=1,a_=2,s_=3,r_=4;if(typeof Symbol=="function"&&Symbol.for){var Bm=Symbol.for;n_=Bm("selector.component"),i_=Bm("selector.has_pseudo_class"),a_=Bm("selector.role"),s_=Bm("selector.test_id"),r_=Bm("selector.text")}var l_=[],t5=typeof WeakMap=="function"?WeakMap:Map,aa=0,Li=2,kr=4,Ll=0,Om=1,wf=2,zb=3,dc=4,xR=5,o_=6,Ot=aa,Yt=null,ft=null,dt=0,ba=0,Nm=1,pc=2,Gm=3,SR=4,Hb=5,Pf=6,wm=7,Vb=8,Xt=ba,Ya=null,jl=!1,zf=!1,Lb=!1,Kr=0,vn=Ll,Zo=0,Wo=0,jb=0,Xa=0,mc=0,Pm=null,or=null,u_=!1,Yb=0,TR=300,zm=1/0,Xb=500,Hm=null,Jo=null,c_=!1,yc=null,Vm=0,qb=0,Fb=null,n5=50,Lm=0,Ib=null,kb=!1,h_=!1,i5=50,gc=0,jm=null,Hf=!1,ER=0,a5=1,s5=2,f_=null,CR=!1,RR=new Set,r5={},As=null,Vf=null,AR=!1;try{var MR=Object.preventExtensions({})}catch{AR=!0}var DR=!1,UR={},BR=null,OR=null,NR=null,GR=null,wR=null,PR=null,zR=null,HR=null,VR=null;return BR=function(i,s,c,p){s=t(i,s),s!==null&&(c=a(s.memoizedState,c,0,p),s.memoizedState=c,s.baseState=c,i.memoizedProps=jn({},i.memoizedProps),c=hn(i,2),c!==null&&Zt(c,i,2))},OR=function(i,s,c){s=t(i,s),s!==null&&(c=h(s.memoizedState,c,0),s.memoizedState=c,s.baseState=c,i.memoizedProps=jn({},i.memoizedProps),c=hn(i,2),c!==null&&Zt(c,i,2))},NR=function(i,s,c,p){s=t(i,s),s!==null&&(c=r(s.memoizedState,c,p),s.memoizedState=c,s.baseState=c,i.memoizedProps=jn({},i.memoizedProps),c=hn(i,2),c!==null&&Zt(c,i,2))},GR=function(i,s,c){i.pendingProps=a(i.memoizedProps,s,0,c),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=hn(i,2),s!==null&&Zt(s,i,2)},wR=function(i,s){i.pendingProps=h(i.memoizedProps,s,0),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=hn(i,2),s!==null&&Zt(s,i,2)},PR=function(i,s,c){i.pendingProps=r(i.memoizedProps,s,c),i.alternate&&(i.alternate.pendingProps=i.pendingProps),s=hn(i,2),s!==null&&Zt(s,i,2)},zR=function(i){var s=hn(i,2);s!==null&&Zt(s,i,2)},HR=function(i){m=i},VR=function(i){d=i},ut.attemptContinuousHydration=function(i){if(i.tag===13){var s=hn(i,67108864);s!==null&&Zt(s,i,67108864),$h(i,67108864)}},ut.attemptHydrationAtCurrentPriority=function(i){if(i.tag===13){var s=Qi(i),c=hn(i,s);c!==null&&Zt(c,i,s),$h(i,s)}},ut.attemptSynchronousHydration=function(i){switch(i.tag){case 3:if(i=i.stateNode,i.current.memoizedState.isDehydrated){var s=De(i.pendingLanes);if(s!==0){for(i.pendingLanes|=2,i.entangledLanes|=2;s;){var c=1<<31-In(s);i.entanglements[1]|=c,s&=~c}Ma(i),(Ot&(Li|kr))===aa&&(zm=C()+Xb,vr(0))}}break;case 13:s=hn(i,2),s!==null&&Zt(s,i,2),Or(),$h(i,2)}},ut.batchedUpdates=function(i,s){return i(s)},ut.createComponentSelector=function(i){return{$$typeof:n_,value:i}},ut.createContainer=function(i,s,c,p,g,v,R,N,Y,J){return Ag(i,s,!1,null,c,p,v,R,N,Y,J,null)},ut.createHasPseudoClassSelector=function(i){return{$$typeof:i_,value:i}},ut.createHydrationContainer=function(i,s,c,p,g,v,R,N,Y,J,fe,xe,Re){return i=Ag(c,p,!0,i,g,v,N,Y,J,fe,xe,Re),i.context=em(null),c=i.current,p=Qi(c),g=Ls(p),g.callback=s??null,qi(c,g,p),i.current.lanes=p,cn(i,p),Ma(i),i},ut.createPortal=function(i,s,c){var p=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{Zi(p);var g=!1}catch{g=!0}return g&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&p[Symbol.toStringTag]||p.constructor.name||"Object"),Zi(p)),{$$typeof:nn,key:p==null?null:""+p,children:i,containerInfo:s,implementation:c}},ut.createRoleSelector=function(i){return{$$typeof:a_,value:i}},ut.createTestNameSelector=function(i){return{$$typeof:s_,value:i}},ut.createTextSelector=function(i){return{$$typeof:r_,value:i}},ut.defaultOnCaughtError=function(i,s){var c=Mf?"The above error occurred in the <"+Mf+"> component.":"The above error occurred in one of your React components.",p="React will try to recreate this component tree from scratch using the error boundary you provided, "+((Bb||"Anonymous")+"."),g=$.getCurrentStack,v=s.componentStack!=null?s.componentStack:"";$.getCurrentStack=function(){return v};try{typeof i=="object"&&i!==null&&typeof i.environmentName=="string"?Go("error",[`%o
|
|
1448
|
+
|
|
1449
|
+
%s
|
|
1450
|
+
|
|
1451
|
+
%s
|
|
1452
|
+
`,i,c,p],i.environmentName)():console.error(`%o
|
|
1453
|
+
|
|
1454
|
+
%s
|
|
1455
|
+
|
|
1456
|
+
%s
|
|
1457
|
+
`,i,c,p)}finally{$.getCurrentStack=g}},ut.defaultOnRecoverableError=function(i){uR(i)},ut.defaultOnUncaughtError=function(i,s){uR(i),i=Mf?"An error occurred in the <"+Mf+"> component.":"An error occurred in one of your React components.";var c=$.getCurrentStack,p=s.componentStack!=null?s.componentStack:"";$.getCurrentStack=function(){return p};try{console.warn(`%s
|
|
1458
|
+
|
|
1459
|
+
%s
|
|
1460
|
+
`,i,`Consider adding an error boundary to your tree to customize error handling behavior.
|
|
1461
|
+
Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}finally{$.getCurrentStack=c}},ut.deferredUpdates=function(i){var s=$.T,c=nr();try{return Fn(32),$.T=null,i()}finally{Fn(c),$.T=s}},ut.discreteUpdates=function(i,s,c,p,g){var v=$.T,R=nr();try{return Fn(2),$.T=null,i(s,c,p,g)}finally{Fn(R),$.T=v,Ot===aa&&(zm=C()+Xb)}},ut.findAllNodes=Ih,ut.findBoundingRects=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");s=Ih(i,s),i=[];for(var c=0;c<s.length;c++)i.push(Po(s[c]));for(s=i.length-1;0<s;s--){c=i[s];for(var p=c.x,g=p+c.width,v=c.y,R=v+c.height,N=s-1;0<=N;N--)if(s!==N){var Y=i[N],J=Y.x,fe=J+Y.width,xe=Y.y,Re=xe+Y.height;if(p>=J&&v>=xe&&g<=fe&&R<=Re){i.splice(s,1);break}else if(p!==J||c.width!==Y.width||Re<v||xe>R){if(!(v!==xe||c.height!==Y.height||fe<p||J>g)){J>p&&(Y.width+=J-p,Y.x=p),fe<g&&(Y.width=g-J),i.splice(s,1);break}}else{xe>v&&(Y.height+=xe-v,Y.y=v),Re<R&&(Y.height=R-xe),i.splice(s,1);break}}}return i},ut.findHostInstance=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):(i=Object.keys(i).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+i));return i=ee(s),i===null?null:ma(i.stateNode)},ut.findHostInstanceWithNoPortals=function(i){return i=j(i),i=i!==null?pe(i):null,i===null?null:ma(i.stateNode)},ut.findHostInstanceWithWarning=function(i,s){var c=i._reactInternals;if(c===void 0)throw typeof i.render=="function"?Error("Unable to find node on an unmounted component."):(i=Object.keys(i).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+i));if(i=ee(c),i===null)return null;if(i.mode&8){var p=z(c)||"Component";UR[p]||(UR[p]=!0,ae(i,function(){c.mode&8?console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which is inside StrictMode. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",s,s,p):console.error("%s is deprecated in StrictMode. %s was passed an instance of %s which renders StrictMode children. Instead, add a ref directly to the element you want to reference. Learn more about using refs safely here: https://react.dev/link/strict-mode-find-node",s,s,p)}))}return ma(i.stateNode)},ut.flushPassiveEffects=Nr,ut.flushSyncFromReconciler=function(i){var s=Ot;Ot|=1;var c=$.T,p=nr();try{if(Fn(2),$.T=null,i)return i()}finally{Fn(p),$.T=c,Ot=s,(Ot&(Li|kr))===aa&&vr(0)}},ut.flushSyncWork=Or,ut.focusWithin=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");for(i=ai(i),s=og(i,s),s=Array.from(s),i=0;i<s.length;){var c=s[i++],p=c.tag;if(!ri(c)){if((p===5||p===26||p===27)&&Tn(c.stateNode))return!0;for(c=c.child;c!==null;)s.push(c),c=c.sibling}}return!1},ut.getFindAllNodesFailureDescription=function(i,s){if(!ya)throw Error("Test selector API is not supported by this renderer.");var c=0,p=[];i=[ai(i),0];for(var g=0;g<i.length;){var v=i[g++],R=v.tag,N=i[g++],Y=s[N];if((R!==5&&R!==26&&R!==27||!ri(v))&&(Ws(v,Y)&&(p.push(Lp(Y)),N++,N>c&&(c=N)),N<s.length))for(v=v.child;v!==null;)i.push(v,N),v=v.sibling}if(c<s.length){for(i=[];c<s.length;c++)i.push(Lp(s[c]));return`findAllNodes was able to match part of the selector:
|
|
1462
|
+
`+(p.join(" > ")+`
|
|
1463
|
+
|
|
1464
|
+
No matching component was found for:
|
|
1465
|
+
`)+i.join(" > ")}return null},ut.getPublicRootInstance=function(i){if(i=i.current,!i.child)return null;switch(i.child.tag){case 27:case 5:return ma(i.child.stateNode);default:return i.child.stateNode}},ut.injectIntoDevTools=function(){var i={bundleType:1,version:lf,rendererPackageName:pa,currentDispatcherRef:$,findFiberByHostInstance:Ml,reconcilerVersion:"19.0.0"};return Ji!==null&&(i.rendererConfig=Ji),i.overrideHookState=BR,i.overrideHookStateDeletePath=OR,i.overrideHookStateRenamePath=NR,i.overrideProps=GR,i.overridePropsDeletePath=wR,i.overridePropsRenamePath=PR,i.scheduleUpdate=zR,i.setErrorHandler=HR,i.setSuspenseHandler=VR,i.scheduleRefresh=S,i.scheduleRoot=b,i.setRefreshHandler=T,i.getCurrentFiber=lb,i.getLaneLabelMap=Mg,i.injectProfilingHooks=Vc,ll(i)},ut.isAlreadyRendering=function(){return(Ot&(Li|kr))!==aa},ut.observeVisibleRects=function(i,s,c,p){function g(){var J=Ih(i,s);v.forEach(function(fe){0>J.indexOf(fe)&&Y(fe)}),J.forEach(function(fe){0>v.indexOf(fe)&&N(fe)})}if(!ya)throw Error("Test selector API is not supported by this renderer.");var v=Ih(i,s);c=Vr(v,c,p);var R=c.disconnect,N=c.observe,Y=c.unobserve;return l_.push(g),{disconnect:function(){var J=l_.indexOf(g);0<=J&&l_.splice(J,1),R()}}},ut.shouldError=function(i){return m(i)},ut.shouldSuspend=function(i){return d(i)},ut.startHostTransition=function(i,s,c,p){if(i.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var g=op(i).queue;lp(i,g,s,ps,c===null?B:function(){$.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var v=op(i).next.queue;return _l(i,v,{},Qi(i)),c(p)})},ut.updateContainer=function(i,s,c,p){var g=s.current,v=Qi(g);return tm(g,v,i,s,c,p),v},ut.updateContainerSync=Jh,ut},n.exports.default=n.exports,Object.defineProperty(n.exports,"__esModule",{value:!0}))}(y0)),y0.exports}var u2;function TO(){return u2||(u2=1,process.env.NODE_ENV==="production"?Ay.exports=xO():Ay.exports=SO()),Ay.exports}var EO=TO();const CO=xa(EO);function RO(n,e,t,a){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function AO(){}function MO(){return!1}const c2={};function DO(n){return n??c2}function UO(){return Wl.currentUpdatePriority}function BO(){return null}function OO(n){throw new Error("Not yet implemented.")}function NO(n){return n}function GO(){return c2}function wO(n){n instanceof Gn?n.visible=!1:n instanceof Fl&&(n.enabled=!1)}function PO(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function h2(n){if(n instanceof Fl){const e=n.__pixireact.parent;if(e){const t=e.__pixireact.filters.indexOf(n);e.__pixireact.filters.splice(t,1),e.filters=e.__pixireact.filters}n.__pixireact.parent=null}}function g0(n,e,...t){if(process.env.NODE_ENV!=="production"&&!n){let a;if(e===void 0)a=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;a=new Error(e.replace(/%s/g,()=>String(t[r++]))),a.name="Invariant Violation"}throw a}}function f2(n,e,t){if(g0(e!==t,"Cannot insert node before itself"),e instanceof Gn){const a=e,r=e,u=t;a.parent===n&&n.removeChild(r);const h=n.getChildIndex(u);n.addChildAt(r,h)}else if(e instanceof Fl){const u=e.__pixireact.filters.indexOf(t);h2(e),KE(n,e,u)}}function zO(){return!1}function HO(){return!0}function VO(){return null}function LO(){}function jO(){}function d2(n,e){e instanceof Fl&&h2(e),e.destroy()}function YO(n){}function XO(){}function qO(){}function FO(){return-1.1}function IO(){return null}function kO(){var t;if(Wl.currentUpdatePriority)return Wl.currentUpdatePriority;const n=typeof self<"u"&&self||typeof window<"u"&&window;if(!n)return Oc.DefaultEventPriority;switch((t=n.event)==null?void 0:t.type){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return Oc.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return Oc.ContinuousEventPriority;default:return Oc.DefaultEventPriority}}function KO(n){Wl.currentUpdatePriority=n}function QO(){return!1}function ZO(){return!1}function WO(){}function JO(){}function $O(){}function eN(n){n instanceof Gn?n.visible=!0:n instanceof Fl&&(n.enabled=!0)}function tN(n){throw new Error("Text instances are not yet supported. Please use a `<text>` component.")}function nN(){return null}const Dy=CO({isPrimaryRenderer:!1,noTimeout:-1,NotPendingTransition:null,supportsHydration:!1,supportsMutation:!0,supportsPersistence:!1,warnsIfNotActing:!1,afterActiveInstanceBlur:eO,appendChild:u0,appendChildToContainer:u0,appendInitialChild:u0,beforeActiveInstanceBlur:tO,cancelTimeout:clearTimeout,clearContainer:nO,commitUpdate:dO,createInstance:_O,createTextInstance:RO,hideTextInstance:PO,unhideTextInstance:tN,detachDeletedInstance:AO,finalizeInitialChildren:MO,getChildHostContext:DO,getCurrentUpdatePriority:UO,getInstanceFromNode:BO,getInstanceFromScope:OO,getPublicInstance:NO,getRootHostContext:GO,hideInstance:wO,insertBefore:f2,insertInContainerBefore:f2,maySuspendCommit:zO,preloadInstance:HO,prepareForCommit:VO,preparePortalMount:LO,prepareScopeUpdate:jO,removeChild:d2,removeChildFromContainer:d2,requestPostPaintCallback:YO,resetAfterCommit:XO,resetFormInstance:qO,resolveEventTimeStamp:FO,resolveEventType:IO,resolveUpdatePriority:kO,scheduleTimeout:setTimeout,shouldAttemptEagerTransition:QO,setCurrentUpdatePriority:KO,shouldSetTextContent:ZO,startSuspendingCommit:WO,suspendInstance:JO,trackSchedulerEvent:$O,unhideInstance:eN,waitForCommitToBeReady:nN});Dy.injectIntoDevTools({bundleType:process.env.NODE_ENV==="production"?0:1,rendererPackageName:"@pixi/react",version:$B.version});const Nc=new Map;function iN(n,e={}){let t=Nc.get(n),a=(t==null?void 0:t.applicationState)??{isInitialised:!1,isInitialising:!1};const r=(t==null?void 0:t.internalState)??{};t||(a.app=new iv,r.rootContainer=kE(a.app.stage));const u=(t==null?void 0:t.fiber)??Dy.createContainer(r.rootContainer,Oc.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null);if(!t){let h;n instanceof HTMLCanvasElement&&(h=n),h||(h=document.createElement("canvas"),n.innerHTML="",n.appendChild(h)),r.canvas=h,t={applicationState:a,fiber:u,internalState:r,render:async(m,y)=>{var b;return!a.app.renderer&&!a.isInitialised&&!a.isInitialising&&(a.isInitialising=!0,await a.app.init({...y,canvas:h}),a.isInitialising=!1,a.isInitialised=!0,a={...a},(b=e.onInit)==null||b.call(e,a.app)),Object.entries(y).forEach(([S,T])=>{const E=S;FE(y,E)||(a.app[E]=T)}),Dy.updateContainer(Ai.jsx(WB,{value:a,children:m}),u,null,()=>{}),a.app}},Nc.set(h,t)}return t}function p2(n){Wl.unmountQueue.delete(n);const e=n.fiber;e&&Dy.updateContainer(null,e,null,()=>{n.applicationState.app&&n.applicationState.app.destroy(),Nc.delete(n.internalState.canvas)})}function aN(){for(const n of Wl.unmountQueue)p2(n)}function sN(n){const e=Nc.get(n);e&&(e.applicationState.isInitialised?p2(e):Wl.unmountQueue.add(e))}function rN(n){const e=Nc.get(n);e&&Wl.unmountQueue.delete(e)}const xd=typeof window<"u"&&((EC=window.document)!=null&&EC.createElement||((CC=window.navigator)==null?void 0:CC.product)==="ReactNative")?He.useLayoutEffect:He.useEffect,lN={...nl.defaultTextStyle},oN=He.forwardRef(function(e,t){const{children:a,className:r,defaultTextStyle:u,extensions:h,onInit:d,resizeTo:m,...y}=e,b=bA(),S=He.useRef(null),T=He.useRef(null),E=He.useRef(new Set);He.useImperativeHandle(t,()=>({getApplication(){return S.current},getCanvas(){return T.current}}));const A=He.useCallback(()=>{const M=S.current;M&&(m?"current"in m?m.current instanceof HTMLElement&&(M.resizeTo=m.current):M.resizeTo=m:M.resizeTo=void 0)},[m]),B=He.useCallback(M=>{aN(),S.current=M,A(),d==null||d(M)},[d]);return xd(()=>{if(h){const M=[...h],G=E.current;for(const w of G.values()){const P=M.indexOf(w);P===-1&&(Ie.remove(w),G.delete(w)),M.splice(P,1)}for(const w in M)Ie.add(w),G.add(w)}},[h]),xd(()=>{const M=T.current;if(M){let G=Nc.get(M);G||(G=iN(M,{onInit:B})),G.render(Ai.jsx(b,{children:a}),y)}},[y,a,B,m]),xd(()=>{A()},[m]),xd(()=>{u?Object.assign(nl.defaultTextStyle,u):Object.assign(nl.defaultTextStyle,lN)},[u]),He.useEffect(()=>{const M=T.current;if(M)return rN(M),()=>{sN(M)}},[]),Ai.jsx("canvas",{ref:T,className:r})}),uN=He.forwardRef(function(e,t){return Ai.jsx(hx,{children:Ai.jsx(oN,{ref:t,...e})})});function cN(n){Object.assign(f0,n)}function m2(){const n=He.useContext(o0);return g0(n.app instanceof iv,"No Context found with `%s`. Make sure to wrap component with `%s`","Application","AppProvider"),n}function hN(n){const{app:e,isInitialised:t}=m2();let a,r,u=!0,h;typeof n=="function"?a=n:(a=n.callback,r=n.context,u=n.isEnabled??!0,h=n.priority),g0(typeof a=="function","`useTick` needs a callback function."),xd(()=>{if(t){const d=e==null?void 0:e.ticker,m=u,y=r,b=a;return u&&d&&d.add(a,r,h),()=>{m&&(d==null||d.remove(b,y))}}},[e==null?void 0:e.ticker,a,r,u,t,h])}var _0=Td(),Je=n=>Sd(n,_0),v0=Td();Je.write=n=>Sd(n,v0);var Uy=Td();Je.onStart=n=>Sd(n,Uy);var b0=Td();Je.onFrame=n=>Sd(n,b0);var x0=Td();Je.onFinish=n=>Sd(n,x0);var Gc=[];Je.setTimeout=(n,e)=>{const t=Je.now()+e,a=()=>{const u=Gc.findIndex(h=>h.cancel==a);~u&&Gc.splice(u,1),$l-=~u?1:0},r={time:t,handler:n,cancel:a};return Gc.splice(y2(t),0,r),$l+=1,g2(),r};var y2=n=>~(~Gc.findIndex(e=>e.time>n)||~Gc.length);Je.cancel=n=>{Uy.delete(n),b0.delete(n),x0.delete(n),_0.delete(n),v0.delete(n)},Je.sync=n=>{T0=!0,Je.batchedUpdates(n),T0=!1},Je.throttle=n=>{let e;function t(){try{n(...e)}finally{e=null}}function a(...r){e=r,Je.onStart(t)}return a.handler=n,a.cancel=()=>{Uy.delete(t),e=null},a};var S0=typeof window<"u"?window.requestAnimationFrame:()=>{};Je.use=n=>S0=n,Je.now=typeof performance<"u"?()=>performance.now():Date.now,Je.batchedUpdates=n=>n(),Je.catch=console.error,Je.frameLoop="always",Je.advance=()=>{Je.frameLoop!=="demand"?console.warn("Cannot call the manual advancement of rafz whilst frameLoop is not set as demand"):v2()};var Jl=-1,$l=0,T0=!1;function Sd(n,e){T0?(e.delete(n),n(0)):(e.add(n),g2())}function g2(){Jl<0&&(Jl=0,Je.frameLoop!=="demand"&&S0(_2))}function fN(){Jl=-1}function _2(){~Jl&&(S0(_2),Je.batchedUpdates(v2))}function v2(){const n=Jl;Jl=Je.now();const e=y2(Jl);if(e&&(b2(Gc.splice(0,e),t=>t.handler()),$l-=e),!$l){fN();return}Uy.flush(),_0.flush(n?Math.min(64,Jl-n):16.667),b0.flush(),v0.flush(),x0.flush()}function Td(){let n=new Set,e=n;return{add(t){$l+=e==n&&!n.has(t)?1:0,n.add(t)},delete(t){return $l-=e==n&&n.has(t)?1:0,n.delete(t)},flush(t){e.size&&(n=new Set,$l-=e.size,b2(e,a=>a(t)&&n.add(a)),$l+=n.size,e=n)}}}function b2(n,e){n.forEach(t=>{try{e(t)}catch(a){Je.catch(a)}})}var dN=Object.defineProperty,pN=(n,e)=>{for(var t in e)dN(n,t,{get:e[t],enumerable:!0})},Ns={};pN(Ns,{assign:()=>yN,colors:()=>eo,createStringInterpolator:()=>R0,skipAnimation:()=>S2,to:()=>x2,willAdvance:()=>A0});function E0(){}var mN=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),ge={arr:Array.isArray,obj:n=>!!n&&n.constructor.name==="Object",fun:n=>typeof n=="function",str:n=>typeof n=="string",num:n=>typeof n=="number",und:n=>n===void 0};function rl(n,e){if(ge.arr(n)){if(!ge.arr(e)||n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}return n===e}var gt=(n,e)=>n.forEach(e);function pr(n,e,t){if(ge.arr(n)){for(let a=0;a<n.length;a++)e.call(t,n[a],`${a}`);return}for(const a in n)n.hasOwnProperty(a)&&e.call(t,n[a],a)}var Ca=n=>ge.und(n)?[]:ge.arr(n)?n:[n];function Ed(n,e){if(n.size){const t=Array.from(n);n.clear(),gt(t,e)}}var Cd=(n,...e)=>Ed(n,t=>t(...e)),C0=()=>typeof window>"u"||!window.navigator||/ServerSideRendering|^Deno\//.test(window.navigator.userAgent),R0,x2,eo=null,S2=!1,A0=E0,yN=n=>{n.to&&(x2=n.to),n.now&&(Je.now=n.now),n.colors!==void 0&&(eo=n.colors),n.skipAnimation!=null&&(S2=n.skipAnimation),n.createStringInterpolator&&(R0=n.createStringInterpolator),n.requestAnimationFrame&&Je.use(n.requestAnimationFrame),n.batchedUpdates&&(Je.batchedUpdates=n.batchedUpdates),n.willAdvance&&(A0=n.willAdvance),n.frameLoop&&(Je.frameLoop=n.frameLoop)},Rd=new Set,Ka=[],M0=[],By=0,Oy={get idle(){return!Rd.size&&!Ka.length},start(n){By>n.priority?(Rd.add(n),Je.onStart(gN)):(T2(n),Je(D0))},advance:D0,sort(n){if(By)Je.onFrame(()=>Oy.sort(n));else{const e=Ka.indexOf(n);~e&&(Ka.splice(e,1),E2(n))}},clear(){Ka=[],Rd.clear()}};function gN(){Rd.forEach(T2),Rd.clear(),Je(D0)}function T2(n){Ka.includes(n)||E2(n)}function E2(n){Ka.splice(_N(Ka,e=>e.priority>n.priority),0,n)}function D0(n){const e=M0;for(let t=0;t<Ka.length;t++){const a=Ka[t];By=a.priority,a.idle||(A0(a),a.advance(n),a.idle||e.push(a))}return By=0,M0=Ka,M0.length=0,Ka=e,Ka.length>0}function _N(n,e){const t=n.findIndex(e);return t<0?n.length:t}var vN={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},Gs="[-+]?\\d*\\.?\\d+",Ny=Gs+"%";function Gy(...n){return"\\(\\s*("+n.join(")\\s*,\\s*(")+")\\s*\\)"}var bN=new RegExp("rgb"+Gy(Gs,Gs,Gs)),xN=new RegExp("rgba"+Gy(Gs,Gs,Gs,Gs)),SN=new RegExp("hsl"+Gy(Gs,Ny,Ny)),TN=new RegExp("hsla"+Gy(Gs,Ny,Ny,Gs)),EN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,CN=/^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,RN=/^#([0-9a-fA-F]{6})$/,AN=/^#([0-9a-fA-F]{8})$/;function MN(n){let e;return typeof n=="number"?n>>>0===n&&n>=0&&n<=4294967295?n:null:(e=RN.exec(n))?parseInt(e[1]+"ff",16)>>>0:eo&&eo[n]!==void 0?eo[n]:(e=bN.exec(n))?(wc(e[1])<<24|wc(e[2])<<16|wc(e[3])<<8|255)>>>0:(e=xN.exec(n))?(wc(e[1])<<24|wc(e[2])<<16|wc(e[3])<<8|A2(e[4]))>>>0:(e=EN.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+"ff",16)>>>0:(e=AN.exec(n))?parseInt(e[1],16)>>>0:(e=CN.exec(n))?parseInt(e[1]+e[1]+e[2]+e[2]+e[3]+e[3]+e[4]+e[4],16)>>>0:(e=SN.exec(n))?(C2(R2(e[1]),wy(e[2]),wy(e[3]))|255)>>>0:(e=TN.exec(n))?(C2(R2(e[1]),wy(e[2]),wy(e[3]))|A2(e[4]))>>>0:null}function U0(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function C2(n,e,t){const a=t<.5?t*(1+e):t+e-t*e,r=2*t-a,u=U0(r,a,n+1/3),h=U0(r,a,n),d=U0(r,a,n-1/3);return Math.round(u*255)<<24|Math.round(h*255)<<16|Math.round(d*255)<<8}function wc(n){const e=parseInt(n,10);return e<0?0:e>255?255:e}function R2(n){return(parseFloat(n)%360+360)%360/360}function A2(n){const e=parseFloat(n);return e<0?0:e>1?255:Math.round(e*255)}function wy(n){const e=parseFloat(n);return e<0?0:e>100?1:e/100}function M2(n){let e=MN(n);if(e===null)return n;e=e||0;const t=(e&4278190080)>>>24,a=(e&16711680)>>>16,r=(e&65280)>>>8,u=(e&255)/255;return`rgba(${t}, ${a}, ${r}, ${u})`}var Ad=(n,e,t)=>{if(ge.fun(n))return n;if(ge.arr(n))return Ad({range:n,output:e,extrapolate:t});if(ge.str(n.output[0]))return R0(n);const a=n,r=a.output,u=a.range||[0,1],h=a.extrapolateLeft||a.extrapolate||"extend",d=a.extrapolateRight||a.extrapolate||"extend",m=a.easing||(y=>y);return y=>{const b=UN(y,u);return DN(y,u[b],u[b+1],r[b],r[b+1],m,h,d,a.map)}};function DN(n,e,t,a,r,u,h,d,m){let y=m?m(n):n;if(y<e){if(h==="identity")return y;h==="clamp"&&(y=e)}if(y>t){if(d==="identity")return y;d==="clamp"&&(y=t)}return a===r?a:e===t?n<=e?a:r:(e===-1/0?y=-y:t===1/0?y=y-e:y=(y-e)/(t-e),y=u(y),a===-1/0?y=-y:r===1/0?y=y+a:y=y*(r-a)+a,y)}function UN(n,e){for(var t=1;t<e.length-1&&!(e[t]>=n);++t);return t-1}var BN={linear:n=>n},Md=Symbol.for("FluidValue.get"),Pc=Symbol.for("FluidValue.observers"),Qa=n=>!!(n&&n[Md]),ra=n=>n&&n[Md]?n[Md]():n,D2=n=>n[Pc]||null;function ON(n,e){n.eventObserved?n.eventObserved(e):n(e)}function Dd(n,e){const t=n[Pc];t&&t.forEach(a=>{ON(a,e)})}var U2=class{constructor(n){if(!n&&!(n=this.get))throw Error("Unknown getter");NN(this,n)}},NN=(n,e)=>B2(n,Md,e);function zc(n,e){if(n[Md]){let t=n[Pc];t||B2(n,Pc,t=new Set),t.has(e)||(t.add(e),n.observerAdded&&n.observerAdded(t.size,e))}return e}function Ud(n,e){const t=n[Pc];if(t&&t.has(e)){const a=t.size-1;a?t.delete(e):n[Pc]=null,n.observerRemoved&&n.observerRemoved(a,e)}}var B2=(n,e,t)=>Object.defineProperty(n,e,{value:t,writable:!0,configurable:!0}),Py=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,GN=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,O2=new RegExp(`(${Py.source})(%|[a-z]+)`,"i"),wN=/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,zy=/var\((--[a-zA-Z0-9-_]+),? ?([a-zA-Z0-9 ()%#.,-]+)?\)/,N2=n=>{const[e,t]=PN(n);if(!e||C0())return n;const a=window.getComputedStyle(document.documentElement).getPropertyValue(e);if(a)return a.trim();if(t&&t.startsWith("--")){const r=window.getComputedStyle(document.documentElement).getPropertyValue(t);return r||n}else{if(t&&zy.test(t))return N2(t);if(t)return t}return n},PN=n=>{const e=zy.exec(n);if(!e)return[,];const[,t,a]=e;return[t,a]},B0,zN=(n,e,t,a,r)=>`rgba(${Math.round(e)}, ${Math.round(t)}, ${Math.round(a)}, ${r})`,G2=n=>{B0||(B0=eo?new RegExp(`(${Object.keys(eo).join("|")})(?!\\w)`,"g"):/^\b$/);const e=n.output.map(u=>ra(u).replace(zy,N2).replace(GN,M2).replace(B0,M2)),t=e.map(u=>u.match(Py).map(Number)),r=t[0].map((u,h)=>t.map(d=>{if(!(h in d))throw Error('The arity of each "output" value must be equal');return d[h]})).map(u=>Ad({...n,output:u}));return u=>{var m;const h=!O2.test(e[0])&&((m=e.find(y=>O2.test(y)))==null?void 0:m.replace(Py,""));let d=0;return e[0].replace(Py,()=>`${r[d++](u)}${h||""}`).replace(wN,zN)}},O0="react-spring: ",w2=n=>{const e=n;let t=!1;if(typeof e!="function")throw new TypeError(`${O0}once requires a function parameter`);return(...a)=>{t||(e(...a),t=!0)}},HN=w2(console.warn);function VN(){HN(`${O0}The "interpolate" function is deprecated in v9 (use "to" instead)`)}var LN=w2(console.warn);function jN(){LN(`${O0}Directly calling start instead of using the api object is deprecated in v9 (use ".start" instead), this will be removed in later 0.X.0 versions`)}function Hy(n){return ge.str(n)&&(n[0]=="#"||/\d/.test(n)||!C0()&&zy.test(n)||n in(eo||{}))}var N0=C0()?He.useEffect:He.useLayoutEffect,YN=()=>{const n=He.useRef(!1);return N0(()=>(n.current=!0,()=>{n.current=!1}),[]),n};function P2(){const n=He.useState()[1],e=YN();return()=>{e.current&&n(Math.random())}}var z2=n=>He.useEffect(n,XN),XN=[];function H2(n){const e=He.useRef(void 0);return He.useEffect(()=>{e.current=n}),e.current}var Bd=Symbol.for("Animated:node"),qN=n=>!!n&&n[Bd]===n,mr=n=>n&&n[Bd],G0=(n,e)=>mN(n,Bd,e),Vy=n=>n&&n[Bd]&&n[Bd].getPayload(),V2=class{constructor(){G0(this,this)}getPayload(){return this.payload||[]}},Ly=class oA extends V2{constructor(e){super(),this._value=e,this.done=!0,this.durationProgress=0,ge.num(this._value)&&(this.lastPosition=this._value)}static create(e){return new oA(e)}getPayload(){return[this]}getValue(){return this._value}setValue(e,t){return ge.num(e)&&(this.lastPosition=e,t&&(e=Math.round(e/t)*t,this.done&&(this.lastPosition=e))),this._value===e?!1:(this._value=e,!0)}reset(){const{done:e}=this;this.done=!1,ge.num(this._value)&&(this.elapsedTime=0,this.durationProgress=0,this.lastPosition=this._value,e&&(this.lastVelocity=null),this.v0=null)}},jy=class uA extends Ly{constructor(e){super(0),this._string=null,this._toString=Ad({output:[e,e]})}static create(e){return new uA(e)}getValue(){const e=this._string;return e??(this._string=this._toString(this._value))}setValue(e){if(ge.str(e)){if(e==this._string)return!1;this._string=e,this._value=1}else if(super.setValue(e))this._string=null;else return!1;return!0}reset(e){e&&(this._toString=Ad({output:[this.getValue(),e]})),this._value=0,super.reset()}},Yy={dependencies:null},Xy=class extends V2{constructor(n){super(),this.source=n,this.setValue(n)}getValue(n){const e={};return pr(this.source,(t,a)=>{qN(t)?e[a]=t.getValue(n):Qa(t)?e[a]=ra(t):n||(e[a]=t)}),e}setValue(n){this.source=n,this.payload=this._makePayload(n)}reset(){this.payload&>(this.payload,n=>n.reset())}_makePayload(n){if(n){const e=new Set;return pr(n,this._addToPayload,e),Array.from(e)}}_addToPayload(n){Yy.dependencies&&Qa(n)&&Yy.dependencies.add(n);const e=Vy(n);e&>(e,t=>this.add(t))}},FN=class cA extends Xy{constructor(e){super(e)}static create(e){return new cA(e)}getValue(){return this.source.map(e=>e.getValue())}setValue(e){const t=this.getPayload();return e.length==t.length?t.map((a,r)=>a.setValue(e[r])).some(Boolean):(super.setValue(e.map(IN)),!0)}};function IN(n){return(Hy(n)?jy:Ly).create(n)}function w0(n){const e=mr(n);return e?e.constructor:ge.arr(n)?FN:Hy(n)?jy:Ly}var L2=(n,e)=>{const t=!ge.fun(n)||n.prototype&&n.prototype.isReactComponent;return He.forwardRef((a,r)=>{const u=He.useRef(null),h=t&&He.useCallback(A=>{u.current=QN(r,A)},[r]),[d,m]=KN(a,e),y=P2(),b=()=>{const A=u.current;if(t&&!A)return;(A?e.applyAnimatedValues(A,d.getValue(!0)):!1)===!1&&y()},S=new kN(b,m),T=He.useRef(void 0);N0(()=>(T.current=S,gt(m,A=>zc(A,S)),()=>{T.current&&(gt(T.current.deps,A=>Ud(A,T.current)),Je.cancel(T.current.update))})),He.useEffect(b,[]),z2(()=>()=>{const A=T.current;gt(A.deps,B=>Ud(B,A))});const E=e.getComponentProps(d.getValue());return He.createElement(n,{...E,ref:h})})},kN=class{constructor(n,e){this.update=n,this.deps=e}eventObserved(n){n.type=="change"&&Je.write(this.update)}};function KN(n,e){const t=new Set;return Yy.dependencies=t,n.style&&(n={...n,style:e.createAnimatedStyle(n.style)}),n=new Xy(n),Yy.dependencies=null,[n,t]}function QN(n,e){return n&&(ge.fun(n)?n(e):n.current=e),e}var j2=Symbol.for("AnimatedComponent"),ZN=(n,{applyAnimatedValues:e=()=>!1,createAnimatedStyle:t=r=>new Xy(r),getComponentProps:a=r=>r}={})=>{const r={applyAnimatedValues:e,createAnimatedStyle:t,getComponentProps:a},u=h=>{const d=Y2(h)||"Anonymous";return ge.str(h)?h=u[h]||(u[h]=L2(h,r)):h=h[j2]||(h[j2]=L2(h,r)),h.displayName=`Animated(${d})`,h};return pr(n,(h,d)=>{ge.arr(n)&&(d=Y2(h)),u[d]=u(h)}),{animated:u}},Y2=n=>ge.str(n)?n:n&&ge.str(n.displayName)?n.displayName:ge.fun(n)&&n.name||null;function fu(n,...e){return ge.fun(n)?n(...e):n}var Od=(n,e)=>n===!0||!!(e&&n&&(ge.fun(n)?n(e):Ca(n).includes(e))),X2=(n,e)=>ge.obj(n)?e&&n[e]:n,q2=(n,e)=>n.default===!0?n[e]:n.default?n.default[e]:void 0,WN=n=>n,P0=(n,e=WN)=>{let t=JN;n.default&&n.default!==!0&&(n=n.default,t=Object.keys(n));const a={};for(const r of t){const u=e(n[r],r);ge.und(u)||(a[r]=u)}return a},JN=["config","onProps","onStart","onChange","onPause","onResume","onRest"],$N={config:1,from:1,to:1,ref:1,loop:1,reset:1,pause:1,cancel:1,reverse:1,immediate:1,default:1,delay:1,onProps:1,onStart:1,onChange:1,onPause:1,onResume:1,onRest:1,onResolve:1,items:1,trail:1,sort:1,expires:1,initial:1,enter:1,update:1,leave:1,children:1,onDestroyed:1,keys:1,callId:1,parentId:1};function eG(n){const e={};let t=0;if(pr(n,(a,r)=>{$N[r]||(e[r]=a,t++)}),t)return e}function F2(n){const e=eG(n);if(e){const t={to:e};return pr(n,(a,r)=>r in e||(t[r]=a)),t}return{...n}}function Nd(n){return n=ra(n),ge.arr(n)?n.map(Nd):Hy(n)?Ns.createStringInterpolator({range:[0,1],output:[n,n]})(1):n}function tG(n){for(const e in n)return!0;return!1}function z0(n){return ge.fun(n)||ge.arr(n)&&ge.obj(n[0])}function nG(n,e){var t;(t=n.ref)==null||t.delete(n),e==null||e.delete(n)}function iG(n,e){var t;e&&n.ref!==e&&((t=n.ref)==null||t.delete(n),e.add(n),n.ref=e)}var aG={default:{tension:170,friction:26}},H0={...aG.default,mass:1,damping:1,easing:BN.linear,clamp:!1},sG=class{constructor(){this.velocity=0,Object.assign(this,H0)}};function rG(n,e,t){t&&(t={...t},I2(t,e),e={...t,...e}),I2(n,e),Object.assign(n,e);for(const h in H0)n[h]==null&&(n[h]=H0[h]);let{frequency:a,damping:r}=n;const{mass:u}=n;return ge.und(a)||(a<.01&&(a=.01),r<0&&(r=0),n.tension=Math.pow(2*Math.PI/a,2)*u,n.friction=4*Math.PI*r*u/a),n}function I2(n,e){if(!ge.und(e.decay))n.duration=void 0;else{const t=!ge.und(e.tension)||!ge.und(e.friction);(t||!ge.und(e.frequency)||!ge.und(e.damping)||!ge.und(e.mass))&&(n.duration=void 0,n.decay=void 0),t&&(n.frequency=void 0)}}var k2=[],lG=class{constructor(){this.changed=!1,this.values=k2,this.toValues=null,this.fromValues=k2,this.config=new sG,this.immediate=!1}};function K2(n,{key:e,props:t,defaultProps:a,state:r,actions:u}){return new Promise((h,d)=>{let m,y,b=Od(t.cancel??(a==null?void 0:a.cancel),e);if(b)E();else{ge.und(t.pause)||(r.paused=Od(t.pause,e));let A=a==null?void 0:a.pause;A!==!0&&(A=r.paused||Od(A,e)),m=fu(t.delay||0,e),A?(r.resumeQueue.add(T),u.pause()):(u.resume(),T())}function S(){r.resumeQueue.add(T),r.timeouts.delete(y),y.cancel(),m=y.time-Je.now()}function T(){m>0&&!Ns.skipAnimation?(r.delayed=!0,y=Je.setTimeout(E,m),r.pauseQueue.add(S),r.timeouts.add(y)):E()}function E(){r.delayed&&(r.delayed=!1),r.pauseQueue.delete(S),r.timeouts.delete(y),n<=(r.cancelId||0)&&(b=!0);try{u.start({...t,callId:n,cancel:b},h)}catch(A){d(A)}}})}var V0=(n,e)=>e.length==1?e[0]:e.some(t=>t.cancelled)?Hc(n.get()):e.every(t=>t.noop)?Q2(n.get()):ws(n.get(),e.every(t=>t.finished)),Q2=n=>({value:n,noop:!0,finished:!0,cancelled:!1}),ws=(n,e,t=!1)=>({value:n,finished:e,cancelled:t}),Hc=n=>({value:n,cancelled:!0,finished:!1});function Z2(n,e,t,a){const{callId:r,parentId:u,onRest:h}=e,{asyncTo:d,promise:m}=t;return!u&&n===d&&!e.reset?m:t.promise=(async()=>{t.asyncId=r,t.asyncTo=n;const y=P0(e,(M,G)=>G==="onRest"?void 0:M);let b,S;const T=new Promise((M,G)=>(b=M,S=G)),E=M=>{const G=r<=(t.cancelId||0)&&Hc(a)||r!==t.asyncId&&ws(a,!1);if(G)throw M.result=G,S(M),M},A=(M,G)=>{const w=new W2,P=new J2;return(async()=>{if(Ns.skipAnimation)throw Gd(t),P.result=ws(a,!1),S(P),P;E(w);const z=ge.obj(M)?{...M}:{...G,to:M};z.parentId=r,pr(y,(ie,ne)=>{ge.und(z[ne])&&(z[ne]=ie)});const Z=await a.start(z);return E(w),t.paused&&await new Promise(ie=>{t.resumeQueue.add(ie)}),Z})()};let B;if(Ns.skipAnimation)return Gd(t),ws(a,!1);try{let M;ge.arr(n)?M=(async G=>{for(const w of G)await A(w)})(n):M=Promise.resolve(n(A,a.stop.bind(a))),await Promise.all([M.then(b),T]),B=ws(a.get(),!0,!1)}catch(M){if(M instanceof W2)B=M.result;else if(M instanceof J2)B=M.result;else throw M}finally{r==t.asyncId&&(t.asyncId=u,t.asyncTo=u?d:void 0,t.promise=u?m:void 0)}return ge.fun(h)&&Je.batchedUpdates(()=>{h(B,a,a.item)}),B})()}function Gd(n,e){Ed(n.timeouts,t=>t.cancel()),n.pauseQueue.clear(),n.resumeQueue.clear(),n.asyncId=n.asyncTo=n.promise=void 0,e&&(n.cancelId=e)}var W2=class extends Error{constructor(){super("An async animation has been interrupted. You see this error because you forgot to use `await` or `.catch(...)` on its returned promise.")}},J2=class extends Error{constructor(){super("SkipAnimationSignal")}},L0=n=>n instanceof j0,oG=1,j0=class extends U2{constructor(){super(...arguments),this.id=oG++,this._priority=0}get priority(){return this._priority}set priority(n){this._priority!=n&&(this._priority=n,this._onPriorityChange(n))}get(){const n=mr(this);return n&&n.getValue()}to(...n){return Ns.to(this,n)}interpolate(...n){return VN(),Ns.to(this,n)}toJSON(){return this.get()}observerAdded(n){n==1&&this._attach()}observerRemoved(n){n==0&&this._detach()}_attach(){}_detach(){}_onChange(n,e=!1){Dd(this,{type:"change",parent:this,value:n,idle:e})}_onPriorityChange(n){this.idle||Oy.sort(this),Dd(this,{type:"priority",parent:this,priority:n})}},du=Symbol.for("SpringPhase"),$2=1,Y0=2,X0=4,q0=n=>(n[du]&$2)>0,to=n=>(n[du]&Y0)>0,wd=n=>(n[du]&X0)>0,eC=(n,e)=>e?n[du]|=Y0|$2:n[du]&=~Y0,tC=(n,e)=>e?n[du]|=X0:n[du]&=~X0,uG=class extends j0{constructor(n,e){if(super(),this.animation=new lG,this.defaultProps={},this._state={paused:!1,delayed:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._pendingCalls=new Set,this._lastCallId=0,this._lastToId=0,this._memoizedDuration=0,!ge.und(n)||!ge.und(e)){const t=ge.obj(n)?{...n}:{...e,from:n};ge.und(t.default)&&(t.default=!0),this.start(t)}}get idle(){return!(to(this)||this._state.asyncTo)||wd(this)}get goal(){return ra(this.animation.to)}get velocity(){const n=mr(this);return n instanceof Ly?n.lastVelocity||0:n.getPayload().map(e=>e.lastVelocity||0)}get hasAnimated(){return q0(this)}get isAnimating(){return to(this)}get isPaused(){return wd(this)}get isDelayed(){return this._state.delayed}advance(n){let e=!0,t=!1;const a=this.animation;let{toValues:r}=a;const{config:u}=a,h=Vy(a.to);!h&&Qa(a.to)&&(r=Ca(ra(a.to))),a.values.forEach((y,b)=>{if(y.done)return;const S=y.constructor==jy?1:h?h[b].lastPosition:r[b];let T=a.immediate,E=S;if(!T){if(E=y.lastPosition,u.tension<=0){y.done=!0;return}let A=y.elapsedTime+=n;const B=a.fromValues[b],M=y.v0!=null?y.v0:y.v0=ge.arr(u.velocity)?u.velocity[b]:u.velocity;let G;const w=u.precision||(B==S?.005:Math.min(1,Math.abs(S-B)*.001));if(ge.und(u.duration))if(u.decay){const P=u.decay===!0?.998:u.decay,z=Math.exp(-(1-P)*A);E=B+M/(1-P)*(1-z),T=Math.abs(y.lastPosition-E)<=w,G=M*z}else{G=y.lastVelocity==null?M:y.lastVelocity;const P=u.restVelocity||w/10,z=u.clamp?0:u.bounce,Z=!ge.und(z),ie=B==S?y.v0>0:B<S;let ne,Se=!1;const _e=1,me=Math.ceil(n/_e);for(let se=0;se<me&&(ne=Math.abs(G)>P,!(!ne&&(T=Math.abs(S-E)<=w,T)));++se){Z&&(Se=E==S||E>S==ie,Se&&(G=-G*z,E=S));const Le=-u.tension*1e-6*(E-S),ae=-u.friction*.001*G,We=(Le+ae)/u.mass;G=G+We*_e,E=E+G*_e}}else{let P=1;u.duration>0&&(this._memoizedDuration!==u.duration&&(this._memoizedDuration=u.duration,y.durationProgress>0&&(y.elapsedTime=u.duration*y.durationProgress,A=y.elapsedTime+=n)),P=(u.progress||0)+A/this._memoizedDuration,P=P>1?1:P<0?0:P,y.durationProgress=P),E=B+u.easing(P)*(S-B),G=(E-y.lastPosition)/n,T=P==1}y.lastVelocity=G,Number.isNaN(E)&&(console.warn("Got NaN while animating:",this),T=!0)}h&&!h[b].done&&(T=!1),T?y.done=!0:e=!1,y.setValue(E,u.round)&&(t=!0)});const d=mr(this),m=d.getValue();if(e){const y=ra(a.to);(m!==y||t)&&!u.decay?(d.setValue(y),this._onChange(y)):t&&u.decay&&this._onChange(m),this._stop()}else t&&this._onChange(m)}set(n){return Je.batchedUpdates(()=>{this._stop(),this._focus(n),this._set(n)}),this}pause(){this._update({pause:!0})}resume(){this._update({pause:!1})}finish(){if(to(this)){const{to:n,config:e}=this.animation;Je.batchedUpdates(()=>{this._onStart(),e.decay||this._set(n,!1),this._stop()})}return this}update(n){return(this.queue||(this.queue=[])).push(n),this}start(n,e){let t;return ge.und(n)?(t=this.queue||[],this.queue=[]):t=[ge.obj(n)?n:{...e,to:n}],Promise.all(t.map(a=>this._update(a))).then(a=>V0(this,a))}stop(n){const{to:e}=this.animation;return this._focus(this.get()),Gd(this._state,n&&this._lastCallId),Je.batchedUpdates(()=>this._stop(e,n)),this}reset(){this._update({reset:!0})}eventObserved(n){n.type=="change"?this._start():n.type=="priority"&&(this.priority=n.priority+1)}_prepareNode(n){const e=this.key||"";let{to:t,from:a}=n;t=ge.obj(t)?t[e]:t,(t==null||z0(t))&&(t=void 0),a=ge.obj(a)?a[e]:a,a==null&&(a=void 0);const r={to:t,from:a};return q0(this)||(n.reverse&&([t,a]=[a,t]),a=ra(a),ge.und(a)?mr(this)||this._set(t):this._set(a)),r}_update({...n},e){const{key:t,defaultProps:a}=this;n.default&&Object.assign(a,P0(n,(h,d)=>/^on/.test(d)?X2(h,t):h)),aC(this,n,"onProps"),Hd(this,"onProps",n,this);const r=this._prepareNode(n);if(Object.isFrozen(this))throw Error("Cannot animate a `SpringValue` object that is frozen. Did you forget to pass your component to `animated(...)` before animating its props?");const u=this._state;return K2(++this._lastCallId,{key:t,props:n,defaultProps:a,state:u,actions:{pause:()=>{wd(this)||(tC(this,!0),Cd(u.pauseQueue),Hd(this,"onPause",ws(this,Pd(this,this.animation.to)),this))},resume:()=>{wd(this)&&(tC(this,!1),to(this)&&this._resume(),Cd(u.resumeQueue),Hd(this,"onResume",ws(this,Pd(this,this.animation.to)),this))},start:this._merge.bind(this,r)}}).then(h=>{if(n.loop&&h.finished&&!(e&&h.noop)){const d=nC(n);if(d)return this._update(d,!0)}return h})}_merge(n,e,t){if(e.cancel)return this.stop(!0),t(Hc(this));const a=!ge.und(n.to),r=!ge.und(n.from);if(a||r)if(e.callId>this._lastToId)this._lastToId=e.callId;else return t(Hc(this));const{key:u,defaultProps:h,animation:d}=this,{to:m,from:y}=d;let{to:b=m,from:S=y}=n;r&&!a&&(!e.default||ge.und(b))&&(b=S),e.reverse&&([b,S]=[S,b]);const T=!rl(S,y);T&&(d.from=S),S=ra(S);const E=!rl(b,m);E&&this._focus(b);const A=z0(e.to),{config:B}=d,{decay:M,velocity:G}=B;(a||r)&&(B.velocity=0),e.config&&!A&&rG(B,fu(e.config,u),e.config!==h.config?fu(h.config,u):void 0);let w=mr(this);if(!w||ge.und(b))return t(ws(this,!0));const P=ge.und(e.reset)?r&&!e.default:!ge.und(S)&&Od(e.reset,u),z=P?S:this.get(),Z=Nd(b),ie=ge.num(Z)||ge.arr(Z)||Hy(Z),ne=!A&&(!ie||Od(h.immediate||e.immediate,u));if(E){const se=w0(b);if(se!==w.constructor)if(ne)w=this._set(Z);else throw Error(`Cannot animate between ${w.constructor.name} and ${se.name}, as the "to" prop suggests`)}const Se=w.constructor;let _e=Qa(b),me=!1;if(!_e){const se=P||!q0(this)&&T;(E||se)&&(me=rl(Nd(z),Z),_e=!me),(!rl(d.immediate,ne)&&!ne||!rl(B.decay,M)||!rl(B.velocity,G))&&(_e=!0)}if(me&&to(this)&&(d.changed&&!P?_e=!0:_e||this._stop(m)),!A&&((_e||Qa(m))&&(d.values=w.getPayload(),d.toValues=Qa(b)?null:Se==jy?[1]:Ca(Z)),d.immediate!=ne&&(d.immediate=ne,!ne&&!P&&this._set(m)),_e)){const{onRest:se}=d;gt(hG,ae=>aC(this,e,ae));const Le=ws(this,Pd(this,m));Cd(this._pendingCalls,Le),this._pendingCalls.add(t),d.changed&&Je.batchedUpdates(()=>{var ae;d.changed=!P,se==null||se(Le,this),P?fu(h.onRest,Le):(ae=d.onStart)==null||ae.call(d,Le,this)})}P&&this._set(z),A?t(Z2(e.to,e,this._state,this)):_e?this._start():to(this)&&!E?this._pendingCalls.add(t):t(Q2(z))}_focus(n){const e=this.animation;n!==e.to&&(D2(this)&&this._detach(),e.to=n,D2(this)&&this._attach())}_attach(){let n=0;const{to:e}=this.animation;Qa(e)&&(zc(e,this),L0(e)&&(n=e.priority+1)),this.priority=n}_detach(){const{to:n}=this.animation;Qa(n)&&Ud(n,this)}_set(n,e=!0){const t=ra(n);if(!ge.und(t)){const a=mr(this);if(!a||!rl(t,a.getValue())){const r=w0(t);!a||a.constructor!=r?G0(this,r.create(t)):a.setValue(t),a&&Je.batchedUpdates(()=>{this._onChange(t,e)})}}return mr(this)}_onStart(){const n=this.animation;n.changed||(n.changed=!0,Hd(this,"onStart",ws(this,Pd(this,n.to)),this))}_onChange(n,e){e||(this._onStart(),fu(this.animation.onChange,n,this)),fu(this.defaultProps.onChange,n,this),super._onChange(n,e)}_start(){const n=this.animation;mr(this).reset(ra(n.to)),n.immediate||(n.fromValues=n.values.map(e=>e.lastPosition)),to(this)||(eC(this,!0),wd(this)||this._resume())}_resume(){Ns.skipAnimation?this.finish():Oy.start(this)}_stop(n,e){if(to(this)){eC(this,!1);const t=this.animation;gt(t.values,r=>{r.done=!0}),t.toValues&&(t.onChange=t.onPause=t.onResume=void 0),Dd(this,{type:"idle",parent:this});const a=e?Hc(this.get()):ws(this.get(),Pd(this,n??t.to));Cd(this._pendingCalls,a),t.changed&&(t.changed=!1,Hd(this,"onRest",a,this))}}};function Pd(n,e){const t=Nd(e),a=Nd(n.get());return rl(a,t)}function nC(n,e=n.loop,t=n.to){const a=fu(e);if(a){const r=a!==!0&&F2(a),u=(r||n).reverse,h=!r||r.reset;return zd({...n,loop:e,default:!1,pause:void 0,to:!u||z0(t)?t:void 0,from:h?n.from:void 0,reset:h,...r})}}function zd(n){const{to:e,from:t}=n=F2(n),a=new Set;return ge.obj(e)&&iC(e,a),ge.obj(t)&&iC(t,a),n.keys=a.size?Array.from(a):null,n}function cG(n){const e=zd(n);return ge.und(e.default)&&(e.default=P0(e)),e}function iC(n,e){pr(n,(t,a)=>t!=null&&e.add(a))}var hG=["onStart","onRest","onChange","onPause","onResume"];function aC(n,e,t){n.animation[t]=e[t]!==q2(e,t)?X2(e[t],n.key):void 0}function Hd(n,e,...t){var a,r,u,h;(r=(a=n.animation)[e])==null||r.call(a,...t),(h=(u=n.defaultProps)[e])==null||h.call(u,...t)}var fG=["onStart","onChange","onRest"],dG=1,pG=class{constructor(n,e){this.id=dG++,this.springs={},this.queue=[],this._lastAsyncId=0,this._active=new Set,this._changed=new Set,this._started=!1,this._state={paused:!1,pauseQueue:new Set,resumeQueue:new Set,timeouts:new Set},this._events={onStart:new Map,onChange:new Map,onRest:new Map},this._onFrame=this._onFrame.bind(this),e&&(this._flush=e),n&&this.start({default:!0,...n})}get idle(){return!this._state.asyncTo&&Object.values(this.springs).every(n=>n.idle&&!n.isDelayed&&!n.isPaused)}get item(){return this._item}set item(n){this._item=n}get(){const n={};return this.each((e,t)=>n[t]=e.get()),n}set(n){for(const e in n){const t=n[e];ge.und(t)||this.springs[e].set(t)}}update(n){return n&&this.queue.push(zd(n)),this}start(n){let{queue:e}=this;return n?e=Ca(n).map(zd):this.queue=[],this._flush?this._flush(this,e):(cC(this,e),F0(this,e))}stop(n,e){if(n!==!!n&&(e=n),e){const t=this.springs;gt(Ca(e),a=>t[a].stop(!!n))}else Gd(this._state,this._lastAsyncId),this.each(t=>t.stop(!!n));return this}pause(n){if(ge.und(n))this.start({pause:!0});else{const e=this.springs;gt(Ca(n),t=>e[t].pause())}return this}resume(n){if(ge.und(n))this.start({pause:!1});else{const e=this.springs;gt(Ca(n),t=>e[t].resume())}return this}each(n){pr(this.springs,n)}_onFrame(){const{onStart:n,onChange:e,onRest:t}=this._events,a=this._active.size>0,r=this._changed.size>0;(a&&!this._started||r&&!this._started)&&(this._started=!0,Ed(n,([d,m])=>{m.value=this.get(),d(m,this,this._item)}));const u=!a&&this._started,h=r||u&&t.size?this.get():null;r&&e.size&&Ed(e,([d,m])=>{m.value=h,d(m,this,this._item)}),u&&(this._started=!1,Ed(t,([d,m])=>{m.value=h,d(m,this,this._item)}))}eventObserved(n){if(n.type=="change")this._changed.add(n.parent),n.idle||this._active.add(n.parent);else if(n.type=="idle")this._active.delete(n.parent);else return;Je.onFrame(this._onFrame)}};function F0(n,e){return Promise.all(e.map(t=>sC(n,t))).then(t=>V0(n,t))}async function sC(n,e,t){const{keys:a,to:r,from:u,loop:h,onRest:d,onResolve:m}=e,y=ge.obj(e.default)&&e.default;h&&(e.loop=!1),r===!1&&(e.to=null),u===!1&&(e.from=null);const b=ge.arr(r)||ge.fun(r)?r:void 0;b?(e.to=void 0,e.onRest=void 0,y&&(y.onRest=void 0)):gt(fG,B=>{const M=e[B];if(ge.fun(M)){const G=n._events[B];e[B]=({finished:w,cancelled:P})=>{const z=G.get(M);z?(w||(z.finished=!1),P&&(z.cancelled=!0)):G.set(M,{value:null,finished:w||!1,cancelled:P||!1})},y&&(y[B]=e[B])}});const S=n._state;e.pause===!S.paused?(S.paused=e.pause,Cd(e.pause?S.pauseQueue:S.resumeQueue)):S.paused&&(e.pause=!0);const T=(a||Object.keys(n.springs)).map(B=>n.springs[B].start(e)),E=e.cancel===!0||q2(e,"cancel")===!0;(b||E&&S.asyncId)&&T.push(K2(++n._lastAsyncId,{props:e,state:S,actions:{pause:E0,resume:E0,start(B,M){E?(Gd(S,n._lastAsyncId),M(Hc(n))):(B.onRest=d,M(Z2(b,B,S,n)))}}})),S.paused&&await new Promise(B=>{S.resumeQueue.add(B)});const A=V0(n,await Promise.all(T));if(h&&A.finished&&!(t&&A.noop)){const B=nC(e,h,r);if(B)return cC(n,[B]),sC(n,B,!0)}return m&&Je.batchedUpdates(()=>m(A,n,n.item)),A}function rC(n,e){const t={...n.springs};return e&>(Ca(e),a=>{ge.und(a.keys)&&(a=zd(a)),ge.obj(a.to)||(a={...a,to:void 0}),uC(t,a,r=>oC(r))}),lC(n,t),t}function lC(n,e){pr(e,(t,a)=>{n.springs[a]||(n.springs[a]=t,zc(t,n))})}function oC(n,e){const t=new uG;return t.key=n,e&&zc(t,e),t}function uC(n,e,t){e.keys&>(e.keys,a=>{(n[a]||(n[a]=t(a)))._prepareNode(e)})}function cC(n,e){gt(e,t=>{uC(n.springs,t,a=>oC(a,n))})}var mG=He.createContext({pause:!1,immediate:!1}),yG=()=>{const n=[],e=function(a){jN();const r=[];return gt(n,(u,h)=>{if(ge.und(a))r.push(u.start());else{const d=t(a,u,h);d&&r.push(u.start(d))}}),r};e.current=n,e.add=function(a){n.includes(a)||n.push(a)},e.delete=function(a){const r=n.indexOf(a);~r&&n.splice(r,1)},e.pause=function(){return gt(n,a=>a.pause(...arguments)),this},e.resume=function(){return gt(n,a=>a.resume(...arguments)),this},e.set=function(a){gt(n,(r,u)=>{const h=ge.fun(a)?a(u,r):a;h&&r.set(h)})},e.start=function(a){const r=[];return gt(n,(u,h)=>{if(ge.und(a))r.push(u.start());else{const d=this._getProps(a,u,h);d&&r.push(u.start(d))}}),r},e.stop=function(){return gt(n,a=>a.stop(...arguments)),this},e.update=function(a){return gt(n,(r,u)=>r.update(this._getProps(a,r,u))),this};const t=function(a,r,u){return ge.fun(a)?a(u,r):a};return e._getProps=t,e};function gG(n,e,t){const a=ge.fun(e)&&e;a&&!t&&(t=[]);const r=He.useMemo(()=>a||arguments.length==3?yG():void 0,[]),u=He.useRef(0),h=P2(),d=He.useMemo(()=>({ctrls:[],queue:[],flush(G,w){const P=rC(G,w);return u.current>0&&!d.queue.length&&!Object.keys(P).some(Z=>!G.springs[Z])?F0(G,w):new Promise(Z=>{lC(G,P),d.queue.push(()=>{Z(F0(G,w))}),h()})}}),[]),m=He.useRef([...d.ctrls]),y=He.useRef([]),b=H2(n)||0;He.useMemo(()=>{gt(m.current.slice(n,b),G=>{nG(G,r),G.stop(!0)}),m.current.length=n,S(b,n)},[n]),He.useMemo(()=>{S(0,Math.min(b,n))},t);function S(G,w){for(let P=G;P<w;P++){const z=m.current[P]||(m.current[P]=new pG(null,d.flush)),Z=a?a(P,z):e[P];Z&&(y.current[P]=cG(Z))}}const T=m.current.map((G,w)=>rC(G,y.current[w])),E=He.useContext(mG),A=H2(E),B=E!==A&&tG(E);N0(()=>{u.current++,d.ctrls=m.current;const{queue:G}=d;G.length&&(d.queue=[],gt(G,w=>w())),gt(m.current,(w,P)=>{r==null||r.add(w),B&&w.start({default:E});const z=y.current[P];z&&(iG(w,z.ref),w.ref?w.queue.push(z):w.start(z))})}),z2(()=>()=>{gt(d.ctrls,G=>G.stop(!0))});const M=T.map(G=>({...G}));return r?[M,r]:M}function hC(n,e){const t=ge.fun(n),[[a],r]=gG(1,t?n:[n],t?[]:e);return t||arguments.length==2?[a,r]:a}var _G=class extends j0{constructor(n,e){super(),this.source=n,this.idle=!0,this._active=new Set,this.calc=Ad(...e);const t=this._get(),a=w0(t);G0(this,a.create(t))}advance(n){const e=this._get(),t=this.get();rl(e,t)||(mr(this).setValue(e),this._onChange(e,this.idle)),!this.idle&&fC(this._active)&&I0(this)}_get(){const n=ge.arr(this.source)?this.source.map(ra):Ca(ra(this.source));return this.calc(...n)}_start(){this.idle&&!fC(this._active)&&(this.idle=!1,gt(Vy(this),n=>{n.done=!1}),Ns.skipAnimation?(Je.batchedUpdates(()=>this.advance()),I0(this)):Oy.start(this))}_attach(){let n=1;gt(Ca(this.source),e=>{Qa(e)&&zc(e,this),L0(e)&&(e.idle||this._active.add(e),n=Math.max(n,e.priority+1))}),this.priority=n,this._start()}_detach(){gt(Ca(this.source),n=>{Qa(n)&&Ud(n,this)}),this._active.clear(),I0(this)}eventObserved(n){n.type=="change"?n.idle?this.advance():(this._active.add(n.parent),this._start()):n.type=="idle"?this._active.delete(n.parent):n.type=="priority"&&(this.priority=Ca(this.source).reduce((e,t)=>Math.max(e,(L0(t)?t.priority:0)+1),0))}};function vG(n){return n.idle!==!1}function fC(n){return!n.size||Array.from(n).every(vG)}function I0(n){n.idle||(n.idle=!0,gt(Vy(n),e=>{e.done=!0}),Dd(n,{type:"idle",parent:n}))}Ns.assign({createStringInterpolator:G2,to:(n,e)=>new _G(n,e)});var qy={exports:{}},Bi={};/**
|
|
1466
|
+
* @license React
|
|
1467
|
+
* react-dom.production.js
|
|
1468
|
+
*
|
|
1469
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1470
|
+
*
|
|
1471
|
+
* This source code is licensed under the MIT license found in the
|
|
1472
|
+
* LICENSE file in the root directory of this source tree.
|
|
1473
|
+
*/var dC;function bG(){if(dC)return Bi;dC=1;var n=_c();function e(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+m+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var a={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},r=Symbol.for("react.portal");function u(m,y,b){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:r,key:S==null?null:""+S,children:m,containerInfo:y,implementation:b}}var h=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Bi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,Bi.createPortal=function(m,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(e(299));return u(m,y,null,b)},Bi.flushSync=function(m){var y=h.T,b=a.p;try{if(h.T=null,a.p=2,m)return m()}finally{h.T=y,a.p=b,a.d.f()}},Bi.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,a.d.C(m,y))},Bi.prefetchDNS=function(m){typeof m=="string"&&a.d.D(m)},Bi.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var b=y.as,S=d(b,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,E=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?a.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:S,integrity:T,fetchPriority:E}):b==="script"&&a.d.X(m,{crossOrigin:S,integrity:T,fetchPriority:E,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Bi.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=d(y.as,y.crossOrigin);a.d.M(m,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&a.d.M(m)},Bi.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,S=d(b,y.crossOrigin);a.d.L(m,b,{crossOrigin:S,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Bi.preloadModule=function(m,y){if(typeof m=="string")if(y){var b=d(y.as,y.crossOrigin);a.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else a.d.m(m)},Bi.requestFormReset=function(m){a.d.r(m)},Bi.unstable_batchedUpdates=function(m,y){return m(y)},Bi.useFormState=function(m,y,b){return h.H.useFormState(m,y,b)},Bi.useFormStatus=function(){return h.H.useHostTransitionStatus()},Bi.version="19.1.1",Bi}var Oi={};/**
|
|
1474
|
+
* @license React
|
|
1475
|
+
* react-dom.development.js
|
|
1476
|
+
*
|
|
1477
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
1478
|
+
*
|
|
1479
|
+
* This source code is licensed under the MIT license found in the
|
|
1480
|
+
* LICENSE file in the root directory of this source tree.
|
|
1481
|
+
*/var pC;function xG(){return pC||(pC=1,process.env.NODE_ENV!=="production"&&function(){function n(){}function e(S){return""+S}function t(S,T,E){var A=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;try{e(A);var B=!1}catch{B=!0}return B&&(console.error("The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",typeof Symbol=="function"&&Symbol.toStringTag&&A[Symbol.toStringTag]||A.constructor.name||"Object"),e(A)),{$$typeof:y,key:A==null?null:""+A,children:S,containerInfo:T,implementation:E}}function a(S,T){if(S==="font")return"";if(typeof T=="string")return T==="use-credentials"?T:""}function r(S){return S===null?"`null`":S===void 0?"`undefined`":S===""?"an empty string":'something with type "'+typeof S+'"'}function u(S){return S===null?"`null`":S===void 0?"`undefined`":S===""?"an empty string":typeof S=="string"?JSON.stringify(S):typeof S=="number"?"`"+S+"`":'something with type "'+typeof S+'"'}function h(){var S=b.H;return S===null&&console.error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
|
|
1482
|
+
1. You might have mismatching versions of React and the renderer (such as React DOM)
|
|
1483
|
+
2. You might be breaking the Rules of Hooks
|
|
1484
|
+
3. You might have more than one copy of React in the same app
|
|
1485
|
+
See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`),S}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var d=_c(),m={d:{f:n,r:function(){throw Error("Invalid form element. requestFormReset must be passed a form that was rendered by React.")},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},y=Symbol.for("react.portal"),b=d.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills"),Oi.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=m,Oi.createPortal=function(S,T){var E=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!T||T.nodeType!==1&&T.nodeType!==9&&T.nodeType!==11)throw Error("Target container is not a DOM element.");return t(S,T,null,E)},Oi.flushSync=function(S){var T=b.T,E=m.p;try{if(b.T=null,m.p=2,S)return S()}finally{b.T=T,m.p=E,m.d.f()&&console.error("flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.")}},Oi.preconnect=function(S,T){typeof S=="string"&&S?T!=null&&typeof T!="object"?console.error("ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.",u(T)):T!=null&&typeof T.crossOrigin!="string"&&console.error("ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.",r(T.crossOrigin)):console.error("ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S)),typeof S=="string"&&(T?(T=T.crossOrigin,T=typeof T=="string"?T==="use-credentials"?T:"":void 0):T=null,m.d.C(S,T))},Oi.prefetchDNS=function(S){if(typeof S!="string"||!S)console.error("ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S));else if(1<arguments.length){var T=arguments[1];typeof T=="object"&&T.hasOwnProperty("crossOrigin")?console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(T)):console.error("ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.",u(T))}typeof S=="string"&&m.d.D(S)},Oi.preinit=function(S,T){if(typeof S=="string"&&S?T==null||typeof T!="object"?console.error("ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.",u(T)):T.as!=="style"&&T.as!=="script"&&console.error('ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".',u(T.as)):console.error("ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.",r(S)),typeof S=="string"&&T&&typeof T.as=="string"){var E=T.as,A=a(E,T.crossOrigin),B=typeof T.integrity=="string"?T.integrity:void 0,M=typeof T.fetchPriority=="string"?T.fetchPriority:void 0;E==="style"?m.d.S(S,typeof T.precedence=="string"?T.precedence:void 0,{crossOrigin:A,integrity:B,fetchPriority:M}):E==="script"&&m.d.X(S,{crossOrigin:A,integrity:B,fetchPriority:M,nonce:typeof T.nonce=="string"?T.nonce:void 0})}},Oi.preinitModule=function(S,T){var E="";if(typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T!==void 0&&typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":T&&"as"in T&&T.as!=="script"&&(E+=" The `as` option encountered was "+u(T.as)+"."),E)console.error("ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s",E);else switch(E=T&&typeof T.as=="string"?T.as:"script",E){case"script":break;default:E=u(E),console.error('ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',E,S)}typeof S=="string"&&(typeof T=="object"&&T!==null?(T.as==null||T.as==="script")&&(E=a(T.as,T.crossOrigin),m.d.M(S,{crossOrigin:E,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0})):T==null&&m.d.M(S))},Oi.preload=function(S,T){var E="";if(typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T==null||typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":typeof T.as=="string"&&T.as||(E+=" The `as` option encountered was "+r(T.as)+"."),E&&console.error('ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `<link rel="preload" as="..." />` tag.%s',E),typeof S=="string"&&typeof T=="object"&&T!==null&&typeof T.as=="string"){E=T.as;var A=a(E,T.crossOrigin);m.d.L(S,E,{crossOrigin:A,integrity:typeof T.integrity=="string"?T.integrity:void 0,nonce:typeof T.nonce=="string"?T.nonce:void 0,type:typeof T.type=="string"?T.type:void 0,fetchPriority:typeof T.fetchPriority=="string"?T.fetchPriority:void 0,referrerPolicy:typeof T.referrerPolicy=="string"?T.referrerPolicy:void 0,imageSrcSet:typeof T.imageSrcSet=="string"?T.imageSrcSet:void 0,imageSizes:typeof T.imageSizes=="string"?T.imageSizes:void 0,media:typeof T.media=="string"?T.media:void 0})}},Oi.preloadModule=function(S,T){var E="";typeof S=="string"&&S||(E+=" The `href` argument encountered was "+r(S)+"."),T!==void 0&&typeof T!="object"?E+=" The `options` argument encountered was "+r(T)+".":T&&"as"in T&&typeof T.as!="string"&&(E+=" The `as` option encountered was "+r(T.as)+"."),E&&console.error('ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `<link rel="modulepreload" as="..." />` tag.%s',E),typeof S=="string"&&(T?(E=a(T.as,T.crossOrigin),m.d.m(S,{as:typeof T.as=="string"&&T.as!=="script"?T.as:void 0,crossOrigin:E,integrity:typeof T.integrity=="string"?T.integrity:void 0})):m.d.m(S))},Oi.requestFormReset=function(S){m.d.r(S)},Oi.unstable_batchedUpdates=function(S,T){return S(T)},Oi.useFormState=function(S,T,E){return h().useFormState(S,T,E)},Oi.useFormStatus=function(){return h().useHostTransitionStatus()},Oi.version="19.1.1",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Oi}var mC;function SG(){if(mC)return qy.exports;mC=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}}return process.env.NODE_ENV==="production"?(n(),qy.exports=bG()):qy.exports=xG(),qy.exports}var TG=SG(),yC=/^--/;function EG(n,e){return e==null||typeof e=="boolean"||e===""?"":typeof e=="number"&&e!==0&&!yC.test(n)&&!(Vd.hasOwnProperty(n)&&Vd[n])?e+"px":(""+e).trim()}var gC={};function CG(n,e){if(!n.nodeType||!n.setAttribute)return!1;const t=n.nodeName==="filter"||n.parentNode&&n.parentNode.nodeName==="filter",{className:a,style:r,children:u,scrollTop:h,scrollLeft:d,viewBox:m,...y}=e,b=Object.values(y),S=Object.keys(y).map(T=>t||n.hasAttribute(T)?T:gC[T]||(gC[T]=T.replace(/([A-Z])/g,E=>"-"+E.toLowerCase())));u!==void 0&&(n.textContent=u);for(const T in r)if(r.hasOwnProperty(T)){const E=EG(T,r[T]);yC.test(T)?n.style.setProperty(T,E):n.style[T]=E}S.forEach((T,E)=>{n.setAttribute(T,b[E])}),a!==void 0&&(n.className=a),h!==void 0&&(n.scrollTop=h),d!==void 0&&(n.scrollLeft=d),m!==void 0&&n.setAttribute("viewBox",m)}var Vd={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},RG=(n,e)=>n+e.charAt(0).toUpperCase()+e.substring(1),AG=["Webkit","Ms","Moz","O"];Vd=Object.keys(Vd).reduce((n,e)=>(AG.forEach(t=>n[RG(t,e)]=n[e]),n),Vd);var MG=/^(matrix|translate|scale|rotate|skew)/,DG=/^(translate)/,UG=/^(rotate|skew)/,k0=(n,e)=>ge.num(n)&&n!==0?n+e:n,Fy=(n,e)=>ge.arr(n)?n.every(t=>Fy(t,e)):ge.num(n)?n===e:parseFloat(n)===e,BG=class extends Xy{constructor({x:n,y:e,z:t,...a}){const r=[],u=[];(n||e||t)&&(r.push([n||0,e||0,t||0]),u.push(h=>[`translate3d(${h.map(d=>k0(d,"px")).join(",")})`,Fy(h,0)])),pr(a,(h,d)=>{if(d==="transform")r.push([h||""]),u.push(m=>[m,m===""]);else if(MG.test(d)){if(delete a[d],ge.und(h))return;const m=DG.test(d)?"px":UG.test(d)?"deg":"";r.push(Ca(h)),u.push(d==="rotate3d"?([y,b,S,T])=>[`rotate3d(${y},${b},${S},${k0(T,m)})`,Fy(T,0)]:y=>[`${d}(${y.map(b=>k0(b,m)).join(",")})`,Fy(y,d.startsWith("scale")?1:0)])}}),r.length&&(a.transform=new OG(r,u)),super(a)}},OG=class extends U2{constructor(n,e){super(),this.inputs=n,this.transforms=e,this._value=null}get(){return this._value||(this._value=this._get())}_get(){let n="",e=!0;return gt(this.inputs,(t,a)=>{const r=ra(t[0]),[u,h]=this.transforms[a](ge.arr(r)?r:t.map(ra));n+=" "+u,e=e&&h}),e?"none":n}observerAdded(n){n==1&>(this.inputs,e=>gt(e,t=>Qa(t)&&zc(t,this)))}observerRemoved(n){n==0&>(this.inputs,e=>gt(e,t=>Qa(t)&&Ud(t,this)))}eventObserved(n){n.type=="change"&&(this._value=null),Dd(this,n)}},NG=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"];Ns.assign({batchedUpdates:TG.unstable_batchedUpdates,createStringInterpolator:G2,colors:vN});var GG=ZN(NG,{applyAnimatedValues:CG,createAnimatedStyle:n=>new BG(n),getComponentProps:({scrollTop:n,scrollLeft:e,...t})=>t}),_C=GG.animated;const vC=He.createContext({}),wG=({children:n})=>{const{app:e}=m2(),t=He.useMemo(()=>{if(!e||!e.renderer)return null;const a=new uu;a.setFillStyle({color:"#1e1524"}),a.rect(0,0,1,1),a.fill();const r=e.renderer.generateTexture(a);return a.destroy(),r},[e==null?void 0:e.renderer]);return t?Ai.jsx(vC.Provider,{value:t,children:n}):null};class PG extends DE{constructor(t,a,r,u,h,d){super({texture:t,x:a,y:r,scaleX:u,scaleY:h,alpha:0});$o(this,"animationProgress",0);$o(this,"delayCounter",0);$o(this,"randomSpeed");$o(this,"randomDelayOffset");$o(this,"startScaleX");$o(this,"startScaleY");this.texture=t,this.x=a,this.y=r,this.scaleX=u,this.scaleY=h,this.curLevel=d,this.startScaleX=u,this.startScaleY=h,this.curLevel=d,this.randomSpeed=.04+Math.random()*.04,this.randomDelayOffset=Math.floor(Math.random()*150)}update(){if(this.delayCounter<this.curLevel*15+this.randomDelayOffset){this.delayCounter++;return}const t=1;this.animationProgress+=(t-this.animationProgress)*this.randomSpeed,this.alpha=this.animationProgress}}class zG{constructor(e,t){$o(this,"cells",[]);this.texture=e,this.particleContainerRefCurrent=t,this.texture=e}add(e,t,a,r,u){const h=new PG(this.texture,e,t,a,r,u);this.particleContainerRefCurrent.addParticle(h),this.cells.push(h)}updateAll(){for(const e of this.cells)e.update()}}const HG=({gridRows:n,gridCols:e,cellWidth:t,cellHeight:a,gridDepth:r})=>{const u=He.useContext(vC),h=He.useRef(null),d=He.useRef(null);He.useEffect(()=>{h.current&&(d.current=new zG(u,h.current),m(0,0,t,a,e,n,r,h.current))},[]),hN(()=>{var y;(y=d.current)==null||y.updateAll()});const m=(y,b,S,T,E,A,B,M)=>{var G;for(let w=0;w<A;w++)for(let P=0;P<E;P++){const z=y+P*S,Z=b+w*T;B<=0||Math.random()>.7&&B<r?Math.random()>.1&&((G=d.current)==null||G.add(z,Z,S-1,T-1,B)):m(z,Z,S/E,T/A,E,A,B-1)}};return Ai.jsx("pixiParticleContainer",{ref:h,dynamicProperties:{position:!0,vertex:!0,color:!0}})},VG=({cellWidth:n,cellHeight:e,gridRows:t,gridCols:a,gridDepth:r})=>Ai.jsx(wG,{children:Ai.jsx(HG,{cellWidth:n,cellHeight:e,gridCols:a,gridRows:t,gridDepth:r})}),LG=n=>Ai.jsx("svg",{viewBox:"10 0 489.935 489.935",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...n,children:Ai.jsx("path",{d:`M278.235,33.267c-116.7,0-211.6,95-211.6,211.7v0.7l-41.9-63.1c-4.1-6.2-12.5-7.9-18.7-3.8c-6.2,4.1-7.9,12.5-3.8,18.7 \r
|
|
1486
|
+
l60.8,91.5c2.2,3.3,5.7,5.4,9.6,5.9c0.6,0.1,1.1,0.1,1.7,0.1c3.3,0,6.5-1.2,9-3.5l84.5-76.1c5.5-5,6-13.5,1-19.1 \r
|
|
1487
|
+
c-5-5.5-13.5-6-19.1-1l-56.1,50.7v-1c0-101.9,82.8-184.7,184.6-184.7s184.7,82.8,184.7,184.7s-82.8,184.7-184.6,184.7 \r
|
|
1488
|
+
c-49.3,0-95.7-19.2-130.5-54.1c-5.3-5.3-13.8-5.3-19.1,0c-5.3,5.3-5.3,13.8,0,19.1c40,40,93.1,62,149.6,62 \r
|
|
1489
|
+
c116.6,0,211.6-94.9,211.6-211.7S394.935,33.267,278.235,33.267z`})});cN({ParticleContainer:bB,Particle:DE,Texture:Ge,Container:Gn,Sprite:au,Graphics:uu});const bC=2,xC=2,SC=225,TC=225,jG=5,YG=()=>{const[n,e]=He.useState(!1),[t,a]=He.useState(0),[r,u]=He.useState(0),h=hC({from:{rotate:0},to:{rotate:r*-360},config:{duration:500,easing:S=>1-Math.pow(1-S,3)}}),d=hC({opacity:n?1:0,scale:n?1:.5,config:{tension:150,friction:14}}),m=_C(LG),y=_C("button"),b=()=>{a(S=>S+1),u(S=>S+1)};return Ai.jsxs("div",{className:"flex flex-col items-center justify-center h-screen w-screen",children:[Ai.jsx(uN,{antialias:!1,width:SC*bC,height:TC*xC,className:"transition-all image-pixelated md:w-full max-w-max w-72 mb-8",backgroundAlpha:0,onInit:()=>e(!0),children:Ai.jsx(VG,{gridCols:bC,gridRows:xC,cellWidth:SC,cellHeight:TC,gridDepth:jG},t)}),n&&Ai.jsx(y,{style:d,className:"p-4",onClick:b,children:Ai.jsx(m,{width:36,height:36,className:"hover:opacity-100 opacity-25",style:{rotate:h.rotate.to(S=>`${S}deg`)}})})]})};Ie.add(DM),Ie.mixin(Gn,UM),Ie.add(YS),Ie.add(XS),Ie.add(H1),Ie.mixin(Gn,pU),Ie.add(z1),Ie.add(_E),Ie.add(Cv),Ie.add(xE),Ie.add(RE),Ie.add(AE),Ie.add(jE),Ie.add(LE),Ie.add(wE),Ie.add(VE),Ie.add(zE),Ie.add(GE),Ie.add(NE),Ie.add(L1),Ie.add(V1);const XG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"})),qG=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));return YG});
|
|
1490
|
+
//# sourceMappingURL=recursive-grid.umd.js.map
|