Files
red-valley/resources/[framework]/[addons]/qs-advancedgarages/web/build/assets/index-BOPTKBra.js
2026-03-29 21:41:17 +03:00

4010 lines
2.2 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-DvSYKMeA.js","./features-animation-dlBJ5TCC.js","./src-UW24ZMRV-D5IQgZfI.js","./index-CoCPE5d4.js"])))=>i.map(i=>d[i]);
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))i(a);new MutationObserver(a=>{for(const s of a)if(s.type==="childList")for(const r of s.addedNodes)r.tagName==="LINK"&&r.rel==="modulepreload"&&i(r)}).observe(document,{childList:!0,subtree:!0});function n(a){const s={};return a.integrity&&(s.integrity=a.integrity),a.referrerPolicy&&(s.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?s.credentials="include":a.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(a){if(a.ep)return;a.ep=!0;const s=n(a);fetch(a.href,s)}})();var jy=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zg(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var j4={exports:{}},Fy={};/**
* @license React
* react-jsx-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var OR;function UW(){if(OR)return Fy;OR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(i,a,s){var r=null;if(s!==void 0&&(r=""+s),a.key!==void 0&&(r=""+a.key),"key"in a){s={};for(var o in a)o!=="key"&&(s[o]=a[o])}else s=a;return a=s.ref,{$$typeof:t,type:i,key:r,ref:a!==void 0?a:null,props:s}}return Fy.Fragment=e,Fy.jsx=n,Fy.jsxs=n,Fy}var IR;function jW(){return IR||(IR=1,j4.exports=UW()),j4.exports}var _=jW(),F4={exports:{}},On={};/**
* @license React
* react.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var zR;function FW(){if(zR)return On;zR=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),r=Symbol.for("react.context"),o=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),u=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),d=Symbol.for("react.activity"),p=Symbol.iterator;function g(K){return K===null||typeof K!="object"?null:(K=p&&K[p]||K["@@iterator"],typeof K=="function"?K:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,x={};function S(K,ee,ie){this.props=K,this.context=ee,this.refs=x,this.updater=ie||b}S.prototype.isReactComponent={},S.prototype.setState=function(K,ee){if(typeof K!="object"&&typeof K!="function"&&K!=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,K,ee,"setState")},S.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function M(){}M.prototype=S.prototype;function C(K,ee,ie){this.props=K,this.context=ee,this.refs=x,this.updater=ie||b}var A=C.prototype=new M;A.constructor=C,w(A,S.prototype),A.isPureReactComponent=!0;var N=Array.isArray;function R(){}var D={H:null,A:null,T:null,S:null},B=Object.prototype.hasOwnProperty;function z(K,ee,ie){var Z=ie.ref;return{$$typeof:t,type:K,key:ee,ref:Z!==void 0?Z:null,props:ie}}function I(K,ee){return z(K.type,ee,K.props)}function U(K){return typeof K=="object"&&K!==null&&K.$$typeof===t}function $(K){var ee={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(ie){return ee[ie]})}var G=/\/+/g;function k(K,ee){return typeof K=="object"&&K!==null&&K.key!=null?$(""+K.key):ee.toString(36)}function X(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(R,R):(K.status="pending",K.then(function(ee){K.status==="pending"&&(K.status="fulfilled",K.value=ee)},function(ee){K.status==="pending"&&(K.status="rejected",K.reason=ee)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function V(K,ee,ie,Z,ue){var se=typeof K;(se==="undefined"||se==="boolean")&&(K=null);var ae=!1;if(K===null)ae=!0;else switch(se){case"bigint":case"string":case"number":ae=!0;break;case"object":switch(K.$$typeof){case t:case e:ae=!0;break;case h:return ae=K._init,V(ae(K._payload),ee,ie,Z,ue)}}if(ae)return ue=ue(K),ae=Z===""?"."+k(K,0):Z,N(ue)?(ie="",ae!=null&&(ie=ae.replace(G,"$&/")+"/"),V(ue,ee,ie,"",function(ye){return ye})):ue!=null&&(U(ue)&&(ue=I(ue,ie+(ue.key==null||K&&K.key===ue.key?"":(""+ue.key).replace(G,"$&/")+"/")+ae)),ee.push(ue)),1;ae=0;var ce=Z===""?".":Z+":";if(N(K))for(var pe=0;pe<K.length;pe++)Z=K[pe],se=ce+k(Z,pe),ae+=V(Z,ee,ie,se,ue);else if(pe=g(K),typeof pe=="function")for(K=pe.call(K),pe=0;!(Z=K.next()).done;)Z=Z.value,se=ce+k(Z,pe++),ae+=V(Z,ee,ie,se,ue);else if(se==="object"){if(typeof K.then=="function")return V(X(K),ee,ie,Z,ue);throw ee=String(K),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.")}return ae}function H(K,ee,ie){if(K==null)return K;var Z=[],ue=0;return V(K,Z,"","",function(se){return ee.call(ie,se,ue++)}),Z}function W(K){if(K._status===-1){var ee=K._result;ee=ee(),ee.then(function(ie){(K._status===0||K._status===-1)&&(K._status=1,K._result=ie)},function(ie){(K._status===0||K._status===-1)&&(K._status=2,K._result=ie)}),K._status===-1&&(K._status=0,K._result=ee)}if(K._status===1)return K._result.default;throw K._result}var J=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ee=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(ee))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)},Y={map:H,forEach:function(K,ee,ie){H(K,function(){ee.apply(this,arguments)},ie)},count:function(K){var ee=0;return H(K,function(){ee++}),ee},toArray:function(K){return H(K,function(ee){return ee})||[]},only:function(K){if(!U(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return On.Activity=d,On.Children=Y,On.Component=S,On.Fragment=n,On.Profiler=a,On.PureComponent=C,On.StrictMode=i,On.Suspense=c,On.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=D,On.__COMPILER_RUNTIME={__proto__:null,c:function(K){return D.H.useMemoCache(K)}},On.cache=function(K){return function(){return K.apply(null,arguments)}},On.cacheSignal=function(){return null},On.cloneElement=function(K,ee,ie){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var Z=w({},K.props),ue=K.key;if(ee!=null)for(se in ee.key!==void 0&&(ue=""+ee.key),ee)!B.call(ee,se)||se==="key"||se==="__self"||se==="__source"||se==="ref"&&ee.ref===void 0||(Z[se]=ee[se]);var se=arguments.length-2;if(se===1)Z.children=ie;else if(1<se){for(var ae=Array(se),ce=0;ce<se;ce++)ae[ce]=arguments[ce+2];Z.children=ae}return z(K.type,ue,Z)},On.createContext=function(K){return K={$$typeof:r,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:s,_context:K},K},On.createElement=function(K,ee,ie){var Z,ue={},se=null;if(ee!=null)for(Z in ee.key!==void 0&&(se=""+ee.key),ee)B.call(ee,Z)&&Z!=="key"&&Z!=="__self"&&Z!=="__source"&&(ue[Z]=ee[Z]);var ae=arguments.length-2;if(ae===1)ue.children=ie;else if(1<ae){for(var ce=Array(ae),pe=0;pe<ae;pe++)ce[pe]=arguments[pe+2];ue.children=ce}if(K&&K.defaultProps)for(Z in ae=K.defaultProps,ae)ue[Z]===void 0&&(ue[Z]=ae[Z]);return z(K,se,ue)},On.createRef=function(){return{current:null}},On.forwardRef=function(K){return{$$typeof:o,render:K}},On.isValidElement=U,On.lazy=function(K){return{$$typeof:h,_payload:{_status:-1,_result:K},_init:W}},On.memo=function(K,ee){return{$$typeof:u,type:K,compare:ee===void 0?null:ee}},On.startTransition=function(K){var ee=D.T,ie={};D.T=ie;try{var Z=K(),ue=D.S;ue!==null&&ue(ie,Z),typeof Z=="object"&&Z!==null&&typeof Z.then=="function"&&Z.then(R,J)}catch(se){J(se)}finally{ee!==null&&ie.types!==null&&(ee.types=ie.types),D.T=ee}},On.unstable_useCacheRefresh=function(){return D.H.useCacheRefresh()},On.use=function(K){return D.H.use(K)},On.useActionState=function(K,ee,ie){return D.H.useActionState(K,ee,ie)},On.useCallback=function(K,ee){return D.H.useCallback(K,ee)},On.useContext=function(K){return D.H.useContext(K)},On.useDebugValue=function(){},On.useDeferredValue=function(K,ee){return D.H.useDeferredValue(K,ee)},On.useEffect=function(K,ee){return D.H.useEffect(K,ee)},On.useEffectEvent=function(K){return D.H.useEffectEvent(K)},On.useId=function(){return D.H.useId()},On.useImperativeHandle=function(K,ee,ie){return D.H.useImperativeHandle(K,ee,ie)},On.useInsertionEffect=function(K,ee){return D.H.useInsertionEffect(K,ee)},On.useLayoutEffect=function(K,ee){return D.H.useLayoutEffect(K,ee)},On.useMemo=function(K,ee){return D.H.useMemo(K,ee)},On.useOptimistic=function(K,ee){return D.H.useOptimistic(K,ee)},On.useReducer=function(K,ee,ie){return D.H.useReducer(K,ee,ie)},On.useRef=function(K){return D.H.useRef(K)},On.useState=function(K){return D.H.useState(K)},On.useSyncExternalStore=function(K,ee,ie){return D.H.useSyncExternalStore(K,ee,ie)},On.useTransition=function(){return D.H.useTransition()},On.version="19.2.0",On}var BR;function om(){return BR||(BR=1,F4.exports=FW()),F4.exports}var P=om();const ft=Zg(P);var V4={exports:{}},Vy={},k4={exports:{}},H4={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var UR;function VW(){return UR||(UR=1,(function(t){function e(V,H){var W=V.length;V.push(H);e:for(;0<W;){var J=W-1>>>1,Y=V[J];if(0<a(Y,H))V[J]=H,V[W]=Y,W=J;else break e}}function n(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var H=V[0],W=V.pop();if(W!==H){V[0]=W;e:for(var J=0,Y=V.length,K=Y>>>1;J<K;){var ee=2*(J+1)-1,ie=V[ee],Z=ee+1,ue=V[Z];if(0>a(ie,W))Z<Y&&0>a(ue,ie)?(V[J]=ue,V[Z]=W,J=Z):(V[J]=ie,V[ee]=W,J=ee);else if(Z<Y&&0>a(ue,W))V[J]=ue,V[Z]=W,J=Z;else break e}}return H}function a(V,H){var W=V.sortIndex-H.sortIndex;return W!==0?W:V.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var r=Date,o=r.now();t.unstable_now=function(){return r.now()-o}}var c=[],u=[],h=1,d=null,p=3,g=!1,b=!1,w=!1,x=!1,S=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function A(V){for(var H=n(u);H!==null;){if(H.callback===null)i(u);else if(H.startTime<=V)i(u),H.sortIndex=H.expirationTime,e(c,H);else break;H=n(u)}}function N(V){if(w=!1,A(V),!b)if(n(c)!==null)b=!0,R||(R=!0,$());else{var H=n(u);H!==null&&X(N,H.startTime-V)}}var R=!1,D=-1,B=5,z=-1;function I(){return x?!0:!(t.unstable_now()-z<B)}function U(){if(x=!1,R){var V=t.unstable_now();z=V;var H=!0;try{e:{b=!1,w&&(w=!1,M(D),D=-1),g=!0;var W=p;try{t:{for(A(V),d=n(c);d!==null&&!(d.expirationTime>V&&I());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var Y=J(d.expirationTime<=V);if(V=t.unstable_now(),typeof Y=="function"){d.callback=Y,A(V),H=!0;break t}d===n(c)&&i(c),A(V)}else i(c);d=n(c)}if(d!==null)H=!0;else{var K=n(u);K!==null&&X(N,K.startTime-V),H=!1}}break e}finally{d=null,p=W,g=!1}H=void 0}}finally{H?$():R=!1}}}var $;if(typeof C=="function")$=function(){C(U)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,k=G.port2;G.port1.onmessage=U,$=function(){k.postMessage(null)}}else $=function(){S(U,0)};function X(V,H){D=S(function(){V(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):B=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var W=p;p=H;try{return V()}finally{p=W}},t.unstable_requestPaint=function(){x=!0},t.unstable_runWithPriority=function(V,H){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var W=p;p=V;try{return H()}finally{p=W}},t.unstable_scheduleCallback=function(V,H,W){var J=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,V){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=W+Y,V={id:h++,callback:H,priorityLevel:V,startTime:W,expirationTime:Y,sortIndex:-1},W>J?(V.sortIndex=W,e(u,V),n(c)===null&&V===n(u)&&(w?(M(D),D=-1):w=!0,X(N,W-J))):(V.sortIndex=Y,e(c,V),b||g||(b=!0,R||(R=!0,$()))),V},t.unstable_shouldYield=I,t.unstable_wrapCallback=function(V){var H=p;return function(){var W=p;p=H;try{return V.apply(this,arguments)}finally{p=W}}}})(H4)),H4}var jR;function kW(){return jR||(jR=1,k4.exports=VW()),k4.exports}var $4={exports:{}},tr={};/**
* @license React
* react-dom.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var FR;function HW(){if(FR)return tr;FR=1;var t=om();function e(c){var u="https://react.dev/errors/"+c;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)u+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var i={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function s(c,u,h){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:d==null?null:""+d,children:c,containerInfo:u,implementation:h}}var r=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function o(c,u){if(c==="font")return"";if(typeof u=="string")return u==="use-credentials"?u:""}return tr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,tr.createPortal=function(c,u){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)throw Error(e(299));return s(c,u,null,h)},tr.flushSync=function(c){var u=r.T,h=i.p;try{if(r.T=null,i.p=2,c)return c()}finally{r.T=u,i.p=h,i.d.f()}},tr.preconnect=function(c,u){typeof c=="string"&&(u?(u=u.crossOrigin,u=typeof u=="string"?u==="use-credentials"?u:"":void 0):u=null,i.d.C(c,u))},tr.prefetchDNS=function(c){typeof c=="string"&&i.d.D(c)},tr.preinit=function(c,u){if(typeof c=="string"&&u&&typeof u.as=="string"){var h=u.as,d=o(h,u.crossOrigin),p=typeof u.integrity=="string"?u.integrity:void 0,g=typeof u.fetchPriority=="string"?u.fetchPriority:void 0;h==="style"?i.d.S(c,typeof u.precedence=="string"?u.precedence:void 0,{crossOrigin:d,integrity:p,fetchPriority:g}):h==="script"&&i.d.X(c,{crossOrigin:d,integrity:p,fetchPriority:g,nonce:typeof u.nonce=="string"?u.nonce:void 0})}},tr.preinitModule=function(c,u){if(typeof c=="string")if(typeof u=="object"&&u!==null){if(u.as==null||u.as==="script"){var h=o(u.as,u.crossOrigin);i.d.M(c,{crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0})}}else u==null&&i.d.M(c)},tr.preload=function(c,u){if(typeof c=="string"&&typeof u=="object"&&u!==null&&typeof u.as=="string"){var h=u.as,d=o(h,u.crossOrigin);i.d.L(c,h,{crossOrigin:d,integrity:typeof u.integrity=="string"?u.integrity:void 0,nonce:typeof u.nonce=="string"?u.nonce:void 0,type:typeof u.type=="string"?u.type:void 0,fetchPriority:typeof u.fetchPriority=="string"?u.fetchPriority:void 0,referrerPolicy:typeof u.referrerPolicy=="string"?u.referrerPolicy:void 0,imageSrcSet:typeof u.imageSrcSet=="string"?u.imageSrcSet:void 0,imageSizes:typeof u.imageSizes=="string"?u.imageSizes:void 0,media:typeof u.media=="string"?u.media:void 0})}},tr.preloadModule=function(c,u){if(typeof c=="string")if(u){var h=o(u.as,u.crossOrigin);i.d.m(c,{as:typeof u.as=="string"&&u.as!=="script"?u.as:void 0,crossOrigin:h,integrity:typeof u.integrity=="string"?u.integrity:void 0})}else i.d.m(c)},tr.requestFormReset=function(c){i.d.r(c)},tr.unstable_batchedUpdates=function(c,u){return c(u)},tr.useFormState=function(c,u,h){return r.H.useFormState(c,u,h)},tr.useFormStatus=function(){return r.H.useHostTransitionStatus()},tr.version="19.2.0",tr}var VR;function L9(){if(VR)return $4.exports;VR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),$4.exports=HW(),$4.exports}/**
* @license React
* react-dom-client.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var kR;function $W(){if(kR)return Vy;kR=1;var t=kW(),e=om(),n=L9();function i(l){var f="https://react.dev/errors/"+l;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+l+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(l){return!(!l||l.nodeType!==1&&l.nodeType!==9&&l.nodeType!==11)}function s(l){var f=l,y=l;if(l.alternate)for(;f.return;)f=f.return;else{l=f;do f=l,(f.flags&4098)!==0&&(y=f.return),l=f.return;while(l)}return f.tag===3?y:null}function r(l){if(l.tag===13){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function o(l){if(l.tag===31){var f=l.memoizedState;if(f===null&&(l=l.alternate,l!==null&&(f=l.memoizedState)),f!==null)return f.dehydrated}return null}function c(l){if(s(l)!==l)throw Error(i(188))}function u(l){var f=l.alternate;if(!f){if(f=s(l),f===null)throw Error(i(188));return f!==l?null:l}for(var y=l,E=f;;){var L=y.return;if(L===null)break;var j=L.alternate;if(j===null){if(E=L.return,E!==null){y=E;continue}break}if(L.child===j.child){for(j=L.child;j;){if(j===y)return c(L),l;if(j===E)return c(L),f;j=j.sibling}throw Error(i(188))}if(y.return!==E.return)y=L,E=j;else{for(var Q=!1,oe=L.child;oe;){if(oe===y){Q=!0,y=L,E=j;break}if(oe===E){Q=!0,E=L,y=j;break}oe=oe.sibling}if(!Q){for(oe=j.child;oe;){if(oe===y){Q=!0,y=j,E=L;break}if(oe===E){Q=!0,E=j,y=L;break}oe=oe.sibling}if(!Q)throw Error(i(189))}}if(y.alternate!==E)throw Error(i(190))}if(y.tag!==3)throw Error(i(188));return y.stateNode.current===y?l:f}function h(l){var f=l.tag;if(f===5||f===26||f===27||f===6)return l;for(l=l.child;l!==null;){if(f=h(l),f!==null)return f;l=l.sibling}return null}var d=Object.assign,p=Symbol.for("react.element"),g=Symbol.for("react.transitional.element"),b=Symbol.for("react.portal"),w=Symbol.for("react.fragment"),x=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),C=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),N=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),D=Symbol.for("react.memo"),B=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),I=Symbol.for("react.memo_cache_sentinel"),U=Symbol.iterator;function $(l){return l===null||typeof l!="object"?null:(l=U&&l[U]||l["@@iterator"],typeof l=="function"?l:null)}var G=Symbol.for("react.client.reference");function k(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===G?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case w:return"Fragment";case S:return"Profiler";case x:return"StrictMode";case N:return"Suspense";case R:return"SuspenseList";case z:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case b:return"Portal";case C:return l.displayName||"Context";case M:return(l._context.displayName||"Context")+".Consumer";case A:var f=l.render;return l=l.displayName,l||(l=f.displayName||f.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case D:return f=l.displayName||null,f!==null?f:k(l.type)||"Memo";case B:f=l._payload,l=l._init;try{return k(l(f))}catch{}}return null}var X=Array.isArray,V=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,H=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,W={pending:!1,data:null,method:null,action:null},J=[],Y=-1;function K(l){return{current:l}}function ee(l){0>Y||(l.current=J[Y],J[Y]=null,Y--)}function ie(l,f){Y++,J[Y]=l.current,l.current=f}var Z=K(null),ue=K(null),se=K(null),ae=K(null);function ce(l,f){switch(ie(se,f),ie(ue,l),ie(Z,null),f.nodeType){case 9:case 11:l=(l=f.documentElement)&&(l=l.namespaceURI)?iR(l):0;break;default:if(l=f.tagName,f=f.namespaceURI)f=iR(f),l=aR(f,l);else switch(l){case"svg":l=1;break;case"math":l=2;break;default:l=0}}ee(Z),ie(Z,l)}function pe(){ee(Z),ee(ue),ee(se)}function ye(l){l.memoizedState!==null&&ie(ae,l);var f=Z.current,y=aR(f,l.type);f!==y&&(ie(ue,l),ie(Z,y))}function _e(l){ue.current===l&&(ee(Z),ee(ue)),ae.current===l&&(ee(ae),Iy._currentValue=W)}var me,ne;function be(l){if(me===void 0)try{throw Error()}catch(y){var f=y.stack.trim().match(/\n( *(at )?)/);me=f&&f[1]||"",ne=-1<y.stack.indexOf(`
at`)?" (<anonymous>)":-1<y.stack.indexOf("@")?"@unknown:0:0":""}return`
`+me+l+ne}var xe=!1;function he(l,f){if(!l||xe)return"";xe=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var E={DetermineComponentFrameRoot:function(){try{if(f){var xt=function(){throw Error()};if(Object.defineProperty(xt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(xt,[])}catch(st){var qe=st}Reflect.construct(l,[],xt)}else{try{xt.call()}catch(st){qe=st}l.call(xt.prototype)}}else{try{throw Error()}catch(st){qe=st}(xt=l())&&typeof xt.catch=="function"&&xt.catch(function(){})}}catch(st){if(st&&qe&&typeof st.stack=="string")return[st.stack,qe.stack]}return[null,null]}};E.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var L=Object.getOwnPropertyDescriptor(E.DetermineComponentFrameRoot,"name");L&&L.configurable&&Object.defineProperty(E.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var j=E.DetermineComponentFrameRoot(),Q=j[0],oe=j[1];if(Q&&oe){var Me=Q.split(`
`),Ge=oe.split(`
`);for(L=E=0;E<Me.length&&!Me[E].includes("DetermineComponentFrameRoot");)E++;for(;L<Ge.length&&!Ge[L].includes("DetermineComponentFrameRoot");)L++;if(E===Me.length||L===Ge.length)for(E=Me.length-1,L=Ge.length-1;1<=E&&0<=L&&Me[E]!==Ge[L];)L--;for(;1<=E&&0<=L;E--,L--)if(Me[E]!==Ge[L]){if(E!==1||L!==1)do if(E--,L--,0>L||Me[E]!==Ge[L]){var ht=`
`+Me[E].replace(" at new "," at ");return l.displayName&&ht.includes("<anonymous>")&&(ht=ht.replace("<anonymous>",l.displayName)),ht}while(1<=E&&0<=L);break}}}finally{xe=!1,Error.prepareStackTrace=y}return(y=l?l.displayName||l.name:"")?be(y):""}function ve(l,f){switch(l.tag){case 26:case 27:case 5:return be(l.type);case 16:return be("Lazy");case 13:return l.child!==f&&f!==null?be("Suspense Fallback"):be("Suspense");case 19:return be("SuspenseList");case 0:case 15:return he(l.type,!1);case 11:return he(l.type.render,!1);case 1:return he(l.type,!0);case 31:return be("Activity");default:return""}}function Oe(l){try{var f="",y=null;do f+=ve(l,y),y=l,l=l.return;while(l);return f}catch(E){return`
Error generating stack: `+E.message+`
`+E.stack}}var Le=Object.prototype.hasOwnProperty,Ae=t.unstable_scheduleCallback,et=t.unstable_cancelCallback,tt=t.unstable_shouldYield,re=t.unstable_requestPaint,te=t.unstable_now,we=t.unstable_getCurrentPriorityLevel,Ce=t.unstable_ImmediatePriority,Ie=t.unstable_UserBlockingPriority,Pe=t.unstable_NormalPriority,Ze=t.unstable_LowPriority,We=t.unstable_IdlePriority,mt=t.log,nt=t.unstable_setDisableYieldValue,Ye=null,Je=null;function jt(l){if(typeof mt=="function"&&nt(l),Je&&typeof Je.setStrictMode=="function")try{Je.setStrictMode(Ye,l)}catch{}}var wt=Math.clz32?Math.clz32:Te,Et=Math.log,zt=Math.LN2;function Te(l){return l>>>=0,l===0?32:31-(Et(l)/zt|0)|0}var pt=256,at=262144,St=4194304;function ct(l){var f=l&42;if(f!==0)return f;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:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;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 it(l,f,y){var E=l.pendingLanes;if(E===0)return 0;var L=0,j=l.suspendedLanes,Q=l.pingedLanes;l=l.warmLanes;var oe=E&134217727;return oe!==0?(E=oe&~j,E!==0?L=ct(E):(Q&=oe,Q!==0?L=ct(Q):y||(y=oe&~l,y!==0&&(L=ct(y))))):(oe=E&~j,oe!==0?L=ct(oe):Q!==0?L=ct(Q):y||(y=E&~l,y!==0&&(L=ct(y)))),L===0?0:f!==0&&f!==L&&(f&j)===0&&(j=L&-L,y=f&-f,j>=y||j===32&&(y&4194048)!==0)?f:L}function Nt(l,f){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&f)===0}function kt(l,f){switch(l){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+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 Xt(){var l=St;return St<<=1,(St&62914560)===0&&(St=4194304),l}function rn(l){for(var f=[],y=0;31>y;y++)f.push(l);return f}function ge(l,f){l.pendingLanes|=f,f!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function Se(l,f,y,E,L,j){var Q=l.pendingLanes;l.pendingLanes=y,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=y,l.entangledLanes&=y,l.errorRecoveryDisabledLanes&=y,l.shellSuspendCounter=0;var oe=l.entanglements,Me=l.expirationTimes,Ge=l.hiddenUpdates;for(y=Q&~y;0<y;){var ht=31-wt(y),xt=1<<ht;oe[ht]=0,Me[ht]=-1;var qe=Ge[ht];if(qe!==null)for(Ge[ht]=null,ht=0;ht<qe.length;ht++){var st=qe[ht];st!==null&&(st.lane&=-536870913)}y&=~xt}E!==0&&De(l,E,0),j!==0&&L===0&&l.tag!==0&&(l.suspendedLanes|=j&~(Q&~f))}function De(l,f,y){l.pendingLanes|=f,l.suspendedLanes&=~f;var E=31-wt(f);l.entangledLanes|=f,l.entanglements[E]=l.entanglements[E]|1073741824|y&261930}function lt(l,f){var y=l.entangledLanes|=f;for(l=l.entanglements;y;){var E=31-wt(y),L=1<<E;L&f|l[E]&f&&(l[E]|=f),y&=~L}}function rt(l,f){var y=f&-f;return y=(y&42)!==0?1:Bt(y),(y&(l.suspendedLanes|f))!==0?0:y}function Bt(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function Ut(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function Dt(){var l=H.p;return l!==0?l:(l=window.event,l===void 0?32:CR(l.type))}function ot(l,f){var y=H.p;try{return H.p=l,f()}finally{H.p=y}}var Lt=Math.random().toString(36).slice(2),vt="__reactFiber$"+Lt,Ot="__reactProps$"+Lt,Mt="__reactContainer$"+Lt,Ln="__reactEvents$"+Lt,wi="__reactListeners$"+Lt,aa="__reactHandles$"+Lt,ei="__reactResources$"+Lt,Fn="__reactMarker$"+Lt;function le(l){delete l[vt],delete l[Ot],delete l[Ln],delete l[wi],delete l[aa]}function Re(l){var f=l[vt];if(f)return f;for(var y=l.parentNode;y;){if(f=y[Mt]||y[vt]){if(y=f.alternate,f.child!==null||y!==null&&y.child!==null)for(l=dR(l);l!==null;){if(y=l[vt])return y;l=dR(l)}return f}l=y,y=l.parentNode}return null}function Be(l){if(l=l[vt]||l[Mt]){var f=l.tag;if(f===5||f===6||f===13||f===31||f===26||f===27||f===3)return l}return null}function ke(l){var f=l.tag;if(f===5||f===26||f===27||f===6)return l.stateNode;throw Error(i(33))}function ze(l){var f=l[ei];return f||(f=l[ei]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function yt(l){l[Fn]=!0}var Pt=new Set,Ht={};function Ke(l,f){Tt(l,f),Tt(l+"Capture",f)}function Tt(l,f){for(Ht[l]=f,l=0;l<f.length;l++)Pt.add(f[l])}var qt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Jt={},xn={};function vn(l){return Le.call(xn,l)?!0:Le.call(Jt,l)?!1:qt.test(l)?xn[l]=!0:(Jt[l]=!0,!1)}function ui(l,f,y){if(vn(f))if(y===null)l.removeAttribute(f);else{switch(typeof y){case"undefined":case"function":case"symbol":l.removeAttribute(f);return;case"boolean":var E=f.toLowerCase().slice(0,5);if(E!=="data-"&&E!=="aria-"){l.removeAttribute(f);return}}l.setAttribute(f,""+y)}}function si(l,f,y){if(y===null)l.removeAttribute(f);else{switch(typeof y){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(f);return}l.setAttribute(f,""+y)}}function zn(l,f,y,E){if(E===null)l.removeAttribute(y);else{switch(typeof E){case"undefined":case"function":case"symbol":case"boolean":l.removeAttribute(y);return}l.setAttributeNS(f,y,""+E)}}function tn(l){switch(typeof l){case"bigint":case"boolean":case"number":case"string":case"undefined":return l;case"object":return l;default:return""}}function Ui(l){var f=l.type;return(l=l.nodeName)&&l.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function ti(l,f,y){var E=Object.getOwnPropertyDescriptor(l.constructor.prototype,f);if(!l.hasOwnProperty(f)&&typeof E<"u"&&typeof E.get=="function"&&typeof E.set=="function"){var L=E.get,j=E.set;return Object.defineProperty(l,f,{configurable:!0,get:function(){return L.call(this)},set:function(Q){y=""+Q,j.call(this,Q)}}),Object.defineProperty(l,f,{enumerable:E.enumerable}),{getValue:function(){return y},setValue:function(Q){y=""+Q},stopTracking:function(){l._valueTracker=null,delete l[f]}}}}function Fa(l){if(!l._valueTracker){var f=Ui(l)?"checked":"value";l._valueTracker=ti(l,f,""+l[f])}}function Wo(l){if(!l)return!1;var f=l._valueTracker;if(!f)return!0;var y=f.getValue(),E="";return l&&(E=Ui(l)?l.checked?"true":"false":l.value),l=E,l!==y?(f.setValue(l),!0):!1}function wa(l){if(l=l||(typeof document<"u"?document:void 0),typeof l>"u")return null;try{return l.activeElement||l.body}catch{return l.body}}var vc=/[\n"\\]/g;function Kn(l){return l.replace(vc,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function Ja(l,f,y,E,L,j,Q,oe){l.name="",Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"?l.type=Q:l.removeAttribute("type"),f!=null?Q==="number"?(f===0&&l.value===""||l.value!=f)&&(l.value=""+tn(f)):l.value!==""+tn(f)&&(l.value=""+tn(f)):Q!=="submit"&&Q!=="reset"||l.removeAttribute("value"),f!=null?Ea(l,Q,tn(f)):y!=null?Ea(l,Q,tn(y)):E!=null&&l.removeAttribute("value"),L==null&&j!=null&&(l.defaultChecked=!!j),L!=null&&(l.checked=L&&typeof L!="function"&&typeof L!="symbol"),oe!=null&&typeof oe!="function"&&typeof oe!="symbol"&&typeof oe!="boolean"?l.name=""+tn(oe):l.removeAttribute("name")}function hs(l,f,y,E,L,j,Q,oe){if(j!=null&&typeof j!="function"&&typeof j!="symbol"&&typeof j!="boolean"&&(l.type=j),f!=null||y!=null){if(!(j!=="submit"&&j!=="reset"||f!=null)){Fa(l);return}y=y!=null?""+tn(y):"",f=f!=null?""+tn(f):y,oe||f===l.value||(l.value=f),l.defaultValue=f}E=E??L,E=typeof E!="function"&&typeof E!="symbol"&&!!E,l.checked=oe?l.checked:!!E,l.defaultChecked=!!E,Q!=null&&typeof Q!="function"&&typeof Q!="symbol"&&typeof Q!="boolean"&&(l.name=Q),Fa(l)}function Ea(l,f,y){f==="number"&&wa(l.ownerDocument)===l||l.defaultValue===""+y||(l.defaultValue=""+y)}function ha(l,f,y,E){if(l=l.options,f){f={};for(var L=0;L<y.length;L++)f["$"+y[L]]=!0;for(y=0;y<l.length;y++)L=f.hasOwnProperty("$"+l[y].value),l[y].selected!==L&&(l[y].selected=L),L&&E&&(l[y].defaultSelected=!0)}else{for(y=""+tn(y),f=null,L=0;L<l.length;L++){if(l[L].value===y){l[L].selected=!0,E&&(l[L].defaultSelected=!0);return}f!==null||l[L].disabled||(f=l[L])}f!==null&&(f.selected=!0)}}function Tu(l,f,y){if(f!=null&&(f=""+tn(f),f!==l.value&&(l.value=f),y==null)){l.defaultValue!==f&&(l.defaultValue=f);return}l.defaultValue=y!=null?""+tn(y):""}function Cs(l,f,y,E){if(f==null){if(E!=null){if(y!=null)throw Error(i(92));if(X(E)){if(1<E.length)throw Error(i(93));E=E[0]}y=E}y==null&&(y=""),f=y}y=tn(f),l.defaultValue=y,E=l.textContent,E===y&&E!==""&&E!==null&&(l.value=E),Fa(l)}function Cu(l,f){if(f){var y=l.firstChild;if(y&&y===l.lastChild&&y.nodeType===3){y.nodeValue=f;return}}l.textContent=f}var Sm=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function gh(l,f,y){var E=f.indexOf("--")===0;y==null||typeof y=="boolean"||y===""?E?l.setProperty(f,""):f==="float"?l.cssFloat="":l[f]="":E?l.setProperty(f,y):typeof y!="number"||y===0||Sm.has(f)?f==="float"?l.cssFloat=y:l[f]=(""+y).trim():l[f]=y+"px"}function mv(l,f,y){if(f!=null&&typeof f!="object")throw Error(i(62));if(l=l.style,y!=null){for(var E in y)!y.hasOwnProperty(E)||f!=null&&f.hasOwnProperty(E)||(E.indexOf("--")===0?l.setProperty(E,""):E==="float"?l.cssFloat="":l[E]="");for(var L in f)E=f[L],f.hasOwnProperty(L)&&y[L]!==E&&gh(l,L,E)}else for(var j in f)f.hasOwnProperty(j)&&gh(l,j,f[j])}function vh(l){if(l.indexOf("-")===-1)return!1;switch(l){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var gx=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),vx=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function yh(l){return vx.test(""+l)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":l}function Ko(){}var bh=null;function wm(l){return l=l.target||l.srcElement||window,l.correspondingUseElement&&(l=l.correspondingUseElement),l.nodeType===3?l.parentNode:l}var Au=null,yc=null;function gv(l){var f=Be(l);if(f&&(l=f.stateNode)){var y=l[Ot]||null;e:switch(l=f.stateNode,f.type){case"input":if(Ja(l,y.value,y.defaultValue,y.defaultValue,y.checked,y.defaultChecked,y.type,y.name),f=y.name,y.type==="radio"&&f!=null){for(y=l;y.parentNode;)y=y.parentNode;for(y=y.querySelectorAll('input[name="'+Kn(""+f)+'"][type="radio"]'),f=0;f<y.length;f++){var E=y[f];if(E!==l&&E.form===l.form){var L=E[Ot]||null;if(!L)throw Error(i(90));Ja(E,L.value,L.defaultValue,L.defaultValue,L.checked,L.defaultChecked,L.type,L.name)}}for(f=0;f<y.length;f++)E=y[f],E.form===l.form&&Wo(E)}break e;case"textarea":Tu(l,y.value,y.defaultValue);break e;case"select":f=y.value,f!=null&&ha(l,!!y.multiple,f,!1)}}}var Em=!1;function vv(l,f,y){if(Em)return l(f,y);Em=!0;try{var E=l(f);return E}finally{if(Em=!1,(Au!==null||yc!==null)&&(de(),Au&&(f=Au,l=yc,yc=Au=null,gv(f),l)))for(f=0;f<l.length;f++)gv(l[f])}}function Ru(l,f){var y=l.stateNode;if(y===null)return null;var E=y[Ot]||null;if(E===null)return null;y=E[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(E=!E.disabled)||(l=l.type,E=!(l==="button"||l==="input"||l==="select"||l==="textarea")),l=!E;break e;default:l=!1}if(l)return null;if(y&&typeof y!="function")throw Error(i(231,f,typeof y));return y}var Xo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Mm=!1;if(Xo)try{var xh={};Object.defineProperty(xh,"passive",{get:function(){Mm=!0}}),window.addEventListener("test",xh,xh),window.removeEventListener("test",xh,xh)}catch{Mm=!1}var bc=null,Tm=null,xc=null;function Cm(){if(xc)return xc;var l,f=Tm,y=f.length,E,L="value"in bc?bc.value:bc.textContent,j=L.length;for(l=0;l<y&&f[l]===L[l];l++);var Q=y-l;for(E=1;E<=Q&&f[y-E]===L[j-E];E++);return xc=L.slice(l,1<E?1-E:void 0)}function Nu(l){var f=l.keyCode;return"charCode"in l?(l=l.charCode,l===0&&f===13&&(l=13)):l=f,l===10&&(l=13),32<=l||l===13?l:0}function _h(){return!0}function yv(){return!1}function ps(l){function f(y,E,L,j,Q){this._reactName=y,this._targetInst=L,this.type=E,this.nativeEvent=j,this.target=Q,this.currentTarget=null;for(var oe in l)l.hasOwnProperty(oe)&&(y=l[oe],this[oe]=y?y(j):j[oe]);return this.isDefaultPrevented=(j.defaultPrevented!=null?j.defaultPrevented:j.returnValue===!1)?_h:yv,this.isPropagationStopped=yv,this}return d(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var y=this.nativeEvent;y&&(y.preventDefault?y.preventDefault():typeof y.returnValue!="unknown"&&(y.returnValue=!1),this.isDefaultPrevented=_h)},stopPropagation:function(){var y=this.nativeEvent;y&&(y.stopPropagation?y.stopPropagation():typeof y.cancelBubble!="unknown"&&(y.cancelBubble=!0),this.isPropagationStopped=_h)},persist:function(){},isPersistent:_h}),f}var _c={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(l){return l.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Sh=ps(_c),So=d({},_c,{view:0,detail:0}),Am=ps(So),Rm,wh,Dd,Eh=d({},So,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Th,button:0,buttons:0,relatedTarget:function(l){return l.relatedTarget===void 0?l.fromElement===l.srcElement?l.toElement:l.fromElement:l.relatedTarget},movementX:function(l){return"movementX"in l?l.movementX:(l!==Dd&&(Dd&&l.type==="mousemove"?(Rm=l.screenX-Dd.screenX,wh=l.screenY-Dd.screenY):wh=Rm=0,Dd=l),Rm)},movementY:function(l){return"movementY"in l?l.movementY:wh}}),yx=ps(Eh),es=d({},Eh,{dataTransfer:0}),bx=ps(es),xx=d({},So,{relatedTarget:0}),Nm=ps(xx),_x=d({},_c,{animationName:0,elapsedTime:0,pseudoElement:0}),Sx=ps(_x),Mh=d({},_c,{clipboardData:function(l){return"clipboardData"in l?l.clipboardData:window.clipboardData}}),bv=ps(Mh),wx=d({},_c,{data:0}),xv=ps(wx),Ex={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_v={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Sv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Mx(l){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(l):(l=Sv[l])?!!f[l]:!1}function Th(){return Mx}var wv=d({},So,{key:function(l){if(l.key){var f=Ex[l.key]||l.key;if(f!=="Unidentified")return f}return l.type==="keypress"?(l=Nu(l),l===13?"Enter":String.fromCharCode(l)):l.type==="keydown"||l.type==="keyup"?_v[l.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Th,charCode:function(l){return l.type==="keypress"?Nu(l):0},keyCode:function(l){return l.type==="keydown"||l.type==="keyup"?l.keyCode:0},which:function(l){return l.type==="keypress"?Nu(l):l.type==="keydown"||l.type==="keyup"?l.keyCode:0}}),Ev=ps(wv),Tx=d({},Eh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Pm=ps(Tx),Cx=d({},So,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Th}),Ol=ps(Cx),Mv=d({},_c,{propertyName:0,elapsedTime:0,pseudoElement:0}),a4=ps(Mv),Ax=d({},Eh,{deltaX:function(l){return"deltaX"in l?l.deltaX:"wheelDeltaX"in l?-l.wheelDeltaX:0},deltaY:function(l){return"deltaY"in l?l.deltaY:"wheelDeltaY"in l?-l.wheelDeltaY:"wheelDelta"in l?-l.wheelDelta:0},deltaZ:0,deltaMode:0}),Sc=ps(Ax),Il=d({},_c,{newState:0,oldState:0}),Tv=ps(Il),Cv=[9,13,27,32],Pu=Xo&&"CompositionEvent"in window,wc=null;Xo&&"documentMode"in document&&(wc=document.documentMode);var Du=Xo&&"TextEvent"in window&&!wc,ts=Xo&&(!Pu||wc&&8<wc&&11>=wc),Ch=" ",Av=!1;function Dm(l,f){switch(l){case"keyup":return Cv.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ld(l){return l=l.detail,typeof l=="object"&&"data"in l?l.data:null}var Ec=!1;function Lm(l,f){switch(l){case"compositionend":return Ld(f);case"keypress":return f.which!==32?null:(Av=!0,Ch);case"textInput":return l=f.data,l===Ch&&Av?null:l;default:return null}}function Rx(l,f){if(Ec)return l==="compositionend"||!Pu&&Dm(l,f)?(l=Cm(),xc=Tm=bc=null,Ec=!1,l):null;switch(l){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return ts&&f.locale!=="ko"?null:f.data;default:return null}}var _r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Rv(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f==="input"?!!_r[l.type]:f==="textarea"}function Om(l,f,y,E){Au?yc?yc.push(E):yc=[E]:Au=E,f=x2(f,"onChange"),0<f.length&&(y=new Sh("onChange","change",null,y,E),l.push({event:y,listeners:f}))}var Od=null,Id=null;function Nv(l){Z6(l,0)}function zd(l){var f=ke(l);if(Wo(f))return l}function Pv(l,f){if(l==="change")return f}var Ah=!1;if(Xo){var Lu;if(Xo){var Gi="oninput"in document;if(!Gi){var Nx=document.createElement("div");Nx.setAttribute("oninput","return;"),Gi=typeof Nx.oninput=="function"}Lu=Gi}else Lu=!1;Ah=Lu&&(!document.documentMode||9<document.documentMode)}function Px(){Od&&(Od.detachEvent("onpropertychange",Dv),Id=Od=null)}function Dv(l){if(l.propertyName==="value"&&zd(Id)){var f=[];Om(f,Id,l,wm(l)),vv(Nv,f)}}function Rh(l,f,y){l==="focusin"?(Px(),Od=f,Id=y,Od.attachEvent("onpropertychange",Dv)):l==="focusout"&&Px()}function Mc(l){if(l==="selectionchange"||l==="keyup"||l==="keydown")return zd(Id)}function Dx(l,f){if(l==="click")return zd(f)}function Lx(l,f){if(l==="input"||l==="change")return zd(f)}function Ou(l,f){return l===f&&(l!==0||1/l===1/f)||l!==l&&f!==f}var Wi=typeof Object.is=="function"?Object.is:Ou;function Bd(l,f){if(Wi(l,f))return!0;if(typeof l!="object"||l===null||typeof f!="object"||f===null)return!1;var y=Object.keys(l),E=Object.keys(f);if(y.length!==E.length)return!1;for(E=0;E<y.length;E++){var L=y[E];if(!Le.call(f,L)||!Wi(l[L],f[L]))return!1}return!0}function Lv(l){for(;l&&l.firstChild;)l=l.firstChild;return l}function Ov(l,f){var y=Lv(l);l=0;for(var E;y;){if(y.nodeType===3){if(E=l+y.textContent.length,l<=f&&E>=f)return{node:y,offset:f-l};l=E}e:{for(;y;){if(y.nextSibling){y=y.nextSibling;break e}y=y.parentNode}y=void 0}y=Lv(y)}}function Im(l,f){return l&&f?l===f?!0:l&&l.nodeType===3?!1:f&&f.nodeType===3?Im(l,f.parentNode):"contains"in l?l.contains(f):l.compareDocumentPosition?!!(l.compareDocumentPosition(f)&16):!1:!1}function zm(l){l=l!=null&&l.ownerDocument!=null&&l.ownerDocument.defaultView!=null?l.ownerDocument.defaultView:window;for(var f=wa(l.document);f instanceof l.HTMLIFrameElement;){try{var y=typeof f.contentWindow.location.href=="string"}catch{y=!1}if(y)l=f.contentWindow;else break;f=wa(l.document)}return f}function Ud(l){var f=l&&l.nodeName&&l.nodeName.toLowerCase();return f&&(f==="input"&&(l.type==="text"||l.type==="search"||l.type==="tel"||l.type==="url"||l.type==="password")||f==="textarea"||l.contentEditable==="true")}var Ox=Xo&&"documentMode"in document&&11>=document.documentMode,jd=null,Bm=null,Fd=null,Sr=!1;function Um(l,f,y){var E=y.window===y?y.document:y.nodeType===9?y:y.ownerDocument;Sr||jd==null||jd!==wa(E)||(E=jd,"selectionStart"in E&&Ud(E)?E={start:E.selectionStart,end:E.selectionEnd}:(E=(E.ownerDocument&&E.ownerDocument.defaultView||window).getSelection(),E={anchorNode:E.anchorNode,anchorOffset:E.anchorOffset,focusNode:E.focusNode,focusOffset:E.focusOffset}),Fd&&Bd(Fd,E)||(Fd=E,E=x2(Bm,"onSelect"),0<E.length&&(f=new Sh("onSelect","select",null,f,y),l.push({event:f,listeners:E}),f.target=jd)))}function Tc(l,f){var y={};return y[l.toLowerCase()]=f.toLowerCase(),y["Webkit"+l]="webkit"+f,y["Moz"+l]="moz"+f,y}var Vd={animationend:Tc("Animation","AnimationEnd"),animationiteration:Tc("Animation","AnimationIteration"),animationstart:Tc("Animation","AnimationStart"),transitionrun:Tc("Transition","TransitionRun"),transitionstart:Tc("Transition","TransitionStart"),transitioncancel:Tc("Transition","TransitionCancel"),transitionend:Tc("Transition","TransitionEnd")},Nh={},As={};Xo&&(As=document.createElement("div").style,"AnimationEvent"in window||(delete Vd.animationend.animation,delete Vd.animationiteration.animation,delete Vd.animationstart.animation),"TransitionEvent"in window||delete Vd.transitionend.transition);function Cc(l){if(Nh[l])return Nh[l];if(!Vd[l])return l;var f=Vd[l],y;for(y in f)if(f.hasOwnProperty(y)&&y in As)return Nh[l]=f[y];return l}var $s=Cc("animationend"),Iv=Cc("animationiteration"),qo=Cc("animationstart"),kd=Cc("transitionrun"),Ac=Cc("transitionstart"),zv=Cc("transitioncancel"),jm=Cc("transitionend"),zl=new Map,Fm="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Fm.push("scrollEnd");function ms(l,f){zl.set(l,f),Ke(f,[l])}var Rc=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=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(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},Va=[],Iu=0,Vm=0;function Nc(){for(var l=Iu,f=Vm=Iu=0;f<l;){var y=Va[f];Va[f++]=null;var E=Va[f];Va[f++]=null;var L=Va[f];Va[f++]=null;var j=Va[f];if(Va[f++]=null,E!==null&&L!==null){var Q=E.pending;Q===null?L.next=L:(L.next=Q.next,Q.next=L),E.pending=L}j!==0&&km(y,L,j)}}function Ph(l,f,y,E){Va[Iu++]=l,Va[Iu++]=f,Va[Iu++]=y,Va[Iu++]=E,Vm|=E,l.lanes|=E,l=l.alternate,l!==null&&(l.lanes|=E)}function Hd(l,f,y,E){return Ph(l,f,y,E),$d(l)}function Pc(l,f){return Ph(l,null,null,f),$d(l)}function km(l,f,y){l.lanes|=y;var E=l.alternate;E!==null&&(E.lanes|=y);for(var L=!1,j=l.return;j!==null;)j.childLanes|=y,E=j.alternate,E!==null&&(E.childLanes|=y),j.tag===22&&(l=j.stateNode,l===null||l._visibility&1||(L=!0)),l=j,j=j.return;return l.tag===3?(j=l.stateNode,L&&f!==null&&(L=31-wt(y),l=j.hiddenUpdates,E=l[L],E===null?l[L]=[f]:E.push(f),f.lane=y|536870912),j):null}function $d(l){if(50<Qu)throw Qu=0,Ju=null,Error(i(185));for(var f=l.return;f!==null;)l=f,f=l.return;return l.tag===3?l.stateNode:null}var Dc={};function Ix(l,f,y,E){this.tag=l,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=E,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rs(l,f,y,E){return new Ix(l,f,y,E)}function Ns(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Yo(l,f){var y=l.alternate;return y===null?(y=Rs(l.tag,f,l.key,l.mode),y.elementType=l.elementType,y.type=l.type,y.stateNode=l.stateNode,y.alternate=l,l.alternate=y):(y.pendingProps=f,y.type=l.type,y.flags=0,y.subtreeFlags=0,y.deletions=null),y.flags=l.flags&65011712,y.childLanes=l.childLanes,y.lanes=l.lanes,y.child=l.child,y.memoizedProps=l.memoizedProps,y.memoizedState=l.memoizedState,y.updateQueue=l.updateQueue,f=l.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=l.sibling,y.index=l.index,y.ref=l.ref,y.refCleanup=l.refCleanup,y}function gs(l,f){l.flags&=65011714;var y=l.alternate;return y===null?(l.childLanes=0,l.lanes=f,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=y.childLanes,l.lanes=y.lanes,l.child=y.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=y.memoizedProps,l.memoizedState=y.memoizedState,l.updateQueue=y.updateQueue,l.type=y.type,f=y.dependencies,l.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),l}function Dh(l,f,y,E,L,j){var Q=0;if(E=l,typeof l=="function")Ns(l)&&(Q=1);else if(typeof l=="string")Q=TW(l,y,Z.current)?26:l==="html"||l==="head"||l==="body"?27:5;else e:switch(l){case z:return l=Rs(31,y,f,L),l.elementType=z,l.lanes=j,l;case w:return Bl(y.children,L,j,f);case x:Q=8,L|=24;break;case S:return l=Rs(12,y,f,L|2),l.elementType=S,l.lanes=j,l;case N:return l=Rs(13,y,f,L),l.elementType=N,l.lanes=j,l;case R:return l=Rs(19,y,f,L),l.elementType=R,l.lanes=j,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case C:Q=10;break e;case M:Q=9;break e;case A:Q=11;break e;case D:Q=14;break e;case B:Q=16,E=null;break e}Q=29,y=Error(i(130,l===null?"null":typeof l,"")),E=null}return f=Rs(Q,y,f,L),f.elementType=l,f.type=E,f.lanes=j,f}function Bl(l,f,y,E){return l=Rs(7,l,E,f),l.lanes=y,l}function Hm(l,f,y){return l=Rs(6,l,null,f),l.lanes=y,l}function zx(l){var f=Rs(18,null,null,0);return f.stateNode=l,f}function wo(l,f,y){return f=Rs(4,l.children!==null?l.children:[],l.key,f),f.lanes=y,f.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},f}var Bv=new WeakMap;function Gs(l,f){if(typeof l=="object"&&l!==null){var y=Bv.get(l);return y!==void 0?y:(f={value:l,source:f,stack:Oe(f)},Bv.set(l,f),f)}return{value:l,source:f,stack:Oe(f)}}var Eo=[],zu=0,Lh=null,Gd=0,wr=[],Ws=0,Zo=null,Qo=1,Jo="";function Ul(l,f){Eo[zu++]=Gd,Eo[zu++]=Lh,Lh=l,Gd=f}function Uv(l,f,y){wr[Ws++]=Qo,wr[Ws++]=Jo,wr[Ws++]=Zo,Zo=l;var E=Qo;l=Jo;var L=32-wt(E)-1;E&=~(1<<L),y+=1;var j=32-wt(f)+L;if(30<j){var Q=L-L%5;j=(E&(1<<Q)-1).toString(32),E>>=Q,L-=Q,Qo=1<<32-wt(f)+L|y<<L|E,Jo=j+l}else Qo=1<<j|y<<L|E,Jo=l}function $m(l){l.return!==null&&(Ul(l,1),Uv(l,1,0))}function Lc(l){for(;l===Lh;)Lh=Eo[--zu],Eo[zu]=null,Gd=Eo[--zu],Eo[zu]=null;for(;l===Zo;)Zo=wr[--Ws],wr[Ws]=null,Jo=wr[--Ws],wr[Ws]=null,Qo=wr[--Ws],wr[Ws]=null}function Oh(l,f){wr[Ws++]=Qo,wr[Ws++]=Jo,wr[Ws++]=Zo,Qo=f.id,Jo=f.overflow,Zo=l}var ka=null,ji=null,ni=!1,jl=null,Ha=!1,Gm=Error(i(519));function Zn(l){var f=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ih(Gs(f,l)),Gm}function Wm(l){var f=l.stateNode,y=l.type,E=l.memoizedProps;switch(f[vt]=l,f[Ot]=E,y){case"dialog":ii("cancel",f),ii("close",f);break;case"iframe":case"object":case"embed":ii("load",f);break;case"video":case"audio":for(y=0;y<Ny.length;y++)ii(Ny[y],f);break;case"source":ii("error",f);break;case"img":case"image":case"link":ii("error",f),ii("load",f);break;case"details":ii("toggle",f);break;case"input":ii("invalid",f),hs(f,E.value,E.defaultValue,E.checked,E.defaultChecked,E.type,E.name,!0);break;case"select":ii("invalid",f);break;case"textarea":ii("invalid",f),Cs(f,E.value,E.defaultValue,E.children)}y=E.children,typeof y!="string"&&typeof y!="number"&&typeof y!="bigint"||f.textContent===""+y||E.suppressHydrationWarning===!0||tR(f.textContent,y)?(E.popover!=null&&(ii("beforetoggle",f),ii("toggle",f)),E.onScroll!=null&&ii("scroll",f),E.onScrollEnd!=null&&ii("scrollend",f),E.onClick!=null&&(f.onclick=Ko),f=!0):f=!1,f||Zn(l,!0)}function Bx(l){for(ka=l.return;ka;)switch(ka.tag){case 5:case 31:case 13:Ha=!1;return;case 27:case 3:Ha=!0;return;default:ka=ka.return}}function Bu(l){if(l!==ka)return!1;if(!ni)return Bx(l),ni=!0,!1;var f=l.tag,y;if((y=f!==3&&f!==27)&&((y=f===5)&&(y=l.type,y=!(y!=="form"&&y!=="button")||E4(l.type,l.memoizedProps)),y=!y),y&&ji&&Zn(l),Bx(l),f===13){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));ji=uR(l)}else if(f===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));ji=uR(l)}else f===27?(f=ji,df(l.type)?(l=R4,R4=null,ji=l):ji=f):ji=ka?ul(l.stateNode.nextSibling):null;return!0}function Uu(){ji=ka=null,ni=!1}function jv(){var l=jl;return l!==null&&(Ss===null?Ss=l:Ss.push.apply(Ss,l),jl=null),l}function Ih(l){jl===null?jl=[l]:jl.push(l)}var Fv=K(null),Fl=null,vs=null;function Vl(l,f,y){ie(Fv,f._currentValue),f._currentValue=y}function qr(l){l._currentValue=Fv.current,ee(Fv)}function kl(l,f,y){for(;l!==null;){var E=l.alternate;if((l.childLanes&f)!==f?(l.childLanes|=f,E!==null&&(E.childLanes|=f)):E!==null&&(E.childLanes&f)!==f&&(E.childLanes|=f),l===y)break;l=l.return}}function Km(l,f,y,E){var L=l.child;for(L!==null&&(L.return=l);L!==null;){var j=L.dependencies;if(j!==null){var Q=L.child;j=j.firstContext;e:for(;j!==null;){var oe=j;j=L;for(var Me=0;Me<f.length;Me++)if(oe.context===f[Me]){j.lanes|=y,oe=j.alternate,oe!==null&&(oe.lanes|=y),kl(j.return,y,l),E||(Q=null);break e}j=oe.next}}else if(L.tag===18){if(Q=L.return,Q===null)throw Error(i(341));Q.lanes|=y,j=Q.alternate,j!==null&&(j.lanes|=y),kl(Q,y,l),Q=null}else Q=L.child;if(Q!==null)Q.return=L;else for(Q=L;Q!==null;){if(Q===l){Q=null;break}if(L=Q.sibling,L!==null){L.return=Q.return,Q=L;break}Q=Q.return}L=Q}}function Oc(l,f,y,E){l=null;for(var L=f,j=!1;L!==null;){if(!j){if((L.flags&524288)!==0)j=!0;else if((L.flags&262144)!==0)break}if(L.tag===10){var Q=L.alternate;if(Q===null)throw Error(i(387));if(Q=Q.memoizedProps,Q!==null){var oe=L.type;Wi(L.pendingProps.value,Q.value)||(l!==null?l.push(oe):l=[oe])}}else if(L===ae.current){if(Q=L.alternate,Q===null)throw Error(i(387));Q.memoizedState.memoizedState!==L.memoizedState.memoizedState&&(l!==null?l.push(Iy):l=[Iy])}L=L.return}l!==null&&Km(f,l,y,E),f.flags|=262144}function Wd(l){for(l=l.firstContext;l!==null;){if(!Wi(l.context._currentValue,l.memoizedValue))return!0;l=l.next}return!1}function ju(l){Fl=l,vs=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function $a(l){return Vv(Fl,l)}function zh(l,f){return Fl===null&&ju(l),Vv(l,f)}function Vv(l,f){var y=f._currentValue;if(f={context:f,memoizedValue:y,next:null},vs===null){if(l===null)throw Error(i(308));vs=f,l.dependencies={lanes:0,firstContext:f},l.flags|=524288}else vs=vs.next=f;return y}var Ux=typeof AbortController<"u"?AbortController:function(){var l=[],f=this.signal={aborted:!1,addEventListener:function(y,E){l.push(E)}};this.abort=function(){f.aborted=!0,l.forEach(function(y){return y()})}},jx=t.unstable_scheduleCallback,kv=t.unstable_NormalPriority,hn={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hv(){return{controller:new Ux,data:new Map,refCount:0}}function ns(l){l.refCount--,l.refCount===0&&jx(kv,function(){l.controller.abort()})}var Fu=null,$v=0,Hl=0,Mo=null;function Kd(l,f){if(Fu===null){var y=Fu=[];$v=0,Hl=m4(),Mo={status:"pending",value:void 0,then:function(E){y.push(E)}}}return $v++,f.then(Gv,Gv),f}function Gv(){if(--$v===0&&Fu!==null){Mo!==null&&(Mo.status="fulfilled");var l=Fu;Fu=null,Hl=0,Mo=null;for(var f=0;f<l.length;f++)(0,l[f])()}}function Wv(l,f){var y=[],E={status:"pending",value:null,reason:null,then:function(L){y.push(L)}};return l.then(function(){E.status="fulfilled",E.value=f;for(var L=0;L<y.length;L++)(0,y[L])(f)},function(L){for(E.status="rejected",E.reason=L,L=0;L<y.length;L++)(0,y[L])(void 0)}),E}var Fx=V.S;V.S=function(l,f){lf=te(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&Kd(l,f),Fx!==null&&Fx(l,f)};var Ic=K(null);function el(){var l=Ic.current;return l!==null?l:Mi.pooledCache}function Xd(l,f){f===null?ie(Ic,Ic.current):ie(Ic,f.pool)}function Xm(){var l=el();return l===null?null:{parent:hn._currentValue,pool:l}}var zc=Error(i(460)),Bh=Error(i(474)),To=Error(i(542)),Uh={then:function(){}};function Vx(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Kv(l,f,y){switch(y=l[y],y===void 0?l.push(f):y!==f&&(f.then(Ko,Ko),f=y),f.status){case"fulfilled":return f.value;case"rejected":throw l=f.reason,Xv(l),l;default:if(typeof f.status=="string")f.then(Ko,Ko);else{if(l=Mi,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=f,l.status="pending",l.then(function(E){if(f.status==="pending"){var L=f;L.status="fulfilled",L.value=E}},function(E){if(f.status==="pending"){var L=f;L.status="rejected",L.reason=E}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw l=f.reason,Xv(l),l}throw yn=f,zc}}function Vu(l){try{var f=l._init;return f(l._payload)}catch(y){throw y!==null&&typeof y=="object"&&typeof y.then=="function"?(yn=y,zc):y}}var yn=null;function qm(){if(yn===null)throw Error(i(459));var l=yn;return yn=null,l}function Xv(l){if(l===zc||l===To)throw Error(i(483))}var Bc=null,Uc=0;function Ym(l){var f=Uc;return Uc+=1,Bc===null&&(Bc=[]),Kv(Bc,l,f)}function jh(l,f){f=f.props.ref,l.ref=f!==void 0?f:null}function Fh(l,f){throw f.$$typeof===p?Error(i(525)):(l=Object.prototype.toString.call(f),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":l)))}function qd(l){function f(je,Ne){if(l){var $e=je.deletions;$e===null?(je.deletions=[Ne],je.flags|=16):$e.push(Ne)}}function y(je,Ne){if(!l)return null;for(;Ne!==null;)f(je,Ne),Ne=Ne.sibling;return null}function E(je){for(var Ne=new Map;je!==null;)je.key!==null?Ne.set(je.key,je):Ne.set(je.index,je),je=je.sibling;return Ne}function L(je,Ne){return je=Yo(je,Ne),je.index=0,je.sibling=null,je}function j(je,Ne,$e){return je.index=$e,l?($e=je.alternate,$e!==null?($e=$e.index,$e<Ne?(je.flags|=67108866,Ne):$e):(je.flags|=67108866,Ne)):(je.flags|=1048576,Ne)}function Q(je){return l&&je.alternate===null&&(je.flags|=67108866),je}function oe(je,Ne,$e,bt){return Ne===null||Ne.tag!==6?(Ne=Hm($e,je.mode,bt),Ne.return=je,Ne):(Ne=L(Ne,$e),Ne.return=je,Ne)}function Me(je,Ne,$e,bt){var gn=$e.type;return gn===w?ht(je,Ne,$e.props.children,bt,$e.key):Ne!==null&&(Ne.elementType===gn||typeof gn=="object"&&gn!==null&&gn.$$typeof===B&&Vu(gn)===Ne.type)?(Ne=L(Ne,$e.props),jh(Ne,$e),Ne.return=je,Ne):(Ne=Dh($e.type,$e.key,$e.props,null,je.mode,bt),jh(Ne,$e),Ne.return=je,Ne)}function Ge(je,Ne,$e,bt){return Ne===null||Ne.tag!==4||Ne.stateNode.containerInfo!==$e.containerInfo||Ne.stateNode.implementation!==$e.implementation?(Ne=wo($e,je.mode,bt),Ne.return=je,Ne):(Ne=L(Ne,$e.children||[]),Ne.return=je,Ne)}function ht(je,Ne,$e,bt,gn){return Ne===null||Ne.tag!==7?(Ne=Bl($e,je.mode,bt,gn),Ne.return=je,Ne):(Ne=L(Ne,$e),Ne.return=je,Ne)}function xt(je,Ne,$e){if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return Ne=Hm(""+Ne,je.mode,$e),Ne.return=je,Ne;if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case g:return $e=Dh(Ne.type,Ne.key,Ne.props,null,je.mode,$e),jh($e,Ne),$e.return=je,$e;case b:return Ne=wo(Ne,je.mode,$e),Ne.return=je,Ne;case B:return Ne=Vu(Ne),xt(je,Ne,$e)}if(X(Ne)||$(Ne))return Ne=Bl(Ne,je.mode,$e,null),Ne.return=je,Ne;if(typeof Ne.then=="function")return xt(je,Ym(Ne),$e);if(Ne.$$typeof===C)return xt(je,zh(je,Ne),$e);Fh(je,Ne)}return null}function qe(je,Ne,$e,bt){var gn=Ne!==null?Ne.key:null;if(typeof $e=="string"&&$e!==""||typeof $e=="number"||typeof $e=="bigint")return gn!==null?null:oe(je,Ne,""+$e,bt);if(typeof $e=="object"&&$e!==null){switch($e.$$typeof){case g:return $e.key===gn?Me(je,Ne,$e,bt):null;case b:return $e.key===gn?Ge(je,Ne,$e,bt):null;case B:return $e=Vu($e),qe(je,Ne,$e,bt)}if(X($e)||$($e))return gn!==null?null:ht(je,Ne,$e,bt,null);if(typeof $e.then=="function")return qe(je,Ne,Ym($e),bt);if($e.$$typeof===C)return qe(je,Ne,zh(je,$e),bt);Fh(je,$e)}return null}function st(je,Ne,$e,bt,gn){if(typeof bt=="string"&&bt!==""||typeof bt=="number"||typeof bt=="bigint")return je=je.get($e)||null,oe(Ne,je,""+bt,gn);if(typeof bt=="object"&&bt!==null){switch(bt.$$typeof){case g:return je=je.get(bt.key===null?$e:bt.key)||null,Me(Ne,je,bt,gn);case b:return je=je.get(bt.key===null?$e:bt.key)||null,Ge(Ne,je,bt,gn);case B:return bt=Vu(bt),st(je,Ne,$e,bt,gn)}if(X(bt)||$(bt))return je=je.get($e)||null,ht(Ne,je,bt,gn,null);if(typeof bt.then=="function")return st(je,Ne,$e,Ym(bt),gn);if(bt.$$typeof===C)return st(je,Ne,$e,zh(Ne,bt),gn);Fh(Ne,bt)}return null}function on(je,Ne,$e,bt){for(var gn=null,Ci=null,un=Ne,Hn=Ne=0,li=null;un!==null&&Hn<$e.length;Hn++){un.index>Hn?(li=un,un=null):li=un.sibling;var Ai=qe(je,un,$e[Hn],bt);if(Ai===null){un===null&&(un=li);break}l&&un&&Ai.alternate===null&&f(je,un),Ne=j(Ai,Ne,Hn),Ci===null?gn=Ai:Ci.sibling=Ai,Ci=Ai,un=li}if(Hn===$e.length)return y(je,un),ni&&Ul(je,Hn),gn;if(un===null){for(;Hn<$e.length;Hn++)un=xt(je,$e[Hn],bt),un!==null&&(Ne=j(un,Ne,Hn),Ci===null?gn=un:Ci.sibling=un,Ci=un);return ni&&Ul(je,Hn),gn}for(un=E(un);Hn<$e.length;Hn++)li=st(un,je,Hn,$e[Hn],bt),li!==null&&(l&&li.alternate!==null&&un.delete(li.key===null?Hn:li.key),Ne=j(li,Ne,Hn),Ci===null?gn=li:Ci.sibling=li,Ci=li);return l&&un.forEach(function(gf){return f(je,gf)}),ni&&Ul(je,Hn),gn}function bn(je,Ne,$e,bt){if($e==null)throw Error(i(151));for(var gn=null,Ci=null,un=Ne,Hn=Ne=0,li=null,Ai=$e.next();un!==null&&!Ai.done;Hn++,Ai=$e.next()){un.index>Hn?(li=un,un=null):li=un.sibling;var gf=qe(je,un,Ai.value,bt);if(gf===null){un===null&&(un=li);break}l&&un&&gf.alternate===null&&f(je,un),Ne=j(gf,Ne,Hn),Ci===null?gn=gf:Ci.sibling=gf,Ci=gf,un=li}if(Ai.done)return y(je,un),ni&&Ul(je,Hn),gn;if(un===null){for(;!Ai.done;Hn++,Ai=$e.next())Ai=xt(je,Ai.value,bt),Ai!==null&&(Ne=j(Ai,Ne,Hn),Ci===null?gn=Ai:Ci.sibling=Ai,Ci=Ai);return ni&&Ul(je,Hn),gn}for(un=E(un);!Ai.done;Hn++,Ai=$e.next())Ai=st(un,je,Hn,Ai.value,bt),Ai!==null&&(l&&Ai.alternate!==null&&un.delete(Ai.key===null?Hn:Ai.key),Ne=j(Ai,Ne,Hn),Ci===null?gn=Ai:Ci.sibling=Ai,Ci=Ai);return l&&un.forEach(function(BW){return f(je,BW)}),ni&&Ul(je,Hn),gn}function ki(je,Ne,$e,bt){if(typeof $e=="object"&&$e!==null&&$e.type===w&&$e.key===null&&($e=$e.props.children),typeof $e=="object"&&$e!==null){switch($e.$$typeof){case g:e:{for(var gn=$e.key;Ne!==null;){if(Ne.key===gn){if(gn=$e.type,gn===w){if(Ne.tag===7){y(je,Ne.sibling),bt=L(Ne,$e.props.children),bt.return=je,je=bt;break e}}else if(Ne.elementType===gn||typeof gn=="object"&&gn!==null&&gn.$$typeof===B&&Vu(gn)===Ne.type){y(je,Ne.sibling),bt=L(Ne,$e.props),jh(bt,$e),bt.return=je,je=bt;break e}y(je,Ne);break}else f(je,Ne);Ne=Ne.sibling}$e.type===w?(bt=Bl($e.props.children,je.mode,bt,$e.key),bt.return=je,je=bt):(bt=Dh($e.type,$e.key,$e.props,null,je.mode,bt),jh(bt,$e),bt.return=je,je=bt)}return Q(je);case b:e:{for(gn=$e.key;Ne!==null;){if(Ne.key===gn)if(Ne.tag===4&&Ne.stateNode.containerInfo===$e.containerInfo&&Ne.stateNode.implementation===$e.implementation){y(je,Ne.sibling),bt=L(Ne,$e.children||[]),bt.return=je,je=bt;break e}else{y(je,Ne);break}else f(je,Ne);Ne=Ne.sibling}bt=wo($e,je.mode,bt),bt.return=je,je=bt}return Q(je);case B:return $e=Vu($e),ki(je,Ne,$e,bt)}if(X($e))return on(je,Ne,$e,bt);if($($e)){if(gn=$($e),typeof gn!="function")throw Error(i(150));return $e=gn.call($e),bn(je,Ne,$e,bt)}if(typeof $e.then=="function")return ki(je,Ne,Ym($e),bt);if($e.$$typeof===C)return ki(je,Ne,zh(je,$e),bt);Fh(je,$e)}return typeof $e=="string"&&$e!==""||typeof $e=="number"||typeof $e=="bigint"?($e=""+$e,Ne!==null&&Ne.tag===6?(y(je,Ne.sibling),bt=L(Ne,$e),bt.return=je,je=bt):(y(je,Ne),bt=Hm($e,je.mode,bt),bt.return=je,je=bt),Q(je)):y(je,Ne)}return function(je,Ne,$e,bt){try{Uc=0;var gn=ki(je,Ne,$e,bt);return Bc=null,gn}catch(un){if(un===zc||un===To)throw un;var Ci=Rs(29,un,null,je.mode);return Ci.lanes=bt,Ci.return=je,Ci}finally{}}}var ku=qd(!0),kx=qd(!1),jc=!1;function qv(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Yv(l,f){l=l.updateQueue,f.updateQueue===l&&(f.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function tl(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function $l(l,f,y){var E=l.updateQueue;if(E===null)return null;if(E=E.shared,(ri&2)!==0){var L=E.pending;return L===null?f.next=f:(f.next=L.next,L.next=f),E.pending=f,f=$d(l),km(l,null,y),f}return Ph(l,E,f,y),$d(l)}function Fc(l,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194048)!==0)){var E=f.lanes;E&=l.pendingLanes,y|=E,f.lanes=y,lt(l,y)}}function Zm(l,f){var y=l.updateQueue,E=l.alternate;if(E!==null&&(E=E.updateQueue,y===E)){var L=null,j=null;if(y=y.firstBaseUpdate,y!==null){do{var Q={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};j===null?L=j=Q:j=j.next=Q,y=y.next}while(y!==null);j===null?L=j=f:j=j.next=f}else L=j=f;y={baseState:E.baseState,firstBaseUpdate:L,lastBaseUpdate:j,shared:E.shared,callbacks:E.callbacks},l.updateQueue=y;return}l=y.lastBaseUpdate,l===null?y.firstBaseUpdate=f:l.next=f,y.lastBaseUpdate=f}var Zv=!1;function Vh(){if(Zv){var l=Mo;if(l!==null)throw l}}function Hu(l,f,y,E){Zv=!1;var L=l.updateQueue;jc=!1;var j=L.firstBaseUpdate,Q=L.lastBaseUpdate,oe=L.shared.pending;if(oe!==null){L.shared.pending=null;var Me=oe,Ge=Me.next;Me.next=null,Q===null?j=Ge:Q.next=Ge,Q=Me;var ht=l.alternate;ht!==null&&(ht=ht.updateQueue,oe=ht.lastBaseUpdate,oe!==Q&&(oe===null?ht.firstBaseUpdate=Ge:oe.next=Ge,ht.lastBaseUpdate=Me))}if(j!==null){var xt=L.baseState;Q=0,ht=Ge=Me=null,oe=j;do{var qe=oe.lane&-536870913,st=qe!==oe.lane;if(st?(Qn&qe)===qe:(E&qe)===qe){qe!==0&&qe===Hl&&(Zv=!0),ht!==null&&(ht=ht.next={lane:0,tag:oe.tag,payload:oe.payload,callback:null,next:null});e:{var on=l,bn=oe;qe=f;var ki=y;switch(bn.tag){case 1:if(on=bn.payload,typeof on=="function"){xt=on.call(ki,xt,qe);break e}xt=on;break e;case 3:on.flags=on.flags&-65537|128;case 0:if(on=bn.payload,qe=typeof on=="function"?on.call(ki,xt,qe):on,qe==null)break e;xt=d({},xt,qe);break e;case 2:jc=!0}}qe=oe.callback,qe!==null&&(l.flags|=64,st&&(l.flags|=8192),st=L.callbacks,st===null?L.callbacks=[qe]:st.push(qe))}else st={lane:qe,tag:oe.tag,payload:oe.payload,callback:oe.callback,next:null},ht===null?(Ge=ht=st,Me=xt):ht=ht.next=st,Q|=qe;if(oe=oe.next,oe===null){if(oe=L.shared.pending,oe===null)break;st=oe,oe=st.next,st.next=null,L.lastBaseUpdate=st,L.shared.pending=null}}while(!0);ht===null&&(Me=xt),L.baseState=Me,L.firstBaseUpdate=Ge,L.lastBaseUpdate=ht,j===null&&(L.shared.lanes=0),Or|=Q,l.lanes=Q,l.memoizedState=xt}}function nl(l,f){if(typeof l!="function")throw Error(i(191,l));l.call(f)}function is(l,f){var y=l.callbacks;if(y!==null)for(l.callbacks=null,l=0;l<y.length;l++)nl(y[l],f)}var Er=K(null),Ps=K(0);function Qv(l,f){l=ya,ie(Ps,l),ie(Er,f),ya=l|f.baseLanes}function Jv(){ie(Ps,ya),ie(Er,Er.current)}function ys(){ya=Ps.current,ee(Er),ee(Ps)}var Pa=K(null),Yr=null;function Vc(l){var f=l.alternate;ie(sa,sa.current&1),ie(Pa,l),Yr===null&&(f===null||Er.current!==null||f.memoizedState!==null)&&(Yr=l)}function ey(l){ie(sa,sa.current),ie(Pa,l),Yr===null&&(Yr=l)}function Hx(l){l.tag===22?(ie(sa,sa.current),ie(Pa,l),Yr===null&&(Yr=l)):Gl()}function Gl(){ie(sa,sa.current),ie(Pa,Pa.current)}function Mr(l){ee(Pa),Yr===l&&(Yr=null),ee(sa)}var sa=K(0);function Qm(l){for(var f=l;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||C4(y)||A4(y)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var Ks=0,_n=null,Pi=null,Ma=null,Jm=!1,il=!1,$u=!1,e0=0,kh=0,al=null,s4=0;function ra(){throw Error(i(321))}function ty(l,f){if(f===null)return!1;for(var y=0;y<f.length&&y<l.length;y++)if(!Wi(l[y],f[y]))return!1;return!0}function ny(l,f,y,E,L,j){return Ks=j,_n=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,V.H=l===null||l.memoizedState===null?c2:Qd,$u=!1,j=y(E,L),$u=!1,il&&(j=Gx(f,y,E,L)),$x(l),j}function $x(l){V.H=Kh;var f=Pi!==null&&Pi.next!==null;if(Ks=0,Ma=Pi=_n=null,Jm=!1,kh=0,al=null,f)throw Error(i(300));l===null||Ki||(l=l.dependencies,l!==null&&Wd(l)&&(Ki=!0))}function Gx(l,f,y,E){_n=l;var L=0;do{if(il&&(al=null),kh=0,il=!1,25<=L)throw Error(i(301));if(L+=1,Ma=Pi=null,l.updateQueue!=null){var j=l.updateQueue;j.lastEffect=null,j.events=null,j.stores=null,j.memoCache!=null&&(j.memoCache.index=0)}V.H=Xh,j=f(y,E)}while(il);return j}function r4(){var l=V.H,f=l.useState()[0];return f=typeof f.then=="function"?$h(f):f,l=l.useState()[0],(Pi!==null?Pi.memoizedState:null)!==l&&(_n.flags|=1024),f}function iy(){var l=e0!==0;return e0=0,l}function ay(l,f,y){f.updateQueue=l.updateQueue,f.flags&=-2053,l.lanes&=~y}function sy(l){if(Jm){for(l=l.memoizedState;l!==null;){var f=l.queue;f!==null&&(f.pending=null),l=l.next}Jm=!1}Ks=0,Ma=Pi=_n=null,il=!1,kh=e0=0,al=null}function Ds(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ma===null?_n.memoizedState=Ma=l:Ma=Ma.next=l,Ma}function pa(){if(Pi===null){var l=_n.alternate;l=l!==null?l.memoizedState:null}else l=Pi.next;var f=Ma===null?_n.memoizedState:Ma.next;if(f!==null)Ma=f,Pi=l;else{if(l===null)throw _n.alternate===null?Error(i(467)):Error(i(310));Pi=l,l={memoizedState:Pi.memoizedState,baseState:Pi.baseState,baseQueue:Pi.baseQueue,queue:Pi.queue,next:null},Ma===null?_n.memoizedState=Ma=l:Ma=Ma.next=l}return Ma}function Hh(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function $h(l){var f=kh;return kh+=1,al===null&&(al=[]),l=Kv(al,l,f),f=_n,(Ma===null?f.memoizedState:Ma.next)===null&&(f=f.alternate,V.H=f===null||f.memoizedState===null?c2:Qd),l}function t0(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return $h(l);if(l.$$typeof===C)return $a(l)}throw Error(i(438,String(l)))}function ry(l){var f=null,y=_n.updateQueue;if(y!==null&&(f=y.memoCache),f==null){var E=_n.alternate;E!==null&&(E=E.updateQueue,E!==null&&(E=E.memoCache,E!=null&&(f={data:E.data.map(function(L){return L.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),y===null&&(y=Hh(),_n.updateQueue=y),y.memoCache=f,y=f.data[f.index],y===void 0)for(y=f.data[f.index]=Array(l),E=0;E<l;E++)y[E]=I;return f.index++,y}function Wl(l,f){return typeof f=="function"?f(l):f}function n0(l){var f=pa();return oy(f,Pi,l)}function oy(l,f,y){var E=l.queue;if(E===null)throw Error(i(311));E.lastRenderedReducer=y;var L=l.baseQueue,j=E.pending;if(j!==null){if(L!==null){var Q=L.next;L.next=j.next,j.next=Q}f.baseQueue=L=j,E.pending=null}if(j=l.baseState,L===null)l.memoizedState=j;else{f=L.next;var oe=Q=null,Me=null,Ge=f,ht=!1;do{var xt=Ge.lane&-536870913;if(xt!==Ge.lane?(Qn&xt)===xt:(Ks&xt)===xt){var qe=Ge.revertLane;if(qe===0)Me!==null&&(Me=Me.next={lane:0,revertLane:0,gesture:null,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null}),xt===Hl&&(ht=!0);else if((Ks&qe)===qe){Ge=Ge.next,qe===Hl&&(ht=!0);continue}else xt={lane:0,revertLane:Ge.revertLane,gesture:null,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null},Me===null?(oe=Me=xt,Q=j):Me=Me.next=xt,_n.lanes|=qe,Or|=qe;xt=Ge.action,$u&&y(j,xt),j=Ge.hasEagerState?Ge.eagerState:y(j,xt)}else qe={lane:xt,revertLane:Ge.revertLane,gesture:Ge.gesture,action:Ge.action,hasEagerState:Ge.hasEagerState,eagerState:Ge.eagerState,next:null},Me===null?(oe=Me=qe,Q=j):Me=Me.next=qe,_n.lanes|=xt,Or|=xt;Ge=Ge.next}while(Ge!==null&&Ge!==f);if(Me===null?Q=j:Me.next=oe,!Wi(j,l.memoizedState)&&(Ki=!0,ht&&(y=Mo,y!==null)))throw y;l.memoizedState=j,l.baseState=Q,l.baseQueue=Me,E.lastRenderedState=j}return L===null&&(E.lanes=0),[l.memoizedState,E.dispatch]}function i0(l){var f=pa(),y=f.queue;if(y===null)throw Error(i(311));y.lastRenderedReducer=l;var E=y.dispatch,L=y.pending,j=f.memoizedState;if(L!==null){y.pending=null;var Q=L=L.next;do j=l(j,Q.action),Q=Q.next;while(Q!==L);Wi(j,f.memoizedState)||(Ki=!0),f.memoizedState=j,f.baseQueue===null&&(f.baseState=j),y.lastRenderedState=j}return[j,E]}function ly(l,f,y){var E=_n,L=pa(),j=ni;if(j){if(y===void 0)throw Error(i(407));y=y()}else y=f();var Q=!Wi((Pi||L).memoizedState,y);if(Q&&(L.memoizedState=y,Ki=!0),L=L.queue,hy(uy.bind(null,E,L,l),[l]),L.getSnapshot!==f||Q||Ma!==null&&Ma.memoizedState.tag&1){if(E.flags|=2048,Yd(9,{destroy:void 0},cy.bind(null,E,L,y,f),null),Mi===null)throw Error(i(349));j||(Ks&127)!==0||Wx(E,f,y)}return y}function Wx(l,f,y){l.flags|=16384,l={getSnapshot:f,value:y},f=_n.updateQueue,f===null?(f=Hh(),_n.updateQueue=f,f.stores=[l]):(y=f.stores,y===null?f.stores=[l]:y.push(l))}function cy(l,f,y,E){f.value=y,f.getSnapshot=E,dy(f)&&a0(l)}function uy(l,f,y){return y(function(){dy(f)&&a0(l)})}function dy(l){var f=l.getSnapshot;l=l.value;try{var y=f();return!Wi(l,y)}catch{return!0}}function a0(l){var f=Pc(l,2);f!==null&&v(f,l,2)}function Gh(l){var f=Ds();if(typeof l=="function"){var y=l;if(l=y(),$u){jt(!0);try{y()}finally{jt(!1)}}}return f.memoizedState=f.baseState=l,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wl,lastRenderedState:l},f}function Kx(l,f,y,E){return l.baseState=y,oy(l,Pi,typeof E=="function"?E:Wl)}function o4(l,f,y,E,L){if(Kl(l))throw Error(i(485));if(l=f.action,l!==null){var j={payload:L,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Q){j.listeners.push(Q)}};V.T!==null?y(!0):j.isTransition=!1,E(j),y=f.pending,y===null?(j.next=f.pending=j,Xx(f,j)):(j.next=y.next,f.pending=y.next=j)}}function Xx(l,f){var y=f.action,E=f.payload,L=l.state;if(f.isTransition){var j=V.T,Q={};V.T=Q;try{var oe=y(L,E),Me=V.S;Me!==null&&Me(Q,oe),qx(l,f,oe)}catch(Ge){s0(l,f,Ge)}finally{j!==null&&Q.types!==null&&(j.types=Q.types),V.T=j}}else try{j=y(L,E),qx(l,f,j)}catch(Ge){s0(l,f,Ge)}}function qx(l,f,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(E){fy(l,f,E)},function(E){return s0(l,f,E)}):fy(l,f,y)}function fy(l,f,y){f.status="fulfilled",f.value=y,Yx(f),l.state=y,f=l.pending,f!==null&&(y=f.next,y===f?l.pending=null:(y=y.next,f.next=y,Xx(l,y)))}function s0(l,f,y){var E=l.pending;if(l.pending=null,E!==null){E=E.next;do f.status="rejected",f.reason=y,Yx(f),f=f.next;while(f!==E)}l.action=null}function Yx(l){l=l.listeners;for(var f=0;f<l.length;f++)(0,l[f])()}function Zx(l,f){return f}function Qx(l,f){if(ni){var y=Mi.formState;if(y!==null){e:{var E=_n;if(ni){if(ji){t:{for(var L=ji,j=Ha;L.nodeType!==8;){if(!j){L=null;break t}if(L=ul(L.nextSibling),L===null){L=null;break t}}j=L.data,L=j==="F!"||j==="F"?L:null}if(L){ji=ul(L.nextSibling),E=L.data==="F!";break e}}Zn(E)}E=!1}E&&(f=y[0])}}return y=Ds(),y.memoizedState=y.baseState=f,E={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Zx,lastRenderedState:f},y.queue=E,y=l2.bind(null,_n,E),E.dispatch=y,E=Gh(!1),j=Wh.bind(null,_n,!1,E.queue),E=Ds(),L={state:f,dispatch:null,action:l,pending:null},E.queue=L,y=o4.bind(null,_n,L,j,y),L.dispatch=y,E.memoizedState=l,[f,y,!1]}function Jx(l){var f=pa();return e2(f,Pi,l)}function e2(l,f,y){if(f=oy(l,f,Zx)[0],l=n0(Wl)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var E=$h(f)}catch(Q){throw Q===zc?To:Q}else E=f;f=pa();var L=f.queue,j=L.dispatch;return y!==f.memoizedState&&(_n.flags|=2048,Yd(9,{destroy:void 0},l4.bind(null,L,y),null)),[E,j,l]}function l4(l,f){l.action=f}function t2(l){var f=pa(),y=Pi;if(y!==null)return e2(f,y,l);pa(),f=f.memoizedState,y=pa();var E=y.queue.dispatch;return y.memoizedState=l,[f,E,!1]}function Yd(l,f,y,E){return l={tag:l,create:y,deps:E,inst:f,next:null},f=_n.updateQueue,f===null&&(f=Hh(),_n.updateQueue=f),y=f.lastEffect,y===null?f.lastEffect=l.next=l:(E=y.next,y.next=l,l.next=E,f.lastEffect=l),l}function n2(){return pa().memoizedState}function r0(l,f,y,E){var L=Ds();_n.flags|=l,L.memoizedState=Yd(1|f,{destroy:void 0},y,E===void 0?null:E)}function o0(l,f,y,E){var L=pa();E=E===void 0?null:E;var j=L.memoizedState.inst;Pi!==null&&E!==null&&ty(E,Pi.memoizedState.deps)?L.memoizedState=Yd(f,j,y,E):(_n.flags|=l,L.memoizedState=Yd(1|f,j,y,E))}function i2(l,f){r0(8390656,8,l,f)}function hy(l,f){o0(2048,8,l,f)}function a2(l){_n.flags|=4;var f=_n.updateQueue;if(f===null)f=Hh(),_n.updateQueue=f,f.events=[l];else{var y=f.events;y===null?f.events=[l]:y.push(l)}}function s2(l){var f=pa().memoizedState;return a2({ref:f,nextImpl:l}),function(){if((ri&2)!==0)throw Error(i(440));return f.impl.apply(void 0,arguments)}}function r2(l,f){return o0(4,2,l,f)}function Tr(l,f){return o0(4,4,l,f)}function py(l,f){if(typeof f=="function"){l=l();var y=f(l);return function(){typeof y=="function"?y():f(null)}}if(f!=null)return l=l(),f.current=l,function(){f.current=null}}function l0(l,f,y){y=y!=null?y.concat([l]):null,o0(4,4,py.bind(null,f,l),y)}function c0(){}function my(l,f){var y=pa();f=f===void 0?null:f;var E=y.memoizedState;return f!==null&&ty(f,E[1])?E[0]:(y.memoizedState=[l,f],l)}function gy(l,f){var y=pa();f=f===void 0?null:f;var E=y.memoizedState;if(f!==null&&ty(f,E[1]))return E[0];if(E=l(),$u){jt(!0);try{l()}finally{jt(!1)}}return y.memoizedState=[E,f],E}function vy(l,f,y){return y===void 0||(Ks&1073741824)!==0&&(Qn&261930)===0?l.memoizedState=f:(l.memoizedState=y,l=m(),_n.lanes|=l,Or|=l,y)}function yy(l,f,y,E){return Wi(y,f)?y:Er.current!==null?(l=vy(l,y,E),Wi(l,f)||(Ki=!0),l):(Ks&42)===0||(Ks&1073741824)!==0&&(Qn&261930)===0?(Ki=!0,l.memoizedState=y):(l=m(),_n.lanes|=l,Or|=l,f)}function by(l,f,y,E,L){var j=H.p;H.p=j!==0&&8>j?j:8;var Q=V.T,oe={};V.T=oe,Wh(l,!1,f,y);try{var Me=L(),Ge=V.S;if(Ge!==null&&Ge(oe,Me),Me!==null&&typeof Me=="object"&&typeof Me.then=="function"){var ht=Wv(Me,E);Zd(l,f,ht,Os(l))}else Zd(l,f,E,Os(l))}catch(xt){Zd(l,f,{then:function(){},status:"rejected",reason:xt},Os())}finally{H.p=j,Q!==null&&oe.types!==null&&(Q.types=oe.types),V.T=Q}}function c4(){}function xy(l,f,y,E){if(l.tag!==5)throw Error(i(476));var L=o2(l).queue;by(l,L,f,W,y===null?c4:function(){return _y(l),y(E)})}function o2(l){var f=l.memoizedState;if(f!==null)return f;f={memoizedState:W,baseState:W,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wl,lastRenderedState:W},next:null};var y={};return f.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wl,lastRenderedState:y},next:null},l.memoizedState=f,l=l.alternate,l!==null&&(l.memoizedState=f),f}function _y(l){var f=o2(l);f.next===null&&(f=l.alternate.memoizedState),Zd(l,f.next.queue,{},Os())}function Sy(){return $a(Iy)}function as(){return pa().memoizedState}function wy(){return pa().memoizedState}function u4(l){for(var f=l.return;f!==null;){switch(f.tag){case 24:case 3:var y=Os();l=tl(y);var E=$l(f,l,y);E!==null&&(v(E,f,y),Fc(E,f,y)),f={cache:Hv()},l.payload=f;return}f=f.return}}function d4(l,f,y){var E=Os();y={lane:E,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Kl(l)?Gu(f,y):(y=Hd(l,f,y,E),y!==null&&(v(y,l,E),Xs(y,f,E)))}function l2(l,f,y){var E=Os();Zd(l,f,y,E)}function Zd(l,f,y,E){var L={lane:E,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null};if(Kl(l))Gu(f,L);else{var j=l.alternate;if(l.lanes===0&&(j===null||j.lanes===0)&&(j=f.lastRenderedReducer,j!==null))try{var Q=f.lastRenderedState,oe=j(Q,y);if(L.hasEagerState=!0,L.eagerState=oe,Wi(oe,Q))return Ph(l,f,L,0),Mi===null&&Nc(),!1}catch{}finally{}if(y=Hd(l,f,L,E),y!==null)return v(y,l,E),Xs(y,f,E),!0}return!1}function Wh(l,f,y,E){if(E={lane:2,revertLane:m4(),gesture:null,action:E,hasEagerState:!1,eagerState:null,next:null},Kl(l)){if(f)throw Error(i(479))}else f=Hd(l,y,E,2),f!==null&&v(f,l,2)}function Kl(l){var f=l.alternate;return l===_n||f!==null&&f===_n}function Gu(l,f){il=Jm=!0;var y=l.pending;y===null?f.next=f:(f.next=y.next,y.next=f),l.pending=f}function Xs(l,f,y){if((y&4194048)!==0){var E=f.lanes;E&=l.pendingLanes,y|=E,f.lanes=y,lt(l,y)}}var Kh={readContext:$a,use:t0,useCallback:ra,useContext:ra,useEffect:ra,useImperativeHandle:ra,useLayoutEffect:ra,useInsertionEffect:ra,useMemo:ra,useReducer:ra,useRef:ra,useState:ra,useDebugValue:ra,useDeferredValue:ra,useTransition:ra,useSyncExternalStore:ra,useId:ra,useHostTransitionStatus:ra,useFormState:ra,useActionState:ra,useOptimistic:ra,useMemoCache:ra,useCacheRefresh:ra};Kh.useEffectEvent=ra;var c2={readContext:$a,use:t0,useCallback:function(l,f){return Ds().memoizedState=[l,f===void 0?null:f],l},useContext:$a,useEffect:i2,useImperativeHandle:function(l,f,y){y=y!=null?y.concat([l]):null,r0(4194308,4,py.bind(null,f,l),y)},useLayoutEffect:function(l,f){return r0(4194308,4,l,f)},useInsertionEffect:function(l,f){r0(4,2,l,f)},useMemo:function(l,f){var y=Ds();f=f===void 0?null:f;var E=l();if($u){jt(!0);try{l()}finally{jt(!1)}}return y.memoizedState=[E,f],E},useReducer:function(l,f,y){var E=Ds();if(y!==void 0){var L=y(f);if($u){jt(!0);try{y(f)}finally{jt(!1)}}}else L=f;return E.memoizedState=E.baseState=L,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:L},E.queue=l,l=l.dispatch=d4.bind(null,_n,l),[E.memoizedState,l]},useRef:function(l){var f=Ds();return l={current:l},f.memoizedState=l},useState:function(l){l=Gh(l);var f=l.queue,y=l2.bind(null,_n,f);return f.dispatch=y,[l.memoizedState,y]},useDebugValue:c0,useDeferredValue:function(l,f){var y=Ds();return vy(y,l,f)},useTransition:function(){var l=Gh(!1);return l=by.bind(null,_n,l.queue,!0,!1),Ds().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,f,y){var E=_n,L=Ds();if(ni){if(y===void 0)throw Error(i(407));y=y()}else{if(y=f(),Mi===null)throw Error(i(349));(Qn&127)!==0||Wx(E,f,y)}L.memoizedState=y;var j={value:y,getSnapshot:f};return L.queue=j,i2(uy.bind(null,E,j,l),[l]),E.flags|=2048,Yd(9,{destroy:void 0},cy.bind(null,E,j,y,f),null),y},useId:function(){var l=Ds(),f=Mi.identifierPrefix;if(ni){var y=Jo,E=Qo;y=(E&~(1<<32-wt(E)-1)).toString(32)+y,f="_"+f+"R_"+y,y=e0++,0<y&&(f+="H"+y.toString(32)),f+="_"}else y=s4++,f="_"+f+"r_"+y.toString(32)+"_";return l.memoizedState=f},useHostTransitionStatus:Sy,useFormState:Qx,useActionState:Qx,useOptimistic:function(l){var f=Ds();f.memoizedState=f.baseState=l;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=y,f=Wh.bind(null,_n,!0,y),y.dispatch=f,[l,f]},useMemoCache:ry,useCacheRefresh:function(){return Ds().memoizedState=u4.bind(null,_n)},useEffectEvent:function(l){var f=Ds(),y={impl:l};return f.memoizedState=y,function(){if((ri&2)!==0)throw Error(i(440));return y.impl.apply(void 0,arguments)}}},Qd={readContext:$a,use:t0,useCallback:my,useContext:$a,useEffect:hy,useImperativeHandle:l0,useInsertionEffect:r2,useLayoutEffect:Tr,useMemo:gy,useReducer:n0,useRef:n2,useState:function(){return n0(Wl)},useDebugValue:c0,useDeferredValue:function(l,f){var y=pa();return yy(y,Pi.memoizedState,l,f)},useTransition:function(){var l=n0(Wl)[0],f=pa().memoizedState;return[typeof l=="boolean"?l:$h(l),f]},useSyncExternalStore:ly,useId:as,useHostTransitionStatus:Sy,useFormState:Jx,useActionState:Jx,useOptimistic:function(l,f){var y=pa();return Kx(y,Pi,l,f)},useMemoCache:ry,useCacheRefresh:wy};Qd.useEffectEvent=s2;var Xh={readContext:$a,use:t0,useCallback:my,useContext:$a,useEffect:hy,useImperativeHandle:l0,useInsertionEffect:r2,useLayoutEffect:Tr,useMemo:gy,useReducer:i0,useRef:n2,useState:function(){return i0(Wl)},useDebugValue:c0,useDeferredValue:function(l,f){var y=pa();return Pi===null?vy(y,l,f):yy(y,Pi.memoizedState,l,f)},useTransition:function(){var l=i0(Wl)[0],f=pa().memoizedState;return[typeof l=="boolean"?l:$h(l),f]},useSyncExternalStore:ly,useId:as,useHostTransitionStatus:Sy,useFormState:t2,useActionState:t2,useOptimistic:function(l,f){var y=pa();return Pi!==null?Kx(y,Pi,l,f):(y.baseState=l,[l,y.queue.dispatch])},useMemoCache:ry,useCacheRefresh:wy};Xh.useEffectEvent=s2;function Jd(l,f,y,E){f=l.memoizedState,y=y(E,f),y=y==null?f:d({},f,y),l.memoizedState=y,l.lanes===0&&(l.updateQueue.baseState=y)}var qh={enqueueSetState:function(l,f,y){l=l._reactInternals;var E=Os(),L=tl(E);L.payload=f,y!=null&&(L.callback=y),f=$l(l,L,E),f!==null&&(v(f,l,E),Fc(f,l,E))},enqueueReplaceState:function(l,f,y){l=l._reactInternals;var E=Os(),L=tl(E);L.tag=1,L.payload=f,y!=null&&(L.callback=y),f=$l(l,L,E),f!==null&&(v(f,l,E),Fc(f,l,E))},enqueueForceUpdate:function(l,f){l=l._reactInternals;var y=Os(),E=tl(y);E.tag=2,f!=null&&(E.callback=f),f=$l(l,E,y),f!==null&&(v(f,l,y),Fc(f,l,y))}};function u2(l,f,y,E,L,j,Q){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(E,j,Q):f.prototype&&f.prototype.isPureReactComponent?!Bd(y,E)||!Bd(L,j):!0}function d2(l,f,y,E){l=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,E),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,E),f.state!==l&&qh.enqueueReplaceState(f,f.state,null)}function ss(l,f){var y=f;if("ref"in f){y={};for(var E in f)E!=="ref"&&(y[E]=f[E])}if(l=l.defaultProps){y===f&&(y=d({},y));for(var L in l)y[L]===void 0&&(y[L]=l[L])}return y}function Ey(l){Rc(l)}function f2(l){console.error(l)}function u0(l){Rc(l)}function d0(l,f){try{var y=l.onUncaughtError;y(f.value,{componentStack:f.stack})}catch(E){setTimeout(function(){throw E})}}function h2(l,f,y){try{var E=l.onCaughtError;E(y.value,{componentStack:y.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(L){setTimeout(function(){throw L})}}function My(l,f,y){return y=tl(y),y.tag=3,y.payload={element:null},y.callback=function(){d0(l,f)},y}function ef(l){return l=tl(l),l.tag=3,l}function qs(l,f,y,E){var L=y.type.getDerivedStateFromError;if(typeof L=="function"){var j=E.value;l.payload=function(){return L(j)},l.callback=function(){h2(f,y,E)}}var Q=y.stateNode;Q!==null&&typeof Q.componentDidCatch=="function"&&(l.callback=function(){h2(f,y,E),typeof L!="function"&&(cl===null?cl=new Set([this]):cl.add(this));var oe=E.stack;this.componentDidCatch(E.value,{componentStack:oe!==null?oe:""})})}function Cr(l,f,y,E,L){if(y.flags|=32768,E!==null&&typeof E=="object"&&typeof E.then=="function"){if(f=y.alternate,f!==null&&Oc(f,y,L,!0),y=Pa.current,y!==null){switch(y.tag){case 31:case 13:return Yr===null?Cn():y.alternate===null&&Ti===0&&(Ti=3),y.flags&=-257,y.flags|=65536,y.lanes=L,E===Uh?y.flags|=16384:(f=y.updateQueue,f===null?y.updateQueue=new Set([E]):f.add(E),f4(l,E,L)),!1;case 22:return y.flags|=65536,E===Uh?y.flags|=16384:(f=y.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([E])},y.updateQueue=f):(y=f.retryQueue,y===null?f.retryQueue=new Set([E]):y.add(E)),f4(l,E,L)),!1}throw Error(i(435,y.tag))}return f4(l,E,L),Cn(),!1}if(ni)return f=Pa.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=L,E!==Gm&&(l=Error(i(422),{cause:E}),Ih(Gs(l,y)))):(E!==Gm&&(f=Error(i(423),{cause:E}),Ih(Gs(f,y))),l=l.current.alternate,l.flags|=65536,L&=-L,l.lanes|=L,E=Gs(E,y),L=My(l.stateNode,E,L),Zm(l,L),Ti!==4&&(Ti=2)),!1;var j=Error(i(520),{cause:E});if(j=Gs(j,y),Po===null?Po=[j]:Po.push(j),Ti!==4&&(Ti=2),f===null)return!0;E=Gs(E,y),y=f;do{switch(y.tag){case 3:return y.flags|=65536,l=L&-L,y.lanes|=l,l=My(y.stateNode,E,l),Zm(y,l),!1;case 1:if(f=y.type,j=y.stateNode,(y.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||j!==null&&typeof j.componentDidCatch=="function"&&(cl===null||!cl.has(j))))return y.flags|=65536,L&=-L,y.lanes|=L,L=ef(L),qs(L,l,y,E),Zm(y,L),!1}y=y.return}while(y!==null);return!1}var f0=Error(i(461)),Ki=!1;function oa(l,f,y,E){f.child=l===null?kx(f,null,y,E):ku(f,l.child,y,E)}function Yh(l,f,y,E,L){y=y.render;var j=f.ref;if("ref"in E){var Q={};for(var oe in E)oe!=="ref"&&(Q[oe]=E[oe])}else Q=E;return ju(f),E=ny(l,f,y,Q,j,L),oe=iy(),l!==null&&!Ki?(ay(l,f,L),Ro(l,f,L)):(ni&&oe&&$m(f),f.flags|=1,oa(l,f,E,L),f.child)}function Zh(l,f,y,E,L){if(l===null){var j=y.type;return typeof j=="function"&&!Ns(j)&&j.defaultProps===void 0&&y.compare===null?(f.tag=15,f.type=j,Ar(l,f,j,E,L)):(l=Dh(y.type,null,E,f,f.mode,L),l.ref=f.ref,l.return=f,f.child=l)}if(j=l.child,!Hc(l,L)){var Q=j.memoizedProps;if(y=y.compare,y=y!==null?y:Bd,y(Q,E)&&l.ref===f.ref)return Ro(l,f,L)}return f.flags|=1,l=Yo(j,E),l.ref=f.ref,l.return=f,f.child=l}function Ar(l,f,y,E,L){if(l!==null){var j=l.memoizedProps;if(Bd(j,E)&&l.ref===f.ref)if(Ki=!1,f.pendingProps=E=j,Hc(l,L))(l.flags&131072)!==0&&(Ki=!0);else return f.lanes=l.lanes,Ro(l,f,L)}return tf(l,f,y,E,L)}function Rr(l,f,y,E){var L=E.children,j=l!==null?l.memoizedState:null;if(l===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),E.mode==="hidden"){if((f.flags&128)!==0){if(j=j!==null?j.baseLanes|y:y,l!==null){for(E=f.child=l.child,L=0;E!==null;)L=L|E.lanes|E.childLanes,E=E.sibling;E=L&~j}else E=0,f.child=null;return sl(l,f,j,y,E)}if((y&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},l!==null&&Xd(f,j!==null?j.cachePool:null),j!==null?Qv(f,j):Jv(),Hx(f);else return E=f.lanes=536870912,sl(l,f,j!==null?j.baseLanes|y:y,y,E)}else j!==null?(Xd(f,j.cachePool),Qv(f,j),Gl(),f.memoizedState=null):(l!==null&&Xd(f,null),Jv(),Gl());return oa(l,f,L,y),f.child}function Co(l,f){return l!==null&&l.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function sl(l,f,y,E,L){var j=el();return j=j===null?null:{parent:hn._currentValue,pool:j},f.memoizedState={baseLanes:y,cachePool:j},l!==null&&Xd(f,null),Jv(),Hx(f),l!==null&&Oc(l,f,E,!0),f.childLanes=L,null}function Zr(l,f){return f=nf({mode:f.mode,children:f.children},l.mode),f.ref=l.ref,l.child=f,f.return=l,f}function Ga(l,f,y){return ku(f,l.child,null,y),l=Zr(f,f.pendingProps),l.flags|=2,Mr(f),f.memoizedState=null,l}function Qh(l,f,y){var E=f.pendingProps,L=(f.flags&128)!==0;if(f.flags&=-129,l===null){if(ni){if(E.mode==="hidden")return l=Zr(f,E),f.lanes=536870912,Co(null,l);if(ey(f),(l=ji)?(l=cR(l,Ha),l=l!==null&&l.data==="&"?l:null,l!==null&&(f.memoizedState={dehydrated:l,treeContext:Zo!==null?{id:Qo,overflow:Jo}:null,retryLane:536870912,hydrationErrors:null},y=zx(l),y.return=f,f.child=y,ka=f,ji=null)):l=null,l===null)throw Zn(f);return f.lanes=536870912,null}return Zr(f,E)}var j=l.memoizedState;if(j!==null){var Q=j.dehydrated;if(ey(f),L)if(f.flags&256)f.flags&=-257,f=Ga(l,f,y);else if(f.memoizedState!==null)f.child=l.child,f.flags|=128,f=null;else throw Error(i(558));else if(Ki||Oc(l,f,y,!1),L=(y&l.childLanes)!==0,Ki||L){if(E=Mi,E!==null&&(Q=rt(E,y),Q!==0&&Q!==j.retryLane))throw j.retryLane=Q,Pc(l,Q),v(E,l,Q),f0;Cn(),f=Ga(l,f,y)}else l=j.treeContext,ji=ul(Q.nextSibling),ka=f,ni=!0,jl=null,Ha=!1,l!==null&&Oh(f,l),f=Zr(f,E),f.flags|=4096;return f}return l=Yo(l.child,{mode:E.mode,children:E.children}),l.ref=f.ref,f.child=l,l.return=f,l}function Ao(l,f){var y=f.ref;if(y===null)l!==null&&l.ref!==null&&(f.flags|=4194816);else{if(typeof y!="function"&&typeof y!="object")throw Error(i(284));(l===null||l.ref!==y)&&(f.flags|=4194816)}}function tf(l,f,y,E,L){return ju(f),y=ny(l,f,y,E,void 0,L),E=iy(),l!==null&&!Ki?(ay(l,f,L),Ro(l,f,L)):(ni&&E&&$m(f),f.flags|=1,oa(l,f,y,L),f.child)}function bs(l,f,y,E,L,j){return ju(f),f.updateQueue=null,y=Gx(f,E,y,L),$x(l),E=iy(),l!==null&&!Ki?(ay(l,f,j),Ro(l,f,j)):(ni&&E&&$m(f),f.flags|=1,oa(l,f,y,j),f.child)}function rs(l,f,y,E,L){if(ju(f),f.stateNode===null){var j=Dc,Q=y.contextType;typeof Q=="object"&&Q!==null&&(j=$a(Q)),j=new y(E,j),f.memoizedState=j.state!==null&&j.state!==void 0?j.state:null,j.updater=qh,f.stateNode=j,j._reactInternals=f,j=f.stateNode,j.props=E,j.state=f.memoizedState,j.refs={},qv(f),Q=y.contextType,j.context=typeof Q=="object"&&Q!==null?$a(Q):Dc,j.state=f.memoizedState,Q=y.getDerivedStateFromProps,typeof Q=="function"&&(Jd(f,y,Q,E),j.state=f.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof j.getSnapshotBeforeUpdate=="function"||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(Q=j.state,typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount(),Q!==j.state&&qh.enqueueReplaceState(j,j.state,null),Hu(f,E,j,L),Vh(),j.state=f.memoizedState),typeof j.componentDidMount=="function"&&(f.flags|=4194308),E=!0}else if(l===null){j=f.stateNode;var oe=f.memoizedProps,Me=ss(y,oe);j.props=Me;var Ge=j.context,ht=y.contextType;Q=Dc,typeof ht=="object"&&ht!==null&&(Q=$a(ht));var xt=y.getDerivedStateFromProps;ht=typeof xt=="function"||typeof j.getSnapshotBeforeUpdate=="function",oe=f.pendingProps!==oe,ht||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(oe||Ge!==Q)&&d2(f,j,E,Q),jc=!1;var qe=f.memoizedState;j.state=qe,Hu(f,E,j,L),Vh(),Ge=f.memoizedState,oe||qe!==Ge||jc?(typeof xt=="function"&&(Jd(f,y,xt,E),Ge=f.memoizedState),(Me=jc||u2(f,y,Me,E,qe,Ge,Q))?(ht||typeof j.UNSAFE_componentWillMount!="function"&&typeof j.componentWillMount!="function"||(typeof j.componentWillMount=="function"&&j.componentWillMount(),typeof j.UNSAFE_componentWillMount=="function"&&j.UNSAFE_componentWillMount()),typeof j.componentDidMount=="function"&&(f.flags|=4194308)):(typeof j.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=E,f.memoizedState=Ge),j.props=E,j.state=Ge,j.context=Q,E=Me):(typeof j.componentDidMount=="function"&&(f.flags|=4194308),E=!1)}else{j=f.stateNode,Yv(l,f),Q=f.memoizedProps,ht=ss(y,Q),j.props=ht,xt=f.pendingProps,qe=j.context,Ge=y.contextType,Me=Dc,typeof Ge=="object"&&Ge!==null&&(Me=$a(Ge)),oe=y.getDerivedStateFromProps,(Ge=typeof oe=="function"||typeof j.getSnapshotBeforeUpdate=="function")||typeof j.UNSAFE_componentWillReceiveProps!="function"&&typeof j.componentWillReceiveProps!="function"||(Q!==xt||qe!==Me)&&d2(f,j,E,Me),jc=!1,qe=f.memoizedState,j.state=qe,Hu(f,E,j,L),Vh();var st=f.memoizedState;Q!==xt||qe!==st||jc||l!==null&&l.dependencies!==null&&Wd(l.dependencies)?(typeof oe=="function"&&(Jd(f,y,oe,E),st=f.memoizedState),(ht=jc||u2(f,y,ht,E,qe,st,Me)||l!==null&&l.dependencies!==null&&Wd(l.dependencies))?(Ge||typeof j.UNSAFE_componentWillUpdate!="function"&&typeof j.componentWillUpdate!="function"||(typeof j.componentWillUpdate=="function"&&j.componentWillUpdate(E,st,Me),typeof j.UNSAFE_componentWillUpdate=="function"&&j.UNSAFE_componentWillUpdate(E,st,Me)),typeof j.componentDidUpdate=="function"&&(f.flags|=4),typeof j.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof j.componentDidUpdate!="function"||Q===l.memoizedProps&&qe===l.memoizedState||(f.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&qe===l.memoizedState||(f.flags|=1024),f.memoizedProps=E,f.memoizedState=st),j.props=E,j.state=st,j.context=Me,E=ht):(typeof j.componentDidUpdate!="function"||Q===l.memoizedProps&&qe===l.memoizedState||(f.flags|=4),typeof j.getSnapshotBeforeUpdate!="function"||Q===l.memoizedProps&&qe===l.memoizedState||(f.flags|=1024),E=!1)}return j=E,Ao(l,f),E=(f.flags&128)!==0,j||E?(j=f.stateNode,y=E&&typeof y.getDerivedStateFromError!="function"?null:j.render(),f.flags|=1,l!==null&&E?(f.child=ku(f,l.child,null,L),f.child=ku(f,null,y,L)):oa(l,f,y,L),f.memoizedState=j.state,l=f.child):l=Ro(l,f,L),l}function di(l,f,y,E){return Uu(),f.flags|=256,oa(l,f,y,E),f.child}var Nr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qr(l){return{baseLanes:l,cachePool:Xm()}}function Jh(l,f,y){return l=l!==null?l.childLanes&~y:0,f&&(l|=oi),l}function Pr(l,f,y){var E=f.pendingProps,L=!1,j=(f.flags&128)!==0,Q;if((Q=j)||(Q=l!==null&&l.memoizedState===null?!1:(sa.current&2)!==0),Q&&(L=!0,f.flags&=-129),Q=(f.flags&32)!==0,f.flags&=-33,l===null){if(ni){if(L?Vc(f):Gl(),(l=ji)?(l=cR(l,Ha),l=l!==null&&l.data!=="&"?l:null,l!==null&&(f.memoizedState={dehydrated:l,treeContext:Zo!==null?{id:Qo,overflow:Jo}:null,retryLane:536870912,hydrationErrors:null},y=zx(l),y.return=f,f.child=y,ka=f,ji=null)):l=null,l===null)throw Zn(f);return A4(l)?f.lanes=32:f.lanes=536870912,null}var oe=E.children;return E=E.fallback,L?(Gl(),L=f.mode,oe=nf({mode:"hidden",children:oe},L),E=Bl(E,L,y,null),oe.return=f,E.return=f,oe.sibling=E,f.child=oe,E=f.child,E.memoizedState=Qr(y),E.childLanes=Jh(l,Q,y),f.memoizedState=Nr,Co(null,E)):(Vc(f),kc(f,oe))}var Me=l.memoizedState;if(Me!==null&&(oe=Me.dehydrated,oe!==null)){if(j)f.flags&256?(Vc(f),f.flags&=-257,f=af(l,f,y)):f.memoizedState!==null?(Gl(),f.child=l.child,f.flags|=128,f=null):(Gl(),oe=E.fallback,L=f.mode,E=nf({mode:"visible",children:E.children},L),oe=Bl(oe,L,y,null),oe.flags|=2,E.return=f,oe.return=f,E.sibling=oe,f.child=E,ku(f,l.child,null,y),E=f.child,E.memoizedState=Qr(y),E.childLanes=Jh(l,Q,y),f.memoizedState=Nr,f=Co(null,E));else if(Vc(f),A4(oe)){if(Q=oe.nextSibling&&oe.nextSibling.dataset,Q)var Ge=Q.dgst;Q=Ge,E=Error(i(419)),E.stack="",E.digest=Q,Ih({value:E,source:null,stack:null}),f=af(l,f,y)}else if(Ki||Oc(l,f,y,!1),Q=(y&l.childLanes)!==0,Ki||Q){if(Q=Mi,Q!==null&&(E=rt(Q,y),E!==0&&E!==Me.retryLane))throw Me.retryLane=E,Pc(l,E),v(Q,l,E),f0;C4(oe)||Cn(),f=af(l,f,y)}else C4(oe)?(f.flags|=192,f.child=l.child,f=null):(l=Me.treeContext,ji=ul(oe.nextSibling),ka=f,ni=!0,jl=null,Ha=!1,l!==null&&Oh(f,l),f=kc(f,E.children),f.flags|=4096);return f}return L?(Gl(),oe=E.fallback,L=f.mode,Me=l.child,Ge=Me.sibling,E=Yo(Me,{mode:"hidden",children:E.children}),E.subtreeFlags=Me.subtreeFlags&65011712,Ge!==null?oe=Yo(Ge,oe):(oe=Bl(oe,L,y,null),oe.flags|=2),oe.return=f,E.return=f,E.sibling=oe,f.child=E,Co(null,E),E=f.child,oe=l.child.memoizedState,oe===null?oe=Qr(y):(L=oe.cachePool,L!==null?(Me=hn._currentValue,L=L.parent!==Me?{parent:Me,pool:Me}:L):L=Xm(),oe={baseLanes:oe.baseLanes|y,cachePool:L}),E.memoizedState=oe,E.childLanes=Jh(l,Q,y),f.memoizedState=Nr,Co(l.child,E)):(Vc(f),y=l.child,l=y.sibling,y=Yo(y,{mode:"visible",children:E.children}),y.return=f,y.sibling=null,l!==null&&(Q=f.deletions,Q===null?(f.deletions=[l],f.flags|=16):Q.push(l)),f.child=y,f.memoizedState=null,y)}function kc(l,f){return f=nf({mode:"visible",children:f},l.mode),f.return=l,l.child=f}function nf(l,f){return l=Rs(22,l,null,f),l.lanes=0,l}function af(l,f,y){return ku(f,l.child,null,y),l=kc(f,f.pendingProps.children),l.flags|=2,f.memoizedState=null,l}function Wu(l,f,y){l.lanes|=f;var E=l.alternate;E!==null&&(E.lanes|=f),kl(l.return,f,y)}function ep(l,f,y,E,L,j){var Q=l.memoizedState;Q===null?l.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:E,tail:y,tailMode:L,treeForkCount:j}:(Q.isBackwards=f,Q.rendering=null,Q.renderingStartTime=0,Q.last=E,Q.tail=y,Q.tailMode=L,Q.treeForkCount=j)}function tp(l,f,y){var E=f.pendingProps,L=E.revealOrder,j=E.tail;E=E.children;var Q=sa.current,oe=(Q&2)!==0;if(oe?(Q=Q&1|2,f.flags|=128):Q&=1,ie(sa,Q),oa(l,f,E,y),E=ni?Gd:0,!oe&&l!==null&&(l.flags&128)!==0)e:for(l=f.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&Wu(l,y,f);else if(l.tag===19)Wu(l,y,f);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===f)break e;for(;l.sibling===null;){if(l.return===null||l.return===f)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(L){case"forwards":for(y=f.child,L=null;y!==null;)l=y.alternate,l!==null&&Qm(l)===null&&(L=y),y=y.sibling;y=L,y===null?(L=f.child,f.child=null):(L=y.sibling,y.sibling=null),ep(f,!1,L,y,j,E);break;case"backwards":case"unstable_legacy-backwards":for(y=null,L=f.child,f.child=null;L!==null;){if(l=L.alternate,l!==null&&Qm(l)===null){f.child=L;break}l=L.sibling,L.sibling=y,y=L,L=l}ep(f,!0,y,null,j,E);break;case"together":ep(f,!1,null,null,void 0,E);break;default:f.memoizedState=null}return f.child}function Ro(l,f,y){if(l!==null&&(f.dependencies=l.dependencies),Or|=f.lanes,(y&f.childLanes)===0)if(l!==null){if(Oc(l,f,y,!1),(y&f.childLanes)===0)return null}else return null;if(l!==null&&f.child!==l.child)throw Error(i(153));if(f.child!==null){for(l=f.child,y=Yo(l,l.pendingProps),f.child=y,y.return=f;l.sibling!==null;)l=l.sibling,y=y.sibling=Yo(l,l.pendingProps),y.return=f;y.sibling=null}return f.child}function Hc(l,f){return(l.lanes&f)!==0?!0:(l=l.dependencies,!!(l!==null&&Wd(l)))}function np(l,f,y){switch(f.tag){case 3:ce(f,f.stateNode.containerInfo),Vl(f,hn,l.memoizedState.cache),Uu();break;case 27:case 5:ye(f);break;case 4:ce(f,f.stateNode.containerInfo);break;case 10:Vl(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,ey(f),null;break;case 13:var E=f.memoizedState;if(E!==null)return E.dehydrated!==null?(Vc(f),f.flags|=128,null):(y&f.child.childLanes)!==0?Pr(l,f,y):(Vc(f),l=Ro(l,f,y),l!==null?l.sibling:null);Vc(f);break;case 19:var L=(l.flags&128)!==0;if(E=(y&f.childLanes)!==0,E||(Oc(l,f,y,!1),E=(y&f.childLanes)!==0),L){if(E)return tp(l,f,y);f.flags|=128}if(L=f.memoizedState,L!==null&&(L.rendering=null,L.tail=null,L.lastEffect=null),ie(sa,sa.current),E)break;return null;case 22:return f.lanes=0,Rr(l,f,y,f.pendingProps);case 24:Vl(f,hn,l.memoizedState.cache)}return Ro(l,f,y)}function h0(l,f,y){if(l!==null)if(l.memoizedProps!==f.pendingProps)Ki=!0;else{if(!Hc(l,y)&&(f.flags&128)===0)return Ki=!1,np(l,f,y);Ki=(l.flags&131072)!==0}else Ki=!1,ni&&(f.flags&1048576)!==0&&Uv(f,Gd,f.index);switch(f.lanes=0,f.tag){case 16:e:{var E=f.pendingProps;if(l=Vu(f.elementType),f.type=l,typeof l=="function")Ns(l)?(E=ss(l,E),f.tag=1,f=rs(null,f,l,E,y)):(f.tag=0,f=tf(null,f,l,E,y));else{if(l!=null){var L=l.$$typeof;if(L===A){f.tag=11,f=Yh(null,f,l,E,y);break e}else if(L===D){f.tag=14,f=Zh(null,f,l,E,y);break e}}throw f=k(l)||l,Error(i(306,f,""))}}return f;case 0:return tf(l,f,f.type,f.pendingProps,y);case 1:return E=f.type,L=ss(E,f.pendingProps),rs(l,f,E,L,y);case 3:e:{if(ce(f,f.stateNode.containerInfo),l===null)throw Error(i(387));E=f.pendingProps;var j=f.memoizedState;L=j.element,Yv(l,f),Hu(f,E,null,y);var Q=f.memoizedState;if(E=Q.cache,Vl(f,hn,E),E!==j.cache&&Km(f,[hn],y,!0),Vh(),E=Q.element,j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:Q.cache},f.updateQueue.baseState=j,f.memoizedState=j,f.flags&256){f=di(l,f,E,y);break e}else if(E!==L){L=Gs(Error(i(424)),f),Ih(L),f=di(l,f,E,y);break e}else{switch(l=f.stateNode.containerInfo,l.nodeType){case 9:l=l.body;break;default:l=l.nodeName==="HTML"?l.ownerDocument.body:l}for(ji=ul(l.firstChild),ka=f,ni=!0,jl=null,Ha=!0,y=kx(f,null,E,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling}else{if(Uu(),E===L){f=Ro(l,f,y);break e}oa(l,f,E,y)}f=f.child}return f;case 26:return Ao(l,f),l===null?(y=mR(f.type,null,f.pendingProps,null))?f.memoizedState=y:ni||(y=f.type,l=f.pendingProps,E=_2(se.current).createElement(y),E[vt]=f,E[Ot]=l,Is(E,y,l),yt(E),f.stateNode=E):f.memoizedState=mR(f.type,l.memoizedProps,f.pendingProps,l.memoizedState),null;case 27:return ye(f),l===null&&ni&&(E=f.stateNode=fR(f.type,f.pendingProps,se.current),ka=f,Ha=!0,L=ji,df(f.type)?(R4=L,ji=ul(E.firstChild)):ji=L),oa(l,f,f.pendingProps.children,y),Ao(l,f),l===null&&(f.flags|=4194304),f.child;case 5:return l===null&&ni&&((L=E=ji)&&(E=hW(E,f.type,f.pendingProps,Ha),E!==null?(f.stateNode=E,ka=f,ji=ul(E.firstChild),Ha=!1,L=!0):L=!1),L||Zn(f)),ye(f),L=f.type,j=f.pendingProps,Q=l!==null?l.memoizedProps:null,E=j.children,E4(L,j)?E=null:Q!==null&&E4(L,Q)&&(f.flags|=32),f.memoizedState!==null&&(L=ny(l,f,r4,null,null,y),Iy._currentValue=L),Ao(l,f),oa(l,f,E,y),f.child;case 6:return l===null&&ni&&((l=y=ji)&&(y=pW(y,f.pendingProps,Ha),y!==null?(f.stateNode=y,ka=f,ji=null,l=!0):l=!1),l||Zn(f)),null;case 13:return Pr(l,f,y);case 4:return ce(f,f.stateNode.containerInfo),E=f.pendingProps,l===null?f.child=ku(f,null,E,y):oa(l,f,E,y),f.child;case 11:return Yh(l,f,f.type,f.pendingProps,y);case 7:return oa(l,f,f.pendingProps,y),f.child;case 8:return oa(l,f,f.pendingProps.children,y),f.child;case 12:return oa(l,f,f.pendingProps.children,y),f.child;case 10:return E=f.pendingProps,Vl(f,f.type,E.value),oa(l,f,E.children,y),f.child;case 9:return L=f.type._context,E=f.pendingProps.children,ju(f),L=$a(L),E=E(L),f.flags|=1,oa(l,f,E,y),f.child;case 14:return Zh(l,f,f.type,f.pendingProps,y);case 15:return Ar(l,f,f.type,f.pendingProps,y);case 19:return tp(l,f,y);case 31:return Qh(l,f,y);case 22:return Rr(l,f,y,f.pendingProps);case 24:return ju(f),E=$a(hn),l===null?(L=el(),L===null&&(L=Mi,j=Hv(),L.pooledCache=j,j.refCount++,j!==null&&(L.pooledCacheLanes|=y),L=j),f.memoizedState={parent:E,cache:L},qv(f),Vl(f,hn,L)):((l.lanes&y)!==0&&(Yv(l,f),Hu(f,null,null,y),Vh()),L=l.memoizedState,j=f.memoizedState,L.parent!==E?(L={parent:E,cache:E},f.memoizedState=L,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=L),Vl(f,hn,E)):(E=j.cache,Vl(f,hn,E),E!==L.cache&&Km(f,[hn],y,!0))),oa(l,f,f.pendingProps.children,y),f.child;case 29:throw f.pendingProps}throw Error(i(156,f.tag))}function Ys(l){l.flags|=4}function $c(l,f,y,E,L){if((f=(l.mode&32)!==0)&&(f=!1),f){if(l.flags|=16777216,(L&335544128)===L)if(l.stateNode.complete)l.flags|=8192;else if(It())l.flags|=8192;else throw yn=Uh,Bh}else l.flags&=-16777217}function Xl(l,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)l.flags&=-16777217;else if(l.flags|=16777216,!xR(f))if(It())l.flags|=8192;else throw yn=Uh,Bh}function sf(l,f){f!==null&&(l.flags|=4),l.flags&16384&&(f=l.tag!==22?Xt():536870912,l.lanes|=f,Ir|=f)}function ip(l,f){if(!ni)switch(l.tailMode){case"hidden":f=l.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?l.tail=null:y.sibling=null;break;case"collapsed":y=l.tail;for(var E=null;y!==null;)y.alternate!==null&&(E=y),y=y.sibling;E===null?f||l.tail===null?l.tail=null:l.tail.sibling=null:E.sibling=null}}function Ni(l){var f=l.alternate!==null&&l.alternate.child===l.child,y=0,E=0;if(f)for(var L=l.child;L!==null;)y|=L.lanes|L.childLanes,E|=L.subtreeFlags&65011712,E|=L.flags&65011712,L.return=l,L=L.sibling;else for(L=l.child;L!==null;)y|=L.lanes|L.childLanes,E|=L.subtreeFlags,E|=L.flags,L.return=l,L=L.sibling;return l.subtreeFlags|=E,l.childLanes=y,f}function Ty(l,f,y){var E=f.pendingProps;switch(Lc(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ni(f),null;case 1:return Ni(f),null;case 3:return y=f.stateNode,E=null,l!==null&&(E=l.memoizedState.cache),f.memoizedState.cache!==E&&(f.flags|=2048),qr(hn),pe(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(l===null||l.child===null)&&(Bu(f)?Ys(f):l===null||l.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,jv())),Ni(f),null;case 26:var L=f.type,j=f.memoizedState;return l===null?(Ys(f),j!==null?(Ni(f),Xl(f,j)):(Ni(f),$c(f,L,null,E,y))):j?j!==l.memoizedState?(Ys(f),Ni(f),Xl(f,j)):(Ni(f),f.flags&=-16777217):(l=l.memoizedProps,l!==E&&Ys(f),Ni(f),$c(f,L,l,E,y)),null;case 27:if(_e(f),y=se.current,L=f.type,l!==null&&f.stateNode!=null)l.memoizedProps!==E&&Ys(f);else{if(!E){if(f.stateNode===null)throw Error(i(166));return Ni(f),null}l=Z.current,Bu(f)?Wm(f):(l=fR(L,E,y),f.stateNode=l,Ys(f))}return Ni(f),null;case 5:if(_e(f),L=f.type,l!==null&&f.stateNode!=null)l.memoizedProps!==E&&Ys(f);else{if(!E){if(f.stateNode===null)throw Error(i(166));return Ni(f),null}if(j=Z.current,Bu(f))Wm(f);else{var Q=_2(se.current);switch(j){case 1:j=Q.createElementNS("http://www.w3.org/2000/svg",L);break;case 2:j=Q.createElementNS("http://www.w3.org/1998/Math/MathML",L);break;default:switch(L){case"svg":j=Q.createElementNS("http://www.w3.org/2000/svg",L);break;case"math":j=Q.createElementNS("http://www.w3.org/1998/Math/MathML",L);break;case"script":j=Q.createElement("div"),j.innerHTML="<script><\/script>",j=j.removeChild(j.firstChild);break;case"select":j=typeof E.is=="string"?Q.createElement("select",{is:E.is}):Q.createElement("select"),E.multiple?j.multiple=!0:E.size&&(j.size=E.size);break;default:j=typeof E.is=="string"?Q.createElement(L,{is:E.is}):Q.createElement(L)}}j[vt]=f,j[Ot]=E;e:for(Q=f.child;Q!==null;){if(Q.tag===5||Q.tag===6)j.appendChild(Q.stateNode);else if(Q.tag!==4&&Q.tag!==27&&Q.child!==null){Q.child.return=Q,Q=Q.child;continue}if(Q===f)break e;for(;Q.sibling===null;){if(Q.return===null||Q.return===f)break e;Q=Q.return}Q.sibling.return=Q.return,Q=Q.sibling}f.stateNode=j;e:switch(Is(j,L,E),L){case"button":case"input":case"select":case"textarea":E=!!E.autoFocus;break e;case"img":E=!0;break e;default:E=!1}E&&Ys(f)}}return Ni(f),$c(f,f.type,l===null?null:l.memoizedProps,f.pendingProps,y),null;case 6:if(l&&f.stateNode!=null)l.memoizedProps!==E&&Ys(f);else{if(typeof E!="string"&&f.stateNode===null)throw Error(i(166));if(l=se.current,Bu(f)){if(l=f.stateNode,y=f.memoizedProps,E=null,L=ka,L!==null)switch(L.tag){case 27:case 5:E=L.memoizedProps}l[vt]=f,l=!!(l.nodeValue===y||E!==null&&E.suppressHydrationWarning===!0||tR(l.nodeValue,y)),l||Zn(f,!0)}else l=_2(l).createTextNode(E),l[vt]=f,f.stateNode=l}return Ni(f),null;case 31:if(y=f.memoizedState,l===null||l.memoizedState!==null){if(E=Bu(f),y!==null){if(l===null){if(!E)throw Error(i(318));if(l=f.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));l[vt]=f}else Uu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Ni(f),l=!1}else y=jv(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=y),l=!0;if(!l)return f.flags&256?(Mr(f),f):(Mr(f),null);if((f.flags&128)!==0)throw Error(i(558))}return Ni(f),null;case 13:if(E=f.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(L=Bu(f),E!==null&&E.dehydrated!==null){if(l===null){if(!L)throw Error(i(318));if(L=f.memoizedState,L=L!==null?L.dehydrated:null,!L)throw Error(i(317));L[vt]=f}else Uu(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Ni(f),L=!1}else L=jv(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=L),L=!0;if(!L)return f.flags&256?(Mr(f),f):(Mr(f),null)}return Mr(f),(f.flags&128)!==0?(f.lanes=y,f):(y=E!==null,l=l!==null&&l.memoizedState!==null,y&&(E=f.child,L=null,E.alternate!==null&&E.alternate.memoizedState!==null&&E.alternate.memoizedState.cachePool!==null&&(L=E.alternate.memoizedState.cachePool.pool),j=null,E.memoizedState!==null&&E.memoizedState.cachePool!==null&&(j=E.memoizedState.cachePool.pool),j!==L&&(E.flags|=2048)),y!==l&&y&&(f.child.flags|=8192),sf(f,f.updateQueue),Ni(f),null);case 4:return pe(),l===null&&b4(f.stateNode.containerInfo),Ni(f),null;case 10:return qr(f.type),Ni(f),null;case 19:if(ee(sa),E=f.memoizedState,E===null)return Ni(f),null;if(L=(f.flags&128)!==0,j=E.rendering,j===null)if(L)ip(E,!1);else{if(Ti!==0||l!==null&&(l.flags&128)!==0)for(l=f.child;l!==null;){if(j=Qm(l),j!==null){for(f.flags|=128,ip(E,!1),l=j.updateQueue,f.updateQueue=l,sf(f,l),f.subtreeFlags=0,l=y,y=f.child;y!==null;)gs(y,l),y=y.sibling;return ie(sa,sa.current&1|2),ni&&Ul(f,E.treeForkCount),f.child}l=l.sibling}E.tail!==null&&te()>zr&&(f.flags|=128,L=!0,ip(E,!1),f.lanes=4194304)}else{if(!L)if(l=Qm(j),l!==null){if(f.flags|=128,L=!0,l=l.updateQueue,f.updateQueue=l,sf(f,l),ip(E,!0),E.tail===null&&E.tailMode==="hidden"&&!j.alternate&&!ni)return Ni(f),null}else 2*te()-E.renderingStartTime>zr&&y!==536870912&&(f.flags|=128,L=!0,ip(E,!1),f.lanes=4194304);E.isBackwards?(j.sibling=f.child,f.child=j):(l=E.last,l!==null?l.sibling=j:f.child=j,E.last=j)}return E.tail!==null?(l=E.tail,E.rendering=l,E.tail=l.sibling,E.renderingStartTime=te(),l.sibling=null,y=sa.current,ie(sa,L?y&1|2:y&1),ni&&Ul(f,E.treeForkCount),l):(Ni(f),null);case 22:case 23:return Mr(f),ys(),E=f.memoizedState!==null,l!==null?l.memoizedState!==null!==E&&(f.flags|=8192):E&&(f.flags|=8192),E?(y&536870912)!==0&&(f.flags&128)===0&&(Ni(f),f.subtreeFlags&6&&(f.flags|=8192)):Ni(f),y=f.updateQueue,y!==null&&sf(f,y.retryQueue),y=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(y=l.memoizedState.cachePool.pool),E=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(E=f.memoizedState.cachePool.pool),E!==y&&(f.flags|=2048),l!==null&&ee(Ic),null;case 24:return y=null,l!==null&&(y=l.memoizedState.cache),f.memoizedState.cache!==y&&(f.flags|=2048),qr(hn),Ni(f),null;case 25:return null;case 30:return null}throw Error(i(156,f.tag))}function p0(l,f){switch(Lc(f),f.tag){case 1:return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 3:return qr(hn),pe(),l=f.flags,(l&65536)!==0&&(l&128)===0?(f.flags=l&-65537|128,f):null;case 26:case 27:case 5:return _e(f),null;case 31:if(f.memoizedState!==null){if(Mr(f),f.alternate===null)throw Error(i(340));Uu()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 13:if(Mr(f),l=f.memoizedState,l!==null&&l.dehydrated!==null){if(f.alternate===null)throw Error(i(340));Uu()}return l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 19:return ee(sa),null;case 4:return pe(),null;case 10:return qr(f.type),null;case 22:case 23:return Mr(f),ys(),l!==null&&ee(Ic),l=f.flags,l&65536?(f.flags=l&-65537|128,f):null;case 24:return qr(hn),null;case 25:return null;default:return null}}function Ku(l,f){switch(Lc(f),f.tag){case 3:qr(hn),pe();break;case 26:case 27:case 5:_e(f);break;case 4:pe();break;case 31:f.memoizedState!==null&&Mr(f);break;case 13:Mr(f);break;case 19:ee(sa);break;case 10:qr(f.type);break;case 22:case 23:Mr(f),ys(),l!==null&&ee(Ic);break;case 24:qr(hn)}}function rl(l,f){try{var y=f.updateQueue,E=y!==null?y.lastEffect:null;if(E!==null){var L=E.next;y=L;do{if((y.tag&l)===l){E=void 0;var j=y.create,Q=y.inst;E=j(),Q.destroy=E}y=y.next}while(y!==L)}}catch(oe){zi(f,f.return,oe)}}function Jr(l,f,y){try{var E=f.updateQueue,L=E!==null?E.lastEffect:null;if(L!==null){var j=L.next;E=j;do{if((E.tag&l)===l){var Q=E.inst,oe=Q.destroy;if(oe!==void 0){Q.destroy=void 0,L=f;var Me=y,Ge=oe;try{Ge()}catch(ht){zi(L,Me,ht)}}}E=E.next}while(E!==j)}}catch(ht){zi(f,f.return,ht)}}function Gc(l){var f=l.updateQueue;if(f!==null){var y=l.stateNode;try{is(f,y)}catch(E){zi(l,l.return,E)}}}function Cy(l,f,y){y.props=ss(l.type,l.memoizedProps),y.state=l.memoizedState;try{y.componentWillUnmount()}catch(E){zi(l,f,E)}}function ol(l,f){try{var y=l.ref;if(y!==null){switch(l.tag){case 26:case 27:case 5:var E=l.stateNode;break;case 30:E=l.stateNode;break;default:E=l.stateNode}typeof y=="function"?l.refCleanup=y(E):y.current=E}}catch(L){zi(l,f,L)}}function Dr(l,f){var y=l.ref,E=l.refCleanup;if(y!==null)if(typeof E=="function")try{E()}catch(L){zi(l,f,L)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(L){zi(l,f,L)}else y.current=null}function Lr(l){var f=l.type,y=l.memoizedProps,E=l.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":y.autoFocus&&E.focus();break e;case"img":y.src?E.src=y.src:y.srcSet&&(E.srcset=y.srcSet)}}catch(L){zi(l,l.return,L)}}function eo(l,f,y){try{var E=l.stateNode;oW(E,l.type,y,f),E[Ot]=f}catch(L){zi(l,l.return,L)}}function Ta(l){return l.tag===5||l.tag===3||l.tag===26||l.tag===27&&df(l.type)||l.tag===4}function ll(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Ta(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(l.tag===27&&df(l.type)||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 Bn(l,f,y){var E=l.tag;if(E===5||E===6)l=l.stateNode,f?(y.nodeType===9?y.body:y.nodeName==="HTML"?y.ownerDocument.body:y).insertBefore(l,f):(f=y.nodeType===9?y.body:y.nodeName==="HTML"?y.ownerDocument.body:y,f.appendChild(l),y=y._reactRootContainer,y!=null||f.onclick!==null||(f.onclick=Ko));else if(E!==4&&(E===27&&df(l.type)&&(y=l.stateNode,f=null),l=l.child,l!==null))for(Bn(l,f,y),l=l.sibling;l!==null;)Bn(l,f,y),l=l.sibling}function yi(l,f,y){var E=l.tag;if(E===5||E===6)l=l.stateNode,f?y.insertBefore(l,f):y.appendChild(l);else if(E!==4&&(E===27&&df(l.type)&&(y=l.stateNode),l=l.child,l!==null))for(yi(l,f,y),l=l.sibling;l!==null;)yi(l,f,y),l=l.sibling}function ma(l){var f=l.stateNode,y=l.memoizedProps;try{for(var E=l.type,L=f.attributes;L.length;)f.removeAttributeNode(L[0]);Is(f,E,y),f[vt]=l,f[Ot]=y}catch(j){zi(l,l.return,j)}}var to=!1,Xi=!1,ql=!1,ap=typeof WeakSet=="function"?WeakSet:Set,la=null;function rf(l,f){if(l=l.containerInfo,S4=A2,l=zm(l),Ud(l)){if("selectionStart"in l)var y={start:l.selectionStart,end:l.selectionEnd};else e:{y=(y=l.ownerDocument)&&y.defaultView||window;var E=y.getSelection&&y.getSelection();if(E&&E.rangeCount!==0){y=E.anchorNode;var L=E.anchorOffset,j=E.focusNode;E=E.focusOffset;try{y.nodeType,j.nodeType}catch{y=null;break e}var Q=0,oe=-1,Me=-1,Ge=0,ht=0,xt=l,qe=null;t:for(;;){for(var st;xt!==y||L!==0&&xt.nodeType!==3||(oe=Q+L),xt!==j||E!==0&&xt.nodeType!==3||(Me=Q+E),xt.nodeType===3&&(Q+=xt.nodeValue.length),(st=xt.firstChild)!==null;)qe=xt,xt=st;for(;;){if(xt===l)break t;if(qe===y&&++Ge===L&&(oe=Q),qe===j&&++ht===E&&(Me=Q),(st=xt.nextSibling)!==null)break;xt=qe,qe=xt.parentNode}xt=st}y=oe===-1||Me===-1?null:{start:oe,end:Me}}else y=null}y=y||{start:0,end:0}}else y=null;for(w4={focusedElem:l,selectionRange:y},A2=!1,la=f;la!==null;)if(f=la,l=f.child,(f.subtreeFlags&1028)!==0&&l!==null)l.return=f,la=l;else for(;la!==null;){switch(f=la,j=f.alternate,l=f.flags,f.tag){case 0:if((l&4)!==0&&(l=f.updateQueue,l=l!==null?l.events:null,l!==null))for(y=0;y<l.length;y++)L=l[y],L.ref.impl=L.nextImpl;break;case 11:case 15:break;case 1:if((l&1024)!==0&&j!==null){l=void 0,y=f,L=j.memoizedProps,j=j.memoizedState,E=y.stateNode;try{var on=ss(y.type,L);l=E.getSnapshotBeforeUpdate(on,j),E.__reactInternalSnapshotBeforeUpdate=l}catch(bn){zi(y,y.return,bn)}}break;case 3:if((l&1024)!==0){if(l=f.stateNode.containerInfo,y=l.nodeType,y===9)T4(l);else if(y===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":T4(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((l&1024)!==0)throw Error(i(163))}if(l=f.sibling,l!==null){l.return=f.return,la=l;break}la=f.return}}function p2(l,f,y){var E=y.flags;switch(y.tag){case 0:case 11:case 15:Yl(l,y),E&4&&rl(5,y);break;case 1:if(Yl(l,y),E&4)if(l=y.stateNode,f===null)try{l.componentDidMount()}catch(Q){zi(y,y.return,Q)}else{var L=ss(y.type,f.memoizedProps);f=f.memoizedState;try{l.componentDidUpdate(L,f,l.__reactInternalSnapshotBeforeUpdate)}catch(Q){zi(y,y.return,Q)}}E&64&&Gc(y),E&512&&ol(y,y.return);break;case 3:if(Yl(l,y),E&64&&(l=y.updateQueue,l!==null)){if(f=null,y.child!==null)switch(y.child.tag){case 27:case 5:f=y.child.stateNode;break;case 1:f=y.child.stateNode}try{is(l,f)}catch(Q){zi(y,y.return,Q)}}break;case 27:f===null&&E&4&&ma(y);case 26:case 5:Yl(l,y),f===null&&E&4&&Lr(y),E&512&&ol(y,y.return);break;case 12:Yl(l,y);break;case 31:Yl(l,y),E&4&&g0(l,y);break;case 13:Yl(l,y),E&4&&Ay(l,y),E&64&&(l=y.memoizedState,l!==null&&(l=l.dehydrated,l!==null&&(y=qG.bind(null,y),mW(l,y))));break;case 22:if(E=y.memoizedState!==null||to,!E){f=f!==null&&f.memoizedState!==null||Xi,L=to;var j=Xi;to=E,(Xi=f)&&!j?Ei(l,y,(y.subtreeFlags&8772)!==0):Yl(l,y),to=L,Xi=j}break;case 30:break;default:Yl(l,y)}}function m0(l){var f=l.alternate;f!==null&&(l.alternate=null,m0(f)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(f=l.stateNode,f!==null&&le(f)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}var fi=null,Ca=!1;function xs(l,f,y){for(y=y.child;y!==null;)Wc(l,f,y),y=y.sibling}function Wc(l,f,y){if(Je&&typeof Je.onCommitFiberUnmount=="function")try{Je.onCommitFiberUnmount(Ye,y)}catch{}switch(y.tag){case 26:Xi||Dr(y,f),xs(l,f,y),y.memoizedState?y.memoizedState.count--:y.stateNode&&(y=y.stateNode,y.parentNode.removeChild(y));break;case 27:Xi||Dr(y,f);var E=fi,L=Ca;df(y.type)&&(fi=y.stateNode,Ca=!1),xs(l,f,y),Dy(y.stateNode),fi=E,Ca=L;break;case 5:Xi||Dr(y,f);case 6:if(E=fi,L=Ca,fi=null,xs(l,f,y),fi=E,Ca=L,fi!==null)if(Ca)try{(fi.nodeType===9?fi.body:fi.nodeName==="HTML"?fi.ownerDocument.body:fi).removeChild(y.stateNode)}catch(j){zi(y,f,j)}else try{fi.removeChild(y.stateNode)}catch(j){zi(y,f,j)}break;case 18:fi!==null&&(Ca?(l=fi,oR(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,y.stateNode),C0(l)):oR(fi,y.stateNode));break;case 4:E=fi,L=Ca,fi=y.stateNode.containerInfo,Ca=!0,xs(l,f,y),fi=E,Ca=L;break;case 0:case 11:case 14:case 15:Jr(2,y,f),Xi||Jr(4,y,f),xs(l,f,y);break;case 1:Xi||(Dr(y,f),E=y.stateNode,typeof E.componentWillUnmount=="function"&&Cy(y,f,E)),xs(l,f,y);break;case 21:xs(l,f,y);break;case 22:Xi=(E=Xi)||y.memoizedState!==null,xs(l,f,y),Xi=E;break;default:xs(l,f,y)}}function g0(l,f){if(f.memoizedState===null&&(l=f.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{C0(l)}catch(y){zi(f,f.return,y)}}}function Ay(l,f){if(f.memoizedState===null&&(l=f.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{C0(l)}catch(y){zi(f,f.return,y)}}function m2(l){switch(l.tag){case 31:case 13:case 19:var f=l.stateNode;return f===null&&(f=l.stateNode=new ap),f;case 22:return l=l.stateNode,f=l._retryCache,f===null&&(f=l._retryCache=new ap),f;default:throw Error(i(435,l.tag))}}function ga(l,f){var y=m2(l);f.forEach(function(E){if(!y.has(E)){y.add(E);var L=YG.bind(null,l,E);E.then(L,L)}})}function _s(l,f){var y=f.deletions;if(y!==null)for(var E=0;E<y.length;E++){var L=y[E],j=l,Q=f,oe=Q;e:for(;oe!==null;){switch(oe.tag){case 27:if(df(oe.type)){fi=oe.stateNode,Ca=!1;break e}break;case 5:fi=oe.stateNode,Ca=!1;break e;case 3:case 4:fi=oe.stateNode.containerInfo,Ca=!0;break e}oe=oe.return}if(fi===null)throw Error(i(160));Wc(j,Q,L),fi=null,Ca=!1,j=L.alternate,j!==null&&(j.return=null),L.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)Kc(f,l),f=f.sibling}var Zs=null;function Kc(l,f){var y=l.alternate,E=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:_s(f,l),ca(l),E&4&&(Jr(3,l,l.return),rl(3,l),Jr(5,l,l.return));break;case 1:_s(f,l),ca(l),E&512&&(Xi||y===null||Dr(y,y.return)),E&64&&to&&(l=l.updateQueue,l!==null&&(E=l.callbacks,E!==null&&(y=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=y===null?E:y.concat(E))));break;case 26:var L=Zs;if(_s(f,l),ca(l),E&512&&(Xi||y===null||Dr(y,y.return)),E&4){var j=y!==null?y.memoizedState:null;if(E=l.memoizedState,y===null)if(E===null)if(l.stateNode===null){e:{E=l.type,y=l.memoizedProps,L=L.ownerDocument||L;t:switch(E){case"title":j=L.getElementsByTagName("title")[0],(!j||j[Fn]||j[vt]||j.namespaceURI==="http://www.w3.org/2000/svg"||j.hasAttribute("itemprop"))&&(j=L.createElement(E),L.head.insertBefore(j,L.querySelector("head > title"))),Is(j,E,y),j[vt]=l,yt(j),E=j;break e;case"link":var Q=yR("link","href",L).get(E+(y.href||""));if(Q){for(var oe=0;oe<Q.length;oe++)if(j=Q[oe],j.getAttribute("href")===(y.href==null||y.href===""?null:y.href)&&j.getAttribute("rel")===(y.rel==null?null:y.rel)&&j.getAttribute("title")===(y.title==null?null:y.title)&&j.getAttribute("crossorigin")===(y.crossOrigin==null?null:y.crossOrigin)){Q.splice(oe,1);break t}}j=L.createElement(E),Is(j,E,y),L.head.appendChild(j);break;case"meta":if(Q=yR("meta","content",L).get(E+(y.content||""))){for(oe=0;oe<Q.length;oe++)if(j=Q[oe],j.getAttribute("content")===(y.content==null?null:""+y.content)&&j.getAttribute("name")===(y.name==null?null:y.name)&&j.getAttribute("property")===(y.property==null?null:y.property)&&j.getAttribute("http-equiv")===(y.httpEquiv==null?null:y.httpEquiv)&&j.getAttribute("charset")===(y.charSet==null?null:y.charSet)){Q.splice(oe,1);break t}}j=L.createElement(E),Is(j,E,y),L.head.appendChild(j);break;default:throw Error(i(468,E))}j[vt]=l,yt(j),E=j}l.stateNode=E}else bR(L,l.type,l.stateNode);else l.stateNode=vR(L,E,l.memoizedProps);else j!==E?(j===null?y.stateNode!==null&&(y=y.stateNode,y.parentNode.removeChild(y)):j.count--,E===null?bR(L,l.type,l.stateNode):vR(L,E,l.memoizedProps)):E===null&&l.stateNode!==null&&eo(l,l.memoizedProps,y.memoizedProps)}break;case 27:_s(f,l),ca(l),E&512&&(Xi||y===null||Dr(y,y.return)),y!==null&&E&4&&eo(l,l.memoizedProps,y.memoizedProps);break;case 5:if(_s(f,l),ca(l),E&512&&(Xi||y===null||Dr(y,y.return)),l.flags&32){L=l.stateNode;try{Cu(L,"")}catch(on){zi(l,l.return,on)}}E&4&&l.stateNode!=null&&(L=l.memoizedProps,eo(l,L,y!==null?y.memoizedProps:L)),E&1024&&(ql=!0);break;case 6:if(_s(f,l),ca(l),E&4){if(l.stateNode===null)throw Error(i(162));E=l.memoizedProps,y=l.stateNode;try{y.nodeValue=E}catch(on){zi(l,l.return,on)}}break;case 3:if(E2=null,L=Zs,Zs=S2(f.containerInfo),_s(f,l),Zs=L,ca(l),E&4&&y!==null&&y.memoizedState.isDehydrated)try{C0(f.containerInfo)}catch(on){zi(l,l.return,on)}ql&&(ql=!1,g2(l));break;case 4:E=Zs,Zs=S2(l.stateNode.containerInfo),_s(f,l),ca(l),Zs=E;break;case 12:_s(f,l),ca(l);break;case 31:_s(f,l),ca(l),E&4&&(E=l.updateQueue,E!==null&&(l.updateQueue=null,ga(l,E)));break;case 13:_s(f,l),ca(l),l.child.flags&8192&&l.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(Jl=te()),E&4&&(E=l.updateQueue,E!==null&&(l.updateQueue=null,ga(l,E)));break;case 22:L=l.memoizedState!==null;var Me=y!==null&&y.memoizedState!==null,Ge=to,ht=Xi;if(to=Ge||L,Xi=ht||Me,_s(f,l),Xi=ht,to=Ge,ca(l),E&8192)e:for(f=l.stateNode,f._visibility=L?f._visibility&-2:f._visibility|1,L&&(y===null||Me||to||Xi||Xu(l)),y=null,f=l;;){if(f.tag===5||f.tag===26){if(y===null){Me=y=f;try{if(j=Me.stateNode,L)Q=j.style,typeof Q.setProperty=="function"?Q.setProperty("display","none","important"):Q.display="none";else{oe=Me.stateNode;var xt=Me.memoizedProps.style,qe=xt!=null&&xt.hasOwnProperty("display")?xt.display:null;oe.style.display=qe==null||typeof qe=="boolean"?"":(""+qe).trim()}}catch(on){zi(Me,Me.return,on)}}}else if(f.tag===6){if(y===null){Me=f;try{Me.stateNode.nodeValue=L?"":Me.memoizedProps}catch(on){zi(Me,Me.return,on)}}}else if(f.tag===18){if(y===null){Me=f;try{var st=Me.stateNode;L?lR(st,!0):lR(Me.stateNode,!1)}catch(on){zi(Me,Me.return,on)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===l)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===l)break e;for(;f.sibling===null;){if(f.return===null||f.return===l)break e;y===f&&(y=null),f=f.return}y===f&&(y=null),f.sibling.return=f.return,f=f.sibling}E&4&&(E=l.updateQueue,E!==null&&(y=E.retryQueue,y!==null&&(E.retryQueue=null,ga(l,y))));break;case 19:_s(f,l),ca(l),E&4&&(E=l.updateQueue,E!==null&&(l.updateQueue=null,ga(l,E)));break;case 30:break;case 21:break;default:_s(f,l),ca(l)}}function ca(l){var f=l.flags;if(f&2){try{for(var y,E=l.return;E!==null;){if(Ta(E)){y=E;break}E=E.return}if(y==null)throw Error(i(160));switch(y.tag){case 27:var L=y.stateNode,j=ll(l);yi(l,j,L);break;case 5:var Q=y.stateNode;y.flags&32&&(Cu(Q,""),y.flags&=-33);var oe=ll(l);yi(l,oe,Q);break;case 3:case 4:var Me=y.stateNode.containerInfo,Ge=ll(l);Bn(l,Ge,Me);break;default:throw Error(i(161))}}catch(ht){zi(l,l.return,ht)}l.flags&=-3}f&4096&&(l.flags&=-4097)}function g2(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var f=l;g2(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),l=l.sibling}}function Yl(l,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)p2(l,f.alternate,f),f=f.sibling}function Xu(l){for(l=l.child;l!==null;){var f=l;switch(f.tag){case 0:case 11:case 14:case 15:Jr(4,f,f.return),Xu(f);break;case 1:Dr(f,f.return);var y=f.stateNode;typeof y.componentWillUnmount=="function"&&Cy(f,f.return,y),Xu(f);break;case 27:Dy(f.stateNode);case 26:case 5:Dr(f,f.return),Xu(f);break;case 22:f.memoizedState===null&&Xu(f);break;case 30:Xu(f);break;default:Xu(f)}l=l.sibling}}function Ei(l,f,y){for(y=y&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var E=f.alternate,L=l,j=f,Q=j.flags;switch(j.tag){case 0:case 11:case 15:Ei(L,j,y),rl(4,j);break;case 1:if(Ei(L,j,y),E=j,L=E.stateNode,typeof L.componentDidMount=="function")try{L.componentDidMount()}catch(Ge){zi(E,E.return,Ge)}if(E=j,L=E.updateQueue,L!==null){var oe=E.stateNode;try{var Me=L.shared.hiddenCallbacks;if(Me!==null)for(L.shared.hiddenCallbacks=null,L=0;L<Me.length;L++)nl(Me[L],oe)}catch(Ge){zi(E,E.return,Ge)}}y&&Q&64&&Gc(j),ol(j,j.return);break;case 27:ma(j);case 26:case 5:Ei(L,j,y),y&&E===null&&Q&4&&Lr(j),ol(j,j.return);break;case 12:Ei(L,j,y);break;case 31:Ei(L,j,y),y&&Q&4&&g0(L,j);break;case 13:Ei(L,j,y),y&&Q&4&&Ay(L,j);break;case 22:j.memoizedState===null&&Ei(L,j,y),ol(j,j.return);break;case 30:break;default:Ei(L,j,y)}f=f.sibling}}function v0(l,f){var y=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(y=l.memoizedState.cachePool.pool),l=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(l=f.memoizedState.cachePool.pool),l!==y&&(l!=null&&l.refCount++,y!=null&&ns(y))}function Zl(l,f){l=null,f.alternate!==null&&(l=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==l&&(f.refCount++,l!=null&&ns(l))}function Da(l,f,y,E){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)Qi(l,f,y,E),f=f.sibling}function Qi(l,f,y,E){var L=f.flags;switch(f.tag){case 0:case 11:case 15:Da(l,f,y,E),L&2048&&rl(9,f);break;case 1:Da(l,f,y,E);break;case 3:Da(l,f,y,E),L&2048&&(l=null,f.alternate!==null&&(l=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==l&&(f.refCount++,l!=null&&ns(l)));break;case 12:if(L&2048){Da(l,f,y,E),l=f.stateNode;try{var j=f.memoizedProps,Q=j.id,oe=j.onPostCommit;typeof oe=="function"&&oe(Q,f.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(Me){zi(f,f.return,Me)}}else Da(l,f,y,E);break;case 31:Da(l,f,y,E);break;case 13:Da(l,f,y,E);break;case 23:break;case 22:j=f.stateNode,Q=f.alternate,f.memoizedState!==null?j._visibility&2?Da(l,f,y,E):of(l,f):j._visibility&2?Da(l,f,y,E):(j._visibility|=2,Xc(l,f,y,E,(f.subtreeFlags&10256)!==0||!1)),L&2048&&v0(Q,f);break;case 24:Da(l,f,y,E),L&2048&&Zl(f.alternate,f);break;default:Da(l,f,y,E)}}function Xc(l,f,y,E,L){for(L=L&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var j=l,Q=f,oe=y,Me=E,Ge=Q.flags;switch(Q.tag){case 0:case 11:case 15:Xc(j,Q,oe,Me,L),rl(8,Q);break;case 23:break;case 22:var ht=Q.stateNode;Q.memoizedState!==null?ht._visibility&2?Xc(j,Q,oe,Me,L):of(j,Q):(ht._visibility|=2,Xc(j,Q,oe,Me,L)),L&&Ge&2048&&v0(Q.alternate,Q);break;case 24:Xc(j,Q,oe,Me,L),L&&Ge&2048&&Zl(Q.alternate,Q);break;default:Xc(j,Q,oe,Me,L)}f=f.sibling}}function of(l,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var y=l,E=f,L=E.flags;switch(E.tag){case 22:of(y,E),L&2048&&v0(E.alternate,E);break;case 24:of(y,E),L&2048&&Zl(E.alternate,E);break;default:of(y,E)}f=f.sibling}}var ua=8192;function qu(l,f,y){if(l.subtreeFlags&ua)for(l=l.child;l!==null;)va(l,f,y),l=l.sibling}function va(l,f,y){switch(l.tag){case 26:qu(l,f,y),l.flags&ua&&l.memoizedState!==null&&CW(y,Zs,l.memoizedState,l.memoizedProps);break;case 5:qu(l,f,y);break;case 3:case 4:var E=Zs;Zs=S2(l.stateNode.containerInfo),qu(l,f,y),Zs=E;break;case 22:l.memoizedState===null&&(E=l.alternate,E!==null&&E.memoizedState!==null?(E=ua,ua=16777216,qu(l,f,y),ua=E):qu(l,f,y));break;default:qu(l,f,y)}}function Qs(l){var f=l.alternate;if(f!==null&&(l=f.child,l!==null)){f.child=null;do f=l.sibling,l.sibling=null,l=f;while(l!==null)}}function Ls(l){var f=l.deletions;if((l.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var E=f[y];la=E,sp(E,l)}Qs(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Yu(l),l=l.sibling}function Yu(l){switch(l.tag){case 0:case 11:case 15:Ls(l),l.flags&2048&&Jr(9,l,l.return);break;case 3:Ls(l);break;case 12:Ls(l);break;case 22:var f=l.stateNode;l.memoizedState!==null&&f._visibility&2&&(l.return===null||l.return.tag!==13)?(f._visibility&=-3,y0(l)):Ls(l);break;default:Ls(l)}}function y0(l){var f=l.deletions;if((l.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var E=f[y];la=E,sp(E,l)}Qs(l)}for(l=l.child;l!==null;){switch(f=l,f.tag){case 0:case 11:case 15:Jr(8,f,f.return),y0(f);break;case 22:y=f.stateNode,y._visibility&2&&(y._visibility&=-3,y0(f));break;default:y0(f)}l=l.sibling}}function sp(l,f){for(;la!==null;){var y=la;switch(y.tag){case 0:case 11:case 15:Jr(8,y,f);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var E=y.memoizedState.cachePool.pool;E!=null&&E.refCount++}break;case 24:ns(y.memoizedState.cache)}if(E=y.child,E!==null)E.return=y,la=E;else e:for(y=l;la!==null;){E=la;var L=E.sibling,j=E.return;if(m0(E),E===y){la=null;break e}if(L!==null){L.return=j,la=L;break e}la=j}}}var b0={getCacheForType:function(l){var f=$a(hn),y=f.data.get(l);return y===void 0&&(y=l(),f.data.set(l,y)),y},cacheSignal:function(){return $a(hn).controller.signal}},x0=typeof WeakMap=="function"?WeakMap:Map,ri=0,Mi=null,Un=null,Qn=0,pn=0,Wn=null,Rn=!1,kn=!1,Di=!1,ya=0,Ti=0,Or=0,Ql=0,No=0,oi=0,Ir=0,Po=null,Ss=null,Js=!1,Jl=0,lf=0,zr=1/0,cf=null,cl=null,Ji=0,Do=null,Br=null,no=0,ec=0,Zu=null,_0=null,Qu=0,Ju=null;function Os(){return(ri&2)!==0&&Qn!==0?Qn&-Qn:V.T!==null?m4():Dt()}function m(){if(oi===0)if((Qn&536870912)===0||ni){var l=at;at<<=1,(at&3932160)===0&&(at=262144),oi=l}else oi=536870912;return l=Pa.current,l!==null&&(l.flags|=32),oi}function v(l,f,y){(l===Mi&&(pn===2||pn===9)||l.cancelPendingCommit!==null)&&(Fe(l,0),q(l,Qn,oi,!1)),ge(l,y),((ri&2)===0||l!==Mi)&&(l===Mi&&((ri&2)===0&&(Ql|=y),Ti===4&&q(l,Qn,oi,!1)),qc(l))}function T(l,f,y){if((ri&6)!==0)throw Error(i(327));var E=!y&&(f&127)===0&&(f&l.expiredLanes)===0||Nt(l,f),L=E?ed(l,f):er(l,f,!0),j=E;do{if(L===0){kn&&!E&&q(l,f,0,!1);break}else{if(y=l.current.alternate,j&&!F(y)){L=er(l,f,!1),j=!1;continue}if(L===2){if(j=f,l.errorRecoveryDisabledLanes&j)var Q=0;else Q=l.pendingLanes&-536870913,Q=Q!==0?Q:Q&536870912?536870912:0;if(Q!==0){f=Q;e:{var oe=l;L=Po;var Me=oe.current.memoizedState.isDehydrated;if(Me&&(Fe(oe,Q).flags|=256),Q=er(oe,Q,!1),Q!==2){if(Di&&!Me){oe.errorRecoveryDisabledLanes|=j,Ql|=j,L=4;break e}j=Ss,Ss=L,j!==null&&(Ss===null?Ss=j:Ss.push.apply(Ss,j))}L=Q}if(j=!1,L!==2)continue}}if(L===1){Fe(l,0),q(l,f,0,!0);break}e:{switch(E=l,j=L,j){case 0:case 1:throw Error(i(345));case 4:if((f&4194048)!==f)break;case 6:q(E,f,oi,!Rn);break e;case 2:Ss=null;break;case 3:case 5:break;default:throw Error(i(329))}if((f&62914560)===f&&(L=Jl+300-te(),10<L)){if(q(E,f,oi,!Rn),it(E,0,!0)!==0)break e;no=f,E.timeoutHandle=sR(O.bind(null,E,y,Ss,cf,Js,f,oi,Ql,Ir,Rn,j,"Throttled",-0,0),L);break e}O(E,y,Ss,cf,Js,f,oi,Ql,Ir,Rn,j,null,-0,0)}}break}while(!0);qc(l)}function O(l,f,y,E,L,j,Q,oe,Me,Ge,ht,xt,qe,st){if(l.timeoutHandle=-1,xt=f.subtreeFlags,xt&8192||(xt&16785408)===16785408){xt={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ko},va(f,j,xt);var on=(j&62914560)===j?Jl-te():(j&4194048)===j?lf-te():0;if(on=AW(xt,on),on!==null){no=j,l.cancelPendingCommit=on(Sn.bind(null,l,f,j,y,E,L,Q,oe,Me,ht,xt,null,qe,st)),q(l,j,Q,!Ge);return}}Sn(l,f,j,y,E,L,Q,oe,Me)}function F(l){for(var f=l;;){var y=f.tag;if((y===0||y===11||y===15)&&f.flags&16384&&(y=f.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var E=0;E<y.length;E++){var L=y[E],j=L.getSnapshot;L=L.value;try{if(!Wi(j(),L))return!1}catch{return!1}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===l)break;for(;f.sibling===null;){if(f.return===null||f.return===l)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function q(l,f,y,E){f&=~No,f&=~Ql,l.suspendedLanes|=f,l.pingedLanes&=~f,E&&(l.warmLanes|=f),E=l.expirationTimes;for(var L=f;0<L;){var j=31-wt(L),Q=1<<j;E[j]=-1,L&=~Q}y!==0&&De(l,y,f)}function de(){return(ri&6)===0?(Ry(0),!1):!0}function Ee(){if(Un!==null){if(pn===0)var l=Un.return;else l=Un,vs=Fl=null,sy(l),Bc=null,Uc=0,l=Un;for(;l!==null;)Ku(l.alternate,l),l=l.return;Un=null}}function Fe(l,f){var y=l.timeoutHandle;y!==-1&&(l.timeoutHandle=-1,uW(y)),y=l.cancelPendingCommit,y!==null&&(l.cancelPendingCommit=null,y()),no=0,Ee(),Mi=l,Un=y=Yo(l.current,null),Qn=f,pn=0,Wn=null,Rn=!1,kn=Nt(l,f),Di=!1,Ir=oi=No=Ql=Or=Ti=0,Ss=Po=null,Js=!1,(f&8)!==0&&(f|=f&32);var E=l.entangledLanes;if(E!==0)for(l=l.entanglements,E&=f;0<E;){var L=31-wt(E),j=1<<L;f|=l[L],E&=~j}return ya=f,Nc(),y}function gt(l,f){_n=null,V.H=Kh,f===zc||f===To?(f=qm(),pn=3):f===Bh?(f=qm(),pn=4):pn=f===f0?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Wn=f,Un===null&&(Ti=1,d0(l,Gs(f,l.current)))}function It(){var l=Pa.current;return l===null?!0:(Qn&4194048)===Qn?Yr===null:(Qn&62914560)===Qn||(Qn&536870912)!==0?l===Yr:!1}function $t(){var l=V.H;return V.H=Kh,l===null?Kh:l}function Kt(){var l=V.A;return V.A=b0,l}function Cn(){Ti=4,Rn||(Qn&4194048)!==Qn&&Pa.current!==null||(kn=!0),(Or&134217727)===0&&(Ql&134217727)===0||Mi===null||q(Mi,Qn,oi,!1)}function er(l,f,y){var E=ri;ri|=2;var L=$t(),j=Kt();(Mi!==l||Qn!==f)&&(cf=null,Fe(l,f)),f=!1;var Q=Ti;e:do try{if(pn!==0&&Un!==null){var oe=Un,Me=Wn;switch(pn){case 8:Ee(),Q=6;break e;case 3:case 2:case 9:case 6:Pa.current===null&&(f=!0);var Ge=pn;if(pn=0,Wn=null,At(l,oe,Me,Ge),y&&kn){Q=0;break e}break;default:Ge=pn,pn=0,Wn=null,At(l,oe,Me,Ge)}}rp(),Q=Ti;break}catch(ht){gt(l,ht)}while(!0);return f&&l.shellSuspendCounter++,vs=Fl=null,ri=E,V.H=L,V.A=j,Un===null&&(Mi=null,Qn=0,Nc()),Q}function rp(){for(;Un!==null;)Ue(Un)}function ed(l,f){var y=ri;ri|=2;var E=$t(),L=Kt();Mi!==l||Qn!==f?(cf=null,zr=te()+500,Fe(l,f)):kn=Nt(l,f);e:do try{if(pn!==0&&Un!==null){f=Un;var j=Wn;t:switch(pn){case 1:pn=0,Wn=null,At(l,f,j,1);break;case 2:case 9:if(Vx(j)){pn=0,Wn=null,Qe(f);break}f=function(){pn!==2&&pn!==9||Mi!==l||(pn=7),qc(l)},j.then(f,f);break e;case 3:pn=7;break e;case 4:pn=5;break e;case 7:Vx(j)?(pn=0,Wn=null,Qe(f)):(pn=0,Wn=null,At(l,f,j,7));break;case 5:var Q=null;switch(Un.tag){case 26:Q=Un.memoizedState;case 5:case 27:var oe=Un;if(Q?xR(Q):oe.stateNode.complete){pn=0,Wn=null;var Me=oe.sibling;if(Me!==null)Un=Me;else{var Ge=oe.return;Ge!==null?(Un=Ge,dn(Ge)):Un=null}break t}}pn=0,Wn=null,At(l,f,j,5);break;case 6:pn=0,Wn=null,At(l,f,j,6);break;case 8:Ee(),Ti=6;break e;default:throw Error(i(462))}}Xe();break}catch(ht){gt(l,ht)}while(!0);return vs=Fl=null,V.H=E,V.A=L,ri=y,Un!==null?0:(Mi=null,Qn=0,Nc(),Ti)}function Xe(){for(;Un!==null&&!tt();)Ue(Un)}function Ue(l){var f=h0(l.alternate,l,ya);l.memoizedProps=l.pendingProps,f===null?dn(l):Un=f}function Qe(l){var f=l,y=f.alternate;switch(f.tag){case 15:case 0:f=bs(y,f,f.pendingProps,f.type,void 0,Qn);break;case 11:f=bs(y,f,f.pendingProps,f.type.render,f.ref,Qn);break;case 5:sy(f);default:Ku(y,f),f=Un=gs(f,ya),f=h0(y,f,ya)}l.memoizedProps=l.pendingProps,f===null?dn(l):Un=f}function At(l,f,y,E){vs=Fl=null,sy(f),Bc=null,Uc=0;var L=f.return;try{if(Cr(l,L,f,y,Qn)){Ti=1,d0(l,Gs(y,l.current)),Un=null;return}}catch(j){if(L!==null)throw Un=L,j;Ti=1,d0(l,Gs(y,l.current)),Un=null;return}f.flags&32768?(ni||E===1?l=!0:kn||(Qn&536870912)!==0?l=!1:(Rn=l=!0,(E===2||E===9||E===3||E===6)&&(E=Pa.current,E!==null&&E.tag===13&&(E.flags|=16384))),Fi(f,l)):dn(f)}function dn(l){var f=l;do{if((f.flags&32768)!==0){Fi(f,Rn);return}l=f.return;var y=Ty(f.alternate,f,ya);if(y!==null){Un=y;return}if(f=f.sibling,f!==null){Un=f;return}Un=f=l}while(f!==null);Ti===0&&(Ti=5)}function Fi(l,f){do{var y=p0(l.alternate,l);if(y!==null){y.flags&=32767,Un=y;return}if(y=l.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!f&&(l=l.sibling,l!==null)){Un=l;return}Un=l=y}while(l!==null);Ti=6,Un=null}function Sn(l,f,y,E,L,j,Q,oe,Me){l.cancelPendingCommit=null;do S0();while(Ji!==0);if((ri&6)!==0)throw Error(i(327));if(f!==null){if(f===l.current)throw Error(i(177));if(j=f.lanes|f.childLanes,j|=Vm,Se(l,y,j,Q,oe,Me),l===Mi&&(Un=Mi=null,Qn=0),Br=f,Do=l,no=y,ec=j,Zu=L,_0=E,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,ZG(Pe,function(){return k6(),null})):(l.callbackNode=null,l.callbackPriority=0),E=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||E){E=V.T,V.T=null,L=H.p,H.p=2,Q=ri,ri|=4;try{rf(l,f,y)}finally{ri=Q,H.p=L,V.T=E}}Ji=1,hi(),La(),pi()}}function hi(){if(Ji===1){Ji=0;var l=Do,f=Br,y=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||y){y=V.T,V.T=null;var E=H.p;H.p=2;var L=ri;ri|=4;try{Kc(f,l);var j=w4,Q=zm(l.containerInfo),oe=j.focusedElem,Me=j.selectionRange;if(Q!==oe&&oe&&oe.ownerDocument&&Im(oe.ownerDocument.documentElement,oe)){if(Me!==null&&Ud(oe)){var Ge=Me.start,ht=Me.end;if(ht===void 0&&(ht=Ge),"selectionStart"in oe)oe.selectionStart=Ge,oe.selectionEnd=Math.min(ht,oe.value.length);else{var xt=oe.ownerDocument||document,qe=xt&&xt.defaultView||window;if(qe.getSelection){var st=qe.getSelection(),on=oe.textContent.length,bn=Math.min(Me.start,on),ki=Me.end===void 0?bn:Math.min(Me.end,on);!st.extend&&bn>ki&&(Q=ki,ki=bn,bn=Q);var je=Ov(oe,bn),Ne=Ov(oe,ki);if(je&&Ne&&(st.rangeCount!==1||st.anchorNode!==je.node||st.anchorOffset!==je.offset||st.focusNode!==Ne.node||st.focusOffset!==Ne.offset)){var $e=xt.createRange();$e.setStart(je.node,je.offset),st.removeAllRanges(),bn>ki?(st.addRange($e),st.extend(Ne.node,Ne.offset)):($e.setEnd(Ne.node,Ne.offset),st.addRange($e))}}}}for(xt=[],st=oe;st=st.parentNode;)st.nodeType===1&&xt.push({element:st,left:st.scrollLeft,top:st.scrollTop});for(typeof oe.focus=="function"&&oe.focus(),oe=0;oe<xt.length;oe++){var bt=xt[oe];bt.element.scrollLeft=bt.left,bt.element.scrollTop=bt.top}}A2=!!S4,w4=S4=null}finally{ri=L,H.p=E,V.T=y}}l.current=f,Ji=2}}function La(){if(Ji===2){Ji=0;var l=Do,f=Br,y=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||y){y=V.T,V.T=null;var E=H.p;H.p=2;var L=ri;ri|=4;try{p2(l,f.alternate,f)}finally{ri=L,H.p=E,V.T=y}}Ji=3}}function pi(){if(Ji===4||Ji===3){Ji=0,re();var l=Do,f=Br,y=no,E=_0;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?Ji=5:(Ji=0,Br=Do=null,tc(l,l.pendingLanes));var L=l.pendingLanes;if(L===0&&(cl=null),Ut(y),f=f.stateNode,Je&&typeof Je.onCommitFiberRoot=="function")try{Je.onCommitFiberRoot(Ye,f,void 0,(f.current.flags&128)===128)}catch{}if(E!==null){f=V.T,L=H.p,H.p=2,V.T=null;try{for(var j=l.onRecoverableError,Q=0;Q<E.length;Q++){var oe=E[Q];j(oe.value,{componentStack:oe.stack})}}finally{V.T=f,H.p=L}}(no&3)!==0&&S0(),qc(l),L=l.pendingLanes,(y&261930)!==0&&(L&42)!==0?l===Ju?Qu++:(Qu=0,Ju=l):Qu=0,Ry(0)}}function tc(l,f){(l.pooledCacheLanes&=f)===0&&(f=l.pooledCache,f!=null&&(l.pooledCache=null,ns(f)))}function S0(){return hi(),La(),pi(),k6()}function k6(){if(Ji!==5)return!1;var l=Do,f=ec;ec=0;var y=Ut(no),E=V.T,L=H.p;try{H.p=32>y?32:y,V.T=null,y=Zu,Zu=null;var j=Do,Q=no;if(Ji=0,Br=Do=null,no=0,(ri&6)!==0)throw Error(i(331));var oe=ri;if(ri|=4,Yu(j.current),Qi(j,j.current,Q,y),ri=oe,Ry(0,!1),Je&&typeof Je.onPostCommitFiberRoot=="function")try{Je.onPostCommitFiberRoot(Ye,j)}catch{}return!0}finally{H.p=L,V.T=E,tc(l,f)}}function H6(l,f,y){f=Gs(y,f),f=My(l.stateNode,f,2),l=$l(l,f,2),l!==null&&(ge(l,2),qc(l))}function zi(l,f,y){if(l.tag===3)H6(l,l,y);else for(;f!==null;){if(f.tag===3){H6(f,l,y);break}else if(f.tag===1){var E=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof E.componentDidCatch=="function"&&(cl===null||!cl.has(E))){l=Gs(y,l),y=ef(2),E=$l(f,y,2),E!==null&&(qs(y,E,f,l),ge(E,2),qc(E));break}}f=f.return}}function f4(l,f,y){var E=l.pingCache;if(E===null){E=l.pingCache=new x0;var L=new Set;E.set(f,L)}else L=E.get(f),L===void 0&&(L=new Set,E.set(f,L));L.has(y)||(Di=!0,L.add(y),l=XG.bind(null,l,f,y),f.then(l,l))}function XG(l,f,y){var E=l.pingCache;E!==null&&E.delete(f),l.pingedLanes|=l.suspendedLanes&y,l.warmLanes&=~y,Mi===l&&(Qn&y)===y&&(Ti===4||Ti===3&&(Qn&62914560)===Qn&&300>te()-Jl?(ri&2)===0&&Fe(l,0):No|=y,Ir===Qn&&(Ir=0)),qc(l)}function $6(l,f){f===0&&(f=Xt()),l=Pc(l,f),l!==null&&(ge(l,f),qc(l))}function qG(l){var f=l.memoizedState,y=0;f!==null&&(y=f.retryLane),$6(l,y)}function YG(l,f){var y=0;switch(l.tag){case 31:case 13:var E=l.stateNode,L=l.memoizedState;L!==null&&(y=L.retryLane);break;case 19:E=l.stateNode;break;case 22:E=l.stateNode._retryCache;break;default:throw Error(i(314))}E!==null&&E.delete(f),$6(l,y)}function ZG(l,f){return Ae(l,f)}var v2=null,w0=null,h4=!1,y2=!1,p4=!1,uf=0;function qc(l){l!==w0&&l.next===null&&(w0===null?v2=w0=l:w0=w0.next=l),y2=!0,h4||(h4=!0,JG())}function Ry(l,f){if(!p4&&y2){p4=!0;do for(var y=!1,E=v2;E!==null;){if(l!==0){var L=E.pendingLanes;if(L===0)var j=0;else{var Q=E.suspendedLanes,oe=E.pingedLanes;j=(1<<31-wt(42|l)+1)-1,j&=L&~(Q&~oe),j=j&201326741?j&201326741|1:j?j|2:0}j!==0&&(y=!0,X6(E,j))}else j=Qn,j=it(E,E===Mi?j:0,E.cancelPendingCommit!==null||E.timeoutHandle!==-1),(j&3)===0||Nt(E,j)||(y=!0,X6(E,j));E=E.next}while(y);p4=!1}}function QG(){G6()}function G6(){y2=h4=!1;var l=0;uf!==0&&cW()&&(l=uf);for(var f=te(),y=null,E=v2;E!==null;){var L=E.next,j=W6(E,f);j===0?(E.next=null,y===null?v2=L:y.next=L,L===null&&(w0=y)):(y=E,(l!==0||(j&3)!==0)&&(y2=!0)),E=L}Ji!==0&&Ji!==5||Ry(l),uf!==0&&(uf=0)}function W6(l,f){for(var y=l.suspendedLanes,E=l.pingedLanes,L=l.expirationTimes,j=l.pendingLanes&-62914561;0<j;){var Q=31-wt(j),oe=1<<Q,Me=L[Q];Me===-1?((oe&y)===0||(oe&E)!==0)&&(L[Q]=kt(oe,f)):Me<=f&&(l.expiredLanes|=oe),j&=~oe}if(f=Mi,y=Qn,y=it(l,l===f?y:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),E=l.callbackNode,y===0||l===f&&(pn===2||pn===9)||l.cancelPendingCommit!==null)return E!==null&&E!==null&&et(E),l.callbackNode=null,l.callbackPriority=0;if((y&3)===0||Nt(l,y)){if(f=y&-y,f===l.callbackPriority)return f;switch(E!==null&&et(E),Ut(y)){case 2:case 8:y=Ie;break;case 32:y=Pe;break;case 268435456:y=We;break;default:y=Pe}return E=K6.bind(null,l),y=Ae(y,E),l.callbackPriority=f,l.callbackNode=y,f}return E!==null&&E!==null&&et(E),l.callbackPriority=2,l.callbackNode=null,2}function K6(l,f){if(Ji!==0&&Ji!==5)return l.callbackNode=null,l.callbackPriority=0,null;var y=l.callbackNode;if(S0()&&l.callbackNode!==y)return null;var E=Qn;return E=it(l,l===Mi?E:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),E===0?null:(T(l,E,f),W6(l,te()),l.callbackNode!=null&&l.callbackNode===y?K6.bind(null,l):null)}function X6(l,f){if(S0())return null;T(l,f,!0)}function JG(){dW(function(){(ri&6)!==0?Ae(Ce,QG):G6()})}function m4(){if(uf===0){var l=Hl;l===0&&(l=pt,pt<<=1,(pt&261888)===0&&(pt=256)),uf=l}return uf}function q6(l){return l==null||typeof l=="symbol"||typeof l=="boolean"?null:typeof l=="function"?l:yh(""+l)}function Y6(l,f){var y=f.ownerDocument.createElement("input");return y.name=f.name,y.value=f.value,l.id&&y.setAttribute("form",l.id),f.parentNode.insertBefore(y,f),l=new FormData(l),y.parentNode.removeChild(y),l}function eW(l,f,y,E,L){if(f==="submit"&&y&&y.stateNode===L){var j=q6((L[Ot]||null).action),Q=E.submitter;Q&&(f=(f=Q[Ot]||null)?q6(f.formAction):Q.getAttribute("formAction"),f!==null&&(j=f,Q=null));var oe=new Sh("action","action",null,E,L);l.push({event:oe,listeners:[{instance:null,listener:function(){if(E.defaultPrevented){if(uf!==0){var Me=Q?Y6(L,Q):new FormData(L);xy(y,{pending:!0,data:Me,method:L.method,action:j},null,Me)}}else typeof j=="function"&&(oe.preventDefault(),Me=Q?Y6(L,Q):new FormData(L),xy(y,{pending:!0,data:Me,method:L.method,action:j},j,Me))},currentTarget:L}]})}}for(var g4=0;g4<Fm.length;g4++){var v4=Fm[g4],tW=v4.toLowerCase(),nW=v4[0].toUpperCase()+v4.slice(1);ms(tW,"on"+nW)}ms($s,"onAnimationEnd"),ms(Iv,"onAnimationIteration"),ms(qo,"onAnimationStart"),ms("dblclick","onDoubleClick"),ms("focusin","onFocus"),ms("focusout","onBlur"),ms(kd,"onTransitionRun"),ms(Ac,"onTransitionStart"),ms(zv,"onTransitionCancel"),ms(jm,"onTransitionEnd"),Tt("onMouseEnter",["mouseout","mouseover"]),Tt("onMouseLeave",["mouseout","mouseover"]),Tt("onPointerEnter",["pointerout","pointerover"]),Tt("onPointerLeave",["pointerout","pointerover"]),Ke("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ke("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ke("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ke("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ke("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ke("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ny="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),iW=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ny));function Z6(l,f){f=(f&4)!==0;for(var y=0;y<l.length;y++){var E=l[y],L=E.event;E=E.listeners;e:{var j=void 0;if(f)for(var Q=E.length-1;0<=Q;Q--){var oe=E[Q],Me=oe.instance,Ge=oe.currentTarget;if(oe=oe.listener,Me!==j&&L.isPropagationStopped())break e;j=oe,L.currentTarget=Ge;try{j(L)}catch(ht){Rc(ht)}L.currentTarget=null,j=Me}else for(Q=0;Q<E.length;Q++){if(oe=E[Q],Me=oe.instance,Ge=oe.currentTarget,oe=oe.listener,Me!==j&&L.isPropagationStopped())break e;j=oe,L.currentTarget=Ge;try{j(L)}catch(ht){Rc(ht)}L.currentTarget=null,j=Me}}}}function ii(l,f){var y=f[Ln];y===void 0&&(y=f[Ln]=new Set);var E=l+"__bubble";y.has(E)||(Q6(f,l,2,!1),y.add(E))}function y4(l,f,y){var E=0;f&&(E|=4),Q6(y,l,E,f)}var b2="_reactListening"+Math.random().toString(36).slice(2);function b4(l){if(!l[b2]){l[b2]=!0,Pt.forEach(function(y){y!=="selectionchange"&&(iW.has(y)||y4(y,!1,l),y4(y,!0,l))});var f=l.nodeType===9?l:l.ownerDocument;f===null||f[b2]||(f[b2]=!0,y4("selectionchange",!1,f))}}function Q6(l,f,y,E){switch(CR(f)){case 2:var L=PW;break;case 8:L=DW;break;default:L=O4}y=L.bind(null,f,y,l),L=void 0,!Mm||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(L=!0),E?L!==void 0?l.addEventListener(f,y,{capture:!0,passive:L}):l.addEventListener(f,y,!0):L!==void 0?l.addEventListener(f,y,{passive:L}):l.addEventListener(f,y,!1)}function x4(l,f,y,E,L){var j=E;if((f&1)===0&&(f&2)===0&&E!==null)e:for(;;){if(E===null)return;var Q=E.tag;if(Q===3||Q===4){var oe=E.stateNode.containerInfo;if(oe===L)break;if(Q===4)for(Q=E.return;Q!==null;){var Me=Q.tag;if((Me===3||Me===4)&&Q.stateNode.containerInfo===L)return;Q=Q.return}for(;oe!==null;){if(Q=Re(oe),Q===null)return;if(Me=Q.tag,Me===5||Me===6||Me===26||Me===27){E=j=Q;continue e}oe=oe.parentNode}}E=E.return}vv(function(){var Ge=j,ht=wm(y),xt=[];e:{var qe=zl.get(l);if(qe!==void 0){var st=Sh,on=l;switch(l){case"keypress":if(Nu(y)===0)break e;case"keydown":case"keyup":st=Ev;break;case"focusin":on="focus",st=Nm;break;case"focusout":on="blur",st=Nm;break;case"beforeblur":case"afterblur":st=Nm;break;case"click":if(y.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":st=yx;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":st=bx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":st=Ol;break;case $s:case Iv:case qo:st=Sx;break;case jm:st=a4;break;case"scroll":case"scrollend":st=Am;break;case"wheel":st=Sc;break;case"copy":case"cut":case"paste":st=bv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":st=Pm;break;case"toggle":case"beforetoggle":st=Tv}var bn=(f&4)!==0,ki=!bn&&(l==="scroll"||l==="scrollend"),je=bn?qe!==null?qe+"Capture":null:qe;bn=[];for(var Ne=Ge,$e;Ne!==null;){var bt=Ne;if($e=bt.stateNode,bt=bt.tag,bt!==5&&bt!==26&&bt!==27||$e===null||je===null||(bt=Ru(Ne,je),bt!=null&&bn.push(Py(Ne,bt,$e))),ki)break;Ne=Ne.return}0<bn.length&&(qe=new st(qe,on,null,y,ht),xt.push({event:qe,listeners:bn}))}}if((f&7)===0){e:{if(qe=l==="mouseover"||l==="pointerover",st=l==="mouseout"||l==="pointerout",qe&&y!==bh&&(on=y.relatedTarget||y.fromElement)&&(Re(on)||on[Mt]))break e;if((st||qe)&&(qe=ht.window===ht?ht:(qe=ht.ownerDocument)?qe.defaultView||qe.parentWindow:window,st?(on=y.relatedTarget||y.toElement,st=Ge,on=on?Re(on):null,on!==null&&(ki=s(on),bn=on.tag,on!==ki||bn!==5&&bn!==27&&bn!==6)&&(on=null)):(st=null,on=Ge),st!==on)){if(bn=yx,bt="onMouseLeave",je="onMouseEnter",Ne="mouse",(l==="pointerout"||l==="pointerover")&&(bn=Pm,bt="onPointerLeave",je="onPointerEnter",Ne="pointer"),ki=st==null?qe:ke(st),$e=on==null?qe:ke(on),qe=new bn(bt,Ne+"leave",st,y,ht),qe.target=ki,qe.relatedTarget=$e,bt=null,Re(ht)===Ge&&(bn=new bn(je,Ne+"enter",on,y,ht),bn.target=$e,bn.relatedTarget=ki,bt=bn),ki=bt,st&&on)t:{for(bn=aW,je=st,Ne=on,$e=0,bt=je;bt;bt=bn(bt))$e++;bt=0;for(var gn=Ne;gn;gn=bn(gn))bt++;for(;0<$e-bt;)je=bn(je),$e--;for(;0<bt-$e;)Ne=bn(Ne),bt--;for(;$e--;){if(je===Ne||Ne!==null&&je===Ne.alternate){bn=je;break t}je=bn(je),Ne=bn(Ne)}bn=null}else bn=null;st!==null&&J6(xt,qe,st,bn,!1),on!==null&&ki!==null&&J6(xt,ki,on,bn,!0)}}e:{if(qe=Ge?ke(Ge):window,st=qe.nodeName&&qe.nodeName.toLowerCase(),st==="select"||st==="input"&&qe.type==="file")var Ci=Pv;else if(Rv(qe))if(Ah)Ci=Lx;else{Ci=Mc;var un=Rh}else st=qe.nodeName,!st||st.toLowerCase()!=="input"||qe.type!=="checkbox"&&qe.type!=="radio"?Ge&&vh(Ge.elementType)&&(Ci=Pv):Ci=Dx;if(Ci&&(Ci=Ci(l,Ge))){Om(xt,Ci,y,ht);break e}un&&un(l,qe,Ge),l==="focusout"&&Ge&&qe.type==="number"&&Ge.memoizedProps.value!=null&&Ea(qe,"number",qe.value)}switch(un=Ge?ke(Ge):window,l){case"focusin":(Rv(un)||un.contentEditable==="true")&&(jd=un,Bm=Ge,Fd=null);break;case"focusout":Fd=Bm=jd=null;break;case"mousedown":Sr=!0;break;case"contextmenu":case"mouseup":case"dragend":Sr=!1,Um(xt,y,ht);break;case"selectionchange":if(Ox)break;case"keydown":case"keyup":Um(xt,y,ht)}var Hn;if(Pu)e:{switch(l){case"compositionstart":var li="onCompositionStart";break e;case"compositionend":li="onCompositionEnd";break e;case"compositionupdate":li="onCompositionUpdate";break e}li=void 0}else Ec?Dm(l,y)&&(li="onCompositionEnd"):l==="keydown"&&y.keyCode===229&&(li="onCompositionStart");li&&(ts&&y.locale!=="ko"&&(Ec||li!=="onCompositionStart"?li==="onCompositionEnd"&&Ec&&(Hn=Cm()):(bc=ht,Tm="value"in bc?bc.value:bc.textContent,Ec=!0)),un=x2(Ge,li),0<un.length&&(li=new xv(li,l,null,y,ht),xt.push({event:li,listeners:un}),Hn?li.data=Hn:(Hn=Ld(y),Hn!==null&&(li.data=Hn)))),(Hn=Du?Lm(l,y):Rx(l,y))&&(li=x2(Ge,"onBeforeInput"),0<li.length&&(un=new xv("onBeforeInput","beforeinput",null,y,ht),xt.push({event:un,listeners:li}),un.data=Hn)),eW(xt,l,Ge,y,ht)}Z6(xt,f)})}function Py(l,f,y){return{instance:l,listener:f,currentTarget:y}}function x2(l,f){for(var y=f+"Capture",E=[];l!==null;){var L=l,j=L.stateNode;if(L=L.tag,L!==5&&L!==26&&L!==27||j===null||(L=Ru(l,y),L!=null&&E.unshift(Py(l,L,j)),L=Ru(l,f),L!=null&&E.push(Py(l,L,j))),l.tag===3)return E;l=l.return}return[]}function aW(l){if(l===null)return null;do l=l.return;while(l&&l.tag!==5&&l.tag!==27);return l||null}function J6(l,f,y,E,L){for(var j=f._reactName,Q=[];y!==null&&y!==E;){var oe=y,Me=oe.alternate,Ge=oe.stateNode;if(oe=oe.tag,Me!==null&&Me===E)break;oe!==5&&oe!==26&&oe!==27||Ge===null||(Me=Ge,L?(Ge=Ru(y,j),Ge!=null&&Q.unshift(Py(y,Ge,Me))):L||(Ge=Ru(y,j),Ge!=null&&Q.push(Py(y,Ge,Me)))),y=y.return}Q.length!==0&&l.push({event:f,listeners:Q})}var sW=/\r\n?/g,rW=/\u0000|\uFFFD/g;function eR(l){return(typeof l=="string"?l:""+l).replace(sW,`
`).replace(rW,"")}function tR(l,f){return f=eR(f),eR(l)===f}function Vi(l,f,y,E,L,j){switch(y){case"children":typeof E=="string"?f==="body"||f==="textarea"&&E===""||Cu(l,E):(typeof E=="number"||typeof E=="bigint")&&f!=="body"&&Cu(l,""+E);break;case"className":si(l,"class",E);break;case"tabIndex":si(l,"tabindex",E);break;case"dir":case"role":case"viewBox":case"width":case"height":si(l,y,E);break;case"style":mv(l,E,j);break;case"data":if(f!=="object"){si(l,"data",E);break}case"src":case"href":if(E===""&&(f!=="a"||y!=="href")){l.removeAttribute(y);break}if(E==null||typeof E=="function"||typeof E=="symbol"||typeof E=="boolean"){l.removeAttribute(y);break}E=yh(""+E),l.setAttribute(y,E);break;case"action":case"formAction":if(typeof E=="function"){l.setAttribute(y,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof j=="function"&&(y==="formAction"?(f!=="input"&&Vi(l,f,"name",L.name,L,null),Vi(l,f,"formEncType",L.formEncType,L,null),Vi(l,f,"formMethod",L.formMethod,L,null),Vi(l,f,"formTarget",L.formTarget,L,null)):(Vi(l,f,"encType",L.encType,L,null),Vi(l,f,"method",L.method,L,null),Vi(l,f,"target",L.target,L,null)));if(E==null||typeof E=="symbol"||typeof E=="boolean"){l.removeAttribute(y);break}E=yh(""+E),l.setAttribute(y,E);break;case"onClick":E!=null&&(l.onclick=Ko);break;case"onScroll":E!=null&&ii("scroll",l);break;case"onScrollEnd":E!=null&&ii("scrollend",l);break;case"dangerouslySetInnerHTML":if(E!=null){if(typeof E!="object"||!("__html"in E))throw Error(i(61));if(y=E.__html,y!=null){if(L.children!=null)throw Error(i(60));l.innerHTML=y}}break;case"multiple":l.multiple=E&&typeof E!="function"&&typeof E!="symbol";break;case"muted":l.muted=E&&typeof E!="function"&&typeof E!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(E==null||typeof E=="function"||typeof E=="boolean"||typeof E=="symbol"){l.removeAttribute("xlink:href");break}y=yh(""+E),l.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",y);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":E!=null&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,""+E):l.removeAttribute(y);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":E&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,""):l.removeAttribute(y);break;case"capture":case"download":E===!0?l.setAttribute(y,""):E!==!1&&E!=null&&typeof E!="function"&&typeof E!="symbol"?l.setAttribute(y,E):l.removeAttribute(y);break;case"cols":case"rows":case"size":case"span":E!=null&&typeof E!="function"&&typeof E!="symbol"&&!isNaN(E)&&1<=E?l.setAttribute(y,E):l.removeAttribute(y);break;case"rowSpan":case"start":E==null||typeof E=="function"||typeof E=="symbol"||isNaN(E)?l.removeAttribute(y):l.setAttribute(y,E);break;case"popover":ii("beforetoggle",l),ii("toggle",l),ui(l,"popover",E);break;case"xlinkActuate":zn(l,"http://www.w3.org/1999/xlink","xlink:actuate",E);break;case"xlinkArcrole":zn(l,"http://www.w3.org/1999/xlink","xlink:arcrole",E);break;case"xlinkRole":zn(l,"http://www.w3.org/1999/xlink","xlink:role",E);break;case"xlinkShow":zn(l,"http://www.w3.org/1999/xlink","xlink:show",E);break;case"xlinkTitle":zn(l,"http://www.w3.org/1999/xlink","xlink:title",E);break;case"xlinkType":zn(l,"http://www.w3.org/1999/xlink","xlink:type",E);break;case"xmlBase":zn(l,"http://www.w3.org/XML/1998/namespace","xml:base",E);break;case"xmlLang":zn(l,"http://www.w3.org/XML/1998/namespace","xml:lang",E);break;case"xmlSpace":zn(l,"http://www.w3.org/XML/1998/namespace","xml:space",E);break;case"is":ui(l,"is",E);break;case"innerText":case"textContent":break;default:(!(2<y.length)||y[0]!=="o"&&y[0]!=="O"||y[1]!=="n"&&y[1]!=="N")&&(y=gx.get(y)||y,ui(l,y,E))}}function _4(l,f,y,E,L,j){switch(y){case"style":mv(l,E,j);break;case"dangerouslySetInnerHTML":if(E!=null){if(typeof E!="object"||!("__html"in E))throw Error(i(61));if(y=E.__html,y!=null){if(L.children!=null)throw Error(i(60));l.innerHTML=y}}break;case"children":typeof E=="string"?Cu(l,E):(typeof E=="number"||typeof E=="bigint")&&Cu(l,""+E);break;case"onScroll":E!=null&&ii("scroll",l);break;case"onScrollEnd":E!=null&&ii("scrollend",l);break;case"onClick":E!=null&&(l.onclick=Ko);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ht.hasOwnProperty(y))e:{if(y[0]==="o"&&y[1]==="n"&&(L=y.endsWith("Capture"),f=y.slice(2,L?y.length-7:void 0),j=l[Ot]||null,j=j!=null?j[y]:null,typeof j=="function"&&l.removeEventListener(f,j,L),typeof E=="function")){typeof j!="function"&&j!==null&&(y in l?l[y]=null:l.hasAttribute(y)&&l.removeAttribute(y)),l.addEventListener(f,E,L);break e}y in l?l[y]=E:E===!0?l.setAttribute(y,""):ui(l,y,E)}}}function Is(l,f,y){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":ii("error",l),ii("load",l);var E=!1,L=!1,j;for(j in y)if(y.hasOwnProperty(j)){var Q=y[j];if(Q!=null)switch(j){case"src":E=!0;break;case"srcSet":L=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(i(137,f));default:Vi(l,f,j,Q,y,null)}}L&&Vi(l,f,"srcSet",y.srcSet,y,null),E&&Vi(l,f,"src",y.src,y,null);return;case"input":ii("invalid",l);var oe=j=Q=L=null,Me=null,Ge=null;for(E in y)if(y.hasOwnProperty(E)){var ht=y[E];if(ht!=null)switch(E){case"name":L=ht;break;case"type":Q=ht;break;case"checked":Me=ht;break;case"defaultChecked":Ge=ht;break;case"value":j=ht;break;case"defaultValue":oe=ht;break;case"children":case"dangerouslySetInnerHTML":if(ht!=null)throw Error(i(137,f));break;default:Vi(l,f,E,ht,y,null)}}hs(l,j,oe,Me,Ge,Q,L,!1);return;case"select":ii("invalid",l),E=Q=j=null;for(L in y)if(y.hasOwnProperty(L)&&(oe=y[L],oe!=null))switch(L){case"value":j=oe;break;case"defaultValue":Q=oe;break;case"multiple":E=oe;default:Vi(l,f,L,oe,y,null)}f=j,y=Q,l.multiple=!!E,f!=null?ha(l,!!E,f,!1):y!=null&&ha(l,!!E,y,!0);return;case"textarea":ii("invalid",l),j=L=E=null;for(Q in y)if(y.hasOwnProperty(Q)&&(oe=y[Q],oe!=null))switch(Q){case"value":E=oe;break;case"defaultValue":L=oe;break;case"children":j=oe;break;case"dangerouslySetInnerHTML":if(oe!=null)throw Error(i(91));break;default:Vi(l,f,Q,oe,y,null)}Cs(l,E,L,j);return;case"option":for(Me in y)if(y.hasOwnProperty(Me)&&(E=y[Me],E!=null))switch(Me){case"selected":l.selected=E&&typeof E!="function"&&typeof E!="symbol";break;default:Vi(l,f,Me,E,y,null)}return;case"dialog":ii("beforetoggle",l),ii("toggle",l),ii("cancel",l),ii("close",l);break;case"iframe":case"object":ii("load",l);break;case"video":case"audio":for(E=0;E<Ny.length;E++)ii(Ny[E],l);break;case"image":ii("error",l),ii("load",l);break;case"details":ii("toggle",l);break;case"embed":case"source":case"link":ii("error",l),ii("load",l);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ge in y)if(y.hasOwnProperty(Ge)&&(E=y[Ge],E!=null))switch(Ge){case"children":case"dangerouslySetInnerHTML":throw Error(i(137,f));default:Vi(l,f,Ge,E,y,null)}return;default:if(vh(f)){for(ht in y)y.hasOwnProperty(ht)&&(E=y[ht],E!==void 0&&_4(l,f,ht,E,y,void 0));return}}for(oe in y)y.hasOwnProperty(oe)&&(E=y[oe],E!=null&&Vi(l,f,oe,E,y,null))}function oW(l,f,y,E){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var L=null,j=null,Q=null,oe=null,Me=null,Ge=null,ht=null;for(st in y){var xt=y[st];if(y.hasOwnProperty(st)&&xt!=null)switch(st){case"checked":break;case"value":break;case"defaultValue":Me=xt;default:E.hasOwnProperty(st)||Vi(l,f,st,null,E,xt)}}for(var qe in E){var st=E[qe];if(xt=y[qe],E.hasOwnProperty(qe)&&(st!=null||xt!=null))switch(qe){case"type":j=st;break;case"name":L=st;break;case"checked":Ge=st;break;case"defaultChecked":ht=st;break;case"value":Q=st;break;case"defaultValue":oe=st;break;case"children":case"dangerouslySetInnerHTML":if(st!=null)throw Error(i(137,f));break;default:st!==xt&&Vi(l,f,qe,st,E,xt)}}Ja(l,Q,oe,Me,Ge,ht,j,L);return;case"select":st=Q=oe=qe=null;for(j in y)if(Me=y[j],y.hasOwnProperty(j)&&Me!=null)switch(j){case"value":break;case"multiple":st=Me;default:E.hasOwnProperty(j)||Vi(l,f,j,null,E,Me)}for(L in E)if(j=E[L],Me=y[L],E.hasOwnProperty(L)&&(j!=null||Me!=null))switch(L){case"value":qe=j;break;case"defaultValue":oe=j;break;case"multiple":Q=j;default:j!==Me&&Vi(l,f,L,j,E,Me)}f=oe,y=Q,E=st,qe!=null?ha(l,!!y,qe,!1):!!E!=!!y&&(f!=null?ha(l,!!y,f,!0):ha(l,!!y,y?[]:"",!1));return;case"textarea":st=qe=null;for(oe in y)if(L=y[oe],y.hasOwnProperty(oe)&&L!=null&&!E.hasOwnProperty(oe))switch(oe){case"value":break;case"children":break;default:Vi(l,f,oe,null,E,L)}for(Q in E)if(L=E[Q],j=y[Q],E.hasOwnProperty(Q)&&(L!=null||j!=null))switch(Q){case"value":qe=L;break;case"defaultValue":st=L;break;case"children":break;case"dangerouslySetInnerHTML":if(L!=null)throw Error(i(91));break;default:L!==j&&Vi(l,f,Q,L,E,j)}Tu(l,qe,st);return;case"option":for(var on in y)if(qe=y[on],y.hasOwnProperty(on)&&qe!=null&&!E.hasOwnProperty(on))switch(on){case"selected":l.selected=!1;break;default:Vi(l,f,on,null,E,qe)}for(Me in E)if(qe=E[Me],st=y[Me],E.hasOwnProperty(Me)&&qe!==st&&(qe!=null||st!=null))switch(Me){case"selected":l.selected=qe&&typeof qe!="function"&&typeof qe!="symbol";break;default:Vi(l,f,Me,qe,E,st)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var bn in y)qe=y[bn],y.hasOwnProperty(bn)&&qe!=null&&!E.hasOwnProperty(bn)&&Vi(l,f,bn,null,E,qe);for(Ge in E)if(qe=E[Ge],st=y[Ge],E.hasOwnProperty(Ge)&&qe!==st&&(qe!=null||st!=null))switch(Ge){case"children":case"dangerouslySetInnerHTML":if(qe!=null)throw Error(i(137,f));break;default:Vi(l,f,Ge,qe,E,st)}return;default:if(vh(f)){for(var ki in y)qe=y[ki],y.hasOwnProperty(ki)&&qe!==void 0&&!E.hasOwnProperty(ki)&&_4(l,f,ki,void 0,E,qe);for(ht in E)qe=E[ht],st=y[ht],!E.hasOwnProperty(ht)||qe===st||qe===void 0&&st===void 0||_4(l,f,ht,qe,E,st);return}}for(var je in y)qe=y[je],y.hasOwnProperty(je)&&qe!=null&&!E.hasOwnProperty(je)&&Vi(l,f,je,null,E,qe);for(xt in E)qe=E[xt],st=y[xt],!E.hasOwnProperty(xt)||qe===st||qe==null&&st==null||Vi(l,f,xt,qe,E,st)}function nR(l){switch(l){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function lW(){if(typeof performance.getEntriesByType=="function"){for(var l=0,f=0,y=performance.getEntriesByType("resource"),E=0;E<y.length;E++){var L=y[E],j=L.transferSize,Q=L.initiatorType,oe=L.duration;if(j&&oe&&nR(Q)){for(Q=0,oe=L.responseEnd,E+=1;E<y.length;E++){var Me=y[E],Ge=Me.startTime;if(Ge>oe)break;var ht=Me.transferSize,xt=Me.initiatorType;ht&&nR(xt)&&(Me=Me.responseEnd,Q+=ht*(Me<oe?1:(oe-Ge)/(Me-Ge)))}if(--E,f+=8*(j+Q)/(L.duration/1e3),l++,10<l)break}}if(0<l)return f/l/1e6}return navigator.connection&&(l=navigator.connection.downlink,typeof l=="number")?l:5}var S4=null,w4=null;function _2(l){return l.nodeType===9?l:l.ownerDocument}function iR(l){switch(l){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function aR(l,f){if(l===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return l===1&&f==="foreignObject"?0:l}function E4(l,f){return l==="textarea"||l==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var M4=null;function cW(){var l=window.event;return l&&l.type==="popstate"?l===M4?!1:(M4=l,!0):(M4=null,!1)}var sR=typeof setTimeout=="function"?setTimeout:void 0,uW=typeof clearTimeout=="function"?clearTimeout:void 0,rR=typeof Promise=="function"?Promise:void 0,dW=typeof queueMicrotask=="function"?queueMicrotask:typeof rR<"u"?function(l){return rR.resolve(null).then(l).catch(fW)}:sR;function fW(l){setTimeout(function(){throw l})}function df(l){return l==="head"}function oR(l,f){var y=f,E=0;do{var L=y.nextSibling;if(l.removeChild(y),L&&L.nodeType===8)if(y=L.data,y==="/$"||y==="/&"){if(E===0){l.removeChild(L),C0(f);return}E--}else if(y==="$"||y==="$?"||y==="$~"||y==="$!"||y==="&")E++;else if(y==="html")Dy(l.ownerDocument.documentElement);else if(y==="head"){y=l.ownerDocument.head,Dy(y);for(var j=y.firstChild;j;){var Q=j.nextSibling,oe=j.nodeName;j[Fn]||oe==="SCRIPT"||oe==="STYLE"||oe==="LINK"&&j.rel.toLowerCase()==="stylesheet"||y.removeChild(j),j=Q}}else y==="body"&&Dy(l.ownerDocument.body);y=L}while(y);C0(f)}function lR(l,f){var y=l;l=0;do{var E=y.nextSibling;if(y.nodeType===1?f?(y._stashedDisplay=y.style.display,y.style.display="none"):(y.style.display=y._stashedDisplay||"",y.getAttribute("style")===""&&y.removeAttribute("style")):y.nodeType===3&&(f?(y._stashedText=y.nodeValue,y.nodeValue=""):y.nodeValue=y._stashedText||""),E&&E.nodeType===8)if(y=E.data,y==="/$"){if(l===0)break;l--}else y!=="$"&&y!=="$?"&&y!=="$~"&&y!=="$!"||l++;y=E}while(y)}function T4(l){var f=l.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var y=f;switch(f=f.nextSibling,y.nodeName){case"HTML":case"HEAD":case"BODY":T4(y),le(y);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(y.rel.toLowerCase()==="stylesheet")continue}l.removeChild(y)}}function hW(l,f,y,E){for(;l.nodeType===1;){var L=y;if(l.nodeName.toLowerCase()!==f.toLowerCase()){if(!E&&(l.nodeName!=="INPUT"||l.type!=="hidden"))break}else if(E){if(!l[Fn])switch(f){case"meta":if(!l.hasAttribute("itemprop"))break;return l;case"link":if(j=l.getAttribute("rel"),j==="stylesheet"&&l.hasAttribute("data-precedence"))break;if(j!==L.rel||l.getAttribute("href")!==(L.href==null||L.href===""?null:L.href)||l.getAttribute("crossorigin")!==(L.crossOrigin==null?null:L.crossOrigin)||l.getAttribute("title")!==(L.title==null?null:L.title))break;return l;case"style":if(l.hasAttribute("data-precedence"))break;return l;case"script":if(j=l.getAttribute("src"),(j!==(L.src==null?null:L.src)||l.getAttribute("type")!==(L.type==null?null:L.type)||l.getAttribute("crossorigin")!==(L.crossOrigin==null?null:L.crossOrigin))&&j&&l.hasAttribute("async")&&!l.hasAttribute("itemprop"))break;return l;default:return l}}else if(f==="input"&&l.type==="hidden"){var j=L.name==null?null:""+L.name;if(L.type==="hidden"&&l.getAttribute("name")===j)return l}else return l;if(l=ul(l.nextSibling),l===null)break}return null}function pW(l,f,y){if(f==="")return null;for(;l.nodeType!==3;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!y||(l=ul(l.nextSibling),l===null))return null;return l}function cR(l,f){for(;l.nodeType!==8;)if((l.nodeType!==1||l.nodeName!=="INPUT"||l.type!=="hidden")&&!f||(l=ul(l.nextSibling),l===null))return null;return l}function C4(l){return l.data==="$?"||l.data==="$~"}function A4(l){return l.data==="$!"||l.data==="$?"&&l.ownerDocument.readyState!=="loading"}function mW(l,f){var y=l.ownerDocument;if(l.data==="$~")l._reactRetry=f;else if(l.data!=="$?"||y.readyState!=="loading")f();else{var E=function(){f(),y.removeEventListener("DOMContentLoaded",E)};y.addEventListener("DOMContentLoaded",E),l._reactRetry=E}}function ul(l){for(;l!=null;l=l.nextSibling){var f=l.nodeType;if(f===1||f===3)break;if(f===8){if(f=l.data,f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"||f==="F!"||f==="F")break;if(f==="/$"||f==="/&")return null}}return l}var R4=null;function uR(l){l=l.nextSibling;for(var f=0;l;){if(l.nodeType===8){var y=l.data;if(y==="/$"||y==="/&"){if(f===0)return ul(l.nextSibling);f--}else y!=="$"&&y!=="$!"&&y!=="$?"&&y!=="$~"&&y!=="&"||f++}l=l.nextSibling}return null}function dR(l){l=l.previousSibling;for(var f=0;l;){if(l.nodeType===8){var y=l.data;if(y==="$"||y==="$!"||y==="$?"||y==="$~"||y==="&"){if(f===0)return l;f--}else y!=="/$"&&y!=="/&"||f++}l=l.previousSibling}return null}function fR(l,f,y){switch(f=_2(y),l){case"html":if(l=f.documentElement,!l)throw Error(i(452));return l;case"head":if(l=f.head,!l)throw Error(i(453));return l;case"body":if(l=f.body,!l)throw Error(i(454));return l;default:throw Error(i(451))}}function Dy(l){for(var f=l.attributes;f.length;)l.removeAttributeNode(f[0]);le(l)}var dl=new Map,hR=new Set;function S2(l){return typeof l.getRootNode=="function"?l.getRootNode():l.nodeType===9?l:l.ownerDocument}var td=H.d;H.d={f:gW,r:vW,D:yW,C:bW,L:xW,m:_W,X:wW,S:SW,M:EW};function gW(){var l=td.f(),f=de();return l||f}function vW(l){var f=Be(l);f!==null&&f.tag===5&&f.type==="form"?_y(f):td.r(l)}var E0=typeof document>"u"?null:document;function pR(l,f,y){var E=E0;if(E&&typeof f=="string"&&f){var L=Kn(f);L='link[rel="'+l+'"][href="'+L+'"]',typeof y=="string"&&(L+='[crossorigin="'+y+'"]'),hR.has(L)||(hR.add(L),l={rel:l,crossOrigin:y,href:f},E.querySelector(L)===null&&(f=E.createElement("link"),Is(f,"link",l),yt(f),E.head.appendChild(f)))}}function yW(l){td.D(l),pR("dns-prefetch",l,null)}function bW(l,f){td.C(l,f),pR("preconnect",l,f)}function xW(l,f,y){td.L(l,f,y);var E=E0;if(E&&l&&f){var L='link[rel="preload"][as="'+Kn(f)+'"]';f==="image"&&y&&y.imageSrcSet?(L+='[imagesrcset="'+Kn(y.imageSrcSet)+'"]',typeof y.imageSizes=="string"&&(L+='[imagesizes="'+Kn(y.imageSizes)+'"]')):L+='[href="'+Kn(l)+'"]';var j=L;switch(f){case"style":j=M0(l);break;case"script":j=T0(l)}dl.has(j)||(l=d({rel:"preload",href:f==="image"&&y&&y.imageSrcSet?void 0:l,as:f},y),dl.set(j,l),E.querySelector(L)!==null||f==="style"&&E.querySelector(Ly(j))||f==="script"&&E.querySelector(Oy(j))||(f=E.createElement("link"),Is(f,"link",l),yt(f),E.head.appendChild(f)))}}function _W(l,f){td.m(l,f);var y=E0;if(y&&l){var E=f&&typeof f.as=="string"?f.as:"script",L='link[rel="modulepreload"][as="'+Kn(E)+'"][href="'+Kn(l)+'"]',j=L;switch(E){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":j=T0(l)}if(!dl.has(j)&&(l=d({rel:"modulepreload",href:l},f),dl.set(j,l),y.querySelector(L)===null)){switch(E){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(y.querySelector(Oy(j)))return}E=y.createElement("link"),Is(E,"link",l),yt(E),y.head.appendChild(E)}}}function SW(l,f,y){td.S(l,f,y);var E=E0;if(E&&l){var L=ze(E).hoistableStyles,j=M0(l);f=f||"default";var Q=L.get(j);if(!Q){var oe={loading:0,preload:null};if(Q=E.querySelector(Ly(j)))oe.loading=5;else{l=d({rel:"stylesheet",href:l,"data-precedence":f},y),(y=dl.get(j))&&N4(l,y);var Me=Q=E.createElement("link");yt(Me),Is(Me,"link",l),Me._p=new Promise(function(Ge,ht){Me.onload=Ge,Me.onerror=ht}),Me.addEventListener("load",function(){oe.loading|=1}),Me.addEventListener("error",function(){oe.loading|=2}),oe.loading|=4,w2(Q,f,E)}Q={type:"stylesheet",instance:Q,count:1,state:oe},L.set(j,Q)}}}function wW(l,f){td.X(l,f);var y=E0;if(y&&l){var E=ze(y).hoistableScripts,L=T0(l),j=E.get(L);j||(j=y.querySelector(Oy(L)),j||(l=d({src:l,async:!0},f),(f=dl.get(L))&&P4(l,f),j=y.createElement("script"),yt(j),Is(j,"link",l),y.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},E.set(L,j))}}function EW(l,f){td.M(l,f);var y=E0;if(y&&l){var E=ze(y).hoistableScripts,L=T0(l),j=E.get(L);j||(j=y.querySelector(Oy(L)),j||(l=d({src:l,async:!0,type:"module"},f),(f=dl.get(L))&&P4(l,f),j=y.createElement("script"),yt(j),Is(j,"link",l),y.head.appendChild(j)),j={type:"script",instance:j,count:1,state:null},E.set(L,j))}}function mR(l,f,y,E){var L=(L=se.current)?S2(L):null;if(!L)throw Error(i(446));switch(l){case"meta":case"title":return null;case"style":return typeof y.precedence=="string"&&typeof y.href=="string"?(f=M0(y.href),y=ze(L).hoistableStyles,E=y.get(f),E||(E={type:"style",instance:null,count:0,state:null},y.set(f,E)),E):{type:"void",instance:null,count:0,state:null};case"link":if(y.rel==="stylesheet"&&typeof y.href=="string"&&typeof y.precedence=="string"){l=M0(y.href);var j=ze(L).hoistableStyles,Q=j.get(l);if(Q||(L=L.ownerDocument||L,Q={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},j.set(l,Q),(j=L.querySelector(Ly(l)))&&!j._p&&(Q.instance=j,Q.state.loading=5),dl.has(l)||(y={rel:"preload",as:"style",href:y.href,crossOrigin:y.crossOrigin,integrity:y.integrity,media:y.media,hrefLang:y.hrefLang,referrerPolicy:y.referrerPolicy},dl.set(l,y),j||MW(L,l,y,Q.state))),f&&E===null)throw Error(i(528,""));return Q}if(f&&E!==null)throw Error(i(529,""));return null;case"script":return f=y.async,y=y.src,typeof y=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=T0(y),y=ze(L).hoistableScripts,E=y.get(f),E||(E={type:"script",instance:null,count:0,state:null},y.set(f,E)),E):{type:"void",instance:null,count:0,state:null};default:throw Error(i(444,l))}}function M0(l){return'href="'+Kn(l)+'"'}function Ly(l){return'link[rel="stylesheet"]['+l+"]"}function gR(l){return d({},l,{"data-precedence":l.precedence,precedence:null})}function MW(l,f,y,E){l.querySelector('link[rel="preload"][as="style"]['+f+"]")?E.loading=1:(f=l.createElement("link"),E.preload=f,f.addEventListener("load",function(){return E.loading|=1}),f.addEventListener("error",function(){return E.loading|=2}),Is(f,"link",y),yt(f),l.head.appendChild(f))}function T0(l){return'[src="'+Kn(l)+'"]'}function Oy(l){return"script[async]"+l}function vR(l,f,y){if(f.count++,f.instance===null)switch(f.type){case"style":var E=l.querySelector('style[data-href~="'+Kn(y.href)+'"]');if(E)return f.instance=E,yt(E),E;var L=d({},y,{"data-href":y.href,"data-precedence":y.precedence,href:null,precedence:null});return E=(l.ownerDocument||l).createElement("style"),yt(E),Is(E,"style",L),w2(E,y.precedence,l),f.instance=E;case"stylesheet":L=M0(y.href);var j=l.querySelector(Ly(L));if(j)return f.state.loading|=4,f.instance=j,yt(j),j;E=gR(y),(L=dl.get(L))&&N4(E,L),j=(l.ownerDocument||l).createElement("link"),yt(j);var Q=j;return Q._p=new Promise(function(oe,Me){Q.onload=oe,Q.onerror=Me}),Is(j,"link",E),f.state.loading|=4,w2(j,y.precedence,l),f.instance=j;case"script":return j=T0(y.src),(L=l.querySelector(Oy(j)))?(f.instance=L,yt(L),L):(E=y,(L=dl.get(j))&&(E=d({},y),P4(E,L)),l=l.ownerDocument||l,L=l.createElement("script"),yt(L),Is(L,"link",E),l.head.appendChild(L),f.instance=L);case"void":return null;default:throw Error(i(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(E=f.instance,f.state.loading|=4,w2(E,y.precedence,l));return f.instance}function w2(l,f,y){for(var E=y.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),L=E.length?E[E.length-1]:null,j=L,Q=0;Q<E.length;Q++){var oe=E[Q];if(oe.dataset.precedence===f)j=oe;else if(j!==L)break}j?j.parentNode.insertBefore(l,j.nextSibling):(f=y.nodeType===9?y.head:y,f.insertBefore(l,f.firstChild))}function N4(l,f){l.crossOrigin==null&&(l.crossOrigin=f.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=f.referrerPolicy),l.title==null&&(l.title=f.title)}function P4(l,f){l.crossOrigin==null&&(l.crossOrigin=f.crossOrigin),l.referrerPolicy==null&&(l.referrerPolicy=f.referrerPolicy),l.integrity==null&&(l.integrity=f.integrity)}var E2=null;function yR(l,f,y){if(E2===null){var E=new Map,L=E2=new Map;L.set(y,E)}else L=E2,E=L.get(y),E||(E=new Map,L.set(y,E));if(E.has(l))return E;for(E.set(l,null),y=y.getElementsByTagName(l),L=0;L<y.length;L++){var j=y[L];if(!(j[Fn]||j[vt]||l==="link"&&j.getAttribute("rel")==="stylesheet")&&j.namespaceURI!=="http://www.w3.org/2000/svg"){var Q=j.getAttribute(f)||"";Q=l+Q;var oe=E.get(Q);oe?oe.push(j):E.set(Q,[j])}}return E}function bR(l,f,y){l=l.ownerDocument||l,l.head.insertBefore(y,f==="title"?l.querySelector("head > title"):null)}function TW(l,f,y){if(y===1||f.itemProp!=null)return!1;switch(l){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return l=f.disabled,typeof f.precedence=="string"&&l==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function xR(l){return!(l.type==="stylesheet"&&(l.state.loading&3)===0)}function CW(l,f,y,E){if(y.type==="stylesheet"&&(typeof E.media!="string"||matchMedia(E.media).matches!==!1)&&(y.state.loading&4)===0){if(y.instance===null){var L=M0(E.href),j=f.querySelector(Ly(L));if(j){f=j._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(l.count++,l=M2.bind(l),f.then(l,l)),y.state.loading|=4,y.instance=j,yt(j);return}j=f.ownerDocument||f,E=gR(E),(L=dl.get(L))&&N4(E,L),j=j.createElement("link"),yt(j);var Q=j;Q._p=new Promise(function(oe,Me){Q.onload=oe,Q.onerror=Me}),Is(j,"link",E),y.instance=j}l.stylesheets===null&&(l.stylesheets=new Map),l.stylesheets.set(y,f),(f=y.state.preload)&&(y.state.loading&3)===0&&(l.count++,y=M2.bind(l),f.addEventListener("load",y),f.addEventListener("error",y))}}var D4=0;function AW(l,f){return l.stylesheets&&l.count===0&&C2(l,l.stylesheets),0<l.count||0<l.imgCount?function(y){var E=setTimeout(function(){if(l.stylesheets&&C2(l,l.stylesheets),l.unsuspend){var j=l.unsuspend;l.unsuspend=null,j()}},6e4+f);0<l.imgBytes&&D4===0&&(D4=62500*lW());var L=setTimeout(function(){if(l.waitingForImages=!1,l.count===0&&(l.stylesheets&&C2(l,l.stylesheets),l.unsuspend)){var j=l.unsuspend;l.unsuspend=null,j()}},(l.imgBytes>D4?50:800)+f);return l.unsuspend=y,function(){l.unsuspend=null,clearTimeout(E),clearTimeout(L)}}:null}function M2(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)C2(this,this.stylesheets);else if(this.unsuspend){var l=this.unsuspend;this.unsuspend=null,l()}}}var T2=null;function C2(l,f){l.stylesheets=null,l.unsuspend!==null&&(l.count++,T2=new Map,f.forEach(RW,l),T2=null,M2.call(l))}function RW(l,f){if(!(f.state.loading&4)){var y=T2.get(l);if(y)var E=y.get(null);else{y=new Map,T2.set(l,y);for(var L=l.querySelectorAll("link[data-precedence],style[data-precedence]"),j=0;j<L.length;j++){var Q=L[j];(Q.nodeName==="LINK"||Q.getAttribute("media")!=="not all")&&(y.set(Q.dataset.precedence,Q),E=Q)}E&&y.set(null,E)}L=f.instance,Q=L.getAttribute("data-precedence"),j=y.get(Q)||E,j===E&&y.set(null,L),y.set(Q,L),this.count++,E=M2.bind(this),L.addEventListener("load",E),L.addEventListener("error",E),j?j.parentNode.insertBefore(L,j.nextSibling):(l=l.nodeType===9?l.head:l,l.insertBefore(L,l.firstChild)),f.state.loading|=4}}var Iy={$$typeof:C,Provider:null,Consumer:null,_currentValue:W,_currentValue2:W,_threadCount:0};function NW(l,f,y,E,L,j,Q,oe,Me){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=rn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=rn(0),this.hiddenUpdates=rn(null),this.identifierPrefix=E,this.onUncaughtError=L,this.onCaughtError=j,this.onRecoverableError=Q,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Me,this.incompleteTransitions=new Map}function _R(l,f,y,E,L,j,Q,oe,Me,Ge,ht,xt){return l=new NW(l,f,y,Q,Me,Ge,ht,xt,oe),f=1,j===!0&&(f|=24),j=Rs(3,null,null,f),l.current=j,j.stateNode=l,f=Hv(),f.refCount++,l.pooledCache=f,f.refCount++,j.memoizedState={element:E,isDehydrated:y,cache:f},qv(j),l}function SR(l){return l?(l=Dc,l):Dc}function wR(l,f,y,E,L,j){L=SR(L),E.context===null?E.context=L:E.pendingContext=L,E=tl(f),E.payload={element:y},j=j===void 0?null:j,j!==null&&(E.callback=j),y=$l(l,E,f),y!==null&&(v(y,l,f),Fc(y,l,f))}function ER(l,f){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var y=l.retryLane;l.retryLane=y!==0&&y<f?y:f}}function L4(l,f){ER(l,f),(l=l.alternate)&&ER(l,f)}function MR(l){if(l.tag===13||l.tag===31){var f=Pc(l,67108864);f!==null&&v(f,l,67108864),L4(l,67108864)}}function TR(l){if(l.tag===13||l.tag===31){var f=Os();f=Bt(f);var y=Pc(l,f);y!==null&&v(y,l,f),L4(l,f)}}var A2=!0;function PW(l,f,y,E){var L=V.T;V.T=null;var j=H.p;try{H.p=2,O4(l,f,y,E)}finally{H.p=j,V.T=L}}function DW(l,f,y,E){var L=V.T;V.T=null;var j=H.p;try{H.p=8,O4(l,f,y,E)}finally{H.p=j,V.T=L}}function O4(l,f,y,E){if(A2){var L=I4(E);if(L===null)x4(l,f,E,R2,y),AR(l,E);else if(OW(L,l,f,y,E))E.stopPropagation();else if(AR(l,E),f&4&&-1<LW.indexOf(l)){for(;L!==null;){var j=Be(L);if(j!==null)switch(j.tag){case 3:if(j=j.stateNode,j.current.memoizedState.isDehydrated){var Q=ct(j.pendingLanes);if(Q!==0){var oe=j;for(oe.pendingLanes|=2,oe.entangledLanes|=2;Q;){var Me=1<<31-wt(Q);oe.entanglements[1]|=Me,Q&=~Me}qc(j),(ri&6)===0&&(zr=te()+500,Ry(0))}}break;case 31:case 13:oe=Pc(j,2),oe!==null&&v(oe,j,2),de(),L4(j,2)}if(j=I4(E),j===null&&x4(l,f,E,R2,y),j===L)break;L=j}L!==null&&E.stopPropagation()}else x4(l,f,E,null,y)}}function I4(l){return l=wm(l),z4(l)}var R2=null;function z4(l){if(R2=null,l=Re(l),l!==null){var f=s(l);if(f===null)l=null;else{var y=f.tag;if(y===13){if(l=r(f),l!==null)return l;l=null}else if(y===31){if(l=o(f),l!==null)return l;l=null}else if(y===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;l=null}else f!==l&&(l=null)}}return R2=l,null}function CR(l){switch(l){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(we()){case Ce:return 2;case Ie:return 8;case Pe:case Ze:return 32;case We:return 268435456;default:return 32}default:return 32}}var B4=!1,ff=null,hf=null,pf=null,zy=new Map,By=new Map,mf=[],LW="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function AR(l,f){switch(l){case"focusin":case"focusout":ff=null;break;case"dragenter":case"dragleave":hf=null;break;case"mouseover":case"mouseout":pf=null;break;case"pointerover":case"pointerout":zy.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":By.delete(f.pointerId)}}function Uy(l,f,y,E,L,j){return l===null||l.nativeEvent!==j?(l={blockedOn:f,domEventName:y,eventSystemFlags:E,nativeEvent:j,targetContainers:[L]},f!==null&&(f=Be(f),f!==null&&MR(f)),l):(l.eventSystemFlags|=E,f=l.targetContainers,L!==null&&f.indexOf(L)===-1&&f.push(L),l)}function OW(l,f,y,E,L){switch(f){case"focusin":return ff=Uy(ff,l,f,y,E,L),!0;case"dragenter":return hf=Uy(hf,l,f,y,E,L),!0;case"mouseover":return pf=Uy(pf,l,f,y,E,L),!0;case"pointerover":var j=L.pointerId;return zy.set(j,Uy(zy.get(j)||null,l,f,y,E,L)),!0;case"gotpointercapture":return j=L.pointerId,By.set(j,Uy(By.get(j)||null,l,f,y,E,L)),!0}return!1}function RR(l){var f=Re(l.target);if(f!==null){var y=s(f);if(y!==null){if(f=y.tag,f===13){if(f=r(y),f!==null){l.blockedOn=f,ot(l.priority,function(){TR(y)});return}}else if(f===31){if(f=o(y),f!==null){l.blockedOn=f,ot(l.priority,function(){TR(y)});return}}else if(f===3&&y.stateNode.current.memoizedState.isDehydrated){l.blockedOn=y.tag===3?y.stateNode.containerInfo:null;return}}}l.blockedOn=null}function N2(l){if(l.blockedOn!==null)return!1;for(var f=l.targetContainers;0<f.length;){var y=I4(l.nativeEvent);if(y===null){y=l.nativeEvent;var E=new y.constructor(y.type,y);bh=E,y.target.dispatchEvent(E),bh=null}else return f=Be(y),f!==null&&MR(f),l.blockedOn=y,!1;f.shift()}return!0}function NR(l,f,y){N2(l)&&y.delete(f)}function IW(){B4=!1,ff!==null&&N2(ff)&&(ff=null),hf!==null&&N2(hf)&&(hf=null),pf!==null&&N2(pf)&&(pf=null),zy.forEach(NR),By.forEach(NR)}function P2(l,f){l.blockedOn===f&&(l.blockedOn=null,B4||(B4=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,IW)))}var D2=null;function PR(l){D2!==l&&(D2=l,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){D2===l&&(D2=null);for(var f=0;f<l.length;f+=3){var y=l[f],E=l[f+1],L=l[f+2];if(typeof E!="function"){if(z4(E||y)===null)continue;break}var j=Be(y);j!==null&&(l.splice(f,3),f-=3,xy(j,{pending:!0,data:L,method:y.method,action:E},E,L))}}))}function C0(l){function f(Me){return P2(Me,l)}ff!==null&&P2(ff,l),hf!==null&&P2(hf,l),pf!==null&&P2(pf,l),zy.forEach(f),By.forEach(f);for(var y=0;y<mf.length;y++){var E=mf[y];E.blockedOn===l&&(E.blockedOn=null)}for(;0<mf.length&&(y=mf[0],y.blockedOn===null);)RR(y),y.blockedOn===null&&mf.shift();if(y=(l.ownerDocument||l).$$reactFormReplay,y!=null)for(E=0;E<y.length;E+=3){var L=y[E],j=y[E+1],Q=L[Ot]||null;if(typeof j=="function")Q||PR(y);else if(Q){var oe=null;if(j&&j.hasAttribute("formAction")){if(L=j,Q=j[Ot]||null)oe=Q.formAction;else if(z4(L)!==null)continue}else oe=Q.action;typeof oe=="function"?y[E+1]=oe:(y.splice(E,3),E-=3),PR(y)}}}function DR(){function l(j){j.canIntercept&&j.info==="react-transition"&&j.intercept({handler:function(){return new Promise(function(Q){return L=Q})},focusReset:"manual",scroll:"manual"})}function f(){L!==null&&(L(),L=null),E||setTimeout(y,20)}function y(){if(!E&&!navigation.transition){var j=navigation.currentEntry;j&&j.url!=null&&navigation.navigate(j.url,{state:j.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var E=!1,L=null;return navigation.addEventListener("navigate",l),navigation.addEventListener("navigatesuccess",f),navigation.addEventListener("navigateerror",f),setTimeout(y,100),function(){E=!0,navigation.removeEventListener("navigate",l),navigation.removeEventListener("navigatesuccess",f),navigation.removeEventListener("navigateerror",f),L!==null&&(L(),L=null)}}}function U4(l){this._internalRoot=l}L2.prototype.render=U4.prototype.render=function(l){var f=this._internalRoot;if(f===null)throw Error(i(409));var y=f.current,E=Os();wR(y,E,l,f,null,null)},L2.prototype.unmount=U4.prototype.unmount=function(){var l=this._internalRoot;if(l!==null){this._internalRoot=null;var f=l.containerInfo;wR(l.current,2,null,l,null,null),de(),f[Mt]=null}};function L2(l){this._internalRoot=l}L2.prototype.unstable_scheduleHydration=function(l){if(l){var f=Dt();l={blockedOn:null,target:l,priority:f};for(var y=0;y<mf.length&&f!==0&&f<mf[y].priority;y++);mf.splice(y,0,l),y===0&&RR(l)}};var LR=e.version;if(LR!=="19.2.0")throw Error(i(527,LR,"19.2.0"));H.findDOMNode=function(l){var f=l._reactInternals;if(f===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=u(f),l=l!==null?h(l):null,l=l===null?null:l.stateNode,l};var zW={bundleType:0,version:"19.2.0",rendererPackageName:"react-dom",currentDispatcherRef:V,reconcilerVersion:"19.2.0"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var O2=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!O2.isDisabled&&O2.supportsFiber)try{Ye=O2.inject(zW),Je=O2}catch{}}return Vy.createRoot=function(l,f){if(!a(l))throw Error(i(299));var y=!1,E="",L=Ey,j=f2,Q=u0;return f!=null&&(f.unstable_strictMode===!0&&(y=!0),f.identifierPrefix!==void 0&&(E=f.identifierPrefix),f.onUncaughtError!==void 0&&(L=f.onUncaughtError),f.onCaughtError!==void 0&&(j=f.onCaughtError),f.onRecoverableError!==void 0&&(Q=f.onRecoverableError)),f=_R(l,1,!1,null,null,y,E,null,L,j,Q,DR),l[Mt]=f.current,b4(l),new U4(f)},Vy.hydrateRoot=function(l,f,y){if(!a(l))throw Error(i(299));var E=!1,L="",j=Ey,Q=f2,oe=u0,Me=null;return y!=null&&(y.unstable_strictMode===!0&&(E=!0),y.identifierPrefix!==void 0&&(L=y.identifierPrefix),y.onUncaughtError!==void 0&&(j=y.onUncaughtError),y.onCaughtError!==void 0&&(Q=y.onCaughtError),y.onRecoverableError!==void 0&&(oe=y.onRecoverableError),y.formState!==void 0&&(Me=y.formState)),f=_R(l,1,!0,f,y??null,E,L,Me,j,Q,oe,DR),f.context=SR(null),y=f.current,E=Os(),E=Bt(E),L=tl(E),L.callback=null,$l(y,L,E),y=E,f.current.lanes=y,ge(f,y),qc(f),l[Mt]=f.current,b4(l),new L2(f)},Vy.version="19.2.0",Vy}var HR;function GW(){if(HR)return V4.exports;HR=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),V4.exports=$W(),V4.exports}var WW=GW();const KW="modulepreload",XW=function(t,e){return new URL(t,e).href},$R={},bu=function(e,n,i){let a=Promise.resolve();if(n&&n.length>0){let u=function(h){return Promise.all(h.map(d=>Promise.resolve(d).then(p=>({status:"fulfilled",value:p}),p=>({status:"rejected",reason:p}))))};const r=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),c=o?.nonce||o?.getAttribute("nonce");a=u(n.map(h=>{if(h=XW(h,i),h in $R)return;$R[h]=!0;const d=h.endsWith(".css"),p=d?'[rel="stylesheet"]':"";if(i)for(let b=r.length-1;b>=0;b--){const w=r[b];if(w.href===h&&(!d||w.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${p}`))return;const g=document.createElement("link");if(g.rel=d?"stylesheet":KW,d||(g.as="script"),g.crossOrigin="",g.href=h,c&&g.setAttribute("nonce",c),document.head.appendChild(g),d)return new Promise((b,w)=>{g.addEventListener("load",b),g.addEventListener("error",()=>w(new Error(`Unable to preload CSS for ${h}`)))})}))}function s(r){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=r,window.dispatchEvent(o),!o.defaultPrevented)throw r}return a.then(r=>{for(const o of r||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};/**
* react-router v7.9.4
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var O9=t=>{throw TypeError(t)},qW=(t,e,n)=>e.has(t)||O9("Cannot "+n),G4=(t,e,n)=>(qW(t,e,"read from private field"),n?n.call(t):e.get(t)),YW=(t,e,n)=>e.has(t)?O9("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),GR="popstate";function ZW(t={}){function e(i,a){let{pathname:s,search:r,hash:o}=i.location;return Wb("",{pathname:s,search:r,hash:o},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function n(i,a){return typeof a=="string"?a:Hf(a)}return JW(e,n,null,t)}function ai(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Za(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function QW(){return Math.random().toString(36).substring(2,10)}function WR(t,e){return{usr:t.state,key:t.key,idx:e}}function Wb(t,e,n=null,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?th(e):e,state:n,key:e&&e.key||i||QW()}}function Hf({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function th(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let i=t.indexOf("?");i>=0&&(e.search=t.substring(i),t=t.substring(0,i)),t&&(e.pathname=t)}return e}function JW(t,e,n,i={}){let{window:a=document.defaultView,v5Compat:s=!1}=i,r=a.history,o="POP",c=null,u=h();u==null&&(u=0,r.replaceState({...r.state,idx:u},""));function h(){return(r.state||{idx:null}).idx}function d(){o="POP";let x=h(),S=x==null?null:x-u;u=x,c&&c({action:o,location:w.location,delta:S})}function p(x,S){o="PUSH";let M=Wb(w.location,x,S);u=h()+1;let C=WR(M,u),A=w.createHref(M);try{r.pushState(C,"",A)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;a.location.assign(A)}s&&c&&c({action:o,location:w.location,delta:1})}function g(x,S){o="REPLACE";let M=Wb(w.location,x,S);u=h();let C=WR(M,u),A=w.createHref(M);r.replaceState(C,"",A),s&&c&&c({action:o,location:w.location,delta:0})}function b(x){return I9(x)}let w={get action(){return o},get location(){return t(a,r)},listen(x){if(c)throw new Error("A history only accepts one active listener");return a.addEventListener(GR,d),c=x,()=>{a.removeEventListener(GR,d),c=null}},createHref(x){return e(a,x)},createURL:b,encodeLocation(x){let S=b(x);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:p,replace:g,go(x){return r.go(x)}};return w}function I9(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),ai(n,"No window.location.(origin|href) available to create URL");let i=typeof t=="string"?t:Hf(t);return i=i.replace(/ $/,"%20"),!e&&i.startsWith("//")&&(i=n+i),new URL(i,n)}var db,KR=class{constructor(t){if(YW(this,db,new Map),t)for(let[e,n]of t)this.set(e,n)}get(t){if(G4(this,db).has(t))return G4(this,db).get(t);if(t.defaultValue!==void 0)return t.defaultValue;throw new Error("No value found for context")}set(t,e){G4(this,db).set(t,e)}};db=new WeakMap;var eK=new Set(["lazy","caseSensitive","path","id","index","children"]);function tK(t){return eK.has(t)}var nK=new Set(["lazy","caseSensitive","path","id","index","middleware","children"]);function iK(t){return nK.has(t)}function aK(t){return t.index===!0}function Kb(t,e,n=[],i={},a=!1){return t.map((s,r)=>{let o=[...n,String(r)],c=typeof s.id=="string"?s.id:o.join("-");if(ai(s.index!==!0||!s.children,"Cannot specify children on an index route"),ai(a||!i[c],`Found a route id collision on id "${c}". Route id's must be globally unique within Data Router usages`),aK(s)){let u={...s,...e(s),id:c};return i[c]=u,u}else{let u={...s,...e(s),id:c,children:void 0};return i[c]=u,s.children&&(u.children=Kb(s.children,e,o,i,a)),u}})}function Nf(t,e,n="/"){return iS(t,e,n,!1)}function iS(t,e,n,i){let a=typeof e=="string"?th(e):e,s=Cl(a.pathname||"/",n);if(s==null)return null;let r=z9(t);rK(r);let o=null;for(let c=0;o==null&&c<r.length;++c){let u=vK(s);o=mK(r[c],u,i)}return o}function sK(t,e){let{route:n,pathname:i,params:a}=t;return{id:n.id,pathname:i,params:a,data:e[n.id],loaderData:e[n.id],handle:n.handle}}function z9(t,e=[],n=[],i="",a=!1){let s=(r,o,c=a,u)=>{let h={relativePath:u===void 0?r.path||"":u,caseSensitive:r.caseSensitive===!0,childrenIndex:o,route:r};if(h.relativePath.startsWith("/")){if(!h.relativePath.startsWith(i)&&c)return;ai(h.relativePath.startsWith(i),`Absolute route path "${h.relativePath}" nested under path "${i}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),h.relativePath=h.relativePath.slice(i.length)}let d=du([i,h.relativePath]),p=n.concat(h);r.children&&r.children.length>0&&(ai(r.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${d}".`),z9(r.children,e,p,d,c)),!(r.path==null&&!r.index)&&e.push({path:d,score:hK(d,r.index),routesMeta:p})};return t.forEach((r,o)=>{if(r.path===""||!r.path?.includes("?"))s(r,o);else for(let c of B9(r.path))s(r,o,!0,c)}),e}function B9(t){let e=t.split("/");if(e.length===0)return[];let[n,...i]=e,a=n.endsWith("?"),s=n.replace(/\?$/,"");if(i.length===0)return a?[s,""]:[s];let r=B9(i.join("/")),o=[];return o.push(...r.map(c=>c===""?s:[s,c].join("/"))),a&&o.push(...r),o.map(c=>t.startsWith("/")&&c===""?"/":c)}function rK(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:pK(e.routesMeta.map(i=>i.childrenIndex),n.routesMeta.map(i=>i.childrenIndex)))}var oK=/^:[\w-]+$/,lK=3,cK=2,uK=1,dK=10,fK=-2,XR=t=>t==="*";function hK(t,e){let n=t.split("/"),i=n.length;return n.some(XR)&&(i+=fK),e&&(i+=cK),n.filter(a=>!XR(a)).reduce((a,s)=>a+(oK.test(s)?lK:s===""?uK:dK),i)}function pK(t,e){return t.length===e.length&&t.slice(0,-1).every((i,a)=>i===e[a])?t[t.length-1]-e[e.length-1]:0}function mK(t,e,n=!1){let{routesMeta:i}=t,a={},s="/",r=[];for(let o=0;o<i.length;++o){let c=i[o],u=o===i.length-1,h=s==="/"?e:e.slice(s.length)||"/",d=wS({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},h),p=c.route;if(!d&&u&&n&&!i[i.length-1].route.index&&(d=wS({path:c.relativePath,caseSensitive:c.caseSensitive,end:!1},h)),!d)return null;Object.assign(a,d.params),r.push({params:a,pathname:du([s,d.pathname]),pathnameBase:_K(du([s,d.pathnameBase])),route:p}),d.pathnameBase!=="/"&&(s=du([s,d.pathnameBase]))}return r}function wS(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,i]=gK(t.path,t.caseSensitive,t.end),a=e.match(n);if(!a)return null;let s=a[0],r=s.replace(/(.)\/+$/,"$1"),o=a.slice(1);return{params:i.reduce((u,{paramName:h,isOptional:d},p)=>{if(h==="*"){let b=o[p]||"";r=s.slice(0,s.length-b.length).replace(/(.)\/+$/,"$1")}const g=o[p];return d&&!g?u[h]=void 0:u[h]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:s,pathnameBase:r,pattern:t}}function gK(t,e=!1,n=!0){Za(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let i=[],a="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(r,o,c)=>(i.push({paramName:o,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(i.push({paramName:"*"}),a+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":t!==""&&t!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,e?void 0:"i"),i]}function vK(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Za(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function Cl(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,i=t.charAt(n);return i&&i!=="/"?null:t.slice(n)||"/"}function yK({basename:t,pathname:e}){return e==="/"?t:du([t,e])}function bK(t,e="/"){let{pathname:n,search:i="",hash:a=""}=typeof t=="string"?th(t):t;return{pathname:n?n.startsWith("/")?n:xK(n,e):e,search:SK(i),hash:wK(a)}}function xK(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function W4(t,e,n,i){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(i)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U9(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Z5(t){let e=U9(t);return e.map((n,i)=>i===e.length-1?n.pathname:n.pathnameBase)}function Q5(t,e,n,i=!1){let a;typeof t=="string"?a=th(t):(a={...t},ai(!a.pathname||!a.pathname.includes("?"),W4("?","pathname","search",a)),ai(!a.pathname||!a.pathname.includes("#"),W4("#","pathname","hash",a)),ai(!a.search||!a.search.includes("#"),W4("#","search","hash",a)));let s=t===""||a.pathname==="",r=s?"/":a.pathname,o;if(r==null)o=n;else{let d=e.length-1;if(!i&&r.startsWith("..")){let p=r.split("/");for(;p[0]==="..";)p.shift(),d-=1;a.pathname=p.join("/")}o=d>=0?e[d]:"/"}let c=bK(a,o),u=r&&r!=="/"&&r.endsWith("/"),h=(s||r===".")&&n.endsWith("/");return!c.pathname.endsWith("/")&&(u||h)&&(c.pathname+="/"),c}var du=t=>t.join("/").replace(/\/\/+/g,"/"),_K=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),SK=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,wK=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,ES=class{constructor(t,e,n,i=!1){this.status=t,this.statusText=e||"",this.internal=i,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Rg(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}var j9=["POST","PUT","PATCH","DELETE"],EK=new Set(j9),MK=["GET",...j9],TK=new Set(MK),CK=new Set([301,302,303,307,308]),AK=new Set([307,308]),K4={state:"idle",location:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},RK={state:"idle",data:void 0,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0},ky={state:"unblocked",proceed:void 0,reset:void 0,location:void 0},NK=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,J5=t=>NK.test(t),PK=t=>({hasErrorBoundary:!!t.hasErrorBoundary}),F9="remix-router-transitions",V9=Symbol("ResetLoaderData");function DK(t){const e=t.window?t.window:typeof window<"u"?window:void 0,n=typeof e<"u"&&typeof e.document<"u"&&typeof e.document.createElement<"u";ai(t.routes.length>0,"You must provide a non-empty routes array to createRouter");let i=t.hydrationRouteProperties||[],a=t.mapRouteProperties||PK,s={},r=Kb(t.routes,a,void 0,s),o,c=t.basename||"/";c.startsWith("/")||(c=`/${c}`);let u=t.dataStrategy||BK,h={...t.future},d=null,p=new Set,g=null,b=null,w=null,x=t.hydrationData!=null,S=Nf(r,t.history.location,c),M=!1,C=null,A;if(S==null&&!t.patchRoutesOnNavigation){let ge=vl(404,{pathname:t.history.location.pathname}),{matches:Se,route:De}=I2(r);A=!0,S=Se,C={[De.id]:ge}}else if(S&&!t.hydrationData&&Nt(S,r,t.history.location.pathname).active&&(S=null),S)if(S.some(ge=>ge.route.lazy))A=!1;else if(!S.some(ge=>eC(ge.route)))A=!0;else{let ge=t.hydrationData?t.hydrationData.loaderData:null,Se=t.hydrationData?t.hydrationData.errors:null;if(Se){let De=S.findIndex(lt=>Se[lt.route.id]!==void 0);A=S.slice(0,De+1).every(lt=>!cT(lt.route,ge,Se))}else A=S.every(De=>!cT(De.route,ge,Se))}else{A=!1,S=[];let ge=Nt(null,r,t.history.location.pathname);ge.active&&ge.matches&&(M=!0,S=ge.matches)}let N,R={historyAction:t.history.action,location:t.history.location,matches:S,initialized:A,navigation:K4,restoreScrollPosition:t.hydrationData!=null?!1:null,preventScrollReset:!1,revalidation:"idle",loaderData:t.hydrationData&&t.hydrationData.loaderData||{},actionData:t.hydrationData&&t.hydrationData.actionData||null,errors:t.hydrationData&&t.hydrationData.errors||C,fetchers:new Map,blockers:new Map},D="POP",B=!1,z,I=!1,U=new Map,$=null,G=!1,k=!1,X=new Set,V=new Map,H=0,W=-1,J=new Map,Y=new Set,K=new Map,ee=new Map,ie=new Set,Z=new Map,ue,se=null;function ae(){if(d=t.history.listen(({action:ge,location:Se,delta:De})=>{if(ue){ue(),ue=void 0;return}Za(Z.size===0||De!=null,"You are trying to use a blocker on a POP navigation to a location that was not created by @remix-run/router. This will fail silently in production. This can happen if you are navigating outside the router via `window.history.pushState`/`window.location.hash` instead of using router navigation APIs. This can also happen if you are using createHashRouter and the user manually changes the URL.");let lt=Te({currentLocation:R.location,nextLocation:Se,historyAction:ge});if(lt&&De!=null){let rt=new Promise(Bt=>{ue=Bt});t.history.go(De*-1),zt(lt,{state:"blocked",location:Se,proceed(){zt(lt,{state:"proceeding",proceed:void 0,reset:void 0,location:Se}),rt.then(()=>t.history.go(De))},reset(){let Bt=new Map(R.blockers);Bt.set(lt,ky),ye({blockers:Bt})}});return}return be(ge,Se)}),n){QK(e,U);let ge=()=>JK(e,U);e.addEventListener("pagehide",ge),$=()=>e.removeEventListener("pagehide",ge)}return R.initialized||be("POP",R.location,{initialHydration:!0}),N}function ce(){d&&d(),$&&$(),p.clear(),z&&z.abort(),R.fetchers.forEach((ge,Se)=>We(Se)),R.blockers.forEach((ge,Se)=>Et(Se))}function pe(ge){return p.add(ge),()=>p.delete(ge)}function ye(ge,Se={}){ge.matches&&(ge.matches=ge.matches.map(rt=>{let Bt=s[rt.route.id],Ut=rt.route;return Ut.element!==Bt.element||Ut.errorElement!==Bt.errorElement||Ut.hydrateFallbackElement!==Bt.hydrateFallbackElement?{...rt,route:Bt}:rt})),R={...R,...ge};let De=[],lt=[];R.fetchers.forEach((rt,Bt)=>{rt.state==="idle"&&(ie.has(Bt)?De.push(Bt):lt.push(Bt))}),ie.forEach(rt=>{!R.fetchers.has(rt)&&!V.has(rt)&&De.push(rt)}),[...p].forEach(rt=>rt(R,{deletedFetchers:De,viewTransitionOpts:Se.viewTransitionOpts,flushSync:Se.flushSync===!0})),De.forEach(rt=>We(rt)),lt.forEach(rt=>R.fetchers.delete(rt))}function _e(ge,Se,{flushSync:De}={}){let lt=R.actionData!=null&&R.navigation.formMethod!=null&&uo(R.navigation.formMethod)&&R.navigation.state==="loading"&&ge.state?._isRedirect!==!0,rt;Se.actionData?Object.keys(Se.actionData).length>0?rt=Se.actionData:rt=null:lt?rt=R.actionData:rt=null;let Bt=Se.loaderData?a8(R.loaderData,Se.loaderData,Se.matches||[],Se.errors):R.loaderData,Ut=R.blockers;Ut.size>0&&(Ut=new Map(Ut),Ut.forEach((vt,Ot)=>Ut.set(Ot,ky)));let Dt=G?!1:it(ge,Se.matches||R.matches),ot=B===!0||R.navigation.formMethod!=null&&uo(R.navigation.formMethod)&&ge.state?._isRedirect!==!0;o&&(r=o,o=void 0),G||D==="POP"||(D==="PUSH"?t.history.push(ge,ge.state):D==="REPLACE"&&t.history.replace(ge,ge.state));let Lt;if(D==="POP"){let vt=U.get(R.location.pathname);vt&&vt.has(ge.pathname)?Lt={currentLocation:R.location,nextLocation:ge}:U.has(ge.pathname)&&(Lt={currentLocation:ge,nextLocation:R.location})}else if(I){let vt=U.get(R.location.pathname);vt?vt.add(ge.pathname):(vt=new Set([ge.pathname]),U.set(R.location.pathname,vt)),Lt={currentLocation:R.location,nextLocation:ge}}ye({...Se,actionData:rt,loaderData:Bt,historyAction:D,location:ge,initialized:!0,navigation:K4,revalidation:"idle",restoreScrollPosition:Dt,preventScrollReset:ot,blockers:Ut},{viewTransitionOpts:Lt,flushSync:De===!0}),D="POP",B=!1,I=!1,G=!1,k=!1,se?.resolve(),se=null}async function me(ge,Se){if(typeof ge=="number"){t.history.go(ge);return}let De=lT(R.location,R.matches,c,ge,Se?.fromRouteId,Se?.relative),{path:lt,submission:rt,error:Bt}=qR(!1,De,Se),Ut=R.location,Dt=Wb(R.location,lt,Se&&Se.state);Dt={...Dt,...t.history.encodeLocation(Dt)};let ot=Se&&Se.replace!=null?Se.replace:void 0,Lt="PUSH";ot===!0?Lt="REPLACE":ot===!1||rt!=null&&uo(rt.formMethod)&&rt.formAction===R.location.pathname+R.location.search&&(Lt="REPLACE");let vt=Se&&"preventScrollReset"in Se?Se.preventScrollReset===!0:void 0,Ot=(Se&&Se.flushSync)===!0,Mt=Te({currentLocation:Ut,nextLocation:Dt,historyAction:Lt});if(Mt){zt(Mt,{state:"blocked",location:Dt,proceed(){zt(Mt,{state:"proceeding",proceed:void 0,reset:void 0,location:Dt}),me(ge,Se)},reset(){let Ln=new Map(R.blockers);Ln.set(Mt,ky),ye({blockers:Ln})}});return}await be(Lt,Dt,{submission:rt,pendingError:Bt,preventScrollReset:vt,replace:Se&&Se.replace,enableViewTransition:Se&&Se.viewTransition,flushSync:Ot})}function ne(){se||(se=eX()),we(),ye({revalidation:"loading"});let ge=se.promise;return R.navigation.state==="submitting"?ge:R.navigation.state==="idle"?(be(R.historyAction,R.location,{startUninterruptedRevalidation:!0}),ge):(be(D||R.historyAction,R.navigation.location,{overrideNavigation:R.navigation,enableViewTransition:I===!0}),ge)}async function be(ge,Se,De){z&&z.abort(),z=null,D=ge,G=(De&&De.startUninterruptedRevalidation)===!0,ct(R.location,R.matches),B=(De&&De.preventScrollReset)===!0,I=(De&&De.enableViewTransition)===!0;let lt=o||r,rt=De&&De.overrideNavigation,Bt=De?.initialHydration&&R.matches&&R.matches.length>0&&!M?R.matches:Nf(lt,Se,c),Ut=(De&&De.flushSync)===!0;if(Bt&&R.initialized&&!k&&GK(R.location,Se)&&!(De&&De.submission&&uo(De.submission.formMethod))){_e(Se,{matches:Bt},{flushSync:Ut});return}let Dt=Nt(Bt,lt,Se.pathname);if(Dt.active&&Dt.matches&&(Bt=Dt.matches),!Bt){let{error:aa,notFoundMatches:ei,route:Fn}=pt(Se.pathname);_e(Se,{matches:ei,loaderData:{},errors:{[Fn.id]:aa}},{flushSync:Ut});return}z=new AbortController;let ot=ag(t.history,Se,z.signal,De&&De.submission),Lt=t.getContext?await t.getContext():new KR,vt;if(De&&De.pendingError)vt=[Pf(Bt).route.id,{type:"error",error:De.pendingError}];else if(De&&De.submission&&uo(De.submission.formMethod)){let aa=await xe(ot,Se,De.submission,Bt,Lt,Dt.active,De&&De.initialHydration===!0,{replace:De.replace,flushSync:Ut});if(aa.shortCircuited)return;if(aa.pendingActionResult){let[ei,Fn]=aa.pendingActionResult;if(Io(Fn)&&Rg(Fn.error)&&Fn.error.status===404){z=null,_e(Se,{matches:aa.matches,loaderData:{},errors:{[ei]:Fn.error}});return}}Bt=aa.matches||Bt,vt=aa.pendingActionResult,rt=X4(Se,De.submission),Ut=!1,Dt.active=!1,ot=ag(t.history,ot.url,ot.signal)}let{shortCircuited:Ot,matches:Mt,loaderData:Ln,errors:wi}=await he(ot,Se,Bt,Lt,Dt.active,rt,De&&De.submission,De&&De.fetcherSubmission,De&&De.replace,De&&De.initialHydration===!0,Ut,vt);Ot||(z=null,_e(Se,{matches:Mt||Bt,...s8(vt),loaderData:Ln,errors:wi}))}async function xe(ge,Se,De,lt,rt,Bt,Ut,Dt={}){we();let ot=YK(Se,De);if(ye({navigation:ot},{flushSync:Dt.flushSync===!0}),Bt){let Ot=await kt(lt,Se.pathname,ge.signal);if(Ot.type==="aborted")return{shortCircuited:!0};if(Ot.type==="error"){if(Ot.partialMatches.length===0){let{matches:Ln,route:wi}=I2(r);return{matches:Ln,pendingActionResult:[wi.id,{type:"error",error:Ot.error}]}}let Mt=Pf(Ot.partialMatches).route.id;return{matches:Ot.partialMatches,pendingActionResult:[Mt,{type:"error",error:Ot.error}]}}else if(Ot.matches)lt=Ot.matches;else{let{notFoundMatches:Mt,error:Ln,route:wi}=pt(Se.pathname);return{matches:Mt,pendingActionResult:[wi.id,{type:"error",error:Ln}]}}}let Lt,vt=aS(lt,Se);if(!vt.route.action&&!vt.route.lazy)Lt={type:"error",error:vl(405,{method:ge.method,pathname:Se.pathname,routeId:vt.route.id})};else{let Ot=_g(a,s,ge,lt,vt,Ut?[]:i,rt),Mt=await re(ge,Ot,rt,null);if(Lt=Mt[vt.route.id],!Lt){for(let Ln of lt)if(Mt[Ln.route.id]){Lt=Mt[Ln.route.id];break}}if(ge.signal.aborted)return{shortCircuited:!0}}if(Pp(Lt)){let Ot;return Dt&&Dt.replace!=null?Ot=Dt.replace:Ot=t8(Lt.response.headers.get("Location"),new URL(ge.url),c)===R.location.pathname+R.location.search,await tt(ge,Lt,!0,{submission:De,replace:Ot}),{shortCircuited:!0}}if(Io(Lt)){let Ot=Pf(lt,vt.route.id);return(Dt&&Dt.replace)!==!0&&(D="PUSH"),{matches:lt,pendingActionResult:[Ot.route.id,Lt,vt.route.id]}}return{matches:lt,pendingActionResult:[vt.route.id,Lt]}}async function he(ge,Se,De,lt,rt,Bt,Ut,Dt,ot,Lt,vt,Ot){let Mt=Bt||X4(Se,Ut),Ln=Ut||Dt||o8(Mt),wi=!G&&!Lt;if(rt){if(wi){let qt=ve(Ot);ye({navigation:Mt,...qt!==void 0?{actionData:qt}:{}},{flushSync:vt})}let Tt=await kt(De,Se.pathname,ge.signal);if(Tt.type==="aborted")return{shortCircuited:!0};if(Tt.type==="error"){if(Tt.partialMatches.length===0){let{matches:Jt,route:xn}=I2(r);return{matches:Jt,loaderData:{},errors:{[xn.id]:Tt.error}}}let qt=Pf(Tt.partialMatches).route.id;return{matches:Tt.partialMatches,loaderData:{},errors:{[qt]:Tt.error}}}else if(Tt.matches)De=Tt.matches;else{let{error:qt,notFoundMatches:Jt,route:xn}=pt(Se.pathname);return{matches:Jt,loaderData:{},errors:{[xn.id]:qt}}}}let aa=o||r,{dsMatches:ei,revalidatingFetchers:Fn}=YR(ge,lt,a,s,t.history,R,De,Ln,Se,Lt?[]:i,Lt===!0,k,X,ie,K,Y,aa,c,t.patchRoutesOnNavigation!=null,Ot);if(W=++H,!t.dataStrategy&&!ei.some(Tt=>Tt.shouldLoad)&&!ei.some(Tt=>Tt.route.middleware&&Tt.route.middleware.length>0)&&Fn.length===0){let Tt=Je();return _e(Se,{matches:De,loaderData:{},errors:Ot&&Io(Ot[1])?{[Ot[0]]:Ot[1].error}:null,...s8(Ot),...Tt?{fetchers:new Map(R.fetchers)}:{}},{flushSync:vt}),{shortCircuited:!0}}if(wi){let Tt={};if(!rt){Tt.navigation=Mt;let qt=ve(Ot);qt!==void 0&&(Tt.actionData=qt)}Fn.length>0&&(Tt.fetchers=Oe(Fn)),ye(Tt,{flushSync:vt})}Fn.forEach(Tt=>{nt(Tt.key),Tt.controller&&V.set(Tt.key,Tt.controller)});let le=()=>Fn.forEach(Tt=>nt(Tt.key));z&&z.signal.addEventListener("abort",le);let{loaderResults:Re,fetcherResults:Be}=await te(ei,Fn,ge,lt);if(ge.signal.aborted)return{shortCircuited:!0};z&&z.signal.removeEventListener("abort",le),Fn.forEach(Tt=>V.delete(Tt.key));let ke=z2(Re);if(ke)return await tt(ge,ke.result,!0,{replace:ot}),{shortCircuited:!0};if(ke=z2(Be),ke)return Y.add(ke.key),await tt(ge,ke.result,!0,{replace:ot}),{shortCircuited:!0};let{loaderData:ze,errors:yt}=i8(R,De,Re,Ot,Fn,Be);Lt&&R.errors&&(yt={...R.errors,...yt});let Pt=Je(),Ht=jt(W),Ke=Pt||Ht||Fn.length>0;return{matches:De,loaderData:ze,errors:yt,...Ke?{fetchers:new Map(R.fetchers)}:{}}}function ve(ge){if(ge&&!Io(ge[1]))return{[ge[0]]:ge[1].data};if(R.actionData)return Object.keys(R.actionData).length===0?null:R.actionData}function Oe(ge){return ge.forEach(Se=>{let De=R.fetchers.get(Se.key),lt=Hy(void 0,De?De.data:void 0);R.fetchers.set(Se.key,lt)}),new Map(R.fetchers)}async function Le(ge,Se,De,lt){nt(ge);let rt=(lt&&lt.flushSync)===!0,Bt=o||r,Ut=lT(R.location,R.matches,c,De,Se,lt?.relative),Dt=Nf(Bt,Ut,c),ot=Nt(Dt,Bt,Ut);if(ot.active&&ot.matches&&(Dt=ot.matches),!Dt){Ie(ge,Se,vl(404,{pathname:Ut}),{flushSync:rt});return}let{path:Lt,submission:vt,error:Ot}=qR(!0,Ut,lt);if(Ot){Ie(ge,Se,Ot,{flushSync:rt});return}let Mt=t.getContext?await t.getContext():new KR,Ln=(lt&&lt.preventScrollReset)===!0;if(vt&&uo(vt.formMethod)){await Ae(ge,Se,Lt,Dt,Mt,ot.active,rt,Ln,vt);return}K.set(ge,{routeId:Se,path:Lt}),await et(ge,Se,Lt,Dt,Mt,ot.active,rt,Ln,vt)}async function Ae(ge,Se,De,lt,rt,Bt,Ut,Dt,ot){we(),K.delete(ge);let Lt=R.fetchers.get(ge);Ce(ge,ZK(ot,Lt),{flushSync:Ut});let vt=new AbortController,Ot=ag(t.history,De,vt.signal,ot);if(Bt){let vn=await kt(lt,new URL(Ot.url).pathname,Ot.signal,ge);if(vn.type==="aborted")return;if(vn.type==="error"){Ie(ge,Se,vn.error,{flushSync:Ut});return}else if(vn.matches)lt=vn.matches;else{Ie(ge,Se,vl(404,{pathname:De}),{flushSync:Ut});return}}let Mt=aS(lt,De);if(!Mt.route.action&&!Mt.route.lazy){let vn=vl(405,{method:ot.formMethod,pathname:De,routeId:Se});Ie(ge,Se,vn,{flushSync:Ut});return}V.set(ge,vt);let Ln=H,wi=_g(a,s,Ot,lt,Mt,i,rt),ei=(await re(Ot,wi,rt,ge))[Mt.route.id];if(Ot.signal.aborted){V.get(ge)===vt&&V.delete(ge);return}if(ie.has(ge)){if(Pp(ei)||Io(ei)){Ce(ge,fd(void 0));return}}else{if(Pp(ei))if(V.delete(ge),W>Ln){Ce(ge,fd(void 0));return}else return Y.add(ge),Ce(ge,Hy(ot)),tt(Ot,ei,!1,{fetcherSubmission:ot,preventScrollReset:Dt});if(Io(ei)){Ie(ge,Se,ei.error);return}}let Fn=R.navigation.location||R.location,le=ag(t.history,Fn,vt.signal),Re=o||r,Be=R.navigation.state!=="idle"?Nf(Re,R.navigation.location,c):R.matches;ai(Be,"Didn't find any matches after fetcher action");let ke=++H;J.set(ge,ke);let ze=Hy(ot,ei.data);R.fetchers.set(ge,ze);let{dsMatches:yt,revalidatingFetchers:Pt}=YR(le,rt,a,s,t.history,R,Be,ot,Fn,i,!1,k,X,ie,K,Y,Re,c,t.patchRoutesOnNavigation!=null,[Mt.route.id,ei]);Pt.filter(vn=>vn.key!==ge).forEach(vn=>{let ui=vn.key,si=R.fetchers.get(ui),zn=Hy(void 0,si?si.data:void 0);R.fetchers.set(ui,zn),nt(ui),vn.controller&&V.set(ui,vn.controller)}),ye({fetchers:new Map(R.fetchers)});let Ht=()=>Pt.forEach(vn=>nt(vn.key));vt.signal.addEventListener("abort",Ht);let{loaderResults:Ke,fetcherResults:Tt}=await te(yt,Pt,le,rt);if(vt.signal.aborted)return;if(vt.signal.removeEventListener("abort",Ht),J.delete(ge),V.delete(ge),Pt.forEach(vn=>V.delete(vn.key)),R.fetchers.has(ge)){let vn=fd(ei.data);R.fetchers.set(ge,vn)}let qt=z2(Ke);if(qt)return tt(le,qt.result,!1,{preventScrollReset:Dt});if(qt=z2(Tt),qt)return Y.add(qt.key),tt(le,qt.result,!1,{preventScrollReset:Dt});let{loaderData:Jt,errors:xn}=i8(R,Be,Ke,void 0,Pt,Tt);jt(ke),R.navigation.state==="loading"&&ke>W?(ai(D,"Expected pending action"),z&&z.abort(),_e(R.navigation.location,{matches:Be,loaderData:Jt,errors:xn,fetchers:new Map(R.fetchers)})):(ye({errors:xn,loaderData:a8(R.loaderData,Jt,Be,xn),fetchers:new Map(R.fetchers)}),k=!1)}async function et(ge,Se,De,lt,rt,Bt,Ut,Dt,ot){let Lt=R.fetchers.get(ge);Ce(ge,Hy(ot,Lt?Lt.data:void 0),{flushSync:Ut});let vt=new AbortController,Ot=ag(t.history,De,vt.signal);if(Bt){let Fn=await kt(lt,new URL(Ot.url).pathname,Ot.signal,ge);if(Fn.type==="aborted")return;if(Fn.type==="error"){Ie(ge,Se,Fn.error,{flushSync:Ut});return}else if(Fn.matches)lt=Fn.matches;else{Ie(ge,Se,vl(404,{pathname:De}),{flushSync:Ut});return}}let Mt=aS(lt,De);V.set(ge,vt);let Ln=H,wi=_g(a,s,Ot,lt,Mt,i,rt),ei=(await re(Ot,wi,rt,ge))[Mt.route.id];if(V.get(ge)===vt&&V.delete(ge),!Ot.signal.aborted){if(ie.has(ge)){Ce(ge,fd(void 0));return}if(Pp(ei))if(W>Ln){Ce(ge,fd(void 0));return}else{Y.add(ge),await tt(Ot,ei,!1,{preventScrollReset:Dt});return}if(Io(ei)){Ie(ge,Se,ei.error);return}Ce(ge,fd(ei.data))}}async function tt(ge,Se,De,{submission:lt,fetcherSubmission:rt,preventScrollReset:Bt,replace:Ut}={}){Se.response.headers.has("X-Remix-Revalidate")&&(k=!0);let Dt=Se.response.headers.get("Location");ai(Dt,"Expected a Location header on the redirect Response"),Dt=t8(Dt,new URL(ge.url),c);let ot=Wb(R.location,Dt,{_isRedirect:!0});if(n){let wi=!1;if(Se.response.headers.has("X-Remix-Reload-Document"))wi=!0;else if(J5(Dt)){const aa=I9(Dt,!0);wi=aa.origin!==e.location.origin||Cl(aa.pathname,c)==null}if(wi){Ut?e.location.replace(Dt):e.location.assign(Dt);return}}z=null;let Lt=Ut===!0||Se.response.headers.has("X-Remix-Replace")?"REPLACE":"PUSH",{formMethod:vt,formAction:Ot,formEncType:Mt}=R.navigation;!lt&&!rt&&vt&&Ot&&Mt&&(lt=o8(R.navigation));let Ln=lt||rt;if(AK.has(Se.response.status)&&Ln&&uo(Ln.formMethod))await be(Lt,ot,{submission:{...Ln,formAction:Dt},preventScrollReset:Bt||B,enableViewTransition:De?I:void 0});else{let wi=X4(ot,lt);await be(Lt,ot,{overrideNavigation:wi,fetcherSubmission:rt,preventScrollReset:Bt||B,enableViewTransition:De?I:void 0})}}async function re(ge,Se,De,lt){let rt,Bt={};try{rt=await jK(u,ge,Se,lt,De,!1)}catch(Ut){return Se.filter(Dt=>Dt.shouldLoad).forEach(Dt=>{Bt[Dt.route.id]={type:"error",error:Ut}}),Bt}if(ge.signal.aborted)return Bt;for(let[Ut,Dt]of Object.entries(rt))if(XK(Dt)){let ot=Dt.result;Bt[Ut]={type:"redirect",response:HK(ot,ge,Ut,Se,c)}}else Bt[Ut]=await kK(Dt);return Bt}async function te(ge,Se,De,lt){let rt=re(De,ge,lt,null),Bt=Promise.all(Se.map(async ot=>{if(ot.matches&&ot.match&&ot.request&&ot.controller){let vt=(await re(ot.request,ot.matches,lt,ot.key))[ot.match.route.id];return{[ot.key]:vt}}else return Promise.resolve({[ot.key]:{type:"error",error:vl(404,{pathname:ot.path})}})})),Ut=await rt,Dt=(await Bt).reduce((ot,Lt)=>Object.assign(ot,Lt),{});return{loaderResults:Ut,fetcherResults:Dt}}function we(){k=!0,K.forEach((ge,Se)=>{V.has(Se)&&X.add(Se),nt(Se)})}function Ce(ge,Se,De={}){R.fetchers.set(ge,Se),ye({fetchers:new Map(R.fetchers)},{flushSync:(De&&De.flushSync)===!0})}function Ie(ge,Se,De,lt={}){let rt=Pf(R.matches,Se);We(ge),ye({errors:{[rt.route.id]:De},fetchers:new Map(R.fetchers)},{flushSync:(lt&&lt.flushSync)===!0})}function Pe(ge){return ee.set(ge,(ee.get(ge)||0)+1),ie.has(ge)&&ie.delete(ge),R.fetchers.get(ge)||RK}function Ze(ge,Se){nt(ge,Se?.reason),Ce(ge,fd(null))}function We(ge){let Se=R.fetchers.get(ge);V.has(ge)&&!(Se&&Se.state==="loading"&&J.has(ge))&&nt(ge),K.delete(ge),J.delete(ge),Y.delete(ge),ie.delete(ge),X.delete(ge),R.fetchers.delete(ge)}function mt(ge){let Se=(ee.get(ge)||0)-1;Se<=0?(ee.delete(ge),ie.add(ge)):ee.set(ge,Se),ye({fetchers:new Map(R.fetchers)})}function nt(ge,Se){let De=V.get(ge);De&&(De.abort(Se),V.delete(ge))}function Ye(ge){for(let Se of ge){let De=Pe(Se),lt=fd(De.data);R.fetchers.set(Se,lt)}}function Je(){let ge=[],Se=!1;for(let De of Y){let lt=R.fetchers.get(De);ai(lt,`Expected fetcher: ${De}`),lt.state==="loading"&&(Y.delete(De),ge.push(De),Se=!0)}return Ye(ge),Se}function jt(ge){let Se=[];for(let[De,lt]of J)if(lt<ge){let rt=R.fetchers.get(De);ai(rt,`Expected fetcher: ${De}`),rt.state==="loading"&&(nt(De),J.delete(De),Se.push(De))}return Ye(Se),Se.length>0}function wt(ge,Se){let De=R.blockers.get(ge)||ky;return Z.get(ge)!==Se&&Z.set(ge,Se),De}function Et(ge){R.blockers.delete(ge),Z.delete(ge)}function zt(ge,Se){let De=R.blockers.get(ge)||ky;ai(De.state==="unblocked"&&Se.state==="blocked"||De.state==="blocked"&&Se.state==="blocked"||De.state==="blocked"&&Se.state==="proceeding"||De.state==="blocked"&&Se.state==="unblocked"||De.state==="proceeding"&&Se.state==="unblocked",`Invalid blocker state transition: ${De.state} -> ${Se.state}`);let lt=new Map(R.blockers);lt.set(ge,Se),ye({blockers:lt})}function Te({currentLocation:ge,nextLocation:Se,historyAction:De}){if(Z.size===0)return;Z.size>1&&Za(!1,"A router only supports one blocker at a time");let lt=Array.from(Z.entries()),[rt,Bt]=lt[lt.length-1],Ut=R.blockers.get(rt);if(!(Ut&&Ut.state==="proceeding")&&Bt({currentLocation:ge,nextLocation:Se,historyAction:De}))return rt}function pt(ge){let Se=vl(404,{pathname:ge}),De=o||r,{matches:lt,route:rt}=I2(De);return{notFoundMatches:lt,route:rt,error:Se}}function at(ge,Se,De){if(g=ge,w=Se,b=De||null,!x&&R.navigation===K4){x=!0;let lt=it(R.location,R.matches);lt!=null&&ye({restoreScrollPosition:lt})}return()=>{g=null,w=null,b=null}}function St(ge,Se){return b&&b(ge,Se.map(lt=>sK(lt,R.loaderData)))||ge.key}function ct(ge,Se){if(g&&w){let De=St(ge,Se);g[De]=w()}}function it(ge,Se){if(g){let De=St(ge,Se),lt=g[De];if(typeof lt=="number")return lt}return null}function Nt(ge,Se,De){if(t.patchRoutesOnNavigation)if(ge){if(Object.keys(ge[0].params).length>0)return{active:!0,matches:iS(Se,De,c,!0)}}else return{active:!0,matches:iS(Se,De,c,!0)||[]};return{active:!1,matches:null}}async function kt(ge,Se,De,lt){if(!t.patchRoutesOnNavigation)return{type:"success",matches:ge};let rt=ge;for(;;){let Bt=o==null,Ut=o||r,Dt=s;try{await t.patchRoutesOnNavigation({signal:De,path:Se,matches:rt,fetcherKey:lt,patch:(vt,Ot)=>{De.aborted||ZR(vt,Ot,Ut,Dt,a,!1)}})}catch(vt){return{type:"error",error:vt,partialMatches:rt}}finally{Bt&&!De.aborted&&(r=[...r])}if(De.aborted)return{type:"aborted"};let ot=Nf(Ut,Se,c);if(ot)return{type:"success",matches:ot};let Lt=iS(Ut,Se,c,!0);if(!Lt||rt.length===Lt.length&&rt.every((vt,Ot)=>vt.route.id===Lt[Ot].route.id))return{type:"success",matches:null};rt=Lt}}function Xt(ge){s={},o=Kb(ge,a,void 0,s)}function rn(ge,Se,De=!1){let lt=o==null;ZR(ge,Se,o||r,s,a,De),lt&&(r=[...r],ye({}))}return N={get basename(){return c},get future(){return h},get state(){return R},get routes(){return r},get window(){return e},initialize:ae,subscribe:pe,enableScrollRestoration:at,navigate:me,fetch:Le,revalidate:ne,createHref:ge=>t.history.createHref(ge),encodeLocation:ge=>t.history.encodeLocation(ge),getFetcher:Pe,resetFetcher:Ze,deleteFetcher:mt,dispose:ce,getBlocker:wt,deleteBlocker:Et,patchRoutes:rn,_internalFetchControllers:V,_internalSetRoutes:Xt,_internalSetStateDoNotUseOrYouWillBreakYourApp(ge){ye(ge)}},N}function LK(t){return t!=null&&("formData"in t&&t.formData!=null||"body"in t&&t.body!==void 0)}function lT(t,e,n,i,a,s){let r,o;if(a){r=[];for(let u of e)if(r.push(u),u.route.id===a){o=u;break}}else r=e,o=e[e.length-1];let c=Q5(i||".",Z5(r),Cl(t.pathname,n)||t.pathname,s==="path");if(i==null&&(c.search=t.search,c.hash=t.hash),(i==null||i===""||i===".")&&o){let u=tC(c.search);if(o.route.index&&!u)c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index";else if(!o.route.index&&u){let h=new URLSearchParams(c.search),d=h.getAll("index");h.delete("index"),d.filter(g=>g).forEach(g=>h.append("index",g));let p=h.toString();c.search=p?`?${p}`:""}}return n!=="/"&&(c.pathname=yK({basename:n,pathname:c.pathname})),Hf(c)}function qR(t,e,n){if(!n||!LK(n))return{path:e};if(n.formMethod&&!qK(n.formMethod))return{path:e,error:vl(405,{method:n.formMethod})};let i=()=>({path:e,error:vl(400,{type:"invalid-body"})}),s=(n.formMethod||"get").toUpperCase(),r=K9(e);if(n.body!==void 0){if(n.formEncType==="text/plain"){if(!uo(s))return i();let d=typeof n.body=="string"?n.body:n.body instanceof FormData||n.body instanceof URLSearchParams?Array.from(n.body.entries()).reduce((p,[g,b])=>`${p}${g}=${b}
`,""):String(n.body);return{path:e,submission:{formMethod:s,formAction:r,formEncType:n.formEncType,formData:void 0,json:void 0,text:d}}}else if(n.formEncType==="application/json"){if(!uo(s))return i();try{let d=typeof n.body=="string"?JSON.parse(n.body):n.body;return{path:e,submission:{formMethod:s,formAction:r,formEncType:n.formEncType,formData:void 0,json:d,text:void 0}}}catch{return i()}}}ai(typeof FormData=="function","FormData is not available in this environment");let o,c;if(n.formData)o=dT(n.formData),c=n.formData;else if(n.body instanceof FormData)o=dT(n.body),c=n.body;else if(n.body instanceof URLSearchParams)o=n.body,c=n8(o);else if(n.body==null)o=new URLSearchParams,c=new FormData;else try{o=new URLSearchParams(n.body),c=n8(o)}catch{return i()}let u={formMethod:s,formAction:r,formEncType:n&&n.formEncType||"application/x-www-form-urlencoded",formData:c,json:void 0,text:void 0};if(uo(u.formMethod))return{path:e,submission:u};let h=th(e);return t&&h.search&&tC(h.search)&&o.append("index",""),h.search=`?${o}`,{path:Hf(h),submission:u}}function YR(t,e,n,i,a,s,r,o,c,u,h,d,p,g,b,w,x,S,M,C){let A=C?Io(C[1])?C[1].error:C[1].data:void 0,N=a.createURL(s.location),R=a.createURL(c),D;if(h&&s.errors){let G=Object.keys(s.errors)[0];D=r.findIndex(k=>k.route.id===G)}else if(C&&Io(C[1])){let G=C[0];D=r.findIndex(k=>k.route.id===G)-1}let B=C?C[1].statusCode:void 0,z=B&&B>=400,I={currentUrl:N,currentParams:s.matches[0]?.params||{},nextUrl:R,nextParams:r[0].params,...o,actionResult:A,actionStatus:B},U=r.map((G,k)=>{let{route:X}=G,V=null;if(D!=null&&k>D?V=!1:X.lazy?V=!0:eC(X)?h?V=cT(X,s.loaderData,s.errors):OK(s.loaderData,s.matches[k],G)&&(V=!0):V=!1,V!==null)return uT(n,i,t,G,u,e,V);let H=z?!1:d||N.pathname+N.search===R.pathname+R.search||N.search!==R.search||IK(s.matches[k],G),W={...I,defaultShouldRevalidate:H},J=MS(G,W);return uT(n,i,t,G,u,e,J,W)}),$=[];return b.forEach((G,k)=>{if(h||!r.some(ee=>ee.route.id===G.routeId)||g.has(k))return;let X=s.fetchers.get(k),V=X&&X.state!=="idle"&&X.data===void 0,H=Nf(x,G.path,S);if(!H){if(M&&V)return;$.push({key:k,routeId:G.routeId,path:G.path,matches:null,match:null,request:null,controller:null});return}if(w.has(k))return;let W=aS(H,G.path),J=new AbortController,Y=ag(a,G.path,J.signal),K=null;if(p.has(k))p.delete(k),K=_g(n,i,Y,H,W,u,e);else if(V)d&&(K=_g(n,i,Y,H,W,u,e));else{let ee={...I,defaultShouldRevalidate:z?!1:d};MS(W,ee)&&(K=_g(n,i,Y,H,W,u,e,ee))}K&&$.push({key:k,routeId:G.routeId,path:G.path,matches:K,match:W,request:Y,controller:J})}),{dsMatches:U,revalidatingFetchers:$}}function eC(t){return t.loader!=null||t.middleware!=null&&t.middleware.length>0}function cT(t,e,n){if(t.lazy)return!0;if(!eC(t))return!1;let i=e!=null&&t.id in e,a=n!=null&&n[t.id]!==void 0;return!i&&a?!1:typeof t.loader=="function"&&t.loader.hydrate===!0?!0:!i&&!a}function OK(t,e,n){let i=!e||n.route.id!==e.route.id,a=!t.hasOwnProperty(n.route.id);return i||a}function IK(t,e){let n=t.route.path;return t.pathname!==e.pathname||n!=null&&n.endsWith("*")&&t.params["*"]!==e.params["*"]}function MS(t,e){if(t.route.shouldRevalidate){let n=t.route.shouldRevalidate(e);if(typeof n=="boolean")return n}return e.defaultShouldRevalidate}function ZR(t,e,n,i,a,s){let r;if(t){let u=i[t];ai(u,`No route found to patch children into: routeId = ${t}`),u.children||(u.children=[]),r=u.children}else r=n;let o=[],c=[];if(e.forEach(u=>{let h=r.find(d=>k9(u,d));h?c.push({existingRoute:h,newRoute:u}):o.push(u)}),o.length>0){let u=Kb(o,a,[t||"_","patch",String(r?.length||"0")],i);r.push(...u)}if(s&&c.length>0)for(let u=0;u<c.length;u++){let{existingRoute:h,newRoute:d}=c[u],p=h,[g]=Kb([d],a,[],{},!0);Object.assign(p,{element:g.element?g.element:p.element,errorElement:g.errorElement?g.errorElement:p.errorElement,hydrateFallbackElement:g.hydrateFallbackElement?g.hydrateFallbackElement:p.hydrateFallbackElement})}}function k9(t,e){return"id"in t&&"id"in e&&t.id===e.id?!0:t.index===e.index&&t.path===e.path&&t.caseSensitive===e.caseSensitive?(!t.children||t.children.length===0)&&(!e.children||e.children.length===0)?!0:t.children.every((n,i)=>e.children?.some(a=>k9(n,a))):!1}var QR=new WeakMap,H9=({key:t,route:e,manifest:n,mapRouteProperties:i})=>{let a=n[e.id];if(ai(a,"No route found in manifest"),!a.lazy||typeof a.lazy!="object")return;let s=a.lazy[t];if(!s)return;let r=QR.get(a);r||(r={},QR.set(a,r));let o=r[t];if(o)return o;let c=(async()=>{let u=tK(t),d=a[t]!==void 0&&t!=="hasErrorBoundary";if(u)Za(!u,"Route property "+t+" is not a supported lazy route property. This property will be ignored."),r[t]=Promise.resolve();else if(d)Za(!1,`Route "${a.id}" has a static property "${t}" defined. The lazy property will be ignored.`);else{let p=await s();p!=null&&(Object.assign(a,{[t]:p}),Object.assign(a,i(a)))}typeof a.lazy=="object"&&(a.lazy[t]=void 0,Object.values(a.lazy).every(p=>p===void 0)&&(a.lazy=void 0))})();return r[t]=c,c},JR=new WeakMap;function zK(t,e,n,i,a){let s=n[t.id];if(ai(s,"No route found in manifest"),!t.lazy)return{lazyRoutePromise:void 0,lazyHandlerPromise:void 0};if(typeof t.lazy=="function"){let h=JR.get(s);if(h)return{lazyRoutePromise:h,lazyHandlerPromise:h};let d=(async()=>{ai(typeof t.lazy=="function","No lazy route function found");let p=await t.lazy(),g={};for(let b in p){let w=p[b];if(w===void 0)continue;let x=iK(b),M=s[b]!==void 0&&b!=="hasErrorBoundary";x?Za(!x,"Route property "+b+" is not a supported property to be returned from a lazy route function. This property will be ignored."):M?Za(!M,`Route "${s.id}" has a static property "${b}" defined but its lazy function is also returning a value for this property. The lazy route property "${b}" will be ignored.`):g[b]=w}Object.assign(s,g),Object.assign(s,{...i(s),lazy:void 0})})();return JR.set(s,d),d.catch(()=>{}),{lazyRoutePromise:d,lazyHandlerPromise:d}}let r=Object.keys(t.lazy),o=[],c;for(let h of r){if(a&&a.includes(h))continue;let d=H9({key:h,route:t,manifest:n,mapRouteProperties:i});d&&(o.push(d),h===e&&(c=d))}let u=o.length>0?Promise.all(o).then(()=>{}):void 0;return u?.catch(()=>{}),c?.catch(()=>{}),{lazyRoutePromise:u,lazyHandlerPromise:c}}async function e8(t){let e=t.matches.filter(a=>a.shouldLoad),n={};return(await Promise.all(e.map(a=>a.resolve()))).forEach((a,s)=>{n[e[s].route.id]=a}),n}async function BK(t){return t.matches.some(e=>e.route.middleware)?$9(t,()=>e8(t)):e8(t)}function $9(t,e){return UK(t,e,i=>i,WK,n);function n(i,a,s){if(s)return Promise.resolve(Object.assign(s.value,{[a]:{type:"error",result:i}}));{let{matches:r}=t,o=Math.min(Math.max(r.findIndex(u=>u.route.id===a),0),Math.max(r.findIndex(u=>u.unstable_shouldCallHandler()),0)),c=Pf(r,r[o].route.id).route.id;return Promise.resolve({[c]:{type:"error",result:i}})}}}async function UK(t,e,n,i,a){let{matches:s,request:r,params:o,context:c}=t,u=s.flatMap(d=>d.route.middleware?d.route.middleware.map(p=>[d.route.id,p]):[]);return await G9({request:r,params:o,context:c},u,e,n,i,a)}async function G9(t,e,n,i,a,s,r=0){let{request:o}=t;if(o.signal.aborted)throw o.signal.reason??new Error(`Request aborted: ${o.method} ${o.url}`);let c=e[r];if(!c)return await n();let[u,h]=c,d,p=async()=>{if(d)throw new Error("You may only call `next()` once per middleware");try{return d={value:await G9(t,e,n,i,a,s,r+1)},d.value}catch(g){return d={value:await s(g,u,d)},d.value}};try{let g=await h(t,p),b=g!=null?i(g):void 0;return a(b)?b:d?b??d.value:(d={value:await p()},d.value)}catch(g){return await s(g,u,d)}}function W9(t,e,n,i,a){let s=H9({key:"middleware",route:i.route,manifest:e,mapRouteProperties:t}),r=zK(i.route,uo(n.method)?"action":"loader",e,t,a);return{middleware:s,route:r.lazyRoutePromise,handler:r.lazyHandlerPromise}}function uT(t,e,n,i,a,s,r,o=null){let c=!1,u=W9(t,e,n,i,a);return{...i,_lazyPromises:u,shouldLoad:r,unstable_shouldRevalidateArgs:o,unstable_shouldCallHandler(h){return c=!0,o?typeof h=="boolean"?MS(i,{...o,defaultShouldRevalidate:h}):MS(i,o):r},resolve(h){let{lazy:d,loader:p,middleware:g}=i.route,b=c||r||h&&!uo(n.method)&&(d||p),w=g&&g.length>0&&!p&&!d;return b&&!w?FK({request:n,match:i,lazyHandlerPromise:u?.handler,lazyRoutePromise:u?.route,handlerOverride:h,scopedContext:s}):Promise.resolve({type:"data",result:void 0})}}}function _g(t,e,n,i,a,s,r,o=null){return i.map(c=>c.route.id!==a.route.id?{...c,shouldLoad:!1,unstable_shouldRevalidateArgs:o,unstable_shouldCallHandler:()=>!1,_lazyPromises:W9(t,e,n,c,s),resolve:()=>Promise.resolve({type:"data",result:void 0})}:uT(t,e,n,c,s,r,!0,o))}async function jK(t,e,n,i,a,s){n.some(u=>u._lazyPromises?.middleware)&&await Promise.all(n.map(u=>u._lazyPromises?.middleware));let r={request:e,params:n[0].params,context:a,matches:n},c=await t({...r,fetcherKey:i,runClientMiddleware:u=>{let h=r;return $9(h,()=>u({...h,fetcherKey:i,runClientMiddleware:()=>{throw new Error("Cannot call `runClientMiddleware()` from within an `runClientMiddleware` handler")}}))}});try{await Promise.all(n.flatMap(u=>[u._lazyPromises?.handler,u._lazyPromises?.route]))}catch{}return c}async function FK({request:t,match:e,lazyHandlerPromise:n,lazyRoutePromise:i,handlerOverride:a,scopedContext:s}){let r,o,c=uo(t.method),u=c?"action":"loader",h=d=>{let p,g=new Promise((x,S)=>p=S);o=()=>p(),t.signal.addEventListener("abort",o);let b=x=>typeof d!="function"?Promise.reject(new Error(`You cannot call the handler for a route which defines a boolean "${u}" [routeId: ${e.route.id}]`)):d({request:t,params:e.params,context:s},...x!==void 0?[x]:[]),w=(async()=>{try{return{type:"data",result:await(a?a(S=>b(S)):b())}}catch(x){return{type:"error",result:x}}})();return Promise.race([w,g])};try{let d=c?e.route.action:e.route.loader;if(n||i)if(d){let p,[g]=await Promise.all([h(d).catch(b=>{p=b}),n,i]);if(p!==void 0)throw p;r=g}else{await n;let p=c?e.route.action:e.route.loader;if(p)[r]=await Promise.all([h(p),i]);else if(u==="action"){let g=new URL(t.url),b=g.pathname+g.search;throw vl(405,{method:t.method,pathname:b,routeId:e.route.id})}else return{type:"data",result:void 0}}else if(d)r=await h(d);else{let p=new URL(t.url),g=p.pathname+p.search;throw vl(404,{pathname:g})}}catch(d){return{type:"error",result:d}}finally{o&&t.signal.removeEventListener("abort",o)}return r}async function VK(t){let e=t.headers.get("Content-Type");return e&&/\bapplication\/json\b/.test(e)?t.body==null?null:t.json():t.text()}async function kK(t){let{result:e,type:n}=t;if(X9(e)){let i;try{i=await VK(e)}catch(a){return{type:"error",error:a}}return n==="error"?{type:"error",error:new ES(e.status,e.statusText,i),statusCode:e.status,headers:e.headers}:{type:"data",data:i,statusCode:e.status,headers:e.headers}}return n==="error"?r8(e)?e.data instanceof Error?{type:"error",error:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:new ES(e.init?.status||500,void 0,e.data),statusCode:Rg(e)?e.status:void 0,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"error",error:e,statusCode:Rg(e)?e.status:void 0}:r8(e)?{type:"data",data:e.data,statusCode:e.init?.status,headers:e.init?.headers?new Headers(e.init.headers):void 0}:{type:"data",data:e}}function HK(t,e,n,i,a){let s=t.headers.get("Location");if(ai(s,"Redirects returned/thrown from loaders/actions must have a Location header"),!J5(s)){let r=i.slice(0,i.findIndex(o=>o.route.id===n)+1);s=lT(new URL(e.url),r,a,s),t.headers.set("Location",s)}return t}function t8(t,e,n){if(J5(t)){let i=t,a=i.startsWith("//")?new URL(e.protocol+i):new URL(i),s=Cl(a.pathname,n)!=null;if(a.origin===e.origin&&s)return a.pathname+a.search+a.hash}return t}function ag(t,e,n,i){let a=t.createURL(K9(e)).toString(),s={signal:n};if(i&&uo(i.formMethod)){let{formMethod:r,formEncType:o}=i;s.method=r.toUpperCase(),o==="application/json"?(s.headers=new Headers({"Content-Type":o}),s.body=JSON.stringify(i.json)):o==="text/plain"?s.body=i.text:o==="application/x-www-form-urlencoded"&&i.formData?s.body=dT(i.formData):s.body=i.formData}return new Request(a,s)}function dT(t){let e=new URLSearchParams;for(let[n,i]of t.entries())e.append(n,typeof i=="string"?i:i.name);return e}function n8(t){let e=new FormData;for(let[n,i]of t.entries())e.append(n,i);return e}function $K(t,e,n,i=!1,a=!1){let s={},r=null,o,c=!1,u={},h=n&&Io(n[1])?n[1].error:void 0;return t.forEach(d=>{if(!(d.route.id in e))return;let p=d.route.id,g=e[p];if(ai(!Pp(g),"Cannot handle redirect results in processLoaderData"),Io(g)){let b=g.error;if(h!==void 0&&(b=h,h=void 0),r=r||{},a)r[p]=b;else{let w=Pf(t,p);r[w.route.id]==null&&(r[w.route.id]=b)}i||(s[p]=V9),c||(c=!0,o=Rg(g.error)?g.error.status:500),g.headers&&(u[p]=g.headers)}else s[p]=g.data,g.statusCode&&g.statusCode!==200&&!c&&(o=g.statusCode),g.headers&&(u[p]=g.headers)}),h!==void 0&&n&&(r={[n[0]]:h},n[2]&&(s[n[2]]=void 0)),{loaderData:s,errors:r,statusCode:o||200,loaderHeaders:u}}function i8(t,e,n,i,a,s){let{loaderData:r,errors:o}=$K(e,n,i);return a.filter(c=>!c.matches||c.matches.some(u=>u.shouldLoad)).forEach(c=>{let{key:u,match:h,controller:d}=c;if(d&&d.signal.aborted)return;let p=s[u];if(ai(p,"Did not find corresponding fetcher result"),Io(p)){let g=Pf(t.matches,h?.route.id);o&&o[g.route.id]||(o={...o,[g.route.id]:p.error}),t.fetchers.delete(u)}else if(Pp(p))ai(!1,"Unhandled fetcher revalidation redirect");else{let g=fd(p.data);t.fetchers.set(u,g)}}),{loaderData:r,errors:o}}function a8(t,e,n,i){let a=Object.entries(e).filter(([,s])=>s!==V9).reduce((s,[r,o])=>(s[r]=o,s),{});for(let s of n){let r=s.route.id;if(!e.hasOwnProperty(r)&&t.hasOwnProperty(r)&&s.route.loader&&(a[r]=t[r]),i&&i.hasOwnProperty(r))break}return a}function s8(t){return t?Io(t[1])?{actionData:{}}:{actionData:{[t[0]]:t[1].data}}:{}}function Pf(t,e){return(e?t.slice(0,t.findIndex(i=>i.route.id===e)+1):[...t]).reverse().find(i=>i.route.hasErrorBoundary===!0)||t[0]}function I2(t){let e=t.length===1?t[0]:t.find(n=>n.index||!n.path||n.path==="/")||{id:"__shim-error-route__"};return{matches:[{params:{},pathname:"",pathnameBase:"",route:e}],route:e}}function vl(t,{pathname:e,routeId:n,method:i,type:a,message:s}={}){let r="Unknown Server Error",o="Unknown @remix-run/router error";return t===400?(r="Bad Request",i&&e&&n?o=`You made a ${i} request to "${e}" but did not provide a \`loader\` for route "${n}", so there is no way to handle the request.`:a==="invalid-body"&&(o="Unable to encode submission body")):t===403?(r="Forbidden",o=`Route "${n}" does not match URL "${e}"`):t===404?(r="Not Found",o=`No route matches URL "${e}"`):t===405&&(r="Method Not Allowed",i&&e&&n?o=`You made a ${i.toUpperCase()} request to "${e}" but did not provide an \`action\` for route "${n}", so there is no way to handle the request.`:i&&(o=`Invalid request method "${i.toUpperCase()}"`)),new ES(t||500,r,new Error(o),!0)}function z2(t){let e=Object.entries(t);for(let n=e.length-1;n>=0;n--){let[i,a]=e[n];if(Pp(a))return{key:i,result:a}}}function K9(t){let e=typeof t=="string"?th(t):t;return Hf({...e,hash:""})}function GK(t,e){return t.pathname!==e.pathname||t.search!==e.search?!1:t.hash===""?e.hash!=="":t.hash===e.hash?!0:e.hash!==""}function WK(t){return t!=null&&typeof t=="object"&&Object.entries(t).every(([e,n])=>typeof e=="string"&&KK(n))}function KK(t){return t!=null&&typeof t=="object"&&"type"in t&&"result"in t&&(t.type==="data"||t.type==="error")}function XK(t){return X9(t.result)&&CK.has(t.result.status)}function Io(t){return t.type==="error"}function Pp(t){return(t&&t.type)==="redirect"}function r8(t){return typeof t=="object"&&t!=null&&"type"in t&&"data"in t&&"init"in t&&t.type==="DataWithResponseInit"}function X9(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.headers=="object"&&typeof t.body<"u"}function qK(t){return TK.has(t.toUpperCase())}function uo(t){return EK.has(t.toUpperCase())}function tC(t){return new URLSearchParams(t).getAll("index").some(e=>e==="")}function aS(t,e){let n=typeof e=="string"?th(e).search:e.search;if(t[t.length-1].route.index&&tC(n||""))return t[t.length-1];let i=U9(t);return i[i.length-1]}function o8(t){let{formMethod:e,formAction:n,formEncType:i,text:a,formData:s,json:r}=t;if(!(!e||!n||!i)){if(a!=null)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:void 0,text:a};if(s!=null)return{formMethod:e,formAction:n,formEncType:i,formData:s,json:void 0,text:void 0};if(r!==void 0)return{formMethod:e,formAction:n,formEncType:i,formData:void 0,json:r,text:void 0}}}function X4(t,e){return e?{state:"loading",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}:{state:"loading",location:t,formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0}}function YK(t,e){return{state:"submitting",location:t,formMethod:e.formMethod,formAction:e.formAction,formEncType:e.formEncType,formData:e.formData,json:e.json,text:e.text}}function Hy(t,e){return t?{state:"loading",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e}:{state:"loading",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:e}}function ZK(t,e){return{state:"submitting",formMethod:t.formMethod,formAction:t.formAction,formEncType:t.formEncType,formData:t.formData,json:t.json,text:t.text,data:e?e.data:void 0}}function fd(t){return{state:"idle",formMethod:void 0,formAction:void 0,formEncType:void 0,formData:void 0,json:void 0,text:void 0,data:t}}function QK(t,e){try{let n=t.sessionStorage.getItem(F9);if(n){let i=JSON.parse(n);for(let[a,s]of Object.entries(i||{}))s&&Array.isArray(s)&&e.set(a,new Set(s||[]))}}catch{}}function JK(t,e){if(e.size>0){let n={};for(let[i,a]of e)n[i]=[...a];try{t.sessionStorage.setItem(F9,JSON.stringify(n))}catch(i){Za(!1,`Failed to save applied view transitions in sessionStorage (${i}).`)}}}function eX(){let t,e,n=new Promise((i,a)=>{t=async s=>{i(s);try{await n}catch{}},e=async s=>{a(s);try{await n}catch{}}});return{promise:n,resolve:t,reject:e}}var lm=P.createContext(null);lm.displayName="DataRouter";var k1=P.createContext(null);k1.displayName="DataRouterState";P.createContext(!1);var nC=P.createContext({isTransitioning:!1});nC.displayName="ViewTransition";var q9=P.createContext(new Map);q9.displayName="Fetchers";var tX=P.createContext(null);tX.displayName="Await";var xu=P.createContext(null);xu.displayName="Navigation";var Y3=P.createContext(null);Y3.displayName="Location";var mc=P.createContext({outlet:null,matches:[],isDataRoute:!1});mc.displayName="Route";var iC=P.createContext(null);iC.displayName="RouteError";function nX(t,{relative:e}={}){ai(H1(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:i}=P.useContext(xu),{hash:a,pathname:s,search:r}=$1(t,{relative:e}),o=s;return n!=="/"&&(o=s==="/"?n:du([n,s])),i.createHref({pathname:o,search:r,hash:a})}function H1(){return P.useContext(Y3)!=null}function _u(){return ai(H1(),"useLocation() may be used only in the context of a <Router> component."),P.useContext(Y3).location}var Y9="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Z9(t){P.useContext(xu).static||P.useLayoutEffect(t)}function nh(){let{isDataRoute:t}=P.useContext(mc);return t?vX():iX()}function iX(){ai(H1(),"useNavigate() may be used only in the context of a <Router> component.");let t=P.useContext(lm),{basename:e,navigator:n}=P.useContext(xu),{matches:i}=P.useContext(mc),{pathname:a}=_u(),s=JSON.stringify(Z5(i)),r=P.useRef(!1);return Z9(()=>{r.current=!0}),P.useCallback((c,u={})=>{if(Za(r.current,Y9),!r.current)return;if(typeof c=="number"){n.go(c);return}let h=Q5(c,JSON.parse(s),a,u.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:du([e,h.pathname])),(u.replace?n.replace:n.push)(h,u.state,u)},[e,n,s,a,t])}var aX=P.createContext(null);function sX(t){let e=P.useContext(mc).outlet;return P.useMemo(()=>e&&P.createElement(aX.Provider,{value:t},e),[e,t])}function cm(){let{matches:t}=P.useContext(mc),e=t[t.length-1];return e?e.params:{}}function $1(t,{relative:e}={}){let{matches:n}=P.useContext(mc),{pathname:i}=_u(),a=JSON.stringify(Z5(n));return P.useMemo(()=>Q5(t,JSON.parse(a),i,e==="path"),[t,a,i,e])}function rX(t,e,n,i,a){ai(H1(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=P.useContext(xu),{matches:r}=P.useContext(mc),o=r[r.length-1],c=o?o.params:{},u=o?o.pathname:"/",h=o?o.pathnameBase:"/",d=o&&o.route;{let M=d&&d.path||"";Q9(u,!d||M.endsWith("*")||M.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${u}" (under <Route path="${M}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${M}"> to <Route path="${M==="/"?"*":`${M}/*`}">.`)}let p=_u(),g;g=p;let b=g.pathname||"/",w=b;if(h!=="/"){let M=h.replace(/^\//,"").split("/");w="/"+b.replace(/^\//,"").split("/").slice(M.length).join("/")}let x=Nf(t,{pathname:w});return Za(d||x!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),Za(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`),dX(x&&x.map(M=>Object.assign({},M,{params:Object.assign({},c,M.params),pathname:du([h,s.encodeLocation?s.encodeLocation(M.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathname]),pathnameBase:M.pathnameBase==="/"?h:du([h,s.encodeLocation?s.encodeLocation(M.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:M.pathnameBase])})),r,n,i,a)}function oX(){let t=gX(),e=Rg(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,i="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:i},s={padding:"2px 4px",backgroundColor:i},r=null;return console.error("Error handled by React Router default ErrorBoundary:",t),r=P.createElement(P.Fragment,null,P.createElement("p",null,"💿 Hey developer 👋"),P.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",P.createElement("code",{style:s},"ErrorBoundary")," or"," ",P.createElement("code",{style:s},"errorElement")," prop on your route.")),P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},e),n?P.createElement("pre",{style:a},n):null,r)}var lX=P.createElement(oX,null),cX=class extends P.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.unstable_onError?this.props.unstable_onError(t,e):console.error("React Router caught the following error during render",t)}render(){return this.state.error!==void 0?P.createElement(mc.Provider,{value:this.props.routeContext},P.createElement(iC.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function uX({routeContext:t,match:e,children:n}){let i=P.useContext(lm);return i&&i.static&&i.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(i.staticContext._deepestRenderedBoundaryId=e.route.id),P.createElement(mc.Provider,{value:t},n)}function dX(t,e=[],n=null,i=null,a=null){if(t==null){if(!n)return null;if(n.errors)t=n.matches;else if(e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let s=t,r=n?.errors;if(r!=null){let u=s.findIndex(h=>h.route.id&&r?.[h.route.id]!==void 0);ai(u>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(r).join(",")}`),s=s.slice(0,Math.min(s.length,u+1))}let o=!1,c=-1;if(n)for(let u=0;u<s.length;u++){let h=s[u];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(c=u),h.route.id){let{loaderData:d,errors:p}=n,g=h.route.loader&&!d.hasOwnProperty(h.route.id)&&(!p||p[h.route.id]===void 0);if(h.route.lazy||g){o=!0,c>=0?s=s.slice(0,c+1):s=[s[0]];break}}}return s.reduceRight((u,h,d)=>{let p,g=!1,b=null,w=null;n&&(p=r&&h.route.id?r[h.route.id]:void 0,b=h.route.errorElement||lX,o&&(c<0&&d===0?(Q9("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),g=!0,w=null):c===d&&(g=!0,w=h.route.hydrateFallbackElement||null)));let x=e.concat(s.slice(0,d+1)),S=()=>{let M;return p?M=b:g?M=w:h.route.Component?M=P.createElement(h.route.Component,null):h.route.element?M=h.route.element:M=u,P.createElement(uX,{match:h,routeContext:{outlet:u,matches:x,isDataRoute:n!=null},children:M})};return n&&(h.route.ErrorBoundary||h.route.errorElement||d===0)?P.createElement(cX,{location:n.location,revalidation:n.revalidation,component:b,error:p,children:S(),routeContext:{outlet:null,matches:x,isDataRoute:!0},unstable_onError:i}):S()},null)}function aC(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function fX(t){let e=P.useContext(lm);return ai(e,aC(t)),e}function hX(t){let e=P.useContext(k1);return ai(e,aC(t)),e}function pX(t){let e=P.useContext(mc);return ai(e,aC(t)),e}function sC(t){let e=pX(t),n=e.matches[e.matches.length-1];return ai(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function mX(){return sC("useRouteId")}function gX(){let t=P.useContext(iC),e=hX("useRouteError"),n=sC("useRouteError");return t!==void 0?t:e.errors?.[n]}function vX(){let{router:t}=fX("useNavigate"),e=sC("useNavigate"),n=P.useRef(!1);return Z9(()=>{n.current=!0}),P.useCallback(async(a,s={})=>{Za(n.current,Y9),n.current&&(typeof a=="number"?t.navigate(a):await t.navigate(a,{fromRouteId:e,...s}))},[t,e])}var l8={};function Q9(t,e,n){!e&&!l8[t]&&(l8[t]=!0,Za(!1,n))}var c8={};function u8(t,e){!t&&!c8[e]&&(c8[e]=!0,console.warn(e))}function yX(t){let e={hasErrorBoundary:t.hasErrorBoundary||t.ErrorBoundary!=null||t.errorElement!=null};return t.Component&&(t.element&&Za(!1,"You should not include both `Component` and `element` on your route - `Component` will be used."),Object.assign(e,{element:P.createElement(t.Component),Component:void 0})),t.HydrateFallback&&(t.hydrateFallbackElement&&Za(!1,"You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - `HydrateFallback` will be used."),Object.assign(e,{hydrateFallbackElement:P.createElement(t.HydrateFallback),HydrateFallback:void 0})),t.ErrorBoundary&&(t.errorElement&&Za(!1,"You should not include both `ErrorBoundary` and `errorElement` on your route - `ErrorBoundary` will be used."),Object.assign(e,{errorElement:P.createElement(t.ErrorBoundary),ErrorBoundary:void 0})),e}var bX=["HydrateFallback","hydrateFallbackElement"],xX=class{constructor(){this.status="pending",this.promise=new Promise((t,e)=>{this.resolve=n=>{this.status==="pending"&&(this.status="resolved",t(n))},this.reject=n=>{this.status==="pending"&&(this.status="rejected",e(n))}})}};function _X({router:t,flushSync:e,unstable_onError:n}){let[i,a]=P.useState(t.state),[s,r]=P.useState(),[o,c]=P.useState({isTransitioning:!1}),[u,h]=P.useState(),[d,p]=P.useState(),[g,b]=P.useState(),w=P.useRef(new Map),x=P.useCallback(N=>{a(R=>(N.errors&&n&&Object.entries(N.errors).forEach(([D,B])=>{R.errors?.[D]!==B&&n(B)}),N))},[n]),S=P.useCallback((N,{deletedFetchers:R,flushSync:D,viewTransitionOpts:B})=>{N.fetchers.forEach((I,U)=>{I.data!==void 0&&w.current.set(U,I.data)}),R.forEach(I=>w.current.delete(I)),u8(D===!1||e!=null,'You provided the `flushSync` option to a router update, but you are not using the `<RouterProvider>` from `react-router/dom` so `ReactDOM.flushSync()` is unavailable. Please update your app to `import { RouterProvider } from "react-router/dom"` and ensure you have `react-dom` installed as a dependency to use the `flushSync` option.');let z=t.window!=null&&t.window.document!=null&&typeof t.window.document.startViewTransition=="function";if(u8(B==null||z,"You provided the `viewTransition` option to a router update, but you do not appear to be running in a DOM environment as `window.startViewTransition` is not available."),!B||!z){e&&D?e(()=>x(N)):P.startTransition(()=>x(N));return}if(e&&D){e(()=>{d&&(u&&u.resolve(),d.skipTransition()),c({isTransitioning:!0,flushSync:!0,currentLocation:B.currentLocation,nextLocation:B.nextLocation})});let I=t.window.document.startViewTransition(()=>{e(()=>x(N))});I.finished.finally(()=>{e(()=>{h(void 0),p(void 0),r(void 0),c({isTransitioning:!1})})}),e(()=>p(I));return}d?(u&&u.resolve(),d.skipTransition(),b({state:N,currentLocation:B.currentLocation,nextLocation:B.nextLocation})):(r(N),c({isTransitioning:!0,flushSync:!1,currentLocation:B.currentLocation,nextLocation:B.nextLocation}))},[t.window,e,d,u,x]);P.useLayoutEffect(()=>t.subscribe(S),[t,S]),P.useEffect(()=>{o.isTransitioning&&!o.flushSync&&h(new xX)},[o]),P.useEffect(()=>{if(u&&s&&t.window){let N=s,R=u.promise,D=t.window.document.startViewTransition(async()=>{P.startTransition(()=>x(N)),await R});D.finished.finally(()=>{h(void 0),p(void 0),r(void 0),c({isTransitioning:!1})}),p(D)}},[s,u,t.window,x]),P.useEffect(()=>{u&&s&&i.location.key===s.location.key&&u.resolve()},[u,d,i.location,s]),P.useEffect(()=>{!o.isTransitioning&&g&&(r(g.state),c({isTransitioning:!0,flushSync:!1,currentLocation:g.currentLocation,nextLocation:g.nextLocation}),b(void 0))},[o.isTransitioning,g]);let M=P.useMemo(()=>({createHref:t.createHref,encodeLocation:t.encodeLocation,go:N=>t.navigate(N),push:(N,R,D)=>t.navigate(N,{state:R,preventScrollReset:D?.preventScrollReset}),replace:(N,R,D)=>t.navigate(N,{replace:!0,state:R,preventScrollReset:D?.preventScrollReset})}),[t]),C=t.basename||"/",A=P.useMemo(()=>({router:t,navigator:M,static:!1,basename:C,unstable_onError:n}),[t,M,C,n]);return P.createElement(P.Fragment,null,P.createElement(lm.Provider,{value:A},P.createElement(k1.Provider,{value:i},P.createElement(q9.Provider,{value:w.current},P.createElement(nC.Provider,{value:o},P.createElement(EX,{basename:C,location:i.location,navigationType:i.historyAction,navigator:M},P.createElement(SX,{routes:t.routes,future:t.future,state:i,unstable_onError:n})))))),null)}var SX=P.memo(wX);function wX({routes:t,future:e,state:n,unstable_onError:i}){return rX(t,void 0,n,i,e)}function J9(t){return sX(t.context)}function EX({basename:t="/",children:e=null,location:n,navigationType:i="POP",navigator:a,static:s=!1}){ai(!H1(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let r=t.replace(/^\/*/,"/"),o=P.useMemo(()=>({basename:r,navigator:a,static:s,future:{}}),[r,a,s]);typeof n=="string"&&(n=th(n));let{pathname:c="/",search:u="",hash:h="",state:d=null,key:p="default"}=n,g=P.useMemo(()=>{let b=Cl(c,r);return b==null?null:{location:{pathname:b,search:u,hash:h,state:d,key:p},navigationType:i}},[r,c,u,h,d,p,i]);return Za(g!=null,`<Router basename="${r}"> is not able to match the URL "${c}${u}${h}" because it does not start with the basename, so the <Router> won't render anything.`),g==null?null:P.createElement(xu.Provider,{value:o},P.createElement(Y3.Provider,{children:e,value:g}))}var sS="get",rS="application/x-www-form-urlencoded";function Z3(t){return t!=null&&typeof t.tagName=="string"}function MX(t){return Z3(t)&&t.tagName.toLowerCase()==="button"}function TX(t){return Z3(t)&&t.tagName.toLowerCase()==="form"}function CX(t){return Z3(t)&&t.tagName.toLowerCase()==="input"}function AX(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function RX(t,e){return t.button===0&&(!e||e==="_self")&&!AX(t)}var B2=null;function NX(){if(B2===null)try{new FormData(document.createElement("form"),0),B2=!1}catch{B2=!0}return B2}var PX=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function q4(t){return t!=null&&!PX.has(t)?(Za(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${rS}"`),null):t}function DX(t,e){let n,i,a,s,r;if(TX(t)){let o=t.getAttribute("action");i=o?Cl(o,e):null,n=t.getAttribute("method")||sS,a=q4(t.getAttribute("enctype"))||rS,s=new FormData(t)}else if(MX(t)||CX(t)&&(t.type==="submit"||t.type==="image")){let o=t.form;if(o==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let c=t.getAttribute("formaction")||o.getAttribute("action");if(i=c?Cl(c,e):null,n=t.getAttribute("formmethod")||o.getAttribute("method")||sS,a=q4(t.getAttribute("formenctype"))||q4(o.getAttribute("enctype"))||rS,s=new FormData(o,t),!NX()){let{name:u,type:h,value:d}=t;if(h==="image"){let p=u?`${u}.`:"";s.append(`${p}x`,"0"),s.append(`${p}y`,"0")}else u&&s.append(u,d)}}else{if(Z3(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=sS,i=null,a=rS,r=t}return s&&a==="text/plain"&&(r=s,s=void 0),{action:i,method:n.toLowerCase(),encType:a,formData:s,body:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function rC(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function LX(t,e,n){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return i.pathname==="/"?i.pathname=`_root.${n}`:e&&Cl(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${n}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${n}`,i}async function OX(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function IX(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function zX(t,e,n){let i=await Promise.all(t.map(async a=>{let s=e.routes[a.route.id];if(s){let r=await OX(s,n);return r.links?r.links():[]}return[]}));return FX(i.flat(1).filter(IX).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function d8(t,e,n,i,a,s){let r=(c,u)=>n[u]?c.route.id!==n[u].route.id:!0,o=(c,u)=>n[u].pathname!==c.pathname||n[u].route.path?.endsWith("*")&&n[u].params["*"]!==c.params["*"];return s==="assets"?e.filter((c,u)=>r(c,u)||o(c,u)):s==="data"?e.filter((c,u)=>{let h=i.routes[c.route.id];if(!h||!h.hasLoader)return!1;if(r(c,u)||o(c,u))return!0;if(c.route.shouldRevalidate){let d=c.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(t,window.origin),nextParams:c.params,defaultShouldRevalidate:!0});if(typeof d=="boolean")return d}return!0}):[]}function BX(t,e,{includeHydrateFallback:n}={}){return UX(t.map(i=>{let a=e.routes[i.route.id];if(!a)return[];let s=[a.module];return a.clientActionModule&&(s=s.concat(a.clientActionModule)),a.clientLoaderModule&&(s=s.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(s=s.concat(a.hydrateFallbackModule)),a.imports&&(s=s.concat(a.imports)),s}).flat(1))}function UX(t){return[...new Set(t)]}function jX(t){let e={},n=Object.keys(t).sort();for(let i of n)e[i]=t[i];return e}function FX(t,e){let n=new Set;return new Set(e),t.reduce((i,a)=>{let s=JSON.stringify(jX(a));return n.has(s)||(n.add(s),i.push({key:s,link:a})),i},[])}function eO(){let t=P.useContext(lm);return rC(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function VX(){let t=P.useContext(k1);return rC(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var oC=P.createContext(void 0);oC.displayName="FrameworkContext";function tO(){let t=P.useContext(oC);return rC(t,"You must render this element inside a <HydratedRouter> element"),t}function kX(t,e){let n=P.useContext(oC),[i,a]=P.useState(!1),[s,r]=P.useState(!1),{onFocus:o,onBlur:c,onMouseEnter:u,onMouseLeave:h,onTouchStart:d}=e,p=P.useRef(null);P.useEffect(()=>{if(t==="render"&&r(!0),t==="viewport"){let w=S=>{S.forEach(M=>{r(M.isIntersecting)})},x=new IntersectionObserver(w,{threshold:.5});return p.current&&x.observe(p.current),()=>{x.disconnect()}}},[t]),P.useEffect(()=>{if(i){let w=setTimeout(()=>{r(!0)},100);return()=>{clearTimeout(w)}}},[i]);let g=()=>{a(!0)},b=()=>{a(!1),r(!1)};return n?t!=="intent"?[s,p,{}]:[s,p,{onFocus:$y(o,g),onBlur:$y(c,b),onMouseEnter:$y(u,g),onMouseLeave:$y(h,b),onTouchStart:$y(d,g)}]:[!1,p,{}]}function $y(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function HX({page:t,...e}){let{router:n}=eO(),i=P.useMemo(()=>Nf(n.routes,t,n.basename),[n.routes,t,n.basename]);return i?P.createElement(GX,{page:t,matches:i,...e}):null}function $X(t){let{manifest:e,routeModules:n}=tO(),[i,a]=P.useState([]);return P.useEffect(()=>{let s=!1;return zX(t,e,n).then(r=>{s||a(r)}),()=>{s=!0}},[t,e,n]),i}function GX({page:t,matches:e,...n}){let i=_u(),{manifest:a,routeModules:s}=tO(),{basename:r}=eO(),{loaderData:o,matches:c}=VX(),u=P.useMemo(()=>d8(t,e,c,a,i,"data"),[t,e,c,a,i]),h=P.useMemo(()=>d8(t,e,c,a,i,"assets"),[t,e,c,a,i]),d=P.useMemo(()=>{if(t===i.pathname+i.search+i.hash)return[];let b=new Set,w=!1;if(e.forEach(S=>{let M=a.routes[S.route.id];!M||!M.hasLoader||(!u.some(C=>C.route.id===S.route.id)&&S.route.id in o&&s[S.route.id]?.shouldRevalidate||M.hasClientLoader?w=!0:b.add(S.route.id))}),b.size===0)return[];let x=LX(t,r,"data");return w&&b.size>0&&x.searchParams.set("_routes",e.filter(S=>b.has(S.route.id)).map(S=>S.route.id).join(",")),[x.pathname+x.search]},[r,o,i,a,u,e,t,s]),p=P.useMemo(()=>BX(h,a),[h,a]),g=$X(h);return P.createElement(P.Fragment,null,d.map(b=>P.createElement("link",{key:b,rel:"prefetch",as:"fetch",href:b,...n})),p.map(b=>P.createElement("link",{key:b,rel:"modulepreload",href:b,...n})),g.map(({key:b,link:w})=>P.createElement("link",{key:b,nonce:n.nonce,...w})))}function WX(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var nO=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{nO&&(window.__reactRouterVersion="7.9.4")}catch{}function KX(t,e){return DK({basename:e?.basename,getContext:e?.getContext,future:e?.future,history:ZW({window:e?.window}),hydrationData:XX(),routes:t,mapRouteProperties:yX,hydrationRouteProperties:bX,dataStrategy:e?.dataStrategy,patchRoutesOnNavigation:e?.patchRoutesOnNavigation,window:e?.window}).initialize()}function XX(){let t=window?.__staticRouterHydrationData;return t&&t.errors&&(t={...t,errors:qX(t.errors)}),t}function qX(t){if(!t)return null;let e=Object.entries(t),n={};for(let[i,a]of e)if(a&&a.__type==="RouteErrorResponse")n[i]=new ES(a.status,a.statusText,a.data,a.internal===!0);else if(a&&a.__type==="Error"){if(a.__subType){let s=window[a.__subType];if(typeof s=="function")try{let r=new s(a.message);r.stack="",n[i]=r}catch{}}if(n[i]==null){let s=new Error(a.message);s.stack="",n[i]=s}}else n[i]=a;return n}var iO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,lC=P.forwardRef(function({onClick:e,discover:n="render",prefetch:i="none",relative:a,reloadDocument:s,replace:r,state:o,target:c,to:u,preventScrollReset:h,viewTransition:d,...p},g){let{basename:b}=P.useContext(xu),w=typeof u=="string"&&iO.test(u),x,S=!1;if(typeof u=="string"&&w&&(x=u,nO))try{let z=new URL(window.location.href),I=u.startsWith("//")?new URL(z.protocol+u):new URL(u),U=Cl(I.pathname,b);I.origin===z.origin&&U!=null?u=U+I.search+I.hash:S=!0}catch{Za(!1,`<Link to="${u}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let M=nX(u,{relative:a}),[C,A,N]=kX(i,p),R=QX(u,{replace:r,state:o,target:c,preventScrollReset:h,relative:a,viewTransition:d});function D(z){e&&e(z),z.defaultPrevented||R(z)}let B=P.createElement("a",{...p,...N,href:x||M,onClick:S||s?e:D,ref:WX(g,A),target:c,"data-discover":!w&&n==="render"?"true":void 0});return C&&!w?P.createElement(P.Fragment,null,B,P.createElement(HX,{page:M})):B});lC.displayName="Link";var aO=P.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:i="",end:a=!1,style:s,to:r,viewTransition:o,children:c,...u},h){let d=$1(r,{relative:u.relative}),p=_u(),g=P.useContext(k1),{navigator:b,basename:w}=P.useContext(xu),x=g!=null&&iq(d)&&o===!0,S=b.encodeLocation?b.encodeLocation(d).pathname:d.pathname,M=p.pathname,C=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;n||(M=M.toLowerCase(),C=C?C.toLowerCase():null,S=S.toLowerCase()),C&&w&&(C=Cl(C,w)||C);const A=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let N=M===S||!a&&M.startsWith(S)&&M.charAt(A)==="/",R=C!=null&&(C===S||!a&&C.startsWith(S)&&C.charAt(S.length)==="/"),D={isActive:N,isPending:R,isTransitioning:x},B=N?e:void 0,z;typeof i=="function"?z=i(D):z=[i,N?"active":null,R?"pending":null,x?"transitioning":null].filter(Boolean).join(" ");let I=typeof s=="function"?s(D):s;return P.createElement(lC,{...u,"aria-current":B,className:z,ref:h,style:I,to:r,viewTransition:o},typeof c=="function"?c(D):c)});aO.displayName="NavLink";var YX=P.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:i,replace:a,state:s,method:r=sS,action:o,onSubmit:c,relative:u,preventScrollReset:h,viewTransition:d,...p},g)=>{let b=tq(),w=nq(o,{relative:u}),x=r.toLowerCase()==="get"?"get":"post",S=typeof o=="string"&&iO.test(o),M=C=>{if(c&&c(C),C.defaultPrevented)return;C.preventDefault();let A=C.nativeEvent.submitter,N=A?.getAttribute("formmethod")||r;b(A||C.currentTarget,{fetcherKey:e,method:N,navigate:n,replace:a,state:s,relative:u,preventScrollReset:h,viewTransition:d})};return P.createElement("form",{ref:g,method:x,action:w,onSubmit:i?c:M,...p,"data-discover":!S&&t==="render"?"true":void 0})});YX.displayName="Form";function ZX(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function sO(t){let e=P.useContext(lm);return ai(e,ZX(t)),e}function QX(t,{target:e,replace:n,state:i,preventScrollReset:a,relative:s,viewTransition:r}={}){let o=nh(),c=_u(),u=$1(t,{relative:s});return P.useCallback(h=>{if(RX(h,e)){h.preventDefault();let d=n!==void 0?n:Hf(c)===Hf(u);o(t,{replace:d,state:i,preventScrollReset:a,relative:s,viewTransition:r})}},[c,o,u,n,i,e,t,a,s,r])}var JX=0,eq=()=>`__${String(++JX)}__`;function tq(){let{router:t}=sO("useSubmit"),{basename:e}=P.useContext(xu),n=mX();return P.useCallback(async(i,a={})=>{let{action:s,method:r,encType:o,formData:c,body:u}=DX(i,e);if(a.navigate===!1){let h=a.fetcherKey||eq();await t.fetch(h,n,a.action||s,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||r,formEncType:a.encType||o,flushSync:a.flushSync})}else await t.navigate(a.action||s,{preventScrollReset:a.preventScrollReset,formData:c,body:u,formMethod:a.method||r,formEncType:a.encType||o,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[t,e,n])}function nq(t,{relative:e}={}){let{basename:n}=P.useContext(xu),i=P.useContext(mc);ai(i,"useFormAction must be used inside a RouteContext");let[a]=i.matches.slice(-1),s={...$1(t||".",{relative:e})},r=_u();if(t==null){s.search=r.search;let o=new URLSearchParams(s.search),c=o.getAll("index");if(c.some(h=>h==="")){o.delete("index"),c.filter(d=>d).forEach(d=>o.append("index",d));let h=o.toString();s.search=h?`?${h}`:""}}return(!t||t===".")&&a.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(s.pathname=s.pathname==="/"?n:du([n,s.pathname])),Hf(s)}function iq(t,{relative:e}={}){let n=P.useContext(nC);ai(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:i}=sO("useViewTransitionState"),a=$1(t,{relative:e});if(!n.isTransitioning)return!1;let s=Cl(n.currentLocation.pathname,i)||n.currentLocation.pathname,r=Cl(n.nextLocation.pathname,i)||n.nextLocation.pathname;return wS(a.pathname,r)!=null||wS(a.pathname,s)!=null}var cC=L9();const uC=Zg(cC);var Y4={exports:{}},Z4={};/**
* @license React
* react-compiler-runtime.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f8;function aq(){if(f8)return Z4;f8=1;var t=om().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;return Z4.c=function(e){return t.H.useMemoCache(e)},Z4}var h8;function sq(){return h8||(h8=1,Y4.exports=aq()),Y4.exports}var sn=sq();function rq(t){const e=sn.c(10),{error:n}=t;let i="Oops!",a="An unexpected error occurred.",s;Rg(n)&&(i=n.status===404?"404":"Error",a=n.status===404?"The requested page could not be found.":n.statusText||"An unexpected error occurred.");let r;e[0]!==i?(r=_.jsx("h1",{children:i}),e[0]=i,e[1]=r):r=e[1];let o;e[2]!==a?(o=_.jsx("p",{children:a}),e[2]=a,e[3]=o):o=e[3];let c;e[4]!==s?(c=s,e[4]=s,e[5]=c):c=e[5];let u;return e[6]!==r||e[7]!==o||e[8]!==c?(u=_.jsxs("main",{className:"pt-16 p-4 container mx-auto bg-purple-500",children:[r,o,c]}),e[6]=r,e[7]=o,e[8]=c,e[9]=u):u=e[9],u}function ih(t={}){const{strict:e=!0,errorMessage:n="useContext: `context` is undefined. Seems you forgot to wrap component within the Provider",name:i}=t,a=P.createContext(void 0);a.displayName=i;function s(){var r;const o=P.useContext(a);if(!o&&e){const c=new Error(n);throw c.name="ContextError",(r=Error.captureStackTrace)==null||r.call(Error,c,s),c}return o}return[a.Provider,s,a]}function oq(t){return{UNSAFE_getDOMNode(){return t.current}}}function _i(t){const e=P.useRef(null);return P.useImperativeHandle(t,()=>e.current),e}var lq=t=>t?"":void 0;function dC(t){return Array.isArray(t)}function cq(t){return dC(t)&&t.length===0}function rO(t){const e=typeof t;return t!=null&&(e==="object"||e==="function")&&!dC(t)}function uq(t){return rO(t)&&Object.keys(t).length===0}function Xb(t){return dC(t)?cq(t):rO(t)?uq(t):t==null||t===""}function dq(t){return typeof t=="function"}var He=t=>t?"true":void 0;function oO(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=oO(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function Vt(...t){for(var e=0,n,i,a="";e<t.length;)(n=t[e++])&&(i=oO(n))&&(a&&(a+=" "),a+=i);return a}var fq=t=>t?.length<=4?t:t?.slice(0,3),hq=t=>{const e=t?.trim().split(/[\s\-_.]+/).filter(Boolean).map(n=>n.charAt(0).toUpperCase()).join("")||"";return fq(e)},lO=(...t)=>{let e=" ";for(const n of t)if(typeof n=="string"&&n.length>0){e=n;break}return e},cO=t=>t?t.charAt(0).toUpperCase()+t.slice(1).toLowerCase():"";function p8(...t){return function(n){t.some(i=>(i?.(n),n?.defaultPrevented))}}function uO(t){return`${t}-${Math.floor(Math.random()*1e6)}`}function pq(t){for(const e in t)e.startsWith("on")&&delete t[e];return t}function ks(t){if(!t||typeof t!="object")return"";try{return JSON.stringify(t)}catch{return""}}function dO(t,e,n){return Math.min(Math.max(t,e),n)}var m8={};function mq(t,e,...n){const a=`[Hero UI] : ${t}`;typeof console>"u"||m8[a]||(m8[a]=!0)}function $r(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}var g8=new Map;function gq(t,e){if(t===e)return t;let n=g8.get(t);if(n)return n.forEach(a=>a.current=e),e;let i=g8.get(e);return i?(i.forEach(a=>a.current=t),t):e}function Yt(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let i=t[n];for(let a in i){let s=e[a],r=i[a];typeof s=="function"&&typeof r=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?e[a]=$r(s,r):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof r=="string"?e[a]=Vt(s,r):a==="id"&&s&&r?e.id=gq(s,r):e[a]=r!==void 0?r:s}}return e}function fC(...t){return t.length===1&&t[0]?t[0]:e=>{let n=!1;const i=t.map(a=>{const s=v8(a,e);return n||(n=typeof s=="function"),s});if(n)return()=>{i.forEach((a,s)=>{typeof a=="function"?a?.():v8(t[s],null)})}}}function v8(t,e){if(typeof t=="function")return()=>t(e);t!=null&&"current"in t&&(t.current=e)}function vq(t,e){if(t!=null){if(dq(t)){t(e);return}try{t.current=e}catch{throw new Error(`Cannot assign value '${e}' to ref '${t}'`)}}}function Q3(...t){return e=>{t.forEach(n=>vq(n,e))}}function yq(){const t=()=>()=>{};return P.useSyncExternalStore(t,()=>!0,()=>!1)}var bq=(t,e)=>{var n;let i=[];const a=(n=P.Children.map(t,r=>P.isValidElement(r)&&r.type===e?(i.push(r),null):r))==null?void 0:n.filter(Boolean),s=i.length>=0?i:void 0;return[a,s]},xq=new Set(["id","type","style","title","role","tabIndex","htmlFor","width","height","abbr","accept","acceptCharset","accessKey","action","allowFullScreen","allowTransparency","alt","async","autoComplete","autoFocus","autoPlay","cellPadding","cellSpacing","challenge","charset","checked","cite","class","className","cols","colSpan","command","content","contentEditable","contextMenu","controls","coords","crossOrigin","data","dateTime","default","defer","dir","disabled","download","draggable","dropzone","encType","enterKeyHint","for","form","formAction","formEncType","formMethod","formNoValidate","formTarget","frameBorder","headers","hidden","high","href","hrefLang","httpEquiv","icon","inputMode","isMap","itemId","itemProp","itemRef","itemScope","itemType","kind","label","lang","list","loop","manifest","max","maxLength","media","mediaGroup","method","min","minLength","multiple","muted","name","noValidate","open","optimum","pattern","ping","placeholder","poster","preload","radioGroup","referrerPolicy","readOnly","rel","required","rows","rowSpan","sandbox","scope","scoped","scrolling","seamless","selected","shape","size","sizes","slot","sortable","span","spellCheck","src","srcDoc","srcSet","start","step","target","translate","typeMustMatch","useMap","value","wmode","wrap"]),_q=new Set(["onCopy","onCut","onPaste","onLoad","onError","onWheel","onScroll","onCompositionEnd","onCompositionStart","onCompositionUpdate","onKeyDown","onKeyPress","onKeyUp","onFocus","onBlur","onChange","onInput","onSubmit","onClick","onContextMenu","onDoubleClick","onDrag","onDragEnd","onDragEnter","onDragExit","onDragLeave","onDragOver","onDragStart","onDrop","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onPointerDown","onPointerEnter","onPointerLeave","onPointerUp","onSelect","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionEnd"]),y8=/^(data-.*)$/,Sq=/^(aria-.*)$/,U2=/^(on[A-Z].*)$/;function cs(t,e={}){let{labelable:n=!0,enabled:i=!0,propNames:a,omitPropNames:s,omitEventNames:r,omitDataProps:o,omitEventProps:c}=e,u={};if(!i)return t;for(const h in t)s?.has(h)||r?.has(h)&&U2.test(h)||U2.test(h)&&!_q.has(h)||o&&y8.test(h)||c&&U2.test(h)||(Object.prototype.hasOwnProperty.call(t,h)&&(xq.has(h)||n&&Sq.test(h)||a?.has(h)||y8.test(h))||U2.test(h))&&(u[h]=t[h]);return u}var[wq,fa]=ih({name:"ProviderContext",strict:!1});const Eq=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Mq=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function fO(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),i=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(i)return i.direction==="rtl";if(n.script)return Eq.has(n.script)}let e=t.split("-")[0];return Mq.has(e)}const hO={prefix:String(Math.round(Math.random()*1e10)),current:0},pO=ft.createContext(hO),Tq=ft.createContext(!1);let Q4=new WeakMap;function Cq(t=!1){let e=P.useContext(pO),n=P.useRef(null);if(n.current===null&&!t){var i,a;let s=(a=ft.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||a===void 0||(i=a.ReactCurrentOwner)===null||i===void 0?void 0:i.current;if(s){let r=Q4.get(s);r==null?Q4.set(s,{id:e.current,state:s.memoizedState}):s.memoizedState!==r.state&&(e.current=r.id,Q4.delete(s))}n.current=++e.current}return n.current}function Aq(t){let e=P.useContext(pO),n=Cq(!!t),i=`react-aria${e.prefix}`;return t||`${i}-${n}`}function Rq(t){let e=ft.useId(),[n]=P.useState(G1()),i=n?"react-aria":`react-aria${hO.prefix}`;return t||`${i}-${e}`}const Nq=typeof ft.useId=="function"?Rq:Aq;function Pq(){return!1}function Dq(){return!0}function Lq(t){return()=>{}}function G1(){return typeof ft.useSyncExternalStore=="function"?ft.useSyncExternalStore(Lq,Pq,Dq):P.useContext(Tq)}const Oq=Symbol.for("react-aria.i18n.locale");function mO(){let t=typeof window<"u"&&window[Oq]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:fO(t)?"rtl":"ltr"}}let fT=mO(),fb=new Set;function b8(){fT=mO();for(let t of fb)t(fT)}function gO(){let t=G1(),[e,n]=P.useState(fT);return P.useEffect(()=>(fb.size===0&&window.addEventListener("languagechange",b8),fb.add(n),()=>{fb.delete(n),fb.size===0&&window.removeEventListener("languagechange",b8)}),[]),t?{locale:"en-US",direction:"ltr"}:e}const hC=ft.createContext(null);function Iq(t){let{locale:e,children:n}=t,i=ft.useMemo(()=>({locale:e,direction:fO(e)?"rtl":"ltr"}),[e]);return ft.createElement(hC.Provider,{value:i},n)}function zq(t){let{children:e}=t,n=gO();return ft.createElement(hC.Provider,{value:n},e)}function Bq(t){let{locale:e,children:n}=t;return e?ft.createElement(Iq,{locale:e,children:n}):ft.createElement(zq,{children:n})}function um(){let t=gO();return P.useContext(hC)||t}const Uq=Symbol.for("react-aria.i18n.locale"),jq=Symbol.for("react-aria.i18n.strings");let A0;class J3{getStringForLocale(e,n){let a=this.getStringsForLocale(n)[e];if(!a)throw new Error(`Could not find intl message ${e} in ${n} locale`);return a}getStringsForLocale(e){let n=this.strings[e];return n||(n=Fq(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[Uq];if(A0===void 0){let a=window[jq];if(!a)return null;A0={};for(let s in a)A0[s]=new J3({[n]:a[s]},n)}let i=A0?.[e];if(!i)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return i}constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,i])=>i)),this.defaultLocale=n}}function Fq(t,e,n="en-US"){if(e[t])return e[t];let i=Vq(t);if(e[i])return e[i];for(let a in e)if(a.startsWith(i+"-"))return e[a];return e[n]}function Vq(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const x8=new Map,_8=new Map;class kq{format(e,n){let i=this.strings.getStringForLocale(e,this.locale);return typeof i=="function"?i(n,this):i}plural(e,n,i="cardinal"){let a=n["="+e];if(a)return typeof a=="function"?a():a;let s=this.locale+":"+i,r=x8.get(s);r||(r=new Intl.PluralRules(this.locale,{type:i}),x8.set(s,r));let o=r.select(e);return a=n[o]||n.other,typeof a=="function"?a():a}number(e){let n=_8.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),_8.set(this.locale,n)),n.format(e)}select(e,n){let i=e[n]||e.other;return typeof i=="function"?i():i}constructor(e,n){this.locale=e,this.strings=n}}const S8=new WeakMap;function Hq(t){let e=S8.get(t);return e||(e=new J3(t),S8.set(t,e)),e}function $q(t,e){return e&&J3.getGlobalDictionaryForPackage(e)||Hq(t)}function Qg(t,e){let{locale:n}=um(),i=$q(t,e);return P.useMemo(()=>new kq(n,i),[n,i])}function Gq(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function Wq(t,e,n){Gq(t,e),e.set(t,n)}const Hi=typeof document<"u"?ft.useLayoutEffect:()=>{};var J4;const Kq=(J4=ft.useInsertionEffect)!==null&&J4!==void 0?J4:Hi;function xa(t){const e=P.useRef(null);return Kq(()=>{e.current=t},[t]),P.useCallback((...n)=>{const i=e.current;return i?.(...n)},[])}function Xq(t){let[e,n]=P.useState(t),i=P.useRef(null),a=xa(()=>{if(!i.current)return;let r=i.current.next();if(r.done){i.current=null;return}e===r.value?a():n(r.value)});Hi(()=>{i.current&&a()});let s=xa(r=>{i.current=r(e),a()});return[e,s]}let qq=!!(typeof window<"u"&&window.document&&window.document.createElement),Sg=new Map,hb;typeof FinalizationRegistry<"u"&&(hb=new FinalizationRegistry(t=>{Sg.delete(t)}));function Us(t){let[e,n]=P.useState(t),i=P.useRef(null),a=Nq(e),s=P.useRef(null);if(hb&&hb.register(s,a),qq){const r=Sg.get(a);r&&!r.includes(i)?r.push(i):Sg.set(a,[i])}return Hi(()=>{let r=a;return()=>{hb&&hb.unregister(s),Sg.delete(r)}},[a]),P.useEffect(()=>{let r=i.current;return r&&n(r),()=>{r&&(i.current=null)}}),a}function Yq(t,e){if(t===e)return t;let n=Sg.get(t);if(n)return n.forEach(a=>a.current=e),e;let i=Sg.get(e);return i?(i.forEach(a=>a.current=t),t):e}function Ng(t=[]){let e=Us(),[n,i]=Xq(e),a=P.useCallback(()=>{i(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,i]);return Hi(a,[e,a,...t]),n}function ah(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const Ii=t=>{var e;return(e=t?.ownerDocument)!==null&&e!==void 0?e:document},jo=t=>t&&"window"in t&&t.window===t?t:Ii(t).defaultView||window;function Zq(t){return t!==null&&typeof t=="object"&&"nodeType"in t&&typeof t.nodeType=="number"}function Qq(t){return Zq(t)&&t.nodeType===Node.DOCUMENT_FRAGMENT_NODE&&"host"in t}let Jq=!1;function ew(){return Jq}function oo(t,e){if(!ew())return e&&t?t.contains(e):!1;if(!t||!e)return!1;let n=e;for(;n!==null;){if(n===t)return!0;n.tagName==="SLOT"&&n.assignedSlot?n=n.assignedSlot.parentNode:Qq(n)?n=n.host:n=n.parentNode}return!1}const hr=(t=document)=>{var e;if(!ew())return t.activeElement;let n=t.activeElement;for(;n&&"shadowRoot"in n&&(!((e=n.shadowRoot)===null||e===void 0)&&e.activeElement);)n=n.shadowRoot.activeElement;return n};function Ba(t){return ew()&&t.target.shadowRoot&&t.composedPath?t.composedPath()[0]:t.target}class eY{get currentNode(){return this._currentNode}set currentNode(e){if(!oo(this.root,e))throw new Error("Cannot set currentNode to a node that is not contained by the root node.");const n=[];let i=e,a=e;for(this._currentNode=e;i&&i!==this.root;)if(i.nodeType===Node.DOCUMENT_FRAGMENT_NODE){const r=i,o=this._doc.createTreeWalker(r,this.whatToShow,{acceptNode:this._acceptNode});n.push(o),o.currentNode=a,this._currentSetFor.add(o),i=a=r.host}else i=i.parentNode;const s=this._doc.createTreeWalker(this.root,this.whatToShow,{acceptNode:this._acceptNode});n.push(s),s.currentNode=a,this._currentSetFor.add(s),this._walkerStack=n}get doc(){return this._doc}firstChild(){let e=this.currentNode,n=this.nextNode();return oo(e,n)?(n&&(this.currentNode=n),n):(this.currentNode=e,null)}lastChild(){let n=this._walkerStack[0].lastChild();return n&&(this.currentNode=n),n}nextNode(){const e=this._walkerStack[0].nextNode();if(e){if(e.shadowRoot){var n;let a;if(typeof this.filter=="function"?a=this.filter(e):!((n=this.filter)===null||n===void 0)&&n.acceptNode&&(a=this.filter.acceptNode(e)),a===NodeFilter.FILTER_ACCEPT)return this.currentNode=e,e;let s=this.nextNode();return s&&(this.currentNode=s),s}return e&&(this.currentNode=e),e}else if(this._walkerStack.length>1){this._walkerStack.shift();let i=this.nextNode();return i&&(this.currentNode=i),i}else return null}previousNode(){const e=this._walkerStack[0];if(e.currentNode===e.root){if(this._currentSetFor.has(e))if(this._currentSetFor.delete(e),this._walkerStack.length>1){this._walkerStack.shift();let a=this.previousNode();return a&&(this.currentNode=a),a}else return null;return null}const n=e.previousNode();if(n){if(n.shadowRoot){var i;let s;if(typeof this.filter=="function"?s=this.filter(n):!((i=this.filter)===null||i===void 0)&&i.acceptNode&&(s=this.filter.acceptNode(n)),s===NodeFilter.FILTER_ACCEPT)return n&&(this.currentNode=n),n;let r=this.lastChild();return r&&(this.currentNode=r),r}return n&&(this.currentNode=n),n}else if(this._walkerStack.length>1){this._walkerStack.shift();let a=this.previousNode();return a&&(this.currentNode=a),a}else return null}nextSibling(){return null}previousSibling(){return null}parentNode(){return null}constructor(e,n,i,a){this._walkerStack=[],this._currentSetFor=new Set,this._acceptNode=r=>{if(r.nodeType===Node.ELEMENT_NODE){const c=r.shadowRoot;if(c){const u=this._doc.createTreeWalker(c,this.whatToShow,{acceptNode:this._acceptNode});return this._walkerStack.unshift(u),NodeFilter.FILTER_ACCEPT}else{var o;if(typeof this.filter=="function")return this.filter(r);if(!((o=this.filter)===null||o===void 0)&&o.acceptNode)return this.filter.acceptNode(r);if(this.filter===null)return NodeFilter.FILTER_ACCEPT}}return NodeFilter.FILTER_SKIP},this._doc=e,this.root=n,this.filter=a??null,this.whatToShow=i??NodeFilter.SHOW_ALL,this._currentNode=n,this._walkerStack.unshift(e.createTreeWalker(n,i,this._acceptNode));const s=n.shadowRoot;if(s){const r=this._doc.createTreeWalker(s,this.whatToShow,{acceptNode:this._acceptNode});this._walkerStack.unshift(r)}}}function tY(t,e,n,i){return ew()?new eY(t,e,n,i):t.createTreeWalker(e,n,i)}function vO(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=vO(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function nY(){for(var t,e,n=0,i="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=vO(t))&&(i&&(i+=" "),i+=e);return i}function ci(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let i=t[n];for(let a in i){let s=e[a],r=i[a];typeof s=="function"&&typeof r=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?e[a]=ah(s,r):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof r=="string"?e[a]=nY(s,r):a==="id"&&s&&r?e.id=Yq(s,r):e[a]=r!==void 0?r:s}}return e}const iY=new Set(["id"]),aY=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),sY=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),rY=new Set(["dir","lang","hidden","inert","translate"]),w8=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),oY=/^(data-.*)$/;function Dl(t,e={}){let{labelable:n,isLink:i,global:a,events:s=a,propNames:r}=e,o={};for(const c in t)Object.prototype.hasOwnProperty.call(t,c)&&(iY.has(c)||n&&aY.has(c)||i&&sY.has(c)||a&&rY.has(c)||s&&w8.has(c)||c.endsWith("Capture")&&w8.has(c.slice(0,-7))||r?.has(c)||oY.test(c))&&(o[c]=t[c]);return o}function or(t){if(lY())t.focus({preventScroll:!0});else{let e=cY(t);t.focus(),uY(e)}}let j2=null;function lY(){if(j2==null){j2=!1;try{document.createElement("div").focus({get preventScroll(){return j2=!0,!0}})}catch{}}return j2}function cY(t){let e=t.parentNode,n=[],i=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==i;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&n.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return i instanceof HTMLElement&&n.push({element:i,scrollTop:i.scrollTop,scrollLeft:i.scrollLeft}),n}function uY(t){for(let{element:e,scrollTop:n,scrollLeft:i}of t)e.scrollTop=n,e.scrollLeft=i}function tw(t){var e;if(typeof window>"u"||window.navigator==null)return!1;let n=(e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands;return Array.isArray(n)&&n.some(i=>t.test(i.brand))||t.test(window.navigator.userAgent)}function pC(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function Ad(t){let e=null;return()=>(e==null&&(e=t()),e)}const $f=Ad(function(){return pC(/^Mac/i)}),yO=Ad(function(){return pC(/^iPhone/i)}),bO=Ad(function(){return pC(/^iPad/i)||$f()&&navigator.maxTouchPoints>1}),W1=Ad(function(){return yO()||bO()}),dY=Ad(function(){return $f()||W1()}),mC=Ad(function(){return tw(/AppleWebKit/i)&&!gC()}),gC=Ad(function(){return tw(/Chrome/i)}),nw=Ad(function(){return tw(/Android/i)}),fY=Ad(function(){return tw(/Firefox/i)}),xO=P.createContext({isNative:!0,open:mY,useHref:t=>t});function hY(t){let{children:e,navigate:n,useHref:i}=t,a=P.useMemo(()=>({isNative:!1,open:(s,r,o,c)=>{_O(s,u=>{pY(u,r)?n(o,c):Gf(u,r)})},useHref:i||(s=>s)}),[n,i]);return ft.createElement(xO.Provider,{value:a},e)}function vC(){return P.useContext(xO)}function pY(t,e){let n=t.getAttribute("target");return(!n||n==="_self")&&t.origin===location.origin&&!t.hasAttribute("download")&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey}function Gf(t,e,n=!0){var i,a;let{metaKey:s,ctrlKey:r,altKey:o,shiftKey:c}=e;fY()&&(!((a=window.event)===null||a===void 0||(i=a.type)===null||i===void 0)&&i.startsWith("key"))&&t.target==="_blank"&&($f()?s=!0:r=!0);let u=mC()&&$f()&&!bO()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:s,ctrlKey:r,altKey:o,shiftKey:c}):new MouseEvent("click",{metaKey:s,ctrlKey:r,altKey:o,shiftKey:c,bubbles:!0,cancelable:!0});Gf.isOpening=n,or(t),t.dispatchEvent(u),Gf.isOpening=!1}Gf.isOpening=!1;function _O(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function mY(t,e){_O(t,n=>Gf(n,e))}function SO(t){let e=vC();var n;const i=e.useHref((n=t?.href)!==null&&n!==void 0?n:"");return{href:t?.href?i:void 0,target:t?.target,rel:t?.rel,download:t?.download,ping:t?.ping,referrerPolicy:t?.referrerPolicy}}let Df=new Map,hT=new Set;function E8(){if(typeof window>"u")return;function t(i){return"propertyName"in i}let e=i=>{if(!t(i)||!i.target)return;let a=Df.get(i.target);a||(a=new Set,Df.set(i.target,a),i.target.addEventListener("transitioncancel",n,{once:!0})),a.add(i.propertyName)},n=i=>{if(!t(i)||!i.target)return;let a=Df.get(i.target);if(a&&(a.delete(i.propertyName),a.size===0&&(i.target.removeEventListener("transitioncancel",n),Df.delete(i.target)),Df.size===0)){for(let s of hT)s();hT.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?E8():document.addEventListener("DOMContentLoaded",E8));function gY(){for(const[t]of Df)"isConnected"in t&&!t.isConnected&&Df.delete(t)}function wO(t){requestAnimationFrame(()=>{gY(),Df.size===0?t():hT.add(t)})}function K1(){let t=P.useRef(new Map),e=P.useCallback((a,s,r,o)=>{let c=o?.once?(...u)=>{t.current.delete(r),r(...u)}:r;t.current.set(r,{type:s,eventTarget:a,fn:c,options:o}),a.addEventListener(s,c,o)},[]),n=P.useCallback((a,s,r,o)=>{var c;let u=((c=t.current.get(r))===null||c===void 0?void 0:c.fn)||r;a.removeEventListener(s,u,o),t.current.delete(r)},[]),i=P.useCallback(()=>{t.current.forEach((a,s)=>{n(a.eventTarget,a.type,s,a.options)})},[n]);return P.useEffect(()=>i,[i]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:i}}function iw(t,e){let{id:n,"aria-label":i,"aria-labelledby":a}=t;return n=Us(n),a&&i?a=[...new Set([n,...a.trim().split(/\s+/)])].join(" "):a&&(a=a.trim().split(/\s+/).join(" ")),!i&&!a&&e&&(i=e),{id:n,"aria-label":i,"aria-labelledby":a}}function M8(t,e){const n=P.useRef(!0),i=P.useRef(null);Hi(()=>(n.current=!0,()=>{n.current=!1}),[]),Hi(()=>{n.current?n.current=!1:(!i.current||e.some((a,s)=>!Object.is(a,i[s])))&&t(),i.current=e},e)}function vY(){return typeof window.ResizeObserver<"u"}function T8(t){const{ref:e,box:n,onResize:i}=t;P.useEffect(()=>{let a=e?.current;if(a)if(vY()){const s=new window.ResizeObserver(r=>{r.length&&i()});return s.observe(a,{box:n}),()=>{a&&s.unobserve(a)}}else return window.addEventListener("resize",i,!1),()=>{window.removeEventListener("resize",i,!1)}},[i,e,n])}function EO(t,e){Hi(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Pg(t,e){if(!t)return!1;let n=window.getComputedStyle(t),i=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return i&&e&&(i=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),i}function MO(t,e){let n=t;for(Pg(n,e)&&(n=n.parentElement);n&&!Pg(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function yY(t,e){const n=[];for(;t&&t!==document.documentElement;)Pg(t,e)&&n.push(t),t=t.parentElement;return n}function sg(t){return $f()?t.metaKey:t.ctrlKey}const bY=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function eE(t){return t instanceof HTMLInputElement&&!bY.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}let xY=0;const tE=new Map;function _Y(t){let[e,n]=P.useState();return Hi(()=>{if(!t)return;let i=tE.get(t);if(i)n(i.element.id);else{let a=`react-aria-description-${xY++}`;n(a);let s=document.createElement("div");s.id=a,s.style.display="none",s.textContent=t,document.body.appendChild(s),i={refCount:0,element:s},tE.set(t,i)}return i.refCount++,()=>{i&&--i.refCount===0&&(i.element.remove(),tE.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function pb(t,e,n,i){let a=xa(n),s=n==null;P.useEffect(()=>{if(s||!t.current)return;let r=t.current;return r.addEventListener(e,a,i),()=>{r.removeEventListener(e,a,i)}},[t,e,i,s,a])}function TO(t,e){let n=C8(t,e,"left"),i=C8(t,e,"top"),a=e.offsetWidth,s=e.offsetHeight,r=t.scrollLeft,o=t.scrollTop,{borderTopWidth:c,borderLeftWidth:u,scrollPaddingTop:h,scrollPaddingRight:d,scrollPaddingBottom:p,scrollPaddingLeft:g}=getComputedStyle(t),{scrollMarginTop:b,scrollMarginRight:w,scrollMarginBottom:x,scrollMarginLeft:S}=getComputedStyle(e),M=r+parseInt(u,10),C=o+parseInt(c,10),A=M+t.clientWidth,N=C+t.clientHeight,R=parseInt(h,10)||0,D=parseInt(p,10)||0,B=parseInt(d,10)||0,z=parseInt(g,10)||0,I=parseInt(b,10)||0,U=parseInt(x,10)||0,$=parseInt(w,10)||0,G=parseInt(S,10)||0,k=n-G,X=n+a+$,V=i-I,H=i+s+U,W=r+parseInt(u,10)+z,J=A-B,Y=o+parseInt(c,10)+R,K=N-D;(k>W||X<J)&&(k<=r+z?r=k-parseInt(u,10)-z:X>A-B&&(r+=X-A+B)),(V>Y||H<K)&&(V<=C+R?o=V-parseInt(c,10)-R:H>N-D&&(o+=H-N+D)),t.scrollTo({left:r,top:o})}function C8(t,e,n){const i=n==="left"?"offsetLeft":"offsetTop";let a=0;for(;e.offsetParent&&(a+=e[i],e.offsetParent!==t);){if(e.offsetParent.contains(t)){a-=t[i];break}e=e.offsetParent}return a}function A8(t,e){if(t&&document.contains(t)){let r=document.scrollingElement||document.documentElement;if(!(window.getComputedStyle(r).overflow==="hidden")&&!gC()){var n;let{left:c,top:u}=t.getBoundingClientRect();t==null||(n=t.scrollIntoView)===null||n===void 0||n.call(t,{block:"nearest"});let{left:h,top:d}=t.getBoundingClientRect();if(Math.abs(c-h)>1||Math.abs(u-d)>1){var i,a,s;e==null||(a=e.containingElement)===null||a===void 0||(i=a.scrollIntoView)===null||i===void 0||i.call(a,{block:"center",inline:"center"}),(s=t.scrollIntoView)===null||s===void 0||s.call(t,{block:"nearest"})}}else{let c=yY(t);for(let u of c)TO(u,t)}}}function CO(t){return t.pointerType===""&&t.isTrusted?!0:nw()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function SY(t){return!nw()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}function yC(t,e,n){let i=xa(()=>{n&&n(e)});P.useEffect(()=>{var a;let s=t==null||(a=t.current)===null||a===void 0?void 0:a.form;return s?.addEventListener("reset",i),()=>{s?.removeEventListener("reset",i)}},[t,i])}const wY="react-aria-clear-focus",EY="react-aria-focus",MY=typeof Element<"u"&&"checkVisibility"in Element.prototype;function TY(t){const e=jo(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:i}=t.style,a=n!=="none"&&i!=="hidden"&&i!=="collapse";if(a){const{getComputedStyle:s}=t.ownerDocument.defaultView;let{display:r,visibility:o}=s(t);a=r!=="none"&&o!=="hidden"&&o!=="collapse"}return a}function CY(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function bC(t,e){return MY?t.checkVisibility({visibilityProperty:!0})&&!t.closest("[data-react-aria-prevent-focus]"):t.nodeName!=="#comment"&&TY(t)&&CY(t,e)&&(!t.parentElement||bC(t.parentElement,t))}const xC=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])',"permission"],AY=xC.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";xC.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const RY=xC.join(':not([hidden]):not([tabindex="-1"]),');function AO(t){return t.matches(AY)&&bC(t)&&!RO(t)}function NY(t){return t.matches(RY)&&bC(t)&&!RO(t)}function RO(t){let e=t;for(;e!=null;){if(e instanceof e.ownerDocument.defaultView.HTMLElement&&e.inert)return!0;e=e.parentElement}return!1}function sh(t,e,n){let[i,a]=P.useState(t||e),s=P.useRef(t!==void 0),r=t!==void 0;P.useEffect(()=>{s.current,s.current=r},[r]);let o=r?t:i,c=P.useCallback((u,...h)=>{let d=(p,...g)=>{n&&(Object.is(o,p)||n(p,...g)),r||(o=p)};typeof u=="function"?a((g,...b)=>{let w=u(r?o:g,...b);return d(w,...h),r?g:w}):(r||a(u),d(u,...h))},[r,o,n]);return[o,c]}function wg(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}function F2(t,e){let n=t,i=0,a=e.toString(),s=a.toLowerCase().indexOf("e-");if(s>0)i=Math.abs(Math.floor(Math.log10(Math.abs(e))))+s;else{let r=a.indexOf(".");r>=0&&(i=a.length-r)}if(i>0){let r=Math.pow(10,i);n=Math.round(n*r)/r}return n}function nd(t,e,n,i){e=Number(e),n=Number(n);let a=(t-(isNaN(e)?0:e))%i,s=F2(Math.abs(a)*2>=i?t+Math.sign(a)*(i-Math.abs(a)):t-a,i);return isNaN(e)?!isNaN(n)&&s>n&&(s=Math.floor(F2(n/i,i))*i):s<e?s=e:!isNaN(n)&&s>n&&(s=e+Math.floor(F2((n-e)/i,i))*i),s=F2(s,i),s}let nE=new Map,pT=!1;try{pT=new Intl.NumberFormat("de-DE",{signDisplay:"exceptZero"}).resolvedOptions().signDisplay==="exceptZero"}catch{}let TS=!1;try{TS=new Intl.NumberFormat("de-DE",{style:"unit",unit:"degree"}).resolvedOptions().style==="unit"}catch{}const NO={degree:{narrow:{default:"°","ja-JP":" 度","zh-TW":"度","sl-SI":" °"}}};class CS{format(e){let n="";if(!pT&&this.options.signDisplay!=null?n=DY(this.numberFormatter,this.options.signDisplay,e):n=this.numberFormatter.format(e),this.options.style==="unit"&&!TS){var i;let{unit:a,unitDisplay:s="short",locale:r}=this.resolvedOptions();if(!a)return n;let o=(i=NO[a])===null||i===void 0?void 0:i[s];n+=o[r]||o.default}return n}formatToParts(e){return this.numberFormatter.formatToParts(e)}formatRange(e,n){if(typeof this.numberFormatter.formatRange=="function")return this.numberFormatter.formatRange(e,n);if(n<e)throw new RangeError("End date must be >= start date");return`${this.format(e)} ${this.format(n)}`}formatRangeToParts(e,n){if(typeof this.numberFormatter.formatRangeToParts=="function")return this.numberFormatter.formatRangeToParts(e,n);if(n<e)throw new RangeError("End date must be >= start date");let i=this.numberFormatter.formatToParts(e),a=this.numberFormatter.formatToParts(n);return[...i.map(s=>({...s,source:"startRange"})),{type:"literal",value:" ",source:"shared"},...a.map(s=>({...s,source:"endRange"}))]}resolvedOptions(){let e=this.numberFormatter.resolvedOptions();return!pT&&this.options.signDisplay!=null&&(e={...e,signDisplay:this.options.signDisplay}),!TS&&this.options.style==="unit"&&(e={...e,style:"unit",unit:this.options.unit,unitDisplay:this.options.unitDisplay}),e}constructor(e,n={}){this.numberFormatter=PY(e,n),this.options=n}}function PY(t,e={}){let{numberingSystem:n}=e;if(n&&t.includes("-nu-")&&(t.includes("-u-")||(t+="-u-"),t+=`-nu-${n}`),e.style==="unit"&&!TS){var i;let{unit:r,unitDisplay:o="short"}=e;if(!r)throw new Error('unit option must be provided with style: "unit"');if(!(!((i=NO[r])===null||i===void 0)&&i[o]))throw new Error(`Unsupported unit ${r} with unitDisplay = ${o}`);e={...e,style:"decimal"}}let a=t+(e?Object.entries(e).sort((r,o)=>r[0]<o[0]?-1:1).join():"");if(nE.has(a))return nE.get(a);let s=new Intl.NumberFormat(t,e);return nE.set(a,s),s}function DY(t,e,n){if(e==="auto")return t.format(n);if(e==="never")return t.format(Math.abs(n));{let i=!1;if(e==="always"?i=n>0||Object.is(n,0):e==="exceptZero"&&(Object.is(n,-0)||Object.is(n,0)?n=Math.abs(n):i=n>0),i){let a=t.format(-n),s=t.format(n),r=a.replace(s,"").replace(/\u200e|\u061C/,"");return[...r].length!==1&&console.warn("@react-aria/i18n polyfill for NumberFormat signDisplay: Unsupported case"),a.replace(s,"!!!").replace(r,"+").replace("!!!",s)}else return t.format(n)}}const LY=new RegExp("^.*\\(.*\\).*$"),OY=["latn","arab","hanidec","deva","beng","fullwide"];class PO{parse(e){return iE(this.locale,this.options,e).parse(e)}isValidPartialNumber(e,n,i){return iE(this.locale,this.options,e).isValidPartialNumber(e,n,i)}getNumberingSystem(e){return iE(this.locale,this.options,e).options.numberingSystem}constructor(e,n={}){this.locale=e,this.options=n}}const R8=new Map;function iE(t,e,n){let i=N8(t,e);if(!t.includes("-nu-")&&!i.isValidPartialNumber(n)){for(let a of OY)if(a!==i.options.numberingSystem){let s=N8(t+(t.includes("-u-")?"-nu-":"-u-nu-")+a,e);if(s.isValidPartialNumber(n))return s}}return i}function N8(t,e){let n=t+(e?Object.entries(e).sort((a,s)=>a[0]<s[0]?-1:1).join():""),i=R8.get(n);return i||(i=new IY(t,e),R8.set(n,i)),i}class IY{parse(e){let n=this.sanitize(e);if(this.symbols.group&&(n=R0(n,this.symbols.group,"")),this.symbols.decimal&&(n=n.replace(this.symbols.decimal,".")),this.symbols.minusSign&&(n=n.replace(this.symbols.minusSign,"-")),n=n.replace(this.symbols.numeral,this.symbols.index),this.options.style==="percent"){let r=n.indexOf("-");n=n.replace("-",""),n=n.replace("+","");let o=n.indexOf(".");o===-1&&(o=n.length),n=n.replace(".",""),o-2===0?n=`0.${n}`:o-2===-1?n=`0.0${n}`:o-2===-2?n="0.00":n=`${n.slice(0,o-2)}.${n.slice(o-2)}`,r>-1&&(n=`-${n}`)}let i=n?+n:NaN;if(isNaN(i))return NaN;if(this.options.style==="percent"){var a,s;let r={...this.options,style:"decimal",minimumFractionDigits:Math.min(((a=this.options.minimumFractionDigits)!==null&&a!==void 0?a:0)+2,20),maximumFractionDigits:Math.min(((s=this.options.maximumFractionDigits)!==null&&s!==void 0?s:0)+2,20)};return new PO(this.locale,r).parse(new CS(this.locale,r).format(i))}return this.options.currencySign==="accounting"&&LY.test(e)&&(i=-1*i),i}sanitize(e){return e=e.replace(this.symbols.literals,""),this.symbols.minusSign&&(e=e.replace("-",this.symbols.minusSign)),this.options.numberingSystem==="arab"&&(this.symbols.decimal&&(e=e.replace(",",this.symbols.decimal),e=e.replace("،",this.symbols.decimal)),this.symbols.group&&(e=R0(e,".",this.symbols.group))),this.symbols.group===""&&e.includes("'")&&(e=R0(e,"'",this.symbols.group)),this.options.locale==="fr-FR"&&this.symbols.group&&(e=R0(e," ",this.symbols.group),e=R0(e,/\u00A0/g,this.symbols.group)),e}isValidPartialNumber(e,n=-1/0,i=1/0){return e=this.sanitize(e),this.symbols.minusSign&&e.startsWith(this.symbols.minusSign)&&n<0?e=e.slice(this.symbols.minusSign.length):this.symbols.plusSign&&e.startsWith(this.symbols.plusSign)&&i>0&&(e=e.slice(this.symbols.plusSign.length)),this.symbols.group&&e.startsWith(this.symbols.group)||this.symbols.decimal&&e.indexOf(this.symbols.decimal)>-1&&this.options.maximumFractionDigits===0?!1:(this.symbols.group&&(e=R0(e,this.symbols.group,"")),e=e.replace(this.symbols.numeral,""),this.symbols.decimal&&(e=e.replace(this.symbols.decimal,"")),e.length===0)}constructor(e,n={}){this.locale=e,n.roundingIncrement!==1&&n.roundingIncrement!=null&&(n.maximumFractionDigits==null&&n.minimumFractionDigits==null?(n.maximumFractionDigits=0,n.minimumFractionDigits=0):n.maximumFractionDigits==null?n.maximumFractionDigits=n.minimumFractionDigits:n.minimumFractionDigits==null&&(n.minimumFractionDigits=n.maximumFractionDigits)),this.formatter=new Intl.NumberFormat(e,n),this.options=this.formatter.resolvedOptions(),this.symbols=BY(e,this.formatter,this.options,n);var i,a;this.options.style==="percent"&&(((i=this.options.minimumFractionDigits)!==null&&i!==void 0?i:0)>18||((a=this.options.maximumFractionDigits)!==null&&a!==void 0?a:0)>18)&&console.warn("NumberParser cannot handle percentages with greater than 18 decimal places, please reduce the number in your options.")}}const P8=new Set(["decimal","fraction","integer","minusSign","plusSign","group"]),zY=[0,4,2,1,11,20,3,7,100,21,.1,1.1];function BY(t,e,n,i){var a,s,r,o;let c=new Intl.NumberFormat(t,{...n,minimumSignificantDigits:1,maximumSignificantDigits:21,roundingIncrement:1,roundingPriority:"auto",roundingMode:"halfExpand"}),u=c.formatToParts(-10000.111),h=c.formatToParts(10000.111),d=zY.map(I=>c.formatToParts(I));var p;let g=(p=(a=u.find(I=>I.type==="minusSign"))===null||a===void 0?void 0:a.value)!==null&&p!==void 0?p:"-",b=(s=h.find(I=>I.type==="plusSign"))===null||s===void 0?void 0:s.value;!b&&(i?.signDisplay==="exceptZero"||i?.signDisplay==="always")&&(b="+");let x=(r=new Intl.NumberFormat(t,{...n,minimumFractionDigits:2,maximumFractionDigits:2}).formatToParts(.001).find(I=>I.type==="decimal"))===null||r===void 0?void 0:r.value,S=(o=u.find(I=>I.type==="group"))===null||o===void 0?void 0:o.value,M=u.filter(I=>!P8.has(I.type)).map(I=>D8(I.value)),C=d.flatMap(I=>I.filter(U=>!P8.has(U.type)).map(U=>D8(U.value))),A=[...new Set([...M,...C])].sort((I,U)=>U.length-I.length),N=A.length===0?new RegExp("[\\p{White_Space}]","gu"):new RegExp(`${A.join("|")}|[\\p{White_Space}]`,"gu"),R=[...new Intl.NumberFormat(n.locale,{useGrouping:!1}).format(9876543210)].reverse(),D=new Map(R.map((I,U)=>[I,U])),B=new RegExp(`[${R.join("")}]`,"g");return{minusSign:g,plusSign:b,decimal:x,group:S,literals:N,numeral:B,index:I=>String(D.get(I))}}function R0(t,e,n){return t.replaceAll?t.replaceAll(e,n):t.split(e).join(n)}function D8(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function L8(t={}){let{locale:e}=um();return P.useMemo(()=>new CS(e,t),[e,t])}let aE=new Map;function DO(t){let{locale:e}=um(),n=e+(t?Object.entries(t).sort((a,s)=>a[0]<s[0]?-1:1).join():"");if(aE.has(n))return aE.get(n);let i=new Intl.Collator(e,t);return aE.set(n,i),i}const qb=P.createContext({});function X1(t){const e=P.useRef(null);return e.current===null&&(e.current=t()),e.current}const _C=typeof window<"u",SC=_C?P.useLayoutEffect:P.useEffect,q1=P.createContext(null);function wC(t,e){t.indexOf(e)===-1&&t.push(e)}function EC(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}function w_e([...t],e,n){const i=e<0?t.length+e:e;if(i>=0&&i<t.length){const a=n<0?t.length+n:n,[s]=t.splice(e,1);t.splice(a,0,s)}return t}const Sd=(t,e,n)=>n>e?e:n<t?t:n;let E_e=()=>{},MC=()=>{};const yu={},LO=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function OO(t){return typeof t=="object"&&t!==null}const IO=t=>/^0[^.\s]+$/u.test(t);function TC(t){let e;return()=>(e===void 0&&(e=t()),e)}const Ml=t=>t,UY=(t,e)=>n=>e(t(n)),Y1=(...t)=>t.reduce(UY),Yb=(t,e,n)=>{const i=e-t;return i===0?1:(n-t)/i};class CC{constructor(){this.subscriptions=[]}add(e){return wC(this.subscriptions,e),()=>EC(this.subscriptions,e)}notify(e,n,i){const a=this.subscriptions.length;if(a)if(a===1)this.subscriptions[0](e,n,i);else for(let s=0;s<a;s++){const r=this.subscriptions[s];r&&r(e,n,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const fu=t=>t*1e3,_l=t=>t/1e3;function zO(t,e){return e?t*(1e3/e):0}const BO=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,jY=1e-7,FY=12;function VY(t,e,n,i,a){let s,r,o=0;do r=e+(n-e)/2,s=BO(r,i,a)-t,s>0?n=r:e=r;while(Math.abs(s)>jY&&++o<FY);return r}function Z1(t,e,n,i){if(t===e&&n===i)return Ml;const a=s=>VY(s,0,1,t,n);return s=>s===0||s===1?s:BO(a(s),e,i)}const UO=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,jO=t=>e=>1-t(1-e),FO=Z1(.33,1.53,.69,.99),AC=jO(FO),VO=UO(AC),kO=t=>(t*=2)<1?.5*AC(t):.5*(2-Math.pow(2,-10*(t-1))),RC=t=>1-Math.sin(Math.acos(t)),HO=jO(RC),$O=UO(RC),kY=Z1(.42,0,1,1),HY=Z1(0,0,.58,1),GO=Z1(.42,0,.58,1),$Y=t=>Array.isArray(t)&&typeof t[0]!="number",WO=t=>Array.isArray(t)&&typeof t[0]=="number",GY={linear:Ml,easeIn:kY,easeInOut:GO,easeOut:HY,circIn:RC,circInOut:$O,circOut:HO,backIn:AC,backInOut:VO,backOut:FO,anticipate:kO},WY=t=>typeof t=="string",O8=t=>{if(WO(t)){MC(t.length===4);const[e,n,i,a]=t;return Z1(e,n,i,a)}else if(WY(t))return GY[t];return t},V2=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],au={value:null,addProjectionMetrics:null};function KY(t,e){let n=new Set,i=new Set,a=!1,s=!1;const r=new WeakSet;let o={delta:0,timestamp:0,isProcessing:!1},c=0;function u(d){r.has(d)&&(h.schedule(d),t()),c++,d(o)}const h={schedule:(d,p=!1,g=!1)=>{const w=g&&a?n:i;return p&&r.add(d),w.has(d)||w.add(d),d},cancel:d=>{i.delete(d),r.delete(d)},process:d=>{if(o=d,a){s=!0;return}a=!0,[n,i]=[i,n],n.forEach(u),e&&au.value&&au.value.frameloop[e].push(c),c=0,n.clear(),a=!1,s&&(s=!1,h.process(d))}};return h}const XY=40;function KO(t,e){let n=!1,i=!0;const a={delta:0,timestamp:0,isProcessing:!1},s=()=>n=!0,r=V2.reduce((C,A)=>(C[A]=KY(s,e?A:void 0),C),{}),{setup:o,read:c,resolveKeyframes:u,preUpdate:h,update:d,preRender:p,render:g,postRender:b}=r,w=()=>{const C=yu.useManualTiming?a.timestamp:performance.now();n=!1,yu.useManualTiming||(a.delta=i?1e3/60:Math.max(Math.min(C-a.timestamp,XY),1)),a.timestamp=C,a.isProcessing=!0,o.process(a),c.process(a),u.process(a),h.process(a),d.process(a),p.process(a),g.process(a),b.process(a),a.isProcessing=!1,n&&e&&(i=!1,t(w))},x=()=>{n=!0,i=!0,a.isProcessing||t(w)};return{schedule:V2.reduce((C,A)=>{const N=r[A];return C[A]=(R,D=!1,B=!1)=>(n||x(),N.schedule(R,D,B)),C},{}),cancel:C=>{for(let A=0;A<V2.length;A++)r[V2[A]].cancel(C)},state:a,steps:r}}const{schedule:ta,cancel:Wf,state:zs,steps:sE}=KO(typeof requestAnimationFrame<"u"?requestAnimationFrame:Ml,!0);let oS;function qY(){oS=void 0}const mo={now:()=>(oS===void 0&&mo.set(zs.isProcessing||yu.useManualTiming?zs.timestamp:performance.now()),oS),set:t=>{oS=t,queueMicrotask(qY)}},kp={layout:0,mainThread:0,waapi:0},XO=t=>e=>typeof e=="string"&&e.startsWith(t),NC=XO("--"),YY=XO("var(--"),PC=t=>YY(t)?ZY.test(t.split("/*")[0].trim()):!1,ZY=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Jg={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Zb={...Jg,transform:t=>Sd(0,1,t)},k2={...Jg,default:1},Sb=t=>Math.round(t*1e5)/1e5,DC=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function QY(t){return t==null}const JY=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,LC=(t,e)=>n=>!!(typeof n=="string"&&JY.test(n)&&n.startsWith(t)||e&&!QY(n)&&Object.prototype.hasOwnProperty.call(n,e)),qO=(t,e,n)=>i=>{if(typeof i!="string")return i;const[a,s,r,o]=i.match(DC);return{[t]:parseFloat(a),[e]:parseFloat(s),[n]:parseFloat(r),alpha:o!==void 0?parseFloat(o):1}},eZ=t=>Sd(0,255,t),rE={...Jg,transform:t=>Math.round(eZ(t))},Dp={test:LC("rgb","red"),parse:qO("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:i=1})=>"rgba("+rE.transform(t)+", "+rE.transform(e)+", "+rE.transform(n)+", "+Sb(Zb.transform(i))+")"};function tZ(t){let e="",n="",i="",a="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),i=t.substring(5,7),a=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),i=t.substring(3,4),a=t.substring(4,5),e+=e,n+=n,i+=i,a+=a),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(i,16),alpha:a?parseInt(a,16)/255:1}}const mT={test:LC("#"),parse:tZ,transform:Dp.transform},Q1=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Tf=Q1("deg"),hu=Q1("%"),Mn=Q1("px"),nZ=Q1("vh"),iZ=Q1("vw"),I8={...hu,parse:t=>hu.parse(t)/100,transform:t=>hu.transform(t*100)},lg={test:LC("hsl","hue"),parse:qO("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:i=1})=>"hsla("+Math.round(t)+", "+hu.transform(Sb(e))+", "+hu.transform(Sb(n))+", "+Sb(Zb.transform(i))+")"},Ka={test:t=>Dp.test(t)||mT.test(t)||lg.test(t),parse:t=>Dp.test(t)?Dp.parse(t):lg.test(t)?lg.parse(t):mT.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Dp.transform(t):lg.transform(t),getAnimatableNone:t=>{const e=Ka.parse(t);return e.alpha=0,Ka.transform(e)}},aZ=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function sZ(t){return isNaN(t)&&typeof t=="string"&&(t.match(DC)?.length||0)+(t.match(aZ)?.length||0)>0}const YO="number",ZO="color",rZ="var",oZ="var(",z8="${}",lZ=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function Qb(t){const e=t.toString(),n=[],i={color:[],number:[],var:[]},a=[];let s=0;const o=e.replace(lZ,c=>(Ka.test(c)?(i.color.push(s),a.push(ZO),n.push(Ka.parse(c))):c.startsWith(oZ)?(i.var.push(s),a.push(rZ),n.push(c)):(i.number.push(s),a.push(YO),n.push(parseFloat(c))),++s,z8)).split(z8);return{values:n,split:o,indexes:i,types:a}}function QO(t){return Qb(t).values}function JO(t){const{split:e,types:n}=Qb(t),i=e.length;return a=>{let s="";for(let r=0;r<i;r++)if(s+=e[r],a[r]!==void 0){const o=n[r];o===YO?s+=Sb(a[r]):o===ZO?s+=Ka.transform(a[r]):s+=a[r]}return s}}const cZ=t=>typeof t=="number"?0:Ka.test(t)?Ka.getAnimatableNone(t):t;function uZ(t){const e=QO(t);return JO(t)(e.map(cZ))}const Kf={test:sZ,parse:QO,createTransformer:JO,getAnimatableNone:uZ};function oE(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function dZ({hue:t,saturation:e,lightness:n,alpha:i}){t/=360,e/=100,n/=100;let a=0,s=0,r=0;if(!e)a=s=r=n;else{const o=n<.5?n*(1+e):n+e-n*e,c=2*n-o;a=oE(c,o,t+1/3),s=oE(c,o,t),r=oE(c,o,t-1/3)}return{red:Math.round(a*255),green:Math.round(s*255),blue:Math.round(r*255),alpha:i}}function AS(t,e){return n=>n>0?e:t}const _a=(t,e,n)=>t+(e-t)*n,lE=(t,e,n)=>{const i=t*t,a=n*(e*e-i)+i;return a<0?0:Math.sqrt(a)},fZ=[mT,Dp,lg],hZ=t=>fZ.find(e=>e.test(t));function B8(t){const e=hZ(t);if(!e)return!1;let n=e.parse(t);return e===lg&&(n=dZ(n)),n}const U8=(t,e)=>{const n=B8(t),i=B8(e);if(!n||!i)return AS(t,e);const a={...n};return s=>(a.red=lE(n.red,i.red,s),a.green=lE(n.green,i.green,s),a.blue=lE(n.blue,i.blue,s),a.alpha=_a(n.alpha,i.alpha,s),Dp.transform(a))},gT=new Set(["none","hidden"]);function pZ(t,e){return gT.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function mZ(t,e){return n=>_a(t,e,n)}function OC(t){return typeof t=="number"?mZ:typeof t=="string"?PC(t)?AS:Ka.test(t)?U8:yZ:Array.isArray(t)?eI:typeof t=="object"?Ka.test(t)?U8:gZ:AS}function eI(t,e){const n=[...t],i=n.length,a=t.map((s,r)=>OC(s)(s,e[r]));return s=>{for(let r=0;r<i;r++)n[r]=a[r](s);return n}}function gZ(t,e){const n={...t,...e},i={};for(const a in n)t[a]!==void 0&&e[a]!==void 0&&(i[a]=OC(t[a])(t[a],e[a]));return a=>{for(const s in i)n[s]=i[s](a);return n}}function vZ(t,e){const n=[],i={color:0,var:0,number:0};for(let a=0;a<e.values.length;a++){const s=e.types[a],r=t.indexes[s][i[s]],o=t.values[r]??0;n[a]=o,i[s]++}return n}const yZ=(t,e)=>{const n=Kf.createTransformer(e),i=Qb(t),a=Qb(e);return i.indexes.var.length===a.indexes.var.length&&i.indexes.color.length===a.indexes.color.length&&i.indexes.number.length>=a.indexes.number.length?gT.has(t)&&!a.values.length||gT.has(e)&&!i.values.length?pZ(t,e):Y1(eI(vZ(i,a),a.values),n):AS(t,e)};function tI(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?_a(t,e,n):OC(t)(t,e)}const bZ=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>ta.update(e,n),stop:()=>Wf(e),now:()=>zs.isProcessing?zs.timestamp:mo.now()}},nI=(t,e,n=10)=>{let i="";const a=Math.max(Math.round(e/n),2);for(let s=0;s<a;s++)i+=Math.round(t(s/(a-1))*1e4)/1e4+", ";return`linear(${i.substring(0,i.length-2)})`},RS=2e4;function IC(t){let e=0;const n=50;let i=t.next(e);for(;!i.done&&e<RS;)e+=n,i=t.next(e);return e>=RS?1/0:e}function xZ(t,e=100,n){const i=n({...t,keyframes:[0,e]}),a=Math.min(IC(i),RS);return{type:"keyframes",ease:s=>i.next(a*s).value/e,duration:_l(a)}}const _Z=5;function iI(t,e,n){const i=Math.max(e-_Z,0);return zO(n-t(i),e-i)}const Ra={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},cE=.001;function SZ({duration:t=Ra.duration,bounce:e=Ra.bounce,velocity:n=Ra.velocity,mass:i=Ra.mass}){let a,s,r=1-e;r=Sd(Ra.minDamping,Ra.maxDamping,r),t=Sd(Ra.minDuration,Ra.maxDuration,_l(t)),r<1?(a=u=>{const h=u*r,d=h*t,p=h-n,g=vT(u,r),b=Math.exp(-d);return cE-p/g*b},s=u=>{const d=u*r*t,p=d*n+n,g=Math.pow(r,2)*Math.pow(u,2)*t,b=Math.exp(-d),w=vT(Math.pow(u,2),r);return(-a(u)+cE>0?-1:1)*((p-g)*b)/w}):(a=u=>{const h=Math.exp(-u*t),d=(u-n)*t+1;return-cE+h*d},s=u=>{const h=Math.exp(-u*t),d=(n-u)*(t*t);return h*d});const o=5/t,c=EZ(a,s,o);if(t=fu(t),isNaN(c))return{stiffness:Ra.stiffness,damping:Ra.damping,duration:t};{const u=Math.pow(c,2)*i;return{stiffness:u,damping:r*2*Math.sqrt(i*u),duration:t}}}const wZ=12;function EZ(t,e,n){let i=n;for(let a=1;a<wZ;a++)i=i-t(i)/e(i);return i}function vT(t,e){return t*Math.sqrt(1-e*e)}const MZ=["duration","bounce"],TZ=["stiffness","damping","mass"];function j8(t,e){return e.some(n=>t[n]!==void 0)}function CZ(t){let e={velocity:Ra.velocity,stiffness:Ra.stiffness,damping:Ra.damping,mass:Ra.mass,isResolvedFromDuration:!1,...t};if(!j8(t,TZ)&&j8(t,MZ))if(t.visualDuration){const n=t.visualDuration,i=2*Math.PI/(n*1.2),a=i*i,s=2*Sd(.05,1,1-(t.bounce||0))*Math.sqrt(a);e={...e,mass:Ra.mass,stiffness:a,damping:s}}else{const n=SZ(t);e={...e,...n,mass:Ra.mass},e.isResolvedFromDuration=!0}return e}function NS(t=Ra.visualDuration,e=Ra.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:i,restDelta:a}=n;const s=n.keyframes[0],r=n.keyframes[n.keyframes.length-1],o={done:!1,value:s},{stiffness:c,damping:u,mass:h,duration:d,velocity:p,isResolvedFromDuration:g}=CZ({...n,velocity:-_l(n.velocity||0)}),b=p||0,w=u/(2*Math.sqrt(c*h)),x=r-s,S=_l(Math.sqrt(c/h)),M=Math.abs(x)<5;i||(i=M?Ra.restSpeed.granular:Ra.restSpeed.default),a||(a=M?Ra.restDelta.granular:Ra.restDelta.default);let C;if(w<1){const N=vT(S,w);C=R=>{const D=Math.exp(-w*S*R);return r-D*((b+w*S*x)/N*Math.sin(N*R)+x*Math.cos(N*R))}}else if(w===1)C=N=>r-Math.exp(-S*N)*(x+(b+S*x)*N);else{const N=S*Math.sqrt(w*w-1);C=R=>{const D=Math.exp(-w*S*R),B=Math.min(N*R,300);return r-D*((b+w*S*x)*Math.sinh(B)+N*x*Math.cosh(B))/N}}const A={calculatedDuration:g&&d||null,next:N=>{const R=C(N);if(g)o.done=N>=d;else{let D=N===0?b:0;w<1&&(D=N===0?fu(b):iI(C,N,R));const B=Math.abs(D)<=i,z=Math.abs(r-R)<=a;o.done=B&&z}return o.value=o.done?r:R,o},toString:()=>{const N=Math.min(IC(A),RS),R=nI(D=>A.next(N*D).value,N,30);return N+"ms "+R},toTransition:()=>{}};return A}NS.applyToOptions=t=>{const e=xZ(t,100,NS);return t.ease=e.ease,t.duration=fu(e.duration),t.type="keyframes",t};function yT({keyframes:t,velocity:e=0,power:n=.8,timeConstant:i=325,bounceDamping:a=10,bounceStiffness:s=500,modifyTarget:r,min:o,max:c,restDelta:u=.5,restSpeed:h}){const d=t[0],p={done:!1,value:d},g=B=>o!==void 0&&B<o||c!==void 0&&B>c,b=B=>o===void 0?c:c===void 0||Math.abs(o-B)<Math.abs(c-B)?o:c;let w=n*e;const x=d+w,S=r===void 0?x:r(x);S!==x&&(w=S-d);const M=B=>-w*Math.exp(-B/i),C=B=>S+M(B),A=B=>{const z=M(B),I=C(B);p.done=Math.abs(z)<=u,p.value=p.done?S:I};let N,R;const D=B=>{g(p.value)&&(N=B,R=NS({keyframes:[p.value,b(p.value)],velocity:iI(C,B,p.value),damping:a,stiffness:s,restDelta:u,restSpeed:h}))};return D(0),{calculatedDuration:null,next:B=>{let z=!1;return!R&&N===void 0&&(z=!0,A(B),D(B)),N!==void 0&&B>=N?R.next(B-N):(!z&&A(B),p)}}}function AZ(t,e,n){const i=[],a=n||yu.mix||tI,s=t.length-1;for(let r=0;r<s;r++){let o=a(t[r],t[r+1]);if(e){const c=Array.isArray(e)?e[r]||Ml:e;o=Y1(c,o)}i.push(o)}return i}function RZ(t,e,{clamp:n=!0,ease:i,mixer:a}={}){const s=t.length;if(MC(s===e.length),s===1)return()=>e[0];if(s===2&&e[0]===e[1])return()=>e[1];const r=t[0]===t[1];t[0]>t[s-1]&&(t=[...t].reverse(),e=[...e].reverse());const o=AZ(e,i,a),c=o.length,u=h=>{if(r&&h<t[0])return e[0];let d=0;if(c>1)for(;d<t.length-2&&!(h<t[d+1]);d++);const p=Yb(t[d],t[d+1],h);return o[d](p)};return n?h=>u(Sd(t[0],t[s-1],h)):u}function NZ(t,e){const n=t[t.length-1];for(let i=1;i<=e;i++){const a=Yb(0,e,i);t.push(_a(n,1,a))}}function PZ(t){const e=[0];return NZ(e,t.length-1),e}function DZ(t,e){return t.map(n=>n*e)}function LZ(t,e){return t.map(()=>e||GO).splice(0,t.length-1)}function wb({duration:t=300,keyframes:e,times:n,ease:i="easeInOut"}){const a=$Y(i)?i.map(O8):O8(i),s={done:!1,value:e[0]},r=DZ(n&&n.length===e.length?n:PZ(e),t),o=RZ(r,e,{ease:Array.isArray(a)?a:LZ(e,a)});return{calculatedDuration:t,next:c=>(s.value=o(c),s.done=c>=t,s)}}const OZ=t=>t!==null;function zC(t,{repeat:e,repeatType:n="loop"},i,a=1){const s=t.filter(OZ),o=a<0||e&&n!=="loop"&&e%2===1?0:s.length-1;return!o||i===void 0?s[o]:i}const IZ={decay:yT,inertia:yT,tween:wb,keyframes:wb,spring:NS};function aI(t){typeof t.type=="string"&&(t.type=IZ[t.type])}class BC{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const zZ=t=>t/100;class aw extends BC{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{const{motionValue:n}=this.options;n&&n.updatedAt!==mo.now()&&this.tick(mo.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),this.options.onStop?.())},kp.mainThread++,this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;aI(e);const{type:n=wb,repeat:i=0,repeatDelay:a=0,repeatType:s,velocity:r=0}=e;let{keyframes:o}=e;const c=n||wb;c!==wb&&typeof o[0]!="number"&&(this.mixKeyframes=Y1(zZ,tI(o[0],o[1])),o=[0,100]);const u=c({...e,keyframes:o});s==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...o].reverse(),velocity:-r})),u.calculatedDuration===null&&(u.calculatedDuration=IC(u));const{calculatedDuration:h}=u;this.calculatedDuration=h,this.resolvedDuration=h+a,this.totalDuration=this.resolvedDuration*(i+1)-a,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:i,totalDuration:a,mixKeyframes:s,mirroredGenerator:r,resolvedDuration:o,calculatedDuration:c}=this;if(this.startTime===null)return i.next(0);const{delay:u=0,keyframes:h,repeat:d,repeatType:p,repeatDelay:g,type:b,onUpdate:w,finalKeyframe:x}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-a/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const S=this.currentTime-u*(this.playbackSpeed>=0?1:-1),M=this.playbackSpeed>=0?S<0:S>a;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=a);let C=this.currentTime,A=i;if(d){const B=Math.min(this.currentTime,a)/o;let z=Math.floor(B),I=B%1;!I&&B>=1&&(I=1),I===1&&z--,z=Math.min(z,d+1),!!(z%2)&&(p==="reverse"?(I=1-I,g&&(I-=g/o)):p==="mirror"&&(A=r)),C=Sd(0,1,I)*o}const N=M?{done:!1,value:h[0]}:A.next(C);s&&(N.value=s(N.value));let{done:R}=N;!M&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=a:this.currentTime<=0);const D=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return D&&b!==yT&&(N.value=zC(h,this.options,x,this.speed)),w&&w(N.value),D&&this.finish(),N}then(e,n){return this.finished.then(e,n)}get duration(){return _l(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_l(e)}get time(){return _l(this.currentTime)}set time(e){e=fu(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(mo.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=_l(this.currentTime))}play(){if(this.isStopped)return;const{driver:e=bZ,startTime:n}=this.options;this.driver||(this.driver=e(a=>this.tick(a))),this.options.onPlay?.();const i=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=i):this.holdTime!==null?this.startTime=i-this.holdTime:this.startTime||(this.startTime=n??i),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(mo.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){this.notifyFinished(),this.teardown(),this.state="finished",this.options.onComplete?.()}cancel(){this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),this.options.onCancel?.()}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null,kp.mainThread--}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),this.driver?.stop(),e.observe(this)}}function M_e(t){return new aw(t)}function BZ(t){for(let e=1;e<t.length;e++)t[e]??(t[e]=t[e-1])}const Lp=t=>t*180/Math.PI,bT=t=>{const e=Lp(Math.atan2(t[1],t[0]));return xT(e)},UZ={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:bT,rotateZ:bT,skewX:t=>Lp(Math.atan(t[1])),skewY:t=>Lp(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},xT=t=>(t=t%360,t<0&&(t+=360),t),F8=bT,V8=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),k8=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),jZ={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:V8,scaleY:k8,scale:t=>(V8(t)+k8(t))/2,rotateX:t=>xT(Lp(Math.atan2(t[6],t[5]))),rotateY:t=>xT(Lp(Math.atan2(-t[2],t[0]))),rotateZ:F8,rotate:F8,skewX:t=>Lp(Math.atan(t[4])),skewY:t=>Lp(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function _T(t){return t.includes("scale")?1:0}function ST(t,e){if(!t||t==="none")return _T(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let i,a;if(n)i=jZ,a=n;else{const o=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);i=UZ,a=o}if(!a)return _T(e);const s=i[e],r=a[1].split(",").map(VZ);return typeof s=="function"?s(r):r[s]}const FZ=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return ST(n,e)};function VZ(t){return parseFloat(t.trim())}const ev=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],dm=new Set(ev),H8=t=>t===Jg||t===Mn,kZ=new Set(["x","y","z"]),HZ=ev.filter(t=>!kZ.has(t));function $Z(t){const e=[];return HZ.forEach(n=>{const i=t.getValue(n);i!==void 0&&(e.push([n,i.get()]),i.set(n.startsWith("scale")?1:0))}),e}const Hp={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>ST(e,"x"),y:(t,{transform:e})=>ST(e,"y")};Hp.translateX=Hp.x;Hp.translateY=Hp.y;const $p=new Set;let wT=!1,ET=!1,MT=!1;function sI(){if(ET){const t=Array.from($p).filter(i=>i.needsMeasurement),e=new Set(t.map(i=>i.element)),n=new Map;e.forEach(i=>{const a=$Z(i);a.length&&(n.set(i,a),i.render())}),t.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const a=n.get(i);a&&a.forEach(([s,r])=>{i.getValue(s)?.set(r)})}),t.forEach(i=>i.measureEndState()),t.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}ET=!1,wT=!1,$p.forEach(t=>t.complete(MT)),$p.clear()}function rI(){$p.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(ET=!0)})}function GZ(){MT=!0,rI(),sI(),MT=!1}class UC{constructor(e,n,i,a,s,r=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=i,this.motionValue=a,this.element=s,this.isAsync=r}scheduleResolve(){this.state="scheduled",this.isAsync?($p.add(this),wT||(wT=!0,ta.read(rI),ta.resolveKeyframes(sI))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:i,motionValue:a}=this;if(e[0]===null){const s=a?.get(),r=e[e.length-1];if(s!==void 0)e[0]=s;else if(i&&n){const o=i.readValue(n,r);o!=null&&(e[0]=o)}e[0]===void 0&&(e[0]=r),a&&s===void 0&&a.set(e[0])}BZ(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),$p.delete(this)}cancel(){this.state==="scheduled"&&($p.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const WZ=t=>t.startsWith("--");function KZ(t,e,n){WZ(e)?t.style.setProperty(e,n):t.style[e]=n}const XZ=TC(()=>window.ScrollTimeline!==void 0),qZ={};function YZ(t,e){const n=TC(t);return()=>qZ[e]??n()}const oI=YZ(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),mb=([t,e,n,i])=>`cubic-bezier(${t}, ${e}, ${n}, ${i})`,$8={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:mb([0,.65,.55,1]),circOut:mb([.55,0,1,.45]),backIn:mb([.31,.01,.66,-.59]),backOut:mb([.33,1.53,.69,.99])};function lI(t,e){if(t)return typeof t=="function"?oI()?nI(t,e):"ease-out":WO(t)?mb(t):Array.isArray(t)?t.map(n=>lI(n,e)||$8.easeOut):$8[t]}function ZZ(t,e,n,{delay:i=0,duration:a=300,repeat:s=0,repeatType:r="loop",ease:o="easeOut",times:c}={},u=void 0){const h={[e]:n};c&&(h.offset=c);const d=lI(o,a);Array.isArray(d)&&(h.easing=d),au.value&&kp.waapi++;const p={delay:i,duration:a,easing:Array.isArray(d)?"linear":d,fill:"both",iterations:s+1,direction:r==="reverse"?"alternate":"normal"};u&&(p.pseudoElement=u);const g=t.animate(h,p);return au.value&&g.finished.finally(()=>{kp.waapi--}),g}function cI(t){return typeof t=="function"&&"applyToOptions"in t}function QZ({type:t,...e}){return cI(t)&&oI()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class JZ extends BC{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:i,keyframes:a,pseudoElement:s,allowFlatten:r=!1,finalKeyframe:o,onComplete:c}=e;this.isPseudoElement=!!s,this.allowFlatten=r,this.options=e,MC(typeof e.type!="string");const u=QZ(e);this.animation=ZZ(n,i,a,u,s),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!s){const h=zC(a,this.options,o,this.speed);this.updateMotionValue?this.updateMotionValue(h):KZ(n,i,h),this.animation.cancel()}c?.(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){this.animation.finish?.()}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){this.isPseudoElement||this.animation.commitStyles?.()}get duration(){const e=this.animation.effect?.getComputedTiming?.().duration||0;return _l(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+_l(e)}get time(){return _l(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=fu(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){return this.allowFlatten&&this.animation.effect?.updateTiming({easing:"linear"}),this.animation.onfinish=null,e&&XZ()?(this.animation.timeline=e,Ml):n(this)}}const uI={anticipate:kO,backInOut:VO,circInOut:$O};function eQ(t){return t in uI}function tQ(t){typeof t.ease=="string"&&eQ(t.ease)&&(t.ease=uI[t.ease])}const G8=10;class nQ extends JZ{constructor(e){tQ(e),aI(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:i,onComplete:a,element:s,...r}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const o=new aw({...r,autoplay:!1}),c=fu(this.finishedTime??this.time);n.setWithVelocity(o.sample(c-G8).value,o.sample(c).value,G8),o.stop()}}const W8=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Kf.test(t)||t==="0")&&!t.startsWith("url("));function iQ(t){const e=t[0];if(t.length===1)return!0;for(let n=0;n<t.length;n++)if(t[n]!==e)return!0}function aQ(t,e,n,i){const a=t[0];if(a===null)return!1;if(e==="display"||e==="visibility")return!0;const s=t[t.length-1],r=W8(a,e),o=W8(s,e);return!r||!o?!1:iQ(t)||(n==="spring"||cI(n))&&i}function TT(t){t.duration=0,t.type="keyframes"}const sQ=new Set(["opacity","clipPath","filter","transform"]),rQ=TC(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function oQ(t){const{motionValue:e,name:n,repeatDelay:i,repeatType:a,damping:s,type:r}=t;if(!(e?.owner?.current instanceof HTMLElement))return!1;const{onUpdate:c,transformTemplate:u}=e.owner.getProps();return rQ()&&n&&sQ.has(n)&&(n!=="transform"||!u)&&!c&&!i&&a!=="mirror"&&s!==0&&r!=="inertia"}const lQ=40;class cQ extends BC{constructor({autoplay:e=!0,delay:n=0,type:i="keyframes",repeat:a=0,repeatDelay:s=0,repeatType:r="loop",keyframes:o,name:c,motionValue:u,element:h,...d}){super(),this.stop=()=>{this._animation&&(this._animation.stop(),this.stopTimeline?.()),this.keyframeResolver?.cancel()},this.createdAt=mo.now();const p={autoplay:e,delay:n,type:i,repeat:a,repeatDelay:s,repeatType:r,name:c,motionValue:u,element:h,...d},g=h?.KeyframeResolver||UC;this.keyframeResolver=new g(o,(b,w,x)=>this.onKeyframesResolved(b,w,p,!x),c,u,h),this.keyframeResolver?.scheduleResolve()}onKeyframesResolved(e,n,i,a){this.keyframeResolver=void 0;const{name:s,type:r,velocity:o,delay:c,isHandoff:u,onUpdate:h}=i;this.resolvedAt=mo.now(),aQ(e,s,r,o)||((yu.instantAnimations||!c)&&h?.(zC(e,i,n)),e[0]=e[e.length-1],TT(i),i.repeat=0);const p={startTime:a?this.resolvedAt?this.resolvedAt-this.createdAt>lQ?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...i,keyframes:e},g=!u&&oQ(p)?new nQ({...p,element:p.motionValue.owner.current}):new aw(p);g.finished.then(()=>this.notifyFinished()).catch(Ml),this.pendingTimeline&&(this.stopTimeline=g.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=g}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){return this._animation||(this.keyframeResolver?.resume(),GZ()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){this._animation&&this.animation.cancel(),this.keyframeResolver?.cancel()}}const uQ=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function dQ(t){const e=uQ.exec(t);if(!e)return[,];const[,n,i,a]=e;return[`--${n??i}`,a]}function dI(t,e,n=1){const[i,a]=dQ(t);if(!i)return;const s=window.getComputedStyle(e).getPropertyValue(i);if(s){const r=s.trim();return LO(r)?parseFloat(r):r}return PC(a)?dI(a,e,n+1):a}function jC(t,e){return t?.[e]??t?.default??t}const fI=new Set(["width","height","top","left","right","bottom",...ev]),fQ={test:t=>t==="auto",parse:t=>t},hI=t=>e=>e.test(t),pI=[Jg,Mn,hu,Tf,iZ,nZ,fQ],K8=t=>pI.find(hI(t));function hQ(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||IO(t):!0}const pQ=new Set(["brightness","contrast","saturate","opacity"]);function mQ(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[i]=n.match(DC)||[];if(!i)return t;const a=n.replace(i,"");let s=pQ.has(e)?1:0;return i!==n&&(s*=100),e+"("+s+a+")"}const gQ=/\b([a-z-]*)\(.*?\)/gu,CT={...Kf,getAnimatableNone:t=>{const e=t.match(gQ);return e?e.map(mQ).join(" "):t}},X8={...Jg,transform:Math.round},vQ={rotate:Tf,rotateX:Tf,rotateY:Tf,rotateZ:Tf,scale:k2,scaleX:k2,scaleY:k2,scaleZ:k2,skew:Tf,skewX:Tf,skewY:Tf,distance:Mn,translateX:Mn,translateY:Mn,translateZ:Mn,x:Mn,y:Mn,z:Mn,perspective:Mn,transformPerspective:Mn,opacity:Zb,originX:I8,originY:I8,originZ:Mn},FC={borderWidth:Mn,borderTopWidth:Mn,borderRightWidth:Mn,borderBottomWidth:Mn,borderLeftWidth:Mn,borderRadius:Mn,radius:Mn,borderTopLeftRadius:Mn,borderTopRightRadius:Mn,borderBottomRightRadius:Mn,borderBottomLeftRadius:Mn,width:Mn,maxWidth:Mn,height:Mn,maxHeight:Mn,top:Mn,right:Mn,bottom:Mn,left:Mn,padding:Mn,paddingTop:Mn,paddingRight:Mn,paddingBottom:Mn,paddingLeft:Mn,margin:Mn,marginTop:Mn,marginRight:Mn,marginBottom:Mn,marginLeft:Mn,backgroundPositionX:Mn,backgroundPositionY:Mn,...vQ,zIndex:X8,fillOpacity:Zb,strokeOpacity:Zb,numOctaves:X8},yQ={...FC,color:Ka,backgroundColor:Ka,outlineColor:Ka,fill:Ka,stroke:Ka,borderColor:Ka,borderTopColor:Ka,borderRightColor:Ka,borderBottomColor:Ka,borderLeftColor:Ka,filter:CT,WebkitFilter:CT},mI=t=>yQ[t];function gI(t,e){let n=mI(t);return n!==CT&&(n=Kf),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const bQ=new Set(["auto","none","0"]);function xQ(t,e,n){let i=0,a;for(;i<t.length&&!a;){const s=t[i];typeof s=="string"&&!bQ.has(s)&&Qb(s).values.length&&(a=t[i]),i++}if(a&&n)for(const s of e)t[s]=gI(n,a)}class _Q extends UC{constructor(e,n,i,a,s){super(e,n,i,a,s,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:n,name:i}=this;if(!n||!n.current)return;super.readKeyframes();for(let c=0;c<e.length;c++){let u=e[c];if(typeof u=="string"&&(u=u.trim(),PC(u))){const h=dI(u,n.current);h!==void 0&&(e[c]=h),c===e.length-1&&(this.finalKeyframe=u)}}if(this.resolveNoneKeyframes(),!fI.has(i)||e.length!==2)return;const[a,s]=e,r=K8(a),o=K8(s);if(r!==o)if(H8(r)&&H8(o))for(let c=0;c<e.length;c++){const u=e[c];typeof u=="string"&&(e[c]=parseFloat(u))}else Hp[i]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:n}=this,i=[];for(let a=0;a<e.length;a++)(e[a]===null||hQ(e[a]))&&i.push(a);i.length&&xQ(e,i,n)}measureInitialState(){const{element:e,unresolvedKeyframes:n,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Hp[i](e.measureViewportBox(),window.getComputedStyle(e.current)),n[0]=this.measuredOrigin;const a=n[n.length-1];a!==void 0&&e.getValue(i,a).jump(a,!1)}measureEndState(){const{element:e,name:n,unresolvedKeyframes:i}=this;if(!e||!e.current)return;const a=e.getValue(n);a&&a.jump(this.measuredOrigin,!1);const s=i.length-1,r=i[s];i[s]=Hp[n](e.measureViewportBox(),window.getComputedStyle(e.current)),r!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=r),this.removedTransforms?.length&&this.removedTransforms.forEach(([o,c])=>{e.getValue(o).set(c)}),this.resolveNoneKeyframes()}}const SQ=new Set(["opacity","clipPath","filter","transform"]);function wQ(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let i=document;e&&(i=e.current);const a=n?.[t]??i.querySelectorAll(t);return a?Array.from(a):[]}return Array.from(t)}const vI=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function yI(t){return OO(t)&&"offsetHeight"in t}const q8=30,EQ=t=>!isNaN(parseFloat(t)),Y8={current:void 0};class bI{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=i=>{const a=mo.now();if(this.updatedAt!==a&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&(this.events.change?.notify(this.current),this.dependents))for(const s of this.dependents)s.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=mo.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=EQ(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new CC);const i=this.events[e].add(n);return e==="change"?()=>{i(),ta.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,i){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){this.events.change?.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return Y8.current&&Y8.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const e=mo.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>q8)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,q8);return zO(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.dependents?.clear(),this.events.destroy?.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Dg(t,e){return new bI(t,e)}const{schedule:VC,cancel:T_e}=KO(queueMicrotask,!1),sc={x:!1,y:!1};function xI(){return sc.x||sc.y}function MQ(t){return t==="x"||t==="y"?sc[t]?null:(sc[t]=!0,()=>{sc[t]=!1}):sc.x||sc.y?null:(sc.x=sc.y=!0,()=>{sc.x=sc.y=!1})}function _I(t,e){const n=wQ(t),i=new AbortController,a={passive:!0,...e,signal:i.signal};return[n,a,()=>i.abort()]}function Z8(t){return!(t.pointerType==="touch"||xI())}function TQ(t,e,n={}){const[i,a,s]=_I(t,n),r=o=>{if(!Z8(o))return;const{target:c}=o,u=e(c,o);if(typeof u!="function"||!c)return;const h=d=>{Z8(d)&&(u(d),c.removeEventListener("pointerleave",h))};c.addEventListener("pointerleave",h,a)};return i.forEach(o=>{o.addEventListener("pointerenter",r,a)}),s}const SI=(t,e)=>e?t===e?!0:SI(t,e.parentElement):!1,kC=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,CQ=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function AQ(t){return CQ.has(t.tagName)||t.tabIndex!==-1}const lS=new WeakSet;function Q8(t){return e=>{e.key==="Enter"&&t(e)}}function uE(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const RQ=(t,e)=>{const n=t.currentTarget;if(!n)return;const i=Q8(()=>{if(lS.has(n))return;uE(n,"down");const a=Q8(()=>{uE(n,"up")}),s=()=>uE(n,"cancel");n.addEventListener("keyup",a,e),n.addEventListener("blur",s,e)});n.addEventListener("keydown",i,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",i),e)};function J8(t){return kC(t)&&!xI()}function NQ(t,e,n={}){const[i,a,s]=_I(t,n),r=o=>{const c=o.currentTarget;if(!J8(o))return;lS.add(c);const u=e(c,o),h=(g,b)=>{window.removeEventListener("pointerup",d),window.removeEventListener("pointercancel",p),lS.has(c)&&lS.delete(c),J8(g)&&typeof u=="function"&&u(g,{success:b})},d=g=>{h(g,c===window||c===document||n.useGlobalTarget||SI(c,g.target))},p=g=>{h(g,!1)};window.addEventListener("pointerup",d,a),window.addEventListener("pointercancel",p,a)};return i.forEach(o=>{(n.useGlobalTarget?window:o).addEventListener("pointerdown",r,a),yI(o)&&(o.addEventListener("focus",u=>RQ(u,a)),!AQ(o)&&!o.hasAttribute("tabindex")&&(o.tabIndex=0))}),s}function wI(t){return OO(t)&&"ownerSVGElement"in t}function PQ(t){return wI(t)&&t.tagName==="svg"}const cr=t=>!!(t&&t.getVelocity),DQ=[...pI,Ka,Kf],LQ=t=>DQ.find(hI(t)),Jb=P.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function eN(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function OQ(...t){return e=>{let n=!1;const i=t.map(a=>{const s=eN(a,e);return!n&&typeof s=="function"&&(n=!0),s});if(n)return()=>{for(let a=0;a<i.length;a++){const s=i[a];typeof s=="function"?s():eN(t[a],null)}}}}function IQ(...t){return P.useCallback(OQ(...t),t)}class zQ extends P.Component{getSnapshotBeforeUpdate(e){const n=this.props.childRef.current;if(n&&e.isPresent&&!this.props.isPresent){const i=n.offsetParent,a=yI(i)&&i.offsetWidth||0,s=this.props.sizeRef.current;s.height=n.offsetHeight||0,s.width=n.offsetWidth||0,s.top=n.offsetTop,s.left=n.offsetLeft,s.right=a-s.width-s.left}return null}componentDidUpdate(){}render(){return this.props.children}}function BQ({children:t,isPresent:e,anchorX:n,root:i}){const a=P.useId(),s=P.useRef(null),r=P.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:o}=P.useContext(Jb),c=IQ(s,t?.ref);return P.useInsertionEffect(()=>{const{width:u,height:h,top:d,left:p,right:g}=r.current;if(e||!s.current||!u||!h)return;const b=n==="left"?`left: ${p}`:`right: ${g}`;s.current.dataset.motionPopId=a;const w=document.createElement("style");o&&(w.nonce=o);const x=i??document.head;return x.appendChild(w),w.sheet&&w.sheet.insertRule(`
[data-motion-pop-id="${a}"] {
position: absolute !important;
width: ${u}px !important;
height: ${h}px !important;
${b}px !important;
top: ${d}px !important;
}
`),()=>{x.contains(w)&&x.removeChild(w)}},[e]),_.jsx(zQ,{isPresent:e,childRef:s,sizeRef:r,children:P.cloneElement(t,{ref:c})})}const UQ=({children:t,initial:e,isPresent:n,onExitComplete:i,custom:a,presenceAffectsLayout:s,mode:r,anchorX:o,root:c})=>{const u=X1(jQ),h=P.useId();let d=!0,p=P.useMemo(()=>(d=!1,{id:h,initial:e,isPresent:n,custom:a,onExitComplete:g=>{u.set(g,!0);for(const b of u.values())if(!b)return;i&&i()},register:g=>(u.set(g,!1),()=>u.delete(g))}),[n,u,i]);return s&&d&&(p={...p}),P.useMemo(()=>{u.forEach((g,b)=>u.set(b,!1))},[n]),P.useEffect(()=>{!n&&!u.size&&i&&i()},[n]),r==="popLayout"&&(t=_.jsx(BQ,{isPresent:n,anchorX:o,root:c,children:t})),_.jsx(q1.Provider,{value:p,children:t})};function jQ(){return new Map}function EI(t=!0){const e=P.useContext(q1);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:i,register:a}=e,s=P.useId();P.useEffect(()=>{if(t)return a(s)},[t]);const r=P.useCallback(()=>t&&i&&i(s),[s,i,t]);return!n&&i?[!1,r]:[!0]}function C_e(){return FQ(P.useContext(q1))}function FQ(t){return t===null?!0:t.isPresent}const H2=t=>t.key||"";function tN(t){const e=[];return P.Children.forEach(t,n=>{P.isValidElement(n)&&e.push(n)}),e}const Hs=({children:t,custom:e,initial:n=!0,onExitComplete:i,presenceAffectsLayout:a=!0,mode:s="sync",propagate:r=!1,anchorX:o="left",root:c})=>{const[u,h]=EI(r),d=P.useMemo(()=>tN(t),[t]),p=r&&!u?[]:d.map(H2),g=P.useRef(!0),b=P.useRef(d),w=X1(()=>new Map),[x,S]=P.useState(d),[M,C]=P.useState(d);SC(()=>{g.current=!1,b.current=d;for(let R=0;R<M.length;R++){const D=H2(M[R]);p.includes(D)?w.delete(D):w.get(D)!==!0&&w.set(D,!1)}},[M,p.length,p.join("-")]);const A=[];if(d!==x){let R=[...d];for(let D=0;D<M.length;D++){const B=M[D],z=H2(B);p.includes(z)||(R.splice(D,0,B),A.push(B))}return s==="wait"&&A.length&&(R=A),C(tN(R)),S(d),null}const{forceRender:N}=P.useContext(qb);return _.jsx(_.Fragment,{children:M.map(R=>{const D=H2(R),B=r&&!u?!1:d===M||p.includes(D),z=()=>{if(w.has(D))w.set(D,!0);else return;let I=!0;w.forEach(U=>{U||(I=!1)}),I&&(N?.(),C(b.current),r&&h?.(),i&&i())};return _.jsx(UQ,{isPresent:B,initial:!g.current||n?void 0:!1,custom:e,presenceAffectsLayout:a,mode:s,root:c,onExitComplete:B?void 0:z,anchorX:o,children:R},D)})})},VQ=P.createContext(null);function kQ(){const t=P.useRef(!1);return SC(()=>(t.current=!0,()=>{t.current=!1}),[]),t}function HQ(){const t=kQ(),[e,n]=P.useState(0),i=P.useCallback(()=>{t.current&&n(e+1)},[e]);return[P.useCallback(()=>ta.postRender(i),[i]),e]}const $Q=t=>!t.isLayoutDirty&&t.willUpdate(!1);function nN(){const t=new Set,e=new WeakMap,n=()=>t.forEach($Q);return{add:i=>{t.add(i),e.set(i,i.addEventListener("willUpdate",n))},remove:i=>{t.delete(i);const a=e.get(i);a&&(a(),e.delete(i)),n()},dirty:n}}const MI=t=>t===!0,GQ=t=>MI(t===!0)||t==="id",WQ=({children:t,id:e,inherit:n=!0})=>{const i=P.useContext(qb),a=P.useContext(VQ),[s,r]=HQ(),o=P.useRef(null),c=i.id||a;o.current===null&&(GQ(n)&&c&&(e=e?c+"-"+e:c),o.current={id:e,group:MI(n)&&i.group||nN()});const u=P.useMemo(()=>({...o.current,forceRender:s}),[r]);return _.jsx(qb.Provider,{value:u,children:t})},HC=P.createContext({strict:!1}),iN={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},Lg={};for(const t in iN)Lg[t]={isEnabled:e=>iN[t].some(n=>!!e[n])};function AT(t){for(const e in t)Lg[e]={...Lg[e],...t[e]}}function Al({children:t,features:e,strict:n=!1}){const[,i]=P.useState(!dE(e)),a=P.useRef(void 0);if(!dE(e)){const{renderer:s,...r}=e;a.current=s,AT(r)}return P.useEffect(()=>{dE(e)&&e().then(({renderer:s,...r})=>{AT(r),a.current=s,i(!0)})},[]),_.jsx(HC.Provider,{value:{renderer:a.current,strict:n},children:t})}function dE(t){return typeof t=="function"}const KQ=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function PS(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||KQ.has(t)}let TI=t=>!PS(t);function CI(t){typeof t=="function"&&(TI=e=>e.startsWith("on")?!PS(e):t(e))}try{CI(require("@emotion/is-prop-valid").default)}catch{}function XQ(t,e,n){const i={};for(const a in t)a==="values"&&typeof t.values=="object"||(TI(a)||n===!0&&PS(a)||!e&&!PS(a)||t.draggable&&a.startsWith("onDrag"))&&(i[a]=t[a]);return i}function qQ({children:t,isValidProp:e,...n}){e&&CI(e),n={...P.useContext(Jb),...n},n.isStatic=X1(()=>n.isStatic);const i=P.useMemo(()=>n,[JSON.stringify(n.transition),n.transformPagePoint,n.reducedMotion]);return _.jsx(Jb.Provider,{value:i,children:t})}const sw=P.createContext({});function rw(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function e1(t){return typeof t=="string"||Array.isArray(t)}const $C=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],GC=["initial",...$C];function ow(t){return rw(t.animate)||GC.some(e=>e1(t[e]))}function AI(t){return!!(ow(t)||t.variants)}function YQ(t,e){if(ow(t)){const{initial:n,animate:i}=t;return{initial:n===!1||e1(n)?n:void 0,animate:e1(i)?i:void 0}}return t.inherit!==!1?e:{}}function ZQ(t){const{initial:e,animate:n}=YQ(t,P.useContext(sw));return P.useMemo(()=>({initial:e,animate:n}),[aN(e),aN(n)])}function aN(t){return Array.isArray(t)?t.join(" "):t}const t1={};function QQ(t){for(const e in t)t1[e]=t[e],NC(e)&&(t1[e].isCSSVariable=!0)}function RI(t,{layout:e,layoutId:n}){return dm.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!t1[t]||t==="opacity")}const JQ={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},eJ=ev.length;function tJ(t,e,n){let i="",a=!0;for(let s=0;s<eJ;s++){const r=ev[s],o=t[r];if(o===void 0)continue;let c=!0;if(typeof o=="number"?c=o===(r.startsWith("scale")?1:0):c=parseFloat(o)===0,!c||n){const u=vI(o,FC[r]);if(!c){a=!1;const h=JQ[r]||r;i+=`${h}(${u}) `}n&&(e[r]=u)}}return i=i.trim(),n?i=n(e,a?"":i):a&&(i="none"),i}function WC(t,e,n){const{style:i,vars:a,transformOrigin:s}=t;let r=!1,o=!1;for(const c in e){const u=e[c];if(dm.has(c)){r=!0;continue}else if(NC(c)){a[c]=u;continue}else{const h=vI(u,FC[c]);c.startsWith("origin")?(o=!0,s[c]=h):i[c]=h}}if(e.transform||(r||n?i.transform=tJ(e,t.transform,n):i.transform&&(i.transform="none")),o){const{originX:c="50%",originY:u="50%",originZ:h=0}=s;i.transformOrigin=`${c} ${u} ${h}`}}const KC=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function NI(t,e,n){for(const i in e)!cr(e[i])&&!RI(i,n)&&(t[i]=e[i])}function nJ({transformTemplate:t},e){return P.useMemo(()=>{const n=KC();return WC(n,e,t),Object.assign({},n.vars,n.style)},[e])}function iJ(t,e){const n=t.style||{},i={};return NI(i,n,t),Object.assign(i,nJ(t,e)),i}function aJ(t,e){const n={},i=iJ(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=i,n}const sJ={offset:"stroke-dashoffset",array:"stroke-dasharray"},rJ={offset:"strokeDashoffset",array:"strokeDasharray"};function oJ(t,e,n=1,i=0,a=!0){t.pathLength=1;const s=a?sJ:rJ;t[s.offset]=Mn.transform(-i);const r=Mn.transform(e),o=Mn.transform(n);t[s.array]=`${r} ${o}`}function PI(t,{attrX:e,attrY:n,attrScale:i,pathLength:a,pathSpacing:s=1,pathOffset:r=0,...o},c,u,h){if(WC(t,o,u),c){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:d,style:p}=t;d.transform&&(p.transform=d.transform,delete d.transform),(p.transform||d.transformOrigin)&&(p.transformOrigin=d.transformOrigin??"50% 50%",delete d.transformOrigin),p.transform&&(p.transformBox=h?.transformBox??"fill-box",delete d.transformBox),e!==void 0&&(d.x=e),n!==void 0&&(d.y=n),i!==void 0&&(d.scale=i),a!==void 0&&oJ(d,a,s,r,!1)}const DI=()=>({...KC(),attrs:{}}),LI=t=>typeof t=="string"&&t.toLowerCase()==="svg";function lJ(t,e,n,i){const a=P.useMemo(()=>{const s=DI();return PI(s,e,LI(i),t.transformTemplate,t.style),{...s.attrs,style:{...s.style}}},[e]);if(t.style){const s={};NI(s,t.style,t),a.style={...s,...a.style}}return a}const cJ=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function XC(t){return typeof t!="string"||t.includes("-")?!1:!!(cJ.indexOf(t)>-1||/[A-Z]/u.test(t))}function uJ(t,e,n,{latestValues:i},a,s=!1){const o=(XC(t)?lJ:aJ)(e,i,a,t),c=XQ(e,typeof t=="string",s),u=t!==P.Fragment?{...c,...o,ref:n}:{},{children:h}=e,d=P.useMemo(()=>cr(h)?h.get():h,[h]);return P.createElement(t,{...u,children:d})}function sN(t){const e=[{},{}];return t?.values.forEach((n,i)=>{e[0][i]=n.get(),e[1][i]=n.getVelocity()}),e}function qC(t,e,n,i){if(typeof e=="function"){const[a,s]=sN(i);e=e(n!==void 0?n:t.custom,a,s)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[a,s]=sN(i);e=e(n!==void 0?n:t.custom,a,s)}return e}function cS(t){return cr(t)?t.get():t}function dJ({scrapeMotionValuesFromProps:t,createRenderState:e},n,i,a){return{latestValues:fJ(n,i,a,t),renderState:e()}}function fJ(t,e,n,i){const a={},s=i(t,{});for(const p in s)a[p]=cS(s[p]);let{initial:r,animate:o}=t;const c=ow(t),u=AI(t);e&&u&&!c&&t.inherit!==!1&&(r===void 0&&(r=e.initial),o===void 0&&(o=e.animate));let h=n?n.initial===!1:!1;h=h||r===!1;const d=h?o:r;if(d&&typeof d!="boolean"&&!rw(d)){const p=Array.isArray(d)?d:[d];for(let g=0;g<p.length;g++){const b=qC(t,p[g]);if(b){const{transitionEnd:w,transition:x,...S}=b;for(const M in S){let C=S[M];if(Array.isArray(C)){const A=h?C.length-1:0;C=C[A]}C!==null&&(a[M]=C)}for(const M in w)a[M]=w[M]}}}return a}const OI=t=>(e,n)=>{const i=P.useContext(sw),a=P.useContext(q1),s=()=>dJ(t,e,i,a);return n?s():X1(s)};function YC(t,e,n){const{style:i}=t,a={};for(const s in i)(cr(i[s])||e.style&&cr(e.style[s])||RI(s,t)||n?.getValue(s)?.liveStyle!==void 0)&&(a[s]=i[s]);return a}const hJ=OI({scrapeMotionValuesFromProps:YC,createRenderState:KC});function II(t,e,n){const i=YC(t,e,n);for(const a in t)if(cr(t[a])||cr(e[a])){const s=ev.indexOf(a)!==-1?"attr"+a.charAt(0).toUpperCase()+a.substring(1):a;i[s]=t[a]}return i}const pJ=OI({scrapeMotionValuesFromProps:II,createRenderState:DI}),mJ=Symbol.for("motionComponentSymbol");function cg(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function gJ(t,e,n){return P.useCallback(i=>{i&&t.onMount&&t.onMount(i),e&&(i?e.mount(i):e.unmount()),n&&(typeof n=="function"?n(i):cg(n)&&(n.current=i))},[e])}const ZC=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vJ="framerAppearId",zI="data-"+ZC(vJ),BI=P.createContext({});function yJ(t,e,n,i,a){const{visualElement:s}=P.useContext(sw),r=P.useContext(HC),o=P.useContext(q1),c=P.useContext(Jb).reducedMotion,u=P.useRef(null);i=i||r.renderer,!u.current&&i&&(u.current=i(t,{visualState:e,parent:s,props:n,presenceContext:o,blockInitialAnimation:o?o.initial===!1:!1,reducedMotionConfig:c}));const h=u.current,d=P.useContext(BI);h&&!h.projection&&a&&(h.type==="html"||h.type==="svg")&&bJ(u.current,n,a,d);const p=P.useRef(!1);P.useInsertionEffect(()=>{h&&p.current&&h.update(n,o)});const g=n[zI],b=P.useRef(!!g&&!window.MotionHandoffIsComplete?.(g)&&window.MotionHasOptimisedAnimation?.(g));return SC(()=>{h&&(p.current=!0,window.MotionIsMounted=!0,h.updateFeatures(),h.scheduleRenderMicrotask(),b.current&&h.animationState&&h.animationState.animateChanges())}),P.useEffect(()=>{h&&(!b.current&&h.animationState&&h.animationState.animateChanges(),b.current&&(queueMicrotask(()=>{window.MotionHandoffMarkAsComplete?.(g)}),b.current=!1),h.enteringChildren=void 0)}),h}function bJ(t,e,n,i){const{layoutId:a,layout:s,drag:r,dragConstraints:o,layoutScroll:c,layoutRoot:u,layoutCrossfade:h}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:UI(t.parent)),t.projection.setOptions({layoutId:a,layout:s,alwaysMeasureLayout:!!r||o&&cg(o),visualElement:t,animationType:typeof s=="string"?s:"both",initialPromotionConfig:i,crossfade:h,layoutScroll:c,layoutRoot:u})}function UI(t){if(t)return t.options.allowProjection!==!1?t.projection:UI(t.parent)}function fE(t,{forwardMotionProps:e=!1}={},n,i){n&&AT(n);const a=XC(t)?pJ:hJ;function s(o,c){let u;const h={...P.useContext(Jb),...o,layoutId:xJ(o)},{isStatic:d}=h,p=ZQ(o),g=a(o,d);if(!d&&_C){_J();const b=SJ(h);u=b.MeasureLayout,p.visualElement=yJ(t,g,h,i,b.ProjectionNode)}return _.jsxs(sw.Provider,{value:p,children:[u&&p.visualElement?_.jsx(u,{visualElement:p.visualElement,...h}):null,uJ(t,o,gJ(g,p.visualElement,c),g,d,e)]})}s.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const r=P.forwardRef(s);return r[mJ]=t,r}function xJ({layoutId:t}){const e=P.useContext(qb).id;return e&&t!==void 0?e+"-"+t:t}function _J(t,e){P.useContext(HC).strict}function SJ(t){const{drag:e,layout:n}=Lg;if(!e&&!n)return{};const i={...e,...n};return{MeasureLayout:e?.isEnabled(t)||n?.isEnabled(t)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}function jI(t,e){if(typeof Proxy>"u")return fE;const n=new Map,i=(s,r)=>fE(s,r,t,e),a=(s,r)=>i(s,r);return new Proxy(a,{get:(s,r)=>r==="create"?i:(n.has(r)||n.set(r,fE(r,void 0,t,e)),n.get(r))})}const Rl=jI();function FI({top:t,left:e,right:n,bottom:i}){return{x:{min:e,max:n},y:{min:t,max:i}}}function wJ({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function EJ(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),i=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:i.y,right:i.x}}function hE(t){return t===void 0||t===1}function RT({scale:t,scaleX:e,scaleY:n}){return!hE(t)||!hE(e)||!hE(n)}function Tp(t){return RT(t)||VI(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function VI(t){return rN(t.x)||rN(t.y)}function rN(t){return t&&t!=="0%"}function DS(t,e,n){const i=t-n,a=e*i;return n+a}function oN(t,e,n,i,a){return a!==void 0&&(t=DS(t,a,i)),DS(t,n,i)+e}function NT(t,e=0,n=1,i,a){t.min=oN(t.min,e,n,i,a),t.max=oN(t.max,e,n,i,a)}function kI(t,{x:e,y:n}){NT(t.x,e.translate,e.scale,e.originPoint),NT(t.y,n.translate,n.scale,n.originPoint)}const lN=.999999999999,cN=1.0000000000001;function MJ(t,e,n,i=!1){const a=n.length;if(!a)return;e.x=e.y=1;let s,r;for(let o=0;o<a;o++){s=n[o],r=s.projectionDelta;const{visualElement:c}=s.options;c&&c.props.style&&c.props.style.display==="contents"||(i&&s.options.layoutScroll&&s.scroll&&s!==s.root&&dg(t,{x:-s.scroll.offset.x,y:-s.scroll.offset.y}),r&&(e.x*=r.x.scale,e.y*=r.y.scale,kI(t,r)),i&&Tp(s.latestValues)&&dg(t,s.latestValues))}e.x<cN&&e.x>lN&&(e.x=1),e.y<cN&&e.y>lN&&(e.y=1)}function ug(t,e){t.min=t.min+e,t.max=t.max+e}function uN(t,e,n,i,a=.5){const s=_a(t.min,t.max,a);NT(t,e,n,s,i)}function dg(t,e){uN(t.x,e.x,e.scaleX,e.scale,e.originX),uN(t.y,e.y,e.scaleY,e.scale,e.originY)}function HI(t,e){return FI(EJ(t.getBoundingClientRect(),e))}function TJ(t,e,n){const i=HI(t,n),{scroll:a}=e;return a&&(ug(i.x,a.offset.x),ug(i.y,a.offset.y)),i}const dN=()=>({translate:0,scale:1,origin:0,originPoint:0}),fg=()=>({x:dN(),y:dN()}),fN=()=>({min:0,max:0}),za=()=>({x:fN(),y:fN()}),PT={current:null},$I={current:!1};function CJ(){if($I.current=!0,!!_C)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>PT.current=t.matches;t.addEventListener("change",e),e()}else PT.current=!1}const AJ=new WeakMap;function RJ(t,e,n){for(const i in e){const a=e[i],s=n[i];if(cr(a))t.addValue(i,a);else if(cr(s))t.addValue(i,Dg(a,{owner:t}));else if(s!==a)if(t.hasValue(i)){const r=t.getValue(i);r.liveStyle===!0?r.jump(a):r.hasAnimated||r.set(a)}else{const r=t.getStaticValue(i);t.addValue(i,Dg(r!==void 0?r:a,{owner:t}))}}for(const i in n)e[i]===void 0&&t.removeValue(i);return e}const hN=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class NJ{scrapeMotionValuesFromProps(e,n,i){return{}}constructor({parent:e,props:n,presenceContext:i,reducedMotionConfig:a,blockInitialAnimation:s,visualState:r},o={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=UC,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const p=mo.now();this.renderScheduledAt<p&&(this.renderScheduledAt=p,ta.render(this.render,!1,!0))};const{latestValues:c,renderState:u}=r;this.latestValues=c,this.baseTarget={...c},this.initialValues=n.initial?{...c}:{},this.renderState=u,this.parent=e,this.props=n,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=a,this.options=o,this.blockInitialAnimation=!!s,this.isControllingVariants=ow(n),this.isVariantNode=AI(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:h,...d}=this.scrapeMotionValuesFromProps(n,{},this);for(const p in d){const g=d[p];c[p]!==void 0&&cr(g)&&g.set(c[p])}}mount(e){this.current=e,AJ.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,i)=>this.bindToMotionValue(i,n)),$I.current||CJ(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:PT.current,this.parent?.addChild(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),Wf(this.notifyUpdate),Wf(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent?.removeChild(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const n=this.features[e];n&&(n.unmount(),n.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=dm.has(e);i&&this.onBindTransform&&this.onBindTransform();const a=n.on("change",r=>{this.latestValues[e]=r,this.props.onUpdate&&ta.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let s;window.MotionCheckAppearSync&&(s=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{a(),s&&s(),n.owner&&n.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in Lg){const n=Lg[e];if(!n)continue;const{isEnabled:i,Feature:a}=n;if(!this.features[e]&&a&&i(this.props)&&(this.features[e]=new a(this)),this.features[e]){const s=this.features[e];s.isMounted?s.update():(s.mount(),s.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):za()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let i=0;i<hN.length;i++){const a=hN[i];this.propEventSubscriptions[a]&&(this.propEventSubscriptions[a](),delete this.propEventSubscriptions[a]);const s="on"+a,r=e[s];r&&(this.propEventSubscriptions[a]=this.on(a,r))}this.prevMotionValues=RJ(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(e),()=>n.variantChildren.delete(e)}addValue(e,n){const i=this.values.get(e);n!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&n!==void 0&&(i=Dg(n===null?void 0:n,{owner:this}),this.addValue(e,i)),i}readValue(e,n){let i=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return i!=null&&(typeof i=="string"&&(LO(i)||IO(i))?i=parseFloat(i):!LQ(i)&&Kf.test(n)&&(i=gI(e,n)),this.setBaseTarget(e,cr(i)?i.get():i)),cr(i)?i.get():i}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){const{initial:n}=this.props;let i;if(typeof n=="string"||typeof n=="object"){const s=qC(this.props,n,this.presenceContext?.custom);s&&(i=s[e])}if(n&&i!==void 0)return i;const a=this.getBaseTargetFromProps(this.props,e);return a!==void 0&&!cr(a)?a:this.initialValues[e]!==void 0&&i===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new CC),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){VC.render(this.render)}}class GI extends NJ{constructor(){super(...arguments),this.KeyframeResolver=_Q}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:i}){delete n[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;cr(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function WI(t,{style:e,vars:n},i,a){const s=t.style;let r;for(r in e)s[r]=e[r];a?.applyProjectionStyles(s,i);for(r in n)s.setProperty(r,n[r])}function PJ(t){return window.getComputedStyle(t)}class DJ extends GI{constructor(){super(...arguments),this.type="html",this.renderInstance=WI}readValueFromInstance(e,n){if(dm.has(n))return this.projection?.isProjecting?_T(n):FZ(e,n);{const i=PJ(e),a=(NC(n)?i.getPropertyValue(n):i[n])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:n}){return HI(e,n)}build(e,n,i){WC(e,n,i.transformTemplate)}scrapeMotionValuesFromProps(e,n,i){return YC(e,n,i)}}const KI=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function LJ(t,e,n,i){WI(t,e,void 0,i);for(const a in e.attrs)t.setAttribute(KI.has(a)?a:ZC(a),e.attrs[a])}class OJ extends GI{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=za}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(dm.has(n)){const i=mI(n);return i&&i.default||0}return n=KI.has(n)?n:ZC(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,i){return II(e,n,i)}build(e,n,i){PI(e,n,this.isSVGTag,i.transformTemplate,i.style)}renderInstance(e,n,i,a){LJ(e,n,i,a)}mount(e){this.isSVGTag=LI(e.tagName),super.mount(e)}}const IJ=(t,e)=>XC(t)?new OJ(e):new DJ(e,{allowProjection:t!==P.Fragment});function Eg(t,e,n){const i=t.getProps();return qC(i,e,n!==void 0?n:i.custom,t)}const DT=t=>Array.isArray(t);function zJ(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Dg(n))}function BJ(t){return DT(t)?t[t.length-1]||0:t}function UJ(t,e){const n=Eg(t,e);let{transitionEnd:i={},transition:a={},...s}=n||{};s={...s,...i};for(const r in s){const o=BJ(s[r]);zJ(t,r,o)}}function jJ(t){return!!(cr(t)&&t.add)}function LT(t,e){const n=t.getValue("willChange");if(jJ(n))return n.add(e);if(!n&&yu.WillChange){const i=new yu.WillChange("auto");t.addValue("willChange",i),i.add(e)}}function XI(t){return t.props[zI]}const FJ=t=>t!==null;function VJ(t,{repeat:e,repeatType:n="loop"},i){const a=t.filter(FJ),s=e&&n!=="loop"&&e%2===1?0:a.length-1;return a[s]}const kJ={type:"spring",stiffness:500,damping:25,restSpeed:10},HJ=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),$J={type:"keyframes",duration:.8},GJ={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},WJ=(t,{keyframes:e})=>e.length>2?$J:dm.has(t)?t.startsWith("scale")?HJ(e[1]):kJ:GJ;function KJ({when:t,delay:e,delayChildren:n,staggerChildren:i,staggerDirection:a,repeat:s,repeatType:r,repeatDelay:o,from:c,elapsed:u,...h}){return!!Object.keys(h).length}const QC=(t,e,n,i={},a,s)=>r=>{const o=jC(i,t)||{},c=o.delay||i.delay||0;let{elapsed:u=0}=i;u=u-fu(c);const h={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...o,delay:-u,onUpdate:p=>{e.set(p),o.onUpdate&&o.onUpdate(p)},onComplete:()=>{r(),o.onComplete&&o.onComplete()},name:t,motionValue:e,element:s?void 0:a};KJ(o)||Object.assign(h,WJ(t,h)),h.duration&&(h.duration=fu(h.duration)),h.repeatDelay&&(h.repeatDelay=fu(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let d=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(TT(h),h.delay===0&&(d=!0)),(yu.instantAnimations||yu.skipAnimations)&&(d=!0,TT(h),h.delay=0),h.allowFlatten=!o.type&&!o.ease,d&&!s&&e.get()!==void 0){const p=VJ(h.keyframes,o);if(p!==void 0){ta.update(()=>{h.onUpdate(p),h.onComplete()});return}}return o.isSync?new aw(h):new cQ(h)};function XJ({protectedKeys:t,needsAnimating:e},n){const i=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,i}function qI(t,e,{delay:n=0,transitionOverride:i,type:a}={}){let{transition:s=t.getDefaultTransition(),transitionEnd:r,...o}=e;i&&(s=i);const c=[],u=a&&t.animationState&&t.animationState.getState()[a];for(const h in o){const d=t.getValue(h,t.latestValues[h]??null),p=o[h];if(p===void 0||u&&XJ(u,h))continue;const g={delay:n,...jC(s||{},h)},b=d.get();if(b!==void 0&&!d.isAnimating&&!Array.isArray(p)&&p===b&&!g.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const S=XI(t);if(S){const M=window.MotionHandoffAnimation(S,h,ta);M!==null&&(g.startTime=M,w=!0)}}LT(t,h),d.start(QC(h,d,p,t.shouldReduceMotion&&fI.has(h)?{type:!1}:g,t,w));const x=d.animation;x&&c.push(x)}return r&&Promise.all(c).then(()=>{ta.update(()=>{r&&UJ(t,r)})}),c}function YI(t,e,n,i=0,a=1){const s=Array.from(t).sort((u,h)=>u.sortNodePosition(h)).indexOf(e),r=t.size,o=(r-1)*i;return typeof n=="function"?n(s,r):a===1?s*i:o-s*i}function OT(t,e,n={}){const i=Eg(t,e,n.type==="exit"?t.presenceContext?.custom:void 0);let{transition:a=t.getDefaultTransition()||{}}=i||{};n.transitionOverride&&(a=n.transitionOverride);const s=i?()=>Promise.all(qI(t,i,n)):()=>Promise.resolve(),r=t.variantChildren&&t.variantChildren.size?(c=0)=>{const{delayChildren:u=0,staggerChildren:h,staggerDirection:d}=a;return qJ(t,e,c,u,h,d,n)}:()=>Promise.resolve(),{when:o}=a;if(o){const[c,u]=o==="beforeChildren"?[s,r]:[r,s];return c().then(()=>u())}else return Promise.all([s(),r(n.delay)])}function qJ(t,e,n=0,i=0,a=0,s=1,r){const o=[];for(const c of t.variantChildren)c.notify("AnimationStart",e),o.push(OT(c,e,{...r,delay:n+(typeof i=="function"?0:i)+YI(t.variantChildren,c,i,a,s)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(o)}function YJ(t,e,n={}){t.notify("AnimationStart",e);let i;if(Array.isArray(e)){const a=e.map(s=>OT(t,s,n));i=Promise.all(a)}else if(typeof e=="string")i=OT(t,e,n);else{const a=typeof e=="function"?Eg(t,e,n.custom):e;i=Promise.all(qI(t,a,n))}return i.then(()=>{t.notify("AnimationComplete",e)})}function ZI(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let i=0;i<n;i++)if(e[i]!==t[i])return!1;return!0}const ZJ=GC.length;function QI(t){if(!t)return;if(!t.isControllingVariants){const n=t.parent?QI(t.parent)||{}:{};return t.props.initial!==void 0&&(n.initial=t.props.initial),n}const e={};for(let n=0;n<ZJ;n++){const i=GC[n],a=t.props[i];(e1(a)||a===!1)&&(e[i]=a)}return e}const QJ=[...$C].reverse(),JJ=$C.length;function eee(t){return e=>Promise.all(e.map(({animation:n,options:i})=>YJ(t,n,i)))}function tee(t){let e=eee(t),n=pN(),i=!0;const a=c=>(u,h)=>{const d=Eg(t,h,c==="exit"?t.presenceContext?.custom:void 0);if(d){const{transition:p,transitionEnd:g,...b}=d;u={...u,...b,...g}}return u};function s(c){e=c(t)}function r(c){const{props:u}=t,h=QI(t.parent)||{},d=[],p=new Set;let g={},b=1/0;for(let x=0;x<JJ;x++){const S=QJ[x],M=n[S],C=u[S]!==void 0?u[S]:h[S],A=e1(C),N=S===c?M.isActive:null;N===!1&&(b=x);let R=C===h[S]&&C!==u[S]&&A;if(R&&i&&t.manuallyAnimateOnMount&&(R=!1),M.protectedKeys={...g},!M.isActive&&N===null||!C&&!M.prevProp||rw(C)||typeof C=="boolean")continue;const D=nee(M.prevProp,C);let B=D||S===c&&M.isActive&&!R&&A||x>b&&A,z=!1;const I=Array.isArray(C)?C:[C];let U=I.reduce(a(S),{});N===!1&&(U={});const{prevResolvedValues:$={}}=M,G={...$,...U},k=H=>{B=!0,p.has(H)&&(z=!0,p.delete(H)),M.needsAnimating[H]=!0;const W=t.getValue(H);W&&(W.liveStyle=!1)};for(const H in G){const W=U[H],J=$[H];if(g.hasOwnProperty(H))continue;let Y=!1;DT(W)&&DT(J)?Y=!ZI(W,J):Y=W!==J,Y?W!=null?k(H):p.add(H):W!==void 0&&p.has(H)?k(H):M.protectedKeys[H]=!0}M.prevProp=C,M.prevResolvedValues=U,M.isActive&&(g={...g,...U}),i&&t.blockInitialAnimation&&(B=!1);const X=R&&D;B&&(!X||z)&&d.push(...I.map(H=>{const W={type:S};if(typeof H=="string"&&i&&!X&&t.manuallyAnimateOnMount&&t.parent){const{parent:J}=t,Y=Eg(J,H);if(J.enteringChildren&&Y){const{delayChildren:K}=Y.transition||{};W.delay=YI(J.enteringChildren,t,K)}}return{animation:H,options:W}}))}if(p.size){const x={};if(typeof u.initial!="boolean"){const S=Eg(t,Array.isArray(u.initial)?u.initial[0]:u.initial);S&&S.transition&&(x.transition=S.transition)}p.forEach(S=>{const M=t.getBaseTarget(S),C=t.getValue(S);C&&(C.liveStyle=!0),x[S]=M??null}),d.push({animation:x})}let w=!!d.length;return i&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(w=!1),i=!1,w?e(d):Promise.resolve()}function o(c,u){if(n[c].isActive===u)return Promise.resolve();t.variantChildren?.forEach(d=>d.animationState?.setActive(c,u)),n[c].isActive=u;const h=r(c);for(const d in n)n[d].protectedKeys={};return h}return{animateChanges:r,setActive:o,setAnimateFunction:s,getState:()=>n,reset:()=>{n=pN()}}}function nee(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!ZI(e,t):!1}function op(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function pN(){return{animate:op(!0),whileInView:op(),whileHover:op(),whileTap:op(),whileDrag:op(),whileFocus:op(),exit:op()}}class rh{constructor(e){this.isMounted=!1,this.node=e}update(){}}class iee extends rh{constructor(e){super(e),e.animationState||(e.animationState=tee(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();rw(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){this.node.animationState.reset(),this.unmountControls?.()}}let aee=0;class see extends rh{constructor(){super(...arguments),this.id=aee++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const a=this.node.animationState.setActive("exit",!e);n&&!e&&a.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const ree={animation:{Feature:iee},exit:{Feature:see}};function n1(t,e,n,i={passive:!0}){return t.addEventListener(e,n,i),()=>t.removeEventListener(e,n)}function J1(t){return{point:{x:t.pageX,y:t.pageY}}}const oee=t=>e=>kC(e)&&t(e,J1(e));function Eb(t,e,n,i){return n1(t,e,oee(n),i)}const JI=1e-4,lee=1-JI,cee=1+JI,ez=.01,uee=0-ez,dee=0+ez;function kr(t){return t.max-t.min}function fee(t,e,n){return Math.abs(t-e)<=n}function mN(t,e,n,i=.5){t.origin=i,t.originPoint=_a(e.min,e.max,t.origin),t.scale=kr(n)/kr(e),t.translate=_a(n.min,n.max,t.origin)-t.originPoint,(t.scale>=lee&&t.scale<=cee||isNaN(t.scale))&&(t.scale=1),(t.translate>=uee&&t.translate<=dee||isNaN(t.translate))&&(t.translate=0)}function Mb(t,e,n,i){mN(t.x,e.x,n.x,i?i.originX:void 0),mN(t.y,e.y,n.y,i?i.originY:void 0)}function gN(t,e,n){t.min=n.min+e.min,t.max=t.min+kr(e)}function hee(t,e,n){gN(t.x,e.x,n.x),gN(t.y,e.y,n.y)}function vN(t,e,n){t.min=e.min-n.min,t.max=t.min+kr(e)}function Tb(t,e,n){vN(t.x,e.x,n.x),vN(t.y,e.y,n.y)}function ml(t){return[t("x"),t("y")]}const tz=({current:t})=>t?t.ownerDocument.defaultView:null,yN=(t,e)=>Math.abs(t-e);function pee(t,e){const n=yN(t.x,e.x),i=yN(t.y,e.y);return Math.sqrt(n**2+i**2)}class nz{constructor(e,n,{transformPagePoint:i,contextWindow:a=window,dragSnapToOrigin:s=!1,distanceThreshold:r=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const p=mE(this.lastMoveEventInfo,this.history),g=this.startEvent!==null,b=pee(p.offset,{x:0,y:0})>=this.distanceThreshold;if(!g&&!b)return;const{point:w}=p,{timestamp:x}=zs;this.history.push({...w,timestamp:x});const{onStart:S,onMove:M}=this.handlers;g||(S&&S(this.lastMoveEvent,p),this.startEvent=this.lastMoveEvent),M&&M(this.lastMoveEvent,p)},this.handlePointerMove=(p,g)=>{this.lastMoveEvent=p,this.lastMoveEventInfo=pE(g,this.transformPagePoint),ta.update(this.updatePoint,!0)},this.handlePointerUp=(p,g)=>{this.end();const{onEnd:b,onSessionEnd:w,resumeAnimation:x}=this.handlers;if(this.dragSnapToOrigin&&x&&x(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const S=mE(p.type==="pointercancel"?this.lastMoveEventInfo:pE(g,this.transformPagePoint),this.history);this.startEvent&&b&&b(p,S),w&&w(p,S)},!kC(e))return;this.dragSnapToOrigin=s,this.handlers=n,this.transformPagePoint=i,this.distanceThreshold=r,this.contextWindow=a||window;const o=J1(e),c=pE(o,this.transformPagePoint),{point:u}=c,{timestamp:h}=zs;this.history=[{...u,timestamp:h}];const{onSessionStart:d}=n;d&&d(e,mE(c,this.history)),this.removeListeners=Y1(Eb(this.contextWindow,"pointermove",this.handlePointerMove),Eb(this.contextWindow,"pointerup",this.handlePointerUp),Eb(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Wf(this.updatePoint)}}function pE(t,e){return e?{point:e(t.point)}:t}function bN(t,e){return{x:t.x-e.x,y:t.y-e.y}}function mE({point:t},e){return{point:t,delta:bN(t,iz(e)),offset:bN(t,mee(e)),velocity:gee(e,.1)}}function mee(t){return t[0]}function iz(t){return t[t.length-1]}function gee(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,i=null;const a=iz(t);for(;n>=0&&(i=t[n],!(a.timestamp-i.timestamp>fu(e)));)n--;if(!i)return{x:0,y:0};const s=_l(a.timestamp-i.timestamp);if(s===0)return{x:0,y:0};const r={x:(a.x-i.x)/s,y:(a.y-i.y)/s};return r.x===1/0&&(r.x=0),r.y===1/0&&(r.y=0),r}function vee(t,{min:e,max:n},i){return e!==void 0&&t<e?t=i?_a(e,t,i.min):Math.max(t,e):n!==void 0&&t>n&&(t=i?_a(n,t,i.max):Math.min(t,n)),t}function xN(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function yee(t,{top:e,left:n,bottom:i,right:a}){return{x:xN(t.x,n,a),y:xN(t.y,e,i)}}function _N(t,e){let n=e.min-t.min,i=e.max-t.max;return e.max-e.min<t.max-t.min&&([n,i]=[i,n]),{min:n,max:i}}function bee(t,e){return{x:_N(t.x,e.x),y:_N(t.y,e.y)}}function xee(t,e){let n=.5;const i=kr(t),a=kr(e);return a>i?n=Yb(e.min,e.max-i,t.min):i>a&&(n=Yb(t.min,t.max-a,e.min)),Sd(0,1,n)}function _ee(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const IT=.35;function See(t=IT){return t===!1?t=0:t===!0&&(t=IT),{x:SN(t,"left","right"),y:SN(t,"top","bottom")}}function SN(t,e,n){return{min:wN(t,e),max:wN(t,n)}}function wN(t,e){return typeof t=="number"?t:t[e]||0}const wee=new WeakMap;class Eee{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=za(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:i}={}){const{presenceContext:a}=this.visualElement;if(a&&a.isPresent===!1)return;const s=d=>{const{dragSnapToOrigin:p}=this.getProps();p?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(J1(d).point)},r=(d,p)=>{const{drag:g,dragPropagation:b,onDragStart:w}=this.getProps();if(g&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=MQ(g),!this.openDragLock))return;this.latestPointerEvent=d,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),ml(S=>{let M=this.getAxisMotionValue(S).get()||0;if(hu.test(M)){const{projection:C}=this.visualElement;if(C&&C.layout){const A=C.layout.layoutBox[S];A&&(M=kr(A)*(parseFloat(M)/100))}}this.originPoint[S]=M}),w&&ta.postRender(()=>w(d,p)),LT(this.visualElement,"transform");const{animationState:x}=this.visualElement;x&&x.setActive("whileDrag",!0)},o=(d,p)=>{this.latestPointerEvent=d,this.latestPanInfo=p;const{dragPropagation:g,dragDirectionLock:b,onDirectionLock:w,onDrag:x}=this.getProps();if(!g&&!this.openDragLock)return;const{offset:S}=p;if(b&&this.currentDirection===null){this.currentDirection=Mee(S),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",p.point,S),this.updateAxis("y",p.point,S),this.visualElement.render(),x&&x(d,p)},c=(d,p)=>{this.latestPointerEvent=d,this.latestPanInfo=p,this.stop(d,p),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>ml(d=>this.getAnimationState(d)==="paused"&&this.getAxisMotionValue(d).animation?.play()),{dragSnapToOrigin:h}=this.getProps();this.panSession=new nz(e,{onSessionStart:s,onStart:r,onMove:o,onSessionEnd:c,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:i,contextWindow:tz(this.visualElement)})}stop(e,n){const i=e||this.latestPointerEvent,a=n||this.latestPanInfo,s=this.isDragging;if(this.cancel(),!s||!a||!i)return;const{velocity:r}=a;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&ta.postRender(()=>o(i,a))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,i){const{drag:a}=this.getProps();if(!i||!$2(e,a,this.currentDirection))return;const s=this.getAxisMotionValue(e);let r=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(r=vee(r,this.constraints[e],this.elastic[e])),s.set(r)}resolveConstraints(){const{dragConstraints:e,dragElastic:n}=this.getProps(),i=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):this.visualElement.projection?.layout,a=this.constraints;e&&cg(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&i?this.constraints=yee(i.layoutBox,e):this.constraints=!1,this.elastic=See(n),a!==this.constraints&&i&&this.constraints&&!this.hasMutatedConstraints&&ml(s=>{this.constraints!==!1&&this.getAxisMotionValue(s)&&(this.constraints[s]=_ee(i.layoutBox[s],this.constraints[s]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!cg(e))return!1;const i=e.current,{projection:a}=this.visualElement;if(!a||!a.layout)return!1;const s=TJ(i,a.root,this.visualElement.getTransformPagePoint());let r=bee(a.layout.layoutBox,s);if(n){const o=n(wJ(r));this.hasMutatedConstraints=!!o,o&&(r=FI(o))}return r}startAnimation(e){const{drag:n,dragMomentum:i,dragElastic:a,dragTransition:s,dragSnapToOrigin:r,onDragTransitionEnd:o}=this.getProps(),c=this.constraints||{},u=ml(h=>{if(!$2(h,n,this.currentDirection))return;let d=c&&c[h]||{};r&&(d={min:0,max:0});const p=a?200:1e6,g=a?40:1e7,b={type:"inertia",velocity:i?e[h]:0,bounceStiffness:p,bounceDamping:g,timeConstant:750,restDelta:1,restSpeed:10,...s,...d};return this.startAxisValueAnimation(h,b)});return Promise.all(u).then(o)}startAxisValueAnimation(e,n){const i=this.getAxisMotionValue(e);return LT(this.visualElement,e),i.start(QC(e,i,0,n,this.visualElement,!1))}stopAnimation(){ml(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){ml(e=>this.getAxisMotionValue(e).animation?.pause())}getAnimationState(e){return this.getAxisMotionValue(e).animation?.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),a=i[n];return a||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){ml(n=>{const{drag:i}=this.getProps();if(!$2(n,i,this.currentDirection))return;const{projection:a}=this.visualElement,s=this.getAxisMotionValue(n);if(a&&a.layout){const{min:r,max:o}=a.layout.layoutBox[n];s.set(e[n]-_a(r,o,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:i}=this.visualElement;if(!cg(n)||!i||!this.constraints)return;this.stopAnimation();const a={x:0,y:0};ml(r=>{const o=this.getAxisMotionValue(r);if(o&&this.constraints!==!1){const c=o.get();a[r]=xee({min:c,max:c},this.constraints[r])}});const{transformTemplate:s}=this.visualElement.getProps();this.visualElement.current.style.transform=s?s({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),ml(r=>{if(!$2(r,e,null))return;const o=this.getAxisMotionValue(r),{min:c,max:u}=this.constraints[r];o.set(_a(c,u,a[r]))})}addListeners(){if(!this.visualElement.current)return;wee.set(this.visualElement,this);const e=this.visualElement.current,n=Eb(e,"pointerdown",c=>{const{drag:u,dragListener:h=!0}=this.getProps();u&&h&&this.start(c)}),i=()=>{const{dragConstraints:c}=this.getProps();cg(c)&&c.current&&(this.constraints=this.resolveRefConstraints())},{projection:a}=this.visualElement,s=a.addEventListener("measure",i);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),ta.read(i);const r=n1(window,"resize",()=>this.scalePositionWithinConstraints()),o=a.addEventListener("didUpdate",(({delta:c,hasLayoutChanged:u})=>{this.isDragging&&u&&(ml(h=>{const d=this.getAxisMotionValue(h);d&&(this.originPoint[h]+=c[h].translate,d.set(d.get()+c[h].translate))}),this.visualElement.render())}));return()=>{r(),n(),s(),o&&o()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:i=!1,dragPropagation:a=!1,dragConstraints:s=!1,dragElastic:r=IT,dragMomentum:o=!0}=e;return{...e,drag:n,dragDirectionLock:i,dragPropagation:a,dragConstraints:s,dragElastic:r,dragMomentum:o}}}function $2(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function Mee(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class Tee extends rh{constructor(e){super(e),this.removeGroupControls=Ml,this.removeListeners=Ml,this.controls=new Eee(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Ml}unmount(){this.removeGroupControls(),this.removeListeners()}}const EN=t=>(e,n)=>{t&&ta.postRender(()=>t(e,n))};class Cee extends rh{constructor(){super(...arguments),this.removePointerDownListener=Ml}onPointerDown(e){this.session=new nz(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:tz(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:i,onPanEnd:a}=this.node.getProps();return{onSessionStart:EN(e),onStart:EN(n),onMove:i,onEnd:(s,r)=>{delete this.session,a&&ta.postRender(()=>a(s,r))}}}mount(){this.removePointerDownListener=Eb(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const uS={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function MN(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Gy={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(Mn.test(t))t=parseFloat(t);else return t;const n=MN(t,e.target.x),i=MN(t,e.target.y);return`${n}% ${i}%`}},Aee={correct:(t,{treeScale:e,projectionDelta:n})=>{const i=t,a=Kf.parse(t);if(a.length>5)return i;const s=Kf.createTransformer(t),r=typeof a[0]!="number"?1:0,o=n.x.scale*e.x,c=n.y.scale*e.y;a[0+r]/=o,a[1+r]/=c;const u=_a(o,c,.5);return typeof a[2+r]=="number"&&(a[2+r]/=u),typeof a[3+r]=="number"&&(a[3+r]/=u),s(a)}};let gE=!1;class Ree extends P.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i,layoutId:a}=this.props,{projection:s}=e;QQ(Nee),s&&(n.group&&n.group.add(s),i&&i.register&&a&&i.register(s),gE&&s.root.didUpdate(),s.addEventListener("animationComplete",()=>{this.safeToRemove()}),s.setOptions({...s.options,onExitComplete:()=>this.safeToRemove()})),uS.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:i,drag:a,isPresent:s}=this.props,{projection:r}=i;return r&&(r.isPresent=s,gE=!0,a||e.layoutDependency!==n||n===void 0||e.isPresent!==s?r.willUpdate():this.safeToRemove(),e.isPresent!==s&&(s?r.promote():r.relegate()||ta.postRender(()=>{const o=r.getStack();(!o||!o.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),VC.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:i}=this.props,{projection:a}=e;gE=!0,a&&(a.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(a),i&&i.deregister&&i.deregister(a))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function az(t){const[e,n]=EI(),i=P.useContext(qb);return _.jsx(Ree,{...t,layoutGroup:i,switchLayoutGroup:P.useContext(BI),isPresent:e,safeToRemove:n})}const Nee={borderRadius:{...Gy,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Gy,borderTopRightRadius:Gy,borderBottomLeftRadius:Gy,borderBottomRightRadius:Gy,boxShadow:Aee};function Pee(t,e,n){const i=cr(t)?t:Dg(t);return i.start(QC("",i,e,n)),i.animation}const Dee=(t,e)=>t.depth-e.depth;class Lee{constructor(){this.children=[],this.isDirty=!1}add(e){wC(this.children,e),this.isDirty=!0}remove(e){EC(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(Dee),this.isDirty=!1,this.children.forEach(e)}}function Oee(t,e){const n=mo.now(),i=({timestamp:a})=>{const s=a-n;s>=e&&(Wf(i),t(s-e))};return ta.setup(i,!0),()=>Wf(i)}const sz=["TopLeft","TopRight","BottomLeft","BottomRight"],Iee=sz.length,TN=t=>typeof t=="string"?parseFloat(t):t,CN=t=>typeof t=="number"||Mn.test(t);function zee(t,e,n,i,a,s){a?(t.opacity=_a(0,n.opacity??1,Bee(i)),t.opacityExit=_a(e.opacity??1,0,Uee(i))):s&&(t.opacity=_a(e.opacity??1,n.opacity??1,i));for(let r=0;r<Iee;r++){const o=`border${sz[r]}Radius`;let c=AN(e,o),u=AN(n,o);if(c===void 0&&u===void 0)continue;c||(c=0),u||(u=0),c===0||u===0||CN(c)===CN(u)?(t[o]=Math.max(_a(TN(c),TN(u),i),0),(hu.test(u)||hu.test(c))&&(t[o]+="%")):t[o]=u}(e.rotate||n.rotate)&&(t.rotate=_a(e.rotate||0,n.rotate||0,i))}function AN(t,e){return t[e]!==void 0?t[e]:t.borderRadius}const Bee=rz(0,.5,HO),Uee=rz(.5,.95,Ml);function rz(t,e,n){return i=>i<t?0:i>e?1:n(Yb(t,e,i))}function RN(t,e){t.min=e.min,t.max=e.max}function fl(t,e){RN(t.x,e.x),RN(t.y,e.y)}function NN(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function PN(t,e,n,i,a){return t-=e,t=DS(t,1/n,i),a!==void 0&&(t=DS(t,1/a,i)),t}function jee(t,e=0,n=1,i=.5,a,s=t,r=t){if(hu.test(e)&&(e=parseFloat(e),e=_a(r.min,r.max,e/100)-r.min),typeof e!="number")return;let o=_a(s.min,s.max,i);t===s&&(o-=e),t.min=PN(t.min,e,n,o,a),t.max=PN(t.max,e,n,o,a)}function DN(t,e,[n,i,a],s,r){jee(t,e[n],e[i],e[a],e.scale,s,r)}const Fee=["x","scaleX","originX"],Vee=["y","scaleY","originY"];function LN(t,e,n,i){DN(t.x,e,Fee,n?n.x:void 0,i?i.x:void 0),DN(t.y,e,Vee,n?n.y:void 0,i?i.y:void 0)}function ON(t){return t.translate===0&&t.scale===1}function oz(t){return ON(t.x)&&ON(t.y)}function IN(t,e){return t.min===e.min&&t.max===e.max}function kee(t,e){return IN(t.x,e.x)&&IN(t.y,e.y)}function zN(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function lz(t,e){return zN(t.x,e.x)&&zN(t.y,e.y)}function BN(t){return kr(t.x)/kr(t.y)}function UN(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Hee{constructor(){this.members=[]}add(e){wC(this.members,e),e.scheduleRender()}remove(e){if(EC(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(a=>e===a);if(n===0)return!1;let i;for(let a=n;a>=0;a--){const s=this.members[a];if(s.isPresent!==!1){i=s;break}}return i?(this.promote(i),!0):!1}promote(e,n){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,n&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:a}=e.options;a===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:i}=e;n.onExitComplete&&n.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function $ee(t,e,n){let i="";const a=t.x.translate/e.x,s=t.y.translate/e.y,r=n?.z||0;if((a||s||r)&&(i=`translate3d(${a}px, ${s}px, ${r}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:h,rotateX:d,rotateY:p,skewX:g,skewY:b}=n;u&&(i=`perspective(${u}px) ${i}`),h&&(i+=`rotate(${h}deg) `),d&&(i+=`rotateX(${d}deg) `),p&&(i+=`rotateY(${p}deg) `),g&&(i+=`skewX(${g}deg) `),b&&(i+=`skewY(${b}deg) `)}const o=t.x.scale*e.x,c=t.y.scale*e.y;return(o!==1||c!==1)&&(i+=`scale(${o}, ${c})`),i||"none"}const Cp={nodes:0,calculatedTargetDeltas:0,calculatedProjections:0},vE=["","X","Y","Z"],Gee=1e3;let Wee=0;function yE(t,e,n,i){const{latestValues:a}=e;a[t]&&(n[t]=a[t],e.setStaticValue(t,0),i&&(i[t]=0))}function cz(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=XI(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:a,layoutId:s}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",ta,!(a||s))}const{parent:i}=t;i&&!i.hasCheckedOptimisedAppear&&cz(i)}function uz({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:i,resetTransform:a}){return class{constructor(r={},o=e?.()){this.id=Wee++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,au.value&&(Cp.nodes=Cp.calculatedTargetDeltas=Cp.calculatedProjections=0),this.nodes.forEach(qee),this.nodes.forEach(Jee),this.nodes.forEach(ete),this.nodes.forEach(Yee),au.addProjectionMetrics&&au.addProjectionMetrics(Cp)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=r,this.root=o?o.root||o:this,this.path=o?[...o.path,o]:[],this.parent=o,this.depth=o?o.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new Lee)}addEventListener(r,o){return this.eventHandlers.has(r)||this.eventHandlers.set(r,new CC),this.eventHandlers.get(r).add(o)}notifyListeners(r,...o){const c=this.eventHandlers.get(r);c&&c.notify(...o)}hasListeners(r){return this.eventHandlers.has(r)}mount(r){if(this.instance)return;this.isSVG=wI(r)&&!PQ(r),this.instance=r;const{layoutId:o,layout:c,visualElement:u}=this.options;if(u&&!u.current&&u.mount(r),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||o)&&(this.isLayoutDirty=!0),t){let h,d=0;const p=()=>this.root.updateBlockedByResize=!1;ta.read(()=>{d=window.innerWidth}),t(r,()=>{const g=window.innerWidth;g!==d&&(d=g,this.root.updateBlockedByResize=!0,h&&h(),h=Oee(p,250),uS.hasAnimatedSinceResize&&(uS.hasAnimatedSinceResize=!1,this.nodes.forEach(VN)))})}o&&this.root.registerSharedNode(o,this),this.options.animate!==!1&&u&&(o||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:d,hasRelativeLayoutChanged:p,layout:g})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const b=this.options.transition||u.getDefaultTransition()||ste,{onLayoutAnimationStart:w,onLayoutAnimationComplete:x}=u.getProps(),S=!this.targetLayout||!lz(this.targetLayout,g),M=!d&&p;if(this.options.layoutRoot||this.resumeFrom||M||d&&(S||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const C={...jC(b,"layout"),onPlay:w,onComplete:x};(u.shouldReduceMotion||this.options.layoutRoot)&&(C.delay=0,C.type=!1),this.startAnimation(C),this.setAnimationOrigin(h,M)}else d||VN(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=g})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const r=this.getStack();r&&r.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Wf(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(tte),this.animationId++)}getTransformTemplate(){const{visualElement:r}=this.options;return r&&r.getProps().transformTemplate}willUpdate(r=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&cz(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const d=this.path[h];d.shouldResetTransform=!0,d.updateScroll("snapshot"),d.options.layoutRoot&&d.willUpdate(!1)}const{layoutId:o,layout:c}=this.options;if(o===void 0&&!c)return;const u=this.getTransformTemplate();this.prevTransformTemplateValue=u?u(this.latestValues,""):void 0,this.updateSnapshot(),r&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(jN);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(FN);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Qee),this.nodes.forEach(Kee),this.nodes.forEach(Xee)):this.nodes.forEach(FN),this.clearAllSnapshots();const o=mo.now();zs.delta=Sd(0,1e3/60,o-zs.timestamp),zs.timestamp=o,zs.isProcessing=!0,sE.update.process(zs),sE.preRender.process(zs),sE.render.process(zs),zs.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,VC.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Zee),this.sharedNodes.forEach(nte)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,ta.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){ta.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!kr(this.snapshot.measuredBox.x)&&!kr(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const r=this.layout;this.layout=this.measure(!1),this.layoutCorrected=za(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:o}=this.options;o&&o.notify("LayoutMeasure",this.layout.layoutBox,r?r.layoutBox:void 0)}updateScroll(r="measure"){let o=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===r&&(o=!1),o&&this.instance){const c=i(this.instance);this.scroll={animationId:this.root.animationId,phase:r,isRoot:c,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!a)return;const r=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,o=this.projectionDelta&&!oz(this.projectionDelta),c=this.getTransformTemplate(),u=c?c(this.latestValues,""):void 0,h=u!==this.prevTransformTemplateValue;r&&this.instance&&(o||Tp(this.latestValues)||h)&&(a(this.instance,u),this.shouldResetTransform=!1,this.scheduleRender())}measure(r=!0){const o=this.measurePageBox();let c=this.removeElementScroll(o);return r&&(c=this.removeTransform(c)),rte(c),{animationId:this.root.animationId,measuredBox:o,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){const{visualElement:r}=this.options;if(!r)return za();const o=r.measureViewportBox();if(!(this.scroll?.wasRoot||this.path.some(ote))){const{scroll:u}=this.root;u&&(ug(o.x,u.offset.x),ug(o.y,u.offset.y))}return o}removeElementScroll(r){const o=za();if(fl(o,r),this.scroll?.wasRoot)return o;for(let c=0;c<this.path.length;c++){const u=this.path[c],{scroll:h,options:d}=u;u!==this.root&&h&&d.layoutScroll&&(h.wasRoot&&fl(o,r),ug(o.x,h.offset.x),ug(o.y,h.offset.y))}return o}applyTransform(r,o=!1){const c=za();fl(c,r);for(let u=0;u<this.path.length;u++){const h=this.path[u];!o&&h.options.layoutScroll&&h.scroll&&h!==h.root&&dg(c,{x:-h.scroll.offset.x,y:-h.scroll.offset.y}),Tp(h.latestValues)&&dg(c,h.latestValues)}return Tp(this.latestValues)&&dg(c,this.latestValues),c}removeTransform(r){const o=za();fl(o,r);for(let c=0;c<this.path.length;c++){const u=this.path[c];if(!u.instance||!Tp(u.latestValues))continue;RT(u.latestValues)&&u.updateSnapshot();const h=za(),d=u.measurePageBox();fl(h,d),LN(o,u.latestValues,u.snapshot?u.snapshot.layoutBox:void 0,h)}return Tp(this.latestValues)&&LN(o,this.latestValues),o}setTargetDelta(r){this.targetDelta=r,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(r){this.options={...this.options,...r,crossfade:r.crossfade!==void 0?r.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==zs.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(r=!1){const o=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=o.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=o.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=o.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==o;if(!(r||c&&this.isSharedProjectionDirty||this.isProjectionDirty||this.parent?.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:d}=this.options;if(!(!this.layout||!(h||d))){if(this.resolvedRelativeTargetAt=zs.timestamp,!this.targetDelta&&!this.relativeTarget){const p=this.getClosestProjectingParent();p&&p.layout&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=za(),this.relativeTargetOrigin=za(),Tb(this.relativeTargetOrigin,this.layout.layoutBox,p.layout.layoutBox),fl(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=za(),this.targetWithTransforms=za()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),hee(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):fl(this.target,this.layout.layoutBox),kI(this.target,this.targetDelta)):fl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const p=this.getClosestProjectingParent();p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?(this.relativeParent=p,this.forceRelativeParentToResolveTarget(),this.relativeTarget=za(),this.relativeTargetOrigin=za(),Tb(this.relativeTargetOrigin,this.target,p.target),fl(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}au.value&&Cp.calculatedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||RT(this.parent.latestValues)||VI(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){const r=this.getLead(),o=!!this.resumingFrom||this!==r;let c=!0;if((this.isProjectionDirty||this.parent?.isProjectionDirty)&&(c=!1),o&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===zs.timestamp&&(c=!1),c)return;const{layout:u,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(u||h))return;fl(this.layoutCorrected,this.layout.layoutBox);const d=this.treeScale.x,p=this.treeScale.y;MJ(this.layoutCorrected,this.treeScale,this.path,o),r.layout&&!r.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(r.target=r.layout.layoutBox,r.targetWithTransforms=za());const{target:g}=r;if(!g){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(NN(this.prevProjectionDelta.x,this.projectionDelta.x),NN(this.prevProjectionDelta.y,this.projectionDelta.y)),Mb(this.projectionDelta,this.layoutCorrected,g,this.latestValues),(this.treeScale.x!==d||this.treeScale.y!==p||!UN(this.projectionDelta.x,this.prevProjectionDelta.x)||!UN(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",g)),au.value&&Cp.calculatedProjections++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(r=!0){if(this.options.visualElement?.scheduleRender(),r){const o=this.getStack();o&&o.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=fg(),this.projectionDelta=fg(),this.projectionDeltaWithTransform=fg()}setAnimationOrigin(r,o=!1){const c=this.snapshot,u=c?c.latestValues:{},h={...this.latestValues},d=fg();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!o;const p=za(),g=c?c.source:void 0,b=this.layout?this.layout.source:void 0,w=g!==b,x=this.getStack(),S=!x||x.members.length<=1,M=!!(w&&!S&&this.options.crossfade===!0&&!this.path.some(ate));this.animationProgress=0;let C;this.mixTargetDelta=A=>{const N=A/1e3;kN(d.x,r.x,N),kN(d.y,r.y,N),this.setTargetDelta(d),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Tb(p,this.layout.layoutBox,this.relativeParent.layout.layoutBox),ite(this.relativeTarget,this.relativeTargetOrigin,p,N),C&&kee(this.relativeTarget,C)&&(this.isProjectionDirty=!1),C||(C=za()),fl(C,this.relativeTarget)),w&&(this.animationValues=h,zee(h,u,this.latestValues,N,M,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(r){this.notifyListeners("animationStart"),this.currentAnimation?.stop(),this.resumingFrom?.currentAnimation?.stop(),this.pendingAnimation&&(Wf(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=ta.update(()=>{uS.hasAnimatedSinceResize=!0,kp.layout++,this.motionValue||(this.motionValue=Dg(0)),this.currentAnimation=Pee(this.motionValue,[0,1e3],{...r,velocity:0,isSync:!0,onUpdate:o=>{this.mixTargetDelta(o),r.onUpdate&&r.onUpdate(o)},onStop:()=>{kp.layout--},onComplete:()=>{kp.layout--,r.onComplete&&r.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const r=this.getStack();r&&r.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Gee),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const r=this.getLead();let{targetWithTransforms:o,target:c,layout:u,latestValues:h}=r;if(!(!o||!c||!u)){if(this!==r&&this.layout&&u&&dz(this.options.animationType,this.layout.layoutBox,u.layoutBox)){c=this.target||za();const d=kr(this.layout.layoutBox.x);c.x.min=r.target.x.min,c.x.max=c.x.min+d;const p=kr(this.layout.layoutBox.y);c.y.min=r.target.y.min,c.y.max=c.y.min+p}fl(o,c),dg(o,h),Mb(this.projectionDeltaWithTransform,this.layoutCorrected,o,h)}}registerSharedNode(r,o){this.sharedNodes.has(r)||this.sharedNodes.set(r,new Hee),this.sharedNodes.get(r).add(o);const u=o.options.initialPromotionConfig;o.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(o):void 0})}isLead(){const r=this.getStack();return r?r.lead===this:!0}getLead(){const{layoutId:r}=this.options;return r?this.getStack()?.lead||this:this}getPrevLead(){const{layoutId:r}=this.options;return r?this.getStack()?.prevLead:void 0}getStack(){const{layoutId:r}=this.options;if(r)return this.root.sharedNodes.get(r)}promote({needsReset:r,transition:o,preserveFollowOpacity:c}={}){const u=this.getStack();u&&u.promote(this,c),r&&(this.projectionDelta=void 0,this.needsReset=!0),o&&this.setOptions({transition:o})}relegate(){const r=this.getStack();return r?r.relegate(this):!1}resetSkewAndRotation(){const{visualElement:r}=this.options;if(!r)return;let o=!1;const{latestValues:c}=r;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(o=!0),!o)return;const u={};c.z&&yE("z",r,u,this.animationValues);for(let h=0;h<vE.length;h++)yE(`rotate${vE[h]}`,r,u,this.animationValues),yE(`skew${vE[h]}`,r,u,this.animationValues);r.render();for(const h in u)r.setStaticValue(h,u[h]),this.animationValues&&(this.animationValues[h]=u[h]);r.scheduleRender()}applyProjectionStyles(r,o){if(!this.instance||this.isSVG)return;if(!this.isVisible){r.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,r.visibility="",r.opacity="",r.pointerEvents=cS(o?.pointerEvents)||"",r.transform=c?c(this.latestValues,""):"none";return}const u=this.getLead();if(!this.projectionDelta||!this.layout||!u.target){this.options.layoutId&&(r.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,r.pointerEvents=cS(o?.pointerEvents)||""),this.hasProjected&&!Tp(this.latestValues)&&(r.transform=c?c({},""):"none",this.hasProjected=!1);return}r.visibility="";const h=u.animationValues||u.latestValues;this.applyTransformsToTarget();let d=$ee(this.projectionDeltaWithTransform,this.treeScale,h);c&&(d=c(h,d)),r.transform=d;const{x:p,y:g}=this.projectionDelta;r.transformOrigin=`${p.origin*100}% ${g.origin*100}% 0`,u.animationValues?r.opacity=u===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:r.opacity=u===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const b in t1){if(h[b]===void 0)continue;const{correct:w,applyTo:x,isCSSVariable:S}=t1[b],M=d==="none"?h[b]:w(h[b],u);if(x){const C=x.length;for(let A=0;A<C;A++)r[x[A]]=M}else S?this.options.visualElement.renderState.vars[b]=M:r[b]=M}this.options.layoutId&&(r.pointerEvents=u===this?cS(o?.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(r=>r.currentAnimation?.stop()),this.root.nodes.forEach(jN),this.root.sharedNodes.clear()}}}function Kee(t){t.updateLayout()}function Xee(t){const e=t.resumeFrom?.snapshot||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:n,measuredBox:i}=t.layout,{animationType:a}=t.options,s=e.source!==t.layout.source;a==="size"?ml(h=>{const d=s?e.measuredBox[h]:e.layoutBox[h],p=kr(d);d.min=n[h].min,d.max=d.min+p}):dz(a,e.layoutBox,n)&&ml(h=>{const d=s?e.measuredBox[h]:e.layoutBox[h],p=kr(n[h]);d.max=d.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const r=fg();Mb(r,n,e.layoutBox);const o=fg();s?Mb(o,t.applyTransform(i,!0),e.measuredBox):Mb(o,n,e.layoutBox);const c=!oz(r);let u=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:d,layout:p}=h;if(d&&p){const g=za();Tb(g,e.layoutBox,d.layoutBox);const b=za();Tb(b,n,p.layoutBox),lz(g,b)||(u=!0),h.options.layoutRoot&&(t.relativeTarget=b,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:n,snapshot:e,delta:o,layoutDelta:r,hasLayoutChanged:c,hasRelativeLayoutChanged:u})}else if(t.isLead()){const{onExitComplete:n}=t.options;n&&n()}t.options.transition=void 0}function qee(t){au.value&&Cp.nodes++,t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Yee(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Zee(t){t.clearSnapshot()}function jN(t){t.clearMeasurements()}function FN(t){t.isLayoutDirty=!1}function Qee(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function VN(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Jee(t){t.resolveTargetDelta()}function ete(t){t.calcProjection()}function tte(t){t.resetSkewAndRotation()}function nte(t){t.removeLeadSnapshot()}function kN(t,e,n){t.translate=_a(e.translate,0,n),t.scale=_a(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function HN(t,e,n,i){t.min=_a(e.min,n.min,i),t.max=_a(e.max,n.max,i)}function ite(t,e,n,i){HN(t.x,e.x,n.x,i),HN(t.y,e.y,n.y,i)}function ate(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const ste={duration:.45,ease:[.4,0,.1,1]},$N=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),GN=$N("applewebkit/")&&!$N("chrome/")?Math.round:Ml;function WN(t){t.min=GN(t.min),t.max=GN(t.max)}function rte(t){WN(t.x),WN(t.y)}function dz(t,e,n){return t==="position"||t==="preserve-aspect"&&!fee(BN(e),BN(n),.2)}function ote(t){return t!==t.root&&t.scroll?.wasRoot}const lte=uz({attachResizeListener:(t,e)=>n1(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bE={current:void 0},fz=uz({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!bE.current){const t=new lte({});t.mount(window),t.setOptions({layoutScroll:!0}),bE.current=t}return bE.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),cte={pan:{Feature:Cee},drag:{Feature:Tee,ProjectionNode:fz,MeasureLayout:az}};function KN(t,e,n){const{props:i}=t;t.animationState&&i.whileHover&&t.animationState.setActive("whileHover",n==="Start");const a="onHover"+n,s=i[a];s&&ta.postRender(()=>s(e,J1(e)))}class ute extends rh{mount(){const{current:e}=this.node;e&&(this.unmount=TQ(e,(n,i)=>(KN(this.node,i,"Start"),a=>KN(this.node,a,"End"))))}unmount(){}}class dte extends rh{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=Y1(n1(this.node.current,"focus",()=>this.onFocus()),n1(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function XN(t,e,n){const{props:i}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&i.whileTap&&t.animationState.setActive("whileTap",n==="Start");const a="onTap"+(n==="End"?"":n),s=i[a];s&&ta.postRender(()=>s(e,J1(e)))}class fte extends rh{mount(){const{current:e}=this.node;e&&(this.unmount=NQ(e,(n,i)=>(XN(this.node,i,"Start"),(a,{success:s})=>XN(this.node,a,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const zT=new WeakMap,xE=new WeakMap,hte=t=>{const e=zT.get(t.target);e&&e(t)},pte=t=>{t.forEach(hte)};function mte({root:t,...e}){const n=t||document;xE.has(n)||xE.set(n,{});const i=xE.get(n),a=JSON.stringify(e);return i[a]||(i[a]=new IntersectionObserver(pte,{root:t,...e})),i[a]}function gte(t,e,n){const i=mte(e);return zT.set(t,n),i.observe(t),()=>{zT.delete(t),i.unobserve(t)}}const vte={some:0,all:1};class yte extends rh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:i,amount:a="some",once:s}=e,r={root:n?n.current:void 0,rootMargin:i,threshold:typeof a=="number"?a:vte[a]},o=c=>{const{isIntersecting:u}=c;if(this.isInView===u||(this.isInView=u,s&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:h,onViewportLeave:d}=this.node.getProps(),p=u?h:d;p&&p(c)};return gte(this.node.current,r,o)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(bte(e,n))&&this.startObserver()}unmount(){}}function bte({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const xte={inView:{Feature:yte},tap:{Feature:fte},focus:{Feature:dte},hover:{Feature:ute}},_te={layout:{ProjectionNode:fz,MeasureLayout:az}},Ste={...ree,...xte,...cte,..._te},Ve=jI(Ste,IJ);function wte(t){return P.useEffect(()=>()=>t(),[])}class Ete extends bI{constructor(){super(...arguments),this.isEnabled=!1}add(e){(dm.has(e)||SQ.has(e))&&(this.isEnabled=!0,this.update())}update(){this.set(this.isEnabled?"transform":"auto")}}function Mte(){return X1(()=>new Ete("auto"))}const su={top:"top",bottom:"top",left:"left",right:"left"},LS={top:"bottom",bottom:"top",left:"right",right:"left"},Tte={top:"left",left:"top"},BT={top:"height",left:"width"},hz={width:"totalWidth",height:"totalHeight"},G2={};let ws=typeof document<"u"?window.visualViewport:null;function qN(t){let e=0,n=0,i=0,a=0,s=0,r=0,o={};var c;let u=((c=ws?.scale)!==null&&c!==void 0?c:1)>1;if(t.tagName==="BODY"){let b=document.documentElement;i=b.clientWidth,a=b.clientHeight;var h;e=(h=ws?.width)!==null&&h!==void 0?h:i;var d;n=(d=ws?.height)!==null&&d!==void 0?d:a,o.top=b.scrollTop||t.scrollTop,o.left=b.scrollLeft||t.scrollLeft,ws&&(s=ws.offsetTop,r=ws.offsetLeft)}else({width:e,height:n,top:s,left:r}=Mg(t,!1)),o.top=t.scrollTop,o.left=t.scrollLeft,i=e,a=n;if(mC()&&(t.tagName==="BODY"||t.tagName==="HTML")&&u){o.top=0,o.left=0;var p;s=(p=ws?.pageTop)!==null&&p!==void 0?p:0;var g;r=(g=ws?.pageLeft)!==null&&g!==void 0?g:0}return{width:e,height:n,totalWidth:i,totalHeight:a,scroll:o,top:s,left:r}}function Cte(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function YN(t,e,n,i,a,s,r){var o;let c=(o=a.scroll[t])!==null&&o!==void 0?o:0,u=i[BT[t]],h=i.scroll[su[t]]+s,d=u+i.scroll[su[t]]-s,p=e-c+r[t]-i[su[t]],g=e-c+n+r[t]-i[su[t]];return p<h?h-p:g>d?Math.max(d-g,h-p):0}function Ate(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function ZN(t){if(G2[t])return G2[t];let[e,n]=t.split(" "),i=su[e]||"right",a=Tte[i];su[n]||(n="center");let s=BT[i],r=BT[a];return G2[t]={placement:e,crossPlacement:n,axis:i,crossAxis:a,size:s,crossSize:r},G2[t]}function _E(t,e,n,i,a,s,r,o,c,u){let{placement:h,crossPlacement:d,axis:p,crossAxis:g,size:b,crossSize:w}=i,x={};var S;x[g]=(S=t[g])!==null&&S!==void 0?S:0;var M,C,A,N;d==="center"?x[g]+=(((M=t[w])!==null&&M!==void 0?M:0)-((C=n[w])!==null&&C!==void 0?C:0))/2:d!==g&&(x[g]+=((A=t[w])!==null&&A!==void 0?A:0)-((N=n[w])!==null&&N!==void 0?N:0)),x[g]+=s;const R=t[g]-n[w]+c+u,D=t[g]+t[w]-c-u;if(x[g]=wg(x[g],R,D),h===p){const B=o?r[b]:e[hz[b]];x[LS[p]]=Math.floor(B-t[p]+a)}else x[p]=Math.floor(t[p]+t[b]+a);return x}function Rte(t,e,n,i,a,s,r,o){const c=i?n.height:e[hz.height];var u;let h=t.top!=null?n.top+t.top:n.top+(c-((u=t.bottom)!==null&&u!==void 0?u:0)-r);var d,p,g,b,w,x;let S=o!=="top"?Math.max(0,e.height+e.top+((d=e.scroll.top)!==null&&d!==void 0?d:0)-h-(((p=a.top)!==null&&p!==void 0?p:0)+((g=a.bottom)!==null&&g!==void 0?g:0)+s)):Math.max(0,h+r-(e.top+((b=e.scroll.top)!==null&&b!==void 0?b:0))-(((w=a.top)!==null&&w!==void 0?w:0)+((x=a.bottom)!==null&&x!==void 0?x:0)+s));return Math.min(e.height-s*2,S)}function QN(t,e,n,i,a,s){let{placement:r,axis:o,size:c}=s;var u,h;if(r===o)return Math.max(0,n[o]-t[o]-((u=t.scroll[o])!==null&&u!==void 0?u:0)+e[o]-((h=i[o])!==null&&h!==void 0?h:0)-i[LS[o]]-a);var d;return Math.max(0,t[c]+t[o]+t.scroll[o]-e[o]-n[o]-n[c]-((d=i[o])!==null&&d!==void 0?d:0)-i[LS[o]]-a)}function Nte(t,e,n,i,a,s,r,o,c,u,h,d,p,g,b,w){let x=ZN(t),{size:S,crossAxis:M,crossSize:C,placement:A,crossPlacement:N}=x,R=_E(e,o,n,x,h,d,u,p,b,w),D=h,B=QN(o,u,e,a,s+h,x);if(r&&i[S]>B){let ae=ZN(`${LS[A]} ${N}`),ce=_E(e,o,n,ae,h,d,u,p,b,w);QN(o,u,e,a,s+h,ae)>B&&(x=ae,R=ce,D=h)}let z="bottom";x.axis==="top"?x.placement==="top"?z="top":x.placement==="bottom"&&(z="bottom"):x.crossAxis==="top"&&(x.crossPlacement==="top"?z="bottom":x.crossPlacement==="bottom"&&(z="top"));let I=YN(M,R[M],n[C],o,c,s,u);R[M]+=I;let U=Rte(R,o,u,p,a,s,n.height,z);g&&g<U&&(U=g),n.height=Math.min(n.height,U),R=_E(e,o,n,x,D,d,u,p,b,w),I=YN(M,R[M],n[C],o,c,s,u),R[M]+=I;let $={},G=e[M]-R[M]-a[su[M]],k=G+.5*e[C];const X=b/2+w;var V,H,W,J;const Y=su[M]==="left"?((V=a.left)!==null&&V!==void 0?V:0)+((H=a.right)!==null&&H!==void 0?H:0):((W=a.top)!==null&&W!==void 0?W:0)+((J=a.bottom)!==null&&J!==void 0?J:0),K=n[C]-Y-b/2-w,ee=e[M]+b/2-(R[M]+a[su[M]]),ie=e[M]+e[C]-b/2-(R[M]+a[su[M]]),Z=wg(k,ee,ie);$[M]=wg(Z,X,K),{placement:A,crossPlacement:N}=x,b?G=$[M]:N==="right"?G+=e[C]:N==="center"&&(G+=e[C]/2);let ue=A==="left"||A==="top"?n[S]:0,se={x:A==="top"||A==="bottom"?G:ue,y:A==="left"||A==="right"?G:ue};return{position:R,maxHeight:U,arrowOffsetLeft:$.left,arrowOffsetTop:$.top,placement:A,triggerAnchorPoint:se}}function Pte(t){let{placement:e,targetNode:n,overlayNode:i,scrollNode:a,padding:s,shouldFlip:r,boundaryElement:o,offset:c,crossOffset:u,maxHeight:h,arrowSize:d=0,arrowBoundaryOffset:p=0}=t,g=i instanceof HTMLElement?Dte(i):document.documentElement,b=g===document.documentElement;const w=window.getComputedStyle(g).position;let x=!!w&&w!=="static",S=b?Mg(n,!1):JN(n,g,!1);if(!b){let{marginTop:$,marginLeft:G}=window.getComputedStyle(n);S.top+=parseInt($,10)||0,S.left+=parseInt(G,10)||0}let M=Mg(i,!0),C=Ate(i);var A,N;M.width+=((A=C.left)!==null&&A!==void 0?A:0)+((N=C.right)!==null&&N!==void 0?N:0);var R,D;M.height+=((R=C.top)!==null&&R!==void 0?R:0)+((D=C.bottom)!==null&&D!==void 0?D:0);let B=Cte(a),z=qN(o),I=qN(g),U=o.tagName==="BODY"?Mg(g,!1):JN(g,o,!1);return g.tagName==="HTML"&&o.tagName==="BODY"&&(I.scroll.top=0,I.scroll.left=0),Nte(e,S,M,B,C,s,r,z,I,U,c,u,x,h,d,p)}function JC(t,e){let{top:n,left:i,width:a,height:s}=t.getBoundingClientRect();return e&&t instanceof t.ownerDocument.defaultView.HTMLElement&&(a=t.offsetWidth,s=t.offsetHeight),{top:n,left:i,width:a,height:s}}function Mg(t,e){let{top:n,left:i,width:a,height:s}=JC(t,e),{scrollTop:r,scrollLeft:o,clientTop:c,clientLeft:u}=document.documentElement;return{top:n+r-c,left:i+o-u,width:a,height:s}}function JN(t,e,n){let i=window.getComputedStyle(t),a;if(i.position==="fixed")a=JC(t,n);else{a=Mg(t,n);let s=Mg(e,n),r=window.getComputedStyle(e);s.top+=(parseInt(r.borderTopWidth,10)||0)-e.scrollTop,s.left+=(parseInt(r.borderLeftWidth,10)||0)-e.scrollLeft,a.top-=s.top,a.left-=s.left}return a.top-=parseInt(i.marginTop,10)||0,a.left-=parseInt(i.marginLeft,10)||0,a}function Dte(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!eP(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!eP(e);)e=e.parentElement;return e||document.documentElement}function eP(t){let e=window.getComputedStyle(t);return e.transform!=="none"||/transform|perspective/.test(e.willChange)||e.filter!=="none"||e.contain==="paint"||"backdropFilter"in e&&e.backdropFilter!=="none"||"WebkitBackdropFilter"in e&&e.WebkitBackdropFilter!=="none"}const pz=new WeakMap;function Lte(t){let{triggerRef:e,isOpen:n,onClose:i}=t;P.useEffect(()=>{if(!n||i===null)return;let a=s=>{let r=s.target;if(!e.current||r instanceof Node&&!r.contains(e.current)||s.target instanceof HTMLInputElement||s.target instanceof HTMLTextAreaElement)return;let o=i||pz.get(e.current);o&&o()};return window.addEventListener("scroll",a,!0),()=>{window.removeEventListener("scroll",a,!0)}},[n,i,e])}let Oa=typeof document<"u"?window.visualViewport:null;function mz(t){let{direction:e}=um(),{arrowSize:n,targetRef:i,overlayRef:a,arrowRef:s,scrollRef:r=a,placement:o="bottom",containerPadding:c=12,shouldFlip:u=!0,boundaryElement:h=typeof document<"u"?document.body:null,offset:d=0,crossOffset:p=0,shouldUpdatePosition:g=!0,isOpen:b=!0,onClose:w,maxHeight:x,arrowBoundaryOffset:S=0}=t,[M,C]=P.useState(null),A=[g,o,a.current,i.current,s?.current,r.current,c,u,h,d,p,b,e,x,S,n],N=P.useRef(Oa?.scale);P.useEffect(()=>{b&&(N.current=Oa?.scale)},[b]);let R=P.useCallback(()=>{if(g===!1||!b||!a.current||!i.current||!h||Oa?.scale!==N.current)return;let $=null;if(r.current&&r.current.contains(document.activeElement)){var G;let Y=(G=document.activeElement)===null||G===void 0?void 0:G.getBoundingClientRect(),K=r.current.getBoundingClientRect();var k;if($={type:"top",offset:((k=Y?.top)!==null&&k!==void 0?k:0)-K.top},$.offset>K.height/2){$.type="bottom";var X;$.offset=((X=Y?.bottom)!==null&&X!==void 0?X:0)-K.bottom}}let V=a.current;if(!x&&a.current){var H;V.style.top="0px",V.style.bottom="";var W;V.style.maxHeight=((W=(H=window.visualViewport)===null||H===void 0?void 0:H.height)!==null&&W!==void 0?W:window.innerHeight)+"px"}let J=Pte({placement:Ite(o,e),overlayNode:a.current,targetNode:i.current,scrollNode:r.current||a.current,padding:c,shouldFlip:u,boundaryElement:h,offset:d,crossOffset:p,maxHeight:x,arrowSize:n??(s?.current?JC(s.current,!0).width:0),arrowBoundaryOffset:S});if(J.position){if(V.style.top="",V.style.bottom="",V.style.left="",V.style.right="",Object.keys(J.position).forEach(Y=>V.style[Y]=J.position[Y]+"px"),V.style.maxHeight=J.maxHeight!=null?J.maxHeight+"px":"",$&&document.activeElement&&r.current){let Y=document.activeElement.getBoundingClientRect(),K=r.current.getBoundingClientRect(),ee=Y[$.type]-K[$.type];r.current.scrollTop+=ee-$.offset}C(J)}},A);Hi(R,A),Ote(R),T8({ref:a,onResize:R}),T8({ref:i,onResize:R});let D=P.useRef(!1);Hi(()=>{let $,G=()=>{D.current=!0,clearTimeout($),$=setTimeout(()=>{D.current=!1},500),R()},k=()=>{D.current&&G()};return Oa?.addEventListener("resize",G),Oa?.addEventListener("scroll",k),()=>{Oa?.removeEventListener("resize",G),Oa?.removeEventListener("scroll",k)}},[R]);let B=P.useCallback(()=>{D.current||w?.()},[w,D]);Lte({triggerRef:i,isOpen:b,onClose:w&&B});var z,I,U;return{overlayProps:{style:{position:M?"absolute":"fixed",top:M?void 0:0,left:M?void 0:0,zIndex:1e5,...M?.position,maxHeight:(z=M?.maxHeight)!==null&&z!==void 0?z:"100vh"}},placement:(I=M?.placement)!==null&&I!==void 0?I:null,triggerAnchorPoint:(U=M?.triggerAnchorPoint)!==null&&U!==void 0?U:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:M?.arrowOffsetLeft,top:M?.arrowOffsetTop}},updatePosition:R}}function Ote(t){Hi(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ite(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}function eA(t){let e=t;return e.nativeEvent=t,e.isDefaultPrevented=()=>e.defaultPrevented,e.isPropagationStopped=()=>e.cancelBubble,e.persist=()=>{},e}function gz(t,e){Object.defineProperty(t,"target",{value:e}),Object.defineProperty(t,"currentTarget",{value:e})}function vz(t){let e=P.useRef({isFocused:!1,observer:null});Hi(()=>{const i=e.current;return()=>{i.observer&&(i.observer.disconnect(),i.observer=null)}},[]);let n=xa(i=>{t?.(i)});return P.useCallback(i=>{if(i.target instanceof HTMLButtonElement||i.target instanceof HTMLInputElement||i.target instanceof HTMLTextAreaElement||i.target instanceof HTMLSelectElement){e.current.isFocused=!0;let a=i.target,s=r=>{if(e.current.isFocused=!1,a.disabled){let o=eA(r);n(o)}e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};a.addEventListener("focusout",s,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&a.disabled){var r;(r=e.current.observer)===null||r===void 0||r.disconnect();let o=a===document.activeElement?null:document.activeElement;a.dispatchEvent(new FocusEvent("blur",{relatedTarget:o})),a.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:o}))}}),e.current.observer.observe(a,{attributes:!0,attributeFilter:["disabled"]})}},[n])}let OS=!1;function zte(t){for(;t&&!AO(t);)t=t.parentElement;let e=jo(t),n=e.document.activeElement;if(!n||n===t)return;OS=!0;let i=!1,a=h=>{(h.target===n||i)&&h.stopImmediatePropagation()},s=h=>{(h.target===n||i)&&(h.stopImmediatePropagation(),!t&&!i&&(i=!0,or(n),c()))},r=h=>{(h.target===t||i)&&h.stopImmediatePropagation()},o=h=>{(h.target===t||i)&&(h.stopImmediatePropagation(),i||(i=!0,or(n),c()))};e.addEventListener("blur",a,!0),e.addEventListener("focusout",s,!0),e.addEventListener("focusin",o,!0),e.addEventListener("focus",r,!0);let c=()=>{cancelAnimationFrame(u),e.removeEventListener("blur",a,!0),e.removeEventListener("focusout",s,!0),e.removeEventListener("focusin",o,!0),e.removeEventListener("focus",r,!0),OS=!1,i=!1},u=requestAnimationFrame(c);return c}let hg="default",UT="",dS=new WeakMap;function Bte(t){if(W1()){if(hg==="default"){const e=Ii(t);UT=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}hg="disabled"}else if(t instanceof HTMLElement||t instanceof SVGElement){let e="userSelect"in t.style?"userSelect":"webkitUserSelect";dS.set(t,t.style[e]),t.style[e]="none"}}function tP(t){if(W1()){if(hg!=="disabled")return;hg="restoring",setTimeout(()=>{wO(()=>{if(hg==="restoring"){const e=Ii(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=UT||""),UT="",hg="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&dS.has(t)){let e=dS.get(t),n="userSelect"in t.style?"userSelect":"webkitUserSelect";t.style[n]==="none"&&(t.style[n]=e),t.getAttribute("style")===""&&t.removeAttribute("style"),dS.delete(t)}}const tA=ft.createContext({register:()=>{}});tA.displayName="PressResponderContext";function Ute(t,e){return e.get?e.get.call(t):e.value}function yz(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function jte(t,e){var n=yz(t,e,"get");return Ute(t,n)}function Fte(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function nP(t,e,n){var i=yz(t,e,"set");return Fte(t,i,n),n}function Vte(t){let e=P.useContext(tA);if(e){let{register:n,...i}=e;t=ci(i,t),n()}return EO(e,t.ref),t}var W2=new WeakMap;class K2{continuePropagation(){nP(this,W2,!1)}get shouldStopPropagation(){return jte(this,W2)}constructor(e,n,i,a){Wq(this,W2,{writable:!0,value:void 0}),nP(this,W2,!0);var s;let r=(s=a?.target)!==null&&s!==void 0?s:i.currentTarget;const o=r?.getBoundingClientRect();let c,u=0,h,d=null;i.clientX!=null&&i.clientY!=null&&(h=i.clientX,d=i.clientY),o&&(h!=null&&d!=null?(c=h-o.left,u=d-o.top):(c=o.width/2,u=o.height/2)),this.type=e,this.pointerType=n,this.target=i.currentTarget,this.shiftKey=i.shiftKey,this.metaKey=i.metaKey,this.ctrlKey=i.ctrlKey,this.altKey=i.altKey,this.x=c,this.y=u}}const iP=Symbol("linkClicked"),aP="react-aria-pressable-style",sP="data-react-aria-pressable";function bo(t){let{onPress:e,onPressChange:n,onPressStart:i,onPressEnd:a,onPressUp:s,onClick:r,isDisabled:o,isPressed:c,preventFocusOnPress:u,shouldCancelOnPointerExit:h,allowTextSelectionOnPress:d,ref:p,...g}=Vte(t),[b,w]=P.useState(!1),x=P.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null,disposables:[]}),{addGlobalListener:S,removeAllGlobalListeners:M}=K1(),C=xa((U,$)=>{let G=x.current;if(o||G.didFirePressStart)return!1;let k=!0;if(G.isTriggeringEvent=!0,i){let X=new K2("pressstart",$,U);i(X),k=X.shouldStopPropagation}return n&&n(!0),G.isTriggeringEvent=!1,G.didFirePressStart=!0,w(!0),k}),A=xa((U,$,G=!0)=>{let k=x.current;if(!k.didFirePressStart)return!1;k.didFirePressStart=!1,k.isTriggeringEvent=!0;let X=!0;if(a){let V=new K2("pressend",$,U);a(V),X=V.shouldStopPropagation}if(n&&n(!1),w(!1),e&&G&&!o){let V=new K2("press",$,U);e(V),X&&(X=V.shouldStopPropagation)}return k.isTriggeringEvent=!1,X}),N=xa((U,$)=>{let G=x.current;if(o)return!1;if(s){G.isTriggeringEvent=!0;let k=new K2("pressup",$,U);return s(k),G.isTriggeringEvent=!1,k.shouldStopPropagation}return!0}),R=xa(U=>{let $=x.current;if($.isPressed&&$.target){$.didFirePressStart&&$.pointerType!=null&&A(lp($.target,U),$.pointerType,!1),$.isPressed=!1,$.isOverTarget=!1,$.activePointerId=null,$.pointerType=null,M(),d||tP($.target);for(let G of $.disposables)G();$.disposables=[]}}),D=xa(U=>{h&&R(U)}),B=xa(U=>{o||r?.(U)}),z=xa((U,$)=>{if(!o&&r){let G=new MouseEvent("click",U);gz(G,$),r(eA(G))}}),I=P.useMemo(()=>{let U=x.current,$={onKeyDown(k){if(SE(k.nativeEvent,k.currentTarget)&&oo(k.currentTarget,Ba(k.nativeEvent))){var X;rP(Ba(k.nativeEvent),k.key)&&k.preventDefault();let V=!0;if(!U.isPressed&&!k.repeat){U.target=k.currentTarget,U.isPressed=!0,U.pointerType="keyboard",V=C(k,"keyboard");let H=k.currentTarget,W=J=>{SE(J,H)&&!J.repeat&&oo(H,Ba(J))&&U.target&&N(lp(U.target,J),"keyboard")};S(Ii(k.currentTarget),"keyup",ah(W,G),!0)}V&&k.stopPropagation(),k.metaKey&&$f()&&((X=U.metaKeyEvents)===null||X===void 0||X.set(k.key,k.nativeEvent))}else k.key==="Meta"&&(U.metaKeyEvents=new Map)},onClick(k){if(!(k&&!oo(k.currentTarget,Ba(k.nativeEvent)))&&k&&k.button===0&&!U.isTriggeringEvent&&!Gf.isOpening){let X=!0;if(o&&k.preventDefault(),!U.ignoreEmulatedMouseEvents&&!U.isPressed&&(U.pointerType==="virtual"||CO(k.nativeEvent))){let V=C(k,"virtual"),H=N(k,"virtual"),W=A(k,"virtual");B(k),X=V&&H&&W}else if(U.isPressed&&U.pointerType!=="keyboard"){let V=U.pointerType||k.nativeEvent.pointerType||"virtual",H=N(lp(k.currentTarget,k),V),W=A(lp(k.currentTarget,k),V,!0);X=H&&W,U.isOverTarget=!1,B(k),R(k)}U.ignoreEmulatedMouseEvents=!1,X&&k.stopPropagation()}}},G=k=>{var X;if(U.isPressed&&U.target&&SE(k,U.target)){var V;rP(Ba(k),k.key)&&k.preventDefault();let W=Ba(k),J=oo(U.target,Ba(k));A(lp(U.target,k),"keyboard",J),J&&z(k,U.target),M(),k.key!=="Enter"&&nA(U.target)&&oo(U.target,W)&&!k[iP]&&(k[iP]=!0,Gf(U.target,k,!1)),U.isPressed=!1,(V=U.metaKeyEvents)===null||V===void 0||V.delete(k.key)}else if(k.key==="Meta"&&(!((X=U.metaKeyEvents)===null||X===void 0)&&X.size)){var H;let W=U.metaKeyEvents;U.metaKeyEvents=void 0;for(let J of W.values())(H=U.target)===null||H===void 0||H.dispatchEvent(new KeyboardEvent("keyup",J))}};if(typeof PointerEvent<"u"){$.onPointerDown=V=>{if(V.button!==0||!oo(V.currentTarget,Ba(V.nativeEvent)))return;if(SY(V.nativeEvent)){U.pointerType="virtual";return}U.pointerType=V.pointerType;let H=!0;if(!U.isPressed){U.isPressed=!0,U.isOverTarget=!0,U.activePointerId=V.pointerId,U.target=V.currentTarget,d||Bte(U.target),H=C(V,U.pointerType);let W=Ba(V.nativeEvent);"releasePointerCapture"in W&&W.releasePointerCapture(V.pointerId),S(Ii(V.currentTarget),"pointerup",k,!1),S(Ii(V.currentTarget),"pointercancel",X,!1)}H&&V.stopPropagation()},$.onMouseDown=V=>{if(oo(V.currentTarget,Ba(V.nativeEvent))&&V.button===0){if(u){let H=zte(V.target);H&&U.disposables.push(H)}V.stopPropagation()}},$.onPointerUp=V=>{!oo(V.currentTarget,Ba(V.nativeEvent))||U.pointerType==="virtual"||V.button===0&&!U.isPressed&&N(V,U.pointerType||V.pointerType)},$.onPointerEnter=V=>{V.pointerId===U.activePointerId&&U.target&&!U.isOverTarget&&U.pointerType!=null&&(U.isOverTarget=!0,C(lp(U.target,V),U.pointerType))},$.onPointerLeave=V=>{V.pointerId===U.activePointerId&&U.target&&U.isOverTarget&&U.pointerType!=null&&(U.isOverTarget=!1,A(lp(U.target,V),U.pointerType,!1),D(V))};let k=V=>{if(V.pointerId===U.activePointerId&&U.isPressed&&V.button===0&&U.target){if(oo(U.target,Ba(V))&&U.pointerType!=null){let H=!1,W=setTimeout(()=>{U.isPressed&&U.target instanceof HTMLElement&&(H?R(V):(or(U.target),U.target.click()))},80);S(V.currentTarget,"click",()=>H=!0,!0),U.disposables.push(()=>clearTimeout(W))}else R(V);U.isOverTarget=!1}},X=V=>{R(V)};$.onDragStart=V=>{oo(V.currentTarget,Ba(V.nativeEvent))&&R(V)}}return $},[S,o,u,M,d,R,D,A,C,N,B,z]);return P.useEffect(()=>{if(!p)return;const U=Ii(p.current);if(!U||!U.head||U.getElementById(aP))return;const $=U.createElement("style");$.id=aP,$.textContent=`
@layer {
[${sP}] {
touch-action: pan-x pan-y pinch-zoom;
}
}
`.trim(),U.head.prepend($)},[p]),P.useEffect(()=>{let U=x.current;return()=>{var $;d||tP(($=U.target)!==null&&$!==void 0?$:void 0);for(let G of U.disposables)G();U.disposables=[]}},[d]),{isPressed:c||b,pressProps:ci(g,I,{[sP]:!0})}}function nA(t){return t.tagName==="A"&&t.hasAttribute("href")}function SE(t,e){const{key:n,code:i}=t,a=e,s=a.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||i==="Space")&&!(a instanceof jo(a).HTMLInputElement&&!bz(a,n)||a instanceof jo(a).HTMLTextAreaElement||a.isContentEditable)&&!((s==="link"||!s&&nA(a))&&n!=="Enter")}function lp(t,e){let n=e.clientX,i=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:i}}function kte(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!nA(t)}function rP(t,e){return t instanceof HTMLInputElement?!bz(t,e):kte(t)}const Hte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bz(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":Hte.has(t.type)}let fm=null,jT=new Set,Cb=new Map,Yp=!1,FT=!1;const $te={Tab:!0,Escape:!0};function lw(t,e){for(let n of jT)n(t,e)}function Gte(t){return!(t.metaKey||!$f()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function IS(t){Yp=!0,Gte(t)&&(fm="keyboard",lw("keyboard",t))}function Tg(t){fm="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Yp=!0,lw("pointer",t))}function xz(t){CO(t)&&(Yp=!0,fm="virtual")}function _z(t){t.target===window||t.target===document||OS||!t.isTrusted||(!Yp&&!FT&&(fm="virtual",lw("virtual",t)),Yp=!1,FT=!1)}function Sz(){OS||(Yp=!1,FT=!0)}function VT(t){if(typeof window>"u"||typeof document>"u"||Cb.get(jo(t)))return;const e=jo(t),n=Ii(t);let i=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Yp=!0,i.apply(this,arguments)},n.addEventListener("keydown",IS,!0),n.addEventListener("keyup",IS,!0),n.addEventListener("click",xz,!0),e.addEventListener("focus",_z,!0),e.addEventListener("blur",Sz,!1),typeof PointerEvent<"u"&&(n.addEventListener("pointerdown",Tg,!0),n.addEventListener("pointermove",Tg,!0),n.addEventListener("pointerup",Tg,!0)),e.addEventListener("beforeunload",()=>{wz(t)},{once:!0}),Cb.set(e,{focus:i})}const wz=(t,e)=>{const n=jo(t),i=Ii(t);e&&i.removeEventListener("DOMContentLoaded",e),Cb.has(n)&&(n.HTMLElement.prototype.focus=Cb.get(n).focus,i.removeEventListener("keydown",IS,!0),i.removeEventListener("keyup",IS,!0),i.removeEventListener("click",xz,!0),n.removeEventListener("focus",_z,!0),n.removeEventListener("blur",Sz,!1),typeof PointerEvent<"u"&&(i.removeEventListener("pointerdown",Tg,!0),i.removeEventListener("pointermove",Tg,!0),i.removeEventListener("pointerup",Tg,!0)),Cb.delete(n))};function Wte(t){const e=Ii(t);let n;return e.readyState!=="loading"?VT(t):(n=()=>{VT(t)},e.addEventListener("DOMContentLoaded",n)),()=>wz(t,n)}typeof document<"u"&&Wte();function Og(){return fm!=="pointer"}function Ff(){return fm}function Ez(t){fm=t,lw(t,null)}const Kte=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Xte(t,e,n){let i=Ii(n?.target);const a=typeof window<"u"?jo(n?.target).HTMLInputElement:HTMLInputElement,s=typeof window<"u"?jo(n?.target).HTMLTextAreaElement:HTMLTextAreaElement,r=typeof window<"u"?jo(n?.target).HTMLElement:HTMLElement,o=typeof window<"u"?jo(n?.target).KeyboardEvent:KeyboardEvent;return t=t||i.activeElement instanceof a&&!Kte.has(i.activeElement.type)||i.activeElement instanceof s||i.activeElement instanceof r&&i.activeElement.isContentEditable,!(t&&e==="keyboard"&&n instanceof o&&!$te[n.key])}function Mz(t,e,n){VT(),P.useEffect(()=>{let i=(a,s)=>{Xte(!!n?.isTextInput,a,s)&&t(Og())};return jT.add(i),()=>{jT.delete(i)}},e)}function Xf(t){const e=Ii(t),n=hr(e);if(Ff()==="virtual"){let i=n;wO(()=>{hr(e)===i&&t.isConnected&&or(t)})}else or(t)}function cw(t){let{isDisabled:e,onFocus:n,onBlur:i,onFocusChange:a}=t;const s=P.useCallback(c=>{if(c.target===c.currentTarget)return i&&i(c),a&&a(!1),!0},[i,a]),r=vz(s),o=P.useCallback(c=>{const u=Ii(c.target),h=u?hr(u):hr();c.target===c.currentTarget&&h===Ba(c.nativeEvent)&&(n&&n(c),a&&a(!0),r(c))},[a,n,r]);return{focusProps:{onFocus:!e&&(n||a||i)?o:void 0,onBlur:!e&&(i||a)?s:void 0}}}function oP(t){if(!t)return;let e=!0;return n=>{let i={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(i),e&&n.stopPropagation()}}function qte(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:oP(t.onKeyDown),onKeyUp:oP(t.onKeyUp)}}}let Yte=ft.createContext(null);function Zte(t){let e=P.useContext(Yte)||{};EO(e,t);let{ref:n,...i}=e;return i}function hm(t,e){let{focusProps:n}=cw(t),{keyboardProps:i}=qte(t),a=ci(n,i),s=Zte(e),r=t.isDisabled?{}:s,o=P.useRef(t.autoFocus);P.useEffect(()=>{o.current&&e.current&&Xf(e.current),o.current=!1},[e]);let c=t.excludeFromTabOrder?-1:0;return t.isDisabled&&(c=void 0),{focusableProps:ci({...a,tabIndex:c},r)}}function Qte({children:t}){let e=P.useMemo(()=>({register:()=>{}}),[]);return ft.createElement(tA.Provider,{value:e},t)}function Rd(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:i,onFocusWithinChange:a}=t,s=P.useRef({isFocusWithin:!1}),{addGlobalListener:r,removeAllGlobalListeners:o}=K1(),c=P.useCallback(d=>{d.currentTarget.contains(d.target)&&s.current.isFocusWithin&&!d.currentTarget.contains(d.relatedTarget)&&(s.current.isFocusWithin=!1,o(),n&&n(d),a&&a(!1))},[n,a,s,o]),u=vz(c),h=P.useCallback(d=>{if(!d.currentTarget.contains(d.target))return;const p=Ii(d.target),g=hr(p);if(!s.current.isFocusWithin&&g===Ba(d.nativeEvent)){i&&i(d),a&&a(!0),s.current.isFocusWithin=!0,u(d);let b=d.currentTarget;r(p,"focus",w=>{if(s.current.isFocusWithin&&!oo(b,w.target)){let x=new p.defaultView.FocusEvent("blur",{relatedTarget:w.target});gz(x,b);let S=eA(x);c(S)}},{capture:!0})}},[i,a,u,r,c]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:h,onBlur:c}}}let kT=!1,X2=0;function Jte(){kT=!0,setTimeout(()=>{kT=!1},50)}function lP(t){t.pointerType==="touch"&&Jte()}function ene(){if(!(typeof document>"u"))return X2===0&&typeof PointerEvent<"u"&&document.addEventListener("pointerup",lP),X2++,()=>{X2--,!(X2>0)&&typeof PointerEvent<"u"&&document.removeEventListener("pointerup",lP)}}function Qa(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:i,isDisabled:a}=t,[s,r]=P.useState(!1),o=P.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;P.useEffect(ene,[]);let{addGlobalListener:c,removeAllGlobalListeners:u}=K1(),{hoverProps:h,triggerHoverEnd:d}=P.useMemo(()=>{let p=(w,x)=>{if(o.pointerType=x,a||x==="touch"||o.isHovered||!w.currentTarget.contains(w.target))return;o.isHovered=!0;let S=w.currentTarget;o.target=S,c(Ii(w.target),"pointerover",M=>{o.isHovered&&o.target&&!oo(o.target,M.target)&&g(M,M.pointerType)},{capture:!0}),e&&e({type:"hoverstart",target:S,pointerType:x}),n&&n(!0),r(!0)},g=(w,x)=>{let S=o.target;o.pointerType="",o.target=null,!(x==="touch"||!o.isHovered||!S)&&(o.isHovered=!1,u(),i&&i({type:"hoverend",target:S,pointerType:x}),n&&n(!1),r(!1))},b={};return typeof PointerEvent<"u"&&(b.onPointerEnter=w=>{kT&&w.pointerType==="mouse"||p(w,w.pointerType)},b.onPointerLeave=w=>{!a&&w.currentTarget.contains(w.target)&&g(w,w.pointerType)}),{hoverProps:b,triggerHoverEnd:g}},[e,n,i,a,o,c,u]);return P.useEffect(()=>{a&&d({currentTarget:o.target},o.pointerType)},[a]),{hoverProps:h,isHovered:s}}function tne(t){let{ref:e,onInteractOutside:n,isDisabled:i,onInteractOutsideStart:a}=t,s=P.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),r=xa(c=>{n&&cP(c,e)&&(a&&a(c),s.current.isPointerDown=!0)}),o=xa(c=>{n&&n(c)});P.useEffect(()=>{let c=s.current;if(i)return;const u=e.current,h=Ii(u);if(typeof PointerEvent<"u"){let d=p=>{c.isPointerDown&&cP(p,e)&&o(p),c.isPointerDown=!1};return h.addEventListener("pointerdown",r,!0),h.addEventListener("click",d,!0),()=>{h.removeEventListener("pointerdown",r,!0),h.removeEventListener("click",d,!0)}}},[e,i,r,o])}function cP(t,e){if(t.button>0)return!1;if(t.target){const n=t.target.ownerDocument;if(!n||!n.documentElement.contains(t.target)||t.target.closest("[data-react-aria-top-layer]"))return!1}return e.current?!t.composedPath().includes(e.current):!1}function nne(t,e){let{onScroll:n,isDisabled:i}=t,a=P.useCallback(s=>{s.ctrlKey||(s.preventDefault(),s.stopPropagation(),n&&n({deltaX:s.deltaX,deltaY:s.deltaY}))},[n]);pb(e,"wheel",i?void 0:a)}const ine=500;function Tz(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:i,onLongPress:a,threshold:s=ine,accessibilityDescription:r}=t;const o=P.useRef(void 0);let{addGlobalListener:c,removeGlobalListener:u}=K1(),{pressProps:h}=bo({isDisabled:e,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),o.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),Ii(p.target).activeElement!==p.target&&or(p.target),a&&a({...p,type:"longpress"}),o.current=void 0},s),p.pointerType==="touch")){let g=b=>{b.preventDefault()};c(p.target,"contextmenu",g,{once:!0}),c(window,"pointerup",()=>{setTimeout(()=>{u(p.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(p){o.current&&clearTimeout(o.current),i&&(p.pointerType==="mouse"||p.pointerType==="touch")&&i({...p,type:"longpressend"})}}),d=_Y(a&&!e?r:void 0);return{longPressProps:ci(h,d)}}const uP=ft.createContext(null),HT="react-aria-focus-scope-restore";let Zi=null;function ane(t){let{children:e,contain:n,restoreFocus:i,autoFocus:a}=t,s=P.useRef(null),r=P.useRef(null),o=P.useRef([]),{parentNode:c}=P.useContext(uP)||{},u=P.useMemo(()=>new GT({scopeRef:o}),[o]);Hi(()=>{let p=c||Xa.root;if(Xa.getTreeNode(p.scopeRef)&&Zi&&!zS(Zi,p.scopeRef)){let g=Xa.getTreeNode(Zi);g&&(p=g)}p.addChild(u),Xa.addNode(u)},[u,c]),Hi(()=>{let p=Xa.getTreeNode(o);p&&(p.contain=!!n)},[n]),Hi(()=>{var p;let g=(p=s.current)===null||p===void 0?void 0:p.nextSibling,b=[],w=x=>x.stopPropagation();for(;g&&g!==r.current;)b.push(g),g.addEventListener(HT,w),g=g.nextSibling;return o.current=b,()=>{for(let x of b)x.removeEventListener(HT,w)}},[e]),une(o,i,n),one(o,n),dne(o,i,n),cne(o,a),P.useEffect(()=>{const p=hr(Ii(o.current?o.current[0]:void 0));let g=null;if(Nl(p,o.current)){for(let b of Xa.traverse())b.scopeRef&&Nl(p,b.scopeRef.current)&&(g=b);g===Xa.getTreeNode(o)&&(Zi=g.scopeRef)}},[o]),Hi(()=>()=>{var p,g,b;let w=(b=(g=Xa.getTreeNode(o))===null||g===void 0||(p=g.parent)===null||p===void 0?void 0:p.scopeRef)!==null&&b!==void 0?b:null;(o===Zi||zS(o,Zi))&&(!w||Xa.getTreeNode(w))&&(Zi=w),Xa.removeTreeNode(o)},[o]);let h=P.useMemo(()=>sne(o),[]),d=P.useMemo(()=>({focusManager:h,parentNode:u}),[u,h]);return ft.createElement(uP.Provider,{value:d},ft.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:s}),e,ft.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:r}))}function sne(t){return{focusNext(e={}){let n=t.current,{from:i,tabbable:a,wrap:s,accept:r}=e;var o;let c=i||hr(Ii((o=n[0])!==null&&o!==void 0?o:void 0)),u=n[0].previousElementSibling,h=Op(n),d=ru(h,{tabbable:a,accept:r},n);d.currentNode=Nl(c,n)?c:u;let p=d.nextNode();return!p&&s&&(d.currentNode=u,p=d.nextNode()),p&&vd(p,!0),p},focusPrevious(e={}){let n=t.current,{from:i,tabbable:a,wrap:s,accept:r}=e;var o;let c=i||hr(Ii((o=n[0])!==null&&o!==void 0?o:void 0)),u=n[n.length-1].nextElementSibling,h=Op(n),d=ru(h,{tabbable:a,accept:r},n);d.currentNode=Nl(c,n)?c:u;let p=d.previousNode();return!p&&s&&(d.currentNode=u,p=d.previousNode()),p&&vd(p,!0),p},focusFirst(e={}){let n=t.current,{tabbable:i,accept:a}=e,s=Op(n),r=ru(s,{tabbable:i,accept:a},n);r.currentNode=n[0].previousElementSibling;let o=r.nextNode();return o&&vd(o,!0),o},focusLast(e={}){let n=t.current,{tabbable:i,accept:a}=e,s=Op(n),r=ru(s,{tabbable:i,accept:a},n);r.currentNode=n[n.length-1].nextElementSibling;let o=r.previousNode();return o&&vd(o,!0),o}}}function Op(t){return t[0].parentElement}function gb(t){let e=Xa.getTreeNode(Zi);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function rne(t){if(t.checked)return!0;let e=[];if(!t.form)e=[...Ii(t).querySelectorAll(`input[type="radio"][name="${CSS.escape(t.name)}"]`)].filter(s=>!s.form);else{var n,i;let s=(i=t.form)===null||i===void 0||(n=i.elements)===null||n===void 0?void 0:n.namedItem(t.name);e=[...s??[]]}return e?!e.some(s=>s.checked):!1}function one(t,e){let n=P.useRef(void 0),i=P.useRef(void 0);Hi(()=>{let a=t.current;if(!e){i.current&&(cancelAnimationFrame(i.current),i.current=void 0);return}const s=Ii(a?a[0]:void 0);let r=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey||!gb(t)||u.isComposing)return;let h=hr(s),d=t.current;if(!d||!Nl(h,d))return;let p=Op(d),g=ru(p,{tabbable:!0},d);if(!h)return;g.currentNode=h;let b=u.shiftKey?g.previousNode():g.nextNode();b||(g.currentNode=u.shiftKey?d[d.length-1].nextElementSibling:d[0].previousElementSibling,b=u.shiftKey?g.previousNode():g.nextNode()),u.preventDefault(),b&&vd(b,!0)},o=u=>{(!Zi||zS(Zi,t))&&Nl(Ba(u),t.current)?(Zi=t,n.current=Ba(u)):gb(t)&&!If(Ba(u),t)?n.current?n.current.focus():Zi&&Zi.current&&$T(Zi.current):gb(t)&&(n.current=Ba(u))},c=u=>{i.current&&cancelAnimationFrame(i.current),i.current=requestAnimationFrame(()=>{let h=Ff(),d=(h==="virtual"||h===null)&&nw()&&gC(),p=hr(s);if(!d&&p&&gb(t)&&!If(p,t)){Zi=t;let b=Ba(u);if(b&&b.isConnected){var g;n.current=b,(g=n.current)===null||g===void 0||g.focus()}else Zi.current&&$T(Zi.current)}})};return s.addEventListener("keydown",r,!1),s.addEventListener("focusin",o,!1),a?.forEach(u=>u.addEventListener("focusin",o,!1)),a?.forEach(u=>u.addEventListener("focusout",c,!1)),()=>{s.removeEventListener("keydown",r,!1),s.removeEventListener("focusin",o,!1),a?.forEach(u=>u.removeEventListener("focusin",o,!1)),a?.forEach(u=>u.removeEventListener("focusout",c,!1))}},[t,e]),Hi(()=>()=>{i.current&&cancelAnimationFrame(i.current)},[i])}function Cz(t){return If(t)}function Nl(t,e){return!t||!e?!1:e.some(n=>n.contains(t))}function If(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of Xa.traverse(Xa.getTreeNode(e)))if(n&&Nl(t,n.current))return!0;return!1}function lne(t){return If(t,Zi)}function zS(t,e){var n;let i=(n=Xa.getTreeNode(e))===null||n===void 0?void 0:n.parent;for(;i;){if(i.scopeRef===t)return!0;i=i.parent}return!1}function vd(t,e=!1){if(t!=null&&!e)try{Xf(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function Az(t,e=!0){let n=t[0].previousElementSibling,i=Op(t),a=ru(i,{tabbable:e},t);a.currentNode=n;let s=a.nextNode();return e&&!s&&(i=Op(t),a=ru(i,{tabbable:!1},t),a.currentNode=n,s=a.nextNode()),s}function $T(t,e=!0){vd(Az(t,e))}function cne(t,e){const n=ft.useRef(e);P.useEffect(()=>{if(n.current){Zi=t;const i=Ii(t.current?t.current[0]:void 0);!Nl(hr(i),Zi.current)&&t.current&&$T(t.current)}n.current=!1},[t])}function une(t,e,n){Hi(()=>{if(e||n)return;let i=t.current;const a=Ii(i?i[0]:void 0);let s=r=>{let o=Ba(r);Nl(o,t.current)?Zi=t:Cz(o)||(Zi=null)};return a.addEventListener("focusin",s,!1),i?.forEach(r=>r.addEventListener("focusin",s,!1)),()=>{a.removeEventListener("focusin",s,!1),i?.forEach(r=>r.removeEventListener("focusin",s,!1))}},[t,e,n])}function dP(t){let e=Xa.getTreeNode(Zi);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return e?.scopeRef===t}function dne(t,e,n){const i=P.useRef(typeof document<"u"?hr(Ii(t.current?t.current[0]:void 0)):null);Hi(()=>{let a=t.current;const s=Ii(a?a[0]:void 0);if(!e||n)return;let r=()=>{(!Zi||zS(Zi,t))&&Nl(hr(s),t.current)&&(Zi=t)};return s.addEventListener("focusin",r,!1),a?.forEach(o=>o.addEventListener("focusin",r,!1)),()=>{s.removeEventListener("focusin",r,!1),a?.forEach(o=>o.removeEventListener("focusin",r,!1))}},[t,n]),Hi(()=>{const a=Ii(t.current?t.current[0]:void 0);if(!e)return;let s=r=>{if(r.key!=="Tab"||r.altKey||r.ctrlKey||r.metaKey||!gb(t)||r.isComposing)return;let o=a.activeElement;if(!If(o,t)||!dP(t))return;let c=Xa.getTreeNode(t);if(!c)return;let u=c.nodeToRestore,h=ru(a.body,{tabbable:!0});h.currentNode=o;let d=r.shiftKey?h.previousNode():h.nextNode();if((!u||!u.isConnected||u===a.body)&&(u=void 0,c.nodeToRestore=void 0),(!d||!If(d,t))&&u){h.currentNode=u;do d=r.shiftKey?h.previousNode():h.nextNode();while(If(d,t));r.preventDefault(),r.stopPropagation(),d?vd(d,!0):Cz(u)?vd(u,!0):o.blur()}};return n||a.addEventListener("keydown",s,!0),()=>{n||a.removeEventListener("keydown",s,!0)}},[t,e,n]),Hi(()=>{const a=Ii(t.current?t.current[0]:void 0);if(!e)return;let s=Xa.getTreeNode(t);if(s){var r;return s.nodeToRestore=(r=i.current)!==null&&r!==void 0?r:void 0,()=>{let o=Xa.getTreeNode(t);if(!o)return;let c=o.nodeToRestore,u=hr(a);if(e&&c&&(u&&If(u,t)||u===a.body&&dP(t))){let h=Xa.clone();requestAnimationFrame(()=>{if(a.activeElement===a.body){let d=h.getTreeNode(t);for(;d;){if(d.nodeToRestore&&d.nodeToRestore.isConnected){fP(d.nodeToRestore);return}d=d.parent}for(d=h.getTreeNode(t);d;){if(d.scopeRef&&d.scopeRef.current&&Xa.getTreeNode(d.scopeRef)){let p=Az(d.scopeRef.current,!0);fP(p);return}d=d.parent}}})}}}},[t,e])}function fP(t){t.dispatchEvent(new CustomEvent(HT,{bubbles:!0,cancelable:!0}))&&vd(t)}function ru(t,e,n){let i=e?.tabbable?NY:AO,a=t?.nodeType===Node.ELEMENT_NODE?t:null,s=Ii(a),r=tY(s,t||s,NodeFilter.SHOW_ELEMENT,{acceptNode(o){var c;return!(e==null||(c=e.from)===null||c===void 0)&&c.contains(o)||e?.tabbable&&o.tagName==="INPUT"&&o.getAttribute("type")==="radio"&&(!rne(o)||r.currentNode.tagName==="INPUT"&&r.currentNode.type==="radio"&&r.currentNode.name===o.name)?NodeFilter.FILTER_REJECT:i(o)&&(!n||Nl(o,n))&&(!e?.accept||e.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e?.from&&(r.currentNode=e.from),r}class iA{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,i){let a=this.fastMap.get(n??null);if(!a)return;let s=new GT({scopeRef:e});a.addChild(s),s.parent=a,this.fastMap.set(e,s),i&&(s.nodeToRestore=i)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let i=n.parent;for(let s of this.traverse())s!==n&&n.nodeToRestore&&s.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&Nl(s.nodeToRestore,n.scopeRef.current)&&(s.nodeToRestore=n.nodeToRestore);let a=n.children;i&&(i.removeChild(n),a.size>0&&a.forEach(s=>i&&i.addChild(s))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var e;let n=new iA;var i;for(let a of this.traverse())n.addTreeNode(a.scopeRef,(i=(e=a.parent)===null||e===void 0?void 0:e.scopeRef)!==null&&i!==void 0?i:null,a.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new GT({scopeRef:null}),this.fastMap.set(null,this.root)}}class GT{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let Xa=new iA;function Ts(t={}){let{autoFocus:e=!1,isTextInput:n,within:i}=t,a=P.useRef({isFocused:!1,isFocusVisible:e||Og()}),[s,r]=P.useState(!1),[o,c]=P.useState(()=>a.current.isFocused&&a.current.isFocusVisible),u=P.useCallback(()=>c(a.current.isFocused&&a.current.isFocusVisible),[]),h=P.useCallback(g=>{a.current.isFocused=g,r(g),u()},[u]);Mz(g=>{a.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:d}=cw({isDisabled:i,onFocusChange:h}),{focusWithinProps:p}=Rd({isDisabled:!i,onFocusWithinChange:h});return{isFocused:s,isFocusVisible:o,focusProps:i?p:d}}function fne(t,e){let n=e?.isDisabled,[i,a]=P.useState(!1);return Hi(()=>{if(t?.current&&!n){let s=()=>{if(t.current){let o=ru(t.current,{tabbable:!0});a(!!o.nextNode())}};s();let r=new MutationObserver(s);return r.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{r.disconnect()}}}),n?!1:i}function Rz(t){let e=pne(Ii(t));e!==t&&(e&&hne(e,t),t&&Nz(t,e))}function hne(t,e){t.dispatchEvent(new FocusEvent("blur",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:e}))}function Nz(t,e){t.dispatchEvent(new FocusEvent("focus",{relatedTarget:e})),t.dispatchEvent(new FocusEvent("focusin",{bubbles:!0,relatedTarget:e}))}function pne(t){let e=hr(t),n=e?.getAttribute("aria-activedescendant");return n&&t.getElementById(n)||e}function Pz(t,e,n){let{type:i}=t,{isOpen:a}=e;P.useEffect(()=>{n&&n.current&&pz.set(n.current,e.close)});let s;i==="menu"?s=!0:i==="listbox"&&(s="listbox");let r=Us();return{triggerProps:{"aria-haspopup":s,"aria-expanded":a,"aria-controls":a?r:void 0,onPress:e.toggle},overlayProps:{id:r}}}const Ab=typeof document<"u"&&window.visualViewport;let q2=0,wE;function aA(t={}){let{isDisabled:e}=t;Hi(()=>{if(!e)return q2++,q2===1&&(W1()?wE=gne():wE=mne()),()=>{q2--,q2===0&&wE()}},[e])}function mne(){let t=window.innerWidth-document.documentElement.clientWidth;return ah(t>0&&("scrollbarGutter"in document.documentElement.style?EE(document.documentElement,"scrollbarGutter","stable"):EE(document.documentElement,"paddingRight",`${t}px`)),EE(document.documentElement,"overflow","hidden"))}function gne(){let t,e=!1,n=c=>{let u=c.target;t=Pg(u)?u:MO(u,!0),e=!1;let h=u.ownerDocument.defaultView.getSelection();h&&!h.isCollapsed&&h.containsNode(u,!0)&&(e=!0),"selectionStart"in u&&"selectionEnd"in u&&u.selectionStart<u.selectionEnd&&u.ownerDocument.activeElement===u&&(e=!0)},i=document.createElement("style");i.textContent=`
@layer {
* {
overscroll-behavior: contain;
}
}`.trim(),document.head.prepend(i);let a=c=>{if(!(c.touches.length===2||e)){if(!t||t===document.documentElement||t===document.body){c.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&c.preventDefault()}},s=c=>{let u=c.target,h=c.relatedTarget;if(h&&eE(h))h.focus({preventScroll:!0}),hP(h,eE(u));else if(!h){var d;let p=(d=u.parentElement)===null||d===void 0?void 0:d.closest("[tabindex]");p?.focus({preventScroll:!0})}},r=HTMLElement.prototype.focus;HTMLElement.prototype.focus=function(c){let u=document.activeElement!=null&&eE(document.activeElement);r.call(this,{...c,preventScroll:!0}),(!c||!c.preventScroll)&&hP(this,u)};let o=ah(ME(document,"touchstart",n,{passive:!1,capture:!0}),ME(document,"touchmove",a,{passive:!1,capture:!0}),ME(document,"blur",s,!0));return()=>{o(),i.remove(),HTMLElement.prototype.focus=r}}function EE(t,e,n){let i=t.style[e];return t.style[e]=n,()=>{t.style[e]=i}}function ME(t,e,n,i){return t.addEventListener(e,n,i),()=>{t.removeEventListener(e,n,i)}}function hP(t,e){e||!Ab?pP(t):Ab.addEventListener("resize",()=>pP(t),{once:!0})}function pP(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let i=MO(n);if(i!==document.documentElement&&i!==document.body&&i!==n){let a=i.getBoundingClientRect(),s=n.getBoundingClientRect();if(s.top<a.top||s.bottom>a.top+n.clientHeight){let r=a.bottom;Ab&&(r=Math.min(r,Ab.offsetTop+Ab.height));let o=s.top-a.top-((r-a.top)/2-s.height/2);i.scrollTo({top:Math.max(0,Math.min(i.scrollHeight-i.clientHeight,i.scrollTop+o)),behavior:"smooth"})}}n=i.parentElement}}const vne=P.createContext({});function Dz(){var t;return(t=P.useContext(vne))!==null&&t!==void 0?t:{}}const WT=ft.createContext(null);function yne(t){let{children:e}=t,n=P.useContext(WT),[i,a]=P.useState(0),s=P.useMemo(()=>({parent:n,modalCount:i,addModal(){a(r=>r+1),n&&n.addModal()},removeModal(){a(r=>r-1),n&&n.removeModal()}}),[n,i]);return ft.createElement(WT.Provider,{value:s},e)}function bne(){let t=P.useContext(WT);return{modalProviderProps:{"aria-hidden":t&&t.modalCount>0?!0:void 0}}}function xne(t){let{modalProviderProps:e}=bne();return ft.createElement("div",{"data-overlay-container":!0,...t,...e})}function Lz(t){return ft.createElement(yne,null,ft.createElement(xne,t))}function mP(t){let e=G1(),{portalContainer:n=e?null:document.body,...i}=t,{getContainer:a}=Dz();if(!t.portalContainer&&a&&(n=a()),ft.useEffect(()=>{if(n?.closest("[data-overlay-container]"))throw new Error("An OverlayContainer must not be inside another container. Please change the portalContainer prop.")},[n]),!n)return null;let s=ft.createElement(Lz,i);return uC.createPortal(s,n)}var Oz={};Oz={dismiss:"تجاهل"};var Iz={};Iz={dismiss:"Отхвърляне"};var zz={};zz={dismiss:"Odstranit"};var Bz={};Bz={dismiss:"Luk"};var Uz={};Uz={dismiss:"Schließen"};var jz={};jz={dismiss:"Απόρριψη"};var Fz={};Fz={dismiss:"Dismiss"};var Vz={};Vz={dismiss:"Descartar"};var kz={};kz={dismiss:"Lõpeta"};var Hz={};Hz={dismiss:"Hylkää"};var $z={};$z={dismiss:"Rejeter"};var Gz={};Gz={dismiss:"התעלם"};var Wz={};Wz={dismiss:"Odbaci"};var Kz={};Kz={dismiss:"Elutasítás"};var Xz={};Xz={dismiss:"Ignora"};var qz={};qz={dismiss:"閉じる"};var Yz={};Yz={dismiss:"무시"};var Zz={};Zz={dismiss:"Atmesti"};var Qz={};Qz={dismiss:"Nerādīt"};var Jz={};Jz={dismiss:"Lukk"};var eB={};eB={dismiss:"Negeren"};var tB={};tB={dismiss:"Zignoruj"};var nB={};nB={dismiss:"Descartar"};var iB={};iB={dismiss:"Dispensar"};var aB={};aB={dismiss:"Revocare"};var sB={};sB={dismiss:"Пропустить"};var rB={};rB={dismiss:"Zrušiť"};var oB={};oB={dismiss:"Opusti"};var lB={};lB={dismiss:"Odbaci"};var cB={};cB={dismiss:"Avvisa"};var uB={};uB={dismiss:"Kapat"};var dB={};dB={dismiss:"Скасувати"};var fB={};fB={dismiss:"取消"};var hB={};hB={dismiss:"關閉"};var pB={};pB={"ar-AE":Oz,"bg-BG":Iz,"cs-CZ":zz,"da-DK":Bz,"de-DE":Uz,"el-GR":jz,"en-US":Fz,"es-ES":Vz,"et-EE":kz,"fi-FI":Hz,"fr-FR":$z,"he-IL":Gz,"hr-HR":Wz,"hu-HU":Kz,"it-IT":Xz,"ja-JP":qz,"ko-KR":Yz,"lt-LT":Zz,"lv-LV":Qz,"nb-NO":Jz,"nl-NL":eB,"pl-PL":tB,"pt-BR":nB,"pt-PT":iB,"ro-RO":aB,"ru-RU":sB,"sk-SK":rB,"sl-SI":oB,"sr-SP":lB,"sv-SE":cB,"tr-TR":uB,"uk-UA":dB,"zh-CN":fB,"zh-TW":hB};const gP={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function mB(t={}){let{style:e,isFocusable:n}=t,[i,a]=P.useState(!1),{focusWithinProps:s}=Rd({isDisabled:!n,onFocusWithinChange:o=>a(o)}),r=P.useMemo(()=>i?e:e?{...gP,...e}:gP,[i]);return{visuallyHiddenProps:{...s,style:r}}}function gB(t){let{children:e,elementType:n="div",isFocusable:i,style:a,...s}=t,{visuallyHiddenProps:r}=mB(t);return ft.createElement(n,ci(s,r),e)}function _ne(t){return t&&t.__esModule?t.default:t}function Ig(t){let{onDismiss:e,...n}=t,i=Qg(_ne(pB),"@react-aria/overlays"),a=iw(n,i.format("dismiss")),s=()=>{e&&e()};return ft.createElement(gB,null,ft.createElement("button",{...a,tabIndex:-1,onClick:s,style:{width:1,height:1}}))}const Sne=typeof HTMLElement<"u"&&"inert"in HTMLElement.prototype;let Wy=new WeakMap,hl=[];function wne(t,e){let n=jo(t?.[0]),i=e instanceof n.Element?{root:e}:e;var a;let s=(a=i?.root)!==null&&a!==void 0?a:document.body,r=i?.shouldUseInert&&Sne,o=new Set(t),c=new Set,u=w=>r&&w instanceof n.HTMLElement?w.inert:w.getAttribute("aria-hidden")==="true",h=(w,x)=>{r&&w instanceof n.HTMLElement?w.inert=x:x?w.setAttribute("aria-hidden","true"):(w.removeAttribute("aria-hidden"),w instanceof n.HTMLElement&&(w.inert=!1))},d=w=>{for(let C of w.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))o.add(C);let x=C=>{if(c.has(C)||o.has(C)||C.parentElement&&c.has(C.parentElement)&&C.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let A of o)if(C.contains(A))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},S=document.createTreeWalker(w,NodeFilter.SHOW_ELEMENT,{acceptNode:x}),M=x(w);if(M===NodeFilter.FILTER_ACCEPT&&p(w),M!==NodeFilter.FILTER_REJECT){let C=S.nextNode();for(;C!=null;)p(C),C=S.nextNode()}},p=w=>{var x;let S=(x=Wy.get(w))!==null&&x!==void 0?x:0;u(w)&&S===0||(S===0&&h(w,!0),c.add(w),Wy.set(w,S+1))};hl.length&&hl[hl.length-1].disconnect(),d(s);let g=new MutationObserver(w=>{for(let x of w)if(x.type==="childList"&&![...o,...c].some(S=>S.contains(x.target)))for(let S of x.addedNodes)(S instanceof HTMLElement||S instanceof SVGElement)&&(S.dataset.liveAnnouncer==="true"||S.dataset.reactAriaTopLayer==="true")?o.add(S):S instanceof Element&&d(S)});g.observe(s,{childList:!0,subtree:!0});let b={visibleNodes:o,hiddenNodes:c,observe(){g.observe(s,{childList:!0,subtree:!0})},disconnect(){g.disconnect()}};return hl.push(b),()=>{g.disconnect();for(let w of c){let x=Wy.get(w);x!=null&&(x===1?(h(w,!1),Wy.delete(w)):Wy.set(w,x-1))}b===hl[hl.length-1]?(hl.pop(),hl.length&&hl[hl.length-1].observe()):hl.splice(hl.indexOf(b),1)}}const vB=ft.createContext(null);function sA(t){let e=G1(),{portalContainer:n=e?null:document.body,isExiting:i}=t,[a,s]=P.useState(!1),r=P.useMemo(()=>({contain:a,setContain:s}),[a,s]),{getContainer:o}=Dz();if(!t.portalContainer&&o&&(n=o()),!n)return null;let c=t.children;return t.disableFocusManagement||(c=ft.createElement(ane,{restoreFocus:!0,contain:(t.shouldContainFocus||a)&&!i},c)),c=ft.createElement(vB.Provider,{value:r},ft.createElement(Qte,null,c)),uC.createPortal(c,n)}function yB(){let t=P.useContext(vB),e=t?.setContain;Hi(()=>{e?.(!0)},[e])}var Ene=({children:t,navigate:e,disableAnimation:n,useHref:i,disableRipple:a=!1,skipFramerMotionAnimations:s=n,reducedMotion:r="never",validationBehavior:o,locale:c="en-US",labelPlacement:u,defaultDates:h,createCalendar:d,spinnerVariant:p,...g})=>{let b=t;e&&(b=_.jsx(hY,{navigate:e,useHref:i,children:b}));const w=P.useMemo(()=>(n&&s&&(yu.skipAnimations=!0),{createCalendar:d,defaultDates:h,disableAnimation:n,disableRipple:a,validationBehavior:o,labelPlacement:u,spinnerVariant:p}),[d,h?.maxDate,h?.minDate,n,a,o,u,p]);return _.jsx(wq,{value:w,children:_.jsx(Bq,{locale:c,children:_.jsx(qQ,{reducedMotion:r,children:_.jsx(Lz,{...g,children:b})})})})};function bB(t){const e=fa(),n=e?.labelPlacement;return P.useMemo(()=>{var i,a;const s=(a=(i=t.labelPlacement)!=null?i:n)!=null?a:"inside";return s==="inside"&&!t.label?"outside":s},[t.labelPlacement,n,t.label])}function Mne(t){const e=fa(),n=e?.labelPlacement;return P.useMemo(()=>{var i,a;const s=(a=(i=t.labelPlacement)!=null?i:n)!=null?a:"inside";return s==="inside"&&!t.label?"outside":s},[t.labelPlacement,n,t.label])}function Si(t){return P.forwardRef(t)}var gr=(t,e,n=!0)=>{if(!e)return[t,{}];const i=e.reduce((a,s)=>s in t?{...a,[s]:t[s]}:a,{});return n?[Object.keys(t).filter(s=>!e.includes(s)).reduce((s,r)=>({...s,[r]:t[r]}),{}),i]:[t,i]},Tne={default:"bg-default text-default-foreground",primary:"bg-primary text-primary-foreground",secondary:"bg-secondary text-secondary-foreground",success:"bg-success text-success-foreground",warning:"bg-warning text-warning-foreground",danger:"bg-danger text-danger-foreground",foreground:"bg-foreground text-background"},Cne={default:"shadow-lg shadow-default/50 bg-default text-default-foreground",primary:"shadow-lg shadow-primary/40 bg-primary text-primary-foreground",secondary:"shadow-lg shadow-secondary/40 bg-secondary text-secondary-foreground",success:"shadow-lg shadow-success/40 bg-success text-success-foreground",warning:"shadow-lg shadow-warning/40 bg-warning text-warning-foreground",danger:"shadow-lg shadow-danger/40 bg-danger text-danger-foreground"},Ane={default:"bg-transparent border-default text-foreground",primary:"bg-transparent border-primary text-primary",secondary:"bg-transparent border-secondary text-secondary",success:"bg-transparent border-success text-success",warning:"bg-transparent border-warning text-warning",danger:"bg-transparent border-danger text-danger"},Rne={default:"bg-default/40 text-default-700",primary:"bg-primary/20 text-primary-600",secondary:"bg-secondary/20 text-secondary-600",success:"bg-success/20 text-success-700 dark:text-success",warning:"bg-warning/20 text-warning-700 dark:text-warning",danger:"bg-danger/20 text-danger-600 dark:text-danger-500"},Nne={default:"border-default bg-default-100 text-default-foreground",primary:"border-default bg-default-100 text-primary",secondary:"border-default bg-default-100 text-secondary",success:"border-default bg-default-100 text-success",warning:"border-default bg-default-100 text-warning",danger:"border-default bg-default-100 text-danger"},Pne={default:"bg-transparent text-default-foreground",primary:"bg-transparent text-primary",secondary:"bg-transparent text-secondary",success:"bg-transparent text-success",warning:"bg-transparent text-warning",danger:"bg-transparent text-danger"},Dne={default:"border-default text-default-foreground",primary:"border-primary text-primary",secondary:"border-secondary text-secondary",success:"border-success text-success",warning:"border-warning text-warning",danger:"border-danger text-danger"},Ct={solid:Tne,shadow:Cne,bordered:Ane,flat:Rne,faded:Nne,light:Pne,ghost:Dne},Lne={".spinner-bar-animation":{"animation-delay":"calc(-1.2s + (0.1s * var(--bar-index)))",transform:"rotate(calc(30deg * var(--bar-index)))translate(140%)"},".spinner-dot-animation":{"animation-delay":"calc(250ms * var(--dot-index))"},".spinner-dot-blink-animation":{"animation-delay":"calc(200ms * var(--dot-index))"}},One={".leading-inherit":{"line-height":"inherit"},".bg-img-inherit":{"background-image":"inherit"},".bg-clip-inherit":{"background-clip":"inherit"},".text-fill-inherit":{"-webkit-text-fill-color":"inherit"},".tap-highlight-transparent":{"-webkit-tap-highlight-color":"transparent"},".input-search-cancel-button-none":{"&::-webkit-search-cancel-button":{"-webkit-appearance":"none"}}},Ine={".scrollbar-hide":{"-ms-overflow-style":"none","scrollbar-width":"none","&::-webkit-scrollbar":{display:"none"}},".scrollbar-default":{"-ms-overflow-style":"auto","scrollbar-width":"auto","&::-webkit-scrollbar":{display:"block"}}},zne={".text-tiny":{"font-size":"var(--heroui-font-size-tiny)","line-height":"var(--heroui-line-height-tiny)"},".text-small":{"font-size":"var(--heroui-font-size-small)","line-height":"var(--heroui-line-height-small)"},".text-medium":{"font-size":"var(--heroui-font-size-medium)","line-height":"var(--heroui-line-height-medium)"},".text-large":{"font-size":"var(--heroui-font-size-large)","line-height":"var(--heroui-line-height-large)"}},Yc="250ms",Bne={".transition-background":{"transition-property":"background","transition-timing-function":"ease","transition-duration":Yc},".transition-colors-opacity":{"transition-property":"color, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":Yc},".transition-width":{"transition-property":"width","transition-timing-function":"ease","transition-duration":Yc},".transition-height":{"transition-property":"height","transition-timing-function":"ease","transition-duration":Yc},".transition-size":{"transition-property":"width, height","transition-timing-function":"ease","transition-duration":Yc},".transition-left":{"transition-property":"left","transition-timing-function":"ease","transition-duration":Yc},".transition-transform-opacity":{"transition-property":"transform, scale, opacity rotate","transition-timing-function":"ease","transition-duration":Yc},".transition-transform-background":{"transition-property":"transform, scale, background","transition-timing-function":"ease","transition-duration":Yc},".transition-transform-colors":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke","transition-timing-function":"ease","transition-duration":Yc},".transition-transform-colors-opacity":{"transition-property":"transform, scale, color, background, background-color, border-color, text-decoration-color, fill, stroke, opacity","transition-timing-function":"ease","transition-duration":Yc}},Une={...One,...Bne,...Ine,...zne,...Lne},Y2=["small","medium","large"],KT={theme:{spacing:["divider"],radius:Y2},classGroups:{shadow:[{shadow:Y2}],opacity:[{opacity:["disabled"]}],"font-size":[{text:["tiny",...Y2]}],"border-w":[{border:Y2}],"bg-image":["bg-stripe-gradient-default","bg-stripe-gradient-primary","bg-stripe-gradient-secondary","bg-stripe-gradient-success","bg-stripe-gradient-warning","bg-stripe-gradient-danger"],transition:Object.keys(Une).filter(t=>t.includes(".transition")).map(t=>t.replace(".",""))}},jne=/\s+/g,XT=t=>typeof t!="string"||!t?t:t.replace(jne," ").trim(),BS=(...t)=>{let e=[],n=i=>{if(!i&&i!==0&&i!==0n)return;if(Array.isArray(i)){for(let s=0,r=i.length;s<r;s++)n(i[s]);return}let a=typeof i;if(a==="string"||a==="number"||a==="bigint"){if(a==="number"&&i!==i)return;e.push(String(i))}else if(a==="object"){let s=Object.keys(i);for(let r=0,o=s.length;r<o;r++){let c=s[r];i[c]&&e.push(c)}}};for(let i=0,a=t.length;i<a;i++){let s=t[i];s!=null&&n(s)}return e.length>0?XT(e.join(" ")):void 0},vP=t=>t===!1?"false":t===!0?"true":t===0?"0":t,ao=t=>{if(!t||typeof t!="object")return!0;for(let e in t)return!1;return!0},Fne=(t,e)=>{if(t===e)return!0;if(!t||!e)return!1;let n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(let a=0;a<n.length;a++){let s=n[a];if(!i.includes(s)||t[s]!==e[s])return!1}return!0},yP=(t,e)=>{for(let n in e)if(Object.prototype.hasOwnProperty.call(e,n)){let i=e[n];n in t?t[n]=BS(t[n],i):t[n]=i}return t},xB=(t,e)=>{for(let n=0;n<t.length;n++){let i=t[n];Array.isArray(i)?xB(i,e):i&&e.push(i)}},_B=(...t)=>{let e=[];xB(t,e);let n=[];for(let i=0;i<e.length;i++)e[i]&&n.push(e[i]);return n},qT=(t,e)=>{let n={};for(let i in t){let a=t[i];if(i in e){let s=e[i];Array.isArray(a)||Array.isArray(s)?n[i]=_B(s,a):typeof a=="object"&&typeof s=="object"&&a&&s?n[i]=qT(a,s):n[i]=s+" "+a}else n[i]=a}for(let i in e)i in t||(n[i]=e[i]);return n},Vne={twMerge:!0,twMergeConfig:{},responsiveVariants:!1};function kne(){let t=null,e={},n=!1;return{get cachedTwMerge(){return t},set cachedTwMerge(i){t=i},get cachedTwMergeConfig(){return e},set cachedTwMergeConfig(i){e=i},get didTwMergeConfigChange(){return n},set didTwMergeConfigChange(i){n=i},reset(){t=null,e={},n=!1}}}var pd=kne(),Hne=t=>{let e=(n,i)=>{let{extend:a=null,slots:s={},variants:r={},compoundVariants:o=[],compoundSlots:c=[],defaultVariants:u={}}=n,h={...Vne,...i},d=a?.base?BS(a.base,n?.base):n?.base,p=a?.variants&&!ao(a.variants)?qT(r,a.variants):r,g=a?.defaultVariants&&!ao(a.defaultVariants)?{...a.defaultVariants,...u}:u;!ao(h.twMergeConfig)&&!Fne(h.twMergeConfig,pd.cachedTwMergeConfig)&&(pd.didTwMergeConfigChange=!0,pd.cachedTwMergeConfig=h.twMergeConfig);let b=ao(a?.slots),w=ao(s)?{}:{base:BS(n?.base,b&&a?.base),...s},x=b?w:yP({...a?.slots},ao(w)?{base:n?.base}:w),S=ao(a?.compoundVariants)?o:_B(a?.compoundVariants,o),M=A=>{if(ao(p)&&ao(s)&&b)return t(d,A?.class,A?.className)(h);if(S&&!Array.isArray(S))throw new TypeError(`The "compoundVariants" prop must be an array. Received: ${typeof S}`);if(c&&!Array.isArray(c))throw new TypeError(`The "compoundSlots" prop must be an array. Received: ${typeof c}`);let N=(k,X,V=[],H)=>{let W=V;if(typeof X=="string"){let J=XT(X).split(" ");for(let Y=0;Y<J.length;Y++)W.push(`${k}:${J[Y]}`)}else if(Array.isArray(X))for(let J=0;J<X.length;J++)W.push(`${k}:${X[J]}`);else if(typeof X=="object"&&typeof H=="string"&&H in X){let J=X[H];if(J&&typeof J=="string"){let Y=XT(J).split(" "),K=[];for(let ee=0;ee<Y.length;ee++)K.push(`${k}:${Y[ee]}`);W[H]=W[H]?W[H].concat(K):K}else if(Array.isArray(J)&&J.length>0){let Y=[];for(let K=0;K<J.length;K++)Y.push(`${k}:${J[K]}`);W[H]=Y}}return W},R=(k,X=p,V=null,H=null)=>{let W=X[k];if(!W||ao(W))return null;let J=H?.[k]??A?.[k];if(J===null)return null;let Y=vP(J),K=Array.isArray(h.responsiveVariants)&&h.responsiveVariants.length>0||h.responsiveVariants===!0,ee=g?.[k],ie=[];if(typeof Y=="object"&&K)for(let[se,ae]of Object.entries(Y)){let ce=W[ae];if(se==="initial"){ee=ae;continue}Array.isArray(h.responsiveVariants)&&!h.responsiveVariants.includes(se)||(ie=N(se,ce,ie,V))}let Z=Y!=null&&typeof Y!="object"?Y:vP(ee),ue=W[Z||"false"];return typeof ie=="object"&&typeof V=="string"&&ie[V]?yP(ie,ue):ie.length>0?(ie.push(ue),V==="base"?ie.join(" "):ie):ue},D=()=>{if(!p)return null;let k=Object.keys(p),X=[];for(let V=0;V<k.length;V++){let H=R(k[V],p);H&&X.push(H)}return X},B=(k,X)=>{if(!p||typeof p!="object")return null;let V=[];for(let H in p){let W=R(H,p,k,X),J=k==="base"&&typeof W=="string"?W:W&&W[k];J&&V.push(J)}return V},z={};for(let k in A){let X=A[k];X!==void 0&&(z[k]=X)}let I=(k,X)=>{let V=typeof A?.[k]=="object"?{[k]:A[k]?.initial}:{};return{...g,...z,...V,...X}},U=(k=[],X)=>{let V=[],H=k.length;for(let W=0;W<H;W++){let{class:J,className:Y,...K}=k[W],ee=!0,ie=I(null,X);for(let Z in K){let ue=K[Z],se=ie[Z];if(Array.isArray(ue)){if(!ue.includes(se)){ee=!1;break}}else{if((ue==null||ue===!1)&&(se==null||se===!1))continue;if(se!==ue){ee=!1;break}}}ee&&(J&&V.push(J),Y&&V.push(Y))}return V},$=k=>{let X=U(S,k);if(!Array.isArray(X))return X;let V={},H=t;for(let W=0;W<X.length;W++){let J=X[W];if(typeof J=="string")V.base=H(V.base,J)(h);else if(typeof J=="object")for(let Y in J)V[Y]=H(V[Y],J[Y])(h)}return V},G=k=>{if(c.length<1)return null;let X={},V=I(null,k);for(let H=0;H<c.length;H++){let{slots:W=[],class:J,className:Y,...K}=c[H];if(!ao(K)){let ee=!0;for(let ie in K){let Z=V[ie],ue=K[ie];if(Z===void 0||(Array.isArray(ue)?!ue.includes(Z):ue!==Z)){ee=!1;break}}if(!ee)continue}for(let ee=0;ee<W.length;ee++){let ie=W[ee];X[ie]||(X[ie]=[]),X[ie].push([J,Y])}}return X};if(!ao(s)||!b){let k={};if(typeof x=="object"&&!ao(x)){let X=t;for(let V in x)k[V]=H=>{let W=$(H),J=G(H);return X(x[V],B(V,H),W?W[V]:void 0,J?J[V]:void 0,H?.class,H?.className)(h)}}return k}return t(d,D(),U(S),A?.class,A?.className)(h)},C=()=>{if(!(!p||typeof p!="object"))return Object.keys(p)};return M.variantKeys=C(),M.extend=a,M.base=d,M.slots=x,M.variants=p,M.defaultVariants=g,M.compoundSlots=c,M.compoundVariants=S,M};return{tv:e,createTV:n=>(i,a)=>e(i,a?qT(n,a):n)}};const rA="-",$ne=t=>{const e=Wne(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:i}=t;return{getClassGroupId:r=>{const o=r.split(rA);return o[0]===""&&o.length!==1&&o.shift(),SB(o,e)||Gne(r)},getConflictingClassGroupIds:(r,o)=>{const c=n[r]||[];return o&&i[r]?[...c,...i[r]]:c}}},SB=(t,e)=>{if(t.length===0)return e.classGroupId;const n=t[0],i=e.nextPart.get(n),a=i?SB(t.slice(1),i):void 0;if(a)return a;if(e.validators.length===0)return;const s=t.join(rA);return e.validators.find(({validator:r})=>r(s))?.classGroupId},bP=/^\[(.+)\]$/,Gne=t=>{if(bP.test(t)){const e=bP.exec(t)[1],n=e?.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},Wne=t=>{const{theme:e,classGroups:n}=t,i={nextPart:new Map,validators:[]};for(const a in n)YT(n[a],i,a,e);return i},YT=(t,e,n,i)=>{t.forEach(a=>{if(typeof a=="string"){const s=a===""?e:xP(e,a);s.classGroupId=n;return}if(typeof a=="function"){if(Kne(a)){YT(a(i),e,n,i);return}e.validators.push({validator:a,classGroupId:n});return}Object.entries(a).forEach(([s,r])=>{YT(r,xP(e,s),n,i)})})},xP=(t,e)=>{let n=t;return e.split(rA).forEach(i=>{n.nextPart.has(i)||n.nextPart.set(i,{nextPart:new Map,validators:[]}),n=n.nextPart.get(i)}),n},Kne=t=>t.isThemeGetter,Xne=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,i=new Map;const a=(s,r)=>{n.set(s,r),e++,e>t&&(e=0,i=n,n=new Map)};return{get(s){let r=n.get(s);if(r!==void 0)return r;if((r=i.get(s))!==void 0)return a(s,r),r},set(s,r){n.has(s)?n.set(s,r):a(s,r)}}},ZT="!",QT=":",qne=QT.length,Yne=t=>{const{prefix:e,experimentalParseClassName:n}=t;let i=a=>{const s=[];let r=0,o=0,c=0,u;for(let b=0;b<a.length;b++){let w=a[b];if(r===0&&o===0){if(w===QT){s.push(a.slice(c,b)),c=b+qne;continue}if(w==="/"){u=b;continue}}w==="["?r++:w==="]"?r--:w==="("?o++:w===")"&&o--}const h=s.length===0?a:a.substring(c),d=Zne(h),p=d!==h,g=u&&u>c?u-c:void 0;return{modifiers:s,hasImportantModifier:p,baseClassName:d,maybePostfixModifierPosition:g}};if(e){const a=e+QT,s=i;i=r=>r.startsWith(a)?s(r.substring(a.length)):{isExternal:!0,modifiers:[],hasImportantModifier:!1,baseClassName:r,maybePostfixModifierPosition:void 0}}if(n){const a=i;i=s=>n({className:s,parseClassName:a})}return i},Zne=t=>t.endsWith(ZT)?t.substring(0,t.length-1):t.startsWith(ZT)?t.substring(1):t,Qne=t=>{const e=Object.fromEntries(t.orderSensitiveModifiers.map(i=>[i,!0]));return i=>{if(i.length<=1)return i;const a=[];let s=[];return i.forEach(r=>{r[0]==="["||e[r]?(a.push(...s.sort(),r),s=[]):s.push(r)}),a.push(...s.sort()),a}},Jne=t=>({cache:Xne(t.cacheSize),parseClassName:Yne(t),sortModifiers:Qne(t),...$ne(t)}),eie=/\s+/,tie=(t,e)=>{const{parseClassName:n,getClassGroupId:i,getConflictingClassGroupIds:a,sortModifiers:s}=e,r=[],o=t.trim().split(eie);let c="";for(let u=o.length-1;u>=0;u-=1){const h=o[u],{isExternal:d,modifiers:p,hasImportantModifier:g,baseClassName:b,maybePostfixModifierPosition:w}=n(h);if(d){c=h+(c.length>0?" "+c:c);continue}let x=!!w,S=i(x?b.substring(0,w):b);if(!S){if(!x){c=h+(c.length>0?" "+c:c);continue}if(S=i(b),!S){c=h+(c.length>0?" "+c:c);continue}x=!1}const M=s(p).join(":"),C=g?M+ZT:M,A=C+S;if(r.includes(A))continue;r.push(A);const N=a(S,x);for(let R=0;R<N.length;++R){const D=N[R];r.push(C+D)}c=h+(c.length>0?" "+c:c)}return c};function nie(){let t=0,e,n,i="";for(;t<arguments.length;)(e=arguments[t++])&&(n=wB(e))&&(i&&(i+=" "),i+=n);return i}const wB=t=>{if(typeof t=="string")return t;let e,n="";for(let i=0;i<t.length;i++)t[i]&&(e=wB(t[i]))&&(n&&(n+=" "),n+=e);return n};function JT(t,...e){let n,i,a,s=r;function r(c){const u=e.reduce((h,d)=>d(h),t());return n=Jne(u),i=n.cache.get,a=n.cache.set,s=o,o(c)}function o(c){const u=i(c);if(u)return u;const h=tie(c,n);return a(c,h),h}return function(){return s(nie.apply(null,arguments))}}const os=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},EB=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,MB=/^\((?:(\w[\w-]*):)?(.+)\)$/i,iie=/^\d+\/\d+$/,aie=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,sie=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,rie=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,oie=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,lie=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,N0=t=>iie.test(t),Xn=t=>!!t&&!Number.isNaN(Number(t)),vf=t=>!!t&&Number.isInteger(Number(t)),TE=t=>t.endsWith("%")&&Xn(t.slice(0,-1)),id=t=>aie.test(t),cie=()=>!0,uie=t=>sie.test(t)&&!rie.test(t),TB=()=>!1,die=t=>oie.test(t),fie=t=>lie.test(t),hie=t=>!ln(t)&&!cn(t),pie=t=>tv(t,RB,TB),ln=t=>EB.test(t),cp=t=>tv(t,NB,uie),CE=t=>tv(t,bie,Xn),_P=t=>tv(t,CB,TB),mie=t=>tv(t,AB,fie),Z2=t=>tv(t,PB,die),cn=t=>MB.test(t),Ky=t=>nv(t,NB),gie=t=>nv(t,xie),SP=t=>nv(t,CB),vie=t=>nv(t,RB),yie=t=>nv(t,AB),Q2=t=>nv(t,PB,!0),tv=(t,e,n)=>{const i=EB.exec(t);return i?i[1]?e(i[1]):n(i[2]):!1},nv=(t,e,n=!1)=>{const i=MB.exec(t);return i?i[1]?e(i[1]):n:!1},CB=t=>t==="position"||t==="percentage",AB=t=>t==="image"||t==="url",RB=t=>t==="length"||t==="size"||t==="bg-size",NB=t=>t==="length",bie=t=>t==="number",xie=t=>t==="family-name",PB=t=>t==="shadow",e5=()=>{const t=os("color"),e=os("font"),n=os("text"),i=os("font-weight"),a=os("tracking"),s=os("leading"),r=os("breakpoint"),o=os("container"),c=os("spacing"),u=os("radius"),h=os("shadow"),d=os("inset-shadow"),p=os("text-shadow"),g=os("drop-shadow"),b=os("blur"),w=os("perspective"),x=os("aspect"),S=os("ease"),M=os("animate"),C=()=>["auto","avoid","all","avoid-page","page","left","right","column"],A=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],N=()=>[...A(),cn,ln],R=()=>["auto","hidden","clip","visible","scroll"],D=()=>["auto","contain","none"],B=()=>[cn,ln,c],z=()=>[N0,"full","auto",...B()],I=()=>[vf,"none","subgrid",cn,ln],U=()=>["auto",{span:["full",vf,cn,ln]},vf,cn,ln],$=()=>[vf,"auto",cn,ln],G=()=>["auto","min","max","fr",cn,ln],k=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],X=()=>["start","end","center","stretch","center-safe","end-safe"],V=()=>["auto",...B()],H=()=>[N0,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...B()],W=()=>[t,cn,ln],J=()=>[...A(),SP,_P,{position:[cn,ln]}],Y=()=>["no-repeat",{repeat:["","x","y","space","round"]}],K=()=>["auto","cover","contain",vie,pie,{size:[cn,ln]}],ee=()=>[TE,Ky,cp],ie=()=>["","none","full",u,cn,ln],Z=()=>["",Xn,Ky,cp],ue=()=>["solid","dashed","dotted","double"],se=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ae=()=>[Xn,TE,SP,_P],ce=()=>["","none",b,cn,ln],pe=()=>["none",Xn,cn,ln],ye=()=>["none",Xn,cn,ln],_e=()=>[Xn,cn,ln],me=()=>[N0,"full",...B()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[id],breakpoint:[id],color:[cie],container:[id],"drop-shadow":[id],ease:["in","out","in-out"],font:[hie],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[id],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[id],shadow:[id],spacing:["px",Xn],text:[id],"text-shadow":[id],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",N0,ln,cn,x]}],container:["container"],columns:[{columns:[Xn,ln,cn,o]}],"break-after":[{"break-after":C()}],"break-before":[{"break-before":C()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:N()}],overflow:[{overflow:R()}],"overflow-x":[{"overflow-x":R()}],"overflow-y":[{"overflow-y":R()}],overscroll:[{overscroll:D()}],"overscroll-x":[{"overscroll-x":D()}],"overscroll-y":[{"overscroll-y":D()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:z()}],"inset-x":[{"inset-x":z()}],"inset-y":[{"inset-y":z()}],start:[{start:z()}],end:[{end:z()}],top:[{top:z()}],right:[{right:z()}],bottom:[{bottom:z()}],left:[{left:z()}],visibility:["visible","invisible","collapse"],z:[{z:[vf,"auto",cn,ln]}],basis:[{basis:[N0,"full","auto",o,...B()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Xn,N0,"auto","initial","none",ln]}],grow:[{grow:["",Xn,cn,ln]}],shrink:[{shrink:["",Xn,cn,ln]}],order:[{order:[vf,"first","last","none",cn,ln]}],"grid-cols":[{"grid-cols":I()}],"col-start-end":[{col:U()}],"col-start":[{"col-start":$()}],"col-end":[{"col-end":$()}],"grid-rows":[{"grid-rows":I()}],"row-start-end":[{row:U()}],"row-start":[{"row-start":$()}],"row-end":[{"row-end":$()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":G()}],"auto-rows":[{"auto-rows":G()}],gap:[{gap:B()}],"gap-x":[{"gap-x":B()}],"gap-y":[{"gap-y":B()}],"justify-content":[{justify:[...k(),"normal"]}],"justify-items":[{"justify-items":[...X(),"normal"]}],"justify-self":[{"justify-self":["auto",...X()]}],"align-content":[{content:["normal",...k()]}],"align-items":[{items:[...X(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...X(),{baseline:["","last"]}]}],"place-content":[{"place-content":k()}],"place-items":[{"place-items":[...X(),"baseline"]}],"place-self":[{"place-self":["auto",...X()]}],p:[{p:B()}],px:[{px:B()}],py:[{py:B()}],ps:[{ps:B()}],pe:[{pe:B()}],pt:[{pt:B()}],pr:[{pr:B()}],pb:[{pb:B()}],pl:[{pl:B()}],m:[{m:V()}],mx:[{mx:V()}],my:[{my:V()}],ms:[{ms:V()}],me:[{me:V()}],mt:[{mt:V()}],mr:[{mr:V()}],mb:[{mb:V()}],ml:[{ml:V()}],"space-x":[{"space-x":B()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":B()}],"space-y-reverse":["space-y-reverse"],size:[{size:H()}],w:[{w:[o,"screen",...H()]}],"min-w":[{"min-w":[o,"screen","none",...H()]}],"max-w":[{"max-w":[o,"screen","none","prose",{screen:[r]},...H()]}],h:[{h:["screen","lh",...H()]}],"min-h":[{"min-h":["screen","lh","none",...H()]}],"max-h":[{"max-h":["screen","lh",...H()]}],"font-size":[{text:["base",n,Ky,cp]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[i,cn,CE]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",TE,ln]}],"font-family":[{font:[gie,ln,e]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,cn,ln]}],"line-clamp":[{"line-clamp":[Xn,"none",cn,CE]}],leading:[{leading:[s,...B()]}],"list-image":[{"list-image":["none",cn,ln]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",cn,ln]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:W()}],"text-color":[{text:W()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...ue(),"wavy"]}],"text-decoration-thickness":[{decoration:[Xn,"from-font","auto",cn,cp]}],"text-decoration-color":[{decoration:W()}],"underline-offset":[{"underline-offset":[Xn,"auto",cn,ln]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:B()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",cn,ln]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",cn,ln]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:J()}],"bg-repeat":[{bg:Y()}],"bg-size":[{bg:K()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},vf,cn,ln],radial:["",cn,ln],conic:[vf,cn,ln]},yie,mie]}],"bg-color":[{bg:W()}],"gradient-from-pos":[{from:ee()}],"gradient-via-pos":[{via:ee()}],"gradient-to-pos":[{to:ee()}],"gradient-from":[{from:W()}],"gradient-via":[{via:W()}],"gradient-to":[{to:W()}],rounded:[{rounded:ie()}],"rounded-s":[{"rounded-s":ie()}],"rounded-e":[{"rounded-e":ie()}],"rounded-t":[{"rounded-t":ie()}],"rounded-r":[{"rounded-r":ie()}],"rounded-b":[{"rounded-b":ie()}],"rounded-l":[{"rounded-l":ie()}],"rounded-ss":[{"rounded-ss":ie()}],"rounded-se":[{"rounded-se":ie()}],"rounded-ee":[{"rounded-ee":ie()}],"rounded-es":[{"rounded-es":ie()}],"rounded-tl":[{"rounded-tl":ie()}],"rounded-tr":[{"rounded-tr":ie()}],"rounded-br":[{"rounded-br":ie()}],"rounded-bl":[{"rounded-bl":ie()}],"border-w":[{border:Z()}],"border-w-x":[{"border-x":Z()}],"border-w-y":[{"border-y":Z()}],"border-w-s":[{"border-s":Z()}],"border-w-e":[{"border-e":Z()}],"border-w-t":[{"border-t":Z()}],"border-w-r":[{"border-r":Z()}],"border-w-b":[{"border-b":Z()}],"border-w-l":[{"border-l":Z()}],"divide-x":[{"divide-x":Z()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":Z()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...ue(),"hidden","none"]}],"divide-style":[{divide:[...ue(),"hidden","none"]}],"border-color":[{border:W()}],"border-color-x":[{"border-x":W()}],"border-color-y":[{"border-y":W()}],"border-color-s":[{"border-s":W()}],"border-color-e":[{"border-e":W()}],"border-color-t":[{"border-t":W()}],"border-color-r":[{"border-r":W()}],"border-color-b":[{"border-b":W()}],"border-color-l":[{"border-l":W()}],"divide-color":[{divide:W()}],"outline-style":[{outline:[...ue(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Xn,cn,ln]}],"outline-w":[{outline:["",Xn,Ky,cp]}],"outline-color":[{outline:W()}],shadow:[{shadow:["","none",h,Q2,Z2]}],"shadow-color":[{shadow:W()}],"inset-shadow":[{"inset-shadow":["none",d,Q2,Z2]}],"inset-shadow-color":[{"inset-shadow":W()}],"ring-w":[{ring:Z()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:W()}],"ring-offset-w":[{"ring-offset":[Xn,cp]}],"ring-offset-color":[{"ring-offset":W()}],"inset-ring-w":[{"inset-ring":Z()}],"inset-ring-color":[{"inset-ring":W()}],"text-shadow":[{"text-shadow":["none",p,Q2,Z2]}],"text-shadow-color":[{"text-shadow":W()}],opacity:[{opacity:[Xn,cn,ln]}],"mix-blend":[{"mix-blend":[...se(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":se()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Xn]}],"mask-image-linear-from-pos":[{"mask-linear-from":ae()}],"mask-image-linear-to-pos":[{"mask-linear-to":ae()}],"mask-image-linear-from-color":[{"mask-linear-from":W()}],"mask-image-linear-to-color":[{"mask-linear-to":W()}],"mask-image-t-from-pos":[{"mask-t-from":ae()}],"mask-image-t-to-pos":[{"mask-t-to":ae()}],"mask-image-t-from-color":[{"mask-t-from":W()}],"mask-image-t-to-color":[{"mask-t-to":W()}],"mask-image-r-from-pos":[{"mask-r-from":ae()}],"mask-image-r-to-pos":[{"mask-r-to":ae()}],"mask-image-r-from-color":[{"mask-r-from":W()}],"mask-image-r-to-color":[{"mask-r-to":W()}],"mask-image-b-from-pos":[{"mask-b-from":ae()}],"mask-image-b-to-pos":[{"mask-b-to":ae()}],"mask-image-b-from-color":[{"mask-b-from":W()}],"mask-image-b-to-color":[{"mask-b-to":W()}],"mask-image-l-from-pos":[{"mask-l-from":ae()}],"mask-image-l-to-pos":[{"mask-l-to":ae()}],"mask-image-l-from-color":[{"mask-l-from":W()}],"mask-image-l-to-color":[{"mask-l-to":W()}],"mask-image-x-from-pos":[{"mask-x-from":ae()}],"mask-image-x-to-pos":[{"mask-x-to":ae()}],"mask-image-x-from-color":[{"mask-x-from":W()}],"mask-image-x-to-color":[{"mask-x-to":W()}],"mask-image-y-from-pos":[{"mask-y-from":ae()}],"mask-image-y-to-pos":[{"mask-y-to":ae()}],"mask-image-y-from-color":[{"mask-y-from":W()}],"mask-image-y-to-color":[{"mask-y-to":W()}],"mask-image-radial":[{"mask-radial":[cn,ln]}],"mask-image-radial-from-pos":[{"mask-radial-from":ae()}],"mask-image-radial-to-pos":[{"mask-radial-to":ae()}],"mask-image-radial-from-color":[{"mask-radial-from":W()}],"mask-image-radial-to-color":[{"mask-radial-to":W()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":A()}],"mask-image-conic-pos":[{"mask-conic":[Xn]}],"mask-image-conic-from-pos":[{"mask-conic-from":ae()}],"mask-image-conic-to-pos":[{"mask-conic-to":ae()}],"mask-image-conic-from-color":[{"mask-conic-from":W()}],"mask-image-conic-to-color":[{"mask-conic-to":W()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:J()}],"mask-repeat":[{mask:Y()}],"mask-size":[{mask:K()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",cn,ln]}],filter:[{filter:["","none",cn,ln]}],blur:[{blur:ce()}],brightness:[{brightness:[Xn,cn,ln]}],contrast:[{contrast:[Xn,cn,ln]}],"drop-shadow":[{"drop-shadow":["","none",g,Q2,Z2]}],"drop-shadow-color":[{"drop-shadow":W()}],grayscale:[{grayscale:["",Xn,cn,ln]}],"hue-rotate":[{"hue-rotate":[Xn,cn,ln]}],invert:[{invert:["",Xn,cn,ln]}],saturate:[{saturate:[Xn,cn,ln]}],sepia:[{sepia:["",Xn,cn,ln]}],"backdrop-filter":[{"backdrop-filter":["","none",cn,ln]}],"backdrop-blur":[{"backdrop-blur":ce()}],"backdrop-brightness":[{"backdrop-brightness":[Xn,cn,ln]}],"backdrop-contrast":[{"backdrop-contrast":[Xn,cn,ln]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Xn,cn,ln]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Xn,cn,ln]}],"backdrop-invert":[{"backdrop-invert":["",Xn,cn,ln]}],"backdrop-opacity":[{"backdrop-opacity":[Xn,cn,ln]}],"backdrop-saturate":[{"backdrop-saturate":[Xn,cn,ln]}],"backdrop-sepia":[{"backdrop-sepia":["",Xn,cn,ln]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":B()}],"border-spacing-x":[{"border-spacing-x":B()}],"border-spacing-y":[{"border-spacing-y":B()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",cn,ln]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Xn,"initial",cn,ln]}],ease:[{ease:["linear","initial",S,cn,ln]}],delay:[{delay:[Xn,cn,ln]}],animate:[{animate:["none",M,cn,ln]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[w,cn,ln]}],"perspective-origin":[{"perspective-origin":N()}],rotate:[{rotate:pe()}],"rotate-x":[{"rotate-x":pe()}],"rotate-y":[{"rotate-y":pe()}],"rotate-z":[{"rotate-z":pe()}],scale:[{scale:ye()}],"scale-x":[{"scale-x":ye()}],"scale-y":[{"scale-y":ye()}],"scale-z":[{"scale-z":ye()}],"scale-3d":["scale-3d"],skew:[{skew:_e()}],"skew-x":[{"skew-x":_e()}],"skew-y":[{"skew-y":_e()}],transform:[{transform:[cn,ln,"","none","gpu","cpu"]}],"transform-origin":[{origin:N()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:me()}],"translate-x":[{"translate-x":me()}],"translate-y":[{"translate-y":me()}],"translate-z":[{"translate-z":me()}],"translate-none":["translate-none"],accent:[{accent:W()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:W()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",cn,ln]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":B()}],"scroll-mx":[{"scroll-mx":B()}],"scroll-my":[{"scroll-my":B()}],"scroll-ms":[{"scroll-ms":B()}],"scroll-me":[{"scroll-me":B()}],"scroll-mt":[{"scroll-mt":B()}],"scroll-mr":[{"scroll-mr":B()}],"scroll-mb":[{"scroll-mb":B()}],"scroll-ml":[{"scroll-ml":B()}],"scroll-p":[{"scroll-p":B()}],"scroll-px":[{"scroll-px":B()}],"scroll-py":[{"scroll-py":B()}],"scroll-ps":[{"scroll-ps":B()}],"scroll-pe":[{"scroll-pe":B()}],"scroll-pt":[{"scroll-pt":B()}],"scroll-pr":[{"scroll-pr":B()}],"scroll-pb":[{"scroll-pb":B()}],"scroll-pl":[{"scroll-pl":B()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",cn,ln]}],fill:[{fill:["none",...W()]}],"stroke-w":[{stroke:[Xn,Ky,cp,CE]}],stroke:[{stroke:["none",...W()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},_ie=(t,{cacheSize:e,prefix:n,experimentalParseClassName:i,extend:a={},override:s={}})=>(vb(t,"cacheSize",e),vb(t,"prefix",n),vb(t,"experimentalParseClassName",i),J2(t.theme,s.theme),J2(t.classGroups,s.classGroups),J2(t.conflictingClassGroups,s.conflictingClassGroups),J2(t.conflictingClassGroupModifiers,s.conflictingClassGroupModifiers),vb(t,"orderSensitiveModifiers",s.orderSensitiveModifiers),e_(t.theme,a.theme),e_(t.classGroups,a.classGroups),e_(t.conflictingClassGroups,a.conflictingClassGroups),e_(t.conflictingClassGroupModifiers,a.conflictingClassGroupModifiers),DB(t,a,"orderSensitiveModifiers"),t),vb=(t,e,n)=>{n!==void 0&&(t[e]=n)},J2=(t,e)=>{if(e)for(const n in e)vb(t,n,e[n])},e_=(t,e)=>{if(e)for(const n in e)DB(t,e,n)},DB=(t,e,n)=>{const i=e[n];i!==void 0&&(t[n]=t[n]?t[n].concat(i):i)},LB=(t,...e)=>typeof t=="function"?JT(e5,t,...e):JT(()=>_ie(e5(),t),...e),Sie=JT(e5);var wie=t=>ao(t)?Sie:LB({...t,extend:{theme:t.theme,classGroups:t.classGroups,conflictingClassGroupModifiers:t.conflictingClassGroupModifiers,conflictingClassGroups:t.conflictingClassGroups,...t.extend}}),Eie=(...t)=>e=>{let n=BS(t);return!n||!e.twMerge?n:((!pd.cachedTwMerge||pd.didTwMergeConfigChange)&&(pd.didTwMergeConfigChange=!1,pd.cachedTwMerge=wie(pd.cachedTwMergeConfig)),pd.cachedTwMerge(n)||void 0)},{tv:Mie}=Hne(Eie),Yi=(t,e)=>{var n,i,a;return Mie(t,{...e,twMerge:(n=void 0)!=null?n:!0,twMergeConfig:{theme:{...(i=void 0)==null?void 0:i.theme,...KT.theme},classGroups:{...(a=void 0)==null?void 0:a.classGroups,...KT.classGroups}}})},wP=Yi({slots:{base:"relative inline-flex flex-col gap-2 items-center justify-center",wrapper:"relative flex",label:"text-foreground dark:text-foreground-dark font-regular",circle1:"absolute w-full h-full rounded-full",circle2:"absolute w-full h-full rounded-full",dots:"relative rounded-full mx-auto",spinnerBars:["absolute","animate-fade-out","rounded-full","w-[25%]","h-[8%]","left-[calc(37.5%)]","top-[calc(46%)]","spinner-bar-animation"]},variants:{size:{sm:{wrapper:"w-5 h-5",circle1:"border-2",circle2:"border-2",dots:"size-1",label:"text-small"},md:{wrapper:"w-8 h-8",circle1:"border-3",circle2:"border-3",dots:"size-1.5",label:"text-medium"},lg:{wrapper:"w-10 h-10",circle1:"border-3",circle2:"border-3",dots:"size-2",label:"text-large"}},color:{current:{circle1:"border-b-current",circle2:"border-b-current",dots:"bg-current",spinnerBars:"bg-current"},white:{circle1:"border-b-white",circle2:"border-b-white",dots:"bg-white",spinnerBars:"bg-white"},default:{circle1:"border-b-default",circle2:"border-b-default",dots:"bg-default",spinnerBars:"bg-default"},primary:{circle1:"border-b-primary",circle2:"border-b-primary",dots:"bg-primary",spinnerBars:"bg-primary"},secondary:{circle1:"border-b-secondary",circle2:"border-b-secondary",dots:"bg-secondary",spinnerBars:"bg-secondary"},success:{circle1:"border-b-success",circle2:"border-b-success",dots:"bg-success",spinnerBars:"bg-success"},warning:{circle1:"border-b-warning",circle2:"border-b-warning",dots:"bg-warning",spinnerBars:"bg-warning"},danger:{circle1:"border-b-danger",circle2:"border-b-danger",dots:"bg-danger",spinnerBars:"bg-danger"}},labelColor:{foreground:{label:"text-foreground"},primary:{label:"text-primary"},secondary:{label:"text-secondary"},success:{label:"text-success"},warning:{label:"text-warning"},danger:{label:"text-danger"}},variant:{default:{circle1:["animate-spinner-ease-spin","border-solid","border-t-transparent","border-l-transparent","border-r-transparent"],circle2:["opacity-75","animate-spinner-linear-spin","border-dotted","border-t-transparent","border-l-transparent","border-r-transparent"]},gradient:{circle1:["border-0","bg-gradient-to-b","from-transparent","via-transparent","to-primary","animate-spinner-linear-spin","[animation-duration:1s]","[-webkit-mask:radial-gradient(closest-side,rgba(0,0,0,0.0)calc(100%-3px),rgba(0,0,0,1)calc(100%-3px))]"],circle2:["hidden"]},wave:{wrapper:"translate-y-3/4",dots:["animate-sway","spinner-dot-animation"]},dots:{wrapper:"translate-y-2/4",dots:["animate-blink","spinner-dot-blink-animation"]},spinner:{},simple:{wrapper:"text-foreground h-5 w-5 animate-spin",circle1:"opacity-25",circle2:"opacity-75"}}},defaultVariants:{size:"md",color:"primary",labelColor:"foreground",variant:"default"},compoundVariants:[{variant:"gradient",color:"current",class:{circle1:"to-current"}},{variant:"gradient",color:"white",class:{circle1:"to-white"}},{variant:"gradient",color:"default",class:{circle1:"to-default"}},{variant:"gradient",color:"primary",class:{circle1:"to-primary"}},{variant:"gradient",color:"secondary",class:{circle1:"to-secondary"}},{variant:"gradient",color:"success",class:{circle1:"to-success"}},{variant:"gradient",color:"warning",class:{circle1:"to-warning"}},{variant:"gradient",color:"danger",class:{circle1:"to-danger"}},{variant:"wave",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"wave",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"wave",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"dots",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"dots",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"dots",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",size:"sm",class:{wrapper:"w-5 h-5"}},{variant:"simple",size:"md",class:{wrapper:"w-8 h-8"}},{variant:"simple",size:"lg",class:{wrapper:"w-12 h-12"}},{variant:"simple",color:"current",class:{wrapper:"text-current"}},{variant:"simple",color:"white",class:{wrapper:"text-white"}},{variant:"simple",color:"default",class:{wrapper:"text-default"}},{variant:"simple",color:"primary",class:{wrapper:"text-primary"}},{variant:"simple",color:"secondary",class:{wrapper:"text-secondary"}},{variant:"simple",color:"success",class:{wrapper:"text-success"}},{variant:"simple",color:"warning",class:{wrapper:"text-warning"}},{variant:"simple",color:"danger",class:{wrapper:"text-danger"}}]}),Go=["outline-solid outline-transparent","data-[focus-visible=true]:z-10","data-[focus-visible=true]:outline-2","data-[focus-visible=true]:outline-focus","data-[focus-visible=true]:outline-offset-2"],uw=["outline-solid outline-transparent","group-data-[focus-visible=true]:z-10","group-data-[focus-visible=true]:ring-2","group-data-[focus-visible=true]:ring-focus","group-data-[focus-visible=true]:ring-offset-2","group-data-[focus-visible=true]:ring-offset-background"],Tie=["outline-solid outline-transparent","ring-2","ring-focus","ring-offset-2","ring-offset-background"],AE=["absolute","top-1/2","left-1/2","-translate-x-1/2","-translate-y-1/2"],P0={default:["[&+.border-medium.border-default]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],primary:["[&+.border-medium.border-primary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],secondary:["[&+.border-medium.border-secondary]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],success:["[&+.border-medium.border-success]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],warning:["[&+.border-medium.border-warning]:ms-[calc(var(--heroui-border-width-medium)*-1)]"],danger:["[&+.border-medium.border-danger]:ms-[calc(var(--heroui-border-width-medium)*-1)]"]},OB=["font-inherit","text-[100%]","leading-[1.15]","m-0","p-0","overflow-visible","box-border","absolute","top-0","w-full","h-full","opacity-[0.0001]","z-[1]","cursor-pointer","disabled:cursor-default"],EP=Yi({slots:{base:"inline-flex",tabList:["relative","flex","p-1","h-fit","gap-2","items-center","flex-nowrap","overflow-x-scroll","scrollbar-hide","bg-default-100"],tab:["z-0","w-full","px-3","py-1","flex","group","relative","justify-center","items-center","outline-solid outline-transparent","cursor-pointer","transition-opacity","tap-highlight-transparent","data-[disabled=true]:cursor-not-allowed","data-[disabled=true]:opacity-30","data-[hover-unselected=true]:opacity-disabled",...Go],tabContent:["relative","z-10","text-inherit","whitespace-nowrap","transition-colors","text-default-500","group-data-[selected=true]:text-foreground"],cursor:["absolute","z-0","bg-white","will-change-[transform,width,height]","transition-[left,top,width,height]","duration-250","ease-out"],panel:["py-3","px-1","outline-solid outline-transparent","data-[inert=true]:hidden",...Go],tabWrapper:[]},variants:{variant:{solid:{cursor:"inset-0"},light:{tabList:"bg-transparent dark:bg-transparent",cursor:"inset-0"},underlined:{tabList:"bg-transparent dark:bg-transparent",cursor:"h-[2px] w-[80%] bottom-0 shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]"},bordered:{tabList:"bg-transparent dark:bg-transparent border-medium border-default-200 shadow-xs",cursor:"inset-0"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{tabList:"rounded-medium",tab:"h-7 text-tiny rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"h-8 text-small rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"h-9 text-medium rounded-medium",cursor:"rounded-medium"}},radius:{none:{tabList:"rounded-none",tab:"rounded-none",cursor:"rounded-none"},sm:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},md:{tabList:"rounded-medium",tab:"rounded-small",cursor:"rounded-small"},lg:{tabList:"rounded-large",tab:"rounded-medium",cursor:"rounded-medium"},full:{tabList:"rounded-full",tab:"rounded-full",cursor:"rounded-full"}},fullWidth:{true:{base:"w-full",tabList:"w-full"}},isDisabled:{true:{tabList:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{tab:"transition-none",tabContent:"transition-none"}},placement:{top:{},start:{tabList:"flex-col",panel:"py-0 px-3",tabWrapper:"flex"},end:{tabList:"flex-col",panel:"py-0 px-3",tabWrapper:"flex flex-row-reverse"},bottom:{tabWrapper:"flex flex-col-reverse"}}},defaultVariants:{color:"default",variant:"solid",size:"md",fullWidth:!1,isDisabled:!1},compoundVariants:[{variant:["solid","bordered","light"],color:"default",class:{cursor:["bg-background","dark:bg-default","shadow-small"],tabContent:"group-data-[selected=true]:text-default-foreground"}},{variant:["solid","bordered","light"],color:"primary",class:{cursor:Ct.solid.primary,tabContent:"group-data-[selected=true]:text-primary-foreground"}},{variant:["solid","bordered","light"],color:"secondary",class:{cursor:Ct.solid.secondary,tabContent:"group-data-[selected=true]:text-secondary-foreground"}},{variant:["solid","bordered","light"],color:"success",class:{cursor:Ct.solid.success,tabContent:"group-data-[selected=true]:text-success-foreground"}},{variant:["solid","bordered","light"],color:"warning",class:{cursor:Ct.solid.warning,tabContent:"group-data-[selected=true]:text-warning-foreground"}},{variant:["solid","bordered","light"],color:"danger",class:{cursor:Ct.solid.danger,tabContent:"group-data-[selected=true]:text-danger-foreground"}},{variant:"underlined",color:"default",class:{cursor:"bg-foreground",tabContent:"group-data-[selected=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{cursor:"bg-primary",tabContent:"group-data-[selected=true]:text-primary"}},{variant:"underlined",color:"secondary",class:{cursor:"bg-secondary",tabContent:"group-data-[selected=true]:text-secondary"}},{variant:"underlined",color:"success",class:{cursor:"bg-success",tabContent:"group-data-[selected=true]:text-success"}},{variant:"underlined",color:"warning",class:{cursor:"bg-warning",tabContent:"group-data-[selected=true]:text-warning"}},{variant:"underlined",color:"danger",class:{cursor:"bg-danger",tabContent:"group-data-[selected=true]:text-danger"}},{disableAnimation:!0,variant:"underlined",class:{tab:["after:content-['']","after:absolute","after:bottom-0","after:h-[2px]","after:w-[80%]","after:opacity-0","after:shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","data-[selected=true]:after:opacity-100"]}},{disableAnimation:!0,color:"default",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-default data-[selected=true]:text-default-foreground"}},{disableAnimation:!0,color:"primary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-primary data-[selected=true]:text-primary-foreground"}},{disableAnimation:!0,color:"secondary",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-secondary data-[selected=true]:text-secondary-foreground"}},{disableAnimation:!0,color:"success",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-success data-[selected=true]:text-success-foreground"}},{disableAnimation:!0,color:"warning",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-warning data-[selected=true]:text-warning-foreground"}},{disableAnimation:!0,color:"danger",variant:["solid","bordered","light"],class:{tab:"data-[selected=true]:bg-danger data-[selected=true]:text-danger-foreground"}},{disableAnimation:!0,color:"default",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-foreground"}},{disableAnimation:!0,color:"primary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-primary"}},{disableAnimation:!0,color:"secondary",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-secondary"}},{disableAnimation:!0,color:"success",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-success"}},{disableAnimation:!0,color:"warning",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-warning"}},{disableAnimation:!0,color:"danger",variant:"underlined",class:{tab:"data-[selected=true]:after:bg-danger"}}],compoundSlots:[{variant:"underlined",slots:["tab","tabList","cursor"],class:["rounded-none"]}]}),Cie=Yi({slots:{base:"relative z-[100]"},variants:{disableAnimation:{false:{base:""},true:{base:["data-[placement=bottom-right]:bottom-0 data-[placement=bottom-right]:right-0 w-full px-2 sm:w-auto sm:px-0 data-[placement=bottom-right]:fixed data-[placement=bottom-right]:flex data-[placement=bottom-right]:flex-col","data-[placement=bottom-left]:bottom-0 data-[placement=bottom-left]:left-0 w-full px-2 sm:w-auto sm:px-0 data-[placement=bottom-left]:fixed data-[placement=bottom-left]:flex data-[placement=bottom-left]:flex-col","data-[placement=bottom-center]:bottom-0 data-[placement=bottom-center]:fixed w-full px-2 sm:w-auto sm:px-0 data-[placement=bottom-center]:flex data-[placement=bottom-center]:flex-col data-[placement=bottom-center]:left-1/2 data-[placement=bottom-center]:-translate-x-1/2","data-[placement=top-right]:top-0 data-[placement=top-right]:right-0 w-full px-2 sm:w-auto sm:px-0 data-[placement=top-right]:fixed data-[placement=top-right]:flex data-[placement=top-right]:flex-col","data-[placement=top-left]:top-0 data-[placement=top-left]:left-0 w-full px-2 sm:w-auto sm:px-0 data-[placement=top-left]:fixed data-[placement=top-left]:flex data-[placement=top-left]:flex-col","data-[placement=top-center]:top-0 data-[placement=top-center]:fixed w-full px-2 sm:w-auto sm:px-0 data-[placement=top-center]:flex data-[placement=top-center]:flex-col data-[placement=top-center]:left-1/2 data-[placement=top-center]:-translate-x-1/2"]}}},defaultVariants:{disableAnimation:!1}}),MP=Yi({slots:{base:["flex gap-x-4 items-center","group","cursor-pointer","relative","z-50","box-border","outline-solid outline-transparent","p-3 sm:mx-1","my-1","w-full sm:w-[356px]","min-h-4","before:content-['']","before:absolute","before:left-0","before:right-0","data-[placement=bottom-right]:before:h-[var(--top-extension,16px)]","data-[placement=bottom-left]:before:h-[var(--top-extension,16px)]","data-[placement=bottom-center]:before:h-[var(--top-extension,16px)]","data-[placement=bottom-right]:before:top-[calc(-1*var(--top-extension,16px))]","data-[placement=bottom-left]:before:top-[calc(-1*var(--top-extension,16px))]","data-[placement=bottom-center]:before:top-[calc(-1*var(--top-extension,16px))]","before:z-[-1]","before:pointer-events-auto","before:bg-transparent","after:content-['']","after:absolute","after:left-0","after:right-0","data-[placement=bottom-right]:after:h-[var(--bottom-extension,16px)]","data-[placement=bottom-left]:after:h-[var(--bottom-extension,16px)]","data-[placement=bottom-center]:after:h-[var(--bottom-extension,16px)]","data-[placement=bottom-right]:after:bottom-[calc(-1*var(--bottom-extension,16px))]","data-[placement=bottom-left]:after:bottom-[calc(-1*var(--bottom-extension,16px))]","data-[placement=bottom-center]:after:bottom-[calc(-1*var(--bottom-extension,16px))]","after:z-[-1]","after:pointer-events-auto","after:bg-transparent","transform-gpu","will-change-transform","backface-visibility-hidden"],wrapper:["flex flex-col gap-y-0"],title:["text-sm","me-4","font-medium","text-foreground"],description:["text-sm","me-4","text-default-500"],icon:["w-6 h-6 flex-none fill-current"],loadingComponent:["w-6 h-6 flex-none fill-current"],content:["flex flex-grow flex-row gap-x-4 items-center relative"],progressTrack:["absolute inset-0 pointer-events-none bg-transparent overflow-hidden"],progressIndicator:["h-full bg-default-400 opacity-20"],motionDiv:["fixed","px-4 sm:px-0","data-[placement=bottom-right]:bottom-0 data-[placement=bottom-right]:right-0 data-[placement=bottom-right]:mx-auto w-full sm:data-[placement=bottom-right]:w-max mb-1 sm:data-[placement=bottom-right]:mr-2","data-[placement=bottom-left]:bottom-0 data-[placement=bottom-left]:left-0 data-[placement=bottom-left]:mx-auto w-full sm:data-[placement=bottom-left]:w-max mb-1 sm:data-[placement=bottom-left]:ml-2","data-[placement=bottom-center]:bottom-0 data-[placement=bottom-center]:left-0 data-[placement=bottom-center]:right-0 w-full sm:data-[placement=bottom-center]:w-max sm:data-[placement=bottom-center]:mx-auto","data-[placement=top-right]:top-0 data-[placement=top-right]:right-0 data-[placement=top-right]:mx-auto w-full sm:data-[placement=top-right]:w-max sm:data-[placement=top-right]:mr-2","data-[placement=top-left]:top-0 data-[placement=top-left]:left-0 data-[placement=top-left]:mx-auto w-full sm:data-[placement=top-left]:w-max sm:data-[placement=top-left]:ml-2","data-[placement=top-center]:top-0 data-[placement=top-center]:left-0 data-[placement=top-center]:right-0 w-full sm:data-[placement=top-center]:w-max sm:data-[placement=top-center]:mx-auto"],closeButton:["opacity-0 group-hover:opacity-100","transform-gpu","transition-all duration-200 ease-out","will-change-opacity will-change-transform","p-0 group-hover:pointer-events-auto w-6 h-6 min-w-4 absolute -right-2 -top-2 items-center justify-center bg-transparent text-default-400 hover:text-default-600 border border-3 border-transparent","data-[hidden=true]:hidden"],closeIcon:["rounded-full w-full h-full p-0.5 border border-default-400 bg-default-100"]},variants:{size:{sm:{icon:"w-5 h-5",loadingComponent:"w-5 h-5"},md:{},lg:{}},variant:{flat:"bg-content1 border border-default-100",solid:Ct.solid.default,bordered:"bg-background border border-default-200"},color:{default:"",foreground:{progressIndicator:"h-full opacity-20 bg-foreground-400"},primary:{progressIndicator:"h-full opacity-20 bg-primary-400"},secondary:{progressIndicator:"h-full opacity-20 bg-secondary-400"},success:{progressIndicator:"h-full opacity-20 bg-success-400"},warning:{progressIndicator:"h-full opacity-20 bg-warning-400"},danger:{progressIndicator:"h-full opacity-20 bg-danger-400"}},radius:{none:{base:"rounded-none",progressTrack:"rounded-none"},sm:{base:"rounded-small",progressTrack:"rounded-small"},md:{base:"rounded-medium",progressTrack:"rounded-medium"},lg:{base:"rounded-large",progressTrack:"rounded-large"},full:{base:"rounded-full",closeButton:"-top-px -right-px",progressTrack:"rounded-full"}},disableAnimation:{true:{closeButton:"transition-none",base:"data-[animation=exiting]:opacity-0 transition-none"},false:{closeButton:"transition-all ease-out duration-200",base:["data-[toast-exiting=true]:transform-gpu","data-[toast-exiting=true]:will-change-transform","data-[toast-exiting=true]:transition-all","data-[toast-exiting=true]:ease-out","data-[toast-exiting=true]:data-[placement=bottom-right]:translate-x-full","data-[toast-exiting=true]:data-[placement=bottom-left]:-translate-x-full","data-[toast-exiting=true]:data-[placement=bottom-center]:translate-y-full","data-[toast-exiting=true]:data-[placement=top-right]:translate-x-full","data-[toast-exiting=true]:data-[placement=top-left]:-translate-x-full","data-[toast-exiting=true]:data-[placement=top-center]:-translate-y-full","data-[toast-exiting=true]:opacity-0","data-[toast-exiting=true]:duration-300","data-[toast-exiting=true]:ease-out"]}},shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}}},defaultVariants:{size:"md",variant:"flat",radius:"md",shadow:"sm"},compoundVariants:[{variant:"flat",color:"foreground",class:{base:"bg-foreground text-background",closeButton:"text-foreground-400 hover:text-foreground-600",closeIcon:"border border-foreground-400 bg-foreground-100",title:"text-background-600",description:"text-background-500"}},{variant:"flat",color:"primary",class:{base:"bg-primary-50 text-primary-600 border-primary-100",closeButton:"text-primary-400 hover:text-primary-600",closeIcon:"border border-primary-400 bg-primary-100",title:"text-primary-600",description:"text-primary-500"}},{variant:"flat",color:"secondary",class:{base:"bg-secondary-50 text-secondary-600 border-secondary-100",closeButton:"text-secondary-400 hover:text-secondary-600",closeIcon:"border border-secondary-400 bg-secondary-100",title:"text-secondary-600",description:"text-secondary-500"}},{variant:"flat",color:"success",class:{base:"bg-success-50 text-success-600 border-success-100",closeButton:"text-success-400 hover:text-success-600",closeIcon:"border border-success-400 bg-success-100",title:"text-success-600",description:"text-success-500"}},{variant:"flat",color:"warning",class:{base:"bg-warning-50 text-warning-600 border-warning-100",closeButton:"text-warning-400 hover:text-warning-600",closeIcon:"border border-warning-400 bg-warning-100",title:"text-warning-600",description:"text-warning-500"}},{variant:"flat",color:"danger",class:{base:"bg-danger-50 text-danger-600 border-danger-100",closeButton:"text-danger-400 hover:text-danger-600",closeIcon:"border border-danger-400 bg-danger-100",title:"text-danger-600",description:"text-danger-500"}},{variant:"bordered",color:"foreground",class:{base:"bg-foreground border-foreground-400 text-background",closeButton:"text-foreground-400 hover:text-foreground-600",closeIcon:"border border-foreground-400 bg-foreground-100",title:"text-background-600",description:"text-background-500"}},{variant:"bordered",color:"primary",class:{base:"border-primary-400 text-primary-600",closeButton:"text-primary-400 hover:text-primary-600",closeIcon:"border border-primary-400 bg-primary-100",title:"text-primary-600",description:"text-primary-500"}},{variant:"bordered",color:"secondary",class:{base:"border-secondary-400 text-secondary-600",closeButton:"text-secondary-400 hover:text-secondary-600",closeIcon:"border border-secondary-400 bg-secondary-100",title:"text-secondary-600",description:"text-secondary-500"}},{variant:"bordered",color:"success",class:{base:"border-success-400 text-success-600",closeButton:"text-success-400 hover:text-success-600",closeIcon:"border border-success-400 bg-success-100",title:"text-success-600",description:"text-success-500"}},{variant:"bordered",color:"warning",class:{base:"border-warning-400 text-warning-600",closeButton:"text-warning-400 hover:text-warning-600",closeIcon:"border border-warning-400 bg-warning-100",title:"text-warning-600",description:"text-warning-500"}},{variant:"bordered",color:"danger",class:{base:"border-danger-400 text-danger-600",closeButton:"text-danger-400 hover:text-danger-600",closeIcon:"border border-danger-400 bg-danger-100",title:"text-danger-600",description:"text-danger-500"}},{variant:"solid",color:"foreground",class:{base:Ct.solid.foreground,closeButton:"text-foreground-400 hover:text-foreground-600",closeIcon:"border border-foreground-400 bg-foreground-100",title:"text-background",description:"text-background"}},{variant:"solid",color:"primary",class:{base:Ct.solid.primary,closeButton:"text-primary-400 hover:text-primary-600",closeIcon:"border border-primary-400 bg-primary-100",title:"text-primary-foreground",description:"text-primary-foreground"}},{variant:"solid",color:"secondary",class:{base:Ct.solid.secondary,closeButton:"text-secondary-400 hover:text-secondary-600",closeIcon:"border border-secondary-400 bg-secondary-100",title:"text-secondary-foreground",description:"text-secondary-foreground"}},{variant:"solid",color:"success",class:{base:Ct.solid.success,closeButton:"text-success-400 hover:text-success-600",closeIcon:"border border-success-400 bg-success-100",title:"text-success-foreground",description:"text-success-foreground"}},{variant:"solid",color:"warning",class:{base:Ct.solid.warning,closeButton:"text-warning-400 hover:text-warning-600",closeIcon:"border border-warning-400 bg-warning-100",title:"text-warning-foreground",description:"text-warning-foreground"}},{variant:"solid",color:"danger",class:{base:Ct.solid.danger,closeButton:"text-danger-400 hover:text-danger-600",closeIcon:"border border-danger-400 bg-danger-100",title:"text-danger-foreground",description:"text-danger-foreground"}}]}),TP=Yi({slots:{base:"group relative max-w-fit inline-flex items-center justify-start cursor-pointer touch-none tap-highlight-transparent select-none",wrapper:["px-1","relative","inline-flex","items-center","justify-start","shrink-0","overflow-hidden","bg-default-200","rounded-full",...uw],thumb:["z-10","flex","items-center","justify-center","bg-white","shadow-small","rounded-full","origin-right","pointer-events-none"],hiddenInput:OB,startContent:"z-0 absolute start-1.5 text-current",endContent:"z-0 absolute end-1.5 text-default-600",thumbIcon:"text-black",label:"relative text-foreground select-none ms-2"},variants:{color:{default:{wrapper:["group-data-[selected=true]:bg-default-400","group-data-[selected=true]:text-default-foreground"]},primary:{wrapper:["group-data-[selected=true]:bg-primary","group-data-[selected=true]:text-primary-foreground"]},secondary:{wrapper:["group-data-[selected=true]:bg-secondary","group-data-[selected=true]:text-secondary-foreground"]},success:{wrapper:["group-data-[selected=true]:bg-success","group-data-[selected=true]:text-success-foreground"]},warning:{wrapper:["group-data-[selected=true]:bg-warning","group-data-[selected=true]:text-warning-foreground"]},danger:{wrapper:["group-data-[selected=true]:bg-danger","data-[selected=true]:text-danger-foreground"]}},size:{sm:{wrapper:"w-10 h-6",thumb:["w-4 h-4 text-tiny","group-data-[selected=true]:ms-4"],endContent:"text-tiny",startContent:"text-tiny",label:"text-small"},md:{wrapper:"w-12 h-7",thumb:["w-5 h-5 text-small","group-data-[selected=true]:ms-5"],endContent:"text-small",startContent:"text-small",label:"text-medium"},lg:{wrapper:"w-14 h-8",thumb:["w-6 h-6 text-medium","group-data-[selected=true]:ms-6"],endContent:"text-medium",startContent:"text-medium",label:"text-large"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{wrapper:"transition-none",thumb:"transition-none"},false:{wrapper:"transition-background",thumb:"transition-all",startContent:["opacity-0","scale-50","transition-transform-opacity","group-data-[selected=true]:scale-100","group-data-[selected=true]:opacity-100"],endContent:["opacity-100","transition-transform-opacity","group-data-[selected=true]:translate-x-3","group-data-[selected=true]:opacity-0"]}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1},compoundVariants:[{disableAnimation:!1,size:"sm",class:{thumb:["group-data-[pressed=true]:w-5","group-data-[selected]:group-data-[pressed]:ml-3"]}},{disableAnimation:!1,size:"md",class:{thumb:["group-data-[pressed=true]:w-6","group-data-[selected]:group-data-[pressed]:ml-4"]}},{disableAnimation:!1,size:"lg",class:{thumb:["group-data-[pressed=true]:w-7","group-data-[selected]:group-data-[pressed]:ml-5"]}}]}),US=Yi({slots:{base:["z-0","relative","bg-transparent","[transform-origin:var(--trigger-anchor-point)]","before:content-['']","before:hidden","before:z-[-1]","before:absolute","before:rotate-45","before:w-2.5","before:h-2.5","before:rounded-sm","data-[arrow=true]:before:block","data-[placement=top]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top]:before:left-1/2","data-[placement=top]:before:-translate-x-1/2","data-[placement=top-start]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-start]:before:left-3","data-[placement=top-end]:before:-bottom-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=top-end]:before:right-3","data-[placement=bottom]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom]:before:left-1/2","data-[placement=bottom]:before:-translate-x-1/2","data-[placement=bottom-start]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-start]:before:left-3","data-[placement=bottom-end]:before:-top-[calc(theme(spacing.5)/4_-_1.5px)]","data-[placement=bottom-end]:before:right-3","data-[placement=left]:before:-right-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=left]:before:top-1/2","data-[placement=left]:before:-translate-y-1/2","data-[placement=left-start]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-start]:before:top-1/4","data-[placement=left-end]:before:-right-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=left-end]:before:bottom-1/4","data-[placement=right]:before:-left-[calc(theme(spacing.5)/4_-_2px)]","data-[placement=right]:before:top-1/2","data-[placement=right]:before:-translate-y-1/2","data-[placement=right-start]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-start]:before:top-1/4","data-[placement=right-end]:before:-left-[calc(theme(spacing.5)/4_-_3px)]","data-[placement=right-end]:before:bottom-1/4",...Go],content:["z-10","px-2.5","py-1","w-full","inline-flex","flex-col","items-center","justify-center","box-border","subpixel-antialiased","outline-solid outline-transparent","box-border"],trigger:["z-10"],backdrop:["hidden"],arrow:[]},variants:{size:{sm:{content:"text-tiny"},md:{content:"text-small"},lg:{content:"text-medium"}},color:{default:{base:"before:bg-content1 before:shadow-small",content:"bg-content1"},foreground:{base:"before:bg-foreground",content:Ct.solid.foreground},primary:{base:"before:bg-primary",content:Ct.solid.primary},secondary:{base:"before:bg-secondary",content:Ct.solid.secondary},success:{base:"before:bg-success",content:Ct.solid.success},warning:{base:"before:bg-warning",content:Ct.solid.warning},danger:{base:"before:bg-danger",content:Ct.solid.danger}},radius:{none:{content:"rounded-none"},sm:{content:"rounded-small"},md:{content:"rounded-medium"},lg:{content:"rounded-large"},full:{content:"rounded-full"}},shadow:{none:{content:"shadow-none"},sm:{content:"shadow-small"},md:{content:"shadow-medium"},lg:{content:"shadow-large"}},backdrop:{transparent:{},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-sm backdrop-saturate-150 bg-overlay/30"}},triggerScaleOnOpen:{true:{trigger:["aria-expanded:scale-[0.97]","aria-expanded:opacity-70","subpixel-antialiased"]},false:{}},disableAnimation:{true:{base:"animate-none"}},isTriggerDisabled:{true:{trigger:"opacity-disabled pointer-events-none"},false:{}}},defaultVariants:{color:"default",radius:"lg",size:"md",shadow:"md",backdrop:"transparent",triggerScaleOnOpen:!0},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"block w-full h-full fixed inset-0 -z-30"}}]}),Aie=["data-[top-scroll=true]:[mask-image:linear-gradient(0deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[bottom-scroll=true]:[mask-image:linear-gradient(180deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[top-bottom-scroll=true]:[mask-image:linear-gradient(#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],Rie=["data-[left-scroll=true]:[mask-image:linear-gradient(270deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[right-scroll=true]:[mask-image:linear-gradient(90deg,#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]","data-[left-right-scroll=true]:[mask-image:linear-gradient(to_right,#000,#000,transparent_0,#000_var(--scroll-shadow-size),#000_calc(100%_-_var(--scroll-shadow-size)),transparent)]"],jS=Yi({base:[],variants:{orientation:{vertical:["overflow-y-auto",...Aie],horizontal:["overflow-x-auto",...Rie]},hideScrollBar:{true:"scrollbar-hide",false:""}},defaultVariants:{orientation:"vertical",hideScrollBar:!1}}),CP=Yi({slots:{base:["group inline-flex flex-col relative"],label:["block","absolute","z-10","origin-top-left","flex-shrink-0","rtl:origin-top-right","subpixel-antialiased","text-small","text-foreground-500","pointer-events-none","group-data-[has-label-outside=true]:pointer-events-auto"],mainWrapper:"w-full flex flex-col",trigger:"relative px-3 gap-3 w-full inline-flex flex-row items-center shadow-xs outline-solid outline-transparent tap-highlight-transparent",innerWrapper:"inline-flex h-fit w-[calc(100%_-theme(spacing.6))] min-h-4 items-center gap-1.5 box-border",selectorIcon:"absolute end-3 w-4 h-4",spinner:"absolute end-3",value:["text-foreground-500","font-normal","w-full","text-start"],listboxWrapper:"scroll-py-6 w-full",listbox:"",popoverContent:"w-full p-1 overflow-hidden",clearButton:["w-4","h-4","z-10","mb-4","relative","start-auto","appearance-none","outline-none","select-none","opacity-70","hover:!opacity-100","cursor-pointer","active:!opacity-70","rounded-full",...Go],helperWrapper:"p-1 flex relative flex-col gap-1.5 group-data-[has-helper=true]:flex",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger",endWrapper:"flex end-18",endContent:"mb-4"},variants:{variant:{flat:{trigger:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-200"],clearButton:"mb-4"},faded:{trigger:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 data-[focus=true]:border-default-400 data-[open=true]:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},bordered:{trigger:["border-medium","border-default-200","data-[hover=true]:border-default-400","data-[open=true]:border-default-foreground","data-[focus=true]:border-default-foreground"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4"},underlined:{trigger:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","data-[open=true]:after:w-full","data-[focus=true]:after:w-full"],value:"group-data-[has-value=true]:text-default-foreground",clearButton:"mb-4 me-2"}},color:{default:{},primary:{selectorIcon:"text-primary"},secondary:{selectorIcon:"text-secondary"},success:{selectorIcon:"text-success"},warning:{selectorIcon:"text-warning"},danger:{selectorIcon:"text-danger"}},size:{sm:{label:"text-tiny",trigger:"h-8 min-h-8 px-2 rounded-small",value:"text-small",clearButton:"text-medium"},md:{trigger:"h-10 min-h-10 rounded-medium",value:"text-small",clearButton:"text-large"},lg:{trigger:"h-12 min-h-12 rounded-large",value:"text-medium",clearButton:"mb-5 text-large"}},radius:{none:{trigger:"rounded-none"},sm:{trigger:"rounded-small"},md:{trigger:"rounded-medium"},lg:{trigger:"rounded-large"},full:{trigger:"rounded-full"}},labelPlacement:{outside:{base:"flex flex-col",clearButton:"mb-0"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",label:"relative pe-2 text-foreground",clearButton:"mb-0"},inside:{label:"text-tiny cursor-pointer",trigger:"flex-col items-start justify-center gap-0"}},fullWidth:{true:{base:"w-full"},false:{base:"min-w-40"}},isClearable:{true:{clearButton:"peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block",endContent:"ms-3"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",trigger:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",value:"!text-danger",selectorIcon:"text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",trigger:"!h-auto"},false:{value:"truncate"}},disableAnimation:{true:{trigger:"after:transition-none",base:"transition-none",label:"transition-none",selectorIcon:"transition-none"},false:{base:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","origin-top-left","rtl:origin-top-right","!duration-200","!ease-out","transition-[transform,color,left,opacity,translate,scale]","motion-reduce:transition-none"],selectorIcon:"transition-transform duration-150 ease motion-reduce:transition-none",clearButton:["transition-opacity","motion-reduce:transition-none"]}},disableSelectorIconRotation:{true:{},false:{selectorIcon:"data-[open=true]:rotate-180"}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1,disableSelectorIconRotation:!1},compoundVariants:[{variant:"flat",color:"default",class:{value:"group-data-[has-value=true]:text-default-foreground",trigger:["bg-default-100","data-[hover=true]:bg-default-200"]}},{variant:"flat",color:"primary",class:{trigger:["bg-primary-100","text-primary","data-[hover=true]:bg-primary-50","group-data-[focus=true]:bg-primary-50"],value:"text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{trigger:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50"],value:"text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{trigger:["bg-success-100","text-success-600","dark:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],value:"text-success-600 dark:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{trigger:["bg-warning-100","text-warning-600","dark:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],value:"text-warning-600 dark:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{trigger:["bg-danger-100","text-danger","dark:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],value:"text-danger dark:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{trigger:"data-[hover=true]:border-primary data-[focus=true]:border-primary data-[open=true]:border-primary",label:"text-primary"}},{variant:"faded",color:"secondary",class:{trigger:"data-[hover=true]:border-secondary data-[focus=true]:border-secondary data-[open=true]:border-secondary",label:"text-secondary"}},{variant:"faded",color:"success",class:{trigger:"data-[hover=true]:border-success data-[focus=true]:border-success data-[open=true]:border-success",label:"text-success"}},{variant:"faded",color:"warning",class:{trigger:"data-[hover=true]:border-warning data-[focus=true]:border-warning data-[open=true]:border-warning",label:"text-warning"}},{variant:"faded",color:"danger",class:{trigger:"data-[hover=true]:border-danger data-[focus=true]:border-danger data-[open=true]:border-danger",label:"text-danger"}},{variant:"underlined",color:"default",class:{value:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{trigger:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{trigger:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{trigger:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{trigger:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{trigger:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{trigger:["data-[open=true]:border-primary","data-[focus=true]:border-primary"],label:"text-primary"}},{variant:"bordered",color:"secondary",class:{trigger:["data-[open=true]:border-secondary","data-[focus=true]:border-secondary"],label:"text-secondary"}},{variant:"bordered",color:"success",class:{trigger:["data-[open=true]:border-success","data-[focus=true]:border-success"],label:"text-success"}},{variant:"bordered",color:"warning",class:{trigger:["data-[open=true]:border-warning","data-[focus=true]:border-warning"],label:"text-warning"}},{variant:"bordered",color:"danger",class:{trigger:["data-[open=true]:border-danger","data-[focus=true]:border-danger"],label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled=true]:text-foreground"}},{radius:"full",size:["sm"],class:{trigger:"px-3"}},{radius:"full",size:"md",class:{trigger:"px-4"}},{radius:"full",size:"lg",class:{trigger:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{trigger:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{trigger:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{trigger:[...Go]}},{isInvalid:!0,variant:"flat",class:{trigger:["bg-danger-50","data-[hover=true]:bg-danger-100","group-data-[focus=true]:bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{trigger:"!border-danger group-data-[focus=true]:border-danger"}},{isInvalid:!0,variant:"underlined",class:{trigger:"after:bg-danger"}},{labelPlacement:"inside",size:"sm",class:{trigger:"h-12 min-h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{trigger:"h-14 min-h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{label:"text-medium",trigger:"h-16 min-h-16 py-2.5 gap-0"}},{labelPlacement:"outside",isMultiline:!1,class:{base:"group relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled=true]:start-0"]}},{labelPlacement:["inside"],class:{label:"group-data-[filled=true]:scale-85"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"],innerWrapper:"group-data-[has-label=true]:pt-4"}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"],innerWrapper:"group-data-[has-label=true]:pt-5"}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled=true]:-translate-y-[calc(100%_+var(--heroui-font-size-tiny)/2_+_16px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_26px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"md",class:{label:["start-3","text-small","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_30px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",isMultiline:!1,size:"lg",class:{label:["start-3","text-medium","group-data-[filled=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]","group-data-[has-helper=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_34px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{labelPlacement:["outside","outside-left"],isClearable:!0,class:{endContent:["mt-4"],clearButton:["group-data-[has-end-content=true]:mt-4"]}},{isClearable:!1,labelPlacement:["outside","outside-left"],class:{endContent:["mt-4"]}},{isClearable:!0,variant:["underlined"],class:{clearButton:["relative group-data-[has-end-content=true]:left-2"],endContent:["me-2"]}},{isClearable:!1,variant:["underlined"],class:{endContent:["me-2"]}},{isClearable:!0,size:"sm",class:{endContent:"ms-2"}}]}),AP=Yi({slots:{base:"group flex flex-col data-[hidden=true]:hidden",label:["absolute","z-10","pointer-events-none","origin-top-left","shrink-0","rtl:origin-top-right","subpixel-antialiased","block","text-small","text-foreground-500"],mainWrapper:"h-full",inputWrapper:"relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-xs px-3 gap-3",innerWrapper:"inline-flex w-full items-center h-full box-border",input:["w-full font-normal bg-transparent !outline-solid outline-transparent placeholder:text-foreground-500 focus-visible:outline-solid outline-transparent","data-[has-start-content=true]:ps-1.5","data-[has-end-content=true]:pe-1.5","data-[type=color]:rounded-none","file:cursor-pointer file:bg-transparent file:border-0","autofill:bg-transparent bg-clip-text"],clearButton:["p-2","-m-2","z-10","absolute","end-3","start-auto","pointer-events-none","appearance-none","outline-solid outline-transparent","select-none","opacity-0","cursor-pointer","active:!opacity-70","rounded-full",...Go],helperWrapper:"hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger"},variants:{variant:{flat:{inputWrapper:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-100"]},faded:{inputWrapper:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 focus-within:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground"},bordered:{inputWrapper:["border-medium","border-default-200","data-[hover=true]:border-default-400","group-data-[focus=true]:border-default-foreground"]},underlined:{inputWrapper:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","group-data-[focus=true]:after:w-full"],innerWrapper:"pb-1",label:"group-data-[filled-within=true]:text-foreground"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},size:{sm:{label:"text-tiny",inputWrapper:"h-8 min-h-8 px-2 rounded-small",input:"text-small",clearButton:"text-medium"},md:{inputWrapper:"h-10 min-h-10 rounded-medium",input:"text-small",clearButton:"text-large hover:!opacity-100"},lg:{label:"text-medium",inputWrapper:"h-12 min-h-12 rounded-large",input:"text-medium",clearButton:"text-large hover:!opacity-100"}},radius:{none:{inputWrapper:"rounded-none"},sm:{inputWrapper:"rounded-small"},md:{inputWrapper:"rounded-medium"},lg:{inputWrapper:"rounded-large"},full:{inputWrapper:"rounded-full"}},labelPlacement:{outside:{mainWrapper:"flex flex-col"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",inputWrapper:"flex-1",mainWrapper:"flex flex-col",label:"relative text-foreground pe-2 ps-2 pointer-events-auto"},"outside-top":{mainWrapper:"flex flex-col",label:"relative text-foreground pb-2 pointer-events-auto"},inside:{label:"cursor-text",inputWrapper:"flex-col items-start justify-center gap-0",innerWrapper:"group-data-[has-label=true]:items-end"}},fullWidth:{true:{base:"w-full"},false:{}},isClearable:{true:{input:"peer pe-6 input-search-cancel-button-none",clearButton:["peer-data-[filled=true]:pointer-events-auto","peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block","peer-data-[filled=true]:scale-100"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",inputWrapper:"pointer-events-none",label:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",input:"!placeholder:text-danger !text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},isMultiline:{true:{label:"relative",inputWrapper:"!h-auto",innerWrapper:"items-start group-data-[has-label=true]:items-start",input:"resize-none data-[hide-scroll=true]:scrollbar-hide",clearButton:"absolute top-2 right-2 rtl:right-auto rtl:left-2 z-10"}},disableAnimation:{true:{input:"transition-none",inputWrapper:"transition-none",label:"transition-none"},false:{inputWrapper:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","!duration-200","!ease-out","motion-reduce:transition-none","transition-[transform,color,left,opacity,translate,scale]"],clearButton:["scale-90","ease-out","duration-150","transition-[opacity,transform]","motion-reduce:transition-none","motion-reduce:scale-100"]}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,isDisabled:!1,isMultiline:!1},compoundVariants:[{variant:"flat",color:"default",class:{input:"group-data-[has-value=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{inputWrapper:["bg-primary-100","data-[hover=true]:bg-primary-50","text-primary","group-data-[focus=true]:bg-primary-50","placeholder:text-primary"],input:"placeholder:text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{inputWrapper:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50","placeholder:text-secondary"],input:"placeholder:text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{inputWrapper:["bg-success-100","text-success-600","dark:text-success","placeholder:text-success-600","dark:placeholder:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],input:"placeholder:text-success-600 dark:placeholder:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{inputWrapper:["bg-warning-100","text-warning-600","dark:text-warning","placeholder:text-warning-600","dark:placeholder:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],input:"placeholder:text-warning-600 dark:placeholder:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{inputWrapper:["bg-danger-100","text-danger","dark:text-danger-500","placeholder:text-danger","dark:placeholder:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],input:"placeholder:text-danger dark:placeholder:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{label:"text-primary",inputWrapper:"data-[hover=true]:border-primary focus-within:border-primary"}},{variant:"faded",color:"secondary",class:{label:"text-secondary",inputWrapper:"data-[hover=true]:border-secondary focus-within:border-secondary"}},{variant:"faded",color:"success",class:{label:"text-success",inputWrapper:"data-[hover=true]:border-success focus-within:border-success"}},{variant:"faded",color:"warning",class:{label:"text-warning",inputWrapper:"data-[hover=true]:border-warning focus-within:border-warning"}},{variant:"faded",color:"danger",class:{label:"text-danger",inputWrapper:"data-[hover=true]:border-danger focus-within:border-danger"}},{variant:"underlined",color:"default",class:{input:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{inputWrapper:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{inputWrapper:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{inputWrapper:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{inputWrapper:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{inputWrapper:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{inputWrapper:"group-data-[focus=true]:border-primary",label:"text-primary"}},{variant:"bordered",color:"secondary",class:{inputWrapper:"group-data-[focus=true]:border-secondary",label:"text-secondary"}},{variant:"bordered",color:"success",class:{inputWrapper:"group-data-[focus=true]:border-success",label:"text-success"}},{variant:"bordered",color:"warning",class:{inputWrapper:"group-data-[focus=true]:border-warning",label:"text-warning"}},{variant:"bordered",color:"danger",class:{inputWrapper:"group-data-[focus=true]:border-danger",label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled-within=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled-within=true]:text-foreground"}},{radius:"full",size:["sm"],class:{inputWrapper:"px-3"}},{radius:"full",size:"md",class:{inputWrapper:"px-4"}},{radius:"full",size:"lg",class:{inputWrapper:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{inputWrapper:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{inputWrapper:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{inputWrapper:[...uw]}},{isInvalid:!0,variant:"flat",class:{inputWrapper:["!bg-danger-50","data-[hover=true]:!bg-danger-100","group-data-[focus=true]:!bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{inputWrapper:"!border-danger group-data-[focus=true]:!border-danger"}},{isInvalid:!0,variant:"underlined",class:{inputWrapper:"after:!bg-danger"}},{labelPlacement:"inside",size:"sm",class:{inputWrapper:"h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{inputWrapper:"h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{inputWrapper:"h-16 py-2.5 gap-0"}},{labelPlacement:"inside",size:"sm",variant:["bordered","faded"],class:{inputWrapper:"py-1"}},{labelPlacement:["inside","outside"],class:{label:["group-data-[filled-within=true]:pointer-events-auto"]}},{labelPlacement:"outside",isMultiline:!1,class:{base:"relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled-within=true]:start-0"]}},{labelPlacement:["inside"],class:{label:["group-data-[filled-within=true]:scale-85"]}},{labelPlacement:["inside"],variant:"flat",class:{innerWrapper:"pb-0.5"}},{variant:"underlined",size:"sm",class:{innerWrapper:"pb-1"}},{variant:"underlined",size:["md","lg"],class:{innerWrapper:"pb-1.5"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small"}},{labelPlacement:"inside",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"]}},{labelPlacement:"inside",isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"lg",isMultiline:!1,class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",isMultiline:!1,class:{label:["start-2","text-tiny","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-tiny)/2_+_16px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]"}},{labelPlacement:"outside",size:"md",isMultiline:!1,class:{label:["start-3","end-auto","text-small","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]"}},{labelPlacement:"outside",size:"lg",isMultiline:!1,class:{label:["start-3","end-auto","text-medium","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4"}},{labelPlacement:["outside","outside-left"],isMultiline:!0,class:{inputWrapper:"py-2"}},{labelPlacement:"outside",isMultiline:!0,class:{label:"pb-1.5"}},{labelPlacement:"inside",isMultiline:!0,class:{label:"pb-0.5",input:"pt-0"}},{isMultiline:!0,disableAnimation:!1,class:{input:"transition-height !duration-100 motion-reduce:transition-none"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{isMultiline:!0,radius:"full",class:{inputWrapper:"data-[has-multiple-rows=true]:rounded-large"}},{isClearable:!0,isMultiline:!0,class:{clearButton:["group-data-[has-value=true]:opacity-70 group-data-[has-value=true]:block","group-data-[has-value=true]:scale-100","group-data-[has-value=true]:pointer-events-auto"]}},{isClearable:!0,isDisabled:!0,class:{clearButton:"peer-data-[filled=true]:pointer-events-none"}}]}),Nie=Yi({slots:{base:"w-full relative flex flex-col gap-1 p-1 overflow-clip",list:"w-full flex flex-col gap-0.5 outline-solid outline-transparent",emptyContent:["h-10","px-2","py-1.5","w-full","h-full","text-foreground-400","text-start"]}}),RP=Yi({slots:{base:["flex","group","gap-2","items-center","justify-between","relative","px-2","py-1.5","w-full","h-full","box-border","rounded-small","subpixel-antialiased","outline-solid outline-transparent","cursor-pointer","tap-highlight-transparent",...Go,"data-[focus-visible=true]:dark:ring-offset-background-content1"],wrapper:"w-full flex flex-col items-start justify-center min-w-0",title:"flex-1 text-small font-normal w-full",description:["w-full","text-tiny","text-foreground-500","group-hover:text-current"],selectedIcon:["text-inherit","w-3","h-3","shrink-0"],shortcut:["px-1","py-0.5","rounded-sm","font-sans","text-foreground-500","text-tiny","border-small","border-default-300","group-hover:border-current"]},variants:{variant:{solid:{base:""},bordered:{base:"border-medium border-transparent bg-transparent"},light:{base:"bg-transparent"},faded:{base:["border-small border-transparent hover:border-default data-[hover=true]:bg-default-100","data-[selectable=true]:focus:border-default data-[selectable=true]:focus:bg-default-100"]},flat:{base:""},shadow:{base:"data-[hover=true]:shadow-lg"}},color:{default:{},primary:{},secondary:{},success:{},warning:{},danger:{}},showDivider:{true:{base:["mb-1.5","after:content-['']","after:absolute","after:-bottom-1","after:left-0","after:right-0","after:h-divider","after:bg-divider"]},false:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},disableAnimation:{true:{},false:{base:"data-[hover=true]:transition-colors"}},hasTitleTextChild:{true:{title:"truncate"}},hasDescriptionTextChild:{true:{description:"truncate"}}},defaultVariants:{variant:"solid",color:"default",showDivider:!1},compoundVariants:[{variant:"solid",color:"default",class:{base:["data-[hover=true]:bg-default","data-[hover=true]:text-default-foreground","data-[selectable=true]:focus:bg-default","data-[selectable=true]:focus:text-default-foreground"]}},{variant:"solid",color:"primary",class:{base:["data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground","data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"]}},{variant:"solid",color:"secondary",class:{base:["data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground","data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"]}},{variant:"solid",color:"success",class:{base:["data-[hover=true]:bg-success data-[hover=true]:text-success-foreground","data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"]}},{variant:"solid",color:"warning",class:{base:["data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground","data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"]}},{variant:"solid",color:"danger",class:{base:["data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground","data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"]}},{variant:"shadow",color:"default",class:{base:["data-[hover=true]:shadow-default/50 data-[hover=true]:bg-default data-[hover=true]:text-default-foreground","data-[selectable=true]:focus:shadow-default/50 data-[selectable=true]:focus:bg-default data-[selectable=true]:focus:text-default-foreground"]}},{variant:"shadow",color:"primary",class:{base:["data-[hover=true]:shadow-primary/30 data-[hover=true]:bg-primary data-[hover=true]:text-primary-foreground","data-[selectable=true]:focus:shadow-primary/30 data-[selectable=true]:focus:bg-primary data-[selectable=true]:focus:text-primary-foreground"]}},{variant:"shadow",color:"secondary",class:{base:["data-[hover=true]:shadow-secondary/30 data-[hover=true]:bg-secondary data-[hover=true]:text-secondary-foreground","data-[selectable=true]:focus:shadow-secondary/30 data-[selectable=true]:focus:bg-secondary data-[selectable=true]:focus:text-secondary-foreground"]}},{variant:"shadow",color:"success",class:{base:["data-[hover=true]:shadow-success/30 data-[hover=true]:bg-success data-[hover=true]:text-success-foreground","data-[selectable=true]:focus:shadow-success/30 data-[selectable=true]:focus:bg-success data-[selectable=true]:focus:text-success-foreground"]}},{variant:"shadow",color:"warning",class:{base:["data-[hover=true]:shadow-warning/30 data-[hover=true]:bg-warning data-[hover=true]:text-warning-foreground","data-[selectable=true]:focus:shadow-warning/30 data-[selectable=true]:focus:bg-warning data-[selectable=true]:focus:text-warning-foreground"]}},{variant:"shadow",color:"danger",class:{base:["data-[hover=true]:shadow-danger/30 data-[hover=true]:bg-danger data-[hover=true]:text-danger-foreground","data-[selectable=true]:focus:shadow-danger/30 data-[selectable=true]:focus:bg-danger data-[selectable=true]:focus:text-danger-foreground"]}},{variant:"bordered",color:"default",class:{base:["data-[hover=true]:border-default","data-[selectable=true]:focus:border-default"]}},{variant:"bordered",color:"primary",class:{base:["data-[hover=true]:border-primary data-[hover=true]:text-primary","data-[selectable=true]:focus:border-primary data-[selectable=true]:focus:text-primary"]}},{variant:"bordered",color:"secondary",class:{base:["data-[hover=true]:border-secondary data-[hover=true]:text-secondary","data-[selectable=true]:focus:border-secondary data-[selectable=true]:focus:text-secondary"]}},{variant:"bordered",color:"success",class:{base:["data-[hover=true]:border-success data-[hover=true]:text-success","data-[selectable=true]:focus:border-success data-[selectable=true]:focus:text-success"]}},{variant:"bordered",color:"warning",class:{base:["data-[hover=true]:border-warning data-[hover=true]:text-warning","data-[selectable=true]:focus:border-warning data-[selectable=true]:focus:text-warning"]}},{variant:"bordered",color:"danger",class:{base:["data-[hover=true]:border-danger data-[hover=true]:text-danger","data-[selectable=true]:focus:border-danger data-[selectable=true]:focus:text-danger"]}},{variant:"flat",color:"default",class:{base:["data-[hover=true]:bg-default/40","data-[hover=true]:text-default-foreground","data-[selectable=true]:focus:bg-default/40","data-[selectable=true]:focus:text-default-foreground"]}},{variant:"flat",color:"primary",class:{base:["data-[hover=true]:bg-primary/20 data-[hover=true]:text-primary","data-[selectable=true]:focus:bg-primary/20 data-[selectable=true]:focus:text-primary"]}},{variant:"flat",color:"secondary",class:{base:["data-[hover=true]:bg-secondary/20 data-[hover=true]:text-secondary","data-[selectable=true]:focus:bg-secondary/20 data-[selectable=true]:focus:text-secondary"]}},{variant:"flat",color:"success",class:{base:["data-[hover=true]:bg-success/20 data-[hover=true]:text-success","data-[selectable=true]:focus:bg-success/20 data-[selectable=true]:focus:text-success"]}},{variant:"flat",color:"warning",class:{base:["data-[hover=true]:bg-warning/20 data-[hover=true]:text-warning","data-[selectable=true]:focus:bg-warning/20 data-[selectable=true]:focus:text-warning"]}},{variant:"flat",color:"danger",class:{base:["data-[hover=true]:bg-danger/20 data-[hover=true]:text-danger","data-[selectable=true]:focus:bg-danger/20 data-[selectable=true]:focus:text-danger"]}},{variant:"faded",color:"default",class:{base:["data-[hover=true]:text-default-foreground","data-[selectable=true]:focus:text-default-foreground"]}},{variant:"faded",color:"primary",class:{base:["data-[hover=true]:text-primary","data-[selectable=true]:focus:text-primary"]}},{variant:"faded",color:"secondary",class:{base:["data-[hover=true]:text-secondary","data-[selectable=true]:focus:text-secondary"]}},{variant:"faded",color:"success",class:{base:["data-[hover=true]:text-success","data-[selectable=true]:focus:text-success"]}},{variant:"faded",color:"warning",class:{base:["data-[hover=true]:text-warning","data-[selectable=true]:focus:text-warning"]}},{variant:"faded",color:"danger",class:{base:["data-[hover=true]:text-danger","data-[selectable=true]:focus:text-danger"]}},{variant:"light",color:"default",class:{base:["data-[hover=true]:text-default-500","data-[selectable=true]:focus:text-default-500"]}},{variant:"light",color:"primary",class:{base:["data-[hover=true]:text-primary","data-[selectable=true]:focus:text-primary"]}},{variant:"light",color:"secondary",class:{base:["data-[hover=true]:text-secondary","data-[selectable=true]:focus:text-secondary"]}},{variant:"light",color:"success",class:{base:["data-[hover=true]:text-success","data-[selectable=true]:focus:text-success"]}},{variant:"light",color:"warning",class:{base:["data-[hover=true]:text-warning","data-[selectable=true]:focus:text-warning"]}},{variant:"light",color:"danger",class:{base:["data-[hover=true]:text-danger","data-[selectable=true]:focus:text-danger"]}}]}),Pie=Yi({slots:{base:"relative mb-2",heading:"pl-1 text-tiny text-foreground-500",group:"data-[has-title=true]:pt-1",divider:"mt-2"}}),NP=Yi({slots:{wrapper:["flex","w-screen","h-[100dvh]","fixed","inset-0","z-50","overflow-x-auto","justify-center","h-(--visual-viewport-height)"],base:["flex","flex-col","relative","bg-white","z-50","w-full","box-border","bg-content1","outline-solid outline-transparent","mx-1","my-1","sm:mx-6","sm:my-16"],backdrop:"z-50",header:"flex py-4 px-6 flex-initial text-large font-semibold",body:"flex flex-1 flex-col gap-3 px-6 py-2",footer:"flex flex-row gap-2 px-6 py-4 justify-end",closeButton:["absolute","appearance-none","outline-solid outline-transparent","select-none","top-1","end-1","p-2","text-foreground-500","rounded-full","hover:bg-default-100","active:bg-default-200","tap-highlight-transparent",...Go]},variants:{size:{xs:{base:"max-w-xs"},sm:{base:"max-w-sm"},md:{base:"max-w-md"},lg:{base:"max-w-lg"},xl:{base:"max-w-xl"},"2xl":{base:"max-w-2xl"},"3xl":{base:"max-w-3xl"},"4xl":{base:"max-w-4xl"},"5xl":{base:"max-w-5xl"},full:{base:"my-0 mx-0 sm:mx-0 sm:my-0 max-w-full h-[100dvh] min-h-[100dvh] !rounded-none"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"}},placement:{auto:{wrapper:"items-end sm:items-center"},center:{wrapper:"items-center sm:items-center"},top:{wrapper:"items-start sm:items-start"},"top-center":{wrapper:"items-start sm:items-center"},bottom:{wrapper:"items-end sm:items-end"},"bottom-center":{wrapper:"items-end sm:items-center"}},shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},backdrop:{transparent:{backdrop:"hidden"},opaque:{backdrop:"bg-overlay/50 backdrop-opacity-disabled"},blur:{backdrop:"backdrop-blur-md backdrop-saturate-150 bg-overlay/30"}},scrollBehavior:{normal:{base:"overflow-y-hidden"},inside:{base:"max-h-[calc(100%_-_8rem)]",body:"overflow-y-auto"},outside:{wrapper:"items-start sm:items-start overflow-y-auto",base:"my-16"}},disableAnimation:{false:{wrapper:["[--scale-enter:100%]","[--scale-exit:100%]","[--slide-enter:0px]","[--slide-exit:80px]","sm:[--scale-enter:100%]","sm:[--scale-exit:103%]","sm:[--slide-enter:0px]","sm:[--slide-exit:0px]"]}}},defaultVariants:{size:"md",radius:"lg",shadow:"sm",placement:"auto",backdrop:"opaque",scrollBehavior:"normal"},compoundVariants:[{backdrop:["opaque","blur"],class:{backdrop:"w-screen h-screen fixed inset-0"}}]}),PP=Yi({slots:{base:"group flex flex-col data-[hidden=true]:hidden",label:["absolute","z-10","pointer-events-none","origin-top-left","flex-shrink-0","rtl:origin-top-right","subpixel-antialiased","block","text-small","text-foreground-500"],mainWrapper:"h-full",inputWrapper:"relative w-full inline-flex tap-highlight-transparent flex-row items-center shadow-sm px-3 gap-3",innerWrapper:"inline-flex w-full items-center h-full box-border",input:["w-full font-normal bg-transparent !outline-solid outline-transparent placeholder:text-foreground-500 focus-visible:outline-solid outline-transparent","data-[has-start-content=true]:ps-1.5","data-[has-end-content=true]:pe-1.5","autofill:bg-transparent bg-clip-text"],clearButton:["p-2","-m-2","z-10","end-3","start-auto","pointer-events-none","appearance-none","outline-solid outline-transparent","select-none","opacity-0","hover:!opacity-100","cursor-pointer","active:!opacity-70","rounded-full",...Go],stepperButton:["bg-transparent","flex","justify-center","items-center","before:absolute","before:w-8","before:h-8","before:rounded-full","after:shadow-small","after:bg-background","data-[focused=true]:z-10","min-w-5","w-5","h-5","overflow-visible","transition-opacity","data-[hover=true]:opacity-70","data-[pressed=true]:opacity-disabled"],stepperWrapper:["flex","flex-col","ps-1","h-full","justify-center"],helperWrapper:"hidden group-data-[has-helper=true]:flex p-1 relative flex-col gap-1.5",description:"text-tiny text-foreground-400",errorMessage:"text-tiny text-danger"},variants:{variant:{flat:{inputWrapper:["bg-default-100","data-[hover=true]:bg-default-200","group-data-[focus=true]:bg-default-100"]},faded:{inputWrapper:["bg-default-100","border-medium","border-default-200","data-[hover=true]:border-default-400 focus-within:border-default-400"],value:"group-data-[has-value=true]:text-default-foreground"},bordered:{inputWrapper:["border-medium","border-default-200","data-[hover=true]:border-default-400","group-data-[focus=true]:border-default-foreground"]},underlined:{inputWrapper:["!px-1","!pb-0","!gap-0","relative","box-border","border-b-medium","shadow-[0_1px_0px_0_rgba(0,0,0,0.05)]","border-default-200","!rounded-none","hover:border-default-300","after:content-['']","after:w-0","after:origin-center","after:bg-default-foreground","after:absolute","after:left-1/2","after:-translate-x-1/2","after:-bottom-[2px]","after:h-[2px]","group-data-[focus=true]:after:w-full"],innerWrapper:"pb-1",label:"group-data-[filled-within=true]:text-foreground"}},color:{default:{},primary:{stepperButton:"text-primary"},secondary:{stepperButton:"text-secondary"},success:{stepperButton:"text-success"},warning:{stepperButton:"text-warning"},danger:{stepperButton:"text-danger"}},size:{sm:{label:"text-tiny",inputWrapper:"h-8 min-h-8 px-2 rounded-small",input:"text-small",clearButton:"text-medium"},md:{inputWrapper:"h-10 min-h-10 rounded-medium",input:"text-small",clearButton:"text-large"},lg:{label:"text-medium",inputWrapper:"h-12 min-h-12 rounded-large",input:"text-medium",clearButton:"text-large"}},radius:{none:{inputWrapper:"rounded-none"},sm:{inputWrapper:"rounded-small"},md:{inputWrapper:"rounded-medium"},lg:{inputWrapper:"rounded-large"},full:{inputWrapper:"rounded-full"}},labelPlacement:{outside:{mainWrapper:"flex flex-col",stepperButton:"min-w-3 w-3 h-3"},"outside-left":{base:"flex-row items-center flex-nowrap data-[has-helper=true]:items-start",inputWrapper:"flex-1",mainWrapper:"flex flex-col",label:"relative text-foreground pe-2 ps-2 pointer-events-auto",stepperButton:"min-w-3 w-3 h-3"},inside:{label:"cursor-text",inputWrapper:"flex-col items-start justify-center gap-0",innerWrapper:"group-data-[has-label=true]:items-end"}},fullWidth:{true:{base:"w-full"},false:{}},isClearable:{true:{input:"peer pe-6 input-search-cancel-button-none",clearButton:["peer-data-[filled=true]:pointer-events-auto","peer-data-[filled=true]:opacity-70 peer-data-[filled=true]:block","peer-data-[filled=true]:scale-100"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none",inputWrapper:"pointer-events-none",label:"pointer-events-none"}},isInvalid:{true:{label:"!text-danger",input:"!placeholder:text-danger !text-danger"}},isRequired:{true:{label:"after:content-['*'] after:text-danger after:ms-0.5"}},disableAnimation:{true:{input:"transition-none",inputWrapper:"transition-none",label:"transition-none"},false:{inputWrapper:"transition-background motion-reduce:transition-none !duration-150",label:["will-change-auto","!duration-200","!ease-out","motion-reduce:transition-none","transition-[transform,color,left,opacity,translate,scale]"],clearButton:["scale-90","ease-out","duration-150","transition-[opacity,transform]","motion-reduce:transition-none","motion-reduce:scale-100"]}}},defaultVariants:{variant:"flat",color:"default",size:"md",fullWidth:!0,labelPlacement:"inside",isDisabled:!1},compoundVariants:[{variant:"flat",color:"default",class:{input:"group-data-[has-value=true]:text-default-foreground"}},{variant:"flat",color:"primary",class:{inputWrapper:["bg-primary-100","data-[hover=true]:bg-primary-50","text-primary","group-data-[focus=true]:bg-primary-50","placeholder:text-primary"],input:"placeholder:text-primary",label:"text-primary"}},{variant:"flat",color:"secondary",class:{inputWrapper:["bg-secondary-100","text-secondary","data-[hover=true]:bg-secondary-50","group-data-[focus=true]:bg-secondary-50","placeholder:text-secondary"],input:"placeholder:text-secondary",label:"text-secondary"}},{variant:"flat",color:"success",class:{inputWrapper:["bg-success-100","text-success-600","dark:text-success","placeholder:text-success-600","dark:placeholder:text-success","data-[hover=true]:bg-success-50","group-data-[focus=true]:bg-success-50"],input:"placeholder:text-success-600 dark:placeholder:text-success",label:"text-success-600 dark:text-success"}},{variant:"flat",color:"warning",class:{inputWrapper:["bg-warning-100","text-warning-600","dark:text-warning","placeholder:text-warning-600","dark:placeholder:text-warning","data-[hover=true]:bg-warning-50","group-data-[focus=true]:bg-warning-50"],input:"placeholder:text-warning-600 dark:placeholder:text-warning",label:"text-warning-600 dark:text-warning"}},{variant:"flat",color:"danger",class:{inputWrapper:["bg-danger-100","text-danger","dark:text-danger-500","placeholder:text-danger","dark:placeholder:text-danger-500","data-[hover=true]:bg-danger-50","group-data-[focus=true]:bg-danger-50"],input:"placeholder:text-danger dark:placeholder:text-danger-500",label:"text-danger dark:text-danger-500"}},{variant:"faded",color:"primary",class:{label:"text-primary",inputWrapper:"data-[hover=true]:border-primary focus-within:border-primary"}},{variant:"faded",color:"secondary",class:{label:"text-secondary",inputWrapper:"data-[hover=true]:border-secondary focus-within:border-secondary"}},{variant:"faded",color:"success",class:{label:"text-success",inputWrapper:"data-[hover=true]:border-success focus-within:border-success"}},{variant:"faded",color:"warning",class:{label:"text-warning",inputWrapper:"data-[hover=true]:border-warning focus-within:border-warning"}},{variant:"faded",color:"danger",class:{label:"text-danger",inputWrapper:"data-[hover=true]:border-danger focus-within:border-danger"}},{variant:"underlined",color:"default",class:{input:"group-data-[has-value=true]:text-foreground"}},{variant:"underlined",color:"primary",class:{inputWrapper:"after:bg-primary",label:"text-primary"}},{variant:"underlined",color:"secondary",class:{inputWrapper:"after:bg-secondary",label:"text-secondary"}},{variant:"underlined",color:"success",class:{inputWrapper:"after:bg-success",label:"text-success"}},{variant:"underlined",color:"warning",class:{inputWrapper:"after:bg-warning",label:"text-warning"}},{variant:"underlined",color:"danger",class:{inputWrapper:"after:bg-danger",label:"text-danger"}},{variant:"bordered",color:"primary",class:{inputWrapper:"group-data-[focus=true]:border-primary",label:"text-primary"}},{variant:"bordered",color:"secondary",class:{inputWrapper:"group-data-[focus=true]:border-secondary",label:"text-secondary"}},{variant:"bordered",color:"success",class:{inputWrapper:"group-data-[focus=true]:border-success",label:"text-success"}},{variant:"bordered",color:"warning",class:{inputWrapper:"group-data-[focus=true]:border-warning",label:"text-warning"}},{variant:"bordered",color:"danger",class:{inputWrapper:"group-data-[focus=true]:border-danger",label:"text-danger"}},{labelPlacement:"inside",color:"default",class:{label:"group-data-[filled-within=true]:text-default-600"}},{labelPlacement:"outside",color:"default",class:{label:"group-data-[filled-within=true]:text-foreground"}},{radius:"full",size:["sm"],class:{inputWrapper:"px-3"}},{radius:"full",size:"md",class:{inputWrapper:"px-4"}},{radius:"full",size:"lg",class:{inputWrapper:"px-5"}},{disableAnimation:!1,variant:["faded","bordered"],class:{inputWrapper:"transition-colors motion-reduce:transition-none"}},{disableAnimation:!1,variant:"underlined",class:{inputWrapper:"after:transition-width motion-reduce:after:transition-none"}},{variant:["flat","faded"],class:{inputWrapper:[...uw]}},{isInvalid:!0,variant:"flat",class:{inputWrapper:["!bg-danger-50","data-[hover=true]:!bg-danger-100","group-data-[focus=true]:!bg-danger-50"]}},{isInvalid:!0,variant:"bordered",class:{inputWrapper:"!border-danger group-data-[focus=true]:!border-danger"}},{isInvalid:!0,variant:"underlined",class:{inputWrapper:"after:!bg-danger"}},{labelPlacement:"inside",size:"sm",class:{inputWrapper:"h-12 py-1.5 px-3"}},{labelPlacement:"inside",size:"md",class:{inputWrapper:"h-14 py-2"}},{labelPlacement:"inside",size:"lg",class:{inputWrapper:"h-16 py-2.5 gap-0"}},{labelPlacement:"inside",size:"sm",variant:["bordered","faded"],class:{inputWrapper:"py-1"}},{labelPlacement:["inside","outside"],class:{label:["group-data-[filled-within=true]:pointer-events-auto"]}},{labelPlacement:"outside",class:{base:"relative justify-end",label:["pb-0","z-20","top-1/2","-translate-y-1/2","group-data-[filled-within=true]:start-0"]}},{labelPlacement:["inside"],class:{label:["group-data-[filled-within=true]:scale-85"]}},{labelPlacement:"inside",size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px)]"]}},{labelPlacement:"inside",size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px)]"]}},{labelPlacement:"inside",size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px)]"]}},{labelPlacement:["inside"],variant:"flat",class:{innerWrapper:"pb-0.5"}},{variant:"underlined",size:"sm",class:{innerWrapper:"pb-1"}},{variant:"underlined",size:["md","lg"],class:{innerWrapper:"pb-1.5"}},{labelPlacement:"inside",size:["sm","md"],class:{label:"text-small",stepperButton:"before:h-6"}},{labelPlacement:"inside",variant:["faded","bordered"],size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],isMultiline:!1,size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_6px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:["faded","bordered"],size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_8px_-_var(--heroui-border-width-medium))]"]}},{labelPlacement:"inside",variant:"underlined",size:"sm",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-tiny)/2_-_5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"md",class:{label:["group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_3.5px)]"]}},{labelPlacement:"inside",variant:"underlined",size:"lg",class:{label:["text-medium","group-data-[filled-within=true]:-translate-y-[calc(50%_+_var(--heroui-font-size-small)/2_-_4px)]"]}},{labelPlacement:"outside",size:"sm",class:{label:["start-2","text-tiny","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-tiny)/2_+_16px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_8px)]",stepperButton:"before:h-4"}},{labelPlacement:"outside",size:"md",class:{label:["start-3","end-auto","text-small","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_20px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_10px)]",stepperButton:"before:h-4"}},{labelPlacement:"outside",size:"lg",class:{label:["start-3","end-auto","text-medium","group-data-[filled-within=true]:-translate-y-[calc(100%_+_var(--heroui-font-size-small)/2_+_24px)]"],base:"data-[has-label=true]:mt-[calc(var(--heroui-font-size-small)_+_12px)]",stepperButton:"min-4 w-4 h-4 before:h-6"}},{labelPlacement:"outside-left",size:"sm",class:{label:"group-data-[has-helper=true]:pt-2",stepperButton:"before:h-4"}},{labelPlacement:"outside-left",size:"md",class:{label:"group-data-[has-helper=true]:pt-3",stepperButton:"before:h-4"}},{labelPlacement:"outside-left",size:"lg",class:{label:"group-data-[has-helper=true]:pt-4",stepperButton:"min-4 w-4 h-4 before:h-6"}},{labelPlacement:["inside","outside"],class:{label:["pe-2","max-w-full","text-ellipsis","overflow-hidden"]}},{isClearable:!0,isDisabled:!0,class:{clearButton:"peer-data-[filled=true]:pointer-events-none"}}]}),Die=Yi({base:"shrink-0 bg-divider border-none",variants:{orientation:{horizontal:"w-full h-divider",vertical:"h-full w-divider"}},defaultVariants:{orientation:"horizontal"}}),Lie=Yi({base:"flex flex-col gap-2 items-start"}),DP=Yi({slots:{wrapper:"relative shadow-black/5",zoomedWrapper:"relative overflow-hidden rounded-inherit",img:"relative z-10 opacity-0 shadow-black/5 data-[loaded=true]:opacity-100",blurredImg:["absolute","z-0","inset-0","w-full","h-full","object-cover","filter","blur-lg","scale-105","saturate-150","opacity-30","translate-y-1"]},variants:{radius:{none:{},sm:{},md:{},lg:{},full:{}},shadow:{none:{wrapper:"shadow-none",img:"shadow-none"},sm:{wrapper:"shadow-small",img:"shadow-small"},md:{wrapper:"shadow-medium",img:"shadow-medium"},lg:{wrapper:"shadow-large",img:"shadow-large"}},isZoomed:{true:{img:["object-cover","transform","hover:scale-125"]}},showSkeleton:{true:{wrapper:["group","relative","overflow-hidden","bg-content3 dark:bg-content2"],img:"opacity-0"}},disableAnimation:{true:{img:"transition-none"},false:{img:"transition-transform-opacity motion-reduce:transition-none !duration-300"}}},defaultVariants:{radius:"lg",shadow:"none",isZoomed:!1,isBlurred:!1,showSkeleton:!1},compoundVariants:[{showSkeleton:!0,disableAnimation:!1,class:{wrapper:["before:opacity-100","before:absolute","before:inset-0","before:-translate-x-full","before:animate-shimmer","before:border-t","before:border-content4/30","before:bg-gradient-to-r","before:from-transparent","before:via-content4","dark:before:via-default-700/10","before:to-transparent","after:opacity-100","after:absolute","after:inset-0","after:-z-10","after:bg-content3","dark:after:bg-content2"]}}],compoundSlots:[{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"none",class:"rounded-none"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"full",class:"rounded-full"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"sm",class:"rounded-small"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"md",class:"rounded-md"},{slots:["wrapper","img","blurredImg","zoomedWrapper"],radius:"lg",class:"rounded-large"}]}),IB=Yi({base:["z-0","group","relative","inline-flex","items-center","justify-center","box-border","appearance-none","outline-solid outline-transparent","select-none","whitespace-nowrap","min-w-max","font-normal","subpixel-antialiased","overflow-hidden","tap-highlight-transparent","transform-gpu data-[pressed=true]:scale-[0.97]","cursor-pointer",...Go],variants:{variant:{solid:"",bordered:"border-medium bg-transparent",light:"bg-transparent",flat:"",faded:"border-medium",shadow:"",ghost:"border-medium bg-transparent"},size:{sm:"px-3 min-w-16 h-8 text-tiny gap-2 rounded-small",md:"px-4 min-w-20 h-10 text-small gap-2 rounded-medium",lg:"px-6 min-w-24 h-12 text-medium gap-3 rounded-large"},color:{default:"",primary:"",secondary:"",success:"",warning:"",danger:""},radius:{none:"rounded-none",sm:"rounded-small",md:"rounded-medium",lg:"rounded-large",full:"rounded-full"},fullWidth:{true:"w-full"},isDisabled:{true:"opacity-disabled pointer-events-none"},isInGroup:{true:"[&:not(:first-child):not(:last-child)]:rounded-none"},isIconOnly:{true:"px-0 !gap-0",false:"[&>svg]:max-w-[theme(spacing.8)]"},disableAnimation:{true:"!transition-none data-[pressed=true]:scale-100",false:"transition-transform-colors-opacity motion-reduce:transition-none"}},defaultVariants:{size:"md",variant:"solid",color:"default",fullWidth:!1,isDisabled:!1,isInGroup:!1},compoundVariants:[{variant:"solid",color:"default",class:Ct.solid.default},{variant:"solid",color:"primary",class:Ct.solid.primary},{variant:"solid",color:"secondary",class:Ct.solid.secondary},{variant:"solid",color:"success",class:Ct.solid.success},{variant:"solid",color:"warning",class:Ct.solid.warning},{variant:"solid",color:"danger",class:Ct.solid.danger},{variant:"shadow",color:"default",class:Ct.shadow.default},{variant:"shadow",color:"primary",class:Ct.shadow.primary},{variant:"shadow",color:"secondary",class:Ct.shadow.secondary},{variant:"shadow",color:"success",class:Ct.shadow.success},{variant:"shadow",color:"warning",class:Ct.shadow.warning},{variant:"shadow",color:"danger",class:Ct.shadow.danger},{variant:"bordered",color:"default",class:Ct.bordered.default},{variant:"bordered",color:"primary",class:Ct.bordered.primary},{variant:"bordered",color:"secondary",class:Ct.bordered.secondary},{variant:"bordered",color:"success",class:Ct.bordered.success},{variant:"bordered",color:"warning",class:Ct.bordered.warning},{variant:"bordered",color:"danger",class:Ct.bordered.danger},{variant:"flat",color:"default",class:Ct.flat.default},{variant:"flat",color:"primary",class:Ct.flat.primary},{variant:"flat",color:"secondary",class:Ct.flat.secondary},{variant:"flat",color:"success",class:Ct.flat.success},{variant:"flat",color:"warning",class:Ct.flat.warning},{variant:"flat",color:"danger",class:Ct.flat.danger},{variant:"faded",color:"default",class:Ct.faded.default},{variant:"faded",color:"primary",class:Ct.faded.primary},{variant:"faded",color:"secondary",class:Ct.faded.secondary},{variant:"faded",color:"success",class:Ct.faded.success},{variant:"faded",color:"warning",class:Ct.faded.warning},{variant:"faded",color:"danger",class:Ct.faded.danger},{variant:"light",color:"default",class:[Ct.light.default,"data-[hover=true]:bg-default/40"]},{variant:"light",color:"primary",class:[Ct.light.primary,"data-[hover=true]:bg-primary/20"]},{variant:"light",color:"secondary",class:[Ct.light.secondary,"data-[hover=true]:bg-secondary/20"]},{variant:"light",color:"success",class:[Ct.light.success,"data-[hover=true]:bg-success/20"]},{variant:"light",color:"warning",class:[Ct.light.warning,"data-[hover=true]:bg-warning/20"]},{variant:"light",color:"danger",class:[Ct.light.danger,"data-[hover=true]:bg-danger/20"]},{variant:"ghost",color:"default",class:[Ct.ghost.default,"data-[hover=true]:!bg-default"]},{variant:"ghost",color:"primary",class:[Ct.ghost.primary,"data-[hover=true]:!bg-primary data-[hover=true]:!text-primary-foreground"]},{variant:"ghost",color:"secondary",class:[Ct.ghost.secondary,"data-[hover=true]:!bg-secondary data-[hover=true]:!text-secondary-foreground"]},{variant:"ghost",color:"success",class:[Ct.ghost.success,"data-[hover=true]:!bg-success data-[hover=true]:!text-success-foreground"]},{variant:"ghost",color:"warning",class:[Ct.ghost.warning,"data-[hover=true]:!bg-warning data-[hover=true]:!text-warning-foreground"]},{variant:"ghost",color:"danger",class:[Ct.ghost.danger,"data-[hover=true]:!bg-danger data-[hover=true]:!text-danger-foreground"]},{isInGroup:!0,class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,size:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,size:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,isRounded:!0,class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,radius:"none",class:"rounded-none first:rounded-s-none last:rounded-e-none"},{isInGroup:!0,radius:"sm",class:"rounded-none first:rounded-s-small last:rounded-e-small"},{isInGroup:!0,radius:"md",class:"rounded-none first:rounded-s-medium last:rounded-e-medium"},{isInGroup:!0,radius:"lg",class:"rounded-none first:rounded-s-large last:rounded-e-large"},{isInGroup:!0,radius:"full",class:"rounded-none first:rounded-s-full last:rounded-e-full"},{isInGroup:!0,variant:["ghost","bordered"],color:"default",className:P0.default},{isInGroup:!0,variant:["ghost","bordered"],color:"primary",className:P0.primary},{isInGroup:!0,variant:["ghost","bordered"],color:"secondary",className:P0.secondary},{isInGroup:!0,variant:["ghost","bordered"],color:"success",className:P0.success},{isInGroup:!0,variant:["ghost","bordered"],color:"warning",className:P0.warning},{isInGroup:!0,variant:["ghost","bordered"],color:"danger",className:P0.danger},{isIconOnly:!0,size:"sm",class:"min-w-8 w-8 h-8"},{isIconOnly:!0,size:"md",class:"min-w-10 w-10 h-10"},{isIconOnly:!0,size:"lg",class:"min-w-12 w-12 h-12"},{variant:["solid","faded","flat","bordered","shadow"],class:"data-[hover=true]:opacity-hover"}]});Yi({base:"inline-flex items-center justify-center h-auto",variants:{fullWidth:{true:"w-full"}},defaultVariants:{fullWidth:!1}});var LP=Yi({slots:{base:["flex","flex-col","relative","overflow-hidden","h-auto","outline-solid outline-transparent","text-foreground","box-border","bg-content1",...Go],header:["flex","p-3","z-10","w-full","justify-start","items-center","shrink-0","overflow-inherit","color-inherit","subpixel-antialiased"],body:["relative","flex","flex-1","w-full","p-3","flex-auto","flex-col","place-content-inherit","align-items-inherit","h-auto","break-words","text-left","overflow-y-auto","subpixel-antialiased"],footer:["p-3","h-auto","flex","w-full","items-center","overflow-hidden","color-inherit","subpixel-antialiased"]},variants:{shadow:{none:{base:"shadow-none"},sm:{base:"shadow-small"},md:{base:"shadow-medium"},lg:{base:"shadow-large"}},radius:{none:{base:"rounded-none",header:"rounded-none",footer:"rounded-none"},sm:{base:"rounded-small",header:"rounded-t-small",footer:"rounded-b-small"},md:{base:"rounded-medium",header:"rounded-t-medium",footer:"rounded-b-medium"},lg:{base:"rounded-large",header:"rounded-t-large",footer:"rounded-b-large"}},fullWidth:{true:{base:"w-full"}},isHoverable:{true:{base:"data-[hover=true]:bg-content2 dark:data-[hover=true]:bg-content2"}},isPressable:{true:{base:"cursor-pointer"}},isBlurred:{true:{base:["bg-background/80","dark:bg-background/20","backdrop-blur-md","backdrop-saturate-150"]}},isFooterBlurred:{true:{footer:["bg-background/10","backdrop-blur","backdrop-saturate-150"]}},isDisabled:{true:{base:"opacity-disabled cursor-not-allowed"}},disableAnimation:{true:"",false:{base:"transition-transform-background motion-reduce:transition-none"}}},compoundVariants:[{isPressable:!0,class:"data-[pressed=true]:scale-[0.97] tap-highlight-transparent"}],defaultVariants:{radius:"lg",shadow:"md",fullWidth:!1,isHoverable:!1,isPressable:!1,isDisabled:!1,isFooterBlurred:!1}}),Oie=Yi({slots:{base:"group relative max-w-fit inline-flex items-center justify-start cursor-pointer tap-highlight-transparent p-2 -m-2 select-none",wrapper:["relative","inline-flex","items-center","justify-center","shrink-0","overflow-hidden","before:content-['']","before:absolute","before:inset-0","before:border-solid","before:border-2","before:box-border","before:border-default","after:content-['']","after:absolute","after:inset-0","after:scale-50","after:opacity-0","after:origin-center","group-data-[selected=true]:after:scale-100","group-data-[selected=true]:after:opacity-100","group-data-[hover=true]:before:bg-default-100",...uw],hiddenInput:OB,icon:"z-10 w-4 h-3 opacity-0 group-data-[selected=true]:opacity-100 pointer-events-none",label:"relative text-foreground select-none"},variants:{color:{default:{wrapper:"after:bg-default after:text-default-foreground text-default-foreground"},primary:{wrapper:"after:bg-primary after:text-primary-foreground text-primary-foreground"},secondary:{wrapper:"after:bg-secondary after:text-secondary-foreground text-secondary-foreground"},success:{wrapper:"after:bg-success after:text-success-foreground text-success-foreground"},warning:{wrapper:"after:bg-warning after:text-warning-foreground text-warning-foreground"},danger:{wrapper:"after:bg-danger after:text-danger-foreground text-danger-foreground"}},size:{sm:{wrapper:["w-4 h-4 me-2","rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"],label:"text-small",icon:"w-3 h-2"},md:{wrapper:["w-5 h-5 me-2","rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"],label:"text-medium",icon:"w-4 h-3"},lg:{wrapper:["w-6 h-6 me-2","rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"],label:"text-large",icon:"w-5 h-4"}},radius:{none:{wrapper:"rounded-none before:rounded-none after:rounded-none"},sm:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.5)]","before:rounded-[calc(var(--heroui-radius-medium)*0.5)]","after:rounded-[calc(var(--heroui-radius-medium)*0.5)]"]},md:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.6)]","before:rounded-[calc(var(--heroui-radius-medium)*0.6)]","after:rounded-[calc(var(--heroui-radius-medium)*0.6)]"]},lg:{wrapper:["rounded-[calc(var(--heroui-radius-medium)*0.7)]","before:rounded-[calc(var(--heroui-radius-medium)*0.7)]","after:rounded-[calc(var(--heroui-radius-medium)*0.7)]"]},full:{wrapper:"rounded-full before:rounded-full after:rounded-full"}},lineThrough:{true:{label:["inline-flex","items-center","justify-center","before:content-['']","before:absolute","before:bg-foreground","before:w-0","before:h-0.5","group-data-[selected=true]:opacity-60","group-data-[selected=true]:before:w-full"]}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isInvalid:{true:{wrapper:"before:border-danger",label:"text-danger"}},disableAnimation:{true:{wrapper:"transition-none",icon:"transition-none",label:"transition-none"},false:{wrapper:["before:transition-colors","group-data-[pressed=true]:scale-95","transition-transform","after:transition-transform-opacity","after:!ease-linear","after:!duration-200","motion-reduce:transition-none"],icon:"transition-opacity motion-reduce:transition-none",label:"transition-colors-opacity before:transition-width motion-reduce:transition-none"}}},defaultVariants:{color:"primary",size:"md",isDisabled:!1,lineThrough:!1}});Yi({slots:{base:"relative flex flex-col gap-2",label:"relative text-medium text-foreground-500",wrapper:"flex flex-col flex-wrap gap-2 data-[orientation=horizontal]:flex-row",description:"text-small text-foreground-400",errorMessage:"text-small text-danger"},variants:{isRequired:{true:{label:"after:content-['*'] after:text-danger after:ml-0.5"}},isInvalid:{true:{description:"text-danger"}},disableAnimation:{true:{},false:{description:"transition-colors !duration-150 motion-reduce:transition-none"}}},defaultVariants:{isInvalid:!1,isRequired:!1}});var OP=Yi({slots:{base:["relative","max-w-fit","min-w-min","inline-flex","items-center","justify-between","box-border","whitespace-nowrap"],content:"flex-1 text-inherit font-normal",dot:["w-2","h-2","ml-1","rounded-full"],avatar:"shrink-0",closeButton:["z-10","appearance-none","outline-solid outline-transparent","select-none","transition-opacity","opacity-70","hover:opacity-100","cursor-pointer","active:opacity-disabled","tap-highlight-transparent"]},variants:{variant:{solid:{},bordered:{base:"border-medium bg-transparent"},light:{base:"bg-transparent"},flat:{},faded:{base:"border-medium"},shadow:{},dot:{base:"border-medium border-default text-foreground bg-transparent"}},color:{default:{dot:"bg-default-400"},primary:{dot:"bg-primary"},secondary:{dot:"bg-secondary"},success:{dot:"bg-success"},warning:{dot:"bg-warning"},danger:{dot:"bg-danger"}},size:{sm:{base:"px-1 h-6 text-tiny",content:"px-1",closeButton:"text-medium",avatar:"w-4 h-4"},md:{base:"px-1 h-7 text-small",content:"px-2",closeButton:"text-large",avatar:"w-5 h-5"},lg:{base:"px-2 h-8 text-medium",content:"px-2",closeButton:"text-xl",avatar:"w-6 h-6"}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"},full:{base:"rounded-full"}},isOneChar:{true:{},false:{}},isCloseable:{true:{},false:{}},hasStartContent:{true:{}},hasEndContent:{true:{}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},isCloseButtonFocusVisible:{true:{closeButton:[...Tie,"ring-1","rounded-full"]}}},defaultVariants:{variant:"solid",color:"default",size:"md",radius:"full",isDisabled:!1},compoundVariants:[{variant:"solid",color:"default",class:{base:Ct.solid.default}},{variant:"solid",color:"primary",class:{base:Ct.solid.primary}},{variant:"solid",color:"secondary",class:{base:Ct.solid.secondary}},{variant:"solid",color:"success",class:{base:Ct.solid.success}},{variant:"solid",color:"warning",class:{base:Ct.solid.warning}},{variant:"solid",color:"danger",class:{base:Ct.solid.danger}},{variant:"shadow",color:"default",class:{base:Ct.shadow.default}},{variant:"shadow",color:"primary",class:{base:Ct.shadow.primary}},{variant:"shadow",color:"secondary",class:{base:Ct.shadow.secondary}},{variant:"shadow",color:"success",class:{base:Ct.shadow.success}},{variant:"shadow",color:"warning",class:{base:Ct.shadow.warning}},{variant:"shadow",color:"danger",class:{base:Ct.shadow.danger}},{variant:"bordered",color:"default",class:{base:Ct.bordered.default}},{variant:"bordered",color:"primary",class:{base:Ct.bordered.primary}},{variant:"bordered",color:"secondary",class:{base:Ct.bordered.secondary}},{variant:"bordered",color:"success",class:{base:Ct.bordered.success}},{variant:"bordered",color:"warning",class:{base:Ct.bordered.warning}},{variant:"bordered",color:"danger",class:{base:Ct.bordered.danger}},{variant:"flat",color:"default",class:{base:Ct.flat.default}},{variant:"flat",color:"primary",class:{base:Ct.flat.primary}},{variant:"flat",color:"secondary",class:{base:Ct.flat.secondary}},{variant:"flat",color:"success",class:{base:Ct.flat.success}},{variant:"flat",color:"warning",class:{base:Ct.flat.warning}},{variant:"flat",color:"danger",class:{base:Ct.flat.danger}},{variant:"faded",color:"default",class:{base:Ct.faded.default}},{variant:"faded",color:"primary",class:{base:Ct.faded.primary}},{variant:"faded",color:"secondary",class:{base:Ct.faded.secondary}},{variant:"faded",color:"success",class:{base:Ct.faded.success}},{variant:"faded",color:"warning",class:{base:Ct.faded.warning}},{variant:"faded",color:"danger",class:{base:Ct.faded.danger}},{variant:"light",color:"default",class:{base:Ct.light.default}},{variant:"light",color:"primary",class:{base:Ct.light.primary}},{variant:"light",color:"secondary",class:{base:Ct.light.secondary}},{variant:"light",color:"success",class:{base:Ct.light.success}},{variant:"light",color:"warning",class:{base:Ct.light.warning}},{variant:"light",color:"danger",class:{base:Ct.light.danger}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"sm",class:{base:"w-5 h-5 min-w-5 min-h-5"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"md",class:{base:"w-6 h-6 min-w-6 min-h-6"}},{isOneChar:!0,hasStartContent:!1,hasEndContent:!1,size:"lg",class:{base:"w-7 h-7 min-w-7 min-h-7"}},{isOneChar:!0,isCloseable:!1,hasStartContent:!1,hasEndContent:!1,class:{base:"px-0 justify-center",content:"px-0 flex-none"}},{isOneChar:!0,isCloseable:!0,hasStartContent:!1,hasEndContent:!1,class:{base:"w-auto"}},{isOneChar:!0,variant:"dot",class:{base:"w-auto h-7 px-1 items-center",content:"px-2"}},{hasStartContent:!0,size:"sm",class:{content:"pl-0.5"}},{hasStartContent:!0,size:["md","lg"],class:{content:"pl-1"}},{hasEndContent:!0,size:"sm",class:{content:"pr-0.5"}},{hasEndContent:!0,size:["md","lg"],class:{content:"pr-1"}}]}),Iie=Yi({base:"px-2",variants:{variant:{light:"",shadow:"px-4 shadow-medium rounded-medium bg-content1",bordered:"px-4 border-medium border-divider rounded-medium",splitted:"flex flex-col gap-2"},fullWidth:{true:"w-full"}},defaultVariants:{variant:"light",fullWidth:!0}}),zie=Yi({slots:{base:"",heading:"",trigger:["flex py-4 w-full h-full gap-3 outline-solid outline-transparent items-center tap-highlight-transparent",...Go],startContent:"shrink-0",indicator:"text-default-400",titleWrapper:"flex-1 flex flex-col text-start",title:"text-foreground text-medium",subtitle:"text-small text-foreground-500 font-normal",content:"py-2"},variants:{variant:{splitted:{base:"px-4 bg-content1 shadow-medium rounded-medium"}},isCompact:{true:{trigger:"py-2",title:"text-medium",subtitle:"text-small",indicator:"text-medium",content:"py-1"}},isDisabled:{true:{base:"opacity-disabled pointer-events-none"}},hideIndicator:{true:{indicator:"hidden"}},disableAnimation:{true:{content:"hidden data-[open=true]:block"},false:{indicator:"transition-transform",trigger:"transition-opacity"}},disableIndicatorAnimation:{true:{indicator:"transition-none"},false:{indicator:"rotate-0 data-[open=true]:-rotate-90 rtl:-rotate-180 rtl:data-[open=true]:-rotate-90"}}},defaultVariants:{size:"md",radius:"lg",isDisabled:!1,hideIndicator:!1,disableIndicatorAnimation:!1}}),Bie=Yi({slots:{base:["flex","relative","justify-center","items-center","box-border","overflow-hidden","align-middle","text-white","z-0",...Go],img:["flex","object-cover","w-full","h-full","transition-opacity","!duration-500","opacity-0","data-[loaded=true]:opacity-100"],fallback:[...AE,"flex","items-center","justify-center"],name:[...AE,"font-normal","text-center","text-inherit"],icon:[...AE,"flex","items-center","justify-center","text-inherit","w-full","h-full"]},variants:{size:{sm:{base:"w-8 h-8 text-tiny"},md:{base:"w-10 h-10 text-tiny"},lg:{base:"w-14 h-14 text-small"}},color:{default:{base:Ct.solid.default},primary:{base:Ct.solid.primary},secondary:{base:Ct.solid.secondary},success:{base:Ct.solid.success},warning:{base:Ct.solid.warning},danger:{base:Ct.solid.danger}},radius:{none:{base:"rounded-none"},sm:{base:"rounded-small"},md:{base:"rounded-medium"},lg:{base:"rounded-large"},full:{base:"rounded-full"}},isBordered:{true:{base:"ring-2 ring-offset-2 ring-offset-background dark:ring-offset-background-dark"}},isDisabled:{true:{base:"opacity-disabled"}},isInGroup:{true:{base:["-ms-2 data-[hover=true]:-translate-x-3 rtl:data-[hover=true]:translate-x-3 transition-transform","data-[focus-visible=true]:-translate-x-3 rtl:data-[focus-visible=true]:translate-x-3"]}},isInGridGroup:{true:{base:"m-0 data-[hover=true]:translate-x-0"}},disableAnimation:{true:{base:"transition-none",img:"transition-none"},false:{}}},defaultVariants:{size:"md",color:"default",radius:"full"},compoundVariants:[{color:"default",isBordered:!0,class:{base:"ring-default"}},{color:"primary",isBordered:!0,class:{base:"ring-primary"}},{color:"secondary",isBordered:!0,class:{base:"ring-secondary"}},{color:"success",isBordered:!0,class:{base:"ring-success"}},{color:"warning",isBordered:!0,class:{base:"ring-warning"}},{color:"danger",isBordered:!0,class:{base:"ring-danger"}}]});Yi({slots:{base:"flex items-center justify-center h-auto w-max",count:"hover:-translate-x-0"},variants:{isGrid:{true:"inline-grid grid-cols-4 gap-3"}}});function zB(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t))for(e=0;e<t.length;e++)t[e]&&(n=zB(t[e]))&&(i&&(i+=" "),i+=n);else for(e in t)t[e]&&(i&&(i+=" "),i+=e);return i}function Uie(){for(var t,e,n=0,i="";n<arguments.length;)(t=arguments[n++])&&(e=zB(t))&&(i&&(i+=" "),i+=e);return i}var jie=LB({extend:KT});function Fie(...t){return jie(Uie(t))}function Vie(t,e){let{elementType:n="button",isDisabled:i,onPress:a,onPressStart:s,onPressEnd:r,onPressUp:o,onPressChange:c,preventFocusOnPress:u,allowFocusWhenDisabled:h,onClick:d,href:p,target:g,rel:b,type:w="button"}=t,x;n==="button"?x={type:w,disabled:i,form:t.form,formAction:t.formAction,formEncType:t.formEncType,formMethod:t.formMethod,formNoValidate:t.formNoValidate,formTarget:t.formTarget,name:t.name,value:t.value}:x={role:"button",href:n==="a"&&!i?p:void 0,target:n==="a"?g:void 0,type:n==="input"?w:void 0,disabled:n==="input"?i:void 0,"aria-disabled":!i||n==="input"?void 0:i,rel:n==="a"?b:void 0};let{pressProps:S,isPressed:M}=bo({onPressStart:s,onPressEnd:r,onPressChange:c,onPress:a,onPressUp:o,onClick:d,isDisabled:i,preventFocusOnPress:u,ref:e}),{focusableProps:C}=hm(t,e);h&&(C.tabIndex=i?-1:C.tabIndex);let A=ci(C,S,Dl(t,{labelable:!0}));return{isPressed:M,buttonProps:ci(x,A,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"],"aria-disabled":t["aria-disabled"]})}}function kie(t,e,n){let{item:i,isDisabled:a}=t,s=i.key,r=e.selectionManager,o=P.useId(),c=P.useId(),u=e.disabledKeys.has(i.key)||a;P.useEffect(()=>{s===e.focusedKey&&document.activeElement!==n.current&&n.current&&Xf(n.current)},[n,s,e.focusedKey]);let h=P.useCallback(w=>{r.canSelectItem(s)&&(r.select(s,w),e.toggleKey(s))},[s,r]);const d=P.useCallback(w=>{r.selectionBehavior==="replace"&&r.extendSelection(w),r.setFocusedKey(w)},[r]),p=P.useCallback(w=>{const S={ArrowDown:()=>{const M=e.collection.getKeyAfter(s);if(M&&e.disabledKeys.has(M)){const C=e.collection.getKeyAfter(M);C&&d(C)}else M&&d(M)},ArrowUp:()=>{const M=e.collection.getKeyBefore(s);if(M&&e.disabledKeys.has(M)){const C=e.collection.getKeyBefore(M);C&&d(C)}else M&&d(M)},Home:()=>{const M=e.collection.getFirstKey();M&&d(M)},End:()=>{const M=e.collection.getLastKey();M&&d(M)}}[w.key];S&&(w.preventDefault(),r.canSelectItem(s)&&S(w))},[s,r]);let{buttonProps:g}=Vie({id:o,elementType:"button",isDisabled:u,onKeyDown:p,onPress:h},n),b=e.selectionManager.isSelected(i.key);return{buttonProps:{...g,"aria-expanded":b,"aria-controls":b?c:void 0},regionProps:{id:c,role:"region","aria-labelledby":o}}}function t5(t){return dY()?t.altKey:t.ctrlKey}function fS(t,e){var n,i;let a=`[data-key="${CSS.escape(String(e))}"]`,s=(n=t.current)===null||n===void 0?void 0:n.dataset.collection;return s&&(a=`[data-collection="${CSS.escape(s)}"]${a}`),(i=t.current)===null||i===void 0?void 0:i.querySelector(a)}const BB=new WeakMap;function Hie(t){let e=Us();return BB.set(t,e),e}function $ie(t){return BB.get(t)}const Gie=1e3;function UB(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:i}=t,a=P.useRef({search:"",timeout:void 0}).current,s=r=>{let o=Wie(r.key);if(!(!o||r.ctrlKey||r.metaKey||!r.currentTarget.contains(r.target)||a.search.length===0&&o===" ")){if(o===" "&&a.search.trim().length>0&&(r.preventDefault(),"continuePropagation"in r||r.stopPropagation()),a.search+=o,e.getKeyForSearch!=null){let c=e.getKeyForSearch(a.search,n.focusedKey);c==null&&(c=e.getKeyForSearch(a.search)),c!=null&&(n.setFocusedKey(c),i&&i(c))}clearTimeout(a.timeout),a.timeout=setTimeout(()=>{a.search=""},Gie)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?s:void 0}}}function Wie(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function jB(t){let{selectionManager:e,keyboardDelegate:n,ref:i,autoFocus:a=!1,shouldFocusWrap:s=!1,disallowEmptySelection:r=!1,disallowSelectAll:o=!1,escapeKeyBehavior:c="clearSelection",selectOnFocus:u=e.selectionBehavior==="replace",disallowTypeAhead:h=!1,shouldUseVirtualFocus:d,allowsTabNavigation:p=!1,isVirtualized:g,scrollRef:b=i,linkBehavior:w="action"}=t,{direction:x}=um(),S=vC(),M=H=>{var W;if(H.altKey&&H.key==="Tab"&&H.preventDefault(),!(!((W=i.current)===null||W===void 0)&&W.contains(H.target)))return;const J=(me,ne)=>{if(me!=null){if(e.isLink(me)&&w==="selection"&&u&&!t5(H)){cC.flushSync(()=>{e.setFocusedKey(me,ne)});let be=fS(i,me),xe=e.getItemProps(me);be&&S.open(be,H,xe.href,xe.routerOptions);return}if(e.setFocusedKey(me,ne),e.isLink(me)&&w==="override")return;H.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(me):u&&!t5(H)&&e.replaceSelection(me)}};switch(H.key){case"ArrowDown":if(n.getKeyBelow){var Y,K,ee;let me=e.focusedKey!=null?(Y=n.getKeyBelow)===null||Y===void 0?void 0:Y.call(n,e.focusedKey):(K=n.getFirstKey)===null||K===void 0?void 0:K.call(n);me==null&&s&&(me=(ee=n.getFirstKey)===null||ee===void 0?void 0:ee.call(n,e.focusedKey)),me!=null&&(H.preventDefault(),J(me))}break;case"ArrowUp":if(n.getKeyAbove){var ie,Z,ue;let me=e.focusedKey!=null?(ie=n.getKeyAbove)===null||ie===void 0?void 0:ie.call(n,e.focusedKey):(Z=n.getLastKey)===null||Z===void 0?void 0:Z.call(n);me==null&&s&&(me=(ue=n.getLastKey)===null||ue===void 0?void 0:ue.call(n,e.focusedKey)),me!=null&&(H.preventDefault(),J(me))}break;case"ArrowLeft":if(n.getKeyLeftOf){var se,ae,ce;let me=e.focusedKey!=null?(se=n.getKeyLeftOf)===null||se===void 0?void 0:se.call(n,e.focusedKey):null;me==null&&s&&(me=x==="rtl"?(ae=n.getFirstKey)===null||ae===void 0?void 0:ae.call(n,e.focusedKey):(ce=n.getLastKey)===null||ce===void 0?void 0:ce.call(n,e.focusedKey)),me!=null&&(H.preventDefault(),J(me,x==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var pe,ye,_e;let me=e.focusedKey!=null?(pe=n.getKeyRightOf)===null||pe===void 0?void 0:pe.call(n,e.focusedKey):null;me==null&&s&&(me=x==="rtl"?(ye=n.getLastKey)===null||ye===void 0?void 0:ye.call(n,e.focusedKey):(_e=n.getFirstKey)===null||_e===void 0?void 0:_e.call(n,e.focusedKey)),me!=null&&(H.preventDefault(),J(me,x==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&H.shiftKey)return;H.preventDefault();let me=n.getFirstKey(e.focusedKey,sg(H));e.setFocusedKey(me),me!=null&&(sg(H)&&H.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(me):u&&e.replaceSelection(me))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&H.shiftKey)return;H.preventDefault();let me=n.getLastKey(e.focusedKey,sg(H));e.setFocusedKey(me),me!=null&&(sg(H)&&H.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(me):u&&e.replaceSelection(me))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let me=n.getKeyPageBelow(e.focusedKey);me!=null&&(H.preventDefault(),J(me))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let me=n.getKeyPageAbove(e.focusedKey);me!=null&&(H.preventDefault(),J(me))}break;case"a":sg(H)&&e.selectionMode==="multiple"&&o!==!0&&(H.preventDefault(),e.selectAll());break;case"Escape":c==="clearSelection"&&!r&&e.selectedKeys.size!==0&&(H.stopPropagation(),H.preventDefault(),e.clearSelection());break;case"Tab":if(!p){if(H.shiftKey)i.current.focus();else{let me=ru(i.current,{tabbable:!0}),ne,be;do be=me.lastChild(),be&&(ne=be);while(be);ne&&!ne.contains(document.activeElement)&&or(ne)}break}}},C=P.useRef({top:0,left:0});pb(b,"scroll",g?void 0:()=>{var H,W,J,Y;C.current={top:(J=(H=b.current)===null||H===void 0?void 0:H.scrollTop)!==null&&J!==void 0?J:0,left:(Y=(W=b.current)===null||W===void 0?void 0:W.scrollLeft)!==null&&Y!==void 0?Y:0}});let A=H=>{if(e.isFocused){H.currentTarget.contains(H.target)||e.setFocused(!1);return}if(H.currentTarget.contains(H.target)){if(e.setFocused(!0),e.focusedKey==null){var W,J;let ee=Z=>{Z!=null&&(e.setFocusedKey(Z),u&&!e.isSelected(Z)&&e.replaceSelection(Z))},ie=H.relatedTarget;var Y,K;ie&&H.currentTarget.compareDocumentPosition(ie)&Node.DOCUMENT_POSITION_FOLLOWING?ee((Y=e.lastSelectedKey)!==null&&Y!==void 0?Y:(W=n.getLastKey)===null||W===void 0?void 0:W.call(n)):ee((K=e.firstSelectedKey)!==null&&K!==void 0?K:(J=n.getFirstKey)===null||J===void 0?void 0:J.call(n))}else!g&&b.current&&(b.current.scrollTop=C.current.top,b.current.scrollLeft=C.current.left);if(e.focusedKey!=null&&b.current){let ee=fS(i,e.focusedKey);ee instanceof HTMLElement&&(!ee.contains(document.activeElement)&&!d&&or(ee),Ff()==="keyboard"&&A8(ee,{containingElement:i.current}))}}},N=H=>{H.currentTarget.contains(H.relatedTarget)||e.setFocused(!1)},R=P.useRef(!1);pb(i,EY,d?H=>{let{detail:W}=H;H.stopPropagation(),e.setFocused(!0),W?.focusStrategy==="first"&&(R.current=!0)}:void 0);let D=xa(()=>{var H,W;let J=(W=(H=n.getFirstKey)===null||H===void 0?void 0:H.call(n))!==null&&W!==void 0?W:null;if(J==null){let Y=hr();Rz(i.current),Nz(Y,null),e.collection.size>0&&(R.current=!1)}else e.setFocusedKey(J),R.current=!1});M8(()=>{R.current&&D()},[e.collection,D]);let B=xa(()=>{e.collection.size>0&&(R.current=!1)});M8(()=>{B()},[e.focusedKey,B]),pb(i,wY,d?H=>{var W;H.stopPropagation(),e.setFocused(!1),!((W=H.detail)===null||W===void 0)&&W.clearFocusKey&&e.setFocusedKey(null)}:void 0);const z=P.useRef(a),I=P.useRef(!1);P.useEffect(()=>{if(z.current){var H,W;let K=null;var J;a==="first"&&(K=(J=(H=n.getFirstKey)===null||H===void 0?void 0:H.call(n))!==null&&J!==void 0?J:null);var Y;a==="last"&&(K=(Y=(W=n.getLastKey)===null||W===void 0?void 0:W.call(n))!==null&&Y!==void 0?Y:null);let ee=e.selectedKeys;if(ee.size){for(let ie of ee)if(e.canSelectItem(ie)){K=ie;break}}e.setFocused(!0),e.setFocusedKey(K),K==null&&!d&&i.current&&Xf(i.current),e.collection.size>0&&(z.current=!1,I.current=!0)}});let U=P.useRef(e.focusedKey),$=P.useRef(null);P.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==U.current||I.current)&&b.current&&i.current){let H=Ff(),W=fS(i,e.focusedKey);if(!(W instanceof HTMLElement))return;(H==="keyboard"||I.current)&&($.current&&cancelAnimationFrame($.current),$.current=requestAnimationFrame(()=>{b.current&&(TO(b.current,W),H!=="virtual"&&A8(W,{containingElement:i.current}))}))}!d&&e.isFocused&&e.focusedKey==null&&U.current!=null&&i.current&&Xf(i.current),U.current=e.focusedKey,I.current=!1}),P.useEffect(()=>()=>{$.current&&cancelAnimationFrame($.current)},[]),pb(i,"react-aria-focus-scope-restore",H=>{H.preventDefault(),e.setFocused(!0)});let G={onKeyDown:M,onFocus:A,onBlur:N,onMouseDown(H){b.current===H.target&&H.preventDefault()}},{typeSelectProps:k}=UB({keyboardDelegate:n,selectionManager:e});h||(G=ci(k,G));let X;d||(X=e.focusedKey==null?0:-1);let V=Hie(e.collection);return{collectionProps:ci(G,{tabIndex:X,"data-collection":V})}}function FB(t){let{id:e,selectionManager:n,key:i,ref:a,shouldSelectOnPressUp:s,shouldUseVirtualFocus:r,focus:o,isDisabled:c,onAction:u,allowsDifferentPressOrigin:h,linkBehavior:d="action"}=t,p=vC();e=Us(e);let g=Y=>{if(Y.pointerType==="keyboard"&&t5(Y))n.toggleSelection(i);else{if(n.selectionMode==="none")return;if(n.isLink(i)){if(d==="selection"&&a.current){let K=n.getItemProps(i);p.open(a.current,Y,K.href,K.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(d==="override"||d==="none")return}n.selectionMode==="single"?n.isSelected(i)&&!n.disallowEmptySelection?n.toggleSelection(i):n.replaceSelection(i):Y&&Y.shiftKey?n.extendSelection(i):n.selectionBehavior==="toggle"||Y&&(sg(Y)||Y.pointerType==="touch"||Y.pointerType==="virtual")?n.toggleSelection(i):n.replaceSelection(i)}};P.useEffect(()=>{i===n.focusedKey&&n.isFocused&&(r?Rz(a.current):o?o():document.activeElement!==a.current&&a.current&&Xf(a.current))},[a,i,n.focusedKey,n.childFocusStrategy,n.isFocused,r]),c=c||n.isDisabled(i);let b={};!r&&!c?b={tabIndex:i===n.focusedKey?0:-1,onFocus(Y){Y.target===a.current&&n.setFocusedKey(i)}}:c&&(b.onMouseDown=Y=>{Y.preventDefault()});let w=n.isLink(i)&&d==="override",x=u&&t.UNSTABLE_itemBehavior==="action",S=n.isLink(i)&&d!=="selection"&&d!=="none",M=!c&&n.canSelectItem(i)&&!w&&!x,C=(u||S)&&!c,A=C&&(n.selectionBehavior==="replace"?!M:!M||n.isEmpty),N=C&&M&&n.selectionBehavior==="replace",R=A||N,D=P.useRef(null),B=R&&M,z=P.useRef(!1),I=P.useRef(!1),U=n.getItemProps(i),$=Y=>{if(u){var K;u(),(K=a.current)===null||K===void 0||K.dispatchEvent(new CustomEvent("react-aria-item-action",{bubbles:!0}))}S&&a.current&&p.open(a.current,Y,U.href,U.routerOptions)},G={ref:a};if(s?(G.onPressStart=Y=>{D.current=Y.pointerType,z.current=B,Y.pointerType==="keyboard"&&(!R||zP())&&g(Y)},h?(G.onPressUp=A?void 0:Y=>{Y.pointerType==="mouse"&&M&&g(Y)},G.onPress=A?$:Y=>{Y.pointerType!=="keyboard"&&Y.pointerType!=="mouse"&&M&&g(Y)}):G.onPress=Y=>{if(A||N&&Y.pointerType!=="mouse"){if(Y.pointerType==="keyboard"&&!IP())return;$(Y)}else Y.pointerType!=="keyboard"&&M&&g(Y)}):(G.onPressStart=Y=>{D.current=Y.pointerType,z.current=B,I.current=A,M&&(Y.pointerType==="mouse"&&!A||Y.pointerType==="keyboard"&&(!C||zP()))&&g(Y)},G.onPress=Y=>{(Y.pointerType==="touch"||Y.pointerType==="pen"||Y.pointerType==="virtual"||Y.pointerType==="keyboard"&&R&&IP()||Y.pointerType==="mouse"&&I.current)&&(R?$(Y):M&&g(Y))}),b["data-collection"]=$ie(n.collection),b["data-key"]=i,G.preventFocusOnPress=r,r&&(G=ci(G,{onPressStart(Y){Y.pointerType!=="touch"&&(n.setFocused(!0),n.setFocusedKey(i))},onPress(Y){Y.pointerType==="touch"&&(n.setFocused(!0),n.setFocusedKey(i))}})),U)for(let Y of["onPressStart","onPressEnd","onPressChange","onPress","onPressUp","onClick"])U[Y]&&(G[Y]=ah(G[Y],U[Y]));let{pressProps:k,isPressed:X}=bo(G),V=N?Y=>{D.current==="mouse"&&(Y.stopPropagation(),Y.preventDefault(),$(Y))}:void 0,{longPressProps:H}=Tz({isDisabled:!B,onLongPress(Y){Y.pointerType==="touch"&&(g(Y),n.setSelectionBehavior("toggle"))}}),W=Y=>{D.current==="touch"&&z.current&&Y.preventDefault()},J=d!=="none"&&n.isLink(i)?Y=>{Gf.isOpening||Y.preventDefault()}:void 0;return{itemProps:ci(b,M||A||r&&!c?k:{},B?H:{},{onDoubleClick:V,onDragStartCapture:W,onClick:J,id:e},r?{onMouseDown:Y=>Y.preventDefault()}:void 0),isPressed:X,isSelected:n.isSelected(i),isFocused:n.isFocused&&n.focusedKey===i,isDisabled:c,allowsSelection:M,hasAction:R}}function IP(){let t=window.event;return t?.key==="Enter"}function zP(){let t=window.event;return t?.key===" "||t?.code==="Space"}class BP{getItemRect(e){let n=this.ref.current;if(!n)return null;let i=e!=null?fS(this.ref,e):null;if(!i)return null;let a=n.getBoundingClientRect(),s=i.getBoundingClientRect();return{x:s.left-a.left-n.clientLeft+n.scrollLeft,y:s.top-a.top-n.clientTop+n.scrollTop,width:s.width,height:s.height}}getContentSize(){let e=this.ref.current;var n,i;return{width:(n=e?.scrollWidth)!==null&&n!==void 0?n:0,height:(i=e?.scrollHeight)!==null&&i!==void 0?i:0}}getVisibleRect(){let e=this.ref.current;var n,i,a,s;return{x:(n=e?.scrollLeft)!==null&&n!==void 0?n:0,y:(i=e?.scrollTop)!==null&&i!==void 0?i:0,width:(a=e?.clientWidth)!==null&&a!==void 0?a:0,height:(s=e?.clientHeight)!==null&&s!==void 0?s:0}}constructor(e){this.ref=e}}class VB{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let i=e;for(;i!=null;){let a=this.collection.getItem(i);if(a?.type==="item"&&!this.isDisabled(a))return i;i=n(i)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,i=>this.collection.getKeyAfter(i))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,i=>this.collection.getKeyBefore(i))}findKey(e,n,i){let a=e,s=this.layoutDelegate.getItemRect(a);if(!s||a==null)return null;let r=s;do{if(a=n(a),a==null)break;s=this.layoutDelegate.getItemRect(a)}while(s&&i(r,s)&&a!=null);return a}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,i=>this.layoutDelegate[n](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,i=>this.getNextColumn(i,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,i=>this.layoutDelegate[n](i))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,i=>this.getNextColumn(i,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,i=this.layoutDelegate.getItemRect(e);if(!i)return null;if(n&&!Pg(n))return this.getFirstKey();let a=e;if(this.orientation==="horizontal"){let s=Math.max(0,i.x+i.width-this.layoutDelegate.getVisibleRect().width);for(;i&&i.x>s&&a!=null;)a=this.getKeyAbove(a),i=a==null?null:this.layoutDelegate.getItemRect(a)}else{let s=Math.max(0,i.y+i.height-this.layoutDelegate.getVisibleRect().height);for(;i&&i.y>s&&a!=null;)a=this.getKeyAbove(a),i=a==null?null:this.layoutDelegate.getItemRect(a)}return a??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,i=this.layoutDelegate.getItemRect(e);if(!i)return null;if(n&&!Pg(n))return this.getLastKey();let a=e;if(this.orientation==="horizontal"){let s=Math.min(this.layoutDelegate.getContentSize().width,i.y-i.width+this.layoutDelegate.getVisibleRect().width);for(;i&&i.x<s&&a!=null;)a=this.getKeyBelow(a),i=a==null?null:this.layoutDelegate.getItemRect(a)}else{let s=Math.min(this.layoutDelegate.getContentSize().height,i.y-i.height+this.layoutDelegate.getVisibleRect().height);for(;i&&i.y<s&&a!=null;)a=this.getKeyBelow(a),i=a==null?null:this.layoutDelegate.getItemRect(a)}return a??this.getLastKey()}getKeyForSearch(e,n){if(!this.collator)return null;let i=this.collection,a=n||this.getFirstKey();for(;a!=null;){let s=i.getItem(a);if(!s)return null;let r=s.textValue.slice(0,e.length);if(s.textValue&&this.collator.compare(r,e)===0)return a;a=this.getNextKey(a)}return null}constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new BP(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new BP(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}function kB(t){let{selectionManager:e,collection:n,disabledKeys:i,ref:a,keyboardDelegate:s,layoutDelegate:r}=t,o=DO({usage:"search",sensitivity:"base"}),c=e.disabledBehavior,u=P.useMemo(()=>s||new VB({collection:n,disabledKeys:i,disabledBehavior:c,ref:a,collator:o,layoutDelegate:r}),[s,r,n,i,a,o,c]),{collectionProps:h}=jB({...t,ref:a,selectionManager:e,keyboardDelegate:u});return{listProps:h}}function Kie(t,e,n){let{listProps:i}=kB({...t,...e,allowsTabNavigation:!0,disallowSelectAll:!0,ref:n});return delete i.onKeyDownCapture,{accordionProps:{...i,tabIndex:void 0}}}function Xie(t){var e,n;const i=fa(),{ref:a,as:s,item:r,onFocusChange:o}=t,{state:c,className:u,indicator:h,children:d,title:p,subtitle:g,startContent:b,motionProps:w,focusedKey:x,variant:S,isCompact:M=!1,classNames:C={},isDisabled:A=!1,hideIndicator:N=!1,disableAnimation:R=(e=i?.disableAnimation)!=null?e:!1,keepContentMounted:D=!1,disableIndicatorAnimation:B=!1,HeadingComponent:z=s||"h2",onPress:I,onPressStart:U,onPressEnd:$,onPressChange:G,onPressUp:k,onClick:X,...V}=t,H=s||"div",W=typeof H=="string",J=_i(a),Y=c.disabledKeys.has(r.key)||A,K=c.selectionManager.isSelected(r.key),{buttonProps:ee,regionProps:ie}=kie({item:r,isDisabled:Y},{...c,focusedKey:x},J),{onFocus:Z,onBlur:ue,...se}=ee,{isFocused:ae,isFocusVisible:ce,focusProps:pe}=Ts({autoFocus:(n=r.props)==null?void 0:n.autoFocus}),{isHovered:ye,hoverProps:_e}=Qa({isDisabled:Y}),{pressProps:me,isPressed:ne}=bo({ref:J,isDisabled:Y,onPress:I,onPressStart:U,onPressEnd:$,onPressChange:G,onPressUp:k}),be=P.useCallback(()=>{o?.(!0,r.key)},[]),xe=P.useCallback(()=>{o?.(!1,r.key)},[]),he=P.useMemo(()=>({...C}),[ks(C)]),ve=P.useMemo(()=>zie({isCompact:M,isDisabled:Y,hideIndicator:N,disableAnimation:R,disableIndicatorAnimation:B,variant:S}),[M,Y,N,R,B,S]),Oe=Vt(he?.base,u),Le=P.useCallback((Ce={})=>({"data-open":He(K),"data-disabled":He(Y),"data-slot":"base",className:ve.base({class:Oe}),...Yt(cs(V,{enabled:W}),Ce)}),[Oe,W,V,ve,r.props,K,Y]),Ae=(Ce={})=>{var Ie,Pe;return{ref:J,"data-open":He(K),"data-focus":He(ae),"data-focus-visible":He(ce),"data-disabled":He(Y),"data-hover":He(ye),"data-pressed":He(ne),"data-slot":"trigger",className:ve.trigger({class:he?.trigger}),onFocus:p8(be,Z,pe.onFocus,V.onFocus,(Ie=r.props)==null?void 0:Ie.onFocus),onBlur:p8(xe,ue,pe.onBlur,V.onBlur,(Pe=r.props)==null?void 0:Pe.onBlur),...Yt(se,_e,me,Ce,{onClick:$r(me.onClick,X)})}},et=P.useCallback((Ce={})=>({"data-open":He(K),"data-disabled":He(Y),"data-slot":"content",className:ve.content({class:he?.content}),...Yt(ie,Ce)}),[ve,he,ie,K,Y,he?.content]),tt=P.useCallback((Ce={})=>({"aria-hidden":He(!0),"data-open":He(K),"data-disabled":He(Y),"data-slot":"indicator",className:ve.indicator({class:he?.indicator}),...Ce}),[ve,he?.indicator,K,Y,he?.indicator]),re=P.useCallback((Ce={})=>({"data-open":He(K),"data-disabled":He(Y),"data-slot":"heading",className:ve.heading({class:he?.heading}),...Ce}),[ve,he?.heading,K,Y,he?.heading]),te=P.useCallback((Ce={})=>({"data-open":He(K),"data-disabled":He(Y),"data-slot":"title",className:ve.title({class:he?.title}),...Ce}),[ve,he?.title,K,Y,he?.title]),we=P.useCallback((Ce={})=>({"data-open":He(K),"data-disabled":He(Y),"data-slot":"subtitle",className:ve.subtitle({class:he?.subtitle}),...Ce}),[ve,he,K,Y,he?.subtitle]);return{Component:H,HeadingComponent:z,item:r,slots:ve,classNames:he,domRef:J,indicator:h,children:d,title:p,subtitle:g,startContent:b,isOpen:K,isDisabled:Y,hideIndicator:N,keepContentMounted:D,disableAnimation:R,motionProps:w,getBaseProps:Le,getHeadingProps:re,getButtonProps:Ae,getContentProps:et,getIndicatorProps:tt,getTitleProps:te,getSubtitleProps:we}}var qie=t=>_.jsx("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{d:`
M12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2Z
M16.78 9.7L11.11 15.37C10.97 15.51 10.78 15.59 10.58 15.59C10.38 15.59 10.19 15.51 10.05 15.37L7.22 12.54
C6.93 12.25 6.93 11.77 7.22 11.48C7.51 11.19 7.99 11.19 8.28 11.48L10.58 13.78L15.72 8.64
C16.01 8.35 16.49 8.35 16.78 8.64C17.07 8.93 17.07 9.4 16.78 9.7Z
`})}),Yie=t=>_.jsx("svg",{className:"fill-current",fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{clipRule:"evenodd",d:"M3 10.417C3 7.219 3 5.62 3.378 5.082C3.755 4.545 5.258 4.03 8.265 3.001L8.838 2.805C10.405 2.268 11.188 2 12 2C12.812 2 13.595 2.268 15.162 2.805L15.735 3.001C18.742 4.03 20.245 4.545 20.622 5.082C21 5.62 21 7.22 21 10.417V11.991C21 17.629 16.761 20.366 14.101 21.527C13.38 21.842 13.02 22 12 22C10.98 22 10.62 21.842 9.899 21.527C7.239 20.365 3 17.63 3 11.991V10.417ZM12 7.25C12.1989 7.25 12.3897 7.32902 12.5303 7.46967C12.671 7.61032 12.75 7.80109 12.75 8V12C12.75 12.1989 12.671 12.3897 12.5303 12.5303C12.3897 12.671 12.1989 12.75 12 12.75C11.8011 12.75 11.6103 12.671 11.4697 12.5303C11.329 12.3897 11.25 12.1989 11.25 12V8C11.25 7.80109 11.329 7.61032 11.4697 7.46967C11.6103 7.32902 11.8011 7.25 12 7.25ZM12 16C12.2652 16 12.5196 15.8946 12.7071 15.7071C12.8946 15.5196 13 15.2652 13 15C13 14.7348 12.8946 14.4804 12.7071 14.2929C12.5196 14.1054 12.2652 14 12 14C11.7348 14 11.4804 14.1054 11.2929 14.2929C11.1054 14.4804 11 14.7348 11 15C11 15.2652 11.1054 15.5196 11.2929 15.7071C11.4804 15.8946 11.7348 16 12 16Z",fill:"currentColor",fillRule:"evenodd"})}),RE=t=>_.jsx("svg",{fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{d:"M12 22C17.51 22 22 17.51 22 12C22 6.49 17.51 2 12 2C6.49 2 2 6.49 2 12C2 17.51 6.49 22 12 22ZM12.75 16C12.75 16.41 12.41 16.75 12 16.75C11.59 16.75 11.25 16.41 11.25 16L11.25 11C11.25 10.59 11.59 10.25 12 10.25C12.41 10.25 12.75 10.59 12.75 11L12.75 16ZM11.08 7.62C11.13 7.49 11.2 7.39 11.29 7.29C11.39 7.2 11.5 7.13 11.62 7.08C11.74 7.03 11.87 7 12 7C12.13 7 12.26 7.03 12.38 7.08C12.5 7.13 12.61 7.2 12.71 7.29C12.8 7.39 12.87 7.49 12.92 7.62C12.97 7.74 13 7.87 13 8C13 8.13 12.97 8.26 12.92 8.38C12.87 8.5 12.8 8.61 12.71 8.71C12.61 8.8 12.5 8.87 12.38 8.92C12.14 9.02 11.86 9.02 11.62 8.92C11.5 8.87 11.39 8.8 11.29 8.71C11.2 8.61 11.13 8.5 11.08 8.38C11.03 8.26 11 8.13 11 8C11 7.87 11.03 7.74 11.08 7.62Z"})}),Zie=({strokeWidth:t=1.5,...e})=>_.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,viewBox:"0 0 24 24",width:"1em",...e,children:_.jsx("path",{d:"m18 15-6-6-6 6"})}),UP=t=>_.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...t,children:_.jsx("path",{d:"M15.5 19l-7-7 7-7",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5"})}),ex=t=>_.jsx("svg",{"aria-hidden":"true",focusable:"false",height:"1em",role:"presentation",viewBox:"0 0 24 24",width:"1em",...t,children:_.jsx("path",{d:"M12 2a10 10 0 1010 10A10.016 10.016 0 0012 2zm3.36 12.3a.754.754 0 010 1.06.748.748 0 01-1.06 0l-2.3-2.3-2.3 2.3a.748.748 0 01-1.06 0 .754.754 0 010-1.06l2.3-2.3-2.3-2.3A.75.75 0 019.7 8.64l2.3 2.3 2.3-2.3a.75.75 0 011.06 1.06l-2.3 2.3z",fill:"currentColor"})}),HB=t=>{const{isSelected:e,isIndeterminate:n,disableAnimation:i,...a}=t;return _.jsx("svg",{"aria-hidden":"true",className:"fill-current",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24",width:"1em",...a,children:_.jsx("path",{d:"M18 6L6 18M6 6l12 12"})})},Qie=t=>_.jsx("svg",{className:"fill-current",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",...t,children:_.jsx("path",{d:"M17.51 3.85L11.57 0.42C10.6 -0.14 9.4 -0.14 8.42 0.42L2.49 3.85C1.52 4.41 0.919998 5.45 0.919998 6.58V13.42C0.919998 14.54 1.52 15.58 2.49 16.15L8.43 19.58C9.4 20.14 10.6 20.14 11.58 19.58L17.52 16.15C18.49 15.59 19.09 14.55 19.09 13.42V6.58C19.08 5.45 18.48 4.42 17.51 3.85ZM9.25 5.75C9.25 5.34 9.59 5 10 5C10.41 5 10.75 5.34 10.75 5.75V11C10.75 11.41 10.41 11.75 10 11.75C9.59 11.75 9.25 11.41 9.25 11V5.75ZM10.92 14.63C10.87 14.75 10.8 14.86 10.71 14.96C10.52 15.15 10.27 15.25 10 15.25C9.87 15.25 9.74 15.22 9.62 15.17C9.49 15.12 9.39 15.05 9.29 14.96C9.2 14.86 9.13 14.75 9.07 14.63C9.02 14.51 9 14.38 9 14.25C9 13.99 9.1 13.73 9.29 13.54C9.39 13.45 9.49 13.38 9.62 13.33C9.99 13.17 10.43 13.26 10.71 13.54C10.8 13.64 10.87 13.74 10.92 13.87C10.97 13.99 11 14.12 11 14.25C11 14.38 10.97 14.51 10.92 14.63Z"})}),$B=({strokeWidth:t=1.5,...e})=>_.jsx("svg",{"aria-hidden":"true",fill:"none",focusable:"false",height:"1em",role:"presentation",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:t,viewBox:"0 0 24 24",width:"1em",...e,children:_.jsx("path",{d:"m6 9 6 6 6-6"})}),Rb={ease:[.36,.66,.4,1]},qf={scaleSpring:{enter:{transform:"scale(1)",opacity:1,transition:{type:"spring",bounce:0,duration:.2}},exit:{transform:"scale(0.85)",opacity:0,transition:{type:"easeOut",duration:.15}}},scaleSpringOpacity:{initial:{opacity:0,transform:"scale(0.8)"},enter:{opacity:1,transform:"scale(1)",transition:{type:"spring",bounce:0,duration:.3}},exit:{opacity:0,transform:"scale(0.96)",transition:{type:"easeOut",bounce:0,duration:.15}}},fade:{enter:{opacity:1,transition:{duration:.4,ease:Rb.ease}},exit:{opacity:0,transition:{duration:.3,ease:Rb.ease}}},collapse:{enter:{opacity:1,height:"auto",transition:{height:{type:"spring",bounce:0,duration:.3},opacity:{easings:"ease",duration:.4}}},exit:{opacity:0,height:0,transition:{easings:"ease",duration:.3}}}},jP=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),GB=Si((t,e)=>{const{Component:n,HeadingComponent:i,classNames:a,slots:s,indicator:r,children:o,title:c,subtitle:u,startContent:h,isOpen:d,isDisabled:p,hideIndicator:g,keepContentMounted:b,disableAnimation:w,motionProps:x,getBaseProps:S,getHeadingProps:M,getButtonProps:C,getTitleProps:A,getSubtitleProps:N,getContentProps:R,getIndicatorProps:D}=Xie({...t,ref:e}),B=Mte(),I=P.useMemo(()=>typeof r=="function"?r({indicator:_.jsx(UP,{}),isOpen:d,isDisabled:p}):r||null,[r,d,p])||_.jsx(UP,{}),U=P.useMemo(()=>{if(w)return b?_.jsx("div",{...R(),children:o}):d&&_.jsx("div",{...R(),children:o});const $={exit:{...qf.collapse.exit,overflowY:"hidden"},enter:{...qf.collapse.enter,overflowY:"unset"}};return b?_.jsx(Al,{features:jP,children:_.jsx(Rl.section,{animate:d?"enter":"exit",exit:"exit",initial:"exit",style:{willChange:B},variants:$,onKeyDown:G=>{G.stopPropagation()},...x,children:_.jsx("div",{...R(),children:o})},"accordion-content")}):_.jsx(Hs,{initial:!1,children:d&&_.jsx(Al,{features:jP,children:_.jsx(Rl.section,{animate:"enter",exit:"exit",initial:"exit",style:{willChange:B},variants:$,onKeyDown:G=>{G.stopPropagation()},...x,children:_.jsx("div",{...R(),children:o})},"accordion-content")})})},[d,w,b,o,x]);return _.jsxs(n,{...S(),children:[_.jsx(i,{...M(),children:_.jsxs("button",{...C(),children:[h&&_.jsx("div",{className:s.startContent({class:a?.startContent}),children:h}),_.jsxs("div",{className:s.titleWrapper({class:a?.titleWrapper}),children:[c&&_.jsx("span",{...A(),children:c}),u&&_.jsx("span",{...N(),children:u})]}),!g&&I&&_.jsx("span",{...D(),children:I})]})}),U]})});GB.displayName="HeroUI.AccordionItem";var Jie=GB;class eae{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var i;return n&&(i=n.prevKey)!==null&&i!==void 0?i:null}getKeyAfter(e){let n=this.keyMap.get(e);var i;return n&&(i=n.nextKey)!==null&&i!==void 0?i:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}constructor(e,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,n=n||new Set;let i=o=>{if(this.keyMap.set(o.key,o),o.childNodes&&(o.type==="section"||n.has(o.key)))for(let c of o.childNodes)i(c)};for(let o of e)i(o);let a=null,s=0;for(let[o,c]of this.keyMap)a?(a.nextKey=o,c.prevKey=a.key):(this.firstKey=o,c.prevKey=void 0),c.type==="item"&&(c.index=s++),a=c,a.nextKey=void 0;var r;this.lastKey=(r=a?.key)!==null&&r!==void 0?r:null}}class oc extends Set{constructor(e,n,i){super(e),e instanceof oc?(this.anchorKey=n??e.anchorKey,this.currentKey=i??e.currentKey):(this.anchorKey=n??null,this.currentKey=i??null)}}function tae(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function WB(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:i,selectionBehavior:a="toggle",disabledBehavior:s="all"}=t,r=P.useRef(!1),[,o]=P.useState(!1),c=P.useRef(null),u=P.useRef(null),[,h]=P.useState(null),d=P.useMemo(()=>FP(t.selectedKeys),[t.selectedKeys]),p=P.useMemo(()=>FP(t.defaultSelectedKeys,new oc),[t.defaultSelectedKeys]),[g,b]=sh(d,p,t.onSelectionChange),w=P.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[x,S]=P.useState(a);a==="replace"&&x==="toggle"&&typeof g=="object"&&g.size===0&&S("replace");let M=P.useRef(a);return P.useEffect(()=>{a!==M.current&&(S(a),M.current=a)},[a]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:x,setSelectionBehavior:S,get isFocused(){return r.current},setFocused(C){r.current=C,o(C)},get focusedKey(){return c.current},get childFocusStrategy(){return u.current},setFocusedKey(C,A="first"){c.current=C,u.current=A,h(C)},selectedKeys:g,setSelectedKeys(C){(i||!tae(C,g))&&b(C)},disabledKeys:w,disabledBehavior:s}}function FP(t,e){return t?t==="all"?"all":new oc(t):e}function KB(t){return null}KB.getCollectionNode=function*(e,n){let{childItems:i,title:a,children:s}=e,r=e.title||e.children,o=e.textValue||(typeof r=="string"?r:"")||e["aria-label"]||"";!o&&n?.suppressTextValueWarning,yield{type:"item",props:e,rendered:r,textValue:o,"aria-label":e["aria-label"],hasChildNodes:nae(e),*childNodes(){if(i)for(let c of i)yield{type:"item",value:c};else if(a){let c=[];ft.Children.forEach(s,u=>{c.push({type:"item",element:u})}),yield*c}}}};function nae(t){return t.hasChildItems!=null?t.hasChildItems:!!(t.childItems||t.title&&ft.Children.count(t.children)>0)}let oA=KB;class iae{build(e,n){return this.context=n,VP(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:i}=e;if(ft.isValidElement(n)&&n.type===ft.Fragment)yield*this.iterateCollection({children:n.props.children,items:i});else if(typeof n=="function"){if(!i)throw new Error("props.children was a function but props.items is missing");let a=0;for(let s of i)yield*this.getFullNode({value:s,index:a},{renderer:n}),a++}else{let a=[];ft.Children.forEach(n,r=>{r&&a.push(r)});let s=0;for(let r of a){let o=this.getFullNode({element:r,index:s},{});for(let c of o)s++,yield c}}}getKey(e,n,i,a){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${a}${n.key}`;let s=n.value;if(s!=null){var r;let o=(r=s.key)!==null&&r!==void 0?r:s.id;if(o==null)throw new Error("No key found for item");return o}return a?`${a}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,i,a){if(ft.isValidElement(e.element)&&e.element.type===ft.Fragment){let x=[];ft.Children.forEach(e.element.props.children,M=>{x.push(M)});var s;let S=(s=e.index)!==null&&s!==void 0?s:0;for(const M of x)yield*this.getFullNode({element:M,index:S++},n,i,a);return}let r=e.element;if(!r&&e.value&&n&&n.renderer){let x=this.cache.get(e.value);if(x&&(!x.shouldInvalidate||!x.shouldInvalidate(this.context))){x.index=e.index,x.parentKey=a?a.key:null,yield x;return}r=n.renderer(e.value)}if(ft.isValidElement(r)){let x=r.type;if(typeof x!="function"&&typeof x.getCollectionNode!="function"){let A=r.type;throw new Error(`Unknown element <${A}> in collection.`)}let S=x.getCollectionNode(r.props,this.context);var o;let M=(o=e.index)!==null&&o!==void 0?o:0,C=S.next();for(;!C.done&&C.value;){let A=C.value;e.index=M;var c;let N=(c=A.key)!==null&&c!==void 0?c:null;N==null&&(N=A.element?null:this.getKey(r,e,n,i));let D=[...this.getFullNode({...A,key:N,index:M,wrapper:aae(e.wrapper,A.wrapper)},this.getChildState(n,A),i?`${i}${r.key}`:r.key,a)];for(let B of D){var u,h;B.value=(h=(u=A.value)!==null&&u!==void 0?u:e.value)!==null&&h!==void 0?h:null,B.value&&this.cache.set(B.value,B);var d;if(e.type&&B.type!==e.type)throw new Error(`Unsupported type <${NE(B.type)}> in <${NE((d=a?.type)!==null&&d!==void 0?d:"unknown parent type")}>. Only <${NE(e.type)}> is supported.`);M++,yield B}C=S.next(D)}return}if(e.key==null||e.type==null)return;let p=this;var g,b;let w={type:e.type,props:e.props,key:e.key,parentKey:a?a.key:null,value:(g=e.value)!==null&&g!==void 0?g:null,level:a?a.level+1:0,index:e.index,rendered:e.rendered,textValue:(b=e.textValue)!==null&&b!==void 0?b:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:VP(function*(){if(!e.hasChildNodes||!e.childNodes)return;let x=0;for(let S of e.childNodes()){S.key!=null&&(S.key=`${w.key}${S.key}`);let M=p.getFullNode({...S,index:x},p.getChildState(n,S),w.key,w);for(let C of M)x++,yield C}})};yield w}constructor(){this.cache=new WeakMap}}function VP(t){let e=[],n=null;return{*[Symbol.iterator](){for(let i of e)yield i;n||(n=t());for(let i of n)e.push(i),yield i}}}function aae(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function NE(t){return t[0].toUpperCase()+t.slice(1)}function XB(t,e,n){let i=P.useMemo(()=>new iae,[]),{children:a,items:s,collection:r}=t;return P.useMemo(()=>{if(r)return r;let c=i.build({children:a,items:s},n);return e(c)},[i,a,s,r,n,e])}function qB(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function sae(t){return rae(t)}function rae(t,e){for(let n of t)return n}function PE(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let i=[...kP(t,e),e],a=[...kP(t,n),n],s=i.slice(0,a.length).findIndex((r,o)=>r!==a[o]);return s!==-1?(e=i[s],n=a[s],e.index-n.index):i.findIndex(r=>r===n)>=0?1:(a.findIndex(r=>r===e)>=0,-1)}function kP(t,e){let n=[],i=e;for(;i?.parentKey!=null;)i=t.getItem(i.parentKey),i&&n.unshift(i);return n}const HP=new WeakMap;function oae(t){let e=HP.get(t);if(e!=null)return e;let n=0,i=a=>{for(let s of a)s.type==="section"?i(qB(s,t)):s.type==="item"&&n++};return i(t),HP.set(t,n),n}class dw{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(i=>n.has(i)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let a=this.collection.getItem(i);(!e||a&&PE(this.collection,a,e)<0)&&(e=a)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let i of this.state.selectedKeys){let a=this.collection.getItem(i);(!e||a&&PE(this.collection,a,e)>0)&&(e=a)}var n;return(n=e?.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let i;if(this.state.selectedKeys==="all")i=new oc([n],n,n);else{let r=this.state.selectedKeys;var a;let o=(a=r.anchorKey)!==null&&a!==void 0?a:n;i=new oc(r,o,n);var s;for(let c of this.getKeyRange(o,(s=r.currentKey)!==null&&s!==void 0?s:n))i.delete(c);for(let c of this.getKeyRange(n,o))this.canSelectItem(c)&&i.add(c)}this.state.setSelectedKeys(i)}getKeyRange(e,n){let i=this.collection.getItem(e),a=this.collection.getItem(n);return i&&a?PE(this.collection,i,a)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var i;if(!((i=this.layoutDelegate)===null||i===void 0)&&i.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let a=[],s=e;for(;s!=null;){let r=this.collection.getItem(s);if(r&&(r.type==="item"||r.type==="cell"&&this.allowsCellSelection)&&a.push(s),s===n)return a;s=this.collection.getKeyAfter(s)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let i=new oc(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);i.has(n)?i.delete(n):this.canSelectItem(n)&&(i.add(n),i.anchorKey=n,i.currentKey=n),!(this.disallowEmptySelection&&i.size===0)&&this.state.setSelectedKeys(i)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let i=this.canSelectItem(n)?new oc([n],n,n):new oc;this.state.setSelectedKeys(i)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new oc;for(let i of e){let a=this.getKey(i);if(a!=null&&(n.add(a),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=i=>{for(;i!=null;){if(this.canSelectItem(i)){var a;let r=this.collection.getItem(i);r?.type==="item"&&e.push(i);var s;r?.hasChildNodes&&(this.allowsCellSelection||r.type!=="item")&&n((s=(a=sae(qB(r,this.collection)))===null||a===void 0?void 0:a.key)!==null&&s!==void 0?s:null)}i=this.collection.getKeyAfter(i)}};return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new oc)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let i of e)if(!n.has(i))return!1;for(let i of n)if(!e.has(i))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let i=this.collection.getItem(e);return!(!i||!(i==null||(n=i.props)===null||n===void 0)&&n.isDisabled||i.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,i;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((i=this.collection.getItem(e))===null||i===void 0||(n=i.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,i;return!!(!((i=this.collection.getItem(e))===null||i===void 0||(n=i.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}withCollection(e){return new dw(e,this.state,{allowsCellSelection:this.allowsCellSelection,layoutDelegate:this.layoutDelegate||void 0})}constructor(e,n,i){this.collection=e,this.state=n;var a;this.allowsCellSelection=(a=i?.allowsCellSelection)!==null&&a!==void 0?a:!1,this._isSelectAll=null,this.layoutDelegate=i?.layoutDelegate||null}}function lae(t){let{onExpandedChange:e}=t,[n,i]=sh(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),a=WB(t),s=P.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),r=XB(t,P.useCallback(c=>new eae(c,{expandedKeys:n}),[n]),null);return P.useEffect(()=>{a.focusedKey!=null&&!r.getItem(a.focusedKey)&&a.setFocusedKey(null)},[r,a.focusedKey]),{collection:r,expandedKeys:n,disabledKeys:s,toggleKey:c=>{i(cae(n,c))},setExpandedKeys:i,selectionManager:new dw(r,a)}}function cae(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}function uae(t){var e;const n=fa(),{ref:i,as:a,className:s,items:r,variant:o,motionProps:c,expandedKeys:u,disabledKeys:h,selectedKeys:d,children:p,defaultExpandedKeys:g,selectionMode:b="single",selectionBehavior:w="toggle",keepContentMounted:x=!1,disallowEmptySelection:S,defaultSelectedKeys:M,onExpandedChange:C,onSelectionChange:A,dividerProps:N={},isCompact:R=!1,isDisabled:D=!1,showDivider:B=!0,hideIndicator:z=!1,disableAnimation:I=(e=n?.disableAnimation)!=null?e:!1,disableIndicatorAnimation:U=!1,itemClasses:$,...G}=t,[k,X]=P.useState(null),V=a||"div",H=typeof V=="string",W=_i(i),J=P.useMemo(()=>Iie({variant:o,className:s}),[o,s]),K={children:P.useMemo(()=>{let pe=[];return ft.Children.map(p,ye=>{var _e;if(ft.isValidElement(ye)&&typeof((_e=ye.props)==null?void 0:_e.children)!="string"){const me=ft.cloneElement(ye,{hasChildItems:!1});pe.push(me)}else pe.push(ye)}),pe},[p]),items:r},ee={expandedKeys:u,defaultExpandedKeys:g,onExpandedChange:C},ie={disabledKeys:h,selectedKeys:d,selectionMode:b,selectionBehavior:w,disallowEmptySelection:S,defaultSelectedKeys:M??g,onSelectionChange:A,...K,...ee},Z=lae(ie);Z.selectionManager.setFocusedKey=pe=>{X(pe)};const{accordionProps:ue}=Kie({...K,...ee},Z,W),se=P.useMemo(()=>({state:Z,focusedKey:k,motionProps:c,isCompact:R,isDisabled:D,hideIndicator:z,disableAnimation:I,keepContentMounted:x,disableIndicatorAnimation:U}),[k,R,D,z,d,I,x,Z?.expandedKeys.values,U,Z.expandedKeys.size,Z.disabledKeys.size,c]),ae=P.useCallback((pe={})=>({ref:W,className:J,"data-orientation":"vertical",...Yt(ue,cs(G,{enabled:H}),pe)}),[]),ce=P.useCallback((pe,ye)=>{pe&&X(ye)},[]);return{Component:V,values:se,state:Z,focusedKey:k,getBaseProps:ae,isSplitted:o==="splitted",classNames:J,showDivider:B,dividerProps:N,disableAnimation:I,handleFocusChanged:ce,itemClasses:$}}function dae(t){let e=cs(t,{enabled:typeof t.elementType=="string"}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}function fae(t){const{as:e,className:n,orientation:i,...a}=t;let s=e||"hr";s==="hr"&&i==="vertical"&&(s="div");const{separatorProps:r}=dae({elementType:typeof s=="string"?s:"hr",orientation:i}),o=P.useMemo(()=>Die({orientation:i,className:n}),[i,n]),c=P.useCallback((u={})=>({className:o,role:"separator","data-orientation":i,...r,...a,...u}),[o,i,r,a]);return{Component:s,getDividerProps:c}}var YB=Si((t,e)=>{const{Component:n,getDividerProps:i}=fae({...t});return _.jsx(n,{ref:e,...i()})});YB.displayName="HeroUI.Divider";var pg=YB,ZB=Si((t,e)=>{const{Component:n,values:i,state:a,isSplitted:s,showDivider:r,getBaseProps:o,disableAnimation:c,handleFocusChanged:u,itemClasses:h,dividerProps:d}=uae({...t,ref:e}),p=P.useCallback((b,w)=>u(b,w),[u]),g=P.useMemo(()=>[...a.collection].map((b,w)=>{const x={...h,...b.props.classNames||{}};return _.jsxs(P.Fragment,{children:[_.jsx(Jie,{item:b,variant:t.variant,onFocusChange:p,...i,...b.props,classNames:x}),!b.props.hidden&&!s&&r&&w<a.collection.size-1&&_.jsx(pg,{...d})]},b.key)}),[i,h,p,s,r,a.collection]);return _.jsx(n,{...o(),children:c?g:_.jsx(WQ,{children:g})})});ZB.displayName="HeroUI.Accordion";var hae=ZB,lA=t=>{const e={top:{originY:1},bottom:{originY:0},left:{originX:1},right:{originX:0},"top-start":{originX:0,originY:1},"top-end":{originX:1,originY:1},"bottom-start":{originX:0,originY:0},"bottom-end":{originX:1,originY:0},"right-start":{originX:0,originY:0},"right-end":{originX:0,originY:1},"left-start":{originX:1,originY:0},"left-end":{originX:1,originY:1}};return e?.[t]||{}},QB=t=>({top:"top",bottom:"bottom",left:"left",right:"right","top-start":"top start","top-end":"top end","bottom-start":"bottom start","bottom-end":"bottom end","left-start":"left top","left-end":"left bottom","right-start":"right top","right-end":"right bottom"})[t],pae=(t,e)=>{if(e.includes("-")){const[n]=e.split("-");if(n.includes(t))return!1}return!0},FS=(t,e)=>{if(e.includes("-")){const[,n]=e.split("-");return`${t}-${n}`}return t},Xy=new WeakMap,ro=[];function mae(t,e=document.body){let n=new Set(t),i=new Set,a=c=>{for(let p of c.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(p);let u=p=>{if(n.has(p)||p.parentElement&&i.has(p.parentElement)&&p.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let g of n)if(p.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},h=document.createTreeWalker(c,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(c);if(d===NodeFilter.FILTER_ACCEPT&&s(c),d!==NodeFilter.FILTER_REJECT){let p=h.nextNode();for(;p!=null;)s(p),p=h.nextNode()}},s=c=>{var u;let h=(u=Xy.get(c))!=null?u:0;c.getAttribute("aria-hidden")==="true"&&h===0||(h===0&&c.setAttribute("aria-hidden","true"),i.add(c),Xy.set(c,h+1))};ro.length&&ro[ro.length-1].disconnect(),a(e);let r=new MutationObserver(c=>{for(let u of c)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...i].some(h=>h.contains(u.target))){for(let h of u.removedNodes)h instanceof Element&&(n.delete(h),i.delete(h));for(let h of u.addedNodes)(h instanceof HTMLElement||h instanceof SVGElement)&&(h.dataset.liveAnnouncer==="true"||h.dataset.reactAriaTopLayer==="true")?n.add(h):h instanceof Element&&a(h)}});r.observe(e,{childList:!0,subtree:!0});let o={visibleNodes:n,hiddenNodes:i,observe(){r.observe(e,{childList:!0,subtree:!0})},disconnect(){r.disconnect()}};return ro.push(o),()=>{r.disconnect();for(let c of i){let u=Xy.get(c);u!=null&&(u===1?(c.removeAttribute("aria-hidden"),Xy.delete(c)):Xy.set(c,u-1))}o===ro[ro.length-1]?(ro.pop(),ro.length&&ro[ro.length-1].observe()):ro.splice(ro.indexOf(o),1)}}function gae(t){let e=ro[ro.length-1];if(e&&!e.visibleNodes.has(t))return e.visibleNodes.add(t),()=>{e.visibleNodes.delete(t)}}var vae=oA,yae=vae,bae=()=>_.jsxs("svg",{"aria-hidden":"true",fill:"none",height:"80%",role:"presentation",viewBox:"0 0 24 24",width:"80%",children:[_.jsx("path",{d:"M12 2C9.38 2 7.25 4.13 7.25 6.75C7.25 9.32 9.26 11.4 11.88 11.49C11.96 11.48 12.04 11.48 12.1 11.49C12.12 11.49 12.13 11.49 12.15 11.49C12.16 11.49 12.16 11.49 12.17 11.49C14.73 11.4 16.74 9.32 16.75 6.75C16.75 4.13 14.62 2 12 2Z",fill:"currentColor"}),_.jsx("path",{d:"M17.0809 14.1489C14.2909 12.2889 9.74094 12.2889 6.93094 14.1489C5.66094 14.9989 4.96094 16.1489 4.96094 17.3789C4.96094 18.6089 5.66094 19.7489 6.92094 20.5889C8.32094 21.5289 10.1609 21.9989 12.0009 21.9989C13.8409 21.9989 15.6809 21.5289 17.0809 20.5889C18.3409 19.7389 19.0409 18.5989 19.0409 17.3589C19.0309 16.1289 18.3409 14.9889 17.0809 14.1489Z",fill:"currentColor"})]}),[R_e,xae]=ih({name:"AvatarGroupContext",strict:!1}),Nd=globalThis?.document?P.useLayoutEffect:P.useEffect;function JB(t={}){const{onLoad:e,onError:n,ignoreFallback:i,src:a,crossOrigin:s,srcSet:r,sizes:o,loading:c,shouldBypassImageLoad:u=!1}=t,h=yq(),d=P.useRef(h?new Image:null),[p,g]=P.useState("pending");P.useEffect(()=>{d.current&&(d.current.onload=x=>{b(),g("loaded"),e?.(x)},d.current.onerror=x=>{b(),g("failed"),n?.(x)})},[d.current]);const b=()=>{d.current&&(d.current.onload=null,d.current.onerror=null,d.current=null)},w=P.useCallback(()=>{if(!a)return"pending";if(i||u)return"loaded";const x=new Image;return x.src=a,s&&(x.crossOrigin=s),r&&(x.srcset=r),o&&(x.sizes=o),c&&(x.loading=c),d.current=x,x.complete&&x.naturalWidth?"loaded":"loading"},[a,s,r,o,e,n,c,u]);return Nd(()=>{h&&g(w())},[h,w]),i?"loaded":p}function _ae(t={}){var e,n,i,a,s,r,o,c;const u=fa(),h=xae(),d=!!h,{as:p,ref:g,src:b,name:w,icon:x,classNames:S,fallback:M,alt:C=w||"avatar",imgRef:A,color:N=(e=h?.color)!=null?e:"default",radius:R=(n=h?.radius)!=null?n:"full",size:D=(i=h?.size)!=null?i:"md",isBordered:B=(a=h?.isBordered)!=null?a:!1,isDisabled:z=(s=h?.isDisabled)!=null?s:!1,isFocusable:I=!1,getInitials:U=hq,ignoreFallback:$=!1,showFallback:G=!1,ImgComponent:k="img",imgProps:X,className:V,onError:H,disableAnimation:W,...J}=t,Y=p||"span",K=_i(g),ee=_i(A),{isFocusVisible:ie,isFocused:Z,focusProps:ue}=Ts(),{isHovered:se,hoverProps:ae}=Qa({isDisabled:z}),ce=(r=W??u?.disableAnimation)!=null?r:!1,pe=(c=typeof k=="object"&&((o=k?.displayName)==null?void 0:o.includes("HeroUI")))!=null?c:!1,_e=JB({src:b,onError:H,ignoreFallback:$,shouldBypassImageLoad:p!==void 0||k!=="img"&&!pe})==="loaded",me=!pe,ne=(!b||!_e)&&G,be=P.useMemo(()=>{var Le;return Bie({color:N,radius:R,size:D,isBordered:B,isDisabled:z,isInGroup:d,disableAnimation:ce,isInGridGroup:(Le=h?.isGrid)!=null?Le:!1})},[N,R,D,B,z,ce,d,h?.isGrid]),xe=Vt(S?.base,V),he=P.useMemo(()=>I||p==="button",[I,p]),ve=P.useCallback((Le={})=>({ref:K,tabIndex:he?0:-1,"data-hover":He(se),"data-focus":He(Z),"data-focus-visible":He(ie),className:be.base({class:Vt(xe,Le?.className)}),...Yt(J,ae,he?ue:{})}),[he,be,xe,ue,J]),Oe=P.useCallback((Le={})=>({ref:ee,src:b,"data-loaded":He(_e),className:be.img({class:S?.img}),...Yt(X,Le,cs({disableAnimation:ce},{enabled:me}))}),[be,_e,X,ce,b,ee,me]);return{Component:Y,ImgComponent:k,src:b,alt:C,icon:x,name:w,imgRef:ee,slots:be,classNames:S,fallback:M,isImgLoaded:_e,showFallback:ne,ignoreFallback:$,getInitials:U,getAvatarProps:ve,getImageProps:Oe}}var eU=Si((t,e)=>{const{Component:n,ImgComponent:i,src:a,icon:s=_.jsx(bae,{}),alt:r,classNames:o,slots:c,name:u,showFallback:h,fallback:d,getInitials:p,getAvatarProps:g,getImageProps:b}=_ae({...t,ref:e}),w=P.useMemo(()=>!h&&a?null:d?_.jsx("div",{"aria-label":r,className:c.fallback({class:o?.fallback}),role:"img",children:d}):u?_.jsx("span",{"aria-label":r,className:c.name({class:o?.name}),role:"img",children:p(u)}):_.jsx("span",{"aria-label":r,className:c.icon({class:o?.icon}),role:"img",children:s}),[h,a,d,u,o]);return _.jsxs(n,{...g(),children:[a&&_.jsx(i,{...b(),alt:r}),w]})});eU.displayName="HeroUI.Avatar";var Sae=eU,[N_e,wae]=ih({name:"ButtonGroupContext",strict:!1});function tx(t,e){let{elementType:n="button",isDisabled:i,onPress:a,onPressStart:s,onPressEnd:r,onPressUp:o,onPressChange:c,preventFocusOnPress:u,allowFocusWhenDisabled:h,onClick:d,href:p,target:g,rel:b,type:w="button",allowTextSelectionOnPress:x}=t,S;n==="button"?S={type:w,disabled:i}:S={role:"button",href:n==="a"&&!i?p:void 0,target:n==="a"?g:void 0,type:n==="input"?w:void 0,disabled:n==="input"?i:void 0,"aria-disabled":!i||n==="input"?void 0:i,rel:n==="a"?b:void 0};let{pressProps:M,isPressed:C}=bo({onClick:d,onPressStart:s,onPressEnd:r,onPressUp:o,onPressChange:c,onPress:a,isDisabled:i,preventFocusOnPress:u,allowTextSelectionOnPress:x,ref:e}),{focusableProps:A}=hm(t,e);h&&(A.tabIndex=i?-1:A.tabIndex);let N=ci(A,M,Dl(t,{labelable:!0}));return{isPressed:C,buttonProps:ci(S,N,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"]})}}var Eae=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),tU=t=>{const{ripples:e=[],motionProps:n,color:i="currentColor",style:a,onClear:s}=t;return _.jsx(_.Fragment,{children:e.map(r=>{const o=dO(.01*r.size,.2,r.size>100?.75:.5);return _.jsx(Al,{features:Eae,children:_.jsx(Hs,{mode:"popLayout",children:_.jsx(Rl.span,{animate:{transform:"scale(2)",opacity:0},className:"heroui-ripple",exit:{opacity:0},initial:{transform:"scale(0)",opacity:.35},style:{position:"absolute",backgroundColor:i,borderRadius:"100%",transformOrigin:"center",pointerEvents:"none",overflow:"hidden",inset:0,zIndex:0,top:r.y,left:r.x,width:`${r.size}px`,height:`${r.size}px`,...a},transition:{duration:o},onAnimationComplete:()=>{s(r.key)},...n})})},r.key)})})};tU.displayName="HeroUI.Ripple";var nU=tU;function iU(t={}){const[e,n]=P.useState([]),i=P.useCallback(s=>{const r=s.target,o=Math.max(r.clientWidth,r.clientHeight);n(c=>[...c,{key:uO(c.length.toString()),size:o,x:s.x-o/2,y:s.y-o/2}])},[]),a=P.useCallback(s=>{n(r=>r.filter(o=>o.key!==s))},[]);return{ripples:e,onClear:a,onPress:i,...t}}function Mae(t){var e,n,i,a,s,r,o,c,u;const h=wae(),d=fa(),p=!!h,{ref:g,as:b,children:w,startContent:x,endContent:S,autoFocus:M,className:C,spinner:A,isLoading:N=!1,disableRipple:R=!1,fullWidth:D=(e=h?.fullWidth)!=null?e:!1,radius:B=h?.radius,size:z=(n=h?.size)!=null?n:"md",color:I=(i=h?.color)!=null?i:"default",variant:U=(a=h?.variant)!=null?a:"solid",disableAnimation:$=(r=(s=h?.disableAnimation)!=null?s:d?.disableAnimation)!=null?r:!1,isDisabled:G=(o=h?.isDisabled)!=null?o:!1,isIconOnly:k=(c=h?.isIconOnly)!=null?c:!1,spinnerPlacement:X="start",onPress:V,onClick:H,...W}=t,J=b||"button",Y=typeof J=="string",K=_i(g),ee=(u=R||d?.disableRipple)!=null?u:$,{isFocusVisible:ie,isFocused:Z,focusProps:ue}=Ts({autoFocus:M}),se=G||N,ae=P.useMemo(()=>IB({size:z,color:I,variant:U,radius:B,fullWidth:D,isDisabled:se,isInGroup:p,disableAnimation:$,isIconOnly:k,className:C}),[z,I,U,B,D,se,p,k,$,C]),{onPress:ce,onClear:pe,ripples:ye}=iU(),_e=P.useCallback(tt=>{ee||se||$||K.current&&ce(tt)},[ee,se,$,K,ce]),{buttonProps:me,isPressed:ne}=tx({elementType:b,isDisabled:se,onPress:$r(V,_e),onClick:H,...W},K),{isHovered:be,hoverProps:xe}=Qa({isDisabled:se}),he=P.useCallback((tt={})=>({"data-disabled":He(se),"data-focus":He(Z),"data-pressed":He(ne),"data-focus-visible":He(ie),"data-hover":He(be),"data-loading":He(N),...Yt(me,ue,xe,cs(W,{enabled:Y}),cs(tt)),className:ae}),[N,se,Z,ne,Y,ie,be,me,ue,xe,W,ae]),ve=tt=>P.isValidElement(tt)?P.cloneElement(tt,{"aria-hidden":!0,focusable:!1}):null,Oe=ve(x),Le=ve(S),Ae=P.useMemo(()=>({sm:"sm",md:"sm",lg:"md"})[z],[z]),et=P.useCallback(()=>({ripples:ye,onClear:pe}),[ye,pe]);return{Component:J,children:w,domRef:K,spinner:A,styles:ae,startContent:Oe,endContent:Le,isLoading:N,spinnerPlacement:X,spinnerSize:Ae,disableRipple:ee,getButtonProps:he,getRippleProps:et,isIconOnly:k}}function Tae(t){var e,n;const[i,a]=gr(t,wP.variantKeys),s=fa(),r=(n=(e=t?.variant)!=null?e:s?.spinnerVariant)!=null?n:"default",{children:o,className:c,classNames:u,label:h,...d}=i,p=P.useMemo(()=>wP({...a}),[ks(a)]),g=Vt(u?.base,c),b=h||o,w=P.useMemo(()=>b&&typeof b=="string"?b:d["aria-label"]?"":"Loading",[o,b,d["aria-label"]]),x=P.useCallback(()=>({"aria-label":w,className:p.base({class:g}),...d}),[w,p,g,d]);return{label:b,slots:p,classNames:u,variant:r,getSpinnerProps:x}}var aU=Si((t,e)=>{const{slots:n,classNames:i,label:a,variant:s,getSpinnerProps:r}=Tae({...t});return s==="wave"||s==="dots"?_.jsxs("div",{ref:e,...r(),children:[_.jsx("div",{className:n.wrapper({class:i?.wrapper}),children:[...new Array(3)].map((o,c)=>_.jsx("i",{className:n.dots({class:i?.dots}),style:{"--dot-index":c}},`dot-${c}`))}),a&&_.jsx("span",{className:n.label({class:i?.label}),children:a})]}):s==="simple"?_.jsxs("div",{ref:e,...r(),children:[_.jsxs("svg",{className:n.wrapper({class:i?.wrapper}),fill:"none",viewBox:"0 0 24 24",children:[_.jsx("circle",{className:n.circle1({class:i?.circle1}),cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),_.jsx("path",{className:n.circle2({class:i?.circle2}),d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z",fill:"currentColor"})]}),a&&_.jsx("span",{className:n.label({class:i?.label}),children:a})]}):s==="spinner"?_.jsxs("div",{ref:e,...r(),children:[_.jsx("div",{className:n.wrapper({class:i?.wrapper}),children:[...new Array(12)].map((o,c)=>_.jsx("i",{className:n.spinnerBars({class:i?.spinnerBars}),style:{"--bar-index":c}},`star-${c}`))}),a&&_.jsx("span",{className:n.label({class:i?.label}),children:a})]}):_.jsxs("div",{ref:e,...r(),children:[_.jsxs("div",{className:n.wrapper({class:i?.wrapper}),children:[_.jsx("i",{className:n.circle1({class:i?.circle1})}),_.jsx("i",{className:n.circle2({class:i?.circle2})})]}),a&&_.jsx("span",{className:n.label({class:i?.label}),children:a})]})});aU.displayName="HeroUI.Spinner";var Yf=aU,sU=Si((t,e)=>{const{Component:n,domRef:i,children:a,spinnerSize:s,spinner:r=_.jsx(Yf,{color:"current",size:s}),spinnerPlacement:o,startContent:c,endContent:u,isLoading:h,disableRipple:d,getButtonProps:p,getRippleProps:g,isIconOnly:b}=Mae({...t,ref:e});return _.jsxs(n,{ref:i,...p(),children:[c,h&&o==="start"&&r,h&&b?null:a,h&&o==="end"&&r,u,!d&&_.jsx(nU,{...g()})]})});sU.displayName="HeroUI.Button";var Zt=sU,[Cae,rU]=ih({name:"CardContext",strict:!0,errorMessage:"useCardContext: `context` is undefined. Seems you forgot to wrap component within <Card />"}),oU=Si((t,e)=>{var n;const{as:i,className:a,children:s,...r}=t,o=i||"div",c=_i(e),{slots:u,classNames:h}=rU(),d=Vt(h?.body,a);return _.jsx(o,{ref:c,className:(n=u.body)==null?void 0:n.call(u,{class:d}),...r,children:s})});oU.displayName="HeroUI.CardBody";var Gr=oU,lU=Si((t,e)=>{var n;const{as:i,className:a,children:s,...r}=t,o=i||"div",c=_i(e),{slots:u,classNames:h}=rU(),d=Vt(h?.header,a);return _.jsx(o,{ref:c,className:(n=u.header)==null?void 0:n.call(u,{class:d}),...r,children:s})});lU.displayName="HeroUI.CardHeader";var Aae=lU;function Rae(t){var e,n,i,a;const s=fa(),[r,o]=gr(t,LP.variantKeys),{ref:c,as:u,children:h,onClick:d,onPress:p,autoFocus:g,className:b,classNames:w,allowTextSelectionOnPress:x=!0,...S}=r,M=_i(c),C=u||(t.isPressable?"button":"div"),A=typeof C=="string",N=(n=(e=t.disableAnimation)!=null?e:s?.disableAnimation)!=null?n:!1,R=(a=(i=t.disableRipple)!=null?i:s?.disableRipple)!=null?a:!1,D=Vt(w?.base,b),{onClear:B,onPress:z,ripples:I}=iU(),U=P.useCallback(ie=>{R||N||M.current&&z(ie)},[R,N,M,z]),{buttonProps:$,isPressed:G}=tx({onPress:$r(p,U),elementType:u,isDisabled:!t.isPressable,onClick:d,allowTextSelectionOnPress:x,...S},M),{hoverProps:k,isHovered:X}=Qa({isDisabled:!t.isHoverable,...S}),{isFocusVisible:V,isFocused:H,focusProps:W}=Ts({autoFocus:g}),J=P.useMemo(()=>LP({...o,disableAnimation:N}),[ks(o),N]),Y=P.useMemo(()=>({slots:J,classNames:w,disableAnimation:N,isDisabled:t.isDisabled,isFooterBlurred:t.isFooterBlurred,fullWidth:t.fullWidth}),[J,w,t.isDisabled,t.isFooterBlurred,N,t.fullWidth]),K=P.useCallback((ie={})=>({ref:M,className:J.base({class:D}),tabIndex:t.isPressable?0:-1,"data-hover":He(X),"data-pressed":He(G),"data-focus":He(H),"data-focus-visible":He(V),"data-disabled":He(t.isDisabled),...Yt(t.isPressable?{...$,...W,role:"button"}:{},t.isHoverable?k:{},cs(S,{enabled:A}),cs(ie))}),[M,J,D,A,t.isPressable,t.isHoverable,t.isDisabled,X,G,V,$,W,k,S]),ee=P.useCallback(()=>({ripples:I,onClear:B}),[I,B]);return{context:Y,domRef:M,Component:C,classNames:w,children:h,isHovered:X,isPressed:G,disableAnimation:N,isPressable:t.isPressable,isHoverable:t.isHoverable,disableRipple:R,handlePress:U,isFocusVisible:V,getCardProps:K,getRippleProps:ee}}var cU=Si((t,e)=>{const{children:n,context:i,Component:a,isPressable:s,disableAnimation:r,disableRipple:o,getCardProps:c,getRippleProps:u}=Rae({...t,ref:e});return _.jsxs(a,{...c(),children:[_.jsx(Cae,{value:i,children:n}),s&&!r&&!o&&_.jsx(nU,{...u()})]})});cU.displayName="HeroUI.Card";var js=cU;function Nae(t){const[e,n]=gr(t,OP.variantKeys),{ref:i,as:a,children:s,avatar:r,startContent:o,endContent:c,onClose:u,classNames:h,className:d,...p}=e,g=a||"div",b=_i(i),w=Vt(h?.base,d),x=!!u,S=t.variant==="dot",{focusProps:M,isFocusVisible:C}=Ts(),A=P.useMemo(()=>typeof s=="string"&&s?.length===1,[s]),N=P.useMemo(()=>!!r||!!o,[r,o]),R=P.useMemo(()=>!!c||x,[c,x]),D=P.useMemo(()=>OP({...n,hasStartContent:N,hasEndContent:R,isOneChar:A,isCloseable:x,isCloseButtonFocusVisible:C}),[ks(n),C,N,R,A,x]),{pressProps:B}=bo({isDisabled:!!t?.isDisabled,onPress:u}),z=()=>({ref:b,className:D.base({class:w}),...p}),I=()=>({role:"button",tabIndex:0,className:D.closeButton({class:h?.closeButton}),"aria-label":"close chip",...Yt(B,M)}),U=G=>P.isValidElement(G)?P.cloneElement(G,{className:D.avatar({class:h?.avatar})}):null,$=G=>P.isValidElement(G)?P.cloneElement(G,{className:Vt("max-h-[80%]",G.props.className)}):null;return{Component:g,children:s,slots:D,classNames:h,isDot:S,isCloseable:x,startContent:U(r)||$(o),endContent:$(c),getCloseButtonProps:I,getChipProps:z}}var uU=Si((t,e)=>{const{Component:n,children:i,slots:a,classNames:s,isDot:r,isCloseable:o,startContent:c,endContent:u,getCloseButtonProps:h,getChipProps:d}=Nae({...t,ref:e}),p=P.useMemo(()=>r&&!c?_.jsx("span",{className:a.dot({class:s?.dot})}):c,[a,c,r]),g=P.useMemo(()=>o?_.jsx("span",{...h(),children:u||_.jsx(ex,{})}):u,[u,o,h]);return _.jsxs(n,{...d(),children:[p,_.jsx("span",{className:a.content({class:s?.content}),children:i}),g]})});uU.displayName="HeroUI.Chip";var na=uU;const dU={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valueMissing:!1,valid:!0},fU={...dU,customError:!0,valid:!1},rg={isInvalid:!1,validationDetails:dU,validationErrors:[]},hU=P.createContext({}),i1="__formValidationState"+Date.now();function nx(t){if(t[i1]){let{realtimeValidation:e,displayValidation:n,updateValidation:i,resetValidation:a,commitValidation:s}=t[i1];return{realtimeValidation:e,displayValidation:n,updateValidation:i,resetValidation:a,commitValidation:s}}return Pae(t)}function Pae(t){let{isInvalid:e,validationState:n,name:i,value:a,builtinValidation:s,validate:r,validationBehavior:o="aria"}=t;n&&(e||(e=n==="invalid"));let c=e!==void 0?{isInvalid:e,validationErrors:[],validationDetails:fU}:null,u=P.useMemo(()=>{if(!r||a==null)return null;let I=Dae(r,a);return $P(I)},[r,a]);s?.validationDetails.valid&&(s=void 0);let h=P.useContext(hU),d=P.useMemo(()=>i?Array.isArray(i)?i.flatMap(I=>n5(h[I])):n5(h[i]):[],[h,i]),[p,g]=P.useState(h),[b,w]=P.useState(!1);h!==p&&(g(h),w(!1));let x=P.useMemo(()=>$P(b?[]:d),[b,d]),S=P.useRef(rg),[M,C]=P.useState(rg),A=P.useRef(rg),N=()=>{if(!R)return;D(!1);let I=u||s||S.current;DE(I,A.current)||(A.current=I,C(I))},[R,D]=P.useState(!1);return P.useEffect(N),{realtimeValidation:c||x||u||s||rg,displayValidation:o==="native"?c||x||M:c||x||u||s||M,updateValidation(I){o==="aria"&&!DE(M,I)?C(I):S.current=I},resetValidation(){let I=rg;DE(I,A.current)||(A.current=I,C(I)),o==="native"&&D(!1),w(!0)},commitValidation(){o==="native"&&D(!0),w(!0)}}}function n5(t){return t?Array.isArray(t)?t:[t]:[]}function Dae(t,e){if(typeof t=="function"){let n=t(e);if(n&&typeof n!="boolean")return n5(n)}return[]}function $P(t){return t.length?{isInvalid:!0,validationErrors:t,validationDetails:fU}:null}function DE(t,e){return t===e?!0:!!t&&!!e&&t.isInvalid===e.isInvalid&&t.validationErrors.length===e.validationErrors.length&&t.validationErrors.every((n,i)=>n===e.validationErrors[i])&&Object.entries(t.validationDetails).every(([n,i])=>e.validationDetails[n]===i)}function cA(t,e,n){let{validationBehavior:i,focus:a}=t;Hi(()=>{if(i==="native"&&n?.current&&!n.current.disabled){let u=e.realtimeValidation.isInvalid?e.realtimeValidation.validationErrors.join(" ")||"Invalid value.":"";n.current.setCustomValidity(u),n.current.hasAttribute("title")||(n.current.title=""),e.realtimeValidation.isInvalid||e.updateValidation(Oae(n.current))}});let s=P.useRef(!1),r=xa(()=>{s.current||e.resetValidation()}),o=xa(u=>{var h;e.displayValidation.isInvalid||e.commitValidation();let d=n==null||(h=n.current)===null||h===void 0?void 0:h.form;if(!u.defaultPrevented&&n&&d&&Iae(d)===n.current){var p;a?a():(p=n.current)===null||p===void 0||p.focus(),Ez("keyboard")}u.preventDefault()}),c=xa(()=>{e.commitValidation()});P.useEffect(()=>{let u=n?.current;if(!u)return;let h=u.form,d=h?.reset;return h&&(h.reset=()=>{s.current=!window.event||window.event.type==="message"&&window.event.target instanceof MessagePort,d?.call(h),s.current=!1}),u.addEventListener("invalid",o),u.addEventListener("change",c),h?.addEventListener("reset",r),()=>{u.removeEventListener("invalid",o),u.removeEventListener("change",c),h?.removeEventListener("reset",r),h&&(h.reset=d)}},[n,o,c,r,i])}function Lae(t){let e=t.validity;return{badInput:e.badInput,customError:e.customError,patternMismatch:e.patternMismatch,rangeOverflow:e.rangeOverflow,rangeUnderflow:e.rangeUnderflow,stepMismatch:e.stepMismatch,tooLong:e.tooLong,tooShort:e.tooShort,typeMismatch:e.typeMismatch,valueMissing:e.valueMissing,valid:e.valid}}function Oae(t){return{isInvalid:!t.validity.valid,validationDetails:Lae(t),validationErrors:t.validationMessage?[t.validationMessage]:[]}}function Iae(t){for(let e=0;e<t.elements.length;e++){let n=t.elements[e];if(!n.validity.valid)return n}return null}function pU(t,e,n){let{isDisabled:i=!1,isReadOnly:a=!1,value:s,name:r,form:o,children:c,"aria-label":u,"aria-labelledby":h,validationState:d="valid",isInvalid:p,onPressStart:g,onPressEnd:b,onPressChange:w,onPress:x,onPressUp:S,onClick:M}=t,C=U=>{U.stopPropagation(),e.setSelected(U.target.checked)},{pressProps:A,isPressed:N}=bo({onPressStart:g,onPressEnd:b,onPressChange:w,onPress:x,onPressUp:S,onClick:M,isDisabled:i}),{pressProps:R,isPressed:D}=bo({onPressStart:g,onPressEnd:b,onPressChange:w,onPressUp:S,onClick:M,onPress(U){var $;x?.(U),e.toggle(),($=n.current)===null||$===void 0||$.focus()},isDisabled:i||a}),{focusableProps:B}=hm(t,n),z=ci(A,B),I=Dl(t,{labelable:!0});return yC(n,e.defaultSelected,e.setSelected),{labelProps:ci(R,{onClick:U=>U.preventDefault()}),inputProps:ci(I,{"aria-invalid":p||d==="invalid"||void 0,"aria-errormessage":t["aria-errormessage"],"aria-controls":t["aria-controls"],"aria-readonly":a||void 0,onChange:C,disabled:i,...s==null?{}:{value:s},name:r,form:o,type:"checkbox",...z}),isSelected:e.isSelected,isPressed:N||D,isDisabled:i,isReadOnly:a,isInvalid:p||d==="invalid"}}function mU(t,e,n){let i=nx({...t,value:e.isSelected}),{isInvalid:a,validationErrors:s,validationDetails:r}=i.displayValidation,{labelProps:o,inputProps:c,isSelected:u,isPressed:h,isDisabled:d,isReadOnly:p}=pU({...t,isInvalid:a},e,n);cA(t,i,n);let{isIndeterminate:g,isRequired:b,validationBehavior:w="aria"}=t;P.useEffect(()=>{n.current&&(n.current.indeterminate=!!g)});let{pressProps:x}=bo({isDisabled:d||p,onPress(){let{[i1]:S}=t,{commitValidation:M}=S||i;M()}});return{labelProps:ci(o,x,P.useMemo(()=>({onMouseDown:S=>S.preventDefault()}),[])),inputProps:{...c,checked:u,"aria-required":b&&w==="aria"||void 0,required:b&&w==="native"},isSelected:u,isPressed:h,isDisabled:d,isReadOnly:p,isInvalid:a,validationErrors:s,validationDetails:r}}const zae=new WeakMap;function gU(t){let{id:e,label:n,"aria-labelledby":i,"aria-label":a,labelElementType:s="label"}=t;e=Us(e);let r=Us(),o={};n&&(i=i?`${r} ${i}`:r,o={id:r,htmlFor:s==="label"?e:void 0});let c=iw({id:e,"aria-label":a,"aria-labelledby":i});return{labelProps:o,fieldProps:c}}function vU(t){let{description:e,errorMessage:n,isInvalid:i,validationState:a}=t,{labelProps:s,fieldProps:r}=gU(t),o=Ng([!!e,!!n,i,a]),c=Ng([!!e,!!n,i,a]);return r=ci(r,{"aria-describedby":[o,c,t["aria-describedby"]].filter(Boolean).join(" ")||void 0}),{labelProps:s,fieldProps:r,descriptionProps:{id:o},errorMessageProps:{id:c}}}function uA(t={}){let{isReadOnly:e}=t,[n,i]=sh(t.isSelected,t.defaultSelected||!1,t.onChange),[a]=P.useState(n);function s(c){e||i(c)}function r(){e||i(!n)}var o;return{isSelected:n,defaultSelected:(o=t.defaultSelected)!==null&&o!==void 0?o:a,setSelected:s,toggle:r}}function Bae(t,e,n){const i=uA({isReadOnly:t.isReadOnly||e.isReadOnly,isSelected:e.isSelected(t.value),defaultSelected:e.defaultValue.includes(t.value),onChange(S){S?e.addValue(t.value):e.removeValue(t.value),t.onChange&&t.onChange(S)}});let{name:a,form:s,descriptionId:r,errorMessageId:o,validationBehavior:c}=zae.get(e);var u;c=(u=t.validationBehavior)!==null&&u!==void 0?u:c;let{realtimeValidation:h}=nx({...t,value:i.isSelected,name:void 0,validationBehavior:"aria"}),d=P.useRef(rg),p=()=>{e.setInvalid(t.value,h.isInvalid?h:d.current)};P.useEffect(p);let g=e.realtimeValidation.isInvalid?e.realtimeValidation:h,b=c==="native"?e.displayValidation:g;var w;let x=mU({...t,isReadOnly:t.isReadOnly||e.isReadOnly,isDisabled:t.isDisabled||e.isDisabled,name:t.name||a,form:t.form||s,isRequired:(w=t.isRequired)!==null&&w!==void 0?w:e.isRequired,validationBehavior:c,[i1]:{realtimeValidation:g,displayValidation:b,resetValidation:e.resetValidation,commitValidation:e.commitValidation,updateValidation(S){d.current=S,p()}}},i,n);return{...x,inputProps:{...x.inputProps,"aria-describedby":[t["aria-describedby"],e.isInvalid?o:null,r].filter(Boolean).join(" ")||void 0}}}var GP=Symbol("default");function Uae(t){const e=P.useRef(null),n=P.useRef(void 0),i=P.useCallback(a=>{if(typeof t=="function"){const s=t,r=s(a);return()=>{typeof r=="function"?r():s(null)}}else if(t)return t.current=a,()=>{t.current=null}},[t]);return P.useMemo(()=>({get current(){return e.current},set current(a){e.current=a,n.current&&(n.current(),n.current=void 0),a!=null&&(n.current=i(a))}}),[i])}function ix(t,e){let n=P.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let i=new Intl.ListFormat().format(Object.keys(n.slots).map(s=>`"${s}"`));if(!e&&!n.slots[GP])throw new Error(`A slot prop is required. Valid slot names are ${i}.`);let a=e||GP;if(!n.slots[a])throw new Error(`Invalid slot "${e}". Valid slot names are ${i}.`);return n.slots[a]}return n}function jae(t,e,n){let i=ix(n,t.slot)||{},{ref:a,...s}=i,r=Uae(P.useMemo(()=>fC(e,a),[e,a])),o=Yt(s,t);return"style"in s&&s.style&&"style"in t&&t.style&&(typeof s.style=="function"||typeof t.style=="function"?o.style=c=>{let u=typeof s.style=="function"?s.style(c):s.style,h={...c.defaultStyle,...u},d=typeof t.style=="function"?t.style({...c,defaultStyle:h}):t.style;return{...h,...d}}:o.style={...s.style,...t.style}),[o,r]}var zg=P.createContext(null),Fae=P.forwardRef(function(e,n){[e,n]=jae(e,n,zg);let{validationErrors:i,validationBehavior:a="native",children:s,className:r,...o}=e;const c=P.useMemo(()=>Lie({className:r}),[r]);return _.jsx("form",{noValidate:a!=="native",...o,ref:n,className:c,children:_.jsx(zg.Provider,{value:{...e,validationBehavior:a},children:_.jsx(hU.Provider,{value:i??{},children:s})})})}),yU=P.forwardRef(function(e,n){var i,a;const s=fa(),r=(a=(i=e.validationBehavior)!=null?i:s?.validationBehavior)!=null?a:"native";return _.jsx(Fae,{...e,ref:n,validationBehavior:r})}),[P_e,Vae]=ih({name:"CheckboxGroupContext",strict:!1});function kae(t){const{isSelected:e,disableAnimation:n,...i}=t;return _.jsx("svg",{"aria-hidden":"true",fill:"none",role:"presentation",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:e?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,style:!n&&e?{transition:"stroke-dashoffset 250ms linear 0.2s"}:{},viewBox:"0 0 17 18",...i,children:_.jsx("polyline",{points:"1 9 7 14 15 4"})})}function Hae(t){const{isSelected:e,disableAnimation:n,...i}=t;return _.jsx("svg",{stroke:"currentColor",strokeWidth:3,viewBox:"0 0 24 24",...i,children:_.jsx("line",{x1:"21",x2:"3",y1:"12",y2:"12"})})}function $ae(t){const{isIndeterminate:e,...n}=t,i=e?Hae:kae;return _.jsx(i,{...n})}function Gae(t,e=[]){const n=P.useRef(t);return Nd(()=>{n.current=t}),P.useCallback((...i)=>{var a;return(a=n.current)==null?void 0:a.call(n,...i)},e)}function Wae(t={}){var e,n,i,a,s,r,o,c;const u=fa(),h=Vae(),{validationBehavior:d}=ix(zg)||{},p=!!h,{as:g,ref:b,value:w="",children:x,icon:S,name:M,isRequired:C,isReadOnly:A=!1,autoFocus:N=!1,isSelected:R,size:D=(e=h?.size)!=null?e:"md",color:B=(n=h?.color)!=null?n:"primary",radius:z=h?.radius,lineThrough:I=(i=h?.lineThrough)!=null?i:!1,isDisabled:U=(a=h?.isDisabled)!=null?a:!1,disableAnimation:$=(r=(s=h?.disableAnimation)!=null?s:u?.disableAnimation)!=null?r:!1,validationState:G,isInvalid:k=G?G==="invalid":(o=h?.isInvalid)!=null?o:!1,isIndeterminate:X=!1,validationBehavior:V=p?h.validationBehavior:(c=d??u?.validationBehavior)!=null?c:"native",defaultSelected:H,classNames:W,className:J,onValueChange:Y,validate:K,...ee}=t,ie=g||"label",Z=P.useRef(null),ue=P.useRef(null);let se=t.onChange;p&&(se=$r(()=>{h.groupState.resetValidation()},se));const ae=P.useId(),ce=P.useMemo(()=>({name:M,value:w,children:x,autoFocus:N,defaultSelected:H,isIndeterminate:X,isRequired:C,isInvalid:k,isSelected:R,isDisabled:U,isReadOnly:A,"aria-label":lO(ee["aria-label"],x),"aria-labelledby":ee["aria-labelledby"]||ae,onChange:Y}),[M,w,x,N,H,X,C,k,R,U,A,ee["aria-label"],ee["aria-labelledby"],ae,Y]),pe=uA(ce),ye={isInvalid:k,isRequired:C,validate:K,validationState:G,validationBehavior:V},{inputProps:_e,isSelected:me,isDisabled:ne,isReadOnly:be,isPressed:xe,isInvalid:he}=p?Bae({...ce,...ye},h.groupState,ue):mU({...ce,...ye},pe,ue),ve=ne||be,Oe=G==="invalid"||k||he,Le=ve?!1:xe,{hoverProps:Ae,isHovered:et}=Qa({isDisabled:_e.disabled}),{focusProps:tt,isFocused:re,isFocusVisible:te}=Ts({autoFocus:_e.autoFocus}),we=P.useMemo(()=>Oie({color:B,size:D,radius:z,isInvalid:Oe,lineThrough:I,isDisabled:ne,disableAnimation:$}),[B,D,z,Oe,I,ne,$]);Nd(()=>{if(!ue.current)return;const Je=!!ue.current.checked;pe.setSelected(Je)},[ue.current]);const Ce=Gae(se),Ie=P.useCallback(Je=>{if(be||ne){Je.preventDefault();return}Ce?.(Je)},[be,ne,Ce]),Pe=Vt(W?.base,J),Ze=P.useCallback(()=>({ref:Z,className:we.base({class:Pe}),"data-disabled":He(ne),"data-selected":He(me||X),"data-invalid":He(Oe),"data-hover":He(et),"data-focus":He(re),"data-pressed":He(Le),"data-readonly":He(_e.readOnly),"data-focus-visible":He(te),"data-indeterminate":He(X),...Yt(Ae,ee)}),[we,Pe,ne,me,X,Oe,et,re,Le,_e.readOnly,te,Ae,ee]),We=P.useCallback((Je={})=>({...Je,"aria-hidden":!0,className:Vt(we.wrapper({class:Vt(W?.wrapper,Je?.className)}))}),[we,W?.wrapper]),mt=P.useCallback(()=>({ref:Q3(ue,b),...Yt(_e,tt),className:we.hiddenInput({class:W?.hiddenInput}),onChange:$r(_e.onChange,Ie)}),[_e,tt,Ie,W?.hiddenInput]),nt=P.useCallback(()=>({id:ae,className:we.label({class:W?.label})}),[we,W?.label,ne,me,Oe]),Ye=P.useCallback(()=>({isSelected:me,isIndeterminate:X,disableAnimation:$,className:we.icon({class:W?.icon})}),[we,W?.icon,me,X,$]);return{Component:ie,icon:S,children:x,isSelected:me,isDisabled:ne,isInvalid:Oe,isFocused:re,isHovered:et,isFocusVisible:te,getBaseProps:Ze,getWrapperProps:We,getInputProps:mt,getLabelProps:nt,getIconProps:Ye}}var bU=Si((t,e)=>{const{Component:n,children:i,icon:a=_.jsx($ae,{}),getBaseProps:s,getWrapperProps:r,getInputProps:o,getIconProps:c,getLabelProps:u}=Wae({...t,ref:e}),h=typeof a=="function"?a(c()):P.cloneElement(a,c());return _.jsxs(n,{...s(),children:[_.jsx("input",{...o()}),_.jsx("span",{...r(),children:h}),i&&_.jsx("span",{...u(),children:i})]})});bU.displayName="HeroUI.Checkbox";var Kae=bU;const WP=t=>typeof t=="object"&&t!=null&&t.nodeType===1,KP=(t,e)=>(!e||t!=="hidden")&&t!=="visible"&&t!=="clip",t_=(t,e)=>{if(t.clientHeight<t.scrollHeight||t.clientWidth<t.scrollWidth){const n=getComputedStyle(t,null);return KP(n.overflowY,e)||KP(n.overflowX,e)||(i=>{const a=(s=>{if(!s.ownerDocument||!s.ownerDocument.defaultView)return null;try{return s.ownerDocument.defaultView.frameElement}catch{return null}})(i);return!!a&&(a.clientHeight<i.scrollHeight||a.clientWidth<i.scrollWidth)})(t)}return!1},n_=(t,e,n,i,a,s,r,o)=>s<t&&r>e||s>t&&r<e?0:s<=t&&o<=n||r>=e&&o>=n?s-t-i:r>e&&o<n||s<t&&o>n?r-e+a:0,Xae=t=>{const e=t.parentElement;return e??(t.getRootNode().host||null)},XP=(t,e)=>{var n,i,a,s;if(typeof document>"u")return[];const{scrollMode:r,block:o,inline:c,boundary:u,skipOverflowHiddenElements:h}=e,d=typeof u=="function"?u:V=>V!==u;if(!WP(t))throw new TypeError("Invalid target");const p=document.scrollingElement||document.documentElement,g=[];let b=t;for(;WP(b)&&d(b);){if(b=Xae(b),b===p){g.push(b);break}b!=null&&b===document.body&&t_(b)&&!t_(document.documentElement)||b!=null&&t_(b,h)&&g.push(b)}const w=(i=(n=window.visualViewport)==null?void 0:n.width)!=null?i:innerWidth,x=(s=(a=window.visualViewport)==null?void 0:a.height)!=null?s:innerHeight,{scrollX:S,scrollY:M}=window,{height:C,width:A,top:N,right:R,bottom:D,left:B}=t.getBoundingClientRect(),{top:z,right:I,bottom:U,left:$}=(V=>{const H=window.getComputedStyle(V);return{top:parseFloat(H.scrollMarginTop)||0,right:parseFloat(H.scrollMarginRight)||0,bottom:parseFloat(H.scrollMarginBottom)||0,left:parseFloat(H.scrollMarginLeft)||0}})(t);let G=o==="start"||o==="nearest"?N-z:o==="end"?D+U:N+C/2-z+U,k=c==="center"?B+A/2-$+I:c==="end"?R+I:B-$;const X=[];for(let V=0;V<g.length;V++){const H=g[V],{height:W,width:J,top:Y,right:K,bottom:ee,left:ie}=H.getBoundingClientRect();if(r==="if-needed"&&N>=0&&B>=0&&D<=x&&R<=w&&(H===p&&!t_(H)||N>=Y&&D<=ee&&B>=ie&&R<=K))return X;const Z=getComputedStyle(H),ue=parseInt(Z.borderLeftWidth,10),se=parseInt(Z.borderTopWidth,10),ae=parseInt(Z.borderRightWidth,10),ce=parseInt(Z.borderBottomWidth,10);let pe=0,ye=0;const _e="offsetWidth"in H?H.offsetWidth-H.clientWidth-ue-ae:0,me="offsetHeight"in H?H.offsetHeight-H.clientHeight-se-ce:0,ne="offsetWidth"in H?H.offsetWidth===0?0:J/H.offsetWidth:0,be="offsetHeight"in H?H.offsetHeight===0?0:W/H.offsetHeight:0;if(p===H)pe=o==="start"?G:o==="end"?G-x:o==="nearest"?n_(M,M+x,x,se,ce,M+G,M+G+C,C):G-x/2,ye=c==="start"?k:c==="center"?k-w/2:c==="end"?k-w:n_(S,S+w,w,ue,ae,S+k,S+k+A,A),pe=Math.max(0,pe+M),ye=Math.max(0,ye+S);else{pe=o==="start"?G-Y-se:o==="end"?G-ee+ce+me:o==="nearest"?n_(Y,ee,W,se,ce+me,G,G+C,C):G-(Y+W/2)+me/2,ye=c==="start"?k-ie-ue:c==="center"?k-(ie+J/2)+_e/2:c==="end"?k-K+ae+_e:n_(ie,K,J,ue,ae+_e,k,k+A,A);const{scrollLeft:xe,scrollTop:he}=H;pe=be===0?0:Math.max(0,Math.min(he+pe/be,H.scrollHeight-W/be+me)),ye=ne===0?0:Math.max(0,Math.min(xe+ye/ne,H.scrollWidth-J/ne+_e)),G+=he-pe,k+=xe-ye}X.push({el:H,top:pe,left:ye})}return X},qae=t=>t===!1?{block:"end",inline:"nearest"}:(e=>e===Object(e)&&Object.keys(e).length!==0)(t)?t:{block:"start",inline:"nearest"};function Yae(t,e){if(!t.isConnected||!(i=>{let a=i;for(;a&&a.parentNode;){if(a.parentNode===document)return!0;a=a.parentNode instanceof ShadowRoot?a.parentNode.host:a.parentNode}return!1})(t))return;if((i=>typeof i=="object"&&typeof i.behavior=="function")(e))return e.behavior(XP(t,e));const n=typeof e=="boolean"||e==null?void 0:e.behavior;for(const{el:i,top:a,left:s}of XP(t,qae(e)))i.scroll({top:a,left:s,behavior:n})}function fw(t){let[e,n]=sh(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const i=P.useCallback(()=>{n(!0)},[n]),a=P.useCallback(()=>{n(!1)},[n]),s=P.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:i,close:a,toggle:s}}const Zae=1500,qP=500;let up={},Qae=0,qy=!1,ad=null,dp=null;function Jae(t={}){let{delay:e=Zae,closeDelay:n=qP}=t,{isOpen:i,open:a,close:s}=fw(t),r=P.useMemo(()=>`${++Qae}`,[]),o=P.useRef(null),c=P.useRef(s),u=()=>{up[r]=p},h=()=>{for(let b in up)b!==r&&(up[b](!0),delete up[b])},d=()=>{o.current&&clearTimeout(o.current),o.current=null,h(),u(),qy=!0,a(),ad&&(clearTimeout(ad),ad=null),dp&&(clearTimeout(dp),dp=null)},p=b=>{b||n<=0?(o.current&&clearTimeout(o.current),o.current=null,c.current()):o.current||(o.current=setTimeout(()=>{o.current=null,c.current()},n)),ad&&(clearTimeout(ad),ad=null),qy&&(dp&&clearTimeout(dp),dp=setTimeout(()=>{delete up[r],dp=null,qy=!1},Math.max(qP,n)))},g=()=>{h(),u(),!i&&!ad&&!qy?ad=setTimeout(()=>{ad=null,qy=!0,d()},e):i||d()};return P.useEffect(()=>{c.current=s},[s]),P.useEffect(()=>()=>{o.current&&clearTimeout(o.current),up[r]&&delete up[r]},[r]),{isOpen:i,open:b=>{!b&&e>0&&!o.current?g():d()},close:p}}function ese(t,e){let n=Dl(t,{labelable:!0}),{hoverProps:i}=Qa({onHoverStart:()=>e?.open(!0),onHoverEnd:()=>e?.close()});return{tooltipProps:ci(n,i,{role:"tooltip"})}}function tse(t,e,n){let{isDisabled:i,trigger:a}=t,s=Us(),r=P.useRef(!1),o=P.useRef(!1),c=()=>{(r.current||o.current)&&e.open(o.current)},u=S=>{!r.current&&!o.current&&e.close(S)};P.useEffect(()=>{let S=M=>{n&&n.current&&M.key==="Escape"&&(M.stopPropagation(),e.close(!0))};if(e.isOpen)return document.addEventListener("keydown",S,!0),()=>{document.removeEventListener("keydown",S,!0)}},[n,e]);let h=()=>{a!=="focus"&&(Ff()==="pointer"?r.current=!0:r.current=!1,c())},d=()=>{a!=="focus"&&(o.current=!1,r.current=!1,u())},p=()=>{o.current=!1,r.current=!1,u(!0)},g=()=>{Og()&&(o.current=!0,c())},b=()=>{o.current=!1,r.current=!1,u(!0)},{hoverProps:w}=Qa({isDisabled:i,onHoverStart:h,onHoverEnd:d}),{focusableProps:x}=hm({isDisabled:i,onFocus:g,onBlur:b},n);return{triggerProps:{"aria-describedby":e.isOpen?s:void 0,...ci(x,w,{onPointerDown:p,onKeyDown:p}),tabIndex:void 0},tooltipProps:{id:s}}}var Zc=[];function dA(t,e){const{disableOutsideEvents:n=!0,isDismissable:i=!1,isKeyboardDismissDisabled:a=!1,isOpen:s,onClose:r,shouldCloseOnBlur:o,shouldCloseOnInteractOutside:c}=t;P.useEffect(()=>{if(s&&!Zc.includes(e))return Zc.push(e),()=>{let x=Zc.indexOf(e);x>=0&&Zc.splice(x,1)}},[s,e]);const u=()=>{Zc[Zc.length-1]===e&&r&&r()},h=x=>{(!c||c(x.target))&&(Zc[Zc.length-1]===e&&n&&(x.stopPropagation(),x.preventDefault()),w(e)!=="pressEnd"&&u())},d=x=>{(!c||c(x.target))&&(Zc[Zc.length-1]===e&&n&&(x.stopPropagation(),x.preventDefault()),u())},p=x=>{x.key==="Escape"&&!a&&!x.nativeEvent.isComposing&&(x.stopPropagation(),x.preventDefault(),u())};tne({isDisabled:!(i&&s),onInteractOutside:i&&s?d:void 0,onInteractOutsideStart:h,ref:e});const{focusWithinProps:g}=Rd({isDisabled:!o,onBlurWithin:x=>{!x.relatedTarget||lne(x.relatedTarget)||(!c||c(x.relatedTarget))&&u()}}),b=x=>{x.target===x.currentTarget&&x.preventDefault()};function w(x){const S=x.current;if(!S)return"unknown";const M=(S.getAttribute("role")||"").toLowerCase(),C=S.getAttribute("aria-modal");return(M==="dialog"||M==="alertdialog")&&(C===null||C.toLowerCase()==="true")?"pressEnd":["listbox","menu","tree","grid","combobox"].includes(M)?"pressStart":"unknown"}return{overlayProps:{onKeyDown:p,...g},underlayProps:{onPointerDown:b}}}function nse(t){var e,n;const i=fa(),[a,s]=gr(t,US.variantKeys),{ref:r,as:o,isOpen:c,content:u,children:h,defaultOpen:d,onOpenChange:p,isDisabled:g,trigger:b,shouldFlip:w=!0,containerPadding:x=12,placement:S="top",delay:M=0,closeDelay:C=500,showArrow:A=!1,offset:N=7,crossOffset:R=0,isDismissable:D,shouldCloseOnBlur:B=!0,portalContainer:z,isKeyboardDismissDisabled:I=!1,updatePositionDeps:U=[],shouldCloseOnInteractOutside:$,className:G,onClose:k,motionProps:X,classNames:V,...H}=a,W=o||"div",J=(n=(e=t?.disableAnimation)!=null?e:i?.disableAnimation)!=null?n:!1,Y=Jae({delay:M,closeDelay:C,isDisabled:g,defaultOpen:d,isOpen:c,onOpenChange:he=>{p?.(he),he||k?.()}}),K=P.useRef(null),ee=P.useRef(null),ie=P.useId(),Z=Y.isOpen&&!g;P.useImperativeHandle(r,()=>oq(ee));const{triggerProps:ue,tooltipProps:se}=tse({isDisabled:g,trigger:b},Y,K),{tooltipProps:ae}=ese({isOpen:Z,...Yt(a,se)},Y),{overlayProps:ce,placement:pe,updatePosition:ye}=mz({isOpen:Z,targetRef:K,placement:QB(S),overlayRef:ee,offset:A?N+3:N,crossOffset:R,shouldFlip:w,containerPadding:x});Nd(()=>{U.length&&ye()},U);const{overlayProps:_e}=dA({isOpen:Z,onClose:Y.close,isDismissable:D,shouldCloseOnBlur:B,isKeyboardDismissDisabled:I,shouldCloseOnInteractOutside:$},ee),me=P.useMemo(()=>{var he,ve,Oe;return US({...s,disableAnimation:J,radius:(he=t?.radius)!=null?he:"md",size:(ve=t?.size)!=null?ve:"md",shadow:(Oe=t?.shadow)!=null?Oe:"sm"})},[ks(s),J,t?.radius,t?.size,t?.shadow]),ne=P.useCallback((he={},ve=null)=>({...Yt(ue,he),ref:Q3(ve,K),"aria-describedby":Z?ie:void 0}),[ue,Z,ie,Y]),be=P.useCallback(()=>({ref:ee,"data-slot":"base","data-open":He(Z),"data-arrow":He(A),"data-disabled":He(g),"data-placement":FS(pe||"top",S),...Yt(ae,_e,H),style:Yt(ce.style,H.style,a.style),className:me.base({class:V?.base}),id:ie}),[me,Z,A,g,pe,S,ae,_e,H,ce,a,ie]),xe=P.useCallback(()=>({"data-slot":"content","data-open":He(Z),"data-arrow":He(A),"data-disabled":He(g),"data-placement":FS(pe||"top",S),className:me.content({class:Vt(V?.content,G)})}),[me,Z,A,g,pe,S,V]);return{Component:W,content:u,children:h,isOpen:Z,triggerRef:K,showArrow:A,portalContainer:z,placement:S,disableAnimation:J,isDisabled:g,motionProps:X,getTooltipContentProps:xe,getTriggerProps:ne,getTooltipProps:be}}var ise=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),xU=Si((t,e)=>{var n;const{Component:i,children:a,content:s,isOpen:r,portalContainer:o,placement:c,disableAnimation:u,motionProps:h,getTriggerProps:d,getTooltipProps:p,getTooltipContentProps:g}=nse({...t,ref:e});let b;try{if(P.Children.count(a)!==1)throw new Error;if(!P.isValidElement(a))b=_.jsx("p",{...d(),children:a});else{const N=a,R=(n=N.props.ref)!=null?n:N.ref;b=P.cloneElement(N,d(N.props,R))}}catch{b=_.jsx("span",{}),mq("Tooltip must have only one child node. Please, check your code.")}const{ref:w,id:x,style:S,...M}=p(),C=_.jsx("div",{ref:w,id:x,style:S,children:_.jsx(Rl.div,{animate:"enter",exit:"exit",initial:"exit",variants:qf.scaleSpring,...Yt(h,M),style:{...lA(c)},children:_.jsx(i,{...g(),children:s})},`${x}-tooltip-inner`)},`${x}-tooltip-content`);return _.jsxs(_.Fragment,{children:[b,u?r&&_.jsx(mP,{portalContainer:o,children:_.jsx("div",{ref:w,id:x,style:S,...M,children:_.jsx(i,{...g(),children:s})})}):_.jsx(Al,{features:ise,children:_.jsx(Hs,{children:r&&_.jsx(mP,{portalContainer:o,children:C})})})]})});xU.displayName="HeroUI.Tooltip";var _U=xU;function ase(t,e,n){let{labelProps:i,inputProps:a,isSelected:s,isPressed:r,isDisabled:o,isReadOnly:c}=pU(t,e,n);return{labelProps:i,inputProps:{...a,role:"switch",checked:s},isSelected:s,isPressed:r,isDisabled:o,isReadOnly:c}}function sse(t={}){var e,n;const i=fa(),[a,s]=gr(t,TP.variantKeys),{ref:r,as:o,name:c,value:u="",isReadOnly:h=!1,autoFocus:d=!1,startContent:p,endContent:g,defaultSelected:b,isSelected:w,children:x,thumbIcon:S,className:M,classNames:C,onChange:A,onValueChange:N,...R}=a,D=o||"label",B=P.useRef(null),z=P.useRef(null),I=(n=(e=t.disableAnimation)!=null?e:i?.disableAnimation)!=null?n:!1,U=P.useId(),$=P.useMemo(()=>{const he=R["aria-label"]||typeof x=="string"?x:void 0;return{name:c,value:u,children:x,autoFocus:d,defaultSelected:b,isSelected:w,isDisabled:!!t.isDisabled,isReadOnly:h,"aria-label":he,"aria-labelledby":R["aria-labelledby"]||U,onChange:N}},[u,c,U,x,d,h,w,b,t.isDisabled,R["aria-label"],R["aria-labelledby"],N]),G=uA($);Nd(()=>{if(!z.current)return;const he=!!z.current.checked;G.setSelected(he)},[z.current]);const{inputProps:k,isPressed:X,isReadOnly:V}=ase($,G,z),{focusProps:H,isFocused:W,isFocusVisible:J}=Ts({autoFocus:k.autoFocus}),{hoverProps:Y,isHovered:K}=Qa({isDisabled:k.disabled}),ie=$.isDisabled||V?!1:X,Z=k.checked,ue=k.disabled,se=P.useMemo(()=>TP({...s,disableAnimation:I}),[ks(s),I]),ae=Vt(C?.base,M),ce=he=>({...Yt(Y,R,he),ref:B,className:se.base({class:Vt(ae,he?.className)}),"data-disabled":He(ue),"data-selected":He(Z),"data-readonly":He(V),"data-focus":He(W),"data-focus-visible":He(J),"data-hover":He(K),"data-pressed":He(ie)}),pe=P.useCallback((he={})=>({...he,"aria-hidden":!0,className:Vt(se.wrapper({class:Vt(C?.wrapper,he?.className)}))}),[se,C?.wrapper]),ye=(he={})=>({...Yt(k,H,he),ref:Q3(z,r),id:k.id,className:se.hiddenInput({class:C?.hiddenInput}),onChange:$r(A,k.onChange)}),_e=P.useCallback((he={})=>({...he,className:se.thumb({class:Vt(C?.thumb,he?.className)})}),[se,C?.thumb]),me=P.useCallback((he={})=>({...he,id:U,className:se.label({class:Vt(C?.label,he?.className)})}),[se,C?.label,ue,Z]),ne=P.useCallback((he={includeStateProps:!1})=>Yt({width:"1em",height:"1em",className:se.thumbIcon({class:Vt(C?.thumbIcon)})},he.includeStateProps?{isSelected:Z}:{}),[se,C?.thumbIcon,Z]),be=P.useCallback((he={})=>({width:"1em",height:"1em",...he,className:se.startContent({class:Vt(C?.startContent,he?.className)})}),[se,C?.startContent,Z]),xe=P.useCallback((he={})=>({width:"1em",height:"1em",...he,className:se.endContent({class:Vt(C?.endContent,he?.className)})}),[se,C?.endContent,Z]);return{Component:D,slots:se,classNames:C,domRef:B,children:x,thumbIcon:S,startContent:p,endContent:g,isHovered:K,isSelected:Z,isPressed:ie,isFocused:W,isFocusVisible:J,isDisabled:ue,getBaseProps:ce,getWrapperProps:pe,getInputProps:ye,getLabelProps:me,getThumbProps:_e,getThumbIconProps:ne,getStartContentProps:be,getEndContentProps:xe}}var SU=Si((t,e)=>{const{Component:n,children:i,startContent:a,endContent:s,thumbIcon:r,getBaseProps:o,getInputProps:c,getWrapperProps:u,getThumbProps:h,getThumbIconProps:d,getLabelProps:p,getStartContentProps:g,getEndContentProps:b}=sse({...t,ref:e}),w=typeof r=="function"?r(d({includeStateProps:!0})):r&&P.cloneElement(r,d()),x=a&&P.cloneElement(a,g()),S=s&&P.cloneElement(s,b());return _.jsxs(n,{...o(),children:[_.jsx("input",{...c()}),_.jsxs("span",{...u(),children:[a&&x,_.jsx("span",{...h(),children:r&&w}),s&&S]}),i&&_.jsx("span",{...p(),children:i})]})});SU.displayName="HeroUI.Switch";var a1=SU;function wU(t,e){let{inputElementType:n="input",isDisabled:i=!1,isRequired:a=!1,isReadOnly:s=!1,type:r="text",validationBehavior:o="aria"}=t,[c,u]=sh(t.value,t.defaultValue||"",t.onChange),{focusableProps:h}=hm(t,e),d=nx({...t,value:c}),{isInvalid:p,validationErrors:g,validationDetails:b}=d.displayValidation,{labelProps:w,fieldProps:x,descriptionProps:S,errorMessageProps:M}=vU({...t,isInvalid:p,errorMessage:t.errorMessage||g}),C=Dl(t,{labelable:!0});const A={type:r,pattern:t.pattern};let[N]=P.useState(c);var R;return yC(e,(R=t.defaultValue)!==null&&R!==void 0?R:N,u),cA(t,d,e),P.useEffect(()=>{if(e.current instanceof jo(e.current).HTMLTextAreaElement){let D=e.current;Object.defineProperty(D,"defaultValue",{get:()=>D.value,set:()=>{},configurable:!0})}},[e]),{labelProps:w,inputProps:ci(C,n==="input"?A:void 0,{disabled:i,readOnly:s,required:a&&o==="native","aria-required":a&&o==="aria"||void 0,"aria-invalid":p||void 0,"aria-errormessage":t["aria-errormessage"],"aria-activedescendant":t["aria-activedescendant"],"aria-autocomplete":t["aria-autocomplete"],"aria-haspopup":t["aria-haspopup"],"aria-controls":t["aria-controls"],value:c,onChange:D=>u(D.target.value),autoComplete:t.autoComplete,autoCapitalize:t.autoCapitalize,maxLength:t.maxLength,minLength:t.minLength,name:t.name,form:t.form,placeholder:t.placeholder,inputMode:t.inputMode,autoCorrect:t.autoCorrect,spellCheck:t.spellCheck,[parseInt(ft.version,10)>=17?"enterKeyHint":"enterkeyhint"]:t.enterKeyHint,onCopy:t.onCopy,onCut:t.onCut,onPaste:t.onPaste,onCompositionEnd:t.onCompositionEnd,onCompositionStart:t.onCompositionStart,onCompositionUpdate:t.onCompositionUpdate,onSelect:t.onSelect,onBeforeInput:t.onBeforeInput,onInput:t.onInput,...h,...x}),descriptionProps:S,errorMessageProps:M,isInvalid:p,validationErrors:g,validationDetails:b}}function YP(){return typeof window<"u"&&window.InputEvent&&typeof InputEvent.prototype.getTargetRanges=="function"}function rse(t,e,n){let i=xa(d=>{let p=n.current;if(!p)return;let g=null;switch(d.inputType){case"historyUndo":case"historyRedo":return;case"insertLineBreak":return;case"deleteContent":case"deleteByCut":case"deleteByDrag":g=p.value.slice(0,p.selectionStart)+p.value.slice(p.selectionEnd);break;case"deleteContentForward":g=p.selectionEnd===p.selectionStart?p.value.slice(0,p.selectionStart)+p.value.slice(p.selectionEnd+1):p.value.slice(0,p.selectionStart)+p.value.slice(p.selectionEnd);break;case"deleteContentBackward":g=p.selectionEnd===p.selectionStart?p.value.slice(0,p.selectionStart-1)+p.value.slice(p.selectionStart):p.value.slice(0,p.selectionStart)+p.value.slice(p.selectionEnd);break;case"deleteSoftLineBackward":case"deleteHardLineBackward":g=p.value.slice(p.selectionStart);break;default:d.data!=null&&(g=p.value.slice(0,p.selectionStart)+d.data+p.value.slice(p.selectionEnd));break}(g==null||!e.validate(g))&&d.preventDefault()});P.useEffect(()=>{if(!YP()||!n.current)return;let d=n.current;return d.addEventListener("beforeinput",i,!1),()=>{d.removeEventListener("beforeinput",i,!1)}},[n,i]);let a=YP()?null:d=>{let p=d.target.value.slice(0,d.target.selectionStart)+d.data+d.target.value.slice(d.target.selectionEnd);e.validate(p)||d.preventDefault()},{labelProps:s,inputProps:r,descriptionProps:o,errorMessageProps:c,...u}=wU(t,n),h=P.useRef(null);return{inputProps:ci(r,{onBeforeInput:a,onCompositionStart(){let{value:d,selectionStart:p,selectionEnd:g}=n.current;h.current={value:d,selectionStart:p,selectionEnd:g}},onCompositionEnd(){if(n.current&&!e.validate(n.current.value)){let{value:d,selectionStart:p,selectionEnd:g}=h.current;n.current.value=d,n.current.setSelectionRange(p,g),e.setInputValue(d)}}}),labelProps:s,descriptionProps:o,errorMessageProps:c,...u}}function EU(t){var e,n,i,a,s,r,o;const c=fa(),{validationBehavior:u}=ix(zg)||{},[h,d]=gr(t,AP.variantKeys),{ref:p,as:g,type:b,label:w,baseRef:x,wrapperRef:S,description:M,className:C,classNames:A,autoFocus:N,startContent:R,endContent:D,onClear:B,onChange:z,validationState:I,validationBehavior:U=(e=u??c?.validationBehavior)!=null?e:"native",innerWrapperRef:$,onValueChange:G=()=>{},...k}=h,X=P.useCallback(Mt=>{G(Mt??"")},[G]),[V,H]=P.useState(!1),W=g||"div",J=(i=(n=t.disableAnimation)!=null?n:c?.disableAnimation)!=null?i:!1,Y=_i(p),K=_i(x),ee=_i(S),ie=_i($),[Z,ue]=sh(h.value,(a=h.defaultValue)!=null?a:"",X),se=b==="file",ae=((o=(r=(s=Y?.current)==null?void 0:s.files)==null?void 0:r.length)!=null?o:0)>0,ce=["date","time","month","week","range"].includes(b),pe=!Xb(Z)||ce||ae,ye=pe||V,_e=b==="hidden",me=t.isMultiline,ne=Vt(A?.base,C,pe?"is-filled":""),be=P.useCallback(()=>{var Mt;se?Y.current.value="":ue(""),B?.(),(Mt=Y.current)==null||Mt.focus()},[ue,B,se]);Nd(()=>{Y.current&&ue(Y.current.value)},[Y.current]);const{labelProps:xe,inputProps:he,isInvalid:ve,validationErrors:Oe,validationDetails:Le,descriptionProps:Ae,errorMessageProps:et}=wU({...t,validationBehavior:U,autoCapitalize:t.autoCapitalize,value:Z,"aria-label":t.label?t["aria-label"]:lO(t["aria-label"],t.placeholder),inputElementType:me?"textarea":"input",onChange:ue},Y);se&&(delete he.value,delete he.onChange);const{isFocusVisible:tt,isFocused:re,focusProps:te}=Ts({autoFocus:N,isTextInput:!0}),{isHovered:we,hoverProps:Ce}=Qa({isDisabled:!!t?.isDisabled}),{isHovered:Ie,hoverProps:Pe}=Qa({isDisabled:!!t?.isDisabled}),{focusProps:Ze,isFocusVisible:We}=Ts(),{focusWithinProps:mt}=Rd({onFocusWithinChange:H}),{pressProps:nt}=bo({isDisabled:!!t?.isDisabled||!!t?.isReadOnly,onPress:be}),Ye=I==="invalid"||ve,Je=Mne({labelPlacement:t.labelPlacement,label:w}),jt=typeof h.errorMessage=="function"?h.errorMessage({isInvalid:Ye,validationErrors:Oe,validationDetails:Le}):h.errorMessage||Oe?.join(" "),wt=!!B||t.isClearable,Et=!!w||!!M||!!jt,zt=!!h.placeholder,Te=!!w,pt=!!M||!!jt,at=Je==="outside-left",St=Je==="outside-top",ct=Je==="outside"||at||St,it=Je==="inside",Nt=Y.current?(!Y.current.value||Y.current.value===""||!Z||Z==="")&&zt:!1,kt=!!R,Xt=ct?at||St||zt||Je==="outside"&&kt:!1,rn=Je==="outside"&&!zt&&!kt,ge=P.useMemo(()=>AP({...d,isInvalid:Ye,labelPlacement:Je,isClearable:wt,disableAnimation:J}),[ks(d),Ye,Je,wt,kt,J]),Se=P.useCallback((Mt={})=>({ref:K,className:ge.base({class:ne}),"data-slot":"base","data-filled":He(pe||zt||kt||Nt||se),"data-filled-within":He(ye||zt||kt||Nt||se),"data-focus-within":He(V),"data-focus-visible":He(tt),"data-readonly":He(t.isReadOnly),"data-focus":He(re),"data-hover":He(we||Ie),"data-required":He(t.isRequired),"data-invalid":He(Ye),"data-disabled":He(t.isDisabled),"data-has-elements":He(Et),"data-has-helper":He(pt),"data-has-label":He(Te),"data-has-value":He(!Nt),"data-hidden":He(_e),...mt,...Mt}),[ge,ne,pe,re,we,Ie,Ye,pt,Te,Et,Nt,kt,V,tt,ye,zt,mt,_e,t.isReadOnly,t.isRequired,t.isDisabled]),De=P.useCallback((Mt={})=>({"data-slot":"label",className:ge.label({class:A?.label}),...Yt(xe,Pe,Mt)}),[ge,Ie,xe,A?.label]),lt=P.useCallback(Mt=>{Mt.key==="Escape"&&Z&&(wt||B)&&!t.isReadOnly&&(ue(""),B?.())},[Z,ue,B,wt,t.isReadOnly]),rt=P.useCallback((Mt={})=>({"data-slot":"input","data-filled":He(pe),"data-filled-within":He(ye),"data-has-start-content":He(kt),"data-has-end-content":He(!!D),"data-type":b,className:ge.input({class:Vt(A?.input,pe?"is-filled":"",me?"pe-0":"",b==="password"?"[&::-ms-reveal]:hidden":"")}),...Yt(te,he,cs(k,{enabled:!0,labelable:!0,omitEventNames:new Set(Object.keys(he))}),Mt),"aria-readonly":He(t.isReadOnly),onChange:$r(he.onChange,z),onKeyDown:$r(he.onKeyDown,Mt.onKeyDown,lt),ref:Y}),[ge,Z,te,he,k,pe,ye,kt,D,A?.input,t.isReadOnly,t.isRequired,z,lt]),Bt=P.useCallback((Mt={})=>({ref:ee,"data-slot":"input-wrapper","data-hover":He(we||Ie),"data-focus-visible":He(tt),"data-focus":He(re),className:ge.inputWrapper({class:Vt(A?.inputWrapper,pe?"is-filled":"")}),...Yt(Mt,Ce),onClick:Ln=>{Y.current&&Ln.currentTarget===Ln.target&&Y.current.focus()},style:{cursor:"text",...Mt.style}}),[ge,we,Ie,tt,re,Z,A?.inputWrapper]),Ut=P.useCallback((Mt={})=>({...Mt,ref:ie,"data-slot":"inner-wrapper",onClick:Ln=>{Y.current&&Ln.currentTarget===Ln.target&&Y.current.focus()},className:ge.innerWrapper({class:Vt(A?.innerWrapper,Mt?.className)})}),[ge,A?.innerWrapper]),Dt=P.useCallback((Mt={})=>({...Mt,"data-slot":"main-wrapper",className:ge.mainWrapper({class:Vt(A?.mainWrapper,Mt?.className)})}),[ge,A?.mainWrapper]),ot=P.useCallback((Mt={})=>({...Mt,"data-slot":"helper-wrapper",className:ge.helperWrapper({class:Vt(A?.helperWrapper,Mt?.className)})}),[ge,A?.helperWrapper]),Lt=P.useCallback((Mt={})=>({...Mt,...Ae,"data-slot":"description",className:ge.description({class:Vt(A?.description,Mt?.className)})}),[ge,A?.description]),vt=P.useCallback((Mt={})=>({...Mt,...et,"data-slot":"error-message",className:ge.errorMessage({class:Vt(A?.errorMessage,Mt?.className)})}),[ge,et,A?.errorMessage]),Ot=P.useCallback((Mt={})=>({...Mt,type:"button",tabIndex:-1,disabled:t.isDisabled,"aria-label":"clear input","data-slot":"clear-button","data-focus-visible":He(We),className:ge.clearButton({class:Vt(A?.clearButton,Mt?.className)}),...Yt(nt,Ze)}),[ge,We,nt,Ze,A?.clearButton]);return{Component:W,classNames:A,domRef:Y,label:w,description:M,startContent:R,endContent:D,labelPlacement:Je,isClearable:wt,hasHelper:pt,hasStartContent:kt,isLabelOutside:Xt,isOutsideLeft:at,isOutsideTop:St,isLabelOutsideAsPlaceholder:rn,shouldLabelBeOutside:ct,shouldLabelBeInside:it,hasPlaceholder:zt,isInvalid:Ye,errorMessage:jt,getBaseProps:Se,getLabelProps:De,getInputProps:rt,getMainWrapperProps:Dt,getInputWrapperProps:Bt,getInnerWrapperProps:Ut,getHelperWrapperProps:ot,getDescriptionProps:Lt,getErrorMessageProps:vt,getClearButtonProps:Ot}}var MU=Si((t,e)=>{const{Component:n,label:i,description:a,isClearable:s,startContent:r,endContent:o,labelPlacement:c,hasHelper:u,isOutsideLeft:h,isOutsideTop:d,shouldLabelBeOutside:p,errorMessage:g,isInvalid:b,getBaseProps:w,getLabelProps:x,getInputProps:S,getInnerWrapperProps:M,getInputWrapperProps:C,getMainWrapperProps:A,getHelperWrapperProps:N,getDescriptionProps:R,getErrorMessageProps:D,getClearButtonProps:B}=EU({...t,ref:e}),z=i?_.jsx("label",{...x(),children:i}):null,I=P.useMemo(()=>s?_.jsx("button",{...B(),children:o||_.jsx(ex,{})}):o,[s,B]),U=P.useMemo(()=>{const k=b&&g;return!u||!(k||a)?null:_.jsx("div",{...N(),children:k?_.jsx("div",{...D(),children:g}):_.jsx("div",{...R(),children:a})})},[u,b,g,a,N,D,R]),$=P.useMemo(()=>_.jsxs("div",{...M(),children:[r,_.jsx("input",{...S()}),I]}),[r,I,S,M]),G=P.useMemo(()=>p?_.jsxs("div",{...A(),children:[_.jsxs("div",{...C(),children:[!h&&!d?z:null,$]}),U]}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{...C(),children:[z,$]}),U]}),[c,U,p,z,$,g,a,A,C,D,R]);return _.jsxs(n,{...w(),children:[h||d?z:null,G]})});MU.displayName="HeroUI.Input";var go=MU;function s1(){return s1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)({}).hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},s1.apply(null,arguments)}function ose(t,e){if(t==null)return{};var n={};for(var i in t)if({}.hasOwnProperty.call(t,i)){if(e.indexOf(i)!==-1)continue;n[i]=t[i]}return n}var lse=P.useLayoutEffect,cse=function(e){var n=ft.useRef(e);return lse(function(){n.current=e}),n},ZP=function(e,n){if(typeof e=="function"){e(n);return}e.current=n},use=function(e,n){var i=ft.useRef();return ft.useCallback(function(a){e.current=a,i.current&&ZP(i.current,null),i.current=n,n&&ZP(n,a)},[n])},QP={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},dse=function(e){Object.keys(QP).forEach(function(n){e.style.setProperty(n,QP[n],"important")})},JP=dse,Ur=null,eD=function(e,n){var i=e.scrollHeight;return n.sizingStyle.boxSizing==="border-box"?i+n.borderSize:i-n.paddingSize};function fse(t,e,n,i){n===void 0&&(n=1),i===void 0&&(i=1/0),Ur||(Ur=document.createElement("textarea"),Ur.setAttribute("tabindex","-1"),Ur.setAttribute("aria-hidden","true"),JP(Ur)),Ur.parentNode===null&&document.body.appendChild(Ur);var a=t.paddingSize,s=t.borderSize,r=t.sizingStyle,o=r.boxSizing;Object.keys(r).forEach(function(p){var g=p;Ur.style[g]=r[g]}),JP(Ur),Ur.value=e;var c=eD(Ur,t);Ur.value=e,c=eD(Ur,t),Ur.value="x";var u=Ur.scrollHeight-a,h=u*n;o==="border-box"&&(h=h+a+s),c=Math.max(h,c);var d=u*i;return o==="border-box"&&(d=d+a+s),c=Math.min(d,c),[c,u]}var tD=function(){},hse=function(e,n){return e.reduce(function(i,a){return i[a]=n[a],i},{})},pse=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],mse=!!document.documentElement.currentStyle,gse=function(e){var n=window.getComputedStyle(e);if(n===null)return null;var i=hse(pse,n),a=i.boxSizing;if(a==="")return null;mse&&a==="border-box"&&(i.width=parseFloat(i.width)+parseFloat(i.borderRightWidth)+parseFloat(i.borderLeftWidth)+parseFloat(i.paddingRight)+parseFloat(i.paddingLeft)+"px");var s=parseFloat(i.paddingBottom)+parseFloat(i.paddingTop),r=parseFloat(i.borderBottomWidth)+parseFloat(i.borderTopWidth);return{sizingStyle:i,paddingSize:s,borderSize:r}},vse=gse;function fA(t,e,n){var i=cse(n);P.useLayoutEffect(function(){var a=function(r){return i.current(r)};if(t)return t.addEventListener(e,a),function(){return t.removeEventListener(e,a)}},[])}var yse=function(e,n){fA(document.body,"reset",function(i){e.current.form===i.target&&n(i)})},bse=function(e){fA(window,"resize",e)},xse=function(e){fA(document.fonts,"loadingdone",e)},_se=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Sse=function(e,n){var i=e.cacheMeasurements,a=e.maxRows,s=e.minRows,r=e.onChange,o=r===void 0?tD:r,c=e.onHeightChange,u=c===void 0?tD:c,h=ose(e,_se),d=h.value!==void 0,p=P.useRef(null),g=use(p,n),b=P.useRef(0),w=P.useRef(),x=function(){var C=p.current,A=i&&w.current?w.current:vse(C);if(A){w.current=A;var N=fse(A,C.value||C.placeholder||"x",s,a),R=N[0],D=N[1];b.current!==R&&(b.current=R,C.style.setProperty("height",R+"px","important"),u(R,{rowHeight:D}))}},S=function(C){d||x(),o(C)};return P.useLayoutEffect(x),yse(p,function(){if(!d){var M=p.current.value;requestAnimationFrame(function(){var C=p.current;C&&M!==C.value&&x()})}}),bse(x),xse(x),P.createElement("textarea",s1({},h,{onChange:S,ref:g}))},wse=P.forwardRef(Sse),TU=Si(({style:t,minRows:e=3,maxRows:n=8,cacheMeasurements:i=!1,disableAutosize:a=!1,onHeightChange:s,...r},o)=>{const{Component:c,label:u,description:h,startContent:d,endContent:p,hasHelper:g,shouldLabelBeOutside:b,shouldLabelBeInside:w,isInvalid:x,errorMessage:S,getBaseProps:M,getLabelProps:C,getInputProps:A,getInnerWrapperProps:N,getInputWrapperProps:R,getHelperWrapperProps:D,getDescriptionProps:B,getErrorMessageProps:z,isClearable:I,getClearButtonProps:U}=EU({...r,ref:o,isMultiline:!0}),[$,G]=P.useState(e>1),[k,X]=P.useState(!1),V=u?_.jsx("label",{...C(),children:u}):null,H=A(),W=(Z,ue)=>{if(e===1&&G(Z>=ue.rowHeight*2),n>e){const se=Z>=n*ue.rowHeight;X(se)}s?.(Z,ue)},J=a?_.jsx("textarea",{...H,style:Yt(H.style,t??{})}):_.jsx(wse,{...H,cacheMeasurements:i,"data-hide-scroll":He(!k),maxRows:n,minRows:e,style:Yt(H.style,t??{}),onHeightChange:W}),Y=P.useMemo(()=>I?_.jsx("button",{...U(),children:_.jsx(ex,{})}):null,[I,U]),K=P.useMemo(()=>d||p?_.jsxs("div",{...N(),children:[d,J,p]}):_.jsx("div",{...N(),children:J}),[d,H,p,N]),ee=x&&S,ie=ee||h;return _.jsxs(c,{...M(),children:[b?V:null,_.jsxs("div",{...R(),"data-has-multiple-rows":He($),children:[w?V:null,K,Y]}),g&&ie?_.jsx("div",{...D(),children:ee?_.jsx("div",{...z(),children:S}):_.jsx("div",{...B(),children:h})}):null]})});TU.displayName="HeroUI.Textarea";var CU=TU;function Ese(t,e){const{groupRef:n,triggerRef:i,popoverRef:a,showArrow:s,offset:r=7,crossOffset:o=0,scrollRef:c,shouldFlip:u,boundaryElement:h,isDismissable:d=!0,shouldCloseOnBlur:p=!0,shouldCloseOnScroll:g=!0,placement:b="top",containerPadding:w,shouldCloseOnInteractOutside:x,isNonModal:S,isKeyboardDismissDisabled:M,updatePositionDeps:C=[],...A}=t,N=S??!0,R=A.trigger==="SubmenuTrigger",{overlayProps:D,underlayProps:B}=dA({isOpen:e.isOpen,onClose:e.close,shouldCloseOnBlur:p,isDismissable:d||R,isKeyboardDismissDisabled:M,shouldCloseOnInteractOutside:x||(k=>{var X;return!((X=i.current)!=null&&X.contains(k))}),disableOutsideEvents:!N},a),{overlayProps:z,arrowProps:I,placement:U,updatePosition:$,triggerAnchorPoint:G}=mz({...A,shouldFlip:u,crossOffset:o,targetRef:i,overlayRef:a,isOpen:e.isOpen,scrollRef:c,boundaryElement:h,containerPadding:w,placement:QB(b),offset:s?r+3:r,onClose:N&&!R&&g?e.close:()=>{}});return Nd(()=>{C.length&&$()},C),P.useEffect(()=>{var k,X;if(e.isOpen&&a.current)return N?gae((k=n?.current)!=null?k:a.current):mae([(X=n?.current)!=null?X:a.current])},[N,e.isOpen,a,n]),{popoverProps:Yt(D,z),arrowProps:I,underlayProps:B,placement:U,triggerAnchorPoint:G}}var Mse="top";function AU(t){var e,n,i;const a=fa(),[s,r]=gr(t,US.variantKeys),{as:o,ref:c,children:u,state:h,triggerRef:d,scrollRef:p,defaultOpen:g,onOpenChange:b,isOpen:w,isNonModal:x=!0,shouldFlip:S=!0,containerPadding:M=12,shouldBlockScroll:C=!1,isDismissable:A=!0,shouldCloseOnBlur:N,portalContainer:R,updatePositionDeps:D,dialogProps:B,placement:z=Mse,triggerType:I="dialog",showArrow:U=!1,offset:$=7,crossOffset:G=0,boundaryElement:k,isKeyboardDismissDisabled:X,shouldCloseOnInteractOutside:V,shouldCloseOnScroll:H,triggerAnchorPoint:W,motionProps:J,className:Y,classNames:K,onClose:ee,...ie}=s,Z=o||"div",ue=_i(c),se=P.useRef(null),ae=P.useRef(!1),ce=d||se,pe=(n=(e=t.disableAnimation)!=null?e:a?.disableAnimation)!=null?n:!1,ye=fw({isOpen:w,defaultOpen:g,onOpenChange:Ze=>{b?.(Ze),Ze||ee?.()}}),_e=h||ye,{popoverProps:me,underlayProps:ne,placement:be}=Ese({triggerRef:ce,isNonModal:x,popoverRef:ue,placement:z,offset:$,scrollRef:p,isDismissable:A,shouldCloseOnBlur:N,boundaryElement:k,crossOffset:G,shouldFlip:S,containerPadding:M,updatePositionDeps:D,isKeyboardDismissDisabled:X,shouldCloseOnScroll:H,shouldCloseOnInteractOutside:V,triggerAnchorPoint:W},_e),xe=P.useMemo(()=>be?pae(be,z)?be:z:null,[be,z]),{triggerProps:he}=Pz({type:I},_e,ce),{isFocusVisible:ve,isFocused:Oe,focusProps:Le}=Ts(),Ae=P.useMemo(()=>US({...r}),[ks(r)]),et=Vt(K?.base,Y),tt={"--trigger-anchor-point":W?`${W.x}px ${W.y}px`:void 0};aA({isDisabled:!(C&&_e.isOpen)});const re=(Ze={})=>({ref:ue,...Yt(me,ie,Ze),style:Yt(me.style,ie.style,Ze.style)}),te=(Ze={})=>({"data-slot":"base","data-open":He(_e.isOpen),"data-focus":He(Oe),"data-arrow":He(U),"data-focus-visible":He(ve),"data-placement":be?FS(be,z):void 0,...Yt(Le,B,Ze),className:Ae.base({class:Vt(et)}),style:{outline:"none",...tt}}),we=P.useCallback((Ze={})=>({"data-slot":"content","data-open":He(_e.isOpen),"data-arrow":He(U),"data-placement":be?FS(be,z):void 0,className:Ae.content({class:Vt(K?.content,Ze.className)})}),[Ae,_e.isOpen,U,xe,z,K,be]),Ce=P.useCallback(Ze=>{var We;let mt;return Ze.pointerType==="touch"&&(t?.backdrop==="blur"||t?.backdrop==="opaque")?mt=setTimeout(()=>{ae.current=!0},100):ae.current=!0,(We=he.onPress)==null||We.call(he,Ze),()=>{clearTimeout(mt)}},[he?.onPress]),Ie=P.useCallback((Ze={},We=null)=>{const{isDisabled:mt,...nt}=Ze;return{"data-slot":"trigger",...Yt({"aria-haspopup":"dialog"},he,nt),onPress:Ce,isDisabled:mt,className:Ae.trigger({class:Vt(K?.trigger,Ze.className),isTriggerDisabled:mt}),ref:fC(We,ce)}},[_e,he,Ce,ce]),Pe=P.useCallback((Ze={})=>({"data-slot":"backdrop",className:Ae.backdrop({class:K?.backdrop}),onClick:We=>{if(!ae.current){We.preventDefault();return}_e.close(),ae.current=!1},...ne,...Ze}),[Ae,_e.isOpen,K,ne]);return{state:_e,Component:Z,children:u,classNames:K,showArrow:U,triggerRef:ce,placement:xe,isNonModal:x,popoverRef:ue,portalContainer:R,isOpen:_e.isOpen,onClose:_e.close,disableAnimation:pe,shouldBlockScroll:C,backdrop:(i=t.backdrop)!=null?i:"transparent",motionProps:J,getBackdropProps:Pe,getPopoverProps:re,getTriggerProps:Ie,getDialogProps:te,getContentProps:we}}function hA(t,e){let{role:n="dialog"}=t,i=Ng();i=t["aria-label"]?void 0:i;let a=P.useRef(!1);return P.useEffect(()=>{if(e.current&&!e.current.contains(document.activeElement)){Xf(e.current);let s=setTimeout(()=>{(document.activeElement===e.current||document.activeElement===document.body)&&(a.current=!0,e.current&&(e.current.blur(),Xf(e.current)),a.current=!1)},500);return()=>{clearTimeout(s)}}},[e]),yB(),{dialogProps:{...Dl(t,{labelable:!0}),role:n,tabIndex:-1,"aria-labelledby":t["aria-labelledby"]||i,onBlur:s=>{a.current&&s.stopPropagation()}},titleProps:{id:i}}}var RU=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),NU=Si(({children:t,motionProps:e,placement:n,disableAnimation:i,style:a={},transformOrigin:s={},...r},o)=>{let c=a;return s.originX!==void 0||s.originY!==void 0?c={...c,transformOrigin:s}:n&&(c={...c,...lA(n==="center"?"top":n)}),i?_.jsx("div",{...r,ref:o,children:t}):_.jsx(Al,{features:RU,children:_.jsx(Rl.div,{ref:o,animate:"enter",exit:"exit",initial:"initial",style:c,variants:qf.scaleSpringOpacity,...Yt(r,e),children:t})})});NU.displayName="HeroUI.FreeSoloPopoverWrapper";var PU=Si(({children:t,transformOrigin:e,disableDialogFocus:n=!1,...i},a)=>{const{Component:s,state:r,placement:o,backdrop:c,portalContainer:u,disableAnimation:h,motionProps:d,isNonModal:p,getPopoverProps:g,getBackdropProps:b,getDialogProps:w,getContentProps:x}=AU({...i,ref:a}),S=P.useRef(null),{dialogProps:M,titleProps:C}=hA({},S),A=w({...!n&&{ref:S},...M}),N=P.useMemo(()=>c==="transparent"?null:h?_.jsx("div",{...b()}):_.jsx(Al,{features:RU,children:_.jsx(Rl.div,{animate:"enter",exit:"exit",initial:"exit",variants:qf.fade,...b()})}),[c,h,b]);return _.jsxs(sA,{portalContainer:u,children:[!p&&N,_.jsx(s,{...g(),children:_.jsxs(NU,{disableAnimation:h,motionProps:d,placement:o,tabIndex:-1,transformOrigin:e,...A,children:[!p&&_.jsx(Ig,{onDismiss:r.close}),_.jsx("div",{...x(),children:typeof t=="function"?t(C):t}),_.jsx(Ig,{onDismiss:r.close})]})})]})});PU.displayName="HeroUI.FreeSoloPopover";var Tse=PU,[Cse,DU]=ih({name:"PopoverContext",errorMessage:"usePopoverContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Popover />`"}),nD=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),LU=t=>{const{as:e,children:n,className:i,...a}=t,{Component:s,placement:r,backdrop:o,motionProps:c,disableAnimation:u,getPopoverProps:h,getDialogProps:d,getBackdropProps:p,getContentProps:g,isNonModal:b,onClose:w}=DU(),x=P.useRef(null),{dialogProps:S,titleProps:M}=hA({},x),C=d({ref:x,...S,...a}),A=e||s||"div",N=n&&_.jsxs(_.Fragment,{children:[!b&&_.jsx(Ig,{onDismiss:w}),_.jsx(A,{...C,children:_.jsx("div",{...g({className:i}),children:typeof n=="function"?n(M):n})}),_.jsx(Ig,{onDismiss:w})]}),R=P.useMemo(()=>o==="transparent"?null:u?_.jsx("div",{...p()}):_.jsx(Al,{features:nD,children:_.jsx(Rl.div,{animate:"enter",exit:"exit",initial:"exit",variants:qf.fade,...p()})}),[o,u,p]),D=r?lA(r==="center"?"top":r):void 0,B=_.jsx(_.Fragment,{children:u?N:_.jsx(Al,{features:nD,children:_.jsx(Rl.div,{animate:"enter",exit:"exit",initial:"initial",style:D,variants:qf.scaleSpringOpacity,...c,children:N})})});return _.jsxs("div",{...h(),children:[R,B]})};LU.displayName="HeroUI.PopoverContent";var iv=LU,OU=t=>{var e;const{triggerRef:n,getTriggerProps:i}=DU(),{children:a,...s}=t,r=P.useMemo(()=>typeof a=="string"?_.jsx("p",{children:a}):P.Children.only(a),[a]),o=(e=r.props.ref)!=null?e:r.ref,{onPress:c,isDisabled:u,...h}=P.useMemo(()=>i(Yt(s,r.props),o),[i,r.props,s,o]),[,d]=bq(a,Zt),{buttonProps:p}=tx({onPress:c,isDisabled:u},n),g=P.useMemo(()=>d?.[0]!==void 0,[d]);return g||delete h.preventFocusOnPress,P.cloneElement(r,Yt(h,g?{onPress:c,isDisabled:u}:p))};OU.displayName="HeroUI.PopoverTrigger";var av=OU,IU=Si((t,e)=>{const{children:n,...i}=t,a=AU({...i,ref:e}),[s,r]=P.Children.toArray(n),o=_.jsx(sA,{portalContainer:a.portalContainer,children:r});return _.jsxs(Cse,{value:a,children:[s,a.disableAnimation&&a.isOpen?o:_.jsx(Hs,{children:a.isOpen?o:null})]})});IU.displayName="HeroUI.Popover";var sv=IU,zU={};zU={longPressMessage:"اضغط مطولاً أو اضغط على Alt + السهم لأسفل لفتح القائمة"};var BU={};BU={longPressMessage:"Натиснете продължително или натиснете Alt+ стрелка надолу, за да отворите менюто"};var UU={};UU={longPressMessage:"Dlouhým stiskem nebo stisknutím kláves Alt + šipka dolů otevřete nabídku"};var jU={};jU={longPressMessage:"Langt tryk eller tryk på Alt + pil ned for at åbne menuen"};var FU={};FU={longPressMessage:"Drücken Sie lange oder drücken Sie Alt + Nach-unten, um das Menü zu öffnen"};var VU={};VU={longPressMessage:"Πιέστε παρατεταμένα ή πατήστε Alt + κάτω βέλος για να ανοίξετε το μενού"};var kU={};kU={longPressMessage:"Long press or press Alt + ArrowDown to open menu"};var HU={};HU={longPressMessage:"Mantenga pulsado o pulse Alt + flecha abajo para abrir el menú"};var $U={};$U={longPressMessage:"Menüü avamiseks vajutage pikalt või vajutage klahve Alt + allanool"};var GU={};GU={longPressMessage:"Avaa valikko painamalla pohjassa tai näppäinyhdistelmällä Alt + Alanuoli"};var WU={};WU={longPressMessage:"Appuyez de manière prolongée ou appuyez sur Alt + Flèche vers le bas pour ouvrir le menu."};var KU={};KU={longPressMessage:"לחץ לחיצה ארוכה או הקש Alt + ArrowDown כדי לפתוח את התפריט"};var XU={};XU={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dolje za otvaranje izbornika"};var qU={};qU={longPressMessage:"Nyomja meg hosszan, vagy nyomja meg az Alt + lefele nyíl gombot a menü megnyitásához"};var YU={};YU={longPressMessage:"Premere a lungo o premere Alt + Freccia giù per aprire il menu"};var ZU={};ZU={longPressMessage:"長押しまたは Alt+下矢印キーでメニューを開く"};var QU={};QU={longPressMessage:"길게 누르거나 Alt + 아래쪽 화살표를 눌러 메뉴 열기"};var JU={};JU={longPressMessage:"Norėdami atidaryti meniu, nuspaudę palaikykite arba paspauskite „Alt + ArrowDown“."};var ej={};ej={longPressMessage:"Lai atvērtu izvēlni, turiet nospiestu vai nospiediet taustiņu kombināciju Alt + lejupvērstā bultiņa"};var tj={};tj={longPressMessage:"Langt trykk eller trykk Alt + PilNed for å åpne menyen"};var nj={};nj={longPressMessage:"Druk lang op Alt + pijl-omlaag of druk op Alt om het menu te openen"};var ij={};ij={longPressMessage:"Naciśnij i przytrzymaj lub naciśnij klawisze Alt + Strzałka w dół, aby otworzyć menu"};var aj={};aj={longPressMessage:"Pressione e segure ou pressione Alt + Seta para baixo para abrir o menu"};var sj={};sj={longPressMessage:"Prima continuamente ou prima Alt + Seta Para Baixo para abrir o menu"};var rj={};rj={longPressMessage:"Apăsați lung sau apăsați pe Alt + săgeată în jos pentru a deschide meniul"};var oj={};oj={longPressMessage:"Нажмите и удерживайте или нажмите Alt + Стрелка вниз, чтобы открыть меню"};var lj={};lj={longPressMessage:"Ponuku otvoríte dlhým stlačením alebo stlačením klávesu Alt + klávesu so šípkou nadol"};var cj={};cj={longPressMessage:"Za odprtje menija pritisnite in držite gumb ali pritisnite Alt+puščica navzdol"};var uj={};uj={longPressMessage:"Dugo pritisnite ili pritisnite Alt + strelicu prema dole da otvorite meni"};var dj={};dj={longPressMessage:"Håll nedtryckt eller tryck på Alt + pil nedåt för att öppna menyn"};var fj={};fj={longPressMessage:"Menüyü açmak için uzun basın veya Alt + Aşağı Ok tuşuna basın"};var hj={};hj={longPressMessage:"Довго або звичайно натисніть комбінацію клавіш Alt і стрілка вниз, щоб відкрити меню"};var pj={};pj={longPressMessage:"长按或按 Alt + 向下方向键以打开菜单"};var mj={};mj={longPressMessage:"長按或按 Alt+向下鍵以開啟功能表"};var gj={};gj={"ar-AE":zU,"bg-BG":BU,"cs-CZ":UU,"da-DK":jU,"de-DE":FU,"el-GR":VU,"en-US":kU,"es-ES":HU,"et-EE":$U,"fi-FI":GU,"fr-FR":WU,"he-IL":KU,"hr-HR":XU,"hu-HU":qU,"it-IT":YU,"ja-JP":ZU,"ko-KR":QU,"lt-LT":JU,"lv-LV":ej,"nb-NO":tj,"nl-NL":nj,"pl-PL":ij,"pt-BR":aj,"pt-PT":sj,"ro-RO":rj,"ru-RU":oj,"sk-SK":lj,"sl-SI":cj,"sr-SP":uj,"sv-SE":dj,"tr-TR":fj,"uk-UA":hj,"zh-CN":pj,"zh-TW":mj};function Ase(t){return t&&t.__esModule?t.default:t}function Rse(t,e,n){let{type:i="menu",isDisabled:a,trigger:s="press"}=t,r=Us(),{triggerProps:o,overlayProps:c}=Pz({type:i},e,n),u=g=>{if(!a&&!(s==="longPress"&&!g.altKey)&&n&&n.current)switch(g.key){case"Enter":case" ":if(s==="longPress"||g.isDefaultPrevented())return;case"ArrowDown":"continuePropagation"in g||g.stopPropagation(),g.preventDefault(),e.toggle("first");break;case"ArrowUp":"continuePropagation"in g||g.stopPropagation(),g.preventDefault(),e.toggle("last");break;default:"continuePropagation"in g&&g.continuePropagation()}},h=Qg(Ase(gj),"@react-aria/menu"),{longPressProps:d}=Tz({isDisabled:a||s!=="longPress",accessibilityDescription:h.format("longPressMessage"),onLongPressStart(){e.close()},onLongPress(){e.open("first")}}),p={preventFocusOnPress:!0,onPressStart(g){g.pointerType!=="touch"&&g.pointerType!=="keyboard"&&!a&&(or(g.target),e.open(g.pointerType==="virtual"?"first":null))},onPress(g){g.pointerType==="touch"&&!a&&(or(g.target),e.toggle())}};return delete o.onPress,{menuTriggerProps:{...o,...s==="press"?p:d,id:r,onKeyDown:u},menuProps:{...c,"aria-labelledby":r,autoFocus:e.focusStrategy||!0,onClose:e.close}}}var Nse=700;function vj(){return G1()||typeof window>"u"?!1:window.screen.width<=Nse}function Pse(t){let e=fw(t),[n,i]=P.useState(null),[a,s]=P.useState([]),r=()=>{s([]),e.close()};return{focusStrategy:n,...e,open(u=null){i(u),e.open()},toggle(u=null){i(u),e.toggle()},close(){r()},expandedKeysStack:a,openSubmenu:(u,h)=>{s(d=>h>d.length?d:[...d.slice(0,h),u])},closeSubmenu:(u,h)=>{s(d=>d[h]===u?d.slice(0,h):d)}}}function Dse(t){var e,n;const i=fa(),[a,s]=gr(t,DP.variantKeys),{ref:r,as:o,src:c,className:u,classNames:h,loading:d,isBlurred:p,fallbackSrc:g,isLoading:b,disableSkeleton:w=!!g,removeWrapper:x=!1,onError:S,onLoad:M,srcSet:C,sizes:A,crossOrigin:N,...R}=a,D=JB({src:c,loading:d,onError:S,onLoad:M,ignoreFallback:!1,srcSet:C,sizes:A,crossOrigin:N,shouldBypassImageLoad:o!==void 0}),B=(n=(e=t.disableAnimation)!=null?e:i?.disableAnimation)!=null?n:!1,z=D==="loaded"&&!b,I=D==="loading"||b,U=t.isZoomed,$=o||"img",G=_i(r),{w:k,h:X}=P.useMemo(()=>({w:a.width?typeof a.width=="number"?`${a.width}px`:a.width:"fit-content",h:a.height?typeof a.height=="number"?`${a.height}px`:a.height:"auto"}),[a?.width,a?.height]),V=(!c||!z)&&!!g,H=I&&!w,W=P.useMemo(()=>DP({...s,disableAnimation:B,showSkeleton:H}),[ks(s),B,H]),J=Vt(u,h?.img),Y=(ie={})=>{const Z=Vt(J,ie?.className);return{src:c,ref:G,"data-loaded":He(z),className:W.img({class:Z}),loading:d,srcSet:C,sizes:A,crossOrigin:N,...R,style:{...R?.height&&{height:X},...ie.style,...R.style}}},K=P.useCallback(()=>{const ie=V?{backgroundImage:`url(${g})`}:{};return{className:W.wrapper({class:h?.wrapper}),style:{...ie,maxWidth:k}}},[W,V,g,h?.wrapper,k]),ee=P.useCallback(()=>({src:c,"aria-hidden":He(!0),className:W.blurredImg({class:h?.blurredImg})}),[W,c,h?.blurredImg]);return{Component:$,domRef:G,slots:W,classNames:h,isBlurred:p,disableSkeleton:w,fallbackSrc:g,removeWrapper:x,isZoomed:U,isLoading:I,getImgProps:Y,getWrapperProps:K,getBlurredImgProps:ee}}var yj=Si((t,e)=>{const{Component:n,domRef:i,slots:a,classNames:s,isBlurred:r,isZoomed:o,fallbackSrc:c,removeWrapper:u,disableSkeleton:h,getImgProps:d,getWrapperProps:p,getBlurredImgProps:g}=Dse({...t,ref:e}),b=_.jsx(n,{ref:i,...d()});if(u)return b;const w=_.jsx("div",{className:a.zoomedWrapper({class:s?.zoomedWrapper}),children:b});return r?_.jsxs("div",{...p(),children:[o?w:b,P.cloneElement(b,g())]}):o||!h||c?_.jsxs("div",{...p(),children:[" ",o?w:b]}):b});yj.displayName="HeroUI.Image";var pA=yj,[Lse,hw]=ih({name:"ModalContext",errorMessage:"useModalContext: `context` is undefined. Seems you forgot to wrap all popover components within `<Modal />`"}),bj=Si((t,e)=>{const{as:n,children:i,className:a,...s}=t,{slots:r,classNames:o,bodyId:c,setBodyMounted:u}=hw(),h=_i(e),d=n||"div";return P.useEffect(()=>(u(!0),()=>u(!1)),[u]),_.jsx(d,{ref:h,className:r.body({class:Vt(o?.body,a)}),id:c,...s,children:i})});bj.displayName="HeroUI.ModalBody";var oh=bj,Ose={enter:{scale:"var(--scale-enter)",y:"var(--slide-enter)",opacity:1,willChange:"auto",transition:{scale:{duration:.4,ease:Rb.ease},opacity:{duration:.4,ease:Rb.ease},y:{type:"spring",bounce:0,duration:.6}}},exit:{scale:"var(--scale-exit)",y:"var(--slide-exit)",opacity:0,willChange:"transform",transition:{duration:.3,ease:Rb.ease}}},tu=typeof document<"u"&&window.visualViewport,Ise=ft.createContext(!1);function zse(){return!1}function Bse(){return!0}function Use(t){return()=>{}}function jse(){return typeof ft.useSyncExternalStore=="function"?ft.useSyncExternalStore(Use,zse,Bse):P.useContext(Ise)}function Fse(){let t=jse(),[e,n]=P.useState(()=>t?{width:0,height:0}:iD());return P.useEffect(()=>{let i=()=>{n(a=>{let s=iD();return s.width===a.width&&s.height===a.height?a:s})};return tu?tu.addEventListener("resize",i):window.addEventListener("resize",i),()=>{tu?tu.removeEventListener("resize",i):window.removeEventListener("resize",i)}},[]),e}function iD(){return{width:tu&&tu?.width||window.innerWidth,height:tu&&tu?.height||window.innerHeight}}var aD=()=>bu(()=>import("./index-DvSYKMeA.js"),__vite__mapDeps([0,1]),import.meta.url).then(t=>t.default),xj=t=>{const{as:e,children:n,role:i="dialog",...a}=t,{Component:s,domRef:r,slots:o,classNames:c,motionProps:u,backdrop:h,closeButton:d,hideCloseButton:p,disableAnimation:g,getDialogProps:b,getBackdropProps:w,getCloseButtonProps:x,onClose:S}=hw(),M=e||s||"div",C=Fse(),{dialogProps:A}=hA({role:i},r),N=P.isValidElement(d)?P.cloneElement(d,x()):_.jsx("button",{...x(),children:_.jsx(HB,{})}),R=P.useCallback($=>{$.key==="Tab"&&$.nativeEvent.isComposing&&($.stopPropagation(),$.preventDefault())},[]),D=b(Yt(A,a)),B=_.jsxs(M,{...D,onKeyDown:$r(D.onKeyDown,R),children:[_.jsx(Ig,{onDismiss:S}),!p&&N,typeof n=="function"?n(S):n,_.jsx(Ig,{onDismiss:S})]}),z=P.useMemo(()=>h==="transparent"?null:g?_.jsx("div",{...w()}):_.jsx(Al,{features:aD,children:_.jsx(Rl.div,{animate:"enter",exit:"exit",initial:"exit",variants:qf.fade,...w()})}),[h,g,w]),I={"--visual-viewport-height":C.height+"px"},U=g?_.jsx("div",{className:o.wrapper({class:c?.wrapper}),"data-slot":"wrapper",style:I,children:B}):_.jsx(Al,{features:aD,children:_.jsx(Rl.div,{animate:"enter",className:o.wrapper({class:c?.wrapper}),"data-slot":"wrapper",exit:"exit",initial:"exit",variants:Ose,...u,style:I,children:B})});return _.jsxs("div",{tabIndex:-1,children:[z,U]})};xj.displayName="HeroUI.ModalContent";var lh=xj,_j=Si((t,e)=>{const{as:n,children:i,className:a,...s}=t,{slots:r,classNames:o}=hw(),c=_i(e),u=n||"footer";return _.jsx(u,{ref:c,className:r.footer({class:Vt(o?.footer,a)}),...s,children:i})});_j.displayName="HeroUI.ModalFooter";var rv=_j,Sj=Si((t,e)=>{const{as:n,children:i,className:a,...s}=t,{slots:r,classNames:o,headerId:c,setHeaderMounted:u}=hw(),h=_i(e),d=n||"header";return P.useEffect(()=>(u(!0),()=>u(!1)),[u]),_.jsx(d,{ref:h,className:r.header({class:Vt(o?.header,a)}),id:c,...s,children:i})});Sj.displayName="HeroUI.ModalHeader";var ch=Sj;function Vse(t={shouldBlockScroll:!0},e,n){let{overlayProps:i,underlayProps:a}=dA({...t,isOpen:e.isOpen,onClose:e.close},n);return aA({isDisabled:!e.isOpen||!t.shouldBlockScroll}),yB(),P.useEffect(()=>{if(e.isOpen&&n.current)return wne([n.current])},[e.isOpen,n]),{modalProps:ci(i),underlayProps:a}}function kse(t){var e,n,i;const a=fa(),[s,r]=gr(t,NP.variantKeys),{ref:o,as:c,className:u,classNames:h,isOpen:d,defaultOpen:p,onOpenChange:g,motionProps:b,closeButton:w,isDismissable:x=!0,hideCloseButton:S=!1,shouldBlockScroll:M=!0,portalContainer:C,isKeyboardDismissDisabled:A=!1,onClose:N,...R}=s,D=c||"section",B=_i(o),z=P.useRef(null),[I,U]=P.useState(!1),[$,G]=P.useState(!1),k=(n=(e=t.disableAnimation)!=null?e:a?.disableAnimation)!=null?n:!1,X=P.useId(),V=P.useId(),H=P.useId(),W=fw({isOpen:d,defaultOpen:p,onOpenChange:pe=>{g?.(pe),pe||N?.()}}),{modalProps:J,underlayProps:Y}=Vse({isDismissable:x,shouldBlockScroll:M,isKeyboardDismissDisabled:A},W,B),{buttonProps:K}=tx({onPress:W.close},z),{isFocusVisible:ee,focusProps:ie}=Ts(),Z=Vt(h?.base,u),ue=P.useMemo(()=>NP({...r,disableAnimation:k}),[ks(r),k]),se=(pe={},ye=null)=>{var _e;return{ref:fC(ye,B),...Yt(J,R,pe),className:ue.base({class:Vt(Z,pe.className)}),id:X,"data-open":He(W.isOpen),"data-dismissable":He(x),"aria-modal":He(!0),"data-placement":(_e=t?.placement)!=null?_e:"right","aria-labelledby":I?V:void 0,"aria-describedby":$?H:void 0}},ae=P.useCallback((pe={})=>({className:ue.backdrop({class:h?.backdrop}),...Y,...pe}),[ue,h,Y]),ce=()=>({role:"button",tabIndex:0,"aria-label":"Close","data-focus-visible":He(ee),className:ue.closeButton({class:h?.closeButton}),...Yt(K,ie)});return{Component:D,slots:ue,domRef:B,headerId:V,bodyId:H,motionProps:b,classNames:h,isDismissable:x,closeButton:w,hideCloseButton:S,portalContainer:C,shouldBlockScroll:M,backdrop:(i=t.backdrop)!=null?i:"opaque",isOpen:W.isOpen,onClose:W.close,disableAnimation:k,setBodyMounted:G,setHeaderMounted:U,getDialogProps:se,getBackdropProps:ae,getCloseButtonProps:ce}}var wj=Si((t,e)=>{const{children:n,...i}=t,a=kse({...i,ref:e}),s=_.jsx(sA,{portalContainer:a.portalContainer,children:n});return _.jsx(Lse,{value:a,children:a.disableAnimation&&a.isOpen?s:_.jsx(Hs,{children:a.isOpen?s:null})})});wj.displayName="HeroUI.Modal";var Ej=wj;const Mj=7e3;let gl=null;function Hse(t,e="assertive",n=Mj){gl?gl.announce(t,e,n):(gl=new Gse,(typeof IS_REACT_ACT_ENVIRONMENT=="boolean"?IS_REACT_ACT_ENVIRONMENT:typeof jest<"u")?gl.announce(t,e,n):setTimeout(()=>{gl?.isAttached()&&gl?.announce(t,e,n)},100))}function $se(t){gl&&gl.clear(t)}class Gse{isAttached(){var e;return(e=this.node)===null||e===void 0?void 0:e.isConnected}createLog(e){let n=document.createElement("div");return n.setAttribute("role","log"),n.setAttribute("aria-live",e),n.setAttribute("aria-relevant","additions"),n}destroy(){this.node&&(document.body.removeChild(this.node),this.node=null)}announce(e,n="assertive",i=Mj){var a,s;if(!this.node)return;let r=document.createElement("div");typeof e=="object"?(r.setAttribute("role","img"),r.setAttribute("aria-labelledby",e["aria-labelledby"])):r.textContent=e,n==="assertive"?(a=this.assertiveLog)===null||a===void 0||a.appendChild(r):(s=this.politeLog)===null||s===void 0||s.appendChild(r),e!==""&&setTimeout(()=>{r.remove()},i)}clear(e){this.node&&((!e||e==="assertive")&&this.assertiveLog&&(this.assertiveLog.innerHTML=""),(!e||e==="polite")&&this.politeLog&&(this.politeLog.innerHTML=""))}constructor(){this.node=null,this.assertiveLog=null,this.politeLog=null,typeof document<"u"&&(this.node=document.createElement("div"),this.node.dataset.liveAnnouncer="true",Object.assign(this.node.style,{border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"}),this.assertiveLog=this.createLog("assertive"),this.node.appendChild(this.assertiveLog),this.politeLog=this.createLog("polite"),this.node.appendChild(this.politeLog),document.body.prepend(this.node))}}function D0(t,e,n){let i=n.initialDeps??[],a;return()=>{var s,r,o,c;let u;n.key&&((s=n.debug)!=null&&s.call(n))&&(u=Date.now());const h=t();if(!(h.length!==i.length||h.some((g,b)=>i[b]!==g)))return a;i=h;let p;if(n.key&&((r=n.debug)!=null&&r.call(n))&&(p=Date.now()),a=e(...h),n.key&&((o=n.debug)!=null&&o.call(n))){const g=Math.round((Date.now()-u)*100)/100,b=Math.round((Date.now()-p)*100)/100,w=b/16,x=(S,M)=>{for(S=String(S);S.length<M;)S=" "+S;return S};console.info(`%c⏱ ${x(b,5)} /${x(g,5)} ms`,`
font-size: .6rem;
font-weight: bold;
color: hsl(${Math.max(0,Math.min(120-120*w,120))}deg 100% 31%);`,n?.key)}return(c=n?.onChange)==null||c.call(n,a),a}}function LE(t,e){if(t===void 0)throw new Error("Unexpected undefined");return t}const Wse=(t,e)=>Math.abs(t-e)<1,Kse=(t,e,n)=>{let i;return function(...a){t.clearTimeout(i),i=t.setTimeout(()=>e.apply(this,a),n)}},Xse=t=>t,qse=t=>{const e=Math.max(t.startIndex-t.overscan,0),n=Math.min(t.endIndex+t.overscan,t.count-1),i=[];for(let a=e;a<=n;a++)i.push(a);return i},Yse=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;const a=r=>{const{width:o,height:c}=r;e({width:Math.round(o),height:Math.round(c)})};if(a(n.getBoundingClientRect()),!i.ResizeObserver)return()=>{};const s=new i.ResizeObserver(r=>{const o=r[0];if(o?.borderBoxSize){const c=o.borderBoxSize[0];if(c){a({width:c.inlineSize,height:c.blockSize});return}}a(n.getBoundingClientRect())});return s.observe(n,{box:"border-box"}),()=>{s.unobserve(n)}},sD={passive:!0},Zse=typeof window>"u"?!0:"onscrollend"in window,Qse=(t,e)=>{const n=t.scrollElement;if(!n)return;const i=t.targetWindow;if(!i)return;let a=0;const s=t.options.useScrollendEvent&&Zse?()=>{}:Kse(i,()=>{e(a,!1)},t.options.isScrollingResetDelay),r=u=>()=>{const{horizontal:h,isRtl:d}=t.options;a=h?n.scrollLeft*(d&&-1||1):n.scrollTop,s(),e(a,u)},o=r(!0),c=r(!1);return c(),n.addEventListener("scroll",o,sD),n.addEventListener("scrollend",c,sD),()=>{n.removeEventListener("scroll",o),n.removeEventListener("scrollend",c)}},Jse=(t,e,n)=>{if(e?.borderBoxSize){const i=e.borderBoxSize[0];if(i)return Math.round(i[n.options.horizontal?"inlineSize":"blockSize"])}return Math.round(t.getBoundingClientRect()[n.options.horizontal?"width":"height"])},ere=(t,{adjustments:e=0,behavior:n},i)=>{var a,s;const r=t+e;(s=(a=i.scrollElement)==null?void 0:a.scrollTo)==null||s.call(a,{[i.options.horizontal?"left":"top"]:r,behavior:n})};class tre{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let n=null;const i=()=>n||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:n=new this.targetWindow.ResizeObserver(a=>{a.forEach(s=>{this._measureElement(s.target,s)})}));return{disconnect:()=>{var a;(a=i())==null||a.disconnect(),n=null},observe:a=>{var s;return(s=i())==null?void 0:s.observe(a,{box:"border-box"})},unobserve:a=>{var s;return(s=i())==null?void 0:s.unobserve(a)}}})(),this.range=null,this.setOptions=n=>{Object.entries(n).forEach(([i,a])=>{typeof a>"u"&&delete n[i]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Xse,rangeExtractor:qse,onChange:()=>{},measureElement:Jse,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!0,...n}},this.notify=n=>{var i,a;(a=(i=this.options).onChange)==null||a.call(i,this,n)},this.maybeNotify=D0(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),n=>{this.notify(n)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(n=>n()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var n;const i=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==i){if(this.cleanup(),!i){this.maybeNotify();return}this.scrollElement=i,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((n=this.scrollElement)==null?void 0:n.window)??null,this.elementsCache.forEach(a=>{this.observer.observe(a)}),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,a=>{this.scrollRect=a,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(a,s)=>{this.scrollAdjustments=0,this.scrollDirection=s?this.getScrollOffset()<a?"forward":"backward":null,this.scrollOffset=a,this.isScrolling=s,this.maybeNotify()}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(n,i)=>{const a=new Map,s=new Map;for(let r=i-1;r>=0;r--){const o=n[r];if(a.has(o.lane))continue;const c=s.get(o.lane);if(c==null||o.end>c.end?s.set(o.lane,o):o.end<c.end&&a.set(o.lane,!0),a.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((r,o)=>r.end===o.end?r.index-o.index:r.end-o.end)[0]:void 0},this.getMeasurementOptions=D0(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(n,i,a,s,r)=>(this.pendingMeasuredCacheIndexes=[],{count:n,paddingStart:i,scrollMargin:a,getItemKey:s,enabled:r}),{key:!1}),this.getMeasurements=D0(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:n,paddingStart:i,scrollMargin:a,getItemKey:s,enabled:r},o)=>{if(!r)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const c=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const u=this.measurementsCache.slice(0,c);for(let h=c;h<n;h++){const d=s(h),p=this.options.lanes===1?u[h-1]:this.getFurthestMeasurement(u,h),g=p?p.end+this.options.gap:i+a,b=o.get(d),w=typeof b=="number"?b:this.options.estimateSize(h),x=g+w,S=p?p.lane:h%this.options.lanes;u[h]={index:h,start:g,size:w,end:x,key:d,lane:S}}return this.measurementsCache=u,u},{key:!1,debug:()=>this.options.debug}),this.calculateRange=D0(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(n,i,a)=>this.range=n.length>0&&i>0?nre({measurements:n,outerSize:i,scrollOffset:a}):null,{key:!1,debug:()=>this.options.debug}),this.getIndexes=D0(()=>{let n=null,i=null;const a=this.calculateRange();return a&&(n=a.startIndex,i=a.endIndex),[this.options.rangeExtractor,this.options.overscan,this.options.count,n,i]},(n,i,a,s,r)=>s===null||r===null?[]:n({startIndex:s,endIndex:r,overscan:i,count:a}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=n=>{const i=this.options.indexAttribute,a=n.getAttribute(i);return a?parseInt(a,10):(console.warn(`Missing attribute name '${i}={index}' on measured element.`),-1)},this._measureElement=(n,i)=>{const a=this.indexFromElement(n),s=this.measurementsCache[a];if(!s)return;const r=s.key,o=this.elementsCache.get(r);o!==n&&(o&&this.observer.unobserve(o),this.observer.observe(n),this.elementsCache.set(r,n)),n.isConnected&&this.resizeItem(a,this.options.measureElement(n,i,this))},this.resizeItem=(n,i)=>{const a=this.measurementsCache[n];if(!a)return;const s=this.itemSizeCache.get(a.key)??a.size,r=i-s;r!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(a,r,this):a.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=r,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(a.index),this.itemSizeCache=new Map(this.itemSizeCache.set(a.key,i)),this.notify(!1))},this.measureElement=n=>{if(!n){this.elementsCache.forEach((i,a)=>{i.isConnected||(this.observer.unobserve(i),this.elementsCache.delete(a))});return}this._measureElement(n,void 0)},this.getVirtualItems=D0(()=>[this.getIndexes(),this.getMeasurements()],(n,i)=>{const a=[];for(let s=0,r=n.length;s<r;s++){const o=n[s],c=i[o];a.push(c)}return a},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=n=>{const i=this.getMeasurements();if(i.length!==0)return LE(i[Tj(0,i.length-1,a=>LE(i[a]).start,n)])},this.getOffsetForAlignment=(n,i)=>{const a=this.getSize(),s=this.getScrollOffset();i==="auto"&&n>=s+a&&(i="end"),i==="end"&&(n-=a);const r=this.options.horizontal?"scrollWidth":"scrollHeight",c=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[r]:this.scrollElement[r]:0)-a;return Math.max(Math.min(c,n),0)},this.getOffsetForIndex=(n,i="auto")=>{n=Math.max(0,Math.min(n,this.options.count-1));const a=this.measurementsCache[n];if(!a)return;const s=this.getSize(),r=this.getScrollOffset();if(i==="auto")if(a.end>=r+s-this.options.scrollPaddingEnd)i="end";else if(a.start<=r+this.options.scrollPaddingStart)i="start";else return[r,i];const o=a.start-this.options.scrollPaddingStart+(a.size-s)/2;switch(i){case"center":return[this.getOffsetForAlignment(o,i),i];case"end":return[this.getOffsetForAlignment(a.end+this.options.scrollPaddingEnd,i),i];default:return[this.getOffsetForAlignment(a.start-this.options.scrollPaddingStart,i),i]}},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(n,{align:i="start",behavior:a}={})=>{this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(n,i),{adjustments:void 0,behavior:a})},this.scrollToIndex=(n,{align:i="auto",behavior:a}={})=>{n=Math.max(0,Math.min(n,this.options.count-1)),this.cancelScrollToIndex(),a==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const s=this.getOffsetForIndex(n,i);if(!s)return;const[r,o]=s;this._scrollToOffset(r,{adjustments:void 0,behavior:a}),a!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(n))){const[u]=LE(this.getOffsetForIndex(n,o));Wse(u,this.getScrollOffset())||this.scrollToIndex(n,{align:o,behavior:a})}else this.scrollToIndex(n,{align:o,behavior:a})}))},this.scrollBy=(n,{behavior:i}={})=>{this.cancelScrollToIndex(),i==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+n,{adjustments:void 0,behavior:i})},this.getTotalSize=()=>{var n;const i=this.getMeasurements();let a;return i.length===0?a=this.options.paddingStart:a=this.options.lanes===1?((n=i[i.length-1])==null?void 0:n.end)??0:Math.max(...i.slice(-this.options.lanes).map(s=>s.end)),Math.max(a-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(n,{adjustments:i,behavior:a})=>{this.options.scrollToFn(n,{behavior:a,adjustments:i},this)},this.measure=()=>{this.itemSizeCache=new Map,this.notify(!1)},this.setOptions(e)}}const Tj=(t,e,n,i)=>{for(;t<=e;){const a=(t+e)/2|0,s=n(a);if(s<i)t=a+1;else if(s>i)e=a-1;else return a}return t>0?t-1:0};function nre({measurements:t,outerSize:e,scrollOffset:n}){const i=t.length-1,s=Tj(0,i,o=>t[o].start,n);let r=s;for(;r<i&&t[r].end<n+e;)r++;return{startIndex:s,endIndex:r}}const rD=typeof document<"u"?P.useLayoutEffect:P.useEffect;function ire(t){const e=P.useReducer(()=>({}),{})[1],n={...t,onChange:(a,s)=>{var r;s?cC.flushSync(e):e(),(r=t.onChange)==null||r.call(t,a,s)}},[i]=P.useState(()=>new tre(n));return i.setOptions(n),rD(()=>i._didMount(),[]),rD(()=>i._willUpdate()),i}function are(t){return ire({observeElementRect:Yse,observeElementOffset:Qse,scrollToFn:ere,...t})}const Cj=new WeakMap;function VS(t,e,n){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${Cj.get(t)}-${n}-${e}`):""}function sre(t,e,n){let{key:i,isDisabled:a,shouldSelectOnPressUp:s}=t,{selectionManager:r,selectedKey:o}=e,c=i===o,u=a||e.isDisabled||e.selectionManager.isDisabled(i),{itemProps:h,isPressed:d}=FB({selectionManager:r,key:i,ref:n,isDisabled:u,shouldSelectOnPressUp:s,linkBehavior:"selection"}),p=VS(e,i,"tab"),g=VS(e,i,"tabpanel"),{tabIndex:b}=h,w=e.collection.getItem(i),x=Dl(w?.props,{labelable:!0});delete x.id;let S=SO(w?.props),{focusableProps:M}=hm({isDisabled:u},n);return{tabProps:ci(x,M,S,h,{id:p,"aria-selected":c,"aria-disabled":u||void 0,"aria-controls":c?g:void 0,tabIndex:u?void 0:b,role:"tab"}),isSelected:c,isDisabled:u,isPressed:d}}function rre(t,e,n){let i=fne(n)?void 0:0;var a;const s=VS(e,(a=t.id)!==null&&a!==void 0?a:e?.selectedKey,"tabpanel"),r=iw({...t,id:s,"aria-labelledby":VS(e,e?.selectedKey,"tab")});return{tabPanelProps:ci(r,{tabIndex:i,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class ore{getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){var n,i;return this.disabledKeys.has(e)||!!(!((i=this.collection.getItem(e))===null||i===void 0||(n=i.props)===null||n===void 0)&&n.isDisabled)}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){let n=e;do n=this.collection.getKeyAfter(n),n==null&&(n=this.collection.getFirstKey());while(n!=null&&this.isDisabled(n));return n}getPreviousKey(e){let n=e;do n=this.collection.getKeyBefore(n),n==null&&(n=this.collection.getLastKey());while(n!=null&&this.isDisabled(n));return n}constructor(e,n,i,a=new Set){this.collection=e,this.flipDirection=n==="rtl"&&i==="horizontal",this.disabledKeys=a,this.tabDirection=i==="horizontal"}}function lre(t,e,n){let{orientation:i="horizontal",keyboardActivation:a="automatic"}=t,{collection:s,selectionManager:r,disabledKeys:o}=e,{direction:c}=um(),u=P.useMemo(()=>new ore(s,c,i,o),[s,o,i,c]),{collectionProps:h}=jB({ref:n,selectionManager:r,keyboardDelegate:u,selectOnFocus:a==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),d=Us();Cj.set(e,d);let p=iw({...t,id:d});return{tabListProps:{...ci(h,p),role:"tablist","aria-orientation":i,tabIndex:void 0}}}var Aj=Si((t,e)=>{var n,i;const{as:a,tabKey:s,destroyInactiveTabPanel:r,state:o,className:c,slots:u,classNames:h,...d}=t,p=a||"div",g=_i(e),{tabPanelProps:b}=rre({...t,id:String(s)},o,g),{focusProps:w,isFocused:x,isFocusVisible:S}=Ts(),M=o.selectedItem,C=o.collection.getItem(s).props.children,A=Vt(h?.panel,c,(n=M?.props)==null?void 0:n.className),N=s===M?.key;return!C||!N&&r?null:_.jsx(p,{ref:g,"data-focus":x,"data-focus-visible":S,"data-inert":N?void 0:"true",inert:lq(!N),...N&&Yt(b,w,d),className:(i=u.panel)==null?void 0:i.call(u,{class:A}),"data-slot":"panel",children:C})});Aj.displayName="HeroUI.TabPanel";var cre=Aj,Rj=Si((t,e)=>{var n;const{className:i,as:a,item:s,state:r,classNames:o,isDisabled:c,listRef:u,slots:h,shouldSelectOnPressUp:d,tabRef:p,...g}=t,{key:b}=s,w=_i(e),x=a||(t.href?"a":"button"),S=typeof x=="string",{tabProps:M,isSelected:C,isDisabled:A,isPressed:N}=sre({key:b,isDisabled:c,shouldSelectOnPressUp:d},r,w);t.children==null&&delete M["aria-controls"];const R=c||A,{focusProps:D,isFocused:B,isFocusVisible:z}=Ts(),{hoverProps:I,isHovered:U}=Qa({isDisabled:R}),$=Vt(o?.tab,i),G=()=>{!w?.current||!u?.current||Yae(w.current,{scrollMode:"if-needed",behavior:"smooth",block:"end",inline:"end",boundary:u?.current})};return _.jsx(x,{ref:Q3(w,p),"data-disabled":He(A),"data-focus":He(B),"data-focus-visible":He(z),"data-hover":He(U),"data-hover-unselected":He((U||N)&&!C),"data-key":b,"data-pressed":He(N),"data-selected":He(C),"data-slot":"tab",...Yt(M,R?{}:{...D,...I},cs(g,{enabled:S,omitPropNames:new Set(["title"]),omitEventNames:new Set(["onClick"])}),{onClick:$r(G,M.onClick)}),className:(n=h.tab)==null?void 0:n.call(h,{class:$}),title:g?.titleValue,type:x==="button"?"button":void 0,children:_.jsx("div",{className:h.tabContent({class:o?.tabContent}),"data-slot":"tabContent",children:s.rendered})})});Rj.displayName="HeroUI.Tab";var ure=Rj;class oD{*[Symbol.iterator](){yield*this.iterable}get size(){return this._size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var i;return n&&(i=n.prevKey)!==null&&i!==void 0?i:null}getKeyAfter(e){let n=this.keyMap.get(e);var i;return n&&(i=n.nextKey)!==null&&i!==void 0?i:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return n?.childNodes||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=o=>{if(this.keyMap.set(o.key,o),o.childNodes&&o.type==="section")for(let c of o.childNodes)n(c)};for(let o of e)n(o);let i=null,a=0,s=0;for(let[o,c]of this.keyMap)i?(i.nextKey=o,c.prevKey=i.key):(this.firstKey=o,c.prevKey=void 0),c.type==="item"&&(c.index=a++),(c.type==="section"||c.type==="item")&&s++,i=c,i.nextKey=void 0;this._size=s;var r;this.lastKey=(r=i?.key)!==null&&r!==void 0?r:null}}function mA(t){let{filter:e,layoutDelegate:n}=t,i=WB(t),a=P.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),s=P.useCallback(u=>e?new oD(e(u)):new oD(u),[e]),r=P.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),o=XB(t,s,r),c=P.useMemo(()=>new dw(o,i,{layoutDelegate:n}),[o,i,n]);return dre(o,c),{collection:o,disabledKeys:a,selectionManager:c}}function dre(t,e){const n=P.useRef(null);P.useEffect(()=>{if(e.focusedKey!=null&&!t.getItem(e.focusedKey)&&n.current){const h=n.current.getItem(e.focusedKey),d=[...n.current.getKeys()].map(S=>{const M=n.current.getItem(S);return M?.type==="item"?M:null}).filter(S=>S!==null),p=[...t.getKeys()].map(S=>{const M=t.getItem(S);return M?.type==="item"?M:null}).filter(S=>S!==null);var i,a;const g=((i=d?.length)!==null&&i!==void 0?i:0)-((a=p?.length)!==null&&a!==void 0?a:0);var s,r,o;let b=Math.min(g>1?Math.max(((s=h?.index)!==null&&s!==void 0?s:0)-g+1,0):(r=h?.index)!==null&&r!==void 0?r:0,((o=p?.length)!==null&&o!==void 0?o:0)-1),w=null,x=!1;for(;b>=0;){if(!e.isDisabled(p[b].key)){w=p[b];break}if(b<p.length-1&&!x)b++;else{x=!0;var c,u;b>((c=h?.index)!==null&&c!==void 0?c:0)&&(b=(u=h?.index)!==null&&u!==void 0?u:0),b--}}e.setFocusedKey(w?w.key:null)}n.current=t},[t,e])}function fre(t){var e;let[n,i]=sh(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),a=P.useMemo(()=>n!=null?[n]:[],[n]),{collection:s,disabledKeys:r,selectionManager:o}=mA({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:a,onSelectionChange:u=>{if(u==="all")return;var h;let d=(h=u.values().next().value)!==null&&h!==void 0?h:null;d===n&&t.onSelectionChange&&t.onSelectionChange(d),i(d)}}),c=n!=null?s.getItem(n):null;return{collection:s,disabledKeys:r,selectionManager:o,selectedKey:n,setSelectedKey:i,selectedItem:c}}function hre(t){var e,n;let i=fre({...t,onSelectionChange:t.onSelectionChange?c=>{var u;c!=null&&((u=t.onSelectionChange)===null||u===void 0||u.call(t,c))}:void 0,suppressTextValueWarning:!0,defaultSelectedKey:(n=(e=t.defaultSelectedKey)!==null&&e!==void 0?e:lD(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set))!==null&&n!==void 0?n:void 0}),{selectionManager:a,collection:s,selectedKey:r}=i,o=P.useRef(r);return P.useEffect(()=>{let c=r;t.selectedKey==null&&(a.isEmpty||c==null||!s.getItem(c))&&(c=lD(s,i.disabledKeys),c!=null&&a.setSelectedKeys([c])),(c!=null&&a.focusedKey==null||!a.isFocused&&c!==o.current)&&a.setFocusedKey(c),o.current=c}),{...i,isDisabled:t.isDisabled||!1}}function lD(t,e){let n=null;if(t){var i,a,s,r;for(n=t.getFirstKey();n!=null&&(e.has(n)||!((a=t.getItem(n))===null||a===void 0||(i=a.props)===null||i===void 0)&&i.isDisabled)&&n!==t.getLastKey();)n=t.getKeyAfter(n);n!=null&&(e.has(n)||!((r=t.getItem(n))===null||r===void 0||(s=r.props)===null||s===void 0)&&s.isDisabled)&&n===t.getLastKey()&&(n=t.getFirstKey())}return n}function pre(t){var e,n,i;const a=fa(),[s,r]=gr(t,EP.variantKeys),{ref:o,as:c,className:u,classNames:h,children:d,disableCursorAnimation:p,isVertical:g=!1,shouldSelectOnPressUp:b=!0,destroyInactiveTabPanel:w=!0,...x}=s,S=c||"div",M=typeof S=="string",C=_i(o),A=(n=(e=t?.disableAnimation)!=null?e:a?.disableAnimation)!=null?n:!1,N=hre({children:d,...x}),{tabListProps:R}=lre(x,N,C),D=P.useMemo(()=>EP({...r,disableAnimation:A,...g?{placement:"start"}:{}}),[ks(r),A,g]),B=Vt(h?.base,u),z=P.useMemo(()=>({state:N,slots:D,classNames:h,disableAnimation:A,listRef:C,shouldSelectOnPressUp:b,disableCursorAnimation:p,isDisabled:t?.isDisabled}),[N,D,C,A,p,b,t?.isDisabled,h]),I=P.useCallback(X=>({"data-slot":"base",className:D.base({class:Vt(B,X?.className)}),...Yt(cs(x,{enabled:M}),X)}),[B,x,D]),U=(i=r.placement)!=null?i:g?"start":"top",$=P.useCallback(X=>({"data-slot":"tabWrapper",className:D.tabWrapper({class:Vt(h?.tabWrapper,X?.className)}),"data-placement":U,"data-vertical":g||U==="start"||U==="end"?"vertical":"horizontal"}),[h,D,U,g]),G=P.useCallback(X=>({ref:C,"data-slot":"tabList",className:D.tabList({class:Vt(h?.tabList,X?.className)}),...Yt(R,X)}),[C,R,h,D]),k=P.useCallback(X=>({"data-slot":"cursor",className:D.cursor({class:Vt(h?.cursor,X?.className)})}),[h,D]);return{Component:S,domRef:C,state:N,values:z,destroyInactiveTabPanel:w,getBaseProps:I,getTabListProps:G,getWrapperProps:$,getTabCursorProps:k}}var mre=Si(function(e,n){const{Component:i,values:a,state:s,domRef:r,destroyInactiveTabPanel:o,getBaseProps:c,getTabListProps:u,getWrapperProps:h,getTabCursorProps:d}=pre({...e,ref:n}),p={state:s,listRef:a.listRef,slots:a.slots,classNames:a.classNames,isDisabled:a.isDisabled,shouldSelectOnPressUp:a.shouldSelectOnPressUp},g=[...s.collection].map(B=>_.jsx(ure,{item:B,...p,...B.props},B.key)),b=s.selectedItem,w=b?.key,x=P.useRef(void 0),S=P.useRef(e?.variant),M=e?.variant,C=e?.isVertical,A=(B,z,I)=>{const U={left:`${z}px`,width:`${B.width}px`};return M==="underlined"?{left:`${z+B.width*.1}px`,top:`${I+B.height-2}px`,width:`${B.width*.8}px`,height:""}:{...U,top:`${I}px`,height:`${B.height}px`}},N=(B,z)=>{const I={width:z.offsetWidth,height:z.offsetHeight},U=A(I,z.offsetLeft,z.offsetTop);B.style.left=U.left,B.style.top=U.top,B.style.width=U.width,B.style.height=U.height},R=B=>{var z;if(!B)return;const I=(z=r.current)==null?void 0:z.querySelector(`[data-key="${w}"]`);if(!I||!r.current)return;const U=x.current===void 0||S.current!==M;B.style.transition=U?"none":"",x.current=w,S.current=M,N(B,I)},D=P.useMemo(()=>_.jsxs(_.Fragment,{children:[_.jsx("div",{...c(),children:_.jsxs(i,{...u(),children:[!a.disableAnimation&&!a.disableCursorAnimation&&w!=null&&_.jsx("span",{...d(),ref:R}),g]})}),[...s.collection].map(B=>_.jsx(cre,{classNames:a.classNames,destroyInactiveTabPanel:o,slots:a.slots,state:a.state,tabKey:B.key},B.key))]}),[i,c,u,d,g,w,s.collection,a.disableAnimation,a.disableCursorAnimation,a.classNames,a.slots,a.state,o,r,M,C]);return"placement"in e||"isVertical"in e?_.jsx("div",{...h(),children:D}):D}),Nj=mre,gre=oA,Nb=gre;function vre(t={}){const{domRef:e,isEnabled:n=!0,overflowCheck:i="vertical",visibility:a="auto",offset:s=0,onVisibilityChange:r,updateDeps:o=[]}=t,c=P.useRef(a);P.useEffect(()=>{const u=e?.current;if(!u||!n)return;const h=(g,b,w,x,S)=>{if(a==="auto"){const M=`${x}${cO(S)}Scroll`;b&&w?(u.dataset[M]="true",u.removeAttribute(`data-${x}-scroll`),u.removeAttribute(`data-${S}-scroll`)):(u.dataset[`${x}Scroll`]=b.toString(),u.dataset[`${S}Scroll`]=w.toString(),u.removeAttribute(`data-${x}-${S}-scroll`))}else{const M=b&&w?"both":b?x:w?S:"none";M!==c.current&&(r?.(M),c.current=M)}},d=()=>{var g,b;const w=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],x=u.querySelector('ul[data-slot="list"]'),S=+((g=x?.getAttribute("data-virtual-scroll-height"))!=null?g:u.scrollHeight),M=+((b=x?.getAttribute("data-virtual-scroll-top"))!=null?b:u.scrollTop);for(const{type:C,prefix:A,suffix:N}of w)if(i===C||i==="both"){const R=C==="vertical"?M>s:u.scrollLeft>s,D=C==="vertical"?M+u.clientHeight+s<S:u.scrollLeft+u.clientWidth+s<u.scrollWidth;h(C,R,D,A,N)}},p=()=>{["top","bottom","top-bottom","left","right","left-right"].forEach(g=>{u.removeAttribute(`data-${g}-scroll`)})};return d(),u.addEventListener("scroll",d,!0),a!=="auto"&&(p(),a==="both"?(u.dataset.topBottomScroll=String(i==="vertical"),u.dataset.leftRightScroll=String(i==="horizontal")):(u.dataset.topBottomScroll="false",u.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(g=>{u.dataset[`${g}Scroll`]=String(a===g)}))),()=>{u.removeEventListener("scroll",d,!0),p()}},[...o,n,a,i,r,e])}function yre(t){var e;const[n,i]=gr(t,jS.variantKeys),{ref:a,as:s,children:r,className:o,style:c,size:u=40,offset:h=0,visibility:d="auto",isEnabled:p=!0,onVisibilityChange:g,...b}=n,w=s||"div",x=_i(a);vre({domRef:x,offset:h,visibility:d,isEnabled:p,onVisibilityChange:g,updateDeps:[r],overflowCheck:(e=t.orientation)!=null?e:"vertical"});const S=P.useMemo(()=>jS({...i,className:o}),[ks(i),o]);return{Component:w,styles:S,domRef:x,children:r,getBaseProps:(C={})=>{var A;return{ref:x,className:S,"data-orientation":(A=t.orientation)!=null?A:"vertical",style:{"--scroll-shadow-size":`${u}px`,...c,...C.style},...b,...C}}}}var Pj=Si((t,e)=>{const{Component:n,children:i,getBaseProps:a}=yre({...t,ref:e});return _.jsx(n,{...a(),children:i})});Pj.displayName="HeroUI.ScrollShadow";var bre=Pj;function xre(t){const{collection:e,disabledKeys:n,selectionManager:i,selectionManager:{setSelectedKeys:a,selectedKeys:s,selectionMode:r}}=mA(t),o=P.useMemo(()=>!t.isLoading&&s.size!==0?Array.from(s).filter(Boolean).filter(u=>!e.getItem(u)):[],[s,e]),c=s.size!==0?Array.from(s).map(u=>e.getItem(u)).filter(Boolean):null;return o.length&&console.warn(`Select: Keys "${o.join(", ")}" passed to "selectedKeys" are not present in the collection.`),{collection:e,disabledKeys:n,selectionManager:i,selectionMode:r,selectedKeys:s,setSelectedKeys:a.bind(i),selectedItems:c}}function _re({validate:t,validationBehavior:e,...n}){const[i,a]=P.useState(!1),[s,r]=P.useState(null),o=Pse(n),c=xre({...n,onSelectionChange:d=>{n.onSelectionChange!=null&&(d==="all"?n.onSelectionChange(new Set(c.collection.getKeys())):n.onSelectionChange(d)),n.selectionMode==="single"&&o.close()}}),u=nx({...n,validationBehavior:e,validate:d=>{if(!t)return;const p=Array.from(d);return t(n.selectionMode==="single"?p[0]:p)},value:c.selectedKeys}),h=c.collection.size===0&&n.hideEmptyContent;return{...u,...c,...o,focusStrategy:s,close(){o.close()},open(d=null){h||(r(d),o.open())},toggle(d=null){h||(r(d),o.toggle())},isFocused:i,setFocused:a}}function Sre(t,e,n){const{disallowEmptySelection:i,isDisabled:a}=t,s=DO({usage:"search",sensitivity:"base"}),r=P.useMemo(()=>new VB(e.collection,e.disabledKeys,null,s),[e.collection,e.disabledKeys,s]),{menuTriggerProps:o,menuProps:c}=Rse({isDisabled:a,type:"listbox"},e,n),u=N=>{if(e.selectionMode==="single")switch(N.key){case"ArrowLeft":{N.preventDefault();const R=e.selectedKeys.size>0?r.getKeyAbove(e.selectedKeys.values().next().value):r.getFirstKey();R&&e.setSelectedKeys([R]);break}case"ArrowRight":{N.preventDefault();const R=e.selectedKeys.size>0?r.getKeyBelow(e.selectedKeys.values().next().value):r.getFirstKey();R&&e.setSelectedKeys([R]);break}}},{typeSelectProps:h}=UB({keyboardDelegate:r,selectionManager:e.selectionManager,onTypeSelect(N){e.setSelectedKeys([N])}}),{isInvalid:d,validationErrors:p,validationDetails:g}=e.displayValidation,{labelProps:b,fieldProps:w,descriptionProps:x,errorMessageProps:S}=vU({...t,labelElementType:"span",isInvalid:d,errorMessage:t.errorMessage||p});h.onKeyDown=h.onKeyDownCapture,delete h.onKeyDownCapture,o.onPressStart=N=>{N.pointerType!=="touch"&&N.pointerType!=="keyboard"&&!a&&e.toggle(N.pointerType==="virtual"?"first":null)};const M=Dl(t,{labelable:!0}),C=ci(h,o,w),A=Us();return{labelProps:{...b,onClick:()=>{var N;t.isDisabled||((N=n.current)==null||N.focus(),Ez("keyboard"))}},triggerProps:ci(M,{...C,onKeyDown:ah(C.onKeyDown,u,t.onKeyDown),onKeyUp:t.onKeyUp,"aria-labelledby":[A,C["aria-labelledby"],C["aria-label"]&&!C["aria-labelledby"]?C.id:null].join(" "),onFocus(N){e.isFocused||(t.onFocus&&t.onFocus(N),e.setFocused(!0))},onBlur(N){e.isOpen||(t.onBlur&&t.onBlur(N),e.setFocused(!1))}}),valueProps:{id:A},menuProps:{...c,disallowEmptySelection:i,autoFocus:e.focusStrategy||!0,shouldSelectOnPressUp:!0,shouldFocusOnHover:!0,onBlur:N=>{N.currentTarget.contains(N.relatedTarget)||(t.onBlur&&t.onBlur(N),e.setFocused(!1))},onFocus:c?.onFocus,"aria-labelledby":[w["aria-labelledby"],C["aria-label"]&&!w["aria-labelledby"]?C.id:null].filter(Boolean).join(" ")},descriptionProps:x,errorMessageProps:S,isInvalid:d,validationErrors:p,validationDetails:g}}var Dj=new WeakMap;function wre(t){var e,n,i,a,s,r;const o=fa(),{validationBehavior:c}=ix(zg)||{},[u,h]=gr(t,CP.variantKeys),d=(n=(e=t.disableAnimation)!=null?e:o?.disableAnimation)!=null?n:!1,{ref:p,as:g,label:b,name:w,isLoading:x,selectorIcon:S,isOpen:M,defaultOpen:C,onOpenChange:A,startContent:N,endContent:R,description:D,renderValue:B,onSelectionChange:z,placeholder:I,isVirtualized:U,itemHeight:$=36,maxListboxHeight:G=256,children:k,disallowEmptySelection:X=!1,selectionMode:V="single",spinnerRef:H,scrollRef:W,popoverProps:J={},scrollShadowProps:Y={},listboxProps:K={},spinnerProps:ee={},validationState:ie,onChange:Z,onClose:ue,className:se,classNames:ae,validationBehavior:ce=(i=c??o?.validationBehavior)!=null?i:"native",hideEmptyContent:pe=!1,onClear:ye,..._e}=u,me=_i(W),ne={popoverProps:Yt({placement:"bottom",triggerScaleOnOpen:!1,offset:5,disableAnimation:d},J),scrollShadowProps:Yt({ref:me,isEnabled:(a=t.showScrollIndicators)!=null?a:!0,hideScrollBar:!0,offset:15},Y),listboxProps:Yt({disableAnimation:d},K)},be=g||"button",xe=typeof be=="string",he=_i(p),ve=P.useRef(null),Oe=P.useRef(null),Le=P.useRef(null);let Ae=_re({...u,isOpen:M,selectionMode:V,disallowEmptySelection:X,validationBehavior:ce,children:k,isRequired:t.isRequired,isDisabled:t.isDisabled,isInvalid:t.isInvalid,defaultOpen:C,hideEmptyContent:pe,onOpenChange:Ke=>{A?.(Ke),Ke||ue?.()},onSelectionChange:Ke=>{z?.(Ke),Z&&typeof Z=="function"&&Z({target:{...he.current&&{...he.current,name:he.current.name},value:Array.from(Ke).join(",")}}),Ae.commitValidation()}});Ae={...Ae,...t.isDisabled&&{disabledKeys:new Set([...Ae.collection.getKeys()])}},Nd(()=>{var Ke;(Ke=he.current)!=null&&Ke.value&&Ae.setSelectedKeys(new Set([...Ae.selectedKeys,he.current.value]))},[he.current]);const{labelProps:et,triggerProps:tt,valueProps:re,menuProps:te,descriptionProps:we,errorMessageProps:Ce,isInvalid:Ie,validationErrors:Pe,validationDetails:Ze}=Sre({...u,disallowEmptySelection:X,isDisabled:t.isDisabled},Ae,ve),We=P.useCallback(()=>{var Ke;Ae.setSelectedKeys(new Set([])),ye?.(),(Ke=ve.current)==null||Ke.focus()},[ye,Ae]),{pressProps:mt}=bo({isDisabled:!!t?.isDisabled,onPress:We}),nt=t.isInvalid||ie==="invalid"||Ie,{isPressed:Ye,buttonProps:Je}=tx(tt,ve),{focusProps:jt,isFocused:wt,isFocusVisible:Et}=Ts(),{focusProps:zt,isFocusVisible:Te}=Ts(),{isHovered:pt,hoverProps:at}=Qa({isDisabled:t.isDisabled}),St=bB({labelPlacement:t.labelPlacement,label:b}),ct=!!I,it=St==="outside-left"||St==="outside",Nt=St==="inside",kt=St==="outside-left",Xt=t.isClearable,rn=Ae.isOpen||ct||!!((s=Ae.selectedItems)!=null&&s.length)||!!N||!!R||!!t.isMultiline,ge=!!((r=Ae.selectedItems)!=null&&r.length),Se=!!b,De=Se&&(kt||it&&ct),lt=Vt(ae?.base,se),rt=P.useMemo(()=>CP({...h,isInvalid:nt,isClearable:Xt,labelPlacement:St,disableAnimation:d}),[ks(h),nt,St,d]);aA({isDisabled:!Ae.isOpen});const Bt=typeof u.errorMessage=="function"?u.errorMessage({isInvalid:nt,validationErrors:Pe,validationDetails:Ze}):u.errorMessage||Pe?.join(" "),Ut=!!D||!!Bt,Dt=!!R;P.useEffect(()=>{if(Ae.isOpen&&Le.current&&ve.current){let Ke=ve.current.getBoundingClientRect(),Tt=Le.current;Tt.style.width=Ke.width+"px"}},[Ae.isOpen]);const ot=P.useCallback((Ke={})=>({"data-slot":"base","data-filled":He(rn),"data-has-value":He(ge),"data-has-label":He(Se),"data-has-helper":He(Ut),"data-has-end-content":He(Dt),"data-invalid":He(nt),"data-has-label-outside":He(De),className:rt.base({class:Vt(lt,Ke.className)}),...Ke}),[rt,Ut,ge,Se,De,rn,lt]),Lt=P.useCallback((Ke={})=>({ref:ve,"data-slot":"trigger","data-open":He(Ae.isOpen),"data-disabled":He(t?.isDisabled),"data-focus":He(wt),"data-pressed":He(Ye),"data-focus-visible":He(Et),"data-hover":He(pt),className:rt.trigger({class:ae?.trigger}),...Yt(Je,jt,at,cs(_e,{enabled:xe}),cs(Ke))}),[rt,ve,Ae.isOpen,ae?.trigger,t?.isDisabled,wt,Ye,Et,pt,Je,jt,at,_e,xe]),vt=P.useCallback((Ke={})=>({state:Ae,triggerRef:ve,selectRef:he,selectionMode:V,label:t?.label,name:t?.name,isRequired:t?.isRequired,autoComplete:t?.autoComplete,isDisabled:t?.isDisabled,form:t?.form,onChange:Z,...Ke}),[Ae,V,t?.label,t?.autoComplete,t?.name,t?.isDisabled,ve]),Ot=P.useCallback((Ke={})=>({"data-slot":"label",className:rt.label({class:Vt(ae?.label,Ke.className)}),...et,...Ke}),[rt,ae?.label,et]),Mt=P.useCallback((Ke={})=>({"data-slot":"value",className:rt.value({class:Vt(ae?.value,Ke.className)}),...re,...Ke}),[rt,ae?.value,re]),Ln=P.useCallback((Ke={})=>({"data-slot":"listboxWrapper",className:rt.listboxWrapper({class:Vt(ae?.listboxWrapper,Ke?.className)}),style:{maxHeight:G??256,...Ke.style},...Yt(ne.scrollShadowProps,Ke)}),[rt.listboxWrapper,ae?.listboxWrapper,ne.scrollShadowProps,G]),wi=(Ke={})=>{const Tt=U??Ae.collection.size>50;return{state:Ae,ref:Oe,isVirtualized:Tt,virtualization:Tt?{maxListboxHeight:G,itemHeight:$}:void 0,"data-slot":"listbox",className:rt.listbox({class:Vt(ae?.listbox,Ke?.className)}),scrollShadowProps:ne.scrollShadowProps,...Yt(ne.listboxProps,Ke,te)}},aa=P.useCallback((Ke={})=>{var Tt,qt;const Jt=Yt(ne.popoverProps,Ke);return{state:Ae,triggerRef:ve,ref:Le,"data-slot":"popover",scrollRef:Oe,triggerType:"listbox",classNames:{content:rt.popoverContent({class:Vt(ae?.popoverContent,Ke.className)})},...Jt,offset:Ae.selectedItems&&Ae.selectedItems.length>0?Ae.selectedItems.length*1e-8+(((Tt=ne.popoverProps)==null?void 0:Tt.offset)||0):(qt=ne.popoverProps)==null?void 0:qt.offset}},[rt,ae?.popoverContent,ne.popoverProps,ve,Ae,Ae.selectedItems]),ei=P.useCallback(()=>({"data-slot":"selectorIcon","aria-hidden":He(!0),"data-open":He(Ae.isOpen),className:rt.selectorIcon({class:ae?.selectorIcon})}),[rt,ae?.selectorIcon,Ae.isOpen]),Fn=P.useCallback((Ke={})=>({...Ke,"data-slot":"innerWrapper",className:rt.innerWrapper({class:Vt(ae?.innerWrapper,Ke?.className)})}),[rt,ae?.innerWrapper]),le=P.useCallback((Ke={})=>({...Ke,"data-slot":"helperWrapper",className:rt.helperWrapper({class:Vt(ae?.helperWrapper,Ke?.className)})}),[rt,ae?.helperWrapper]),Re=P.useCallback((Ke={})=>({...Ke,...we,"data-slot":"description",className:rt.description({class:Vt(ae?.description,Ke?.className)})}),[rt,ae?.description]),Be=P.useCallback((Ke={})=>({...Ke,"data-slot":"mainWrapper",className:rt.mainWrapper({class:Vt(ae?.mainWrapper,Ke?.className)})}),[rt,ae?.mainWrapper]),ke=P.useCallback((Ke={})=>({...Ke,"data-slot":"end-wrapper",className:rt.endWrapper({class:Vt(ae?.endWrapper,Ke?.className)})}),[rt,ae?.endWrapper]),ze=P.useCallback((Ke={})=>({...Ke,"data-slot":"end-content",className:rt.endContent({class:Vt(ae?.endContent,Ke?.className)})}),[rt,ae?.endContent]),yt=P.useCallback((Ke={})=>({...Ke,...Ce,"data-slot":"error-message",className:rt.errorMessage({class:Vt(ae?.errorMessage,Ke?.className)})}),[rt,Ce,ae?.errorMessage]),Pt=P.useCallback((Ke={})=>({"aria-hidden":He(!0),"data-slot":"spinner",color:"current",size:"sm",...ee,...Ke,ref:H,className:rt.spinner({class:Vt(ae?.spinner,Ke?.className)})}),[rt,H,ee,ae?.spinner]),Ht=P.useCallback((Ke={})=>({...Ke,type:"button",tabIndex:-1,"aria-label":"clear selection","data-slot":"clear-button","data-focus-visible":He(Te),className:rt.clearButton({class:Vt(ae?.clearButton,Ke?.className)}),...Yt(mt,zt)}),[rt,Te,mt,zt,ae?.clearButton]);return Dj.set(Ae,{isDisabled:t?.isDisabled,isRequired:t?.isRequired,name:t?.name,isInvalid:nt,validationBehavior:ce}),{Component:be,domRef:he,state:Ae,label:b,name:w,triggerRef:ve,isLoading:x,placeholder:I,startContent:N,endContent:R,description:D,selectorIcon:S,hasHelper:Ut,labelPlacement:St,hasPlaceholder:ct,renderValue:B,selectionMode:V,disableAnimation:d,isOutsideLeft:kt,shouldLabelBeOutside:it,shouldLabelBeInside:Nt,isInvalid:nt,errorMessage:Bt,isClearable:Xt,getClearButtonProps:Ht,getBaseProps:ot,getTriggerProps:Lt,getLabelProps:Ot,getValueProps:Mt,getListboxProps:wi,getPopoverProps:aa,getSpinnerProps:Pt,getMainWrapperProps:Be,getListboxWrapperProps:Ln,getHiddenSelectProps:vt,getInnerWrapperProps:Fn,getHelperWrapperProps:le,getDescriptionProps:Re,getErrorMessageProps:yt,getSelectorIconProps:ei,getEndWrapperProps:ke,getEndContentProps:ze}}var Ere=typeof document<"u"?ft.useLayoutEffect:()=>{};function Mre(t){const e=P.useRef(null);return Ere(()=>{e.current=t},[t]),P.useCallback((...n)=>{const i=e.current;return i?.(...n)},[])}function Tre(t,e,n){let i=P.useRef(e),a=Mre(()=>{n&&n(i.current)});P.useEffect(()=>{var s;let r=(s=t?.current)==null?void 0:s.form;return r?.addEventListener("reset",a),()=>{r?.removeEventListener("reset",a)}},[t,a])}function Cre(t,e,n){var i;let a=Dj.get(e)||{},{autoComplete:s,name:r=a.name,isDisabled:o=a.isDisabled,selectionMode:c,onChange:u,form:h}=t,{validationBehavior:d,isRequired:p,isInvalid:g}=a,{visuallyHiddenProps:b}=mB();return Tre(t.selectRef,e.selectedKeys,e.setSelectedKeys),cA({validationBehavior:d,focus:()=>{var w;return(w=n.current)==null?void 0:w.focus()}},e,t.selectRef),{containerProps:{...b,"aria-hidden":!0,"data-a11y-ignore":"aria-hidden-focus"},inputProps:{style:{display:"none"}},selectProps:{form:h,autoComplete:s,disabled:o,"aria-invalid":g||void 0,"aria-required":p&&d==="aria"||void 0,required:p&&d==="native",name:r,tabIndex:-1,value:c==="multiple"?[...e.selectedKeys].map(w=>String(w)):(i=[...e.selectedKeys][0])!=null?i:"",multiple:c==="multiple",onChange:w=>{e.setSelectedKeys(w.target.value),u?.(w)}}}}function Are(t){var e;let{state:n,triggerRef:i,selectRef:a,label:s,name:r,isDisabled:o,form:c}=t,{containerProps:u,selectProps:h}=Cre({...t,selectRef:a},n,i);return n.collection.size<=300?_.jsx("div",{...u,"data-testid":"hidden-select-container",children:_.jsxs("label",{children:[s,_.jsxs("select",{...h,ref:a,children:[_.jsx("option",{}),[...n.collection.getKeys()].map(d=>{let p=n.collection.getItem(d);if(p?.type==="item")return _.jsx("option",{value:p.key,children:p.textValue},p.key)})]})]})}):r?_.jsx("input",{autoComplete:h.autoComplete,disabled:o,form:c,name:r,type:"hidden",value:(e=[...n.selectedKeys].join(","))!=null?e:""}):null}var Rre=oA,Cf=Rre;const gA=new WeakMap;function Nre(t){return typeof t=="string"?t.replace(/\s*/g,""):""+t}function Pre(t,e){let n=gA.get(t);if(!n)throw new Error("Unknown list");return`${n.id}-option-${Nre(e)}`}function Dre(t,e,n){let i=Dl(t,{labelable:!0}),a=t.selectionBehavior||"toggle",s=t.linkBehavior||(a==="replace"?"action":"override");a==="toggle"&&s==="action"&&(s="override");let{listProps:r}=kB({...t,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,linkBehavior:s}),{focusWithinProps:o}=Rd({onFocusWithin:t.onFocus,onBlurWithin:t.onBlur,onFocusWithinChange:t.onFocusChange}),c=Us(t.id);gA.set(e,{id:c,shouldUseVirtualFocus:t.shouldUseVirtualFocus,shouldSelectOnPressUp:t.shouldSelectOnPressUp,shouldFocusOnHover:t.shouldFocusOnHover,isVirtualized:t.isVirtualized,onAction:t.onAction,linkBehavior:s,UNSTABLE_itemBehavior:t.UNSTABLE_itemBehavior});let{labelProps:u,fieldProps:h}=gU({...t,id:c,labelElementType:"span"});return{labelProps:u,listBoxProps:ci(i,o,e.selectionManager.selectionMode==="multiple"?{"aria-multiselectable":"true"}:{},{role:"listbox",...ci(h,r)})}}function Lre(t,e,n){var i,a;let{key:s}=t,r=gA.get(e);var o;let c=(o=t.isDisabled)!==null&&o!==void 0?o:e.selectionManager.isDisabled(s);var u;let h=(u=t.isSelected)!==null&&u!==void 0?u:e.selectionManager.isSelected(s);var d;let p=(d=t.shouldSelectOnPressUp)!==null&&d!==void 0?d:r?.shouldSelectOnPressUp;var g;let b=(g=t.shouldFocusOnHover)!==null&&g!==void 0?g:r?.shouldFocusOnHover;var w;let x=(w=t.shouldUseVirtualFocus)!==null&&w!==void 0?w:r?.shouldUseVirtualFocus;var S;let M=(S=t.isVirtualized)!==null&&S!==void 0?S:r?.isVirtualized,C=Ng(),A=Ng(),N={role:"option","aria-disabled":c||void 0,"aria-selected":e.selectionManager.selectionMode!=="none"?h:void 0};$f()&&mC()||(N["aria-label"]=t["aria-label"],N["aria-labelledby"]=C,N["aria-describedby"]=A);let R=e.collection.getItem(s);if(M){let H=Number(R?.index);N["aria-posinset"]=Number.isNaN(H)?void 0:H+1,N["aria-setsize"]=oae(e.collection)}let D=r?.onAction?()=>{var H;return r==null||(H=r.onAction)===null||H===void 0?void 0:H.call(r,s)}:void 0,B=Pre(e,s),{itemProps:z,isPressed:I,isFocused:U,hasAction:$,allowsSelection:G}=FB({selectionManager:e.selectionManager,key:s,ref:n,shouldSelectOnPressUp:p,allowsDifferentPressOrigin:p&&b,isVirtualized:M,shouldUseVirtualFocus:x,isDisabled:c,onAction:D||!(R==null||(i=R.props)===null||i===void 0)&&i.onAction?ah(R==null||(a=R.props)===null||a===void 0?void 0:a.onAction,D):void 0,linkBehavior:r?.linkBehavior,UNSTABLE_itemBehavior:r?.UNSTABLE_itemBehavior,id:B}),{hoverProps:k}=Qa({isDisabled:c||!b,onHoverStart(){Og()||(e.selectionManager.setFocused(!0),e.selectionManager.setFocusedKey(s))}}),X=Dl(R?.props);delete X.id;let V=SO(R?.props);return{optionProps:{...N,...ci(X,z,k,V),id:B},labelProps:{id:C},descriptionProps:{id:A},isFocused:U,isFocusVisible:U&&e.selectionManager.isFocused&&Og(),isSelected:h,isDisabled:c,isPressed:I,allowsSelection:G,hasAction:$}}function Ore(t){let{heading:e,"aria-label":n}=t,i=Us();return{itemProps:{role:"presentation"},headingProps:e?{id:i,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?i:void 0}}}function Ire(t){var e;const n=fa(),{ref:i,as:a,state:s,variant:r,color:o,onAction:c,children:u,onSelectionChange:h,disableAnimation:d=(e=n?.disableAnimation)!=null?e:!1,itemClasses:p,className:g,topContent:b,bottomContent:w,emptyContent:x="No items.",hideSelectedIcon:S=!1,hideEmptyContent:M=!1,shouldHighlightOnFocus:C=!1,classNames:A,...N}=t,R=a||"ul",D=typeof R=="string",B=_i(i),z=mA({...t,children:u,onSelectionChange:h}),I=s||z,{listBoxProps:U}=Dre({...t,onAction:c},I,B),$=P.useMemo(()=>Nie(),[]),G=Vt(A?.base,g);return{Component:R,state:I,variant:r,color:o,slots:$,classNames:A,topContent:b,bottomContent:w,emptyContent:x,hideEmptyContent:M,shouldHighlightOnFocus:C,hideSelectedIcon:S,disableAnimation:d,className:g,itemClasses:p,getBaseProps:(H={})=>({ref:B,"data-slot":"base",className:$.base({class:G}),...cs(N,{enabled:D}),...H}),getListProps:(H={})=>({"data-slot":"list",className:$.list({class:A?.list}),...U,...H}),getEmptyContentProps:(H={})=>({"data-slot":"empty-content",children:x,className:$.emptyContent({class:A?.emptyContent}),...H})}}function zre(t){const{isSelected:e,disableAnimation:n,...i}=t;return _.jsx("svg",{"aria-hidden":"true","data-selected":e,role:"presentation",viewBox:"0 0 17 18",...i,children:_.jsx("polyline",{fill:"none",points:"1 9 7 14 15 4",stroke:"currentColor",strokeDasharray:22,strokeDashoffset:e?44:66,strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,style:n?{}:{transition:"stroke-dashoffset 200ms ease"}})})}function Bre(t){var e,n;const i=fa(),[a,s]=gr(t,RP.variantKeys),{as:r,item:o,state:c,description:u,startContent:h,endContent:d,isVirtualized:p,selectedIcon:g,className:b,classNames:w,autoFocus:x,onPress:S,onPressUp:M,onPressStart:C,onPressEnd:A,onPressChange:N,onClick:R,shouldHighlightOnFocus:D,hideSelectedIcon:B=!1,isReadOnly:z=!1,...I}=a,U=(n=(e=t.disableAnimation)!=null?e:i?.disableAnimation)!=null?n:!1,$=P.useRef(null),G=r||(t.href?"a":"li"),k=typeof G=="string",{rendered:X,key:V}=o,H=c.disabledKeys.has(V)||t.isDisabled,W=c.selectionManager.selectionMode!=="none",J=vj(),{pressProps:Y,isPressed:K}=bo({ref:$,isDisabled:H,onClick:R,onPress:S,onPressUp:M,onPressStart:C,onPressEnd:A,onPressChange:N}),{isHovered:ee,hoverProps:ie}=Qa({isDisabled:H}),{isFocusVisible:Z,focusProps:ue}=Ts({autoFocus:x}),{isFocused:se,isSelected:ae,optionProps:ce,labelProps:pe,descriptionProps:ye}=Lre({key:V,isDisabled:H,"aria-label":a["aria-label"],isVirtualized:p},c,$);let _e=ce;const me=P.useMemo(()=>RP({...s,isDisabled:H,disableAnimation:U,hasTitleTextChild:typeof X=="string",hasDescriptionTextChild:typeof u=="string"}),[ks(s),H,U,X,u]),ne=Vt(w?.base,b);z&&(_e=pq(_e));const be=D&&se||(J?ee||K:ee||se&&!Z),xe=(Ae={})=>({ref:$,...Yt(_e,z?{}:Yt(ue,Y),ie,cs(I,{enabled:k}),Ae),"data-selectable":He(W),"data-focus":He(se),"data-hover":He(be),"data-disabled":He(H),"data-selected":He(ae),"data-pressed":He(K),"data-focus-visible":He(Z),className:me.base({class:Vt(ne,Ae.className)})}),he=(Ae={})=>({...Yt(pe,Ae),"data-label":He(!0),className:me.title({class:w?.title})}),ve=(Ae={})=>({...Yt(ye,Ae),className:me.description({class:w?.description})}),Oe=(Ae={})=>({...Yt(Ae),className:me.wrapper({class:w?.wrapper})}),Le=P.useCallback((Ae={})=>({"aria-hidden":He(!0),"data-disabled":He(H),className:me.selectedIcon({class:w?.selectedIcon}),...Ae}),[H,me,w]);return{Component:G,domRef:$,slots:me,classNames:w,isSelectable:W,isSelected:ae,isDisabled:H,rendered:X,description:u,startContent:h,endContent:d,selectedIcon:g,hideSelectedIcon:B,disableAnimation:U,getItemProps:xe,getLabelProps:he,getWrapperProps:Oe,getDescriptionProps:ve,getSelectedIconProps:Le}}var Lj=t=>{const{Component:e,rendered:n,description:i,isSelectable:a,isSelected:s,isDisabled:r,selectedIcon:o,startContent:c,endContent:u,hideSelectedIcon:h,disableAnimation:d,getItemProps:p,getLabelProps:g,getWrapperProps:b,getDescriptionProps:w,getSelectedIconProps:x}=Bre(t),S=P.useMemo(()=>{const M=_.jsx(zre,{disableAnimation:d,isSelected:s});return typeof o=="function"?o({icon:M,isSelected:s,isDisabled:r}):o||M},[o,s,r,d]);return _.jsxs(e,{...p(),children:[c,i?_.jsxs("div",{...b(),children:[_.jsx("span",{...g(),children:n}),_.jsx("span",{...w(),children:i})]}):_.jsx("span",{...g(),children:n}),a&&!h&&_.jsx("span",{...x(),children:S}),u]})};Lj.displayName="HeroUI.ListboxItem";var vA=Lj,Oj=Si(({item:t,state:e,as:n,variant:i,color:a,disableAnimation:s,className:r,classNames:o,hideSelectedIcon:c,showDivider:u=!1,dividerProps:h={},itemClasses:d,title:p,items:g,...b},w)=>{const x=n||"li",S=P.useMemo(()=>Pie(),[]),M=Vt(o?.base,r),C=Vt(o?.divider,h?.className),{itemProps:A,headingProps:N,groupProps:R}=Ore({heading:t.rendered,"aria-label":t["aria-label"]});return _.jsxs(x,{"data-slot":"base",...Yt(A,b),className:S.base({class:M}),children:[t.rendered&&_.jsx("span",{...N,className:S.heading({class:o?.heading}),"data-slot":"heading",children:t.rendered}),_.jsxs("ul",{...R,className:S.group({class:o?.group}),"data-has-title":!!t.rendered,"data-slot":"group",children:[[...t.childNodes].map(D=>{const{key:B,props:z}=D;let I=_.jsx(vA,{classNames:d,color:a,disableAnimation:s,hideSelectedIcon:c,item:D,state:e,variant:i,...z},B);return D.wrapper&&(I=D.wrapper(I)),I}),u&&_.jsx(pg,{as:"li",className:S.divider({class:C}),...h})]})]},t.key)});Oj.displayName="HeroUI.ListboxSection";var Ij=Oj;function Ure(t={}){const{domRef:e,isEnabled:n=!0,overflowCheck:i="vertical",visibility:a="auto",offset:s=0,onVisibilityChange:r,updateDeps:o=[]}=t,c=P.useRef(a);P.useEffect(()=>{const u=e?.current;if(!u||!n)return;const h=(g,b,w,x,S)=>{if(a==="auto"){const M=`${x}${cO(S)}Scroll`;b&&w?(u.dataset[M]="true",u.removeAttribute(`data-${x}-scroll`),u.removeAttribute(`data-${S}-scroll`)):(u.dataset[`${x}Scroll`]=b.toString(),u.dataset[`${S}Scroll`]=w.toString(),u.removeAttribute(`data-${x}-${S}-scroll`))}else{const M=b&&w?"both":b?x:w?S:"none";M!==c.current&&(r?.(M),c.current=M)}},d=()=>{var g,b;const w=[{type:"vertical",prefix:"top",suffix:"bottom"},{type:"horizontal",prefix:"left",suffix:"right"}],x=u.querySelector('ul[data-slot="list"]'),S=+((g=x?.getAttribute("data-virtual-scroll-height"))!=null?g:u.scrollHeight),M=+((b=x?.getAttribute("data-virtual-scroll-top"))!=null?b:u.scrollTop);for(const{type:C,prefix:A,suffix:N}of w)if(i===C||i==="both"){const R=C==="vertical"?M>s:u.scrollLeft>s,D=C==="vertical"?M+u.clientHeight+s<S:u.scrollLeft+u.clientWidth+s<u.scrollWidth;h(C,R,D,A,N)}},p=()=>{["top","bottom","top-bottom","left","right","left-right"].forEach(g=>{u.removeAttribute(`data-${g}-scroll`)})};return d(),u.addEventListener("scroll",d,!0),a!=="auto"&&(p(),a==="both"?(u.dataset.topBottomScroll=String(i==="vertical"),u.dataset.leftRightScroll=String(i==="horizontal")):(u.dataset.topBottomScroll="false",u.dataset.leftRightScroll="false",["top","bottom","left","right"].forEach(g=>{u.dataset[`${g}Scroll`]=String(a===g)}))),()=>{u.removeEventListener("scroll",d,!0),p()}},[...o,n,a,i,r,e])}function jre(t){var e;const[n,i]=gr(t,jS.variantKeys),{ref:a,as:s,children:r,className:o,style:c,size:u=40,offset:h=0,visibility:d="auto",isEnabled:p=!0,onVisibilityChange:g,...b}=n,w=s||"div",x=_i(a);Ure({domRef:x,offset:h,visibility:d,isEnabled:p,onVisibilityChange:g,updateDeps:[r],overflowCheck:(e=t.orientation)!=null?e:"vertical"});const S=P.useMemo(()=>jS({...i,className:o}),[ks(i),o]);return{Component:w,styles:S,domRef:x,children:r,getBaseProps:(C={})=>{var A;return{ref:x,className:S,"data-orientation":(A=t.orientation)!=null?A:"vertical",style:{"--scroll-shadow-size":`${u}px`,...c,...C.style},...b,...C}}}}var Fre=(t,e)=>{const n=[];for(const i of t)i.type==="section"?n.push(([...i.childNodes].length+1)*e):n.push(e);return n},Vre=t=>{if(!t||t.scrollTop===void 0||t.clientHeight===void 0||t.scrollHeight===void 0)return{isTop:!1,isBottom:!1,isMiddle:!1};const e=t.scrollTop===0,n=Math.ceil(t.scrollTop+t.clientHeight)>=t.scrollHeight;return{isTop:e,isBottom:n,isMiddle:!e&&!n}},kre=t=>{var e;const{Component:n,state:i,color:a,variant:s,itemClasses:r,getBaseProps:o,topContent:c,bottomContent:u,hideEmptyContent:h,hideSelectedIcon:d,shouldHighlightOnFocus:p,disableAnimation:g,getEmptyContentProps:b,getListProps:w,scrollShadowProps:x}=t,{virtualization:S}=t;if(!S||!Xb(S)&&!S.maxListboxHeight&&!S.itemHeight)throw new Error("You are using a virtualized listbox. VirtualizedListbox requires 'virtualization' props with 'maxListboxHeight' and 'itemHeight' properties. This error might have originated from autocomplete components that use VirtualizedListbox. Please provide these props to use the virtualized listbox.");const{maxListboxHeight:M,itemHeight:C}=S,A=Math.min(M,C*i.collection.size),N=P.useRef(null),R=P.useMemo(()=>Fre([...i.collection],C),[i.collection,C]),D=are({count:[...i.collection].length,getScrollElement:()=>N.current,estimateSize:X=>R[X]}),B=D.getVirtualItems(),z=D.getTotalSize(),{getBaseProps:I}=jre({...x}),U=X=>{var V;const H=[...i.collection][X.index];if(!H)return null;const W={color:a,item:H,state:i,variant:s,disableAnimation:g,hideSelectedIcon:d,...H.props},J={position:"absolute",top:0,left:0,width:"100%",height:`${X.size}px`,transform:`translateY(${X.start}px)`};if(H.type==="section")return _.jsx(Ij,{...W,itemClasses:r,style:{...J,...W.style}},H.key);let Y=_.jsx(vA,{...W,classNames:Yt(r,(V=H.props)==null?void 0:V.classNames),shouldHighlightOnFocus:p,style:{...J,...W.style}},H.key);return H.wrapper&&(Y=H.wrapper(Y)),Y},[$,G]=P.useState({isTop:!1,isBottom:!0,isMiddle:!1}),k=_.jsxs(n,{...w(),"data-virtual-scroll-height":z,"data-virtual-scroll-top":(e=N?.current)==null?void 0:e.scrollTop,children:[!i.collection.size&&!h&&_.jsx("li",{children:_.jsx("div",{...b()})}),_.jsx("div",{...cs(I()),ref:N,style:{height:M,overflow:"auto"},onScroll:X=>{G(Vre(X.target))},children:A>0&&C>0&&_.jsx("div",{style:{height:`${z}px`,width:"100%",position:"relative"},children:B.map(X=>U(X))})})]});return _.jsxs("div",{...o(),children:[c,k,u]})},Hre=kre,$re=Si(function(e,n){const{isVirtualized:i,...a}=e,s=Ire({...a,ref:n}),{Component:r,state:o,color:c,variant:u,itemClasses:h,getBaseProps:d,topContent:p,bottomContent:g,hideEmptyContent:b,hideSelectedIcon:w,shouldHighlightOnFocus:x,disableAnimation:S,getEmptyContentProps:M,getListProps:C}=s;if(i)return _.jsx(Hre,{...e,...s});const A=_.jsxs(r,{...C(),children:[!o.collection.size&&!b&&_.jsx("li",{children:_.jsx("div",{...M()})}),[...o.collection].map(N=>{var R;const D={color:c,item:N,state:o,variant:u,disableAnimation:S,hideSelectedIcon:w,...N.props};if(N.type==="section")return _.jsx(Ij,{...D,itemClasses:h},N.key);let B=_.jsx(vA,{...D,classNames:Yt(h,(R=N.props)==null?void 0:R.classNames),shouldHighlightOnFocus:x},N.key);return N.wrapper&&(B=N.wrapper(B)),B})]});return _.jsxs("div",{...d(),children:[p,A,g]})}),Gre=$re,Wre=Si(function(e,n){var i;const{Component:a,state:s,label:r,hasHelper:o,isLoading:c,triggerRef:u,selectorIcon:h=_.jsx($B,{}),description:d,errorMessage:p,isInvalid:g,startContent:b,endContent:w,placeholder:x,renderValue:S,shouldLabelBeOutside:M,disableAnimation:C,getBaseProps:A,getLabelProps:N,getTriggerProps:R,getValueProps:D,getListboxProps:B,getPopoverProps:z,getSpinnerProps:I,getMainWrapperProps:U,getInnerWrapperProps:$,getHiddenSelectProps:G,getHelperWrapperProps:k,getListboxWrapperProps:X,getDescriptionProps:V,getErrorMessageProps:H,getSelectorIconProps:W,isClearable:J,getClearButtonProps:Y,getEndWrapperProps:K,getEndContentProps:ee}=wre({...e,ref:n}),ie=r?_.jsx("label",{...N(),children:r}):null,Z=P.cloneElement(h,W()),ue=P.useMemo(()=>{var _e;return J&&((_e=s.selectedItems)!=null&&_e.length)?_.jsx("span",{...Y(),children:_.jsx(ex,{})}):null},[J,Y,(i=s.selectedItems)==null?void 0:i.length]),se=P.useMemo(()=>ue?_.jsxs("div",{...K(),children:[ue,w&&_.jsx("span",{...ee(),children:w})]}):w&&_.jsx("span",{...ee(),children:w}),[ue,w,K,ee]),ae=P.useMemo(()=>{const _e=g&&p;return!o||!(_e||d)?null:_.jsx("div",{...k(),children:_e?_.jsx("div",{...H(),children:p}):_.jsx("div",{...V(),children:d})})},[o,g,p,d,k,H,V]),ce=P.useMemo(()=>{var _e;if(!((_e=s.selectedItems)!=null&&_e.length))return x;if(S&&typeof S=="function"){const me=[...s.selectedItems].map(ne=>({key:ne.key,data:ne.value,type:ne.type,props:ne.props,textValue:ne.textValue,rendered:ne.rendered,"aria-label":ne["aria-label"]}));return S(me)}return s.selectedItems.map(me=>me.textValue).join(", ")},[s.selectedItems,S,x]),pe=P.useMemo(()=>c?_.jsx(Yf,{...I()}):Z,[c,Z,I]),ye=P.useMemo(()=>s.isOpen?_.jsx(Tse,{...z(),children:_.jsx(bre,{...X(),children:_.jsx(Gre,{...B()})})}):null,[s.isOpen,z,s,u,X,B]);return _.jsxs("div",{...A(),children:[_.jsx(Are,{...G()}),M?ie:null,_.jsxs("div",{...U(),children:[_.jsxs(a,{...R(),children:[M?null:ie,_.jsxs("div",{...$(),children:[b,_.jsx("span",{...D(),children:ce}),w&&s.selectedItems&&_.jsx(gB,{elementType:"span",children:","}),se]}),pe]}),ae]}),C?ye:_.jsx(Hs,{children:ye})]})}),Af=Wre,zj={};zj={Empty:"فارغ"};var Bj={};Bj={Empty:"Изпразни"};var Uj={};Uj={Empty:"Prázdné"};var jj={};jj={Empty:"Tom"};var Fj={};Fj={Empty:"Leer"};var Vj={};Vj={Empty:"Άδειο"};var kj={};kj={Empty:"Empty"};var Hj={};Hj={Empty:"Vacío"};var $j={};$j={Empty:"Tühjenda"};var Gj={};Gj={Empty:"Tyhjä"};var Wj={};Wj={Empty:"Vide"};var Kj={};Kj={Empty:"ריק"};var Xj={};Xj={Empty:"Prazno"};var qj={};qj={Empty:"Üres"};var Yj={};Yj={Empty:"Vuoto"};var Zj={};Zj={Empty:"空"};var Qj={};Qj={Empty:"비어 있음"};var Jj={};Jj={Empty:"Tuščias"};var eF={};eF={Empty:"Tukšs"};var tF={};tF={Empty:"Tom"};var nF={};nF={Empty:"Leeg"};var iF={};iF={Empty:"Pusty"};var aF={};aF={Empty:"Vazio"};var sF={};sF={Empty:"Vazio"};var rF={};rF={Empty:"Gol"};var oF={};oF={Empty:"Не заполнено"};var lF={};lF={Empty:"Prázdne"};var cF={};cF={Empty:"Prazen"};var uF={};uF={Empty:"Prazno"};var dF={};dF={Empty:"Tomt"};var fF={};fF={Empty:"Boş"};var hF={};hF={Empty:"Пусто"};var pF={};pF={Empty:"空"};var mF={};mF={Empty:"空白"};var gF={};gF={"ar-AE":zj,"bg-BG":Bj,"cs-CZ":Uj,"da-DK":jj,"de-DE":Fj,"el-GR":Vj,"en-US":kj,"es-ES":Hj,"et-EE":$j,"fi-FI":Gj,"fr-FR":Wj,"he-IL":Kj,"hr-HR":Xj,"hu-HU":qj,"it-IT":Yj,"ja-JP":Zj,"ko-KR":Qj,"lt-LT":Jj,"lv-LV":eF,"nb-NO":tF,"nl-NL":nF,"pl-PL":iF,"pt-BR":aF,"pt-PT":sF,"ro-RO":rF,"ru-RU":oF,"sk-SK":lF,"sl-SI":cF,"sr-SP":uF,"sv-SE":dF,"tr-TR":fF,"uk-UA":hF,"zh-CN":pF,"zh-TW":mF};function Kre(t){return t&&t.__esModule?t.default:t}function Xre(t){const e=P.useRef(void 0);let{value:n,textValue:i,minValue:a,maxValue:s,isDisabled:r,isReadOnly:o,isRequired:c,onIncrement:u,onIncrementPage:h,onDecrement:d,onDecrementPage:p,onDecrementToMin:g,onIncrementToMax:b}=t;const w=Qg(Kre(gF),"@react-aria/spinbutton"),x=()=>clearTimeout(e.current);P.useEffect(()=>()=>x(),[]);let S=U=>{if(!(U.ctrlKey||U.metaKey||U.shiftKey||U.altKey||o||U.nativeEvent.isComposing))switch(U.key){case"PageUp":if(h){U.preventDefault(),h?.();break}case"ArrowUp":case"Up":u&&(U.preventDefault(),u?.());break;case"PageDown":if(p){U.preventDefault(),p?.();break}case"ArrowDown":case"Down":d&&(U.preventDefault(),d?.());break;case"Home":g&&(U.preventDefault(),g?.());break;case"End":b&&(U.preventDefault(),b?.());break}},M=P.useRef(!1),C=()=>{M.current=!0},A=()=>{M.current=!1},N=i===""?w.format("Empty"):(i||`${n}`).replace("-","");P.useEffect(()=>{M.current&&($se("assertive"),Hse(N,"assertive"))},[N]);const R=xa(U=>{x(),u?.(),e.current=window.setTimeout(()=>{(s===void 0||isNaN(s)||n===void 0||isNaN(n)||n<s)&&R(60)},U)}),D=xa(U=>{x(),d?.(),e.current=window.setTimeout(()=>{(a===void 0||isNaN(a)||n===void 0||isNaN(n)||n>a)&&D(60)},U)});let B=U=>{U.preventDefault()},{addGlobalListener:z,removeAllGlobalListeners:I}=K1();return{spinButtonProps:{role:"spinbutton","aria-valuenow":n!==void 0&&!isNaN(n)?n:void 0,"aria-valuetext":N,"aria-valuemin":a,"aria-valuemax":s,"aria-disabled":r||void 0,"aria-readonly":o||void 0,"aria-required":c||void 0,onKeyDown:S,onFocus:C,onBlur:A},incrementButtonProps:{onPressStart:()=>{R(400),z(window,"contextmenu",B)},onPressEnd:()=>{x(),I()},onFocus:C,onBlur:A},decrementButtonProps:{onPressStart:()=>{D(400),z(window,"contextmenu",B)},onPressEnd:()=>{x(),I()},onFocus:C,onBlur:A}}}var vF=({direction:t,...e})=>_.jsx(Zt,{disableRipple:!0,isIconOnly:!0,...e,children:t=="up"?_.jsx(Zie,{}):_.jsx($B,{})});vF.displayName="HeroUI.NumberInputStepper";var cD=vF;function qre(t){let{minValue:e,maxValue:n,step:i,formatOptions:a,value:s,defaultValue:r=NaN,onChange:o,locale:c,isDisabled:u,isReadOnly:h}=t;s===null&&(s=NaN),s!==void 0&&!isNaN(s)&&(i!==void 0&&!isNaN(i)?s=nd(s,e,n,i):s=wg(s,e,n)),isNaN(r)||(i!==void 0&&!isNaN(i)?r=nd(r,e,n,i):r=wg(r,e,n));let[d,p]=sh(s,isNaN(r)?NaN:r,o),[g]=P.useState(d),[b,w]=P.useState(()=>isNaN(d)?"":new CS(c,a).format(d)),x=P.useMemo(()=>new PO(c,a),[c,a]),S=P.useMemo(()=>x.getNumberingSystem(b),[x,b]),M=P.useMemo(()=>new CS(c,{...a,numberingSystem:S}),[c,a,S]),C=P.useMemo(()=>M.resolvedOptions(),[M]),A=P.useCallback(ie=>isNaN(ie)||ie===null?"":M.format(ie),[M]),N=nx({...t,value:d}),R=i!==void 0&&!isNaN(i)?i:1;C.style==="percent"&&(i===void 0||isNaN(i))&&(R=.01);let[D,B]=P.useState(d),[z,I]=P.useState(c),[U,$]=P.useState(a);(!Object.is(d,D)||c!==z||a!==U)&&(w(A(d)),B(d),I(c),$(a));let G=P.useMemo(()=>x.parse(b),[x,b]),k=()=>{if(!b.length){p(NaN),w(s===void 0?"":A(d));return}if(isNaN(G)){w(A(d));return}let ie;i===void 0||isNaN(i)?ie=wg(G,e,n):ie=nd(G,e,n,i),ie=x.parse(A(ie)),p(ie),w(A(s===void 0?ie:d)),N.commitValidation()},X=(ie,Z=0)=>{let ue=G;if(isNaN(ue)){let se=isNaN(Z)?0:Z;return nd(se,e,n,R)}else{let se=nd(ue,e,n,R);return ie==="+"&&se>ue||ie==="-"&&se<ue?se:nd(OE(ie,ue,R),e,n,R)}},V=()=>{let ie=X("+",e);ie===d&&w(A(ie)),p(ie),N.commitValidation()},H=()=>{let ie=X("-",n);ie===d&&w(A(ie)),p(ie),N.commitValidation()},W=()=>{n!=null&&(p(nd(n,e,n,R)),N.commitValidation())},J=()=>{e!=null&&(p(e),N.commitValidation())},Y=P.useMemo(()=>!u&&!h&&(isNaN(G)||n===void 0||isNaN(n)||nd(G,e,n,R)>G||OE("+",G,R)<=n),[u,h,e,n,R,G]),K=P.useMemo(()=>!u&&!h&&(isNaN(G)||e===void 0||isNaN(e)||nd(G,e,n,R)<G||OE("-",G,R)>=e),[u,h,e,n,R,G]);return{...N,validate:ie=>x.isValidPartialNumber(ie,e,n),increment:V,incrementToMax:W,decrement:H,decrementToMin:J,canIncrement:Y,canDecrement:K,minValue:e,maxValue:n,numberValue:G,defaultNumberValue:isNaN(r)?g:r,setNumberValue:p,setInputValue:w,inputValue:b,commit:k}}function OE(t,e,n){let i=t==="+"?e+n:e-n;if(e%1!==0||n%1!==0){const a=e.toString().split("."),s=n.toString().split("."),r=a[1]&&a[1].length||0,o=s[1]&&s[1].length||0,c=Math.pow(10,Math.max(r,o));e=Math.round(e*c),n=Math.round(n*c),i=t==="+"?e+n:e-n,i/=c}return i}var yF={};yF={decrease:t=>`خفض ${t.fieldLabel}`,increase:t=>`زيادة ${t.fieldLabel}`,numberField:"حقل رقمي"};var bF={};bF={decrease:t=>`Намаляване ${t.fieldLabel}`,increase:t=>`Усилване ${t.fieldLabel}`,numberField:"Номер на полето"};var xF={};xF={decrease:t=>`Snížit ${t.fieldLabel}`,increase:t=>`Zvýšit ${t.fieldLabel}`,numberField:"Číselné pole"};var _F={};_F={decrease:t=>`Reducer ${t.fieldLabel}`,increase:t=>`Øg ${t.fieldLabel}`,numberField:"Talfelt"};var SF={};SF={decrease:t=>`${t.fieldLabel} verringern`,increase:t=>`${t.fieldLabel} erhöhen`,numberField:"Nummernfeld"};var wF={};wF={decrease:t=>`Μείωση ${t.fieldLabel}`,increase:t=>`Αύξηση ${t.fieldLabel}`,numberField:"Πεδίο αριθμού"};var EF={};EF={decrease:t=>`Decrease ${t.fieldLabel}`,increase:t=>`Increase ${t.fieldLabel}`,numberField:"Number field"};var MF={};MF={decrease:t=>`Reducir ${t.fieldLabel}`,increase:t=>`Aumentar ${t.fieldLabel}`,numberField:"Campo de número"};var TF={};TF={decrease:t=>`Vähenda ${t.fieldLabel}`,increase:t=>`Suurenda ${t.fieldLabel}`,numberField:"Numbri väli"};var CF={};CF={decrease:t=>`Vähennä ${t.fieldLabel}`,increase:t=>`Lisää ${t.fieldLabel}`,numberField:"Numerokenttä"};var AF={};AF={decrease:t=>`Diminuer ${t.fieldLabel}`,increase:t=>`Augmenter ${t.fieldLabel}`,numberField:"Champ de nombre"};var RF={};RF={decrease:t=>`הקטן ${t.fieldLabel}`,increase:t=>`הגדל ${t.fieldLabel}`,numberField:"שדה מספר"};var NF={};NF={decrease:t=>`Smanji ${t.fieldLabel}`,increase:t=>`Povećaj ${t.fieldLabel}`,numberField:"Polje broja"};var PF={};PF={decrease:t=>`${t.fieldLabel} csökkentése`,increase:t=>`${t.fieldLabel} növelése`,numberField:"Számmező"};var DF={};DF={decrease:t=>`Riduci ${t.fieldLabel}`,increase:t=>`Aumenta ${t.fieldLabel}`,numberField:"Campo numero"};var LF={};LF={decrease:t=>`${t.fieldLabel}を縮小`,increase:t=>`${t.fieldLabel}を拡大`,numberField:"数値フィールド"};var OF={};OF={decrease:t=>`${t.fieldLabel} 감소`,increase:t=>`${t.fieldLabel} 증가`,numberField:"번호 필드"};var IF={};IF={decrease:t=>`Sumažinti ${t.fieldLabel}`,increase:t=>`Padidinti ${t.fieldLabel}`,numberField:"Numerio laukas"};var zF={};zF={decrease:t=>`Samazināšana ${t.fieldLabel}`,increase:t=>`Palielināšana ${t.fieldLabel}`,numberField:"Skaitļu lauks"};var BF={};BF={decrease:t=>`Reduser ${t.fieldLabel}`,increase:t=>`Øk ${t.fieldLabel}`,numberField:"Tallfelt"};var UF={};UF={decrease:t=>`${t.fieldLabel} verlagen`,increase:t=>`${t.fieldLabel} verhogen`,numberField:"Getalveld"};var jF={};jF={decrease:t=>`Zmniejsz ${t.fieldLabel}`,increase:t=>`Zwiększ ${t.fieldLabel}`,numberField:"Pole numeru"};var FF={};FF={decrease:t=>`Diminuir ${t.fieldLabel}`,increase:t=>`Aumentar ${t.fieldLabel}`,numberField:"Campo de número"};var VF={};VF={decrease:t=>`Diminuir ${t.fieldLabel}`,increase:t=>`Aumentar ${t.fieldLabel}`,numberField:"Campo numérico"};var kF={};kF={decrease:t=>`Scădere ${t.fieldLabel}`,increase:t=>`Creștere ${t.fieldLabel}`,numberField:"Câmp numeric"};var HF={};HF={decrease:t=>`Уменьшение ${t.fieldLabel}`,increase:t=>`Увеличение ${t.fieldLabel}`,numberField:"Числовое поле"};var $F={};$F={decrease:t=>`Znížiť ${t.fieldLabel}`,increase:t=>`Zvýšiť ${t.fieldLabel}`,numberField:"Číselné pole"};var GF={};GF={decrease:t=>`Upadati ${t.fieldLabel}`,increase:t=>`Povečajte ${t.fieldLabel}`,numberField:"Številčno polje"};var WF={};WF={decrease:t=>`Smanji ${t.fieldLabel}`,increase:t=>`Povećaj ${t.fieldLabel}`,numberField:"Polje broja"};var KF={};KF={decrease:t=>`Minska ${t.fieldLabel}`,increase:t=>`Öka ${t.fieldLabel}`,numberField:"Nummerfält"};var XF={};XF={decrease:t=>`${t.fieldLabel} azalt`,increase:t=>`${t.fieldLabel} arttır`,numberField:"Sayı alanı"};var qF={};qF={decrease:t=>`Зменшити ${t.fieldLabel}`,increase:t=>`Збільшити ${t.fieldLabel}`,numberField:"Поле номера"};var YF={};YF={decrease:t=>`降低 ${t.fieldLabel}`,increase:t=>`提高 ${t.fieldLabel}`,numberField:"数字字段"};var ZF={};ZF={decrease:t=>`縮小 ${t.fieldLabel}`,increase:t=>`放大 ${t.fieldLabel}`,numberField:"數字欄位"};var QF={};QF={"ar-AE":yF,"bg-BG":bF,"cs-CZ":xF,"da-DK":_F,"de-DE":SF,"el-GR":wF,"en-US":EF,"es-ES":MF,"et-EE":TF,"fi-FI":CF,"fr-FR":AF,"he-IL":RF,"hr-HR":NF,"hu-HU":PF,"it-IT":DF,"ja-JP":LF,"ko-KR":OF,"lt-LT":IF,"lv-LV":zF,"nb-NO":BF,"nl-NL":UF,"pl-PL":jF,"pt-BR":FF,"pt-PT":VF,"ro-RO":kF,"ru-RU":HF,"sk-SK":$F,"sl-SI":GF,"sr-SP":WF,"sv-SE":KF,"tr-TR":XF,"uk-UA":qF,"zh-CN":YF,"zh-TW":ZF};function Yre(t){return t&&t.__esModule?t.default:t}function Zre(t,e,n){let{id:i,decrementAriaLabel:a,incrementAriaLabel:s,isDisabled:r,isReadOnly:o,isRequired:c,minValue:u,maxValue:h,autoFocus:d,label:p,formatOptions:g,onBlur:b=()=>{},onFocus:w,onFocusChange:x,onKeyDown:S,onKeyUp:M,description:C,errorMessage:A,isWheelDisabled:N,...R}=t,{increment:D,incrementToMax:B,decrement:z,decrementToMin:I,numberValue:U,inputValue:$,commit:G,commitValidation:k}=e;const X=Qg(Yre(QF),"@react-aria/numberfield");let V=Us(i),{focusProps:H}=cw({onBlur(){G()}}),W=L8(g),J=P.useMemo(()=>W.resolvedOptions(),[W]),Y=L8({...g,currencySign:void 0}),K=P.useMemo(()=>isNaN(U)?"":Y.format(U),[Y,U]),{spinButtonProps:ee,incrementButtonProps:ie,decrementButtonProps:Z}=Xre({isDisabled:r,isReadOnly:o,isRequired:c,maxValue:h,minValue:u,onIncrement:D,onIncrementToMax:B,onDecrement:z,onDecrementToMin:I,value:U,textValue:K}),[ue,se]=P.useState(!1),{focusWithinProps:ae}=Rd({isDisabled:r,onFocusWithinChange:se}),ce=P.useCallback(nt=>{Math.abs(nt.deltaY)<=Math.abs(nt.deltaX)||(nt.deltaY>0?D():nt.deltaY<0&&z())},[z,D]);nne({onScroll:ce,isDisabled:N||r||o||!ue},n);var ye;let _e=((ye=J.maximumFractionDigits)!==null&&ye!==void 0?ye:0)>0,me=e.minValue===void 0||isNaN(e.minValue)||e.minValue<0,ne="numeric";yO()?me?ne="text":_e&&(ne="decimal"):nw()&&(me?ne="numeric":_e&&(ne="decimal"));let be=nt=>{e.validate(nt)&&e.setInputValue(nt)},xe=Dl(t),he=P.useCallback(nt=>{nt.nativeEvent.isComposing||(nt.key==="Enter"?(G(),k()):nt.continuePropagation())},[G,k]),{isInvalid:ve,validationErrors:Oe,validationDetails:Le}=e.displayValidation,{labelProps:Ae,inputProps:et,descriptionProps:tt,errorMessageProps:re}=rse({...R,...xe,name:void 0,form:void 0,label:p,autoFocus:d,isDisabled:r,isReadOnly:o,isRequired:c,validate:void 0,[i1]:e,value:$,defaultValue:"!",autoComplete:"off","aria-label":t["aria-label"]||void 0,"aria-labelledby":t["aria-labelledby"]||void 0,id:V,type:"text",inputMode:ne,onChange:be,onBlur:b,onFocus:w,onFocusChange:x,onKeyDown:P.useMemo(()=>ah(he,S),[he,S]),onKeyUp:M,description:C,errorMessage:A},e,n);yC(n,e.defaultNumberValue,e.setNumberValue);let te=ci(ee,H,et,{role:null,"aria-roledescription":W1()?null:X.format("numberField"),"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null,autoCorrect:"off",spellCheck:"false"});t.validationBehavior==="native"&&(te["aria-required"]=void 0);let we=nt=>{var Ye;document.activeElement!==n.current&&(nt.pointerType==="mouse"?(Ye=n.current)===null||Ye===void 0||Ye.focus():nt.target.focus())},Ce=t["aria-label"]||(typeof t.label=="string"?t.label:""),Ie;Ce||(Ie=t.label!=null?Ae.id:t["aria-labelledby"]);let Pe=Us(),Ze=Us(),We=ci(ie,{"aria-label":s||X.format("increase",{fieldLabel:Ce}).trim(),id:Ie&&!s?Pe:null,"aria-labelledby":Ie&&!s?`${Pe} ${Ie}`:null,"aria-controls":V,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!e.canIncrement,onPressStart:we}),mt=ci(Z,{"aria-label":a||X.format("decrease",{fieldLabel:Ce}).trim(),id:Ie&&!a?Ze:null,"aria-labelledby":Ie&&!a?`${Ze} ${Ie}`:null,"aria-controls":V,excludeFromTabOrder:!0,preventFocusOnPress:!0,allowFocusWhenDisabled:!0,isDisabled:!e.canDecrement,onPressStart:we});return{groupProps:{...ae,role:"group","aria-disabled":r,"aria-invalid":ve?"true":void 0},labelProps:Ae,inputProps:te,incrementButtonProps:We,decrementButtonProps:mt,errorMessageProps:re,descriptionProps:tt,isInvalid:ve,validationErrors:Oe,validationDetails:Le}}function Qre(t){var e,n,i;const a=fa(),{validationBehavior:s}=ix(zg)||{},[r,o]=gr(t,PP.variantKeys),{ref:c,as:u,type:h,label:d,baseRef:p,wrapperRef:g,description:b,className:w,classNames:x,autoFocus:S,startContent:M,endContent:C,onClear:A,onChange:N,validationBehavior:R=(e=s??a?.validationBehavior)!=null?e:"native",innerWrapperRef:D,onValueChange:B,hideStepper:z,...I}=r,[U,$]=P.useState(!1),G=u||"div",k=(i=(n=t.disableAnimation)!=null?n:a?.disableAnimation)!=null?i:!1,X=_i(c),V=_i(p),H=_i(g),W=_i(D),{locale:J}=um(),Y=qre({...t,validationBehavior:R,locale:J,onChange:$r(B,N)}),{groupProps:K,labelProps:ee,inputProps:ie,incrementButtonProps:Z,decrementButtonProps:ue,descriptionProps:se,errorMessageProps:ae,isInvalid:ce,validationErrors:pe,validationDetails:ye}=Zre({...t,validationBehavior:R},Y,X),_e=isNaN(Y.numberValue)?"":Y.numberValue,me=!Xb(_e),ne=me||U,be=Vt(x?.base,w,me?"is-filled":""),xe=P.useCallback(()=>{var ot;Y.setInputValue(""),A?.(),(ot=X.current)==null||ot.focus()},[Y.setInputValue,A]);Nd(()=>{X.current&&Y.setInputValue(X.current.value)},[X.current]);const{isFocusVisible:he,isFocused:ve,focusProps:Oe}=Ts({autoFocus:S,isTextInput:!0}),{isHovered:Le,hoverProps:Ae}=Qa({isDisabled:!!t?.isDisabled}),{isHovered:et,hoverProps:tt}=Qa({isDisabled:!!t?.isDisabled}),{focusProps:re,isFocusVisible:te}=Ts(),{focusWithinProps:we}=Rd({onFocusWithinChange:$}),{pressProps:Ce}=bo({isDisabled:!!t?.isDisabled||!!t?.isReadOnly,onPress:xe}),Ie=bB({labelPlacement:t.labelPlacement,label:d}),Pe=typeof r.errorMessage=="function"?r.errorMessage({isInvalid:ce,validationErrors:pe,validationDetails:ye}):r.errorMessage||pe?.join(" "),Ze=!!A||t.isClearable,We=!!d||!!b||!!Pe,mt=!!r.placeholder,nt=!!d,Ye=!!b||!!Pe,Je=Ie==="outside"||Ie==="outside-left",jt=Ie==="inside",wt=X.current?(!X.current.value||X.current.value===""||!_e)&&mt:!1,Et=Ie==="outside-left",zt=!!M,Te=Je?Ie==="outside-left"||mt||Ie==="outside"&&zt:!1,pt=Ie==="outside"&&!mt&&!zt,at=P.useMemo(()=>PP({...o,isInvalid:ce,isClearable:Ze,disableAnimation:k}),[ks(o),ce,Ze,zt,k]),St=P.useCallback(ot=>{var Lt,vt;const Ot=ot.currentTarget,{selectionStart:Mt,selectionEnd:Ln,value:wi}=Ot,ei=(vt=(Lt=new Intl.NumberFormat(J,{useGrouping:!0}).formatToParts(1e3).find(Fn=>Fn.type==="group"))==null?void 0:Lt.value)!=null?vt:",";if(ot.key==="Backspace"&&!t.isReadOnly&&!t.isDisabled&&Mt!==null&&Ln!==null&&Mt===Ln&&Mt>0&&wi[Mt]===ei&&wi[Mt-1]!==ei){ot.preventDefault();const le=(wi.slice(0,Mt-1)+wi.slice(Mt)).replace(/[^\d.-]/g,"");if(le===""||le==="-")Y.setInputValue("");else{const Re=parseFloat(le);isNaN(Re)||Y.setNumberValue(Re)}setTimeout(()=>{const Re=Math.max(0,Mt-1);Ot.setSelectionRange(Re,Re)},0)}else ot.key==="Escape"&&_e&&(Ze||A)&&!t.isReadOnly&&(Y.setInputValue(""),A?.())},[_e,Y,A,Ze,t.isReadOnly]),ct=P.useCallback((ot={})=>({ref:V,className:at.base({class:be}),"data-slot":"base","data-filled":He(me||mt||zt||wt),"data-filled-within":He(ne||mt||zt||wt),"data-focus-within":He(U),"data-focus-visible":He(he),"data-readonly":He(t.isReadOnly),"data-focus":He(ve),"data-hover":He(Le||et),"data-required":He(t.isRequired),"data-invalid":He(ce),"data-disabled":He(t.isDisabled),"data-has-elements":He(We),"data-has-helper":He(Ye),"data-has-label":He(nt),"data-has-value":He(!wt),...we,...ot}),[at,be,me,ve,Le,et,ce,Ye,nt,We,wt,zt,U,he,mt,we,t.isReadOnly,t.isRequired,t.isDisabled]),it=P.useCallback((ot={})=>({"data-slot":"label",className:at.label({class:x?.label}),...Yt(ee,tt,ot)}),[at,et,ee,x?.label]),Nt=P.useCallback((ot={})=>({"data-slot":"input","data-filled":He(me),"data-has-start-content":He(zt),"data-has-end-content":He(!!C),className:at.input({class:Vt(x?.input,me?"is-filled":"")}),...Yt(Oe,ie,cs(I,{enabled:!0,labelable:!0,omitEventNames:new Set(Object.keys(ie)),omitPropNames:new Set(["value","name"])}),ot),"aria-readonly":He(t.isReadOnly),onChange:$r(ie.onChange,N),onKeyDown:$r(ie.onKeyDown,ot.onKeyDown,St),ref:X}),[at,Oe,ie,I,me,zt,C,x?.input,t.isReadOnly,t.isRequired,N,St]),kt=P.useCallback((ot={})=>({name:t.name,value:_e,"data-slot":"hidden-input",type:"hidden",...ot}),[_e,t.name]),Xt=P.useCallback((ot={})=>({ref:H,"data-slot":"input-wrapper","data-hover":He(Le||et),"data-focus-visible":He(he),"data-focus":He(ve),className:at.inputWrapper({class:Vt(x?.inputWrapper,me?"is-filled":"")}),...Yt(ot,Ae),onClick:Lt=>{X.current&&Lt.currentTarget===Lt.target&&X.current.focus()},style:{cursor:"text",...ot.style}}),[at,Le,et,he,ve,_e,x?.inputWrapper]),rn=P.useCallback((ot={})=>({ref:W,"data-slot":"inner-wrapper",onClick:Lt=>{X.current&&Lt.currentTarget===Lt.target&&X.current.focus()},className:at.innerWrapper({class:Vt(x?.innerWrapper,ot?.className)}),...Yt(K,ot)}),[at,x?.innerWrapper]),ge=P.useCallback((ot={})=>({...ot,"data-slot":"main-wrapper",className:at.mainWrapper({class:Vt(x?.mainWrapper,ot?.className)})}),[at,x?.mainWrapper]),Se=P.useCallback((ot={})=>({...ot,"data-slot":"helper-wrapper",className:at.helperWrapper({class:Vt(x?.helperWrapper,ot?.className)})}),[at,x?.helperWrapper]),De=P.useCallback((ot={})=>({...ot,...se,"data-slot":"description",className:at.description({class:Vt(x?.description,ot?.className)})}),[at,x?.description]),lt=P.useCallback((ot={})=>({...ot,...ae,"data-slot":"error-message",className:at.errorMessage({class:Vt(x?.errorMessage,ot?.className)})}),[at,ae,x?.errorMessage]),rt=P.useCallback((ot={})=>({...ot,type:"button",tabIndex:-1,disabled:t.isDisabled,"aria-label":"clear input","data-slot":"clear-button","data-focus-visible":He(te),className:at.clearButton({class:Vt(x?.clearButton,ot?.className)}),...Yt(Ce,re)}),[at,te,Ce,re,x?.clearButton]),Bt=P.useCallback((ot={})=>({...ot,"data-slot":"stepper-wrapper",className:at.stepperWrapper({class:Vt(x?.stepperWrapper,ot?.className)})}),[at]),Ut=P.useCallback((ot={})=>({...ot,type:"button",disabled:t.isDisabled,"data-slot":"increase-button",className:at.stepperButton({class:Vt(x?.stepperButton,ot?.className)}),...Yt(Z,ot)}),[at,Z,x?.stepperButton]),Dt=P.useCallback((ot={})=>({type:"button",disabled:t.isDisabled,"data-slot":"decrease-button",className:at.stepperButton({class:Vt(x?.stepperButton,ot?.className)}),...Yt(ue,ot)}),[at,ue,x?.stepperButton]);return{Component:G,classNames:x,type:h,domRef:X,label:d,description:b,startContent:M,endContent:C,labelPlacement:Ie,isClearable:Ze,hasHelper:Ye,hasStartContent:zt,isLabelOutside:Te,isOutsideLeft:Et,isLabelOutsideAsPlaceholder:pt,shouldLabelBeOutside:Je,shouldLabelBeInside:jt,hasPlaceholder:mt,isInvalid:ce,errorMessage:Pe,hideStepper:z,incrementButtonProps:Z,decrementButtonProps:ue,getBaseProps:ct,getLabelProps:it,getNumberInputProps:Nt,getHiddenNumberInputProps:kt,getMainWrapperProps:ge,getInputWrapperProps:Xt,getInnerWrapperProps:rn,getHelperWrapperProps:Se,getDescriptionProps:De,getErrorMessageProps:lt,getClearButtonProps:rt,getStepperIncreaseButtonProps:Ut,getStepperDecreaseButtonProps:Dt,getStepperWrapperProps:Bt}}var JF=Si((t,e)=>{const{Component:n,label:i,description:a,isClearable:s,startContent:r,endContent:o,labelPlacement:c,hasHelper:u,isOutsideLeft:h,shouldLabelBeOutside:d,errorMessage:p,isInvalid:g,hideStepper:b,getBaseProps:w,getLabelProps:x,getNumberInputProps:S,getHiddenNumberInputProps:M,getInnerWrapperProps:C,getInputWrapperProps:A,getMainWrapperProps:N,getHelperWrapperProps:R,getDescriptionProps:D,getErrorMessageProps:B,getClearButtonProps:z,getStepperIncreaseButtonProps:I,getStepperDecreaseButtonProps:U,getStepperWrapperProps:$}=Qre({...t,ref:e}),G=i?_.jsx("label",{...x(),children:i}):null,k=P.useMemo(()=>s?_.jsxs(_.Fragment,{children:[_.jsx("button",{...z(),children:_.jsx(ex,{})}),o]}):o,[s,z]),X=P.useMemo(()=>{const W=g&&p;return!u||!(W||a)?null:_.jsx("div",{...R(),children:W?_.jsx("div",{...B(),children:p}):_.jsx("div",{...D(),children:a})})},[u,g,p,a,R,B,D]),V=P.useMemo(()=>_.jsxs("div",{...C(),children:[r,_.jsx("input",{...S()}),_.jsx("input",{...M()}),k,!b&&_.jsxs("div",{...$(),children:[_.jsx(cD,{...I(),direction:"up"}),_.jsx(cD,{...U(),direction:"down"})]})]}),[r,k,S,C]),H=P.useMemo(()=>d?_.jsxs("div",{...N(),children:[_.jsxs("div",{...A(),children:[h?null:G,V]}),X]}):_.jsxs(_.Fragment,{children:[_.jsxs("div",{...A(),children:[G,V]}),X]}),[c,X,d,G,V,p,a,N,A,B,D]);return _.jsxs(n,{...w(),children:[h?G:null,H]})});JF.displayName="HeroUI.NumberInput";var Fo=JF,eV={};eV={close:"إغلاق",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} إشعار`,other:()=>`${e.number(t.count)} إشعارات`})}.`};var tV={};tV={close:"Затвори",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} известие`,other:()=>`${e.number(t.count)} известия`})}.`};var nV={};nV={close:"Zavřít",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} oznámení`,other:()=>`${e.number(t.count)} oznámení`})}.`};var iV={};iV={close:"Luk",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} besked`,other:()=>`${e.number(t.count)} beskeder`})}.`};var aV={};aV={close:"Schließen",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} Benachrichtigung`,other:()=>`${e.number(t.count)} Benachrichtigungen`})}.`};var sV={};sV={close:"Κλείσιμο",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} ειδοποίηση`,other:()=>`${e.number(t.count)} ειδοποιήσεις`})}.`};var rV={};rV={close:"Close",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notification`,other:()=>`${e.number(t.count)} notifications`})}.`};var oV={};oV={close:"Cerrar",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notificación`,other:()=>`${e.number(t.count)} notificaciones`})}.`};var lV={};lV={close:"Sule",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} teatis`,other:()=>`${e.number(t.count)} teatist`})}.`};var cV={};cV={close:"Sulje",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} ilmoitus`,other:()=>`${e.number(t.count)} ilmoitusta`})}.`};var uV={};uV={close:"Fermer",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notification`,other:()=>`${e.number(t.count)} notifications`})}.`};var dV={};dV={close:"סגור",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} התראה`,other:()=>`${e.number(t.count)} התראות`})}.`};var fV={};fV={close:"Zatvori",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} obavijest`,other:()=>`${e.number(t.count)} obavijesti`})}.`};var hV={};hV={close:"Bezárás",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} értesítés`,other:()=>`${e.number(t.count)} értesítés`})}.`};var pV={};pV={close:"Chiudi",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notifica`,other:()=>`${e.number(t.count)} notifiche`})}.`};var mV={};mV={close:"閉じる",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} 個の通知`,other:()=>`${e.number(t.count)} 個の通知`})}。`};var gV={};gV={close:"닫기",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)}개 알림`,other:()=>`${e.number(t.count)}개 알림`})}.`};var vV={};vV={close:"Uždaryti",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} pranešimas`,other:()=>`${e.number(t.count)} pranešimai`})}.`};var yV={};yV={close:"Aizvērt",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} paziņojums`,other:()=>`${e.number(t.count)} paziņojumi`})}.`};var bV={};bV={close:"Lukk",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} varsling`,other:()=>`${e.number(t.count)} varsler`})}.`};var xV={};xV={close:"Sluiten",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} melding`,other:()=>`${e.number(t.count)} meldingen`})}.`};var _V={};_V={close:"Zamknij",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} powiadomienie`,few:()=>`${e.number(t.count)} powiadomienia`,many:()=>`${e.number(t.count)} powiadomień`,other:()=>`${e.number(t.count)} powiadomienia`})}.`};var SV={};SV={close:"Fechar",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notificação`,other:()=>`${e.number(t.count)} notificações`})}.`};var wV={};wV={close:"Fechar",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notificação`,other:()=>`${e.number(t.count)} notificações`})}.`};var EV={};EV={close:"Închideţi",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} notificare`,other:()=>`${e.number(t.count)} notificări`})}.`};var MV={};MV={close:"Закрыть",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} уведомление`,other:()=>`${e.number(t.count)} уведомления`})}.`};var TV={};TV={close:"Zatvoriť",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} oznámenie`,few:()=>`${e.number(t.count)} oznámenia`,other:()=>`${e.number(t.count)} oznámení`})}.`};var CV={};CV={close:"Zapri",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} obvestilo`,two:()=>`${e.number(t.count)} obvestili`,few:()=>`${e.number(t.count)} obvestila`,other:()=>`${e.number(t.count)} obvestil`})}.`};var AV={};AV={close:"Zatvori",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} obaveštenje`,other:()=>`${e.number(t.count)} obaveštenja`})}.`};var RV={};RV={close:"Stäng",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} meddelande`,other:()=>`${e.number(t.count)} meddelanden`})}.`};var NV={};NV={close:"Kapat",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} bildirim`,other:()=>`${e.number(t.count)} bildirim`})}.`};var PV={};PV={close:"Закрити",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} сповіщення`,other:()=>`${e.number(t.count)} сповіщення`})}.`};var DV={};DV={close:"关闭",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} 个通知`,other:()=>`${e.number(t.count)} 个通知`})}。`};var LV={};LV={close:"關閉",notifications:(t,e)=>`${e.plural(t.count,{one:()=>`${e.number(t.count)} 個通知`,other:()=>`${e.number(t.count)} 個通知`})}。`};var yA={};yA={"ar-AE":eV,"bg-BG":tV,"cs-CZ":nV,"da-DK":iV,"de-DE":aV,"el-GR":sV,"en-US":rV,"es-ES":oV,"et-EE":lV,"fi-FI":cV,"fr-FR":uV,"he-IL":dV,"hr-HR":fV,"hu-HU":hV,"it-IT":pV,"ja-JP":mV,"ko-KR":gV,"lt-LT":vV,"lv-LV":yV,"nb-NO":bV,"nl-NL":xV,"pl-PL":_V,"pt-BR":SV,"pt-PT":wV,"ro-RO":EV,"ru-RU":MV,"sk-SK":TV,"sl-SI":CV,"sr-SP":AV,"sv-SE":RV,"tr-TR":NV,"uk-UA":PV,"zh-CN":DV,"zh-TW":LV};function Jre(t){return t&&t.__esModule?t.default:t}function eoe(t,e,n){let{key:i,timer:a,timeout:s}=t.toast;P.useEffect(()=>{if(!(a==null||s==null))return a.reset(s),()=>{a.pause()}},[a,s]);let r=Us(),o=Ng(),c=Qg(Jre(yA),"@react-aria/toast"),[u,h]=P.useState(!1);return P.useEffect(()=>{h(!0)},[]),{toastProps:{...Dl(t,{labelable:!0}),role:"alertdialog","aria-modal":"false","aria-labelledby":t["aria-labelledby"]||r,"aria-describedby":t["aria-describedby"]||o,tabIndex:0},contentProps:{role:"alert","aria-atomic":"true","aria-hidden":u?void 0:"true"},titleProps:{id:r},descriptionProps:{id:o},closeButtonProps:{"aria-label":c.format("close"),onPress:()=>e.close(i)}}}var IE={exports:{}},zE={};/**
* @license React
* use-sync-external-store-shim.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var uD;function toe(){if(uD)return zE;uD=1;var t=om();function e(d,p){return d===p&&(d!==0||1/d===1/p)||d!==d&&p!==p}var n=typeof Object.is=="function"?Object.is:e,i=t.useState,a=t.useEffect,s=t.useLayoutEffect,r=t.useDebugValue;function o(d,p){var g=p(),b=i({inst:{value:g,getSnapshot:p}}),w=b[0].inst,x=b[1];return s(function(){w.value=g,w.getSnapshot=p,c(w)&&x({inst:w})},[d,g,p]),a(function(){return c(w)&&x({inst:w}),d(function(){c(w)&&x({inst:w})})},[d]),r(g),g}function c(d){var p=d.getSnapshot;d=d.value;try{var g=p();return!n(d,g)}catch{return!0}}function u(d,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:o;return zE.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:h,zE}var dD;function OV(){return dD||(dD=1,IE.exports=toe()),IE.exports}var IV=OV();const zV=1,BE=Symbol.for("react-aria-landmark-manager");function noe(t){return document.addEventListener("react-aria-landmark-manager-change",t),()=>document.removeEventListener("react-aria-landmark-manager-change",t)}function fD(){if(typeof document>"u")return null;let t=document[BE];return t&&t.version>=zV?t:(document[BE]=new aoe,document.dispatchEvent(new CustomEvent("react-aria-landmark-manager-change")),document[BE])}function ioe(){return IV.useSyncExternalStore(noe,fD,fD)}class aoe{setupIfNeeded(){this.isListening||(document.addEventListener("keydown",this.f6Handler,{capture:!0}),document.addEventListener("focusin",this.focusinHandler,{capture:!0}),document.addEventListener("focusout",this.focusoutHandler,{capture:!0}),this.isListening=!0)}teardownIfNeeded(){!this.isListening||this.landmarks.length>0||this.refCount>0||(document.removeEventListener("keydown",this.f6Handler,{capture:!0}),document.removeEventListener("focusin",this.focusinHandler,{capture:!0}),document.removeEventListener("focusout",this.focusoutHandler,{capture:!0}),this.isListening=!1)}focusLandmark(e,n){var i,a;(a=this.landmarks.find(s=>s.ref.current===e))===null||a===void 0||(i=a.focus)===null||i===void 0||i.call(a,n)}getLandmarksByRole(e){return new Set(this.landmarks.filter(n=>n.role===e))}getLandmarkByRole(e){return this.landmarks.find(n=>n.role===e)}addLandmark(e){if(this.setupIfNeeded(),this.landmarks.find(a=>a.ref===e.ref)||!e.ref.current)return;if(this.landmarks.filter(a=>a.role==="main").length>1,this.landmarks.length===0){this.landmarks=[e],this.checkLabels(e.role);return}let n=0,i=this.landmarks.length-1;for(;n<=i;){let a=Math.floor((n+i)/2),s=e.ref.current.compareDocumentPosition(this.landmarks[a].ref.current);!!(s&Node.DOCUMENT_POSITION_PRECEDING||s&Node.DOCUMENT_POSITION_CONTAINS)?n=a+1:i=a-1}this.landmarks.splice(n,0,e),this.checkLabels(e.role)}updateLandmark(e){let n=this.landmarks.findIndex(i=>i.ref===e.ref);n>=0&&(this.landmarks[n]={...this.landmarks[n],...e},this.checkLabels(this.landmarks[n].role))}removeLandmark(e){this.landmarks=this.landmarks.filter(n=>n.ref!==e),this.teardownIfNeeded()}checkLabels(e){let n=this.getLandmarksByRole(e);n.size>1&&[...n].filter(i=>!i.label)}closestLandmark(e){let n=new Map(this.landmarks.map(a=>[a.ref.current,a])),i=e;for(;i&&!n.has(i)&&i!==document.body&&i.parentElement;)i=i.parentElement;return n.get(i)}getNextLandmark(e,{backward:n}){var i;let a=this.closestLandmark(e),s=n?this.landmarks.length-1:0;a&&(s=this.landmarks.indexOf(a)+(n?-1:1));let r=()=>{if(s<0){if(!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation",{detail:{direction:"backward"},bubbles:!0,cancelable:!0})))return!0;s=this.landmarks.length-1}else if(s>=this.landmarks.length){if(!e.dispatchEvent(new CustomEvent("react-aria-landmark-navigation",{detail:{direction:"forward"},bubbles:!0,cancelable:!0})))return!0;s=0}return s<0||s>=this.landmarks.length};if(r())return;let o=s;for(;!((i=this.landmarks[s].ref.current)===null||i===void 0)&&i.closest("[aria-hidden=true]");){if(s+=n?-1:1,r())return;if(s===o)break}return this.landmarks[s]}f6Handler(e){e.key==="F6"&&(e.altKey?this.focusMain():this.navigate(e.target,e.shiftKey))&&(e.preventDefault(),e.stopPropagation())}focusMain(){let e=this.getLandmarkByRole("main");return e&&e.ref.current&&document.contains(e.ref.current)?(this.focusLandmark(e.ref.current,"forward"),!0):!1}navigate(e,n){let i=this.getNextLandmark(e,{backward:n});if(!i)return!1;if(i.lastFocused){let a=i.lastFocused;if(document.body.contains(a))return a.focus(),!0}return i.ref.current&&document.contains(i.ref.current)?(this.focusLandmark(i.ref.current,n?"backward":"forward"),!0):!1}focusinHandler(e){let n=this.closestLandmark(e.target);n&&n.ref.current!==e.target&&this.updateLandmark({ref:n.ref,lastFocused:e.target});let i=e.relatedTarget;if(i){let a=this.closestLandmark(i);a&&a.ref.current===i&&a.blur()}}focusoutHandler(e){let n=e.target,i=e.relatedTarget;if(!i||i===document){let a=this.closestLandmark(n);a&&a.ref.current===n&&a.blur()}}createLandmarkController(){let e=this;return e.refCount++,e.setupIfNeeded(),{navigate(n,i){let a=i?.from||document.activeElement;return e.navigate(a,n==="backward")},focusNext(n){let i=n?.from||document.activeElement;return e.navigate(i,!1)},focusPrevious(n){let i=n?.from||document.activeElement;return e.navigate(i,!0)},focusMain(){return e.focusMain()},dispose(){e&&(e.refCount--,e.teardownIfNeeded(),e=null)}}}registerLandmark(e){return this.landmarks.find(n=>n.ref===e.ref)?this.updateLandmark(e):this.addLandmark(e),()=>this.removeLandmark(e.ref)}constructor(){this.landmarks=[],this.isListening=!1,this.refCount=0,this.version=zV,this.f6Handler=this.f6Handler.bind(this),this.focusinHandler=this.focusinHandler.bind(this),this.focusoutHandler=this.focusoutHandler.bind(this)}}function soe(t,e){const{role:n,"aria-label":i,"aria-labelledby":a,focus:s}=t;let r=ioe(),o=i||a,[c,u]=P.useState(!1),h=P.useCallback(()=>{u(!0)},[u]),d=P.useCallback(()=>{u(!1)},[u]);return Hi(()=>{if(r)return r.registerLandmark({ref:e,label:o,role:n,focus:s||h,blur:d})},[r,o,e,n,s,h,d]),P.useEffect(()=>{var p;c&&((p=e.current)===null||p===void 0||p.focus())},[c,e]),{landmarkProps:{role:n,tabIndex:c?-1:void 0,"aria-label":i,"aria-labelledby":a}}}function roe(t){return t&&t.__esModule?t.default:t}function ooe(t,e,n){let i=Qg(roe(yA),"@react-aria/toast"),{landmarkProps:a}=soe({role:"region","aria-label":t["aria-label"]||i.format("notifications",{count:e.visibleToasts.length})},n),s=P.useRef(!1),r=P.useRef(!1),o=xa(()=>{s.current||r.current?e.pauseAll():e.resumeAll()}),{hoverProps:c}=Qa({onHoverStart:()=>{s.current=!0,o()},onHoverEnd:()=>{s.current=!1,o()}}),u=P.useRef([]),h=P.useRef(e.visibleToasts),d=P.useRef(null);Hi(()=>{if(d.current===-1||e.visibleToasts.length===0||!n.current){u.current=[],h.current=e.visibleToasts;return}if(u.current=[...n.current.querySelectorAll('[role="alertdialog"]')],h.current.length===e.visibleToasts.length&&e.visibleToasts.every((S,M)=>S.key===h.current[M].key)){h.current=e.visibleToasts;return}let b=h.current.map((S,M)=>({...S,i:M,isRemoved:!e.visibleToasts.some(C=>S.key===C.key)})),w=b.findIndex(S=>S.i===d.current&&S.isRemoved);if(w>-1){var x;if(Ff()==="pointer"&&(!((x=p.current)===null||x===void 0)&&x.isConnected))or(p.current);else{let S=0,M,C;for(;S<=w;)b[S].isRemoved||(C=Math.max(0,S-1)),S++;for(;S<b.length;){if(!b[S].isRemoved){M=S-1;break}S++}C===void 0&&M===void 0&&(C=0),C>=0&&C<u.current.length?or(u.current[C]):M>=0&&M<u.current.length&&or(u.current[M])}}h.current=e.visibleToasts},[e.visibleToasts,n,o]);let p=P.useRef(null),{focusWithinProps:g}=Rd({onFocusWithin:b=>{r.current=!0,p.current=b.relatedTarget,o()},onBlurWithin:()=>{r.current=!1,p.current=null,o()}});return P.useEffect(()=>{var b;e.visibleToasts.length===0&&(!((b=p.current)===null||b===void 0)&&b.isConnected)&&(Ff()==="pointer"?or(p.current):p.current.focus(),p.current=null)},[n,e.visibleToasts.length]),P.useEffect(()=>()=>{var b;!((b=p.current)===null||b===void 0)&&b.isConnected&&(Ff()==="pointer"?or(p.current):p.current.focus(),p.current=null)},[n]),{regionProps:ci(a,c,g,{tabIndex:-1,"data-react-aria-top-layer":!0,onFocus:b=>{let w=b.target.closest('[role="alertdialog"]');d.current=u.current.findIndex(x=>x===w)},onBlur:()=>{d.current=-1}})}}var UE=100,jE=20;function loe(t){var e,n;const[i,a]=gr(t,MP.variantKeys),{ref:s,as:r,title:o,description:c,className:u,classNames:h,toast:d,endContent:p,closeIcon:g,hideIcon:b=!1,placement:w="bottom-right",isRegionExpanded:x,hideCloseButton:S=!1,state:M,total:C=1,index:A=0,heights:N,promise:R,setHeights:D,toastOffset:B=0,motionProps:z,timeout:I=6e3,shouldShowTimeoutProgress:U=!1,icon:$,onClose:G,severity:k,maxVisibleToasts:X,loadingComponent:V,isClosing:H=!1,...W}=i,{isHovered:J,hoverProps:Y}=Qa({isDisabled:!1}),K=fa(),ee=(n=(e=t?.disableAnimation)!=null?e:K?.disableAnimation)!=null?n:!1,ie=vj();let Z=w;ie&&(w.includes("top")?Z="top-center":Z="bottom-center");const ue=P.useRef(null),se=P.useRef(null),ae=P.useRef(0),ce=P.useRef(null),pe=P.useRef(0),ye=P.useRef(0);P.useEffect(()=>{ce.current&&(ce.current.style.width="0%")},[]);const[_e,me]=P.useState(!!R),[ne,be]=P.useState(!1),xe=P.useRef(!1);P.useEffect(()=>{R&&R.finally(()=>{me(!1)})},[R]),P.useEffect(()=>{H&&!ne&&be(!0)},[H,ne]),P.useEffect(()=>{ne&&ee&&(M.close(d.key),xe.current||(xe.current=!0,G?.()))},[ne,ee,M,d.key,G]),P.useEffect(()=>{const Se=De=>{if(!I||_e)return;if(se.current===null&&(se.current=De),J||x){pe.current+=De-se.current,se.current=null,ue.current=requestAnimationFrame(Se);return}const lt=De-se.current+pe.current;ye.current=lt,ye.current>=I&&be(!0),ae.current=Math.min(lt/I*100,100),ce.current&&(ce.current.style.width=`${U?ae.current:0}%`),ae.current<100&&(ue.current=requestAnimationFrame(Se))};return ue.current=requestAnimationFrame(Se),()=>{ue.current!==null&&cancelAnimationFrame(ue.current)}},[I,U,M,J,A,C,x,_e,be]);const he=r||"div",ve=_i(s),Oe=Vt(u,h?.base),{toastProps:Le,contentProps:Ae,titleProps:et,descriptionProps:tt}=eoe(i,M),[re,te]=P.useState(!1);P.useEffect(()=>{te(!0)},[]);const[we,Ce]=P.useState(0);P.useLayoutEffect(()=>{if(!ve.current||!re||ne)return;const Se=ve.current,De=Se.style.height;Se.style.height="auto";const lt=getComputedStyle(Se),rt=parseFloat(lt.marginTop),Bt=parseFloat(lt.marginBottom),Ut=Se.getBoundingClientRect().height+rt+Bt;Se.style.height=De,Ce(ot=>ot!==Ut?Ut:ot);const Dt=[...N];Dt.length>A?Dt[A]=Ut:Dt.push(Ut),D(Dt)},[re,C,D,A,ne]);let Ie=4;for(let Se=A+1;Se<C;Se++)Ie+=N[Se]||0;const Pe=N[N.length-1],Ze=P.useMemo(()=>MP({...a,disableAnimation:ee}),[ks(a)]),We=Z.includes("top")?1:-1,mt={hidden:{opacity:0,y:-50*We},visible:{opacity:1,y:0},exit:{opacity:0,y:-50*We}},[nt,Ye]=P.useState(!1),[Je,jt]=P.useState(0),wt=(Se,De)=>{const lt=Z.includes("right"),rt=Z.includes("left"),Bt=Z==="top-center",Ut=Z==="bottom-center";if(lt&&Se>=UE||rt&&Se<=-UE||Bt&&De<=-jE||Ut&&De>=jE)return!0},Et=Se=>{const De={top:0,bottom:0,right:0,left:0};return Se==="bottom-center"?(De.bottom=1,De):Se==="top-center"?(De.top=1,De):Se.includes("right")?(De.right=1,De):Se.includes("left")?(De.left=1,De):(De.left=1,De.right=1,De)};let zt;nt&&Z==="bottom-center"||Z==="top-center"?zt=Math.max(0,1-Je/(jE+5)):nt&&(zt=Math.max(0,1-Je/(UE+20)));const Te=P.useCallback((Se={})=>{const rt={"--top-extension":"16px","--bottom-extension":"16px"};return{ref:ve,className:Ze.base({class:Vt(Oe,h?.base)}),"data-has-title":He(!Xb(o)),"data-has-description":He(!Xb(c)),"data-placement":Z,"data-drag-value":Je,"data-toast":!0,"aria-label":"toast","data-toast-exiting":He(ne),onTransitionEnd:ee?void 0:()=>{ne&&(M.close(d.key),xe.current||(xe.current=!0,G?.()))},style:{opacity:zt,...rt},...Yt(Se,W,Le,Y)}},[Ze,h,Le,Y,d,d.key,zt,ne,M,d.key,ee]),pt=P.useCallback((Se={})=>({className:Ze.wrapper({class:h?.wrapper}),...Se}),[]),at=P.useCallback((Se={})=>({"aria-label":"descriptionIcon",className:Ze.icon({class:h?.icon}),...Se}),[]),St=P.useCallback((Se={})=>({className:Ze.loadingComponent({class:h?.loadingComponent}),"aria-label":"loadingIcon",color:"current",...Se}),[]),ct=P.useCallback((Se={})=>({classNames:{wrapper:Ze.loadingComponent({class:h?.loadingComponent})},"aria-label":"loadingIcon",color:"current",...Se}),[]),it=P.useCallback((Se={})=>({className:Ze.content({class:h?.content}),...Yt(Se,W,Ae)}),[Ae]),Nt=P.useCallback((Se={})=>({className:Ze.title({class:h?.title}),...Yt(Se,W,et)}),[et]),kt=P.useCallback((Se={})=>({className:Ze.description({class:h?.description}),...Yt(Se,W,tt)}),[tt]),Xt=P.useCallback((Se={})=>({className:Ze.closeButton({class:h?.closeButton}),"aria-label":"closeButton","data-hidden":He(S),...Yt(Se,{onPress:()=>{be(!0),xe.current||(xe.current=!0,G?.()),setTimeout(()=>document.body.focus(),0)}})}),[be,G]),rn=P.useCallback((Se={})=>({className:Ze.closeIcon({class:h?.closeIcon}),"aria-label":"closeIcon",...Se}),[]),ge=P.useCallback((Se={})=>{const De=x?X-1:Math.min(2,X-1),lt=C-A-1<=De,rt=Z==="bottom-center"||Z==="top-center"?"y":"x",Bt={left:0,right:0,top:0,bottom:0},Ut=Et(Z),Dt=Z.includes("top")?{top:x||nt?Ie+B:(C-1-A)*8+B,bottom:"auto"}:Z.includes("bottom")?{bottom:x||nt?Ie+B:(C-1-A)*8+B,top:"auto"}:{};return{animate:{opacity:lt?1:0,pointerEvents:lt?"all":"none",scaleX:x||nt?1:1-(C-1-A)*.1,height:x||nt?we:Pe,y:0,...Dt},drag:rt,dragConstraints:Bt,exit:{opacity:0,transition:{duration:.3}},initial:{opacity:0,scale:1,y:-40*We},transition:{duration:.3,ease:"easeOut"},variants:mt,dragElastic:Ut,onDragEnd:(ot,Lt)=>{const{x:vt,y:Ot}=Lt.offset;if(Ye(!1),wt(vt,Ot)){be(!0);return}jt(0)},onDrag:(ot,Lt)=>{let vt=0;Z==="top-center"?vt=-Lt.offset.y:Z==="bottom-center"?vt=Lt.offset.y:Z.includes("right")?vt=Lt.offset.x:Z.includes("left")&&(vt=-Lt.offset.x),vt>=0&&jt(vt)},onDragStart:()=>{Ye(!0)},"data-drag":He(nt),"data-placement":Z,"data-drag-value":Je,className:Ze.motionDiv({class:h?.motionDiv}),...Se,...z}},[C,A,Z,x,ne,Ie,We,we,Pe,mt,h,nt,He,Ye,wt,Ze,B,X]);return{Component:he,title:o,description:c,icon:$,loadingComponent:V,domRef:ve,severity:k,closeIcon:g,classNames:h,color:a.color,hideIcon:b,placement:Z,state:M,toast:d,disableAnimation:ee,isProgressBarVisible:!!I,total:C,index:A,getWrapperProps:pt,getToastProps:Te,getTitleProps:Nt,getContentProps:it,getDescriptionProps:kt,getCloseButtonProps:Xt,getIconProps:at,getMotionDivProps:ge,getCloseIconProps:rn,getLoadingComponentProps:St,getSpinnerComponentProps:ct,progressBarRef:ce,endContent:p,slots:Ze,isRegionExpanded:x,liftHeight:Ie,frontHeight:Pe,initialHeight:we,isLoading:_e}}var coe=()=>bu(()=>import("./src-UW24ZMRV-D5IQgZfI.js"),__vite__mapDeps([2,1]),import.meta.url).then(t=>t.default),BV=t=>{const{ripples:e=[],motionProps:n,color:i="currentColor",style:a,onClear:s}=t;return _.jsx(_.Fragment,{children:e.map(r=>{const o=dO(.01*r.size,.2,r.size>100?.75:.5);return _.jsx(Al,{features:coe,children:_.jsx(Hs,{mode:"popLayout",children:_.jsx(Rl.span,{animate:{transform:"scale(2)",opacity:0},className:"heroui-ripple",exit:{opacity:0},initial:{transform:"scale(0)",opacity:.35},style:{position:"absolute",backgroundColor:i,borderRadius:"100%",transformOrigin:"center",pointerEvents:"none",overflow:"hidden",inset:0,zIndex:0,top:r.y,left:r.x,width:`${r.size}px`,height:`${r.size}px`,...a},transition:{duration:o},onAnimationComplete:()=>{s(r.key)},...n})})},r.key)})})};BV.displayName="HeroUI.Ripple";var uoe=BV;function doe(t={}){const[e,n]=P.useState([]),i=P.useCallback(s=>{const r=s.target,o=Math.max(r.clientWidth,r.clientHeight);n(c=>[...c,{key:uO(c.length.toString()),size:o,x:s.x-o/2,y:s.y-o/2}])},[]),a=P.useCallback(s=>{n(r=>r.filter(o=>o.key!==s))},[]);return{ripples:e,onClear:a,onPress:i,...t}}var i5=new Map;typeof FinalizationRegistry<"u"&&new FinalizationRegistry(t=>{i5.delete(t)});function foe(t,e){if(t===e)return t;let n=i5.get(t);if(n)return n.forEach(a=>a.current=e),e;let i=i5.get(e);return i?(i.forEach(a=>a.current=t),t):e}function hoe(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}function UV(t){var e,n,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var a=t.length;for(e=0;e<a;e++)t[e]&&(n=UV(t[e]))&&(i&&(i+=" "),i+=n)}else for(n in t)t[n]&&(i&&(i+=" "),i+=n);return i}function poe(){for(var t,e,n=0,i="",a=arguments.length;n<a;n++)(t=arguments[n])&&(e=UV(t))&&(i&&(i+=" "),i+=e);return i}var moe=poe;function hD(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let i=t[n];for(let a in i){let s=e[a],r=i[a];typeof s=="function"&&typeof r=="function"&&a[0]==="o"&&a[1]==="n"&&a.charCodeAt(2)>=65&&a.charCodeAt(2)<=90?e[a]=hoe(s,r):(a==="className"||a==="UNSAFE_className")&&typeof s=="string"&&typeof r=="string"?e[a]=moe(s,r):a==="id"&&s&&r?e.id=foe(s,r):e[a]=r!==void 0?r:s}}return e}var goe=new Set(["id"]),voe=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),yoe=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),boe=new Set(["dir","lang","hidden","inert","translate"]),pD=new Set(["onClick","onAuxClick","onContextMenu","onDoubleClick","onMouseDown","onMouseEnter","onMouseLeave","onMouseMove","onMouseOut","onMouseOver","onMouseUp","onTouchCancel","onTouchEnd","onTouchMove","onTouchStart","onPointerDown","onPointerMove","onPointerUp","onPointerCancel","onPointerEnter","onPointerLeave","onPointerOver","onPointerOut","onGotPointerCapture","onLostPointerCapture","onScroll","onWheel","onAnimationStart","onAnimationEnd","onAnimationIteration","onTransitionCancel","onTransitionEnd","onTransitionRun","onTransitionStart"]),xoe=/^(data-.*)$/;function _oe(t,e={}){let{labelable:n,isLink:i,global:a,events:s=a,propNames:r}=e,o={};for(const c in t)Object.prototype.hasOwnProperty.call(t,c)&&(goe.has(c)||n&&voe.has(c)||i&&yoe.has(c)||a&&boe.has(c)||s&&pD.has(c)||c.endsWith("Capture")&&pD.has(c.slice(0,-7))||r?.has(c)||xoe.test(c))&&(o[c]=t[c]);return o}function Soe(t={}){let{autoFocus:e=!1,isTextInput:n,within:i}=t,a=P.useRef({isFocused:!1,isFocusVisible:e||Og()}),[s,r]=P.useState(!1),[o,c]=P.useState(()=>a.current.isFocused&&a.current.isFocusVisible),u=P.useCallback(()=>c(a.current.isFocused&&a.current.isFocusVisible),[]),h=P.useCallback(g=>{a.current.isFocused=g,r(g),u()},[u]);Mz(g=>{a.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:d}=cw({isDisabled:i,onFocusChange:h}),{focusWithinProps:p}=Rd({isDisabled:!i,onFocusWithinChange:h});return{isFocused:s,isFocusVisible:o,focusProps:i?p:d}}function woe(t,e){let{elementType:n="button",isDisabled:i,onPress:a,onPressStart:s,onPressEnd:r,onPressUp:o,onPressChange:c,preventFocusOnPress:u,allowFocusWhenDisabled:h,onClick:d,href:p,target:g,rel:b,type:w="button",allowTextSelectionOnPress:x}=t,S;n==="button"?S={type:w,disabled:i}:S={role:"button",href:n==="a"&&!i?p:void 0,target:n==="a"?g:void 0,type:n==="input"?w:void 0,disabled:n==="input"?i:void 0,"aria-disabled":!i||n==="input"?void 0:i,rel:n==="a"?b:void 0};let{pressProps:M,isPressed:C}=bo({onClick:d,onPressStart:s,onPressEnd:r,onPressUp:o,onPressChange:c,onPress:a,isDisabled:i,preventFocusOnPress:u,allowTextSelectionOnPress:x,ref:e}),{focusableProps:A}=hm(t,e);h&&(A.tabIndex=i?-1:A.tabIndex);let N=hD(A,M,_oe(t,{labelable:!0}));return{isPressed:C,buttonProps:hD(S,N,{"aria-haspopup":t["aria-haspopup"],"aria-expanded":t["aria-expanded"],"aria-controls":t["aria-controls"],"aria-pressed":t["aria-pressed"],"aria-current":t["aria-current"]})}}var[D_e,Eoe]=ih({name:"ButtonGroupContext",strict:!1});function Moe(t){var e,n,i,a,s,r,o,c,u;const h=Eoe(),d=fa(),p=!!h,{ref:g,as:b,children:w,startContent:x,endContent:S,autoFocus:M,className:C,spinner:A,isLoading:N=!1,disableRipple:R=!1,fullWidth:D=(e=h?.fullWidth)!=null?e:!1,radius:B=h?.radius,size:z=(n=h?.size)!=null?n:"md",color:I=(i=h?.color)!=null?i:"default",variant:U=(a=h?.variant)!=null?a:"solid",disableAnimation:$=(r=(s=h?.disableAnimation)!=null?s:d?.disableAnimation)!=null?r:!1,isDisabled:G=(o=h?.isDisabled)!=null?o:!1,isIconOnly:k=(c=h?.isIconOnly)!=null?c:!1,spinnerPlacement:X="start",onPress:V,onClick:H,...W}=t,J=b||"button",Y=typeof J=="string",K=_i(g),ee=(u=R||d?.disableRipple)!=null?u:$,{isFocusVisible:ie,isFocused:Z,focusProps:ue}=Soe({autoFocus:M}),se=G||N,ae=P.useMemo(()=>IB({size:z,color:I,variant:U,radius:B,fullWidth:D,isDisabled:se,isInGroup:p,disableAnimation:$,isIconOnly:k,className:C}),[z,I,U,B,D,se,p,k,$,C]),{onPress:ce,onClear:pe,ripples:ye}=doe(),_e=P.useCallback(tt=>{ee||se||$||K.current&&ce(tt)},[ee,se,$,K,ce]),{buttonProps:me,isPressed:ne}=woe({elementType:b,isDisabled:se,onPress:$r(V,_e),onClick:H,...W},K),{isHovered:be,hoverProps:xe}=Qa({isDisabled:se}),he=P.useCallback((tt={})=>({"data-disabled":He(se),"data-focus":He(Z),"data-pressed":He(ne),"data-focus-visible":He(ie),"data-hover":He(be),"data-loading":He(N),...Yt(me,ue,xe,cs(W,{enabled:Y}),cs(tt)),className:ae}),[N,se,Z,ne,Y,ie,be,me,ue,xe,W,ae]),ve=tt=>P.isValidElement(tt)?P.cloneElement(tt,{"aria-hidden":!0,focusable:!1}):null,Oe=ve(x),Le=ve(S),Ae=P.useMemo(()=>({sm:"sm",md:"sm",lg:"md"})[z],[z]),et=P.useCallback(()=>({ripples:ye,onClear:pe}),[ye,pe]);return{Component:J,children:w,domRef:K,spinner:A,styles:ae,startContent:Oe,endContent:Le,isLoading:N,spinnerPlacement:X,spinnerSize:Ae,disableRipple:ee,getButtonProps:he,getRippleProps:et,isIconOnly:k}}var jV=Si((t,e)=>{const{Component:n,domRef:i,children:a,spinnerSize:s,spinner:r=_.jsx(Yf,{color:"current",size:s}),spinnerPlacement:o,startContent:c,endContent:u,isLoading:h,disableRipple:d,getButtonProps:p,getRippleProps:g,isIconOnly:b}=Moe({...t,ref:e});return _.jsxs(n,{ref:i,...p(),children:[c,h&&o==="start"&&r,h&&b?null:a,h&&o==="end"&&r,u,!d&&_.jsx(uoe,{...g()})]})});jV.displayName="HeroUI.Button";var Toe=jV,FE={default:RE,primary:RE,secondary:RE,success:qie,warning:Yie,danger:Qie},FV=Si((t,e)=>{const{severity:n,Component:i,icon:a,loadingComponent:s,domRef:r,endContent:o,color:c,hideIcon:u,closeIcon:h,disableAnimation:d,progressBarRef:p,classNames:g,slots:b,getWrapperProps:w,isProgressBarVisible:x,getToastProps:S,getContentProps:M,getTitleProps:C,getDescriptionProps:A,getCloseButtonProps:N,getIconProps:R,getMotionDivProps:D,getCloseIconProps:B,getLoadingComponentProps:z,getSpinnerComponentProps:I,isLoading:U}=loe({...t,ref:e}),$=typeof a=="function"?a(R()):P.isValidElement(a)&&P.cloneElement(a,R()),G=n?FE[n]:FE[c]||FE.default,k=s&&P.isValidElement(s)?P.cloneElement(s,z()):null,X=U?k||_.jsx(Yf,{...I()}):null,V=typeof h=="function"?h({}):P.isValidElement(h)&&P.cloneElement(h,{}),H=_.jsxs(i,{ref:r,...S(),children:[_.jsxs("div",{...M(),children:[u&&!U?null:X||$||_.jsx(G,{...R()}),_.jsxs("div",{...w(),children:[_.jsx("div",{...C(),children:t.toast.content.title}),_.jsx("div",{...A(),children:t.toast.content.description})]})]}),x&&_.jsx("div",{className:b.progressTrack({class:g?.progressTrack}),children:_.jsx("div",{ref:p,className:b.progressIndicator({class:g?.progressIndicator})})}),_.jsx(Toe,{isIconOnly:!0,...N(),children:V||_.jsx(HB,{...B()})}),o]});return _.jsx(_.Fragment,{children:d?H:_.jsx(Rl.div,{...D(),children:H})})});FV.displayName="HeroUI.Toast";var Coe=FV;function Aoe(t){let e=P.useCallback(a=>t.subscribe(a),[t]),n=P.useCallback(()=>t.visibleToasts,[t]);return{visibleToasts:IV.useSyncExternalStore(e,n,n),add:(a,s)=>t.add(a,s),close:a=>t.close(a),pauseAll:()=>t.pauseAll(),resumeAll:()=>t.resumeAll()}}class Roe{runWithWrapUpdate(e,n){this.wrapUpdate?this.wrapUpdate(e,n):e()}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}add(e,n={}){let i="_"+Math.random().toString(36).slice(2),a={...n,content:e,key:i,timer:n.timeout?new Noe(()=>this.close(i),n.timeout):void 0};return this.queue.unshift(a),this.updateVisibleToasts("add"),i}close(e){let n=this.queue.findIndex(s=>s.key===e);if(n>=0){var i,a;(i=(a=this.queue[n]).onClose)===null||i===void 0||i.call(a),this.queue.splice(n,1)}this.updateVisibleToasts("remove")}updateVisibleToasts(e){this.visibleToasts=this.queue.slice(0,this.maxVisibleToasts),this.runWithWrapUpdate(()=>{for(let n of this.subscriptions)n()},e)}pauseAll(){for(let e of this.visibleToasts)e.timer&&e.timer.pause()}resumeAll(){for(let e of this.visibleToasts)e.timer&&e.timer.resume()}clear(){this.queue=[],this.updateVisibleToasts("clear")}constructor(e){this.queue=[],this.subscriptions=new Set,this.visibleToasts=[];var n;this.maxVisibleToasts=(n=e?.maxVisibleToasts)!==null&&n!==void 0?n:1/0,this.wrapUpdate=e?.wrapUpdate}}class Noe{reset(e){this.remaining=e,this.resume()}pause(){this.timerId!=null&&(clearTimeout(this.timerId),this.timerId=null,this.remaining-=Date.now()-this.startTime)}resume(){this.remaining<=0||(this.startTime=Date.now(),this.timerId=setTimeout(()=>{this.timerId=null,this.remaining=0,this.callback()},this.remaining))}constructor(e,n){this.startTime=null,this.remaining=n,this.callback=e}}var Poe=()=>bu(()=>import("./index-CoCPE5d4.js"),__vite__mapDeps([3,1]),import.meta.url).then(t=>t.domMax),Pb=null,Doe=()=>(Pb||(Pb=new Roe({maxVisibleToasts:1/0})),Pb),Loe=({placement:t="bottom-right",disableAnimation:e=!1,maxVisibleToasts:n=3,toastOffset:i=0,toastProps:a={},regionProps:s})=>{var r;const o=Aoe(Doe()),c=fa(),u=(r=e??c?.disableAnimation)!=null?r:!1;return _.jsx(Al,{features:Poe,children:o.visibleToasts.length>0&&_.jsx(zoe,{disableAnimation:u,maxVisibleToasts:n,placement:t,toastOffset:i,toastProps:a,toastQueue:o,...s})})},a5=({...t})=>Pb?Pb.add(t):null,Ooe=new Map,Ioe=t=>Ooe.has(t);function zoe({toastQueue:t,placement:e,disableAnimation:n,maxVisibleToasts:i,toastOffset:a,toastProps:s={},className:r,classNames:o,...c}){var u,h;const d=P.useRef(null),{regionProps:p}=ooe(c,t,d),{hoverProps:g,isHovered:b}=Qa({isDisabled:!1}),[w,x]=P.useState(!1),S=P.useMemo(()=>Cie({disableAnimation:n}),[n]),M=Vt(o?.base,r);P.useEffect(()=>{function D(B){d.current&&!d.current.contains(B.target)&&x(!1)}return document.addEventListener("touchstart",D),()=>{document.removeEventListener("touchstart",D)}},[]);const[C,A]=P.useState([]),N=(h=(u=t.visibleToasts)==null?void 0:u.length)!=null?h:0,R=P.useCallback(()=>{x(!0)},[]);return _.jsx("div",{...Yt(p,g),ref:d,className:S.base({class:M}),"data-placement":e,onTouchStart:R,children:_.jsx(Hs,{children:[...t.visibleToasts].reverse().map((D,B)=>{if(n&&N-B>i)return null;if(n||N-B<=4||b&&N-B<=i+1){const z=Ioe(D.key);return _.jsx(Coe,{state:t,toast:D,...Yt(s,D.content,{isClosing:z}),disableAnimation:n,heights:C,index:B,isRegionExpanded:b||w,maxVisibleToasts:i,placement:e,setHeights:A,toastOffset:a,total:N},D.key)}return null})})})}const Bg={};function VV(t){return"init"in t}function s5(t){return!!t.write}function mD(t){return"v"in t||"e"in t}function kS(t){if("e"in t)throw t.e;if((Bg?"production":void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v}const HS=new WeakMap;function kV(t){var e;return $S(t)&&!!((e=HS.get(t))!=null&&e[0])}function Boe(t){const e=HS.get(t);e?.[0]&&(e[0]=!1,e[1].forEach(n=>n()))}function r5(t,e){let n=HS.get(t);if(!n){n=[!0,new Set],HS.set(t,n);const i=()=>{n[0]=!1};t.then(i,i)}n[1].add(e)}function $S(t){return typeof t?.then=="function"}function HV(t,e,n){if(!n.p.has(t)){n.p.add(t);const i=()=>n.p.delete(t);e.then(i,i)}}function $V(t,e,n){var i;const a=new Set;for(const s of((i=n.get(t))==null?void 0:i.t)||[])n.has(s)&&a.add(s);for(const s of e.p)a.add(s);return a}const Uoe=(t,e,...n)=>e.read(...n),joe=(t,e,...n)=>e.write(...n),Foe=(t,e)=>{var n;return(n=e.unstable_onInit)==null?void 0:n.call(e,t)},Voe=(t,e,n)=>{var i;return(i=e.onMount)==null?void 0:i.call(e,n)},koe=(t,e)=>{const n=pr(t),i=n[0],a=n[9];if((Bg?"production":void 0)!=="production"&&!e)throw new Error("Atom is undefined or null");let s=i.get(e);return s||(s={d:new Map,p:new Set,n:0},i.set(e,s),a?.(t,e)),s},Hoe=t=>{const e=pr(t),n=e[1],i=e[3],a=e[4],s=e[5],r=e[6],o=e[13],c=[],u=h=>{try{h()}catch(d){c.push(d)}};do{r.f&&u(r.f);const h=new Set,d=h.add.bind(h);i.forEach(p=>{var g;return(g=n.get(p))==null?void 0:g.l.forEach(d)}),i.clear(),s.forEach(d),s.clear(),a.forEach(d),a.clear(),h.forEach(u),i.size&&o(t)}while(i.size||s.size||a.size);if(c.length)throw new AggregateError(c)},$oe=t=>{const e=pr(t),n=e[1],i=e[2],a=e[3],s=e[11],r=e[14],o=e[17],c=[],u=new WeakSet,h=new WeakSet,d=Array.from(a);for(;d.length;){const p=d[d.length-1],g=s(t,p);if(h.has(p)){d.pop();continue}if(u.has(p)){if(i.get(p)===g.n)c.push([p,g]);else if((Bg?"production":void 0)!=="production"&&i.has(p))throw new Error("[Bug] invalidated atom exists");h.add(p),d.pop();continue}u.add(p);for(const b of $V(p,g,n))u.has(b)||d.push(b)}for(let p=c.length-1;p>=0;--p){const[g,b]=c[p];let w=!1;for(const x of b.d.keys())if(x!==g&&a.has(x)){w=!0;break}w&&(r(t,g),o(t,g)),i.delete(g)}},Goe=(t,e)=>{var n,i;const a=pr(t),s=a[1],r=a[2],o=a[3],c=a[6],u=a[7],h=a[11],d=a[12],p=a[13],g=a[14],b=a[16],w=a[17],x=h(t,e);if(mD(x)&&(s.has(e)&&r.get(e)!==x.n||Array.from(x.d).every(([B,z])=>g(t,B).n===z)))return x;x.d.clear();let S=!0;function M(){s.has(e)&&(w(t,e),p(t),d(t))}function C(B){var z;if(B===e){const U=h(t,B);if(!mD(U))if(VV(B))GS(t,B,B.init);else throw new Error("no atom init");return kS(U)}const I=g(t,B);try{return kS(I)}finally{x.d.set(B,I.n),kV(x.v)&&HV(e,x.v,I),(z=s.get(B))==null||z.t.add(e),S||M()}}let A,N;const R={get signal(){return A||(A=new AbortController),A.signal},get setSelf(){return(Bg?"production":void 0)!=="production"&&!s5(e)&&console.warn("setSelf function cannot be used with read-only atom"),!N&&s5(e)&&(N=(...B)=>{if((Bg?"production":void 0)!=="production"&&S&&console.warn("setSelf function cannot be called in sync"),!S)try{return b(t,e,...B)}finally{p(t),d(t)}}),N}},D=x.n;try{const B=u(t,e,C,R);return GS(t,e,B),$S(B)&&(r5(B,()=>A?.abort()),B.then(M,M)),(n=c.r)==null||n.call(c,e),x}catch(B){return delete x.v,x.e=B,++x.n,x}finally{S=!1,D!==x.n&&r.get(e)===D&&(r.set(e,x.n),o.add(e),(i=c.c)==null||i.call(c,e))}},Woe=(t,e)=>{const n=pr(t),i=n[1],a=n[2],s=n[11],r=[e];for(;r.length;){const o=r.pop(),c=s(t,o);for(const u of $V(o,c,i)){const h=s(t,u);a.set(u,h.n),r.push(u)}}},GV=(t,e,...n)=>{const i=pr(t),a=i[3],s=i[6],r=i[8],o=i[11],c=i[12],u=i[13],h=i[14],d=i[15],p=i[17];let g=!0;const b=x=>kS(h(t,x)),w=(x,...S)=>{var M;const C=o(t,x);try{if(x===e){if(!VV(x))throw new Error("atom not writable");const A=C.n,N=S[0];GS(t,x,N),p(t,x),A!==C.n&&(a.add(x),(M=s.c)==null||M.call(s,x),d(t,x));return}else return GV(t,x,...S)}finally{g||(u(t),c(t))}};try{return r(t,e,b,w,...n)}finally{g=!1}},Koe=(t,e)=>{var n;const i=pr(t),a=i[1],s=i[3],r=i[6],o=i[11],c=i[15],u=i[18],h=i[19],d=o(t,e),p=a.get(e);if(p&&!kV(d.v)){for(const[g,b]of d.d)if(!p.d.has(g)){const w=o(t,g);u(t,g).t.add(e),p.d.add(g),b!==w.n&&(s.add(g),(n=r.c)==null||n.call(r,g),c(t,g))}for(const g of p.d||[])if(!d.d.has(g)){p.d.delete(g);const b=h(t,g);b?.t.delete(e)}}},WV=(t,e)=>{var n;const i=pr(t),a=i[1],s=i[4],r=i[6],o=i[10],c=i[11],u=i[12],h=i[13],d=i[14],p=i[16],g=c(t,e);let b=a.get(e);if(!b){d(t,e);for(const w of g.d.keys())WV(t,w).t.add(e);if(b={l:new Set,d:new Set(g.d.keys()),t:new Set},a.set(e,b),(n=r.m)==null||n.call(r,e),s5(e)){const w=()=>{let x=!0;const S=(...M)=>{try{return p(t,e,...M)}finally{x||(h(t),u(t))}};try{const M=o(t,e,S);M&&(b.u=()=>{x=!0;try{M()}finally{x=!1}})}finally{x=!1}};s.add(w)}}return b},Xoe=(t,e)=>{var n;const i=pr(t),a=i[1],s=i[5],r=i[6],o=i[11],c=i[19],u=o(t,e);let h=a.get(e);if(h&&!h.l.size&&!Array.from(h.t).some(d=>{var p;return(p=a.get(d))==null?void 0:p.d.has(e)})){h.u&&s.add(h.u),h=void 0,a.delete(e),(n=r.u)==null||n.call(r,e);for(const d of u.d.keys()){const p=c(t,d);p?.t.delete(e)}return}return h},GS=(t,e,n)=>{const i=pr(t)[11],a=i(t,e),s="v"in a,r=a.v;if($S(n))for(const o of a.d.keys())HV(e,n,i(t,o));a.v=n,delete a.e,(!s||!Object.is(r,a.v))&&(++a.n,$S(r)&&Boe(r))},qoe=(t,e)=>{const n=pr(t)[14];return kS(n(t,e))},Yoe=(t,e,...n)=>{const i=pr(t),a=i[12],s=i[13],r=i[16];try{return r(t,e,...n)}finally{s(t),a(t)}},Zoe=(t,e,n)=>{const i=pr(t),a=i[12],s=i[18],r=i[19],c=s(t,e).l;return c.add(n),a(t),()=>{c.delete(n),r(t,e),a(t)}},KV=new WeakMap,pr=t=>{const e=KV.get(t);if((Bg?"production":void 0)!=="production"&&!e)throw new Error("Store must be created by buildStore to read its building blocks");return e};function Qoe(...t){const e={get(i){const a=pr(e)[21];return a(e,i)},set(i,...a){const s=pr(e)[22];return s(e,i,...a)},sub(i,a){const s=pr(e)[23];return s(e,i,a)}},n=[new WeakMap,new WeakMap,new WeakMap,new Set,new Set,new Set,{},Uoe,joe,Foe,Voe,koe,Hoe,$oe,Goe,Woe,GV,Koe,WV,Xoe,GS,qoe,Yoe,Zoe,void 0].map((i,a)=>t[a]||i);return KV.set(e,Object.freeze(n)),e}const XV={};let Joe=0;function fs(t,e){const n=`atom${++Joe}`,i={toString(){return(XV?"production":void 0)!=="production"&&this.debugLabel?n+":"+this.debugLabel:n}};return typeof t=="function"?i.read=t:(i.init=t,i.read=ele,i.write=tle),e&&(i.write=e),i}function ele(t){return t(this)}function tle(t,e,n){return e(this,typeof n=="function"?n(t(this)):n)}function nle(){return Qoe()}let Yy;function ile(){return Yy||(Yy=nle(),(XV?"production":void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=Yy),globalThis.__JOTAI_DEFAULT_STORE__!==Yy&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),Yy}const ale={},sle=P.createContext(void 0);function qV(t){return P.useContext(sle)||ile()}const o5=t=>typeof t?.then=="function",l5=t=>{t.status||(t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e}))},rle=ft.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(l5(t),t)}),VE=new WeakMap,gD=(t,e)=>{let n=VE.get(t);return n||(n=new Promise((i,a)=>{let s=t;const r=u=>h=>{s===u&&i(h)},o=u=>h=>{s===u&&a(h)},c=()=>{try{const u=e();o5(u)?(VE.set(u,n),s=u,u.then(r(u),o(u)),r5(u,c)):i(u)}catch(u){a(u)}};t.then(r(t),o(t)),r5(t,c)}),VE.set(t,n)),n};function vi(t,e){const{delay:n,unstable_promiseStatus:i=!ft.use}={},a=qV(),[[s,r,o],c]=P.useReducer(h=>{const d=a.get(t);return Object.is(h[0],d)&&h[1]===a&&h[2]===t?h:[d,a,t]},void 0,()=>[a.get(t),a,t]);let u=s;if((r!==a||o!==t)&&(c(),u=a.get(t)),P.useEffect(()=>{const h=a.sub(t,()=>{if(i)try{const d=a.get(t);o5(d)&&l5(gD(d,()=>a.get(t)))}catch{}if(typeof n=="number"){setTimeout(c,n);return}c()});return c(),h},[a,t,n,i]),P.useDebugValue(u),o5(u)){const h=gD(u,()=>a.get(t));return i&&l5(h),rle(h)}return u}function Wr(t,e){const n=qV();return P.useCallback((...a)=>{if((ale?"production":void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return n.set(t,...a)},[n,t])}function pu(t,e){return[vi(t),Wr(t)]}const bA=()=>!window.invokeNative,YV={info:"primary",error:"danger",success:"success"};function qa(t,e="info"){if(bA()){a5({title:e.toUpperCase(),description:t,color:YV[e],shouldShowTimeoutProgress:!0,timeout:3e3,variant:"flat"});return}ut("notification",{message:t,type:e})}const ole=async t=>(ut("close"),await ut("select_point",t)),lle=async t=>(ut("close"),await ut("select_entity",t)),cle=window.GetParentResourceName?window.GetParentResourceName():"qs-advancedgarages";async function ut(t,e){if(bA())return await bu(()=>import("./mockNui-bzC9NbQj.js"),[],import.meta.url).then(n=>n.mockFetchNui(t,e));try{return await(await fetch(`https://${cle}/${t}`,{method:"post",headers:{"Content-Type":"application/json; charset=UTF-8"},body:JSON.stringify(e)})).json()}catch(n){throw Error(`Failed to fetch NUI callback ${t}! (${n})`)}}const Zf=fs({visible:!1,navigation:[],furniture:{},enableShop:!1}),xA=fs(!1),ZV=fs(""),r1=fs([]),ule=fs(null,(t,e,n)=>{const i=t(r1).map(a=>a.id===n.id?{...a,...n}:a);e(r1,i),n.id=void 0,ut("update_stash",n)}),_A=fs(void 0),SA=fs(!1),dle=fs(0),fle=fs(0),QV=fs(void 0),JV=fs(void 0),hle=fs("mgizmo");var ek={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},vD=ft.createContext&&ft.createContext(ek),ple=["attr","size","title"];function mle(t,e){if(t==null)return{};var n=gle(t,e),i,a;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(a=0;a<s.length;a++)i=s[a],!(e.indexOf(i)>=0)&&Object.prototype.propertyIsEnumerable.call(t,i)&&(n[i]=t[i])}return n}function gle(t,e){if(t==null)return{};var n={};for(var i in t)if(Object.prototype.hasOwnProperty.call(t,i)){if(e.indexOf(i)>=0)continue;n[i]=t[i]}return n}function WS(){return WS=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&(t[i]=n[i])}return t},WS.apply(this,arguments)}function yD(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(a){return Object.getOwnPropertyDescriptor(t,a).enumerable})),n.push.apply(n,i)}return n}function KS(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?yD(Object(n),!0).forEach(function(i){vle(t,i,n[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):yD(Object(n)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(n,i))})}return t}function vle(t,e,n){return e=yle(e),e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yle(t){var e=ble(t,"string");return typeof e=="symbol"?e:e+""}function ble(t,e){if(typeof t!="object"||!t)return t;var n=t[Symbol.toPrimitive];if(n!==void 0){var i=n.call(t,e);if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function tk(t){return t&&t.map((e,n)=>ft.createElement(e.tag,KS({key:n},e.attr),tk(e.child)))}function en(t){return e=>ft.createElement(xle,WS({attr:KS({},t.attr)},e),tk(t.child))}function xle(t){var e=n=>{var{attr:i,size:a,title:s}=t,r=mle(t,ple),o=a||n.size||"1em",c;return n.className&&(c=n.className),t.className&&(c=(c?c+" ":"")+t.className),ft.createElement("svg",WS({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,i,r,{className:c,style:KS(KS({color:t.color||n.color},n.style),t.style),height:o,width:o,xmlns:"http://www.w3.org/2000/svg"}),s&&ft.createElement("title",null,s),t.children)};return vD!==void 0?ft.createElement(vD.Consumer,null,n=>e(n)):e(ek)}function _le(t){return en({attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M31.7 239l136-136c9.4-9.4 24.6-9.4 33.9 0l22.6 22.6c9.4 9.4 9.4 24.6 0 33.9L127.9 256l96.4 96.4c9.4 9.4 9.4 24.6 0 33.9L201.7 409c-9.4 9.4-24.6 9.4-33.9 0l-136-136c-9.5-9.4-9.5-24.6-.1-34z"},child:[]}]})(t)}function Sle(t){return en({attr:{viewBox:"0 0 256 512"},child:[{tag:"path",attr:{d:"M224.3 273l-136 136c-9.4 9.4-24.6 9.4-33.9 0l-22.6-22.6c-9.4-9.4-9.4-24.6 0-33.9l96.4-96.4-96.4-96.4c-9.4-9.4-9.4-24.6 0-33.9L54.3 103c9.4-9.4 24.6-9.4 33.9 0l136 136c9.5 9.4 9.5 24.6.1 34z"},child:[]}]})(t)}function wle(t){return en({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M257.5 445.1l-22.2 22.2c-9.4 9.4-24.6 9.4-33.9 0L7 273c-9.4-9.4-9.4-24.6 0-33.9L201.4 44.7c9.4-9.4 24.6-9.4 33.9 0l22.2 22.2c9.5 9.5 9.3 25-.4 34.3L136.6 216H424c13.3 0 24 10.7 24 24v32c0 13.3-10.7 24-24 24H136.6l120.5 114.8c9.8 9.3 10 24.8.4 34.3z"},child:[]}]})(t)}function bD(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M352.201 425.775l-79.196 79.196c-9.373 9.373-24.568 9.373-33.941 0l-79.196-79.196c-15.119-15.119-4.411-40.971 16.971-40.97h51.162L228 284H127.196v51.162c0 21.382-25.851 32.09-40.971 16.971L7.029 272.937c-9.373-9.373-9.373-24.569 0-33.941L86.225 159.8c15.119-15.119 40.971-4.411 40.971 16.971V228H228V127.196h-51.23c-21.382 0-32.09-25.851-16.971-40.971l79.196-79.196c9.373-9.373 24.568-9.373 33.941 0l79.196 79.196c15.119 15.119 4.411 40.971-16.971 40.971h-51.162V228h100.804v-51.162c0-21.382 25.851-32.09 40.97-16.971l79.196 79.196c9.373 9.373 9.373 24.569 0 33.941L425.773 352.2c-15.119 15.119-40.971 4.411-40.97-16.971V284H284v100.804h51.23c21.382 0 32.09 25.851 16.971 40.971z"},child:[]}]})(t)}function nk(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M176 256c44.11 0 80-35.89 80-80s-35.89-80-80-80-80 35.89-80 80 35.89 80 80 80zm352-128H304c-8.84 0-16 7.16-16 16v144H64V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v352c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16v-48h512v48c0 8.84 7.16 16 16 16h32c8.84 0 16-7.16 16-16V240c0-61.86-50.14-112-112-112z"},child:[]}]})(t)}function Zp(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M509.5 184.6L458.9 32.8C452.4 13.2 434.1 0 413.4 0H272v192h238.7c-.4-2.5-.4-5-1.2-7.4zM240 0H98.6c-20.7 0-39 13.2-45.5 32.8L2.5 184.6c-.8 2.4-.8 4.9-1.2 7.4H240V0zM0 224v240c0 26.5 21.5 48 48 48h416c26.5 0 48-21.5 48-48V224H0z"},child:[]}]})(t)}function dc(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M499.99 176h-59.87l-16.64-41.6C406.38 91.63 365.57 64 319.5 64h-127c-46.06 0-86.88 27.63-103.99 70.4L71.87 176H12.01C4.2 176-1.53 183.34.37 190.91l6 24C7.7 220.25 12.5 224 18.01 224h20.07C24.65 235.73 16 252.78 16 272v48c0 16.12 6.16 30.67 16 41.93V416c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-32h256v32c0 17.67 14.33 32 32 32h32c17.67 0 32-14.33 32-32v-54.07c9.84-11.25 16-25.8 16-41.93v-48c0-19.22-8.65-36.27-22.07-48H494c5.51 0 10.31-3.75 11.64-9.09l6-24c1.89-7.57-3.84-14.91-11.65-14.91zm-352.06-17.83c7.29-18.22 24.94-30.17 44.57-30.17h127c19.63 0 37.28 11.95 44.57 30.17L384 208H128l19.93-49.83zM96 319.8c-19.2 0-32-12.76-32-31.9S76.8 256 96 256s48 28.71 48 47.85-28.8 15.95-48 15.95zm320 0c-19.2 0-48 3.19-48-15.95S396.8 256 416 256s32 12.76 32 31.9-12.8 31.9-32 31.9z"},child:[]}]})(t)}function Ele(t){return en({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M112 128c0-29.5 16.2-55 40-68.9V256h48V48h48v208h48V59.1c23.8 13.9 40 39.4 40 68.9v128h48V128C384 57.3 326.7 0 256 0h-64C121.3 0 64 57.3 64 128v128h48zm334.3 213.9l-10.7-32c-4.4-13.1-16.6-21.9-30.4-21.9H42.7c-13.8 0-26 8.8-30.4 21.9l-10.7 32C-5.2 362.6 10.2 384 32 384v112c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V384h256v112c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16V384c21.8 0 37.2-21.4 30.3-42.1z"},child:[]}]})(t)}function pm(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M173.898 439.404l-166.4-166.4c-9.997-9.997-9.997-26.206 0-36.204l36.203-36.204c9.997-9.998 26.207-9.998 36.204 0L192 312.69 432.095 72.596c9.997-9.997 26.207-9.997 36.204 0l36.203 36.204c9.997 9.997 9.997 26.206 0 36.204l-294.4 294.401c-9.998 9.997-26.207 9.997-36.204-.001z"},child:[]}]})(t)}function ik(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256,8C119,8,8,119,8,256S119,504,256,504,504,393,504,256,393,8,256,8Zm92.49,313h0l-20,25a16,16,0,0,1-22.49,2.5h0l-67-49.72a40,40,0,0,1-15-31.23V112a16,16,0,0,1,16-16h32a16,16,0,0,1,16,16V256l58,42.5A16,16,0,0,1,348.49,321Z"},child:[]}]})(t)}function o1(t){return en({attr:{viewBox:"0 0 288 512"},child:[{tag:"path",attr:{d:"M209.2 233.4l-108-31.6C88.7 198.2 80 186.5 80 173.5c0-16.3 13.2-29.5 29.5-29.5h66.3c12.2 0 24.2 3.7 34.2 10.5 6.1 4.1 14.3 3.1 19.5-2l34.8-34c7.1-6.9 6.1-18.4-1.8-24.5C238 74.8 207.4 64.1 176 64V16c0-8.8-7.2-16-16-16h-32c-8.8 0-16 7.2-16 16v48h-2.5C45.8 64-5.4 118.7.5 183.6c4.2 46.1 39.4 83.6 83.8 96.6l102.5 30c12.5 3.7 21.2 15.3 21.2 28.3 0 16.3-13.2 29.5-29.5 29.5h-66.3C100 368 88 364.3 78 357.5c-6.1-4.1-14.3-3.1-19.5 2l-34.8 34c-7.1 6.9-6.1 18.4 1.8 24.5 24.5 19.2 55.1 29.9 86.5 30v48c0 8.8 7.2 16 16 16h32c8.8 0 16-7.2 16-16v-48.2c46.6-.9 90.3-28.6 105.7-72.7 21.5-61.6-14.6-124.8-72.5-141.7z"},child:[]}]})(t)}function Mle(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 168v-16c0-13.255 10.745-24 24-24h360V80c0-21.367 25.899-32.042 40.971-16.971l80 80c9.372 9.373 9.372 24.569 0 33.941l-80 80C409.956 271.982 384 261.456 384 240v-48H24c-13.255 0-24-10.745-24-24zm488 152H128v-48c0-21.314-25.862-32.08-40.971-16.971l-80 80c-9.372 9.373-9.372 24.569 0 33.941l80 80C102.057 463.997 128 453.437 128 432v-48h360c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24z"},child:[]}]})(t)}function Tle(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M569.517 440.013C587.975 472.007 564.806 512 527.94 512H48.054c-36.937 0-59.999-40.055-41.577-71.987L246.423 23.985c18.467-32.009 64.72-31.951 83.154 0l239.94 416.028zM288 354c-25.405 0-46 20.595-46 46s20.595 46 46 46 46-20.595 46-46-20.595-46-46-46zm-43.673-165.346l7.418 136c.347 6.364 5.609 11.346 11.982 11.346h48.546c6.373 0 11.635-4.982 11.982-11.346l7.418-136c.375-6.874-5.098-12.654-11.982-12.654h-63.383c-6.884 0-12.356 5.78-11.981 12.654z"},child:[]}]})(t)}function Cle(t){return en({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M360 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24 0 90.965 51.016 167.734 120.842 192C75.016 280.266 24 357.035 24 448c-13.255 0-24 10.745-24 24v16c0 13.255 10.745 24 24 24h336c13.255 0 24-10.745 24-24v-16c0-13.255-10.745-24-24-24 0-90.965-51.016-167.734-120.842-192C308.984 231.734 360 154.965 360 64c13.255 0 24-10.745 24-24V24c0-13.255-10.745-24-24-24zm-75.078 384H99.08c17.059-46.797 52.096-80 92.92-80 40.821 0 75.862 33.196 92.922 80zm.019-256H99.078C91.988 108.548 88 86.748 88 64h208c0 22.805-3.987 44.587-11.059 64z"},child:[]}]})(t)}function Ale(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 8C119.043 8 8 119.083 8 256c0 136.997 111.043 248 248 248s248-111.003 248-248C504 119.083 392.957 8 256 8zm0 110c23.196 0 42 18.804 42 42s-18.804 42-42 42-42-18.804-42-42 18.804-42 42-42zm56 254c0 6.627-5.373 12-12 12h-88c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h12v-64h-12c-6.627 0-12-5.373-12-12v-24c0-6.627 5.373-12 12-12h64c6.627 0 12 5.373 12 12v100h12c6.627 0 12 5.373 12 12v24z"},child:[]}]})(t)}function ak(t){return en({attr:{viewBox:"0 0 384 512"},child:[{tag:"path",attr:{d:"M172.268 501.67C26.97 291.031 0 269.413 0 192 0 85.961 85.961 0 192 0s192 85.961 192 192c0 77.413-26.97 99.031-172.268 309.67-9.535 13.774-29.93 13.773-39.464 0zM192 272c44.183 0 80-35.817 80-80s-35.817-80-80-80-80 35.817-80 80 35.817 80 80 80z"},child:[]}]})(t)}function c5(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M621.16 54.46C582.37 38.19 543.55 32 504.75 32c-123.17-.01-246.33 62.34-369.5 62.34-30.89 0-61.76-3.92-92.65-13.72-3.47-1.1-6.95-1.62-10.35-1.62C15.04 79 0 92.32 0 110.81v317.26c0 12.63 7.23 24.6 18.84 29.46C57.63 473.81 96.45 480 135.25 480c123.17 0 246.34-62.35 369.51-62.35 30.89 0 61.76 3.92 92.65 13.72 3.47 1.1 6.95 1.62 10.35 1.62 17.21 0 32.25-13.32 32.25-31.81V83.93c-.01-12.64-7.24-24.6-18.85-29.47zM48 132.22c20.12 5.04 41.12 7.57 62.72 8.93C104.84 170.54 79 192.69 48 192.69v-60.47zm0 285v-47.78c34.37 0 62.18 27.27 63.71 61.4-22.53-1.81-43.59-6.31-63.71-13.62zM320 352c-44.19 0-80-42.99-80-96 0-53.02 35.82-96 80-96s80 42.98 80 96c0 53.03-35.83 96-80 96zm272 27.78c-17.52-4.39-35.71-6.85-54.32-8.44 5.87-26.08 27.5-45.88 54.32-49.28v57.72zm0-236.11c-30.89-3.91-54.86-29.7-55.81-61.55 19.54 2.17 38.09 6.23 55.81 12.66v48.89z"},child:[]}]})(t)}function Rle(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M204.3 5C104.9 24.4 24.8 104.3 5.2 203.4c-37 187 131.7 326.4 258.8 306.7 41.2-6.4 61.4-54.6 42.5-91.7-23.1-45.4 9.9-98.4 60.9-98.4h79.7c35.8 0 64.8-29.6 64.9-65.3C511.5 97.1 368.1-26.9 204.3 5zM96 320c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm32-128c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128-64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32zm128 64c-17.7 0-32-14.3-32-32s14.3-32 32-32 32 14.3 32 32-14.3 32-32 32z"},child:[]}]})(t)}function mm(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M505 442.7L405.3 343c-4.5-4.5-10.6-7-17-7H372c27.6-35.3 44-79.7 44-128C416 93.1 322.9 0 208 0S0 93.1 0 208s93.1 208 208 208c48.3 0 92.7-16.4 128-44v16.3c0 6.4 2.5 12.5 7 17l99.7 99.7c9.4 9.4 24.6 9.4 33.9 0l28.3-28.3c9.4-9.4 9.4-24.6.1-34zM208 336c-70.7 0-128-57.2-128-128 0-70.7 57.2-128 128-128 70.7 0 128 57.2 128 128 0 70.7-57.2 128-128 128z"},child:[]}]})(t)}function xD(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M466.5 83.7l-192-80a48.15 48.15 0 0 0-36.9 0l-192 80C27.7 91.1 16 108.6 16 128c0 198.5 114.5 335.7 221.5 380.3 11.8 4.9 25.1 4.9 36.9 0C360.1 472.6 496 349.3 496 128c0-19.4-11.7-36.9-29.5-44.3zM256.1 446.3l-.1-381 175.9 73.3c-3.3 151.4-82.1 261.1-175.8 307.7z"},child:[]}]})(t)}function _D(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.12 301.319l47.273-208C578.806 78.301 567.391 64 551.99 64H159.208l-9.166-44.81C147.758 8.021 137.93 0 126.529 0H24C10.745 0 0 10.745 0 24v16c0 13.255 10.745 24 24 24h69.883l70.248 343.435C147.325 417.1 136 435.222 136 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-15.674-6.447-29.835-16.824-40h209.647C430.447 426.165 424 440.326 424 456c0 30.928 25.072 56 56 56s56-25.072 56-56c0-22.172-12.888-41.332-31.579-50.405l5.517-24.276c3.413-15.018-8.002-29.319-23.403-29.319H218.117l-6.545-32h293.145c11.206 0 20.92-7.754 23.403-18.681z"},child:[]}]})(t)}function Nle(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M497 273L329 441c-15 15-41 4.5-41-17v-96H152c-13.3 0-24-10.7-24-24v-96c0-13.3 10.7-24 24-24h136V88c0-21.4 25.9-32 41-17l168 168c9.3 9.4 9.3 24.6 0 34zM192 436v-40c0-6.6-5.4-12-12-12H96c-17.7 0-32-14.3-32-32V160c0-17.7 14.3-32 32-32h84c6.6 0 12-5.4 12-12V76c0-6.6-5.4-12-12-12H96c-53 0-96 43-96 96v192c0 53 43 96 96 96h84c6.6 0 12-5.4 12-12z"},child:[]}]})(t)}function wA(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M259.3 17.8L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0z"},child:[]}]})(t)}function sk(t){return en({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M312 320h136V56c0-13.3-10.7-24-24-24H24C10.7 32 0 42.7 0 56v400c0 13.3 10.7 24 24 24h264V344c0-13.2 10.8-24 24-24zm129 55l-98 98c-4.5 4.5-10.6 7-17 7h-6V352h128v6.1c0 6.3-2.5 12.4-7 16.9z"},child:[]}]})(t)}function Ple(t){return en({attr:{viewBox:"0 0 616 512"},child:[{tag:"path",attr:{d:"M602 118.6L537.1 15C531.3 5.7 521 0 510 0H106C95 0 84.7 5.7 78.9 15L14 118.6c-33.5 53.5-3.8 127.9 58.8 136.4 4.5.6 9.1.9 13.7.9 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18 20.1 44.3 33.1 73.8 33.1 29.6 0 55.8-13 73.8-33.1 18.1 20.1 44.3 33.1 73.8 33.1 4.7 0 9.2-.3 13.7-.9 62.8-8.4 92.6-82.8 59-136.4zM529.5 288c-10 0-19.9-1.5-29.5-3.8V384H116v-99.8c-9.6 2.2-19.5 3.8-29.5 3.8-6 0-12.1-.4-18-1.2-5.6-.8-11.1-2.1-16.4-3.6V480c0 17.7 14.3 32 32 32h448c17.7 0 32-14.3 32-32V283.2c-5.4 1.6-10.8 2.9-16.4 3.6-6.1.8-12.1 1.2-18.2 1.2z"},child:[]}]})(t)}function mg(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M0 252.118V48C0 21.49 21.49 0 48 0h204.118a48 48 0 0 1 33.941 14.059l211.882 211.882c18.745 18.745 18.745 49.137 0 67.882L293.823 497.941c-18.745 18.745-49.137 18.745-67.882 0L14.059 286.059A48 48 0 0 1 0 252.118zM112 64c-26.51 0-48 21.49-48 48s21.49 48 48 48 48-21.49 48-48-21.49-48-48-48z"},child:[]}]})(t)}function Qp(t){return en({attr:{viewBox:"0 0 352 512"},child:[{tag:"path",attr:{d:"M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z"},child:[]}]})(t)}function SD(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M624 352h-16V243.9c0-12.7-5.1-24.9-14.1-33.9L494 110.1c-9-9-21.2-14.1-33.9-14.1H416V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h48c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16zM160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm320 0c-26.5 0-48-21.5-48-48s21.5-48 48-48 48 21.5 48 48-21.5 48-48 48zm80-208H416V144h44.1l99.9 99.9V256z"},child:[]}]})(t)}function EA(t){return en({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224 256c70.7 0 128-57.3 128-128S294.7 0 224 0 96 57.3 96 128s57.3 128 128 128zm89.6 32h-16.7c-22.2 10.2-46.9 16-72.9 16s-50.6-5.8-72.9-16h-16.7C60.2 288 0 348.2 0 422.4V464c0 26.5 21.5 48 48 48h352c26.5 0 48-21.5 48-48v-41.6c0-74.2-60.2-134.4-134.4-134.4z"},child:[]}]})(t)}function Dle(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M96 224c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm448 0c35.3 0 64-28.7 64-64s-28.7-64-64-64-64 28.7-64 64 28.7 64 64 64zm32 32h-64c-17.6 0-33.5 7.1-45.1 18.6 40.3 22.1 68.9 62 75.1 109.4h66c17.7 0 32-14.3 32-32v-32c0-35.3-28.7-64-64-64zm-256 0c61.9 0 112-50.1 112-112S381.9 32 320 32 208 82.1 208 144s50.1 112 112 112zm76.8 32h-8.3c-20.8 10-43.9 16-68.5 16s-47.6-6-68.5-16h-8.3C179.6 288 128 339.6 128 403.2V432c0 26.5 21.5 48 48 48h288c26.5 0 48-21.5 48-48v-28.8c0-63.6-51.6-115.2-115.2-115.2zm-223.7-13.4C161.5 263.1 145.6 256 128 256H64c-35.3 0-64 28.7-64 64v32c0 17.7 14.3 32 32 32h65.9c6.3-47.4 34.9-87.3 75.2-109.4z"},child:[]}]})(t)}function Lle(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M504 352H136.4c-4.4 0-8 3.6-8 8l-.1 48c0 4.4 3.6 8 8 8H504c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm0 96H136.1c-4.4 0-8 3.6-8 8l-.1 48c0 4.4 3.6 8 8 8h368c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm0-192H136.6c-4.4 0-8 3.6-8 8l-.1 48c0 4.4 3.6 8 8 8H504c4.4 0 8-3.6 8-8v-48c0-4.4-3.6-8-8-8zm106.5-139L338.4 3.7a48.15 48.15 0 0 0-36.9 0L29.5 117C11.7 124.5 0 141.9 0 161.3V504c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V256c0-17.6 14.6-32 32.6-32h382.8c18 0 32.6 14.4 32.6 32v248c0 4.4 3.6 8 8 8h80c4.4 0 8-3.6 8-8V161.3c0-19.4-11.7-36.8-29.5-44.3z"},child:[]}]})(t)}function Ole(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M528.1 171.5L382 150.2 316.7 17.8c-11.7-23.6-45.6-23.9-57.4 0L194 150.2 47.9 171.5c-26.2 3.8-36.7 36.1-17.7 54.6l105.7 103-25 145.5c-4.5 26.3 23.2 46 46.4 33.7L288 439.6l130.7 68.7c23.2 12.2 50.9-7.4 46.4-33.7l-25-145.5 105.7-103c19-18.5 8.5-50.8-17.7-54.6zM388.6 312.3l23.7 138.4L288 385.4l-124.3 65.3 23.7-138.4-100.6-98 139-20.2 62.2-126 62.2 126 139 20.2-100.6 98z"},child:[]}]})(t)}var kE,wD;function Ile(){return wD||(wD=1,kE={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),kE}var zle=Ile();const Ble=Zg(zle);var Ule=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ED(t){var e={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=t.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(e.name=n[1],(Ble[n[1]]||t.charAt(t.length-2)==="/")&&(e.voidElement=!0),e.name.startsWith("!--"))){var i=t.indexOf("-->");return{type:"comment",comment:i!==-1?t.slice(4,i):""}}for(var a=new RegExp(Ule),s=null;(s=a.exec(t))!==null;)if(s[0].trim())if(s[1]){var r=s[1].trim(),o=[r,""];r.indexOf("=")>-1&&(o=r.split("=")),e.attrs[o[0]]=o[1],a.lastIndex--}else s[2]&&(e.attrs[s[2]]=s[3].trim().substring(1,s[3].length-1));return e}var jle=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,Fle=/^\s*$/,Vle=Object.create(null);function rk(t,e){switch(e.type){case"text":return t+e.content;case"tag":return t+="<"+e.name+(e.attrs?(function(n){var i=[];for(var a in n)i.push(a+'="'+n[a]+'"');return i.length?" "+i.join(" "):""})(e.attrs):"")+(e.voidElement?"/>":">"),e.voidElement?t:t+e.children.reduce(rk,"")+"</"+e.name+">";case"comment":return t+"<!--"+e.comment+"-->"}}var kle={parse:function(t,e){e||(e={}),e.components||(e.components=Vle);var n,i=[],a=[],s=-1,r=!1;if(t.indexOf("<")!==0){var o=t.indexOf("<");i.push({type:"text",content:o===-1?t:t.substring(0,o)})}return t.replace(jle,function(c,u){if(r){if(c!=="</"+n.name+">")return;r=!1}var h,d=c.charAt(1)!=="/",p=c.startsWith("<!--"),g=u+c.length,b=t.charAt(g);if(p){var w=ED(c);return s<0?(i.push(w),i):((h=a[s]).children.push(w),i)}if(d&&(s++,(n=ED(c)).type==="tag"&&e.components[n.name]&&(n.type="component",r=!0),n.voidElement||r||!b||b==="<"||n.children.push({type:"text",content:t.slice(g,t.indexOf("<",g))}),s===0&&i.push(n),(h=a[s-1])&&h.children.push(n),a[s]=n),(!d||n.voidElement)&&(s>-1&&(n.voidElement||n.name===c.slice(2,-1))&&(s--,n=s===-1?i:a[s]),!r&&b!=="<"&&b)){h=s===-1?i:a[s].children;var x=t.indexOf("<",g),S=t.slice(g,x===-1?void 0:x);Fle.test(S)&&(S=" "),(x>-1&&s+h.length>=0||S!==" ")&&h.push({type:"text",content:S})}}),i},stringify:function(t){return t.reduce(function(e,n){return e+rk("",n)},"")}};const hS=(t,e,n,i)=>{const a=[n,{code:e,...i||{}}];if(t?.services?.logger?.forward)return t.services.logger.forward(a,"warn","react-i18next::",!0);Tl(a[0])&&(a[0]=`react-i18next:: ${a[0]}`),t?.services?.logger?.warn?t.services.logger.warn(...a):console?.warn&&console.warn(...a)},MD={},l1=(t,e,n,i)=>{Tl(n)&&MD[n]||(Tl(n)&&(MD[n]=new Date),hS(t,e,n,i))},ok=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},u5=(t,e,n)=>{t.loadNamespaces(e,ok(t,n))},TD=(t,e,n,i)=>{if(Tl(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return u5(t,n,i);n.forEach(a=>{t.options.ns.indexOf(a)<0&&t.options.ns.push(a)}),t.loadLanguages(e,ok(t,i))},Hle=(t,e,n={})=>!e.languages||!e.languages.length?(l1(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(i,a)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&i.services.backendConnector.backend&&i.isLanguageChangingTo&&!a(i.isLanguageChangingTo,t))return!1}}),Tl=t=>typeof t=="string",zf=t=>typeof t=="object"&&t!==null,$le=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,Gle={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},Wle=t=>Gle[t],Kle=t=>t.replace($le,Wle);let d5={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:Kle};const Xle=(t={})=>{d5={...d5,...t}},lk=()=>d5;let ck;const qle=t=>{ck=t},MA=()=>ck,HE=(t,e)=>{if(!t)return!1;const n=t.props?.children??t.children;return e?n.length>0:!!n},$E=t=>{if(!t)return[];const e=t.props?.children??t.children;return t.props?.i18nIsDynamicList?gg(e):e},Yle=t=>Array.isArray(t)&&t.every(P.isValidElement),gg=t=>Array.isArray(t)?t:[t],Zle=(t,e)=>{const n={...e};return n.props=Object.assign(t.props,e.props),n},uk=(t,e,n,i)=>{if(!t)return"";let a="";const s=gg(t),r=e?.transSupportBasicHtmlNodes?e.transKeepBasicHtmlNodesFor??[]:[];return s.forEach((o,c)=>{if(Tl(o)){a+=`${o}`;return}if(P.isValidElement(o)){const{props:u,type:h}=o,d=Object.keys(u).length,p=r.indexOf(h)>-1,g=u.children;if(!g&&p&&!d){a+=`<${h}/>`;return}if(!g&&(!p||d)||u.i18nIsDynamicList){a+=`<${c}></${c}>`;return}if(p&&d===1&&Tl(g)){a+=`<${h}>${g}</${h}>`;return}const b=uk(g,e,n,i);a+=`<${c}>${b}</${c}>`;return}if(o===null){hS(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:i});return}if(zf(o)){const{format:u,...h}=o,d=Object.keys(h);if(d.length===1){const p=u?`${d[0]}, ${u}`:d[0];a+=`{{${p}}}`;return}hS(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:i,child:o});return}hS(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:i,child:o})}),a},Qle=(t,e,n,i,a,s,r)=>{if(n==="")return[];const o=a.transKeepBasicHtmlNodesFor||[],c=n&&new RegExp(o.map(S=>`<${S}`).join("|")).test(n);if(!t&&!e&&!c&&!r)return[n];const u=e??{},h=S=>{gg(S).forEach(C=>{Tl(C)||(HE(C)?h($E(C)):zf(C)&&!P.isValidElement(C)&&Object.assign(u,C))})};h(t);const d=kle.parse(`<0>${n}</0>`),p={...u,...s},g=(S,M,C)=>{const A=$E(S),N=w(A,M.children,C);return Yle(A)&&N.length===0||S.props?.i18nIsDynamicList?A:N},b=(S,M,C,A,N)=>{S.dummy?(S.children=M,C.push(P.cloneElement(S,{key:A},N?void 0:M))):C.push(...P.Children.map([S],R=>{const D={...R.props};return delete D.i18nIsDynamicList,P.createElement(R.type,{...D,key:A,ref:R.props.ref??R.ref},N?null:M)}))},w=(S,M,C)=>{const A=gg(S);return gg(M).reduce((R,D,B)=>{const z=D.children?.[0]?.content&&i.services.interpolator.interpolate(D.children[0].content,p,i.language);if(D.type==="tag"){let I=A[parseInt(D.name,10)];!I&&e&&(I=e[D.name]),C.length===1&&!I&&(I=C[0][D.name]),I||(I={});const U=Object.keys(D.attrs).length!==0?Zle({props:D.attrs},I):I,$=P.isValidElement(U),G=$&&HE(D,!0)&&!D.voidElement,k=c&&zf(U)&&U.dummy&&!$,X=zf(e)&&Object.hasOwnProperty.call(e,D.name);if(Tl(U)){const V=i.services.interpolator.interpolate(U,p,i.language);R.push(V)}else if(HE(U)||G){const V=g(U,D,C);b(U,V,R,B)}else if(k){const V=w(A,D.children,C);b(U,V,R,B)}else if(Number.isNaN(parseFloat(D.name)))if(X){const V=g(U,D,C);b(U,V,R,B,D.voidElement)}else if(a.transSupportBasicHtmlNodes&&o.indexOf(D.name)>-1)if(D.voidElement)R.push(P.createElement(D.name,{key:`${D.name}-${B}`}));else{const V=w(A,D.children,C);R.push(P.createElement(D.name,{key:`${D.name}-${B}`},V))}else if(D.voidElement)R.push(`<${D.name} />`);else{const V=w(A,D.children,C);R.push(`<${D.name}>${V}</${D.name}>`)}else if(zf(U)&&!$){const V=D.children[0]?z:null;V&&R.push(V)}else b(U,z,R,B,D.children.length!==1||!z)}else if(D.type==="text"){const I=a.transWrapTextNodes,U=r?a.unescape(i.services.interpolator.interpolate(D.content,p,i.language)):i.services.interpolator.interpolate(D.content,p,i.language);I?R.push(P.createElement(I,{key:`${D.name}-${B}`},U)):R.push(U)}return R},[])},x=w([{dummy:!0,children:t||[]}],d,gg(t||[]));return $E(x[0])},dk=(t,e,n)=>{const i=t.key||e,a=P.cloneElement(t,{key:i});if(!a.props||!a.props.children||n.indexOf(`${e}/>`)<0&&n.indexOf(`${e} />`)<0)return a;function s(){return P.createElement(P.Fragment,null,a)}return P.createElement(s,{key:i})},Jle=(t,e)=>t.map((n,i)=>dk(n,i,e)),ece=(t,e)=>{const n={};return Object.keys(t).forEach(i=>{Object.assign(n,{[i]:dk(t[i],i,e)})}),n},tce=(t,e,n,i)=>t?Array.isArray(t)?Jle(t,e):zf(t)?ece(t,e):(l1(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:i}),null):null,nce=t=>!zf(t)||Array.isArray(t)?!1:Object.keys(t).reduce((e,n)=>e&&Number.isNaN(Number.parseFloat(n)),!0);function ice({children:t,count:e,parent:n,i18nKey:i,context:a,tOptions:s={},values:r,defaults:o,components:c,ns:u,i18n:h,t:d,shouldUnescape:p,...g}){const b=h||MA();if(!b)return l1(b,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:i}),t;const w=d||b.t.bind(b)||(k=>k),x={...lk(),...b.options?.react};let S=u||w.ns||b.options?.defaultNS;S=Tl(S)?[S]:S||["translation"];const M=uk(t,x,b,i),C=o||M||x.transEmptyNodeValue||i,{hashTransKey:A}=x,N=i||(A?A(M||C):M||C);b.options?.interpolation?.defaultVariables&&(r=r&&Object.keys(r).length>0?{...r,...b.options.interpolation.defaultVariables}:{...b.options.interpolation.defaultVariables});const R=r||e!==void 0&&!b.options?.interpolation?.alwaysFormat||!t?s.interpolation:{interpolation:{...s.interpolation,prefix:"#$?",suffix:"?$#"}},D={...s,context:a||s.context,count:e,...r,...R,defaultValue:C,ns:S},B=N?w(N,D):C,z=tce(c,B,b,i);let I=z||t,U=null;nce(z)&&(U=z,I=t);const $=Qle(I,U,B,b,x,D,p),G=n??x.defaultTransParent;return G?P.createElement(G,g,$):$}const ace={type:"3rdParty",init(t){Xle(t.options.react),qle(t)}},fk=P.createContext();class sce{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function rce({children:t,count:e,parent:n,i18nKey:i,context:a,tOptions:s={},values:r,defaults:o,components:c,ns:u,i18n:h,t:d,shouldUnescape:p,...g}){const{i18n:b,defaultNS:w}=P.useContext(fk)||{},x=h||b||MA(),S=d||x?.t.bind(x);return ice({children:t,count:e,parent:n,i18nKey:i,context:a,tOptions:s,values:r,defaults:o,components:c,ns:u||S?.ns||w||x?.options?.defaultNS,i18n:x,t:d,shouldUnescape:p,...g})}const oce=(t,e)=>{const n=P.useRef();return P.useEffect(()=>{n.current=t},[t,e]),n.current},hk=(t,e,n,i)=>t.getFixedT(e,n,i),lce=(t,e,n,i)=>P.useCallback(hk(t,e,n,i),[t,e,n,i]),Dn=(t,e={})=>{const{i18n:n}=e,{i18n:i,defaultNS:a}=P.useContext(fk)||{},s=n||i||MA();if(s&&!s.reportNamespaces&&(s.reportNamespaces=new sce),!s){l1(s,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const A=(R,D)=>Tl(D)?D:zf(D)&&Tl(D.defaultValue)?D.defaultValue:Array.isArray(R)?R[R.length-1]:R,N=[A,{},!1];return N.t=A,N.i18n={},N.ready=!1,N}s.options.react?.wait&&l1(s,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const r={...lk(),...s.options.react,...e},{useSuspense:o,keyPrefix:c}=r;let u=a||s.options?.defaultNS;u=Tl(u)?[u]:u||["translation"],s.reportNamespaces.addUsedNamespaces?.(u);const h=(s.isInitialized||s.initializedStoreOnce)&&u.every(A=>Hle(A,s,r)),d=lce(s,e.lng||null,r.nsMode==="fallback"?u:u[0],c),p=()=>d,g=()=>hk(s,e.lng||null,r.nsMode==="fallback"?u:u[0],c),[b,w]=P.useState(p);let x=u.join();e.lng&&(x=`${e.lng}${x}`);const S=oce(x),M=P.useRef(!0);P.useEffect(()=>{const{bindI18n:A,bindI18nStore:N}=r;M.current=!0,!h&&!o&&(e.lng?TD(s,e.lng,u,()=>{M.current&&w(g)}):u5(s,u,()=>{M.current&&w(g)})),h&&S&&S!==x&&M.current&&w(g);const R=()=>{M.current&&w(g)};return A&&s?.on(A,R),N&&s?.store.on(N,R),()=>{M.current=!1,s&&A&&A?.split(" ").forEach(D=>s.off(D,R)),N&&s&&N.split(" ").forEach(D=>s.store.off(D,R))}},[s,x]),P.useEffect(()=>{M.current&&h&&w(p)},[s,c,h]);const C=[b,s,h];if(C.t=b,C.i18n=s,C.ready=h,h||!h&&!o)return C;throw new Promise(A=>{e.lng?TD(s,e.lng,u,()=>A()):u5(s,u,()=>A())})};function CD(t){const e=sn.c(41),{isSearchEmpty:n,searchQuery:i}=t,a=n===void 0?!1:n,s=i===void 0?"":i,{t:r}=Dn();let o,c,u;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={opacity:0},c={opacity:1},u={duration:.5},e[0]=o,e[1]=c,e[2]=u):(o=e[0],c=e[1],u=e[2]);let h,d,p;e[3]===Symbol.for("react.memo_cache_sentinel")?(h={y:20,opacity:0},d={y:0,opacity:1},p={delay:.2,duration:.6},e[3]=h,e[4]=d,e[5]=p):(h=e[3],d=e[4],p=e[5]);let g,b,w;e[6]===Symbol.for("react.memo_cache_sentinel")?(w={scale:0},g={scale:1},b={delay:.4,type:"spring",stiffness:200},e[6]=g,e[7]=b,e[8]=w):(g=e[6],b=e[7],w=e[8]);let x;e[9]!==a?(x=_.jsx(Ve.div,{className:"relative",initial:w,animate:g,transition:b,children:_.jsx("div",{className:"p-6 rounded-full bg-gradient-to-br from-slate-600/30 to-slate-700/30 border border-slate-500/20 backdrop-blur-sm",children:a?_.jsx(mm,{className:"text-4xl text-slate-400"}):_.jsx(Zp,{className:"text-4xl text-slate-400"})})}),e[9]=a,e[10]=x):x=e[10];let S,M,C;e[11]===Symbol.for("react.memo_cache_sentinel")?(S={opacity:0,y:10},M={opacity:1,y:0},C={delay:.6,duration:.5},e[11]=S,e[12]=M,e[13]=C):(S=e[11],M=e[12],C=e[13]);let A;e[14]!==a||e[15]!==r?(A=r(a?"decorate_ui.item_list.empty.search_title":"decorate_ui.item_list.empty.title"),e[14]=a,e[15]=r,e[16]=A):A=e[16];let N;e[17]!==A?(N=_.jsx("h2",{className:"text-2xl font-bold text-slate-200 title",children:A}),e[17]=A,e[18]=N):N=e[18];let R;e[19]!==a||e[20]!==s||e[21]!==r?(R=a?r("decorate_ui.item_list.empty.search_description",{searchQuery:s}):r("decorate_ui.item_list.empty.description"),e[19]=a,e[20]=s,e[21]=r,e[22]=R):R=e[22];let D;e[23]!==R?(D=_.jsx("p",{className:"text-slate-400 max-w-md",children:R}),e[23]=R,e[24]=D):D=e[24];let B;e[25]!==N||e[26]!==D?(B=_.jsxs(Ve.div,{className:"text-center space-y-3",initial:S,animate:M,transition:C,children:[N,D]}),e[25]=N,e[26]=D,e[27]=B):B=e[27];let z,I,U,$;e[28]===Symbol.for("react.memo_cache_sentinel")?(z={opacity:0},I={opacity:1},U={delay:1,duration:.4},$=_.jsx(wle,{className:"text-xs"}),e[28]=z,e[29]=I,e[30]=U,e[31]=$):(z=e[28],I=e[29],U=e[30],$=e[31]);let G;e[32]!==a||e[33]!==r?(G=r(a?"decorate_ui.item_list.empty.search_helper":"decorate_ui.item_list.empty.helper"),e[32]=a,e[33]=r,e[34]=G):G=e[34];let k;e[35]!==G?(k=_.jsxs(Ve.div,{className:"flex items-center space-x-2 text-xs text-slate-500",initial:z,animate:I,transition:U,children:[$,_.jsx("span",{children:G})]}),e[35]=G,e[36]=k):k=e[36];let X;return e[37]!==x||e[38]!==B||e[39]!==k?(X=_.jsx(Ve.div,{className:"w-full flex-shrink flex-grow p-8 flex flex-col items-center justify-center",initial:o,animate:c,transition:u,children:_.jsxs(Ve.div,{className:"flex flex-col items-center space-y-6",initial:h,animate:d,transition:p,children:[x,B,k]})}),e[37]=x,e[38]=B,e[39]=k,e[40]=X):X=e[40],X}const pw=0,uh=1,ov=2,pk=4;function AD(t){return()=>t}function cce(t){t()}function mk(t,e){return n=>t(e(n))}function RD(t,e){return()=>t(e)}function uce(t,e){return n=>t(e,n)}function TA(t){return t!==void 0}function dce(...t){return()=>{t.map(cce)}}function lv(){}function mw(t,e){return e(t),t}function fce(t,e){return e(t)}function ia(...t){return t}function Oi(t,e){return t(uh,e)}function Gn(t,e){t(pw,e)}function CA(t){t(ov)}function Ua(t){return t(pk)}function mn(t,e){return Oi(t,uce(e,pw))}function uc(t,e){const n=t(uh,i=>{n(),e(i)});return n}function ND(t){let e,n;return i=>a=>{e=a,n&&clearTimeout(n),n=setTimeout(()=>{i(e)},t)}}function gk(t,e){return t===e}function ea(t=gk){let e;return n=>i=>{t(e,i)||(e=i,n(i))}}function An(t){return e=>n=>{t(n)&&e(n)}}function nn(t){return e=>mk(e,t)}function nu(t){return e=>()=>{e(t)}}function Rt(t,...e){const n=hce(...e);return(i,a)=>{switch(i){case ov:CA(t);return;case uh:return Oi(t,n(a))}}}function ou(t,e){return n=>i=>{n(e=t(e,i))}}function Jp(t){return e=>n=>{t>0?t--:e(n)}}function yd(t){let e=null,n;return i=>a=>{e=a,!n&&(n=setTimeout(()=>{n=void 0,i(e)},t))}}function Yn(...t){const e=new Array(t.length);let n=0,i=null;const a=Math.pow(2,t.length)-1;return t.forEach((s,r)=>{const o=Math.pow(2,r);Oi(s,c=>{const u=n;n=n|o,e[r]=c,u!==a&&n===a&&i&&(i(),i=null)})}),s=>r=>{const o=()=>{s([r].concat(e))};n===a?o():i=o}}function hce(...t){return e=>t.reduceRight(fce,e)}function pce(t){let e,n;const i=()=>e?.();return function(a,s){switch(a){case uh:return s?n===s?void 0:(i(),n=s,e=Oi(t,s),e):(i(),lv);case ov:i(),n=null;return}}}function Ft(t){let e=t;const n=gi();return(i,a)=>{switch(i){case pw:e=a;break;case uh:{a(e);break}case pk:return e}return n(i,a)}}function ur(t,e){return mw(Ft(e),n=>mn(t,n))}function gi(){const t=[];return(e,n)=>{switch(e){case pw:t.slice().forEach(i=>{i(n)});return;case ov:t.splice(0,t.length);return;case uh:return t.push(n),()=>{const i=t.indexOf(n);i>-1&&t.splice(i,1)}}}}function Ho(t){return mw(gi(),e=>mn(t,e))}function Ri(t,e=[],{singleton:n}={singleton:!0}){return{constructor:t,dependencies:e,id:mce(),singleton:n}}const mce=()=>Symbol();function gce(t){const e=new Map,n=({constructor:i,dependencies:a,id:s,singleton:r})=>{if(r&&e.has(s))return e.get(s);const o=i(a.map(c=>n(c)));return r&&e.set(s,o),o};return n(t)}function Ya(...t){const e=gi(),n=new Array(t.length);let i=0;const a=Math.pow(2,t.length)-1;return t.forEach((s,r)=>{const o=Math.pow(2,r);Oi(s,c=>{n[r]=c,i=i|o,i===a&&Gn(e,n)})}),function(s,r){switch(s){case ov:{CA(e);return}case uh:return i===a&&r(n),Oi(e,r)}}}function Tn(t,e=gk){return Rt(t,ea(e))}function f5(...t){return function(e,n){switch(e){case ov:return;case uh:return dce(...t.map(i=>Oi(i,n)))}}}var vo=(t=>(t[t.DEBUG=0]="DEBUG",t[t.INFO=1]="INFO",t[t.WARN=2]="WARN",t[t.ERROR=3]="ERROR",t))(vo||{});const vce={0:"debug",3:"error",1:"log",2:"warn"},yce=()=>typeof globalThis>"u"?window:globalThis,dh=Ri(()=>{const t=Ft(3);return{log:Ft((e,n,i=1)=>{var a;const s=(a=yce().VIRTUOSO_LOG_LEVEL)!=null?a:Ua(t);i>=s&&console[vce[i]]("%creact-virtuoso: %c%s %o","color: #0253b3; font-weight: bold","color: initial",e,n)}),logLevel:t}},[],{singleton:!0});function gm(t,e,n){return AA(t,e,n).callbackRef}function AA(t,e,n){const i=ft.useRef(null);let a=r=>{};const s=ft.useMemo(()=>typeof ResizeObserver<"u"?new ResizeObserver(r=>{const o=()=>{const c=r[0].target;c.offsetParent!==null&&t(c)};n?o():requestAnimationFrame(o)}):null,[t,n]);return a=r=>{r&&e?(s?.observe(r),i.current=r):(i.current&&s?.unobserve(i.current),i.current=null)},{callbackRef:a,ref:i}}function bce(t,e,n,i,a,s,r,o,c){const u=ft.useCallback(h=>{const d=xce(h.children,e,o?"offsetWidth":"offsetHeight",a);let p=h.parentElement;for(;!p.dataset.virtuosoScroller;)p=p.parentElement;const g=p.lastElementChild.dataset.viewportType==="window";let b;g&&(b=p.ownerDocument.defaultView);const w=r?o?r.scrollLeft:r.scrollTop:g?o?b.scrollX||b.document.documentElement.scrollLeft:b.scrollY||b.document.documentElement.scrollTop:o?p.scrollLeft:p.scrollTop,x=r?o?r.scrollWidth:r.scrollHeight:g?o?b.document.documentElement.scrollWidth:b.document.documentElement.scrollHeight:o?p.scrollWidth:p.scrollHeight,S=r?o?r.offsetWidth:r.offsetHeight:g?o?b.innerWidth:b.innerHeight:o?p.offsetWidth:p.offsetHeight;i({scrollHeight:x,scrollTop:Math.max(w,0),viewportHeight:S}),s?.(o?PD("column-gap",getComputedStyle(h).columnGap,a):PD("row-gap",getComputedStyle(h).rowGap,a)),d!==null&&t(d)},[t,e,a,s,r,i,o]);return AA(u,n,c)}function xce(t,e,n,i){const a=t.length;if(a===0)return null;const s=[];for(let r=0;r<a;r++){const o=t.item(r);if(o.dataset.index===void 0)continue;const c=parseInt(o.dataset.index),u=parseFloat(o.dataset.knownSize),h=e(o,n);if(h===0&&i("Zero-sized element, this should not happen",{child:o},vo.ERROR),h===u)continue;const d=s[s.length-1];s.length===0||d.size!==h||d.endIndex!==c-1?s.push({endIndex:c,size:h,startIndex:c}):s[s.length-1].endIndex++}return s}function PD(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,vo.WARN),e==="normal"?0:parseInt(e??"0",10)}function vk(t,e,n){const i=ft.useRef(null),a=ft.useCallback(c=>{if(!(c!=null&&c.offsetParent))return;const u=c.getBoundingClientRect(),h=u.width;let d,p;if(e){const g=e.getBoundingClientRect(),b=u.top-g.top;p=g.height-Math.max(0,b),d=b+e.scrollTop}else{const g=r.current.ownerDocument.defaultView;p=g.innerHeight-Math.max(0,u.top),d=u.top+g.scrollY}i.current={offsetTop:d,visibleHeight:p,visibleWidth:h},t(i.current)},[t,e]),{callbackRef:s,ref:r}=AA(a,!0,n),o=ft.useCallback(()=>{a(r.current)},[a,r]);return ft.useEffect(()=>{var c;if(e){e.addEventListener("scroll",o);const u=new ResizeObserver(()=>{requestAnimationFrame(o)});return u.observe(e),()=>{e.removeEventListener("scroll",o),u.unobserve(e)}}else{const u=(c=r.current)==null?void 0:c.ownerDocument.defaultView;return u?.addEventListener("scroll",o),u?.addEventListener("resize",o),()=>{u?.removeEventListener("scroll",o),u?.removeEventListener("resize",o)}}},[o,e,r]),s}const Xr=Ri(()=>{const t=gi(),e=gi(),n=Ft(0),i=gi(),a=Ft(0),s=gi(),r=gi(),o=Ft(0),c=Ft(0),u=Ft(0),h=Ft(0),d=gi(),p=gi(),g=Ft(!1),b=Ft(!1),w=Ft(!1);return mn(Rt(t,nn(({scrollTop:x})=>x)),e),mn(Rt(t,nn(({scrollHeight:x})=>x)),r),mn(e,a),{deviation:n,fixedFooterHeight:u,fixedHeaderHeight:c,footerHeight:h,headerHeight:o,horizontalDirection:b,scrollBy:p,scrollContainerState:t,scrollHeight:r,scrollingInProgress:g,scrollTo:d,scrollTop:e,skipAnimationFrameInResizeObserver:w,smoothScrollTargetReached:i,statefulScrollTop:a,viewportHeight:s}},[],{singleton:!0}),c1={lvl:0};function yk(t,e){const n=t.length;if(n===0)return[];let{index:i,value:a}=e(t[0]);const s=[];for(let r=1;r<n;r++){const{index:o,value:c}=e(t[r]);s.push({end:o-1,start:i,value:a}),i=o,a=c}return s.push({end:1/0,start:i,value:a}),s}function qi(t){return t===c1}function u1(t,e){if(!qi(t))return e===t.k?t.v:e<t.k?u1(t.l,e):u1(t.r,e)}function fc(t,e,n="k"){if(qi(t))return[-1/0,void 0];if(Number(t[n])===e)return[t.k,t.v];if(Number(t[n])<e){const i=fc(t.r,e,n);return i[0]===-1/0?[t.k,t.v]:i}return fc(t.l,e,n)}function Uo(t,e,n){return qi(t)?_k(e,n,1):e===t.k?ls(t,{k:e,v:n}):e<t.k?DD(ls(t,{l:Uo(t.l,e,n)})):DD(ls(t,{r:Uo(t.r,e,n)}))}function Cg(){return c1}function gw(t,e,n){if(qi(t))return[];const i=fc(t,e)[0];return _ce(p5(t,i,n))}function h5(t,e){if(qi(t))return c1;const{k:n,l:i,r:a}=t;if(e===n){if(qi(i))return a;if(qi(a))return i;{const[s,r]=xk(i);return pS(ls(t,{k:s,l:bk(i),v:r}))}}else return e<n?pS(ls(t,{l:h5(i,e)})):pS(ls(t,{r:h5(a,e)}))}function Ip(t){return qi(t)?[]:[...Ip(t.l),{k:t.k,v:t.v},...Ip(t.r)]}function p5(t,e,n){if(qi(t))return[];const{k:i,l:a,r:s,v:r}=t;let o=[];return i>e&&(o=o.concat(p5(a,e,n))),i>=e&&i<=n&&o.push({k:i,v:r}),i<=n&&(o=o.concat(p5(s,e,n))),o}function pS(t){const{l:e,lvl:n,r:i}=t;if(i.lvl>=n-1&&e.lvl>=n-1)return t;if(n>i.lvl+1){if(GE(e))return Sk(ls(t,{lvl:n-1}));if(!qi(e)&&!qi(e.r))return ls(e.r,{l:ls(e,{r:e.r.l}),lvl:n,r:ls(t,{l:e.r.r,lvl:n-1})});throw new Error("Unexpected empty nodes")}else{if(GE(t))return m5(ls(t,{lvl:n-1}));if(!qi(i)&&!qi(i.l)){const a=i.l,s=GE(a)?i.lvl-1:i.lvl;return ls(a,{l:ls(t,{lvl:n-1,r:a.l}),lvl:a.lvl+1,r:m5(ls(i,{l:a.r,lvl:s}))})}else throw new Error("Unexpected empty nodes")}}function ls(t,e){return _k(e.k!==void 0?e.k:t.k,e.v!==void 0?e.v:t.v,e.lvl!==void 0?e.lvl:t.lvl,e.l!==void 0?e.l:t.l,e.r!==void 0?e.r:t.r)}function bk(t){return qi(t.r)?t.l:pS(ls(t,{r:bk(t.r)}))}function GE(t){return qi(t)||t.lvl>t.r.lvl}function xk(t){return qi(t.r)?[t.k,t.v]:xk(t.r)}function _k(t,e,n,i=c1,a=c1){return{k:t,l:i,lvl:n,r:a,v:e}}function DD(t){return m5(Sk(t))}function Sk(t){const{l:e}=t;return!qi(e)&&e.lvl===t.lvl?ls(e,{r:ls(t,{l:e.r})}):t}function m5(t){const{lvl:e,r:n}=t;return!qi(n)&&!qi(n.r)&&n.lvl===e&&n.r.lvl===e?ls(n,{l:ls(t,{r:n.l}),lvl:e+1}):t}function _ce(t){return yk(t,({k:e,v:n})=>({index:e,value:n}))}function wk(t,e){return!!(t&&t.startIndex===e.startIndex&&t.endIndex===e.endIndex)}function d1(t,e){return!!(t&&t[0]===e[0]&&t[1]===e[1])}const RA=Ri(()=>({recalcInProgress:Ft(!1)}),[],{singleton:!0});function Ek(t,e,n){return t[XS(t,e,n)]}function XS(t,e,n,i=0){let a=t.length-1;for(;i<=a;){const s=Math.floor((i+a)/2),r=t[s],o=n(r,e);if(o===0)return s;if(o===-1){if(a-i<2)return s-1;a=s-1}else{if(a===i)return s;i=s+1}}throw new Error(`Failed binary finding record in array - ${t.join(",")}, searched for ${e}`)}function Sce(t,e,n,i){const a=XS(t,e,i),s=XS(t,n,i,a);return t.slice(a,s+1)}function Qf(t,e){return Math.round(t.getBoundingClientRect()[e])}function vw(t){return!qi(t.groupOffsetTree)}function NA({index:t},e){return e===t?0:e<t?-1:1}function wce(){return{groupIndices:[],groupOffsetTree:Cg(),lastIndex:0,lastOffset:0,lastSize:0,offsetTree:[],sizeTree:Cg()}}function Ece(t,e){let n=qi(t)?0:1/0;for(const i of e){const{endIndex:a,size:s,startIndex:r}=i;if(n=Math.min(n,r),qi(t)){t=Uo(t,0,s);continue}const o=gw(t,r-1,a+1);if(o.some(Pce(i)))continue;let c=!1,u=!1;for(const{end:h,start:d,value:p}of o)c?(a>=d||s===p)&&(t=h5(t,d)):(u=p!==s,c=!0),h>a&&a>=d&&p!==s&&(t=Uo(t,a+1,p));u&&(t=Uo(t,r,s))}return[t,n]}function Mce(t){return typeof t.groupIndex<"u"}function Tce({offset:t},e){return e===t?0:e<t?-1:1}function f1(t,e,n){if(e.length===0)return 0;const{index:i,offset:a,size:s}=Ek(e,t,NA),r=t-i,o=s*r+(r-1)*n+a;return o>0?o+n:o}function Mk(t,e){if(!vw(e))return t;let n=0;for(;e.groupIndices[n]<=t+n;)n++;return t+n}function Tk(t,e,n){if(Mce(t))return e.groupIndices[t.groupIndex]+1;{const i=t.index==="LAST"?n:t.index;let a=Mk(i,e);return a=Math.max(0,a,Math.min(n,a)),a}}function Cce(t,e,n,i=0){return i>0&&(e=Math.max(e,Ek(t,i,NA).offset)),yk(Sce(t,e,n,Tce),Nce)}function Ace(t,[e,n,i,a]){e.length>0&&i("received item sizes",e,vo.DEBUG);const s=t.sizeTree;let r=s,o=0;if(n.length>0&&qi(s)&&e.length===2){const p=e[0].size,g=e[1].size;r=n.reduce((b,w)=>Uo(Uo(b,w,p),w+1,g),r)}else[r,o]=Ece(r,e);if(r===s)return t;const{lastIndex:c,lastOffset:u,lastSize:h,offsetTree:d}=g5(t.offsetTree,o,r,a);return{groupIndices:n,groupOffsetTree:n.reduce((p,g)=>Uo(p,g,f1(g,d,a)),Cg()),lastIndex:c,lastOffset:u,lastSize:h,offsetTree:d,sizeTree:r}}function Rce(t){return Ip(t).map(({k:e,v:n},i,a)=>{const s=a[i+1];return{endIndex:s?s.k-1:1/0,size:n,startIndex:e}})}function LD(t,e){let n=0,i=0;for(;n<t;)n+=e[i+1]-e[i]-1,i++;return i-(n===t?0:1)}function g5(t,e,n,i){let a=t,s=0,r=0,o=0,c=0;if(e!==0){c=XS(a,e-1,NA),o=a[c].offset;const u=fc(n,e-1);s=u[0],r=u[1],a.length&&a[c].size===fc(n,e)[1]&&(c-=1),a=a.slice(0,c+1)}else a=[];for(const{start:u,value:h}of gw(n,e,1/0)){const d=u-s,p=d*r+o+d*i;a.push({index:u,offset:p,size:h}),s=u,o=p,r=h}return{lastIndex:s,lastOffset:o,lastSize:r,offsetTree:a}}function Nce(t){return{index:t.index,value:t}}function Pce(t){const{endIndex:e,size:n,startIndex:i}=t;return a=>a.start===i&&(a.end===e||a.end===1/0)&&a.value===n}const Dce={offsetHeight:"height",offsetWidth:"width"},Su=Ri(([{log:t},{recalcInProgress:e}])=>{const n=gi(),i=gi(),a=ur(i,0),s=gi(),r=gi(),o=Ft(0),c=Ft([]),u=Ft(void 0),h=Ft(void 0),d=Ft((N,R)=>Qf(N,Dce[R])),p=Ft(void 0),g=Ft(0),b=wce(),w=ur(Rt(n,Yn(c,t,g),ou(Ace,b),ea()),b),x=ur(Rt(c,ea(),ou((N,R)=>({current:R,prev:N.current}),{current:[],prev:[]}),nn(({prev:N})=>N)),[]);mn(Rt(c,An(N=>N.length>0),Yn(w,g),nn(([N,R,D])=>{const B=N.reduce((z,I,U)=>Uo(z,I,f1(I,R.offsetTree,D)||U),Cg());return{...R,groupIndices:N,groupOffsetTree:B}})),w),mn(Rt(i,Yn(w),An(([N,{lastIndex:R}])=>N<R),nn(([N,{lastIndex:R,lastSize:D}])=>[{endIndex:R,size:D,startIndex:N}])),n),mn(u,h);const S=ur(Rt(u,nn(N=>N===void 0)),!0);mn(Rt(h,An(N=>N!==void 0&&qi(Ua(w).sizeTree)),nn(N=>[{endIndex:0,size:N,startIndex:0}])),n);const M=Ho(Rt(n,Yn(w),ou(({sizes:N},[R,D])=>({changed:D!==N,sizes:D}),{changed:!1,sizes:b}),nn(N=>N.changed)));Oi(Rt(o,ou((N,R)=>({diff:N.prev-R,prev:R}),{diff:0,prev:0}),nn(N=>N.diff)),N=>{const{groupIndices:R}=Ua(w);if(N>0)Gn(e,!0),Gn(s,N+LD(N,R));else if(N<0){const D=Ua(x);D.length>0&&(N-=LD(-N,D)),Gn(r,N)}}),Oi(Rt(o,Yn(t)),([N,R])=>{N<0&&R("`firstItemIndex` prop should not be set to less than zero. If you don't know the total count, just use a very high value",{firstItemIndex:o},vo.ERROR)});const C=Ho(s);mn(Rt(s,Yn(w),nn(([N,R])=>{const D=R.groupIndices.length>0,B=[],z=R.lastSize;if(D){const I=u1(R.sizeTree,0);let U=0,$=0;for(;U<N;){const k=R.groupIndices[$],X=R.groupIndices.length===$+1?1/0:R.groupIndices[$+1]-k-1;B.push({endIndex:k,size:I,startIndex:k}),B.push({endIndex:k+1+X-1,size:z,startIndex:k+1}),$++,U+=X+1}const G=Ip(R.sizeTree);return U!==N&&G.shift(),G.reduce((k,{k:X,v:V})=>{let H=k.ranges;return k.prevSize!==0&&(H=[...k.ranges,{endIndex:X+N-1,size:k.prevSize,startIndex:k.prevIndex}]),{prevIndex:X+N,prevSize:V,ranges:H}},{prevIndex:N,prevSize:0,ranges:B}).ranges}return Ip(R.sizeTree).reduce((I,{k:U,v:$})=>({prevIndex:U+N,prevSize:$,ranges:[...I.ranges,{endIndex:U+N-1,size:I.prevSize,startIndex:I.prevIndex}]}),{prevIndex:0,prevSize:z,ranges:[]}).ranges})),n);const A=Ho(Rt(r,Yn(w,g),nn(([N,{offsetTree:R},D])=>{const B=-N;return f1(B,R,D)})));return mn(Rt(r,Yn(w,g),nn(([N,R,D])=>{if(R.groupIndices.length>0){if(qi(R.sizeTree))return R;let B=Cg();const z=Ua(x);let I=0,U=0,$=0;for(;I<-N;){$=z[U];const G=z[U+1]-$-1;U++,I+=G+1}if(B=Ip(R.sizeTree).reduce((G,{k,v:X})=>Uo(G,Math.max(0,k+N),X),B),I!==-N){const G=u1(R.sizeTree,$);B=Uo(B,0,G);const k=fc(R.sizeTree,-N+1)[1];B=Uo(B,1,k)}return{...R,sizeTree:B,...g5(R.offsetTree,0,B,D)}}else{const B=Ip(R.sizeTree).reduce((z,{k:I,v:U})=>Uo(z,Math.max(0,I+N),U),Cg());return{...R,sizeTree:B,...g5(R.offsetTree,0,B,D)}}})),w),{beforeUnshiftWith:C,data:p,defaultItemSize:h,firstItemIndex:o,fixedItemSize:u,gap:g,groupIndices:c,itemSize:d,listRefresh:M,shiftWith:r,shiftWithOffset:A,sizeRanges:n,sizes:w,statefulTotalCount:a,totalCount:i,trackItemSizes:S,unshiftWith:s}},ia(dh,RA),{singleton:!0});function Lce(t){return t.reduce((e,n)=>(e.groupIndices.push(e.totalCount),e.totalCount+=n+1,e),{groupIndices:[],totalCount:0})}const Ck=Ri(([{groupIndices:t,sizes:e,totalCount:n},{headerHeight:i,scrollTop:a}])=>{const s=gi(),r=gi(),o=Ho(Rt(s,nn(Lce)));return mn(Rt(o,nn(c=>c.totalCount)),n),mn(Rt(o,nn(c=>c.groupIndices)),t),mn(Rt(Ya(a,e,i),An(([c,u])=>vw(u)),nn(([c,u,h])=>fc(u.groupOffsetTree,Math.max(c-h,0),"v")[0]),ea(),nn(c=>[c])),r),{groupCounts:s,topItemsIndexes:r}},ia(Su,Xr)),fh=Ri(([{log:t}])=>{const e=Ft(!1),n=Ho(Rt(e,An(i=>i),ea()));return Oi(e,i=>{i&&Ua(t)("props updated",{},vo.DEBUG)}),{didMount:n,propsReady:e}},ia(dh),{singleton:!0}),Oce=typeof document<"u"&&"scrollBehavior"in document.documentElement.style;function Ak(t){const e=typeof t=="number"?{index:t}:t;return e.align||(e.align="start"),(!e.behavior||!Oce)&&(e.behavior="auto"),e.offset||(e.offset=0),e}const ax=Ri(([{gap:t,listRefresh:e,sizes:n,totalCount:i},{fixedFooterHeight:a,fixedHeaderHeight:s,footerHeight:r,headerHeight:o,scrollingInProgress:c,scrollTo:u,smoothScrollTargetReached:h,viewportHeight:d},{log:p}])=>{const g=gi(),b=gi(),w=Ft(0);let x=null,S=null,M=null;function C(){x&&(x(),x=null),M&&(M(),M=null),S&&(clearTimeout(S),S=null),Gn(c,!1)}return mn(Rt(g,Yn(n,d,i,w,o,r,p),Yn(t,s,a),nn(([[A,N,R,D,B,z,I,U],$,G,k])=>{const X=Ak(A),{align:V,behavior:H,offset:W}=X,J=D-1,Y=Tk(X,N,J);let K=f1(Y,N.offsetTree,$)+z;V==="end"?(K+=G+fc(N.sizeTree,Y)[1]-R+k,Y===J&&(K+=I)):V==="center"?K+=(G+fc(N.sizeTree,Y)[1]-R+k)/2:K-=B,W&&(K+=W);const ee=ie=>{C(),ie?(U("retrying to scroll to",{location:A},vo.DEBUG),Gn(g,A)):(Gn(b,!0),U("list did not change, scroll successful",{},vo.DEBUG))};if(C(),H==="smooth"){let ie=!1;M=Oi(e,Z=>{ie=ie||Z}),x=uc(h,()=>{ee(ie)})}else x=uc(Rt(e,Ice(150)),ee);return S=setTimeout(()=>{C()},1200),Gn(c,!0),U("scrolling from index to",{behavior:H,index:Y,top:K},vo.DEBUG),{behavior:H,top:K}})),u),{scrollTargetReached:b,scrollToIndex:g,topListHeight:w}},ia(Su,Xr,dh),{singleton:!0});function Ice(t){return e=>{const n=setTimeout(()=>{e(!1)},t);return i=>{i&&(e(!0),clearTimeout(n))}}}function PA(t,e){t==0?e():requestAnimationFrame(()=>{PA(t-1,e)})}function DA(t,e){const n=e-1;return typeof t=="number"?t:t.index==="LAST"?n:t.index}const sx=Ri(([{defaultItemSize:t,listRefresh:e,sizes:n},{scrollTop:i},{scrollTargetReached:a,scrollToIndex:s},{didMount:r}])=>{const o=Ft(!0),c=Ft(0),u=Ft(!0);return mn(Rt(r,Yn(c),An(([h,d])=>!!d),nu(!1)),o),mn(Rt(r,Yn(c),An(([h,d])=>!!d),nu(!1)),u),Oi(Rt(Ya(e,r),Yn(o,n,t,u),An(([[,h],d,{sizeTree:p},g,b])=>h&&(!qi(p)||TA(g))&&!d&&!b),Yn(c)),([,h])=>{uc(a,()=>{Gn(u,!0)}),PA(4,()=>{uc(i,()=>{Gn(o,!0)}),Gn(s,h)})}),{initialItemFinalLocationReached:u,initialTopMostItemIndex:c,scrolledToInitialItem:o}},ia(Su,Xr,ax,fh),{singleton:!0});function Rk(t,e){return Math.abs(t-e)<1.01}const h1="up",Db="down",zce="none",Bce={atBottom:!1,notAtBottomBecause:"NOT_SHOWING_LAST_ITEM",state:{offsetBottom:0,scrollHeight:0,scrollTop:0,viewportHeight:0}},Uce=0,rx=Ri(([{footerHeight:t,headerHeight:e,scrollBy:n,scrollContainerState:i,scrollTop:a,viewportHeight:s}])=>{const r=Ft(!1),o=Ft(!0),c=gi(),u=gi(),h=Ft(4),d=Ft(Uce),p=ur(Rt(f5(Rt(Tn(a),Jp(1),nu(!0)),Rt(Tn(a),Jp(1),nu(!1),ND(100))),ea()),!1),g=ur(Rt(f5(Rt(n,nu(!0)),Rt(n,nu(!1),ND(200))),ea()),!1);mn(Rt(Ya(Tn(a),Tn(d)),nn(([M,C])=>M<=C),ea()),o),mn(Rt(o,yd(50)),u);const b=Ho(Rt(Ya(i,Tn(s),Tn(e),Tn(t),Tn(h)),ou((M,[{scrollHeight:C,scrollTop:A},N,R,D,B])=>{const z=A+N-C>-B,I={scrollHeight:C,scrollTop:A,viewportHeight:N};if(z){let $,G;return A>M.state.scrollTop?($="SCROLLED_DOWN",G=M.state.scrollTop-A):($="SIZE_DECREASED",G=M.state.scrollTop-A||M.scrollTopDelta),{atBottom:!0,atBottomBecause:$,scrollTopDelta:G,state:I}}let U;return I.scrollHeight>M.state.scrollHeight?U="SIZE_INCREASED":N<M.state.viewportHeight?U="VIEWPORT_HEIGHT_DECREASING":A<M.state.scrollTop?U="SCROLLING_UPWARDS":U="NOT_FULLY_SCROLLED_TO_LAST_ITEM_BOTTOM",{atBottom:!1,notAtBottomBecause:U,state:I}},Bce),ea((M,C)=>M&&M.atBottom===C.atBottom))),w=ur(Rt(i,ou((M,{scrollHeight:C,scrollTop:A,viewportHeight:N})=>{if(Rk(M.scrollHeight,C))return{changed:!1,jump:0,scrollHeight:C,scrollTop:A};{const R=C-(A+N)<1;return M.scrollTop!==A&&R?{changed:!0,jump:M.scrollTop-A,scrollHeight:C,scrollTop:A}:{changed:!0,jump:0,scrollHeight:C,scrollTop:A}}},{changed:!1,jump:0,scrollHeight:0,scrollTop:0}),An(M=>M.changed),nn(M=>M.jump)),0);mn(Rt(b,nn(M=>M.atBottom)),r),mn(Rt(r,yd(50)),c);const x=Ft(Db);mn(Rt(i,nn(({scrollTop:M})=>M),ea(),ou((M,C)=>Ua(g)?{direction:M.direction,prevScrollTop:C}:{direction:C<M.prevScrollTop?h1:Db,prevScrollTop:C},{direction:Db,prevScrollTop:0}),nn(M=>M.direction)),x),mn(Rt(i,yd(50),nu(zce)),x);const S=Ft(0);return mn(Rt(p,An(M=>!M),nu(0)),S),mn(Rt(a,yd(100),Yn(p),An(([M,C])=>!!C),ou(([M,C],[A])=>[C,A],[0,0]),nn(([M,C])=>C-M)),S),{atBottomState:b,atBottomStateChange:c,atBottomThreshold:h,atTopStateChange:u,atTopThreshold:d,isAtBottom:r,isAtTop:o,isScrolling:p,lastJumpDueToItemResize:w,scrollDirection:x,scrollVelocity:S}},ia(Xr)),qS="top",YS="bottom",OD="none";function ID(t,e,n){return typeof t=="number"?n===h1&&e===qS||n===Db&&e===YS?t:0:n===h1?e===qS?t.main:t.reverse:e===YS?t.main:t.reverse}function zD(t,e){var n;return typeof t=="number"?t:(n=t[e])!=null?n:0}const LA=Ri(([{deviation:t,fixedHeaderHeight:e,headerHeight:n,scrollTop:i,viewportHeight:a}])=>{const s=gi(),r=Ft(0),o=Ft(0),c=Ft(0),u=ur(Rt(Ya(Tn(i),Tn(a),Tn(n),Tn(s,d1),Tn(c),Tn(r),Tn(e),Tn(t),Tn(o)),nn(([h,d,p,[g,b],w,x,S,M,C])=>{const A=h-M,N=x+S,R=Math.max(p-A,0);let D=OD;const B=zD(C,qS),z=zD(C,YS);return g-=M,g+=p+S,b+=p+S,b-=M,g>h+N-B&&(D=h1),b<h-R+d+z&&(D=Db),D!==OD?[Math.max(A-p-ID(w,qS,D)-B,0),A-R-S+d+ID(w,YS,D)+z]:null}),An(h=>h!=null),ea(d1)),[0,0]);return{increaseViewportBy:o,listBoundary:s,overscan:c,topListHeight:r,visibleRange:u}},ia(Xr),{singleton:!0});function jce(t,e,n){if(vw(e)){const i=Mk(t,e);return[{index:fc(e.groupOffsetTree,i)[0],offset:0,size:0},{data:n?.[0],index:i,offset:0,size:0}]}return[{data:n?.[0],index:t,offset:0,size:0}]}const WE={bottom:0,firstItemIndex:0,items:[],offsetBottom:0,offsetTop:0,top:0,topItems:[],topListHeight:0,totalCount:0};function mS(t,e,n,i,a,s){const{lastIndex:r,lastOffset:o,lastSize:c}=a;let u=0,h=0;if(t.length>0){u=t[0].offset;const w=t[t.length-1];h=w.offset+w.size}const d=n-r,p=o+d*c+(d-1)*i,g=u,b=p-h;return{bottom:h,firstItemIndex:s,items:BD(t,a,s),offsetBottom:b,offsetTop:u,top:g,topItems:BD(e,a,s),topListHeight:e.reduce((w,x)=>x.size+w,0),totalCount:n}}function Nk(t,e,n,i,a,s){let r=0;if(n.groupIndices.length>0)for(const h of n.groupIndices){if(h-r>=t)break;r++}const o=t+r,c=DA(e,o),u=Array.from({length:o}).map((h,d)=>({data:s[d+c],index:d+c,offset:0,size:0}));return mS(u,[],o,a,n,i)}function BD(t,e,n){if(t.length===0)return[];if(!vw(e))return t.map(u=>({...u,index:u.index+n,originalIndex:u.index}));const i=t[0].index,a=t[t.length-1].index,s=[],r=gw(e.groupOffsetTree,i,a);let o,c=0;for(const u of t){(!o||o.end<u.index)&&(o=r.shift(),c=e.groupIndices.indexOf(o.start));let h;u.index===o.start?h={index:c,type:"group"}:h={groupIndex:c,index:u.index-(c+1)+n},s.push({...h,data:u.data,offset:u.offset,originalIndex:u.index,size:u.size})}return s}const vm=Ri(([{data:t,firstItemIndex:e,gap:n,sizes:i,totalCount:a},s,{listBoundary:r,topListHeight:o,visibleRange:c},{initialTopMostItemIndex:u,scrolledToInitialItem:h},{topListHeight:d},p,{didMount:g},{recalcInProgress:b}])=>{const w=Ft([]),x=Ft(0),S=gi();mn(s.topItemsIndexes,w);const M=ur(Rt(Ya(g,b,Tn(c,d1),Tn(a),Tn(i),Tn(u),h,Tn(w),Tn(e),Tn(n),t),An(([R,D,,B,,,,,,,z])=>{const I=z&&z.length!==B;return R&&!D&&!I}),nn(([,,[R,D],B,z,I,U,$,G,k,X])=>{const V=z,{offsetTree:H,sizeTree:W}=V,J=Ua(x);if(B===0)return{...WE,totalCount:B};if(R===0&&D===0)return J===0?{...WE,totalCount:B}:Nk(J,I,z,G,k,X||[]);if(qi(W))return J>0?null:mS(jce(DA(I,B),V,X),[],B,k,V,G);const Y=[];if($.length>0){const ue=$[0],se=$[$.length-1];let ae=0;for(const ce of gw(W,ue,se)){const pe=ce.value,ye=Math.max(ce.start,ue),_e=Math.min(ce.end,se);for(let me=ye;me<=_e;me++)Y.push({data:X?.[me],index:me,offset:ae,size:pe}),ae+=pe}}if(!U)return mS([],Y,B,k,V,G);const K=$.length>0?$[$.length-1]+1:0,ee=Cce(H,R,D,K);if(ee.length===0)return null;const ie=B-1,Z=mw([],ue=>{for(const se of ee){const ae=se.value;let ce=ae.offset,pe=se.start;const ye=ae.size;if(ae.offset<R){pe+=Math.floor((R-ae.offset+k)/(ye+k));const me=pe-se.start;ce+=me*ye+me*k}pe<K&&(ce+=(K-pe)*ye,pe=K);const _e=Math.min(se.end,ie);for(let me=pe;me<=_e&&!(ce>=D);me++)ue.push({data:X?.[me],index:me,offset:ce,size:ye}),ce+=ye+k}});return mS(Z,Y,B,k,V,G)}),An(R=>R!==null),ea()),WE);mn(Rt(t,An(TA),nn(R=>R?.length)),a),mn(Rt(M,nn(R=>R.topListHeight)),d),mn(d,o),mn(Rt(M,nn(R=>[R.top,R.bottom])),r),mn(Rt(M,nn(R=>R.items)),S);const C=Ho(Rt(M,An(({items:R})=>R.length>0),Yn(a,t),An(([{items:R},D])=>R[R.length-1].originalIndex===D-1),nn(([,R,D])=>[R-1,D]),ea(d1),nn(([R])=>R))),A=Ho(Rt(M,yd(200),An(({items:R,topItems:D})=>R.length>0&&R[0].originalIndex===D.length),nn(({items:R})=>R[0].index),ea())),N=Ho(Rt(M,An(({items:R})=>R.length>0),nn(({items:R})=>{let D=0,B=R.length-1;for(;R[D].type==="group"&&D<B;)D++;for(;R[B].type==="group"&&B>D;)B--;return{endIndex:R[B].index,startIndex:R[D].index}}),ea(wk)));return{endReached:C,initialItemCount:x,itemsRendered:S,listState:M,rangeChanged:N,startReached:A,topItemsIndexes:w,...p}},ia(Su,Ck,LA,sx,ax,rx,fh,RA),{singleton:!0}),Pk=Ri(([{fixedFooterHeight:t,fixedHeaderHeight:e,footerHeight:n,headerHeight:i},{listState:a}])=>{const s=gi(),r=ur(Rt(Ya(n,t,i,e,a),nn(([o,c,u,h,d])=>o+c+u+h+d.offsetBottom+d.bottom)),0);return mn(Tn(r),s),{totalListHeight:r,totalListHeightChanged:s}},ia(Xr,vm),{singleton:!0}),Fce=Ri(([{viewportHeight:t},{totalListHeight:e}])=>{const n=Ft(!1),i=ur(Rt(Ya(n,t,e),An(([a])=>a),nn(([,a,s])=>Math.max(0,a-s)),yd(0),ea()),0);return{alignToBottom:n,paddingTopAddition:i}},ia(Xr,Pk),{singleton:!0}),Dk=Ri(()=>({context:Ft(null)})),Vce=({itemBottom:t,itemTop:e,locationParams:{align:n,behavior:i,...a},viewportBottom:s,viewportTop:r})=>e<r?{...a,align:n??"start",behavior:i}:t>s?{...a,align:n??"end",behavior:i}:null,Lk=Ri(([{gap:t,sizes:e,totalCount:n},{fixedFooterHeight:i,fixedHeaderHeight:a,headerHeight:s,scrollingInProgress:r,scrollTop:o,viewportHeight:c},{scrollToIndex:u}])=>{const h=gi();return mn(Rt(h,Yn(e,c,n,s,a,i,o),Yn(t),nn(([[d,p,g,b,w,x,S,M],C])=>{const{align:A,behavior:N,calculateViewLocation:R=Vce,done:D,...B}=d,z=Tk(d,p,b-1),I=f1(z,p.offsetTree,C)+w+x,U=I+fc(p.sizeTree,z)[1],$=M+x,G=M+g-S,k=R({itemBottom:U,itemTop:I,locationParams:{align:A,behavior:N,...B},viewportBottom:G,viewportTop:$});return k?D&&uc(Rt(r,An(X=>!X),Jp(Ua(r)?1:2)),D):D&&D(),k}),An(d=>d!==null)),u),{scrollIntoView:h}},ia(Su,Xr,ax,vm,dh),{singleton:!0});function UD(t){return t?t==="smooth"?"smooth":"auto":!1}const kce=(t,e)=>typeof t=="function"?UD(t(e)):e&&UD(t),Hce=Ri(([{listRefresh:t,totalCount:e,fixedItemSize:n,data:i},{atBottomState:a,isAtBottom:s},{scrollToIndex:r},{scrolledToInitialItem:o},{didMount:c,propsReady:u},{log:h},{scrollingInProgress:d},{context:p},{scrollIntoView:g}])=>{const b=Ft(!1),w=gi();let x=null;function S(N){Gn(r,{align:"end",behavior:N,index:"LAST"})}Oi(Rt(Ya(Rt(Tn(e),Jp(1)),c),Yn(Tn(b),s,o,d),nn(([[N,R],D,B,z,I])=>{let U=R&&z,$="auto";return U&&($=kce(D,B||I),U=U&&!!$),{followOutputBehavior:$,shouldFollow:U,totalCount:N}}),An(({shouldFollow:N})=>N)),({followOutputBehavior:N,totalCount:R})=>{x&&(x(),x=null),Ua(n)?requestAnimationFrame(()=>{Ua(h)("following output to ",{totalCount:R},vo.DEBUG),S(N)}):x=uc(t,()=>{Ua(h)("following output to ",{totalCount:R},vo.DEBUG),S(N),x=null})});function M(N){const R=uc(a,D=>{N&&!D.atBottom&&D.notAtBottomBecause==="SIZE_INCREASED"&&!x&&(Ua(h)("scrolling to bottom due to increased size",{},vo.DEBUG),S("auto"))});setTimeout(R,100)}Oi(Rt(Ya(Tn(b),e,u),An(([N,,R])=>N&&R),ou(({value:N},[,R])=>({refreshed:N===R,value:R}),{refreshed:!1,value:0}),An(({refreshed:N})=>N),Yn(b,e)),([,N])=>{Ua(o)&&M(N!==!1)}),Oi(w,()=>{M(Ua(b)!==!1)}),Oi(Ya(Tn(b),a),([N,R])=>{N&&!R.atBottom&&R.notAtBottomBecause==="VIEWPORT_HEIGHT_DECREASING"&&S("auto")});const C=Ft(null),A=gi();return mn(f5(Rt(Tn(i),nn(N=>{var R;return(R=N?.length)!=null?R:0})),Rt(Tn(e))),A),Oi(Rt(Ya(Rt(A,Jp(1)),c),Yn(Tn(C),o,d,p),nn(([[N,R],D,B,z,I])=>R&&B&&D?.({context:I,totalCount:N,scrollingInProgress:z})),An(N=>!!N),yd(0)),N=>{x&&(x(),x=null),Ua(n)?requestAnimationFrame(()=>{Ua(h)("scrolling into view",{}),Gn(g,N)}):x=uc(t,()=>{Ua(h)("scrolling into view",{}),Gn(g,N),x=null})}),{autoscrollToBottom:w,followOutput:b,scrollIntoViewOnChange:C}},ia(Su,rx,ax,sx,fh,dh,Xr,Dk,Lk)),$ce=Ri(([{data:t,firstItemIndex:e,gap:n,sizes:i},{initialTopMostItemIndex:a},{initialItemCount:s,listState:r},{didMount:o}])=>(mn(Rt(o,Yn(s),An(([,c])=>c!==0),Yn(a,i,e,n,t),nn(([[,c],u,h,d,p,g=[]])=>Nk(c,u,h,d,p,g))),r),{}),ia(Su,sx,vm,fh),{singleton:!0}),Gce=Ri(([{didMount:t},{scrollTo:e},{listState:n}])=>{const i=Ft(0);return Oi(Rt(t,Yn(i),An(([,a])=>a!==0),nn(([,a])=>({top:a}))),a=>{uc(Rt(n,Jp(1),An(s=>s.items.length>1)),()=>{requestAnimationFrame(()=>{Gn(e,a)})})}),{initialScrollTop:i}},ia(fh,Xr,vm),{singleton:!0}),Ok=Ri(([{scrollVelocity:t}])=>{const e=Ft(!1),n=gi(),i=Ft(!1);return mn(Rt(t,Yn(i,e,n),An(([a,s])=>!!s),nn(([a,s,r,o])=>{const{enter:c,exit:u}=s;if(r){if(u(a,o))return!1}else if(c(a,o))return!0;return r}),ea()),e),Oi(Rt(Ya(e,t,n),Yn(i)),([[a,s,r],o])=>{a&&o&&o.change&&o.change(s,r)}),{isSeeking:e,scrollSeekConfiguration:i,scrollSeekRangeChanged:n,scrollVelocity:t}},ia(rx),{singleton:!0}),OA=Ri(([{scrollContainerState:t,scrollTo:e}])=>{const n=gi(),i=gi(),a=gi(),s=Ft(!1),r=Ft(void 0);return mn(Rt(Ya(n,i),nn(([{scrollHeight:o,scrollTop:c,viewportHeight:u},{offsetTop:h}])=>({scrollHeight:o,scrollTop:Math.max(0,c-h),viewportHeight:u}))),t),mn(Rt(e,Yn(i),nn(([o,{offsetTop:c}])=>({...o,top:o.top+c}))),a),{customScrollParent:r,useWindowScroll:s,windowScrollContainerState:n,windowScrollTo:a,windowViewportRect:i}},ia(Xr)),Wce=Ri(([{sizeRanges:t,sizes:e},{headerHeight:n,scrollTop:i},{initialTopMostItemIndex:a},{didMount:s},{useWindowScroll:r,windowScrollContainerState:o,windowViewportRect:c}])=>{const u=gi(),h=Ft(void 0),d=Ft(null),p=Ft(null);return mn(o,d),mn(c,p),Oi(Rt(u,Yn(e,i,r,d,p,n)),([g,b,w,x,S,M,C])=>{const A=Rce(b.sizeTree);x&&S!==null&&M!==null&&(w=S.scrollTop-M.offsetTop),w-=C,g({ranges:A,scrollTop:w})}),mn(Rt(h,An(TA),nn(Kce)),a),mn(Rt(s,Yn(h),An(([,g])=>g!==void 0),ea(),nn(([,g])=>g.ranges)),t),{getState:u,restoreStateFrom:h}},ia(Su,Xr,sx,fh,OA));function Kce(t){return{align:"start",index:0,offset:t.scrollTop}}const Xce=Ri(([{topItemsIndexes:t}])=>{const e=Ft(0);return mn(Rt(e,An(n=>n>=0),nn(n=>Array.from({length:n}).map((i,a)=>a))),t),{topItemCount:e}},ia(vm));function Ik(t){let e=!1,n;return()=>(e||(e=!0,n=t()),n)}const qce=Ik(()=>/iP(ad|od|hone)/i.test(navigator.userAgent)&&/WebKit/i.test(navigator.userAgent)),Yce=Ri(([{deviation:t,scrollBy:e,scrollingInProgress:n,scrollTop:i},{isAtBottom:a,isScrolling:s,lastJumpDueToItemResize:r,scrollDirection:o},{listState:c},{beforeUnshiftWith:u,gap:h,shiftWithOffset:d,sizes:p},{log:g},{recalcInProgress:b}])=>{const w=Ho(Rt(c,Yn(r),ou(([,S,M,C],[{bottom:A,items:N,offsetBottom:R,totalCount:D},B])=>{const z=A+R;let I=0;return M===D&&S.length>0&&N.length>0&&(N[0].originalIndex===0&&S[0].originalIndex===0||(I=z-C,I!==0&&(I+=B))),[I,N,D,z]},[0,[],0,0]),An(([S])=>S!==0),Yn(i,o,n,a,g,b),An(([,S,M,C,,,A])=>!A&&!C&&S!==0&&M===h1),nn(([[S],,,,,M])=>(M("Upward scrolling compensation",{amount:S},vo.DEBUG),S))));function x(S){S>0?(Gn(e,{behavior:"auto",top:-S}),Gn(t,0)):(Gn(t,0),Gn(e,{behavior:"auto",top:-S}))}return Oi(Rt(w,Yn(t,s)),([S,M,C])=>{C&&qce()?Gn(t,M-S):x(-S)}),Oi(Rt(Ya(ur(s,!1),t,b),An(([S,M,C])=>!S&&!C&&M!==0),nn(([S,M])=>M),yd(1)),x),mn(Rt(d,nn(S=>({top:-S}))),e),Oi(Rt(u,Yn(p,h),nn(([S,{groupIndices:M,lastSize:C,sizeTree:A},N])=>{function R(D){return D*(C+N)}if(M.length===0)return R(S);{let D=0;const B=u1(A,0);let z=0,I=0;for(;z<S;){z++,D+=B;let U=M.length===I+1?1/0:M[I+1]-M[I]-1;z+U>S&&(D-=B,U=S-z+1),z+=U,D+=R(U),I++}return D}})),S=>{Gn(t,S),requestAnimationFrame(()=>{Gn(e,{top:S}),requestAnimationFrame(()=>{Gn(t,0),Gn(b,!1)})})}),{deviation:t}},ia(Xr,rx,vm,Su,dh,RA)),Zce=Ri(([t,e,n,i,a,s,r,o,c,u,h])=>({...t,...e,...n,...i,...a,...s,...r,...o,...c,...u,...h}),ia(LA,$ce,fh,Ok,Pk,Gce,Fce,OA,Lk,dh,Dk)),zk=Ri(([{data:t,defaultItemSize:e,firstItemIndex:n,fixedItemSize:i,gap:a,groupIndices:s,itemSize:r,sizeRanges:o,sizes:c,statefulTotalCount:u,totalCount:h,trackItemSizes:d},{initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:b},w,x,S,{listState:M,topItemsIndexes:C,...A},{scrollToIndex:N},R,{topItemCount:D},{groupCounts:B},z])=>(mn(A.rangeChanged,z.scrollSeekRangeChanged),mn(Rt(z.windowViewportRect,nn(I=>I.visibleHeight)),w.viewportHeight),{data:t,defaultItemHeight:e,firstItemIndex:n,fixedItemHeight:i,gap:a,groupCounts:B,initialItemFinalLocationReached:p,initialTopMostItemIndex:g,scrolledToInitialItem:b,sizeRanges:o,topItemCount:D,topItemsIndexes:C,totalCount:h,...S,groupIndices:s,itemSize:r,listState:M,scrollToIndex:N,statefulTotalCount:u,trackItemSizes:d,...A,...z,...w,sizes:c,...x}),ia(Su,sx,Xr,Wce,Hce,vm,ax,Yce,Xce,Ck,Zce));function Qce(t,e){const n={},i={};let a=0;const s=t.length;for(;a<s;)i[t[a]]=1,a+=1;for(const r in e)Object.hasOwn(i,r)||(n[r]=e[r]);return n}const i_=typeof document<"u"?ft.useLayoutEffect:ft.useEffect;function Bk(t,e,n){const i=Object.keys(e.required||{}),a=Object.keys(e.optional||{}),s=Object.keys(e.methods||{}),r=Object.keys(e.events||{}),o=ft.createContext({});function c(x,S){x.propsReady&&Gn(x.propsReady,!1);for(const M of i){const C=x[e.required[M]];Gn(C,S[M])}for(const M of a)if(M in S){const C=x[e.optional[M]];Gn(C,S[M])}x.propsReady&&Gn(x.propsReady,!0)}function u(x){return s.reduce((S,M)=>(S[M]=C=>{const A=x[e.methods[M]];Gn(A,C)},S),{})}function h(x){return r.reduce((S,M)=>(S[M]=pce(x[e.events[M]]),S),{})}const d=ft.forwardRef((x,S)=>{const{children:M,...C}=x,[A]=ft.useState(()=>mw(gce(t),D=>{c(D,C)})),[N]=ft.useState(RD(h,A));i_(()=>{for(const D of r)D in C&&Oi(N[D],C[D]);return()=>{Object.values(N).map(CA)}},[C,N,A]),i_(()=>{c(A,C)}),ft.useImperativeHandle(S,AD(u(A)));const R=n;return _.jsx(o.Provider,{value:A,children:n?_.jsx(R,{...Qce([...i,...a,...r],C),children:M}):M})}),p=x=>{const S=ft.useContext(o);return ft.useCallback(M=>{Gn(S[x],M)},[S,x])},g=x=>{const S=ft.useContext(o)[x],M=ft.useCallback(C=>Oi(S,C),[S]);return ft.useSyncExternalStore(M,()=>Ua(S),()=>Ua(S))},b=x=>{const S=ft.useContext(o)[x],[M,C]=ft.useState(RD(Ua,S));return i_(()=>Oi(S,A=>{A!==M&&C(AD(A))}),[S,M]),M},w=ft.version.startsWith("18")?g:b;return{Component:d,useEmitter:(x,S)=>{const M=ft.useContext(o)[x];i_(()=>Oi(M,S),[S,M])},useEmitterValue:w,usePublisher:p}}const Uk=ft.createContext(void 0),jk=ft.createContext(void 0),Fk=typeof document<"u"?ft.useLayoutEffect:ft.useEffect;function KE(t){return"self"in t}function Jce(t){return"body"in t}function Vk(t,e,n,i=lv,a,s){const r=ft.useRef(null),o=ft.useRef(null),c=ft.useRef(null),u=ft.useCallback(p=>{let g,b,w;const x=p.target;if(Jce(x)||KE(x)){const M=KE(x)?x:x.defaultView;w=s?M.scrollX:M.scrollY,g=s?M.document.documentElement.scrollWidth:M.document.documentElement.scrollHeight,b=s?M.innerWidth:M.innerHeight}else w=s?x.scrollLeft:x.scrollTop,g=s?x.scrollWidth:x.scrollHeight,b=s?x.offsetWidth:x.offsetHeight;const S=()=>{t({scrollHeight:g,scrollTop:Math.max(w,0),viewportHeight:b})};p.suppressFlushSync?S():uC.flushSync(S),o.current!==null&&(w===o.current||w<=0||w===g-b)&&(o.current=null,e(!0),c.current&&(clearTimeout(c.current),c.current=null))},[t,e,s]);ft.useEffect(()=>{const p=a||r.current;return i(a||r.current),u({suppressFlushSync:!0,target:p}),p.addEventListener("scroll",u,{passive:!0}),()=>{i(null),p.removeEventListener("scroll",u)}},[r,u,n,i,a]);function h(p){const g=r.current;if(!g||(s?"offsetWidth"in g&&g.offsetWidth===0:"offsetHeight"in g&&g.offsetHeight===0))return;const b=p.behavior==="smooth";let w,x,S;KE(g)?(x=Math.max(Qf(g.document.documentElement,s?"width":"height"),s?g.document.documentElement.scrollWidth:g.document.documentElement.scrollHeight),w=s?g.innerWidth:g.innerHeight,S=s?window.scrollX:window.scrollY):(x=g[s?"scrollWidth":"scrollHeight"],w=Qf(g,s?"width":"height"),S=g[s?"scrollLeft":"scrollTop"]);const M=x-w;if(p.top=Math.ceil(Math.max(Math.min(M,p.top),0)),Rk(w,x)||p.top===S){t({scrollHeight:x,scrollTop:S,viewportHeight:w}),b&&e(!0);return}b?(o.current=p.top,c.current&&clearTimeout(c.current),c.current=setTimeout(()=>{c.current=null,o.current=null,e(!0)},1e3)):o.current=null,s&&(p={behavior:p.behavior,left:p.top}),g.scrollTo(p)}function d(p){s&&(p={behavior:p.behavior,left:p.top}),r.current.scrollBy(p)}return{scrollByCallback:d,scrollerRef:r,scrollToCallback:h}}const XE="-webkit-sticky",jD="sticky",IA=Ik(()=>{if(typeof document>"u")return jD;const t=document.createElement("div");return t.style.position=XE,t.style.position===XE?XE:jD});function zA(t){return t}const eue=Ri(()=>{const t=Ft(o=>`Item ${o}`),e=Ft(o=>`Group ${o}`),n=Ft({}),i=Ft(zA),a=Ft("div"),s=Ft(lv),r=(o,c=null)=>ur(Rt(n,nn(u=>u[o]),ea()),c);return{components:n,computeItemKey:i,EmptyPlaceholder:r("EmptyPlaceholder"),FooterComponent:r("Footer"),GroupComponent:r("Group","div"),groupContent:e,HeaderComponent:r("Header"),HeaderFooterTag:a,ItemComponent:r("Item","div"),itemContent:t,ListComponent:r("List","div"),ScrollerComponent:r("Scroller","div"),scrollerRef:s,ScrollSeekPlaceholder:r("ScrollSeekPlaceholder"),TopItemListComponent:r("TopItemList")}}),tue=Ri(([t,e])=>({...t,...e}),ia(zk,eue)),nue=({height:t})=>_.jsx("div",{style:{height:t}}),iue={overflowAnchor:"none",position:IA(),zIndex:1},kk={overflowAnchor:"none"},aue={...kk,display:"inline-block",height:"100%"},FD=ft.memo(function({showTopList:t=!1}){const e=In("listState"),n=Sl("sizeRanges"),i=In("useWindowScroll"),a=In("customScrollParent"),s=Sl("windowScrollContainerState"),r=Sl("scrollContainerState"),o=a||i?s:r,c=In("itemContent"),u=In("context"),h=In("groupContent"),d=In("trackItemSizes"),p=In("itemSize"),g=In("log"),b=Sl("gap"),w=In("horizontalDirection"),{callbackRef:x}=bce(n,p,d,t?lv:o,g,b,a,w,In("skipAnimationFrameInResizeObserver")),[S,M]=ft.useState(0);BA("deviation",k=>{S!==k&&M(k)});const C=In("EmptyPlaceholder"),A=In("ScrollSeekPlaceholder")||nue,N=In("ListComponent"),R=In("ItemComponent"),D=In("GroupComponent"),B=In("computeItemKey"),z=In("isSeeking"),I=In("groupIndices").length>0,U=In("alignToBottom"),$=In("initialItemFinalLocationReached"),G=t?{}:{boxSizing:"border-box",...w?{display:"inline-block",height:"100%",marginLeft:S!==0?S:U?"auto":0,paddingLeft:e.offsetTop,paddingRight:e.offsetBottom,whiteSpace:"nowrap"}:{marginTop:S!==0?S:U?"auto":0,paddingBottom:e.offsetBottom,paddingTop:e.offsetTop},...$?{}:{visibility:"hidden"}};return!t&&e.totalCount===0&&C?_.jsx(C,{...lr(C,u)}):_.jsx(N,{...lr(N,u),"data-testid":t?"virtuoso-top-item-list":"virtuoso-item-list",ref:x,style:G,children:(t?e.topItems:e.items).map(k=>{const X=k.originalIndex,V=B(X+e.firstItemIndex,k.data,u);return z?P.createElement(A,{...lr(A,u),height:k.size,index:k.index,key:V,type:k.type||"item",...k.type==="group"?{}:{groupIndex:k.groupIndex}}):k.type==="group"?P.createElement(D,{...lr(D,u),"data-index":X,"data-item-index":k.index,"data-known-size":k.size,key:V,style:iue},h(k.index,u)):P.createElement(R,{...lr(R,u),...lue(R,k.data),"data-index":X,"data-item-group-index":k.groupIndex,"data-item-index":k.index,"data-known-size":k.size,key:V,style:w?aue:kk},I?c(k.index,k.groupIndex,k.data,u):c(k.index,k.data,u))})})}),sue={height:"100%",outline:"none",overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},rue={outline:"none",overflowX:"auto",position:"relative"},yw=t=>({height:"100%",position:"absolute",top:0,width:"100%",...t?{display:"flex",flexDirection:"column"}:{}}),oue={position:IA(),top:0,width:"100%",zIndex:1};function lr(t,e){if(typeof t!="string")return{context:e}}function lue(t,e){return{item:typeof t=="string"?void 0:e}}const cue=ft.memo(function(){const t=In("HeaderComponent"),e=Sl("headerHeight"),n=In("HeaderFooterTag"),i=gm(ft.useMemo(()=>s=>{e(Qf(s,"height"))},[e]),!0,In("skipAnimationFrameInResizeObserver")),a=In("context");return t?_.jsx(n,{ref:i,children:_.jsx(t,{...lr(t,a)})}):null}),uue=ft.memo(function(){const t=In("FooterComponent"),e=Sl("footerHeight"),n=In("HeaderFooterTag"),i=gm(ft.useMemo(()=>s=>{e(Qf(s,"height"))},[e]),!0,In("skipAnimationFrameInResizeObserver")),a=In("context");return t?_.jsx(n,{ref:i,children:_.jsx(t,{...lr(t,a)})}):null});function Hk({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ft.memo(function({children:i,style:a,context:s,...r}){const o=n("scrollContainerState"),c=e("ScrollerComponent"),u=n("smoothScrollTargetReached"),h=e("scrollerRef"),d=e("horizontalDirection")||!1,{scrollByCallback:p,scrollerRef:g,scrollToCallback:b}=Vk(o,u,c,h,void 0,d);return t("scrollTo",b),t("scrollBy",p),_.jsx(c,{"data-testid":"virtuoso-scroller","data-virtuoso-scroller":!0,ref:g,style:{...d?rue:sue,...a},tabIndex:0,...r,...lr(c,s),children:i})})}function $k({useEmitter:t,useEmitterValue:e,usePublisher:n}){return ft.memo(function({children:i,style:a,context:s,...r}){const o=n("windowScrollContainerState"),c=e("ScrollerComponent"),u=n("smoothScrollTargetReached"),h=e("totalListHeight"),d=e("deviation"),p=e("customScrollParent"),g=ft.useRef(null),b=e("scrollerRef"),{scrollByCallback:w,scrollerRef:x,scrollToCallback:S}=Vk(o,u,c,b,p);return Fk(()=>{var M;return x.current=p||((M=g.current)==null?void 0:M.ownerDocument.defaultView),()=>{x.current=null}},[x,p]),t("windowScrollTo",S),t("scrollBy",w),_.jsx(c,{ref:g,"data-virtuoso-scroller":!0,style:{position:"relative",...a,...h!==0?{height:h+d}:{}},...r,...lr(c,s),children:i})})}const due=({children:t})=>{const e=ft.useContext(Uk),n=Sl("viewportHeight"),i=Sl("fixedItemHeight"),a=In("alignToBottom"),s=In("horizontalDirection"),r=ft.useMemo(()=>mk(n,c=>Qf(c,s?"width":"height")),[n,s]),o=gm(r,!0,In("skipAnimationFrameInResizeObserver"));return ft.useEffect(()=>{e&&(n(e.viewportHeight),i(e.itemHeight))},[e,n,i]),_.jsx("div",{"data-viewport-type":"element",ref:o,style:yw(a),children:t})},fue=({children:t})=>{const e=ft.useContext(Uk),n=Sl("windowViewportRect"),i=Sl("fixedItemHeight"),a=In("customScrollParent"),s=vk(n,a,In("skipAnimationFrameInResizeObserver")),r=In("alignToBottom");return ft.useEffect(()=>{e&&(i(e.itemHeight),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:100}))},[e,n,i]),_.jsx("div",{"data-viewport-type":"window",ref:s,style:yw(r),children:t})},hue=({children:t})=>{const e=In("TopItemListComponent")||"div",n=In("headerHeight"),i={...oue,marginTop:`${n}px`},a=In("context");return _.jsx(e,{style:i,...lr(e,a),children:t})},pue=ft.memo(function(t){const e=In("useWindowScroll"),n=In("topItemsIndexes").length>0,i=In("customScrollParent"),a=In("context");return _.jsxs(i||e?vue:gue,{...t,context:a,children:[n&&_.jsx(hue,{children:_.jsx(FD,{showTopList:!0})}),_.jsxs(i||e?fue:due,{children:[_.jsx(cue,{}),_.jsx(FD,{}),_.jsx(uue,{})]})]})}),{Component:mue,useEmitter:BA,useEmitterValue:In,usePublisher:Sl}=Bk(tue,{required:{},optional:{restoreStateFrom:"restoreStateFrom",context:"context",followOutput:"followOutput",scrollIntoViewOnChange:"scrollIntoViewOnChange",itemContent:"itemContent",groupContent:"groupContent",overscan:"overscan",increaseViewportBy:"increaseViewportBy",totalCount:"totalCount",groupCounts:"groupCounts",topItemCount:"topItemCount",firstItemIndex:"firstItemIndex",initialTopMostItemIndex:"initialTopMostItemIndex",components:"components",atBottomThreshold:"atBottomThreshold",atTopThreshold:"atTopThreshold",computeItemKey:"computeItemKey",defaultItemHeight:"defaultItemHeight",fixedItemHeight:"fixedItemHeight",itemSize:"itemSize",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"HeaderFooterTag",data:"data",initialItemCount:"initialItemCount",initialScrollTop:"initialScrollTop",alignToBottom:"alignToBottom",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",horizontalDirection:"horizontalDirection",skipAnimationFrameInResizeObserver:"skipAnimationFrameInResizeObserver"},methods:{scrollToIndex:"scrollToIndex",scrollIntoView:"scrollIntoView",scrollTo:"scrollTo",scrollBy:"scrollBy",autoscrollToBottom:"autoscrollToBottom",getState:"getState"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",totalListHeightChanged:"totalListHeightChanged",itemsRendered:"itemsRendered",groupIndices:"groupIndices"}},pue),gue=Hk({useEmitter:BA,useEmitterValue:In,usePublisher:Sl}),vue=$k({useEmitter:BA,useEmitterValue:In,usePublisher:Sl}),UA=mue,yue=Ri(()=>{const t=Ft(u=>_.jsxs("td",{children:["Item $",u]})),e=Ft(null),n=Ft(u=>_.jsxs("td",{colSpan:1e3,children:["Group ",u]})),i=Ft(null),a=Ft(null),s=Ft({}),r=Ft(zA),o=Ft(lv),c=(u,h=null)=>ur(Rt(s,nn(d=>d[u]),ea()),h);return{components:s,computeItemKey:r,context:e,EmptyPlaceholder:c("EmptyPlaceholder"),FillerRow:c("FillerRow"),fixedFooterContent:a,fixedHeaderContent:i,itemContent:t,groupContent:n,ScrollerComponent:c("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder"),TableBodyComponent:c("TableBody","tbody"),TableComponent:c("Table","table"),TableFooterComponent:c("TableFoot","tfoot"),TableHeadComponent:c("TableHead","thead"),TableRowComponent:c("TableRow","tr"),GroupComponent:c("Group","tr")}});ia(zk,yue);IA();const VD={bottom:0,itemHeight:0,items:[],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},bue={bottom:0,itemHeight:0,items:[{index:0}],itemWidth:0,offsetBottom:0,offsetTop:0,top:0},{ceil:kD,floor:ZS,max:Lb,min:qE,round:HD}=Math;function $D(t,e,n){return Array.from({length:e-t+1}).map((i,a)=>({data:n===null?null:n[a+t],index:a+t}))}function xue(t){return{...bue,items:t}}function a_(t,e){return t&&t.width===e.width&&t.height===e.height}function _ue(t,e){return t&&t.column===e.column&&t.row===e.row}const Sue=Ri(([{increaseViewportBy:t,listBoundary:e,overscan:n,visibleRange:i},{footerHeight:a,headerHeight:s,scrollBy:r,scrollContainerState:o,scrollTo:c,scrollTop:u,smoothScrollTargetReached:h,viewportHeight:d},p,g,{didMount:b,propsReady:w},{customScrollParent:x,useWindowScroll:S,windowScrollContainerState:M,windowScrollTo:C,windowViewportRect:A},N])=>{const R=Ft(0),D=Ft(0),B=Ft(VD),z=Ft({height:0,width:0}),I=Ft({height:0,width:0}),U=gi(),$=gi(),G=Ft(0),k=Ft(null),X=Ft({column:0,row:0}),V=gi(),H=gi(),W=Ft(!1),J=Ft(0),Y=Ft(!0),K=Ft(!1),ee=Ft(!1);Oi(Rt(b,Yn(J),An(([ce,pe])=>!!pe)),()=>{Gn(Y,!1)}),Oi(Rt(Ya(b,Y,I,z,J,K),An(([ce,pe,ye,_e,,me])=>ce&&!pe&&ye.height!==0&&_e.height!==0&&!me)),([,,,,ce])=>{Gn(K,!0),PA(1,()=>{Gn(U,ce)}),uc(Rt(u),()=>{Gn(e,[0,0]),Gn(Y,!0)})}),mn(Rt(H,An(ce=>ce!=null&&ce.scrollTop>0),nu(0)),D),Oi(Rt(b,Yn(H),An(([,ce])=>ce!=null)),([,ce])=>{ce&&(Gn(z,ce.viewport),Gn(I,ce.item),Gn(X,ce.gap),ce.scrollTop>0&&(Gn(W,!0),uc(Rt(u,Jp(1)),pe=>{Gn(W,!1)}),Gn(c,{top:ce.scrollTop})))}),mn(Rt(z,nn(({height:ce})=>ce)),d),mn(Rt(Ya(Tn(z,a_),Tn(I,a_),Tn(X,(ce,pe)=>ce&&ce.column===pe.column&&ce.row===pe.row),Tn(u)),nn(([ce,pe,ye,_e])=>({gap:ye,item:pe,scrollTop:_e,viewport:ce}))),V),mn(Rt(Ya(Tn(R),i,Tn(X,_ue),Tn(I,a_),Tn(z,a_),Tn(k),Tn(D),Tn(W),Tn(Y),Tn(J)),An(([,,,,,,,ce])=>!ce),nn(([ce,[pe,ye],_e,me,ne,be,xe,,he,ve])=>{const{column:Oe,row:Le}=_e,{height:Ae,width:et}=me,{width:tt}=ne;if(xe===0&&(ce===0||tt===0))return VD;if(et===0){const mt=DA(ve,ce),nt=mt+Math.max(xe-1,0);return xue($D(mt,nt,be))}const re=Gk(tt,et,Oe);let te,we;he?pe===0&&ye===0&&xe>0?(te=0,we=xe-1):(te=re*ZS((pe+Le)/(Ae+Le)),we=re*kD((ye+Le)/(Ae+Le))-1,we=qE(ce-1,Lb(we,re-1)),te=qE(we,Lb(0,te))):(te=0,we=-1);const Ce=$D(te,we,be),{bottom:Ie,top:Pe}=GD(ne,_e,me,Ce),Ze=kD(ce/re),We=Ze*Ae+(Ze-1)*Le-Ie;return{bottom:Ie,itemHeight:Ae,items:Ce,itemWidth:et,offsetBottom:We,offsetTop:Pe,top:Pe}})),B),mn(Rt(k,An(ce=>ce!==null),nn(ce=>ce.length)),R),mn(Rt(Ya(z,I,B,X),An(([ce,pe,{items:ye}])=>ye.length>0&&pe.height!==0&&ce.height!==0),nn(([ce,pe,{items:ye},_e])=>{const{bottom:me,top:ne}=GD(ce,_e,pe,ye);return[ne,me]}),ea(d1)),e);const ie=Ft(!1);mn(Rt(u,Yn(ie),nn(([ce,pe])=>pe||ce!==0)),ie);const Z=Ho(Rt(Ya(B,R),An(([{items:ce}])=>ce.length>0),Yn(ie),An(([[ce,pe],ye])=>{const _e=ce.items[ce.items.length-1].index===pe-1;return(ye||ce.bottom>0&&ce.itemHeight>0&&ce.offsetBottom===0&&ce.items.length===pe)&&_e}),nn(([[,ce]])=>ce-1),ea())),ue=Ho(Rt(Tn(B),An(({items:ce})=>ce.length>0&&ce[0].index===0),nu(0),ea())),se=Ho(Rt(Tn(B),Yn(W),An(([{items:ce},pe])=>ce.length>0&&!pe),nn(([{items:ce}])=>({endIndex:ce[ce.length-1].index,startIndex:ce[0].index})),ea(wk),yd(0)));mn(se,g.scrollSeekRangeChanged),mn(Rt(U,Yn(z,I,R,X),nn(([ce,pe,ye,_e,me])=>{const ne=Ak(ce),{align:be,behavior:xe,offset:he}=ne;let ve=ne.index;ve==="LAST"&&(ve=_e-1),ve=Lb(0,ve,qE(_e-1,ve));let Oe=v5(pe,me,ye,ve);return be==="end"?Oe=HD(Oe-pe.height+ye.height):be==="center"&&(Oe=HD(Oe-pe.height/2+ye.height/2)),he&&(Oe+=he),{behavior:xe,top:Oe}})),c);const ae=ur(Rt(B,nn(ce=>ce.offsetBottom+ce.bottom)),0);return mn(Rt(A,nn(ce=>({height:ce.visibleHeight,width:ce.visibleWidth}))),z),{customScrollParent:x,data:k,deviation:G,footerHeight:a,gap:X,headerHeight:s,increaseViewportBy:t,initialItemCount:D,itemDimensions:I,overscan:n,restoreStateFrom:H,scrollBy:r,scrollContainerState:o,scrollHeight:$,scrollTo:c,scrollToIndex:U,scrollTop:u,smoothScrollTargetReached:h,totalCount:R,useWindowScroll:S,viewportDimensions:z,windowScrollContainerState:M,windowScrollTo:C,windowViewportRect:A,...g,gridState:B,horizontalDirection:ee,initialTopMostItemIndex:J,totalListHeight:ae,...p,endReached:Z,propsReady:w,rangeChanged:se,startReached:ue,stateChanged:V,stateRestoreInProgress:W,...N}},ia(LA,Xr,rx,Ok,fh,OA,dh));function Gk(t,e,n){return Lb(1,ZS((t+n)/(ZS(e)+n)))}function GD(t,e,n,i){const{height:a}=n;if(a===void 0||i.length===0)return{bottom:0,top:0};const s=v5(t,e,n,i[0].index);return{bottom:v5(t,e,n,i[i.length-1].index)+a,top:s}}function v5(t,e,n,i){const a=Gk(t.width,n.width,e.column),s=ZS(i/a),r=s*n.height+Lb(0,s-1)*e.row;return r>0?r+e.row:r}const wue=Ri(()=>{const t=Ft(d=>`Item ${d}`),e=Ft({}),n=Ft(null),i=Ft("virtuoso-grid-item"),a=Ft("virtuoso-grid-list"),s=Ft(zA),r=Ft("div"),o=Ft(lv),c=(d,p=null)=>ur(Rt(e,nn(g=>g[d]),ea()),p),u=Ft(!1),h=Ft(!1);return mn(Tn(h),u),{components:e,computeItemKey:s,context:n,FooterComponent:c("Footer"),HeaderComponent:c("Header"),headerFooterTag:r,itemClassName:i,ItemComponent:c("Item","div"),itemContent:t,listClassName:a,ListComponent:c("List","div"),readyStateChanged:u,reportReadyState:h,ScrollerComponent:c("Scroller","div"),scrollerRef:o,ScrollSeekPlaceholder:c("ScrollSeekPlaceholder","div")}}),Eue=Ri(([t,e])=>({...t,...e}),ia(Sue,wue)),Mue=ft.memo(function(){const t=da("gridState"),e=da("listClassName"),n=da("itemClassName"),i=da("itemContent"),a=da("computeItemKey"),s=da("isSeeking"),r=wl("scrollHeight"),o=da("ItemComponent"),c=da("ListComponent"),u=da("ScrollSeekPlaceholder"),h=da("context"),d=wl("itemDimensions"),p=wl("gap"),g=da("log"),b=da("stateRestoreInProgress"),w=wl("reportReadyState"),x=gm(ft.useMemo(()=>S=>{const M=S.parentElement.parentElement.scrollHeight;r(M);const C=S.firstChild;if(C){const{height:A,width:N}=C.getBoundingClientRect();d({height:A,width:N})}p({column:WD("column-gap",getComputedStyle(S).columnGap,g),row:WD("row-gap",getComputedStyle(S).rowGap,g)})},[r,d,p,g]),!0,!1);return Fk(()=>{t.itemHeight>0&&t.itemWidth>0&&w(!0)},[t]),b?null:_.jsx(c,{className:e,ref:x,...lr(c,h),"data-testid":"virtuoso-item-list",style:{paddingBottom:t.offsetBottom,paddingTop:t.offsetTop},children:t.items.map(S=>{const M=a(S.index,S.data,h);return s?_.jsx(u,{...lr(u,h),height:t.itemHeight,index:S.index,width:t.itemWidth},M):P.createElement(o,{...lr(o,h),className:n,"data-index":S.index,key:M},i(S.index,S.data,h))})})}),Tue=ft.memo(function(){const t=da("HeaderComponent"),e=wl("headerHeight"),n=da("headerFooterTag"),i=gm(ft.useMemo(()=>s=>{e(Qf(s,"height"))},[e]),!0,!1),a=da("context");return t?_.jsx(n,{ref:i,children:_.jsx(t,{...lr(t,a)})}):null}),Cue=ft.memo(function(){const t=da("FooterComponent"),e=wl("footerHeight"),n=da("headerFooterTag"),i=gm(ft.useMemo(()=>s=>{e(Qf(s,"height"))},[e]),!0,!1),a=da("context");return t?_.jsx(n,{ref:i,children:_.jsx(t,{...lr(t,a)})}):null}),Aue=({children:t})=>{const e=ft.useContext(jk),n=wl("itemDimensions"),i=wl("viewportDimensions"),a=gm(ft.useMemo(()=>s=>{i(s.getBoundingClientRect())},[i]),!0,!1);return ft.useEffect(()=>{e&&(i({height:e.viewportHeight,width:e.viewportWidth}),n({height:e.itemHeight,width:e.itemWidth}))},[e,i,n]),_.jsx("div",{ref:a,style:yw(!1),children:t})},Rue=({children:t})=>{const e=ft.useContext(jk),n=wl("windowViewportRect"),i=wl("itemDimensions"),a=da("customScrollParent"),s=vk(n,a,!1);return ft.useEffect(()=>{e&&(i({height:e.itemHeight,width:e.itemWidth}),n({offsetTop:0,visibleHeight:e.viewportHeight,visibleWidth:e.viewportWidth}))},[e,n,i]),_.jsx("div",{ref:s,style:yw(!1),children:t})},Nue=ft.memo(function({...t}){const e=da("useWindowScroll"),n=da("customScrollParent"),i=n||e?Lue:Due,a=n||e?Rue:Aue,s=da("context");return _.jsx(i,{...t,...lr(i,s),children:_.jsxs(a,{children:[_.jsx(Tue,{}),_.jsx(Mue,{}),_.jsx(Cue,{})]})})}),{Component:Pue,useEmitter:Wk,useEmitterValue:da,usePublisher:wl}=Bk(Eue,{optional:{context:"context",totalCount:"totalCount",overscan:"overscan",itemContent:"itemContent",components:"components",computeItemKey:"computeItemKey",data:"data",initialItemCount:"initialItemCount",scrollSeekConfiguration:"scrollSeekConfiguration",headerFooterTag:"headerFooterTag",listClassName:"listClassName",itemClassName:"itemClassName",useWindowScroll:"useWindowScroll",customScrollParent:"customScrollParent",scrollerRef:"scrollerRef",logLevel:"logLevel",restoreStateFrom:"restoreStateFrom",initialTopMostItemIndex:"initialTopMostItemIndex",increaseViewportBy:"increaseViewportBy"},methods:{scrollTo:"scrollTo",scrollBy:"scrollBy",scrollToIndex:"scrollToIndex"},events:{isScrolling:"isScrolling",endReached:"endReached",startReached:"startReached",rangeChanged:"rangeChanged",atBottomStateChange:"atBottomStateChange",atTopStateChange:"atTopStateChange",stateChanged:"stateChanged",readyStateChanged:"readyStateChanged"}},Nue),Due=Hk({useEmitter:Wk,useEmitterValue:da,usePublisher:wl}),Lue=$k({useEmitter:Wk,useEmitterValue:da,usePublisher:wl});function WD(t,e,n){return e!=="normal"&&!(e!=null&&e.endsWith("px"))&&n(`${t} was not resolved to pixel value correctly`,e,vo.WARN),e==="normal"?0:parseInt(e??"0",10)}const Kk=Pue;var YE={exports:{}};/*!
Copyright (c) 2018 Jed Watson.
Licensed under the MIT License (MIT), see
http://jedwatson.github.io/classnames
*/var KD;function Oue(){return KD||(KD=1,(function(t){(function(){var e={}.hasOwnProperty;function n(){for(var s="",r=0;r<arguments.length;r++){var o=arguments[r];o&&(s=a(s,i(o)))}return s}function i(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return n.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var r="";for(var o in s)e.call(s,o)&&s[o]&&(r=a(r,o));return r}function a(s,r){return r?s?s+" "+r:s+r:s}t.exports?(n.default=n,t.exports=n):window.classNames=n})()})(YE)),YE.exports}var Iue=Oue();const fn=Zg(Iue),vr=fs({debug:!1,version:"",transferPrice:0,impoundPrice:0,soundFiles:[],tags:[],idleDuration:0,soundPath:"",imagePath:"",music:"",musicVolume:0,intl:{locales:"en",options:{style:"currency",currency:"USD"}},enabledButtons:{favorite:!0,tag:!0,send:!0,transfer:!0,bring:!0},sellObjectCommision:0});function zue(t){const e=sn.c(125),{item:n,id:i,initialLoad:a,onClick:s}=t,{t:r}=Dn(),{id:o}=cm(),c=vi(SA),u=vi(vr);let h,d,p,g,b,w,x,S,M,C,A,N,R,D,B,z,I,U,$,G,k,X,V,H;if(e[0]!==u.intl.locales||e[1]!==u.intl.options||e[2]!==i||e[3]!==a||e[4]!==c||e[5]!==n||e[6]!==s||e[7]!==o){const be=new Intl.NumberFormat(u.intl.locales,u.intl.options),xe=n.id;if(e[32]!==i||e[33]!==a||e[34]!==n.colors||e[35]!==n.key||e[36]!==n.object||e[37]!==xe||e[38]!==o){const he=xe!=null&&o?xe.toString()===o:n.key===i&&(o===n.object||n.colors?.some(ve=>ve.object===o));g=Ve.div,C="w-full px-2 grid group pt-3",e[52]!==a?(A=a?{opacity:0,y:30,scale:.9}:!1,e[52]=a,e[53]=A):A=e[53],e[54]===Symbol.for("react.memo_cache_sentinel")?(N={opacity:1,y:0,scale:1},R={opacity:0,y:30,scale:.9},D={duration:.5,ease:"easeOut"},e[54]=N,e[55]=R,e[56]=D):(N=e[54],R=e[55],D=e[56]),e[57]===Symbol.for("react.memo_cache_sentinel")?(B={y:-8,scale:1.02,transition:{duration:.3}},e[57]=B):B=e[57],e[58]===Symbol.for("react.memo_cache_sentinel")?(I={scale:.98,transition:{duration:.1}},e[58]=I):I=e[58],p=js,w=!0,x=!0,S=!0,M=fn({"!rounded-xl shadow-lg hover:shadow-2xl overflow-hidden cursor-pointer border border-gray-200/20 backdrop-blur-sm transition-all duration-300 attachment-slot":!0,"bg-primary":he}),e[32]=i,e[33]=a,e[34]=n.colors,e[35]=n.key,e[36]=n.object,e[37]=xe,e[38]=o,e[39]=p,e[40]=g,e[41]=w,e[42]=x,e[43]=S,e[44]=M,e[45]=C,e[46]=A,e[47]=N,e[48]=R,e[49]=D,e[50]=B,e[51]=I}else p=e[39],g=e[40],w=e[41],x=e[42],S=e[43],M=e[44],C=e[45],A=e[46],N=e[47],R=e[48],D=e[49],B=e[50],I=e[51];V="w-full h-full",e[59]!==c||e[60]!==n||e[61]!==s?(H=c?void 0:()=>s(n.key||"",n.object,n.id),e[59]=c,e[60]=n,e[61]=s,e[62]=H):H=e[62],d=Aae,k="relative h-36 overflow-hidden bg-primary",e[63]!==n.img||e[64]!==n.label?(X=_.jsx("img",{src:n.img,alt:n.label,className:"w-full h-full object-cover"}),e[63]=n.img,e[64]=n.label,e[65]=X):X=e[65],h=na,b="success",z="lg",U="sm",$="absolute top-2 right-2 green-subtitle !text-xs shadow-lg backdrop-blur-sm",G=be.format(n.price),e[0]=u.intl.locales,e[1]=u.intl.options,e[2]=i,e[3]=a,e[4]=c,e[5]=n,e[6]=s,e[7]=o,e[8]=h,e[9]=d,e[10]=p,e[11]=g,e[12]=b,e[13]=w,e[14]=x,e[15]=S,e[16]=M,e[17]=C,e[18]=A,e[19]=N,e[20]=R,e[21]=D,e[22]=B,e[23]=z,e[24]=I,e[25]=U,e[26]=$,e[27]=G,e[28]=k,e[29]=X,e[30]=V,e[31]=H}else h=e[8],d=e[9],p=e[10],g=e[11],b=e[12],w=e[13],x=e[14],S=e[15],M=e[16],C=e[17],A=e[18],N=e[19],R=e[20],D=e[21],B=e[22],z=e[23],I=e[24],U=e[25],$=e[26],G=e[27],k=e[28],X=e[29],V=e[30],H=e[31];let W;e[66]!==h||e[67]!==b||e[68]!==z||e[69]!==U||e[70]!==$||e[71]!==G?(W=_.jsx(h,{color:b,radius:z,size:U,className:$,children:G}),e[66]=h,e[67]=b,e[68]=z,e[69]=U,e[70]=$,e[71]=G,e[72]=W):W=e[72];let J;e[73]!==n.type||e[74]!==r?(J=n.type==="stash"&&_.jsx(na,{color:"default",radius:"lg",size:"sm",className:"absolute top-2 left-2 text-xs shadow-lg",children:_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(Zp,{}),r("decorate_ui.item_list.stash")]})}),e[73]=n.type,e[74]=r,e[75]=J):J=e[75];let Y;e[76]!==n.type||e[77]!==r?(Y=n.type==="gardrobe"&&_.jsx(na,{color:"default",radius:"lg",size:"sm",className:"absolute top-2 left-2 text-xs shadow-lg",children:_.jsxs("div",{className:"flex items-center gap-1",children:[_.jsx(nk,{}),r("decorate_ui.item_list.gardrobe")]})}),e[76]=n.type,e[77]=r,e[78]=Y):Y=e[78];let K;e[79]!==d||e[80]!==W||e[81]!==J||e[82]!==Y||e[83]!==k||e[84]!==X?(K=_.jsxs(d,{className:k,children:[X,W,J,Y]}),e[79]=d,e[80]=W,e[81]=J,e[82]=Y,e[83]=k,e[84]=X,e[85]=K):K=e[85];let ee;e[86]!==a?(ee=a?{opacity:0,y:10}:!1,e[86]=a,e[87]=ee):ee=e[87];let ie,Z;e[88]===Symbol.for("react.memo_cache_sentinel")?(ie={opacity:1,y:0},Z={duration:.3,delay:.2},e[88]=ie,e[89]=Z):(ie=e[88],Z=e[89]);let ue;e[90]!==n.label||e[91]!==ee?(ue=_.jsx(Ve.h3,{className:"font-semibold mb-2 !text-sm subtitle p-1",initial:ee,animate:ie,transition:Z,children:n.label}),e[90]=n.label,e[91]=ee,e[92]=ue):ue=e[92];let se;e[93]!==a?(se=a?{opacity:0,y:10}:!1,e[93]=a,e[94]=se):se=e[94];let ae,ce;e[95]===Symbol.for("react.memo_cache_sentinel")?(ae={opacity:1,y:0},ce={duration:.3,delay:.25},e[95]=ae,e[96]=ce):(ae=e[95],ce=e[96]);let pe;e[97]!==n.description||e[98]!==se?(pe=_.jsx(Ve.p,{className:"text-gray-500 dark:text-gray-400 !text-xs mb-2 line-clamp-2",initial:se,animate:ae,transition:ce,children:n.description}),e[97]=n.description,e[98]=se,e[99]=pe):pe=e[99];let ye;e[100]!==ue||e[101]!==pe?(ye=_.jsxs(Gr,{children:[ue,pe]}),e[100]=ue,e[101]=pe,e[102]=ye):ye=e[102];let _e;e[103]!==K||e[104]!==ye||e[105]!==V||e[106]!==H?(_e=_.jsxs("div",{className:V,onClick:H,children:[K,ye]}),e[103]=K,e[104]=ye,e[105]=V,e[106]=H,e[107]=_e):_e=e[107];let me;e[108]!==p||e[109]!==w||e[110]!==x||e[111]!==S||e[112]!==M||e[113]!==_e?(me=_.jsx(p,{isHoverable:w,isPressable:x,isFooterBlurred:S,className:M,children:_e}),e[108]=p,e[109]=w,e[110]=x,e[111]=S,e[112]=M,e[113]=_e,e[114]=me):me=e[114];let ne;return e[115]!==g||e[116]!==C||e[117]!==A||e[118]!==N||e[119]!==R||e[120]!==D||e[121]!==B||e[122]!==I||e[123]!==me?(ne=_.jsx(g,{className:C,initial:A,animate:N,exit:R,transition:D,whileHover:B,whileTap:I,children:me}),e[115]=g,e[116]=C,e[117]=A,e[118]=N,e[119]=R,e[120]=D,e[121]=B,e[122]=I,e[123]=me,e[124]=ne):ne=e[124],ne}function jA(t){const e=sn.c(20),{dynamicId:n,items:i,onClick:a}=t,[s,r]=P.useState(!0),o=vi(ZV);let c,u;if(e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{setTimeout(()=>{r(!1)},1e3)},u=[],e[0]=c,e[1]=u):(c=e[0],u=e[1]),P.useEffect(c,u),!i){let M;return e[2]===Symbol.for("react.memo_cache_sentinel")?(M=_.jsx(CD,{}),e[2]=M):M=e[2],M}let h;if(e[3]!==i||e[4]!==o){const M=o.toLowerCase();h=i.filter(C=>C?.label?.toLowerCase().includes(M)||C?.description?.toLowerCase().includes(M)||C?.colorlabel?.toLowerCase().includes(M)||C?.object?.toLowerCase().includes(M)?!0:C.colors?.length?C.colors.some(A=>A.label.toLowerCase().includes(M)||A.object.toLowerCase().includes(M)):!1),e[3]=i,e[4]=o,e[5]=h}else h=e[5];const d=h;if(d.length===0){const M=o.length>0;let C;return e[6]!==o||e[7]!==M?(C=_.jsx(CD,{isSearchEmpty:M,searchQuery:o}),e[6]=o,e[7]=M,e[8]=C):C=e[8],C}let p,g,b;e[9]===Symbol.for("react.memo_cache_sentinel")?(p={opacity:0,y:10},g={opacity:1,y:0},b={duration:.3,staggerChildren:.1,delayChildren:.1},e[9]=p,e[10]=g,e[11]=b):(p=e[9],g=e[10],b=e[11]);let w;e[12]!==n||e[13]!==s||e[14]!==a?(w=(M,C)=>_.jsx(zue,{item:C,id:n,initialLoad:s,onClick:a},C.key+C.object),e[12]=n,e[13]=s,e[14]=a,e[15]=w):w=e[15];let x;e[16]===Symbol.for("react.memo_cache_sentinel")?(x={height:"15vw",width:"100%"},e[16]=x):x=e[16];let S;return e[17]!==d||e[18]!==w?(S=_.jsx("div",{className:"w-full h-full flex-shrink flex-grow max-h-full",children:_.jsx(Ve.div,{className:"w-full h-full",initial:p,animate:g,transition:b,children:_.jsx(Kk,{data:d,itemContent:w,listClassName:"grid grid-cols-5 place-items-center 5xl:grid-cols-6",itemClassName:"flex w-full h-[15vw]",className:"w-full h-full overflow-x-hidden",style:x})})}),e[17]=d,e[18]=w,e[19]=S):S=e[19],S}function Bue(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M96 77.3c0-7.3 5.9-13.3 13.3-13.3c3.5 0 6.9 1.4 9.4 3.9l14.9 14.9C130 91.8 128 101.7 128 112c0 19.9 7.2 38 19.2 52c-5.3 9.2-4 21.1 3.8 29c9.4 9.4 24.6 9.4 33.9 0L289 89c9.4-9.4 9.4-24.6 0-33.9c-7.9-7.9-19.8-9.1-29-3.8C246 39.2 227.9 32 208 32c-10.3 0-20.2 2-29.2 5.5L163.9 22.6C149.4 8.1 129.7 0 109.3 0C66.6 0 32 34.6 32 77.3L32 256c-17.7 0-32 14.3-32 32s14.3 32 32 32l448 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L96 256 96 77.3zM32 352l0 16c0 28.4 12.4 54 32 71.6L64 480c0 17.7 14.3 32 32 32s32-14.3 32-32l0-16 256 0 0 16c0 17.7 14.3 32 32 32s32-14.3 32-32l0-40.4c19.6-17.6 32-43.1 32-71.6l0-16L32 352z"},child:[]}]})(t)}function Uue(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M32 32c17.7 0 32 14.3 32 32l0 256 224 0 0-160c0-17.7 14.3-32 32-32l224 0c53 0 96 43 96 96l0 224c0 17.7-14.3 32-32 32s-32-14.3-32-32l0-32-224 0-32 0L64 416l0 32c0 17.7-14.3 32-32 32s-32-14.3-32-32L0 64C0 46.3 14.3 32 32 32zm144 96a80 80 0 1 1 0 160 80 80 0 1 1 0-160z"},child:[]}]})(t)}function jue(t){return en({attr:{viewBox:"0 0 640 512"},child:[{tag:"path",attr:{d:"M64 160C64 89.3 121.3 32 192 32l256 0c70.7 0 128 57.3 128 128l0 33.6c-36.5 7.4-64 39.7-64 78.4l0 48-384 0 0-48c0-38.7-27.5-71-64-78.4L64 160zM544 272c0-20.9 13.4-38.7 32-45.3c5-1.8 10.4-2.7 16-2.7c26.5 0 48 21.5 48 48l0 176c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L96 448c0 17.7-14.3 32-32 32l-32 0c-17.7 0-32-14.3-32-32L0 272c0-26.5 21.5-48 48-48c5.6 0 11 1 16 2.7c18.6 6.6 32 24.4 32 45.3l0 48 0 32 32 0 384 0 32 0 0-32 0-48z"},child:[]}]})(t)}function Fue(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M575.8 255.5c0 18-15 32.1-32 32.1l-32 0 .7 160.2c0 2.7-.2 5.4-.5 8.1l0 16.2c0 22.1-17.9 40-40 40l-16 0c-1.1 0-2.2 0-3.3-.1c-1.4 .1-2.8 .1-4.2 .1L416 512l-24 0c-22.1 0-40-17.9-40-40l0-24 0-64c0-17.7-14.3-32-32-32l-64 0c-17.7 0-32 14.3-32 32l0 64 0 24c0 22.1-17.9 40-40 40l-24 0-31.9 0c-1.5 0-3-.1-4.5-.2c-1.2 .1-2.4 .2-3.6 .2l-16 0c-22.1 0-40-17.9-40-40l0-112c0-.9 0-1.9 .1-2.8l0-69.7-32 0c-18 0-32-14-32-32.1c0-9 3-17 10-24L266.4 8c7-7 15-8 22-8s15 2 21 7L564.8 231.5c8 7 12 15 11 24z"},child:[]}]})(t)}function Vue(t){return en({attr:{viewBox:"0 0 576 512"},child:[{tag:"path",attr:{d:"M240 144A96 96 0 1 0 48 144a96 96 0 1 0 192 0zm44.4 32C269.9 240.1 212.5 288 144 288C64.5 288 0 223.5 0 144S64.5 0 144 0c68.5 0 125.9 47.9 140.4 112l71.8 0c8.8-9.8 21.6-16 35.8-16l104 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-104 0c-14.2 0-27-6.2-35.8-16l-71.8 0zM144 80a64 64 0 1 1 0 128 64 64 0 1 1 0-128zM400 240c13.3 0 24 10.7 24 24l0 8 96 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-240 0c-13.3 0-24-10.7-24-24s10.7-24 24-24l96 0 0-8c0-13.3 10.7-24 24-24zM288 464l0-112 224 0 0 112c0 26.5-21.5 48-48 48l-128 0c-26.5 0-48-21.5-48-48zM48 320l80 0 16 0 32 0c26.5 0 48 21.5 48 48s-21.5 48-48 48l-16 0c0 17.7-14.3 32-32 32l-64 0c-17.7 0-32-14.3-32-32l0-80c0-8.8 7.2-16 16-16zm128 64c8.8 0 16-7.2 16-16s-7.2-16-16-16l-16 0 0 32 16 0zM24 464l176 0c13.3 0 24 10.7 24 24s-10.7 24-24 24L24 512c-13.3 0-24-10.7-24-24s10.7-24 24-24z"},child:[]}]})(t)}function kue(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M288 120c0-30.9 25.1-56 56-56s56 25.1 56 56l0 13c-29.3 10-48 34.5-48 70.1c0 27.9 25.3 74.8 66 111.6c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13C464 53.7 410.3 0 344 0S224 53.7 224 120l0 21.8C207.3 133 188.2 128 168 128c-66.3 0-120 53.7-120 120l0 13c-29.3 10-48 34.5-48 70.1C0 359 25.3 405.9 66 442.7c3.8 3.5 8.9 5.3 14 5.3s10.2-1.8 14-5.3c40.7-36.8 66-83.7 66-111.6c0-35.6-18.7-60.2-48-70.1l0-13c0-30.9 25.1-56 56-56s56 25.1 56 56l0 32 0 200c0 17.7 14.3 32 32 32s32-14.3 32-32l0-200 0-32 0-128z"},child:[]}]})(t)}function Hue(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"},child:[]}]})(t)}const $ue={hidden:{opacity:0,y:30},visible:{opacity:1,y:0,transition:{duration:.6,staggerChildren:.1,delayChildren:.2}}},XD={hidden:{opacity:0,scale:.5,rotate:-180},visible:{opacity:1,scale:1,rotate:0,transition:{duration:.5,ease:"backOut"}},hover:{scale:1.15,rotate:5,transition:{duration:.3,ease:"easeInOut"}},tap:{scale:.9,rotate:-2,transition:{duration:.1}},active:{scale:1.1,rotate:0,transition:{duration:.3}}},Gue=[{icon:Vue,path:"kitchen"},{icon:Bue,path:"bathroom"},{icon:Uue,path:"bedroom"},{icon:jue,path:"living"},{icon:kue,path:"garden"}];function Wue(){const t=sn.c(58),e=vi(Zf),{categoryId:n,dynamicId:i,itemId:a}=cm(),s=nh();let r;t[0]!==n?(r=D=>n===D,t[0]=n,t[1]=r):r=t[1];const o=r;let c;t[2]!==n||t[3]!==e.navigation[0]||t[4]!==e.navigation.length||t[5]!==s?(c=()=>{!n&&e.navigation.length>0&&s(`/decorate/dynamic/${e.navigation[0].path}`)},t[2]=n,t[3]=e.navigation[0],t[4]=e.navigation.length,t[5]=s,t[6]=c):c=t[6];let u;t[7]!==n?(u=[n],t[7]=n,t[8]=u):u=t[8],P.useEffect(c,u);let h;if(t[9]!==n||t[10]!==e.navigation){let D;t[12]!==n?(D=B=>n===B.path,t[12]=n,t[13]=D):D=t[13],h=e.navigation.findIndex(D),t[9]=n,t[10]=e.navigation,t[11]=h}else h=t[11];const d=h,p=e.navigation?.[d];let g,b,w,x,S;if(t[14]!==n||t[15]!==p?.background||t[16]!==d||t[17]!==e.furniture||t[18]!==i||t[19]!==a||t[20]!==s){let D;t[26]!==d?(D=G=>{const[,k]=G;return k.navigation-1==d},t[26]=d,t[27]=D):D=t[27];const B=Object.entries(e.furniture).filter(D).map(Kue);let z;t[28]!==n||t[29]!==i||t[30]!==a||t[31]!==s?(z=(G,k)=>{a==k&&i==G?s(`/decorate/dynamic/${n}/${i}`):(console.log("navigate to",`/decorate/dynamic/${n}/${i}/${k}`),s(`/decorate/dynamic/${n}/${i}/${k}`))},t[28]=n,t[29]=i,t[30]=a,t[31]=s,t[32]=z):z=t[32],b=z;let I;t[33]!==e.furniture||t[34]!==i?(I=i?e.furniture?.[i]?.items?.map?.(G=>({...G,key:i})):[],t[33]=e.furniture,t[34]=i,t[35]=I):I=t[35],g=I,w="grid grid-cols-4 p-4 w-[32vw] relative overflow-hidden";const U=p?.background;let $;t[36]===Symbol.for("react.memo_cache_sentinel")?($={wrapper:"w-full h-full object-cover rounded-none",img:"object-cover w-full h-full min-w-full min-h-full rounded-none",blurredImg:"object-cover",zoomedWrapper:"w-full h-full object-cover"},t[36]=$):$=t[36],t[37]!==U?(x=_.jsx("div",{className:"w-full h-full absolute top-0 left-0 -z-50",children:_.jsx(pA,{isBlurred:!0,src:U,classNames:$})}),t[37]=U,t[38]=x):x=t[38],S=d!==-1?_.jsx(Ve.div,{variants:{hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.05,delayChildren:.1}}},initial:"hidden",animate:"visible",className:"w-full h-full relative",children:B.map((G,k)=>_.jsx(Ve.img,{initial:{opacity:0,scale:0,y:50},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,y:50},transition:{duration:0,delay:k*.03,ease:"easeOut"},className:fn({"absolute transition-all duration-300 bg-center bg-no-repeat bg-contain cursor-pointer grayscale hover:grayscale-0":!0,"grayscale-0":i==G.key}),src:G.img,onClick:()=>s(`/decorate/dynamic/${n}/${G.key}`),style:{width:G.css?.width+"vw",maxWidth:G.css?.width+"vw",height:G.css?.height+"vw",top:G.css?.top+2.9+"vw",left:G.css?.left-.5+"vw",zIndex:G.css?.zIndex}},G.label))}):null,t[14]=n,t[15]=p?.background,t[16]=d,t[17]=e.furniture,t[18]=i,t[19]=a,t[20]=s,t[21]=g,t[22]=b,t[23]=w,t[24]=x,t[25]=S}else g=t[21],b=t[22],w=t[23],x=t[24],S=t[25];let M;t[39]!==w||t[40]!==x||t[41]!==S?(M=_.jsxs("div",{className:w,children:[x,S]}),t[39]=w,t[40]=x,t[41]=S,t[42]=M):M=t[42];let C;if(t[43]!==e.navigation||t[44]!==o){let D;t[46]!==o?(D=(B,z)=>_.jsx(Ve.div,{variants:XD,custom:z,className:"relative group",children:_.jsx(lC,{to:`/decorate/dynamic/${B.path}`,children:_.jsxs(Ve.div,{variants:XD,whileHover:"hover",whileTap:"tap",animate:o(B.path)?"active":"visible",className:fn("relative cursor-pointer p-3 !rounded-xl transition-all duration-300","bg-gradient-to-br from-white/10 to-white/5 backdrop-blur-sm","border border-white/20 shadow-lg","hover:from-white/20 hover:to-white/10","hover:border-white/30 hover:shadow-xl",o(B.path)&&"attachment-slot"),children:[o(B.path)&&_.jsx(Ve.div,{layoutId:"activeIndicator",className:"absolute -top-1 -right-1 w-3 h-3 bg-blue-400 rounded-full shadow-lg",initial:{scale:0},animate:{scale:1},transition:{duration:.3}}),_.jsxs("div",{className:"relative",children:[P.createElement(Gue.find(I=>I.path===B.path)?.icon,{size:24,className:"text-blue-300"}),_.jsx(Ve.div,{className:"absolute inset-0 rounded-lg bg-gradient-to-br from-white/20 to-transparent opacity-0",initial:{opacity:0},whileHover:{opacity:1},transition:{duration:.3}})]})]})})},B.path),t[46]=o,t[47]=D):D=t[47],C=e.navigation.map(D),t[43]=e.navigation,t[44]=o,t[45]=C}else C=t[45];let A;t[48]!==C?(A=_.jsx(js,{className:"flex flex-col items-center justify-center bg-primary p-6 rounded-none",children:_.jsx(Ve.div,{variants:$ue,initial:"hidden",animate:"visible",className:"flex flex-col items-center gap-4",children:_.jsx("div",{className:"flex flex-col items-center gap-3",children:C})})}),t[48]=C,t[49]=A):A=t[49];let N;t[50]!==g||t[51]!==i||t[52]!==b?(N=_.jsx("div",{className:"w-full h-full flex-shrink flex-grow bg-primary p-4",children:_.jsx(jA,{dynamicId:i,items:g,onClick:b})}),t[50]=g,t[51]=i,t[52]=b,t[53]=N):N=t[53];let R;return t[54]!==N||t[55]!==M||t[56]!==A?(R=_.jsxs(_.Fragment,{children:[M,A,N]}),t[54]=N,t[55]=M,t[56]=A,t[57]=R):R=t[57],R}function Kue(t){const[e,n]=t;return{key:e,...n}}function Xue(){const t=sn.c(21),{t:e}=Dn(),n=vi(Zf);let i;t[0]!==e?(i=e("decorate_ui.categories.dynamic"),t[0]=e,t[1]=i):i=t[1];let a;t[2]!==i?(a={to:"/decorate/dynamic",icon:Fue,label:i},t[2]=i,t[3]=a):a=t[3];let s;t[4]!==e?(s=e("decorate_ui.categories.objects"),t[4]=e,t[5]=s):s=t[5];let r;t[6]!==s?(r={to:"/decorate/objects",icon:Ele,label:s},t[6]=s,t[7]=r):r=t[7];let o;t[8]!==e?(o=e("decorate_ui.categories.stash"),t[8]=e,t[9]=o):o=t[9];let c;t[10]!==o?(c={to:"/decorate/stash",icon:Zp,label:o},t[10]=o,t[11]=c):c=t[11];let u;t[12]!==a||t[13]!==r||t[14]!==c?(u=[a,r,c],t[12]=a,t[13]=r,t[14]=c,t[15]=u):u=t[15];let h;t[16]!==n||t[17]!==u?(h=u.filter(g=>n.enableShop?!0:g.to==="/decorate/stash"),t[16]=n,t[17]=u,t[18]=h):h=t[18];const d=h;let p;return t[19]!==d?(p=_.jsx(js,{className:"grid place-items-stretch bg-primary rounded-none flex-shrink-0 p-2 py-4",children:d.map(que)}),t[19]=d,t[20]=p):p=t[20],p}function que(t,e){return _.jsx(Ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:e*.1,ease:"easeOut"},whileHover:{scale:1.05,y:-5,transition:{duration:.2}},whileTap:{scale:.95},children:_.jsx(aO,{to:t.to,className:Yue,children:n=>{const{isActive:i}=n;return _.jsxs(_.Fragment,{children:[_.jsx(Ve.div,{animate:i?{rotate:[0,-10,10,0],transition:{duration:.6,ease:"easeInOut"}}:{},children:_.jsx(t.icon,{size:24,className:fn({"transition-all duration-300":!0,"drop-shadow-lg":i,"group-hover:drop-shadow-md":!i})})}),_.jsx(Ve.span,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.3+e*.1},className:"text-xs font-medium tracking-wide",children:t.label})]})}})},t.to)}function Yue(t){const{isActive:e}=t;return fn({"group relative flex flex-col items-center gap-2 p-3 !rounded-xl transition-all duration-300 ease-out":!0,"attachment-slot shadow-lg shadow-black/20 pointer-events-none text-white":e,"bg-white/10 hover:bg-white/20 text-gray-300 hover:text-white":!e})}var ZE={};/*!
* howler.js v2.2.4
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
*/var qD;function Zue(){return qD||(qD=1,(function(t){(function(){var e=function(){this.init()};e.prototype={init:function(){var d=this||n;return d._counter=1e3,d._html5AudioPool=[],d.html5PoolSize=10,d._codecs={},d._howls=[],d._muted=!1,d._volume=1,d._canPlayEvent="canplaythrough",d._navigator=typeof window<"u"&&window.navigator?window.navigator:null,d.masterGain=null,d.noAudio=!1,d.usingWebAudio=!0,d.autoSuspend=!0,d.ctx=null,d.autoUnlock=!0,d._setup(),d},volume:function(d){var p=this||n;if(d=parseFloat(d),p.ctx||h(),typeof d<"u"&&d>=0&&d<=1){if(p._volume=d,p._muted)return p;p.usingWebAudio&&p.masterGain.gain.setValueAtTime(d,n.ctx.currentTime);for(var g=0;g<p._howls.length;g++)if(!p._howls[g]._webAudio)for(var b=p._howls[g]._getSoundIds(),w=0;w<b.length;w++){var x=p._howls[g]._soundById(b[w]);x&&x._node&&(x._node.volume=x._volume*d)}return p}return p._volume},mute:function(d){var p=this||n;p.ctx||h(),p._muted=d,p.usingWebAudio&&p.masterGain.gain.setValueAtTime(d?0:p._volume,n.ctx.currentTime);for(var g=0;g<p._howls.length;g++)if(!p._howls[g]._webAudio)for(var b=p._howls[g]._getSoundIds(),w=0;w<b.length;w++){var x=p._howls[g]._soundById(b[w]);x&&x._node&&(x._node.muted=d?!0:x._muted)}return p},stop:function(){for(var d=this||n,p=0;p<d._howls.length;p++)d._howls[p].stop();return d},unload:function(){for(var d=this||n,p=d._howls.length-1;p>=0;p--)d._howls[p].unload();return d.usingWebAudio&&d.ctx&&typeof d.ctx.close<"u"&&(d.ctx.close(),d.ctx=null,h()),d},codecs:function(d){return(this||n)._codecs[d.replace(/^x-/,"")]},_setup:function(){var d=this||n;if(d.state=d.ctx&&d.ctx.state||"suspended",d._autoSuspend(),!d.usingWebAudio)if(typeof Audio<"u")try{var p=new Audio;typeof p.oncanplaythrough>"u"&&(d._canPlayEvent="canplay")}catch{d.noAudio=!0}else d.noAudio=!0;try{var p=new Audio;p.muted&&(d.noAudio=!0)}catch{}return d.noAudio||d._setupCodecs(),d},_setupCodecs:function(){var d=this||n,p=null;try{p=typeof Audio<"u"?new Audio:null}catch{return d}if(!p||typeof p.canPlayType!="function")return d;var g=p.canPlayType("audio/mpeg;").replace(/^no$/,""),b=d._navigator?d._navigator.userAgent:"",w=b.match(/OPR\/(\d+)/g),x=w&&parseInt(w[0].split("/")[1],10)<33,S=b.indexOf("Safari")!==-1&&b.indexOf("Chrome")===-1,M=b.match(/Version\/(.*?) /),C=S&&M&&parseInt(M[1],10)<15;return d._codecs={mp3:!!(!x&&(g||p.canPlayType("audio/mp3;").replace(/^no$/,""))),mpeg:!!g,opus:!!p.canPlayType('audio/ogg; codecs="opus"').replace(/^no$/,""),ogg:!!p.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),oga:!!p.canPlayType('audio/ogg; codecs="vorbis"').replace(/^no$/,""),wav:!!(p.canPlayType('audio/wav; codecs="1"')||p.canPlayType("audio/wav")).replace(/^no$/,""),aac:!!p.canPlayType("audio/aac;").replace(/^no$/,""),caf:!!p.canPlayType("audio/x-caf;").replace(/^no$/,""),m4a:!!(p.canPlayType("audio/x-m4a;")||p.canPlayType("audio/m4a;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),m4b:!!(p.canPlayType("audio/x-m4b;")||p.canPlayType("audio/m4b;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),mp4:!!(p.canPlayType("audio/x-mp4;")||p.canPlayType("audio/mp4;")||p.canPlayType("audio/aac;")).replace(/^no$/,""),weba:!!(!C&&p.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),webm:!!(!C&&p.canPlayType('audio/webm; codecs="vorbis"').replace(/^no$/,"")),dolby:!!p.canPlayType('audio/mp4; codecs="ec-3"').replace(/^no$/,""),flac:!!(p.canPlayType("audio/x-flac;")||p.canPlayType("audio/flac;")).replace(/^no$/,"")},d},_unlockAudio:function(){var d=this||n;if(!(d._audioUnlocked||!d.ctx)){d._audioUnlocked=!1,d.autoUnlock=!1,!d._mobileUnloaded&&d.ctx.sampleRate!==44100&&(d._mobileUnloaded=!0,d.unload()),d._scratchBuffer=d.ctx.createBuffer(1,1,22050);var p=function(g){for(;d._html5AudioPool.length<d.html5PoolSize;)try{var b=new Audio;b._unlocked=!0,d._releaseHtml5Audio(b)}catch{d.noAudio=!0;break}for(var w=0;w<d._howls.length;w++)if(!d._howls[w]._webAudio)for(var x=d._howls[w]._getSoundIds(),S=0;S<x.length;S++){var M=d._howls[w]._soundById(x[S]);M&&M._node&&!M._node._unlocked&&(M._node._unlocked=!0,M._node.load())}d._autoResume();var C=d.ctx.createBufferSource();C.buffer=d._scratchBuffer,C.connect(d.ctx.destination),typeof C.start>"u"?C.noteOn(0):C.start(0),typeof d.ctx.resume=="function"&&d.ctx.resume(),C.onended=function(){C.disconnect(0),d._audioUnlocked=!0,document.removeEventListener("touchstart",p,!0),document.removeEventListener("touchend",p,!0),document.removeEventListener("click",p,!0),document.removeEventListener("keydown",p,!0);for(var A=0;A<d._howls.length;A++)d._howls[A]._emit("unlock")}};return document.addEventListener("touchstart",p,!0),document.addEventListener("touchend",p,!0),document.addEventListener("click",p,!0),document.addEventListener("keydown",p,!0),d}},_obtainHtml5Audio:function(){var d=this||n;if(d._html5AudioPool.length)return d._html5AudioPool.pop();var p=new Audio().play();return p&&typeof Promise<"u"&&(p instanceof Promise||typeof p.then=="function")&&p.catch(function(){console.warn("HTML5 Audio pool exhausted, returning potentially locked audio object.")}),new Audio},_releaseHtml5Audio:function(d){var p=this||n;return d._unlocked&&p._html5AudioPool.push(d),p},_autoSuspend:function(){var d=this;if(!(!d.autoSuspend||!d.ctx||typeof d.ctx.suspend>"u"||!n.usingWebAudio)){for(var p=0;p<d._howls.length;p++)if(d._howls[p]._webAudio){for(var g=0;g<d._howls[p]._sounds.length;g++)if(!d._howls[p]._sounds[g]._paused)return d}return d._suspendTimer&&clearTimeout(d._suspendTimer),d._suspendTimer=setTimeout(function(){if(d.autoSuspend){d._suspendTimer=null,d.state="suspending";var b=function(){d.state="suspended",d._resumeAfterSuspend&&(delete d._resumeAfterSuspend,d._autoResume())};d.ctx.suspend().then(b,b)}},3e4),d}},_autoResume:function(){var d=this;if(!(!d.ctx||typeof d.ctx.resume>"u"||!n.usingWebAudio))return d.state==="running"&&d.ctx.state!=="interrupted"&&d._suspendTimer?(clearTimeout(d._suspendTimer),d._suspendTimer=null):d.state==="suspended"||d.state==="running"&&d.ctx.state==="interrupted"?(d.ctx.resume().then(function(){d.state="running";for(var p=0;p<d._howls.length;p++)d._howls[p]._emit("resume")}),d._suspendTimer&&(clearTimeout(d._suspendTimer),d._suspendTimer=null)):d.state==="suspending"&&(d._resumeAfterSuspend=!0),d}};var n=new e,i=function(d){var p=this;if(!d.src||d.src.length===0){console.error("An array of source files must be passed with any new Howl.");return}p.init(d)};i.prototype={init:function(d){var p=this;return n.ctx||h(),p._autoplay=d.autoplay||!1,p._format=typeof d.format!="string"?d.format:[d.format],p._html5=d.html5||!1,p._muted=d.mute||!1,p._loop=d.loop||!1,p._pool=d.pool||5,p._preload=typeof d.preload=="boolean"||d.preload==="metadata"?d.preload:!0,p._rate=d.rate||1,p._sprite=d.sprite||{},p._src=typeof d.src!="string"?d.src:[d.src],p._volume=d.volume!==void 0?d.volume:1,p._xhr={method:d.xhr&&d.xhr.method?d.xhr.method:"GET",headers:d.xhr&&d.xhr.headers?d.xhr.headers:null,withCredentials:d.xhr&&d.xhr.withCredentials?d.xhr.withCredentials:!1},p._duration=0,p._state="unloaded",p._sounds=[],p._endTimers={},p._queue=[],p._playLock=!1,p._onend=d.onend?[{fn:d.onend}]:[],p._onfade=d.onfade?[{fn:d.onfade}]:[],p._onload=d.onload?[{fn:d.onload}]:[],p._onloaderror=d.onloaderror?[{fn:d.onloaderror}]:[],p._onplayerror=d.onplayerror?[{fn:d.onplayerror}]:[],p._onpause=d.onpause?[{fn:d.onpause}]:[],p._onplay=d.onplay?[{fn:d.onplay}]:[],p._onstop=d.onstop?[{fn:d.onstop}]:[],p._onmute=d.onmute?[{fn:d.onmute}]:[],p._onvolume=d.onvolume?[{fn:d.onvolume}]:[],p._onrate=d.onrate?[{fn:d.onrate}]:[],p._onseek=d.onseek?[{fn:d.onseek}]:[],p._onunlock=d.onunlock?[{fn:d.onunlock}]:[],p._onresume=[],p._webAudio=n.usingWebAudio&&!p._html5,typeof n.ctx<"u"&&n.ctx&&n.autoUnlock&&n._unlockAudio(),n._howls.push(p),p._autoplay&&p._queue.push({event:"play",action:function(){p.play()}}),p._preload&&p._preload!=="none"&&p.load(),p},load:function(){var d=this,p=null;if(n.noAudio){d._emit("loaderror",null,"No audio support.");return}typeof d._src=="string"&&(d._src=[d._src]);for(var g=0;g<d._src.length;g++){var b,w;if(d._format&&d._format[g])b=d._format[g];else{if(w=d._src[g],typeof w!="string"){d._emit("loaderror",null,"Non-string found in selected audio sources - ignoring.");continue}b=/^data:audio\/([^;,]+);/i.exec(w),b||(b=/\.([^.]+)$/.exec(w.split("?",1)[0])),b&&(b=b[1].toLowerCase())}if(b||console.warn('No file extension was found. Consider using the "format" property or specify an extension.'),b&&n.codecs(b)){p=d._src[g];break}}if(!p){d._emit("loaderror",null,"No codec support for selected audio sources.");return}return d._src=p,d._state="loading",window.location.protocol==="https:"&&p.slice(0,5)==="http:"&&(d._html5=!0,d._webAudio=!1),new a(d),d._webAudio&&r(d),d},play:function(d,p){var g=this,b=null;if(typeof d=="number")b=d,d=null;else{if(typeof d=="string"&&g._state==="loaded"&&!g._sprite[d])return null;if(typeof d>"u"&&(d="__default",!g._playLock)){for(var w=0,x=0;x<g._sounds.length;x++)g._sounds[x]._paused&&!g._sounds[x]._ended&&(w++,b=g._sounds[x]._id);w===1?d=null:b=null}}var S=b?g._soundById(b):g._inactiveSound();if(!S)return null;if(b&&!d&&(d=S._sprite||"__default"),g._state!=="loaded"){S._sprite=d,S._ended=!1;var M=S._id;return g._queue.push({event:"play",action:function(){g.play(M)}}),M}if(b&&!S._paused)return p||g._loadQueue("play"),S._id;g._webAudio&&n._autoResume();var C=Math.max(0,S._seek>0?S._seek:g._sprite[d][0]/1e3),A=Math.max(0,(g._sprite[d][0]+g._sprite[d][1])/1e3-C),N=A*1e3/Math.abs(S._rate),R=g._sprite[d][0]/1e3,D=(g._sprite[d][0]+g._sprite[d][1])/1e3;S._sprite=d,S._ended=!1;var B=function(){S._paused=!1,S._seek=C,S._start=R,S._stop=D,S._loop=!!(S._loop||g._sprite[d][2])};if(C>=D){g._ended(S);return}var z=S._node;if(g._webAudio){var I=function(){g._playLock=!1,B(),g._refreshBuffer(S);var k=S._muted||g._muted?0:S._volume;z.gain.setValueAtTime(k,n.ctx.currentTime),S._playStart=n.ctx.currentTime,typeof z.bufferSource.start>"u"?S._loop?z.bufferSource.noteGrainOn(0,C,86400):z.bufferSource.noteGrainOn(0,C,A):S._loop?z.bufferSource.start(0,C,86400):z.bufferSource.start(0,C,A),N!==1/0&&(g._endTimers[S._id]=setTimeout(g._ended.bind(g,S),N)),p||setTimeout(function(){g._emit("play",S._id),g._loadQueue()},0)};n.state==="running"&&n.ctx.state!=="interrupted"?I():(g._playLock=!0,g.once("resume",I),g._clearTimer(S._id))}else{var U=function(){z.currentTime=C,z.muted=S._muted||g._muted||n._muted||z.muted,z.volume=S._volume*n.volume(),z.playbackRate=S._rate;try{var k=z.play();if(k&&typeof Promise<"u"&&(k instanceof Promise||typeof k.then=="function")?(g._playLock=!0,B(),k.then(function(){g._playLock=!1,z._unlocked=!0,p?g._loadQueue():g._emit("play",S._id)}).catch(function(){g._playLock=!1,g._emit("playerror",S._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction."),S._ended=!0,S._paused=!0})):p||(g._playLock=!1,B(),g._emit("play",S._id)),z.playbackRate=S._rate,z.paused){g._emit("playerror",S._id,"Playback was unable to start. This is most commonly an issue on mobile devices and Chrome where playback was not within a user interaction.");return}d!=="__default"||S._loop?g._endTimers[S._id]=setTimeout(g._ended.bind(g,S),N):(g._endTimers[S._id]=function(){g._ended(S),z.removeEventListener("ended",g._endTimers[S._id],!1)},z.addEventListener("ended",g._endTimers[S._id],!1))}catch(X){g._emit("playerror",S._id,X)}};z.src==="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA"&&(z.src=g._src,z.load());var $=window&&window.ejecta||!z.readyState&&n._navigator.isCocoonJS;if(z.readyState>=3||$)U();else{g._playLock=!0,g._state="loading";var G=function(){g._state="loaded",U(),z.removeEventListener(n._canPlayEvent,G,!1)};z.addEventListener(n._canPlayEvent,G,!1),g._clearTimer(S._id)}}return S._id},pause:function(d){var p=this;if(p._state!=="loaded"||p._playLock)return p._queue.push({event:"pause",action:function(){p.pause(d)}}),p;for(var g=p._getSoundIds(d),b=0;b<g.length;b++){p._clearTimer(g[b]);var w=p._soundById(g[b]);if(w&&!w._paused&&(w._seek=p.seek(g[b]),w._rateSeek=0,w._paused=!0,p._stopFade(g[b]),w._node))if(p._webAudio){if(!w._node.bufferSource)continue;typeof w._node.bufferSource.stop>"u"?w._node.bufferSource.noteOff(0):w._node.bufferSource.stop(0),p._cleanBuffer(w._node)}else(!isNaN(w._node.duration)||w._node.duration===1/0)&&w._node.pause();arguments[1]||p._emit("pause",w?w._id:null)}return p},stop:function(d,p){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"stop",action:function(){g.stop(d)}}),g;for(var b=g._getSoundIds(d),w=0;w<b.length;w++){g._clearTimer(b[w]);var x=g._soundById(b[w]);x&&(x._seek=x._start||0,x._rateSeek=0,x._paused=!0,x._ended=!0,g._stopFade(b[w]),x._node&&(g._webAudio?x._node.bufferSource&&(typeof x._node.bufferSource.stop>"u"?x._node.bufferSource.noteOff(0):x._node.bufferSource.stop(0),g._cleanBuffer(x._node)):(!isNaN(x._node.duration)||x._node.duration===1/0)&&(x._node.currentTime=x._start||0,x._node.pause(),x._node.duration===1/0&&g._clearSound(x._node))),p||g._emit("stop",x._id))}return g},mute:function(d,p){var g=this;if(g._state!=="loaded"||g._playLock)return g._queue.push({event:"mute",action:function(){g.mute(d,p)}}),g;if(typeof p>"u")if(typeof d=="boolean")g._muted=d;else return g._muted;for(var b=g._getSoundIds(p),w=0;w<b.length;w++){var x=g._soundById(b[w]);x&&(x._muted=d,x._interval&&g._stopFade(x._id),g._webAudio&&x._node?x._node.gain.setValueAtTime(d?0:x._volume,n.ctx.currentTime):x._node&&(x._node.muted=n._muted?!0:d),g._emit("mute",x._id))}return g},volume:function(){var d=this,p=arguments,g,b;if(p.length===0)return d._volume;if(p.length===1||p.length===2&&typeof p[1]>"u"){var w=d._getSoundIds(),x=w.indexOf(p[0]);x>=0?b=parseInt(p[0],10):g=parseFloat(p[0])}else p.length>=2&&(g=parseFloat(p[0]),b=parseInt(p[1],10));var S;if(typeof g<"u"&&g>=0&&g<=1){if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"volume",action:function(){d.volume.apply(d,p)}}),d;typeof b>"u"&&(d._volume=g),b=d._getSoundIds(b);for(var M=0;M<b.length;M++)S=d._soundById(b[M]),S&&(S._volume=g,p[2]||d._stopFade(b[M]),d._webAudio&&S._node&&!S._muted?S._node.gain.setValueAtTime(g,n.ctx.currentTime):S._node&&!S._muted&&(S._node.volume=g*n.volume()),d._emit("volume",S._id))}else return S=b?d._soundById(b):d._sounds[0],S?S._volume:0;return d},fade:function(d,p,g,b){var w=this;if(w._state!=="loaded"||w._playLock)return w._queue.push({event:"fade",action:function(){w.fade(d,p,g,b)}}),w;d=Math.min(Math.max(0,parseFloat(d)),1),p=Math.min(Math.max(0,parseFloat(p)),1),g=parseFloat(g),w.volume(d,b);for(var x=w._getSoundIds(b),S=0;S<x.length;S++){var M=w._soundById(x[S]);if(M){if(b||w._stopFade(x[S]),w._webAudio&&!M._muted){var C=n.ctx.currentTime,A=C+g/1e3;M._volume=d,M._node.gain.setValueAtTime(d,C),M._node.gain.linearRampToValueAtTime(p,A)}w._startFadeInterval(M,d,p,g,x[S],typeof b>"u")}}return w},_startFadeInterval:function(d,p,g,b,w,x){var S=this,M=p,C=g-p,A=Math.abs(C/.01),N=Math.max(4,A>0?b/A:b),R=Date.now();d._fadeTo=g,d._interval=setInterval(function(){var D=(Date.now()-R)/b;R=Date.now(),M+=C*D,M=Math.round(M*100)/100,C<0?M=Math.max(g,M):M=Math.min(g,M),S._webAudio?d._volume=M:S.volume(M,d._id,!0),x&&(S._volume=M),(g<p&&M<=g||g>p&&M>=g)&&(clearInterval(d._interval),d._interval=null,d._fadeTo=null,S.volume(g,d._id),S._emit("fade",d._id))},N)},_stopFade:function(d){var p=this,g=p._soundById(d);return g&&g._interval&&(p._webAudio&&g._node.gain.cancelScheduledValues(n.ctx.currentTime),clearInterval(g._interval),g._interval=null,p.volume(g._fadeTo,d),g._fadeTo=null,p._emit("fade",d)),p},loop:function(){var d=this,p=arguments,g,b,w;if(p.length===0)return d._loop;if(p.length===1)if(typeof p[0]=="boolean")g=p[0],d._loop=g;else return w=d._soundById(parseInt(p[0],10)),w?w._loop:!1;else p.length===2&&(g=p[0],b=parseInt(p[1],10));for(var x=d._getSoundIds(b),S=0;S<x.length;S++)w=d._soundById(x[S]),w&&(w._loop=g,d._webAudio&&w._node&&w._node.bufferSource&&(w._node.bufferSource.loop=g,g&&(w._node.bufferSource.loopStart=w._start||0,w._node.bufferSource.loopEnd=w._stop,d.playing(x[S])&&(d.pause(x[S],!0),d.play(x[S],!0)))));return d},rate:function(){var d=this,p=arguments,g,b;if(p.length===0)b=d._sounds[0]._id;else if(p.length===1){var w=d._getSoundIds(),x=w.indexOf(p[0]);x>=0?b=parseInt(p[0],10):g=parseFloat(p[0])}else p.length===2&&(g=parseFloat(p[0]),b=parseInt(p[1],10));var S;if(typeof g=="number"){if(d._state!=="loaded"||d._playLock)return d._queue.push({event:"rate",action:function(){d.rate.apply(d,p)}}),d;typeof b>"u"&&(d._rate=g),b=d._getSoundIds(b);for(var M=0;M<b.length;M++)if(S=d._soundById(b[M]),S){d.playing(b[M])&&(S._rateSeek=d.seek(b[M]),S._playStart=d._webAudio?n.ctx.currentTime:S._playStart),S._rate=g,d._webAudio&&S._node&&S._node.bufferSource?S._node.bufferSource.playbackRate.setValueAtTime(g,n.ctx.currentTime):S._node&&(S._node.playbackRate=g);var C=d.seek(b[M]),A=(d._sprite[S._sprite][0]+d._sprite[S._sprite][1])/1e3-C,N=A*1e3/Math.abs(S._rate);(d._endTimers[b[M]]||!S._paused)&&(d._clearTimer(b[M]),d._endTimers[b[M]]=setTimeout(d._ended.bind(d,S),N)),d._emit("rate",S._id)}}else return S=d._soundById(b),S?S._rate:d._rate;return d},seek:function(){var d=this,p=arguments,g,b;if(p.length===0)d._sounds.length&&(b=d._sounds[0]._id);else if(p.length===1){var w=d._getSoundIds(),x=w.indexOf(p[0]);x>=0?b=parseInt(p[0],10):d._sounds.length&&(b=d._sounds[0]._id,g=parseFloat(p[0]))}else p.length===2&&(g=parseFloat(p[0]),b=parseInt(p[1],10));if(typeof b>"u")return 0;if(typeof g=="number"&&(d._state!=="loaded"||d._playLock))return d._queue.push({event:"seek",action:function(){d.seek.apply(d,p)}}),d;var S=d._soundById(b);if(S)if(typeof g=="number"&&g>=0){var M=d.playing(b);M&&d.pause(b,!0),S._seek=g,S._ended=!1,d._clearTimer(b),!d._webAudio&&S._node&&!isNaN(S._node.duration)&&(S._node.currentTime=g);var C=function(){M&&d.play(b,!0),d._emit("seek",b)};if(M&&!d._webAudio){var A=function(){d._playLock?setTimeout(A,0):C()};setTimeout(A,0)}else C()}else if(d._webAudio){var N=d.playing(b)?n.ctx.currentTime-S._playStart:0,R=S._rateSeek?S._rateSeek-S._seek:0;return S._seek+(R+N*Math.abs(S._rate))}else return S._node.currentTime;return d},playing:function(d){var p=this;if(typeof d=="number"){var g=p._soundById(d);return g?!g._paused:!1}for(var b=0;b<p._sounds.length;b++)if(!p._sounds[b]._paused)return!0;return!1},duration:function(d){var p=this,g=p._duration,b=p._soundById(d);return b&&(g=p._sprite[b._sprite][1]/1e3),g},state:function(){return this._state},unload:function(){for(var d=this,p=d._sounds,g=0;g<p.length;g++)p[g]._paused||d.stop(p[g]._id),d._webAudio||(d._clearSound(p[g]._node),p[g]._node.removeEventListener("error",p[g]._errorFn,!1),p[g]._node.removeEventListener(n._canPlayEvent,p[g]._loadFn,!1),p[g]._node.removeEventListener("ended",p[g]._endFn,!1),n._releaseHtml5Audio(p[g]._node)),delete p[g]._node,d._clearTimer(p[g]._id);var b=n._howls.indexOf(d);b>=0&&n._howls.splice(b,1);var w=!0;for(g=0;g<n._howls.length;g++)if(n._howls[g]._src===d._src||d._src.indexOf(n._howls[g]._src)>=0){w=!1;break}return s&&w&&delete s[d._src],n.noAudio=!1,d._state="unloaded",d._sounds=[],d=null,null},on:function(d,p,g,b){var w=this,x=w["_on"+d];return typeof p=="function"&&x.push(b?{id:g,fn:p,once:b}:{id:g,fn:p}),w},off:function(d,p,g){var b=this,w=b["_on"+d],x=0;if(typeof p=="number"&&(g=p,p=null),p||g)for(x=0;x<w.length;x++){var S=g===w[x].id;if(p===w[x].fn&&S||!p&&S){w.splice(x,1);break}}else if(d)b["_on"+d]=[];else{var M=Object.keys(b);for(x=0;x<M.length;x++)M[x].indexOf("_on")===0&&Array.isArray(b[M[x]])&&(b[M[x]]=[])}return b},once:function(d,p,g){var b=this;return b.on(d,p,g,1),b},_emit:function(d,p,g){for(var b=this,w=b["_on"+d],x=w.length-1;x>=0;x--)(!w[x].id||w[x].id===p||d==="load")&&(setTimeout(function(S){S.call(this,p,g)}.bind(b,w[x].fn),0),w[x].once&&b.off(d,w[x].fn,w[x].id));return b._loadQueue(d),b},_loadQueue:function(d){var p=this;if(p._queue.length>0){var g=p._queue[0];g.event===d&&(p._queue.shift(),p._loadQueue()),d||g.action()}return p},_ended:function(d){var p=this,g=d._sprite;if(!p._webAudio&&d._node&&!d._node.paused&&!d._node.ended&&d._node.currentTime<d._stop)return setTimeout(p._ended.bind(p,d),100),p;var b=!!(d._loop||p._sprite[g][2]);if(p._emit("end",d._id),!p._webAudio&&b&&p.stop(d._id,!0).play(d._id),p._webAudio&&b){p._emit("play",d._id),d._seek=d._start||0,d._rateSeek=0,d._playStart=n.ctx.currentTime;var w=(d._stop-d._start)*1e3/Math.abs(d._rate);p._endTimers[d._id]=setTimeout(p._ended.bind(p,d),w)}return p._webAudio&&!b&&(d._paused=!0,d._ended=!0,d._seek=d._start||0,d._rateSeek=0,p._clearTimer(d._id),p._cleanBuffer(d._node),n._autoSuspend()),!p._webAudio&&!b&&p.stop(d._id,!0),p},_clearTimer:function(d){var p=this;if(p._endTimers[d]){if(typeof p._endTimers[d]!="function")clearTimeout(p._endTimers[d]);else{var g=p._soundById(d);g&&g._node&&g._node.removeEventListener("ended",p._endTimers[d],!1)}delete p._endTimers[d]}return p},_soundById:function(d){for(var p=this,g=0;g<p._sounds.length;g++)if(d===p._sounds[g]._id)return p._sounds[g];return null},_inactiveSound:function(){var d=this;d._drain();for(var p=0;p<d._sounds.length;p++)if(d._sounds[p]._ended)return d._sounds[p].reset();return new a(d)},_drain:function(){var d=this,p=d._pool,g=0,b=0;if(!(d._sounds.length<p)){for(b=0;b<d._sounds.length;b++)d._sounds[b]._ended&&g++;for(b=d._sounds.length-1;b>=0;b--){if(g<=p)return;d._sounds[b]._ended&&(d._webAudio&&d._sounds[b]._node&&d._sounds[b]._node.disconnect(0),d._sounds.splice(b,1),g--)}}},_getSoundIds:function(d){var p=this;if(typeof d>"u"){for(var g=[],b=0;b<p._sounds.length;b++)g.push(p._sounds[b]._id);return g}else return[d]},_refreshBuffer:function(d){var p=this;return d._node.bufferSource=n.ctx.createBufferSource(),d._node.bufferSource.buffer=s[p._src],d._panner?d._node.bufferSource.connect(d._panner):d._node.bufferSource.connect(d._node),d._node.bufferSource.loop=d._loop,d._loop&&(d._node.bufferSource.loopStart=d._start||0,d._node.bufferSource.loopEnd=d._stop||0),d._node.bufferSource.playbackRate.setValueAtTime(d._rate,n.ctx.currentTime),p},_cleanBuffer:function(d){var p=this,g=n._navigator&&n._navigator.vendor.indexOf("Apple")>=0;if(!d.bufferSource)return p;if(n._scratchBuffer&&d.bufferSource&&(d.bufferSource.onended=null,d.bufferSource.disconnect(0),g))try{d.bufferSource.buffer=n._scratchBuffer}catch{}return d.bufferSource=null,p},_clearSound:function(d){var p=/MSIE |Trident\//.test(n._navigator&&n._navigator.userAgent);p||(d.src="data:audio/wav;base64,UklGRigAAABXQVZFZm10IBIAAAABAAEARKwAAIhYAQACABAAAABkYXRhAgAAAAEA")}};var a=function(d){this._parent=d,this.init()};a.prototype={init:function(){var d=this,p=d._parent;return d._muted=p._muted,d._loop=p._loop,d._volume=p._volume,d._rate=p._rate,d._seek=0,d._paused=!0,d._ended=!0,d._sprite="__default",d._id=++n._counter,p._sounds.push(d),d.create(),d},create:function(){var d=this,p=d._parent,g=n._muted||d._muted||d._parent._muted?0:d._volume;return p._webAudio?(d._node=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),d._node.gain.setValueAtTime(g,n.ctx.currentTime),d._node.paused=!0,d._node.connect(n.masterGain)):n.noAudio||(d._node=n._obtainHtml5Audio(),d._errorFn=d._errorListener.bind(d),d._node.addEventListener("error",d._errorFn,!1),d._loadFn=d._loadListener.bind(d),d._node.addEventListener(n._canPlayEvent,d._loadFn,!1),d._endFn=d._endListener.bind(d),d._node.addEventListener("ended",d._endFn,!1),d._node.src=p._src,d._node.preload=p._preload===!0?"auto":p._preload,d._node.volume=g*n.volume(),d._node.load()),d},reset:function(){var d=this,p=d._parent;return d._muted=p._muted,d._loop=p._loop,d._volume=p._volume,d._rate=p._rate,d._seek=0,d._rateSeek=0,d._paused=!0,d._ended=!0,d._sprite="__default",d._id=++n._counter,d},_errorListener:function(){var d=this;d._parent._emit("loaderror",d._id,d._node.error?d._node.error.code:0),d._node.removeEventListener("error",d._errorFn,!1)},_loadListener:function(){var d=this,p=d._parent;p._duration=Math.ceil(d._node.duration*10)/10,Object.keys(p._sprite).length===0&&(p._sprite={__default:[0,p._duration*1e3]}),p._state!=="loaded"&&(p._state="loaded",p._emit("load"),p._loadQueue()),d._node.removeEventListener(n._canPlayEvent,d._loadFn,!1)},_endListener:function(){var d=this,p=d._parent;p._duration===1/0&&(p._duration=Math.ceil(d._node.duration*10)/10,p._sprite.__default[1]===1/0&&(p._sprite.__default[1]=p._duration*1e3),p._ended(d)),d._node.removeEventListener("ended",d._endFn,!1)}};var s={},r=function(d){var p=d._src;if(s[p]){d._duration=s[p].duration,u(d);return}if(/^data:[^;]+;base64,/.test(p)){for(var g=atob(p.split(",")[1]),b=new Uint8Array(g.length),w=0;w<g.length;++w)b[w]=g.charCodeAt(w);c(b.buffer,d)}else{var x=new XMLHttpRequest;x.open(d._xhr.method,p,!0),x.withCredentials=d._xhr.withCredentials,x.responseType="arraybuffer",d._xhr.headers&&Object.keys(d._xhr.headers).forEach(function(S){x.setRequestHeader(S,d._xhr.headers[S])}),x.onload=function(){var S=(x.status+"")[0];if(S!=="0"&&S!=="2"&&S!=="3"){d._emit("loaderror",null,"Failed loading audio file with status: "+x.status+".");return}c(x.response,d)},x.onerror=function(){d._webAudio&&(d._html5=!0,d._webAudio=!1,d._sounds=[],delete s[p],d.load())},o(x)}},o=function(d){try{d.send()}catch{d.onerror()}},c=function(d,p){var g=function(){p._emit("loaderror",null,"Decoding audio data failed.")},b=function(w){w&&p._sounds.length>0?(s[p._src]=w,u(p,w)):g()};typeof Promise<"u"&&n.ctx.decodeAudioData.length===1?n.ctx.decodeAudioData(d).then(b).catch(g):n.ctx.decodeAudioData(d,b,g)},u=function(d,p){p&&!d._duration&&(d._duration=p.duration),Object.keys(d._sprite).length===0&&(d._sprite={__default:[0,d._duration*1e3]}),d._state!=="loaded"&&(d._state="loaded",d._emit("load"),d._loadQueue())},h=function(){if(n.usingWebAudio){try{typeof AudioContext<"u"?n.ctx=new AudioContext:typeof webkitAudioContext<"u"?n.ctx=new webkitAudioContext:n.usingWebAudio=!1}catch{n.usingWebAudio=!1}n.ctx||(n.usingWebAudio=!1);var d=/iP(hone|od|ad)/.test(n._navigator&&n._navigator.platform),p=n._navigator&&n._navigator.appVersion.match(/OS (\d+)_(\d+)_?(\d+)?/),g=p?parseInt(p[1],10):null;if(d&&g&&g<9){var b=/safari/.test(n._navigator&&n._navigator.userAgent.toLowerCase());n._navigator&&!b&&(n.usingWebAudio=!1)}n.usingWebAudio&&(n.masterGain=typeof n.ctx.createGain>"u"?n.ctx.createGainNode():n.ctx.createGain(),n.masterGain.gain.setValueAtTime(n._muted?0:n._volume,n.ctx.currentTime),n.masterGain.connect(n.ctx.destination)),n._setup()}};t.Howler=n,t.Howl=i,typeof jy<"u"?(jy.HowlerGlobal=e,jy.Howler=n,jy.Howl=i,jy.Sound=a):typeof window<"u"&&(window.HowlerGlobal=e,window.Howler=n,window.Howl=i,window.Sound=a)})();/*!
* Spatial Plugin - Adds support for stereo and 3D audio where Web Audio is supported.
*
* howler.js v2.2.4
* howlerjs.com
*
* (c) 2013-2020, James Simpson of GoldFire Studios
* goldfirestudios.com
*
* MIT License
*/(function(){HowlerGlobal.prototype._pos=[0,0,0],HowlerGlobal.prototype._orientation=[0,0,-1,0,1,0],HowlerGlobal.prototype.stereo=function(n){var i=this;if(!i.ctx||!i.ctx.listener)return i;for(var a=i._howls.length-1;a>=0;a--)i._howls[a].stereo(n);return i},HowlerGlobal.prototype.pos=function(n,i,a){var s=this;if(!s.ctx||!s.ctx.listener)return s;if(i=typeof i!="number"?s._pos[1]:i,a=typeof a!="number"?s._pos[2]:a,typeof n=="number")s._pos=[n,i,a],typeof s.ctx.listener.positionX<"u"?(s.ctx.listener.positionX.setTargetAtTime(s._pos[0],Howler.ctx.currentTime,.1),s.ctx.listener.positionY.setTargetAtTime(s._pos[1],Howler.ctx.currentTime,.1),s.ctx.listener.positionZ.setTargetAtTime(s._pos[2],Howler.ctx.currentTime,.1)):s.ctx.listener.setPosition(s._pos[0],s._pos[1],s._pos[2]);else return s._pos;return s},HowlerGlobal.prototype.orientation=function(n,i,a,s,r,o){var c=this;if(!c.ctx||!c.ctx.listener)return c;var u=c._orientation;if(i=typeof i!="number"?u[1]:i,a=typeof a!="number"?u[2]:a,s=typeof s!="number"?u[3]:s,r=typeof r!="number"?u[4]:r,o=typeof o!="number"?u[5]:o,typeof n=="number")c._orientation=[n,i,a,s,r,o],typeof c.ctx.listener.forwardX<"u"?(c.ctx.listener.forwardX.setTargetAtTime(n,Howler.ctx.currentTime,.1),c.ctx.listener.forwardY.setTargetAtTime(i,Howler.ctx.currentTime,.1),c.ctx.listener.forwardZ.setTargetAtTime(a,Howler.ctx.currentTime,.1),c.ctx.listener.upX.setTargetAtTime(s,Howler.ctx.currentTime,.1),c.ctx.listener.upY.setTargetAtTime(r,Howler.ctx.currentTime,.1),c.ctx.listener.upZ.setTargetAtTime(o,Howler.ctx.currentTime,.1)):c.ctx.listener.setOrientation(n,i,a,s,r,o);else return u;return c},Howl.prototype.init=(function(n){return function(i){var a=this;return a._orientation=i.orientation||[1,0,0],a._stereo=i.stereo||null,a._pos=i.pos||null,a._pannerAttr={coneInnerAngle:typeof i.coneInnerAngle<"u"?i.coneInnerAngle:360,coneOuterAngle:typeof i.coneOuterAngle<"u"?i.coneOuterAngle:360,coneOuterGain:typeof i.coneOuterGain<"u"?i.coneOuterGain:0,distanceModel:typeof i.distanceModel<"u"?i.distanceModel:"inverse",maxDistance:typeof i.maxDistance<"u"?i.maxDistance:1e4,panningModel:typeof i.panningModel<"u"?i.panningModel:"HRTF",refDistance:typeof i.refDistance<"u"?i.refDistance:1,rolloffFactor:typeof i.rolloffFactor<"u"?i.rolloffFactor:1},a._onstereo=i.onstereo?[{fn:i.onstereo}]:[],a._onpos=i.onpos?[{fn:i.onpos}]:[],a._onorientation=i.onorientation?[{fn:i.onorientation}]:[],n.call(this,i)}})(Howl.prototype.init),Howl.prototype.stereo=function(n,i){var a=this;if(!a._webAudio)return a;if(a._state!=="loaded")return a._queue.push({event:"stereo",action:function(){a.stereo(n,i)}}),a;var s=typeof Howler.ctx.createStereoPanner>"u"?"spatial":"stereo";if(typeof i>"u")if(typeof n=="number")a._stereo=n,a._pos=[n,0,0];else return a._stereo;for(var r=a._getSoundIds(i),o=0;o<r.length;o++){var c=a._soundById(r[o]);if(c)if(typeof n=="number")c._stereo=n,c._pos=[n,0,0],c._node&&(c._pannerAttr.panningModel="equalpower",(!c._panner||!c._panner.pan)&&e(c,s),s==="spatial"?typeof c._panner.positionX<"u"?(c._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),c._panner.positionY.setValueAtTime(0,Howler.ctx.currentTime),c._panner.positionZ.setValueAtTime(0,Howler.ctx.currentTime)):c._panner.setPosition(n,0,0):c._panner.pan.setValueAtTime(n,Howler.ctx.currentTime)),a._emit("stereo",c._id);else return c._stereo}return a},Howl.prototype.pos=function(n,i,a,s){var r=this;if(!r._webAudio)return r;if(r._state!=="loaded")return r._queue.push({event:"pos",action:function(){r.pos(n,i,a,s)}}),r;if(i=typeof i!="number"?0:i,a=typeof a!="number"?-.5:a,typeof s>"u")if(typeof n=="number")r._pos=[n,i,a];else return r._pos;for(var o=r._getSoundIds(s),c=0;c<o.length;c++){var u=r._soundById(o[c]);if(u)if(typeof n=="number")u._pos=[n,i,a],u._node&&((!u._panner||u._panner.pan)&&e(u,"spatial"),typeof u._panner.positionX<"u"?(u._panner.positionX.setValueAtTime(n,Howler.ctx.currentTime),u._panner.positionY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.positionZ.setValueAtTime(a,Howler.ctx.currentTime)):u._panner.setPosition(n,i,a)),r._emit("pos",u._id);else return u._pos}return r},Howl.prototype.orientation=function(n,i,a,s){var r=this;if(!r._webAudio)return r;if(r._state!=="loaded")return r._queue.push({event:"orientation",action:function(){r.orientation(n,i,a,s)}}),r;if(i=typeof i!="number"?r._orientation[1]:i,a=typeof a!="number"?r._orientation[2]:a,typeof s>"u")if(typeof n=="number")r._orientation=[n,i,a];else return r._orientation;for(var o=r._getSoundIds(s),c=0;c<o.length;c++){var u=r._soundById(o[c]);if(u)if(typeof n=="number")u._orientation=[n,i,a],u._node&&(u._panner||(u._pos||(u._pos=r._pos||[0,0,-.5]),e(u,"spatial")),typeof u._panner.orientationX<"u"?(u._panner.orientationX.setValueAtTime(n,Howler.ctx.currentTime),u._panner.orientationY.setValueAtTime(i,Howler.ctx.currentTime),u._panner.orientationZ.setValueAtTime(a,Howler.ctx.currentTime)):u._panner.setOrientation(n,i,a)),r._emit("orientation",u._id);else return u._orientation}return r},Howl.prototype.pannerAttr=function(){var n=this,i=arguments,a,s,r;if(!n._webAudio)return n;if(i.length===0)return n._pannerAttr;if(i.length===1)if(typeof i[0]=="object")a=i[0],typeof s>"u"&&(a.pannerAttr||(a.pannerAttr={coneInnerAngle:a.coneInnerAngle,coneOuterAngle:a.coneOuterAngle,coneOuterGain:a.coneOuterGain,distanceModel:a.distanceModel,maxDistance:a.maxDistance,refDistance:a.refDistance,rolloffFactor:a.rolloffFactor,panningModel:a.panningModel}),n._pannerAttr={coneInnerAngle:typeof a.pannerAttr.coneInnerAngle<"u"?a.pannerAttr.coneInnerAngle:n._coneInnerAngle,coneOuterAngle:typeof a.pannerAttr.coneOuterAngle<"u"?a.pannerAttr.coneOuterAngle:n._coneOuterAngle,coneOuterGain:typeof a.pannerAttr.coneOuterGain<"u"?a.pannerAttr.coneOuterGain:n._coneOuterGain,distanceModel:typeof a.pannerAttr.distanceModel<"u"?a.pannerAttr.distanceModel:n._distanceModel,maxDistance:typeof a.pannerAttr.maxDistance<"u"?a.pannerAttr.maxDistance:n._maxDistance,refDistance:typeof a.pannerAttr.refDistance<"u"?a.pannerAttr.refDistance:n._refDistance,rolloffFactor:typeof a.pannerAttr.rolloffFactor<"u"?a.pannerAttr.rolloffFactor:n._rolloffFactor,panningModel:typeof a.pannerAttr.panningModel<"u"?a.pannerAttr.panningModel:n._panningModel});else return r=n._soundById(parseInt(i[0],10)),r?r._pannerAttr:n._pannerAttr;else i.length===2&&(a=i[0],s=parseInt(i[1],10));for(var o=n._getSoundIds(s),c=0;c<o.length;c++)if(r=n._soundById(o[c]),r){var u=r._pannerAttr;u={coneInnerAngle:typeof a.coneInnerAngle<"u"?a.coneInnerAngle:u.coneInnerAngle,coneOuterAngle:typeof a.coneOuterAngle<"u"?a.coneOuterAngle:u.coneOuterAngle,coneOuterGain:typeof a.coneOuterGain<"u"?a.coneOuterGain:u.coneOuterGain,distanceModel:typeof a.distanceModel<"u"?a.distanceModel:u.distanceModel,maxDistance:typeof a.maxDistance<"u"?a.maxDistance:u.maxDistance,refDistance:typeof a.refDistance<"u"?a.refDistance:u.refDistance,rolloffFactor:typeof a.rolloffFactor<"u"?a.rolloffFactor:u.rolloffFactor,panningModel:typeof a.panningModel<"u"?a.panningModel:u.panningModel};var h=r._panner;h||(r._pos||(r._pos=n._pos||[0,0,-.5]),e(r,"spatial"),h=r._panner),h.coneInnerAngle=u.coneInnerAngle,h.coneOuterAngle=u.coneOuterAngle,h.coneOuterGain=u.coneOuterGain,h.distanceModel=u.distanceModel,h.maxDistance=u.maxDistance,h.refDistance=u.refDistance,h.rolloffFactor=u.rolloffFactor,h.panningModel=u.panningModel}return n},Sound.prototype.init=(function(n){return function(){var i=this,a=i._parent;i._orientation=a._orientation,i._stereo=a._stereo,i._pos=a._pos,i._pannerAttr=a._pannerAttr,n.call(this),i._stereo?a.stereo(i._stereo):i._pos&&a.pos(i._pos[0],i._pos[1],i._pos[2],i._id)}})(Sound.prototype.init),Sound.prototype.reset=(function(n){return function(){var i=this,a=i._parent;return i._orientation=a._orientation,i._stereo=a._stereo,i._pos=a._pos,i._pannerAttr=a._pannerAttr,i._stereo?a.stereo(i._stereo):i._pos?a.pos(i._pos[0],i._pos[1],i._pos[2],i._id):i._panner&&(i._panner.disconnect(0),i._panner=void 0,a._refreshBuffer(i)),n.call(this)}})(Sound.prototype.reset);var e=function(n,i){i=i||"spatial",i==="spatial"?(n._panner=Howler.ctx.createPanner(),n._panner.coneInnerAngle=n._pannerAttr.coneInnerAngle,n._panner.coneOuterAngle=n._pannerAttr.coneOuterAngle,n._panner.coneOuterGain=n._pannerAttr.coneOuterGain,n._panner.distanceModel=n._pannerAttr.distanceModel,n._panner.maxDistance=n._pannerAttr.maxDistance,n._panner.refDistance=n._pannerAttr.refDistance,n._panner.rolloffFactor=n._pannerAttr.rolloffFactor,n._panner.panningModel=n._pannerAttr.panningModel,typeof n._panner.positionX<"u"?(n._panner.positionX.setValueAtTime(n._pos[0],Howler.ctx.currentTime),n._panner.positionY.setValueAtTime(n._pos[1],Howler.ctx.currentTime),n._panner.positionZ.setValueAtTime(n._pos[2],Howler.ctx.currentTime)):n._panner.setPosition(n._pos[0],n._pos[1],n._pos[2]),typeof n._panner.orientationX<"u"?(n._panner.orientationX.setValueAtTime(n._orientation[0],Howler.ctx.currentTime),n._panner.orientationY.setValueAtTime(n._orientation[1],Howler.ctx.currentTime),n._panner.orientationZ.setValueAtTime(n._orientation[2],Howler.ctx.currentTime)):n._panner.setOrientation(n._orientation[0],n._orientation[1],n._orientation[2])):(n._panner=Howler.ctx.createStereoPanner(),n._panner.pan.setValueAtTime(n._stereo,Howler.ctx.currentTime)),n._panner.connect(n._node),n._paused||n._parent.pause(n._id,!0).play(n._id,!0)}})()})(ZE)),ZE}var Xk=Zue();function Que(t){return en({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"path",attr:{d:"M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"},child:[]},{tag:"path",attr:{d:"M13 13l6 6"},child:[]}]})(t)}function Jue(t){return en({attr:{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"},child:[{tag:"polyline",attr:{points:"1 4 1 10 7 10"},child:[]},{tag:"path",attr:{d:"M3.51 15a9 9 0 1 0 2.13-9.36L1 10"},child:[]}]})(t)}function ede(t){return en({attr:{fill:"currentColor",viewBox:"0 0 16 16"},child:[{tag:"path",attr:{d:"M14 5a1 1 0 0 1 1 1v5a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V6a1 1 0 0 1 1-1zM2 4a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2z"},child:[]},{tag:"path",attr:{d:"M13 10.25a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm0-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5 0A.25.25 0 0 1 8.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 8 8.75zm2 0a.25.25 0 0 1 .25-.25h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5a.25.25 0 0 1-.25-.25zm1 2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-5-2A.25.25 0 0 1 6.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 6 8.75zm-2 0A.25.25 0 0 1 4.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 4 8.75zm-2 0A.25.25 0 0 1 2.25 8h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 2 8.75zm11-2a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm-2 0A.25.25 0 0 1 9.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 9 6.75zm-2 0A.25.25 0 0 1 7.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 7 6.75zm-2 0A.25.25 0 0 1 5.25 6h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5A.25.25 0 0 1 5 6.75zm-3 0A.25.25 0 0 1 2.25 6h1.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-1.5A.25.25 0 0 1 2 6.75zm0 4a.25.25 0 0 1 .25-.25h.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-.5a.25.25 0 0 1-.25-.25zm2 0a.25.25 0 0 1 .25-.25h5.5a.25.25 0 0 1 .25.25v.5a.25.25 0 0 1-.25.25h-5.5a.25.25 0 0 1-.25-.25z"},child:[]}]})(t)}function qk(t){const e=sn.c(13),{title:n,description:i}=t;let a,s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={opacity:0,y:-20},s={opacity:1,y:0},r={duration:.5,delay:.1},e[0]=a,e[1]=s,e[2]=r):(a=e[0],s=e[1],r=e[2]);let o;e[3]!==n?(o=_.jsx(Ve.h1,{initial:a,animate:s,transition:r,className:"!text-5xl mb-2 text-center title",children:n}),e[3]=n,e[4]=o):o=e[4];let c,u,h;e[5]===Symbol.for("react.memo_cache_sentinel")?(c={opacity:0},u={opacity:1},h={duration:.5,delay:.2},e[5]=c,e[6]=u,e[7]=h):(c=e[5],u=e[6],h=e[7]);let d;e[8]!==i?(d=_.jsx(Ve.p,{initial:c,animate:u,transition:h,className:"text-slate-300 text-center mb-2 text-sm",children:i}),e[8]=i,e[9]=d):d=e[9];let p;return e[10]!==o||e[11]!==d?(p=_.jsxs("div",{className:"relative z-10 p-2",children:[o,d]}),e[10]=o,e[11]=d,e[12]=p):p=e[12],p}const tde={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},QE={hidden:{opacity:0,y:20,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}}},gS={hover:{scale:1.05,rotate:2},tap:{scale:.95}};function nde(){const t=sn.c(71),{t:e}=Dn();let n,i,a,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={opacity:0,scale:.9},i={opacity:1,scale:1},a={opacity:0,scale:.9},s={duration:.3},t[0]=n,t[1]=i,t[2]=a,t[3]=s):(n=t[0],i=t[1],a=t[2],s=t[3]);let r;t[4]!==e?(r=e("decorate_ui.help.title"),t[4]=e,t[5]=r):r=t[5];let o;t[6]!==e?(o=e("decorate_ui.help.description"),t[6]=e,t[7]=o):o=t[7];let c;t[8]!==r||t[9]!==o?(c=_.jsx(qk,{title:r,description:o}),t[8]=r,t[9]=o,t[10]=c):c=t[10];let u;t[11]===Symbol.for("react.memo_cache_sentinel")?(u=_.jsx("div",{className:"p-2 bg-blue-500/20 rounded-lg group-hover:bg-blue-500/30 transition-colors",children:_.jsx(Que,{className:"w-5 h-5 text-blue-400"})}),t[11]=u):u=t[11];let h;t[12]!==e?(h=e("decorate_ui.help.mouse_control"),t[12]=e,t[13]=h):h=t[13];let d;t[14]!==h?(d=_.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[u,_.jsx("h3",{className:"font-semibold text-white",children:h})]}),t[14]=h,t[15]=d):d=t[15];let p;t[16]!==e?(p=e("decorate_ui.help.mouse_control_description"),t[16]=e,t[17]=p):p=t[17];let g;t[18]!==p?(g=_.jsx("div",{className:"ml-10 space-y-2",children:_.jsx("p",{className:"text-slate-300",children:p})}),t[18]=p,t[19]=g):g=t[19];let b;t[20]!==g||t[21]!==d?(b=_.jsxs(Ve.div,{variants:QE,className:"group",children:[d,g]}),t[20]=g,t[21]=d,t[22]=b):b=t[22];let w;t[23]===Symbol.for("react.memo_cache_sentinel")?(w=_.jsx("div",{className:"p-2 bg-green-500/20 rounded-lg group-hover:bg-green-500/30 transition-colors",children:_.jsx(ede,{className:"w-5 h-5 text-green-400"})}),t[23]=w):w=t[23];let x;t[24]!==e?(x=e("decorate_ui.help.keyboard_control"),t[24]=e,t[25]=x):x=t[25];let S;t[26]!==x?(S=_.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[w,_.jsx("h3",{className:"font-semibold text-white",children:x})]}),t[26]=x,t[27]=S):S=t[27];let M;t[28]===Symbol.for("react.memo_cache_sentinel")?(M=_.jsx(Ve.div,{variants:gS,whileHover:"hover",whileTap:"tap",className:"px-2 py-1 bg-slate-700 rounded-md border border-slate-600 text-sm font-mono text-slate-200",children:"F5"}),t[28]=M):M=t[28];let C;t[29]!==e?(C=e("decorate_ui.help.f5_description"),t[29]=e,t[30]=C):C=t[30];let A;t[31]!==C?(A=_.jsxs("div",{className:"flex items-center gap-3",children:[M,_.jsx("span",{className:"text-slate-300",children:C})]}),t[31]=C,t[32]=A):A=t[32];let N;t[33]===Symbol.for("react.memo_cache_sentinel")?(N=_.jsx(Ve.div,{variants:gS,whileHover:"hover",whileTap:"tap",className:"px-2 py-1 bg-slate-700 rounded-md border border-slate-600 text-sm font-mono text-slate-200",children:"F6"}),t[33]=N):N=t[33];let R;t[34]!==e?(R=e("decorate_ui.help.f6_description"),t[34]=e,t[35]=R):R=t[35];let D;t[36]!==R?(D=_.jsxs("div",{className:"flex items-center gap-3",children:[N,_.jsx("span",{className:"text-slate-300",children:R})]}),t[36]=R,t[37]=D):D=t[37];let B;t[38]===Symbol.for("react.memo_cache_sentinel")?(B=_.jsx("div",{className:"flex gap-1",children:["W","A","S","D"].map(ide)}),t[38]=B):B=t[38];let z;t[39]!==e?(z=e("decorate_ui.help.wasd_description"),t[39]=e,t[40]=z):z=t[40];let I;t[41]!==z?(I=_.jsxs("div",{className:"flex items-center gap-3",children:[B,_.jsx("span",{className:"text-slate-300",children:z})]}),t[41]=z,t[42]=I):I=t[42];let U;t[43]===Symbol.for("react.memo_cache_sentinel")?(U=_.jsx(Ve.div,{variants:gS,whileHover:"hover",whileTap:"tap",className:"px-2 py-1 bg-red-500/20 rounded-md border border-red-500/30 text-sm font-mono text-red-400",children:"ESC"}),t[43]=U):U=t[43];let $;t[44]!==e?($=e("decorate_ui.help.esc_description"),t[44]=e,t[45]=$):$=t[45];let G;t[46]!==$?(G=_.jsxs("div",{className:"flex items-center gap-3",children:[U,_.jsx("span",{className:"text-slate-300",children:$})]}),t[46]=$,t[47]=G):G=t[47];let k;t[48]!==A||t[49]!==D||t[50]!==I||t[51]!==G?(k=_.jsxs("div",{className:"ml-10 space-y-2",children:[A,D,I,G]}),t[48]=A,t[49]=D,t[50]=I,t[51]=G,t[52]=k):k=t[52];let X;t[53]!==S||t[54]!==k?(X=_.jsxs(Ve.div,{variants:QE,className:"group",children:[S,k]}),t[53]=S,t[54]=k,t[55]=X):X=t[55];let V;t[56]===Symbol.for("react.memo_cache_sentinel")?(V=_.jsx("div",{className:"p-2 bg-yellow-500/20 rounded-lg group-hover:bg-yellow-500/30 transition-colors",children:_.jsx(Jue,{className:"w-5 h-5 text-yellow-400"})}),t[56]=V):V=t[56];let H;t[57]!==e?(H=e("decorate_ui.help.important_tips"),t[57]=e,t[58]=H):H=t[58];let W;t[59]!==H?(W=_.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[V,_.jsx("h3",{className:"font-semibold text-white",children:H})]}),t[59]=H,t[60]=W):W=t[60];let J;t[61]===Symbol.for("react.memo_cache_sentinel")?(J=_.jsx("div",{className:"ml-10",children:_.jsx("p",{className:"text-slate-300 text-sm",children:_.jsx(rce,{i18nKey:"decorate_ui.help.important_tips_description",components:{typeColor:_.jsx("span",{className:"text-blue-400 font-semibold"}),storageWardrobe:_.jsx("span",{className:"text-green-400 font-semibold"})}})})}),t[61]=J):J=t[61];let Y;t[62]!==W?(Y=_.jsxs(Ve.div,{variants:QE,className:"group",children:[W,J]}),t[62]=W,t[63]=Y):Y=t[63];let K;t[64]!==b||t[65]!==X||t[66]!==Y?(K=_.jsx("div",{className:"p-0 pt-0",children:_.jsxs(Ve.div,{variants:tde,initial:"hidden",animate:"visible",className:"space-y-4",children:[b,X,Y]})}),t[64]=b,t[65]=X,t[66]=Y,t[67]=K):K=t[67];let ee;return t[68]!==K||t[69]!==c?(ee=_.jsxs(Ve.div,{initial:n,animate:i,exit:a,transition:s,className:"relative rounded-2xl overflow-auto",children:[c,K]}),t[68]=K,t[69]=c,t[70]=ee):ee=t[70],ee}function ide(t,e){return _.jsx(Ve.div,{variants:gS,whileHover:"hover",whileTap:"tap",className:"px-2 py-1 bg-slate-700 rounded border border-slate-600 text-xs font-mono text-slate-200",children:t},t)}const yo=(t,e)=>{const n=sn.c(6),i=P.useRef(ade);let a,s;n[0]!==e?(a=()=>{i.current=e},s=[e],n[0]=e,n[1]=a,n[2]=s):(a=n[1],s=n[2]),P.useEffect(a,s);let r,o;n[3]!==t?(r=()=>{const c=u=>{const{action:h,data:d}=u.data;i.current&&h===t&&i.current(d)};return window.addEventListener("message",c),()=>window.removeEventListener("message",c)},o=[t],n[3]=t,n[4]=r,n[5]=o):(r=n[4],o=n[5]),P.useEffect(r,o)};function ade(){}function sde(t){const e=sn.c(82),{selectedColorData:n}=t,{t:i}=Dn(),[a,s]=P.useState(!1),[r,o]=pu(xA),c=vi(vr),u=new Intl.NumberFormat(c.intl.locales,c.intl.options);let h,d;e[0]!==a?(h=()=>{d(),ut("buy_object")},d=()=>{a?ut("play_sound","category_down"):ut("play_sound","cancel"),s(rde)},e[0]=a,e[1]=h,e[2]=d):(h=e[1],d=e[2]);let p;e[3]!==r||e[4]!==o||e[5]!==d?(p=()=>{r&&o(!1),d()},e[3]=r,e[4]=o,e[5]=d,e[6]=p):p=e[6],yo("open_buy_object_modal",p);const g=Ve;let b;e[7]===Symbol.for("react.memo_cache_sentinel")?(b={opacity:0,y:20,scale:.95},e[7]=b):b=e[7];let w;e[8]===Symbol.for("react.memo_cache_sentinel")?(w={hidden:b,visible:{opacity:1,y:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}}},e[8]=w):w=e[8];const x="group";let S;e[9]===Symbol.for("react.memo_cache_sentinel")?(S=_.jsx("div",{className:"p-2 bg-green-500/20 rounded-lg group-hover:bg-green-500/30 transition-colors",children:_.jsx(_D,{className:"w-5 h-5 text-green-400"})}),e[9]=S):S=e[9];let M;e[10]!==i?(M=i("decorate_ui.buy.price_info"),e[10]=i,e[11]=M):M=e[11];let C;e[12]!==M?(C=_.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[S,_.jsx("h3",{className:"text-xl font-semibold text-white",children:M})]}),e[12]=M,e[13]=C):C=e[13];const A="ml-10 space-y-4",N="flex items-center justify-between p-4 bg-slate-800/30 rounded-lg border border-slate-600/30";let R;e[14]!==i?(R=i("decorate_ui.buy.selected_color"),e[14]=i,e[15]=R):R=e[15];let D;e[16]!==R?(D=_.jsx("p",{className:"text-slate-300 text-sm",children:R}),e[16]=R,e[17]=D):D=e[17];const B=n?.label;let z;e[18]!==B?(z=_.jsx("p",{className:"text-white font-semibold",children:B}),e[18]=B,e[19]=z):z=e[19];let I;e[20]!==D||e[21]!==z?(I=_.jsxs("div",{children:[D,z]}),e[20]=D,e[21]=z,e[22]=I):I=e[22];const U="text-right";let $;e[23]!==i?($=i("decorate_ui.buy.price"),e[23]=i,e[24]=$):$=e[24];let G;e[25]!==$?(G=_.jsx("p",{className:"text-slate-300 text-sm",children:$}),e[25]=$,e[26]=G):G=e[26];const k="text-green-400 font-bold text-xl",X=u.format(n?.price||0);let V;e[27]!==X?(V=_.jsx("p",{className:k,children:X}),e[27]=X,e[28]=V):V=e[28];let H;e[29]!==G||e[30]!==V?(H=_.jsxs("div",{className:U,children:[G,V]}),e[29]=G,e[30]=V,e[31]=H):H=e[31];let W;e[32]!==I||e[33]!==H?(W=_.jsxs("div",{className:N,children:[I,H]}),e[32]=I,e[33]=H,e[34]=W):W=e[34];let J;e[35]===Symbol.for("react.memo_cache_sentinel")?(J={content:"bg-slate-800/80 text-white"},e[35]=J):J=e[35];let Y;e[36]===Symbol.for("react.memo_cache_sentinel")?(Y=_.jsx(_D,{className:"w-5 h-5"}),e[36]=Y):Y=e[36];const K=!n,ee=n?.price||0;let ie;e[37]!==i||e[38]!==ee?(ie=i("decorate_ui.buy.buy",{price:ee}),e[37]=i,e[38]=ee,e[39]=ie):ie=e[39];let Z;e[40]!==K||e[41]!==ie?(Z=_.jsx(av,{children:_.jsx(Zt,{className:"w-full text-white",startContent:Y,size:"lg",color:"primary",isDisabled:K,children:ie})}),e[40]=K,e[41]=ie,e[42]=Z):Z=e[42];let ue;e[43]!==i?(ue=i("decorate_ui.buy.title"),e[43]=i,e[44]=ue):ue=e[44];let se;e[45]!==ue?(se=_.jsx("div",{className:"subtitle",children:ue}),e[45]=ue,e[46]=se):se=e[46];const ae=n?.price||0;let ce;e[47]!==i||e[48]!==ae?(ce=i("decorate_ui.buy.description",{price:ae}),e[47]=i,e[48]=ae,e[49]=ce):ce=e[49];let pe;e[50]!==ce?(pe=_.jsx("span",{className:"text-sm text-gray-100/80",children:ce}),e[50]=ce,e[51]=pe):pe=e[51];let ye;e[52]!==i?(ye=i("decorate_ui.cancel"),e[52]=i,e[53]=ye):ye=e[53];let _e;e[54]!==ye||e[55]!==d?(_e=_.jsx(Zt,{variant:"solid",color:"primary",onPress:d,children:ye}),e[54]=ye,e[55]=d,e[56]=_e):_e=e[56];let me;e[57]!==i?(me=i("decorate_ui.confirm"),e[57]=i,e[58]=me):me=e[58];let ne;e[59]!==h||e[60]!==me?(ne=_.jsx(Zt,{variant:"solid",color:"success",onPress:h,children:me}),e[59]=h,e[60]=me,e[61]=ne):ne=e[61];let be;e[62]!==_e||e[63]!==ne?(be=_.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[_e,ne]}),e[62]=_e,e[63]=ne,e[64]=be):be=e[64];let xe;e[65]!==se||e[66]!==pe||e[67]!==be?(xe=_.jsx(iv,{children:_.jsxs("div",{className:"px-1 py-2 flex flex-col gap-1",children:[se,pe,be]})}),e[65]=se,e[66]=pe,e[67]=be,e[68]=xe):xe=e[68];let he;e[69]!==a||e[70]!==Z||e[71]!==xe||e[72]!==d?(he=_.jsxs(sv,{classNames:J,showArrow:!0,isOpen:a,onOpenChange:d,offset:20,backdrop:"blur",children:[Z,xe]}),e[69]=a,e[70]=Z,e[71]=xe,e[72]=d,e[73]=he):he=e[73];let ve;e[74]!==W||e[75]!==he?(ve=_.jsxs("div",{className:A,children:[W,he]}),e[74]=W,e[75]=he,e[76]=ve):ve=e[76];let Oe;return e[77]!==g.div||e[78]!==w||e[79]!==ve||e[80]!==C?(Oe=_.jsxs(g.div,{variants:w,className:x,children:[C,ve]}),e[77]=g.div,e[78]=w,e[79]=ve,e[80]=C,e[81]=Oe):Oe=e[81],Oe}function rde(t){return!t}function ode(t){const e=sn.c(147),{data:n}=t,{t:i}=Dn(),[a,s]=pu(r1),r=nh(),o=Wr(ule);vi(_A);const{id:c}=cm(),[u,h]=P.useState(!1),d=vi(vr);let p;e[0]!==n||e[1]!==c||e[2]!==a?(p=c&&a?a.find(De=>De.id&&De.id.toString()===c):a?.find?.(De=>De.modelName===n.object),e[0]=n,e[1]=c,e[2]=a,e[3]=p):p=e[3];const g=p;let b;e[4]!==u?(b=()=>{u?ut("play_sound","category_down"):ut("play_sound","cancel"),h(cde)},e[4]=u,e[5]=b):b=e[5];const w=b;if(!g){let De;return e[6]===Symbol.for("react.memo_cache_sentinel")?(De=_.jsx("div",{children:"Unknown item"}),e[6]=De):De=e[6],De}let x;e[7]!==g.id||e[8]!==o?(x=De=>{o({id:g.id,...De})},e[7]=g.id,e[8]=o,e[9]=x):x=e[9];const S=x;let M;e[10]!==g.id||e[11]!==r||e[12]!==s||e[13]!==a||e[14]!==w?(M=()=>{w(),s(a.filter(De=>De.id!==g.id)),ut("sell_current_object"),r("/decorate/stash/")},e[10]=g.id,e[11]=r,e[12]=s,e[13]=a,e[14]=w,e[15]=M):M=e[15];const C=M,A=lde;let N;e[16]===Symbol.for("react.memo_cache_sentinel")?(N={opacity:0,y:20,scale:.95},e[16]=N):N=e[16];let R;e[17]===Symbol.for("react.memo_cache_sentinel")?(R={hidden:N,visible:{opacity:1,y:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}}},e[17]=R):R=e[17];let D;e[18]===Symbol.for("react.memo_cache_sentinel")?(D=_.jsx("div",{className:"p-3 bg-gradient-to-br from-purple-500/20 to-pink-500/20 rounded-xl group-hover:from-purple-500/30 group-hover:to-pink-500/30 transition-all duration-300 shadow-lg",children:_.jsx(Zp,{className:"w-4 h-4 text-purple-400"})}),e[18]=D):D=e[18];let B;e[19]!==i?(B=i("decorate_ui.stash.furniture_management"),e[19]=i,e[20]=B):B=e[20];let z;e[21]!==B?(z=_.jsxs("div",{className:"flex items-center gap-3 mb-6",children:[D,_.jsx("div",{children:_.jsx("h3",{className:"text-xl font-bold text-white",children:B})})]}),e[21]=B,e[22]=z):z=e[22];let I,U,$;e[23]===Symbol.for("react.memo_cache_sentinel")?(I={opacity:0,x:-20},U={opacity:1,x:0},$={delay:.1},e[23]=I,e[24]=U,e[25]=$):(I=e[23],U=e[24],$=e[25]);let G;e[26]!==g.inStash||e[27]!==S?(G=()=>S({inStash:!g.inStash}),e[26]=g.inStash,e[27]=S,e[28]=G):G=e[28];let k;e[29]===Symbol.for("react.memo_cache_sentinel")?(k=_.jsx("div",{className:"p-2 bg-blue-500/20 rounded-lg group-hover/btn:bg-blue-500/30 transition-colors",children:_.jsx(Zp,{className:"w-5 h-5 text-blue-400"})}),e[29]=k):k=e[29];let X;e[30]!==i?(X=i("decorate_ui.stash.put_in_stash"),e[30]=i,e[31]=X):X=e[31];let V;e[32]!==X?(V=_.jsx("p",{className:"text-white font-semibold text-lg",children:X}),e[32]=X,e[33]=V):V=e[33];let H;e[34]!==g.inStash||e[35]!==i?(H=g.inStash?i("decorate_ui.stash.remove_from_stash_description"):i("decorate_ui.stash.put_in_stash_description"),e[34]=g.inStash,e[35]=i,e[36]=H):H=e[36];let W;e[37]!==H?(W=_.jsx("p",{className:"text-blue-300 text-sm",children:H}),e[37]=H,e[38]=W):W=e[38];let J;e[39]!==V||e[40]!==W?(J=_.jsxs("div",{className:"flex items-center gap-4",children:[k,_.jsxs("div",{className:"text-left",children:[V,W]})]}),e[39]=V,e[40]=W,e[41]=J):J=e[41];let Y;e[42]!==g.inStash||e[43]!==i?(Y=g.inStash?i("decorate_ui.stash.in_stash"):i("decorate_ui.stash.not_in_stash"),e[42]=g.inStash,e[43]=i,e[44]=Y):Y=e[44];let K;e[45]!==Y?(K=_.jsx("span",{className:"text-blue-300 text-sm",children:Y}),e[45]=Y,e[46]=K):K=e[46];let ee;e[47]===Symbol.for("react.memo_cache_sentinel")?(ee=_.jsx("div",{className:"w-2 h-2 bg-blue-400 rounded-full animate-pulse"}),e[47]=ee):ee=e[47];let ie;e[48]!==K?(ie=_.jsxs("div",{className:"flex items-center gap-2",children:[K,ee]}),e[48]=K,e[49]=ie):ie=e[49];let Z;e[50]!==J||e[51]!==ie?(Z=_.jsxs("div",{className:"flex items-center justify-between w-full",children:[J,ie]}),e[50]=J,e[51]=ie,e[52]=Z):Z=e[52];let ue;e[53]!==G||e[54]!==Z?(ue=_.jsx(Ve.div,{initial:I,animate:U,transition:$,children:_.jsx(Zt,{className:"w-full h-16 bg-gradient-to-r from-blue-600/20 to-cyan-600/20 hover:from-blue-600/30 hover:to-cyan-600/30 border border-blue-500/30 hover:border-blue-500/50 transition-all duration-300 group/btn",variant:"flat",size:"lg",onPress:G,children:Z})}),e[53]=G,e[54]=Z,e[55]=ue):ue=e[55];let se,ae,ce;e[56]===Symbol.for("react.memo_cache_sentinel")?(se={opacity:0,x:-20},ae={opacity:1,x:0},ce={delay:.2},e[56]=se,e[57]=ae,e[58]=ce):(se=e[56],ae=e[57],ce=e[58]);let pe;e[59]===Symbol.for("react.memo_cache_sentinel")?(pe={content:"bg-slate-800/80 text-white"},e[59]=pe):pe=e[59];let ye;e[60]===Symbol.for("react.memo_cache_sentinel")?(ye=_.jsx("div",{className:"p-2 bg-green-500/20 rounded-lg group-hover/btn:bg-green-500/30 transition-colors",children:_.jsx(o1,{className:"w-5 h-5 text-green-400"})}),e[60]=ye):ye=e[60];let _e;e[61]!==i?(_e=i("decorate_ui.stash.sell"),e[61]=i,e[62]=_e):_e=e[62];let me;e[63]!==_e?(me=_.jsx("p",{className:"text-white font-semibold text-lg",children:_e}),e[63]=_e,e[64]=me):me=e[64];const ne=n.price*d.sellObjectCommision;let be;e[65]!==i||e[66]!==ne?(be=i("decorate_ui.stash.sell_description",{price:ne}),e[65]=i,e[66]=ne,e[67]=be):be=e[67];let xe;e[68]!==be?(xe=_.jsx("p",{className:"text-green-300 text-sm",children:be}),e[68]=be,e[69]=xe):xe=e[69];let he;e[70]!==me||e[71]!==xe?(he=_.jsxs("div",{className:"flex items-center gap-4",children:[ye,_.jsxs("div",{className:"text-left",children:[me,xe]})]}),e[70]=me,e[71]=xe,e[72]=he):he=e[72];const ve=n.price*d.sellObjectCommision;let Oe;e[73]!==i||e[74]!==ve?(Oe=i("decorate_ui.price",{price:ve}),e[73]=i,e[74]=ve,e[75]=Oe):Oe=e[75];let Le;e[76]!==Oe?(Le=_.jsx("span",{className:"text-green-300 text-sm font-semibold",children:Oe}),e[76]=Oe,e[77]=Le):Le=e[77];let Ae;e[78]===Symbol.for("react.memo_cache_sentinel")?(Ae=_.jsx("div",{className:"w-2 h-2 bg-green-400 rounded-full animate-pulse"}),e[78]=Ae):Ae=e[78];let et;e[79]!==Le?(et=_.jsxs("div",{className:"flex items-center gap-2",children:[Le,Ae]}),e[79]=Le,e[80]=et):et=e[80];let tt;e[81]!==he||e[82]!==et?(tt=_.jsx(av,{children:_.jsx(Zt,{className:"w-full h-16 bg-gradient-to-r from-green-600/20 to-emerald-600/20 hover:from-green-600/30 hover:to-emerald-600/30 border border-green-500/30 hover:border-green-500/50 transition-all duration-300 group/btn",variant:"flat",size:"lg",children:_.jsxs("div",{className:"flex items-center justify-between w-full",children:[he,et]})})}),e[81]=he,e[82]=et,e[83]=tt):tt=e[83];let re;e[84]!==i?(re=i("decorate_ui.stash.are_sure_sell"),e[84]=i,e[85]=re):re=e[85];let te;e[86]!==re?(te=_.jsx("div",{className:"subtitle",children:re}),e[86]=re,e[87]=te):te=e[87];const we=n.price*d.sellObjectCommision;let Ce;e[88]!==i||e[89]!==we?(Ce=i("decorate_ui.stash.are_sure_sell_description",{price:we}),e[88]=i,e[89]=we,e[90]=Ce):Ce=e[90];let Ie;e[91]!==Ce?(Ie=_.jsx("span",{className:"text-sm text-gray-100/80",children:Ce}),e[91]=Ce,e[92]=Ie):Ie=e[92];let Pe;e[93]!==i?(Pe=i("decorate_ui.cancel"),e[93]=i,e[94]=Pe):Pe=e[94];let Ze;e[95]!==Pe||e[96]!==w?(Ze=_.jsx(Zt,{variant:"solid",color:"primary",onPress:w,children:Pe}),e[95]=Pe,e[96]=w,e[97]=Ze):Ze=e[97];let We;e[98]!==i?(We=i("decorate_ui.confirm"),e[98]=i,e[99]=We):We=e[99];let mt;e[100]!==C||e[101]!==We?(mt=_.jsx(Zt,{variant:"solid",color:"danger",onPress:C,children:We}),e[100]=C,e[101]=We,e[102]=mt):mt=e[102];let nt;e[103]!==Ze||e[104]!==mt?(nt=_.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[Ze,mt]}),e[103]=Ze,e[104]=mt,e[105]=nt):nt=e[105];let Ye;e[106]!==te||e[107]!==Ie||e[108]!==nt?(Ye=_.jsx(iv,{children:_.jsxs("div",{className:"px-1 py-2 flex flex-col gap-1",children:[te,Ie,nt]})}),e[106]=te,e[107]=Ie,e[108]=nt,e[109]=Ye):Ye=e[109];let Je;e[110]!==u||e[111]!==tt||e[112]!==Ye||e[113]!==w?(Je=_.jsx(Ve.div,{initial:se,animate:ae,transition:ce,children:_.jsxs(sv,{classNames:pe,showArrow:!0,isOpen:u,onOpenChange:w,offset:20,backdrop:"blur",children:[tt,Ye]})}),e[110]=u,e[111]=tt,e[112]=Ye,e[113]=w,e[114]=Je):Je=e[114];let jt,wt,Et;e[115]===Symbol.for("react.memo_cache_sentinel")?(jt={opacity:0,x:-20},wt={opacity:1,x:0},Et={delay:.3},e[115]=jt,e[116]=wt,e[117]=Et):(jt=e[115],wt=e[116],Et=e[117]);let zt;e[118]===Symbol.for("react.memo_cache_sentinel")?(zt=_.jsx("div",{className:"p-2 bg-orange-500/20 rounded-lg group-hover/btn:bg-orange-500/30 transition-colors",children:_.jsx(ak,{className:"w-5 h-5 text-orange-400"})}),e[118]=zt):zt=e[118];let Te;e[119]!==i?(Te=i("decorate_ui.stash.save_location"),e[119]=i,e[120]=Te):Te=e[120];let pt;e[121]!==Te?(pt=_.jsx("p",{className:"text-white font-semibold text-lg",children:Te}),e[121]=Te,e[122]=pt):pt=e[122];let at;e[123]!==i?(at=i("decorate_ui.stash.save_location_description"),e[123]=i,e[124]=at):at=e[124];let St;e[125]!==at?(St=_.jsx("p",{className:"text-orange-300 text-sm",children:at}),e[125]=at,e[126]=St):St=e[126];let ct;e[127]!==pt||e[128]!==St?(ct=_.jsxs("div",{className:"flex items-center gap-4",children:[zt,_.jsxs("div",{className:"text-left",children:[pt,St]})]}),e[127]=pt,e[128]=St,e[129]=ct):ct=e[129];let it;e[130]!==i?(it=i("decorate_ui.stash.save"),e[130]=i,e[131]=it):it=e[131];let Nt;e[132]!==it?(Nt=_.jsx("span",{className:"text-orange-300 text-sm",children:it}),e[132]=it,e[133]=Nt):Nt=e[133];let kt;e[134]===Symbol.for("react.memo_cache_sentinel")?(kt=_.jsx("div",{className:"w-2 h-2 bg-orange-400 rounded-full animate-pulse"}),e[134]=kt):kt=e[134];let Xt;e[135]!==Nt?(Xt=_.jsxs("div",{className:"flex items-center gap-2",children:[Nt,kt]}),e[135]=Nt,e[136]=Xt):Xt=e[136];let rn;e[137]!==ct||e[138]!==Xt?(rn=_.jsx(Ve.div,{initial:jt,animate:wt,transition:Et,children:_.jsx(Zt,{className:"w-full h-16 bg-gradient-to-r from-orange-600/20 to-red-600/20 hover:from-orange-600/30 hover:to-red-600/30 border border-orange-500/30 hover:border-orange-500/50 transition-all duration-300 group/btn",variant:"flat",size:"lg",onPress:A,children:_.jsxs("div",{className:"flex items-center justify-between w-full",children:[ct,Xt]})})}),e[137]=ct,e[138]=Xt,e[139]=rn):rn=e[139];let ge;e[140]!==ue||e[141]!==Je||e[142]!==rn?(ge=_.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[ue,Je,rn]}),e[140]=ue,e[141]=Je,e[142]=rn,e[143]=ge):ge=e[143];let Se;return e[144]!==ge||e[145]!==z?(Se=_.jsxs(Ve.div,{variants:R,className:"group",children:[z,ge]}),e[144]=ge,e[145]=z,e[146]=Se):Se=e[146],Se}function lde(){ut("save_locations")}function cde(t){return!t}const ude={hidden:{opacity:0},visible:{opacity:1,transition:{staggerChildren:.1,delayChildren:.2}}},YD={hidden:{opacity:0,y:20,scale:.95},visible:{opacity:1,y:0,scale:1,transition:{duration:.4,ease:[.4,0,.2,1]}}};function dde(t){const e=sn.c(76),{data:n,parentItem:i}=t,{t:a}=Dn(),s=_u(),r=nh(),o=cm();let c;e[0]!==s.pathname?(c=s.pathname.split("/"),e[0]=s.pathname,e[1]=c):c=e[1];const u=c[2],[h,d]=pu(JV);let p;const g=i||n;let b;e[2]!==g.colors?(b=g?.colors||[],e[2]=g.colors,e[3]=b):b=e[3];const w=b,x=g?.price,S=g?.object;let M;e[4]!==g.colorlabel||e[5]!==x||e[6]!==S?(M={label:g.colorlabel,price:x,object:S},e[4]=g.colorlabel,e[5]=x,e[6]=S,e[7]=M):M=e[7];const C=M;let A;if(e[8]!==w||e[9]!==C){let ve;e[11]!==C?(ve=Oe=>Oe.object===C.object,e[11]=C,e[12]=ve):ve=e[12],A=w.some(ve),e[8]=w,e[9]=C,e[10]=A}else A=e[10];const N=A;let R;e[13]!==w||e[14]!==N||e[15]!==C?(R=N?w:[...w,C],e[13]=w,e[14]=N,e[15]=C,e[16]=R):R=e[16],p=R;const D=p,[B,z]=P.useState(n.object);let I;e[17]!==D||e[18]!==B?(I=D?.find?.(ve=>ve.object===B),e[17]=D,e[18]=B,e[19]=I):I=e[19];const U=I;let $;e[20]!==d?($=ve=>{d(ve),ut("set_gizmo_editor_mode",ve)},e[20]=d,e[21]=$):$=e[21];const G=$;let k;e[22]!==u||e[23]!==r||e[24]!==o?(k=ve=>{z(ve),u!=="stash"&&(u==="dynamic"&&o.categoryId&&o.dynamicId?r(`/decorate/dynamic/${o.categoryId}/${o.dynamicId}/${ve}`):u==="objects"&&o.dynamicId&&r(`/decorate/objects/${o.dynamicId}/${ve}`))},e[22]=u,e[23]=r,e[24]=o,e[25]=k):k=e[25];const X=k;let V,H,W,J;e[26]===Symbol.for("react.memo_cache_sentinel")?(V={opacity:0,scale:.9},H={opacity:1,scale:1},W={opacity:0,scale:.9},J={duration:.3},e[26]=V,e[27]=H,e[28]=W,e[29]=J):(V=e[26],H=e[27],W=e[28],J=e[29]);let Y;e[30]!==n.description||e[31]!==n.label?(Y=_.jsx(qk,{title:n.label,description:n.description}),e[30]=n.description,e[31]=n.label,e[32]=Y):Y=e[32];let K;e[33]!==u||e[34]!==D||e[35]!==n.object||e[36]!==X||e[37]!==B||e[38]!==a?(K=D.length>0&&u!=="stash"&&_.jsxs(Ve.div,{variants:YD,className:"group",children:[_.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[_.jsx("div",{className:"p-2 bg-purple-500/20 rounded-lg group-hover:bg-purple-500/30 transition-colors",children:_.jsx(Rle,{className:"w-5 h-5 text-purple-400"})}),_.jsx("h3",{className:"text-xl font-semibold text-white",children:a("decorate_ui.furniture_info.select_color")})]}),_.jsx("div",{className:"ml-10",children:_.jsx(Af,{defaultSelectedKeys:[n.object],selectedKeys:B?[B]:[],onSelectionChange:ve=>{const Oe=Array.from(ve)[0];X(Oe)},classNames:{base:"bg-slate-800/50 border border-slate-600/50 rounded-lg",trigger:"bg-transparent border-none hover:bg-slate-700/30 transition-colors",value:"text-slate-200",popoverContent:"bg-slate-800/90 backdrop-blur-sm border border-slate-700"},isRequired:!0,children:D.map(ve=>_.jsx(Cf,{textValue:ve.label,children:_.jsxs("div",{className:"flex items-center w-full justify-between gap-2",children:[_.jsx("span",{className:"text-slate-200",children:ve.label}),_.jsx("span",{className:"text-green-400 font-semibold",children:a("decorate_ui.price",{price:ve.price})})]})},ve.object))})})]}),e[33]=u,e[34]=D,e[35]=n.object,e[36]=X,e[37]=B,e[38]=a,e[39]=K):K=e[39];let ee;e[40]===Symbol.for("react.memo_cache_sentinel")?(ee=_.jsx("div",{className:"p-2 bg-blue-500/20 rounded-lg group-hover:bg-blue-500/30 transition-colors",children:_.jsx(bD,{className:"w-5 h-5 text-blue-400"})}),e[40]=ee):ee=e[40];let ie;e[41]!==a?(ie=a("decorate_ui.furniture_info.edit_mode"),e[41]=a,e[42]=ie):ie=e[42];let Z;e[43]!==ie?(Z=_.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[ee,_.jsx("h3",{className:"text-xl font-semibold text-white",children:ie})]}),e[43]=ie,e[44]=Z):Z=e[44];let ue;e[45]!==G?(ue=ve=>G(ve),e[45]=G,e[46]=ue):ue=e[46];let se;e[47]===Symbol.for("react.memo_cache_sentinel")?(se=_.jsx(bD,{className:"w-4 h-4"}),e[47]=se):se=e[47];let ae;e[48]!==a?(ae=a("decorate_ui.furniture_info.translate"),e[48]=a,e[49]=ae):ae=e[49];let ce;e[50]!==ae?(ce=_.jsx(Nb,{title:_.jsxs("div",{className:"flex items-center gap-2",children:[se,_.jsx("span",{children:ae})]})},"translate"),e[50]=ae,e[51]=ce):ce=e[51];let pe;e[52]===Symbol.for("react.memo_cache_sentinel")?(pe=_.jsx(Hue,{className:"w-4 h-4"}),e[52]=pe):pe=e[52];let ye;e[53]!==a?(ye=a("decorate_ui.furniture_info.rotate"),e[53]=a,e[54]=ye):ye=e[54];let _e;e[55]!==ye?(_e=_.jsx(Nb,{title:_.jsxs("div",{className:"flex items-center gap-2",children:[pe,_.jsx("span",{children:ye})]})},"rotate"),e[55]=ye,e[56]=_e):_e=e[56];let me;e[57]!==h||e[58]!==ue||e[59]!==ce||e[60]!==_e?(me=_.jsx("div",{className:"ml-10",children:_.jsxs(Nj,{selectedKey:h,onSelectionChange:ue,children:[ce,_e]})}),e[57]=h,e[58]=ue,e[59]=ce,e[60]=_e,e[61]=me):me=e[61];let ne;e[62]!==Z||e[63]!==me?(ne=_.jsxs(Ve.div,{variants:YD,className:"group",children:[Z,me]}),e[62]=Z,e[63]=me,e[64]=ne):ne=e[64];let be;e[65]!==u||e[66]!==n||e[67]!==U?(be=u==="stash"?_.jsx(ode,{data:n}):_.jsx(sde,{selectedColorData:U}),e[65]=u,e[66]=n,e[67]=U,e[68]=be):be=e[68];let xe;e[69]!==K||e[70]!==ne||e[71]!==be?(xe=_.jsx("div",{className:"p-8 pt-0",children:_.jsxs(Ve.div,{variants:ude,initial:"hidden",animate:"visible",className:"space-y-6",children:[K,ne,be]})}),e[69]=K,e[70]=ne,e[71]=be,e[72]=xe):xe=e[72];let he;return e[73]!==Y||e[74]!==xe?(he=_.jsxs(Ve.div,{initial:V,animate:H,exit:W,transition:J,className:"relative rounded-2xl overflow-hidden",children:[Y,xe]}),e[73]=Y,e[74]=xe,e[75]=he):he=e[75],he}function fde(t){const e=sn.c(63),{toggle:n}=t,{dynamicId:i,itemId:a,id:s}=cm(),r=_u();let o;e[0]!==r.pathname?(o=r.pathname.split("/"),e[0]=r.pathname,e[1]=o):o=e[1];const c=o[2],u=Wr(SA),h=vi(Zf);vi(_A);const d=vi(r1);let p;e:{if(c==="stash"&&s){let D;e[2]!==s||e[3]!==d?(D=d?.find($=>$.id&&$.id.toString()===s),e[2]=s,e[3]=d,e[4]=D):D=e[4];const B=D;if(!B){p=null;break e}let z,I;if(e[5]!==h.furniture||e[6]!==B){const $=Object.entries(h.furniture).map(mde),G=$.flatMap(pde);let k;e[10]!==B?(k=V=>V.object===B.modelName,e[10]=B,e[11]=k):k=e[11];const X=G.find(k);if(!X){p=null;break e}if(z=X,X.parentObject){let V;if(e[12]!==X.parentObject?(V=H=>H.object===X.parentObject,e[12]=X.parentObject,e[13]=V):V=e[13],I=$.flatMap(hde).find(V),I){const W=(X.type==="stash"||X.type==="gardrobe"?X.type:void 0)||I.type,J=X.stash||I.stash,Y=X.offset||I.offset,K=X.colorlabel||X.label;let ee;e[14]!==X.key||e[15]!==X.label||e[16]!==X.object||e[17]!==X.price||e[18]!==I||e[19]!==K||e[20]!==W||e[21]!==J||e[22]!==Y?(ee={...I,object:X.object,price:X.price,label:X.label,type:W,stash:J,offset:Y,colorlabel:K,key:X.key},e[14]=X.key,e[15]=X.label,e[16]=X.object,e[17]=X.price,e[18]=I,e[19]=K,e[20]=W,e[21]=J,e[22]=Y,e[23]=ee):ee=e[23],z=ee}}e[5]=h.furniture,e[6]=B,e[7]=z,e[8]=I,e[9]=p}else z=e[7],I=e[8],p=e[9];let U;e[24]!==z||e[25]!==I?(U={data:z,parentItem:I},e[24]=z,e[25]=I,e[26]=U):U=e[26],p=U;break e}if(!a||!i){p=null;break e}let A,N;if(a&&i){let D;if(e[27]!==h.furniture||e[28]!==i||e[29]!==a?(D=h.furniture[i]?.items.find(B=>B.object===a),e[27]=h.furniture,e[28]=i,e[29]=a,e[30]=D):D=e[30],A=D,!A){const B=h.furniture[i]?.items;let z,I;if(e[31]!==a||e[32]!==B){if(z=B?.find($=>$.colors?.find(G=>G.object===a)),!z){p=null;break e}N=z,I=z.colors?.find($=>$.object===a),e[31]=a,e[32]=B,e[33]=z,e[34]=I,e[35]=p,e[36]=N}else z=e[33],I=e[34],p=e[35],N=e[36];const U=I;if(U){const $=U.type||z.type,G=U.stash||z.stash,k=U.offset||z.offset;let X;e[37]!==z||e[38]!==U.label||e[39]!==U.object||e[40]!==U.price||e[41]!==$||e[42]!==G||e[43]!==k?(X={...z,object:U.object,price:U.price,label:U.label,type:$,stash:G,offset:k,colorlabel:U.label},e[37]=z,e[38]=U.label,e[39]=U.object,e[40]=U.price,e[41]=$,e[42]=G,e[43]=k,e[44]=X):X=e[44],A=X}}}let R;e[45]!==A||e[46]!==N?(R={data:A,parentItem:N},e[45]=A,e[46]=N,e[47]=R):R=e[47],p=R}const g=p;let b;e:{if(n==="help"){let A;e[48]===Symbol.for("react.memo_cache_sentinel")?(A=_.jsx(nde,{}),e[48]=A):A=e[48],b=A;break e}else if(g?.data){let A;e[49]!==g.data||e[50]!==g.parentItem?(A=_.jsx(dde,{data:g.data,parentItem:g.parentItem},g.data.object),e[49]=g.data,e[50]=g.parentItem,e[51]=A):A=e[51],b=A;break e}b=void 0}const w=b;let x;e[52]!==c||e[53]!==g||e[54]!==u?(x=()=>{c!=="stash"&&(g?.data?(u(!0),ut("spawn_object",{modelName:g.data.object,price:g.data.price}).then(()=>{u(!1)})):ut("remove_current_object"))},e[52]=c,e[53]=g,e[54]=u,e[55]=x):x=e[55];let S;e[56]!==c||e[57]!==g?(S=[g,c],e[56]=c,e[57]=g,e[58]=S):S=e[58],P.useEffect(x,S);let M;e[59]!==w?(M=w&&_.jsx(Ve.div,{initial:{opacity:0,scale:.8,y:-20,height:0},animate:{opacity:1,scale:1,y:0,height:"auto"},exit:{opacity:0,scale:.8,y:-20,height:0},transition:{duration:.3,type:"spring",stiffness:110,damping:15},className:"flex items-center justify-center overflow-hidden max-h-[34vw] max-w-4xl relative mx-4 mb-2",children:_.jsx("div",{className:"w-full h-full",children:w})},"info"),e[59]=w,e[60]=M):M=e[60];let C;return e[61]!==M?(C=_.jsx(Hs,{mode:"wait",children:M}),e[61]=M,e[62]=C):C=e[62],C}function hde(t){return t.items}function pde(t){return t.items.flatMap(e=>{const n={...e,key:t.key},i=e.colors?.map(a=>({...n,...a,colorlabel:a.label,key:t.key,parentObject:e.object}))||[];return[n,...i]})}function mde(t){const[e,n]=t;return{key:e,...n}}function gde(t,e){let n=0;return()=>{const i=Date.now();i-n>=e&&(t(),n=i)}}function Yk(t,e){window.dispatchEvent(new StorageEvent("storage",{key:t,newValue:e}))}function vde(t,e){const[n,i]=P.useState(t);return P.useEffect(()=>{const a=setTimeout(()=>{i(t)},e);return()=>{clearTimeout(a)}},[t,e]),n}function yde(t=1e3*60){const[e,n]=P.useState(!1);return P.useEffect(()=>{let i;const a=()=>{n(!0)},s=gde(o=>{n(!1),window.clearTimeout(i),i=window.setTimeout(a,t)},500),r=()=>{document.hidden||s()};return i=window.setTimeout(a,t),window.addEventListener("mousemove",s),window.addEventListener("mousedown",s),window.addEventListener("resize",s),window.addEventListener("keydown",s),window.addEventListener("touchstart",s),window.addEventListener("wheel",s),document.addEventListener("visibilitychange",r),()=>{window.removeEventListener("mousemove",s),window.removeEventListener("mousedown",s),window.removeEventListener("resize",s),window.removeEventListener("keydown",s),window.removeEventListener("touchstart",s),window.removeEventListener("wheel",s),document.removeEventListener("visibilitychange",r),window.clearTimeout(i)}},[t]),e}const ZD=(t,e)=>{const n=JSON.stringify(e);window.sessionStorage.setItem(t,n),Yk(t,n)},bde=t=>{window.sessionStorage.removeItem(t),Yk(t,null)},QD=t=>window.sessionStorage.getItem(t),xde=t=>(window.addEventListener("storage",t),()=>window.removeEventListener("storage",t)),_de=()=>{throw Error("useSessionStorage is a client-only hook")};function Vf(t,e){const n=()=>QD(t),i=P.useSyncExternalStore(xde,n,_de),a=P.useCallback(s=>{try{const r=typeof s=="function"?s(JSON.parse(i)):s;r==null?bde(t):ZD(t,r)}catch(r){console.warn(r)}},[t,i]);return P.useEffect(()=>{QD(t)===null&&typeof e<"u"&&ZD(t,e)},[t,e]),[i?JSON.parse(i):e,a]}function Sde(){const t=sn.c(36),{t:e}=Dn(),n=Wr(ZV),i=nh(),[a,s]=P.useState(""),r=vde(a,100),[o,c]=P.useState(!1);let u;t[0]!==o?(u=k=>{c(k===o?!1:k)},t[0]=o,t[1]=u):u=t[1];const h=u;let d;t[2]!==r||t[3]!==n?(d=()=>{n(r)},t[2]=r,t[3]=n,t[4]=d):d=t[4];let p;t[5]!==r?(p=[r],t[5]=r,t[6]=p):p=t[6],P.useEffect(d,p);let g;t[7]!==i?(g=()=>{ut("close"),i("/")},t[7]=i,t[8]=g):g=t[8];const b=g;let w;t[9]!==o?(w=_.jsx(fde,{toggle:o}),t[9]=o,t[10]=w):w=t[10];let x;t[11]===Symbol.for("react.memo_cache_sentinel")?(x=_.jsx(mm,{}),t[11]=x):x=t[11];let S;t[12]!==e?(S=e("decorate_ui.header.search_placeholder"),t[12]=e,t[13]=S):S=t[13];let M,C;t[14]===Symbol.for("react.memo_cache_sentinel")?(M=k=>s(k.target.value),C=()=>s(""),t[14]=M,t[15]=C):(M=t[14],C=t[15]);let A;t[16]!==a||t[17]!==S?(A=_.jsx(go,{isClearable:!0,startContent:x,placeholder:S,value:a,onChange:M,onClear:C}),t[16]=a,t[17]=S,t[18]=A):A=t[18];const N=o==="help"?"primary":"default",R=o==="help"?"solid":"bordered";let D;t[19]!==h?(D=()=>h("help"),t[19]=h,t[20]=D):D=t[20];let B;t[21]===Symbol.for("react.memo_cache_sentinel")?(B=_.jsx(Ale,{}),t[21]=B):B=t[21];let z;t[22]!==N||t[23]!==R||t[24]!==D?(z=_.jsx(Zt,{isIconOnly:!0,color:N,variant:R,onPress:D,children:B}),t[22]=N,t[23]=R,t[24]=D,t[25]=z):z=t[25];let I;t[26]===Symbol.for("react.memo_cache_sentinel")?(I=_.jsx(Qp,{}),t[26]=I):I=t[26];let U;t[27]!==b?(U=_.jsx(Zt,{isIconOnly:!0,color:"secondary",onPress:b,children:I}),t[27]=b,t[28]=U):U=t[28];let $;t[29]!==z||t[30]!==U||t[31]!==A?($=_.jsxs("div",{className:"flex items-center gap-2",children:[A,z,U]}),t[29]=z,t[30]=U,t[31]=A,t[32]=$):$=t[32];let G;return t[33]!==$||t[34]!==w?(G=_.jsxs("header",{className:"flex flex-col gap-2 p-4 bg-primary w-[30vw] 5xl:w-[26vw] relative z-10",children:[w,$]}),t[33]=$,t[34]=w,t[35]=G):G=t[35],G}const zp=(t,e,n)=>{const i=sn.c(11),[a,s]=P.useState(!1);let r;i[0]!==e||i[1]!==t||i[2]!==n?(r=p=>{const{key:g,shiftKey:b}=p;n&&!b||g.toLowerCase()==t.toLowerCase()&&(s(!0),e?.())},i[0]=e,i[1]=t,i[2]=n,i[3]=r):r=i[3];const o=r;let c;i[4]!==t||i[5]!==n?(c=p=>{const{key:g,shiftKey:b}=p;n&&!b||g.toLowerCase()==t.toLowerCase()&&s(!1)},i[4]=t,i[5]=n,i[6]=c):c=i[6];const u=c;let h,d;return i[7]!==o||i[8]!==u?(h=()=>(window.addEventListener("keydown",o,!0),window.addEventListener("keyup",u,!0),()=>{window.removeEventListener("keydown",o,!0),window.removeEventListener("keyup",u,!0)}),d=[o,u],i[7]=o,i[8]=u,i[9]=h,i[10]=d):(h=i[9],d=i[10]),P.useEffect(h,d),a};function wde(){const t=sn.c(17),[e,n]=pu(xA),i=P.useRef(null),a=vi(vr);zp("F5",Tde),zp("F6",Mde);let s;t[0]!==n?(s=x=>{n(x)},t[0]=n,t[1]=s):s=t[1],yo("toggle_hide_decorate",s),zp("G",Ede);let r;t[2]!==a.music||t[3]!==a.musicVolume||t[4]!==a.soundPath?(r=()=>{const x=a.music;return i.current=new Xk.Howl({src:[`${a.soundPath}${x}.ogg`],html5:!1,volume:a.musicVolume,loop:!0}),i.current.play(),()=>{i.current&&(i.current.stop(),i.current=null)}},t[2]=a.music,t[3]=a.musicVolume,t[4]=a.soundPath,t[5]=r):r=t[5];let o;t[6]===Symbol.for("react.memo_cache_sentinel")?(o=[],t[6]=o):o=t[6],P.useEffect(r,o);let c,u,h,d;t[7]===Symbol.for("react.memo_cache_sentinel")?(c={opacity:0,y:20},u={opacity:1,y:0},h={opacity:0,y:20},d={duration:.3},t[7]=c,t[8]=u,t[9]=h,t[10]=d):(c=t[7],u=t[8],h=t[9],d=t[10]);let p;t[11]!==e?(p=fn({"absolute bottom-0 w-full":!0,"!opacity-0 transition-opacity duration-300":e}),t[11]=e,t[12]=p):p=t[12];let g;t[13]===Symbol.for("react.memo_cache_sentinel")?(g=_.jsx(Sde,{}),t[13]=g):g=t[13];let b;t[14]===Symbol.for("react.memo_cache_sentinel")?(b=_.jsxs("div",{className:"w-full h-[16.5vw] relative flex z-10",children:[_.jsx(Xue,{}),_.jsx(J9,{})]}),t[14]=b):b=t[14];let w;return t[15]!==p?(w=_.jsx(_.Fragment,{children:_.jsx(Hs,{children:_.jsxs(Ve.div,{layout:!0,initial:c,animate:u,exit:h,transition:d,className:p,children:[g,b]})})}),t[15]=p,t[16]=w):w=t[16],w}function Ede(){ut("place_object_on_ground")}function Mde(){ut("toggle_hide_decorate")}function Tde(){ut("toggle_cursor")}const Cde={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.5,staggerChildren:.08,delayChildren:.1}}};function Ade(){const t=sn.c(102),{t:e}=Dn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],t[0]=n):n=t[0];const[i,a]=P.useState(n),[s,r]=P.useState(""),o=vi(Zf),{dynamicId:c,itemId:u}=cm(),h=nh();let d,p,g,b,w,x,S,M,C,A,N,R,D,B,z,I,U,$,G,k;if(t[1]!==o.furniture||t[2]!==c||t[3]!==u||t[4]!==h||t[5]!==s||t[6]!==i||t[7]!==e){const be=Object.entries(o.furniture).map(Nde),xe=Rde;let he;t[28]!==s?(he=et=>et.label.toLowerCase().includes(s.toLowerCase()),t[28]=s,t[29]=he):he=t[29],b=be.filter(he),x=i.length>0?be.filter(et=>i.includes(et.key)).map(xe).flat():be.map(xe).flat();let ve;t[30]!==i?(ve=et=>{i.includes(et)?a(i.filter(tt=>tt!==et)):a([...i,et])},t[30]=i,t[31]=ve):ve=t[31],w=ve;let Oe;t[32]===Symbol.for("react.memo_cache_sentinel")?(Oe=()=>{a([])},t[32]=Oe):Oe=t[32],g=Oe;let Le;t[33]!==c||t[34]!==u||t[35]!==h?(Le=(et,tt)=>{u==tt&&c==et?h(`/decorate/objects/${c}`):h(`/decorate/objects/${et}/${tt}`)},t[33]=c,t[34]=u,t[35]=h,t[36]=Le):Le=t[36],S=Le,p=Ve.div,C="hidden",A="visible",N=Cde,R="p-4 relative w-[32vw] bg-primary flex flex-col",k="mb-4 px-2",d=Ve.div,t[37]===Symbol.for("react.memo_cache_sentinel")?(z={opacity:0,y:20},I={opacity:1,y:0},U={opacity:0,y:20},$={duration:.2,ease:"easeOut"},t[37]=z,t[38]=I,t[39]=U,t[40]=$):(z=t[37],I=t[38],U=t[39],$=t[40]),G="flex items-center justify-between mb-4",M="flex items-center gap-2";let Ae;t[41]!==i.length||t[42]!==e?(Ae=e("decorate_ui.objects.selected_categories",{count:i.length}),t[41]=i.length,t[42]=e,t[43]=Ae):Ae=t[43],t[44]!==Ae?(D=_.jsx("span",{className:"text-sm text-foreground-500",children:Ae}),t[44]=Ae,t[45]=D):D=t[45],B=i.length>0&&_.jsx(na,{className:"text-xs",color:"primary",children:e("decorate_ui.items_found",{count:x.length})}),t[1]=o.furniture,t[2]=c,t[3]=u,t[4]=h,t[5]=s,t[6]=i,t[7]=e,t[8]=d,t[9]=p,t[10]=g,t[11]=b,t[12]=w,t[13]=x,t[14]=S,t[15]=M,t[16]=C,t[17]=A,t[18]=N,t[19]=R,t[20]=D,t[21]=B,t[22]=z,t[23]=I,t[24]=U,t[25]=$,t[26]=G,t[27]=k}else d=t[8],p=t[9],g=t[10],b=t[11],w=t[12],x=t[13],S=t[14],M=t[15],C=t[16],A=t[17],N=t[18],R=t[19],D=t[20],B=t[21],z=t[22],I=t[23],U=t[24],$=t[25],G=t[26],k=t[27];let X;t[46]!==M||t[47]!==D||t[48]!==B?(X=_.jsxs("div",{className:M,children:[D,B]}),t[46]=M,t[47]=D,t[48]=B,t[49]=X):X=t[49];let V;t[50]!==g||t[51]!==i.length||t[52]!==e?(V=i.length>0&&_.jsx(Zt,{size:"sm",variant:"flat",color:"danger",onPress:g,className:"text-xs",children:e("decorate_ui.clear")}),t[50]=g,t[51]=i.length,t[52]=e,t[53]=V):V=t[53];let H;t[54]!==d||t[55]!==X||t[56]!==V||t[57]!==z||t[58]!==I||t[59]!==U||t[60]!==$||t[61]!==G?(H=_.jsxs(d,{initial:z,animate:I,exit:U,transition:$,className:G,children:[X,V]}),t[54]=d,t[55]=X,t[56]=V,t[57]=z,t[58]=I,t[59]=U,t[60]=$,t[61]=G,t[62]=H):H=t[62];let W,J,Y,K;t[63]===Symbol.for("react.memo_cache_sentinel")?(W={opacity:0,y:20},J={opacity:1,y:0},Y={opacity:0,y:20},K={duration:.2,ease:"easeOut"},t[63]=W,t[64]=J,t[65]=Y,t[66]=K):(W=t[63],J=t[64],Y=t[65],K=t[66]);let ee;t[67]!==e?(ee=e("decorate_ui.objects.search_category"),t[67]=e,t[68]=ee):ee=t[68];let ie,Z,ue;t[69]===Symbol.for("react.memo_cache_sentinel")?(ie=()=>r(""),Z=_.jsx(mm,{}),ue={input:"text-sm",inputWrapper:"h-10"},t[69]=ie,t[70]=Z,t[71]=ue):(ie=t[69],Z=t[70],ue=t[71]);let se;t[72]!==s||t[73]!==ee?(se=_.jsx(Ve.div,{initial:W,animate:J,exit:Y,transition:K,children:_.jsx(go,{isClearable:!0,placeholder:ee,value:s,onValueChange:r,onClear:ie,startContent:Z,classNames:ue})}),t[72]=s,t[73]=ee,t[74]=se):se=t[74];let ae;t[75]!==H||t[76]!==se||t[77]!==k?(ae=_.jsxs("div",{className:k,children:[H,se]}),t[75]=H,t[76]=se,t[77]=k,t[78]=ae):ae=t[78];let ce;t[79]!==w||t[80]!==i||t[81]!==e?(ce=(be,xe)=>_.jsx(P.Suspense,{fallback:_.jsx("div",{children:"Loading..."}),children:_.jsx(_U,{content:_.jsxs("div",{className:"text-center",children:[_.jsx("p",{className:"font-medium",children:xe.label}),_.jsx("p",{className:"text-xs opacity-80",children:e("decorate_ui.items_found",{count:xe.items?.length||0})})]}),placement:"top",showArrow:!0,color:"primary",children:_.jsx(Ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},exit:{opacity:0,y:20},transition:{duration:.2,ease:"easeOut"},whileHover:{scale:1.05},whileTap:{scale:.95},className:fn({"relative transition-all duration-300 bg-center bg-no-repeat bg-contain cursor-pointer size-32 attachment-slot p-3 rounded-lg border-2":!0,"grayscale hover:grayscale-0 border-transparent hover:border-primary-300":!i.includes(xe.key),"grayscale-0 border-primary-500 bg-primary-50 shadow-lg":i.includes(xe.key)}),onClick:()=>w(xe.key),children:_.jsx("img",{className:"w-full h-full object-contain",src:xe.img,alt:xe.label})})},xe.label)}),t[79]=w,t[80]=i,t[81]=e,t[82]=ce):ce=t[82];let pe;t[83]===Symbol.for("react.memo_cache_sentinel")?(pe={height:"100%",width:"100%"},t[83]=pe):pe=t[83];let ye;t[84]!==b||t[85]!==ce?(ye=_.jsx("div",{className:"flex-1",children:_.jsx(Kk,{data:b,itemContent:ce,listClassName:"grid grid-cols-3 5xl:grid-cols-4 gap-4 px-2 w-full h-full",itemClassName:"flex w-full h-full",className:"w-full h-full",style:pe})}),t[84]=b,t[85]=ce,t[86]=ye):ye=t[86];let _e;t[87]!==p||t[88]!==C||t[89]!==A||t[90]!==N||t[91]!==R||t[92]!==ae||t[93]!==ye?(_e=_.jsxs(p,{initial:C,animate:A,variants:N,className:R,children:[ae,ye]}),t[87]=p,t[88]=C,t[89]=A,t[90]=N,t[91]=R,t[92]=ae,t[93]=ye,t[94]=_e):_e=t[94];let me;t[95]!==c||t[96]!==x||t[97]!==S?(me=_.jsx("div",{className:"w-full h-full flex-shrink flex-grow bg-primary p-4",children:_.jsx(jA,{dynamicId:c,items:x,onClick:S},x.length)}),t[95]=c,t[96]=x,t[97]=S,t[98]=me):me=t[98];let ne;return t[99]!==_e||t[100]!==me?(ne=_.jsxs(_.Fragment,{children:[_e,me]}),t[99]=_e,t[100]=me,t[101]=ne):ne=t[101],ne}function Rde(t){return t.items.map(e=>({...e,key:t.key}))}function Nde(t){const[e,n]=t;return{key:e,...n}}var ox=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Pde={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Dde=class{#e=Pde;#t=!1;setTimeoutProvider(t){this.#e=t}setTimeout(t,e){return this.#e.setTimeout(t,e)}clearTimeout(t){this.#e.clearTimeout(t)}setInterval(t,e){return this.#e.setInterval(t,e)}clearInterval(t){this.#e.clearInterval(t)}},Bp=new Dde;function Lde(t){setTimeout(t,0)}var em=typeof window>"u"||"Deno"in globalThis;function lo(){}function Ode(t,e){return typeof t=="function"?t(e):t}function y5(t){return typeof t=="number"&&t>=0&&t!==1/0}function Zk(t,e){return Math.max(t+(e||0)-Date.now(),0)}function kf(t,e){return typeof t=="function"?t(e):t}function yl(t,e){return typeof t=="function"?t(e):t}function JD(t,e){const{type:n="all",exact:i,fetchStatus:a,predicate:s,queryKey:r,stale:o}=t;if(r){if(i){if(e.queryHash!==FA(r,e.options))return!1}else if(!m1(e.queryKey,r))return!1}if(n!=="all"){const c=e.isActive();if(n==="active"&&!c||n==="inactive"&&c)return!1}return!(typeof o=="boolean"&&e.isStale()!==o||a&&a!==e.state.fetchStatus||s&&!s(e))}function e7(t,e){const{exact:n,status:i,predicate:a,mutationKey:s}=t;if(s){if(!e.options.mutationKey)return!1;if(n){if(p1(e.options.mutationKey)!==p1(s))return!1}else if(!m1(e.options.mutationKey,s))return!1}return!(i&&e.state.status!==i||a&&!a(e))}function FA(t,e){return(e?.queryKeyHashFn||p1)(t)}function p1(t){return JSON.stringify(t,(e,n)=>x5(n)?Object.keys(n).sort().reduce((i,a)=>(i[a]=n[a],i),{}):n)}function m1(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>m1(t[n],e[n])):!1}var Ide=Object.prototype.hasOwnProperty;function Qk(t,e){if(t===e)return t;const n=t7(t)&&t7(e);if(!n&&!(x5(t)&&x5(e)))return e;const a=(n?t:Object.keys(t)).length,s=n?e:Object.keys(e),r=s.length,o=n?new Array(r):{};let c=0;for(let u=0;u<r;u++){const h=n?u:s[u],d=t[h],p=e[h];if(d===p){o[h]=d,(n?u<a:Ide.call(t,h))&&c++;continue}if(d===null||p===null||typeof d!="object"||typeof p!="object"){o[h]=p;continue}const g=Qk(d,p);o[h]=g,g===d&&c++}return a===r&&c===a?t:o}function b5(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function t7(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function x5(t){if(!n7(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!n7(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function n7(t){return Object.prototype.toString.call(t)==="[object Object]"}function zde(t){return new Promise(e=>{Bp.setTimeout(e,t)})}function _5(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Qk(t,e):e}function Bde(t,e,n=0){const i=[...t,e];return n&&i.length>n?i.slice(1):i}function Ude(t,e,n=0){const i=[e,...t];return n&&i.length>n?i.slice(0,-1):i}var VA=Symbol();function Jk(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:!t.queryFn||t.queryFn===VA?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function jde(t,e){return typeof t=="function"?t(...e):!!t}var Fde=class extends ox{#e;#t;#n;constructor(){super(),this.#n=t=>{if(!em&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(e=>{typeof e=="boolean"?this.setFocused(e):this.onFocus()})}setFocused(t){this.#e!==t&&(this.#e=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return typeof this.#e=="boolean"?this.#e:globalThis.document?.visibilityState!=="hidden"}},kA=new Fde;function S5(){let t,e;const n=new Promise((a,s)=>{t=a,e=s});n.status="pending",n.catch(()=>{});function i(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{i({status:"fulfilled",value:a}),t(a)},n.reject=a=>{i({status:"rejected",reason:a}),e(a)},n}var Vde=Lde;function kde(){let t=[],e=0,n=o=>{o()},i=o=>{o()},a=Vde;const s=o=>{e?t.push(o):a(()=>{n(o)})},r=()=>{const o=t;t=[],o.length&&a(()=>{i(()=>{o.forEach(c=>{n(c)})})})};return{batch:o=>{let c;e++;try{c=o()}finally{e--,e||r()}return c},batchCalls:o=>(...c)=>{s(()=>{o(...c)})},schedule:s,setNotifyFunction:o=>{n=o},setBatchNotifyFunction:o=>{i=o},setScheduler:o=>{a=o}}}var Bs=kde(),Hde=class extends ox{#e=!0;#t;#n;constructor(){super(),this.#n=t=>{if(!em&&window.addEventListener){const e=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(t){this.#n=t,this.#t?.(),this.#t=t(this.setOnline.bind(this))}setOnline(t){this.#e!==t&&(this.#e=t,this.listeners.forEach(n=>{n(t)}))}isOnline(){return this.#e}},QS=new Hde;function $de(t){return Math.min(1e3*2**t,3e4)}function eH(t){return(t??"online")==="online"?QS.isOnline():!0}var w5=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function tH(t){let e=!1,n=0,i;const a=S5(),s=()=>a.status!=="pending",r=w=>{if(!s()){const x=new w5(w);p(x),t.onCancel?.(x)}},o=()=>{e=!0},c=()=>{e=!1},u=()=>kA.isFocused()&&(t.networkMode==="always"||QS.isOnline())&&t.canRun(),h=()=>eH(t.networkMode)&&t.canRun(),d=w=>{s()||(i?.(),a.resolve(w))},p=w=>{s()||(i?.(),a.reject(w))},g=()=>new Promise(w=>{i=x=>{(s()||u())&&w(x)},t.onPause?.()}).then(()=>{i=void 0,s()||t.onContinue?.()}),b=()=>{if(s())return;let w;const x=n===0?t.initialPromise:void 0;try{w=x??t.fn()}catch(S){w=Promise.reject(S)}Promise.resolve(w).then(d).catch(S=>{if(s())return;const M=t.retry??(em?0:3),C=t.retryDelay??$de,A=typeof C=="function"?C(n,S):C,N=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,S);if(e||!N){p(S);return}n++,t.onFail?.(n,S),zde(A).then(()=>u()?void 0:g()).then(()=>{e?p(S):b()})})};return{promise:a,status:()=>a.status,cancel:r,continue:()=>(i?.(),a),cancelRetry:o,continueRetry:c,canStart:h,start:()=>(h()?b():g().then(b),a)}}var nH=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),y5(this.gcTime)&&(this.#e=Bp.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(em?1/0:300*1e3))}clearGcTimeout(){this.#e&&(Bp.clearTimeout(this.#e),this.#e=void 0)}},Gde=class extends nH{#e;#t;#n;#a;#i;#o;#r;constructor(t){super(),this.#r=!1,this.#o=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#a=t.client,this.#n=this.#a.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#e=i7(this.options),this.state=t.state??this.#e,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#i?.promise}setOptions(t){if(this.options={...this.#o,...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const e=i7(this.options);e.data!==void 0&&(this.setData(e.data,{updatedAt:e.dataUpdatedAt,manual:!0}),this.#e=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.#n.remove(this)}setData(t,e){const n=_5(this.state.data,t,this.options);return this.#s({data:n,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),n}setState(t,e){this.#s({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#i?.promise;return this.#i?.cancel(t),e?e.then(lo).catch(lo):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#e)}isActive(){return this.observers.some(t=>yl(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===VA||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>kf(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!Zk(this.state.dataUpdatedAt,t)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#i?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#i?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#i&&(this.#r?this.#i.cancel({revert:!0}):this.#i.cancelRetry()),this.scheduleGc()),this.#n.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#s({type:"invalidate"})}async fetch(t,e){if(this.state.fetchStatus!=="idle"&&this.#i?.status()!=="rejected"){if(this.state.data!==void 0&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#i)return this.#i.continueRetry(),this.#i.promise}if(t&&this.setOptions(t),!this.options.queryFn){const o=this.observers.find(c=>c.options.queryFn);o&&this.setOptions(o.options)}const n=new AbortController,i=o=>{Object.defineProperty(o,"signal",{enumerable:!0,get:()=>(this.#r=!0,n.signal)})},a=()=>{const o=Jk(this.options,e),u=(()=>{const h={client:this.#a,queryKey:this.queryKey,meta:this.meta};return i(h),h})();return this.#r=!1,this.options.persister?this.options.persister(o,u,this):o(u)},r=(()=>{const o={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#a,state:this.state,fetchFn:a};return i(o),o})();this.options.behavior?.onFetch(r,this),this.#t=this.state,(this.state.fetchStatus==="idle"||this.state.fetchMeta!==r.fetchOptions?.meta)&&this.#s({type:"fetch",meta:r.fetchOptions?.meta}),this.#i=tH({initialPromise:e?.initialPromise,fn:r.fetchFn,onCancel:o=>{o instanceof w5&&o.revert&&this.setState({...this.#t,fetchStatus:"idle"}),n.abort()},onFail:(o,c)=>{this.#s({type:"failed",failureCount:o,error:c})},onPause:()=>{this.#s({type:"pause"})},onContinue:()=>{this.#s({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const o=await this.#i.start();if(o===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(o),this.#n.config.onSuccess?.(o,this),this.#n.config.onSettled?.(o,this.state.error,this),o}catch(o){if(o instanceof w5){if(o.silent)return this.#i.promise;if(o.revert){if(this.state.data===void 0)throw o;return this.state.data}}throw this.#s({type:"error",error:o}),this.#n.config.onError?.(o,this),this.#n.config.onSettled?.(this.state.data,o,this),o}finally{this.scheduleGc()}}#s(t){const e=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...iH(n.data,this.options),fetchMeta:t.meta??null};case"success":const i={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#t=t.manual?i:void 0,i;case"error":const a=t.error;return{...n,error:a,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:a,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=e(this.state),Bs.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),this.#n.notify({query:this,type:"updated",action:t})})}};function iH(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:eH(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function i7(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,i=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var Wde=class extends ox{constructor(t,e){super(),this.options=e,this.#e=t,this.#s=null,this.#r=S5(),this.bindMethods(),this.setOptions(e)}#e;#t=void 0;#n=void 0;#a=void 0;#i;#o;#r;#s;#m;#f;#h;#c;#u;#l;#p=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),a7(this.#t,this.options)?this.#d():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return E5(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return E5(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#x(),this.#_(),this.#t.removeObserver(this)}setOptions(t){const e=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof yl(this.options.enabled,this.#t)!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#S(),this.#t.setOptions(this.options),e._defaulted&&!b5(this.options,e)&&this.#e.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#t,observer:this});const i=this.hasListeners();i&&s7(this.#t,n,this.options,e)&&this.#d(),this.updateResult(),i&&(this.#t!==n||yl(this.options.enabled,this.#t)!==yl(e.enabled,this.#t)||kf(this.options.staleTime,this.#t)!==kf(e.staleTime,this.#t))&&this.#g();const a=this.#v();i&&(this.#t!==n||yl(this.options.enabled,this.#t)!==yl(e.enabled,this.#t)||a!==this.#l)&&this.#y(a)}getOptimisticResult(t){const e=this.#e.getQueryCache().build(this.#e,t),n=this.createResult(e,t);return Xde(this,n)&&(this.#a=n,this.#o=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#a}trackResult(t,e){return new Proxy(t,{get:(n,i)=>(this.trackProp(i),e?.(i),i==="promise"&&!this.options.experimental_prefetchInRender&&this.#r.status==="pending"&&this.#r.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,i))})}trackProp(t){this.#p.add(t)}getCurrentQuery(){return this.#t}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#e.defaultQueryOptions(t),n=this.#e.getQueryCache().build(this.#e,e);return n.fetch().then(()=>this.createResult(n,e))}fetch(t){return this.#d({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#a))}#d(t){this.#S();let e=this.#t.fetch(this.options,t);return t?.throwOnError||(e=e.catch(lo)),e}#g(){this.#x();const t=kf(this.options.staleTime,this.#t);if(em||this.#a.isStale||!y5(t))return;const n=Zk(this.#a.dataUpdatedAt,t)+1;this.#c=Bp.setTimeout(()=>{this.#a.isStale||this.updateResult()},n)}#v(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#y(t){this.#_(),this.#l=t,!(em||yl(this.options.enabled,this.#t)===!1||!y5(this.#l)||this.#l===0)&&(this.#u=Bp.setInterval(()=>{(this.options.refetchIntervalInBackground||kA.isFocused())&&this.#d()},this.#l))}#b(){this.#g(),this.#y(this.#v())}#x(){this.#c&&(Bp.clearTimeout(this.#c),this.#c=void 0)}#_(){this.#u&&(Bp.clearInterval(this.#u),this.#u=void 0)}createResult(t,e){const n=this.#t,i=this.options,a=this.#a,s=this.#i,r=this.#o,c=t!==n?t.state:this.#n,{state:u}=t;let h={...u},d=!1,p;if(e._optimisticResults){const B=this.hasListeners(),z=!B&&a7(t,e),I=B&&s7(t,n,e,i);(z||I)&&(h={...h,...iH(u.data,t.options)}),e._optimisticResults==="isRestoring"&&(h.fetchStatus="idle")}let{error:g,errorUpdatedAt:b,status:w}=h;p=h.data;let x=!1;if(e.placeholderData!==void 0&&p===void 0&&w==="pending"){let B;a?.isPlaceholderData&&e.placeholderData===r?.placeholderData?(B=a.data,x=!0):B=typeof e.placeholderData=="function"?e.placeholderData(this.#h?.state.data,this.#h):e.placeholderData,B!==void 0&&(w="success",p=_5(a?.data,B,e),d=!0)}if(e.select&&p!==void 0&&!x)if(a&&p===s?.data&&e.select===this.#m)p=this.#f;else try{this.#m=e.select,p=e.select(p),p=_5(a?.data,p,e),this.#f=p,this.#s=null}catch(B){this.#s=B}this.#s&&(g=this.#s,p=this.#f,b=Date.now(),w="error");const S=h.fetchStatus==="fetching",M=w==="pending",C=w==="error",A=M&&S,N=p!==void 0,D={status:w,fetchStatus:h.fetchStatus,isPending:M,isSuccess:w==="success",isError:C,isInitialLoading:A,isLoading:A,data:p,dataUpdatedAt:h.dataUpdatedAt,error:g,errorUpdatedAt:b,failureCount:h.fetchFailureCount,failureReason:h.fetchFailureReason,errorUpdateCount:h.errorUpdateCount,isFetched:h.dataUpdateCount>0||h.errorUpdateCount>0,isFetchedAfterMount:h.dataUpdateCount>c.dataUpdateCount||h.errorUpdateCount>c.errorUpdateCount,isFetching:S,isRefetching:S&&!M,isLoadingError:C&&!N,isPaused:h.fetchStatus==="paused",isPlaceholderData:d,isRefetchError:C&&N,isStale:HA(t,e),refetch:this.refetch,promise:this.#r,isEnabled:yl(e.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const B=U=>{D.status==="error"?U.reject(D.error):D.data!==void 0&&U.resolve(D.data)},z=()=>{const U=this.#r=D.promise=S5();B(U)},I=this.#r;switch(I.status){case"pending":t.queryHash===n.queryHash&&B(I);break;case"fulfilled":(D.status==="error"||D.data!==I.value)&&z();break;case"rejected":(D.status!=="error"||D.error!==I.reason)&&z();break}}return D}updateResult(){const t=this.#a,e=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#o=this.options,this.#i.data!==void 0&&(this.#h=this.#t),b5(e,t))return;this.#a=e;const n=()=>{if(!t)return!0;const{notifyOnChangeProps:i}=this.options,a=typeof i=="function"?i():i;if(a==="all"||!a&&!this.#p.size)return!0;const s=new Set(a??this.#p);return this.options.throwOnError&&s.add("error"),Object.keys(this.#a).some(r=>{const o=r;return this.#a[o]!==t[o]&&s.has(o)})};this.#w({listeners:n()})}#S(){const t=this.#e.getQueryCache().build(this.#e,this.options);if(t===this.#t)return;const e=this.#t;this.#t=t,this.#n=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#w(t){Bs.batch(()=>{t.listeners&&this.listeners.forEach(e=>{e(this.#a)}),this.#e.getQueryCache().notify({query:this.#t,type:"observerResultsUpdated"})})}};function Kde(t,e){return yl(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function a7(t,e){return Kde(t,e)||t.state.data!==void 0&&E5(t,e,e.refetchOnMount)}function E5(t,e,n){if(yl(e.enabled,t)!==!1&&kf(e.staleTime,t)!=="static"){const i=typeof n=="function"?n(t):n;return i==="always"||i!==!1&&HA(t,e)}return!1}function s7(t,e,n,i){return(t!==e||yl(i.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&HA(t,n)}function HA(t,e){return yl(e.enabled,t)!==!1&&t.isStaleByTime(kf(e.staleTime,t))}function Xde(t,e){return!b5(t.getCurrentResult(),e)}function r7(t){return{onFetch:(e,n)=>{const i=e.options,a=e.fetchOptions?.meta?.fetchMore?.direction,s=e.state.data?.pages||[],r=e.state.data?.pageParams||[];let o={pages:[],pageParams:[]},c=0;const u=async()=>{let h=!1;const d=b=>{Object.defineProperty(b,"signal",{enumerable:!0,get:()=>(e.signal.aborted?h=!0:e.signal.addEventListener("abort",()=>{h=!0}),e.signal)})},p=Jk(e.options,e.fetchOptions),g=async(b,w,x)=>{if(h)return Promise.reject();if(w==null&&b.pages.length)return Promise.resolve(b);const M=(()=>{const R={client:e.client,queryKey:e.queryKey,pageParam:w,direction:x?"backward":"forward",meta:e.options.meta};return d(R),R})(),C=await p(M),{maxPages:A}=e.options,N=x?Ude:Bde;return{pages:N(b.pages,C,A),pageParams:N(b.pageParams,w,A)}};if(a&&s.length){const b=a==="backward",w=b?qde:o7,x={pages:s,pageParams:r},S=w(i,x);o=await g(x,S,b)}else{const b=t??s.length;do{const w=c===0?r[0]??i.initialPageParam:o7(i,o);if(c>0&&w==null)break;o=await g(o,w),c++}while(c<b)}return o};e.options.persister?e.fetchFn=()=>e.options.persister?.(u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n):e.fetchFn=u}}}function o7(t,{pages:e,pageParams:n}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,n[i],n):void 0}function qde(t,{pages:e,pageParams:n}){return e.length>0?t.getPreviousPageParam?.(e[0],e,n[0],n):void 0}var Yde=class extends nH{#e;#t;#n;#a;constructor(t){super(),this.#e=t.client,this.mutationId=t.mutationId,this.#n=t.mutationCache,this.#t=[],this.state=t.state||Zde(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#n.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#n.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||(this.state.status==="pending"?this.scheduleGc():this.#n.remove(this))}continue(){return this.#a?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#a=tH({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(s,r)=>{this.#i({type:"failed",failureCount:s,error:r})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});const i=this.state.status==="pending",a=!this.#a.canStart();try{if(i)e();else{this.#i({type:"pending",variables:t,isPaused:a}),await this.#n.config.onMutate?.(t,this,n);const r=await this.options.onMutate?.(t,n);r!==this.state.context&&this.#i({type:"pending",context:r,variables:t,isPaused:a})}const s=await this.#a.start();return await this.#n.config.onSuccess?.(s,t,this.state.context,this,n),await this.options.onSuccess?.(s,t,this.state.context,n),await this.#n.config.onSettled?.(s,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(s,null,t,this.state.context,n),this.#i({type:"success",data:s}),s}catch(s){try{throw await this.#n.config.onError?.(s,t,this.state.context,this,n),await this.options.onError?.(s,t,this.state.context,n),await this.#n.config.onSettled?.(void 0,s,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(void 0,s,t,this.state.context,n),s}finally{this.#i({type:"error",error:s})}}finally{this.#n.runNext(this)}}#i(t){const e=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=e(this.state),Bs.batch(()=>{this.#t.forEach(n=>{n.onMutationUpdate(t)}),this.#n.notify({mutation:this,type:"updated",action:t})})}};function Zde(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Qde=class extends ox{constructor(t={}){super(),this.config=t,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(t,e,n){const i=new Yde({client:t,mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:n});return this.add(i),i}add(t){this.#e.add(t);const e=s_(t);if(typeof e=="string"){const n=this.#t.get(e);n?n.push(t):this.#t.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#e.delete(t)){const e=s_(t);if(typeof e=="string"){const n=this.#t.get(e);if(n)if(n.length>1){const i=n.indexOf(t);i!==-1&&n.splice(i,1)}else n[0]===t&&this.#t.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=s_(t);if(typeof e=="string"){const i=this.#t.get(e)?.find(a=>a.state.status==="pending");return!i||i===t}else return!0}runNext(t){const e=s_(t);return typeof e=="string"?this.#t.get(e)?.find(i=>i!==t&&i.state.isPaused)?.continue()??Promise.resolve():Promise.resolve()}clear(){Bs.batch(()=>{this.#e.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(t){const e={exact:!0,...t};return this.getAll().find(n=>e7(e,n))}findAll(t={}){return this.getAll().filter(e=>e7(t,e))}notify(t){Bs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(e=>e.state.isPaused);return Bs.batch(()=>Promise.all(t.map(e=>e.continue().catch(lo))))}};function s_(t){return t.options.scope?.id}var Jde=class extends ox{constructor(t={}){super(),this.config=t,this.#e=new Map}#e;build(t,e,n){const i=e.queryKey,a=e.queryHash??FA(i,e);let s=this.get(a);return s||(s=new Gde({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(e),state:n,defaultOptions:t.getQueryDefaults(i)}),this.add(s)),s}add(t){this.#e.has(t.queryHash)||(this.#e.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#e.get(t.queryHash);e&&(t.destroy(),e===t&&this.#e.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){Bs.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#e.get(t)}getAll(){return[...this.#e.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(n=>JD(e,n))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(n=>JD(t,n)):e}notify(t){Bs.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){Bs.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){Bs.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},efe=class{#e;#t;#n;#a;#i;#o;#r;#s;constructor(t={}){this.#e=t.queryCache||new Jde,this.#t=t.mutationCache||new Qde,this.#n=t.defaultOptions||{},this.#a=new Map,this.#i=new Map,this.#o=0}mount(){this.#o++,this.#o===1&&(this.#r=kA.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=QS.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#o--,this.#o===0&&(this.#r?.(),this.#r=void 0,this.#s?.(),this.#s=void 0)}isFetching(t){return this.#e.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#t.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=this.#e.build(this,e),i=n.state.data;return i===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(kf(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#e.findAll(t).map(({queryKey:e,state:n})=>{const i=n.data;return[e,i]})}setQueryData(t,e,n){const i=this.defaultQueryOptions({queryKey:t}),s=this.#e.get(i.queryHash)?.state.data,r=Ode(e,s);if(r!==void 0)return this.#e.build(this,i).setData(r,{...n,manual:!0})}setQueriesData(t,e,n){return Bs.batch(()=>this.#e.findAll(t).map(({queryKey:i})=>[i,this.setQueryData(i,e,n)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#e.get(e.queryHash)?.state}removeQueries(t){const e=this.#e;Bs.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=this.#e;return Bs.batch(()=>(n.findAll(t).forEach(i=>{i.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},i=Bs.batch(()=>this.#e.findAll(t).map(a=>a.cancel(n)));return Promise.all(i).then(lo).catch(lo)}invalidateQueries(t,e={}){return Bs.batch(()=>(this.#e.findAll(t).forEach(n=>{n.invalidate()}),t?.refetchType==="none"?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},i=Bs.batch(()=>this.#e.findAll(t).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let s=a.fetch(void 0,n);return n.throwOnError||(s=s.catch(lo)),a.state.fetchStatus==="paused"?Promise.resolve():s}));return Promise.all(i).then(lo)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=this.#e.build(this,e);return n.isStaleByTime(kf(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(lo).catch(lo)}fetchInfiniteQuery(t){return t.behavior=r7(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(lo).catch(lo)}ensureInfiniteQueryData(t){return t.behavior=r7(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return QS.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(t){this.#n=t}setQueryDefaults(t,e){this.#a.set(p1(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#a.values()],n={};return e.forEach(i=>{m1(t,i.queryKey)&&Object.assign(n,i.defaultOptions)}),n}setMutationDefaults(t,e){this.#i.set(p1(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#i.values()],n={};return e.forEach(i=>{m1(t,i.mutationKey)&&Object.assign(n,i.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#n.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=FA(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===VA&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#n.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},aH=P.createContext(void 0),tfe=t=>{const e=P.useContext(aH);if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},nfe=({client:t,children:e})=>(P.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),_.jsx(aH.Provider,{value:t,children:e})),sH=P.createContext(!1),ife=()=>P.useContext(sH);sH.Provider;function afe(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var sfe=P.createContext(afe()),rfe=()=>P.useContext(sfe),ofe=(t,e)=>{(t.suspense||t.throwOnError||t.experimental_prefetchInRender)&&(e.isReset()||(t.retryOnMount=!1))},lfe=t=>{P.useEffect(()=>{t.clearReset()},[t])},cfe=({result:t,errorResetBoundary:e,throwOnError:n,query:i,suspense:a})=>t.isError&&!e.isReset()&&!t.isFetching&&i&&(a&&t.data===void 0||jde(n,[t.error,i])),ufe=t=>{if(t.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),i=t.staleTime;t.staleTime=typeof i=="function"?(...a)=>n(i(...a)):n(i),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},dfe=(t,e)=>t.isLoading&&t.isFetching&&!e,ffe=(t,e)=>t?.suspense&&e.isPending,l7=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function hfe(t,e,n){const i=ife(),a=rfe(),s=tfe(),r=s.defaultQueryOptions(t);s.getDefaultOptions().queries?._experimental_beforeQuery?.(r),r._optimisticResults=i?"isRestoring":"optimistic",ufe(r),ofe(r,a),lfe(a);const o=!s.getQueryCache().get(r.queryHash),[c]=P.useState(()=>new e(s,r)),u=c.getOptimisticResult(r),h=!i&&t.subscribed!==!1;if(P.useSyncExternalStore(P.useCallback(d=>{const p=h?c.subscribe(Bs.batchCalls(d)):lo;return c.updateResult(),p},[c,h]),()=>c.getCurrentResult(),()=>c.getCurrentResult()),P.useEffect(()=>{c.setOptions(r)},[r,c]),ffe(r,u))throw l7(r,c,a);if(cfe({result:u,errorResetBoundary:a,throwOnError:r.throwOnError,query:s.getQueryCache().get(r.queryHash),suspense:r.suspense}))throw u.error;return s.getDefaultOptions().queries?._experimental_afterQuery?.(r,u),r.experimental_prefetchInRender&&!em&&dfe(u,i)&&(o?l7(r,c,a):s.getQueryCache().get(r.queryHash)?.promise)?.catch(lo).finally(()=>{c.updateResult()}),r.notifyOnChangeProps?u:c.trackResult(u)}function bw(t,e){return hfe(t,Wde)}const c7={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.4,ease:"easeOut"}}},pfe={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.5,staggerChildren:.08,delayChildren:.1}}};function mfe(){const t=sn.c(17),e=vi(Zf),{t:n}=Dn(),[i,a]=pu(r1),s=Wr(_A);let r;t[0]===Symbol.for("react.memo_cache_sentinel")?(r={queryKey:["stash"],queryFn:bfe},t[0]=r):r=t[0];const o=bw(r),{id:c}=cm(),u=nh(),d=Object.entries(e.furniture).map(yfe).flatMap(vfe),p=d.length&&i?.map(I=>{const U=d.find($=>$.object===I.modelName);return U?{...U,...I,key:U?.key||I.modelName}:(console.warn("Item not found in furniture config:",I.modelName),null)}).filter(Boolean)||[],g=c?p.find(I=>I.id&&I.id.toString()===c):void 0,b=(I,U,$)=>{if($!=null){const G=p.find(k=>k.id===$);if(!G)return console.log("item not found by id",$);c&&parseInt(c)===$?(u("/decorate/stash"),s(void 0),ut("deselect_owned_object")):(s(G),ut("select_owned_object",G.id),u(`/decorate/stash/${G.id}`))}else{const G=p.find(k=>k.object===U&&k.key===I);if(!G)return console.log("item not found",U,I);G.id!==void 0&&G.id!==null?(s(G),ut("select_owned_object",G.id),u(`/decorate/stash/${G.id}`)):(s(G),ut("select_owned_object",G.id),u(`/decorate/stash/${I}/${U}`))}};yo("select_stash_item",I=>{const U=p.find($=>$.id===I);if(!U)return console.log("item not found",I);U.id!==void 0&&U.id!==null?u(`/decorate/stash/${U.id}`):u(`/decorate/stash/${U.key}/${U.object}`)});let w;t[1]!==o.data||t[2]!==a?(w=()=>{o.data&&a(o.data)},t[1]=o.data,t[2]=a,t[3]=w):w=t[3];let x;t[4]!==o.data?(x=[o.data],t[4]=o.data,t[5]=x):x=t[5],P.useEffect(w,x),wte(gfe);const S=Ve,M="hidden",C="visible",A=pfe,N="p-4 relative w-[32vw] bg-primary flex flex-col",R=g?_.jsx(Ve.div,{variants:c7,className:"backdrop-blur-sm rounded-2xl p-6 border border-gray-700/50 shadow-2xl",children:_.jsxs("div",{className:"flex items-start space-x-4",children:[_.jsx("div",{className:"relative",children:_.jsx("div",{className:"w-20 h-20 rounded-xl overflow-hidden bg-gradient-to-br from-gray-700 to-gray-600 p-1",children:_.jsx(pA,{classNames:{wrapper:"w-full h-full object-cover rounded-lg"},src:g.img,alt:g.label})})}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[_.jsx("h3",{className:"subtitle truncate",children:g.label}),_.jsx("div",{className:"flex items-center space-x-1 bg-green-500/20 px-3 py-1 rounded-full",children:_.jsxs("span",{className:" font-medium text-green-400",children:["$",g.price?.toLocaleString()]})})]}),_.jsx("p",{className:"text-gray-300 text-sm leading-relaxed mb-3 line-clamp-2",children:g.description}),_.jsx("div",{className:"flex items-center justify-between",children:_.jsxs("div",{className:"flex items-center space-x-2",children:[_.jsx("div",{className:"bg-blue-500/20 px-3 py-1 rounded-full",children:_.jsx("span",{className:"text-xs font-medium text-blue-400 uppercase tracking-wide",children:g.key})}),_.jsx("div",{className:"bg-purple-500/20 px-3 py-1 rounded-full",children:_.jsx("span",{className:"text-xs font-medium text-purple-400",children:g.inStash?n("decorate_ui.stash.in_stash"):n("decorate_ui.stash.not_in_stash")})})]})})]})]})}):_.jsx(Ve.div,{variants:c7,className:"backdrop-blur-sm rounded-2xl p-3",children:_.jsxs("div",{className:"flex flex-col items-center justify-center text-center space-y-6",children:[_.jsx("div",{className:"relative",children:_.jsx("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-gray-700/50 to-gray-600/50 flex items-center justify-center border-2 border-dashed border-gray-500/30",children:_.jsx(Zp,{className:"text-4xl text-gray-400"})})}),_.jsxs("div",{className:"space-y-1",children:[_.jsx("h3",{className:"text-xl font-semibold subtitle",children:n("decorate_ui.stash.no_selected_item")}),_.jsx("p",{className:"text-gray-400 text-sm leading-relaxed max-w-sm",children:n("decorate_ui.stash.no_selected_item_description")})]}),_.jsx("div",{className:"flex items-center",children:_.jsxs("div",{className:"flex items-center space-x-2 bg-blue-500/20 px-4 py-2 rounded-full",children:[_.jsx("svg",{className:"w-4 h-4 text-blue-400",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})}),_.jsx("span",{className:"text-sm font-medium text-blue-400",children:n("decorate_ui.items_found",{count:p.length})})]})})]})});let D;t[6]!==S.div||t[7]!==A||t[8]!==R?(D=_.jsx(S.div,{initial:M,animate:C,variants:A,className:N,children:R}),t[6]=S.div,t[7]=A,t[8]=R,t[9]=D):D=t[9];let B;t[10]!==p||t[11]!==b||t[12]!==c?(B=_.jsx("div",{className:"w-full h-full flex-shrink flex-grow bg-primary p-4",children:_.jsx(jA,{dynamicId:c,items:p,onClick:b})}),t[10]=p,t[11]=b,t[12]=c,t[13]=B):B=t[13];let z;return t[14]!==B||t[15]!==D?(z=_.jsxs(_.Fragment,{children:[D,B]}),t[14]=B,t[15]=D,t[16]=z):z=t[16],z}function gfe(){ut("deselect_owned_object")}function vfe(t){return t.items.flatMap(e=>{const n={...e,key:t.key},i=e.colors?.map(a=>({...n,...a,colorlabel:a.label,key:t.key,parentObject:e.object}))||[];return[n,...i]})}function yfe(t){const[e,n]=t;return{key:e,...n}}function bfe(){return ut("get_owned_objects")}const M5=new Set,dr=new WeakMap,tm=new WeakMap,Vo=new WeakMap,g1=new WeakMap,JE=new WeakMap,yb=new WeakMap,Gp=new WeakMap,Bf=new WeakMap,og=new WeakSet;let ho,$A=0,GA=0;const bd="__aa_tgt",v1="__aa_del",JS="__aa_new",rH=t=>{const e=wfe(t);e&&e.forEach(n=>Efe(n))},xfe=t=>{t.forEach(e=>{e.target===ho&&_fe(),dr.has(e.target)&&ym(e.target)})};function oH(t){const e=t.getBoundingClientRect(),n=ho?.clientWidth||0,i=ho?.clientHeight||0;return e.bottom<0||e.top>i||e.right<0||e.left>n}function WA(t){const e=g1.get(t);e?.disconnect();let n=dr.get(t),i=0;const a=5;n||(n=Ug(t),dr.set(t,n));const{offsetWidth:s,offsetHeight:r}=ho,c=[n.top-a,s-(n.left+a+n.width),r-(n.top+a+n.height),n.left-a].map(h=>`${-1*Math.floor(h)}px`).join(" "),u=new IntersectionObserver(()=>{++i>1&&ym(t)},{root:ho,threshold:1,rootMargin:c});u.observe(t),g1.set(t,u)}function ym(t,e=!0){clearTimeout(Bf.get(t));const n=xw(t),i=e?y1(n)?500:n.duration:0;Bf.set(t,setTimeout(async()=>{const a=Vo.get(t);try{await a?.finished,dr.set(t,Ug(t)),WA(t)}catch{}},i))}function _fe(){clearTimeout(Bf.get(ho)),Bf.set(ho,setTimeout(()=>{M5.forEach(t=>vS(t,e=>lH(()=>ym(e))))},100))}function Sfe(t){setTimeout(()=>{yb.set(t,setInterval(()=>lH(ym.bind(null,t)),2e3))},Math.round(2e3*Math.random()))}function lH(t){typeof requestIdleCallback=="function"?requestIdleCallback(()=>t()):requestAnimationFrame(()=>t())}let hd;const cH=typeof window<"u"&&"ResizeObserver"in window;cH&&(ho=document.documentElement,new MutationObserver(rH),hd=new ResizeObserver(xfe),window.addEventListener("scroll",()=>{GA=window.scrollY,$A=window.scrollX}),hd.observe(ho));function wfe(t){return t.reduce((i,a)=>[...i,...Array.from(a.addedNodes),...Array.from(a.removedNodes)],[]).every(i=>i.nodeName==="#comment")?!1:t.reduce((i,a)=>{if(i===!1)return!1;if(a.target instanceof Element){if(eM(a.target),!i.has(a.target)){i.add(a.target);for(let s=0;s<a.target.children.length;s++){const r=a.target.children.item(s);if(r){if(v1 in r)return!1;eM(a.target,r),i.add(r)}}}if(a.removedNodes.length)for(let s=0;s<a.removedNodes.length;s++){const r=a.removedNodes[s];if(v1 in r)return!1;r instanceof Element&&(i.add(r),eM(a.target,r),tm.set(r,[a.previousSibling,a.nextSibling]))}}return i},new Set)}function eM(t,e){!e&&!(bd in t)?Object.defineProperty(t,bd,{value:t}):e&&!(bd in e)&&Object.defineProperty(e,bd,{value:t})}function Efe(t){var e,n;const i=t.isConnected,a=dr.has(t);i&&tm.has(t)&&tm.delete(t),((e=Vo.get(t))===null||e===void 0?void 0:e.playState)!=="finished"&&((n=Vo.get(t))===null||n===void 0||n.cancel()),JS in t?u7(t):a&&i?Tfe(t):a&&!i?Cfe(t):u7(t)}function eu(t){return Number(t.replace(/[^0-9.\-]/g,""))}function Mfe(t){let e=t.parentElement;for(;e;){if(e.scrollLeft||e.scrollTop)return{x:e.scrollLeft,y:e.scrollTop};e=e.parentElement}return{x:0,y:0}}function Ug(t){const e=t.getBoundingClientRect(),{x:n,y:i}=Mfe(t);return{top:e.top+i,left:e.left+n,width:e.width,height:e.height}}function uH(t,e,n){let i=e.width,a=e.height,s=n.width,r=n.height;const o=getComputedStyle(t);if(o.getPropertyValue("box-sizing")==="content-box"){const u=eu(o.paddingTop)+eu(o.paddingBottom)+eu(o.borderTopWidth)+eu(o.borderBottomWidth),h=eu(o.paddingLeft)+eu(o.paddingRight)+eu(o.borderRightWidth)+eu(o.borderLeftWidth);i-=h,s-=h,a-=u,r-=u}return[i,s,a,r].map(Math.round)}function xw(t){return bd in t&&Gp.has(t[bd])?Gp.get(t[bd]):{duration:250,easing:"ease-in-out"}}function dH(t){if(bd in t)return t[bd]}function KA(t){const e=dH(t);return e?og.has(e):!1}function vS(t,...e){e.forEach(n=>n(t,Gp.has(t)));for(let n=0;n<t.children.length;n++){const i=t.children.item(n);i&&e.forEach(a=>a(i,Gp.has(i)))}}function XA(t){return Array.isArray(t)?t:[t]}function y1(t){return typeof t=="function"}function Tfe(t){const e=dr.get(t),n=Ug(t);if(!KA(t))return dr.set(t,n);if(oH(t)){dr.set(t,n),WA(t);return}let i;if(!e)return;const a=xw(t);if(typeof a!="function"){let s=e.left-n.left,r=e.top-n.top;const o=e.left+e.width-(n.left+n.width);e.top+e.height-(n.top+n.height)==0&&(r=0),o==0&&(s=0);const[u,h,d,p]=uH(t,e,n),g={transform:`translate(${s}px, ${r}px)`},b={transform:"translate(0, 0)"};u!==h&&(g.width=`${u}px`,b.width=`${h}px`),d!==p&&(g.height=`${d}px`,b.height=`${p}px`),i=t.animate([g,b],{duration:a.duration,easing:a.easing})}else{const[s]=XA(a(t,"remain",e,n));i=new Animation(s),i.play()}Vo.set(t,i),dr.set(t,n),i.addEventListener("finish",ym.bind(null,t,!1),{once:!0})}function u7(t){JS in t&&delete t[JS];const e=Ug(t);dr.set(t,e);const n=xw(t);if(!KA(t))return;if(oH(t)){WA(t);return}let i;if(typeof n!="function")i=t.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:n.duration*1.5,easing:"ease-in"});else{const[a]=XA(n(t,"add",e));i=new Animation(a),i.play()}Vo.set(t,i),i.addEventListener("finish",ym.bind(null,t,!1),{once:!0})}function d7(t,e){var n;t.remove(),dr.delete(t),tm.delete(t),Vo.delete(t),(n=g1.get(t))===null||n===void 0||n.disconnect(),setTimeout(()=>{if(v1 in t&&delete t[v1],Object.defineProperty(t,JS,{value:!0,configurable:!0}),e&&t instanceof HTMLElement)for(const i in e)t.style[i]=""},0)}function Cfe(t){var e;if(!tm.has(t)||!dr.has(t))return;const[n,i]=tm.get(t);Object.defineProperty(t,v1,{value:!0,configurable:!0});const a=window.scrollX,s=window.scrollY;if(i&&i.parentNode&&i.parentNode instanceof Element?i.parentNode.insertBefore(t,i):n&&n.parentNode?n.parentNode.appendChild(t):(e=dH(t))===null||e===void 0||e.appendChild(t),!KA(t))return d7(t);const[r,o,c,u]=Rfe(t),h=xw(t),d=dr.get(t);(a!==$A||s!==GA)&&Afe(t,a,s,h);let p,g={position:"absolute",top:`${r}px`,left:`${o}px`,width:`${c}px`,height:`${u}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!y1(h))Object.assign(t.style,g),p=t.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"});else{const[b,w]=XA(h(t,"remove",d));w?.styleReset!==!1&&(g=w?.styleReset||g,Object.assign(t.style,g)),p=new Animation(b),p.play()}Vo.set(t,p),p.addEventListener("finish",()=>d7(t,g),{once:!0})}function Afe(t,e,n,i){const a=$A-e,s=GA-n,r=document.documentElement.style.scrollBehavior;if(getComputedStyle(ho).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+a,window.scrollY+s),!t.parentElement)return;const c=t.parentElement;let u=c.clientHeight,h=c.clientWidth;const d=performance.now();function p(){requestAnimationFrame(()=>{if(!y1(i)){const g=u-c.clientHeight,b=h-c.clientWidth;d+i.duration>performance.now()?(window.scrollTo({left:window.scrollX-b,top:window.scrollY-g}),u=c.clientHeight,h=c.clientWidth,p()):document.documentElement.style.scrollBehavior=r}})}p()}function Rfe(t){var e;const n=dr.get(t),[i,,a]=uH(t,n,Ug(t));let s=t.parentElement;for(;s&&(getComputedStyle(s).position==="static"||s instanceof HTMLBodyElement);)s=s.parentElement;s||(s=document.body);const r=getComputedStyle(s),o=!Vo.has(t)||((e=Vo.get(t))===null||e===void 0?void 0:e.playState)==="finished"?Ug(s):dr.get(s),c=Math.round(n.top-o.top)-eu(r.borderTopWidth),u=Math.round(n.left-o.left)-eu(r.borderLeftWidth);return[c,u,i,a]}function Nfe(t,e={}){if(cH&&hd&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!y1(e)&&!e.disrespectUserMotionPreference)){og.add(t),getComputedStyle(t).position==="static"&&Object.assign(t.style,{position:"relative"}),vS(t,ym,Sfe,r=>hd?.observe(r)),y1(e)?Gp.set(t,e):Gp.set(t,{duration:250,easing:"ease-in-out",...e});const s=new MutationObserver(rH);s.observe(t,{childList:!0}),JE.set(t,s),M5.add(t)}return Object.freeze({parent:t,enable:()=>{og.add(t)},disable:()=>{og.delete(t),vS(t,i=>{const a=Vo.get(i);try{a?.cancel()}catch{}Vo.delete(i);const s=Bf.get(i);s&&clearTimeout(s),Bf.delete(i);const r=yb.get(i);r&&clearInterval(r),yb.delete(i)})},isEnabled:()=>og.has(t),destroy:()=>{og.delete(t),M5.delete(t),Gp.delete(t);const i=JE.get(t);i?.disconnect(),JE.delete(t),vS(t,a=>{hd?.unobserve(a);const s=Vo.get(a);try{s?.cancel()}catch{}Vo.delete(a);const r=g1.get(a);r?.disconnect(),g1.delete(a);const o=yb.get(a);o&&clearInterval(o),yb.delete(a);const c=Bf.get(a);c&&clearTimeout(c),Bf.delete(a),dr.delete(a),tm.delete(a)})}})}function Pfe(t){const[e,n]=P.useState(),i=P.useMemo(()=>t,[]),a=P.useCallback(r=>{r instanceof HTMLElement?n(Nfe(r,i)):n(void 0)},[i]),s=P.useCallback(r=>{e&&(r?e.enable():e.disable())},[e]);return P.useEffect(()=>()=>{var r;(r=e?.destroy)===null||r===void 0||r.call(e)},[e]),[a,s]}function e3(t,e,n){const i=sn.c(3),a=Wr(e);let s;i[0]!==n||i[1]!==a?(s=r=>{a(r),n?.(r),ut("play_sound",r.visible?"item_down":"hover_up")},i[0]=n,i[1]=a,i[2]=s):s=i[2],yo(t,s)}const Dfe=["Escape"],fH=t=>{const e=sn.c(5),n=P.useRef(Lfe);let i,a;e[0]!==t?(i=()=>{n.current=t},a=[t],e[0]=t,e[1]=i,e[2]=a):(i=e[1],a=e[2]),P.useEffect(i,a);let s,r;e[3]===Symbol.for("react.memo_cache_sentinel")?(s=()=>{const o=c=>{Dfe.includes(c.code)&&n.current(!1)};return window.addEventListener("keyup",o),()=>window.removeEventListener("keyup",o)},r=[],e[3]=s,e[4]=r):(s=e[3],r=e[4]),P.useEffect(s,r)};function Lfe(){}function Ofe(){const t=sn.c(17),[e]=Pfe(),n=Wr(QV),i=Wr(SA),a=nh(),s=_u();let r;t[0]!==s.pathname?(r=s.pathname.split("/"),t[0]=s.pathname,t[1]=r):r=t[1];const o=r[2],c=vi(Zf),u=Wr(xA);let h;t[2]!==a||t[3]!==n||t[4]!==u||t[5]!==i?(h=x=>{i(!1),x.visible?(x.enableShop?a("/decorate/dynamic"):a("/decorate/stash"),u(!1)):n(void 0)},t[2]=a,t[3]=n,t[4]=u,t[5]=i,t[6]=h):h=t[6],e3("toggle_decorate_menu",Zf,h);let d;t[7]!==a?(d=()=>{ut("close"),a("/")},t[7]=a,t[8]=d):d=t[8],fH(d),yo("remove_current_object",Ife);let p,g;t[9]!==o?(p=()=>{ut("set_current_page",o)},g=[o],t[9]=o,t[10]=p,t[11]=g):(p=t[10],g=t[11]),P.useEffect(p,g);let b;t[12]!==c.visible?(b=c.visible&&_.jsx(J9,{}),t[12]=c.visible,t[13]=b):b=t[13];let w;return t[14]!==e||t[15]!==b?(w=_.jsx("div",{id:"decorate-layout",ref:e,className:"w-full h-full",children:b}),t[14]=e,t[15]=b,t[16]=w):w=t[16],w}function Ife(){}const zfe=KX([{path:"*",Component:Ofe,ErrorBoundary:rq,children:[{path:"",element:_.jsx(_.Fragment,{})},{path:"decorate",Component:wde,children:[{path:"dynamic/:categoryId?/:dynamicId?/:itemId?",Component:Wue},{path:"objects/:dynamicId?/:itemId?",Component:Ade},{path:"stash/:id?",Component:mfe}]}]}]),Nn=t=>typeof t=="string",Zy=()=>{let t,e;const n=new Promise((i,a)=>{t=i,e=a});return n.resolve=t,n.reject=e,n},f7=t=>t==null?"":""+t,Bfe=(t,e,n)=>{t.forEach(i=>{e[i]&&(n[i]=e[i])})},Ufe=/###/g,h7=t=>t&&t.indexOf("###")>-1?t.replace(Ufe,"."):t,p7=t=>!t||Nn(t),Ob=(t,e,n)=>{const i=Nn(e)?e.split("."):e;let a=0;for(;a<i.length-1;){if(p7(t))return{};const s=h7(i[a]);!t[s]&&n&&(t[s]=new n),Object.prototype.hasOwnProperty.call(t,s)?t=t[s]:t={},++a}return p7(t)?{}:{obj:t,k:h7(i[a])}},m7=(t,e,n)=>{const{obj:i,k:a}=Ob(t,e,Object);if(i!==void 0||e.length===1){i[a]=n;return}let s=e[e.length-1],r=e.slice(0,e.length-1),o=Ob(t,r,Object);for(;o.obj===void 0&&r.length;)s=`${r[r.length-1]}.${s}`,r=r.slice(0,r.length-1),o=Ob(t,r,Object),o?.obj&&typeof o.obj[`${o.k}.${s}`]<"u"&&(o.obj=void 0);o.obj[`${o.k}.${s}`]=n},jfe=(t,e,n,i)=>{const{obj:a,k:s}=Ob(t,e,Object);a[s]=a[s]||[],a[s].push(n)},t3=(t,e)=>{const{obj:n,k:i}=Ob(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,i))return n[i]},Ffe=(t,e,n)=>{const i=t3(t,n);return i!==void 0?i:t3(e,n)},hH=(t,e,n)=>{for(const i in e)i!=="__proto__"&&i!=="constructor"&&(i in t?Nn(t[i])||t[i]instanceof String||Nn(e[i])||e[i]instanceof String?n&&(t[i]=e[i]):hH(t[i],e[i],n):t[i]=e[i]);return t},L0=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Vfe={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const kfe=t=>Nn(t)?t.replace(/[&<>"'\/]/g,e=>Vfe[e]):t;class Hfe{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const i=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,i),this.regExpQueue.push(e),i}}const $fe=[" ",",","?","!",";"],Gfe=new Hfe(20),Wfe=(t,e,n)=>{e=e||"",n=n||"";const i=$fe.filter(r=>e.indexOf(r)<0&&n.indexOf(r)<0);if(i.length===0)return!0;const a=Gfe.getRegExp(`(${i.map(r=>r==="?"?"\\?":r).join("|")})`);let s=!a.test(t);if(!s){const r=t.indexOf(n);r>0&&!a.test(t.substring(0,r))&&(s=!0)}return s},T5=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const i=e.split(n);let a=t;for(let s=0;s<i.length;){if(!a||typeof a!="object")return;let r,o="";for(let c=s;c<i.length;++c)if(c!==s&&(o+=n),o+=i[c],r=a[o],r!==void 0){if(["string","number","boolean"].indexOf(typeof r)>-1&&c<i.length-1)continue;s+=c-s+1;break}a=r}return a},b1=t=>t?.replace("_","-"),Kfe={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){console?.[t]?.apply?.(console,e)}};class n3{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||Kfe,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,i,a){return a&&!this.debug?null:(Nn(e[0])&&(e[0]=`${i}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new n3(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new n3(this.logger,e)}}var lu=new n3;class _w{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(i=>{this.observers[i]||(this.observers[i]=new Map);const a=this.observers[i].get(n)||0;this.observers[i].set(n,a+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([a,s])=>{for(let r=0;r<s;r++)a(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([a,s])=>{for(let r=0;r<s;r++)a.apply(a,[e,...n])})}}class g7 extends _w{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,i,a={}){const s=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,r=a.ignoreJSONStructure!==void 0?a.ignoreJSONStructure:this.options.ignoreJSONStructure;let o;e.indexOf(".")>-1?o=e.split("."):(o=[e,n],i&&(Array.isArray(i)?o.push(...i):Nn(i)&&s?o.push(...i.split(s)):o.push(i)));const c=t3(this.data,o);return!c&&!n&&!i&&e.indexOf(".")>-1&&(e=o[0],n=o[1],i=o.slice(2).join(".")),c||!r||!Nn(i)?c:T5(this.data?.[e]?.[n],i,s)}addResource(e,n,i,a,s={silent:!1}){const r=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator;let o=[e,n];i&&(o=o.concat(r?i.split(r):i)),e.indexOf(".")>-1&&(o=e.split("."),a=n,n=o[1]),this.addNamespaces(n),m7(this.data,o,a),s.silent||this.emit("added",e,n,i,a)}addResources(e,n,i,a={silent:!1}){for(const s in i)(Nn(i[s])||Array.isArray(i[s]))&&this.addResource(e,n,s,i[s],{silent:!0});a.silent||this.emit("added",e,n,i)}addResourceBundle(e,n,i,a,s,r={silent:!1,skipCopy:!1}){let o=[e,n];e.indexOf(".")>-1&&(o=e.split("."),a=i,i=n,n=o[1]),this.addNamespaces(n);let c=t3(this.data,o)||{};r.skipCopy||(i=JSON.parse(JSON.stringify(i))),a?hH(c,i,s):c={...c,...i},m7(this.data,o,c),r.silent||this.emit("added",e,n,i)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(a=>n[a]&&Object.keys(n[a]).length>0)}toJSON(){return this.data}}var pH={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,i,a){return t.forEach(s=>{e=this.processors[s]?.process(e,n,i,a)??e}),e}};const mH=Symbol("i18next/PATH_KEY");function Xfe(){const t=[],e=Object.create(null);let n;return e.get=(i,a)=>(n?.revoke?.(),a===mH?t:(t.push(a),n=Proxy.revocable(i,e),n.proxy)),Proxy.revocable(Object.create(null),e).proxy}function C5(t,e){const{[mH]:n}=t(Xfe());return n.join(e?.keySeparator??".")}const v7={},tM=t=>!Nn(t)&&typeof t!="boolean"&&typeof t!="number";class i3 extends _w{constructor(e,n={}){super(),Bfe(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=lu.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const i={...n};if(e==null)return!1;const a=this.resolve(e,i);if(a?.res===void 0)return!1;const s=tM(a.res);return!(i.returnObjects===!1&&s)}extractFromKey(e,n){let i=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;i===void 0&&(i=":");const a=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let s=n.ns||this.options.defaultNS||[];const r=i&&e.indexOf(i)>-1,o=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!Wfe(e,i,a);if(r&&!o){const c=e.match(this.interpolator.nestingRegexp);if(c&&c.length>0)return{key:e,namespaces:Nn(s)?[s]:s};const u=e.split(i);(i!==a||i===a&&this.options.ns.indexOf(u[0])>-1)&&(s=u.shift()),e=u.join(a)}return{key:e,namespaces:Nn(s)?[s]:s}}translate(e,n,i){let a=typeof n=="object"?{...n}:n;if(typeof a!="object"&&this.options.overloadTranslationOptionHandler&&(a=this.options.overloadTranslationOptionHandler(arguments)),typeof a=="object"&&(a={...a}),a||(a={}),e==null)return"";typeof e=="function"&&(e=C5(e,{...this.options,...a})),Array.isArray(e)||(e=[String(e)]);const s=a.returnDetails!==void 0?a.returnDetails:this.options.returnDetails,r=a.keySeparator!==void 0?a.keySeparator:this.options.keySeparator,{key:o,namespaces:c}=this.extractFromKey(e[e.length-1],a),u=c[c.length-1];let h=a.nsSeparator!==void 0?a.nsSeparator:this.options.nsSeparator;h===void 0&&(h=":");const d=a.lng||this.language,p=a.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(d?.toLowerCase()==="cimode")return p?s?{res:`${u}${h}${o}`,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:`${u}${h}${o}`:s?{res:o,usedKey:o,exactUsedKey:o,usedLng:d,usedNS:u,usedParams:this.getUsedParamsDetails(a)}:o;const g=this.resolve(e,a);let b=g?.res;const w=g?.usedKey||o,x=g?.exactUsedKey||o,S=["[object Number]","[object Function]","[object RegExp]"],M=a.joinArrays!==void 0?a.joinArrays:this.options.joinArrays,C=!this.i18nFormat||this.i18nFormat.handleAsObject,A=a.count!==void 0&&!Nn(a.count),N=i3.hasDefaultValue(a),R=A?this.pluralResolver.getSuffix(d,a.count,a):"",D=a.ordinal&&A?this.pluralResolver.getSuffix(d,a.count,{ordinal:!1}):"",B=A&&!a.ordinal&&a.count===0,z=B&&a[`defaultValue${this.options.pluralSeparator}zero`]||a[`defaultValue${R}`]||a[`defaultValue${D}`]||a.defaultValue;let I=b;C&&!b&&N&&(I=z);const U=tM(I),$=Object.prototype.toString.apply(I);if(C&&I&&U&&S.indexOf($)<0&&!(Nn(M)&&Array.isArray(I))){if(!a.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const G=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,I,{...a,ns:c}):`key '${o} (${this.language})' returned an object instead of string.`;return s?(g.res=G,g.usedParams=this.getUsedParamsDetails(a),g):G}if(r){const G=Array.isArray(I),k=G?[]:{},X=G?x:w;for(const V in I)if(Object.prototype.hasOwnProperty.call(I,V)){const H=`${X}${r}${V}`;N&&!b?k[V]=this.translate(H,{...a,defaultValue:tM(z)?z[V]:void 0,joinArrays:!1,ns:c}):k[V]=this.translate(H,{...a,joinArrays:!1,ns:c}),k[V]===H&&(k[V]=I[V])}b=k}}else if(C&&Nn(M)&&Array.isArray(b))b=b.join(M),b&&(b=this.extendTranslation(b,e,a,i));else{let G=!1,k=!1;!this.isValidLookup(b)&&N&&(G=!0,b=z),this.isValidLookup(b)||(k=!0,b=o);const V=(a.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&k?void 0:b,H=N&&z!==b&&this.options.updateMissing;if(k||G||H){if(this.logger.log(H?"updateKey":"missingKey",d,u,o,H?z:b),r){const K=this.resolve(o,{...a,keySeparator:!1});K&&K.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let W=[];const J=this.languageUtils.getFallbackCodes(this.options.fallbackLng,a.lng||this.language);if(this.options.saveMissingTo==="fallback"&&J&&J[0])for(let K=0;K<J.length;K++)W.push(J[K]);else this.options.saveMissingTo==="all"?W=this.languageUtils.toResolveHierarchy(a.lng||this.language):W.push(a.lng||this.language);const Y=(K,ee,ie)=>{const Z=N&&ie!==b?ie:V;this.options.missingKeyHandler?this.options.missingKeyHandler(K,u,ee,Z,H,a):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(K,u,ee,Z,H,a),this.emit("missingKey",K,u,ee,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?W.forEach(K=>{const ee=this.pluralResolver.getSuffixes(K,a);B&&a[`defaultValue${this.options.pluralSeparator}zero`]&&ee.indexOf(`${this.options.pluralSeparator}zero`)<0&&ee.push(`${this.options.pluralSeparator}zero`),ee.forEach(ie=>{Y([K],o+ie,a[`defaultValue${ie}`]||z)})}):Y(W,o,z))}b=this.extendTranslation(b,e,a,g,i),k&&b===o&&this.options.appendNamespaceToMissingKey&&(b=`${u}${h}${o}`),(k||G)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${h}${o}`:o,G?b:void 0,a))}return s?(g.res=b,g.usedParams=this.getUsedParamsDetails(a),g):b}extendTranslation(e,n,i,a,s){if(this.i18nFormat?.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...i},i.lng||this.language||a.usedLng,a.usedNS,a.usedKey,{resolved:a});else if(!i.skipInterpolation){i.interpolation&&this.interpolator.init({...i,interpolation:{...this.options.interpolation,...i.interpolation}});const c=Nn(e)&&(i?.interpolation?.skipOnVariables!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let u;if(c){const d=e.match(this.interpolator.nestingRegexp);u=d&&d.length}let h=i.replace&&!Nn(i.replace)?i.replace:i;if(this.options.interpolation.defaultVariables&&(h={...this.options.interpolation.defaultVariables,...h}),e=this.interpolator.interpolate(e,h,i.lng||this.language||a.usedLng,i),c){const d=e.match(this.interpolator.nestingRegexp),p=d&&d.length;u<p&&(i.nest=!1)}!i.lng&&a&&a.res&&(i.lng=this.language||a.usedLng),i.nest!==!1&&(e=this.interpolator.nest(e,(...d)=>s?.[0]===d[0]&&!i.context?(this.logger.warn(`It seems you are nesting recursively key: ${d[0]} in key: ${n[0]}`),null):this.translate(...d,n),i)),i.interpolation&&this.interpolator.reset()}const r=i.postProcess||this.options.postProcess,o=Nn(r)?[r]:r;return e!=null&&o?.length&&i.applyPostProcessor!==!1&&(e=pH.handle(o,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...a,usedParams:this.getUsedParamsDetails(i)},...i}:i,this)),e}resolve(e,n={}){let i,a,s,r,o;return Nn(e)&&(e=[e]),e.forEach(c=>{if(this.isValidLookup(i))return;const u=this.extractFromKey(c,n),h=u.key;a=h;let d=u.namespaces;this.options.fallbackNS&&(d=d.concat(this.options.fallbackNS));const p=n.count!==void 0&&!Nn(n.count),g=p&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(Nn(n.context)||typeof n.context=="number")&&n.context!=="",w=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);d.forEach(x=>{this.isValidLookup(i)||(o=x,!v7[`${w[0]}-${x}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(o)&&(v7[`${w[0]}-${x}`]=!0,this.logger.warn(`key "${a}" for languages "${w.join(", ")}" won't get resolved as namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(S=>{if(this.isValidLookup(i))return;r=S;const M=[h];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(M,h,S,x,n);else{let A;p&&(A=this.pluralResolver.getSuffix(S,n.count,n));const N=`${this.options.pluralSeparator}zero`,R=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(p&&(n.ordinal&&A.indexOf(R)===0&&M.push(h+A.replace(R,this.options.pluralSeparator)),M.push(h+A),g&&M.push(h+N)),b){const D=`${h}${this.options.contextSeparator||"_"}${n.context}`;M.push(D),p&&(n.ordinal&&A.indexOf(R)===0&&M.push(D+A.replace(R,this.options.pluralSeparator)),M.push(D+A),g&&M.push(D+N))}}let C;for(;C=M.pop();)this.isValidLookup(i)||(s=C,i=this.getResource(S,x,C,n))}))})}),{res:i,usedKey:a,exactUsedKey:s,usedLng:r,usedNS:o}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,i,a={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(e,n,i,a):this.resourceStore.getResource(e,n,i,a)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],i=e.replace&&!Nn(e.replace);let a=i?e.replace:e;if(i&&typeof e.count<"u"&&(a.count=e.count),this.options.interpolation.defaultVariables&&(a={...this.options.interpolation.defaultVariables,...a}),!i){a={...a};for(const s of n)delete a[s]}return a}static hasDefaultValue(e){const n="defaultValue";for(const i in e)if(Object.prototype.hasOwnProperty.call(e,i)&&n===i.substring(0,n.length)&&e[i]!==void 0)return!0;return!1}}class y7{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=lu.create("languageUtils")}getScriptPartFromCode(e){if(e=b1(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=b1(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(Nn(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(i=>{if(n)return;const a=this.formatLanguageCode(i);(!this.options.supportedLngs||this.isSupportedCode(a))&&(n=a)}),!n&&this.options.supportedLngs&&e.forEach(i=>{if(n)return;const a=this.getScriptPartFromCode(i);if(this.isSupportedCode(a))return n=a;const s=this.getLanguagePartFromCode(i);if(this.isSupportedCode(s))return n=s;n=this.options.supportedLngs.find(r=>{if(r===s)return r;if(!(r.indexOf("-")<0&&s.indexOf("-")<0)&&(r.indexOf("-")>0&&s.indexOf("-")<0&&r.substring(0,r.indexOf("-"))===s||r.indexOf(s)===0&&s.length>1))return r})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),Nn(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let i=e[n];return i||(i=e[this.getScriptPartFromCode(n)]),i||(i=e[this.formatLanguageCode(n)]),i||(i=e[this.getLanguagePartFromCode(n)]),i||(i=e.default),i||[]}toResolveHierarchy(e,n){const i=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),a=[],s=r=>{r&&(this.isSupportedCode(r)?a.push(r):this.logger.warn(`rejecting language code not found in supportedLngs: ${r}`))};return Nn(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&s(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&s(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&s(this.getLanguagePartFromCode(e))):Nn(e)&&s(this.formatLanguageCode(e)),i.forEach(r=>{a.indexOf(r)<0&&s(this.formatLanguageCode(r))}),a}}const b7={zero:0,one:1,two:2,few:3,many:4,other:5},x7={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class qfe{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=lu.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const i=b1(e==="dev"?"en":e),a=n.ordinal?"ordinal":"cardinal",s=JSON.stringify({cleanedCode:i,type:a});if(s in this.pluralRulesCache)return this.pluralRulesCache[s];let r;try{r=new Intl.PluralRules(i,{type:a})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),x7;if(!e.match(/-|_/))return x7;const c=this.languageUtils.getLanguagePartFromCode(e);r=this.getRule(c,n)}return this.pluralRulesCache[s]=r,r}needsPlural(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(e,n,i={}){return this.getSuffixes(e,i).map(a=>`${n}${a}`)}getSuffixes(e,n={}){let i=this.getRule(e,n);return i||(i=this.getRule("dev",n)),i?i.resolvedOptions().pluralCategories.sort((a,s)=>b7[a]-b7[s]).map(a=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${a}`):[]}getSuffix(e,n,i={}){const a=this.getRule(e,i);return a?`${this.options.prepend}${i.ordinal?`ordinal${this.options.prepend}`:""}${a.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,i))}}const _7=(t,e,n,i=".",a=!0)=>{let s=Ffe(t,e,n);return!s&&a&&Nn(n)&&(s=T5(t,n,i),s===void 0&&(s=T5(e,n,i))),s},nM=t=>t.replace(/\$/g,"$$$$");class Yfe{constructor(e={}){this.logger=lu.create("interpolator"),this.options=e,this.format=e?.interpolation?.format||(n=>n),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:i,useRawValueToEscape:a,prefix:s,prefixEscaped:r,suffix:o,suffixEscaped:c,formatSeparator:u,unescapeSuffix:h,unescapePrefix:d,nestingPrefix:p,nestingPrefixEscaped:g,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:x,maxReplaces:S,alwaysFormat:M}=e.interpolation;this.escape=n!==void 0?n:kfe,this.escapeValue=i!==void 0?i:!0,this.useRawValueToEscape=a!==void 0?a:!1,this.prefix=s?L0(s):r||"{{",this.suffix=o?L0(o):c||"}}",this.formatSeparator=u||",",this.unescapePrefix=h?"":d||"-",this.unescapeSuffix=this.unescapePrefix?"":h||"",this.nestingPrefix=p?L0(p):g||L0("$t("),this.nestingSuffix=b?L0(b):w||L0(")"),this.nestingOptionsSeparator=x||",",this.maxReplaces=S||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,i)=>n?.source===i?(n.lastIndex=0,n):new RegExp(i,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,i,a){let s,r,o;const c=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(g.indexOf(this.formatSeparator)<0){const S=_7(n,c,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,i,{...a,...n,interpolationkey:g}):S}const b=g.split(this.formatSeparator),w=b.shift().trim(),x=b.join(this.formatSeparator).trim();return this.format(_7(n,c,w,this.options.keySeparator,this.options.ignoreJSONStructure),x,i,{...a,...n,interpolationkey:w})};this.resetRegExp();const h=a?.missingInterpolationHandler||this.options.missingInterpolationHandler,d=a?.interpolation?.skipOnVariables!==void 0?a.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>nM(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?nM(this.escape(g)):nM(g)}].forEach(g=>{for(o=0;s=g.regex.exec(e);){const b=s[1].trim();if(r=u(b),r===void 0)if(typeof h=="function"){const x=h(e,s,a);r=Nn(x)?x:""}else if(a&&Object.prototype.hasOwnProperty.call(a,b))r="";else if(d){r=s[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${e}`),r="";else!Nn(r)&&!this.useRawValueToEscape&&(r=f7(r));const w=g.safeValue(r);if(e=e.replace(s[0],w),d?(g.regex.lastIndex+=r.length,g.regex.lastIndex-=s[0].length):g.regex.lastIndex=0,o++,o>=this.maxReplaces)break}}),e}nest(e,n,i={}){let a,s,r;const o=(c,u)=>{const h=this.nestingOptionsSeparator;if(c.indexOf(h)<0)return c;const d=c.split(new RegExp(`${h}[ ]*{`));let p=`{${d[1]}`;c=d[0],p=this.interpolate(p,r);const g=p.match(/'/g),b=p.match(/"/g);((g?.length??0)%2===0&&!b||b.length%2!==0)&&(p=p.replace(/'/g,'"'));try{r=JSON.parse(p),u&&(r={...u,...r})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${c}`,w),`${c}${h}${p}`}return r.defaultValue&&r.defaultValue.indexOf(this.prefix)>-1&&delete r.defaultValue,c};for(;a=this.nestingRegexp.exec(e);){let c=[];r={...i},r=r.replace&&!Nn(r.replace)?r.replace:r,r.applyPostProcessor=!1,delete r.defaultValue;const u=/{.*}/.test(a[1])?a[1].lastIndexOf("}")+1:a[1].indexOf(this.formatSeparator);if(u!==-1&&(c=a[1].slice(u).split(this.formatSeparator).map(h=>h.trim()).filter(Boolean),a[1]=a[1].slice(0,u)),s=n(o.call(this,a[1].trim(),r),r),s&&a[0]===e&&!Nn(s))return s;Nn(s)||(s=f7(s)),s||(this.logger.warn(`missed to resolve ${a[1]} for nesting ${e}`),s=""),c.length&&(s=c.reduce((h,d)=>this.format(h,d,i.lng,{...i,interpolationkey:a[1].trim()}),s.trim())),e=e.replace(a[0],s),this.regexp.lastIndex=0}return e}}const Zfe=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const i=t.split("(");e=i[0].toLowerCase().trim();const a=i[1].substring(0,i[1].length-1);e==="currency"&&a.indexOf(":")<0?n.currency||(n.currency=a.trim()):e==="relativetime"&&a.indexOf(":")<0?n.range||(n.range=a.trim()):a.split(";").forEach(r=>{if(r){const[o,...c]=r.split(":"),u=c.join(":").trim().replace(/^'+|'+$/g,""),h=o.trim();n[h]||(n[h]=u),u==="false"&&(n[h]=!1),u==="true"&&(n[h]=!0),isNaN(u)||(n[h]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},S7=t=>{const e={};return(n,i,a)=>{let s=a;a&&a.interpolationkey&&a.formatParams&&a.formatParams[a.interpolationkey]&&a[a.interpolationkey]&&(s={...s,[a.interpolationkey]:void 0});const r=i+JSON.stringify(s);let o=e[r];return o||(o=t(b1(i),a),e[r]=o),o(n)}},Qfe=t=>(e,n,i)=>t(b1(n),i)(e);class Jfe{constructor(e={}){this.logger=lu.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const i=n.cacheInBuiltFormats?S7:Qfe;this.formats={number:i((a,s)=>{const r=new Intl.NumberFormat(a,{...s});return o=>r.format(o)}),currency:i((a,s)=>{const r=new Intl.NumberFormat(a,{...s,style:"currency"});return o=>r.format(o)}),datetime:i((a,s)=>{const r=new Intl.DateTimeFormat(a,{...s});return o=>r.format(o)}),relativetime:i((a,s)=>{const r=new Intl.RelativeTimeFormat(a,{...s});return o=>r.format(o,s.range||"day")}),list:i((a,s)=>{const r=new Intl.ListFormat(a,{...s});return o=>r.format(o)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=S7(n)}format(e,n,i,a={}){const s=n.split(this.formatSeparator);if(s.length>1&&s[0].indexOf("(")>1&&s[0].indexOf(")")<0&&s.find(o=>o.indexOf(")")>-1)){const o=s.findIndex(c=>c.indexOf(")")>-1);s[0]=[s[0],...s.splice(1,o)].join(this.formatSeparator)}return s.reduce((o,c)=>{const{formatName:u,formatOptions:h}=Zfe(c);if(this.formats[u]){let d=o;try{const p=a?.formatParams?.[a.interpolationkey]||{},g=p.locale||p.lng||a.locale||a.lng||i;d=this.formats[u](o,g,{...h,...a,...p})}catch(p){this.logger.warn(p)}return d}else this.logger.warn(`there was no format function for ${u}`);return o},e)}}const ehe=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class the extends _w{constructor(e,n,i,a={}){super(),this.backend=e,this.store=n,this.services=i,this.languageUtils=i.languageUtils,this.options=a,this.logger=lu.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=a.maxParallelReads||10,this.readingCalls=0,this.maxRetries=a.maxRetries>=0?a.maxRetries:5,this.retryTimeout=a.retryTimeout>=1?a.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(i,a.backend,a)}queueLoad(e,n,i,a){const s={},r={},o={},c={};return e.forEach(u=>{let h=!0;n.forEach(d=>{const p=`${u}|${d}`;!i.reload&&this.store.hasResourceBundle(u,d)?this.state[p]=2:this.state[p]<0||(this.state[p]===1?r[p]===void 0&&(r[p]=!0):(this.state[p]=1,h=!1,r[p]===void 0&&(r[p]=!0),s[p]===void 0&&(s[p]=!0),c[d]===void 0&&(c[d]=!0)))}),h||(o[u]=!0)}),(Object.keys(s).length||Object.keys(r).length)&&this.queue.push({pending:r,pendingCount:Object.keys(r).length,loaded:{},errors:[],callback:a}),{toLoad:Object.keys(s),pending:Object.keys(r),toLoadLanguages:Object.keys(o),toLoadNamespaces:Object.keys(c)}}loaded(e,n,i){const a=e.split("|"),s=a[0],r=a[1];n&&this.emit("failedLoading",s,r,n),!n&&i&&this.store.addResourceBundle(s,r,i,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&i&&(this.state[e]=0);const o={};this.queue.forEach(c=>{jfe(c.loaded,[s],r),ehe(c,e),n&&c.errors.push(n),c.pendingCount===0&&!c.done&&(Object.keys(c.loaded).forEach(u=>{o[u]||(o[u]={});const h=c.loaded[u];h.length&&h.forEach(d=>{o[u][d]===void 0&&(o[u][d]=!0)})}),c.done=!0,c.errors.length?c.callback(c.errors):c.callback())}),this.emit("loaded",o),this.queue=this.queue.filter(c=>!c.done)}read(e,n,i,a=0,s=this.retryTimeout,r){if(!e.length)return r(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:i,tried:a,wait:s,callback:r});return}this.readingCalls++;const o=(u,h)=>{if(this.readingCalls--,this.waitingReads.length>0){const d=this.waitingReads.shift();this.read(d.lng,d.ns,d.fcName,d.tried,d.wait,d.callback)}if(u&&h&&a<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,i,a+1,s*2,r)},s);return}r(u,h)},c=this.backend[i].bind(this.backend);if(c.length===2){try{const u=c(e,n);u&&typeof u.then=="function"?u.then(h=>o(null,h)).catch(o):o(null,u)}catch(u){o(u)}return}return c(e,n,o)}prepareLoading(e,n,i={},a){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),a&&a();Nn(e)&&(e=this.languageUtils.toResolveHierarchy(e)),Nn(n)&&(n=[n]);const s=this.queueLoad(e,n,i,a);if(!s.toLoad.length)return s.pending.length||a(),null;s.toLoad.forEach(r=>{this.loadOne(r)})}load(e,n,i){this.prepareLoading(e,n,{},i)}reload(e,n,i){this.prepareLoading(e,n,{reload:!0},i)}loadOne(e,n=""){const i=e.split("|"),a=i[0],s=i[1];this.read(a,s,"read",void 0,void 0,(r,o)=>{r&&this.logger.warn(`${n}loading namespace ${s} for language ${a} failed`,r),!r&&o&&this.logger.log(`${n}loaded namespace ${s} for language ${a}`,o),this.loaded(e,r,o)})}saveMissing(e,n,i,a,s,r={},o=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${i}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(i==null||i==="")){if(this.backend?.create){const c={...r,isUpdate:s},u=this.backend.create.bind(this.backend);if(u.length<6)try{let h;u.length===5?h=u(e,n,i,a,c):h=u(e,n,i,a),h&&typeof h.then=="function"?h.then(d=>o(null,d)).catch(o):o(null,h)}catch(h){o(h)}else u(e,n,i,a,o,c)}!e||!e[0]||this.store.addResource(e[0],n,i,a)}}}const w7=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),Nn(t[1])&&(e.defaultValue=t[1]),Nn(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(i=>{e[i]=n[i]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),E7=t=>(Nn(t.ns)&&(t.ns=[t.ns]),Nn(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),Nn(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),t.supportedLngs?.indexOf?.("cimode")<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t),r_=()=>{},nhe=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class x1 extends _w{constructor(e={},n){if(super(),this.options=E7(e),this.services={},this.logger=lu,this.modules={external:[]},nhe(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(Nn(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const i=w7();this.options={...i,...this.options,...E7(e)},this.options.interpolation={...i.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const a=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?lu.init(a(this.modules.logger),this.options):lu.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=Jfe;const h=new y7(this.options);this.store=new g7(this.options.resources,this.options);const d=this.services;d.logger=lu,d.resourceStore=this.store,d.languageUtils=h,d.pluralResolver=new qfe(h,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==i.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===i.interpolation.format)&&(d.formatter=a(u),d.formatter.init&&d.formatter.init(d,this.options),this.options.interpolation.format=d.formatter.format.bind(d.formatter)),d.interpolator=new Yfe(this.options),d.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},d.backendConnector=new the(a(this.modules.backend),d.resourceStore,d,this.options),d.backendConnector.on("*",(g,...b)=>{this.emit(g,...b)}),this.modules.languageDetector&&(d.languageDetector=a(this.modules.languageDetector),d.languageDetector.init&&d.languageDetector.init(d,this.options.detection,this.options)),this.modules.i18nFormat&&(d.i18nFormat=a(this.modules.i18nFormat),d.i18nFormat.init&&d.i18nFormat.init(this)),this.translator=new i3(this.services,this.options),this.translator.on("*",(g,...b)=>{this.emit(g,...b)}),this.modules.external.forEach(g=>{g.init&&g.init(this)})}if(this.format=this.options.interpolation.format,n||(n=r_),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...h)=>this.store[u](...h)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...h)=>(this.store[u](...h),this)});const o=Zy(),c=()=>{const u=(h,d)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),o.resolve(d),n(h,d)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?c():setTimeout(c,0),o}loadResources(e,n=r_){let i=n;const a=Nn(e)?e:this.language;if(typeof e=="function"&&(i=e),!this.options.resources||this.options.partialBundledLanguages){if(a?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return i();const s=[],r=o=>{if(!o||o==="cimode")return;this.services.languageUtils.toResolveHierarchy(o).forEach(u=>{u!=="cimode"&&s.indexOf(u)<0&&s.push(u)})};a?r(a):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(c=>r(c)),this.options.preload?.forEach?.(o=>r(o)),this.services.backendConnector.load(s,this.options.ns,o=>{!o&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),i(o)})}else i(null)}reloadResources(e,n,i){const a=Zy();return typeof e=="function"&&(i=e,e=void 0),typeof n=="function"&&(i=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),i||(i=r_),this.services.backendConnector.reload(e,n,s=>{a.resolve(),i(s)}),a}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&pH.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const i=this.languages[n];if(!(["cimode","dev"].indexOf(i)>-1)&&this.store.hasLanguageSomeTranslations(i)){this.resolvedLanguage=i;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const i=Zy();this.emit("languageChanging",e);const a=o=>{this.language=o,this.languages=this.services.languageUtils.toResolveHierarchy(o),this.resolvedLanguage=void 0,this.setResolvedLanguage(o)},s=(o,c)=>{c?this.isLanguageChangingTo===e&&(a(c),this.translator.changeLanguage(c),this.isLanguageChangingTo=void 0,this.emit("languageChanged",c),this.logger.log("languageChanged",c)):this.isLanguageChangingTo=void 0,i.resolve((...u)=>this.t(...u)),n&&n(o,(...u)=>this.t(...u))},r=o=>{!e&&!o&&this.services.languageDetector&&(o=[]);const c=Nn(o)?o:o&&o[0],u=this.store.hasLanguageSomeTranslations(c)?c:this.services.languageUtils.getBestMatchFromCodes(Nn(o)?[o]:o);u&&(this.language||a(u),this.translator.language||this.translator.changeLanguage(u),this.services.languageDetector?.cacheUserLanguage?.(u)),this.loadResources(u,h=>{s(h,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?r(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(r):this.services.languageDetector.detect(r):r(e),i}getFixedT(e,n,i){const a=(s,r,...o)=>{let c;typeof r!="object"?c=this.options.overloadTranslationOptionHandler([s,r].concat(o)):c={...r},c.lng=c.lng||a.lng,c.lngs=c.lngs||a.lngs,c.ns=c.ns||a.ns,c.keyPrefix!==""&&(c.keyPrefix=c.keyPrefix||i||a.keyPrefix);const u=this.options.keySeparator||".";let h;return c.keyPrefix&&Array.isArray(s)?h=s.map(d=>(typeof d=="function"&&(d=C5(d,{...this.options,...r})),`${c.keyPrefix}${u}${d}`)):(typeof s=="function"&&(s=C5(s,{...this.options,...r})),h=c.keyPrefix?`${c.keyPrefix}${u}${s}`:s),this.t(h,c)};return Nn(e)?a.lng=e:a.lngs=e,a.ns=n,a.keyPrefix=i,a}t(...e){return this.translator?.translate(...e)}exists(...e){return this.translator?.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const i=n.lng||this.resolvedLanguage||this.languages[0],a=this.options?this.options.fallbackLng:!1,s=this.languages[this.languages.length-1];if(i.toLowerCase()==="cimode")return!0;const r=(o,c)=>{const u=this.services.backendConnector.state[`${o}|${c}`];return u===-1||u===0||u===2};if(n.precheck){const o=n.precheck(this,r);if(o!==void 0)return o}return!!(this.hasResourceBundle(i,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||r(i,e)&&(!a||r(s,e)))}loadNamespaces(e,n){const i=Zy();return this.options.ns?(Nn(e)&&(e=[e]),e.forEach(a=>{this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}),this.loadResources(a=>{i.resolve(),n&&n(a)}),i):(n&&n(),Promise.resolve())}loadLanguages(e,n){const i=Zy();Nn(e)&&(e=[e]);const a=this.options.preload||[],s=e.filter(r=>a.indexOf(r)<0&&this.services.languageUtils.isSupportedCode(r));return s.length?(this.options.preload=a.concat(s),this.loadResources(r=>{i.resolve(),n&&n(r)}),i):(n&&n(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!e)return"rtl";try{const a=new Intl.Locale(e);if(a&&a.getTextInfo){const s=a.getTextInfo();if(s&&s.direction)return s.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],i=this.services?.languageUtils||new y7(w7());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(i.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){return new x1(e,n)}cloneInstance(e={},n=r_){const i=e.forkResourceStore;i&&delete e.forkResourceStore;const a={...this.options,...e,isClone:!0},s=new x1(a);if((e.debug!==void 0||e.prefix!==void 0)&&(s.logger=s.logger.clone(e)),["store","services","language"].forEach(o=>{s[o]=this[o]}),s.services={...this.services},s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},i){const o=Object.keys(this.store.data).reduce((c,u)=>(c[u]={...this.store.data[u]},c[u]=Object.keys(c[u]).reduce((h,d)=>(h[d]={...c[u][d]},h),c[u]),c),{});s.store=new g7(o,a),s.services.resourceStore=s.store}return s.translator=new i3(s.services,a),s.translator.on("*",(o,...c)=>{s.emit(o,...c)}),s.init(a,n),s.translator.options=a,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const yr=x1.createInstance();yr.createInstance=x1.createInstance;yr.createInstance;yr.dir;yr.init;yr.loadResources;yr.reloadResources;yr.use;yr.changeLanguage;yr.getFixedT;yr.t;yr.exists;yr.setDefaultNamespace;yr.hasLoadedNamespace;yr.loadNamespaces;yr.loadLanguages;function Qy(t){const e=sn.c(7),{icon:n,text:i,onClick:a,disabled:s}=t;let r;e[0]!==i?(r=_.jsx("span",{className:"truncate",children:i}),e[0]=i,e[1]=r):r=e[1];let o;return e[2]!==s||e[3]!==n||e[4]!==a||e[5]!==r?(o=_.jsx(Zt,{variant:"flat",size:"lg",className:"item-slot hoverable text-slate-200 font-medium px-5 py-2.5 2xl:w-[12vw] xl:w-[14vw] w-[16vw] text-lg h-14 rounded-md border border-slate-500/30 transition-all duration-300 hover:border-slate-400/50 hover:shadow-lg hover:shadow-slate-500/20 truncate",startContent:n,onPress:a,isDisabled:s,children:r}),e[2]=s,e[3]=n,e[4]=a,e[5]=r,e[6]=o):o=e[6],o}function o_(t){const e=sn.c(19),{icon:n,value:i,label:a,iconColor:s,badgeValue:r,badgeColor:o}=t,c=s===void 0?"text-slate-300":s,u=o===void 0?"bg-slate-600":o,h=`${c} group-hover:text-slate-200 transition-colors duration-300`;let d;e[0]!==n||e[1]!==h?(d=_.jsx(n,{size:32,className:h}),e[0]=n,e[1]=h,e[2]=d):d=e[2];let p;e[3]!==u||e[4]!==r?(p=r&&_.jsx("div",{className:fn({"absolute -top-1 -right-1 w-5 h-5 rounded-full flex items-center justify-center border border-slate-500/50":!0,[u]:u}),children:_.jsx("span",{className:"text-xs font-semibold text-slate-200",children:r})}),e[3]=u,e[4]=r,e[5]=p):p=e[5];let g;e[6]!==d||e[7]!==p?(g=_.jsxs("div",{className:"relative",children:[d,p]}),e[6]=d,e[7]=p,e[8]=g):g=e[8];let b;e[9]!==a?(b=_.jsx("span",{className:"text-slate-400 text-xs font-medium",children:a}),e[9]=a,e[10]=b):b=e[10];let w;e[11]!==i?(w=_.jsx("span",{className:"text-xl font-bold text-slate-200",children:i}),e[11]=i,e[12]=w):w=e[12];let x;e[13]!==b||e[14]!==w?(x=_.jsxs("div",{className:"flex flex-col",children:[b,w]}),e[13]=b,e[14]=w,e[15]=x):x=e[15];let S;return e[16]!==g||e[17]!==x?(S=_.jsxs("div",{className:"flex items-center gap-3 group",children:[g,x]}),e[16]=g,e[17]=x,e[18]=S):S=e[18],S}function M7(t){const e=sn.c(9),{isFavorite:n}=t,{t:i}=Dn();let a;e[0]!==n?(a=_.jsx("div",{className:"relative",children:_.jsx(Hs,{mode:"wait",children:n?_.jsxs(Ve.div,{initial:{opacity:0},animate:{opacity:1,filter:"drop-shadow(0 0 8px rgba(251, 191, 36, 0.6))"},exit:{opacity:0,filter:"drop-shadow(0 0 0px rgba(251, 191, 36, 0))"},transition:{duration:.2},className:"relative",children:[_.jsx(wA,{size:28,className:"text-amber-400"}),_.jsx(Ve.div,{className:"absolute inset-0 bg-amber-400 rounded-full opacity-20 blur-sm",animate:{scale:[1,1.2,1],opacity:[.2,.4,.2]},transition:{duration:1,repeat:1/0,ease:"easeInOut"}})]},"filled"):_.jsx(Ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},children:_.jsx(Ole,{size:28,className:"text-slate-400"})},"empty")})}),e[0]=n,e[1]=a):a=e[1];let s;e[2]!==i?(s=i("menu.header.favorite_button"),e[2]=i,e[3]=s):s=e[3];let r;e[4]!==s?(r=_.jsx("span",{className:"text-slate-400 text-xs font-medium",children:s}),e[4]=s,e[5]=r):r=e[5];let o;return e[6]!==a||e[7]!==r?(o=_.jsxs("div",{className:"flex flex-col items-center gap-2",children:[a,r]}),e[6]=a,e[7]=r,e[8]=o):o=e[8],o}function Pd(){const t=vi(vr),e=P.useRef(null),n=P.useCallback((a,s)=>{e.current&&(e.current.pause(),e.current.currentTime=0),e.current=new Audio(`${t.soundPath}${a}.ogg`),e.current.volume=s||.05,e.current.play().catch(r=>{console.error("Error playing sound:",r)})},[]),i=P.useCallback(()=>{e.current&&(e.current.pause(),e.current.currentTime=0)},[]);return P.useEffect(()=>()=>{e.current&&(e.current.pause(),e.current=null)},[]),{playSound:n,stopSound:i,audioRef:e}}const wd=fs({visible:!1,isJobGarage:!1,isImpound:!1,vehicles:[],takeOutPrice:0,balance:0}),qA=fs(null),gH=fs(null,(t,e,n)=>{const i=t(wd);e(wd,{...i,vehicles:i.vehicles.map(a=>a.id===n.id?n:a)})}),ihe=fs(null,(t,e,n)=>{const i=t(wd);e(wd,{...i,vehicles:i.vehicles.filter(a=>a.id!==n.id)})});function ahe({setVisible:t,vehicle:e}){const n=vi(qA),[i,a]=P.useState(!1),[s,r]=P.useState(""),o=vi(vr),{playSound:c}=Pd(),u=Wr(gH),{t:h}=Dn(),d=async()=>{if(!s.trim()||!e)return console.error("No vehicle or tag input",{tagInput:s,vehicle:e});a(!0),c("setTag");try{const p=s.trim();await ut("setVehicleTag",{plate:e.plate,tag:p}),u({...e,tag:p}),t(!1),r(""),qa(h("menu.tag_modal.notification",{tag:p}),"success")}catch(p){console.error("Tag set error:",p)}finally{a(!1)}};return _.jsx(lh,{children:p=>_.jsxs(_.Fragment,{children:[_.jsx(ch,{className:"flex flex-col gap-1",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",children:_.jsx(mg,{className:"text-slate-300 text-xl"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"text-xl font-semibold text-slate-200 title",children:h("menu.tag_modal.title")}),_.jsx("p",{className:"text-sm text-slate-400",children:h("menu.tag_modal.description",{name:n?.name})})]})]})}),_.jsx(oh,{className:"py-6",children:_.jsxs(Ve.div,{className:"space-y-6",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},children:[e?.tag&&_.jsxs(Ve.div,{className:"flex items-center gap-2 p-3 rounded-lg bg-gradient-to-r from-slate-700/50 to-slate-600/50 border border-slate-500/30",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{delay:.2},children:[_.jsxs("span",{className:"text-sm text-slate-400",children:[h("menu.tag_modal.current_tag"),":"]}),_.jsx(na,{color:"primary",variant:"flat",startContent:_.jsx(mg,{className:"text-xs"}),className:"animate-pulse",children:e.tag})]}),_.jsxs(Ve.form,{onSubmit:g=>{g.preventDefault(),d()},className:"space-y-4",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:[_.jsxs("div",{className:"space-y-3",children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:h("menu.tag_modal.new_tag")}),_.jsx(go,{value:s,onChange:g=>r(g.target.value),placeholder:h("menu.tag_modal.new_tag_placeholder"),className:" rounded-lg",startContent:_.jsx(mg,{className:"text-slate-400"}),maxLength:20,autoFocus:!0})]}),_.jsxs("div",{className:"space-y-3",children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:h("menu.tag_modal.popular_tags")}),_.jsx("div",{className:"flex flex-wrap gap-2",children:o.tags.map((g,b)=>_.jsx(Ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{delay:.3+b*.1},children:_.jsx(na,{color:b===0?"warning":b===1?"danger":b===2?"success":b===3?"secondary":b===4?"primary":"default",variant:"flat",startContent:_.jsx(mg,{className:"text-xs"}),className:"cursor-pointer hover:scale-105 transition-transform duration-200 px-2",onClick:()=>r(g),children:g})},g))})]})]})]})}),_.jsx(rv,{className:"pt-4",children:_.jsxs(Ve.div,{className:"flex gap-3 w-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:[_.jsx(Zt,{variant:"flat",color:"danger",startContent:_.jsx(Qp,{}),onPress:p,className:"flex-1 item-slot border border-slate-500/30",children:h("menu.tag_modal.cancel")}),_.jsx(Zt,{color:"primary",startContent:_.jsx(pm,{}),onPress:d,isLoading:i,isDisabled:!s.trim(),className:"flex-1 item-slot border border-slate-500/30",children:h("menu.tag_modal.save")})]})})]})})}function YA(t){const e=sn.c(14),{searchQuery:n,defaultIcon:i,searchIcon:a}=t,s=i===void 0?dc:i,r=a===void 0?mm:a,{t:o}=Dn(),c=n?r:s;let u,h,d;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={opacity:0,scale:.9},h={opacity:1,scale:1},d={duration:.3},e[0]=u,e[1]=h,e[2]=d):(u=e[0],h=e[1],d=e[2]);let p,g,b;e[3]===Symbol.for("react.memo_cache_sentinel")?(p={scale:.8},g={scale:1},b={delay:.2},e[3]=p,e[4]=g,e[5]=b):(p=e[3],g=e[4],b=e[5]);let w;e[6]!==c?(w=_.jsx(Ve.div,{className:"p-4 rounded-full bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",initial:p,animate:g,transition:b,children:_.jsx(c,{className:"text-slate-400 text-2xl"})}),e[6]=c,e[7]=w):w=e[7];let x;e[8]!==n||e[9]!==o?(x=_.jsx("div",{className:"text-center space-y-2",children:n?_.jsxs(_.Fragment,{children:[_.jsxs(Ve.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:[_.jsx(Tle,{className:"text-slate-500 text-xl mx-auto mb-2"}),_.jsx("h3",{className:"text-lg font-semibold text-slate-300",children:o("menu.empty.search_title")})]}),_.jsx(Ve.p,{className:"text-sm text-slate-400",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:_.jsx("span",{className:"font-medium text-slate-300",children:o("menu.empty.search_description",{searchQuery:n})})}),_.jsx(Ve.p,{className:"text-xs text-slate-500",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:o("menu.empty.search_helper")})]}):_.jsxs(_.Fragment,{children:[_.jsx(Ve.h3,{className:"text-lg font-semibold text-slate-300",initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3},children:o("menu.empty.title")}),_.jsx(Ve.p,{className:"text-sm text-slate-400",initial:{opacity:0},animate:{opacity:1},transition:{delay:.4},children:o("menu.empty.description")}),_.jsx(Ve.p,{className:"text-xs text-slate-500",initial:{opacity:0},animate:{opacity:1},transition:{delay:.5},children:o("menu.empty.empty_helper")})]})}),e[8]=n,e[9]=o,e[10]=x):x=e[10];let S;return e[11]!==x||e[12]!==w?(S=_.jsxs(Ve.div,{className:"flex flex-col items-center justify-center py-12 space-y-4",initial:u,animate:h,transition:d,children:[w,x]}),e[11]=x,e[12]=w,e[13]=S):S=e[13],S}function she(t){const e=sn.c(9),{filteredGarages:n,selectedGarage:i,handleGarageSelect:a}=t,{t:s}=Dn();let r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={opacity:1,scale:1},e[0]=r):r=e[0];let o;e[1]!==a||e[2]!==i||e[3]!==s?(o=(h,d)=>_.jsx(Ve.div,{className:fn({"p-3 cursor-pointer transition-all duration-200 hover:bg-slate-600/50":!0,"bg-primary/20 border-l-4 border-primary":i===d,"border-l-4 border-transparent":i!==d}),onClick:()=>a(d),children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg bg-slate-600/50",children:_.jsx(dc,{className:"text-slate-300 text-sm"})}),_.jsxs("div",{className:"flex-1",children:[_.jsx("h4",{className:"text-sm font-medium text-slate-200",children:d}),_.jsx("p",{className:"text-xs text-slate-400",children:s("menu.send_vehicle_modal.garage_description")})]}),i===d&&_.jsx(Ve.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:200,damping:10},className:"p-1 rounded-full bg-primary",children:_.jsx(pm,{className:"text-white text-xs"})})]})},d),e[1]=a,e[2]=i,e[3]=s,e[4]=o):o=e[4];let c;e[5]===Symbol.for("react.memo_cache_sentinel")?(c={height:"100%"},e[5]=c):c=e[5];let u;return e[6]!==n||e[7]!==o?(u=_.jsx(Ve.div,{className:"h-64 rounded-lg border border-slate-500/30 bg-gradient-to-br from-slate-700/50 to-slate-600/50 overflow-hidden",animate:r,children:_.jsx(UA,{data:n,itemContent:o,style:c})}),e[6]=n,e[7]=o,e[8]=u):u=e[8],u}function Sw(t){const e=sn.c(14),{title:n,subtitle:i,className:a}=t,s=n===void 0?"LOADING":n,r=i===void 0?"Preparing...":i,c=`flex items-center space-x-3 ${a===void 0?"":a}`;let u,h,d,p;e[0]===Symbol.for("react.memo_cache_sentinel")?(u={opacity:0,scale:.9},h={opacity:1,scale:1},d={duration:.3},p=_.jsx(Yf,{size:"lg",color:"primary",variant:"gradient"}),e[0]=u,e[1]=h,e[2]=d,e[3]=p):(u=e[0],h=e[1],d=e[2],p=e[3]);let g;e[4]!==s?(g=_.jsx("div",{className:"subtitle",children:s}),e[4]=s,e[5]=g):g=e[5];let b;e[6]!==r?(b=_.jsx("div",{className:"text-slate-300 text-xs",children:r}),e[6]=r,e[7]=b):b=e[7];let w;e[8]!==b||e[9]!==g?(w=_.jsxs("div",{className:"flex flex-col",children:[g,b]}),e[8]=b,e[9]=g,e[10]=w):w=e[10];let x;return e[11]!==w||e[12]!==c?(x=_.jsxs(Ve.div,{className:c,initial:u,animate:h,transition:d,children:[p,w]}),e[11]=w,e[12]=c,e[13]=x):x=e[13],x}function rhe({setVisible:t,onGarageSelect:e}){const{t:n}=Dn(),[i,a]=P.useState(""),[s,r]=P.useState(""),[o,c]=P.useState(!1),{playSound:u}=Pd(),h=bw({queryKey:["garageList"],queryFn:()=>ut("getGarageList"),staleTime:1/0}),d=P.useMemo(()=>s.trim()?h.data?.filter(b=>b.toLowerCase().includes(s.toLowerCase())):h.data,[h.data,s]),p=b=>{a(b),u("preview")},g=async()=>{if(i){c(!0),u("driveVehicle");try{await e(i),t(!1)}catch(b){console.error("Garage selection error:",b)}finally{c(!1)}}};return _.jsx(lh,{children:b=>_.jsxs(_.Fragment,{children:[_.jsx(ch,{className:"flex flex-col gap-1",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",children:_.jsx(dc,{className:"text-slate-300 text-xl"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"text-xl font-semibold text-slate-200 title",children:n("menu.send_vehicle_modal.title")}),_.jsx("p",{className:"text-sm text-slate-400",children:n("menu.send_vehicle_modal.description")})]})]})}),_.jsx(oh,{className:"py-6",children:_.jsxs(Ve.div,{className:"space-y-6",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.send_vehicle_modal.search_placeholder")}),_.jsx(go,{value:s,onChange:w=>r(w.target.value),placeholder:n("menu.send_vehicle_modal.search_placeholder"),className:"rounded-lg",startContent:_.jsx(mm,{className:"text-slate-400"}),autoFocus:!0})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.send_vehicle_modal.list_title")}),h.isLoading?_.jsx(Sw,{}):d?.length===0?_.jsx(YA,{searchQuery:s}):_.jsx(she,{filteredGarages:d||[],selectedGarage:i,handleGarageSelect:p})]})]})}),_.jsx(rv,{className:"pt-4",children:_.jsxs(Ve.div,{className:"flex gap-3 w-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:[_.jsx(Zt,{variant:"flat",color:"danger",startContent:_.jsx(Qp,{}),onPress:b,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.send_vehicle_modal.cancel")}),_.jsx(Zt,{color:"primary",startContent:_.jsx(dc,{}),onPress:g,isLoading:o,isDisabled:!i,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.send_vehicle_modal.send_vehicle")})]})})]})})}function ohe(t){const e=sn.c(11),{filteredPlayers:n,selectedPlayer:i,handlePlayerSelect:a}=t,{t:s}=Dn();let r;if(e[0]!==n||e[1]!==a||e[2]!==i?.id||e[3]!==s){let c;e[5]!==a||e[6]!==i?.id||e[7]!==s?(c=(u,h)=>_.jsx(Ve.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:h*.05},children:_.jsx(js,{isPressable:!0,onPress:()=>a(u),className:fn({"bg-gradient-to-r from-primary-500/20 to-primary-600/20 border-primary-500/50":i?.id===u.id,"bg-gradient-to-r from-slate-700/50 to-slate-600/50 hover:from-slate-600/50 hover:to-slate-500/50":i?.id!==u.id,"w-full":!0}),children:_.jsx(Gr,{className:"p-4",children:_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx(Ve.div,{whileHover:{scale:1.1},transition:{duration:.2},children:_.jsx(Sae,{name:u.name,size:"md",className:"bg-gradient-to-br from-slate-600 to-slate-700 border border-slate-500/30",classNames:{name:"text-slate-200 font-semibold"}})}),_.jsxs("div",{className:"flex flex-col",children:[_.jsx("h4",{className:"text-slate-200 font-semibold text-sm",children:u.name}),_.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[_.jsx(EA,{className:"text-slate-400 text-xs"}),_.jsxs("span",{className:"text-xs text-slate-400",children:["ID: ",u.id]})]})]})]}),_.jsx("div",{className:"flex items-center gap-2",children:i?.id===u.id&&_.jsx(Ve.div,{initial:{scale:0},animate:{scale:1},transition:{duration:.2},children:_.jsx(na,{color:"primary",variant:"flat",size:"sm",startContent:_.jsx(pm,{className:"text-xs"}),className:"animate-pulse",children:s("menu.player_list_modal.selected")})})})]})})})},u.id),e[5]=a,e[6]=i?.id,e[7]=s,e[8]=c):c=e[8],r=n.map(c),e[0]=n,e[1]=a,e[2]=i?.id,e[3]=s,e[4]=r}else r=e[4];let o;return e[9]!==r?(o=_.jsx("div",{className:"space-y-2 max-h-64 overflow-y-auto overflow-x-hidden pr-1",children:r}),e[9]=r,e[10]=o):o=e[10],o}function lhe({setVisible:t,onPlayerSelect:e}){const{t:n}=Dn(),[i,a]=P.useState(null),[s,r]=P.useState(""),[o,c]=P.useState(!1),{playSound:u}=Pd(),h=bw({queryKey:["playerList"],queryFn:()=>ut("getPlayerList"),staleTime:5e3}),d=P.useMemo(()=>s.trim()?h.data?.filter(b=>b.name.toLowerCase().includes(s.toLowerCase())):h.data,[h.data,s]),p=b=>{a(b),u("preview")},g=async()=>{if(i){c(!0),u("driveVehicle");try{await e(i),t(!1)}catch(b){console.error("Player selection error:",b)}finally{c(!1)}}};return _.jsx(lh,{children:b=>_.jsxs(_.Fragment,{children:[_.jsx(ch,{className:"flex flex-col gap-1",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",children:_.jsx(Dle,{className:"text-slate-300 text-xl"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"text-xl font-semibold text-slate-200 title",children:n("menu.player_list_modal.title")}),_.jsx("p",{className:"text-sm text-slate-400",children:n("menu.player_list_modal.description")})]})]})}),_.jsx(oh,{className:"py-6",children:_.jsxs(Ve.div,{className:"space-y-6",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},children:[_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.player_list_modal.search_placeholder")}),_.jsx(go,{value:s,onChange:w=>r(w.target.value),placeholder:n("menu.player_list_modal.search_placeholder"),className:"rounded-lg",startContent:_.jsx(mm,{className:"text-slate-400"}),autoFocus:!0})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.player_list_modal.list_title")}),_.jsx(na,{color:"primary",variant:"flat",size:"sm",startContent:_.jsx(EA,{className:"text-xs"}),children:n("menu.player_list_modal.list_description",{count:d?.length})})]}),h.isLoading?_.jsx(Sw,{}):d?.length===0?_.jsx(YA,{searchQuery:s}):_.jsx(ohe,{filteredPlayers:d||[],selectedPlayer:i,handlePlayerSelect:p})]})]})}),_.jsx(rv,{className:"pt-4",children:_.jsxs(Ve.div,{className:"flex gap-3 w-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:[_.jsx(Zt,{variant:"flat",color:"danger",startContent:_.jsx(Qp,{}),onPress:b,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.player_list_modal.cancel")}),_.jsx(Zt,{color:"primary",startContent:_.jsx(pm,{}),onPress:g,isLoading:o,isDisabled:!i,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.player_list_modal.transfer_vehicle")})]})})]})})}function che(){const t=sn.c(13),{t:e}=Dn();let n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=_.jsx("div",{className:"p-4 rounded-full bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",children:_.jsx(dc,{className:"text-slate-300 text-2xl"})}),t[0]=n):n=t[0];let i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=_.jsx(Yf,{color:"primary",size:"lg",classNames:{circle1:"border-b-slate-300",circle2:"border-b-slate-300"}}),t[1]=i):i=t[1];let a;t[2]!==e?(a=e("menu.out_vehicles_modal.loading"),t[2]=e,t[3]=a):a=t[3];let s;t[4]!==a?(s=_.jsx("p",{className:"text-sm text-slate-400 font-medium",children:a}),t[4]=a,t[5]=s):s=t[5];let r;t[6]!==e?(r=e("menu.out_vehicles_modal.loading_helper"),t[6]=e,t[7]=r):r=t[7];let o;t[8]!==r?(o=_.jsx("p",{className:"text-xs text-slate-500",children:r}),t[8]=r,t[9]=o):o=t[9];let c;return t[10]!==s||t[11]!==o?(c=_.jsxs("div",{className:"flex flex-col items-center justify-center py-12 space-y-4",children:[n,_.jsxs("div",{className:"text-center space-y-2",children:[i,s,o]})]}),t[10]=s,t[11]=o,t[12]=c):c=t[12],c}const uhe=t=>{const e=sn.c(28),{vehicle:n,isSelected:i,onSelect:a}=t,{t:s}=Dn();let r;e[0]!==a||e[1]!==n?(r=()=>a(n),e[0]=a,e[1]=n,e[2]=r):r=e[2];const o=!i;let c;e[3]!==i||e[4]!==o?(c=fn({"bg-gradient-to-r from-primary-500/20 to-primary-600/20 border-primary-500/50":i,"bg-gradient-to-r from-slate-700/50 to-slate-600/50 hover:from-slate-600/50 hover:to-slate-500/50":o,"w-full transition-all duration-200":!0}),e[3]=i,e[4]=o,e[5]=c):c=e[5];let u;e[6]===Symbol.for("react.memo_cache_sentinel")?(u=_.jsx("div",{className:"w-12 h-12 rounded-lg bg-gradient-to-br from-slate-600 to-slate-700 border border-slate-500/30 flex items-center justify-center",children:_.jsx(dc,{className:"text-slate-300 text-lg"})}),e[6]=u):u=e[6];let h;e[7]!==n.id||e[8]!==n.name?(h=_.jsxs("h4",{className:"text-slate-200 font-semibold text-sm",children:[n.name," (",n.id,")"]}),e[7]=n.id,e[8]=n.name,e[9]=h):h=e[9];let d;e[10]===Symbol.for("react.memo_cache_sentinel")?(d=_.jsx(wA,{className:"text-slate-400 text-xs"}),e[10]=d):d=e[10];let p;e[11]!==n.brand?(p=_.jsxs("div",{className:"flex items-center gap-1 mt-1",children:[d,_.jsx("span",{className:"text-xs text-slate-400",children:n.brand})]}),e[11]=n.brand,e[12]=p):p=e[12];let g;e[13]!==h||e[14]!==p?(g=_.jsxs("div",{className:"flex items-center gap-3",children:[u,_.jsxs("div",{className:"flex flex-col",children:[h,p]})]}),e[13]=h,e[14]=p,e[15]=g):g=e[15];let b;e[16]!==i||e[17]!==s?(b=i&&_.jsx(na,{color:"primary",variant:"flat",size:"sm",startContent:_.jsx(pm,{className:"text-xs"}),className:"animate-pulse",children:s("menu.out_vehicles_modal.selected")}),e[16]=i,e[17]=s,e[18]=b):b=e[18];let w;e[19]!==b?(w=_.jsx("div",{className:"flex items-center gap-2",children:b}),e[19]=b,e[20]=w):w=e[20];let x;e[21]!==w||e[22]!==g?(x=_.jsx(Gr,{className:"p-4",children:_.jsxs("div",{className:"flex items-center justify-between",children:[g,w]})}),e[21]=w,e[22]=g,e[23]=x):x=e[23];let S;return e[24]!==r||e[25]!==x||e[26]!==c?(S=_.jsx("div",{className:"mb-2",children:_.jsx(js,{isPressable:!0,onPress:r,className:c,children:x})}),e[24]=r,e[25]=x,e[26]=c,e[27]=S):S=e[27],S};function dhe(t){const e=sn.c(7),{filteredVehicles:n,selectedVehicle:i,handleVehicleSelect:a}=t;let s;e[0]!==a||e[1]!==i?.id?(s=(c,u)=>_.jsx(uhe,{vehicle:u,isSelected:i?.id===u.id,onSelect:a}),e[0]=a,e[1]=i?.id,e[2]=s):s=e[2];let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r={height:"100%"},e[3]=r):r=e[3];let o;return e[4]!==n||e[5]!==s?(o=_.jsx("div",{className:"h-64",children:_.jsx(UA,{data:n,itemContent:s,className:"overflow-x-hidden",style:r})}),e[4]=n,e[5]=s,e[6]=o):o=e[6],o}function fhe({setVisible:t,onVehicleSelect:e}){const{t:n}=Dn(),i=bw({queryKey:["outVehiclesList"],queryFn:()=>ut("getOutVehiclesList")}),[a,s]=P.useState(null),[r,o]=P.useState(""),[c,u]=P.useState(!1),{playSound:h}=Pd(),d=P.useMemo(()=>r.trim()?i.data?.filter(b=>b.name.toLowerCase().includes(r.toLowerCase())||b.brand.toLowerCase().includes(r.toLowerCase())):i.data,[i.data,r]),p=b=>{s(b),h("preview")},g=async()=>{if(a){u(!0),h("driveVehicle");try{await e(a),t(!1)}catch(b){console.error("Vehicle selection error:",b)}finally{u(!1)}}};return _.jsx(lh,{children:b=>_.jsxs(_.Fragment,{children:[_.jsx(ch,{className:"flex flex-col gap-1",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg bg-gradient-to-br from-slate-600/50 to-slate-700/50 border border-slate-500/30",children:_.jsx(dc,{className:"text-slate-300 text-xl"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"text-xl font-semibold text-slate-200 title",children:n("menu.out_vehicles_modal.title")}),_.jsx("p",{className:"text-sm text-slate-400",children:n("menu.out_vehicles_modal.description")})]})]})}),_.jsx(oh,{className:"py-6",children:_.jsxs("div",{className:"space-y-6",children:[_.jsxs("div",{className:"space-y-3",children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.out_vehicles_modal.search_placeholder")}),_.jsx(go,{value:r,onChange:w=>o(w.target.value),placeholder:n("menu.out_vehicles_modal.search_placeholder"),className:"rounded-lg",startContent:_.jsx(mm,{className:"text-slate-400"}),autoFocus:!0})]}),_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("label",{className:"text-sm font-medium text-slate-300",children:n("menu.out_vehicles_modal.list_title")}),_.jsx(na,{color:"primary",variant:"flat",size:"sm",startContent:_.jsx(dc,{className:"text-xs"}),children:n("menu.out_vehicles_modal.list_description",{count:d?.length})})]}),i.isLoading?_.jsx(che,{}):d?.length===0?_.jsx(YA,{searchQuery:r}):_.jsx(dhe,{filteredVehicles:d||[],selectedVehicle:a,handleVehicleSelect:p})]})]})}),_.jsx(rv,{className:"pt-4",children:_.jsxs("div",{className:"flex gap-3 w-full",children:[_.jsx(Zt,{variant:"flat",color:"danger",startContent:_.jsx(Qp,{}),onPress:b,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.out_vehicles_modal.cancel")}),_.jsx(Zt,{color:"primary",startContent:_.jsx(pm,{}),onPress:g,isLoading:c,isDisabled:!a,className:"flex-1 item-slot border border-slate-500/30",children:n("menu.out_vehicles_modal.bring_vehicle")})]})})]})})}function Up(t){const e=sn.c(12),{isOpen:n,onOpenChange:i,children:a,onClose:s,size:r,hideCloseButton:o}=t;let c;e[0]!==i?(c=g=>{ut("play_sound",g?"item_down":"hover_up"),i?.(g)},e[0]=i,e[1]=c):c=e[1];const u=r||"2xl",h=`!bg-gradient-to-br from-slate-900 via-slate-800 to-slate-900 ${!r&&"2xl:max-h-[70vh] xl:max-h-[70vh] max-w-[95%] h-[95%] min-w-[95%] max-h-[95%] min-h-[95%]"} ${r==="xl"?"max-w-[50%]":""}`;let d;e[2]!==h?(d={base:h,backdrop:"bg-blue-500/10",wrapper:"overflow-hidden"},e[2]=h,e[3]=d):d=e[3];let p;return e[4]!==a||e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==c||e[9]!==u||e[10]!==d?(p=_.jsx(Ej,{isOpen:n,onClose:s,onOpenChange:c,backdrop:"opaque",size:u,scrollBehavior:"inside",classNames:d,hideCloseButton:o,children:a}),e[4]=a,e[5]=o,e[6]=n,e[7]=s,e[8]=c,e[9]=u,e[10]=d,e[11]=p):p=e[11],p}const hhe={hidden:{opacity:0,y:-30},visible:{opacity:1,y:0,transition:{duration:.8,ease:"easeOut",staggerChildren:.1}},exit:{opacity:0,y:-20,transition:{duration:.3,ease:"easeIn"}}},T7={hidden:{opacity:0,y:20},visible:{opacity:1,y:0,transition:{duration:.5,ease:"easeOut"}},exit:{opacity:0,y:10,transition:{duration:.2,ease:"easeIn"}}},phe={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1,transition:{duration:.4,ease:"easeOut"}},exit:{opacity:0,scale:.9,transition:{duration:.2,ease:"easeIn"}}};function C7(t){const e=sn.c(197),{vehicle:n,vehicleCount:i,currentIndex:a,isInspectMode:s,isJobGarage:r}=t,o=i===void 0?0:i,c=a===void 0?0:a,u=s===void 0?!1:s,[h,d]=P.useState(!1),[p,g]=P.useState(!1),[b,w]=P.useState(!1),[x,S]=P.useState(!1),M=Wr(ihe),C=Wr(gH),{playSound:A}=Pd(),N=vi(vr),R=vi(wd),{t:D}=Dn(),B=N.intl.locales,z=N.intl.options;let I,U,$,G,k,X,V,H,W,J,Y,K,ee,ie,Z,ue,se,ae,ce,pe,ye;if(e[0]!==N.enabledButtons||e[1]!==N.impoundPrice||e[2]!==N.intl.locales||e[3]!==N.intl.options||e[4]!==N.transferPrice||e[5]!==c||e[6]!==u||e[7]!==r||e[8]!==R.balance||e[9]!==R.isImpound||e[10]!==A||e[11]!==M||e[12]!==D||e[13]!==C||e[14]!==n||e[15]!==o){se=Symbol.for("react.early_return_sentinel");e:{const we=new Intl.NumberFormat(B,z);let Ce;e[37]!==A||e[38]!==D||e[39]!==C||e[40]!==n?(Ce=()=>{const Xt=n?.favorite===1?0:1;A("favorite"),ut("setVehicleFav",{fav:Xt,plate:n?.plate}),qa(D(Xt===1?"menu.header.marked_as_favorite":"menu.header.unmarked_as_favorite"),"success"),n&&C({...n,favorite:Xt})},e[37]=A,e[38]=D,e[39]=C,e[40]=n,e[41]=Ce):Ce=e[41];const Ie=Ce;let Pe;e[42]!==A?(Pe=()=>{d(!0),A("openModal")},e[42]=A,e[43]=Pe):Pe=e[43];const Ze=Pe;let We;e[44]!==A?(We=()=>{g(!0),A("openModal")},e[44]=A,e[45]=We):We=e[45];const mt=We;let nt;e[46]!==A?(nt=()=>{w(!0),A("openModal")},e[46]=A,e[47]=nt):nt=e[47];const Ye=nt;let Je;e[48]!==A?(Je=()=>{S(!0),A("openModal")},e[48]=A,e[49]=Je):Je=e[49];const jt=Je;let wt;e[50]!==N.transferPrice||e[51]!==A||e[52]!==M||e[53]!==D||e[54]!==n?(wt=async Xt=>{if(!n)return console.error("No vehicle selected",n);if(A("driveVehicle"),!await ut("existMoney",N.transferPrice))return qa(D("menu.header.money_not_enough",{price:N.transferPrice}),"error");if(!await ut("existAvailableSlot",{garage:Xt}))return qa(D("menu.header.no_slot_available"),"error");await ut("transferVehicle",{plate:n.plate,garage:Xt}),qa(D("menu.header.vehicle_transfer_success",{garage:Xt}),"success"),M(n)},e[50]=N.transferPrice,e[51]=A,e[52]=M,e[53]=D,e[54]=n,e[55]=wt):wt=e[55],X=wt;let Et;e[56]!==N.transferPrice||e[57]!==M||e[58]!==D||e[59]!==n?(Et=async Xt=>{if(!n)return console.error("Vehicle not found",n);if(!await ut("existMoney",N.transferPrice)){qa(D("menu.header.money_not_enough",{price:N.transferPrice}),"error");return}if(!await ut("transferVehicleToPlayer",{plate:n?.plate,playerId:Xt.id}))return console.error("Vehicle transfer failed",n);M(n),qa(D("menu.header.vehicle_transfer_player_success",{plate:n.plate,player:Xt.name}),"success")},e[56]=N.transferPrice,e[57]=M,e[58]=D,e[59]=n,e[60]=Et):Et=e[60],k=Et;let zt;if(e[61]!==N.impoundPrice||e[62]!==D?(zt=async Xt=>{if(!await ut("existMoney",N.impoundPrice))return qa(D("menu.header.money_not_enough",{price:N.impoundPrice}),"error");if(!await ut("existAvailableSlot",{}))return qa(D("menu.header.no_slot_available"),"error");await ut("takeVehicleFromOut",{plate:Xt.id}),qa(D("menu.header.vehicle_brought",{vehicle:Xt.name}),"success")},e[61]=N.impoundPrice,e[62]=D,e[63]=zt):zt=e[63],G=zt,u){let Xt,rn,ge;e[64]===Symbol.for("react.memo_cache_sentinel")?(Xt={opacity:0,y:-10},rn={opacity:1,y:0},ge={delay:.1,duration:.3},e[64]=Xt,e[65]=rn,e[66]=ge):(Xt=e[64],rn=e[65],ge=e[66]);let Se;e[67]!==D?(Se=D("menu.header.total_vehicles"),e[67]=D,e[68]=Se):Se=e[68];const De=`${c+1}/${o}`;let lt;e[69]!==Se||e[70]!==De||e[71]!==o?(lt=_.jsx(o_,{icon:dc,value:o,label:Se,badgeValue:De}),e[69]=Se,e[70]=De,e[71]=o,e[72]=lt):lt=e[72];let rt;e[73]===Symbol.for("react.memo_cache_sentinel")?(rt=_.jsx(pg,{orientation:"vertical",className:"h-8 bg-gradient-to-b from-transparent via-slate-500/30 to-transparent"}),e[73]=rt):rt=e[73];const Bt=n?.favorite===1;let Ut;e[74]!==Bt?(Ut=_.jsx(M7,{isFavorite:Bt}),e[74]=Bt,e[75]=Ut):Ut=e[75];let Dt;e[76]===Symbol.for("react.memo_cache_sentinel")?(Dt=_.jsx(pg,{orientation:"vertical",className:"h-8 bg-gradient-to-b from-transparent via-slate-500/30 to-transparent"}),e[76]=Dt):Dt=e[76];const ot=R.balance;let Lt;e[77]!==D?(Lt=D("menu.header.balance_title"),e[77]=D,e[78]=Lt):Lt=e[78];let vt;e[79]!==D?(vt=D("menu.header.balance_badge"),e[79]=D,e[80]=vt):vt=e[80];let Ot;e[81]!==R.balance||e[82]!==Lt||e[83]!==vt?(Ot=_.jsx(o_,{icon:o1,value:ot,label:Lt,badgeValue:vt,badgeColor:"bg-emerald-600/80",iconColor:"text-emerald-400"}),e[81]=R.balance,e[82]=Lt,e[83]=vt,e[84]=Ot):Ot=e[84];let Mt;e[85]!==lt||e[86]!==Ut||e[87]!==Ot?(Mt=_.jsx(Ve.header,{variants:phe,initial:"hidden",animate:"visible",exit:"exit",className:"w-full flex justify-center items-center",children:_.jsxs(Ve.div,{className:"flex items-center gap-4 item-slot rounded-xl p-3 border border-slate-500/20 shadow-xl bg-black/40 backdrop-blur-sm",initial:Xt,animate:rn,transition:ge,children:[lt,rt,Ut,Dt,Ot]})}),e[85]=lt,e[86]=Ut,e[87]=Ot,e[88]=Mt):Mt=e[88],se=Mt;break e}$=Ve.header,Y=hhe,K="hidden",ee="visible",ie="exit",Z="w-full flex flex-col lg:flex-row justify-between items-center gap-6";let Te;e[89]!==N.enabledButtons.favorite||e[90]!==Ie||e[91]!==r||e[92]!==R.isImpound||e[93]!==D||e[94]!==n?(Te=N.enabledButtons.favorite&&_.jsx(Qy,{icon:_.jsx(wA,{className:"text-amber-400/80"}),text:D("menu.header.set_star"),onClick:Ie,disabled:!n||R.isImpound||r}),e[89]=N.enabledButtons.favorite,e[90]=Ie,e[91]=r,e[92]=R.isImpound,e[93]=D,e[94]=n,e[95]=Te):Te=e[95];let pt;e[96]!==N.enabledButtons.tag||e[97]!==Ze||e[98]!==r||e[99]!==R.isImpound||e[100]!==D||e[101]!==n?(pt=N.enabledButtons.tag&&_.jsx(Qy,{icon:_.jsx(mg,{className:"text-slate-300/80"}),text:D("menu.header.set_tag"),onClick:Ze,disabled:!n||R.isImpound||r}),e[96]=N.enabledButtons.tag,e[97]=Ze,e[98]=r,e[99]=R.isImpound,e[100]=D,e[101]=n,e[102]=pt):pt=e[102];let at;e[103]!==N.enabledButtons.send||e[104]!==mt||e[105]!==r||e[106]!==R.isImpound||e[107]!==D||e[108]!==n?(at=N.enabledButtons.send&&_.jsx(Qy,{icon:_.jsx(Mle,{className:"text-emerald-400/80"}),text:D("menu.header.send_vehicle"),onClick:mt,disabled:!n||R.isImpound||r}),e[103]=N.enabledButtons.send,e[104]=mt,e[105]=r,e[106]=R.isImpound,e[107]=D,e[108]=n,e[109]=at):at=e[109];let St;e[110]!==N.enabledButtons.transfer||e[111]!==Ye||e[112]!==r||e[113]!==R.isImpound||e[114]!==D||e[115]!==n?(St=N.enabledButtons.transfer&&_.jsx(Qy,{icon:_.jsx(EA,{className:"text-violet-400/80"}),text:D("menu.header.transfer_vehicle"),onClick:Ye,disabled:!n||R.isImpound||r}),e[110]=N.enabledButtons.transfer,e[111]=Ye,e[112]=r,e[113]=R.isImpound,e[114]=D,e[115]=n,e[116]=St):St=e[116];let ct;e[117]!==N.enabledButtons.bring||e[118]!==jt||e[119]!==r||e[120]!==R.isImpound||e[121]!==D?(ct=N.enabledButtons.bring&&_.jsx(Qy,{icon:_.jsx(Nle,{className:"text-blue-400/80"}),text:D("menu.header.bring_vehicle"),onClick:jt,disabled:R.isImpound||r}),e[117]=N.enabledButtons.bring,e[118]=jt,e[119]=r,e[120]=R.isImpound,e[121]=D,e[122]=ct):ct=e[122],e[123]!==Te||e[124]!==pt||e[125]!==at||e[126]!==St||e[127]!==ct?(ue=_.jsxs(Ve.div,{variants:T7,className:"w-full lg:w-auto flex flex-wrap justify-center lg:justify-start self-start gap-3",children:[Te,pt,at,St,ct]}),e[123]=Te,e[124]=pt,e[125]=at,e[126]=St,e[127]=ct,e[128]=ue):ue=e[128],U=Ve.div,pe=T7,ye="flex items-center gap-6 item-slot rounded-xl p-4 border border-slate-500/20 shadow-xl";let it;e[129]!==D?(it=D("menu.header.total_vehicles"),e[129]=D,e[130]=it):it=e[130];const Nt=`${c+1}/${o}`;e[131]!==it||e[132]!==Nt||e[133]!==o?(V=_.jsx(o_,{icon:dc,value:o,label:it,badgeValue:Nt}),e[131]=it,e[132]=Nt,e[133]=o,e[134]=V):V=e[134],e[135]===Symbol.for("react.memo_cache_sentinel")?(H=_.jsx(pg,{orientation:"vertical",className:"h-12 bg-gradient-to-b from-transparent via-slate-500/30 to-transparent"}),e[135]=H):H=e[135];const kt=n?.favorite===1;e[136]!==kt?(W=_.jsx(M7,{isFavorite:kt}),e[136]=kt,e[137]=W):W=e[137],e[138]===Symbol.for("react.memo_cache_sentinel")?(J=_.jsx(pg,{orientation:"vertical",className:"h-12 bg-gradient-to-b from-transparent via-slate-500/30 to-transparent"}),e[138]=J):J=e[138],I=o_,ae=o1,ce=we.format(R.balance)}e[0]=N.enabledButtons,e[1]=N.impoundPrice,e[2]=N.intl.locales,e[3]=N.intl.options,e[4]=N.transferPrice,e[5]=c,e[6]=u,e[7]=r,e[8]=R.balance,e[9]=R.isImpound,e[10]=A,e[11]=M,e[12]=D,e[13]=C,e[14]=n,e[15]=o,e[16]=I,e[17]=U,e[18]=$,e[19]=G,e[20]=k,e[21]=X,e[22]=V,e[23]=H,e[24]=W,e[25]=J,e[26]=Y,e[27]=K,e[28]=ee,e[29]=ie,e[30]=Z,e[31]=ue,e[32]=se,e[33]=ae,e[34]=ce,e[35]=pe,e[36]=ye}else I=e[16],U=e[17],$=e[18],G=e[19],k=e[20],X=e[21],V=e[22],H=e[23],W=e[24],J=e[25],Y=e[26],K=e[27],ee=e[28],ie=e[29],Z=e[30],ue=e[31],se=e[32],ae=e[33],ce=e[34],pe=e[35],ye=e[36];if(se!==Symbol.for("react.early_return_sentinel"))return se;let _e;e[139]!==D?(_e=D("menu.header.balance_title"),e[139]=D,e[140]=_e):_e=e[140];let me;e[141]!==D?(me=D("menu.header.balance_badge"),e[141]=D,e[142]=me):me=e[142];let ne;e[143]!==I||e[144]!==_e||e[145]!==me||e[146]!==ae||e[147]!==ce?(ne=_.jsx(I,{icon:ae,value:ce,label:_e,badgeValue:me,badgeColor:"bg-emerald-600/80",iconColor:"text-emerald-400"}),e[143]=I,e[144]=_e,e[145]=me,e[146]=ae,e[147]=ce,e[148]=ne):ne=e[148];let be;e[149]!==U||e[150]!==V||e[151]!==H||e[152]!==W||e[153]!==J||e[154]!==ne||e[155]!==pe||e[156]!==ye?(be=_.jsxs(U,{variants:pe,className:ye,children:[V,H,W,J,ne]}),e[149]=U,e[150]=V,e[151]=H,e[152]=W,e[153]=J,e[154]=ne,e[155]=pe,e[156]=ye,e[157]=be):be=e[157];let xe;e[158]!==$||e[159]!==Y||e[160]!==K||e[161]!==ee||e[162]!==ie||e[163]!==Z||e[164]!==ue||e[165]!==be?(xe=_.jsxs($,{variants:Y,initial:K,animate:ee,exit:ie,className:Z,children:[ue,be]}),e[158]=$,e[159]=Y,e[160]=K,e[161]=ee,e[162]=ie,e[163]=Z,e[164]=ue,e[165]=be,e[166]=xe):xe=e[166];let he;e[167]!==h||e[168]!==n?(he=h&&_.jsx(ahe,{setVisible:d,vehicle:n}),e[167]=h,e[168]=n,e[169]=he):he=e[169];let ve;e[170]!==he||e[171]!==h?(ve=_.jsx(Up,{isOpen:h,onOpenChange:d,size:"2xl",children:he}),e[170]=he,e[171]=h,e[172]=ve):ve=e[172];let Oe;e[173]!==X||e[174]!==p?(Oe=p&&_.jsx(rhe,{setVisible:g,onGarageSelect:X}),e[173]=X,e[174]=p,e[175]=Oe):Oe=e[175];let Le;e[176]!==p||e[177]!==Oe?(Le=_.jsx(Up,{isOpen:p,onOpenChange:g,size:"2xl",children:Oe}),e[176]=p,e[177]=Oe,e[178]=Le):Le=e[178];let Ae;e[179]!==k||e[180]!==b?(Ae=b&&_.jsx(lhe,{setVisible:w,onPlayerSelect:k}),e[179]=k,e[180]=b,e[181]=Ae):Ae=e[181];let et;e[182]!==b||e[183]!==Ae?(et=_.jsx(Up,{isOpen:b,onOpenChange:w,size:"2xl",children:Ae}),e[182]=b,e[183]=Ae,e[184]=et):et=e[184];let tt;e[185]!==G||e[186]!==x?(tt=x&&_.jsx(fhe,{setVisible:S,onVehicleSelect:G}),e[185]=G,e[186]=x,e[187]=tt):tt=e[187];let re;e[188]!==x||e[189]!==tt?(re=_.jsx(Up,{isOpen:x,onOpenChange:S,size:"2xl",children:tt}),e[188]=x,e[189]=tt,e[190]=re):re=e[190];let te;return e[191]!==xe||e[192]!==ve||e[193]!==Le||e[194]!==et||e[195]!==re?(te=_.jsxs(_.Fragment,{children:[xe,ve,Le,et,re]}),e[191]=xe,e[192]=ve,e[193]=Le,e[194]=et,e[195]=re,e[196]=te):te=e[196],te}const mhe={blue:"bg-blue-500/20 border-blue-400/30 text-blue-400",purple:"bg-purple-500/20 border-purple-400/30 text-purple-400",green:"bg-green-500/20 border-green-400/30 text-green-400",red:"bg-red-500/20 border-red-400/30 text-red-400"};function ghe(t){const e=sn.c(14),{keyContent:n,text:i,description:a,color:s,onClick:r}=t,o=`flex items-center justify-center w-10 h-10 rounded-md border text-lg font-bold ${mhe[s]}`;let c;e[0]!==n||e[1]!==o?(c=_.jsx("div",{className:o,children:n}),e[0]=n,e[1]=o,e[2]=c):c=e[2];let u;e[3]!==i?(u=_.jsx("span",{className:"text-white font-medium text-sm",children:i}),e[3]=i,e[4]=u):u=e[4];let h;e[5]!==a?(h=_.jsx("span",{className:"text-slate-400 text-xs",children:a}),e[5]=a,e[6]=h):h=e[6];let d;e[7]!==u||e[8]!==h?(d=_.jsxs("div",{className:"flex flex-col",children:[u,h]}),e[7]=u,e[8]=h,e[9]=d):d=e[9];let p;return e[10]!==r||e[11]!==c||e[12]!==d?(p=_.jsxs(Zt,{onPress:r,className:"flex items-center gap-3 py-8 text-left rounded-lg item-slot hoverable transition-colors",children:[c,d]}),e[10]=r,e[11]=c,e[12]=d,e[13]=p):p=e[13],p}const vhe={hidden:{opacity:0,scale:.9},visible:{opacity:1,scale:1,transition:{duration:.3}}};function A7(t){const e=sn.c(5),{shortcuts:n,className:i}=t,s=`flex items-center gap-6 ${i===void 0?"":i}`;let r;e[0]!==n?(r=n.map(yhe),e[0]=n,e[1]=r):r=e[1];let o;return e[2]!==s||e[3]!==r?(o=_.jsx(Ve.div,{className:s,variants:vhe,children:r}),e[2]=s,e[3]=r,e[4]=o):o=e[4],o}function yhe(t,e){return _.jsx(ghe,{keyContent:t.keyContent,text:t.text,description:t.description,color:t.color,onClick:t.onClick},e)}function R7(t){const e=sn.c(61),{onInspect:n,onMusic:i,onPreviousVehicle:a,onNextVehicle:s,onClose:r,canGoPrevious:o,canGoNext:c}=t,{t:u}=Dn();zp("ArrowRight",a,!1),zp("ArrowLeft",s,!1),zp("P",i,!1),zp("F9",n,!1);let h;e[0]===Symbol.for("react.memo_cache_sentinel")?(h=_.jsx(_le,{}),e[0]=h):h=e[0];let d;e[1]!==u?(d=u("menu.footer.previous_vehicle"),e[1]=u,e[2]=d):d=e[2];let p;e[3]!==u?(p=u("menu.footer.previous_vehicle_description"),e[3]=u,e[4]=p):p=e[4];const g=!o;let b;e[5]!==a||e[6]!==d||e[7]!==p||e[8]!==g?(b={keyContent:h,text:d,description:p,color:"blue",onClick:a,disabled:g},e[5]=a,e[6]=d,e[7]=p,e[8]=g,e[9]=b):b=e[9];let w;e[10]===Symbol.for("react.memo_cache_sentinel")?(w=_.jsx(Sle,{}),e[10]=w):w=e[10];let x;e[11]!==u?(x=u("menu.footer.next_vehicle"),e[11]=u,e[12]=x):x=e[12];let S;e[13]!==u?(S=u("menu.footer.next_vehicle_description"),e[13]=u,e[14]=S):S=e[14];const M=!c;let C;e[15]!==s||e[16]!==x||e[17]!==S||e[18]!==M?(C={keyContent:w,text:x,description:S,color:"blue",onClick:s,disabled:M},e[15]=s,e[16]=x,e[17]=S,e[18]=M,e[19]=C):C=e[19];let A;e[20]!==C||e[21]!==b?(A=[b,C],e[20]=C,e[21]=b,e[22]=A):A=e[22];const N=A;let R;e[23]!==u?(R=u("menu.footer.preview_mode"),e[23]=u,e[24]=R):R=e[24];let D;e[25]!==u?(D=u("menu.footer.preview_mode_description"),e[25]=u,e[26]=D):D=e[26];let B;e[27]!==n||e[28]!==R||e[29]!==D?(B={keyContent:"F9",text:R,description:D,color:"purple",onClick:n},e[27]=n,e[28]=R,e[29]=D,e[30]=B):B=e[30];let z;e[31]!==u?(z=u("menu.footer.music_mode"),e[31]=u,e[32]=z):z=e[32];let I;e[33]!==u?(I=u("menu.footer.music_mode_description"),e[33]=u,e[34]=I):I=e[34];let U;e[35]!==i||e[36]!==z||e[37]!==I?(U={keyContent:"P",text:z,description:I,color:"green",onClick:i},e[35]=i,e[36]=z,e[37]=I,e[38]=U):U=e[38];let $;e[39]!==u?($=u("menu.footer.exit_garage"),e[39]=u,e[40]=$):$=e[40];let G;e[41]!==u?(G=u("menu.footer.exit_garage_description"),e[41]=u,e[42]=G):G=e[42];let k;e[43]!==r||e[44]!==$||e[45]!==G?(k={keyContent:"ESC",text:$,description:G,color:"red",onClick:r},e[43]=r,e[44]=$,e[45]=G,e[46]=k):k=e[46];let X;e[47]!==B||e[48]!==U||e[49]!==k?(X=[B,U,k],e[47]=B,e[48]=U,e[49]=k,e[50]=X):X=e[50];const V=X;let H;e[51]===Symbol.for("react.memo_cache_sentinel")?(H={opacity:0,y:20},e[51]=H):H=e[51];let W;e[52]===Symbol.for("react.memo_cache_sentinel")?(W={hidden:H,visible:{opacity:1,y:0,transition:{duration:.5,staggerChildren:.1}}},e[52]=W):W=e[52];let J;e[53]!==N?(J=_.jsx(A7,{shortcuts:N}),e[53]=N,e[54]=J):J=e[54];let Y;e[55]===Symbol.for("react.memo_cache_sentinel")?(Y=_.jsx("div",{className:"flex-1"}),e[55]=Y):Y=e[55];let K;e[56]!==V?(K=_.jsx(A7,{shortcuts:V}),e[56]=V,e[57]=K):K=e[57];let ee;return e[58]!==J||e[59]!==K?(ee=_.jsx(Ve.footer,{className:"w-full",variants:W,initial:"hidden",animate:"visible",children:_.jsxs("div",{className:"flex items-center justify-between h-full",children:[J,Y,K]})}),e[58]=J,e[59]=K,e[60]=ee):ee=e[60],ee}function vH(t){const e=sn.c(33),{stats:n}=t;let i,a,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={opacity:0,y:-20},a={opacity:1,y:0},s={duration:.5},e[0]=i,e[1]=a,e[2]=s):(i=e[0],a=e[1],s=e[2]);let r,o,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(r={opacity:0,x:-20},o={opacity:1,x:0},c={duration:.5,delay:.2},e[3]=r,e[4]=o,e[5]=c):(r=e[3],o=e[4],c=e[5]);const u=n?.brand;let h;e[6]!==u?(h=_.jsx(Ve.h1,{className:"!text-4xl font-semibold uppercase title text-white",initial:r,animate:o,transition:c,children:u}),e[6]=u,e[7]=h):h=e[7];let d,p,g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g={opacity:0,x:-20},d={opacity:1,x:0},p={duration:.5,delay:.4},e[8]=d,e[9]=p,e[10]=g):(d=e[8],p=e[9],g=e[10]);const b=n?.name;let w;e[11]!==b?(w=_.jsx(Ve.a,{className:"text-slate-300 text-xl font-bold",initial:g,animate:d,transition:p,children:b}),e[11]=b,e[12]=w):w=e[12];let x;e[13]!==w||e[14]!==h?(x=_.jsxs("div",{className:"flex flex-col justify-center",children:[h,w]}),e[13]=w,e[14]=h,e[15]=x):x=e[15];let S,M,C;e[16]===Symbol.for("react.memo_cache_sentinel")?(S={opacity:0,x:20},M={opacity:1,x:0},C={duration:.5,delay:.4},e[16]=S,e[17]=M,e[18]=C):(S=e[16],M=e[17],C=e[18]);let A,N,R,D,B,z;e[19]===Symbol.for("react.memo_cache_sentinel")?(A=_.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-white via-gray-50 to-gray-100 rounded-md"}),N=_.jsx("div",{className:"absolute inset-0 border-2 border-gray-400 rounded-md"}),R=_.jsx("div",{className:"absolute top-1 left-1 w-2 h-2 bg-gray-500 rounded-full shadow-sm"}),D=_.jsx("div",{className:"absolute top-1 right-1 w-2 h-2 bg-gray-500 rounded-full shadow-sm"}),B=_.jsx("div",{className:"absolute bottom-1 left-1 w-2 h-2 bg-gray-500 rounded-full shadow-sm"}),z=_.jsx("div",{className:"absolute bottom-1 right-1 w-2 h-2 bg-gray-500 rounded-full shadow-sm"}),e[19]=A,e[20]=N,e[21]=R,e[22]=D,e[23]=B,e[24]=z):(A=e[19],N=e[20],R=e[21],D=e[22],B=e[23],z=e[24]);const I=n?.plate||"ABC123";let U;e[25]!==I?(U=_.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:_.jsx("span",{className:"text-gray-800 text-2xl font-bold tracking-wider uppercase select-none",children:I})}),e[25]=I,e[26]=U):U=e[26];let $;e[27]===Symbol.for("react.memo_cache_sentinel")?($=_.jsx("div",{className:"absolute inset-0 bg-gradient-to-b from-transparent via-transparent to-gray-300/20 rounded-md"}),e[27]=$):$=e[27];let G;e[28]!==U?(G=_.jsx(Ve.div,{className:"flex flex-col items-center justify-center w-[35%]",initial:S,animate:M,transition:C,children:_.jsxs("div",{className:"relative w-full max-w-[200px] h-[60px] bg-gradient-to-b from-white via-gray-50 to-gray-100 border-2 border-gray-300 rounded-md shadow-lg transform transition-transform duration-300",children:[A,N,R,D,B,z,U,$]})}),e[28]=U,e[29]=G):G=e[29];let k;return e[30]!==x||e[31]!==G?(k=_.jsx(Ve.div,{className:"flex flex-col w-full h-full",initial:i,animate:a,transition:s,children:_.jsxs("section",{className:"flex items-center justify-between",children:[x,G]})}),e[30]=x,e[31]=G,e[32]=k):k=e[32],k}const N7=""+new URL("default-CsqMcVaZ.webp",import.meta.url).href;function yH(t){const e=sn.c(5),{src:n,classNames:i}=t,a=n||N7;let s;e[0]!==i?(s={wrapper:"bg-cover",...i},e[0]=i,e[1]=s):s=e[1];let r;return e[2]!==a||e[3]!==s?(r=_.jsx(pA,{src:a,fallbackSrc:N7,className:"w-full h-full",loading:"lazy",classNames:s}),e[2]=a,e[3]=s,e[4]=r):r=e[4],r}function bhe(t){const e=sn.c(6),{tag:n}=t;let i,a,s;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={opacity:0,x:-20},a={opacity:1,x:0},s={duration:.5,delay:.7},e[0]=i,e[1]=a,e[2]=s):(i=e[0],a=e[1],s=e[2]);let r;e[3]===Symbol.for("react.memo_cache_sentinel")?(r=_.jsx(Ve.div,{whileHover:{rotate:360},transition:{duration:.5},children:_.jsx(mg,{size:24,className:"text-[#00a3ff]"})}),e[3]=r):r=e[3];let o;return e[4]!==n?(o=_.jsxs(Ve.div,{className:"flex gap-2 mt-4 p-2 items-center",initial:i,animate:a,transition:s,children:[r,_.jsx("span",{className:"font-semibold text-xl text-white",children:n})]}),e[4]=n,e[5]=o):o=e[5],o}const l_=t=>{const e=sn.c(56),{label:n,value:i,index:a}=t;let s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={opacity:0,x:-50},r={opacity:1,x:0},e[0]=s,e[1]=r):(s=e[0],r=e[1]);const o=a*.1;let c;e[2]!==o?(c={duration:.8,delay:o},e[2]=o,e[3]=c):c=e[3];let u,h;e[4]===Symbol.for("react.memo_cache_sentinel")?(u={scale:0},h={scale:1},e[4]=u,e[5]=h):(u=e[4],h=e[5]);const d=a*.1+.3;let p;e[6]!==d?(p={duration:.5,delay:d},e[6]=d,e[7]=p):p=e[7];let g;e[8]===Symbol.for("react.memo_cache_sentinel")?(g={scale:1.2},e[8]=g):g=e[8];let b;e[9]!==p?(b=_.jsx(Ve.div,{className:"w-2.5 h-2.5 bg-gradient-to-r from-[#006299] to-[#00a3ff] rounded-full shadow-[0px_0px_8px_0px_rgb(0,163,255)]",initial:u,animate:h,transition:p,whileHover:g}),e[9]=p,e[10]=b):b=e[10];let w,x;e[11]===Symbol.for("react.memo_cache_sentinel")?(w={opacity:0},x={opacity:1},e[11]=w,e[12]=x):(w=e[11],x=e[12]);const S=a*.1+.4;let M;e[13]!==S?(M={duration:.4,delay:S},e[13]=S,e[14]=M):M=e[14];let C;e[15]!==n||e[16]!==M?(C=_.jsx(Ve.h3,{className:"text-white text-sm font-semibold uppercase tracking-wider",initial:w,animate:x,transition:M,children:n}),e[15]=n,e[16]=M,e[17]=C):C=e[17];let A;e[18]!==b||e[19]!==C?(A=_.jsxs("div",{className:"flex items-center gap-3",children:[b,C]}),e[18]=b,e[19]=C,e[20]=A):A=e[20];let N,R;e[21]===Symbol.for("react.memo_cache_sentinel")?(N={scale:0,rotate:-180,opacity:0},R={scale:1,rotate:0,opacity:1},e[21]=N,e[22]=R):(N=e[21],R=e[22]);const D=a*.1+.6;let B;e[23]!==D?(B={duration:.6,delay:D},e[23]=D,e[24]=B):B=e[24];let z;e[25]===Symbol.for("react.memo_cache_sentinel")?(z={scale:1.05,rotate:2},e[25]=z):z=e[25];let I;e[26]!==i?(I=i.toFixed(1),e[26]=i,e[27]=I):I=e[27];let U;e[28]!==I?(U=_.jsx("span",{className:"text-white font-bold text-xs",children:I}),e[28]=I,e[29]=U):U=e[29];let $;e[30]!==B||e[31]!==U?($=_.jsx(Ve.div,{className:"bg-gradient-to-r from-[#006299] to-[#00a3ff] shadow-[0px_0px_12px_0px_rgb(0,163,255)] px-2.5 py-1 border border-[rgba(0,163,255,0.4)] rounded-md",initial:N,animate:R,transition:B,whileHover:z,children:U}),e[30]=B,e[31]=U,e[32]=$):$=e[32];let G;e[33]!==A||e[34]!==$?(G=_.jsxs("div",{className:"flex items-center justify-between mb-4",children:[A,$]}),e[33]=A,e[34]=$,e[35]=G):G=e[35];let k,X;e[36]===Symbol.for("react.memo_cache_sentinel")?(k={opacity:0},X={opacity:1},e[36]=k,e[37]=X):(k=e[36],X=e[37]);const V=a*.1+.8;let H;e[38]!==V?(H=_.jsx(Ve.div,{className:"absolute inset-0 bg-gradient-to-r from-[#006299]/30 to-[#00a3ff]/30",initial:k,animate:X,transition:{duration:1,delay:V}}),e[38]=V,e[39]=H):H=e[39];let W;e[40]===Symbol.for("react.memo_cache_sentinel")?(W={width:0},e[40]=W):W=e[40];const J=`${i}%`;let Y;e[41]!==J?(Y={width:J},e[41]=J,e[42]=Y):Y=e[42];const K=a*.1+1;let ee;e[43]!==K?(ee={duration:1.5,delay:K,ease:"easeOut"},e[43]=K,e[44]=ee):ee=e[44];let ie;e[45]!==Y||e[46]!==ee?(ie=_.jsx(Ve.div,{className:"relative h-full bg-gradient-to-r from-[#006299] via-[#0088cc] to-[#00a3ff] rounded-lg",initial:W,animate:Y,transition:ee}),e[45]=Y,e[46]=ee,e[47]=ie):ie=e[47];let Z;e[48]===Symbol.for("react.memo_cache_sentinel")?(Z=_.jsx(Ve.div,{className:"absolute inset-0 rounded-lg",animate:{boxShadow:["0 0 5px rgba(0,163,255,0.4)","0 0 15px rgba(0,163,255,0.6)","0 0 5px rgba(0,163,255,0.4)"]},transition:{duration:2,repeat:1/0}}),e[48]=Z):Z=e[48];let ue;e[49]!==H||e[50]!==ie?(ue=_.jsx("div",{className:"relative w-full",children:_.jsxs("div",{className:"relative w-full h-5 bg-black/40 border border-[rgba(0,163,255,0.3)] rounded-lg overflow-hidden backdrop-blur-sm shadow-[0px_0px_15px_0px_rgba(0,163,255,0.3)]",children:[H,ie,Z]})}),e[49]=H,e[50]=ie,e[51]=ue):ue=e[51];let se;return e[52]!==G||e[53]!==ue||e[54]!==c?(se=_.jsxs(Ve.div,{className:"relative w-full mb-6",initial:s,animate:r,transition:c,children:[G,ue]}),e[52]=G,e[53]=ue,e[54]=c,e[55]=se):se=e[55],se};function bH(t){const e=sn.c(28),{stats:n}=t,{t:i}=Dn();let a,s,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={opacity:0},s={opacity:1},r={duration:.5,delay:.3},e[0]=a,e[1]=s,e[2]=r):(a=e[0],s=e[1],r=e[2]);let o;e[3]!==i?(o=i("menu.power"),e[3]=i,e[4]=o):o=e[4];const c=n?.topSpeed??0;let u;e[5]!==o||e[6]!==c?(u=_.jsx(l_,{label:o,value:c,index:0}),e[5]=o,e[6]=c,e[7]=u):u=e[7];let h;e[8]!==i?(h=i("menu.acceleration"),e[8]=i,e[9]=h):h=e[9];const d=n?.acceleration??0;let p;e[10]!==h||e[11]!==d?(p=_.jsx(l_,{label:h,value:d,index:1}),e[10]=h,e[11]=d,e[12]=p):p=e[12];let g;e[13]!==i?(g=i("menu.traction"),e[13]=i,e[14]=g):g=e[14];const b=n?.traction??0;let w;e[15]!==g||e[16]!==b?(w=_.jsx(l_,{label:g,value:b,index:2}),e[15]=g,e[16]=b,e[17]=w):w=e[17];let x;e[18]!==i?(x=i("menu.brakes"),e[18]=i,e[19]=x):x=e[19];const S=n?.brakes??0;let M;e[20]!==x||e[21]!==S?(M=_.jsx(l_,{label:x,value:S,index:3}),e[20]=x,e[21]=S,e[22]=M):M=e[22];let C;return e[23]!==w||e[24]!==M||e[25]!==u||e[26]!==p?(C=_.jsxs(Ve.div,{className:"flex flex-col gap-6 mt-8",initial:a,animate:s,transition:r,children:[u,p,w,M]}),e[23]=w,e[24]=M,e[25]=u,e[26]=p,e[27]=C):C=e[27],C}function xhe(t){const e=sn.c(84),{vehicle:n}=t,i=vi(qA),a=vi(vr),[s,r]=pu(wd),{playSound:o}=Pd(),[c,u]=P.useState(!1),{t:h}=Dn();let d;e[0]!==c?(d=()=>{c?ut("play_sound","category_down"):ut("play_sound","cancel"),u(_he)},e[0]=c,e[1]=d):d=e[1];const p=d;let g;e[2]!==s||e[3]!==o||e[4]!==r||e[5]!==h||e[6]!==p||e[7]!==n.vehicle?(g=async()=>{if(s.takeOutPrice&&!await ut("existMoney",s.takeOutPrice)){qa(h("menu.header.money_not_enough",{price:s.takeOutPrice}),"error");return}p(),o("driveVehicle"),r({...s,visible:!1}),await ut("driveVehicle",{vehicle:JSON.parse(n.vehicle),isJobGarage:s.isJobGarage})},e[2]=s,e[3]=o,e[4]=r,e[5]=h,e[6]=p,e[7]=n.vehicle,e[8]=g):g=e[8];const b=g,w=n.id;let x,S,M,C;e[9]===Symbol.for("react.memo_cache_sentinel")?(x={opacity:0,rotateY:-45,rotateX:10,y:50},S={opacity:1,rotateY:0,rotateX:0,y:0},M={opacity:0,rotateY:45,rotateX:-10,y:-50},C={duration:.25,ease:"easeInOut"},e[9]=x,e[10]=S,e[11]=M,e[12]=C):(x=e[9],S=e[10],M=e[11],C=e[12]);const A=i??void 0;let N;e[13]!==A?(N=_.jsx(vH,{stats:A}),e[13]=A,e[14]=N):N=e[14];let R,D,B;e[15]===Symbol.for("react.memo_cache_sentinel")?(R={opacity:0,y:-200,rotateZ:-20,scale:.8},D={opacity:.1,y:0,rotateZ:0,scale:1},B={duration:.3,delay:.1,ease:"easeOut"},e[15]=R,e[16]=D,e[17]=B):(R=e[15],D=e[16],B=e[17]);const z=`${a.imagePath}brands/${i?.logo}`;let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I={img:"w-[18vw] h-[18vh] relative -z-50 drop-shadow-[0_25px_60px_rgba(0,0,0,0.8)]"},e[18]=I):I=e[18];let U;e[19]!==z?(U=_.jsx(Ve.figure,{className:"absolute top-[5vh] -right-[0vw] flex flex-col items-center justify-center w-full mt-4",initial:R,animate:D,transition:B,children:_.jsx(yH,{src:z,classNames:I})}),e[19]=z,e[20]=U):U=e[20];let $;e[21]!==U||e[22]!==N?($=_.jsxs("header",{className:"relative",children:[N,U]}),e[21]=U,e[22]=N,e[23]=$):$=e[23];let G,k,X;e[24]===Symbol.for("react.memo_cache_sentinel")?(G={opacity:0,x:-30,rotateY:-15},k={opacity:1,x:0,rotateY:0},X={duration:.25,delay:.15},e[24]=G,e[25]=k,e[26]=X):(G=e[24],k=e[25],X=e[26]);const V=n.tag??i?.name??"";let H;e[27]!==V?(H=_.jsx(Ve.div,{initial:G,animate:k,transition:X,children:_.jsx(bhe,{tag:V})}),e[27]=V,e[28]=H):H=e[28];let W,J,Y;e[29]===Symbol.for("react.memo_cache_sentinel")?(W={opacity:0,x:30,rotateY:15},J={opacity:1,x:0,rotateY:0},Y={duration:.25,delay:.2},e[29]=W,e[30]=J,e[31]=Y):(W=e[29],J=e[30],Y=e[31]);const K=i??void 0;let ee;e[32]!==K?(ee=_.jsx(Ve.div,{initial:W,animate:J,transition:Y,children:_.jsx(bH,{stats:K})}),e[32]=K,e[33]=ee):ee=e[33];let ie;e[34]===Symbol.for("react.memo_cache_sentinel")?(ie=_.jsx(Ve.hr,{className:"border-white/20 my-6",initial:{scaleX:0,opacity:0},animate:{scaleX:1,opacity:1},transition:{duration:.3,delay:.25}}),e[34]=ie):ie=e[34];let Z,ue,se;e[35]===Symbol.for("react.memo_cache_sentinel")?(Z={opacity:0,y:20},ue={opacity:1,y:0},se={duration:.25,delay:.3,ease:"easeOut"},e[35]=Z,e[36]=ue,e[37]=se):(Z=e[35],ue=e[36],se=e[37]);let ae,ce,pe;e[38]===Symbol.for("react.memo_cache_sentinel")?(ae={opacity:0,x:-40,rotateY:-20},ce={opacity:1,x:0,rotateY:0},pe={duration:.25,delay:.35},e[38]=ae,e[39]=ce,e[40]=pe):(ae=e[38],ce=e[39],pe=e[40]);let ye;e[41]===Symbol.for("react.memo_cache_sentinel")?(ye={content:"bg-slate-800/80 text-white"},e[41]=ye):ye=e[41];const _e=!!n?.impound_data;let me;e[42]===Symbol.for("react.memo_cache_sentinel")?(me=_.jsx(dc,{size:20}),e[42]=me):me=e[42];let ne;e[43]!==h?(ne=h("menu.take_vehicle_out"),e[43]=h,e[44]=ne):ne=e[44];let be;e[45]!==b||e[46]!==_e||e[47]!==ne?(be=_.jsx(av,{children:_.jsxs(Zt,{className:"w-full h-14 bg-gradient-to-r from-[#006299] to-[#00a3ff] border-[rgba(1,144,225,1)] border-2 rounded-xl text-white font-semibold text-lg uppercase transition-all duration-300 flex items-center justify-center gap-3 hover:scale-105 hover:shadow-[0px_0px_20px_0px_rgb(0,163,255)]",size:"lg",radius:"full",color:"primary",variant:"shadow",onPress:b,isDisabled:_e,children:[me,ne]})}),e[45]=b,e[46]=_e,e[47]=ne,e[48]=be):be=e[48];let xe;e[49]!==h?(xe=h("menu.take_vehicle_out_description"),e[49]=h,e[50]=xe):xe=e[50];let he;e[51]!==xe?(he=_.jsx("div",{className:"subtitle",children:xe}),e[51]=xe,e[52]=he):he=e[52];let ve;e[53]!==s.takeOutPrice||e[54]!==h?(ve=s.takeOutPrice?_.jsx("span",{className:"text-sm text-gray-100/80",children:h("menu.take_vehicle_out_price",{price:s.takeOutPrice})}):_.jsx("span",{className:"text-sm text-gray-100/80",children:h("menu.take_vehicle_out_free")}),e[53]=s.takeOutPrice,e[54]=h,e[55]=ve):ve=e[55];let Oe;e[56]!==h?(Oe=h("menu.cancel"),e[56]=h,e[57]=Oe):Oe=e[57];let Le;e[58]!==Oe||e[59]!==p?(Le=_.jsx(Zt,{variant:"solid",color:"primary",onPress:p,children:Oe}),e[58]=Oe,e[59]=p,e[60]=Le):Le=e[60];let Ae;e[61]!==h?(Ae=h("menu.confirm"),e[61]=h,e[62]=Ae):Ae=e[62];let et;e[63]!==b||e[64]!==Ae?(et=_.jsx(Zt,{variant:"solid",color:"danger",onPress:b,children:Ae}),e[63]=b,e[64]=Ae,e[65]=et):et=e[65];let tt;e[66]!==Le||e[67]!==et?(tt=_.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[Le,et]}),e[66]=Le,e[67]=et,e[68]=tt):tt=e[68];let re;e[69]!==he||e[70]!==ve||e[71]!==tt?(re=_.jsx(iv,{children:_.jsxs("div",{className:"px-1 py-2 flex flex-col gap-1",children:[he,ve,tt]})}),e[69]=he,e[70]=ve,e[71]=tt,e[72]=re):re=e[72];let te;e[73]!==c||e[74]!==be||e[75]!==re||e[76]!==p?(te=_.jsx(Ve.div,{className:"flex flex-col gap-4",initial:Z,animate:ue,transition:se,children:_.jsx("article",{id:"public-garage-interactions",className:"flex flex-col gap-3",children:_.jsx(Ve.div,{initial:ae,animate:ce,transition:pe,children:_.jsxs(sv,{classNames:ye,showArrow:!0,isOpen:c,onOpenChange:p,offset:20,backdrop:"blur",children:[be,re]})})})}),e[73]=c,e[74]=be,e[75]=re,e[76]=p,e[77]=te):te=e[77];let we;return e[78]!==$||e[79]!==H||e[80]!==ee||e[81]!==te||e[82]!==n.id?(we=_.jsxs(Ve.div,{initial:x,animate:S,exit:M,transition:C,children:[$,H,ee,ie,te]},w),e[78]=$,e[79]=H,e[80]=ee,e[81]=te,e[82]=n.id,e[83]=we):we=e[83],we}function _he(t){return!t}function She(){const t=sn.c(25),{t:e}=Dn();let n,i,a,s;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={opacity:0,scale:.95},i={opacity:1,scale:1},a={opacity:0,scale:.95},s={duration:.3},t[0]=n,t[1]=i,t[2]=a,t[3]=s):(n=t[0],i=t[1],a=t[2],s=t[3]);let r,o,c;t[4]===Symbol.for("react.memo_cache_sentinel")?(r={opacity:0,scale:.5,rotate:-180},o={opacity:1,scale:1,rotate:0},c={duration:.5,delay:.1},t[4]=r,t[5]=o,t[6]=c):(r=t[4],o=t[5],c=t[6]);let u;t[7]===Symbol.for("react.memo_cache_sentinel")?(u=_.jsx(Ve.div,{className:"w-24 h-24 bg-white/10 rounded-full flex items-center justify-center mb-4",initial:r,animate:o,transition:c,children:_.jsx("svg",{className:"w-12 h-12 text-white/40",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:_.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.5,d:"M13 16h-1v-4h-1m1-4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z"})})}),t[7]=u):u=t[7];let h,d,p;t[8]===Symbol.for("react.memo_cache_sentinel")?(d={opacity:0,y:20,x:-10},p={opacity:1,y:0,x:0},h={duration:.4,delay:.2},t[8]=h,t[9]=d,t[10]=p):(h=t[8],d=t[9],p=t[10]);let g;t[11]!==e?(g=e("menu.empty_garage"),t[11]=e,t[12]=g):g=t[12];let b;t[13]!==g?(b=_.jsx(Ve.h3,{className:"text-white/60 text-lg font-medium mb-2",initial:d,animate:p,transition:h,children:g}),t[13]=g,t[14]=b):b=t[14];let w,x,S;t[15]===Symbol.for("react.memo_cache_sentinel")?(w={opacity:0,y:20,x:10},x={opacity:1,y:0,x:0},S={duration:.4,delay:.3},t[15]=w,t[16]=x,t[17]=S):(w=t[15],x=t[16],S=t[17]);let M;t[18]!==e?(M=e("menu.empty_garage_description"),t[18]=e,t[19]=M):M=t[19];let C;t[20]!==M?(C=_.jsx(Ve.p,{className:"text-white/40 text-sm text-center",initial:w,animate:x,transition:S,children:M}),t[20]=M,t[21]=C):C=t[21];let A;return t[22]!==b||t[23]!==C?(A=_.jsxs(Ve.div,{initial:n,animate:i,exit:a,transition:s,className:"flex flex-col items-center justify-center h-full",children:[u,b,C]},"no-vehicle-content"),t[22]=b,t[23]=C,t[24]=A):A=t[24],A}function whe(t){const e=sn.c(8),{vehicle:n,loading:i}=t,{t:a}=Dn();let s,r,o,c;e[0]===Symbol.for("react.memo_cache_sentinel")?(s={opacity:0,y:50},r={opacity:1,y:0},o={duration:.6,delay:.2},c={boxShadow:"0px 0px_35px_0px rgba(23,23,23,0.9)",borderColor:"rgba(255,255,255,0.4)"},e[0]=s,e[1]=r,e[2]=o,e[3]=c):(s=e[0],r=e[1],o=e[2],c=e[3]);let u;return e[4]!==i||e[5]!==a||e[6]!==n?(u=_.jsx("div",{className:"flex-1 flex items-center",children:_.jsx(Ve.article,{className:"item-slot border-4 border-white/25 overflow-x-hidden w-[24vw] shadow-[0px_0px_25px_0px_rgba(23,23,23,0.7)] p-6 rounded-xl bg-gradient-to-br from-black/40 to-black/20",initial:s,animate:r,transition:o,whileHover:c,children:_.jsx(Hs,{mode:"wait",children:i?_.jsx("div",{className:"flex items-center justify-center h-32",children:_.jsx(Sw,{title:a("menu.vehicle_loading"),subtitle:a("menu.vehicle_loading_subtitle")})}):n?_.jsx(xhe,{vehicle:n}):_.jsx(She,{})})})}),e[4]=i,e[5]=a,e[6]=n,e[7]=u):u=e[7],u}const Ehe={primary:"bg-gradient-to-r from-[#006299] to-[#00a3ff] border-[rgba(1,144,225,1)]",secondary:"bg-gradient-to-r from-[#666] to-[#999] border-[rgba(255,255,255,0.3)]",danger:"bg-gradient-to-r from-[#dc2626] to-[#ef4444] border-[rgba(220,38,38,1)]"},Mhe={primary:"hover:scale-105 hover:shadow-[0px_0px_20px_0px_rgb(0,163,255)]",secondary:"hover:scale-105 hover:shadow-[0px_0px_20px_0px_rgb(255,255,255,0.3)]",danger:"hover:scale-105 hover:shadow-[0px_0px_20px_0px_rgb(220,38,38,1)]"};function The(t){const e=sn.c(14),{icon:n,text:i,onClick:a,disabled:s,variant:r}=t,o=s===void 0?!1:s,c=r===void 0?"primary":r,u=Ehe[c],h=Mhe[c],d=!o;let p;e[0]!==o||e[1]!==u||e[2]!==h||e[3]!==d?(p=fn({"w-full h-14":!0,[u]:!0,"border-2 rounded-xl text-white font-semibold text-lg uppercase transition-all duration-300 flex items-center justify-center gap-3":!0,"opacity-40 pointer-events-none":o,[h]:d}),e[0]=o,e[1]=u,e[2]=h,e[3]=d,e[4]=p):p=e[4];let g;e[5]!==n?(g=_.jsx(n,{size:20}),e[5]=n,e[6]=g):g=e[6];let b;return e[7]!==o||e[8]!==a||e[9]!==p||e[10]!==g||e[11]!==i||e[12]!==c?(b=_.jsxs(Zt,{className:p,isDisabled:o,onPress:a,size:"lg",radius:"full",color:c,variant:"shadow",children:[g,i]}),e[7]=o,e[8]=a,e[9]=p,e[10]=g,e[11]=i,e[12]=c,e[13]=b):b=e[13],b}function Che(t){const e=sn.c(81),{impoundData:n,vehicle:i}=t,[a,s]=P.useState(0),{playSound:r}=Pd(),{t:o}=Dn(),c=vi(vr),u=new Intl.NumberFormat(c.intl.locales,c.intl.options);let h,d;e[0]!==n.time?(h=()=>{(()=>{const et=n.time*1e3,tt=new Date(et),re=Date.now(),te=Math.max(0,Math.floor((tt.getTime()-re)/1e3));te<=0?s(0):s(te)})();const Ae=setInterval(()=>{s(Rhe)},1e3);return()=>clearInterval(Ae)},d=[n.time],e[0]=n.time,e[1]=h,e[2]=d):(h=e[1],d=e[2]),P.useEffect(h,d);const p=Ahe;let g;e[3]!==r||e[4]!==i?(g=()=>{const Le=i.impound_data;if(!Le)return console.log("No impound data");r("impound"),ut("payVehiclePrice",{vehicle:i,price:Le.price})},e[3]=r,e[4]=i,e[5]=g):g=e[5];const b=g,w=Ve,x="relative w-full min-w-[20vw]";let S,M,C;e[6]===Symbol.for("react.memo_cache_sentinel")?(S={opacity:0,y:20},M={opacity:1,y:0},C={duration:.3,ease:"easeOut"},e[6]=S,e[7]=M,e[8]=C):(S=e[6],M=e[7],C=e[8]);const A="bg-slate-800/90 backdrop-blur-sm rounded-lg border border-slate-600/50 p-5 shadow-lg";let N;e[9]===Symbol.for("react.memo_cache_sentinel")?(N=_.jsx("div",{className:"w-3 h-3 bg-red-500 rounded-full animate-pulse"}),e[9]=N):N=e[9];let R;e[10]!==o?(R=o("menu.impound_info.title"),e[10]=o,e[11]=R):R=e[11];let D;e[12]!==R?(D=_.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[N,_.jsx("h3",{className:"red-subtitle font-semibold text-lg",children:R})]}),e[12]=R,e[13]=D):D=e[13];const B="space-y-4";let z;e[14]===Symbol.for("react.memo_cache_sentinel")?(z=_.jsx(ik,{className:"text-blue-400"}),e[14]=z):z=e[14];let I;e[15]!==o?(I=o("menu.impound_info.time_left"),e[15]=o,e[16]=I):I=e[16];let U;e[17]!==I?(U=_.jsxs("div",{className:"flex items-center gap-2",children:[z,_.jsx("span",{className:"text-gray-300 text-sm",children:I})]}),e[17]=I,e[18]=U):U=e[18];const $=p(a);let G;e[19]!==$?(G=_.jsx("span",{className:"font-bold text-lg subtitle",children:$}),e[19]=$,e[20]=G):G=e[20];let k;e[21]!==U||e[22]!==G?(k=_.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-700/30 rounded-lg border border-slate-600/30",children:[U,G]}),e[21]=U,e[22]=G,e[23]=k):k=e[23];const X="flex items-center justify-between p-3 bg-slate-700/30 rounded-lg border border-slate-600/30";let V;e[24]===Symbol.for("react.memo_cache_sentinel")?(V=_.jsx(c5,{className:"text-yellow-400"}),e[24]=V):V=e[24];let H;e[25]!==o?(H=o("menu.impound_info.price"),e[25]=o,e[26]=H):H=e[26];let W;e[27]!==H?(W=_.jsxs("div",{className:"flex items-center gap-2",children:[V,_.jsx("span",{className:"text-gray-300 text-sm",children:H})]}),e[27]=H,e[28]=W):W=e[28];const J="subtitle font-bold",Y=u.format(n.price);let K;e[29]!==Y?(K=_.jsx("span",{className:J,children:Y}),e[29]=Y,e[30]=K):K=e[30];let ee;e[31]!==W||e[32]!==K?(ee=_.jsxs("div",{className:X,children:[W,K]}),e[31]=W,e[32]=K,e[33]=ee):ee=e[33];let ie;e[34]===Symbol.for("react.memo_cache_sentinel")?(ie=_.jsx(ak,{className:"text-green-400"}),e[34]=ie):ie=e[34];let Z;e[35]!==o?(Z=o("menu.impound_info.garage"),e[35]=o,e[36]=Z):Z=e[36];let ue;e[37]!==Z?(ue=_.jsxs("div",{className:"flex items-center gap-2",children:[ie,_.jsx("span",{className:"text-gray-300 text-sm",children:Z})]}),e[37]=Z,e[38]=ue):ue=e[38];let se;e[39]!==n.selectedGarage?(se=_.jsx("span",{className:"text-gray-200 text-sm font-medium",children:n.selectedGarage}),e[39]=n.selectedGarage,e[40]=se):se=e[40];let ae;e[41]!==ue||e[42]!==se?(ae=_.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-700/30 rounded-lg border border-slate-600/30",children:[ue,se]}),e[41]=ue,e[42]=se,e[43]=ae):ae=e[43];let ce;e[44]!==o?(ce=o("menu.impound_info.pay_fine_description"),e[44]=o,e[45]=ce):ce=e[45];let pe;e[46]!==ce?(pe=_.jsx("span",{className:"text-gray-300 text-sm max-w-[83%]",children:ce}),e[46]=ce,e[47]=pe):pe=e[47];const ye=n.getByPay?"success":"default";let _e;e[48]!==n.getByPay||e[49]!==o?(_e=n.getByPay?o("menu.impound_info.yes"):o("menu.impound_info.no"),e[48]=n.getByPay,e[49]=o,e[50]=_e):_e=e[50];let me;e[51]!==ye||e[52]!==_e?(me=_.jsx(na,{color:ye,variant:"flat",size:"sm",children:_e}),e[51]=ye,e[52]=_e,e[53]=me):me=e[53];let ne;e[54]!==pe||e[55]!==me?(ne=_.jsxs("div",{className:"flex items-center justify-between p-3 bg-slate-700/30 rounded-lg border border-slate-600/30",children:[pe,me]}),e[54]=pe,e[55]=me,e[56]=ne):ne=e[56];let be;e[57]!==n.note||e[58]!==o?(be=n.note&&_.jsx("div",{className:"p-3 bg-slate-700/30 rounded-lg border border-slate-600/30",children:_.jsxs("div",{className:"flex items-start gap-2",children:[_.jsx(sk,{className:"text-purple-400 mt-1 flex-shrink-0"}),_.jsxs("div",{children:[_.jsx("span",{className:"text-gray-300 text-sm font-medium block mb-1",children:o("menu.impound_info.note")}),_.jsx("p",{className:"text-gray-200 text-sm",children:n.note})]})]})}),e[57]=n.note,e[58]=o,e[59]=be):be=e[59];let xe;e[60]!==b||e[61]!==n.getByPay||e[62]!==o||e[63]!==a?(xe=n.getByPay||a<=0?_.jsx(Ve.div,{initial:{opacity:0,x:40,rotateY:20},animate:{opacity:1,x:0,rotateY:0},transition:{duration:.25,delay:.4},children:_.jsx(The,{icon:c5,text:o("menu.impound_info.pay_fine_button"),onClick:b,variant:"danger"})}):a>0?_.jsx(Ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:.4},className:"flex items-center justify-center p-4 bg-slate-700/20 rounded-lg border border-slate-600/20",children:_.jsxs("div",{className:"flex items-center gap-3 text-gray-400/60",children:[_.jsx(Cle,{className:"text-lg animate-pulse"}),_.jsx("span",{className:"text-sm font-medium",children:o("menu.impound_info.pay_fine_button_description")})]})}):null,e[60]=b,e[61]=n.getByPay,e[62]=o,e[63]=a,e[64]=xe):xe=e[64];let he;e[65]!==k||e[66]!==ee||e[67]!==ae||e[68]!==ne||e[69]!==be||e[70]!==xe?(he=_.jsxs("div",{className:B,children:[k,ee,ae,ne,be,xe]}),e[65]=k,e[66]=ee,e[67]=ae,e[68]=ne,e[69]=be,e[70]=xe,e[71]=he):he=e[71];let ve;e[72]!==D||e[73]!==he?(ve=_.jsxs("div",{className:A,children:[D,he]}),e[72]=D,e[73]=he,e[74]=ve):ve=e[74];let Oe;return e[75]!==w.div||e[76]!==ve||e[77]!==S||e[78]!==M||e[79]!==C?(Oe=_.jsx(w.div,{className:x,initial:S,animate:M,transition:C,children:ve}),e[75]=w.div,e[76]=ve,e[77]=S,e[78]=M,e[79]=C,e[80]=Oe):Oe=e[80],Oe}function Ahe(t){if(t<=0)return"00:00";const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return e>0?`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}function Rhe(t){return Math.max(0,t-1)}const P7=.05;function Nhe(){const t=sn.c(30),[e,n]=P.useState(!1);let i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i={x:0,y:0},t[0]=i):i=t[0];let a;t[1]===Symbol.for("react.memo_cache_sentinel")?(a={lastCoords:i,lastTime:0,inertia:{x:0,y:0},lastRotation:{x:0,y:0},inertiaInterval:0},t[1]=a):a=t[1];const[s,r]=P.useState(a);let o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=I=>{n(!0)},t[2]=o):o=t[2];const c=o;let u;t[3]!==s.lastCoords||t[4]!==s.lastRotation||t[5]!==s.lastTime||t[6]!==e?(u=I=>{if(!e)return;const U=I.clientX,$=I.clientY,G=Date.now();let k=0,X=0;if(s.lastCoords.x!==0&&s.lastCoords.y!==0){const W=U-s.lastCoords.x,J=$-s.lastCoords.y,Y=G-s.lastTime;k=W/Y,X=J/Y}const V=k*7,H=X*7;ut("RotateCam",{x:s.lastRotation.x+P7*(V-s.lastRotation.x),y:s.lastRotation.y+P7*(H-s.lastRotation.y)}),r(W=>({...W,lastCoords:{x:U,y:$},lastTime:G,inertia:{x:V/2,y:H/2},lastRotation:{x:0,y:0}}))},t[3]=s.lastCoords,t[4]=s.lastRotation,t[5]=s.lastTime,t[6]=e,t[7]=u):u=t[7];const h=u;let d;t[8]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{n(!1)},t[8]=d):d=t[8];const p=d;let g;t[9]!==s.inertia||t[10]!==s.lastRotation||t[11]!==e?(g=()=>{window.addEventListener("mouseup",p);const I=s.lastRotation,U=s.inertia;if(U.x==0&&U.y==0)return;const $=setInterval(()=>{if(e){clearInterval($),r(Dhe);return}ut("RotateCam",{x:I.x+s.inertia.x,y:I.y+s.inertia.y}),U.x=U.x*.95,U.y=U.y*.95,Math.abs(U.x)<.01&&Math.abs(U.y)<.01&&(clearInterval($),r(Phe))},0);return()=>{window.removeEventListener("mouseup",p),clearInterval($)}},t[9]=s.inertia,t[10]=s.lastRotation,t[11]=e,t[12]=g):g=t[12];let b;t[13]!==s||t[14]!==e?(b=[e,s],t[13]=s,t[14]=e,t[15]=b):b=t[15],P.useEffect(g,b);let w,x,S;t[16]===Symbol.for("react.memo_cache_sentinel")?(w={opacity:0},x={opacity:1},S={duration:.3},t[16]=w,t[17]=x,t[18]=S):(w=t[16],x=t[17],S=t[18]);let M;t[19]===Symbol.for("react.memo_cache_sentinel")?(M=_.jsx(Ve.div,{className:"absolute inset-0 pointer-events-none",transition:{duration:.2}}),t[19]=M):M=t[19];const C=e?1.2:1,A=e?.8:0;let N;t[20]!==C||t[21]!==A?(N={scale:C,opacity:A},t[20]=C,t[21]=A,t[22]=N):N=t[22];let R;t[23]===Symbol.for("react.memo_cache_sentinel")?(R={duration:.2},t[23]=R):R=t[23];let D;t[24]===Symbol.for("react.memo_cache_sentinel")?(D=_.jsx("div",{className:"w-16 h-16 border-2 border-cyan-400/50 rounded-full flex items-center justify-center",children:_.jsx("div",{className:"w-8 h-8 border-2 border-cyan-400 rounded-full animate-spin"})}),t[24]=D):D=t[24];let B;t[25]!==N?(B=_.jsx(Ve.div,{className:"absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 pointer-events-none",animate:N,transition:R,children:D}),t[25]=N,t[26]=B):B=t[26];let z;return t[27]!==h||t[28]!==B?(z=_.jsxs(Ve.div,{className:"w-full h-full absolute inset-0 cursor-move",onMouseDown:c,onMouseMove:h,initial:w,animate:x,transition:S,children:[M,B]}),t[27]=h,t[28]=B,t[29]=z):z=t[29],z}function Phe(t){return{...t,inertia:{x:0,y:0}}}function Dhe(t){return{...t,inertia:{x:0,y:0}}}const Lhe={hidden:{opacity:0,scale:1.1},visible:{opacity:1,scale:1,transition:{duration:.6,ease:"easeOut"}},exit:{opacity:0,scale:1.1,transition:{duration:.4,ease:"easeIn"}}};function Ohe(t){const e=sn.c(6),{isActive:n}=t;if(!n)return null;let i,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(i={y:-100},a={y:0},e[0]=i,e[1]=a):(i=e[0],a=e[1]);let s;e[2]===Symbol.for("react.memo_cache_sentinel")?(s=_.jsx(Ve.div,{className:"absolute top-0 left-0 right-0 h-32 bg-black",initial:i,animate:a,transition:{duration:.8,ease:"easeOut",delay:.2}}),e[2]=s):s=e[2];let r,o;e[3]===Symbol.for("react.memo_cache_sentinel")?(r={y:100},o={y:0},e[3]=r,e[4]=o):(r=e[3],o=e[4]);let c;return e[5]===Symbol.for("react.memo_cache_sentinel")?(c=_.jsxs(Ve.div,{className:"fixed inset-0 z-50 pointer-events-none",variants:Lhe,initial:"hidden",animate:"visible",exit:"exit",children:[s,_.jsx(Ve.div,{className:"absolute bottom-0 left-0 right-0 h-32 bg-black",initial:r,animate:o,transition:{duration:.8,ease:"easeOut",delay:.2}})]}),e[5]=c):c=e[5],c}const Ihe={hidden:{opacity:0,scale:.95},visible:{opacity:1,scale:1,transition:{duration:.4,ease:"easeOut"}},exit:{opacity:0,scale:.95,transition:{duration:.3,ease:"easeIn"}}},zhe={hidden:{opacity:0,scale:1.05},visible:{opacity:1,scale:1,transition:{duration:.4,ease:"easeOut"}},exit:{opacity:0,scale:1.05,transition:{duration:.3,ease:"easeIn"}}};function Bhe(t){const e=sn.c(77),{data:n,setVisible:i}=t,[a,s]=P.useState(null),[r,o]=P.useState(!1),[c,u]=P.useState(!1),h=P.useRef(null),{t:d}=Dn(),p=vi(vr),g=yde(p.idleDuration),b=Wr(wd),w=Wr(qA),{playSound:x}=Pd();let S;e[0]!==b?(S=me=>{b(ne=>({...ne,vehicles:me}))},e[0]=b,e[1]=S):S=e[1],yo("update_vehicles",S);let M,C;e[2]!==g?(M=()=>{ut("toggle_cinematic_cam",g)},C=[g],e[2]=g,e[3]=M,e[4]=C):(M=e[3],C=e[4]),P.useEffect(M,C);let A;e[5]!==n||e[6]!==r||e[7]!==a?(A=()=>{if(r||!n||n.vehicles.length===0)return;const me=n.vehicles.findIndex(ne=>ne.id===a);me<n.vehicles.length-1?s(n.vehicles[me+1].id):s(n.vehicles[0].id)},e[5]=n,e[6]=r,e[7]=a,e[8]=A):A=e[8];const N=A;let R;e[9]!==n||e[10]!==r||e[11]!==a?(R=()=>{if(r)return;if(!n||n.vehicles.length===0)return console.log("no data");const me=n.vehicles.findIndex(ne=>ne.id===a);me>0?s(n.vehicles[me-1].id):s(n.vehicles[n.vehicles.length-1].id)},e[9]=n,e[10]=r,e[11]=a,e[12]=R):R=e[12];const D=R;let B;e[13]!==w||e[14]!==i?(B=()=>{i(!1),w(null),ut("close_menu")},e[13]=w,e[14]=i,e[15]=B):B=e[15];const z=B;fH(z);let I;e[16]!==n||e[17]!==a?(I=()=>{n?.vehicles?.length!==0&&(!a||!n?.vehicles?.find(me=>me.id===a))&&s(n.vehicles[0].id)},e[16]=n,e[17]=a,e[18]=I):I=e[18];let U;e[19]!==n?(U=[n],e[19]=n,e[20]=U):U=e[20],P.useEffect(I,U);let $;e[21]!==n?.vehicles||e[22]!==x||e[23]!==a||e[24]!==w||e[25]!==d?($=async()=>{if(a){x("loading");const me=n?.vehicles?.find?.(be=>be.id===a);if(!me)return qa(d("menu.no_vehicle_selected"),"error");o(!0);const ne=await ut("spawnVehicle",{props:me.vehicle});w(ne),o(!1)}},e[21]=n?.vehicles,e[22]=x,e[23]=a,e[24]=w,e[25]=d,e[26]=$):$=e[26];const G=$;let k;e[27]!==c||e[28]!==x||e[29]!==a||e[30]!==d?(k=()=>{if(!a)return qa(d("menu.no_vehicle_selected"),"error");x("preview"),u(Uhe),ut("toggle_inspect",c)},e[27]=c,e[28]=x,e[29]=a,e[30]=d,e[31]=k):k=e[31];const X=k;let V;e[32]!==G?(V=()=>{G()},e[32]=G,e[33]=V):V=e[33];let H;e[34]!==a?(H=[a],e[34]=a,e[35]=H):H=e[35],P.useEffect(V,H);let W;e[36]!==p.soundFiles||e[37]!==p.soundPath?(W=()=>{if(h.current&&h.current.playing())h.current?.stop(),h.current=null;else{const me=p.soundFiles[Math.floor(Math.random()*p.soundFiles.length)];h.current=new Xk.Howl({src:[`${p.soundPath}${me}.ogg`],html5:!1,volume:.3,loop:!0}),h.current.play()}},e[36]=p.soundFiles,e[37]=p.soundPath,e[38]=W):W=e[38];const J=W;let Y;e[39]!==J?(Y=()=>(J(),()=>{h.current&&(h.current.stop(),h.current=null)}),e[39]=J,e[40]=Y):Y=e[40];let K;e[41]===Symbol.for("react.memo_cache_sentinel")?(K=[],e[41]=K):K=e[41],P.useEffect(Y,K);let ee;e[42]!==n?.vehicles||e[43]!==a?(ee=n?.vehicles.find(me=>me.id===a),e[42]=n?.vehicles,e[43]=a,e[44]=ee):ee=e[44];const ie=ee;let Z;e[45]!==n?.vehicles||e[46]!==a?(Z=n?.vehicles.findIndex(me=>me.id===a),e[45]=n?.vehicles,e[46]=a,e[47]=Z):Z=e[47];const ue=Z;let se;e[48]!==g?(se=_.jsx(Ohe,{isActive:g}),e[48]=g,e[49]=se):se=e[49];let ae;e[50]!==r||e[51]!==d?(ae=r&&_.jsx("div",{className:"fixed bottom-4 right-4 z-50",children:_.jsx("div",{className:"bg-black/80 backdrop-blur-sm border border-cyan-400/50 rounded-lg p-4 shadow-lg",children:_.jsx(Sw,{title:d("menu.vehicle_loading"),subtitle:d("menu.vehicle_loading_subtitle")})})}),e[50]=r,e[51]=d,e[52]=ae):ae=e[52];let ce;e[53]!==g||e[54]!==r?(ce=fn({"transition h-full flex flex-col":!0,"pointer-events-none opacity-50":r,"opacity-0":g}),e[53]=g,e[54]=r,e[55]=ce):ce=e[55];let pe;e[56]!==ie||e[57]!==ue||e[58]!==n?.isJobGarage||e[59]!==n?.vehicles.length||e[60]!==D||e[61]!==N||e[62]!==c||e[63]!==X||e[64]!==r||e[65]!==z||e[66]!==i||e[67]!==d||e[68]!==J?(pe=_.jsx(Hs,{mode:"wait",children:c?_.jsxs(Ve.div,{className:"w-full h-full relative flex flex-col",variants:zhe,initial:"hidden",animate:"visible",exit:"exit",children:[_.jsx(C7,{vehicle:ie,vehicleCount:n?.vehicles.length||0,currentIndex:ue||0,isInspectMode:!0,isJobGarage:n?.isJobGarage}),_.jsxs("div",{className:"relative w-screen h-screen",children:[_.jsx(Nhe,{}),_.jsx(Ve.div,{className:"absolute top-4 left-4 z-10",initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:.2,duration:.3},children:_.jsxs("div",{className:"bg-black/60 backdrop-blur-sm border border-white/20 rounded-lg px-4 py-2 text-white text-sm",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-2 h-2 bg--400 rounded-full animate-pulse"}),_.jsx("span",{children:d("menu.preview_mode_active")})]}),_.jsx("div",{className:"text-xs text-gray-300 mt-1",children:d("menu.preview_mode_subtitle")})]})})]}),_.jsx(R7,{onMusic:J,onInspect:X,onPreviousVehicle:N,onNextVehicle:D,onClose:()=>i(!1),canGoPrevious:ue?ue>0:!1,canGoNext:ue?ue<(n?.vehicles.length||0)-1:!1})]},"inspect"):_.jsxs(Ve.div,{className:"h-full flex flex-col",variants:Ihe,initial:"hidden",animate:"visible",exit:"exit",children:[_.jsx(C7,{vehicle:ie,vehicleCount:n?.vehicles.length||0,currentIndex:ue||0,isInspectMode:!1,isJobGarage:n?.isJobGarage}),_.jsxs("div",{className:"flex-1 flex items-center justify-between gap-8",children:[_.jsx("div",{className:"flex-1",children:_.jsx(whe,{vehicle:ie,loading:r})}),ie?.impound_data&&_.jsx(Ve.div,{className:"flex-shrink-0",initial:{opacity:0,x:50},animate:{opacity:1,x:0},transition:{duration:.4,delay:.2},children:_.jsx(Che,{impoundData:ie.impound_data,vehicle:ie})})]}),_.jsx(R7,{onMusic:J,onInspect:X,onPreviousVehicle:N,onNextVehicle:D,onClose:z,canGoPrevious:ue?ue>0:!1,canGoNext:ue?ue<(n?.vehicles.length||0)-1:!1})]},"menu")}),e[56]=ie,e[57]=ue,e[58]=n?.isJobGarage,e[59]=n?.vehicles.length,e[60]=D,e[61]=N,e[62]=c,e[63]=X,e[64]=r,e[65]=z,e[66]=i,e[67]=d,e[68]=J,e[69]=pe):pe=e[69];let ye;e[70]!==ce||e[71]!==pe?(ye=_.jsx("div",{className:ce,children:pe}),e[70]=ce,e[71]=pe,e[72]=ye):ye=e[72];let _e;return e[73]!==se||e[74]!==ae||e[75]!==ye?(_e=_.jsxs(_.Fragment,{children:[se,ae,ye]}),e[73]=se,e[74]=ae,e[75]=ye,e[76]=_e):_e=e[76],_e}function Uhe(t){return!t}function jhe(){const t=sn.c(9),[e,n]=pu(wd);e3("toggle_garage_menu",wd);let i;t[0]!==e.vehicles.length?(i=()=>{e.vehicles.length>0?ut("toggle_ped_visibility",!0):ut("toggle_ped_visibility",!1)},t[0]=e.vehicles.length,t[1]=i):i=t[1];let a;t[2]!==e?(a=[e],t[2]=e,t[3]=a):a=t[3],P.useEffect(i,a);let s;t[4]!==e||t[5]!==n?(s=e.visible&&e&&_.jsx(Ve.main,{className:"w-full h-full p-10 flex flex-col",initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:1.1},transition:{duration:.3},children:_.jsx(Bhe,{data:e,setVisible:o=>n({...e,visible:o})})}),t[4]=e,t[5]=n,t[6]=s):s=t[6];let r;return t[7]!==s?(r=_.jsx(Hs,{children:s}),t[7]=s,t[8]=r):r=t[8],r}function xH(t,e){const n=sn.c(5),[i,a]=P.useState(null);let s;n[0]!==e?(s=c=>{a(c),ut("play_sound",c.visible?"item_down":"hover_up")},n[0]=e,n[1]=s):s=n[1],yo(t,s);const r=i?.visible;let o;return n[2]!==i||n[3]!==r?(o=[r,i,a],n[2]=i,n[3]=r,n[4]=o):o=n[4],o}const D7=t=>{if(t<=0)return"00:00";const e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=t%60;return e>0?`${e.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`:`${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`},L7={selectedGarage:"",minutes:0,seconds:0,canPayToRelease:"yes",price:0,note:""};function Fhe({data:t,setData:e}){const{t:n}=Dn(),[i,a]=P.useState(!1),s=vi(vr),r=new Intl.NumberFormat(s.intl.locales,s.intl.options),[o,c]=P.useState({...L7}),{playSound:u}=Pd(),h=(g,b)=>{c(w=>({...w,[g]:b}))},d=async()=>{if(!o.selectedGarage){qa(n("menu.impound_modal.error.select_garage"),"error");return}if(o.minutes===0&&o.seconds===0){qa(n("menu.impound_modal.error.select_time"),"error");return}a(!0),u("impound");try{const g=o.minutes*60+o.seconds;await ut("impound",{selectedGarage:o.selectedGarage,getByPay:o.canPayToRelease==="yes",price:o.price,time:g,note:o.note}),c(L7),e({visible:!1,impoundGarages:[]})}catch(g){console.error("Impound error:",g),qa(n("menu.impound_modal.error.submit"),"error")}finally{a(!1)}},p=()=>o.selectedGarage&&(o.minutes>0||o.seconds>0)&&o.price>=0;return _.jsx(lh,{children:g=>_.jsxs(_.Fragment,{children:[_.jsx(ch,{className:"flex flex-col gap-1",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"p-2 rounded-lg 50 border border-blue-500/30",children:_.jsx(xD,{className:"text-blue-300 text-xl"})}),_.jsxs("div",{children:[_.jsx("h3",{className:"text-xl font-semibold text-slate-200 title",children:n("menu.impound_modal.title")}),_.jsx("p",{className:"text-sm text-slate-400",children:n("menu.impound_modal.description")})]})]})}),_.jsx(oh,{className:"py-6",children:_.jsxs(Ve.div,{className:"space-y-6",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3},children:[_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.1},children:[_.jsxs("label",{className:"text-sm font-medium text-slate-300 flex items-center gap-2",children:[_.jsx(SD,{className:"text-slate-400"}),n("menu.impound_modal.impound_garage")]}),_.jsx(Af,{placeholder:n("menu.impound_modal.select_garage"),selectedKeys:o.selectedGarage?[o.selectedGarage]:[],onSelectionChange:b=>{const w=Array.from(b)[0];h("selectedGarage",w)},className:"w-full",classNames:{base:"bg-slate-800/50 border border-slate-600/50 rounded-lg",trigger:"bg-transparent border-none",value:"text-slate-200",popoverContent:"bg-slate-800/90 backdrop-blur-sm border border-slate-700"},isRequired:!0,children:t.impoundGarages.map(b=>_.jsx(Cf,{children:b},b))})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.2},children:[_.jsxs("label",{className:"text-sm font-medium text-slate-300 flex items-center gap-2",children:[_.jsx(ik,{className:"text-slate-400"}),n("menu.impound_modal.impound_time")]}),_.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"text-xs text-slate-400",children:n("menu.impound_modal.minutes")}),_.jsx(Fo,{minValue:0,value:o.minutes,onValueChange:b=>h("minutes",b),className:"bg-slate-800/50 border border-slate-600/50 rounded-lg",classNames:{input:"text-slate-200",inputWrapper:"bg-transparent border-none"}})]}),_.jsxs("div",{className:"space-y-2",children:[_.jsx("label",{className:"text-xs text-slate-400",children:n("menu.impound_modal.seconds")}),_.jsx(Fo,{minValue:0,maxValue:59,value:o.seconds,onValueChange:b=>h("seconds",b),className:"bg-slate-800/50 border border-slate-600/50 rounded-lg",classNames:{input:"text-slate-200",inputWrapper:"bg-transparent border-none"}})]})]}),_.jsx("div",{className:"text-xs text-slate-400",children:D7(o.minutes*60+o.seconds)})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.3},children:[_.jsxs("label",{className:"text-sm font-medium text-slate-300 flex items-center gap-2",children:[_.jsx(xD,{className:"text-slate-400 flex-shrink-0"}),_.jsxs("div",{children:[_.jsx("h1",{className:"text-medium font-medium text-slate-300",children:n("menu.impound_modal.pay_to_release")}),_.jsx("p",{className:"text-xs text-slate-400",children:n("menu.impound_modal.pay_to_release_description")})]})]}),_.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[_.jsxs(Zt,{variant:o.canPayToRelease==="yes"?"solid":"bordered",color:o.canPayToRelease==="yes"?"success":"default",className:`flex-1 h-12 transition-all duration-200 ${o.canPayToRelease==="yes"?"bg-green-600/20 border-green-500/50 text-green-300":"bg-slate-800/50 border-slate-600/50 text-slate-300"}`,onPress:()=>h("canPayToRelease","yes"),children:[_.jsx(pm,{className:"mr-2"}),n("menu.impound_modal.yes")]}),_.jsxs(Zt,{variant:o.canPayToRelease==="no"?"solid":"bordered",color:o.canPayToRelease==="no"?"danger":"default",className:`flex-1 h-12 transition-all duration-200 ${o.canPayToRelease==="no"?"bg-red-600/20 border-red-500/50 text-red-300":"bg-slate-800/50 border-slate-600/50 text-slate-300"}`,onPress:()=>h("canPayToRelease","no"),children:[_.jsx(Qp,{className:"mr-2"}),n("menu.impound_modal.no")]})]})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.4},children:[_.jsxs("label",{className:"text-sm font-medium text-slate-300 flex items-center gap-2",children:[_.jsx(c5,{className:"text-slate-400"}),n("menu.impound_modal.impound_fee")]}),_.jsx(Fo,{minValue:0,placeholder:"0",value:o.price,onValueChange:b=>h("price",b),startContent:_.jsx("span",{className:"text-slate-400",children:"$"}),className:"bg-slate-800/50 border border-slate-600/50 rounded-lg",classNames:{input:"text-slate-200",inputWrapper:"bg-transparent border-none"}})]}),_.jsxs(Ve.div,{className:"space-y-3",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.5},children:[_.jsxs("label",{className:"text-sm font-medium text-slate-300 flex items-center gap-2",children:[_.jsx(sk,{className:"text-slate-400"}),n("menu.impound_modal.note")]}),_.jsx(CU,{placeholder:n("menu.impound_modal.note_placeholder"),value:o.note,onChange:b=>h("note",b.target.value),className:"bg-slate-800/50 border border-slate-600/50 rounded-lg",minRows:3,maxRows:5})]}),_.jsxs(Ve.div,{className:"p-4 rounded-lg bg-gradient-to-r from-slate-700/50 to-slate-600/50 border border-slate-500/30",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.6},children:[_.jsx("h4",{className:"text-sm font-medium text-slate-300 mb-3",children:n("menu.impound_modal.summary")}),_.jsxs("div",{className:"space-y-2 text-xs text-slate-400",children:[_.jsxs("div",{className:"flex justify-between",children:[_.jsxs("span",{children:[n("menu.impound_modal.selected_garage"),":"]}),_.jsx("span",{className:"text-slate-200",children:t.impoundGarages.find(b=>b===o.selectedGarage)||n("menu.impound_modal.not_selected")})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsxs("span",{children:[n("menu.impound_modal.time"),":"]}),_.jsx("span",{className:"text-slate-200",children:D7(o.minutes*60+o.seconds)})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsx("span",{children:n("menu.impound_modal.pay_to_release")}),_.jsx(na,{color:o.canPayToRelease==="yes"?"success":"danger",variant:"flat",size:"sm",children:o.canPayToRelease==="yes"?n("menu.impound_modal.yes"):n("menu.impound_modal.no")})]}),_.jsxs("div",{className:"flex justify-between",children:[_.jsxs("span",{children:[n("menu.impound_modal.fee"),":"]}),r.format(o.price)]})]})]})]})}),_.jsx(rv,{className:"pt-4",children:_.jsxs(Ve.div,{className:"flex gap-3 w-full",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:.7},children:[_.jsx(Zt,{variant:"flat",color:"danger",startContent:_.jsx(Qp,{}),onPress:g,className:"flex-1 border border-slate-500/30 hoverable",children:n("menu.impound_modal.cancel")}),_.jsx(Zt,{color:"primary",startContent:_.jsx(SD,{}),onPress:d,isLoading:i,isDisabled:!p(),className:"flex-1 border border-slate-500/30",children:n("menu.impound_modal.send_to_impound")})]})})]})})}function Vhe(){const t=sn.c(9),[e,n,i]=xH("toggle_impound");let a;t[0]!==i?(a=u=>{i({visible:!1,impoundGarages:[]}),ut("close")},t[0]=i,t[1]=a):a=t[1];const s=a,r=!!e;let o;t[2]!==n||t[3]!==i?(o=n&&_.jsx(Fhe,{data:n,setData:i}),t[2]=n,t[3]=i,t[4]=o):o=t[4];let c;return t[5]!==s||t[6]!==r||t[7]!==o?(c=_.jsx(Up,{isOpen:r,onOpenChange:s,size:"2xl",children:o}),t[5]=s,t[6]=r,t[7]=o,t[8]=c):c=t[8],c}function khe(){const t=sn.c(6),[e,n]=xH("toggle_info_card"),i=vi(vr);let a;t[0]!==i||t[1]!==n||t[2]!==e?(a=e&&n&&_.jsx("div",{className:"absolute top-0 left-0 w-full h-full flex items-center p-4",children:_.jsxs(Ve.article,{className:Fie("item-slot border-4 border-white/25","overflow-x-hidden w-[24vw] shadow-[0px_0px_25px_0px_rgba(23,23,23,0.7)]","p-6 rounded-xl bg-gradient-to-br from-black/40 to-black/20"),initial:{opacity:0,y:50},animate:{opacity:1,y:0},transition:{duration:.6,delay:.2},whileHover:{boxShadow:"0px 0px_35px_0px rgba(23,23,23,0.9)",borderColor:"rgba(255,255,255,0.4)"},children:[_.jsxs("header",{className:"relative",children:[_.jsx(vH,{stats:n.stats}),_.jsx(Ve.figure,{className:"absolute top-[5vh] -right-[0vw] flex flex-col items-center justify-center w-full mt-4",initial:{opacity:0,y:-200,rotateZ:-20,scale:.8},animate:{opacity:.1,y:0,rotateZ:0,scale:1},transition:{duration:.3,delay:.1,ease:"easeOut"},children:_.jsx(yH,{src:`${i.imagePath}brands/${n.stats.logo}`,classNames:{img:"w-[18vw] h-[18vh] relative -z-50"}})})]}),_.jsx(Ve.div,{initial:{opacity:0,x:30,rotateY:15},animate:{opacity:1,x:0,rotateY:0},transition:{duration:.25,delay:.2},children:_.jsx(bH,{stats:n.stats})})]})}),t[0]=i,t[1]=n,t[2]=e,t[3]=a):a=t[3];let s;return t[4]!==a?(s=_.jsx(Hs,{children:a}),t[4]=a,t[5]=s):s=t[5],s}var iM={exports:{}},sd={};/**
* @license React
* react-reconciler-constants.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var O7;function Hhe(){return O7||(O7=1,sd.ConcurrentRoot=1,sd.ContinuousEventPriority=8,sd.DefaultEventPriority=32,sd.DiscreteEventPriority=2,sd.IdleEventPriority=268435456,sd.LegacyRoot=0,sd.NoEventPriority=0),sd}var I7;function $he(){return I7||(I7=1,iM.exports=Hhe()),iM.exports}var yS=$he();/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/const ww="180",Ghe={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},Whe={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},_H=0,A5=1,SH=2,Khe=3,wH=0,Ew=1,Ib=2,rc=3,Ed=0,Kr=1,xl=2,xd=0,Wp=1,R5=2,N5=3,P5=4,EH=5,Lf=100,MH=101,TH=102,CH=103,AH=104,RH=200,NH=201,PH=202,DH=203,a3=204,s3=205,LH=206,OH=207,IH=208,zH=209,BH=210,UH=211,jH=212,FH=213,VH=214,r3=0,o3=1,l3=2,nm=3,c3=4,u3=5,d3=6,f3=7,lx=0,kH=1,HH=2,mu=0,$H=1,GH=2,WH=3,ZA=4,KH=5,XH=6,qH=7,D5="attached",YH="detached",Mw=300,Md=301,Jf=302,_1=303,S1=304,cv=306,w1=1e3,El=1001,E1=1002,Fs=1003,QA=1004,Xhe=1004,vg=1005,qhe=1005,ja=1006,zb=1007,Yhe=1007,cu=1008,Zhe=1008,Pl=1009,JA=1010,e6=1011,jg=1012,Tw=1013,Td=1014,Hr=1015,bm=1016,Cw=1017,Aw=1018,Fg=1020,t6=35902,n6=35899,i6=1021,a6=1022,fr=1023,Vg=1026,kg=1027,Rw=1028,cx=1029,s6=1030,Nw=1031,Qhe=1032,Pw=1033,Bb=33776,Ub=33777,jb=33778,Fb=33779,h3=35840,p3=35841,m3=35842,g3=35843,v3=36196,y3=37492,b3=37496,x3=37808,_3=37809,S3=37810,w3=37811,E3=37812,M3=37813,T3=37814,C3=37815,A3=37816,R3=37817,N3=37818,P3=37819,D3=37820,L3=37821,O3=36492,I3=36494,z3=36495,B3=36283,U3=36284,j3=36285,F3=36286,ZH=2200,QH=2201,JH=2202,M1=2300,V3=2301,bS=2302,jp=2400,Fp=2401,T1=2402,Dw=2500,r6=2501,Jhe=0,epe=1,tpe=2,e$=3200,t$=3201,npe=3202,ipe=3203,hh=0,n$=1,md="",rr="srgb",eh="srgb-linear",C1="linear",Bi="srgb",ape=0,Ap=7680,spe=7681,rpe=7682,ope=7683,lpe=34055,cpe=34056,upe=5386,dpe=512,fpe=513,hpe=514,ppe=515,mpe=516,gpe=517,vpe=518,L5=519,i$=512,a$=513,s$=514,o6=515,r$=516,o$=517,l$=518,c$=519,A1=35044,ype=35048,bpe=35040,xpe=35045,_pe=35049,Spe=35041,wpe=35046,Epe=35050,Mpe=35042,Tpe="100",O5="300 es",ko=2e3,Hg=2001,Cpe={COMPUTE:"compute",RENDER:"render"},Ape={PERSPECTIVE:"perspective",LINEAR:"linear",FLAT:"flat"},Rpe={NORMAL:"normal",CENTROID:"centroid",SAMPLE:"sample",FIRST:"first",EITHER:"either"};class wu{addEventListener(e,n){this._listeners===void 0&&(this._listeners={});const i=this._listeners;i[e]===void 0&&(i[e]=[]),i[e].indexOf(n)===-1&&i[e].push(n)}hasEventListener(e,n){const i=this._listeners;return i===void 0?!1:i[e]!==void 0&&i[e].indexOf(n)!==-1}removeEventListener(e,n){const i=this._listeners;if(i===void 0)return;const a=i[e];if(a!==void 0){const s=a.indexOf(n);s!==-1&&a.splice(s,1)}}dispatchEvent(e){const n=this._listeners;if(n===void 0)return;const i=n[e.type];if(i!==void 0){e.target=this;const a=i.slice(0);for(let s=0,r=a.length;s<r;s++)a[s].call(this,e);e.target=null}}}const nr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let z7=1234567;const Kp=Math.PI/180,$g=180/Math.PI;function $o(){const t=Math.random()*4294967295|0,e=Math.random()*4294967295|0,n=Math.random()*4294967295|0,i=Math.random()*4294967295|0;return(nr[t&255]+nr[t>>8&255]+nr[t>>16&255]+nr[t>>24&255]+"-"+nr[e&255]+nr[e>>8&255]+"-"+nr[e>>16&15|64]+nr[e>>24&255]+"-"+nr[n&63|128]+nr[n>>8&255]+"-"+nr[n>>16&255]+nr[n>>24&255]+nr[i&255]+nr[i>>8&255]+nr[i>>16&255]+nr[i>>24&255]).toLowerCase()}function En(t,e,n){return Math.max(e,Math.min(n,t))}function l6(t,e){return(t%e+e)%e}function Npe(t,e,n,i,a){return i+(t-e)*(a-i)/(n-e)}function Ppe(t,e,n){return t!==e?(n-t)/(e-t):0}function Vb(t,e,n){return(1-n)*t+n*e}function Dpe(t,e,n,i){return Vb(t,e,1-Math.exp(-n*i))}function Lpe(t,e=1){return e-Math.abs(l6(t,e*2)-e)}function Ope(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*(3-2*t))}function Ipe(t,e,n){return t<=e?0:t>=n?1:(t=(t-e)/(n-e),t*t*t*(t*(t*6-15)+10))}function zpe(t,e){return t+Math.floor(Math.random()*(e-t+1))}function Bpe(t,e){return t+Math.random()*(e-t)}function Upe(t){return t*(.5-Math.random())}function jpe(t){t!==void 0&&(z7=t);let e=z7+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function Fpe(t){return t*Kp}function Vpe(t){return t*$g}function kpe(t){return(t&t-1)===0&&t!==0}function Hpe(t){return Math.pow(2,Math.ceil(Math.log(t)/Math.LN2))}function $pe(t){return Math.pow(2,Math.floor(Math.log(t)/Math.LN2))}function Gpe(t,e,n,i,a){const s=Math.cos,r=Math.sin,o=s(n/2),c=r(n/2),u=s((e+i)/2),h=r((e+i)/2),d=s((e-i)/2),p=r((e-i)/2),g=s((i-e)/2),b=r((i-e)/2);switch(a){case"XYX":t.set(o*h,c*d,c*p,o*u);break;case"YZY":t.set(c*p,o*h,c*d,o*u);break;case"ZXZ":t.set(c*d,c*p,o*h,o*u);break;case"XZX":t.set(o*h,c*b,c*g,o*u);break;case"YXY":t.set(c*g,o*h,c*b,o*u);break;case"ZYZ":t.set(c*b,c*g,o*h,o*u);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+a)}}function Vr(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return t/4294967295;case Uint16Array:return t/65535;case Uint8Array:return t/255;case Int32Array:return Math.max(t/2147483647,-1);case Int16Array:return Math.max(t/32767,-1);case Int8Array:return Math.max(t/127,-1);default:throw new Error("Invalid component type.")}}function Vn(t,e){switch(e.constructor){case Float32Array:return t;case Uint32Array:return Math.round(t*4294967295);case Uint16Array:return Math.round(t*65535);case Uint8Array:return Math.round(t*255);case Int32Array:return Math.round(t*2147483647);case Int16Array:return Math.round(t*32767);case Int8Array:return Math.round(t*127);default:throw new Error("Invalid component type.")}}const iu={DEG2RAD:Kp,RAD2DEG:$g,generateUUID:$o,clamp:En,euclideanModulo:l6,mapLinear:Npe,inverseLerp:Ppe,lerp:Vb,damp:Dpe,pingpong:Lpe,smoothstep:Ope,smootherstep:Ipe,randInt:zpe,randFloat:Bpe,randFloatSpread:Upe,seededRandom:jpe,degToRad:Fpe,radToDeg:Vpe,isPowerOfTwo:kpe,ceilPowerOfTwo:Hpe,floorPowerOfTwo:$pe,setQuaternionFromProperEuler:Gpe,normalize:Vn,denormalize:Vr};class _t{constructor(e=0,n=0){_t.prototype.isVector2=!0,this.x=e,this.y=n}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,n){return this.x=e,this.y=n,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const n=this.x,i=this.y,a=e.elements;return this.x=a[0]*n+a[3]*i+a[6],this.y=a[1]*n+a[4]*i+a[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,n){return this.x=En(this.x,e.x,n.x),this.y=En(this.y,e.y,n.y),this}clampScalar(e,n){return this.x=En(this.x,e,n),this.y=En(this.y,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(En(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(En(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y;return n*n+i*i}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this}rotateAround(e,n){const i=Math.cos(n),a=Math.sin(n),s=this.x-e.x,r=this.y-e.y;return this.x=s*i-r*a+e.x,this.y=s*a+r*i+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Li{constructor(e=0,n=0,i=0,a=1){this.isQuaternion=!0,this._x=e,this._y=n,this._z=i,this._w=a}static slerpFlat(e,n,i,a,s,r,o){let c=i[a+0],u=i[a+1],h=i[a+2],d=i[a+3];const p=s[r+0],g=s[r+1],b=s[r+2],w=s[r+3];if(o===0){e[n+0]=c,e[n+1]=u,e[n+2]=h,e[n+3]=d;return}if(o===1){e[n+0]=p,e[n+1]=g,e[n+2]=b,e[n+3]=w;return}if(d!==w||c!==p||u!==g||h!==b){let x=1-o;const S=c*p+u*g+h*b+d*w,M=S>=0?1:-1,C=1-S*S;if(C>Number.EPSILON){const N=Math.sqrt(C),R=Math.atan2(N,S*M);x=Math.sin(x*R)/N,o=Math.sin(o*R)/N}const A=o*M;if(c=c*x+p*A,u=u*x+g*A,h=h*x+b*A,d=d*x+w*A,x===1-o){const N=1/Math.sqrt(c*c+u*u+h*h+d*d);c*=N,u*=N,h*=N,d*=N}}e[n]=c,e[n+1]=u,e[n+2]=h,e[n+3]=d}static multiplyQuaternionsFlat(e,n,i,a,s,r){const o=i[a],c=i[a+1],u=i[a+2],h=i[a+3],d=s[r],p=s[r+1],g=s[r+2],b=s[r+3];return e[n]=o*b+h*d+c*g-u*p,e[n+1]=c*b+h*p+u*d-o*g,e[n+2]=u*b+h*g+o*p-c*d,e[n+3]=h*b-o*d-c*p-u*g,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,n,i,a){return this._x=e,this._y=n,this._z=i,this._w=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,n=!0){const i=e._x,a=e._y,s=e._z,r=e._order,o=Math.cos,c=Math.sin,u=o(i/2),h=o(a/2),d=o(s/2),p=c(i/2),g=c(a/2),b=c(s/2);switch(r){case"XYZ":this._x=p*h*d+u*g*b,this._y=u*g*d-p*h*b,this._z=u*h*b+p*g*d,this._w=u*h*d-p*g*b;break;case"YXZ":this._x=p*h*d+u*g*b,this._y=u*g*d-p*h*b,this._z=u*h*b-p*g*d,this._w=u*h*d+p*g*b;break;case"ZXY":this._x=p*h*d-u*g*b,this._y=u*g*d+p*h*b,this._z=u*h*b+p*g*d,this._w=u*h*d-p*g*b;break;case"ZYX":this._x=p*h*d-u*g*b,this._y=u*g*d+p*h*b,this._z=u*h*b-p*g*d,this._w=u*h*d+p*g*b;break;case"YZX":this._x=p*h*d+u*g*b,this._y=u*g*d+p*h*b,this._z=u*h*b-p*g*d,this._w=u*h*d-p*g*b;break;case"XZY":this._x=p*h*d-u*g*b,this._y=u*g*d-p*h*b,this._z=u*h*b+p*g*d,this._w=u*h*d+p*g*b;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+r)}return n===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,n){const i=n/2,a=Math.sin(i);return this._x=e.x*a,this._y=e.y*a,this._z=e.z*a,this._w=Math.cos(i),this._onChangeCallback(),this}setFromRotationMatrix(e){const n=e.elements,i=n[0],a=n[4],s=n[8],r=n[1],o=n[5],c=n[9],u=n[2],h=n[6],d=n[10],p=i+o+d;if(p>0){const g=.5/Math.sqrt(p+1);this._w=.25/g,this._x=(h-c)*g,this._y=(s-u)*g,this._z=(r-a)*g}else if(i>o&&i>d){const g=2*Math.sqrt(1+i-o-d);this._w=(h-c)/g,this._x=.25*g,this._y=(a+r)/g,this._z=(s+u)/g}else if(o>d){const g=2*Math.sqrt(1+o-i-d);this._w=(s-u)/g,this._x=(a+r)/g,this._y=.25*g,this._z=(c+h)/g}else{const g=2*Math.sqrt(1+d-i-o);this._w=(r-a)/g,this._x=(s+u)/g,this._y=(c+h)/g,this._z=.25*g}return this._onChangeCallback(),this}setFromUnitVectors(e,n){let i=e.dot(n)+1;return i<1e-8?(i=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=i):(this._x=0,this._y=-e.z,this._z=e.y,this._w=i)):(this._x=e.y*n.z-e.z*n.y,this._y=e.z*n.x-e.x*n.z,this._z=e.x*n.y-e.y*n.x,this._w=i),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(En(this.dot(e),-1,1)))}rotateTowards(e,n){const i=this.angleTo(e);if(i===0)return this;const a=Math.min(1,n/i);return this.slerp(e,a),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,n){const i=e._x,a=e._y,s=e._z,r=e._w,o=n._x,c=n._y,u=n._z,h=n._w;return this._x=i*h+r*o+a*u-s*c,this._y=a*h+r*c+s*o-i*u,this._z=s*h+r*u+i*c-a*o,this._w=r*h-i*o-a*c-s*u,this._onChangeCallback(),this}slerp(e,n){if(n===0)return this;if(n===1)return this.copy(e);const i=this._x,a=this._y,s=this._z,r=this._w;let o=r*e._w+i*e._x+a*e._y+s*e._z;if(o<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,o=-o):this.copy(e),o>=1)return this._w=r,this._x=i,this._y=a,this._z=s,this;const c=1-o*o;if(c<=Number.EPSILON){const g=1-n;return this._w=g*r+n*this._w,this._x=g*i+n*this._x,this._y=g*a+n*this._y,this._z=g*s+n*this._z,this.normalize(),this}const u=Math.sqrt(c),h=Math.atan2(u,o),d=Math.sin((1-n)*h)/u,p=Math.sin(n*h)/u;return this._w=r*d+this._w*p,this._x=i*d+this._x*p,this._y=a*d+this._y*p,this._z=s*d+this._z*p,this._onChangeCallback(),this}slerpQuaternions(e,n,i){return this.copy(e).slerp(n,i)}random(){const e=2*Math.PI*Math.random(),n=2*Math.PI*Math.random(),i=Math.random(),a=Math.sqrt(1-i),s=Math.sqrt(i);return this.set(a*Math.sin(e),a*Math.cos(e),s*Math.sin(n),s*Math.cos(n))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,n=0){return this._x=e[n],this._y=e[n+1],this._z=e[n+2],this._w=e[n+3],this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._w,e}fromBufferAttribute(e,n){return this._x=e.getX(n),this._y=e.getY(n),this._z=e.getZ(n),this._w=e.getW(n),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class fe{constructor(e=0,n=0,i=0){fe.prototype.isVector3=!0,this.x=e,this.y=n,this.z=i}set(e,n,i){return i===void 0&&(i=this.z),this.x=e,this.y=n,this.z=i,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,n){return this.x=e.x*n.x,this.y=e.y*n.y,this.z=e.z*n.z,this}applyEuler(e){return this.applyQuaternion(B7.setFromEuler(e))}applyAxisAngle(e,n){return this.applyQuaternion(B7.setFromAxisAngle(e,n))}applyMatrix3(e){const n=this.x,i=this.y,a=this.z,s=e.elements;return this.x=s[0]*n+s[3]*i+s[6]*a,this.y=s[1]*n+s[4]*i+s[7]*a,this.z=s[2]*n+s[5]*i+s[8]*a,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const n=this.x,i=this.y,a=this.z,s=e.elements,r=1/(s[3]*n+s[7]*i+s[11]*a+s[15]);return this.x=(s[0]*n+s[4]*i+s[8]*a+s[12])*r,this.y=(s[1]*n+s[5]*i+s[9]*a+s[13])*r,this.z=(s[2]*n+s[6]*i+s[10]*a+s[14])*r,this}applyQuaternion(e){const n=this.x,i=this.y,a=this.z,s=e.x,r=e.y,o=e.z,c=e.w,u=2*(r*a-o*i),h=2*(o*n-s*a),d=2*(s*i-r*n);return this.x=n+c*u+r*d-o*h,this.y=i+c*h+o*u-s*d,this.z=a+c*d+s*h-r*u,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const n=this.x,i=this.y,a=this.z,s=e.elements;return this.x=s[0]*n+s[4]*i+s[8]*a,this.y=s[1]*n+s[5]*i+s[9]*a,this.z=s[2]*n+s[6]*i+s[10]*a,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,n){return this.x=En(this.x,e.x,n.x),this.y=En(this.y,e.y,n.y),this.z=En(this.z,e.z,n.z),this}clampScalar(e,n){return this.x=En(this.x,e,n),this.y=En(this.y,e,n),this.z=En(this.z,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(En(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,n){const i=e.x,a=e.y,s=e.z,r=n.x,o=n.y,c=n.z;return this.x=a*c-s*o,this.y=s*r-i*c,this.z=i*o-a*r,this}projectOnVector(e){const n=e.lengthSq();if(n===0)return this.set(0,0,0);const i=e.dot(this)/n;return this.copy(e).multiplyScalar(i)}projectOnPlane(e){return aM.copy(this).projectOnVector(e),this.sub(aM)}reflect(e){return this.sub(aM.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const n=Math.sqrt(this.lengthSq()*e.lengthSq());if(n===0)return Math.PI/2;const i=this.dot(e)/n;return Math.acos(En(i,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const n=this.x-e.x,i=this.y-e.y,a=this.z-e.z;return n*n+i*i+a*a}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,n,i){const a=Math.sin(n)*e;return this.x=a*Math.sin(i),this.y=Math.cos(n)*e,this.z=a*Math.cos(i),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,n,i){return this.x=e*Math.sin(n),this.y=i,this.z=e*Math.cos(n),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this}setFromMatrixScale(e){const n=this.setFromMatrixColumn(e,0).length(),i=this.setFromMatrixColumn(e,1).length(),a=this.setFromMatrixColumn(e,2).length();return this.x=n,this.y=i,this.z=a,this}setFromMatrixColumn(e,n){return this.fromArray(e.elements,n*4)}setFromMatrix3Column(e,n){return this.fromArray(e.elements,n*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,n=Math.random()*2-1,i=Math.sqrt(1-n*n);return this.x=i*Math.cos(e),this.y=n,this.z=i*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const aM=new fe,B7=new Li;class jn{constructor(e,n,i,a,s,r,o,c,u){jn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,n,i,a,s,r,o,c,u)}set(e,n,i,a,s,r,o,c,u){const h=this.elements;return h[0]=e,h[1]=a,h[2]=o,h[3]=n,h[4]=s,h[5]=c,h[6]=i,h[7]=r,h[8]=u,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],this}extractBasis(e,n,i){return e.setFromMatrix3Column(this,0),n.setFromMatrix3Column(this,1),i.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const n=e.elements;return this.set(n[0],n[4],n[8],n[1],n[5],n[9],n[2],n[6],n[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,a=n.elements,s=this.elements,r=i[0],o=i[3],c=i[6],u=i[1],h=i[4],d=i[7],p=i[2],g=i[5],b=i[8],w=a[0],x=a[3],S=a[6],M=a[1],C=a[4],A=a[7],N=a[2],R=a[5],D=a[8];return s[0]=r*w+o*M+c*N,s[3]=r*x+o*C+c*R,s[6]=r*S+o*A+c*D,s[1]=u*w+h*M+d*N,s[4]=u*x+h*C+d*R,s[7]=u*S+h*A+d*D,s[2]=p*w+g*M+b*N,s[5]=p*x+g*C+b*R,s[8]=p*S+g*A+b*D,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[3]*=e,n[6]*=e,n[1]*=e,n[4]*=e,n[7]*=e,n[2]*=e,n[5]*=e,n[8]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[1],a=e[2],s=e[3],r=e[4],o=e[5],c=e[6],u=e[7],h=e[8];return n*r*h-n*o*u-i*s*h+i*o*c+a*s*u-a*r*c}invert(){const e=this.elements,n=e[0],i=e[1],a=e[2],s=e[3],r=e[4],o=e[5],c=e[6],u=e[7],h=e[8],d=h*r-o*u,p=o*c-h*s,g=u*s-r*c,b=n*d+i*p+a*g;if(b===0)return this.set(0,0,0,0,0,0,0,0,0);const w=1/b;return e[0]=d*w,e[1]=(a*u-h*i)*w,e[2]=(o*i-a*r)*w,e[3]=p*w,e[4]=(h*n-a*c)*w,e[5]=(a*s-o*n)*w,e[6]=g*w,e[7]=(i*c-u*n)*w,e[8]=(r*n-i*s)*w,this}transpose(){let e;const n=this.elements;return e=n[1],n[1]=n[3],n[3]=e,e=n[2],n[2]=n[6],n[6]=e,e=n[5],n[5]=n[7],n[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const n=this.elements;return e[0]=n[0],e[1]=n[3],e[2]=n[6],e[3]=n[1],e[4]=n[4],e[5]=n[7],e[6]=n[2],e[7]=n[5],e[8]=n[8],this}setUvTransform(e,n,i,a,s,r,o){const c=Math.cos(s),u=Math.sin(s);return this.set(i*c,i*u,-i*(c*r+u*o)+r+e,-a*u,a*c,-a*(-u*r+c*o)+o+n,0,0,1),this}scale(e,n){return this.premultiply(sM.makeScale(e,n)),this}rotate(e){return this.premultiply(sM.makeRotation(-e)),this}translate(e,n){return this.premultiply(sM.makeTranslation(e,n)),this}makeTranslation(e,n){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,n,0,0,1),this}makeRotation(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,i,n,0,0,0,1),this}makeScale(e,n){return this.set(e,0,0,0,n,0,0,0,1),this}equals(e){const n=this.elements,i=e.elements;for(let a=0;a<9;a++)if(n[a]!==i[a])return!1;return!0}fromArray(e,n=0){for(let i=0;i<9;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const sM=new jn;function u$(t){for(let e=t.length-1;e>=0;--e)if(t[e]>=65535)return!0;return!1}const Wpe={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function yg(t,e){return new Wpe[t](e)}function R1(t){return document.createElementNS("http://www.w3.org/1999/xhtml",t)}function d$(){const t=R1("canvas");return t.style.display="block",t}const U7={};function N1(t){t in U7||(U7[t]=!0,console.warn(t))}function Kpe(t,e,n){return new Promise(function(i,a){function s(){switch(t.clientWaitSync(e,t.SYNC_FLUSH_COMMANDS_BIT,0)){case t.WAIT_FAILED:a();break;case t.TIMEOUT_EXPIRED:setTimeout(s,n);break;default:i()}}setTimeout(s,n)})}const j7=new jn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),F7=new jn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function Xpe(){const t={enabled:!0,workingColorSpace:eh,spaces:{},convert:function(a,s,r){return this.enabled===!1||s===r||!s||!r||(this.spaces[s].transfer===Bi&&(a.r=_d(a.r),a.g=_d(a.g),a.b=_d(a.b)),this.spaces[s].primaries!==this.spaces[r].primaries&&(a.applyMatrix3(this.spaces[s].toXYZ),a.applyMatrix3(this.spaces[r].fromXYZ)),this.spaces[r].transfer===Bi&&(a.r=Ag(a.r),a.g=Ag(a.g),a.b=Ag(a.b))),a},workingToColorSpace:function(a,s){return this.convert(a,this.workingColorSpace,s)},colorSpaceToWorking:function(a,s){return this.convert(a,s,this.workingColorSpace)},getPrimaries:function(a){return this.spaces[a].primaries},getTransfer:function(a){return a===md?C1:this.spaces[a].transfer},getToneMappingMode:function(a){return this.spaces[a].outputColorSpaceConfig.toneMappingMode||"standard"},getLuminanceCoefficients:function(a,s=this.workingColorSpace){return a.fromArray(this.spaces[s].luminanceCoefficients)},define:function(a){Object.assign(this.spaces,a)},_getMatrix:function(a,s,r){return a.copy(this.spaces[s].toXYZ).multiply(this.spaces[r].fromXYZ)},_getDrawingBufferColorSpace:function(a){return this.spaces[a].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(a=this.workingColorSpace){return this.spaces[a].workingColorSpaceConfig.unpackColorSpace},fromWorkingColorSpace:function(a,s){return N1("THREE.ColorManagement: .fromWorkingColorSpace() has been renamed to .workingToColorSpace()."),t.workingToColorSpace(a,s)},toWorkingColorSpace:function(a,s){return N1("THREE.ColorManagement: .toWorkingColorSpace() has been renamed to .colorSpaceToWorking()."),t.colorSpaceToWorking(a,s)}},e=[.64,.33,.3,.6,.15,.06],n=[.2126,.7152,.0722],i=[.3127,.329];return t.define({[eh]:{primaries:e,whitePoint:i,transfer:C1,toXYZ:j7,fromXYZ:F7,luminanceCoefficients:n,workingColorSpaceConfig:{unpackColorSpace:rr},outputColorSpaceConfig:{drawingBufferColorSpace:rr}},[rr]:{primaries:e,whitePoint:i,transfer:Bi,toXYZ:j7,fromXYZ:F7,luminanceCoefficients:n,outputColorSpaceConfig:{drawingBufferColorSpace:rr}}}),t}const mi=Xpe();function _d(t){return t<.04045?t*.0773993808:Math.pow(t*.9478672986+.0521327014,2.4)}function Ag(t){return t<.0031308?t*12.92:1.055*Math.pow(t,.41666)-.055}let O0;class f${static getDataURL(e,n="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let i;if(e instanceof HTMLCanvasElement)i=e;else{O0===void 0&&(O0=R1("canvas")),O0.width=e.width,O0.height=e.height;const a=O0.getContext("2d");e instanceof ImageData?a.putImageData(e,0,0):a.drawImage(e,0,0,e.width,e.height),i=O0}return i.toDataURL(n)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const n=R1("canvas");n.width=e.width,n.height=e.height;const i=n.getContext("2d");i.drawImage(e,0,0,e.width,e.height);const a=i.getImageData(0,0,e.width,e.height),s=a.data;for(let r=0;r<s.length;r++)s[r]=_d(s[r]/255)*255;return i.putImageData(a,0,0),n}else if(e.data){const n=e.data.slice(0);for(let i=0;i<n.length;i++)n instanceof Uint8Array||n instanceof Uint8ClampedArray?n[i]=Math.floor(_d(n[i]/255)*255):n[i]=_d(n[i]);return{data:n,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let qpe=0;class Uf{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:qpe++}),this.uuid=$o(),this.data=e,this.dataReady=!0,this.version=0}getSize(e){const n=this.data;return typeof HTMLVideoElement<"u"&&n instanceof HTMLVideoElement?e.set(n.videoWidth,n.videoHeight,0):n instanceof VideoFrame?e.set(n.displayHeight,n.displayWidth,0):n!==null?e.set(n.width,n.height,n.depth||0):e.set(0,0,0),e}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const i={uuid:this.uuid,url:""},a=this.data;if(a!==null){let s;if(Array.isArray(a)){s=[];for(let r=0,o=a.length;r<o;r++)a[r].isDataTexture?s.push(rM(a[r].image)):s.push(rM(a[r]))}else s=rM(a);i.url=s}return n||(e.images[this.uuid]=i),i}}function rM(t){return typeof HTMLImageElement<"u"&&t instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&t instanceof ImageBitmap?f$.getDataURL(t):t.data?{data:Array.from(t.data),width:t.width,height:t.height,type:t.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let Ype=0;const oM=new fe;class Na extends wu{constructor(e=Na.DEFAULT_IMAGE,n=Na.DEFAULT_MAPPING,i=El,a=El,s=ja,r=cu,o=fr,c=Pl,u=Na.DEFAULT_ANISOTROPY,h=md){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:Ype++}),this.uuid=$o(),this.name="",this.source=new Uf(e),this.mipmaps=[],this.mapping=n,this.channel=0,this.wrapS=i,this.wrapT=a,this.magFilter=s,this.minFilter=r,this.anisotropy=u,this.format=o,this.internalFormat=null,this.type=c,this.offset=new _t(0,0),this.repeat=new _t(1,1),this.center=new _t(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new jn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace=h,this.userData={},this.updateRanges=[],this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.isArrayTexture=!!(e&&e.depth&&e.depth>1),this.pmremVersion=0}get width(){return this.source.getSize(oM).x}get height(){return this.source.getSize(oM).y}get depth(){return this.source.getSize(oM).z}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.isArrayTexture=e.isArrayTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}setValues(e){for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Texture.setValues(): parameter '${n}' has value of undefined.`);continue}const a=this[n];if(a===void 0){console.warn(`THREE.Texture.setValues(): property '${n}' does not exist.`);continue}a&&i&&a.isVector2&&i.isVector2||a&&i&&a.isVector3&&i.isVector3||a&&i&&a.isMatrix3&&i.isMatrix3?a.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";if(!n&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const i={metadata:{version:4.7,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(i.userData=this.userData),n||(e.textures[this.uuid]=i),i}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==Mw)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case w1:e.x=e.x-Math.floor(e.x);break;case El:e.x=e.x<0?0:1;break;case E1:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case w1:e.y=e.y-Math.floor(e.y);break;case El:e.y=e.y<0?0:1;break;case E1:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Na.DEFAULT_IMAGE=null;Na.DEFAULT_MAPPING=Mw;Na.DEFAULT_ANISOTROPY=1;class xi{constructor(e=0,n=0,i=0,a=1){xi.prototype.isVector4=!0,this.x=e,this.y=n,this.z=i,this.w=a}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,n,i,a){return this.x=e,this.y=n,this.z=i,this.w=a,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,n){switch(e){case 0:this.x=n;break;case 1:this.y=n;break;case 2:this.z=n;break;case 3:this.w=n;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,n){return this.x=e.x+n.x,this.y=e.y+n.y,this.z=e.z+n.z,this.w=e.w+n.w,this}addScaledVector(e,n){return this.x+=e.x*n,this.y+=e.y*n,this.z+=e.z*n,this.w+=e.w*n,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,n){return this.x=e.x-n.x,this.y=e.y-n.y,this.z=e.z-n.z,this.w=e.w-n.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const n=this.x,i=this.y,a=this.z,s=this.w,r=e.elements;return this.x=r[0]*n+r[4]*i+r[8]*a+r[12]*s,this.y=r[1]*n+r[5]*i+r[9]*a+r[13]*s,this.z=r[2]*n+r[6]*i+r[10]*a+r[14]*s,this.w=r[3]*n+r[7]*i+r[11]*a+r[15]*s,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const n=Math.sqrt(1-e.w*e.w);return n<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/n,this.y=e.y/n,this.z=e.z/n),this}setAxisAngleFromRotationMatrix(e){let n,i,a,s;const c=e.elements,u=c[0],h=c[4],d=c[8],p=c[1],g=c[5],b=c[9],w=c[2],x=c[6],S=c[10];if(Math.abs(h-p)<.01&&Math.abs(d-w)<.01&&Math.abs(b-x)<.01){if(Math.abs(h+p)<.1&&Math.abs(d+w)<.1&&Math.abs(b+x)<.1&&Math.abs(u+g+S-3)<.1)return this.set(1,0,0,0),this;n=Math.PI;const C=(u+1)/2,A=(g+1)/2,N=(S+1)/2,R=(h+p)/4,D=(d+w)/4,B=(b+x)/4;return C>A&&C>N?C<.01?(i=0,a=.707106781,s=.707106781):(i=Math.sqrt(C),a=R/i,s=D/i):A>N?A<.01?(i=.707106781,a=0,s=.707106781):(a=Math.sqrt(A),i=R/a,s=B/a):N<.01?(i=.707106781,a=.707106781,s=0):(s=Math.sqrt(N),i=D/s,a=B/s),this.set(i,a,s,n),this}let M=Math.sqrt((x-b)*(x-b)+(d-w)*(d-w)+(p-h)*(p-h));return Math.abs(M)<.001&&(M=1),this.x=(x-b)/M,this.y=(d-w)/M,this.z=(p-h)/M,this.w=Math.acos((u+g+S-1)/2),this}setFromMatrixPosition(e){const n=e.elements;return this.x=n[12],this.y=n[13],this.z=n[14],this.w=n[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,n){return this.x=En(this.x,e.x,n.x),this.y=En(this.y,e.y,n.y),this.z=En(this.z,e.z,n.z),this.w=En(this.w,e.w,n.w),this}clampScalar(e,n){return this.x=En(this.x,e,n),this.y=En(this.y,e,n),this.z=En(this.z,e,n),this.w=En(this.w,e,n),this}clampLength(e,n){const i=this.length();return this.divideScalar(i||1).multiplyScalar(En(i,e,n))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,n){return this.x+=(e.x-this.x)*n,this.y+=(e.y-this.y)*n,this.z+=(e.z-this.z)*n,this.w+=(e.w-this.w)*n,this}lerpVectors(e,n,i){return this.x=e.x+(n.x-e.x)*i,this.y=e.y+(n.y-e.y)*i,this.z=e.z+(n.z-e.z)*i,this.w=e.w+(n.w-e.w)*i,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,n=0){return this.x=e[n],this.y=e[n+1],this.z=e[n+2],this.w=e[n+3],this}toArray(e=[],n=0){return e[n]=this.x,e[n+1]=this.y,e[n+2]=this.z,e[n+3]=this.w,e}fromBufferAttribute(e,n){return this.x=e.getX(n),this.y=e.getY(n),this.z=e.getZ(n),this.w=e.getW(n),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class c6 extends wu{constructor(e=1,n=1,i={}){super(),i=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:ja,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1,depth:1,multiview:!1},i),this.isRenderTarget=!0,this.width=e,this.height=n,this.depth=i.depth,this.scissor=new xi(0,0,e,n),this.scissorTest=!1,this.viewport=new xi(0,0,e,n);const a={width:e,height:n,depth:i.depth},s=new Na(a);this.textures=[];const r=i.count;for(let o=0;o<r;o++)this.textures[o]=s.clone(),this.textures[o].isRenderTargetTexture=!0,this.textures[o].renderTarget=this;this._setTextureOptions(i),this.depthBuffer=i.depthBuffer,this.stencilBuffer=i.stencilBuffer,this.resolveDepthBuffer=i.resolveDepthBuffer,this.resolveStencilBuffer=i.resolveStencilBuffer,this._depthTexture=null,this.depthTexture=i.depthTexture,this.samples=i.samples,this.multiview=i.multiview}_setTextureOptions(e={}){const n={minFilter:ja,generateMipmaps:!1,flipY:!1,internalFormat:null};e.mapping!==void 0&&(n.mapping=e.mapping),e.wrapS!==void 0&&(n.wrapS=e.wrapS),e.wrapT!==void 0&&(n.wrapT=e.wrapT),e.wrapR!==void 0&&(n.wrapR=e.wrapR),e.magFilter!==void 0&&(n.magFilter=e.magFilter),e.minFilter!==void 0&&(n.minFilter=e.minFilter),e.format!==void 0&&(n.format=e.format),e.type!==void 0&&(n.type=e.type),e.anisotropy!==void 0&&(n.anisotropy=e.anisotropy),e.colorSpace!==void 0&&(n.colorSpace=e.colorSpace),e.flipY!==void 0&&(n.flipY=e.flipY),e.generateMipmaps!==void 0&&(n.generateMipmaps=e.generateMipmaps),e.internalFormat!==void 0&&(n.internalFormat=e.internalFormat);for(let i=0;i<this.textures.length;i++)this.textures[i].setValues(n)}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,n,i=1){if(this.width!==e||this.height!==n||this.depth!==i){this.width=e,this.height=n,this.depth=i;for(let a=0,s=this.textures.length;a<s;a++)this.textures[a].image.width=e,this.textures[a].image.height=n,this.textures[a].image.depth=i,this.textures[a].isArrayTexture=this.textures[a].image.depth>1;this.dispose()}this.viewport.set(0,0,e,n),this.scissor.set(0,0,e,n)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let n=0,i=e.textures.length;n<i;n++){this.textures[n]=e.textures[n].clone(),this.textures[n].isRenderTargetTexture=!0,this.textures[n].renderTarget=this;const a=Object.assign({},e.textures[n].image);this.textures[n].source=new Uf(a)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class hc extends c6{constructor(e=1,n=1,i={}){super(e,n,i),this.isWebGLRenderTarget=!0}}class Lw extends Na{constructor(e=null,n=1,i=1,a=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:n,height:i,depth:a},this.magFilter=Fs,this.minFilter=Fs,this.wrapR=El,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Zpe extends hc{constructor(e=1,n=1,i=1,a={}){super(e,n,a),this.isWebGLArrayRenderTarget=!0,this.depth=i,this.texture=new Lw(null,e,n,i),this._setTextureOptions(a),this.texture.isRenderTargetTexture=!0}}class Ow extends Na{constructor(e=null,n=1,i=1,a=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:n,height:i,depth:a},this.magFilter=Fs,this.minFilter=Fs,this.wrapR=El,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class Qpe extends hc{constructor(e=1,n=1,i=1,a={}){super(e,n,a),this.isWebGL3DRenderTarget=!0,this.depth=i,this.texture=new Ow(null,e,n,i),this._setTextureOptions(a),this.texture.isRenderTargetTexture=!0}}class mr{constructor(e=new fe(1/0,1/0,1/0),n=new fe(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromArray(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n+=3)this.expandByPoint(nc.fromArray(e,n));return this}setFromBufferAttribute(e){this.makeEmpty();for(let n=0,i=e.count;n<i;n++)this.expandByPoint(nc.fromBufferAttribute(e,n));return this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=nc.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}setFromObject(e,n=!1){return this.makeEmpty(),this.expandByObject(e,n)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,n=!1){e.updateWorldMatrix(!1,!1);const i=e.geometry;if(i!==void 0){const s=i.getAttribute("position");if(n===!0&&s!==void 0&&e.isInstancedMesh!==!0)for(let r=0,o=s.count;r<o;r++)e.isMesh===!0?e.getVertexPosition(r,nc):nc.fromBufferAttribute(s,r),nc.applyMatrix4(e.matrixWorld),this.expandByPoint(nc);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),c_.copy(e.boundingBox)):(i.boundingBox===null&&i.computeBoundingBox(),c_.copy(i.boundingBox)),c_.applyMatrix4(e.matrixWorld),this.union(c_)}const a=e.children;for(let s=0,r=a.length;s<r;s++)this.expandByObject(a[s],n);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,nc),nc.distanceToSquared(e.center)<=e.radius*e.radius}intersectsPlane(e){let n,i;return e.normal.x>0?(n=e.normal.x*this.min.x,i=e.normal.x*this.max.x):(n=e.normal.x*this.max.x,i=e.normal.x*this.min.x),e.normal.y>0?(n+=e.normal.y*this.min.y,i+=e.normal.y*this.max.y):(n+=e.normal.y*this.max.y,i+=e.normal.y*this.min.y),e.normal.z>0?(n+=e.normal.z*this.min.z,i+=e.normal.z*this.max.z):(n+=e.normal.z*this.max.z,i+=e.normal.z*this.min.z),n<=-e.constant&&i>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(Jy),u_.subVectors(this.max,Jy),I0.subVectors(e.a,Jy),z0.subVectors(e.b,Jy),B0.subVectors(e.c,Jy),yf.subVectors(z0,I0),bf.subVectors(B0,z0),fp.subVectors(I0,B0);let n=[0,-yf.z,yf.y,0,-bf.z,bf.y,0,-fp.z,fp.y,yf.z,0,-yf.x,bf.z,0,-bf.x,fp.z,0,-fp.x,-yf.y,yf.x,0,-bf.y,bf.x,0,-fp.y,fp.x,0];return!lM(n,I0,z0,B0,u_)||(n=[1,0,0,0,1,0,0,0,1],!lM(n,I0,z0,B0,u_))?!1:(d_.crossVectors(yf,bf),n=[d_.x,d_.y,d_.z],lM(n,I0,z0,B0,u_))}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,nc).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(nc).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(rd[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),rd[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),rd[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),rd[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),rd[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),rd[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),rd[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),rd[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(rd),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}toJSON(){return{min:this.min.toArray(),max:this.max.toArray()}}fromJSON(e){return this.min.fromArray(e.min),this.max.fromArray(e.max),this}}const rd=[new fe,new fe,new fe,new fe,new fe,new fe,new fe,new fe],nc=new fe,c_=new mr,I0=new fe,z0=new fe,B0=new fe,yf=new fe,bf=new fe,fp=new fe,Jy=new fe,u_=new fe,d_=new fe,hp=new fe;function lM(t,e,n,i,a){for(let s=0,r=t.length-3;s<=r;s+=3){hp.fromArray(t,s);const o=a.x*Math.abs(hp.x)+a.y*Math.abs(hp.y)+a.z*Math.abs(hp.z),c=e.dot(hp),u=n.dot(hp),h=i.dot(hp);if(Math.max(-Math.max(c,u,h),Math.min(c,u,h))>o)return!1}return!0}const Jpe=new mr,eb=new fe,cM=new fe;class Vs{constructor(e=new fe,n=-1){this.isSphere=!0,this.center=e,this.radius=n}set(e,n){return this.center.copy(e),this.radius=n,this}setFromPoints(e,n){const i=this.center;n!==void 0?i.copy(n):Jpe.setFromPoints(e).getCenter(i);let a=0;for(let s=0,r=e.length;s<r;s++)a=Math.max(a,i.distanceToSquared(e[s]));return this.radius=Math.sqrt(a),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const n=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=n*n}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,n){const i=this.center.distanceToSquared(e);return n.copy(e),i>this.radius*this.radius&&(n.sub(this.center).normalize(),n.multiplyScalar(this.radius).add(this.center)),n}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;eb.subVectors(e,this.center);const n=eb.lengthSq();if(n>this.radius*this.radius){const i=Math.sqrt(n),a=(i-this.radius)*.5;this.center.addScaledVector(eb,a/i),this.radius+=a}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(cM.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(eb.copy(e.center).add(cM)),this.expandByPoint(eb.copy(e.center).sub(cM))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}toJSON(){return{radius:this.radius,center:this.center.toArray()}}fromJSON(e){return this.radius=e.radius,this.center.fromArray(e.center),this}}const od=new fe,uM=new fe,f_=new fe,xf=new fe,dM=new fe,h_=new fe,fM=new fe;class uv{constructor(e=new fe,n=new fe(0,0,-1)){this.origin=e,this.direction=n}set(e,n){return this.origin.copy(e),this.direction.copy(n),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,n){return n.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,od)),this}closestPointToPoint(e,n){n.subVectors(e,this.origin);const i=n.dot(this.direction);return i<0?n.copy(this.origin):n.copy(this.origin).addScaledVector(this.direction,i)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const n=od.subVectors(e,this.origin).dot(this.direction);return n<0?this.origin.distanceToSquared(e):(od.copy(this.origin).addScaledVector(this.direction,n),od.distanceToSquared(e))}distanceSqToSegment(e,n,i,a){uM.copy(e).add(n).multiplyScalar(.5),f_.copy(n).sub(e).normalize(),xf.copy(this.origin).sub(uM);const s=e.distanceTo(n)*.5,r=-this.direction.dot(f_),o=xf.dot(this.direction),c=-xf.dot(f_),u=xf.lengthSq(),h=Math.abs(1-r*r);let d,p,g,b;if(h>0)if(d=r*c-o,p=r*o-c,b=s*h,d>=0)if(p>=-b)if(p<=b){const w=1/h;d*=w,p*=w,g=d*(d+r*p+2*o)+p*(r*d+p+2*c)+u}else p=s,d=Math.max(0,-(r*p+o)),g=-d*d+p*(p+2*c)+u;else p=-s,d=Math.max(0,-(r*p+o)),g=-d*d+p*(p+2*c)+u;else p<=-b?(d=Math.max(0,-(-r*s+o)),p=d>0?-s:Math.min(Math.max(-s,-c),s),g=-d*d+p*(p+2*c)+u):p<=b?(d=0,p=Math.min(Math.max(-s,-c),s),g=p*(p+2*c)+u):(d=Math.max(0,-(r*s+o)),p=d>0?s:Math.min(Math.max(-s,-c),s),g=-d*d+p*(p+2*c)+u);else p=r>0?-s:s,d=Math.max(0,-(r*p+o)),g=-d*d+p*(p+2*c)+u;return i&&i.copy(this.origin).addScaledVector(this.direction,d),a&&a.copy(uM).addScaledVector(f_,p),g}intersectSphere(e,n){od.subVectors(e.center,this.origin);const i=od.dot(this.direction),a=od.dot(od)-i*i,s=e.radius*e.radius;if(a>s)return null;const r=Math.sqrt(s-a),o=i-r,c=i+r;return c<0?null:o<0?this.at(c,n):this.at(o,n)}intersectsSphere(e){return e.radius<0?!1:this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const n=e.normal.dot(this.direction);if(n===0)return e.distanceToPoint(this.origin)===0?0:null;const i=-(this.origin.dot(e.normal)+e.constant)/n;return i>=0?i:null}intersectPlane(e,n){const i=this.distanceToPlane(e);return i===null?null:this.at(i,n)}intersectsPlane(e){const n=e.distanceToPoint(this.origin);return n===0||e.normal.dot(this.direction)*n<0}intersectBox(e,n){let i,a,s,r,o,c;const u=1/this.direction.x,h=1/this.direction.y,d=1/this.direction.z,p=this.origin;return u>=0?(i=(e.min.x-p.x)*u,a=(e.max.x-p.x)*u):(i=(e.max.x-p.x)*u,a=(e.min.x-p.x)*u),h>=0?(s=(e.min.y-p.y)*h,r=(e.max.y-p.y)*h):(s=(e.max.y-p.y)*h,r=(e.min.y-p.y)*h),i>r||s>a||((s>i||isNaN(i))&&(i=s),(r<a||isNaN(a))&&(a=r),d>=0?(o=(e.min.z-p.z)*d,c=(e.max.z-p.z)*d):(o=(e.max.z-p.z)*d,c=(e.min.z-p.z)*d),i>c||o>a)||((o>i||i!==i)&&(i=o),(c<a||a!==a)&&(a=c),a<0)?null:this.at(i>=0?i:a,n)}intersectsBox(e){return this.intersectBox(e,od)!==null}intersectTriangle(e,n,i,a,s){dM.subVectors(n,e),h_.subVectors(i,e),fM.crossVectors(dM,h_);let r=this.direction.dot(fM),o;if(r>0){if(a)return null;o=1}else if(r<0)o=-1,r=-r;else return null;xf.subVectors(this.origin,e);const c=o*this.direction.dot(h_.crossVectors(xf,h_));if(c<0)return null;const u=o*this.direction.dot(dM.cross(xf));if(u<0||c+u>r)return null;const h=-o*xf.dot(fM);return h<0?null:this.at(h/r,s)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class wn{constructor(e,n,i,a,s,r,o,c,u,h,d,p,g,b,w,x){wn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,n,i,a,s,r,o,c,u,h,d,p,g,b,w,x)}set(e,n,i,a,s,r,o,c,u,h,d,p,g,b,w,x){const S=this.elements;return S[0]=e,S[4]=n,S[8]=i,S[12]=a,S[1]=s,S[5]=r,S[9]=o,S[13]=c,S[2]=u,S[6]=h,S[10]=d,S[14]=p,S[3]=g,S[7]=b,S[11]=w,S[15]=x,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new wn().fromArray(this.elements)}copy(e){const n=this.elements,i=e.elements;return n[0]=i[0],n[1]=i[1],n[2]=i[2],n[3]=i[3],n[4]=i[4],n[5]=i[5],n[6]=i[6],n[7]=i[7],n[8]=i[8],n[9]=i[9],n[10]=i[10],n[11]=i[11],n[12]=i[12],n[13]=i[13],n[14]=i[14],n[15]=i[15],this}copyPosition(e){const n=this.elements,i=e.elements;return n[12]=i[12],n[13]=i[13],n[14]=i[14],this}setFromMatrix3(e){const n=e.elements;return this.set(n[0],n[3],n[6],0,n[1],n[4],n[7],0,n[2],n[5],n[8],0,0,0,0,1),this}extractBasis(e,n,i){return e.setFromMatrixColumn(this,0),n.setFromMatrixColumn(this,1),i.setFromMatrixColumn(this,2),this}makeBasis(e,n,i){return this.set(e.x,n.x,i.x,0,e.y,n.y,i.y,0,e.z,n.z,i.z,0,0,0,0,1),this}extractRotation(e){const n=this.elements,i=e.elements,a=1/U0.setFromMatrixColumn(e,0).length(),s=1/U0.setFromMatrixColumn(e,1).length(),r=1/U0.setFromMatrixColumn(e,2).length();return n[0]=i[0]*a,n[1]=i[1]*a,n[2]=i[2]*a,n[3]=0,n[4]=i[4]*s,n[5]=i[5]*s,n[6]=i[6]*s,n[7]=0,n[8]=i[8]*r,n[9]=i[9]*r,n[10]=i[10]*r,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromEuler(e){const n=this.elements,i=e.x,a=e.y,s=e.z,r=Math.cos(i),o=Math.sin(i),c=Math.cos(a),u=Math.sin(a),h=Math.cos(s),d=Math.sin(s);if(e.order==="XYZ"){const p=r*h,g=r*d,b=o*h,w=o*d;n[0]=c*h,n[4]=-c*d,n[8]=u,n[1]=g+b*u,n[5]=p-w*u,n[9]=-o*c,n[2]=w-p*u,n[6]=b+g*u,n[10]=r*c}else if(e.order==="YXZ"){const p=c*h,g=c*d,b=u*h,w=u*d;n[0]=p+w*o,n[4]=b*o-g,n[8]=r*u,n[1]=r*d,n[5]=r*h,n[9]=-o,n[2]=g*o-b,n[6]=w+p*o,n[10]=r*c}else if(e.order==="ZXY"){const p=c*h,g=c*d,b=u*h,w=u*d;n[0]=p-w*o,n[4]=-r*d,n[8]=b+g*o,n[1]=g+b*o,n[5]=r*h,n[9]=w-p*o,n[2]=-r*u,n[6]=o,n[10]=r*c}else if(e.order==="ZYX"){const p=r*h,g=r*d,b=o*h,w=o*d;n[0]=c*h,n[4]=b*u-g,n[8]=p*u+w,n[1]=c*d,n[5]=w*u+p,n[9]=g*u-b,n[2]=-u,n[6]=o*c,n[10]=r*c}else if(e.order==="YZX"){const p=r*c,g=r*u,b=o*c,w=o*u;n[0]=c*h,n[4]=w-p*d,n[8]=b*d+g,n[1]=d,n[5]=r*h,n[9]=-o*h,n[2]=-u*h,n[6]=g*d+b,n[10]=p-w*d}else if(e.order==="XZY"){const p=r*c,g=r*u,b=o*c,w=o*u;n[0]=c*h,n[4]=-d,n[8]=u*h,n[1]=p*d+w,n[5]=r*h,n[9]=g*d-b,n[2]=b*d-g,n[6]=o*h,n[10]=w*d+p}return n[3]=0,n[7]=0,n[11]=0,n[12]=0,n[13]=0,n[14]=0,n[15]=1,this}makeRotationFromQuaternion(e){return this.compose(eme,e,tme)}lookAt(e,n,i){const a=this.elements;return Lo.subVectors(e,n),Lo.lengthSq()===0&&(Lo.z=1),Lo.normalize(),_f.crossVectors(i,Lo),_f.lengthSq()===0&&(Math.abs(i.z)===1?Lo.x+=1e-4:Lo.z+=1e-4,Lo.normalize(),_f.crossVectors(i,Lo)),_f.normalize(),p_.crossVectors(Lo,_f),a[0]=_f.x,a[4]=p_.x,a[8]=Lo.x,a[1]=_f.y,a[5]=p_.y,a[9]=Lo.y,a[2]=_f.z,a[6]=p_.z,a[10]=Lo.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,n){const i=e.elements,a=n.elements,s=this.elements,r=i[0],o=i[4],c=i[8],u=i[12],h=i[1],d=i[5],p=i[9],g=i[13],b=i[2],w=i[6],x=i[10],S=i[14],M=i[3],C=i[7],A=i[11],N=i[15],R=a[0],D=a[4],B=a[8],z=a[12],I=a[1],U=a[5],$=a[9],G=a[13],k=a[2],X=a[6],V=a[10],H=a[14],W=a[3],J=a[7],Y=a[11],K=a[15];return s[0]=r*R+o*I+c*k+u*W,s[4]=r*D+o*U+c*X+u*J,s[8]=r*B+o*$+c*V+u*Y,s[12]=r*z+o*G+c*H+u*K,s[1]=h*R+d*I+p*k+g*W,s[5]=h*D+d*U+p*X+g*J,s[9]=h*B+d*$+p*V+g*Y,s[13]=h*z+d*G+p*H+g*K,s[2]=b*R+w*I+x*k+S*W,s[6]=b*D+w*U+x*X+S*J,s[10]=b*B+w*$+x*V+S*Y,s[14]=b*z+w*G+x*H+S*K,s[3]=M*R+C*I+A*k+N*W,s[7]=M*D+C*U+A*X+N*J,s[11]=M*B+C*$+A*V+N*Y,s[15]=M*z+C*G+A*H+N*K,this}multiplyScalar(e){const n=this.elements;return n[0]*=e,n[4]*=e,n[8]*=e,n[12]*=e,n[1]*=e,n[5]*=e,n[9]*=e,n[13]*=e,n[2]*=e,n[6]*=e,n[10]*=e,n[14]*=e,n[3]*=e,n[7]*=e,n[11]*=e,n[15]*=e,this}determinant(){const e=this.elements,n=e[0],i=e[4],a=e[8],s=e[12],r=e[1],o=e[5],c=e[9],u=e[13],h=e[2],d=e[6],p=e[10],g=e[14],b=e[3],w=e[7],x=e[11],S=e[15];return b*(+s*c*d-a*u*d-s*o*p+i*u*p+a*o*g-i*c*g)+w*(+n*c*g-n*u*p+s*r*p-a*r*g+a*u*h-s*c*h)+x*(+n*u*d-n*o*g-s*r*d+i*r*g+s*o*h-i*u*h)+S*(-a*o*h-n*c*d+n*o*p+a*r*d-i*r*p+i*c*h)}transpose(){const e=this.elements;let n;return n=e[1],e[1]=e[4],e[4]=n,n=e[2],e[2]=e[8],e[8]=n,n=e[6],e[6]=e[9],e[9]=n,n=e[3],e[3]=e[12],e[12]=n,n=e[7],e[7]=e[13],e[13]=n,n=e[11],e[11]=e[14],e[14]=n,this}setPosition(e,n,i){const a=this.elements;return e.isVector3?(a[12]=e.x,a[13]=e.y,a[14]=e.z):(a[12]=e,a[13]=n,a[14]=i),this}invert(){const e=this.elements,n=e[0],i=e[1],a=e[2],s=e[3],r=e[4],o=e[5],c=e[6],u=e[7],h=e[8],d=e[9],p=e[10],g=e[11],b=e[12],w=e[13],x=e[14],S=e[15],M=d*x*u-w*p*u+w*c*g-o*x*g-d*c*S+o*p*S,C=b*p*u-h*x*u-b*c*g+r*x*g+h*c*S-r*p*S,A=h*w*u-b*d*u+b*o*g-r*w*g-h*o*S+r*d*S,N=b*d*c-h*w*c-b*o*p+r*w*p+h*o*x-r*d*x,R=n*M+i*C+a*A+s*N;if(R===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const D=1/R;return e[0]=M*D,e[1]=(w*p*s-d*x*s-w*a*g+i*x*g+d*a*S-i*p*S)*D,e[2]=(o*x*s-w*c*s+w*a*u-i*x*u-o*a*S+i*c*S)*D,e[3]=(d*c*s-o*p*s-d*a*u+i*p*u+o*a*g-i*c*g)*D,e[4]=C*D,e[5]=(h*x*s-b*p*s+b*a*g-n*x*g-h*a*S+n*p*S)*D,e[6]=(b*c*s-r*x*s-b*a*u+n*x*u+r*a*S-n*c*S)*D,e[7]=(r*p*s-h*c*s+h*a*u-n*p*u-r*a*g+n*c*g)*D,e[8]=A*D,e[9]=(b*d*s-h*w*s-b*i*g+n*w*g+h*i*S-n*d*S)*D,e[10]=(r*w*s-b*o*s+b*i*u-n*w*u-r*i*S+n*o*S)*D,e[11]=(h*o*s-r*d*s-h*i*u+n*d*u+r*i*g-n*o*g)*D,e[12]=N*D,e[13]=(h*w*a-b*d*a+b*i*p-n*w*p-h*i*x+n*d*x)*D,e[14]=(b*o*a-r*w*a-b*i*c+n*w*c+r*i*x-n*o*x)*D,e[15]=(r*d*a-h*o*a+h*i*c-n*d*c-r*i*p+n*o*p)*D,this}scale(e){const n=this.elements,i=e.x,a=e.y,s=e.z;return n[0]*=i,n[4]*=a,n[8]*=s,n[1]*=i,n[5]*=a,n[9]*=s,n[2]*=i,n[6]*=a,n[10]*=s,n[3]*=i,n[7]*=a,n[11]*=s,this}getMaxScaleOnAxis(){const e=this.elements,n=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],i=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],a=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(n,i,a))}makeTranslation(e,n,i){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,n,0,0,1,i,0,0,0,1),this}makeRotationX(e){const n=Math.cos(e),i=Math.sin(e);return this.set(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1),this}makeRotationY(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1),this}makeRotationZ(e){const n=Math.cos(e),i=Math.sin(e);return this.set(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,n){const i=Math.cos(n),a=Math.sin(n),s=1-i,r=e.x,o=e.y,c=e.z,u=s*r,h=s*o;return this.set(u*r+i,u*o-a*c,u*c+a*o,0,u*o+a*c,h*o+i,h*c-a*r,0,u*c-a*o,h*c+a*r,s*c*c+i,0,0,0,0,1),this}makeScale(e,n,i){return this.set(e,0,0,0,0,n,0,0,0,0,i,0,0,0,0,1),this}makeShear(e,n,i,a,s,r){return this.set(1,i,s,0,e,1,r,0,n,a,1,0,0,0,0,1),this}compose(e,n,i){const a=this.elements,s=n._x,r=n._y,o=n._z,c=n._w,u=s+s,h=r+r,d=o+o,p=s*u,g=s*h,b=s*d,w=r*h,x=r*d,S=o*d,M=c*u,C=c*h,A=c*d,N=i.x,R=i.y,D=i.z;return a[0]=(1-(w+S))*N,a[1]=(g+A)*N,a[2]=(b-C)*N,a[3]=0,a[4]=(g-A)*R,a[5]=(1-(p+S))*R,a[6]=(x+M)*R,a[7]=0,a[8]=(b+C)*D,a[9]=(x-M)*D,a[10]=(1-(p+w))*D,a[11]=0,a[12]=e.x,a[13]=e.y,a[14]=e.z,a[15]=1,this}decompose(e,n,i){const a=this.elements;let s=U0.set(a[0],a[1],a[2]).length();const r=U0.set(a[4],a[5],a[6]).length(),o=U0.set(a[8],a[9],a[10]).length();this.determinant()<0&&(s=-s),e.x=a[12],e.y=a[13],e.z=a[14],ic.copy(this);const u=1/s,h=1/r,d=1/o;return ic.elements[0]*=u,ic.elements[1]*=u,ic.elements[2]*=u,ic.elements[4]*=h,ic.elements[5]*=h,ic.elements[6]*=h,ic.elements[8]*=d,ic.elements[9]*=d,ic.elements[10]*=d,n.setFromRotationMatrix(ic),i.x=s,i.y=r,i.z=o,this}makePerspective(e,n,i,a,s,r,o=ko,c=!1){const u=this.elements,h=2*s/(n-e),d=2*s/(i-a),p=(n+e)/(n-e),g=(i+a)/(i-a);let b,w;if(c)b=s/(r-s),w=r*s/(r-s);else if(o===ko)b=-(r+s)/(r-s),w=-2*r*s/(r-s);else if(o===Hg)b=-r/(r-s),w=-r*s/(r-s);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+o);return u[0]=h,u[4]=0,u[8]=p,u[12]=0,u[1]=0,u[5]=d,u[9]=g,u[13]=0,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=-1,u[15]=0,this}makeOrthographic(e,n,i,a,s,r,o=ko,c=!1){const u=this.elements,h=2/(n-e),d=2/(i-a),p=-(n+e)/(n-e),g=-(i+a)/(i-a);let b,w;if(c)b=1/(r-s),w=r/(r-s);else if(o===ko)b=-2/(r-s),w=-(r+s)/(r-s);else if(o===Hg)b=-1/(r-s),w=-s/(r-s);else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+o);return u[0]=h,u[4]=0,u[8]=0,u[12]=p,u[1]=0,u[5]=d,u[9]=0,u[13]=g,u[2]=0,u[6]=0,u[10]=b,u[14]=w,u[3]=0,u[7]=0,u[11]=0,u[15]=1,this}equals(e){const n=this.elements,i=e.elements;for(let a=0;a<16;a++)if(n[a]!==i[a])return!1;return!0}fromArray(e,n=0){for(let i=0;i<16;i++)this.elements[i]=e[i+n];return this}toArray(e=[],n=0){const i=this.elements;return e[n]=i[0],e[n+1]=i[1],e[n+2]=i[2],e[n+3]=i[3],e[n+4]=i[4],e[n+5]=i[5],e[n+6]=i[6],e[n+7]=i[7],e[n+8]=i[8],e[n+9]=i[9],e[n+10]=i[10],e[n+11]=i[11],e[n+12]=i[12],e[n+13]=i[13],e[n+14]=i[14],e[n+15]=i[15],e}}const U0=new fe,ic=new wn,eme=new fe(0,0,0),tme=new fe(1,1,1),_f=new fe,p_=new fe,Lo=new fe,V7=new wn,k7=new Li;class xo{constructor(e=0,n=0,i=0,a=xo.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=n,this._z=i,this._order=a}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,n,i,a=this._order){return this._x=e,this._y=n,this._z=i,this._order=a,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,n=this._order,i=!0){const a=e.elements,s=a[0],r=a[4],o=a[8],c=a[1],u=a[5],h=a[9],d=a[2],p=a[6],g=a[10];switch(n){case"XYZ":this._y=Math.asin(En(o,-1,1)),Math.abs(o)<.9999999?(this._x=Math.atan2(-h,g),this._z=Math.atan2(-r,s)):(this._x=Math.atan2(p,u),this._z=0);break;case"YXZ":this._x=Math.asin(-En(h,-1,1)),Math.abs(h)<.9999999?(this._y=Math.atan2(o,g),this._z=Math.atan2(c,u)):(this._y=Math.atan2(-d,s),this._z=0);break;case"ZXY":this._x=Math.asin(En(p,-1,1)),Math.abs(p)<.9999999?(this._y=Math.atan2(-d,g),this._z=Math.atan2(-r,u)):(this._y=0,this._z=Math.atan2(c,s));break;case"ZYX":this._y=Math.asin(-En(d,-1,1)),Math.abs(d)<.9999999?(this._x=Math.atan2(p,g),this._z=Math.atan2(c,s)):(this._x=0,this._z=Math.atan2(-r,u));break;case"YZX":this._z=Math.asin(En(c,-1,1)),Math.abs(c)<.9999999?(this._x=Math.atan2(-h,u),this._y=Math.atan2(-d,s)):(this._x=0,this._y=Math.atan2(o,g));break;case"XZY":this._z=Math.asin(-En(r,-1,1)),Math.abs(r)<.9999999?(this._x=Math.atan2(p,u),this._y=Math.atan2(o,s)):(this._x=Math.atan2(-h,g),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+n)}return this._order=n,i===!0&&this._onChangeCallback(),this}setFromQuaternion(e,n,i){return V7.makeRotationFromQuaternion(e),this.setFromRotationMatrix(V7,n,i)}setFromVector3(e,n=this._order){return this.set(e.x,e.y,e.z,n)}reorder(e){return k7.setFromEuler(this),this.setFromQuaternion(k7,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],n=0){return e[n]=this._x,e[n+1]=this._y,e[n+2]=this._z,e[n+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}xo.DEFAULT_ORDER="XYZ";class Gg{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}isEnabled(e){return(this.mask&(1<<e|0))!==0}}let nme=0;const H7=new fe,j0=new Li,ld=new wn,m_=new fe,tb=new fe,ime=new fe,ame=new Li,$7=new fe(1,0,0),G7=new fe(0,1,0),W7=new fe(0,0,1),K7={type:"added"},sme={type:"removed"},F0={type:"childadded",child:null},hM={type:"childremoved",child:null};class Jn extends wu{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:nme++}),this.uuid=$o(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=Jn.DEFAULT_UP.clone();const e=new fe,n=new xo,i=new Li,a=new fe(1,1,1);function s(){i.setFromEuler(n,!1)}function r(){n.setFromQuaternion(i,void 0,!1)}n._onChange(s),i._onChange(r),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:n},quaternion:{configurable:!0,enumerable:!0,value:i},scale:{configurable:!0,enumerable:!0,value:a},modelViewMatrix:{value:new wn},normalMatrix:{value:new jn}}),this.matrix=new wn,this.matrixWorld=new wn,this.matrixAutoUpdate=Jn.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=Jn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new Gg,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,n){this.quaternion.setFromAxisAngle(e,n)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,n){return j0.setFromAxisAngle(e,n),this.quaternion.multiply(j0),this}rotateOnWorldAxis(e,n){return j0.setFromAxisAngle(e,n),this.quaternion.premultiply(j0),this}rotateX(e){return this.rotateOnAxis($7,e)}rotateY(e){return this.rotateOnAxis(G7,e)}rotateZ(e){return this.rotateOnAxis(W7,e)}translateOnAxis(e,n){return H7.copy(e).applyQuaternion(this.quaternion),this.position.add(H7.multiplyScalar(n)),this}translateX(e){return this.translateOnAxis($7,e)}translateY(e){return this.translateOnAxis(G7,e)}translateZ(e){return this.translateOnAxis(W7,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(ld.copy(this.matrixWorld).invert())}lookAt(e,n,i){e.isVector3?m_.copy(e):m_.set(e,n,i);const a=this.parent;this.updateWorldMatrix(!0,!1),tb.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?ld.lookAt(tb,m_,this.up):ld.lookAt(m_,tb,this.up),this.quaternion.setFromRotationMatrix(ld),a&&(ld.extractRotation(a.matrixWorld),j0.setFromRotationMatrix(ld),this.quaternion.premultiply(j0.invert()))}add(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.add(arguments[n]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(K7),F0.child=e,this.dispatchEvent(F0),F0.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.remove(arguments[i]);return this}const n=this.children.indexOf(e);return n!==-1&&(e.parent=null,this.children.splice(n,1),e.dispatchEvent(sme),hM.child=e,this.dispatchEvent(hM),hM.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),ld.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),ld.multiply(e.parent.matrixWorld)),e.applyMatrix4(ld),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(K7),F0.child=e,this.dispatchEvent(F0),F0.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,n){if(this[e]===n)return this;for(let i=0,a=this.children.length;i<a;i++){const r=this.children[i].getObjectByProperty(e,n);if(r!==void 0)return r}}getObjectsByProperty(e,n,i=[]){this[e]===n&&i.push(this);const a=this.children;for(let s=0,r=a.length;s<r;s++)a[s].getObjectsByProperty(e,n,i);return i}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tb,e,ime),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(tb,ame,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const n=this.matrixWorld.elements;return e.set(n[8],n[9],n[10]).normalize()}raycast(){}traverse(e){e(this);const n=this.children;for(let i=0,a=n.length;i<a;i++)n[i].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const n=this.children;for(let i=0,a=n.length;i<a;i++)n[i].traverseVisible(e)}traverseAncestors(e){const n=this.parent;n!==null&&(e(n),n.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const n=this.children;for(let i=0,a=n.length;i<a;i++)n[i].updateMatrixWorld(e)}updateWorldMatrix(e,n){const i=this.parent;if(e===!0&&i!==null&&i.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),n===!0){const a=this.children;for(let s=0,r=a.length;s<r;s++)a[s].updateWorldMatrix(!1,!0)}}toJSON(e){const n=e===void 0||typeof e=="string",i={};n&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},i.metadata={version:4.7,type:"Object",generator:"Object3D.toJSON"});const a={};a.uuid=this.uuid,a.type=this.type,this.name!==""&&(a.name=this.name),this.castShadow===!0&&(a.castShadow=!0),this.receiveShadow===!0&&(a.receiveShadow=!0),this.visible===!1&&(a.visible=!1),this.frustumCulled===!1&&(a.frustumCulled=!1),this.renderOrder!==0&&(a.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(a.userData=this.userData),a.layers=this.layers.mask,a.matrix=this.matrix.toArray(),a.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(a.matrixAutoUpdate=!1),this.isInstancedMesh&&(a.type="InstancedMesh",a.count=this.count,a.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(a.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(a.type="BatchedMesh",a.perObjectFrustumCulled=this.perObjectFrustumCulled,a.sortObjects=this.sortObjects,a.drawRanges=this._drawRanges,a.reservedRanges=this._reservedRanges,a.geometryInfo=this._geometryInfo.map(o=>({...o,boundingBox:o.boundingBox?o.boundingBox.toJSON():void 0,boundingSphere:o.boundingSphere?o.boundingSphere.toJSON():void 0})),a.instanceInfo=this._instanceInfo.map(o=>({...o})),a.availableInstanceIds=this._availableInstanceIds.slice(),a.availableGeometryIds=this._availableGeometryIds.slice(),a.nextIndexStart=this._nextIndexStart,a.nextVertexStart=this._nextVertexStart,a.geometryCount=this._geometryCount,a.maxInstanceCount=this._maxInstanceCount,a.maxVertexCount=this._maxVertexCount,a.maxIndexCount=this._maxIndexCount,a.geometryInitialized=this._geometryInitialized,a.matricesTexture=this._matricesTexture.toJSON(e),a.indirectTexture=this._indirectTexture.toJSON(e),this._colorsTexture!==null&&(a.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(a.boundingSphere=this.boundingSphere.toJSON()),this.boundingBox!==null&&(a.boundingBox=this.boundingBox.toJSON()));function s(o,c){return o[c.uuid]===void 0&&(o[c.uuid]=c.toJSON(e)),c.uuid}if(this.isScene)this.background&&(this.background.isColor?a.background=this.background.toJSON():this.background.isTexture&&(a.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(a.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){a.geometry=s(e.geometries,this.geometry);const o=this.geometry.parameters;if(o!==void 0&&o.shapes!==void 0){const c=o.shapes;if(Array.isArray(c))for(let u=0,h=c.length;u<h;u++){const d=c[u];s(e.shapes,d)}else s(e.shapes,c)}}if(this.isSkinnedMesh&&(a.bindMode=this.bindMode,a.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(s(e.skeletons,this.skeleton),a.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const o=[];for(let c=0,u=this.material.length;c<u;c++)o.push(s(e.materials,this.material[c]));a.material=o}else a.material=s(e.materials,this.material);if(this.children.length>0){a.children=[];for(let o=0;o<this.children.length;o++)a.children.push(this.children[o].toJSON(e).object)}if(this.animations.length>0){a.animations=[];for(let o=0;o<this.animations.length;o++){const c=this.animations[o];a.animations.push(s(e.animations,c))}}if(n){const o=r(e.geometries),c=r(e.materials),u=r(e.textures),h=r(e.images),d=r(e.shapes),p=r(e.skeletons),g=r(e.animations),b=r(e.nodes);o.length>0&&(i.geometries=o),c.length>0&&(i.materials=c),u.length>0&&(i.textures=u),h.length>0&&(i.images=h),d.length>0&&(i.shapes=d),p.length>0&&(i.skeletons=p),g.length>0&&(i.animations=g),b.length>0&&(i.nodes=b)}return i.object=a,i;function r(o){const c=[];for(const u in o){const h=o[u];delete h.metadata,c.push(h)}return c}}clone(e){return new this.constructor().copy(this,e)}copy(e,n=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),n===!0)for(let i=0;i<e.children.length;i++){const a=e.children[i];this.add(a.clone())}return this}}Jn.DEFAULT_UP=new fe(0,1,0);Jn.DEFAULT_MATRIX_AUTO_UPDATE=!0;Jn.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const ac=new fe,cd=new fe,pM=new fe,ud=new fe,V0=new fe,k0=new fe,X7=new fe,mM=new fe,gM=new fe,vM=new fe,yM=new xi,bM=new xi,xM=new xi;class po{constructor(e=new fe,n=new fe,i=new fe){this.a=e,this.b=n,this.c=i}static getNormal(e,n,i,a){a.subVectors(i,n),ac.subVectors(e,n),a.cross(ac);const s=a.lengthSq();return s>0?a.multiplyScalar(1/Math.sqrt(s)):a.set(0,0,0)}static getBarycoord(e,n,i,a,s){ac.subVectors(a,n),cd.subVectors(i,n),pM.subVectors(e,n);const r=ac.dot(ac),o=ac.dot(cd),c=ac.dot(pM),u=cd.dot(cd),h=cd.dot(pM),d=r*u-o*o;if(d===0)return s.set(0,0,0),null;const p=1/d,g=(u*c-o*h)*p,b=(r*h-o*c)*p;return s.set(1-g-b,b,g)}static containsPoint(e,n,i,a){return this.getBarycoord(e,n,i,a,ud)===null?!1:ud.x>=0&&ud.y>=0&&ud.x+ud.y<=1}static getInterpolation(e,n,i,a,s,r,o,c){return this.getBarycoord(e,n,i,a,ud)===null?(c.x=0,c.y=0,"z"in c&&(c.z=0),"w"in c&&(c.w=0),null):(c.setScalar(0),c.addScaledVector(s,ud.x),c.addScaledVector(r,ud.y),c.addScaledVector(o,ud.z),c)}static getInterpolatedAttribute(e,n,i,a,s,r){return yM.setScalar(0),bM.setScalar(0),xM.setScalar(0),yM.fromBufferAttribute(e,n),bM.fromBufferAttribute(e,i),xM.fromBufferAttribute(e,a),r.setScalar(0),r.addScaledVector(yM,s.x),r.addScaledVector(bM,s.y),r.addScaledVector(xM,s.z),r}static isFrontFacing(e,n,i,a){return ac.subVectors(i,n),cd.subVectors(e,n),ac.cross(cd).dot(a)<0}set(e,n,i){return this.a.copy(e),this.b.copy(n),this.c.copy(i),this}setFromPointsAndIndices(e,n,i,a){return this.a.copy(e[n]),this.b.copy(e[i]),this.c.copy(e[a]),this}setFromAttributeAndIndices(e,n,i,a){return this.a.fromBufferAttribute(e,n),this.b.fromBufferAttribute(e,i),this.c.fromBufferAttribute(e,a),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return ac.subVectors(this.c,this.b),cd.subVectors(this.a,this.b),ac.cross(cd).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return po.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,n){return po.getBarycoord(e,this.a,this.b,this.c,n)}getInterpolation(e,n,i,a,s){return po.getInterpolation(e,this.a,this.b,this.c,n,i,a,s)}containsPoint(e){return po.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return po.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,n){const i=this.a,a=this.b,s=this.c;let r,o;V0.subVectors(a,i),k0.subVectors(s,i),mM.subVectors(e,i);const c=V0.dot(mM),u=k0.dot(mM);if(c<=0&&u<=0)return n.copy(i);gM.subVectors(e,a);const h=V0.dot(gM),d=k0.dot(gM);if(h>=0&&d<=h)return n.copy(a);const p=c*d-h*u;if(p<=0&&c>=0&&h<=0)return r=c/(c-h),n.copy(i).addScaledVector(V0,r);vM.subVectors(e,s);const g=V0.dot(vM),b=k0.dot(vM);if(b>=0&&g<=b)return n.copy(s);const w=g*u-c*b;if(w<=0&&u>=0&&b<=0)return o=u/(u-b),n.copy(i).addScaledVector(k0,o);const x=h*b-g*d;if(x<=0&&d-h>=0&&g-b>=0)return X7.subVectors(s,a),o=(d-h)/(d-h+(g-b)),n.copy(a).addScaledVector(X7,o);const S=1/(x+w+p);return r=w*S,o=p*S,n.copy(i).addScaledVector(V0,r).addScaledVector(k0,o)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const h$={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Sf={h:0,s:0,l:0},g_={h:0,s:0,l:0};function _M(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*6*(2/3-n):t}class Wt{constructor(e,n,i){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,n,i)}set(e,n,i){if(n===void 0&&i===void 0){const a=e;a&&a.isColor?this.copy(a):typeof a=="number"?this.setHex(a):typeof a=="string"&&this.setStyle(a)}else this.setRGB(e,n,i);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,n=rr){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,mi.colorSpaceToWorking(this,n),this}setRGB(e,n,i,a=mi.workingColorSpace){return this.r=e,this.g=n,this.b=i,mi.colorSpaceToWorking(this,a),this}setHSL(e,n,i,a=mi.workingColorSpace){if(e=l6(e,1),n=En(n,0,1),i=En(i,0,1),n===0)this.r=this.g=this.b=i;else{const s=i<=.5?i*(1+n):i+n-i*n,r=2*i-s;this.r=_M(r,s,e+1/3),this.g=_M(r,s,e),this.b=_M(r,s,e-1/3)}return mi.colorSpaceToWorking(this,a),this}setStyle(e,n=rr){function i(s){s!==void 0&&parseFloat(s)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let a;if(a=/^(\w+)\(([^\)]*)\)/.exec(e)){let s;const r=a[1],o=a[2];switch(r){case"rgb":case"rgba":if(s=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(255,parseInt(s[1],10))/255,Math.min(255,parseInt(s[2],10))/255,Math.min(255,parseInt(s[3],10))/255,n);if(s=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setRGB(Math.min(100,parseInt(s[1],10))/100,Math.min(100,parseInt(s[2],10))/100,Math.min(100,parseInt(s[3],10))/100,n);break;case"hsl":case"hsla":if(s=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(o))return i(s[4]),this.setHSL(parseFloat(s[1])/360,parseFloat(s[2])/100,parseFloat(s[3])/100,n);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(a=/^\#([A-Fa-f\d]+)$/.exec(e)){const s=a[1],r=s.length;if(r===3)return this.setRGB(parseInt(s.charAt(0),16)/15,parseInt(s.charAt(1),16)/15,parseInt(s.charAt(2),16)/15,n);if(r===6)return this.setHex(parseInt(s,16),n);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,n);return this}setColorName(e,n=rr){const i=h$[e.toLowerCase()];return i!==void 0?this.setHex(i,n):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=_d(e.r),this.g=_d(e.g),this.b=_d(e.b),this}copyLinearToSRGB(e){return this.r=Ag(e.r),this.g=Ag(e.g),this.b=Ag(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=rr){return mi.workingToColorSpace(ir.copy(this),e),Math.round(En(ir.r*255,0,255))*65536+Math.round(En(ir.g*255,0,255))*256+Math.round(En(ir.b*255,0,255))}getHexString(e=rr){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,n=mi.workingColorSpace){mi.workingToColorSpace(ir.copy(this),n);const i=ir.r,a=ir.g,s=ir.b,r=Math.max(i,a,s),o=Math.min(i,a,s);let c,u;const h=(o+r)/2;if(o===r)c=0,u=0;else{const d=r-o;switch(u=h<=.5?d/(r+o):d/(2-r-o),r){case i:c=(a-s)/d+(a<s?6:0);break;case a:c=(s-i)/d+2;break;case s:c=(i-a)/d+4;break}c/=6}return e.h=c,e.s=u,e.l=h,e}getRGB(e,n=mi.workingColorSpace){return mi.workingToColorSpace(ir.copy(this),n),e.r=ir.r,e.g=ir.g,e.b=ir.b,e}getStyle(e=rr){mi.workingToColorSpace(ir.copy(this),e);const n=ir.r,i=ir.g,a=ir.b;return e!==rr?`color(${e} ${n.toFixed(3)} ${i.toFixed(3)} ${a.toFixed(3)})`:`rgb(${Math.round(n*255)},${Math.round(i*255)},${Math.round(a*255)})`}offsetHSL(e,n,i){return this.getHSL(Sf),this.setHSL(Sf.h+e,Sf.s+n,Sf.l+i)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,n){return this.r=e.r+n.r,this.g=e.g+n.g,this.b=e.b+n.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,n){return this.r+=(e.r-this.r)*n,this.g+=(e.g-this.g)*n,this.b+=(e.b-this.b)*n,this}lerpColors(e,n,i){return this.r=e.r+(n.r-e.r)*i,this.g=e.g+(n.g-e.g)*i,this.b=e.b+(n.b-e.b)*i,this}lerpHSL(e,n){this.getHSL(Sf),e.getHSL(g_);const i=Vb(Sf.h,g_.h,n),a=Vb(Sf.s,g_.s,n),s=Vb(Sf.l,g_.l,n);return this.setHSL(i,a,s),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const n=this.r,i=this.g,a=this.b,s=e.elements;return this.r=s[0]*n+s[3]*i+s[6]*a,this.g=s[1]*n+s[4]*i+s[7]*a,this.b=s[2]*n+s[5]*i+s[8]*a,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,n=0){return this.r=e[n],this.g=e[n+1],this.b=e[n+2],this}toArray(e=[],n=0){return e[n]=this.r,e[n+1]=this.g,e[n+2]=this.b,e}fromBufferAttribute(e,n){return this.r=e.getX(n),this.g=e.getY(n),this.b=e.getZ(n),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const ir=new Wt;Wt.NAMES=h$;let rme=0;class br extends wu{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:rme++}),this.uuid=$o(),this.name="",this.type="Material",this.blending=Wp,this.side=Ed,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=a3,this.blendDst=s3,this.blendEquation=Lf,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Wt(0,0,0),this.blendAlpha=0,this.depthFunc=nm,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=L5,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=Ap,this.stencilZFail=Ap,this.stencilZPass=Ap,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const n in e){const i=e[n];if(i===void 0){console.warn(`THREE.Material: parameter '${n}' has value of undefined.`);continue}const a=this[n];if(a===void 0){console.warn(`THREE.Material: '${n}' is not a property of THREE.${this.type}.`);continue}a&&a.isColor?a.set(i):a&&a.isVector3&&i&&i.isVector3?a.copy(i):this[n]=i}}toJSON(e){const n=e===void 0||typeof e=="string";n&&(e={textures:{},images:{}});const i={metadata:{version:4.7,type:"Material",generator:"Material.toJSON"}};i.uuid=this.uuid,i.type=this.type,this.name!==""&&(i.name=this.name),this.color&&this.color.isColor&&(i.color=this.color.getHex()),this.roughness!==void 0&&(i.roughness=this.roughness),this.metalness!==void 0&&(i.metalness=this.metalness),this.sheen!==void 0&&(i.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(i.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(i.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(i.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(i.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(i.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(i.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(i.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(i.shininess=this.shininess),this.clearcoat!==void 0&&(i.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(i.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(i.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(i.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(i.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,i.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.sheenColorMap&&this.sheenColorMap.isTexture&&(i.sheenColorMap=this.sheenColorMap.toJSON(e).uuid),this.sheenRoughnessMap&&this.sheenRoughnessMap.isTexture&&(i.sheenRoughnessMap=this.sheenRoughnessMap.toJSON(e).uuid),this.dispersion!==void 0&&(i.dispersion=this.dispersion),this.iridescence!==void 0&&(i.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(i.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(i.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(i.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(i.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(i.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(i.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(i.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(i.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(i.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(i.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(i.lightMap=this.lightMap.toJSON(e).uuid,i.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(i.aoMap=this.aoMap.toJSON(e).uuid,i.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(i.bumpMap=this.bumpMap.toJSON(e).uuid,i.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(i.normalMap=this.normalMap.toJSON(e).uuid,i.normalMapType=this.normalMapType,i.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(i.displacementMap=this.displacementMap.toJSON(e).uuid,i.displacementScale=this.displacementScale,i.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(i.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(i.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(i.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(i.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(i.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(i.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(i.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(i.combine=this.combine)),this.envMapRotation!==void 0&&(i.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(i.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(i.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(i.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(i.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(i.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(i.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(i.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(i.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(i.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(i.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(i.size=this.size),this.shadowSide!==null&&(i.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(i.sizeAttenuation=this.sizeAttenuation),this.blending!==Wp&&(i.blending=this.blending),this.side!==Ed&&(i.side=this.side),this.vertexColors===!0&&(i.vertexColors=!0),this.opacity<1&&(i.opacity=this.opacity),this.transparent===!0&&(i.transparent=!0),this.blendSrc!==a3&&(i.blendSrc=this.blendSrc),this.blendDst!==s3&&(i.blendDst=this.blendDst),this.blendEquation!==Lf&&(i.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(i.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(i.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(i.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(i.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(i.blendAlpha=this.blendAlpha),this.depthFunc!==nm&&(i.depthFunc=this.depthFunc),this.depthTest===!1&&(i.depthTest=this.depthTest),this.depthWrite===!1&&(i.depthWrite=this.depthWrite),this.colorWrite===!1&&(i.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(i.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==L5&&(i.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(i.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(i.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==Ap&&(i.stencilFail=this.stencilFail),this.stencilZFail!==Ap&&(i.stencilZFail=this.stencilZFail),this.stencilZPass!==Ap&&(i.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(i.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(i.rotation=this.rotation),this.polygonOffset===!0&&(i.polygonOffset=!0),this.polygonOffsetFactor!==0&&(i.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(i.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(i.linewidth=this.linewidth),this.dashSize!==void 0&&(i.dashSize=this.dashSize),this.gapSize!==void 0&&(i.gapSize=this.gapSize),this.scale!==void 0&&(i.scale=this.scale),this.dithering===!0&&(i.dithering=!0),this.alphaTest>0&&(i.alphaTest=this.alphaTest),this.alphaHash===!0&&(i.alphaHash=!0),this.alphaToCoverage===!0&&(i.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(i.premultipliedAlpha=!0),this.forceSinglePass===!0&&(i.forceSinglePass=!0),this.wireframe===!0&&(i.wireframe=!0),this.wireframeLinewidth>1&&(i.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(i.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(i.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(i.flatShading=!0),this.visible===!1&&(i.visible=!1),this.toneMapped===!1&&(i.toneMapped=!1),this.fog===!1&&(i.fog=!1),Object.keys(this.userData).length>0&&(i.userData=this.userData);function a(s){const r=[];for(const o in s){const c=s[o];delete c.metadata,r.push(c)}return r}if(n){const s=a(e.textures),r=a(e.images);s.length>0&&(i.textures=s),r.length>0&&(i.images=r)}return i}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const n=e.clippingPlanes;let i=null;if(n!==null){const a=n.length;i=new Array(a);for(let s=0;s!==a;++s)i[s]=n[s].clone()}return this.clippingPlanes=i,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipShadows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}}class Eu extends br{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Wt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new xo,this.combine=lx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const gd=ome();function ome(){const t=new ArrayBuffer(4),e=new Float32Array(t),n=new Uint32Array(t),i=new Uint32Array(512),a=new Uint32Array(512);for(let c=0;c<256;++c){const u=c-127;u<-27?(i[c]=0,i[c|256]=32768,a[c]=24,a[c|256]=24):u<-14?(i[c]=1024>>-u-14,i[c|256]=1024>>-u-14|32768,a[c]=-u-1,a[c|256]=-u-1):u<=15?(i[c]=u+15<<10,i[c|256]=u+15<<10|32768,a[c]=13,a[c|256]=13):u<128?(i[c]=31744,i[c|256]=64512,a[c]=24,a[c|256]=24):(i[c]=31744,i[c|256]=64512,a[c]=13,a[c|256]=13)}const s=new Uint32Array(2048),r=new Uint32Array(64),o=new Uint32Array(64);for(let c=1;c<1024;++c){let u=c<<13,h=0;for(;(u&8388608)===0;)u<<=1,h-=8388608;u&=-8388609,h+=947912704,s[c]=u|h}for(let c=1024;c<2048;++c)s[c]=939524096+(c-1024<<13);for(let c=1;c<31;++c)r[c]=c<<23;r[31]=1199570944,r[32]=2147483648;for(let c=33;c<63;++c)r[c]=2147483648+(c-32<<23);r[63]=3347054592;for(let c=1;c<64;++c)c!==32&&(o[c]=1024);return{floatView:e,uint32View:n,baseTable:i,shiftTable:a,mantissaTable:s,exponentTable:r,offsetTable:o}}function so(t){Math.abs(t)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),t=En(t,-65504,65504),gd.floatView[0]=t;const e=gd.uint32View[0],n=e>>23&511;return gd.baseTable[n]+((e&8388607)>>gd.shiftTable[n])}function bb(t){const e=t>>10;return gd.uint32View[0]=gd.mantissaTable[gd.offsetTable[e]+(t&1023)]+gd.exponentTable[e],gd.floatView[0]}class lme{static toHalfFloat(e){return so(e)}static fromHalfFloat(e){return bb(e)}}const Wa=new fe,v_=new _t;let cme=0;class $i{constructor(e,n,i=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:cme++}),this.name="",this.array=e,this.itemSize=n,this.count=e!==void 0?e.length/n:0,this.normalized=i,this.usage=A1,this.updateRanges=[],this.gpuType=Hr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,n,i){e*=this.itemSize,i*=n.itemSize;for(let a=0,s=this.itemSize;a<s;a++)this.array[e+a]=n.array[i+a];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let n=0,i=this.count;n<i;n++)v_.fromBufferAttribute(this,n),v_.applyMatrix3(e),this.setXY(n,v_.x,v_.y);else if(this.itemSize===3)for(let n=0,i=this.count;n<i;n++)Wa.fromBufferAttribute(this,n),Wa.applyMatrix3(e),this.setXYZ(n,Wa.x,Wa.y,Wa.z);return this}applyMatrix4(e){for(let n=0,i=this.count;n<i;n++)Wa.fromBufferAttribute(this,n),Wa.applyMatrix4(e),this.setXYZ(n,Wa.x,Wa.y,Wa.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)Wa.fromBufferAttribute(this,n),Wa.applyNormalMatrix(e),this.setXYZ(n,Wa.x,Wa.y,Wa.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)Wa.fromBufferAttribute(this,n),Wa.transformDirection(e),this.setXYZ(n,Wa.x,Wa.y,Wa.z);return this}set(e,n=0){return this.array.set(e,n),this}getComponent(e,n){let i=this.array[e*this.itemSize+n];return this.normalized&&(i=Vr(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Vn(i,this.array)),this.array[e*this.itemSize+n]=i,this}getX(e){let n=this.array[e*this.itemSize];return this.normalized&&(n=Vr(n,this.array)),n}setX(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize]=n,this}getY(e){let n=this.array[e*this.itemSize+1];return this.normalized&&(n=Vr(n,this.array)),n}setY(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+1]=n,this}getZ(e){let n=this.array[e*this.itemSize+2];return this.normalized&&(n=Vr(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+2]=n,this}getW(e){let n=this.array[e*this.itemSize+3];return this.normalized&&(n=Vr(n,this.array)),n}setW(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+3]=n,this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array)),this.array[e+0]=n,this.array[e+1]=i,this}setXYZ(e,n,i,a){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=a,this}setXYZW(e,n,i,a,s){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array),s=Vn(s,this.array)),this.array[e+0]=n,this.array[e+1]=i,this.array[e+2]=a,this.array[e+3]=s,this}onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==A1&&(e.usage=this.usage),e}}class ume extends $i{constructor(e,n,i){super(new Int8Array(e),n,i)}}class dme extends $i{constructor(e,n,i){super(new Uint8Array(e),n,i)}}class fme extends $i{constructor(e,n,i){super(new Uint8ClampedArray(e),n,i)}}class hme extends $i{constructor(e,n,i){super(new Int16Array(e),n,i)}}class u6 extends $i{constructor(e,n,i){super(new Uint16Array(e),n,i)}}class pme extends $i{constructor(e,n,i){super(new Int32Array(e),n,i)}}class d6 extends $i{constructor(e,n,i){super(new Uint32Array(e),n,i)}}class mme extends $i{constructor(e,n,i){super(new Uint16Array(e),n,i),this.isFloat16BufferAttribute=!0}getX(e){let n=bb(this.array[e*this.itemSize]);return this.normalized&&(n=Vr(n,this.array)),n}setX(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize]=so(n),this}getY(e){let n=bb(this.array[e*this.itemSize+1]);return this.normalized&&(n=Vr(n,this.array)),n}setY(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+1]=so(n),this}getZ(e){let n=bb(this.array[e*this.itemSize+2]);return this.normalized&&(n=Vr(n,this.array)),n}setZ(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+2]=so(n),this}getW(e){let n=bb(this.array[e*this.itemSize+3]);return this.normalized&&(n=Vr(n,this.array)),n}setW(e,n){return this.normalized&&(n=Vn(n,this.array)),this.array[e*this.itemSize+3]=so(n),this}setXY(e,n,i){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array)),this.array[e+0]=so(n),this.array[e+1]=so(i),this}setXYZ(e,n,i,a){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array)),this.array[e+0]=so(n),this.array[e+1]=so(i),this.array[e+2]=so(a),this}setXYZW(e,n,i,a,s){return e*=this.itemSize,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array),s=Vn(s,this.array)),this.array[e+0]=so(n),this.array[e+1]=so(i),this.array[e+2]=so(a),this.array[e+3]=so(s),this}}class an extends $i{constructor(e,n,i){super(new Float32Array(e),n,i)}}let gme=0;const pl=new wn,SM=new Jn,H0=new fe,Oo=new mr,nb=new mr,Es=new fe;class Pn extends wu{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:gme++}),this.uuid=$o(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(u$(e)?d6:u6)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,n){return this.attributes[e]=n,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,n,i=0){this.groups.push({start:e,count:n,materialIndex:i})}clearGroups(){this.groups=[]}setDrawRange(e,n){this.drawRange.start=e,this.drawRange.count=n}applyMatrix4(e){const n=this.attributes.position;n!==void 0&&(n.applyMatrix4(e),n.needsUpdate=!0);const i=this.attributes.normal;if(i!==void 0){const s=new jn().getNormalMatrix(e);i.applyNormalMatrix(s),i.needsUpdate=!0}const a=this.attributes.tangent;return a!==void 0&&(a.transformDirection(e),a.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return pl.makeRotationFromQuaternion(e),this.applyMatrix4(pl),this}rotateX(e){return pl.makeRotationX(e),this.applyMatrix4(pl),this}rotateY(e){return pl.makeRotationY(e),this.applyMatrix4(pl),this}rotateZ(e){return pl.makeRotationZ(e),this.applyMatrix4(pl),this}translate(e,n,i){return pl.makeTranslation(e,n,i),this.applyMatrix4(pl),this}scale(e,n,i){return pl.makeScale(e,n,i),this.applyMatrix4(pl),this}lookAt(e){return SM.lookAt(e),SM.updateMatrix(),this.applyMatrix4(SM.matrix),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(H0).negate(),this.translate(H0.x,H0.y,H0.z),this}setFromPoints(e){const n=this.getAttribute("position");if(n===void 0){const i=[];for(let a=0,s=e.length;a<s;a++){const r=e[a];i.push(r.x,r.y,r.z||0)}this.setAttribute("position",new an(i,3))}else{const i=Math.min(e.length,n.count);for(let a=0;a<i;a++){const s=e[a];n.setXYZ(a,s.x,s.y,s.z||0)}e.length>n.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),n.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new mr);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new fe(-1/0,-1/0,-1/0),new fe(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),n)for(let i=0,a=n.length;i<a;i++){const s=n[i];Oo.setFromBufferAttribute(s),this.morphTargetsRelative?(Es.addVectors(this.boundingBox.min,Oo.min),this.boundingBox.expandByPoint(Es),Es.addVectors(this.boundingBox.max,Oo.max),this.boundingBox.expandByPoint(Es)):(this.boundingBox.expandByPoint(Oo.min),this.boundingBox.expandByPoint(Oo.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Vs);const e=this.attributes.position,n=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new fe,1/0);return}if(e){const i=this.boundingSphere.center;if(Oo.setFromBufferAttribute(e),n)for(let s=0,r=n.length;s<r;s++){const o=n[s];nb.setFromBufferAttribute(o),this.morphTargetsRelative?(Es.addVectors(Oo.min,nb.min),Oo.expandByPoint(Es),Es.addVectors(Oo.max,nb.max),Oo.expandByPoint(Es)):(Oo.expandByPoint(nb.min),Oo.expandByPoint(nb.max))}Oo.getCenter(i);let a=0;for(let s=0,r=e.count;s<r;s++)Es.fromBufferAttribute(e,s),a=Math.max(a,i.distanceToSquared(Es));if(n)for(let s=0,r=n.length;s<r;s++){const o=n[s],c=this.morphTargetsRelative;for(let u=0,h=o.count;u<h;u++)Es.fromBufferAttribute(o,u),c&&(H0.fromBufferAttribute(e,u),Es.add(H0)),a=Math.max(a,i.distanceToSquared(Es))}this.boundingSphere.radius=Math.sqrt(a),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,n=this.attributes;if(e===null||n.position===void 0||n.normal===void 0||n.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const i=n.position,a=n.normal,s=n.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new $i(new Float32Array(4*i.count),4));const r=this.getAttribute("tangent"),o=[],c=[];for(let B=0;B<i.count;B++)o[B]=new fe,c[B]=new fe;const u=new fe,h=new fe,d=new fe,p=new _t,g=new _t,b=new _t,w=new fe,x=new fe;function S(B,z,I){u.fromBufferAttribute(i,B),h.fromBufferAttribute(i,z),d.fromBufferAttribute(i,I),p.fromBufferAttribute(s,B),g.fromBufferAttribute(s,z),b.fromBufferAttribute(s,I),h.sub(u),d.sub(u),g.sub(p),b.sub(p);const U=1/(g.x*b.y-b.x*g.y);isFinite(U)&&(w.copy(h).multiplyScalar(b.y).addScaledVector(d,-g.y).multiplyScalar(U),x.copy(d).multiplyScalar(g.x).addScaledVector(h,-b.x).multiplyScalar(U),o[B].add(w),o[z].add(w),o[I].add(w),c[B].add(x),c[z].add(x),c[I].add(x))}let M=this.groups;M.length===0&&(M=[{start:0,count:e.count}]);for(let B=0,z=M.length;B<z;++B){const I=M[B],U=I.start,$=I.count;for(let G=U,k=U+$;G<k;G+=3)S(e.getX(G+0),e.getX(G+1),e.getX(G+2))}const C=new fe,A=new fe,N=new fe,R=new fe;function D(B){N.fromBufferAttribute(a,B),R.copy(N);const z=o[B];C.copy(z),C.sub(N.multiplyScalar(N.dot(z))).normalize(),A.crossVectors(R,z);const U=A.dot(c[B])<0?-1:1;r.setXYZW(B,C.x,C.y,C.z,U)}for(let B=0,z=M.length;B<z;++B){const I=M[B],U=I.start,$=I.count;for(let G=U,k=U+$;G<k;G+=3)D(e.getX(G+0)),D(e.getX(G+1)),D(e.getX(G+2))}}computeVertexNormals(){const e=this.index,n=this.getAttribute("position");if(n!==void 0){let i=this.getAttribute("normal");if(i===void 0)i=new $i(new Float32Array(n.count*3),3),this.setAttribute("normal",i);else for(let p=0,g=i.count;p<g;p++)i.setXYZ(p,0,0,0);const a=new fe,s=new fe,r=new fe,o=new fe,c=new fe,u=new fe,h=new fe,d=new fe;if(e)for(let p=0,g=e.count;p<g;p+=3){const b=e.getX(p+0),w=e.getX(p+1),x=e.getX(p+2);a.fromBufferAttribute(n,b),s.fromBufferAttribute(n,w),r.fromBufferAttribute(n,x),h.subVectors(r,s),d.subVectors(a,s),h.cross(d),o.fromBufferAttribute(i,b),c.fromBufferAttribute(i,w),u.fromBufferAttribute(i,x),o.add(h),c.add(h),u.add(h),i.setXYZ(b,o.x,o.y,o.z),i.setXYZ(w,c.x,c.y,c.z),i.setXYZ(x,u.x,u.y,u.z)}else for(let p=0,g=n.count;p<g;p+=3)a.fromBufferAttribute(n,p+0),s.fromBufferAttribute(n,p+1),r.fromBufferAttribute(n,p+2),h.subVectors(r,s),d.subVectors(a,s),h.cross(d),i.setXYZ(p+0,h.x,h.y,h.z),i.setXYZ(p+1,h.x,h.y,h.z),i.setXYZ(p+2,h.x,h.y,h.z);this.normalizeNormals(),i.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let n=0,i=e.count;n<i;n++)Es.fromBufferAttribute(e,n),Es.normalize(),e.setXYZ(n,Es.x,Es.y,Es.z)}toNonIndexed(){function e(o,c){const u=o.array,h=o.itemSize,d=o.normalized,p=new u.constructor(c.length*h);let g=0,b=0;for(let w=0,x=c.length;w<x;w++){o.isInterleavedBufferAttribute?g=c[w]*o.data.stride+o.offset:g=c[w]*h;for(let S=0;S<h;S++)p[b++]=u[g++]}return new $i(p,h,d)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const n=new Pn,i=this.index.array,a=this.attributes;for(const o in a){const c=a[o],u=e(c,i);n.setAttribute(o,u)}const s=this.morphAttributes;for(const o in s){const c=[],u=s[o];for(let h=0,d=u.length;h<d;h++){const p=u[h],g=e(p,i);c.push(g)}n.morphAttributes[o]=c}n.morphTargetsRelative=this.morphTargetsRelative;const r=this.groups;for(let o=0,c=r.length;o<c;o++){const u=r[o];n.addGroup(u.start,u.count,u.materialIndex)}return n}toJSON(){const e={metadata:{version:4.7,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const c=this.parameters;for(const u in c)c[u]!==void 0&&(e[u]=c[u]);return e}e.data={attributes:{}};const n=this.index;n!==null&&(e.data.index={type:n.array.constructor.name,array:Array.prototype.slice.call(n.array)});const i=this.attributes;for(const c in i){const u=i[c];e.data.attributes[c]=u.toJSON(e.data)}const a={};let s=!1;for(const c in this.morphAttributes){const u=this.morphAttributes[c],h=[];for(let d=0,p=u.length;d<p;d++){const g=u[d];h.push(g.toJSON(e.data))}h.length>0&&(a[c]=h,s=!0)}s&&(e.data.morphAttributes=a,e.data.morphTargetsRelative=this.morphTargetsRelative);const r=this.groups;r.length>0&&(e.data.groups=JSON.parse(JSON.stringify(r)));const o=this.boundingSphere;return o!==null&&(e.data.boundingSphere=o.toJSON()),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const n={};this.name=e.name;const i=e.index;i!==null&&this.setIndex(i.clone());const a=e.attributes;for(const u in a){const h=a[u];this.setAttribute(u,h.clone(n))}const s=e.morphAttributes;for(const u in s){const h=[],d=s[u];for(let p=0,g=d.length;p<g;p++)h.push(d[p].clone(n));this.morphAttributes[u]=h}this.morphTargetsRelative=e.morphTargetsRelative;const r=e.groups;for(let u=0,h=r.length;u<h;u++){const d=r[u];this.addGroup(d.start,d.count,d.materialIndex)}const o=e.boundingBox;o!==null&&(this.boundingBox=o.clone());const c=e.boundingSphere;return c!==null&&(this.boundingSphere=c.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const q7=new wn,pp=new uv,y_=new Vs,Y7=new fe,b_=new fe,x_=new fe,__=new fe,wM=new fe,S_=new fe,Z7=new fe,w_=new fe;class Qt extends Jn{constructor(e=new Pn,n=new Eu){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.count=1,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const a=n[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=a.length;s<r;s++){const o=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}getVertexPosition(e,n){const i=this.geometry,a=i.attributes.position,s=i.morphAttributes.position,r=i.morphTargetsRelative;n.fromBufferAttribute(a,e);const o=this.morphTargetInfluences;if(s&&o){S_.set(0,0,0);for(let c=0,u=s.length;c<u;c++){const h=o[c],d=s[c];h!==0&&(wM.fromBufferAttribute(d,e),r?S_.addScaledVector(wM,h):S_.addScaledVector(wM.sub(n),h))}n.add(S_)}return n}raycast(e,n){const i=this.geometry,a=this.material,s=this.matrixWorld;a!==void 0&&(i.boundingSphere===null&&i.computeBoundingSphere(),y_.copy(i.boundingSphere),y_.applyMatrix4(s),pp.copy(e.ray).recast(e.near),!(y_.containsPoint(pp.origin)===!1&&(pp.intersectSphere(y_,Y7)===null||pp.origin.distanceToSquared(Y7)>(e.far-e.near)**2))&&(q7.copy(s).invert(),pp.copy(e.ray).applyMatrix4(q7),!(i.boundingBox!==null&&pp.intersectsBox(i.boundingBox)===!1)&&this._computeIntersections(e,n,pp)))}_computeIntersections(e,n,i){let a;const s=this.geometry,r=this.material,o=s.index,c=s.attributes.position,u=s.attributes.uv,h=s.attributes.uv1,d=s.attributes.normal,p=s.groups,g=s.drawRange;if(o!==null)if(Array.isArray(r))for(let b=0,w=p.length;b<w;b++){const x=p[b],S=r[x.materialIndex],M=Math.max(x.start,g.start),C=Math.min(o.count,Math.min(x.start+x.count,g.start+g.count));for(let A=M,N=C;A<N;A+=3){const R=o.getX(A),D=o.getX(A+1),B=o.getX(A+2);a=E_(this,S,e,i,u,h,d,R,D,B),a&&(a.faceIndex=Math.floor(A/3),a.face.materialIndex=x.materialIndex,n.push(a))}}else{const b=Math.max(0,g.start),w=Math.min(o.count,g.start+g.count);for(let x=b,S=w;x<S;x+=3){const M=o.getX(x),C=o.getX(x+1),A=o.getX(x+2);a=E_(this,r,e,i,u,h,d,M,C,A),a&&(a.faceIndex=Math.floor(x/3),n.push(a))}}else if(c!==void 0)if(Array.isArray(r))for(let b=0,w=p.length;b<w;b++){const x=p[b],S=r[x.materialIndex],M=Math.max(x.start,g.start),C=Math.min(c.count,Math.min(x.start+x.count,g.start+g.count));for(let A=M,N=C;A<N;A+=3){const R=A,D=A+1,B=A+2;a=E_(this,S,e,i,u,h,d,R,D,B),a&&(a.faceIndex=Math.floor(A/3),a.face.materialIndex=x.materialIndex,n.push(a))}}else{const b=Math.max(0,g.start),w=Math.min(c.count,g.start+g.count);for(let x=b,S=w;x<S;x+=3){const M=x,C=x+1,A=x+2;a=E_(this,r,e,i,u,h,d,M,C,A),a&&(a.faceIndex=Math.floor(x/3),n.push(a))}}}}function vme(t,e,n,i,a,s,r,o){let c;if(e.side===Kr?c=i.intersectTriangle(r,s,a,!0,o):c=i.intersectTriangle(a,s,r,e.side===Ed,o),c===null)return null;w_.copy(o),w_.applyMatrix4(t.matrixWorld);const u=n.ray.origin.distanceTo(w_);return u<n.near||u>n.far?null:{distance:u,point:w_.clone(),object:t}}function E_(t,e,n,i,a,s,r,o,c,u){t.getVertexPosition(o,b_),t.getVertexPosition(c,x_),t.getVertexPosition(u,__);const h=vme(t,e,n,i,b_,x_,__,Z7);if(h){const d=new fe;po.getBarycoord(Z7,b_,x_,__,d),a&&(h.uv=po.getInterpolatedAttribute(a,o,c,u,d,new _t)),s&&(h.uv1=po.getInterpolatedAttribute(s,o,c,u,d,new _t)),r&&(h.normal=po.getInterpolatedAttribute(r,o,c,u,d,new fe),h.normal.dot(i.direction)>0&&h.normal.multiplyScalar(-1));const p={a:o,b:c,c:u,normal:new fe,materialIndex:0};po.getNormal(b_,x_,__,p.normal),h.face=p,h.barycoord=d}return h}class fo extends Pn{constructor(e=1,n=1,i=1,a=1,s=1,r=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:n,depth:i,widthSegments:a,heightSegments:s,depthSegments:r};const o=this;a=Math.floor(a),s=Math.floor(s),r=Math.floor(r);const c=[],u=[],h=[],d=[];let p=0,g=0;b("z","y","x",-1,-1,i,n,e,r,s,0),b("z","y","x",1,-1,i,n,-e,r,s,1),b("x","z","y",1,1,e,i,n,a,r,2),b("x","z","y",1,-1,e,i,-n,a,r,3),b("x","y","z",1,-1,e,n,i,a,s,4),b("x","y","z",-1,-1,e,n,-i,a,s,5),this.setIndex(c),this.setAttribute("position",new an(u,3)),this.setAttribute("normal",new an(h,3)),this.setAttribute("uv",new an(d,2));function b(w,x,S,M,C,A,N,R,D,B,z){const I=A/D,U=N/B,$=A/2,G=N/2,k=R/2,X=D+1,V=B+1;let H=0,W=0;const J=new fe;for(let Y=0;Y<V;Y++){const K=Y*U-G;for(let ee=0;ee<X;ee++){const ie=ee*I-$;J[w]=ie*M,J[x]=K*C,J[S]=k,u.push(J.x,J.y,J.z),J[w]=0,J[x]=0,J[S]=R>0?1:-1,h.push(J.x,J.y,J.z),d.push(ee/D),d.push(1-Y/B),H+=1}}for(let Y=0;Y<B;Y++)for(let K=0;K<D;K++){const ee=p+K+X*Y,ie=p+K+X*(Y+1),Z=p+(K+1)+X*(Y+1),ue=p+(K+1)+X*Y;c.push(ee,ie,ue),c.push(ie,Z,ue),W+=6}o.addGroup(g,W,z),g+=W,p+=H}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fo(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Wg(t){const e={};for(const n in t){e[n]={};for(const i in t[n]){const a=t[n][i];a&&(a.isColor||a.isMatrix3||a.isMatrix4||a.isVector2||a.isVector3||a.isVector4||a.isTexture||a.isQuaternion)?a.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[n][i]=null):e[n][i]=a.clone():Array.isArray(a)?e[n][i]=a.slice():e[n][i]=a}}return e}function Fr(t){const e={};for(let n=0;n<t.length;n++){const i=Wg(t[n]);for(const a in i)e[a]=i[a]}return e}function yme(t){const e=[];for(let n=0;n<t.length;n++)e.push(t[n].clone());return e}function p$(t){const e=t.getRenderTarget();return e===null?t.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:mi.workingColorSpace}const m$={clone:Wg,merge:Fr};var bme=`void main() {
gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
}`,xme=`void main() {
gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
}`;class pc extends br{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=bme,this.fragmentShader=xme,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Wg(e.uniforms),this.uniformsGroups=yme(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const n=super.toJSON(e);n.glslVersion=this.glslVersion,n.uniforms={};for(const a in this.uniforms){const r=this.uniforms[a].value;r&&r.isTexture?n.uniforms[a]={type:"t",value:r.toJSON(e).uuid}:r&&r.isColor?n.uniforms[a]={type:"c",value:r.getHex()}:r&&r.isVector2?n.uniforms[a]={type:"v2",value:r.toArray()}:r&&r.isVector3?n.uniforms[a]={type:"v3",value:r.toArray()}:r&&r.isVector4?n.uniforms[a]={type:"v4",value:r.toArray()}:r&&r.isMatrix3?n.uniforms[a]={type:"m3",value:r.toArray()}:r&&r.isMatrix4?n.uniforms[a]={type:"m4",value:r.toArray()}:n.uniforms[a]={value:r}}Object.keys(this.defines).length>0&&(n.defines=this.defines),n.vertexShader=this.vertexShader,n.fragmentShader=this.fragmentShader,n.lights=this.lights,n.clipping=this.clipping;const i={};for(const a in this.extensions)this.extensions[a]===!0&&(i[a]=!0);return Object.keys(i).length>0&&(n.extensions=i),n}}class Iw extends Jn{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new wn,this.projectionMatrix=new wn,this.projectionMatrixInverse=new wn,this.coordinateSystem=ko,this._reversedDepth=!1}get reversedDepth(){return this._reversedDepth}copy(e,n){return super.copy(e,n),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,n){super.updateWorldMatrix(e,n),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const wf=new fe,Q7=new _t,J7=new _t;let Ms=class extends Iw{constructor(e=50,n=1,i=.1,a=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=i,this.far=a,this.focus=10,this.aspect=n,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const n=.5*this.getFilmHeight()/e;this.fov=$g*2*Math.atan(n),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(Kp*.5*this.fov);return .5*this.getFilmHeight()/e}getEffectiveFOV(){return $g*2*Math.atan(Math.tan(Kp*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,n,i){wf.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(wf.x,wf.y).multiplyScalar(-e/wf.z),wf.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),i.set(wf.x,wf.y).multiplyScalar(-e/wf.z)}getViewSize(e,n){return this.getViewBounds(e,Q7,J7),n.subVectors(J7,Q7)}setViewOffset(e,n,i,a,s,r){this.aspect=e/n,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let n=e*Math.tan(Kp*.5*this.fov)/this.zoom,i=2*n,a=this.aspect*i,s=-.5*a;const r=this.view;if(this.view!==null&&this.view.enabled){const c=r.fullWidth,u=r.fullHeight;s+=r.offsetX*a/c,n-=r.offsetY*i/u,a*=r.width/c,i*=r.height/u}const o=this.filmOffset;o!==0&&(s+=e*o/this.getFilmWidth()),this.projectionMatrix.makePerspective(s,s+a,n,n-i,e,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.fov=this.fov,n.object.zoom=this.zoom,n.object.near=this.near,n.object.far=this.far,n.object.focus=this.focus,n.object.aspect=this.aspect,this.view!==null&&(n.object.view=Object.assign({},this.view)),n.object.filmGauge=this.filmGauge,n.object.filmOffset=this.filmOffset,n}};const $0=-90,G0=1;class g$ extends Jn{constructor(e,n,i){super(),this.type="CubeCamera",this.renderTarget=i,this.coordinateSystem=null,this.activeMipmapLevel=0;const a=new Ms($0,G0,e,n);a.layers=this.layers,this.add(a);const s=new Ms($0,G0,e,n);s.layers=this.layers,this.add(s);const r=new Ms($0,G0,e,n);r.layers=this.layers,this.add(r);const o=new Ms($0,G0,e,n);o.layers=this.layers,this.add(o);const c=new Ms($0,G0,e,n);c.layers=this.layers,this.add(c);const u=new Ms($0,G0,e,n);u.layers=this.layers,this.add(u)}updateCoordinateSystem(){const e=this.coordinateSystem,n=this.children.concat(),[i,a,s,r,o,c]=n;for(const u of n)this.remove(u);if(e===ko)i.up.set(0,1,0),i.lookAt(1,0,0),a.up.set(0,1,0),a.lookAt(-1,0,0),s.up.set(0,0,-1),s.lookAt(0,1,0),r.up.set(0,0,1),r.lookAt(0,-1,0),o.up.set(0,1,0),o.lookAt(0,0,1),c.up.set(0,1,0),c.lookAt(0,0,-1);else if(e===Hg)i.up.set(0,-1,0),i.lookAt(-1,0,0),a.up.set(0,-1,0),a.lookAt(1,0,0),s.up.set(0,0,1),s.lookAt(0,1,0),r.up.set(0,0,-1),r.lookAt(0,-1,0),o.up.set(0,-1,0),o.lookAt(0,0,1),c.up.set(0,-1,0),c.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const u of n)this.add(u),u.updateMatrixWorld()}update(e,n){this.parent===null&&this.updateMatrixWorld();const{renderTarget:i,activeMipmapLevel:a}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[s,r,o,c,u,h]=this.children,d=e.getRenderTarget(),p=e.getActiveCubeFace(),g=e.getActiveMipmapLevel(),b=e.xr.enabled;e.xr.enabled=!1;const w=i.texture.generateMipmaps;i.texture.generateMipmaps=!1,e.setRenderTarget(i,0,a),e.render(n,s),e.setRenderTarget(i,1,a),e.render(n,r),e.setRenderTarget(i,2,a),e.render(n,o),e.setRenderTarget(i,3,a),e.render(n,c),e.setRenderTarget(i,4,a),e.render(n,u),i.texture.generateMipmaps=w,e.setRenderTarget(i,5,a),e.render(n,h),e.setRenderTarget(d,p,g),e.xr.enabled=b,i.texture.needsPMREMUpdate=!0}}class ux extends Na{constructor(e=[],n=Md,i,a,s,r,o,c,u,h){super(e,n,i,a,s,r,o,c,u,h),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class v$ extends hc{constructor(e=1,n={}){super(e,e,n),this.isWebGLCubeRenderTarget=!0;const i={width:e,height:e,depth:1},a=[i,i,i,i,i,i];this.texture=new ux(a),this._setTextureOptions(n),this.texture.isRenderTargetTexture=!0}fromEquirectangularTexture(e,n){this.texture.type=n.type,this.texture.colorSpace=n.colorSpace,this.texture.generateMipmaps=n.generateMipmaps,this.texture.minFilter=n.minFilter,this.texture.magFilter=n.magFilter;const i={uniforms:{tEquirect:{value:null}},vertexShader:`
varying vec3 vWorldDirection;
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}
`,fragmentShader:`
uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
}
`},a=new fo(5,5,5),s=new pc({name:"CubemapFromEquirect",uniforms:Wg(i.uniforms),vertexShader:i.vertexShader,fragmentShader:i.fragmentShader,side:Kr,blending:xd});s.uniforms.tEquirect.value=n;const r=new Qt(a,s),o=n.minFilter;return n.minFilter===cu&&(n.minFilter=ja),new g$(1,10,this).update(e,r),n.minFilter=o,r.geometry.dispose(),r.material.dispose(),this}clear(e,n=!0,i=!0,a=!0){const s=e.getRenderTarget();for(let r=0;r<6;r++)e.setRenderTarget(this,r),e.clear(n,i,a);e.setRenderTarget(s)}}class bg extends Jn{constructor(){super(),this.isGroup=!0,this.type="Group"}}const _me={type:"move"};class xS{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new bg,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new bg,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new fe,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new fe),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new bg,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new fe,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new fe),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const n=this._hand;if(n)for(const i of e.hand.values())this._getHandJoint(n,i)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,n,i){let a=null,s=null,r=null;const o=this._targetRay,c=this._grip,u=this._hand;if(e&&n.session.visibilityState!=="visible-blurred"){if(u&&e.hand){r=!0;for(const w of e.hand.values()){const x=n.getJointPose(w,i),S=this._getHandJoint(u,w);x!==null&&(S.matrix.fromArray(x.transform.matrix),S.matrix.decompose(S.position,S.rotation,S.scale),S.matrixWorldNeedsUpdate=!0,S.jointRadius=x.radius),S.visible=x!==null}const h=u.joints["index-finger-tip"],d=u.joints["thumb-tip"],p=h.position.distanceTo(d.position),g=.02,b=.005;u.inputState.pinching&&p>g+b?(u.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!u.inputState.pinching&&p<=g-b&&(u.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else c!==null&&e.gripSpace&&(s=n.getPose(e.gripSpace,i),s!==null&&(c.matrix.fromArray(s.transform.matrix),c.matrix.decompose(c.position,c.rotation,c.scale),c.matrixWorldNeedsUpdate=!0,s.linearVelocity?(c.hasLinearVelocity=!0,c.linearVelocity.copy(s.linearVelocity)):c.hasLinearVelocity=!1,s.angularVelocity?(c.hasAngularVelocity=!0,c.angularVelocity.copy(s.angularVelocity)):c.hasAngularVelocity=!1));o!==null&&(a=n.getPose(e.targetRaySpace,i),a===null&&s!==null&&(a=s),a!==null&&(o.matrix.fromArray(a.transform.matrix),o.matrix.decompose(o.position,o.rotation,o.scale),o.matrixWorldNeedsUpdate=!0,a.linearVelocity?(o.hasLinearVelocity=!0,o.linearVelocity.copy(a.linearVelocity)):o.hasLinearVelocity=!1,a.angularVelocity?(o.hasAngularVelocity=!0,o.angularVelocity.copy(a.angularVelocity)):o.hasAngularVelocity=!1,this.dispatchEvent(_me)))}return o!==null&&(o.visible=a!==null),c!==null&&(c.visible=s!==null),u!==null&&(u.visible=r!==null),this}_getHandJoint(e,n){if(e.joints[n.jointName]===void 0){const i=new bg;i.matrixAutoUpdate=!1,i.visible=!1,e.joints[n.jointName]=i,e.add(i)}return e.joints[n.jointName]}}class zw{constructor(e,n=25e-5){this.isFogExp2=!0,this.name="",this.color=new Wt(e),this.density=n}clone(){return new zw(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class Bw{constructor(e,n=1,i=1e3){this.isFog=!0,this.name="",this.color=new Wt(e),this.near=n,this.far=i}clone(){return new Bw(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class f6 extends Jn{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new xo,this.environmentIntensity=1,this.environmentRotation=new xo,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,n){return super.copy(e,n),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const n=super.toJSON(e);return this.fog!==null&&(n.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(n.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(n.object.backgroundIntensity=this.backgroundIntensity),n.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(n.object.environmentIntensity=this.environmentIntensity),n.object.environmentRotation=this.environmentRotation.toArray(),n}}class Uw{constructor(e,n){this.isInterleavedBuffer=!0,this.array=e,this.stride=n,this.count=e!==void 0?e.length/n:0,this.usage=A1,this.updateRanges=[],this.version=0,this.uuid=$o()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,n){this.updateRanges.push({start:e,count:n})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,n,i){e*=this.stride,i*=n.stride;for(let a=0,s=this.stride;a<s;a++)this.array[e+a]=n.array[i+a];return this}set(e,n=0){return this.array.set(e,n),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=$o()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const n=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),i=new this.constructor(n,this.stride);return i.setUsage(this.usage),i}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=$o()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const jr=new fe;class im{constructor(e,n,i,a=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=n,this.offset=i,this.normalized=a}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let n=0,i=this.data.count;n<i;n++)jr.fromBufferAttribute(this,n),jr.applyMatrix4(e),this.setXYZ(n,jr.x,jr.y,jr.z);return this}applyNormalMatrix(e){for(let n=0,i=this.count;n<i;n++)jr.fromBufferAttribute(this,n),jr.applyNormalMatrix(e),this.setXYZ(n,jr.x,jr.y,jr.z);return this}transformDirection(e){for(let n=0,i=this.count;n<i;n++)jr.fromBufferAttribute(this,n),jr.transformDirection(e),this.setXYZ(n,jr.x,jr.y,jr.z);return this}getComponent(e,n){let i=this.array[e*this.data.stride+this.offset+n];return this.normalized&&(i=Vr(i,this.array)),i}setComponent(e,n,i){return this.normalized&&(i=Vn(i,this.array)),this.data.array[e*this.data.stride+this.offset+n]=i,this}setX(e,n){return this.normalized&&(n=Vn(n,this.array)),this.data.array[e*this.data.stride+this.offset]=n,this}setY(e,n){return this.normalized&&(n=Vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+1]=n,this}setZ(e,n){return this.normalized&&(n=Vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+2]=n,this}setW(e,n){return this.normalized&&(n=Vn(n,this.array)),this.data.array[e*this.data.stride+this.offset+3]=n,this}getX(e){let n=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(n=Vr(n,this.array)),n}getY(e){let n=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(n=Vr(n,this.array)),n}getZ(e){let n=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(n=Vr(n,this.array)),n}getW(e){let n=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(n=Vr(n,this.array)),n}setXY(e,n,i){return e=e*this.data.stride+this.offset,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this}setXYZ(e,n,i,a){return e=e*this.data.stride+this.offset,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=a,this}setXYZW(e,n,i,a,s){return e=e*this.data.stride+this.offset,this.normalized&&(n=Vn(n,this.array),i=Vn(i,this.array),a=Vn(a,this.array),s=Vn(s,this.array)),this.data.array[e+0]=n,this.data.array[e+1]=i,this.data.array[e+2]=a,this.data.array[e+3]=s,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)n.push(this.data.array[a+s])}return new $i(new this.array.constructor(n),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new im(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const n=[];for(let i=0;i<this.count;i++){const a=i*this.data.stride+this.offset;for(let s=0;s<this.itemSize;s++)n.push(this.data.array[a+s])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:n,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class h6 extends br{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Wt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let W0;const ib=new fe,K0=new fe,X0=new fe,q0=new _t,ab=new _t,y$=new wn,M_=new fe,sb=new fe,T_=new fe,eL=new _t,EM=new _t,tL=new _t;class b$ extends Jn{constructor(e=new h6){if(super(),this.isSprite=!0,this.type="Sprite",W0===void 0){W0=new Pn;const n=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),i=new Uw(n,5);W0.setIndex([0,1,2,0,2,3]),W0.setAttribute("position",new im(i,3,0,!1)),W0.setAttribute("uv",new im(i,2,3,!1))}this.geometry=W0,this.material=e,this.center=new _t(.5,.5),this.count=1}raycast(e,n){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),K0.setFromMatrixScale(this.matrixWorld),y$.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),X0.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&K0.multiplyScalar(-X0.z);const i=this.material.rotation;let a,s;i!==0&&(s=Math.cos(i),a=Math.sin(i));const r=this.center;C_(M_.set(-.5,-.5,0),X0,r,K0,a,s),C_(sb.set(.5,-.5,0),X0,r,K0,a,s),C_(T_.set(.5,.5,0),X0,r,K0,a,s),eL.set(0,0),EM.set(1,0),tL.set(1,1);let o=e.ray.intersectTriangle(M_,sb,T_,!1,ib);if(o===null&&(C_(sb.set(-.5,.5,0),X0,r,K0,a,s),EM.set(0,1),o=e.ray.intersectTriangle(M_,T_,sb,!1,ib),o===null))return;const c=e.ray.origin.distanceTo(ib);c<e.near||c>e.far||n.push({distance:c,point:ib.clone(),uv:po.getInterpolation(ib,M_,sb,T_,eL,EM,tL,new _t),face:null,object:this})}copy(e,n){return super.copy(e,n),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function C_(t,e,n,i,a,s){q0.subVectors(t,n).addScalar(.5).multiply(i),a!==void 0?(ab.x=s*q0.x-a*q0.y,ab.y=a*q0.x+s*q0.y):ab.copy(q0),t.copy(e),t.x+=ab.x,t.y+=ab.y,t.applyMatrix4(y$)}const A_=new fe,nL=new fe;class x$ extends Jn{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const n=e.levels;for(let i=0,a=n.length;i<a;i++){const s=n[i];this.addLevel(s.object.clone(),s.distance,s.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,n=0,i=0){n=Math.abs(n);const a=this.levels;let s;for(s=0;s<a.length&&!(n<a[s].distance);s++);return a.splice(s,0,{distance:n,hysteresis:i,object:e}),this.add(e),this}removeLevel(e){const n=this.levels;for(let i=0;i<n.length;i++)if(n[i].distance===e){const a=n.splice(i,1);return this.remove(a[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const n=this.levels;if(n.length>0){let i,a;for(i=1,a=n.length;i<a;i++){let s=n[i].distance;if(n[i].object.visible&&(s-=s*n[i].hysteresis),e<s)break}return n[i-1].object}return null}raycast(e,n){if(this.levels.length>0){A_.setFromMatrixPosition(this.matrixWorld);const a=e.ray.origin.distanceTo(A_);this.getObjectForDistance(a).raycast(e,n)}}update(e){const n=this.levels;if(n.length>1){A_.setFromMatrixPosition(e.matrixWorld),nL.setFromMatrixPosition(this.matrixWorld);const i=A_.distanceTo(nL)/e.zoom;n[0].object.visible=!0;let a,s;for(a=1,s=n.length;a<s;a++){let r=n[a].distance;if(n[a].object.visible&&(r-=r*n[a].hysteresis),i>=r)n[a-1].object.visible=!1,n[a].object.visible=!0;else break}for(this._currentLevel=a-1;a<s;a++)n[a].object.visible=!1}}toJSON(e){const n=super.toJSON(e);this.autoUpdate===!1&&(n.object.autoUpdate=!1),n.object.levels=[];const i=this.levels;for(let a=0,s=i.length;a<s;a++){const r=i[a];n.object.levels.push({object:r.object.uuid,distance:r.distance,hysteresis:r.hysteresis})}return n}}const iL=new fe,aL=new xi,sL=new xi,Sme=new fe,rL=new wn,R_=new fe,MM=new Vs,oL=new wn,TM=new uv;class _$ extends Qt{constructor(e,n){super(e,n),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=D5,this.bindMatrix=new wn,this.bindMatrixInverse=new wn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new mr),this.boundingBox.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,R_),this.boundingBox.expandByPoint(R_)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Vs),this.boundingSphere.makeEmpty();const n=e.getAttribute("position");for(let i=0;i<n.count;i++)this.getVertexPosition(i,R_),this.boundingSphere.expandByPoint(R_)}copy(e,n){return super.copy(e,n),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,n){const i=this.material,a=this.matrixWorld;i!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),MM.copy(this.boundingSphere),MM.applyMatrix4(a),e.ray.intersectsSphere(MM)!==!1&&(oL.copy(a).invert(),TM.copy(e.ray).applyMatrix4(oL),!(this.boundingBox!==null&&TM.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,n,TM)))}getVertexPosition(e,n){return super.getVertexPosition(e,n),this.applyBoneTransform(e,n),n}bind(e,n){this.skeleton=e,n===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),n=this.matrixWorld),this.bindMatrix.copy(n),this.bindMatrixInverse.copy(n).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new xi,n=this.geometry.attributes.skinWeight;for(let i=0,a=n.count;i<a;i++){e.fromBufferAttribute(n,i);const s=1/e.manhattanLength();s!==1/0?e.multiplyScalar(s):e.set(1,0,0,0),n.setXYZW(i,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===D5?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===YH?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,n){const i=this.skeleton,a=this.geometry;aL.fromBufferAttribute(a.attributes.skinIndex,e),sL.fromBufferAttribute(a.attributes.skinWeight,e),iL.copy(n).applyMatrix4(this.bindMatrix),n.set(0,0,0);for(let s=0;s<4;s++){const r=sL.getComponent(s);if(r!==0){const o=aL.getComponent(s);rL.multiplyMatrices(i.bones[o].matrixWorld,i.boneInverses[o]),n.addScaledVector(Sme.copy(iL).applyMatrix4(rL),r)}}return n.applyMatrix4(this.bindMatrixInverse)}}class p6 extends Jn{constructor(){super(),this.isBone=!0,this.type="Bone"}}class gu extends Na{constructor(e=null,n=1,i=1,a,s,r,o,c,u=Fs,h=Fs,d,p){super(null,r,o,c,u,h,a,s,d,p),this.isDataTexture=!0,this.image={data:e,width:n,height:i},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const lL=new wn,wme=new wn;class jw{constructor(e=[],n=[]){this.uuid=$o(),this.bones=e.slice(0),this.boneInverses=n,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,n=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),n.length===0)this.calculateInverses();else if(e.length!==n.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let i=0,a=this.bones.length;i<a;i++)this.boneInverses.push(new wn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,n=this.bones.length;e<n;e++){const i=new wn;this.bones[e]&&i.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(i)}}pose(){for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&i.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,n=this.bones.length;e<n;e++){const i=this.bones[e];i&&(i.parent&&i.parent.isBone?(i.matrix.copy(i.parent.matrixWorld).invert(),i.matrix.multiply(i.matrixWorld)):i.matrix.copy(i.matrixWorld),i.matrix.decompose(i.position,i.quaternion,i.scale))}}update(){const e=this.bones,n=this.boneInverses,i=this.boneMatrices,a=this.boneTexture;for(let s=0,r=e.length;s<r;s++){const o=e[s]?e[s].matrixWorld:wme;lL.multiplyMatrices(o,n[s]),lL.toArray(i,s*16)}a!==null&&(a.needsUpdate=!0)}clone(){return new jw(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4);n.set(this.boneMatrices);const i=new gu(n,e,e,fr,Hr);return i.needsUpdate=!0,this.boneMatrices=n,this.boneTexture=i,this}getBoneByName(e){for(let n=0,i=this.bones.length;n<i;n++){const a=this.bones[n];if(a.name===e)return a}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,n){this.uuid=e.uuid;for(let i=0,a=e.bones.length;i<a;i++){const s=e.bones[i];let r=n[s];r===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",s),r=new p6),this.bones.push(r),this.boneInverses.push(new wn().fromArray(e.boneInverses[i]))}return this.init(),this}toJSON(){const e={metadata:{version:4.7,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const n=this.bones,i=this.boneInverses;for(let a=0,s=n.length;a<s;a++){const r=n[a];e.bones.push(r.uuid);const o=i[a];e.boneInverses.push(o.toArray())}return e}}class Kg extends $i{constructor(e,n,i,a=1){super(e,n,i),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=a}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const Y0=new wn,cL=new wn,N_=[],uL=new mr,Eme=new wn,rb=new Qt,ob=new Vs;class S$ extends Qt{constructor(e,n,i){super(e,n),this.isInstancedMesh=!0,this.instanceMatrix=new Kg(new Float32Array(i*16),16),this.instanceColor=null,this.morphTexture=null,this.count=i,this.boundingBox=null,this.boundingSphere=null;for(let a=0;a<i;a++)this.setMatrixAt(a,Eme)}computeBoundingBox(){const e=this.geometry,n=this.count;this.boundingBox===null&&(this.boundingBox=new mr),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,Y0),uL.copy(e.boundingBox).applyMatrix4(Y0),this.boundingBox.union(uL)}computeBoundingSphere(){const e=this.geometry,n=this.count;this.boundingSphere===null&&(this.boundingSphere=new Vs),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let i=0;i<n;i++)this.getMatrixAt(i,Y0),ob.copy(e.boundingSphere).applyMatrix4(Y0),this.boundingSphere.union(ob)}copy(e,n){return super.copy(e,n),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,n){n.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,n){n.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,n){const i=n.morphTargetInfluences,a=this.morphTexture.source.data.data,s=i.length+1,r=e*s+1;for(let o=0;o<i.length;o++)i[o]=a[r+o]}raycast(e,n){const i=this.matrixWorld,a=this.count;if(rb.geometry=this.geometry,rb.material=this.material,rb.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),ob.copy(this.boundingSphere),ob.applyMatrix4(i),e.ray.intersectsSphere(ob)!==!1))for(let s=0;s<a;s++){this.getMatrixAt(s,Y0),cL.multiplyMatrices(i,Y0),rb.matrixWorld=cL,rb.raycast(e,N_);for(let r=0,o=N_.length;r<o;r++){const c=N_[r];c.instanceId=s,c.object=this,n.push(c)}N_.length=0}}setColorAt(e,n){this.instanceColor===null&&(this.instanceColor=new Kg(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),n.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,n){n.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,n){const i=n.morphTargetInfluences,a=i.length+1;this.morphTexture===null&&(this.morphTexture=new gu(new Float32Array(a*this.count),a,this.count,Rw,Hr));const s=this.morphTexture.source.data.data;let r=0;for(let u=0;u<i.length;u++)r+=i[u];const o=this.geometry.morphTargetsRelative?1:1-r,c=a*e;s[c]=o,s.set(i,c+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const CM=new fe,Mme=new fe,Tme=new jn;class Rf{constructor(e=new fe(1,0,0),n=0){this.isPlane=!0,this.normal=e,this.constant=n}set(e,n){return this.normal.copy(e),this.constant=n,this}setComponents(e,n,i,a){return this.normal.set(e,n,i),this.constant=a,this}setFromNormalAndCoplanarPoint(e,n){return this.normal.copy(e),this.constant=-n.dot(this.normal),this}setFromCoplanarPoints(e,n,i){const a=CM.subVectors(i,n).cross(Mme.subVectors(e,n)).normalize();return this.setFromNormalAndCoplanarPoint(a,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,n){return n.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,n){const i=e.delta(CM),a=this.normal.dot(i);if(a===0)return this.distanceToPoint(e.start)===0?n.copy(e.start):null;const s=-(e.start.dot(this.normal)+this.constant)/a;return s<0||s>1?null:n.copy(e.start).addScaledVector(i,s)}intersectsLine(e){const n=this.distanceToPoint(e.start),i=this.distanceToPoint(e.end);return n<0&&i>0||i<0&&n>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,n){const i=n||Tme.getNormalMatrix(e),a=this.coplanarPoint(CM).applyMatrix4(e),s=this.normal.applyMatrix3(i).normalize();return this.constant=-a.dot(s),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const mp=new Vs,Cme=new _t(.5,.5),P_=new fe;class dv{constructor(e=new Rf,n=new Rf,i=new Rf,a=new Rf,s=new Rf,r=new Rf){this.planes=[e,n,i,a,s,r]}set(e,n,i,a,s,r){const o=this.planes;return o[0].copy(e),o[1].copy(n),o[2].copy(i),o[3].copy(a),o[4].copy(s),o[5].copy(r),this}copy(e){const n=this.planes;for(let i=0;i<6;i++)n[i].copy(e.planes[i]);return this}setFromProjectionMatrix(e,n=ko,i=!1){const a=this.planes,s=e.elements,r=s[0],o=s[1],c=s[2],u=s[3],h=s[4],d=s[5],p=s[6],g=s[7],b=s[8],w=s[9],x=s[10],S=s[11],M=s[12],C=s[13],A=s[14],N=s[15];if(a[0].setComponents(u-r,g-h,S-b,N-M).normalize(),a[1].setComponents(u+r,g+h,S+b,N+M).normalize(),a[2].setComponents(u+o,g+d,S+w,N+C).normalize(),a[3].setComponents(u-o,g-d,S-w,N-C).normalize(),i)a[4].setComponents(c,p,x,A).normalize(),a[5].setComponents(u-c,g-p,S-x,N-A).normalize();else if(a[4].setComponents(u-c,g-p,S-x,N-A).normalize(),n===ko)a[5].setComponents(u+c,g+p,S+x,N+A).normalize();else if(n===Hg)a[5].setComponents(c,p,x,A).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+n);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),mp.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const n=e.geometry;n.boundingSphere===null&&n.computeBoundingSphere(),mp.copy(n.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(mp)}intersectsSprite(e){mp.center.set(0,0,0);const n=Cme.distanceTo(e.center);return mp.radius=.7071067811865476+n,mp.applyMatrix4(e.matrixWorld),this.intersectsSphere(mp)}intersectsSphere(e){const n=this.planes,i=e.center,a=-e.radius;for(let s=0;s<6;s++)if(n[s].distanceToPoint(i)<a)return!1;return!0}intersectsBox(e){const n=this.planes;for(let i=0;i<6;i++){const a=n[i];if(P_.x=a.normal.x>0?e.max.x:e.min.x,P_.y=a.normal.y>0?e.max.y:e.min.y,P_.z=a.normal.z>0?e.max.z:e.min.z,a.distanceToPoint(P_)<0)return!1}return!0}containsPoint(e){const n=this.planes;for(let i=0;i<6;i++)if(n[i].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}const Qc=new wn,Jc=new dv;class Fw{constructor(){this.coordinateSystem=ko}intersectsObject(e,n){if(!n.isArrayCamera||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const a=n.cameras[i];if(Qc.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),Jc.setFromProjectionMatrix(Qc,a.coordinateSystem,a.reversedDepth),Jc.intersectsObject(e))return!0}return!1}intersectsSprite(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const a=n.cameras[i];if(Qc.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),Jc.setFromProjectionMatrix(Qc,a.coordinateSystem,a.reversedDepth),Jc.intersectsSprite(e))return!0}return!1}intersectsSphere(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const a=n.cameras[i];if(Qc.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),Jc.setFromProjectionMatrix(Qc,a.coordinateSystem,a.reversedDepth),Jc.intersectsSphere(e))return!0}return!1}intersectsBox(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const a=n.cameras[i];if(Qc.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),Jc.setFromProjectionMatrix(Qc,a.coordinateSystem,a.reversedDepth),Jc.intersectsBox(e))return!0}return!1}containsPoint(e,n){if(!n||!n.cameras||n.cameras.length===0)return!1;for(let i=0;i<n.cameras.length;i++){const a=n.cameras[i];if(Qc.multiplyMatrices(a.projectionMatrix,a.matrixWorldInverse),Jc.setFromProjectionMatrix(Qc,a.coordinateSystem,a.reversedDepth),Jc.containsPoint(e))return!0}return!1}clone(){return new Fw}}function AM(t,e){return t-e}function Ame(t,e){return t.z-e.z}function Rme(t,e){return e.z-t.z}class Nme{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,n,i,a){const s=this.pool,r=this.list;this.index>=s.length&&s.push({start:-1,count:-1,z:-1,index:-1});const o=s[this.index];r.push(o),this.index++,o.start=e,o.count=n,o.z=i,o.index=a}reset(){this.list.length=0,this.index=0}}const io=new wn,Pme=new Wt(1,1,1),dL=new dv,Dme=new Fw,D_=new mr,gp=new Vs,lb=new fe,fL=new fe,Lme=new fe,RM=new Nme,ar=new Qt,L_=[];function Ome(t,e,n=0){const i=e.itemSize;if(t.isInterleavedBufferAttribute||t.array.constructor!==e.array.constructor){const a=t.count;for(let s=0;s<a;s++)for(let r=0;r<i;r++)e.setComponent(s+n,r,t.getComponent(s,r))}else e.array.set(t.array,n*i);e.needsUpdate=!0}function vp(t,e){if(t.constructor!==e.constructor){const n=Math.min(t.length,e.length);for(let i=0;i<n;i++)e[i]=t[i]}else{const n=Math.min(t.length,e.length);e.set(new t.constructor(t.buffer,0,n))}}class w$ extends Qt{constructor(e,n,i=n*2,a){super(new Pn,a),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=n,this._maxIndexCount=i,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const n=new Float32Array(e*e*4),i=new gu(n,e,e,fr,Hr);this._matricesTexture=i}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Uint32Array(e*e),i=new gu(n,e,e,cx,Td);this._indirectTexture=i}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const n=new Float32Array(e*e*4).fill(1),i=new gu(n,e,e,fr,Hr);i.colorSpace=mi.workingColorSpace,this._colorsTexture=i}_initializeGeometry(e){const n=this.geometry,i=this._maxVertexCount,a=this._maxIndexCount;if(this._geometryInitialized===!1){for(const s in e.attributes){const r=e.getAttribute(s),{array:o,itemSize:c,normalized:u}=r,h=new o.constructor(i*c),d=new $i(h,c,u);n.setAttribute(s,d)}if(e.getIndex()!==null){const s=i>65535?new Uint32Array(a):new Uint16Array(a);n.setIndex(new $i(s,1))}this._geometryInitialized=!0}}_validateGeometry(e){const n=this.geometry;if(!!e.getIndex()!=!!n.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const i in n.attributes){if(!e.hasAttribute(i))throw new Error(`THREE.BatchedMesh: Added geometry missing "${i}". All geometries must have consistent attributes.`);const a=e.getAttribute(i),s=n.getAttribute(i);if(a.itemSize!==s.itemSize||a.normalized!==s.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const n=this._instanceInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const n=this._geometryInfo;if(e<0||e>=n.length||n[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new mr);const e=this.boundingBox,n=this._instanceInfo;e.makeEmpty();for(let i=0,a=n.length;i<a;i++){if(n[i].active===!1)continue;const s=n[i].geometryIndex;this.getMatrixAt(i,io),this.getBoundingBoxAt(s,D_).applyMatrix4(io),e.union(D_)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Vs);const e=this.boundingSphere,n=this._instanceInfo;e.makeEmpty();for(let i=0,a=n.length;i<a;i++){if(n[i].active===!1)continue;const s=n[i].geometryIndex;this.getMatrixAt(i,io),this.getBoundingSphereAt(s,gp).applyMatrix4(io),e.union(gp)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const i={visible:!0,active:!0,geometryIndex:e};let a=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(AM),a=this._availableInstanceIds.shift(),this._instanceInfo[a]=i):(a=this._instanceInfo.length,this._instanceInfo.push(i));const s=this._matricesTexture;io.identity().toArray(s.image.data,a*16),s.needsUpdate=!0;const r=this._colorsTexture;return r&&(Pme.toArray(r.image.data,a*4),r.needsUpdate=!0),this._visibilityChanged=!0,a}addGeometry(e,n=-1,i=-1){this._initializeGeometry(e),this._validateGeometry(e);const a={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},s=this._geometryInfo;a.vertexStart=this._nextVertexStart,a.reservedVertexCount=n===-1?e.getAttribute("position").count:n;const r=e.getIndex();if(r!==null&&(a.indexStart=this._nextIndexStart,a.reservedIndexCount=i===-1?r.count:i),a.indexStart!==-1&&a.indexStart+a.reservedIndexCount>this._maxIndexCount||a.vertexStart+a.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let c;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(AM),c=this._availableGeometryIds.shift(),s[c]=a):(c=this._geometryCount,this._geometryCount++,s.push(a)),this.setGeometryAt(c,e),this._nextIndexStart=a.indexStart+a.reservedIndexCount,this._nextVertexStart=a.vertexStart+a.reservedVertexCount,c}setGeometryAt(e,n){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(n);const i=this.geometry,a=i.getIndex()!==null,s=i.getIndex(),r=n.getIndex(),o=this._geometryInfo[e];if(a&&r.count>o.reservedIndexCount||n.attributes.position.count>o.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const c=o.vertexStart,u=o.reservedVertexCount;o.vertexCount=n.getAttribute("position").count;for(const h in i.attributes){const d=n.getAttribute(h),p=i.getAttribute(h);Ome(d,p,c);const g=d.itemSize;for(let b=d.count,w=u;b<w;b++){const x=c+b;for(let S=0;S<g;S++)p.setComponent(x,S,0)}p.needsUpdate=!0,p.addUpdateRange(c*g,u*g)}if(a){const h=o.indexStart,d=o.reservedIndexCount;o.indexCount=n.getIndex().count;for(let p=0;p<r.count;p++)s.setX(h+p,c+r.getX(p));for(let p=r.count,g=d;p<g;p++)s.setX(h+p,c);s.needsUpdate=!0,s.addUpdateRange(h,o.reservedIndexCount)}return o.start=a?o.indexStart:o.vertexStart,o.count=a?o.indexCount:o.vertexCount,o.boundingBox=null,n.boundingBox!==null&&(o.boundingBox=n.boundingBox.clone()),o.boundingSphere=null,n.boundingSphere!==null&&(o.boundingSphere=n.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const n=this._geometryInfo;if(e>=n.length||n[e].active===!1)return this;const i=this._instanceInfo;for(let a=0,s=i.length;a<s;a++)i[a].active&&i[a].geometryIndex===e&&this.deleteInstance(a);return n[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,n=0;const i=this._geometryInfo,a=i.map((r,o)=>o).sort((r,o)=>i[r].vertexStart-i[o].vertexStart),s=this.geometry;for(let r=0,o=i.length;r<o;r++){const c=a[r],u=i[c];if(u.active!==!1){if(s.index!==null){if(u.indexStart!==n){const{indexStart:h,vertexStart:d,reservedIndexCount:p}=u,g=s.index,b=g.array,w=e-d;for(let x=h;x<h+p;x++)b[x]=b[x]+w;g.array.copyWithin(n,h,h+p),g.addUpdateRange(n,p),u.indexStart=n}n+=u.reservedIndexCount}if(u.vertexStart!==e){const{vertexStart:h,reservedVertexCount:d}=u,p=s.attributes;for(const g in p){const b=p[g],{array:w,itemSize:x}=b;w.copyWithin(e*x,h*x,(h+d)*x),b.addUpdateRange(e*x,d*x)}u.vertexStart=e}e+=u.reservedVertexCount,u.start=s.index?u.indexStart:u.vertexStart,this._nextIndexStart=s.index?u.indexStart+u.reservedIndexCount:0,this._nextVertexStart=u.vertexStart+u.reservedVertexCount}}return this}getBoundingBoxAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingBox===null){const s=new mr,r=i.index,o=i.attributes.position;for(let c=a.start,u=a.start+a.count;c<u;c++){let h=c;r&&(h=r.getX(h)),s.expandByPoint(lb.fromBufferAttribute(o,h))}a.boundingBox=s}return n.copy(a.boundingBox),n}getBoundingSphereAt(e,n){if(e>=this._geometryCount)return null;const i=this.geometry,a=this._geometryInfo[e];if(a.boundingSphere===null){const s=new Vs;this.getBoundingBoxAt(e,D_),D_.getCenter(s.center);const r=i.index,o=i.attributes.position;let c=0;for(let u=a.start,h=a.start+a.count;u<h;u++){let d=u;r&&(d=r.getX(d)),lb.fromBufferAttribute(o,d),c=Math.max(c,s.center.distanceToSquared(lb))}s.radius=Math.sqrt(c),a.boundingSphere=s}return n.copy(a.boundingSphere),n}setMatrixAt(e,n){this.validateInstanceId(e);const i=this._matricesTexture,a=this._matricesTexture.image.data;return n.toArray(a,e*16),i.needsUpdate=!0,this}getMatrixAt(e,n){return this.validateInstanceId(e),n.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,n){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),n.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,n){return this.validateInstanceId(e),n.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,n){return this.validateInstanceId(e),this._instanceInfo[e].visible===n?this:(this._instanceInfo[e].visible=n,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,n){return this.validateInstanceId(e),this.validateGeometryId(n),this._instanceInfo[e].geometryIndex=n,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,n={}){this.validateGeometryId(e);const i=this._geometryInfo[e];return n.vertexStart=i.vertexStart,n.vertexCount=i.vertexCount,n.reservedVertexCount=i.reservedVertexCount,n.indexStart=i.indexStart,n.indexCount=i.indexCount,n.reservedIndexCount=i.reservedIndexCount,n.start=i.start,n.count=i.count,n}setInstanceCount(e){const n=this._availableInstanceIds,i=this._instanceInfo;for(n.sort(AM);n[n.length-1]===i.length-1;)i.pop(),n.pop();if(e<i.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const a=new Int32Array(e),s=new Int32Array(e);vp(this._multiDrawCounts,a),vp(this._multiDrawStarts,s),this._multiDrawCounts=a,this._multiDrawStarts=s,this._maxInstanceCount=e;const r=this._indirectTexture,o=this._matricesTexture,c=this._colorsTexture;r.dispose(),this._initIndirectTexture(),vp(r.image.data,this._indirectTexture.image.data),o.dispose(),this._initMatricesTexture(),vp(o.image.data,this._matricesTexture.image.data),c&&(c.dispose(),this._initColorsTexture(),vp(c.image.data,this._colorsTexture.image.data))}setGeometrySize(e,n){const i=[...this._geometryInfo].filter(o=>o.active);if(Math.max(...i.map(o=>o.vertexStart+o.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${n}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...i.map(c=>c.indexStart+c.reservedIndexCount))>n)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${n}. Cannot shrink further.`);const s=this.geometry;s.dispose(),this._maxVertexCount=e,this._maxIndexCount=n,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Pn,this._initializeGeometry(s));const r=this.geometry;s.index&&vp(s.index.array,r.index.array);for(const o in s.attributes)vp(s.attributes[o].array,r.attributes[o].array)}raycast(e,n){const i=this._instanceInfo,a=this._geometryInfo,s=this.matrixWorld,r=this.geometry;ar.material=this.material,ar.geometry.index=r.index,ar.geometry.attributes=r.attributes,ar.geometry.boundingBox===null&&(ar.geometry.boundingBox=new mr),ar.geometry.boundingSphere===null&&(ar.geometry.boundingSphere=new Vs);for(let o=0,c=i.length;o<c;o++){if(!i[o].visible||!i[o].active)continue;const u=i[o].geometryIndex,h=a[u];ar.geometry.setDrawRange(h.start,h.count),this.getMatrixAt(o,ar.matrixWorld).premultiply(s),this.getBoundingBoxAt(u,ar.geometry.boundingBox),this.getBoundingSphereAt(u,ar.geometry.boundingSphere),ar.raycast(e,L_);for(let d=0,p=L_.length;d<p;d++){const g=L_[d];g.object=this,g.batchId=o,n.push(g)}L_.length=0}ar.material=null,ar.geometry.index=null,ar.geometry.attributes={},ar.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(n=>({...n,boundingBox:n.boundingBox!==null?n.boundingBox.clone():null,boundingSphere:n.boundingSphere!==null?n.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(n=>({...n})),this._availableInstanceIds=e._availableInstanceIds.slice(),this._availableGeometryIds=e._availableGeometryIds.slice(),this._nextIndexStart=e._nextIndexStart,this._nextVertexStart=e._nextVertexStart,this._geometryCount=e._geometryCount,this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._indirectTexture=e._indirectTexture.clone(),this._indirectTexture.image.data=this._indirectTexture.image.data.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,n,i,a,s){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const r=a.getIndex(),o=r===null?1:r.array.BYTES_PER_ELEMENT,c=this._instanceInfo,u=this._multiDrawStarts,h=this._multiDrawCounts,d=this._geometryInfo,p=this.perObjectFrustumCulled,g=this._indirectTexture,b=g.image.data,w=i.isArrayCamera?Dme:dL;p&&!i.isArrayCamera&&(io.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse).multiply(this.matrixWorld),dL.setFromProjectionMatrix(io,i.coordinateSystem,i.reversedDepth));let x=0;if(this.sortObjects){io.copy(this.matrixWorld).invert(),lb.setFromMatrixPosition(i.matrixWorld).applyMatrix4(io),fL.set(0,0,-1).transformDirection(i.matrixWorld).transformDirection(io);for(let C=0,A=c.length;C<A;C++)if(c[C].visible&&c[C].active){const N=c[C].geometryIndex;this.getMatrixAt(C,io),this.getBoundingSphereAt(N,gp).applyMatrix4(io);let R=!1;if(p&&(R=!w.intersectsSphere(gp,i)),!R){const D=d[N],B=Lme.subVectors(gp.center,lb).dot(fL);RM.push(D.start,D.count,B,C)}}const S=RM.list,M=this.customSort;M===null?S.sort(s.transparent?Rme:Ame):M.call(this,S,i);for(let C=0,A=S.length;C<A;C++){const N=S[C];u[x]=N.start*o,h[x]=N.count,b[x]=N.index,x++}RM.reset()}else for(let S=0,M=c.length;S<M;S++)if(c[S].visible&&c[S].active){const C=c[S].geometryIndex;let A=!1;if(p&&(this.getMatrixAt(S,io),this.getBoundingSphereAt(C,gp).applyMatrix4(io),A=!w.intersectsSphere(gp,i)),!A){const N=d[C];u[x]=N.start*o,h[x]=N.count,b[x]=S,x++}}g.needsUpdate=!0,this._multiDrawCount=x,this._visibilityChanged=!1}onBeforeShadow(e,n,i,a,s,r){this.onBeforeRender(e,null,a,s,r)}}class xr extends br{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Wt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const k3=new fe,H3=new fe,hL=new wn,cb=new uv,O_=new Vs,NM=new fe,pL=new fe;class qn extends Jn{constructor(e=new Pn,n=new xr){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[0];for(let a=1,s=n.count;a<s;a++)k3.fromBufferAttribute(n,a-1),H3.fromBufferAttribute(n,a),i[a]=i[a-1],i[a]+=k3.distanceTo(H3);e.setAttribute("lineDistance",new an(i,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,n){const i=this.geometry,a=this.matrixWorld,s=e.params.Line.threshold,r=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),O_.copy(i.boundingSphere),O_.applyMatrix4(a),O_.radius+=s,e.ray.intersectsSphere(O_)===!1)return;hL.copy(a).invert(),cb.copy(e.ray).applyMatrix4(hL);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,u=this.isLineSegments?2:1,h=i.index,p=i.attributes.position;if(h!==null){const g=Math.max(0,r.start),b=Math.min(h.count,r.start+r.count);for(let w=g,x=b-1;w<x;w+=u){const S=h.getX(w),M=h.getX(w+1),C=I_(this,e,cb,c,S,M,w);C&&n.push(C)}if(this.isLineLoop){const w=h.getX(b-1),x=h.getX(g),S=I_(this,e,cb,c,w,x,b-1);S&&n.push(S)}}else{const g=Math.max(0,r.start),b=Math.min(p.count,r.start+r.count);for(let w=g,x=b-1;w<x;w+=u){const S=I_(this,e,cb,c,w,w+1,w);S&&n.push(S)}if(this.isLineLoop){const w=I_(this,e,cb,c,b-1,g,b-1);w&&n.push(w)}}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const a=n[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=a.length;s<r;s++){const o=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function I_(t,e,n,i,a,s,r){const o=t.geometry.attributes.position;if(k3.fromBufferAttribute(o,a),H3.fromBufferAttribute(o,s),n.distanceSqToSegment(k3,H3,NM,pL)>i)return;NM.applyMatrix4(t.matrixWorld);const u=e.ray.origin.distanceTo(NM);if(!(u<e.near||u>e.far))return{distance:u,point:pL.clone().applyMatrix4(t.matrixWorld),index:r,face:null,faceIndex:null,barycoord:null,object:t}}const mL=new fe,gL=new fe;class Mu extends qn{constructor(e,n){super(e,n),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const n=e.attributes.position,i=[];for(let a=0,s=n.count;a<s;a+=2)mL.fromBufferAttribute(n,a),gL.fromBufferAttribute(n,a+1),i[a]=a===0?0:i[a-1],i[a+1]=i[a]+mL.distanceTo(gL);e.setAttribute("lineDistance",new an(i,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class E$ extends qn{constructor(e,n){super(e,n),this.isLineLoop=!0,this.type="LineLoop"}}class m6 extends br{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Wt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const vL=new wn,I5=new uv,z_=new Vs,B_=new fe;class M$ extends Jn{constructor(e=new Pn,n=new m6){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=n,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,n){return super.copy(e,n),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,n){const i=this.geometry,a=this.matrixWorld,s=e.params.Points.threshold,r=i.drawRange;if(i.boundingSphere===null&&i.computeBoundingSphere(),z_.copy(i.boundingSphere),z_.applyMatrix4(a),z_.radius+=s,e.ray.intersectsSphere(z_)===!1)return;vL.copy(a).invert(),I5.copy(e.ray).applyMatrix4(vL);const o=s/((this.scale.x+this.scale.y+this.scale.z)/3),c=o*o,u=i.index,d=i.attributes.position;if(u!==null){const p=Math.max(0,r.start),g=Math.min(u.count,r.start+r.count);for(let b=p,w=g;b<w;b++){const x=u.getX(b);B_.fromBufferAttribute(d,x),yL(B_,x,c,a,e,n,this)}}else{const p=Math.max(0,r.start),g=Math.min(d.count,r.start+r.count);for(let b=p,w=g;b<w;b++)B_.fromBufferAttribute(d,b),yL(B_,b,c,a,e,n,this)}}updateMorphTargets(){const n=this.geometry.morphAttributes,i=Object.keys(n);if(i.length>0){const a=n[i[0]];if(a!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let s=0,r=a.length;s<r;s++){const o=a[s].name||String(s);this.morphTargetInfluences.push(0),this.morphTargetDictionary[o]=s}}}}}function yL(t,e,n,i,a,s,r){const o=I5.distanceSqToPoint(t);if(o<n){const c=new fe;I5.closestPointToPoint(t,c),c.applyMatrix4(i);const u=a.ray.origin.distanceTo(c);if(u<a.near||u>a.far)return;s.push({distance:u,distanceToRay:Math.sqrt(o),point:c,index:e,face:null,faceIndex:null,barycoord:null,object:r})}}class T$ extends Na{constructor(e,n,i,a,s=ja,r=ja,o,c,u){super(e,n,i,a,s,r,o,c,u),this.isVideoTexture=!0,this.generateMipmaps=!1,this._requestVideoFrameCallbackId=0;const h=this;function d(){h.needsUpdate=!0,h._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d)}"requestVideoFrameCallback"in e&&(this._requestVideoFrameCallbackId=e.requestVideoFrameCallback(d))}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}dispose(){this._requestVideoFrameCallbackId!==0&&this.source.data.cancelVideoFrameCallback(this._requestVideoFrameCallbackId),super.dispose()}}class Ime extends T${constructor(e,n,i,a,s,r,o,c){super({},e,n,i,a,s,r,o,c),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class zme extends Na{constructor(e,n){super({width:e,height:n}),this.isFramebufferTexture=!0,this.magFilter=Fs,this.minFilter=Fs,this.generateMipmaps=!1,this.needsUpdate=!0}}class Vw extends Na{constructor(e,n,i,a,s,r,o,c,u,h,d,p){super(null,r,o,c,u,h,a,s,d,p),this.isCompressedTexture=!0,this.image={width:n,height:i},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class Bme extends Vw{constructor(e,n,i,a,s,r){super(e,n,i,s,r),this.isCompressedArrayTexture=!0,this.image.depth=a,this.wrapR=El,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class Ume extends Vw{constructor(e,n,i){super(void 0,e[0].width,e[0].height,n,i,Md),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class jme extends Na{constructor(e,n,i,a,s,r,o,c,u){super(e,n,i,a,s,r,o,c,u),this.isCanvasTexture=!0,this.needsUpdate=!0}}class kw extends Na{constructor(e,n,i=Td,a,s,r,o=Fs,c=Fs,u,h=Vg,d=1){if(h!==Vg&&h!==kg)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");const p={width:e,height:n,depth:d};super(p,a,s,r,o,c,h,i,u),this.isDepthTexture=!0,this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Uf(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const n=super.toJSON(e);return this.compareFunction!==null&&(n.compareFunction=this.compareFunction),n}}class g6 extends Na{constructor(e=null){super(),this.sourceTexture=e,this.isExternalTexture=!0}copy(e){return super.copy(e),this.sourceTexture=e.sourceTexture,this}}class Hw extends Pn{constructor(e=1,n=1,i=4,a=8,s=1){super(),this.type="CapsuleGeometry",this.parameters={radius:e,height:n,capSegments:i,radialSegments:a,heightSegments:s},n=Math.max(0,n),i=Math.max(1,Math.floor(i)),a=Math.max(3,Math.floor(a)),s=Math.max(1,Math.floor(s));const r=[],o=[],c=[],u=[],h=n/2,d=Math.PI/2*e,p=n,g=2*d+p,b=i*2+s,w=a+1,x=new fe,S=new fe;for(let M=0;M<=b;M++){let C=0,A=0,N=0,R=0;if(M<=i){const z=M/i,I=z*Math.PI/2;A=-h-e*Math.cos(I),N=e*Math.sin(I),R=-e*Math.cos(I),C=z*d}else if(M<=i+s){const z=(M-i)/s;A=-h+z*n,N=e,R=0,C=d+z*p}else{const z=(M-i-s)/i,I=z*Math.PI/2;A=h+e*Math.sin(I),N=e*Math.cos(I),R=e*Math.sin(I),C=d+p+z*d}const D=Math.max(0,Math.min(1,C/g));let B=0;M===0?B=.5/a:M===b&&(B=-.5/a);for(let z=0;z<=a;z++){const I=z/a,U=I*Math.PI*2,$=Math.sin(U),G=Math.cos(U);S.x=-N*G,S.y=A,S.z=N*$,o.push(S.x,S.y,S.z),x.set(-N*G,R,N*$),x.normalize(),c.push(x.x,x.y,x.z),u.push(I+B,D)}if(M>0){const z=(M-1)*w;for(let I=0;I<a;I++){const U=z+I,$=z+I+1,G=M*w+I,k=M*w+I+1;r.push(U,$,G),r.push($,k,G)}}}this.setIndex(r),this.setAttribute("position",new an(o,3)),this.setAttribute("normal",new an(c,3)),this.setAttribute("uv",new an(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Hw(e.radius,e.height,e.capSegments,e.radialSegments,e.heightSegments)}}class $w extends Pn{constructor(e=1,n=32,i=0,a=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:n,thetaStart:i,thetaLength:a},n=Math.max(3,n);const s=[],r=[],o=[],c=[],u=new fe,h=new _t;r.push(0,0,0),o.push(0,0,1),c.push(.5,.5);for(let d=0,p=3;d<=n;d++,p+=3){const g=i+d/n*a;u.x=e*Math.cos(g),u.y=e*Math.sin(g),r.push(u.x,u.y,u.z),o.push(0,0,1),h.x=(r[p]/e+1)/2,h.y=(r[p+1]/e+1)/2,c.push(h.x,h.y)}for(let d=1;d<=n;d++)s.push(d,d+1,0);this.setIndex(s),this.setAttribute("position",new an(r,3)),this.setAttribute("normal",new an(o,3)),this.setAttribute("uv",new an(c,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new $w(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class sr extends Pn{constructor(e=1,n=1,i=1,a=32,s=1,r=!1,o=0,c=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:n,height:i,radialSegments:a,heightSegments:s,openEnded:r,thetaStart:o,thetaLength:c};const u=this;a=Math.floor(a),s=Math.floor(s);const h=[],d=[],p=[],g=[];let b=0;const w=[],x=i/2;let S=0;M(),r===!1&&(e>0&&C(!0),n>0&&C(!1)),this.setIndex(h),this.setAttribute("position",new an(d,3)),this.setAttribute("normal",new an(p,3)),this.setAttribute("uv",new an(g,2));function M(){const A=new fe,N=new fe;let R=0;const D=(n-e)/i;for(let B=0;B<=s;B++){const z=[],I=B/s,U=I*(n-e)+e;for(let $=0;$<=a;$++){const G=$/a,k=G*c+o,X=Math.sin(k),V=Math.cos(k);N.x=U*X,N.y=-I*i+x,N.z=U*V,d.push(N.x,N.y,N.z),A.set(X,D,V).normalize(),p.push(A.x,A.y,A.z),g.push(G,1-I),z.push(b++)}w.push(z)}for(let B=0;B<a;B++)for(let z=0;z<s;z++){const I=w[z][B],U=w[z+1][B],$=w[z+1][B+1],G=w[z][B+1];(e>0||z!==0)&&(h.push(I,U,G),R+=3),(n>0||z!==s-1)&&(h.push(U,$,G),R+=3)}u.addGroup(S,R,0),S+=R}function C(A){const N=b,R=new _t,D=new fe;let B=0;const z=A===!0?e:n,I=A===!0?1:-1;for(let $=1;$<=a;$++)d.push(0,x*I,0),p.push(0,I,0),g.push(.5,.5),b++;const U=b;for(let $=0;$<=a;$++){const k=$/a*c+o,X=Math.cos(k),V=Math.sin(k);D.x=z*V,D.y=x*I,D.z=z*X,d.push(D.x,D.y,D.z),p.push(0,I,0),R.x=X*.5+.5,R.y=V*.5*I+.5,g.push(R.x,R.y),b++}for(let $=0;$<a;$++){const G=N+$,k=U+$;A===!0?h.push(k,k+1,G):h.push(k+1,k,G),B+=3}u.addGroup(S,B,A===!0?1:2),S+=B}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sr(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class dx extends sr{constructor(e=1,n=1,i=32,a=1,s=!1,r=0,o=Math.PI*2){super(0,e,n,i,a,s,r,o),this.type="ConeGeometry",this.parameters={radius:e,height:n,radialSegments:i,heightSegments:a,openEnded:s,thetaStart:r,thetaLength:o}}static fromJSON(e){return new dx(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class ph extends Pn{constructor(e=[],n=[],i=1,a=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:n,radius:i,detail:a};const s=[],r=[];o(a),u(i),h(),this.setAttribute("position",new an(s,3)),this.setAttribute("normal",new an(s.slice(),3)),this.setAttribute("uv",new an(r,2)),a===0?this.computeVertexNormals():this.normalizeNormals();function o(M){const C=new fe,A=new fe,N=new fe;for(let R=0;R<n.length;R+=3)g(n[R+0],C),g(n[R+1],A),g(n[R+2],N),c(C,A,N,M)}function c(M,C,A,N){const R=N+1,D=[];for(let B=0;B<=R;B++){D[B]=[];const z=M.clone().lerp(A,B/R),I=C.clone().lerp(A,B/R),U=R-B;for(let $=0;$<=U;$++)$===0&&B===R?D[B][$]=z:D[B][$]=z.clone().lerp(I,$/U)}for(let B=0;B<R;B++)for(let z=0;z<2*(R-B)-1;z++){const I=Math.floor(z/2);z%2===0?(p(D[B][I+1]),p(D[B+1][I]),p(D[B][I])):(p(D[B][I+1]),p(D[B+1][I+1]),p(D[B+1][I]))}}function u(M){const C=new fe;for(let A=0;A<s.length;A+=3)C.x=s[A+0],C.y=s[A+1],C.z=s[A+2],C.normalize().multiplyScalar(M),s[A+0]=C.x,s[A+1]=C.y,s[A+2]=C.z}function h(){const M=new fe;for(let C=0;C<s.length;C+=3){M.x=s[C+0],M.y=s[C+1],M.z=s[C+2];const A=x(M)/2/Math.PI+.5,N=S(M)/Math.PI+.5;r.push(A,1-N)}b(),d()}function d(){for(let M=0;M<r.length;M+=6){const C=r[M+0],A=r[M+2],N=r[M+4],R=Math.max(C,A,N),D=Math.min(C,A,N);R>.9&&D<.1&&(C<.2&&(r[M+0]+=1),A<.2&&(r[M+2]+=1),N<.2&&(r[M+4]+=1))}}function p(M){s.push(M.x,M.y,M.z)}function g(M,C){const A=M*3;C.x=e[A+0],C.y=e[A+1],C.z=e[A+2]}function b(){const M=new fe,C=new fe,A=new fe,N=new fe,R=new _t,D=new _t,B=new _t;for(let z=0,I=0;z<s.length;z+=9,I+=6){M.set(s[z+0],s[z+1],s[z+2]),C.set(s[z+3],s[z+4],s[z+5]),A.set(s[z+6],s[z+7],s[z+8]),R.set(r[I+0],r[I+1]),D.set(r[I+2],r[I+3]),B.set(r[I+4],r[I+5]),N.copy(M).add(C).add(A).divideScalar(3);const U=x(N);w(R,I+0,M,U),w(D,I+2,C,U),w(B,I+4,A,U)}}function w(M,C,A,N){N<0&&M.x===1&&(r[C]=M.x-1),A.x===0&&A.z===0&&(r[C]=N/2/Math.PI+.5)}function x(M){return Math.atan2(M.z,-M.x)}function S(M){return Math.atan2(-M.y,Math.sqrt(M.x*M.x+M.z*M.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new ph(e.vertices,e.indices,e.radius,e.details)}}class Gw extends ph{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,a=1/i,s=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-a,-i,0,-a,i,0,a,-i,0,a,i,-a,-i,0,-a,i,0,a,-i,0,a,i,0,-i,0,-a,i,0,-a,-i,0,a,i,0,a],r=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,19,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(s,r,e,n),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new Gw(e.radius,e.detail)}}const U_=new fe,j_=new fe,PM=new fe,F_=new po;class C$ extends Pn{constructor(e=null,n=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:n},e!==null){const a=Math.pow(10,4),s=Math.cos(Kp*n),r=e.getIndex(),o=e.getAttribute("position"),c=r?r.count:o.count,u=[0,0,0],h=["a","b","c"],d=new Array(3),p={},g=[];for(let b=0;b<c;b+=3){r?(u[0]=r.getX(b),u[1]=r.getX(b+1),u[2]=r.getX(b+2)):(u[0]=b,u[1]=b+1,u[2]=b+2);const{a:w,b:x,c:S}=F_;if(w.fromBufferAttribute(o,u[0]),x.fromBufferAttribute(o,u[1]),S.fromBufferAttribute(o,u[2]),F_.getNormal(PM),d[0]=`${Math.round(w.x*a)},${Math.round(w.y*a)},${Math.round(w.z*a)}`,d[1]=`${Math.round(x.x*a)},${Math.round(x.y*a)},${Math.round(x.z*a)}`,d[2]=`${Math.round(S.x*a)},${Math.round(S.y*a)},${Math.round(S.z*a)}`,!(d[0]===d[1]||d[1]===d[2]||d[2]===d[0]))for(let M=0;M<3;M++){const C=(M+1)%3,A=d[M],N=d[C],R=F_[h[M]],D=F_[h[C]],B=`${A}_${N}`,z=`${N}_${A}`;z in p&&p[z]?(PM.dot(p[z].normal)<=s&&(g.push(R.x,R.y,R.z),g.push(D.x,D.y,D.z)),p[z]=null):B in p||(p[B]={index0:u[M],index1:u[C],normal:PM.clone()})}}for(const b in p)if(p[b]){const{index0:w,index1:x}=p[b];U_.fromBufferAttribute(o,w),j_.fromBufferAttribute(o,x),g.push(U_.x,U_.y,U_.z),g.push(j_.x,j_.y,j_.z)}this.setAttribute("position",new an(g,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class gc{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,n){const i=this.getUtoTmapping(e);return this.getPoint(i,n)}getPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return n}getSpacedPoints(e=5){const n=[];for(let i=0;i<=e;i++)n.push(this.getPointAt(i/e));return n}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const n=[];let i,a=this.getPoint(0),s=0;n.push(0);for(let r=1;r<=e;r++)i=this.getPoint(r/e),s+=i.distanceTo(a),n.push(s),a=i;return this.cacheArcLengths=n,n}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,n=null){const i=this.getLengths();let a=0;const s=i.length;let r;n?r=n:r=e*i[s-1];let o=0,c=s-1,u;for(;o<=c;)if(a=Math.floor(o+(c-o)/2),u=i[a]-r,u<0)o=a+1;else if(u>0)c=a-1;else{c=a;break}if(a=c,i[a]===r)return a/(s-1);const h=i[a],p=i[a+1]-h,g=(r-h)/p;return(a+g)/(s-1)}getTangent(e,n){let a=e-1e-4,s=e+1e-4;a<0&&(a=0),s>1&&(s=1);const r=this.getPoint(a),o=this.getPoint(s),c=n||(r.isVector2?new _t:new fe);return c.copy(o).sub(r).normalize(),c}getTangentAt(e,n){const i=this.getUtoTmapping(e);return this.getTangent(i,n)}computeFrenetFrames(e,n=!1){const i=new fe,a=[],s=[],r=[],o=new fe,c=new wn;for(let g=0;g<=e;g++){const b=g/e;a[g]=this.getTangentAt(b,new fe)}s[0]=new fe,r[0]=new fe;let u=Number.MAX_VALUE;const h=Math.abs(a[0].x),d=Math.abs(a[0].y),p=Math.abs(a[0].z);h<=u&&(u=h,i.set(1,0,0)),d<=u&&(u=d,i.set(0,1,0)),p<=u&&i.set(0,0,1),o.crossVectors(a[0],i).normalize(),s[0].crossVectors(a[0],o),r[0].crossVectors(a[0],s[0]);for(let g=1;g<=e;g++){if(s[g]=s[g-1].clone(),r[g]=r[g-1].clone(),o.crossVectors(a[g-1],a[g]),o.length()>Number.EPSILON){o.normalize();const b=Math.acos(En(a[g-1].dot(a[g]),-1,1));s[g].applyMatrix4(c.makeRotationAxis(o,b))}r[g].crossVectors(a[g],s[g])}if(n===!0){let g=Math.acos(En(s[0].dot(s[e]),-1,1));g/=e,a[0].dot(o.crossVectors(s[0],s[e]))>0&&(g=-g);for(let b=1;b<=e;b++)s[b].applyMatrix4(c.makeRotationAxis(a[b],g*b)),r[b].crossVectors(a[b],s[b])}return{tangents:a,normals:s,binormals:r}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.7,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.type,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Ww extends gc{constructor(e=0,n=0,i=1,a=1,s=0,r=Math.PI*2,o=!1,c=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=n,this.xRadius=i,this.yRadius=a,this.aStartAngle=s,this.aEndAngle=r,this.aClockwise=o,this.aRotation=c}getPoint(e,n=new _t){const i=n,a=Math.PI*2;let s=this.aEndAngle-this.aStartAngle;const r=Math.abs(s)<Number.EPSILON;for(;s<0;)s+=a;for(;s>a;)s-=a;s<Number.EPSILON&&(r?s=0:s=a),this.aClockwise===!0&&!r&&(s===a?s=-a:s=s-a);const o=this.aStartAngle+e*s;let c=this.aX+this.xRadius*Math.cos(o),u=this.aY+this.yRadius*Math.sin(o);if(this.aRotation!==0){const h=Math.cos(this.aRotation),d=Math.sin(this.aRotation),p=c-this.aX,g=u-this.aY;c=p*h-g*d+this.aX,u=p*d+g*h+this.aY}return i.set(c,u)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class A$ extends Ww{constructor(e,n,i,a,s,r){super(e,n,i,i,a,s,r),this.isArcCurve=!0,this.type="ArcCurve"}}function v6(){let t=0,e=0,n=0,i=0;function a(s,r,o,c){t=s,e=o,n=-3*s+3*r-2*o-c,i=2*s-2*r+o+c}return{initCatmullRom:function(s,r,o,c,u){a(r,o,u*(o-s),u*(c-r))},initNonuniformCatmullRom:function(s,r,o,c,u,h,d){let p=(r-s)/u-(o-s)/(u+h)+(o-r)/h,g=(o-r)/h-(c-r)/(h+d)+(c-o)/d;p*=h,g*=h,a(r,o,p,g)},calc:function(s){const r=s*s,o=r*s;return t+e*s+n*r+i*o}}}const V_=new fe,DM=new v6,LM=new v6,OM=new v6;class R$ extends gc{constructor(e=[],n=!1,i="centripetal",a=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=n,this.curveType=i,this.tension=a}getPoint(e,n=new fe){const i=n,a=this.points,s=a.length,r=(s-(this.closed?0:1))*e;let o=Math.floor(r),c=r-o;this.closed?o+=o>0?0:(Math.floor(Math.abs(o)/s)+1)*s:c===0&&o===s-1&&(o=s-2,c=1);let u,h;this.closed||o>0?u=a[(o-1)%s]:(V_.subVectors(a[0],a[1]).add(a[0]),u=V_);const d=a[o%s],p=a[(o+1)%s];if(this.closed||o+2<s?h=a[(o+2)%s]:(V_.subVectors(a[s-1],a[s-2]).add(a[s-1]),h=V_),this.curveType==="centripetal"||this.curveType==="chordal"){const g=this.curveType==="chordal"?.5:.25;let b=Math.pow(u.distanceToSquared(d),g),w=Math.pow(d.distanceToSquared(p),g),x=Math.pow(p.distanceToSquared(h),g);w<1e-4&&(w=1),b<1e-4&&(b=w),x<1e-4&&(x=w),DM.initNonuniformCatmullRom(u.x,d.x,p.x,h.x,b,w,x),LM.initNonuniformCatmullRom(u.y,d.y,p.y,h.y,b,w,x),OM.initNonuniformCatmullRom(u.z,d.z,p.z,h.z,b,w,x)}else this.curveType==="catmullrom"&&(DM.initCatmullRom(u.x,d.x,p.x,h.x,this.tension),LM.initCatmullRom(u.y,d.y,p.y,h.y,this.tension),OM.initCatmullRom(u.z,d.z,p.z,h.z,this.tension));return i.set(DM.calc(c),LM.calc(c),OM.calc(c)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const a=e.points[n];this.points.push(a.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const a=this.points[n];e.points.push(a.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const a=e.points[n];this.points.push(new fe().fromArray(a))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function bL(t,e,n,i,a){const s=(i-e)*.5,r=(a-n)*.5,o=t*t,c=t*o;return(2*n-2*i+s+r)*c+(-3*n+3*i-2*s-r)*o+s*t+n}function Fme(t,e){const n=1-t;return n*n*e}function Vme(t,e){return 2*(1-t)*t*e}function kme(t,e){return t*t*e}function kb(t,e,n,i){return Fme(t,e)+Vme(t,n)+kme(t,i)}function Hme(t,e){const n=1-t;return n*n*n*e}function $me(t,e){const n=1-t;return 3*n*n*t*e}function Gme(t,e){return 3*(1-t)*t*t*e}function Wme(t,e){return t*t*t*e}function Hb(t,e,n,i,a){return Hme(t,e)+$me(t,n)+Gme(t,i)+Wme(t,a)}class y6 extends gc{constructor(e=new _t,n=new _t,i=new _t,a=new _t){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=n,this.v2=i,this.v3=a}getPoint(e,n=new _t){const i=n,a=this.v0,s=this.v1,r=this.v2,o=this.v3;return i.set(Hb(e,a.x,s.x,r.x,o.x),Hb(e,a.y,s.y,r.y,o.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class N$ extends gc{constructor(e=new fe,n=new fe,i=new fe,a=new fe){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=n,this.v2=i,this.v3=a}getPoint(e,n=new fe){const i=n,a=this.v0,s=this.v1,r=this.v2,o=this.v3;return i.set(Hb(e,a.x,s.x,r.x,o.x),Hb(e,a.y,s.y,r.y,o.y),Hb(e,a.z,s.z,r.z,o.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class b6 extends gc{constructor(e=new _t,n=new _t){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=n}getPoint(e,n=new _t){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new _t){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class P$ extends gc{constructor(e=new fe,n=new fe){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=n}getPoint(e,n=new fe){const i=n;return e===1?i.copy(this.v2):(i.copy(this.v2).sub(this.v1),i.multiplyScalar(e).add(this.v1)),i}getPointAt(e,n){return this.getPoint(e,n)}getTangent(e,n=new fe){return n.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,n){return this.getTangent(e,n)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class x6 extends gc{constructor(e=new _t,n=new _t,i=new _t){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new _t){const i=n,a=this.v0,s=this.v1,r=this.v2;return i.set(kb(e,a.x,s.x,r.x),kb(e,a.y,s.y,r.y)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class _6 extends gc{constructor(e=new fe,n=new fe,i=new fe){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=n,this.v2=i}getPoint(e,n=new fe){const i=n,a=this.v0,s=this.v1,r=this.v2;return i.set(kb(e,a.x,s.x,r.x),kb(e,a.y,s.y,r.y),kb(e,a.z,s.z,r.z)),i}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class S6 extends gc{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,n=new _t){const i=n,a=this.points,s=(a.length-1)*e,r=Math.floor(s),o=s-r,c=a[r===0?r:r-1],u=a[r],h=a[r>a.length-2?a.length-1:r+1],d=a[r>a.length-3?a.length-1:r+2];return i.set(bL(o,c.x,u.x,h.x,d.x),bL(o,c.y,u.y,h.y,d.y)),i}copy(e){super.copy(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const a=e.points[n];this.points.push(a.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let n=0,i=this.points.length;n<i;n++){const a=this.points[n];e.points.push(a.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let n=0,i=e.points.length;n<i;n++){const a=e.points[n];this.points.push(new _t().fromArray(a))}return this}}var $3=Object.freeze({__proto__:null,ArcCurve:A$,CatmullRomCurve3:R$,CubicBezierCurve:y6,CubicBezierCurve3:N$,EllipseCurve:Ww,LineCurve:b6,LineCurve3:P$,QuadraticBezierCurve:x6,QuadraticBezierCurve3:_6,SplineCurve:S6});class D$ extends gc{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),n=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(n)){const i=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new $3[i](n,e))}return this}getPoint(e,n){const i=e*this.getLength(),a=this.getCurveLengths();let s=0;for(;s<a.length;){if(a[s]>=i){const r=a[s]-i,o=this.curves[s],c=o.getLength(),u=c===0?0:1-r/c;return o.getPointAt(u,n)}s++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let n=0;for(let i=0,a=this.curves.length;i<a;i++)n+=this.curves[i].getLength(),e.push(n);return this.cacheLengths=e,e}getSpacedPoints(e=40){const n=[];for(let i=0;i<=e;i++)n.push(this.getPoint(i/e));return this.autoClose&&n.push(n[0]),n}getPoints(e=12){const n=[];let i;for(let a=0,s=this.curves;a<s.length;a++){const r=s[a],o=r.isEllipseCurve?e*2:r.isLineCurve||r.isLineCurve3?1:r.isSplineCurve?e*r.points.length:e,c=r.getPoints(o);for(let u=0;u<c.length;u++){const h=c[u];i&&i.equals(h)||(n.push(h),i=h)}}return this.autoClose&&n.length>1&&!n[n.length-1].equals(n[0])&&n.push(n[0]),n}copy(e){super.copy(e),this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const a=e.curves[n];this.curves.push(a.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let n=0,i=this.curves.length;n<i;n++){const a=this.curves[n];e.curves.push(a.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let n=0,i=e.curves.length;n<i;n++){const a=e.curves[n];this.curves.push(new $3[a.type]().fromJSON(a))}return this}}class G3 extends D${constructor(e){super(),this.type="Path",this.currentPoint=new _t,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let n=1,i=e.length;n<i;n++)this.lineTo(e[n].x,e[n].y);return this}moveTo(e,n){return this.currentPoint.set(e,n),this}lineTo(e,n){const i=new b6(this.currentPoint.clone(),new _t(e,n));return this.curves.push(i),this.currentPoint.set(e,n),this}quadraticCurveTo(e,n,i,a){const s=new x6(this.currentPoint.clone(),new _t(e,n),new _t(i,a));return this.curves.push(s),this.currentPoint.set(i,a),this}bezierCurveTo(e,n,i,a,s,r){const o=new y6(this.currentPoint.clone(),new _t(e,n),new _t(i,a),new _t(s,r));return this.curves.push(o),this.currentPoint.set(s,r),this}splineThru(e){const n=[this.currentPoint.clone()].concat(e),i=new S6(n);return this.curves.push(i),this.currentPoint.copy(e[e.length-1]),this}arc(e,n,i,a,s,r){const o=this.currentPoint.x,c=this.currentPoint.y;return this.absarc(e+o,n+c,i,a,s,r),this}absarc(e,n,i,a,s,r){return this.absellipse(e,n,i,i,a,s,r),this}ellipse(e,n,i,a,s,r,o,c){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absellipse(e+u,n+h,i,a,s,r,o,c),this}absellipse(e,n,i,a,s,r,o,c){const u=new Ww(e,n,i,a,s,r,o,c);if(this.curves.length>0){const d=u.getPoint(0);d.equals(this.currentPoint)||this.lineTo(d.x,d.y)}this.curves.push(u);const h=u.getPoint(1);return this.currentPoint.copy(h),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class Xp extends G3{constructor(e){super(e),this.uuid=$o(),this.type="Shape",this.holes=[]}getPointsHoles(e){const n=[];for(let i=0,a=this.holes.length;i<a;i++)n[i]=this.holes[i].getPoints(e);return n}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const a=e.holes[n];this.holes.push(a.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let n=0,i=this.holes.length;n<i;n++){const a=this.holes[n];e.holes.push(a.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let n=0,i=e.holes.length;n<i;n++){const a=e.holes[n];this.holes.push(new G3().fromJSON(a))}return this}}function Kme(t,e,n=2){const i=e&&e.length,a=i?e[0]*n:t.length;let s=L$(t,0,a,n,!0);const r=[];if(!s||s.next===s.prev)return r;let o,c,u;if(i&&(s=Qme(t,e,s,n)),t.length>80*n){o=1/0,c=1/0;let h=-1/0,d=-1/0;for(let p=n;p<a;p+=n){const g=t[p],b=t[p+1];g<o&&(o=g),b<c&&(c=b),g>h&&(h=g),b>d&&(d=b)}u=Math.max(h-o,d-c),u=u!==0?32767/u:0}return P1(s,r,n,o,c,u,0),r}function L$(t,e,n,i,a){let s;if(a===c0e(t,e,n,i)>0)for(let r=e;r<n;r+=i)s=xL(r/i|0,t[r],t[r+1],s);else for(let r=n-i;r>=e;r-=i)s=xL(r/i|0,t[r],t[r+1],s);return s&&Xg(s,s.next)&&(L1(s),s=s.next),s}function am(t,e){if(!t)return t;e||(e=t);let n=t,i;do if(i=!1,!n.steiner&&(Xg(n,n.next)||Sa(n.prev,n,n.next)===0)){if(L1(n),n=e=n.prev,n===n.next)break;i=!0}else n=n.next;while(i||n!==e);return e}function P1(t,e,n,i,a,s,r){if(!t)return;!r&&s&&i0e(t,i,a,s);let o=t;for(;t.prev!==t.next;){const c=t.prev,u=t.next;if(s?qme(t,i,a,s):Xme(t)){e.push(c.i,t.i,u.i),L1(t),t=u.next,o=u.next;continue}if(t=u,t===o){r?r===1?(t=Yme(am(t),e),P1(t,e,n,i,a,s,2)):r===2&&Zme(t,e,n,i,a,s):P1(am(t),e,n,i,a,s,1);break}}}function Xme(t){const e=t.prev,n=t,i=t.next;if(Sa(e,n,i)>=0)return!1;const a=e.x,s=n.x,r=i.x,o=e.y,c=n.y,u=i.y,h=Math.min(a,s,r),d=Math.min(o,c,u),p=Math.max(a,s,r),g=Math.max(o,c,u);let b=i.next;for(;b!==e;){if(b.x>=h&&b.x<=p&&b.y>=d&&b.y<=g&&xb(a,o,s,c,r,u,b.x,b.y)&&Sa(b.prev,b,b.next)>=0)return!1;b=b.next}return!0}function qme(t,e,n,i){const a=t.prev,s=t,r=t.next;if(Sa(a,s,r)>=0)return!1;const o=a.x,c=s.x,u=r.x,h=a.y,d=s.y,p=r.y,g=Math.min(o,c,u),b=Math.min(h,d,p),w=Math.max(o,c,u),x=Math.max(h,d,p),S=z5(g,b,e,n,i),M=z5(w,x,e,n,i);let C=t.prevZ,A=t.nextZ;for(;C&&C.z>=S&&A&&A.z<=M;){if(C.x>=g&&C.x<=w&&C.y>=b&&C.y<=x&&C!==a&&C!==r&&xb(o,h,c,d,u,p,C.x,C.y)&&Sa(C.prev,C,C.next)>=0||(C=C.prevZ,A.x>=g&&A.x<=w&&A.y>=b&&A.y<=x&&A!==a&&A!==r&&xb(o,h,c,d,u,p,A.x,A.y)&&Sa(A.prev,A,A.next)>=0))return!1;A=A.nextZ}for(;C&&C.z>=S;){if(C.x>=g&&C.x<=w&&C.y>=b&&C.y<=x&&C!==a&&C!==r&&xb(o,h,c,d,u,p,C.x,C.y)&&Sa(C.prev,C,C.next)>=0)return!1;C=C.prevZ}for(;A&&A.z<=M;){if(A.x>=g&&A.x<=w&&A.y>=b&&A.y<=x&&A!==a&&A!==r&&xb(o,h,c,d,u,p,A.x,A.y)&&Sa(A.prev,A,A.next)>=0)return!1;A=A.nextZ}return!0}function Yme(t,e){let n=t;do{const i=n.prev,a=n.next.next;!Xg(i,a)&&I$(i,n,n.next,a)&&D1(i,a)&&D1(a,i)&&(e.push(i.i,n.i,a.i),L1(n),L1(n.next),n=t=a),n=n.next}while(n!==t);return am(n)}function Zme(t,e,n,i,a,s){let r=t;do{let o=r.next.next;for(;o!==r.prev;){if(r.i!==o.i&&r0e(r,o)){let c=z$(r,o);r=am(r,r.next),c=am(c,c.next),P1(r,e,n,i,a,s,0),P1(c,e,n,i,a,s,0);return}o=o.next}r=r.next}while(r!==t)}function Qme(t,e,n,i){const a=[];for(let s=0,r=e.length;s<r;s++){const o=e[s]*i,c=s<r-1?e[s+1]*i:t.length,u=L$(t,o,c,i,!1);u===u.next&&(u.steiner=!0),a.push(s0e(u))}a.sort(Jme);for(let s=0;s<a.length;s++)n=e0e(a[s],n);return n}function Jme(t,e){let n=t.x-e.x;if(n===0&&(n=t.y-e.y,n===0)){const i=(t.next.y-t.y)/(t.next.x-t.x),a=(e.next.y-e.y)/(e.next.x-e.x);n=i-a}return n}function e0e(t,e){const n=t0e(t,e);if(!n)return e;const i=z$(n,t);return am(i,i.next),am(n,n.next)}function t0e(t,e){let n=e;const i=t.x,a=t.y;let s=-1/0,r;if(Xg(t,n))return n;do{if(Xg(t,n.next))return n.next;if(a<=n.y&&a>=n.next.y&&n.next.y!==n.y){const d=n.x+(a-n.y)*(n.next.x-n.x)/(n.next.y-n.y);if(d<=i&&d>s&&(s=d,r=n.x<n.next.x?n:n.next,d===i))return r}n=n.next}while(n!==e);if(!r)return null;const o=r,c=r.x,u=r.y;let h=1/0;n=r;do{if(i>=n.x&&n.x>=c&&i!==n.x&&O$(a<u?i:s,a,c,u,a<u?s:i,a,n.x,n.y)){const d=Math.abs(a-n.y)/(i-n.x);D1(n,t)&&(d<h||d===h&&(n.x>r.x||n.x===r.x&&n0e(r,n)))&&(r=n,h=d)}n=n.next}while(n!==o);return r}function n0e(t,e){return Sa(t.prev,t,e.prev)<0&&Sa(e.next,t,t.next)<0}function i0e(t,e,n,i){let a=t;do a.z===0&&(a.z=z5(a.x,a.y,e,n,i)),a.prevZ=a.prev,a.nextZ=a.next,a=a.next;while(a!==t);a.prevZ.nextZ=null,a.prevZ=null,a0e(a)}function a0e(t){let e,n=1;do{let i=t,a;t=null;let s=null;for(e=0;i;){e++;let r=i,o=0;for(let u=0;u<n&&(o++,r=r.nextZ,!!r);u++);let c=n;for(;o>0||c>0&&r;)o!==0&&(c===0||!r||i.z<=r.z)?(a=i,i=i.nextZ,o--):(a=r,r=r.nextZ,c--),s?s.nextZ=a:t=a,a.prevZ=s,s=a;i=r}s.nextZ=null,n*=2}while(e>1);return t}function z5(t,e,n,i,a){return t=(t-n)*a|0,e=(e-i)*a|0,t=(t|t<<8)&16711935,t=(t|t<<4)&252645135,t=(t|t<<2)&858993459,t=(t|t<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,t|e<<1}function s0e(t){let e=t,n=t;do(e.x<n.x||e.x===n.x&&e.y<n.y)&&(n=e),e=e.next;while(e!==t);return n}function O$(t,e,n,i,a,s,r,o){return(a-r)*(e-o)>=(t-r)*(s-o)&&(t-r)*(i-o)>=(n-r)*(e-o)&&(n-r)*(s-o)>=(a-r)*(i-o)}function xb(t,e,n,i,a,s,r,o){return!(t===r&&e===o)&&O$(t,e,n,i,a,s,r,o)}function r0e(t,e){return t.next.i!==e.i&&t.prev.i!==e.i&&!o0e(t,e)&&(D1(t,e)&&D1(e,t)&&l0e(t,e)&&(Sa(t.prev,t,e.prev)||Sa(t,e.prev,e))||Xg(t,e)&&Sa(t.prev,t,t.next)>0&&Sa(e.prev,e,e.next)>0)}function Sa(t,e,n){return(e.y-t.y)*(n.x-e.x)-(e.x-t.x)*(n.y-e.y)}function Xg(t,e){return t.x===e.x&&t.y===e.y}function I$(t,e,n,i){const a=H_(Sa(t,e,n)),s=H_(Sa(t,e,i)),r=H_(Sa(n,i,t)),o=H_(Sa(n,i,e));return!!(a!==s&&r!==o||a===0&&k_(t,n,e)||s===0&&k_(t,i,e)||r===0&&k_(n,t,i)||o===0&&k_(n,e,i))}function k_(t,e,n){return e.x<=Math.max(t.x,n.x)&&e.x>=Math.min(t.x,n.x)&&e.y<=Math.max(t.y,n.y)&&e.y>=Math.min(t.y,n.y)}function H_(t){return t>0?1:t<0?-1:0}function o0e(t,e){let n=t;do{if(n.i!==t.i&&n.next.i!==t.i&&n.i!==e.i&&n.next.i!==e.i&&I$(n,n.next,t,e))return!0;n=n.next}while(n!==t);return!1}function D1(t,e){return Sa(t.prev,t,t.next)<0?Sa(t,e,t.next)>=0&&Sa(t,t.prev,e)>=0:Sa(t,e,t.prev)<0||Sa(t,t.next,e)<0}function l0e(t,e){let n=t,i=!1;const a=(t.x+e.x)/2,s=(t.y+e.y)/2;do n.y>s!=n.next.y>s&&n.next.y!==n.y&&a<(n.next.x-n.x)*(s-n.y)/(n.next.y-n.y)+n.x&&(i=!i),n=n.next;while(n!==t);return i}function z$(t,e){const n=B5(t.i,t.x,t.y),i=B5(e.i,e.x,e.y),a=t.next,s=e.prev;return t.next=e,e.prev=t,n.next=a,a.prev=n,i.next=n,n.prev=i,s.next=i,i.prev=s,i}function xL(t,e,n,i){const a=B5(t,e,n);return i?(a.next=i.next,a.prev=i,i.next.prev=a,i.next=a):(a.prev=a,a.next=a),a}function L1(t){t.next.prev=t.prev,t.prev.next=t.next,t.prevZ&&(t.prevZ.nextZ=t.nextZ),t.nextZ&&(t.nextZ.prevZ=t.prevZ)}function B5(t,e,n){return{i:t,x:e,y:n,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function c0e(t,e,n,i){let a=0;for(let s=e,r=n-i;s<n;s+=i)a+=(t[r]-t[s])*(t[s+1]+t[r+1]),r=s;return a}class u0e{static triangulate(e,n,i=2){return Kme(e,n,i)}}class cc{static area(e){const n=e.length;let i=0;for(let a=n-1,s=0;s<n;a=s++)i+=e[a].x*e[s].y-e[s].x*e[a].y;return i*.5}static isClockWise(e){return cc.area(e)<0}static triangulateShape(e,n){const i=[],a=[],s=[];_L(e),SL(i,e);let r=e.length;n.forEach(_L);for(let c=0;c<n.length;c++)a.push(r),r+=n[c].length,SL(i,n[c]);const o=u0e.triangulate(i,a);for(let c=0;c<o.length;c+=3)s.push(o.slice(c,c+3));return s}}function _L(t){const e=t.length;e>2&&t[e-1].equals(t[0])&&t.pop()}function SL(t,e){for(let n=0;n<e.length;n++)t.push(e[n].x),t.push(e[n].y)}class Kw extends Pn{constructor(e=new Xp([new _t(.5,.5),new _t(-.5,.5),new _t(-.5,-.5),new _t(.5,-.5)]),n={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:n},e=Array.isArray(e)?e:[e];const i=this,a=[],s=[];for(let o=0,c=e.length;o<c;o++){const u=e[o];r(u)}this.setAttribute("position",new an(a,3)),this.setAttribute("uv",new an(s,2)),this.computeVertexNormals();function r(o){const c=[],u=n.curveSegments!==void 0?n.curveSegments:12,h=n.steps!==void 0?n.steps:1,d=n.depth!==void 0?n.depth:1;let p=n.bevelEnabled!==void 0?n.bevelEnabled:!0,g=n.bevelThickness!==void 0?n.bevelThickness:.2,b=n.bevelSize!==void 0?n.bevelSize:g-.1,w=n.bevelOffset!==void 0?n.bevelOffset:0,x=n.bevelSegments!==void 0?n.bevelSegments:3;const S=n.extrudePath,M=n.UVGenerator!==void 0?n.UVGenerator:d0e;let C,A=!1,N,R,D,B;S&&(C=S.getSpacedPoints(h),A=!0,p=!1,N=S.computeFrenetFrames(h,!1),R=new fe,D=new fe,B=new fe),p||(x=0,g=0,b=0,w=0);const z=o.extractPoints(u);let I=z.shape;const U=z.holes;if(!cc.isClockWise(I)){I=I.reverse();for(let be=0,xe=U.length;be<xe;be++){const he=U[be];cc.isClockWise(he)&&(U[be]=he.reverse())}}function G(be){const he=10000000000000001e-36;let ve=be[0];for(let Oe=1;Oe<=be.length;Oe++){const Le=Oe%be.length,Ae=be[Le],et=Ae.x-ve.x,tt=Ae.y-ve.y,re=et*et+tt*tt,te=Math.max(Math.abs(Ae.x),Math.abs(Ae.y),Math.abs(ve.x),Math.abs(ve.y)),we=he*te*te;if(re<=we){be.splice(Le,1),Oe--;continue}ve=Ae}}G(I),U.forEach(G);const k=U.length,X=I;for(let be=0;be<k;be++){const xe=U[be];I=I.concat(xe)}function V(be,xe,he){return xe||console.error("THREE.ExtrudeGeometry: vec does not exist"),be.clone().addScaledVector(xe,he)}const H=I.length;function W(be,xe,he){let ve,Oe,Le;const Ae=be.x-xe.x,et=be.y-xe.y,tt=he.x-be.x,re=he.y-be.y,te=Ae*Ae+et*et,we=Ae*re-et*tt;if(Math.abs(we)>Number.EPSILON){const Ce=Math.sqrt(te),Ie=Math.sqrt(tt*tt+re*re),Pe=xe.x-et/Ce,Ze=xe.y+Ae/Ce,We=he.x-re/Ie,mt=he.y+tt/Ie,nt=((We-Pe)*re-(mt-Ze)*tt)/(Ae*re-et*tt);ve=Pe+Ae*nt-be.x,Oe=Ze+et*nt-be.y;const Ye=ve*ve+Oe*Oe;if(Ye<=2)return new _t(ve,Oe);Le=Math.sqrt(Ye/2)}else{let Ce=!1;Ae>Number.EPSILON?tt>Number.EPSILON&&(Ce=!0):Ae<-Number.EPSILON?tt<-Number.EPSILON&&(Ce=!0):Math.sign(et)===Math.sign(re)&&(Ce=!0),Ce?(ve=-et,Oe=Ae,Le=Math.sqrt(te)):(ve=Ae,Oe=et,Le=Math.sqrt(te/2))}return new _t(ve/Le,Oe/Le)}const J=[];for(let be=0,xe=X.length,he=xe-1,ve=be+1;be<xe;be++,he++,ve++)he===xe&&(he=0),ve===xe&&(ve=0),J[be]=W(X[be],X[he],X[ve]);const Y=[];let K,ee=J.concat();for(let be=0,xe=k;be<xe;be++){const he=U[be];K=[];for(let ve=0,Oe=he.length,Le=Oe-1,Ae=ve+1;ve<Oe;ve++,Le++,Ae++)Le===Oe&&(Le=0),Ae===Oe&&(Ae=0),K[ve]=W(he[ve],he[Le],he[Ae]);Y.push(K),ee=ee.concat(K)}let ie;if(x===0)ie=cc.triangulateShape(X,U);else{const be=[],xe=[];for(let he=0;he<x;he++){const ve=he/x,Oe=g*Math.cos(ve*Math.PI/2),Le=b*Math.sin(ve*Math.PI/2)+w;for(let Ae=0,et=X.length;Ae<et;Ae++){const tt=V(X[Ae],J[Ae],Le);pe(tt.x,tt.y,-Oe),ve===0&&be.push(tt)}for(let Ae=0,et=k;Ae<et;Ae++){const tt=U[Ae];K=Y[Ae];const re=[];for(let te=0,we=tt.length;te<we;te++){const Ce=V(tt[te],K[te],Le);pe(Ce.x,Ce.y,-Oe),ve===0&&re.push(Ce)}ve===0&&xe.push(re)}}ie=cc.triangulateShape(be,xe)}const Z=ie.length,ue=b+w;for(let be=0;be<H;be++){const xe=p?V(I[be],ee[be],ue):I[be];A?(D.copy(N.normals[0]).multiplyScalar(xe.x),R.copy(N.binormals[0]).multiplyScalar(xe.y),B.copy(C[0]).add(D).add(R),pe(B.x,B.y,B.z)):pe(xe.x,xe.y,0)}for(let be=1;be<=h;be++)for(let xe=0;xe<H;xe++){const he=p?V(I[xe],ee[xe],ue):I[xe];A?(D.copy(N.normals[be]).multiplyScalar(he.x),R.copy(N.binormals[be]).multiplyScalar(he.y),B.copy(C[be]).add(D).add(R),pe(B.x,B.y,B.z)):pe(he.x,he.y,d/h*be)}for(let be=x-1;be>=0;be--){const xe=be/x,he=g*Math.cos(xe*Math.PI/2),ve=b*Math.sin(xe*Math.PI/2)+w;for(let Oe=0,Le=X.length;Oe<Le;Oe++){const Ae=V(X[Oe],J[Oe],ve);pe(Ae.x,Ae.y,d+he)}for(let Oe=0,Le=U.length;Oe<Le;Oe++){const Ae=U[Oe];K=Y[Oe];for(let et=0,tt=Ae.length;et<tt;et++){const re=V(Ae[et],K[et],ve);A?pe(re.x,re.y+C[h-1].y,C[h-1].x+he):pe(re.x,re.y,d+he)}}}se(),ae();function se(){const be=a.length/3;if(p){let xe=0,he=H*xe;for(let ve=0;ve<Z;ve++){const Oe=ie[ve];ye(Oe[2]+he,Oe[1]+he,Oe[0]+he)}xe=h+x*2,he=H*xe;for(let ve=0;ve<Z;ve++){const Oe=ie[ve];ye(Oe[0]+he,Oe[1]+he,Oe[2]+he)}}else{for(let xe=0;xe<Z;xe++){const he=ie[xe];ye(he[2],he[1],he[0])}for(let xe=0;xe<Z;xe++){const he=ie[xe];ye(he[0]+H*h,he[1]+H*h,he[2]+H*h)}}i.addGroup(be,a.length/3-be,0)}function ae(){const be=a.length/3;let xe=0;ce(X,xe),xe+=X.length;for(let he=0,ve=U.length;he<ve;he++){const Oe=U[he];ce(Oe,xe),xe+=Oe.length}i.addGroup(be,a.length/3-be,1)}function ce(be,xe){let he=be.length;for(;--he>=0;){const ve=he;let Oe=he-1;Oe<0&&(Oe=be.length-1);for(let Le=0,Ae=h+x*2;Le<Ae;Le++){const et=H*Le,tt=H*(Le+1),re=xe+ve+et,te=xe+Oe+et,we=xe+Oe+tt,Ce=xe+ve+tt;_e(re,te,we,Ce)}}}function pe(be,xe,he){c.push(be),c.push(xe),c.push(he)}function ye(be,xe,he){me(be),me(xe),me(he);const ve=a.length/3,Oe=M.generateTopUV(i,a,ve-3,ve-2,ve-1);ne(Oe[0]),ne(Oe[1]),ne(Oe[2])}function _e(be,xe,he,ve){me(be),me(xe),me(ve),me(xe),me(he),me(ve);const Oe=a.length/3,Le=M.generateSideWallUV(i,a,Oe-6,Oe-3,Oe-2,Oe-1);ne(Le[0]),ne(Le[1]),ne(Le[3]),ne(Le[1]),ne(Le[2]),ne(Le[3])}function me(be){a.push(c[be*3+0]),a.push(c[be*3+1]),a.push(c[be*3+2])}function ne(be){s.push(be.x),s.push(be.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes,i=this.parameters.options;return f0e(n,i,e)}static fromJSON(e,n){const i=[];for(let s=0,r=e.shapes.length;s<r;s++){const o=n[e.shapes[s]];i.push(o)}const a=e.options.extrudePath;return a!==void 0&&(e.options.extrudePath=new $3[a.type]().fromJSON(a)),new Kw(i,e.options)}}const d0e={generateTopUV:function(t,e,n,i,a){const s=e[n*3],r=e[n*3+1],o=e[i*3],c=e[i*3+1],u=e[a*3],h=e[a*3+1];return[new _t(s,r),new _t(o,c),new _t(u,h)]},generateSideWallUV:function(t,e,n,i,a,s){const r=e[n*3],o=e[n*3+1],c=e[n*3+2],u=e[i*3],h=e[i*3+1],d=e[i*3+2],p=e[a*3],g=e[a*3+1],b=e[a*3+2],w=e[s*3],x=e[s*3+1],S=e[s*3+2];return Math.abs(o-h)<Math.abs(r-u)?[new _t(r,1-c),new _t(u,1-d),new _t(p,1-b),new _t(w,1-S)]:[new _t(o,1-c),new _t(h,1-d),new _t(g,1-b),new _t(x,1-S)]}};function f0e(t,e,n){if(n.shapes=[],Array.isArray(t))for(let i=0,a=t.length;i<a;i++){const s=t[i];n.shapes.push(s.uuid)}else n.shapes.push(t.uuid);return n.options=Object.assign({},e),e.extrudePath!==void 0&&(n.options.extrudePath=e.extrudePath.toJSON()),n}class Xw extends ph{constructor(e=1,n=0){const i=(1+Math.sqrt(5))/2,a=[-1,i,0,1,i,0,-1,-i,0,1,-i,0,0,-1,i,0,1,i,0,-1,-i,0,1,-i,i,0,-1,i,0,1,-i,0,-1,-i,0,1],s=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(a,s,e,n),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new Xw(e.radius,e.detail)}}class qw extends Pn{constructor(e=[new _t(0,-.5),new _t(.5,0),new _t(0,.5)],n=12,i=0,a=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:n,phiStart:i,phiLength:a},n=Math.floor(n),a=En(a,0,Math.PI*2);const s=[],r=[],o=[],c=[],u=[],h=1/n,d=new fe,p=new _t,g=new fe,b=new fe,w=new fe;let x=0,S=0;for(let M=0;M<=e.length-1;M++)switch(M){case 0:x=e[M+1].x-e[M].x,S=e[M+1].y-e[M].y,g.x=S*1,g.y=-x,g.z=S*0,w.copy(g),g.normalize(),c.push(g.x,g.y,g.z);break;case e.length-1:c.push(w.x,w.y,w.z);break;default:x=e[M+1].x-e[M].x,S=e[M+1].y-e[M].y,g.x=S*1,g.y=-x,g.z=S*0,b.copy(g),g.x+=w.x,g.y+=w.y,g.z+=w.z,g.normalize(),c.push(g.x,g.y,g.z),w.copy(b)}for(let M=0;M<=n;M++){const C=i+M*h*a,A=Math.sin(C),N=Math.cos(C);for(let R=0;R<=e.length-1;R++){d.x=e[R].x*A,d.y=e[R].y,d.z=e[R].x*N,r.push(d.x,d.y,d.z),p.x=M/n,p.y=R/(e.length-1),o.push(p.x,p.y);const D=c[3*R+0]*A,B=c[3*R+1],z=c[3*R+0]*N;u.push(D,B,z)}}for(let M=0;M<n;M++)for(let C=0;C<e.length-1;C++){const A=C+M*e.length,N=A,R=A+e.length,D=A+e.length+1,B=A+1;s.push(N,R,B),s.push(D,B,R)}this.setIndex(s),this.setAttribute("position",new an(r,3)),this.setAttribute("uv",new an(o,2)),this.setAttribute("normal",new an(u,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new qw(e.points,e.segments,e.phiStart,e.phiLength)}}class bl extends ph{constructor(e=1,n=0){const i=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],a=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(i,a,e,n),this.type="OctahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new bl(e.radius,e.detail)}}class Bo extends Pn{constructor(e=1,n=1,i=1,a=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:n,widthSegments:i,heightSegments:a};const s=e/2,r=n/2,o=Math.floor(i),c=Math.floor(a),u=o+1,h=c+1,d=e/o,p=n/c,g=[],b=[],w=[],x=[];for(let S=0;S<h;S++){const M=S*p-r;for(let C=0;C<u;C++){const A=C*d-s;b.push(A,-M,0),w.push(0,0,1),x.push(C/o),x.push(1-S/c)}}for(let S=0;S<c;S++)for(let M=0;M<o;M++){const C=M+u*S,A=M+u*(S+1),N=M+1+u*(S+1),R=M+1+u*S;g.push(C,A,R),g.push(A,N,R)}this.setIndex(g),this.setAttribute("position",new an(b,3)),this.setAttribute("normal",new an(w,3)),this.setAttribute("uv",new an(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Bo(e.width,e.height,e.widthSegments,e.heightSegments)}}class Yw extends Pn{constructor(e=.5,n=1,i=32,a=1,s=0,r=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:n,thetaSegments:i,phiSegments:a,thetaStart:s,thetaLength:r},i=Math.max(3,i),a=Math.max(1,a);const o=[],c=[],u=[],h=[];let d=e;const p=(n-e)/a,g=new fe,b=new _t;for(let w=0;w<=a;w++){for(let x=0;x<=i;x++){const S=s+x/i*r;g.x=d*Math.cos(S),g.y=d*Math.sin(S),c.push(g.x,g.y,g.z),u.push(0,0,1),b.x=(g.x/n+1)/2,b.y=(g.y/n+1)/2,h.push(b.x,b.y)}d+=p}for(let w=0;w<a;w++){const x=w*(i+1);for(let S=0;S<i;S++){const M=S+x,C=M,A=M+i+1,N=M+i+2,R=M+1;o.push(C,A,R),o.push(A,N,R)}}this.setIndex(o),this.setAttribute("position",new an(c,3)),this.setAttribute("normal",new an(u,3)),this.setAttribute("uv",new an(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Yw(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class Zw extends Pn{constructor(e=new Xp([new _t(0,.5),new _t(-.5,-.5),new _t(.5,-.5)]),n=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:n};const i=[],a=[],s=[],r=[];let o=0,c=0;if(Array.isArray(e)===!1)u(e);else for(let h=0;h<e.length;h++)u(e[h]),this.addGroup(o,c,h),o+=c,c=0;this.setIndex(i),this.setAttribute("position",new an(a,3)),this.setAttribute("normal",new an(s,3)),this.setAttribute("uv",new an(r,2));function u(h){const d=a.length/3,p=h.extractPoints(n);let g=p.shape;const b=p.holes;cc.isClockWise(g)===!1&&(g=g.reverse());for(let x=0,S=b.length;x<S;x++){const M=b[x];cc.isClockWise(M)===!0&&(b[x]=M.reverse())}const w=cc.triangulateShape(g,b);for(let x=0,S=b.length;x<S;x++){const M=b[x];g=g.concat(M)}for(let x=0,S=g.length;x<S;x++){const M=g[x];a.push(M.x,M.y,0),s.push(0,0,1),r.push(M.x,M.y)}for(let x=0,S=w.length;x<S;x++){const M=w[x],C=M[0]+d,A=M[1]+d,N=M[2]+d;i.push(C,A,N),c+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),n=this.parameters.shapes;return h0e(n,e)}static fromJSON(e,n){const i=[];for(let a=0,s=e.shapes.length;a<s;a++){const r=n[e.shapes[a]];i.push(r)}return new Zw(i,e.curveSegments)}}function h0e(t,e){if(e.shapes=[],Array.isArray(t))for(let n=0,i=t.length;n<i;n++){const a=t[n];e.shapes.push(a.uuid)}else e.shapes.push(t.uuid);return e}class fv extends Pn{constructor(e=1,n=32,i=16,a=0,s=Math.PI*2,r=0,o=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:n,heightSegments:i,phiStart:a,phiLength:s,thetaStart:r,thetaLength:o},n=Math.max(3,Math.floor(n)),i=Math.max(2,Math.floor(i));const c=Math.min(r+o,Math.PI);let u=0;const h=[],d=new fe,p=new fe,g=[],b=[],w=[],x=[];for(let S=0;S<=i;S++){const M=[],C=S/i;let A=0;S===0&&r===0?A=.5/n:S===i&&c===Math.PI&&(A=-.5/n);for(let N=0;N<=n;N++){const R=N/n;d.x=-e*Math.cos(a+R*s)*Math.sin(r+C*o),d.y=e*Math.cos(r+C*o),d.z=e*Math.sin(a+R*s)*Math.sin(r+C*o),b.push(d.x,d.y,d.z),p.copy(d).normalize(),w.push(p.x,p.y,p.z),x.push(R+A,1-C),M.push(u++)}h.push(M)}for(let S=0;S<i;S++)for(let M=0;M<n;M++){const C=h[S][M+1],A=h[S][M],N=h[S+1][M],R=h[S+1][M+1];(S!==0||r>0)&&g.push(C,A,R),(S!==i-1||c<Math.PI)&&g.push(A,N,R)}this.setIndex(g),this.setAttribute("position",new an(b,3)),this.setAttribute("normal",new an(w,3)),this.setAttribute("uv",new an(x,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new fv(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class Qw extends ph{constructor(e=1,n=0){const i=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],a=[2,1,0,0,3,2,1,3,0,2,3,1];super(i,a,e,n),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:n}}static fromJSON(e){return new Qw(e.radius,e.detail)}}class jf extends Pn{constructor(e=1,n=.4,i=12,a=48,s=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:n,radialSegments:i,tubularSegments:a,arc:s},i=Math.floor(i),a=Math.floor(a);const r=[],o=[],c=[],u=[],h=new fe,d=new fe,p=new fe;for(let g=0;g<=i;g++)for(let b=0;b<=a;b++){const w=b/a*s,x=g/i*Math.PI*2;d.x=(e+n*Math.cos(x))*Math.cos(w),d.y=(e+n*Math.cos(x))*Math.sin(w),d.z=n*Math.sin(x),o.push(d.x,d.y,d.z),h.x=e*Math.cos(w),h.y=e*Math.sin(w),p.subVectors(d,h).normalize(),c.push(p.x,p.y,p.z),u.push(b/a),u.push(g/i)}for(let g=1;g<=i;g++)for(let b=1;b<=a;b++){const w=(a+1)*g+b-1,x=(a+1)*(g-1)+b-1,S=(a+1)*(g-1)+b,M=(a+1)*g+b;r.push(w,x,M),r.push(x,S,M)}this.setIndex(r),this.setAttribute("position",new an(o,3)),this.setAttribute("normal",new an(c,3)),this.setAttribute("uv",new an(u,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new jf(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class Jw extends Pn{constructor(e=1,n=.4,i=64,a=8,s=2,r=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:n,tubularSegments:i,radialSegments:a,p:s,q:r},i=Math.floor(i),a=Math.floor(a);const o=[],c=[],u=[],h=[],d=new fe,p=new fe,g=new fe,b=new fe,w=new fe,x=new fe,S=new fe;for(let C=0;C<=i;++C){const A=C/i*s*Math.PI*2;M(A,s,r,e,g),M(A+.01,s,r,e,b),x.subVectors(b,g),S.addVectors(b,g),w.crossVectors(x,S),S.crossVectors(w,x),w.normalize(),S.normalize();for(let N=0;N<=a;++N){const R=N/a*Math.PI*2,D=-n*Math.cos(R),B=n*Math.sin(R);d.x=g.x+(D*S.x+B*w.x),d.y=g.y+(D*S.y+B*w.y),d.z=g.z+(D*S.z+B*w.z),c.push(d.x,d.y,d.z),p.subVectors(d,g).normalize(),u.push(p.x,p.y,p.z),h.push(C/i),h.push(N/a)}}for(let C=1;C<=i;C++)for(let A=1;A<=a;A++){const N=(a+1)*(C-1)+(A-1),R=(a+1)*C+(A-1),D=(a+1)*C+A,B=(a+1)*(C-1)+A;o.push(N,R,B),o.push(R,D,B)}this.setIndex(o),this.setAttribute("position",new an(c,3)),this.setAttribute("normal",new an(u,3)),this.setAttribute("uv",new an(h,2));function M(C,A,N,R,D){const B=Math.cos(C),z=Math.sin(C),I=N/A*C,U=Math.cos(I);D.x=R*(2+U)*.5*B,D.y=R*(2+U)*z*.5,D.z=R*Math.sin(I)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Jw(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class e4 extends Pn{constructor(e=new _6(new fe(-1,-1,0),new fe(-1,1,0),new fe(1,1,0)),n=64,i=1,a=8,s=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:n,radius:i,radialSegments:a,closed:s};const r=e.computeFrenetFrames(n,s);this.tangents=r.tangents,this.normals=r.normals,this.binormals=r.binormals;const o=new fe,c=new fe,u=new _t;let h=new fe;const d=[],p=[],g=[],b=[];w(),this.setIndex(b),this.setAttribute("position",new an(d,3)),this.setAttribute("normal",new an(p,3)),this.setAttribute("uv",new an(g,2));function w(){for(let C=0;C<n;C++)x(C);x(s===!1?n:0),M(),S()}function x(C){h=e.getPointAt(C/n,h);const A=r.normals[C],N=r.binormals[C];for(let R=0;R<=a;R++){const D=R/a*Math.PI*2,B=Math.sin(D),z=-Math.cos(D);c.x=z*A.x+B*N.x,c.y=z*A.y+B*N.y,c.z=z*A.z+B*N.z,c.normalize(),p.push(c.x,c.y,c.z),o.x=h.x+i*c.x,o.y=h.y+i*c.y,o.z=h.z+i*c.z,d.push(o.x,o.y,o.z)}}function S(){for(let C=1;C<=n;C++)for(let A=1;A<=a;A++){const N=(a+1)*(C-1)+(A-1),R=(a+1)*C+(A-1),D=(a+1)*C+A,B=(a+1)*(C-1)+A;b.push(N,R,B),b.push(R,D,B)}}function M(){for(let C=0;C<=n;C++)for(let A=0;A<=a;A++)u.x=C/n,u.y=A/a,g.push(u.x,u.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new e4(new $3[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class B$ extends Pn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const n=[],i=new Set,a=new fe,s=new fe;if(e.index!==null){const r=e.attributes.position,o=e.index;let c=e.groups;c.length===0&&(c=[{start:0,count:o.count,materialIndex:0}]);for(let u=0,h=c.length;u<h;++u){const d=c[u],p=d.start,g=d.count;for(let b=p,w=p+g;b<w;b+=3)for(let x=0;x<3;x++){const S=o.getX(b+x),M=o.getX(b+(x+1)%3);a.fromBufferAttribute(r,S),s.fromBufferAttribute(r,M),wL(a,s,i)===!0&&(n.push(a.x,a.y,a.z),n.push(s.x,s.y,s.z))}}}else{const r=e.attributes.position;for(let o=0,c=r.count/3;o<c;o++)for(let u=0;u<3;u++){const h=3*o+u,d=3*o+(u+1)%3;a.fromBufferAttribute(r,h),s.fromBufferAttribute(r,d),wL(a,s,i)===!0&&(n.push(a.x,a.y,a.z),n.push(s.x,s.y,s.z))}}this.setAttribute("position",new an(n,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function wL(t,e,n){const i=`${t.x},${t.y},${t.z}-${e.x},${e.y},${e.z}`,a=`${e.x},${e.y},${e.z}-${t.x},${t.y},${t.z}`;return n.has(i)===!0||n.has(a)===!0?!1:(n.add(i),n.add(a),!0)}var EL=Object.freeze({__proto__:null,BoxGeometry:fo,CapsuleGeometry:Hw,CircleGeometry:$w,ConeGeometry:dx,CylinderGeometry:sr,DodecahedronGeometry:Gw,EdgesGeometry:C$,ExtrudeGeometry:Kw,IcosahedronGeometry:Xw,LatheGeometry:qw,OctahedronGeometry:bl,PlaneGeometry:Bo,PolyhedronGeometry:ph,RingGeometry:Yw,ShapeGeometry:Zw,SphereGeometry:fv,TetrahedronGeometry:Qw,TorusGeometry:jf,TorusKnotGeometry:Jw,TubeGeometry:e4,WireframeGeometry:B$});class U$ extends br{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Wt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class j$ extends pc{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class w6 extends br{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Wt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new xo,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class F$ extends w6{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new _t(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return En(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(n){this.ior=(1+.4*n)/(1-.4*n)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Wt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Wt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Wt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class V$ extends br{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Wt(16777215),this.specular=new Wt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new xo,this.combine=lx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class k$ extends br{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Wt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class H$ extends br{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class $$ extends br{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Wt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Wt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new xo,this.combine=lx,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class E6 extends br{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=e$,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class M6 extends br{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class G$ extends br{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Wt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=hh,this.normalScale=new _t(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class W$ extends xr{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function Vp(t,e){return!t||t.constructor===e?t:typeof e.BYTES_PER_ELEMENT=="number"?new e(t):Array.prototype.slice.call(t)}function K$(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function X$(t){function e(a,s){return t[a]-t[s]}const n=t.length,i=new Array(n);for(let a=0;a!==n;++a)i[a]=a;return i.sort(e),i}function U5(t,e,n){const i=t.length,a=new t.constructor(i);for(let s=0,r=0;r!==i;++s){const o=n[s]*e;for(let c=0;c!==e;++c)a[r++]=t[o+c]}return a}function T6(t,e,n,i){let a=1,s=t[0];for(;s!==void 0&&s[i]===void 0;)s=t[a++];if(s===void 0)return;let r=s[i];if(r!==void 0)if(Array.isArray(r))do r=s[i],r!==void 0&&(e.push(s.time),n.push(...r)),s=t[a++];while(s!==void 0);else if(r.toArray!==void 0)do r=s[i],r!==void 0&&(e.push(s.time),r.toArray(n,n.length)),s=t[a++];while(s!==void 0);else do r=s[i],r!==void 0&&(e.push(s.time),n.push(r)),s=t[a++];while(s!==void 0)}function p0e(t,e,n,i,a=30){const s=t.clone();s.name=e;const r=[];for(let c=0;c<s.tracks.length;++c){const u=s.tracks[c],h=u.getValueSize(),d=[],p=[];for(let g=0;g<u.times.length;++g){const b=u.times[g]*a;if(!(b<n||b>=i)){d.push(u.times[g]);for(let w=0;w<h;++w)p.push(u.values[g*h+w])}}d.length!==0&&(u.times=Vp(d,u.times.constructor),u.values=Vp(p,u.values.constructor),r.push(u))}s.tracks=r;let o=1/0;for(let c=0;c<s.tracks.length;++c)o>s.tracks[c].times[0]&&(o=s.tracks[c].times[0]);for(let c=0;c<s.tracks.length;++c)s.tracks[c].shift(-1*o);return s.resetDuration(),s}function m0e(t,e=0,n=t,i=30){i<=0&&(i=30);const a=n.tracks.length,s=e/i;for(let r=0;r<a;++r){const o=n.tracks[r],c=o.ValueTypeName;if(c==="bool"||c==="string")continue;const u=t.tracks.find(function(S){return S.name===o.name&&S.ValueTypeName===c});if(u===void 0)continue;let h=0;const d=o.getValueSize();o.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(h=d/3);let p=0;const g=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(p=g/3);const b=o.times.length-1;let w;if(s<=o.times[0]){const S=h,M=d-h;w=o.values.slice(S,M)}else if(s>=o.times[b]){const S=b*d+h,M=S+d-h;w=o.values.slice(S,M)}else{const S=o.createInterpolant(),M=h,C=d-h;S.evaluate(s),w=S.resultBuffer.slice(M,C)}c==="quaternion"&&new Li().fromArray(w).normalize().conjugate().toArray(w);const x=u.times.length;for(let S=0;S<x;++S){const M=S*g+p;if(c==="quaternion")Li.multiplyQuaternionsFlat(u.values,M,w,0,u.values,M);else{const C=g-p*2;for(let A=0;A<C;++A)u.values[M+A]-=w[A]}}}return t.blendMode=r6,t}class g0e{static convertArray(e,n){return Vp(e,n)}static isTypedArray(e){return K$(e)}static getKeyframeOrder(e){return X$(e)}static sortedArray(e,n,i){return U5(e,n,i)}static flattenJSON(e,n,i,a){T6(e,n,i,a)}static subclip(e,n,i,a,s=30){return p0e(e,n,i,a,s)}static makeClipAdditive(e,n=0,i=e,a=30){return m0e(e,n,i,a)}}class fx{constructor(e,n,i,a){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=a!==void 0?a:new n.constructor(i),this.sampleValues=n,this.valueSize=i,this.settings=null,this.DefaultSettings_={}}evaluate(e){const n=this.parameterPositions;let i=this._cachedIndex,a=n[i],s=n[i-1];e:{t:{let r;n:{i:if(!(e<a)){for(let o=i+2;;){if(a===void 0){if(e<s)break i;return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}if(i===o)break;if(s=a,a=n[++i],e<a)break t}r=n.length;break n}if(!(e>=s)){const o=n[1];e<o&&(i=2,s=o);for(let c=i-2;;){if(s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(i===c)break;if(a=s,s=n[--i-1],e>=s)break t}r=i,i=0;break n}break e}for(;i<r;){const o=i+r>>>1;e<n[o]?r=o:i=o+1}if(a=n[i],s=n[i-1],s===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(a===void 0)return i=n.length,this._cachedIndex=i,this.copySampleValue_(i-1)}this._cachedIndex=i,this.intervalChanged_(i,s,a)}return this.interpolate_(i,s,e,a)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const n=this.resultBuffer,i=this.sampleValues,a=this.valueSize,s=e*a;for(let r=0;r!==a;++r)n[r]=i[s+r];return n}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class q$ extends fx{constructor(e,n,i,a){super(e,n,i,a),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:jp,endingEnd:jp}}intervalChanged_(e,n,i){const a=this.parameterPositions;let s=e-2,r=e+1,o=a[s],c=a[r];if(o===void 0)switch(this.getSettings_().endingStart){case Fp:s=e,o=2*n-i;break;case T1:s=a.length-2,o=n+a[s]-a[s+1];break;default:s=e,o=i}if(c===void 0)switch(this.getSettings_().endingEnd){case Fp:r=e,c=2*i-n;break;case T1:r=1,c=i+a[1]-a[0];break;default:r=e-1,c=n}const u=(i-n)*.5,h=this.valueSize;this._weightPrev=u/(n-o),this._weightNext=u/(c-i),this._offsetPrev=s*h,this._offsetNext=r*h}interpolate_(e,n,i,a){const s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=e*o,u=c-o,h=this._offsetPrev,d=this._offsetNext,p=this._weightPrev,g=this._weightNext,b=(i-n)/(a-n),w=b*b,x=w*b,S=-p*x+2*p*w-p*b,M=(1+p)*x+(-1.5-2*p)*w+(-.5+p)*b+1,C=(-1-g)*x+(1.5+g)*w+.5*b,A=g*x-g*w;for(let N=0;N!==o;++N)s[N]=S*r[h+N]+M*r[u+N]+C*r[c+N]+A*r[d+N];return s}}class C6 extends fx{constructor(e,n,i,a){super(e,n,i,a)}interpolate_(e,n,i,a){const s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=e*o,u=c-o,h=(i-n)/(a-n),d=1-h;for(let p=0;p!==o;++p)s[p]=r[u+p]*d+r[c+p]*h;return s}}class Y$ extends fx{constructor(e,n,i,a){super(e,n,i,a)}interpolate_(e){return this.copySampleValue_(e-1)}}class Ll{constructor(e,n,i,a){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(n===void 0||n.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=Vp(n,this.TimeBufferType),this.values=Vp(i,this.ValueBufferType),this.setInterpolation(a||this.DefaultInterpolation)}static toJSON(e){const n=e.constructor;let i;if(n.toJSON!==this.toJSON)i=n.toJSON(e);else{i={name:e.name,times:Vp(e.times,Array),values:Vp(e.values,Array)};const a=e.getInterpolation();a!==e.DefaultInterpolation&&(i.interpolation=a)}return i.type=e.ValueTypeName,i}InterpolantFactoryMethodDiscrete(e){return new Y$(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new C6(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new q$(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let n;switch(e){case M1:n=this.InterpolantFactoryMethodDiscrete;break;case V3:n=this.InterpolantFactoryMethodLinear;break;case bS:n=this.InterpolantFactoryMethodSmooth;break}if(n===void 0){const i="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(i);return console.warn("THREE.KeyframeTrack:",i),this}return this.createInterpolant=n,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return M1;case this.InterpolantFactoryMethodLinear:return V3;case this.InterpolantFactoryMethodSmooth:return bS}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const n=this.times;for(let i=0,a=n.length;i!==a;++i)n[i]+=e}return this}scale(e){if(e!==1){const n=this.times;for(let i=0,a=n.length;i!==a;++i)n[i]*=e}return this}trim(e,n){const i=this.times,a=i.length;let s=0,r=a-1;for(;s!==a&&i[s]<e;)++s;for(;r!==-1&&i[r]>n;)--r;if(++r,s!==0||r!==a){s>=r&&(r=Math.max(r,1),s=r-1);const o=this.getValueSize();this.times=i.slice(s,r),this.values=this.values.slice(s*o,r*o)}return this}validate(){let e=!0;const n=this.getValueSize();n-Math.floor(n)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const i=this.times,a=this.values,s=i.length;s===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let r=null;for(let o=0;o!==s;o++){const c=i[o];if(typeof c=="number"&&isNaN(c)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,o,c),e=!1;break}if(r!==null&&r>c){console.error("THREE.KeyframeTrack: Out of order keys.",this,o,c,r),e=!1;break}r=c}if(a!==void 0&&K$(a))for(let o=0,c=a.length;o!==c;++o){const u=a[o];if(isNaN(u)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,o,u),e=!1;break}}return e}optimize(){const e=this.times.slice(),n=this.values.slice(),i=this.getValueSize(),a=this.getInterpolation()===bS,s=e.length-1;let r=1;for(let o=1;o<s;++o){let c=!1;const u=e[o],h=e[o+1];if(u!==h&&(o!==1||u!==e[0]))if(a)c=!0;else{const d=o*i,p=d-i,g=d+i;for(let b=0;b!==i;++b){const w=n[d+b];if(w!==n[p+b]||w!==n[g+b]){c=!0;break}}}if(c){if(o!==r){e[r]=e[o];const d=o*i,p=r*i;for(let g=0;g!==i;++g)n[p+g]=n[d+g]}++r}}if(s>0){e[r]=e[s];for(let o=s*i,c=r*i,u=0;u!==i;++u)n[c+u]=n[o+u];++r}return r!==e.length?(this.times=e.slice(0,r),this.values=n.slice(0,r*i)):(this.times=e,this.values=n),this}clone(){const e=this.times.slice(),n=this.values.slice(),i=this.constructor,a=new i(this.name,e,n);return a.createInterpolant=this.createInterpolant,a}}Ll.prototype.ValueTypeName="";Ll.prototype.TimeBufferType=Float32Array;Ll.prototype.ValueBufferType=Float32Array;Ll.prototype.DefaultInterpolation=V3;class xm extends Ll{constructor(e,n,i){super(e,n,i)}}xm.prototype.ValueTypeName="bool";xm.prototype.ValueBufferType=Array;xm.prototype.DefaultInterpolation=M1;xm.prototype.InterpolantFactoryMethodLinear=void 0;xm.prototype.InterpolantFactoryMethodSmooth=void 0;class A6 extends Ll{constructor(e,n,i,a){super(e,n,i,a)}}A6.prototype.ValueTypeName="color";class O1 extends Ll{constructor(e,n,i,a){super(e,n,i,a)}}O1.prototype.ValueTypeName="number";class Z$ extends fx{constructor(e,n,i,a){super(e,n,i,a)}interpolate_(e,n,i,a){const s=this.resultBuffer,r=this.sampleValues,o=this.valueSize,c=(i-n)/(a-n);let u=e*o;for(let h=u+o;u!==h;u+=4)Li.slerpFlat(s,0,r,u-o,r,u,c);return s}}class hx extends Ll{constructor(e,n,i,a){super(e,n,i,a)}InterpolantFactoryMethodLinear(e){return new Z$(this.times,this.values,this.getValueSize(),e)}}hx.prototype.ValueTypeName="quaternion";hx.prototype.InterpolantFactoryMethodSmooth=void 0;class _m extends Ll{constructor(e,n,i){super(e,n,i)}}_m.prototype.ValueTypeName="string";_m.prototype.ValueBufferType=Array;_m.prototype.DefaultInterpolation=M1;_m.prototype.InterpolantFactoryMethodLinear=void 0;_m.prototype.InterpolantFactoryMethodSmooth=void 0;class I1 extends Ll{constructor(e,n,i,a){super(e,n,i,a)}}I1.prototype.ValueTypeName="vector";class z1{constructor(e="",n=-1,i=[],a=Dw){this.name=e,this.tracks=i,this.duration=n,this.blendMode=a,this.uuid=$o(),this.userData={},this.duration<0&&this.resetDuration()}static parse(e){const n=[],i=e.tracks,a=1/(e.fps||1);for(let r=0,o=i.length;r!==o;++r)n.push(y0e(i[r]).scale(a));const s=new this(e.name,e.duration,n,e.blendMode);return s.uuid=e.uuid,s.userData=JSON.parse(e.userData||"{}"),s}static toJSON(e){const n=[],i=e.tracks,a={name:e.name,duration:e.duration,tracks:n,uuid:e.uuid,blendMode:e.blendMode,userData:JSON.stringify(e.userData)};for(let s=0,r=i.length;s!==r;++s)n.push(Ll.toJSON(i[s]));return a}static CreateFromMorphTargetSequence(e,n,i,a){const s=n.length,r=[];for(let o=0;o<s;o++){let c=[],u=[];c.push((o+s-1)%s,o,(o+1)%s),u.push(0,1,0);const h=X$(c);c=U5(c,1,h),u=U5(u,1,h),!a&&c[0]===0&&(c.push(s),u.push(u[0])),r.push(new O1(".morphTargetInfluences["+n[o].name+"]",c,u).scale(1/i))}return new this(e,-1,r)}static findByName(e,n){let i=e;if(!Array.isArray(e)){const a=e;i=a.geometry&&a.geometry.animations||a.animations}for(let a=0;a<i.length;a++)if(i[a].name===n)return i[a];return null}static CreateClipsFromMorphTargetSequences(e,n,i){const a={},s=/^([\w-]*?)([\d]+)$/;for(let o=0,c=e.length;o<c;o++){const u=e[o],h=u.name.match(s);if(h&&h.length>1){const d=h[1];let p=a[d];p||(a[d]=p=[]),p.push(u)}}const r=[];for(const o in a)r.push(this.CreateFromMorphTargetSequence(o,a[o],n,i));return r}static parseAnimation(e,n){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const i=function(d,p,g,b,w){if(g.length!==0){const x=[],S=[];T6(g,x,S,b),x.length!==0&&w.push(new d(p,x,S))}},a=[],s=e.name||"default",r=e.fps||30,o=e.blendMode;let c=e.length||-1;const u=e.hierarchy||[];for(let d=0;d<u.length;d++){const p=u[d].keys;if(!(!p||p.length===0))if(p[0].morphTargets){const g={};let b;for(b=0;b<p.length;b++)if(p[b].morphTargets)for(let w=0;w<p[b].morphTargets.length;w++)g[p[b].morphTargets[w]]=-1;for(const w in g){const x=[],S=[];for(let M=0;M!==p[b].morphTargets.length;++M){const C=p[b];x.push(C.time),S.push(C.morphTarget===w?1:0)}a.push(new O1(".morphTargetInfluence["+w+"]",x,S))}c=g.length*r}else{const g=".bones["+n[d].name+"]";i(I1,g+".position",p,"pos",a),i(hx,g+".quaternion",p,"rot",a),i(I1,g+".scale",p,"scl",a)}}return a.length===0?null:new this(s,c,a,o)}resetDuration(){const e=this.tracks;let n=0;for(let i=0,a=e.length;i!==a;++i){const s=this.tracks[i];n=Math.max(n,s.times[s.times.length-1])}return this.duration=n,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let n=0;n<this.tracks.length;n++)e=e&&this.tracks[n].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let i=0;i<this.tracks.length;i++)e.push(this.tracks[i].clone());const n=new this.constructor(this.name,this.duration,e,this.blendMode);return n.userData=JSON.parse(JSON.stringify(this.userData)),n}toJSON(){return this.constructor.toJSON(this)}}function v0e(t){switch(t.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return O1;case"vector":case"vector2":case"vector3":case"vector4":return I1;case"color":return A6;case"quaternion":return hx;case"bool":case"boolean":return xm;case"string":return _m}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+t)}function y0e(t){if(t.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=v0e(t.type);if(t.times===void 0){const n=[],i=[];T6(t.keys,n,i,"value"),t.times=n,t.values=i}return e.parse!==void 0?e.parse(t):new e(t.name,t.times,t.values,t.interpolation)}const uu={enabled:!1,files:{},add:function(t,e){this.enabled!==!1&&(this.files[t]=e)},get:function(t){if(this.enabled!==!1)return this.files[t]},remove:function(t){delete this.files[t]},clear:function(){this.files={}}};class R6{constructor(e,n,i){const a=this;let s=!1,r=0,o=0,c;const u=[];this.onStart=void 0,this.onLoad=e,this.onProgress=n,this.onError=i,this.abortController=new AbortController,this.itemStart=function(h){o++,s===!1&&a.onStart!==void 0&&a.onStart(h,r,o),s=!0},this.itemEnd=function(h){r++,a.onProgress!==void 0&&a.onProgress(h,r,o),r===o&&(s=!1,a.onLoad!==void 0&&a.onLoad())},this.itemError=function(h){a.onError!==void 0&&a.onError(h)},this.resolveURL=function(h){return c?c(h):h},this.setURLModifier=function(h){return c=h,this},this.addHandler=function(h,d){return u.push(h,d),this},this.removeHandler=function(h){const d=u.indexOf(h);return d!==-1&&u.splice(d,2),this},this.getHandler=function(h){for(let d=0,p=u.length;d<p;d+=2){const g=u[d],b=u[d+1];if(g.global&&(g.lastIndex=0),g.test(h))return b}return null},this.abort=function(){return this.abortController.abort(),this.abortController=new AbortController,this}}}const Q$=new R6;class _o{constructor(e){this.manager=e!==void 0?e:Q$,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,n){const i=this;return new Promise(function(a,s){i.load(e,a,n,s)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}abort(){return this}}_o.DEFAULT_MATERIAL_NAME="__DEFAULT";const dd={};class b0e extends Error{constructor(e,n){super(e),this.response=n}}class Cd extends _o{constructor(e){super(e),this.mimeType="",this.responseType="",this._abortController=new AbortController}load(e,n,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=uu.get(`file:${e}`);if(s!==void 0)return this.manager.itemStart(e),setTimeout(()=>{n&&n(s),this.manager.itemEnd(e)},0),s;if(dd[e]!==void 0){dd[e].push({onLoad:n,onProgress:i,onError:a});return}dd[e]=[],dd[e].push({onLoad:n,onProgress:i,onError:a});const r=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin",signal:typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal}),o=this.mimeType,c=this.responseType;fetch(r).then(u=>{if(u.status===200||u.status===0){if(u.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||u.body===void 0||u.body.getReader===void 0)return u;const h=dd[e],d=u.body.getReader(),p=u.headers.get("X-File-Size")||u.headers.get("Content-Length"),g=p?parseInt(p):0,b=g!==0;let w=0;const x=new ReadableStream({start(S){M();function M(){d.read().then(({done:C,value:A})=>{if(C)S.close();else{w+=A.byteLength;const N=new ProgressEvent("progress",{lengthComputable:b,loaded:w,total:g});for(let R=0,D=h.length;R<D;R++){const B=h[R];B.onProgress&&B.onProgress(N)}S.enqueue(A),M()}},C=>{S.error(C)})}}});return new Response(x)}else throw new b0e(`fetch for "${u.url}" responded with ${u.status}: ${u.statusText}`,u)}).then(u=>{switch(c){case"arraybuffer":return u.arrayBuffer();case"blob":return u.blob();case"document":return u.text().then(h=>new DOMParser().parseFromString(h,o));case"json":return u.json();default:if(o==="")return u.text();{const d=/charset="?([^;"\s]*)"?/i.exec(o),p=d&&d[1]?d[1].toLowerCase():void 0,g=new TextDecoder(p);return u.arrayBuffer().then(b=>g.decode(b))}}}).then(u=>{uu.add(`file:${e}`,u);const h=dd[e];delete dd[e];for(let d=0,p=h.length;d<p;d++){const g=h[d];g.onLoad&&g.onLoad(u)}}).catch(u=>{const h=dd[e];if(h===void 0)throw this.manager.itemError(e),u;delete dd[e];for(let d=0,p=h.length;d<p;d++){const g=h[d];g.onError&&g.onError(u)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}class x0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=new Cd(this.manager);r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(c){a?a(c):console.error(c),s.manager.itemError(e)}},i,a)}parse(e){const n=[];for(let i=0;i<e.length;i++){const a=z1.parse(e[i]);n.push(a)}return n}}class _0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=[],o=new Vw,c=new Cd(this.manager);c.setPath(this.path),c.setResponseType("arraybuffer"),c.setRequestHeader(this.requestHeader),c.setWithCredentials(s.withCredentials);let u=0;function h(d){c.load(e[d],function(p){const g=s.parse(p,!0);r[d]={width:g.width,height:g.height,format:g.format,mipmaps:g.mipmaps},u+=1,u===6&&(g.mipmapCount===1&&(o.minFilter=ja),o.image=r,o.format=g.format,o.needsUpdate=!0,n&&n(o))},i,a)}if(Array.isArray(e))for(let d=0,p=e.length;d<p;++d)h(d);else c.load(e,function(d){const p=s.parse(d,!0);if(p.isCubemap){const g=p.mipmaps.length/p.mipmapCount;for(let b=0;b<g;b++){r[b]={mipmaps:[]};for(let w=0;w<p.mipmapCount;w++)r[b].mipmaps.push(p.mipmaps[b*p.mipmapCount+w]),r[b].format=p.format,r[b].width=p.width,r[b].height=p.height}o.image=r}else o.image.width=p.width,o.image.height=p.height,o.mipmaps=p.mipmaps;p.mipmapCount===1&&(o.minFilter=ja),o.format=p.format,o.needsUpdate=!0,n&&n(o)},i,a);return o}}const Z0=new WeakMap;class B1 extends _o{constructor(e){super(e)}load(e,n,i,a){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=uu.get(`image:${e}`);if(r!==void 0){if(r.complete===!0)s.manager.itemStart(e),setTimeout(function(){n&&n(r),s.manager.itemEnd(e)},0);else{let d=Z0.get(r);d===void 0&&(d=[],Z0.set(r,d)),d.push({onLoad:n,onError:a})}return r}const o=R1("img");function c(){h(),n&&n(this);const d=Z0.get(this)||[];for(let p=0;p<d.length;p++){const g=d[p];g.onLoad&&g.onLoad(this)}Z0.delete(this),s.manager.itemEnd(e)}function u(d){h(),a&&a(d),uu.remove(`image:${e}`);const p=Z0.get(this)||[];for(let g=0;g<p.length;g++){const b=p[g];b.onError&&b.onError(d)}Z0.delete(this),s.manager.itemError(e),s.manager.itemEnd(e)}function h(){o.removeEventListener("load",c,!1),o.removeEventListener("error",u,!1)}return o.addEventListener("load",c,!1),o.addEventListener("error",u,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(o.crossOrigin=this.crossOrigin),uu.add(`image:${e}`,o),s.manager.itemStart(e),o.src=e,o}}class S0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=new ux;s.colorSpace=rr;const r=new B1(this.manager);r.setCrossOrigin(this.crossOrigin),r.setPath(this.path);let o=0;function c(u){r.load(e[u],function(h){s.images[u]=h,o++,o===6&&(s.needsUpdate=!0,n&&n(s))},void 0,a)}for(let u=0;u<e.length;++u)c(u);return s}}class w0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=new gu,o=new Cd(this.manager);return o.setResponseType("arraybuffer"),o.setRequestHeader(this.requestHeader),o.setPath(this.path),o.setWithCredentials(s.withCredentials),o.load(e,function(c){let u;try{u=s.parse(c)}catch(h){if(a!==void 0)a(h);else{console.error(h);return}}u.image!==void 0?r.image=u.image:u.data!==void 0&&(r.image.width=u.width,r.image.height=u.height,r.image.data=u.data),r.wrapS=u.wrapS!==void 0?u.wrapS:El,r.wrapT=u.wrapT!==void 0?u.wrapT:El,r.magFilter=u.magFilter!==void 0?u.magFilter:ja,r.minFilter=u.minFilter!==void 0?u.minFilter:ja,r.anisotropy=u.anisotropy!==void 0?u.anisotropy:1,u.colorSpace!==void 0&&(r.colorSpace=u.colorSpace),u.flipY!==void 0&&(r.flipY=u.flipY),u.format!==void 0&&(r.format=u.format),u.type!==void 0&&(r.type=u.type),u.mipmaps!==void 0&&(r.mipmaps=u.mipmaps,r.minFilter=cu),u.mipmapCount===1&&(r.minFilter=ja),u.generateMipmaps!==void 0&&(r.generateMipmaps=u.generateMipmaps),r.needsUpdate=!0,n&&n(r,u)},i,a),r}}class E0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=new Na,r=new B1(this.manager);return r.setCrossOrigin(this.crossOrigin),r.setPath(this.path),r.load(e,function(o){s.image=o,s.needsUpdate=!0,n!==void 0&&n(s)},i,a),s}}class mh extends Jn{constructor(e,n=1){super(),this.isLight=!0,this.type="Light",this.color=new Wt(e),this.intensity=n}dispose(){}copy(e,n){return super.copy(e,n),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const n=super.toJSON(e);return n.object.color=this.color.getHex(),n.object.intensity=this.intensity,this.groundColor!==void 0&&(n.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(n.object.distance=this.distance),this.angle!==void 0&&(n.object.angle=this.angle),this.decay!==void 0&&(n.object.decay=this.decay),this.penumbra!==void 0&&(n.object.penumbra=this.penumbra),this.shadow!==void 0&&(n.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(n.object.target=this.target.uuid),n}}class J$ extends mh{constructor(e,n,i){super(e,i),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(Jn.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Wt(n)}copy(e,n){return super.copy(e,n),this.groundColor.copy(e.groundColor),this}}const IM=new wn,ML=new fe,TL=new fe;class N6{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new _t(512,512),this.mapType=Pl,this.map=null,this.mapPass=null,this.matrix=new wn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new dv,this._frameExtents=new _t(1,1),this._viewportCount=1,this._viewports=[new xi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const n=this.camera,i=this.matrix;ML.setFromMatrixPosition(e.matrixWorld),n.position.copy(ML),TL.setFromMatrixPosition(e.target.matrixWorld),n.lookAt(TL),n.updateMatrixWorld(),IM.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(IM,n.coordinateSystem,n.reversedDepth),n.reversedDepth?i.set(.5,0,0,.5,0,.5,0,.5,0,0,1,0,0,0,0,1):i.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),i.multiply(IM)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.autoUpdate=e.autoUpdate,this.needsUpdate=e.needsUpdate,this.normalBias=e.normalBias,this.blurSamples=e.blurSamples,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class M0e extends N6{constructor(){super(new Ms(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1,this.aspect=1}updateMatrices(e){const n=this.camera,i=$g*2*e.angle*this.focus,a=this.mapSize.width/this.mapSize.height*this.aspect,s=e.distance||n.far;(i!==n.fov||a!==n.aspect||s!==n.far)&&(n.fov=i,n.aspect=a,n.far=s,n.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class eG extends mh{constructor(e,n,i=0,a=Math.PI/3,s=0,r=2){super(e,n),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(Jn.DEFAULT_UP),this.updateMatrix(),this.target=new Jn,this.distance=i,this.angle=a,this.penumbra=s,this.decay=r,this.map=null,this.shadow=new M0e}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const CL=new wn,ub=new fe,zM=new fe;class T0e extends N6{constructor(){super(new Ms(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new _t(4,2),this._viewportCount=6,this._viewports=[new xi(2,1,1,1),new xi(0,1,1,1),new xi(3,1,1,1),new xi(1,1,1,1),new xi(3,0,1,1),new xi(1,0,1,1)],this._cubeDirections=[new fe(1,0,0),new fe(-1,0,0),new fe(0,0,1),new fe(0,0,-1),new fe(0,1,0),new fe(0,-1,0)],this._cubeUps=[new fe(0,1,0),new fe(0,1,0),new fe(0,1,0),new fe(0,1,0),new fe(0,0,1),new fe(0,0,-1)]}updateMatrices(e,n=0){const i=this.camera,a=this.matrix,s=e.distance||i.far;s!==i.far&&(i.far=s,i.updateProjectionMatrix()),ub.setFromMatrixPosition(e.matrixWorld),i.position.copy(ub),zM.copy(i.position),zM.add(this._cubeDirections[n]),i.up.copy(this._cubeUps[n]),i.lookAt(zM),i.updateMatrixWorld(),a.makeTranslation(-ub.x,-ub.y,-ub.z),CL.multiplyMatrices(i.projectionMatrix,i.matrixWorldInverse),this._frustum.setFromProjectionMatrix(CL,i.coordinateSystem,i.reversedDepth)}}class tG extends mh{constructor(e,n,i=0,a=2){super(e,n),this.isPointLight=!0,this.type="PointLight",this.distance=i,this.decay=a,this.shadow=new T0e}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,n){return super.copy(e,n),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class px extends Iw{constructor(e=-1,n=1,i=1,a=-1,s=.1,r=2e3){super(),this.isOrthographicCamera=!0,this.type="OrthographicCamera",this.zoom=1,this.view=null,this.left=e,this.right=n,this.top=i,this.bottom=a,this.near=s,this.far=r,this.updateProjectionMatrix()}copy(e,n){return super.copy(e,n),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,n,i,a,s,r){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=n,this.view.offsetX=i,this.view.offsetY=a,this.view.width=s,this.view.height=r,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),n=(this.top-this.bottom)/(2*this.zoom),i=(this.right+this.left)/2,a=(this.top+this.bottom)/2;let s=i-e,r=i+e,o=a+n,c=a-n;if(this.view!==null&&this.view.enabled){const u=(this.right-this.left)/this.view.fullWidth/this.zoom,h=(this.top-this.bottom)/this.view.fullHeight/this.zoom;s+=u*this.view.offsetX,r=s+u*this.view.width,o-=h*this.view.offsetY,c=o-h*this.view.height}this.projectionMatrix.makeOrthographic(s,r,o,c,this.near,this.far,this.coordinateSystem,this.reversedDepth),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const n=super.toJSON(e);return n.object.zoom=this.zoom,n.object.left=this.left,n.object.right=this.right,n.object.top=this.top,n.object.bottom=this.bottom,n.object.near=this.near,n.object.far=this.far,this.view!==null&&(n.object.view=Object.assign({},this.view)),n}}class C0e extends N6{constructor(){super(new px(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class nG extends mh{constructor(e,n){super(e,n),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(Jn.DEFAULT_UP),this.updateMatrix(),this.target=new Jn,this.shadow=new C0e}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class iG extends mh{constructor(e,n){super(e,n),this.isAmbientLight=!0,this.type="AmbientLight"}}class aG extends mh{constructor(e,n,i=10,a=10){super(e,n),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=i,this.height=a}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const n=super.toJSON(e);return n.object.width=this.width,n.object.height=this.height,n}}class sG{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new fe)}set(e){for(let n=0;n<9;n++)this.coefficients[n].copy(e[n]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,n){const i=e.x,a=e.y,s=e.z,r=this.coefficients;return n.copy(r[0]).multiplyScalar(.282095),n.addScaledVector(r[1],.488603*a),n.addScaledVector(r[2],.488603*s),n.addScaledVector(r[3],.488603*i),n.addScaledVector(r[4],1.092548*(i*a)),n.addScaledVector(r[5],1.092548*(a*s)),n.addScaledVector(r[6],.315392*(3*s*s-1)),n.addScaledVector(r[7],1.092548*(i*s)),n.addScaledVector(r[8],.546274*(i*i-a*a)),n}getIrradianceAt(e,n){const i=e.x,a=e.y,s=e.z,r=this.coefficients;return n.copy(r[0]).multiplyScalar(.886227),n.addScaledVector(r[1],2*.511664*a),n.addScaledVector(r[2],2*.511664*s),n.addScaledVector(r[3],2*.511664*i),n.addScaledVector(r[4],2*.429043*i*a),n.addScaledVector(r[5],2*.429043*a*s),n.addScaledVector(r[6],.743125*s*s-.247708),n.addScaledVector(r[7],2*.429043*i*s),n.addScaledVector(r[8],.429043*(i*i-a*a)),n}add(e){for(let n=0;n<9;n++)this.coefficients[n].add(e.coefficients[n]);return this}addScaledSH(e,n){for(let i=0;i<9;i++)this.coefficients[i].addScaledVector(e.coefficients[i],n);return this}scale(e){for(let n=0;n<9;n++)this.coefficients[n].multiplyScalar(e);return this}lerp(e,n){for(let i=0;i<9;i++)this.coefficients[i].lerp(e.coefficients[i],n);return this}equals(e){for(let n=0;n<9;n++)if(!this.coefficients[n].equals(e.coefficients[n]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,n=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].fromArray(e,n+a*3);return this}toArray(e=[],n=0){const i=this.coefficients;for(let a=0;a<9;a++)i[a].toArray(e,n+a*3);return e}static getBasisAt(e,n){const i=e.x,a=e.y,s=e.z;n[0]=.282095,n[1]=.488603*a,n[2]=.488603*s,n[3]=.488603*i,n[4]=1.092548*i*a,n[5]=1.092548*a*s,n[6]=.315392*(3*s*s-1),n[7]=1.092548*i*s,n[8]=.546274*(i*i-a*a)}}class rG extends mh{constructor(e=new sG,n=1){super(void 0,n),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const n=super.toJSON(e);return n.object.sh=this.sh.toArray(),n}}class t4 extends _o{constructor(e){super(e),this.textures={}}load(e,n,i,a){const s=this,r=new Cd(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(c){a?a(c):console.error(c),s.manager.itemError(e)}},i,a)}parse(e){const n=this.textures;function i(s){return n[s]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",s),n[s]}const a=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(a.uuid=e.uuid),e.name!==void 0&&(a.name=e.name),e.color!==void 0&&a.color!==void 0&&a.color.setHex(e.color),e.roughness!==void 0&&(a.roughness=e.roughness),e.metalness!==void 0&&(a.metalness=e.metalness),e.sheen!==void 0&&(a.sheen=e.sheen),e.sheenColor!==void 0&&(a.sheenColor=new Wt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(a.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&a.emissive!==void 0&&a.emissive.setHex(e.emissive),e.specular!==void 0&&a.specular!==void 0&&a.specular.setHex(e.specular),e.specularIntensity!==void 0&&(a.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&a.specularColor!==void 0&&a.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(a.shininess=e.shininess),e.clearcoat!==void 0&&(a.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(a.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(a.dispersion=e.dispersion),e.iridescence!==void 0&&(a.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(a.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(a.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(a.transmission=e.transmission),e.thickness!==void 0&&(a.thickness=e.thickness),e.attenuationDistance!==void 0&&(a.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&a.attenuationColor!==void 0&&a.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(a.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(a.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(a.fog=e.fog),e.flatShading!==void 0&&(a.flatShading=e.flatShading),e.blending!==void 0&&(a.blending=e.blending),e.combine!==void 0&&(a.combine=e.combine),e.side!==void 0&&(a.side=e.side),e.shadowSide!==void 0&&(a.shadowSide=e.shadowSide),e.opacity!==void 0&&(a.opacity=e.opacity),e.transparent!==void 0&&(a.transparent=e.transparent),e.alphaTest!==void 0&&(a.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(a.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(a.depthFunc=e.depthFunc),e.depthTest!==void 0&&(a.depthTest=e.depthTest),e.depthWrite!==void 0&&(a.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(a.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(a.blendSrc=e.blendSrc),e.blendDst!==void 0&&(a.blendDst=e.blendDst),e.blendEquation!==void 0&&(a.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(a.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(a.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(a.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&a.blendColor!==void 0&&a.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(a.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(a.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(a.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(a.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(a.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(a.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(a.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(a.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(a.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(a.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(a.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(a.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(a.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(a.rotation=e.rotation),e.linewidth!==void 0&&(a.linewidth=e.linewidth),e.dashSize!==void 0&&(a.dashSize=e.dashSize),e.gapSize!==void 0&&(a.gapSize=e.gapSize),e.scale!==void 0&&(a.scale=e.scale),e.polygonOffset!==void 0&&(a.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(a.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(a.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(a.dithering=e.dithering),e.alphaToCoverage!==void 0&&(a.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(a.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(a.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(a.visible=e.visible),e.toneMapped!==void 0&&(a.toneMapped=e.toneMapped),e.userData!==void 0&&(a.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?a.vertexColors=e.vertexColors>0:a.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const s in e.uniforms){const r=e.uniforms[s];switch(a.uniforms[s]={},r.type){case"t":a.uniforms[s].value=i(r.value);break;case"c":a.uniforms[s].value=new Wt().setHex(r.value);break;case"v2":a.uniforms[s].value=new _t().fromArray(r.value);break;case"v3":a.uniforms[s].value=new fe().fromArray(r.value);break;case"v4":a.uniforms[s].value=new xi().fromArray(r.value);break;case"m3":a.uniforms[s].value=new jn().fromArray(r.value);break;case"m4":a.uniforms[s].value=new wn().fromArray(r.value);break;default:a.uniforms[s].value=r.value}}if(e.defines!==void 0&&(a.defines=e.defines),e.vertexShader!==void 0&&(a.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(a.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(a.glslVersion=e.glslVersion),e.extensions!==void 0)for(const s in e.extensions)a.extensions[s]=e.extensions[s];if(e.lights!==void 0&&(a.lights=e.lights),e.clipping!==void 0&&(a.clipping=e.clipping),e.size!==void 0&&(a.size=e.size),e.sizeAttenuation!==void 0&&(a.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(a.map=i(e.map)),e.matcap!==void 0&&(a.matcap=i(e.matcap)),e.alphaMap!==void 0&&(a.alphaMap=i(e.alphaMap)),e.bumpMap!==void 0&&(a.bumpMap=i(e.bumpMap)),e.bumpScale!==void 0&&(a.bumpScale=e.bumpScale),e.normalMap!==void 0&&(a.normalMap=i(e.normalMap)),e.normalMapType!==void 0&&(a.normalMapType=e.normalMapType),e.normalScale!==void 0){let s=e.normalScale;Array.isArray(s)===!1&&(s=[s,s]),a.normalScale=new _t().fromArray(s)}return e.displacementMap!==void 0&&(a.displacementMap=i(e.displacementMap)),e.displacementScale!==void 0&&(a.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(a.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(a.roughnessMap=i(e.roughnessMap)),e.metalnessMap!==void 0&&(a.metalnessMap=i(e.metalnessMap)),e.emissiveMap!==void 0&&(a.emissiveMap=i(e.emissiveMap)),e.emissiveIntensity!==void 0&&(a.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(a.specularMap=i(e.specularMap)),e.specularIntensityMap!==void 0&&(a.specularIntensityMap=i(e.specularIntensityMap)),e.specularColorMap!==void 0&&(a.specularColorMap=i(e.specularColorMap)),e.envMap!==void 0&&(a.envMap=i(e.envMap)),e.envMapRotation!==void 0&&a.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(a.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(a.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(a.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(a.lightMap=i(e.lightMap)),e.lightMapIntensity!==void 0&&(a.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(a.aoMap=i(e.aoMap)),e.aoMapIntensity!==void 0&&(a.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(a.gradientMap=i(e.gradientMap)),e.clearcoatMap!==void 0&&(a.clearcoatMap=i(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(a.clearcoatRoughnessMap=i(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(a.clearcoatNormalMap=i(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(a.clearcoatNormalScale=new _t().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(a.iridescenceMap=i(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(a.iridescenceThicknessMap=i(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(a.transmissionMap=i(e.transmissionMap)),e.thicknessMap!==void 0&&(a.thicknessMap=i(e.thicknessMap)),e.anisotropyMap!==void 0&&(a.anisotropyMap=i(e.anisotropyMap)),e.sheenColorMap!==void 0&&(a.sheenColorMap=i(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(a.sheenRoughnessMap=i(e.sheenRoughnessMap)),a}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return t4.createMaterialFromType(e)}static createMaterialFromType(e){const n={ShadowMaterial:U$,SpriteMaterial:h6,RawShaderMaterial:j$,ShaderMaterial:pc,PointsMaterial:m6,MeshPhysicalMaterial:F$,MeshStandardMaterial:w6,MeshPhongMaterial:V$,MeshToonMaterial:k$,MeshNormalMaterial:H$,MeshLambertMaterial:$$,MeshDepthMaterial:E6,MeshDistanceMaterial:M6,MeshBasicMaterial:Eu,MeshMatcapMaterial:G$,LineDashedMaterial:W$,LineBasicMaterial:xr,Material:br};return new n[e]}}class j5{static extractUrlBase(e){const n=e.lastIndexOf("/");return n===-1?"./":e.slice(0,n+1)}static resolveURL(e,n){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(n)&&/^\//.test(e)&&(n=n.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:n+e)}}class oG extends Pn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class lG extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=new Cd(s.manager);r.setPath(s.path),r.setRequestHeader(s.requestHeader),r.setWithCredentials(s.withCredentials),r.load(e,function(o){try{n(s.parse(JSON.parse(o)))}catch(c){a?a(c):console.error(c),s.manager.itemError(e)}},i,a)}parse(e){const n={},i={};function a(g,b){if(n[b]!==void 0)return n[b];const x=g.interleavedBuffers[b],S=s(g,x.buffer),M=yg(x.type,S),C=new Uw(M,x.stride);return C.uuid=x.uuid,n[b]=C,C}function s(g,b){if(i[b]!==void 0)return i[b];const x=g.arrayBuffers[b],S=new Uint32Array(x).buffer;return i[b]=S,S}const r=e.isInstancedBufferGeometry?new oG:new Pn,o=e.data.index;if(o!==void 0){const g=yg(o.type,o.array);r.setIndex(new $i(g,1))}const c=e.data.attributes;for(const g in c){const b=c[g];let w;if(b.isInterleavedBufferAttribute){const x=a(e.data,b.data);w=new im(x,b.itemSize,b.offset,b.normalized)}else{const x=yg(b.type,b.array),S=b.isInstancedBufferAttribute?Kg:$i;w=new S(x,b.itemSize,b.normalized)}b.name!==void 0&&(w.name=b.name),b.usage!==void 0&&w.setUsage(b.usage),r.setAttribute(g,w)}const u=e.data.morphAttributes;if(u)for(const g in u){const b=u[g],w=[];for(let x=0,S=b.length;x<S;x++){const M=b[x];let C;if(M.isInterleavedBufferAttribute){const A=a(e.data,M.data);C=new im(A,M.itemSize,M.offset,M.normalized)}else{const A=yg(M.type,M.array);C=new $i(A,M.itemSize,M.normalized)}M.name!==void 0&&(C.name=M.name),w.push(C)}r.morphAttributes[g]=w}e.data.morphTargetsRelative&&(r.morphTargetsRelative=!0);const d=e.data.groups||e.data.drawcalls||e.data.offsets;if(d!==void 0)for(let g=0,b=d.length;g!==b;++g){const w=d[g];r.addGroup(w.start,w.count,w.materialIndex)}const p=e.data.boundingSphere;return p!==void 0&&(r.boundingSphere=new Vs().fromJSON(p)),e.name&&(r.name=e.name),e.userData&&(r.userData=e.userData),r}}class A0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=this.path===""?j5.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||r;const o=new Cd(this.manager);o.setPath(this.path),o.setRequestHeader(this.requestHeader),o.setWithCredentials(this.withCredentials),o.load(e,function(c){let u=null;try{u=JSON.parse(c)}catch(d){a!==void 0&&a(d),console.error("THREE:ObjectLoader: Can't parse "+e+".",d.message);return}const h=u.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry"){a!==void 0&&a(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}s.parse(u,n)},i,a)}async loadAsync(e,n){const i=this,a=this.path===""?j5.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||a;const s=new Cd(this.manager);s.setPath(this.path),s.setRequestHeader(this.requestHeader),s.setWithCredentials(this.withCredentials);const r=await s.loadAsync(e,n),o=JSON.parse(r),c=o.metadata;if(c===void 0||c.type===void 0||c.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await i.parseAsync(o)}parse(e,n){const i=this.parseAnimations(e.animations),a=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,a),r=this.parseImages(e.images,function(){n!==void 0&&n(u)}),o=this.parseTextures(e.textures,r),c=this.parseMaterials(e.materials,o),u=this.parseObject(e.object,s,c,o,i),h=this.parseSkeletons(e.skeletons,u);if(this.bindSkeletons(u,h),this.bindLightTargets(u),n!==void 0){let d=!1;for(const p in r)if(r[p].data instanceof HTMLImageElement){d=!0;break}d===!1&&n(u)}return u}async parseAsync(e){const n=this.parseAnimations(e.animations),i=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,i),s=await this.parseImagesAsync(e.images),r=this.parseTextures(e.textures,s),o=this.parseMaterials(e.materials,r),c=this.parseObject(e.object,a,o,r,n),u=this.parseSkeletons(e.skeletons,c);return this.bindSkeletons(c,u),this.bindLightTargets(c),c}parseShapes(e){const n={};if(e!==void 0)for(let i=0,a=e.length;i<a;i++){const s=new Xp().fromJSON(e[i]);n[s.uuid]=s}return n}parseSkeletons(e,n){const i={},a={};if(n.traverse(function(s){s.isBone&&(a[s.uuid]=s)}),e!==void 0)for(let s=0,r=e.length;s<r;s++){const o=new jw().fromJSON(e[s],a);i[o.uuid]=o}return i}parseGeometries(e,n){const i={};if(e!==void 0){const a=new lG;for(let s=0,r=e.length;s<r;s++){let o;const c=e[s];switch(c.type){case"BufferGeometry":case"InstancedBufferGeometry":o=a.parse(c);break;default:c.type in EL?o=EL[c.type].fromJSON(c,n):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${c.type}"`)}o.uuid=c.uuid,c.name!==void 0&&(o.name=c.name),c.userData!==void 0&&(o.userData=c.userData),i[c.uuid]=o}}return i}parseMaterials(e,n){const i={},a={};if(e!==void 0){const s=new t4;s.setTextures(n);for(let r=0,o=e.length;r<o;r++){const c=e[r];i[c.uuid]===void 0&&(i[c.uuid]=s.parse(c)),a[c.uuid]=i[c.uuid]}}return a}parseAnimations(e){const n={};if(e!==void 0)for(let i=0;i<e.length;i++){const a=e[i],s=z1.parse(a);n[s.uuid]=s}return n}parseImages(e,n){const i=this,a={};let s;function r(c){return i.manager.itemStart(c),s.load(c,function(){i.manager.itemEnd(c)},void 0,function(){i.manager.itemError(c),i.manager.itemEnd(c)})}function o(c){if(typeof c=="string"){const u=c,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:i.resourcePath+u;return r(h)}else return c.data?{data:yg(c.type,c.data),width:c.width,height:c.height}:null}if(e!==void 0&&e.length>0){const c=new R6(n);s=new B1(c),s.setCrossOrigin(this.crossOrigin);for(let u=0,h=e.length;u<h;u++){const d=e[u],p=d.url;if(Array.isArray(p)){const g=[];for(let b=0,w=p.length;b<w;b++){const x=p[b],S=o(x);S!==null&&(S instanceof HTMLImageElement?g.push(S):g.push(new gu(S.data,S.width,S.height)))}a[d.uuid]=new Uf(g)}else{const g=o(d.url);a[d.uuid]=new Uf(g)}}}return a}async parseImagesAsync(e){const n=this,i={};let a;async function s(r){if(typeof r=="string"){const o=r,c=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(o)?o:n.resourcePath+o;return await a.loadAsync(c)}else return r.data?{data:yg(r.type,r.data),width:r.width,height:r.height}:null}if(e!==void 0&&e.length>0){a=new B1(this.manager),a.setCrossOrigin(this.crossOrigin);for(let r=0,o=e.length;r<o;r++){const c=e[r],u=c.url;if(Array.isArray(u)){const h=[];for(let d=0,p=u.length;d<p;d++){const g=u[d],b=await s(g);b!==null&&(b instanceof HTMLImageElement?h.push(b):h.push(new gu(b.data,b.width,b.height)))}i[c.uuid]=new Uf(h)}else{const h=await s(c.url);i[c.uuid]=new Uf(h)}}}return i}parseTextures(e,n){function i(s,r){return typeof s=="number"?s:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",s),r[s])}const a={};if(e!==void 0)for(let s=0,r=e.length;s<r;s++){const o=e[s];o.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',o.uuid),n[o.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",o.image);const c=n[o.image],u=c.data;let h;Array.isArray(u)?(h=new ux,u.length===6&&(h.needsUpdate=!0)):(u&&u.data?h=new gu:h=new Na,u&&(h.needsUpdate=!0)),h.source=c,h.uuid=o.uuid,o.name!==void 0&&(h.name=o.name),o.mapping!==void 0&&(h.mapping=i(o.mapping,R0e)),o.channel!==void 0&&(h.channel=o.channel),o.offset!==void 0&&h.offset.fromArray(o.offset),o.repeat!==void 0&&h.repeat.fromArray(o.repeat),o.center!==void 0&&h.center.fromArray(o.center),o.rotation!==void 0&&(h.rotation=o.rotation),o.wrap!==void 0&&(h.wrapS=i(o.wrap[0],AL),h.wrapT=i(o.wrap[1],AL)),o.format!==void 0&&(h.format=o.format),o.internalFormat!==void 0&&(h.internalFormat=o.internalFormat),o.type!==void 0&&(h.type=o.type),o.colorSpace!==void 0&&(h.colorSpace=o.colorSpace),o.minFilter!==void 0&&(h.minFilter=i(o.minFilter,RL)),o.magFilter!==void 0&&(h.magFilter=i(o.magFilter,RL)),o.anisotropy!==void 0&&(h.anisotropy=o.anisotropy),o.flipY!==void 0&&(h.flipY=o.flipY),o.generateMipmaps!==void 0&&(h.generateMipmaps=o.generateMipmaps),o.premultiplyAlpha!==void 0&&(h.premultiplyAlpha=o.premultiplyAlpha),o.unpackAlignment!==void 0&&(h.unpackAlignment=o.unpackAlignment),o.compareFunction!==void 0&&(h.compareFunction=o.compareFunction),o.userData!==void 0&&(h.userData=o.userData),a[o.uuid]=h}return a}parseObject(e,n,i,a,s){let r;function o(p){return n[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",p),n[p]}function c(p){if(p!==void 0){if(Array.isArray(p)){const g=[];for(let b=0,w=p.length;b<w;b++){const x=p[b];i[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),g.push(i[x])}return g}return i[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",p),i[p]}}function u(p){return a[p]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",p),a[p]}let h,d;switch(e.type){case"Scene":r=new f6,e.background!==void 0&&(Number.isInteger(e.background)?r.background=new Wt(e.background):r.background=u(e.background)),e.environment!==void 0&&(r.environment=u(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?r.fog=new Bw(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(r.fog=new zw(e.fog.color,e.fog.density)),e.fog.name!==""&&(r.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(r.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(r.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&r.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(r.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&r.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":r=new Ms(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(r.focus=e.focus),e.zoom!==void 0&&(r.zoom=e.zoom),e.filmGauge!==void 0&&(r.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(r.filmOffset=e.filmOffset),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"OrthographicCamera":r=new px(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(r.zoom=e.zoom),e.view!==void 0&&(r.view=Object.assign({},e.view));break;case"AmbientLight":r=new iG(e.color,e.intensity);break;case"DirectionalLight":r=new nG(e.color,e.intensity),r.target=e.target||"";break;case"PointLight":r=new tG(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":r=new aG(e.color,e.intensity,e.width,e.height);break;case"SpotLight":r=new eG(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),r.target=e.target||"";break;case"HemisphereLight":r=new J$(e.color,e.groundColor,e.intensity);break;case"LightProbe":r=new rG().fromJSON(e);break;case"SkinnedMesh":h=o(e.geometry),d=c(e.material),r=new _$(h,d),e.bindMode!==void 0&&(r.bindMode=e.bindMode),e.bindMatrix!==void 0&&r.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(r.skeleton=e.skeleton);break;case"Mesh":h=o(e.geometry),d=c(e.material),r=new Qt(h,d);break;case"InstancedMesh":h=o(e.geometry),d=c(e.material);const p=e.count,g=e.instanceMatrix,b=e.instanceColor;r=new S$(h,d,p),r.instanceMatrix=new Kg(new Float32Array(g.array),16),b!==void 0&&(r.instanceColor=new Kg(new Float32Array(b.array),b.itemSize));break;case"BatchedMesh":h=o(e.geometry),d=c(e.material),r=new w$(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,d),r.geometry=h,r.perObjectFrustumCulled=e.perObjectFrustumCulled,r.sortObjects=e.sortObjects,r._drawRanges=e.drawRanges,r._reservedRanges=e.reservedRanges,r._geometryInfo=e.geometryInfo.map(w=>{let x=null,S=null;return w.boundingBox!==void 0&&(x=new mr().fromJSON(w.boundingBox)),w.boundingSphere!==void 0&&(S=new Vs().fromJSON(w.boundingSphere)),{...w,boundingBox:x,boundingSphere:S}}),r._instanceInfo=e.instanceInfo,r._availableInstanceIds=e._availableInstanceIds,r._availableGeometryIds=e._availableGeometryIds,r._nextIndexStart=e.nextIndexStart,r._nextVertexStart=e.nextVertexStart,r._geometryCount=e.geometryCount,r._maxInstanceCount=e.maxInstanceCount,r._maxVertexCount=e.maxVertexCount,r._maxIndexCount=e.maxIndexCount,r._geometryInitialized=e.geometryInitialized,r._matricesTexture=u(e.matricesTexture.uuid),r._indirectTexture=u(e.indirectTexture.uuid),e.colorsTexture!==void 0&&(r._colorsTexture=u(e.colorsTexture.uuid)),e.boundingSphere!==void 0&&(r.boundingSphere=new Vs().fromJSON(e.boundingSphere)),e.boundingBox!==void 0&&(r.boundingBox=new mr().fromJSON(e.boundingBox));break;case"LOD":r=new x$;break;case"Line":r=new qn(o(e.geometry),c(e.material));break;case"LineLoop":r=new E$(o(e.geometry),c(e.material));break;case"LineSegments":r=new Mu(o(e.geometry),c(e.material));break;case"PointCloud":case"Points":r=new M$(o(e.geometry),c(e.material));break;case"Sprite":r=new b$(c(e.material));break;case"Group":r=new bg;break;case"Bone":r=new p6;break;default:r=new Jn}if(r.uuid=e.uuid,e.name!==void 0&&(r.name=e.name),e.matrix!==void 0?(r.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(r.matrixAutoUpdate=e.matrixAutoUpdate),r.matrixAutoUpdate&&r.matrix.decompose(r.position,r.quaternion,r.scale)):(e.position!==void 0&&r.position.fromArray(e.position),e.rotation!==void 0&&r.rotation.fromArray(e.rotation),e.quaternion!==void 0&&r.quaternion.fromArray(e.quaternion),e.scale!==void 0&&r.scale.fromArray(e.scale)),e.up!==void 0&&r.up.fromArray(e.up),e.castShadow!==void 0&&(r.castShadow=e.castShadow),e.receiveShadow!==void 0&&(r.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(r.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(r.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(r.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(r.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&r.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(r.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(r.visible=e.visible),e.frustumCulled!==void 0&&(r.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(r.renderOrder=e.renderOrder),e.userData!==void 0&&(r.userData=e.userData),e.layers!==void 0&&(r.layers.mask=e.layers),e.children!==void 0){const p=e.children;for(let g=0;g<p.length;g++)r.add(this.parseObject(p[g],n,i,a,s))}if(e.animations!==void 0){const p=e.animations;for(let g=0;g<p.length;g++){const b=p[g];r.animations.push(s[b])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(r.autoUpdate=e.autoUpdate);const p=e.levels;for(let g=0;g<p.length;g++){const b=p[g],w=r.getObjectByProperty("uuid",b.object);w!==void 0&&r.addLevel(w,b.distance,b.hysteresis)}}return r}bindSkeletons(e,n){Object.keys(n).length!==0&&e.traverse(function(i){if(i.isSkinnedMesh===!0&&i.skeleton!==void 0){const a=n[i.skeleton];a===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",i.skeleton):i.bind(a,i.bindMatrix)}})}bindLightTargets(e){e.traverse(function(n){if(n.isDirectionalLight||n.isSpotLight){const i=n.target,a=e.getObjectByProperty("uuid",i);a!==void 0?n.target=a:n.target=new Jn}})}}const R0e={UVMapping:Mw,CubeReflectionMapping:Md,CubeRefractionMapping:Jf,EquirectangularReflectionMapping:_1,EquirectangularRefractionMapping:S1,CubeUVReflectionMapping:cv},AL={RepeatWrapping:w1,ClampToEdgeWrapping:El,MirroredRepeatWrapping:E1},RL={NearestFilter:Fs,NearestMipmapNearestFilter:QA,NearestMipmapLinearFilter:vg,LinearFilter:ja,LinearMipmapNearestFilter:zb,LinearMipmapLinearFilter:cu},BM=new WeakMap;class N0e extends _o{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"},this._abortController=new AbortController}setOptions(e){return this.options=e,this}load(e,n,i,a){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const s=this,r=uu.get(`image-bitmap:${e}`);if(r!==void 0){if(s.manager.itemStart(e),r.then){r.then(u=>{if(BM.has(r)===!0)a&&a(BM.get(r)),s.manager.itemError(e),s.manager.itemEnd(e);else return n&&n(u),s.manager.itemEnd(e),u});return}return setTimeout(function(){n&&n(r),s.manager.itemEnd(e)},0),r}const o={};o.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",o.headers=this.requestHeader,o.signal=typeof AbortSignal.any=="function"?AbortSignal.any([this._abortController.signal,this.manager.abortController.signal]):this._abortController.signal;const c=fetch(e,o).then(function(u){return u.blob()}).then(function(u){return createImageBitmap(u,Object.assign(s.options,{colorSpaceConversion:"none"}))}).then(function(u){return uu.add(`image-bitmap:${e}`,u),n&&n(u),s.manager.itemEnd(e),u}).catch(function(u){a&&a(u),BM.set(c,u),uu.remove(`image-bitmap:${e}`),s.manager.itemError(e),s.manager.itemEnd(e)});uu.add(`image-bitmap:${e}`,c),s.manager.itemStart(e)}abort(){return this._abortController.abort(),this._abortController=new AbortController,this}}let $_,P6=class{static getContext(){return $_===void 0&&($_=new(window.AudioContext||window.webkitAudioContext)),$_}static setContext(e){$_=e}};class P0e extends _o{constructor(e){super(e)}load(e,n,i,a){const s=this,r=new Cd(this.manager);r.setResponseType("arraybuffer"),r.setPath(this.path),r.setRequestHeader(this.requestHeader),r.setWithCredentials(this.withCredentials),r.load(e,function(c){try{const u=c.slice(0);P6.getContext().decodeAudioData(u,function(d){n(d)}).catch(o)}catch(u){o(u)}},i,a);function o(c){a?a(c):console.error(c),s.manager.itemError(e)}}}const NL=new wn,PL=new wn,yp=new wn;class D0e{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ms,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ms,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const n=this._cache;if(n.focus!==e.focus||n.fov!==e.fov||n.aspect!==e.aspect*this.aspect||n.near!==e.near||n.far!==e.far||n.zoom!==e.zoom||n.eyeSep!==this.eyeSep){n.focus=e.focus,n.fov=e.fov,n.aspect=e.aspect*this.aspect,n.near=e.near,n.far=e.far,n.zoom=e.zoom,n.eyeSep=this.eyeSep,yp.copy(e.projectionMatrix);const a=n.eyeSep/2,s=a*n.near/n.focus,r=n.near*Math.tan(Kp*n.fov*.5)/n.zoom;let o,c;PL.elements[12]=-a,NL.elements[12]=a,o=-r*n.aspect+s,c=r*n.aspect+s,yp.elements[0]=2*n.near/(c-o),yp.elements[8]=(c+o)/(c-o),this.cameraL.projectionMatrix.copy(yp),o=-r*n.aspect-s,c=r*n.aspect-s,yp.elements[0]=2*n.near/(c-o),yp.elements[8]=(c+o)/(c-o),this.cameraR.projectionMatrix.copy(yp)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply(PL),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(NL)}}class cG extends Ms{constructor(e=[]){super(),this.isArrayCamera=!0,this.isMultiViewCamera=!1,this.cameras=e}}class D6{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=performance.now(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const n=performance.now();e=(n-this.oldTime)/1e3,this.oldTime=n,this.elapsedTime+=e}return e}}const bp=new fe,UM=new Li,L0e=new fe,xp=new fe,_p=new fe;class O0e extends Jn{constructor(){super(),this.type="AudioListener",this.context=P6.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new D6}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const n=this.context.listener;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(bp,UM,L0e),xp.set(0,0,-1).applyQuaternion(UM),_p.set(0,1,0).applyQuaternion(UM),n.positionX){const i=this.context.currentTime+this.timeDelta;n.positionX.linearRampToValueAtTime(bp.x,i),n.positionY.linearRampToValueAtTime(bp.y,i),n.positionZ.linearRampToValueAtTime(bp.z,i),n.forwardX.linearRampToValueAtTime(xp.x,i),n.forwardY.linearRampToValueAtTime(xp.y,i),n.forwardZ.linearRampToValueAtTime(xp.z,i),n.upX.linearRampToValueAtTime(_p.x,i),n.upY.linearRampToValueAtTime(_p.y,i),n.upZ.linearRampToValueAtTime(_p.z,i)}else n.setPosition(bp.x,bp.y,bp.z),n.setOrientation(xp.x,xp.y,xp.z,_p.x,_p.y,_p.z)}}let uG=class extends Jn{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const n=this.context.createBufferSource();return n.buffer=this.buffer,n.loop=this.loop,n.loopStart=this.loopStart,n.loopEnd=this.loopEnd,n.onended=this.onEnded.bind(this),n.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=n,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,n=this.filters.length;e<n;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,n){return super.copy(e,n),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}};const Sp=new fe,DL=new Li,I0e=new fe,wp=new fe;class z0e extends uG{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,n,i){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=n,this.panner.coneOuterGain=i,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(Sp,DL,I0e),wp.set(0,0,1).applyQuaternion(DL);const n=this.panner;if(n.positionX){const i=this.context.currentTime+this.listener.timeDelta;n.positionX.linearRampToValueAtTime(Sp.x,i),n.positionY.linearRampToValueAtTime(Sp.y,i),n.positionZ.linearRampToValueAtTime(Sp.z,i),n.orientationX.linearRampToValueAtTime(wp.x,i),n.orientationY.linearRampToValueAtTime(wp.y,i),n.orientationZ.linearRampToValueAtTime(wp.z,i)}else n.setPosition(Sp.x,Sp.y,Sp.z),n.setOrientation(wp.x,wp.y,wp.z)}}class B0e{constructor(e,n=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=n,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const n=this.getFrequencyData();for(let i=0;i<n.length;i++)e+=n[i];return e/n.length}}class dG{constructor(e,n,i){this.binding=e,this.valueSize=i;let a,s,r;switch(n){case"quaternion":a=this._slerp,s=this._slerpAdditive,r=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(i*6),this._workIndex=5;break;case"string":case"bool":a=this._select,s=this._select,r=this._setAdditiveIdentityOther,this.buffer=new Array(i*5);break;default:a=this._lerp,s=this._lerpAdditive,r=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(i*5)}this._mixBufferRegion=a,this._mixBufferRegionAdditive=s,this._setIdentity=r,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,n){const i=this.buffer,a=this.valueSize,s=e*a+a;let r=this.cumulativeWeight;if(r===0){for(let o=0;o!==a;++o)i[s+o]=i[o];r=n}else{r+=n;const o=n/r;this._mixBufferRegion(i,s,0,o,a)}this.cumulativeWeight=r}accumulateAdditive(e){const n=this.buffer,i=this.valueSize,a=i*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(n,a,0,e,i),this.cumulativeWeightAdditive+=e}apply(e){const n=this.valueSize,i=this.buffer,a=e*n+n,s=this.cumulativeWeight,r=this.cumulativeWeightAdditive,o=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,s<1){const c=n*this._origIndex;this._mixBufferRegion(i,a,c,1-s,n)}r>0&&this._mixBufferRegionAdditive(i,a,this._addIndex*n,1,n);for(let c=n,u=n+n;c!==u;++c)if(i[c]!==i[c+n]){o.setValue(i,a);break}}saveOriginalState(){const e=this.binding,n=this.buffer,i=this.valueSize,a=i*this._origIndex;e.getValue(n,a);for(let s=i,r=a;s!==r;++s)n[s]=n[a+s%i];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,n=e+this.valueSize;for(let i=e;i<n;i++)this.buffer[i]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,n=this._addIndex*this.valueSize;for(let i=0;i<this.valueSize;i++)this.buffer[n+i]=this.buffer[e+i]}_select(e,n,i,a,s){if(a>=.5)for(let r=0;r!==s;++r)e[n+r]=e[i+r]}_slerp(e,n,i,a){Li.slerpFlat(e,n,e,n,e,i,a)}_slerpAdditive(e,n,i,a,s){const r=this._workIndex*s;Li.multiplyQuaternionsFlat(e,r,e,n,e,i),Li.slerpFlat(e,n,e,n,e,r,a)}_lerp(e,n,i,a,s){const r=1-a;for(let o=0;o!==s;++o){const c=n+o;e[c]=e[c]*r+e[i+o]*a}}_lerpAdditive(e,n,i,a,s){for(let r=0;r!==s;++r){const o=n+r;e[o]=e[o]+e[i+r]*a}}}const L6="\\[\\]\\.:\\/",U0e=new RegExp("["+L6+"]","g"),O6="[^"+L6+"]",j0e="[^"+L6.replace("\\.","")+"]",F0e=/((?:WC+[\/:])*)/.source.replace("WC",O6),V0e=/(WCOD+)?/.source.replace("WCOD",j0e),k0e=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",O6),H0e=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",O6),$0e=new RegExp("^"+F0e+V0e+k0e+H0e+"$"),G0e=["material","materials","bones","map"];class W0e{constructor(e,n,i){const a=i||bi.parseTrackName(n);this._targetGroup=e,this._bindings=e.subscribe_(n,a)}getValue(e,n){this.bind();const i=this._targetGroup.nCachedObjects_,a=this._bindings[i];a!==void 0&&a.getValue(e,n)}setValue(e,n){const i=this._bindings;for(let a=this._targetGroup.nCachedObjects_,s=i.length;a!==s;++a)i[a].setValue(e,n)}bind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].bind()}unbind(){const e=this._bindings;for(let n=this._targetGroup.nCachedObjects_,i=e.length;n!==i;++n)e[n].unbind()}}class bi{constructor(e,n,i){this.path=n,this.parsedPath=i||bi.parseTrackName(n),this.node=bi.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,n,i){return e&&e.isAnimationObjectGroup?new bi.Composite(e,n,i):new bi(e,n,i)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace(U0e,"")}static parseTrackName(e){const n=$0e.exec(e);if(n===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const i={nodeName:n[2],objectName:n[3],objectIndex:n[4],propertyName:n[5],propertyIndex:n[6]},a=i.nodeName&&i.nodeName.lastIndexOf(".");if(a!==void 0&&a!==-1){const s=i.nodeName.substring(a+1);G0e.indexOf(s)!==-1&&(i.nodeName=i.nodeName.substring(0,a),i.objectName=s)}if(i.propertyName===null||i.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return i}static findNode(e,n){if(n===void 0||n===""||n==="."||n===-1||n===e.name||n===e.uuid)return e;if(e.skeleton){const i=e.skeleton.getBoneByName(n);if(i!==void 0)return i}if(e.children){const i=function(s){for(let r=0;r<s.length;r++){const o=s[r];if(o.name===n||o.uuid===n)return o;const c=i(o.children);if(c)return c}return null},a=i(e.children);if(a)return a}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,n){e[n]=this.targetObject[this.propertyName]}_getValue_array(e,n){const i=this.resolvedProperty;for(let a=0,s=i.length;a!==s;++a)e[n++]=i[a]}_getValue_arrayElement(e,n){e[n]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,n){this.resolvedProperty.toArray(e,n)}_setValue_direct(e,n){this.targetObject[this.propertyName]=e[n]}_setValue_direct_setNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,n){this.targetObject[this.propertyName]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,n){const i=this.resolvedProperty;for(let a=0,s=i.length;a!==s;++a)i[a]=e[n++]}_setValue_array_setNeedsUpdate(e,n){const i=this.resolvedProperty;for(let a=0,s=i.length;a!==s;++a)i[a]=e[n++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,n){const i=this.resolvedProperty;for(let a=0,s=i.length;a!==s;++a)i[a]=e[n++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,n){this.resolvedProperty[this.propertyIndex]=e[n]}_setValue_arrayElement_setNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty[this.propertyIndex]=e[n],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,n){this.resolvedProperty.fromArray(e,n)}_setValue_fromArray_setNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,n){this.resolvedProperty.fromArray(e,n),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,n){this.bind(),this.getValue(e,n)}_setValue_unbound(e,n){this.bind(),this.setValue(e,n)}bind(){let e=this.node;const n=this.parsedPath,i=n.objectName,a=n.propertyName;let s=n.propertyIndex;if(e||(e=bi.findNode(this.rootNode,n.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(i){let u=n.objectIndex;switch(i){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let h=0;h<e.length;h++)if(e[h].name===u){u=h;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[i]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[i]}if(u!==void 0){if(e[u]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[u]}}const r=e[a];if(r===void 0){const u=n.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+u+"."+a+" but it wasn't found.",e);return}let o=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?o=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(o=this.Versioning.MatrixWorldNeedsUpdate);let c=this.BindingType.Direct;if(s!==void 0){if(a==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[s]!==void 0&&(s=e.morphTargetDictionary[s])}c=this.BindingType.ArrayElement,this.resolvedProperty=r,this.propertyIndex=s}else r.fromArray!==void 0&&r.toArray!==void 0?(c=this.BindingType.HasFromToArray,this.resolvedProperty=r):Array.isArray(r)?(c=this.BindingType.EntireArray,this.resolvedProperty=r):this.propertyName=a;this.getValue=this.GetterByBindingType[c],this.setValue=this.SetterByBindingTypeAndVersioning[c][o]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}bi.Composite=W0e;bi.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};bi.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};bi.prototype.GetterByBindingType=[bi.prototype._getValue_direct,bi.prototype._getValue_array,bi.prototype._getValue_arrayElement,bi.prototype._getValue_toArray];bi.prototype.SetterByBindingTypeAndVersioning=[[bi.prototype._setValue_direct,bi.prototype._setValue_direct_setNeedsUpdate,bi.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[bi.prototype._setValue_array,bi.prototype._setValue_array_setNeedsUpdate,bi.prototype._setValue_array_setMatrixWorldNeedsUpdate],[bi.prototype._setValue_arrayElement,bi.prototype._setValue_arrayElement_setNeedsUpdate,bi.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[bi.prototype._setValue_fromArray,bi.prototype._setValue_fromArray_setNeedsUpdate,bi.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class K0e{constructor(){this.isAnimationObjectGroup=!0,this.uuid=$o(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let i=0,a=arguments.length;i!==a;++i)e[arguments[i].uuid]=i;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const n=this;this.stats={objects:{get total(){return n._objects.length},get inUse(){return this.total-n.nCachedObjects_}},get bindingsPerObject(){return n._bindings.length}}}add(){const e=this._objects,n=this._indicesByUUID,i=this._paths,a=this._parsedPaths,s=this._bindings,r=s.length;let o,c=e.length,u=this.nCachedObjects_;for(let h=0,d=arguments.length;h!==d;++h){const p=arguments[h],g=p.uuid;let b=n[g];if(b===void 0){b=c++,n[g]=b,e.push(p);for(let w=0,x=r;w!==x;++w)s[w].push(new bi(p,i[w],a[w]))}else if(b<u){o=e[b];const w=--u,x=e[w];n[x.uuid]=b,e[b]=x,n[g]=w,e[w]=p;for(let S=0,M=r;S!==M;++S){const C=s[S],A=C[w];let N=C[b];C[b]=A,N===void 0&&(N=new bi(p,i[S],a[S])),C[w]=N}}else e[b]!==o&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=u}remove(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,a=i.length;let s=this.nCachedObjects_;for(let r=0,o=arguments.length;r!==o;++r){const c=arguments[r],u=c.uuid,h=n[u];if(h!==void 0&&h>=s){const d=s++,p=e[d];n[p.uuid]=h,e[h]=p,n[u]=d,e[d]=c;for(let g=0,b=a;g!==b;++g){const w=i[g],x=w[d],S=w[h];w[h]=x,w[d]=S}}}this.nCachedObjects_=s}uncache(){const e=this._objects,n=this._indicesByUUID,i=this._bindings,a=i.length;let s=this.nCachedObjects_,r=e.length;for(let o=0,c=arguments.length;o!==c;++o){const u=arguments[o],h=u.uuid,d=n[h];if(d!==void 0)if(delete n[h],d<s){const p=--s,g=e[p],b=--r,w=e[b];n[g.uuid]=d,e[d]=g,n[w.uuid]=p,e[p]=w,e.pop();for(let x=0,S=a;x!==S;++x){const M=i[x],C=M[p],A=M[b];M[d]=C,M[p]=A,M.pop()}}else{const p=--r,g=e[p];p>0&&(n[g.uuid]=d),e[d]=g,e.pop();for(let b=0,w=a;b!==w;++b){const x=i[b];x[d]=x[p],x.pop()}}}this.nCachedObjects_=s}subscribe_(e,n){const i=this._bindingsIndicesByPath;let a=i[e];const s=this._bindings;if(a!==void 0)return s[a];const r=this._paths,o=this._parsedPaths,c=this._objects,u=c.length,h=this.nCachedObjects_,d=new Array(u);a=s.length,i[e]=a,r.push(e),o.push(n),s.push(d);for(let p=h,g=c.length;p!==g;++p){const b=c[p];d[p]=new bi(b,e,n)}return d}unsubscribe_(e){const n=this._bindingsIndicesByPath,i=n[e];if(i!==void 0){const a=this._paths,s=this._parsedPaths,r=this._bindings,o=r.length-1,c=r[o],u=e[o];n[u]=i,r[i]=c,r.pop(),s[i]=s[o],s.pop(),a[i]=a[o],a.pop()}}}class fG{constructor(e,n,i=null,a=n.blendMode){this._mixer=e,this._clip=n,this._localRoot=i,this.blendMode=a;const s=n.tracks,r=s.length,o=new Array(r),c={endingStart:jp,endingEnd:jp};for(let u=0;u!==r;++u){const h=s[u].createInterpolant(null);o[u]=h,h.settings=c}this._interpolantSettings=c,this._interpolants=o,this._propertyBindings=new Array(r),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=QH,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,n){return this.loop=e,this.repetitions=n,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,n,i=!1){if(e.fadeOut(n),this.fadeIn(n),i===!0){const a=this._clip.duration,s=e._clip.duration,r=s/a,o=a/s;e.warp(1,r,n),this.warp(o,1,n)}return this}crossFadeTo(e,n,i=!1){return e.crossFadeFrom(this,n,i)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,n,i){const a=this._mixer,s=a.time,r=this.timeScale;let o=this._timeScaleInterpolant;o===null&&(o=a._lendControlInterpolant(),this._timeScaleInterpolant=o);const c=o.parameterPositions,u=o.sampleValues;return c[0]=s,c[1]=s+i,u[0]=e/r,u[1]=n/r,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,n,i,a){if(!this.enabled){this._updateWeight(e);return}const s=this._startTime;if(s!==null){const c=(e-s)*i;c<0||i===0?n=0:(this._startTime=null,n=i*c)}n*=this._updateTimeScale(e);const r=this._updateTime(n),o=this._updateWeight(e);if(o>0){const c=this._interpolants,u=this._propertyBindings;switch(this.blendMode){case r6:for(let h=0,d=c.length;h!==d;++h)c[h].evaluate(r),u[h].accumulateAdditive(o);break;case Dw:default:for(let h=0,d=c.length;h!==d;++h)c[h].evaluate(r),u[h].accumulate(a,o)}}}_updateWeight(e){let n=0;if(this.enabled){n=this.weight;const i=this._weightInterpolant;if(i!==null){const a=i.evaluate(e)[0];n*=a,e>i.parameterPositions[1]&&(this.stopFading(),a===0&&(this.enabled=!1))}}return this._effectiveWeight=n,n}_updateTimeScale(e){let n=0;if(!this.paused){n=this.timeScale;const i=this._timeScaleInterpolant;if(i!==null){const a=i.evaluate(e)[0];n*=a,e>i.parameterPositions[1]&&(this.stopWarping(),n===0?this.paused=!0:this.timeScale=n)}}return this._effectiveTimeScale=n,n}_updateTime(e){const n=this._clip.duration,i=this.loop;let a=this.time+e,s=this._loopCount;const r=i===JH;if(e===0)return s===-1?a:r&&(s&1)===1?n-a:a;if(i===ZH){s===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(a>=n)a=n;else if(a<0)a=0;else{this.time=a;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(s===-1&&(e>=0?(s=0,this._setEndings(!0,this.repetitions===0,r)):this._setEndings(this.repetitions===0,!0,r)),a>=n||a<0){const o=Math.floor(a/n);a-=n*o,s+=Math.abs(o);const c=this.repetitions-s;if(c<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,a=e>0?n:0,this.time=a,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(c===1){const u=e<0;this._setEndings(u,!u,r)}else this._setEndings(!1,!1,r);this._loopCount=s,this.time=a,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:o})}}else this.time=a;if(r&&(s&1)===1)return n-a}return a}_setEndings(e,n,i){const a=this._interpolantSettings;i?(a.endingStart=Fp,a.endingEnd=Fp):(e?a.endingStart=this.zeroSlopeAtStart?Fp:jp:a.endingStart=T1,n?a.endingEnd=this.zeroSlopeAtEnd?Fp:jp:a.endingEnd=T1)}_scheduleFading(e,n,i){const a=this._mixer,s=a.time;let r=this._weightInterpolant;r===null&&(r=a._lendControlInterpolant(),this._weightInterpolant=r);const o=r.parameterPositions,c=r.sampleValues;return o[0]=s,c[0]=n,o[1]=s+e,c[1]=i,this}}const X0e=new Float32Array(1);class q0e extends wu{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,n){const i=e._localRoot||this._root,a=e._clip.tracks,s=a.length,r=e._propertyBindings,o=e._interpolants,c=i.uuid,u=this._bindingsByRootAndName;let h=u[c];h===void 0&&(h={},u[c]=h);for(let d=0;d!==s;++d){const p=a[d],g=p.name;let b=h[g];if(b!==void 0)++b.referenceCount,r[d]=b;else{if(b=r[d],b!==void 0){b._cacheIndex===null&&(++b.referenceCount,this._addInactiveBinding(b,c,g));continue}const w=n&&n._propertyBindings[d].binding.parsedPath;b=new dG(bi.create(i,g,w),p.ValueTypeName,p.getValueSize()),++b.referenceCount,this._addInactiveBinding(b,c,g),r[d]=b}o[d].resultBuffer=b.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const i=(e._localRoot||this._root).uuid,a=e._clip.uuid,s=this._actionsByClip[a];this._bindAction(e,s&&s.knownActions[0]),this._addInactiveAction(e,a,i)}const n=e._propertyBindings;for(let i=0,a=n.length;i!==a;++i){const s=n[i];s.useCount++===0&&(this._lendBinding(s),s.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const n=e._propertyBindings;for(let i=0,a=n.length;i!==a;++i){const s=n[i];--s.useCount===0&&(s.restoreOriginalState(),this._takeBackBinding(s))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const n=e._cacheIndex;return n!==null&&n<this._nActiveActions}_addInactiveAction(e,n,i){const a=this._actions,s=this._actionsByClip;let r=s[n];if(r===void 0)r={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,s[n]=r;else{const o=r.knownActions;e._byClipCacheIndex=o.length,o.push(e)}e._cacheIndex=a.length,a.push(e),r.actionByRoot[i]=e}_removeInactiveAction(e){const n=this._actions,i=n[n.length-1],a=e._cacheIndex;i._cacheIndex=a,n[a]=i,n.pop(),e._cacheIndex=null;const s=e._clip.uuid,r=this._actionsByClip,o=r[s],c=o.knownActions,u=c[c.length-1],h=e._byClipCacheIndex;u._byClipCacheIndex=h,c[h]=u,c.pop(),e._byClipCacheIndex=null;const d=o.actionByRoot,p=(e._localRoot||this._root).uuid;delete d[p],c.length===0&&delete r[s],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const n=e._propertyBindings;for(let i=0,a=n.length;i!==a;++i){const s=n[i];--s.referenceCount===0&&this._removeInactiveBinding(s)}}_lendAction(e){const n=this._actions,i=e._cacheIndex,a=this._nActiveActions++,s=n[a];e._cacheIndex=a,n[a]=e,s._cacheIndex=i,n[i]=s}_takeBackAction(e){const n=this._actions,i=e._cacheIndex,a=--this._nActiveActions,s=n[a];e._cacheIndex=a,n[a]=e,s._cacheIndex=i,n[i]=s}_addInactiveBinding(e,n,i){const a=this._bindingsByRootAndName,s=this._bindings;let r=a[n];r===void 0&&(r={},a[n]=r),r[i]=e,e._cacheIndex=s.length,s.push(e)}_removeInactiveBinding(e){const n=this._bindings,i=e.binding,a=i.rootNode.uuid,s=i.path,r=this._bindingsByRootAndName,o=r[a],c=n[n.length-1],u=e._cacheIndex;c._cacheIndex=u,n[u]=c,n.pop(),delete o[s],Object.keys(o).length===0&&delete r[a]}_lendBinding(e){const n=this._bindings,i=e._cacheIndex,a=this._nActiveBindings++,s=n[a];e._cacheIndex=a,n[a]=e,s._cacheIndex=i,n[i]=s}_takeBackBinding(e){const n=this._bindings,i=e._cacheIndex,a=--this._nActiveBindings,s=n[a];e._cacheIndex=a,n[a]=e,s._cacheIndex=i,n[i]=s}_lendControlInterpolant(){const e=this._controlInterpolants,n=this._nActiveControlInterpolants++;let i=e[n];return i===void 0&&(i=new C6(new Float32Array(2),new Float32Array(2),1,X0e),i.__cacheIndex=n,e[n]=i),i}_takeBackControlInterpolant(e){const n=this._controlInterpolants,i=e.__cacheIndex,a=--this._nActiveControlInterpolants,s=n[a];e.__cacheIndex=a,n[a]=e,s.__cacheIndex=i,n[i]=s}clipAction(e,n,i){const a=n||this._root,s=a.uuid;let r=typeof e=="string"?z1.findByName(a,e):e;const o=r!==null?r.uuid:e,c=this._actionsByClip[o];let u=null;if(i===void 0&&(r!==null?i=r.blendMode:i=Dw),c!==void 0){const d=c.actionByRoot[s];if(d!==void 0&&d.blendMode===i)return d;u=c.knownActions[0],r===null&&(r=u._clip)}if(r===null)return null;const h=new fG(this,r,n,i);return this._bindAction(h,u),this._addInactiveAction(h,o,s),h}existingAction(e,n){const i=n||this._root,a=i.uuid,s=typeof e=="string"?z1.findByName(i,e):e,r=s?s.uuid:e,o=this._actionsByClip[r];return o!==void 0&&o.actionByRoot[a]||null}stopAllAction(){const e=this._actions,n=this._nActiveActions;for(let i=n-1;i>=0;--i)e[i].stop();return this}update(e){e*=this.timeScale;const n=this._actions,i=this._nActiveActions,a=this.time+=e,s=Math.sign(e),r=this._accuIndex^=1;for(let u=0;u!==i;++u)n[u]._update(a,e,s,r);const o=this._bindings,c=this._nActiveBindings;for(let u=0;u!==c;++u)o[u].apply(r);return this}setTime(e){this.time=0;for(let n=0;n<this._actions.length;n++)this._actions[n].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const n=this._actions,i=e.uuid,a=this._actionsByClip,s=a[i];if(s!==void 0){const r=s.knownActions;for(let o=0,c=r.length;o!==c;++o){const u=r[o];this._deactivateAction(u);const h=u._cacheIndex,d=n[n.length-1];u._cacheIndex=null,u._byClipCacheIndex=null,d._cacheIndex=h,n[h]=d,n.pop(),this._removeInactiveBindingsForAction(u)}delete a[i]}}uncacheRoot(e){const n=e.uuid,i=this._actionsByClip;for(const r in i){const o=i[r].actionByRoot,c=o[n];c!==void 0&&(this._deactivateAction(c),this._removeInactiveAction(c))}const a=this._bindingsByRootAndName,s=a[n];if(s!==void 0)for(const r in s){const o=s[r];o.restoreOriginalState(),this._removeInactiveBinding(o)}}uncacheAction(e,n){const i=this.existingAction(e,n);i!==null&&(this._deactivateAction(i),this._removeInactiveAction(i))}}class Y0e extends c6{constructor(e=1,n=1,i=1,a={}){super(e,n,a),this.isRenderTarget3D=!0,this.depth=i,this.texture=new Ow(null,e,n,i),this._setTextureOptions(a),this.texture.isRenderTargetTexture=!0}}class I6{constructor(e){this.value=e}clone(){return new I6(this.value.clone===void 0?this.value:this.value.clone())}}let Z0e=0;class Q0e extends wu{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:Z0e++}),this.name="",this.usage=A1,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const n=this.uniforms.indexOf(e);return n!==-1&&this.uniforms.splice(n,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const n=e.uniforms;this.uniforms.length=0;for(let i=0,a=n.length;i<a;i++){const s=Array.isArray(n[i])?n[i]:[n[i]];for(let r=0;r<s.length;r++)this.uniforms.push(s[r].clone())}return this}clone(){return new this.constructor().copy(this)}}class J0e extends Uw{constructor(e,n,i=1){super(e,n),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=i}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const n=super.clone(e);return n.meshPerAttribute=this.meshPerAttribute,n}toJSON(e){const n=super.toJSON(e);return n.isInstancedInterleavedBuffer=!0,n.meshPerAttribute=this.meshPerAttribute,n}}class ege{constructor(e,n,i,a,s,r=!1){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=n,this.itemSize=i,this.elementSize=a,this.count=s,this.normalized=r,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,n){return this.type=e,this.elementSize=n,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const LL=new wn;class z6{constructor(e,n,i=0,a=1/0){this.ray=new uv(e,n),this.near=i,this.far=a,this.camera=null,this.layers=new Gg,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,n){this.ray.set(e,n)}setFromCamera(e,n){n.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(n.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(n).sub(this.ray.origin).normalize(),this.camera=n):n.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(n.near+n.far)/(n.near-n.far)).unproject(n),this.ray.direction.set(0,0,-1).transformDirection(n.matrixWorld),this.camera=n):console.error("THREE.Raycaster: Unsupported camera type: "+n.type)}setFromXRController(e){return LL.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(LL),this}intersectObject(e,n=!0,i=[]){return F5(e,this,i,n),i.sort(OL),i}intersectObjects(e,n=!0,i=[]){for(let a=0,s=e.length;a<s;a++)F5(e[a],this,i,n);return i.sort(OL),i}}function OL(t,e){return t.distance-e.distance}function F5(t,e,n,i){let a=!0;if(t.layers.test(e.layers)&&t.raycast(e,n)===!1&&(a=!1),a===!0&&i===!0){const s=t.children;for(let r=0,o=s.length;r<o;r++)F5(s[r],e,n,!0)}}class tge{constructor(){this._previousTime=0,this._currentTime=0,this._startTime=performance.now(),this._delta=0,this._elapsed=0,this._timescale=1,this._document=null,this._pageVisibilityHandler=null}connect(e){this._document=e,e.hidden!==void 0&&(this._pageVisibilityHandler=nge.bind(this),e.addEventListener("visibilitychange",this._pageVisibilityHandler,!1))}disconnect(){this._pageVisibilityHandler!==null&&(this._document.removeEventListener("visibilitychange",this._pageVisibilityHandler),this._pageVisibilityHandler=null),this._document=null}getDelta(){return this._delta/1e3}getElapsed(){return this._elapsed/1e3}getTimescale(){return this._timescale}setTimescale(e){return this._timescale=e,this}reset(){return this._currentTime=performance.now()-this._startTime,this}dispose(){this.disconnect()}update(e){return this._pageVisibilityHandler!==null&&this._document.hidden===!0?this._delta=0:(this._previousTime=this._currentTime,this._currentTime=(e!==void 0?e:performance.now())-this._startTime,this._delta=(this._currentTime-this._previousTime)*this._timescale,this._elapsed+=this._delta),this}}function nge(){this._document.hidden===!1&&this.reset()}class ige{constructor(e=1,n=0,i=0){this.radius=e,this.phi=n,this.theta=i}set(e,n,i){return this.radius=e,this.phi=n,this.theta=i,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=En(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+n*n+i*i),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,i),this.phi=Math.acos(En(n/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class age{constructor(e=1,n=0,i=0){this.radius=e,this.theta=n,this.y=i}set(e,n,i){return this.radius=e,this.theta=n,this.y=i,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,n,i){return this.radius=Math.sqrt(e*e+i*i),this.theta=Math.atan2(e,i),this.y=n,this}clone(){return new this.constructor().copy(this)}}class B6{constructor(e,n,i,a){B6.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,n,i,a)}identity(){return this.set(1,0,0,1),this}fromArray(e,n=0){for(let i=0;i<4;i++)this.elements[i]=e[i+n];return this}set(e,n,i,a){const s=this.elements;return s[0]=e,s[2]=n,s[1]=i,s[3]=a,this}}const IL=new _t;class sge{constructor(e=new _t(1/0,1/0),n=new _t(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=n}set(e,n){return this.min.copy(e),this.max.copy(n),this}setFromPoints(e){this.makeEmpty();for(let n=0,i=e.length;n<i;n++)this.expandByPoint(e[n]);return this}setFromCenterAndSize(e,n){const i=IL.copy(n).multiplyScalar(.5);return this.min.copy(e).sub(i),this.max.copy(e).add(i),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,n){return n.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,n){return n.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,IL).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const zL=new fe,G_=new fe,Q0=new fe,J0=new fe,jM=new fe,rge=new fe,oge=new fe;class lge{constructor(e=new fe,n=new fe){this.start=e,this.end=n}set(e,n){return this.start.copy(e),this.end.copy(n),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,n){return this.delta(n).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,n){zL.subVectors(e,this.start),G_.subVectors(this.end,this.start);const i=G_.dot(G_);let s=G_.dot(zL)/i;return n&&(s=En(s,0,1)),s}closestPointToPoint(e,n,i){const a=this.closestPointToPointParameter(e,n);return this.delta(i).multiplyScalar(a).add(this.start)}distanceSqToLine3(e,n=rge,i=oge){const a=10000000000000001e-32;let s,r;const o=this.start,c=e.start,u=this.end,h=e.end;Q0.subVectors(u,o),J0.subVectors(h,c),jM.subVectors(o,c);const d=Q0.dot(Q0),p=J0.dot(J0),g=J0.dot(jM);if(d<=a&&p<=a)return n.copy(o),i.copy(c),n.sub(i),n.dot(n);if(d<=a)s=0,r=g/p,r=En(r,0,1);else{const b=Q0.dot(jM);if(p<=a)r=0,s=En(-b/d,0,1);else{const w=Q0.dot(J0),x=d*p-w*w;x!==0?s=En((w*g-b*p)/x,0,1):s=0,r=(w*s+g)/p,r<0?(r=0,s=En(-b/d,0,1)):r>1&&(r=1,s=En((w-b)/d,0,1))}}return n.copy(o).add(Q0.multiplyScalar(s)),i.copy(c).add(J0.multiplyScalar(r)),n.sub(i),n.dot(n)}applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const BL=new fe;class cge extends Jn{constructor(e,n){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=n,this.type="SpotLightHelper";const i=new Pn,a=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let r=0,o=1,c=32;r<c;r++,o++){const u=r/c*Math.PI*2,h=o/c*Math.PI*2;a.push(Math.cos(u),Math.sin(u),1,Math.cos(h),Math.sin(h),1)}i.setAttribute("position",new an(a,3));const s=new xr({fog:!1,toneMapped:!1});this.cone=new Mu(i,s),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,n=e*Math.tan(this.light.angle);this.cone.scale.set(n,n,e),BL.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(BL),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const Ef=new fe,W_=new wn,FM=new wn;class uge extends Mu{constructor(e){const n=hG(e),i=new Pn,a=[],s=[];for(let u=0;u<n.length;u++){const h=n[u];h.parent&&h.parent.isBone&&(a.push(0,0,0),a.push(0,0,0),s.push(0,0,0),s.push(0,0,0))}i.setAttribute("position",new an(a,3)),i.setAttribute("color",new an(s,3));const r=new xr({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(i,r),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=n,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1;const o=new Wt(255),c=new Wt(65280);this.setColors(o,c)}updateMatrixWorld(e){const n=this.bones,i=this.geometry,a=i.getAttribute("position");FM.copy(this.root.matrixWorld).invert();for(let s=0,r=0;s<n.length;s++){const o=n[s];o.parent&&o.parent.isBone&&(W_.multiplyMatrices(FM,o.matrixWorld),Ef.setFromMatrixPosition(W_),a.setXYZ(r,Ef.x,Ef.y,Ef.z),W_.multiplyMatrices(FM,o.parent.matrixWorld),Ef.setFromMatrixPosition(W_),a.setXYZ(r+1,Ef.x,Ef.y,Ef.z),r+=2)}i.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}setColors(e,n){const a=this.geometry.getAttribute("color");for(let s=0;s<a.count;s+=2)a.setXYZ(s,e.r,e.g,e.b),a.setXYZ(s+1,n.r,n.g,n.b);return a.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}function hG(t){const e=[];t.isBone===!0&&e.push(t);for(let n=0;n<t.children.length;n++)e.push(...hG(t.children[n]));return e}class dge extends Qt{constructor(e,n,i){const a=new fv(n,4,2),s=new Eu({wireframe:!0,fog:!1,toneMapped:!1});super(a,s),this.light=e,this.color=i,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const fge=new fe,UL=new Wt,jL=new Wt;class hge extends Jn{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="HemisphereLightHelper";const a=new bl(n);a.rotateY(Math.PI*.5),this.material=new Eu({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const s=a.getAttribute("position"),r=new Float32Array(s.count*3);a.setAttribute("color",new $i(r,3)),this.add(new Qt(a,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const n=e.geometry.getAttribute("color");UL.copy(this.light.color),jL.copy(this.light.groundColor);for(let i=0,a=n.count;i<a;i++){const s=i<a/2?UL:jL;n.setXYZ(i,s.r,s.g,s.b)}n.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(fge.setFromMatrixPosition(this.light.matrixWorld).negate())}}class pge extends Mu{constructor(e=10,n=10,i=4473924,a=8947848){i=new Wt(i),a=new Wt(a);const s=n/2,r=e/n,o=e/2,c=[],u=[];for(let p=0,g=0,b=-o;p<=n;p++,b+=r){c.push(-o,0,b,o,0,b),c.push(b,0,-o,b,0,o);const w=p===s?i:a;w.toArray(u,g),g+=3,w.toArray(u,g),g+=3,w.toArray(u,g),g+=3,w.toArray(u,g),g+=3}const h=new Pn;h.setAttribute("position",new an(c,3)),h.setAttribute("color",new an(u,3));const d=new xr({vertexColors:!0,toneMapped:!1});super(h,d),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class mge extends Mu{constructor(e=10,n=16,i=8,a=64,s=4473924,r=8947848){s=new Wt(s),r=new Wt(r);const o=[],c=[];if(n>1)for(let d=0;d<n;d++){const p=d/n*(Math.PI*2),g=Math.sin(p)*e,b=Math.cos(p)*e;o.push(0,0,0),o.push(g,0,b);const w=d&1?s:r;c.push(w.r,w.g,w.b),c.push(w.r,w.g,w.b)}for(let d=0;d<i;d++){const p=d&1?s:r,g=e-e/i*d;for(let b=0;b<a;b++){let w=b/a*(Math.PI*2),x=Math.sin(w)*g,S=Math.cos(w)*g;o.push(x,0,S),c.push(p.r,p.g,p.b),w=(b+1)/a*(Math.PI*2),x=Math.sin(w)*g,S=Math.cos(w)*g,o.push(x,0,S),c.push(p.r,p.g,p.b)}}const u=new Pn;u.setAttribute("position",new an(o,3)),u.setAttribute("color",new an(c,3));const h=new xr({vertexColors:!0,toneMapped:!1});super(u,h),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const FL=new fe,K_=new fe,VL=new fe;class gge extends Jn{constructor(e,n,i){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=i,this.type="DirectionalLightHelper",n===void 0&&(n=1);let a=new Pn;a.setAttribute("position",new an([-n,n,0,n,n,0,n,-n,0,-n,-n,0,-n,n,0],3));const s=new xr({fog:!1,toneMapped:!1});this.lightPlane=new qn(a,s),this.add(this.lightPlane),a=new Pn,a.setAttribute("position",new an([0,0,0,0,0,1],3)),this.targetLine=new qn(a,s),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),FL.setFromMatrixPosition(this.light.matrixWorld),K_.setFromMatrixPosition(this.light.target.matrixWorld),VL.subVectors(K_,FL),this.lightPlane.lookAt(K_),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(K_),this.targetLine.scale.z=VL.length()}}const X_=new fe,Aa=new Iw;class vge extends Mu{constructor(e){const n=new Pn,i=new xr({color:16777215,vertexColors:!0,toneMapped:!1}),a=[],s=[],r={};o("n1","n2"),o("n2","n4"),o("n4","n3"),o("n3","n1"),o("f1","f2"),o("f2","f4"),o("f4","f3"),o("f3","f1"),o("n1","f1"),o("n2","f2"),o("n3","f3"),o("n4","f4"),o("p","n1"),o("p","n2"),o("p","n3"),o("p","n4"),o("u1","u2"),o("u2","u3"),o("u3","u1"),o("c","t"),o("p","c"),o("cn1","cn2"),o("cn3","cn4"),o("cf1","cf2"),o("cf3","cf4");function o(b,w){c(b),c(w)}function c(b){a.push(0,0,0),s.push(0,0,0),r[b]===void 0&&(r[b]=[]),r[b].push(a.length/3-1)}n.setAttribute("position",new an(a,3)),n.setAttribute("color",new an(s,3)),super(n,i),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=r,this.update();const u=new Wt(16755200),h=new Wt(16711680),d=new Wt(43775),p=new Wt(16777215),g=new Wt(3355443);this.setColors(u,h,d,p,g)}setColors(e,n,i,a,s){const o=this.geometry.getAttribute("color");return o.setXYZ(0,e.r,e.g,e.b),o.setXYZ(1,e.r,e.g,e.b),o.setXYZ(2,e.r,e.g,e.b),o.setXYZ(3,e.r,e.g,e.b),o.setXYZ(4,e.r,e.g,e.b),o.setXYZ(5,e.r,e.g,e.b),o.setXYZ(6,e.r,e.g,e.b),o.setXYZ(7,e.r,e.g,e.b),o.setXYZ(8,e.r,e.g,e.b),o.setXYZ(9,e.r,e.g,e.b),o.setXYZ(10,e.r,e.g,e.b),o.setXYZ(11,e.r,e.g,e.b),o.setXYZ(12,e.r,e.g,e.b),o.setXYZ(13,e.r,e.g,e.b),o.setXYZ(14,e.r,e.g,e.b),o.setXYZ(15,e.r,e.g,e.b),o.setXYZ(16,e.r,e.g,e.b),o.setXYZ(17,e.r,e.g,e.b),o.setXYZ(18,e.r,e.g,e.b),o.setXYZ(19,e.r,e.g,e.b),o.setXYZ(20,e.r,e.g,e.b),o.setXYZ(21,e.r,e.g,e.b),o.setXYZ(22,e.r,e.g,e.b),o.setXYZ(23,e.r,e.g,e.b),o.setXYZ(24,n.r,n.g,n.b),o.setXYZ(25,n.r,n.g,n.b),o.setXYZ(26,n.r,n.g,n.b),o.setXYZ(27,n.r,n.g,n.b),o.setXYZ(28,n.r,n.g,n.b),o.setXYZ(29,n.r,n.g,n.b),o.setXYZ(30,n.r,n.g,n.b),o.setXYZ(31,n.r,n.g,n.b),o.setXYZ(32,i.r,i.g,i.b),o.setXYZ(33,i.r,i.g,i.b),o.setXYZ(34,i.r,i.g,i.b),o.setXYZ(35,i.r,i.g,i.b),o.setXYZ(36,i.r,i.g,i.b),o.setXYZ(37,i.r,i.g,i.b),o.setXYZ(38,a.r,a.g,a.b),o.setXYZ(39,a.r,a.g,a.b),o.setXYZ(40,s.r,s.g,s.b),o.setXYZ(41,s.r,s.g,s.b),o.setXYZ(42,s.r,s.g,s.b),o.setXYZ(43,s.r,s.g,s.b),o.setXYZ(44,s.r,s.g,s.b),o.setXYZ(45,s.r,s.g,s.b),o.setXYZ(46,s.r,s.g,s.b),o.setXYZ(47,s.r,s.g,s.b),o.setXYZ(48,s.r,s.g,s.b),o.setXYZ(49,s.r,s.g,s.b),o.needsUpdate=!0,this}update(){const e=this.geometry,n=this.pointMap,i=1,a=1;let s,r;if(Aa.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse),this.camera.reversedDepth===!0)s=1,r=0;else if(this.camera.coordinateSystem===ko)s=-1,r=1;else if(this.camera.coordinateSystem===Hg)s=0,r=1;else throw new Error("THREE.CameraHelper.update(): Invalid coordinate system: "+this.camera.coordinateSystem);Ia("c",n,e,Aa,0,0,s),Ia("t",n,e,Aa,0,0,r),Ia("n1",n,e,Aa,-i,-a,s),Ia("n2",n,e,Aa,i,-a,s),Ia("n3",n,e,Aa,-i,a,s),Ia("n4",n,e,Aa,i,a,s),Ia("f1",n,e,Aa,-i,-a,r),Ia("f2",n,e,Aa,i,-a,r),Ia("f3",n,e,Aa,-i,a,r),Ia("f4",n,e,Aa,i,a,r),Ia("u1",n,e,Aa,i*.7,a*1.1,s),Ia("u2",n,e,Aa,-i*.7,a*1.1,s),Ia("u3",n,e,Aa,0,a*2,s),Ia("cf1",n,e,Aa,-i,0,r),Ia("cf2",n,e,Aa,i,0,r),Ia("cf3",n,e,Aa,0,-a,r),Ia("cf4",n,e,Aa,0,a,r),Ia("cn1",n,e,Aa,-i,0,s),Ia("cn2",n,e,Aa,i,0,s),Ia("cn3",n,e,Aa,0,-a,s),Ia("cn4",n,e,Aa,0,a,s),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function Ia(t,e,n,i,a,s,r){X_.set(a,s,r).unproject(i);const o=e[t];if(o!==void 0){const c=n.getAttribute("position");for(let u=0,h=o.length;u<h;u++)c.setXYZ(o[u],X_.x,X_.y,X_.z)}}const q_=new mr;class yge extends Mu{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=new Float32Array(24),s=new Pn;s.setIndex(new $i(i,1)),s.setAttribute("position",new $i(a,3)),super(s,new xr({color:n,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&q_.setFromObject(this.object),q_.isEmpty())return;const e=q_.min,n=q_.max,i=this.geometry.attributes.position,a=i.array;a[0]=n.x,a[1]=n.y,a[2]=n.z,a[3]=e.x,a[4]=n.y,a[5]=n.z,a[6]=e.x,a[7]=e.y,a[8]=n.z,a[9]=n.x,a[10]=e.y,a[11]=n.z,a[12]=n.x,a[13]=n.y,a[14]=e.z,a[15]=e.x,a[16]=n.y,a[17]=e.z,a[18]=e.x,a[19]=e.y,a[20]=e.z,a[21]=n.x,a[22]=e.y,a[23]=e.z,i.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,n){return super.copy(e,n),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class bge extends Mu{constructor(e,n=16776960){const i=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),a=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],s=new Pn;s.setIndex(new $i(i,1)),s.setAttribute("position",new an(a,3)),super(s,new xr({color:n,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const n=this.box;n.isEmpty()||(n.getCenter(this.position),n.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class xge extends qn{constructor(e,n=1,i=16776960){const a=i,s=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],r=new Pn;r.setAttribute("position",new an(s,3)),r.computeBoundingSphere(),super(r,new xr({color:a,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=n;const o=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],c=new Pn;c.setAttribute("position",new an(o,3)),c.computeBoundingSphere(),this.add(new Qt(c,new Eu({color:a,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const kL=new fe;let Y_,VM;class _ge extends Jn{constructor(e=new fe(0,0,1),n=new fe(0,0,0),i=1,a=16776960,s=i*.2,r=s*.2){super(),this.type="ArrowHelper",Y_===void 0&&(Y_=new Pn,Y_.setAttribute("position",new an([0,0,0,0,1,0],3)),VM=new dx(.5,1,5,1),VM.translate(0,-.5,0)),this.position.copy(n),this.line=new qn(Y_,new xr({color:a,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new Qt(VM,new Eu({color:a,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(i,s,r)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{kL.set(e.z,0,-e.x).normalize();const n=Math.acos(e.y);this.quaternion.setFromAxisAngle(kL,n)}}setLength(e,n=e*.2,i=n*.2){this.line.scale.set(1,Math.max(1e-4,e-n),1),this.line.updateMatrix(),this.cone.scale.set(i,n,i),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class Sge extends Mu{constructor(e=1){const n=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],i=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],a=new Pn;a.setAttribute("position",new an(n,3)),a.setAttribute("color",new an(i,3));const s=new xr({vertexColors:!0,toneMapped:!1});super(a,s),this.type="AxesHelper"}setColors(e,n,i){const a=new Wt,s=this.geometry.attributes.color.array;return a.set(e),a.toArray(s,0),a.toArray(s,3),a.set(n),a.toArray(s,6),a.toArray(s,9),a.set(i),a.toArray(s,12),a.toArray(s,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class wge{constructor(){this.type="ShapePath",this.color=new Wt,this.subPaths=[],this.currentPath=null}moveTo(e,n){return this.currentPath=new G3,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,n),this}lineTo(e,n){return this.currentPath.lineTo(e,n),this}quadraticCurveTo(e,n,i,a){return this.currentPath.quadraticCurveTo(e,n,i,a),this}bezierCurveTo(e,n,i,a,s,r){return this.currentPath.bezierCurveTo(e,n,i,a,s,r),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function n(S){const M=[];for(let C=0,A=S.length;C<A;C++){const N=S[C],R=new Xp;R.curves=N.curves,M.push(R)}return M}function i(S,M){const C=M.length;let A=!1;for(let N=C-1,R=0;R<C;N=R++){let D=M[N],B=M[R],z=B.x-D.x,I=B.y-D.y;if(Math.abs(I)>Number.EPSILON){if(I<0&&(D=M[R],z=-z,B=M[N],I=-I),S.y<D.y||S.y>B.y)continue;if(S.y===D.y){if(S.x===D.x)return!0}else{const U=I*(S.x-D.x)-z*(S.y-D.y);if(U===0)return!0;if(U<0)continue;A=!A}}else{if(S.y!==D.y)continue;if(B.x<=S.x&&S.x<=D.x||D.x<=S.x&&S.x<=B.x)return!0}}return A}const a=cc.isClockWise,s=this.subPaths;if(s.length===0)return[];let r,o,c;const u=[];if(s.length===1)return o=s[0],c=new Xp,c.curves=o.curves,u.push(c),u;let h=!a(s[0].getPoints());h=e?!h:h;const d=[],p=[];let g=[],b=0,w;p[b]=void 0,g[b]=[];for(let S=0,M=s.length;S<M;S++)o=s[S],w=o.getPoints(),r=a(w),r=e?!r:r,r?(!h&&p[b]&&b++,p[b]={s:new Xp,p:w},p[b].s.curves=o.curves,h&&b++,g[b]=[]):g[b].push({h:o,p:w[0]});if(!p[0])return n(s);if(p.length>1){let S=!1,M=0;for(let C=0,A=p.length;C<A;C++)d[C]=[];for(let C=0,A=p.length;C<A;C++){const N=g[C];for(let R=0;R<N.length;R++){const D=N[R];let B=!0;for(let z=0;z<p.length;z++)i(D.p,p[z].p)&&(C!==z&&M++,B?(B=!1,d[z].push(D)):S=!0);B&&d[C].push(D)}}M>0&&S===!1&&(g=d)}let x;for(let S=0,M=p.length;S<M;S++){c=p[S].s,u.push(c),x=g[S];for(let C=0,A=x.length;C<A;C++)c.holes.push(x[C].h)}return u}}class Ege extends wu{constructor(e,n=null){super(),this.object=e,this.domElement=n,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function Mge(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2):(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0),t}function Tge(t,e){const n=t.image&&t.image.width?t.image.width/t.image.height:1;return n>e?(t.repeat.x=e/n,t.repeat.y=1,t.offset.x=(1-t.repeat.x)/2,t.offset.y=0):(t.repeat.x=1,t.repeat.y=n/e,t.offset.x=0,t.offset.y=(1-t.repeat.y)/2),t}function Cge(t){return t.repeat.x=1,t.repeat.y=1,t.offset.x=0,t.offset.y=0,t}function V5(t,e,n,i){const a=Age(i);switch(n){case i6:return t*e;case Rw:return t*e/a.components*a.byteLength;case cx:return t*e/a.components*a.byteLength;case s6:return t*e*2/a.components*a.byteLength;case Nw:return t*e*2/a.components*a.byteLength;case a6:return t*e*3/a.components*a.byteLength;case fr:return t*e*4/a.components*a.byteLength;case Pw:return t*e*4/a.components*a.byteLength;case Bb:case Ub:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case jb:case Fb:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case p3:case g3:return Math.max(t,16)*Math.max(e,8)/4;case h3:case m3:return Math.max(t,8)*Math.max(e,8)/2;case v3:case y3:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*8;case b3:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case x3:return Math.floor((t+3)/4)*Math.floor((e+3)/4)*16;case _3:return Math.floor((t+4)/5)*Math.floor((e+3)/4)*16;case S3:return Math.floor((t+4)/5)*Math.floor((e+4)/5)*16;case w3:return Math.floor((t+5)/6)*Math.floor((e+4)/5)*16;case E3:return Math.floor((t+5)/6)*Math.floor((e+5)/6)*16;case M3:return Math.floor((t+7)/8)*Math.floor((e+4)/5)*16;case T3:return Math.floor((t+7)/8)*Math.floor((e+5)/6)*16;case C3:return Math.floor((t+7)/8)*Math.floor((e+7)/8)*16;case A3:return Math.floor((t+9)/10)*Math.floor((e+4)/5)*16;case R3:return Math.floor((t+9)/10)*Math.floor((e+5)/6)*16;case N3:return Math.floor((t+9)/10)*Math.floor((e+7)/8)*16;case P3:return Math.floor((t+9)/10)*Math.floor((e+9)/10)*16;case D3:return Math.floor((t+11)/12)*Math.floor((e+9)/10)*16;case L3:return Math.floor((t+11)/12)*Math.floor((e+11)/12)*16;case O3:case I3:case z3:return Math.ceil(t/4)*Math.ceil(e/4)*16;case B3:case U3:return Math.ceil(t/4)*Math.ceil(e/4)*8;case j3:case F3:return Math.ceil(t/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${n} format.`)}function Age(t){switch(t){case Pl:case JA:return{byteLength:1,components:1};case jg:case e6:case bm:return{byteLength:2,components:1};case Cw:case Aw:return{byteLength:2,components:4};case Td:case Tw:case Hr:return{byteLength:4,components:1};case t6:case n6:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${t}.`)}class Rge{static contain(e,n){return Mge(e,n)}static cover(e,n){return Tge(e,n)}static fill(e){return Cge(e)}static getByteLength(e,n,i,a){return V5(e,n,i,a)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:ww}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=ww);/**
* @license
* Copyright 2010-2025 Three.js Authors
* SPDX-License-Identifier: MIT
*/function pG(){let t=null,e=!1,n=null,i=null;function a(s,r){n(s,r),i=t.requestAnimationFrame(a)}return{start:function(){e!==!0&&n!==null&&(i=t.requestAnimationFrame(a),e=!0)},stop:function(){t.cancelAnimationFrame(i),e=!1},setAnimationLoop:function(s){n=s},setContext:function(s){t=s}}}function Nge(t){const e=new WeakMap;function n(o,c){const u=o.array,h=o.usage,d=u.byteLength,p=t.createBuffer();t.bindBuffer(c,p),t.bufferData(c,u,h),o.onUploadCallback();let g;if(u instanceof Float32Array)g=t.FLOAT;else if(typeof Float16Array<"u"&&u instanceof Float16Array)g=t.HALF_FLOAT;else if(u instanceof Uint16Array)o.isFloat16BufferAttribute?g=t.HALF_FLOAT:g=t.UNSIGNED_SHORT;else if(u instanceof Int16Array)g=t.SHORT;else if(u instanceof Uint32Array)g=t.UNSIGNED_INT;else if(u instanceof Int32Array)g=t.INT;else if(u instanceof Int8Array)g=t.BYTE;else if(u instanceof Uint8Array)g=t.UNSIGNED_BYTE;else if(u instanceof Uint8ClampedArray)g=t.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+u);return{buffer:p,type:g,bytesPerElement:u.BYTES_PER_ELEMENT,version:o.version,size:d}}function i(o,c,u){const h=c.array,d=c.updateRanges;if(t.bindBuffer(u,o),d.length===0)t.bufferSubData(u,0,h);else{d.sort((g,b)=>g.start-b.start);let p=0;for(let g=1;g<d.length;g++){const b=d[p],w=d[g];w.start<=b.start+b.count+1?b.count=Math.max(b.count,w.start+w.count-b.start):(++p,d[p]=w)}d.length=p+1;for(let g=0,b=d.length;g<b;g++){const w=d[g];t.bufferSubData(u,w.start*h.BYTES_PER_ELEMENT,h,w.start,w.count)}c.clearUpdateRanges()}c.onUploadCallback()}function a(o){return o.isInterleavedBufferAttribute&&(o=o.data),e.get(o)}function s(o){o.isInterleavedBufferAttribute&&(o=o.data);const c=e.get(o);c&&(t.deleteBuffer(c.buffer),e.delete(o))}function r(o,c){if(o.isInterleavedBufferAttribute&&(o=o.data),o.isGLBufferAttribute){const h=e.get(o);(!h||h.version<o.version)&&e.set(o,{buffer:o.buffer,type:o.type,bytesPerElement:o.elementSize,version:o.version});return}const u=e.get(o);if(u===void 0)e.set(o,n(o,c));else if(u.version<o.version){if(u.size!==o.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");i(u.buffer,o,c),u.version=o.version}}return{get:a,remove:s,update:r}}var Pge=`#ifdef USE_ALPHAHASH
if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
#endif`,Dge=`#ifdef USE_ALPHAHASH
const float ALPHA_HASH_SCALE = 0.05;
float hash2D( vec2 value ) {
return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
}
float hash3D( vec3 value ) {
return hash2D( vec2( hash2D( value.xy ), value.z ) );
}
float getAlphaHashThreshold( vec3 position ) {
float maxDeriv = max(
length( dFdx( position.xyz ) ),
length( dFdy( position.xyz ) )
);
float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
vec2 pixScales = vec2(
exp2( floor( log2( pixScale ) ) ),
exp2( ceil( log2( pixScale ) ) )
);
vec2 alpha = vec2(
hash3D( floor( pixScales.x * position.xyz ) ),
hash3D( floor( pixScales.y * position.xyz ) )
);
float lerpFactor = fract( log2( pixScale ) );
float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
float a = min( lerpFactor, 1.0 - lerpFactor );
vec3 cases = vec3(
x * x / ( 2.0 * a * ( 1.0 - a ) ),
( x - 0.5 * a ) / ( 1.0 - a ),
1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
);
float threshold = ( x < ( 1.0 - a ) )
? ( ( x < a ) ? cases.x : cases.y )
: cases.z;
return clamp( threshold , 1.0e-6, 1.0 );
}
#endif`,Lge=`#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
#endif`,Oge=`#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,Ige=`#ifdef USE_ALPHATEST
#ifdef ALPHA_TO_COVERAGE
diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
if ( diffuseColor.a == 0.0 ) discard;
#else
if ( diffuseColor.a < alphaTest ) discard;
#endif
#endif`,zge=`#ifdef USE_ALPHATEST
uniform float alphaTest;
#endif`,Bge=`#ifdef USE_AOMAP
float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
reflectedLight.indirectDiffuse *= ambientOcclusion;
#if defined( USE_CLEARCOAT )
clearcoatSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_SHEEN )
sheenSpecularIndirect *= ambientOcclusion;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD )
float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
#endif
#endif`,Uge=`#ifdef USE_AOMAP
uniform sampler2D aoMap;
uniform float aoMapIntensity;
#endif`,jge=`#ifdef USE_BATCHING
#if ! defined( GL_ANGLE_multi_draw )
#define gl_DrawID _gl_DrawID
uniform int _gl_DrawID;
#endif
uniform highp sampler2D batchingTexture;
uniform highp usampler2D batchingIdTexture;
mat4 getBatchingMatrix( const in float i ) {
int size = textureSize( batchingTexture, 0 ).x;
int j = int( i ) * 4;
int x = j % size;
int y = j / size;
vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
return mat4( v1, v2, v3, v4 );
}
float getIndirectIndex( const in int i ) {
int size = textureSize( batchingIdTexture, 0 ).x;
int x = i % size;
int y = i / size;
return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
}
#endif
#ifdef USE_BATCHING_COLOR
uniform sampler2D batchingColorTexture;
vec3 getBatchingColor( const in float i ) {
int size = textureSize( batchingColorTexture, 0 ).x;
int j = int( i );
int x = j % size;
int y = j / size;
return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
}
#endif`,Fge=`#ifdef USE_BATCHING
mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
#endif`,Vge=`vec3 transformed = vec3( position );
#ifdef USE_ALPHAHASH
vPosition = vec3( position );
#endif`,kge=`vec3 objectNormal = vec3( normal );
#ifdef USE_TANGENT
vec3 objectTangent = vec3( tangent.xyz );
#endif`,Hge=`float G_BlinnPhong_Implicit( ) {
return 0.25;
}
float D_BlinnPhong( const in float shininess, const in float dotNH ) {
return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
}
vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( specularColor, 1.0, dotVH );
float G = G_BlinnPhong_Implicit( );
float D = D_BlinnPhong( shininess, dotNH );
return F * ( G * D );
} // validated`,$ge=`#ifdef USE_IRIDESCENCE
const mat3 XYZ_TO_REC709 = mat3(
3.2404542, -0.9692660, 0.0556434,
-1.5371385, 1.8760108, -0.2040259,
-0.4985314, 0.0415560, 1.0572252
);
vec3 Fresnel0ToIor( vec3 fresnel0 ) {
vec3 sqrtF0 = sqrt( fresnel0 );
return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
}
vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
}
float IorToFresnel0( float transmittedIor, float incidentIor ) {
return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
}
vec3 evalSensitivity( float OPD, vec3 shift ) {
float phase = 2.0 * PI * OPD * 1.0e-9;
vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
xyz /= 1.0685e-7;
vec3 rgb = XYZ_TO_REC709 * xyz;
return rgb;
}
vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
vec3 I;
float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
float cosTheta2Sq = 1.0 - sinTheta2Sq;
if ( cosTheta2Sq < 0.0 ) {
return vec3( 1.0 );
}
float cosTheta2 = sqrt( cosTheta2Sq );
float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
float R12 = F_Schlick( R0, 1.0, cosTheta1 );
float T121 = 1.0 - R12;
float phi12 = 0.0;
if ( iridescenceIOR < outsideIOR ) phi12 = PI;
float phi21 = PI - phi12;
vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) ); vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
vec3 phi23 = vec3( 0.0 );
if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
vec3 phi = vec3( phi21 ) + phi23;
vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
vec3 r123 = sqrt( R123 );
vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
vec3 C0 = R12 + Rs;
I = C0;
vec3 Cm = Rs - T121;
for ( int m = 1; m <= 2; ++ m ) {
Cm *= r123;
vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
I += Cm * Sm;
}
return max( I, vec3( 0.0 ) );
}
#endif`,Gge=`#ifdef USE_BUMPMAP
uniform sampler2D bumpMap;
uniform float bumpScale;
vec2 dHdxy_fwd() {
vec2 dSTdx = dFdx( vBumpMapUv );
vec2 dSTdy = dFdy( vBumpMapUv );
float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
return vec2( dBx, dBy );
}
vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
vec3 vN = surf_norm;
vec3 R1 = cross( vSigmaY, vN );
vec3 R2 = cross( vN, vSigmaX );
float fDet = dot( vSigmaX, R1 ) * faceDirection;
vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
return normalize( abs( fDet ) * surf_norm - vGrad );
}
#endif`,Wge=`#if NUM_CLIPPING_PLANES > 0
vec4 plane;
#ifdef ALPHA_TO_COVERAGE
float distanceToPlane, distanceGradient;
float clipOpacity = 1.0;
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
distanceGradient = fwidth( distanceToPlane ) / 2.0;
clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
if ( clipOpacity == 0.0 ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
float unionClipOpacity = 1.0;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
distanceGradient = fwidth( distanceToPlane ) / 2.0;
unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
}
#pragma unroll_loop_end
clipOpacity *= 1.0 - unionClipOpacity;
#endif
diffuseColor.a *= clipOpacity;
if ( diffuseColor.a == 0.0 ) discard;
#else
#pragma unroll_loop_start
for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
}
#pragma unroll_loop_end
#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
bool clipped = true;
#pragma unroll_loop_start
for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
plane = clippingPlanes[ i ];
clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
}
#pragma unroll_loop_end
if ( clipped ) discard;
#endif
#endif
#endif`,Kge=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
#endif`,Xge=`#if NUM_CLIPPING_PLANES > 0
varying vec3 vClipPosition;
#endif`,qge=`#if NUM_CLIPPING_PLANES > 0
vClipPosition = - mvPosition.xyz;
#endif`,Yge=`#if defined( USE_COLOR_ALPHA )
diffuseColor *= vColor;
#elif defined( USE_COLOR )
diffuseColor.rgb *= vColor;
#endif`,Zge=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR )
varying vec3 vColor;
#endif`,Qge=`#if defined( USE_COLOR_ALPHA )
varying vec4 vColor;
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
varying vec3 vColor;
#endif`,Jge=`#if defined( USE_COLOR_ALPHA )
vColor = vec4( 1.0 );
#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
vColor = vec3( 1.0 );
#endif
#ifdef USE_COLOR
vColor *= color;
#endif
#ifdef USE_INSTANCING_COLOR
vColor.xyz *= instanceColor.xyz;
#endif
#ifdef USE_BATCHING_COLOR
vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
vColor.xyz *= batchingColor.xyz;
#endif`,eve=`#define PI 3.141592653589793
#define PI2 6.283185307179586
#define PI_HALF 1.5707963267948966
#define RECIPROCAL_PI 0.3183098861837907
#define RECIPROCAL_PI2 0.15915494309189535
#define EPSILON 1e-6
#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
#define whiteComplement( a ) ( 1.0 - saturate( a ) )
float pow2( const in float x ) { return x*x; }
vec3 pow2( const in vec3 x ) { return x*x; }
float pow3( const in float x ) { return x*x*x; }
float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
highp float rand( const in vec2 uv ) {
const highp float a = 12.9898, b = 78.233, c = 43758.5453;
highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
return fract( sin( sn ) * c );
}
#ifdef HIGH_PRECISION
float precisionSafeLength( vec3 v ) { return length( v ); }
#else
float precisionSafeLength( vec3 v ) {
float maxComponent = max3( abs( v ) );
return length( v / maxComponent ) * maxComponent;
}
#endif
struct IncidentLight {
vec3 color;
vec3 direction;
bool visible;
};
struct ReflectedLight {
vec3 directDiffuse;
vec3 directSpecular;
vec3 indirectDiffuse;
vec3 indirectSpecular;
};
#ifdef USE_ALPHAHASH
varying vec3 vPosition;
#endif
vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
}
vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
}
mat3 transposeMat3( const in mat3 m ) {
mat3 tmp;
tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
return tmp;
}
bool isPerspectiveMatrix( mat4 m ) {
return m[ 2 ][ 3 ] == - 1.0;
}
vec2 equirectUv( in vec3 dir ) {
float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
return vec2( u, v );
}
vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
return RECIPROCAL_PI * diffuseColor;
}
vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
}
float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
} // validated`,tve=`#ifdef ENVMAP_TYPE_CUBE_UV
#define cubeUV_minMipLevel 4.0
#define cubeUV_minTileSize 16.0
float getFace( vec3 direction ) {
vec3 absDirection = abs( direction );
float face = - 1.0;
if ( absDirection.x > absDirection.z ) {
if ( absDirection.x > absDirection.y )
face = direction.x > 0.0 ? 0.0 : 3.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
} else {
if ( absDirection.z > absDirection.y )
face = direction.z > 0.0 ? 2.0 : 5.0;
else
face = direction.y > 0.0 ? 1.0 : 4.0;
}
return face;
}
vec2 getUV( vec3 direction, float face ) {
vec2 uv;
if ( face == 0.0 ) {
uv = vec2( direction.z, direction.y ) / abs( direction.x );
} else if ( face == 1.0 ) {
uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
} else if ( face == 2.0 ) {
uv = vec2( - direction.x, direction.y ) / abs( direction.z );
} else if ( face == 3.0 ) {
uv = vec2( - direction.z, direction.y ) / abs( direction.x );
} else if ( face == 4.0 ) {
uv = vec2( - direction.x, direction.z ) / abs( direction.y );
} else {
uv = vec2( direction.x, direction.y ) / abs( direction.z );
}
return 0.5 * ( uv + 1.0 );
}
vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
float face = getFace( direction );
float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
mipInt = max( mipInt, cubeUV_minMipLevel );
float faceSize = exp2( mipInt );
highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
if ( face > 2.0 ) {
uv.y += faceSize;
face -= 3.0;
}
uv.x += face * faceSize;
uv.x += filterInt * 3.0 * cubeUV_minTileSize;
uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
uv.x *= CUBEUV_TEXEL_WIDTH;
uv.y *= CUBEUV_TEXEL_HEIGHT;
#ifdef texture2DGradEXT
return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
#else
return texture2D( envMap, uv ).rgb;
#endif
}
#define cubeUV_r0 1.0
#define cubeUV_m0 - 2.0
#define cubeUV_r1 0.8
#define cubeUV_m1 - 1.0
#define cubeUV_r4 0.4
#define cubeUV_m4 2.0
#define cubeUV_r5 0.305
#define cubeUV_m5 3.0
#define cubeUV_r6 0.21
#define cubeUV_m6 4.0
float roughnessToMip( float roughness ) {
float mip = 0.0;
if ( roughness >= cubeUV_r1 ) {
mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
} else if ( roughness >= cubeUV_r4 ) {
mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
} else if ( roughness >= cubeUV_r5 ) {
mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
} else if ( roughness >= cubeUV_r6 ) {
mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
} else {
mip = - 2.0 * log2( 1.16 * roughness ); }
return mip;
}
vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
float mipF = fract( mip );
float mipInt = floor( mip );
vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
if ( mipF == 0.0 ) {
return vec4( color0, 1.0 );
} else {
vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
return vec4( mix( color0, color1, mipF ), 1.0 );
}
}
#endif`,nve=`vec3 transformedNormal = objectNormal;
#ifdef USE_TANGENT
vec3 transformedTangent = objectTangent;
#endif
#ifdef USE_BATCHING
mat3 bm = mat3( batchingMatrix );
transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
transformedNormal = bm * transformedNormal;
#ifdef USE_TANGENT
transformedTangent = bm * transformedTangent;
#endif
#endif
#ifdef USE_INSTANCING
mat3 im = mat3( instanceMatrix );
transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
transformedNormal = im * transformedNormal;
#ifdef USE_TANGENT
transformedTangent = im * transformedTangent;
#endif
#endif
transformedNormal = normalMatrix * transformedNormal;
#ifdef FLIP_SIDED
transformedNormal = - transformedNormal;
#endif
#ifdef USE_TANGENT
transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
#ifdef FLIP_SIDED
transformedTangent = - transformedTangent;
#endif
#endif`,ive=`#ifdef USE_DISPLACEMENTMAP
uniform sampler2D displacementMap;
uniform float displacementScale;
uniform float displacementBias;
#endif`,ave=`#ifdef USE_DISPLACEMENTMAP
transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + displacementBias );
#endif`,sve=`#ifdef USE_EMISSIVEMAP
vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
emissiveColor = sRGBTransferEOTF( emissiveColor );
#endif
totalEmissiveRadiance *= emissiveColor.rgb;
#endif`,rve=`#ifdef USE_EMISSIVEMAP
uniform sampler2D emissiveMap;
#endif`,ove="gl_FragColor = linearToOutputTexel( gl_FragColor );",lve=`vec4 LinearTransferOETF( in vec4 value ) {
return value;
}
vec4 sRGBTransferEOTF( in vec4 value ) {
return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
}
vec4 sRGBTransferOETF( in vec4 value ) {
return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
}`,cve=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vec3 cameraToFrag;
if ( isOrthographic ) {
cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToFrag = normalize( vWorldPosition - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vec3 reflectVec = reflect( cameraToFrag, worldNormal );
#else
vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
#endif
#else
vec3 reflectVec = vReflect;
#endif
#ifdef ENVMAP_TYPE_CUBE
vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
#else
vec4 envColor = vec4( 0.0 );
#endif
#ifdef ENVMAP_BLENDING_MULTIPLY
outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_MIX )
outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
#elif defined( ENVMAP_BLENDING_ADD )
outgoingLight += envColor.xyz * specularStrength * reflectivity;
#endif
#endif`,uve=`#ifdef USE_ENVMAP
uniform float envMapIntensity;
uniform float flipEnvMap;
uniform mat3 envMapRotation;
#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#else
uniform sampler2D envMap;
#endif
#endif`,dve=`#ifdef USE_ENVMAP
uniform float reflectivity;
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
uniform float refractionRatio;
#else
varying vec3 vReflect;
#endif
#endif`,fve=`#ifdef USE_ENVMAP
#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
#define ENV_WORLDPOS
#endif
#ifdef ENV_WORLDPOS
varying vec3 vWorldPosition;
#else
varying vec3 vReflect;
uniform float refractionRatio;
#endif
#endif`,hve=`#ifdef USE_ENVMAP
#ifdef ENV_WORLDPOS
vWorldPosition = worldPosition.xyz;
#else
vec3 cameraToVertex;
if ( isOrthographic ) {
cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
} else {
cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
}
vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
#ifdef ENVMAP_MODE_REFLECTION
vReflect = reflect( cameraToVertex, worldNormal );
#else
vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
#endif
#endif
#endif`,pve=`#ifdef USE_FOG
vFogDepth = - mvPosition.z;
#endif`,mve=`#ifdef USE_FOG
varying float vFogDepth;
#endif`,gve=`#ifdef USE_FOG
#ifdef FOG_EXP2
float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
#else
float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
#endif
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif`,vve=`#ifdef USE_FOG
uniform vec3 fogColor;
varying float vFogDepth;
#ifdef FOG_EXP2
uniform float fogDensity;
#else
uniform float fogNear;
uniform float fogFar;
#endif
#endif`,yve=`#ifdef USE_GRADIENTMAP
uniform sampler2D gradientMap;
#endif
vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
float dotNL = dot( normal, lightDirection );
vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
#ifdef USE_GRADIENTMAP
return vec3( texture2D( gradientMap, coord ).r );
#else
vec2 fw = fwidth( coord ) * 0.5;
return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
#endif
}`,bve=`#ifdef USE_LIGHTMAP
uniform sampler2D lightMap;
uniform float lightMapIntensity;
#endif`,xve=`LambertMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularStrength = specularStrength;`,_ve=`varying vec3 vViewPosition;
struct LambertMaterial {
vec3 diffuseColor;
float specularStrength;
};
void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Lambert
#define RE_IndirectDiffuse RE_IndirectDiffuse_Lambert`,Sve=`uniform bool receiveShadow;
uniform vec3 ambientLightColor;
#if defined( USE_LIGHT_PROBES )
uniform vec3 lightProbe[ 9 ];
#endif
vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
float x = normal.x, y = normal.y, z = normal.z;
vec3 result = shCoefficients[ 0 ] * 0.886227;
result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
return result;
}
vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
return irradiance;
}
vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
vec3 irradiance = ambientLightColor;
return irradiance;
}
float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
if ( cutoffDistance > 0.0 ) {
distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
}
return distanceFalloff;
}
float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
return smoothstep( coneCosine, penumbraCosine, angleCosine );
}
#if NUM_DIR_LIGHTS > 0
struct DirectionalLight {
vec3 direction;
vec3 color;
};
uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
light.color = directionalLight.color;
light.direction = directionalLight.direction;
light.visible = true;
}
#endif
#if NUM_POINT_LIGHTS > 0
struct PointLight {
vec3 position;
vec3 color;
float distance;
float decay;
};
uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
vec3 lVector = pointLight.position - geometryPosition;
light.direction = normalize( lVector );
float lightDistance = length( lVector );
light.color = pointLight.color;
light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
}
#endif
#if NUM_SPOT_LIGHTS > 0
struct SpotLight {
vec3 position;
vec3 direction;
vec3 color;
float distance;
float decay;
float coneCos;
float penumbraCos;
};
uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
vec3 lVector = spotLight.position - geometryPosition;
light.direction = normalize( lVector );
float angleCos = dot( light.direction, spotLight.direction );
float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
if ( spotAttenuation > 0.0 ) {
float lightDistance = length( lVector );
light.color = spotLight.color * spotAttenuation;
light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
light.visible = ( light.color != vec3( 0.0 ) );
} else {
light.color = vec3( 0.0 );
light.visible = false;
}
}
#endif
#if NUM_RECT_AREA_LIGHTS > 0
struct RectAreaLight {
vec3 color;
vec3 position;
vec3 halfWidth;
vec3 halfHeight;
};
uniform sampler2D ltc_1; uniform sampler2D ltc_2;
uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
#endif
#if NUM_HEMI_LIGHTS > 0
struct HemisphereLight {
vec3 direction;
vec3 skyColor;
vec3 groundColor;
};
uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
float dotNL = dot( normal, hemiLight.direction );
float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
return irradiance;
}
#endif`,wve=`#ifdef USE_ENVMAP
vec3 getIBLIrradiance( const in vec3 normal ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
return PI * envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 reflectVec = reflect( - viewDir, normal );
reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
return envMapColor.rgb * envMapIntensity;
#else
return vec3( 0.0 );
#endif
}
#ifdef USE_ANISOTROPY
vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
#ifdef ENVMAP_TYPE_CUBE_UV
vec3 bentNormal = cross( bitangent, viewDir );
bentNormal = normalize( cross( bentNormal, bitangent ) );
bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
return getIBLRadiance( viewDir, bentNormal, roughness );
#else
return vec3( 0.0 );
#endif
}
#endif
#endif`,Eve=`ToonMaterial material;
material.diffuseColor = diffuseColor.rgb;`,Mve=`varying vec3 vViewPosition;
struct ToonMaterial {
vec3 diffuseColor;
};
void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_Toon
#define RE_IndirectDiffuse RE_IndirectDiffuse_Toon`,Tve=`BlinnPhongMaterial material;
material.diffuseColor = diffuseColor.rgb;
material.specularColor = specular;
material.specularShininess = shininess;
material.specularStrength = specularStrength;`,Cve=`varying vec3 vViewPosition;
struct BlinnPhongMaterial {
vec3 diffuseColor;
vec3 specularColor;
float specularShininess;
float specularStrength;
};
void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
}
void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
#define RE_Direct RE_Direct_BlinnPhong
#define RE_IndirectDiffuse RE_IndirectDiffuse_BlinnPhong`,Ave=`PhysicalMaterial material;
material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
material.roughness = min( material.roughness, 1.0 );
#ifdef IOR
material.ior = ior;
#ifdef USE_SPECULAR
float specularIntensityFactor = specularIntensity;
vec3 specularColorFactor = specularColor;
#ifdef USE_SPECULAR_COLORMAP
specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
#endif
material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
#else
float specularIntensityFactor = 1.0;
vec3 specularColorFactor = vec3( 1.0 );
material.specularF90 = 1.0;
#endif
material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
#else
material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
material.specularF90 = 1.0;
#endif
#ifdef USE_CLEARCOAT
material.clearcoat = clearcoat;
material.clearcoatRoughness = clearcoatRoughness;
material.clearcoatF0 = vec3( 0.04 );
material.clearcoatF90 = 1.0;
#ifdef USE_CLEARCOATMAP
material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
#endif
material.clearcoat = saturate( material.clearcoat ); material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
material.clearcoatRoughness += geometryRoughness;
material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
#endif
#ifdef USE_DISPERSION
material.dispersion = dispersion;
#endif
#ifdef USE_IRIDESCENCE
material.iridescence = iridescence;
material.iridescenceIOR = iridescenceIOR;
#ifdef USE_IRIDESCENCEMAP
material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
#else
material.iridescenceThickness = iridescenceThicknessMaximum;
#endif
#endif
#ifdef USE_SHEEN
material.sheenColor = sheenColor;
#ifdef USE_SHEEN_COLORMAP
material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
#endif
material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
#ifdef USE_SHEEN_ROUGHNESSMAP
material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
#endif
#endif
#ifdef USE_ANISOTROPY
#ifdef USE_ANISOTROPYMAP
mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
#else
vec2 anisotropyV = anisotropyVector;
#endif
material.anisotropy = length( anisotropyV );
if( material.anisotropy == 0.0 ) {
anisotropyV = vec2( 1.0, 0.0 );
} else {
anisotropyV /= material.anisotropy;
material.anisotropy = saturate( material.anisotropy );
}
material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
#endif`,Rve=`struct PhysicalMaterial {
vec3 diffuseColor;
float roughness;
vec3 specularColor;
float specularF90;
float dispersion;
#ifdef USE_CLEARCOAT
float clearcoat;
float clearcoatRoughness;
vec3 clearcoatF0;
float clearcoatF90;
#endif
#ifdef USE_IRIDESCENCE
float iridescence;
float iridescenceIOR;
float iridescenceThickness;
vec3 iridescenceFresnel;
vec3 iridescenceF0;
#endif
#ifdef USE_SHEEN
vec3 sheenColor;
float sheenRoughness;
#endif
#ifdef IOR
float ior;
#endif
#ifdef USE_TRANSMISSION
float transmission;
float transmissionAlpha;
float thickness;
float attenuationDistance;
vec3 attenuationColor;
#endif
#ifdef USE_ANISOTROPY
float anisotropy;
float alphaT;
vec3 anisotropyT;
vec3 anisotropyB;
#endif
};
vec3 clearcoatSpecularDirect = vec3( 0.0 );
vec3 clearcoatSpecularIndirect = vec3( 0.0 );
vec3 sheenSpecularDirect = vec3( 0.0 );
vec3 sheenSpecularIndirect = vec3(0.0 );
vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
float x2 = x * x;
float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
}
float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
float a2 = pow2( alpha );
float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
return 0.5 / max( gv + gl, EPSILON );
}
float D_GGX( const in float alpha, const in float dotNH ) {
float a2 = pow2( alpha );
float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
return RECIPROCAL_PI * a2 / pow2( denom );
}
#ifdef USE_ANISOTROPY
float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
float v = 0.5 / ( gv + gl );
return saturate(v);
}
float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
float a2 = alphaT * alphaB;
highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
highp float v2 = dot( v, v );
float w2 = a2 / v2;
return RECIPROCAL_PI * a2 * pow2 ( w2 );
}
#endif
#ifdef USE_CLEARCOAT
vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
vec3 f0 = material.clearcoatF0;
float f90 = material.clearcoatF90;
float roughness = material.clearcoatRoughness;
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( f0, f90, dotVH );
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
return F * ( V * D );
}
#endif
vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
vec3 f0 = material.specularColor;
float f90 = material.specularF90;
float roughness = material.roughness;
float alpha = pow2( roughness );
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float dotVH = saturate( dot( viewDir, halfDir ) );
vec3 F = F_Schlick( f0, f90, dotVH );
#ifdef USE_IRIDESCENCE
F = mix( F, material.iridescenceFresnel, material.iridescence );
#endif
#ifdef USE_ANISOTROPY
float dotTL = dot( material.anisotropyT, lightDir );
float dotTV = dot( material.anisotropyT, viewDir );
float dotTH = dot( material.anisotropyT, halfDir );
float dotBL = dot( material.anisotropyB, lightDir );
float dotBV = dot( material.anisotropyB, viewDir );
float dotBH = dot( material.anisotropyB, halfDir );
float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
#else
float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
float D = D_GGX( alpha, dotNH );
#endif
return F * ( V * D );
}
vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
const float LUT_SIZE = 64.0;
const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
const float LUT_BIAS = 0.5 / LUT_SIZE;
float dotNV = saturate( dot( N, V ) );
vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
uv = uv * LUT_SCALE + LUT_BIAS;
return uv;
}
float LTC_ClippedSphereFormFactor( const in vec3 f ) {
float l = length( f );
return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
}
vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
float x = dot( v1, v2 );
float y = abs( x );
float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
float b = 3.4175940 + ( 4.1616724 + y ) * y;
float v = a / b;
float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
return cross( v1, v2 ) * theta_sintheta;
}
vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
vec3 lightNormal = cross( v1, v2 );
if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
vec3 T1, T2;
T1 = normalize( V - N * dot( V, N ) );
T2 = - cross( N, T1 );
mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
vec3 coords[ 4 ];
coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
coords[ 0 ] = normalize( coords[ 0 ] );
coords[ 1 ] = normalize( coords[ 1 ] );
coords[ 2 ] = normalize( coords[ 2 ] );
coords[ 3 ] = normalize( coords[ 3 ] );
vec3 vectorFormFactor = vec3( 0.0 );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
return vec3( result );
}
#if defined( USE_SHEEN )
float D_Charlie( float roughness, float dotNH ) {
float alpha = pow2( roughness );
float invAlpha = 1.0 / alpha;
float cos2h = dotNH * dotNH;
float sin2h = max( 1.0 - cos2h, 0.0078125 );
return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
}
float V_Neubelt( float dotNV, float dotNL ) {
return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
}
vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
vec3 halfDir = normalize( lightDir + viewDir );
float dotNL = saturate( dot( normal, lightDir ) );
float dotNV = saturate( dot( normal, viewDir ) );
float dotNH = saturate( dot( normal, halfDir ) );
float D = D_Charlie( sheenRoughness, dotNH );
float V = V_Neubelt( dotNV, dotNL );
return sheenColor * ( D * V );
}
#endif
float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
float r2 = roughness * roughness;
float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
return saturate( DG * RECIPROCAL_PI );
}
vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
float dotNV = saturate( dot( normal, viewDir ) );
const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
vec4 r = roughness * c0 + c1;
float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
return fab;
}
vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
vec2 fab = DFGApprox( normal, viewDir, roughness );
return specularColor * fab.x + specularF90 * fab.y;
}
#ifdef USE_IRIDESCENCE
void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#else
void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
#endif
vec2 fab = DFGApprox( normal, viewDir, roughness );
#ifdef USE_IRIDESCENCE
vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
#else
vec3 Fr = specularColor;
#endif
vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
float Ess = fab.x + fab.y;
float Ems = 1.0 - Ess;
vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619; vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
singleScatter += FssEss;
multiScatter += Fms * Ems;
}
#if NUM_RECT_AREA_LIGHTS > 0
void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
vec3 normal = geometryNormal;
vec3 viewDir = geometryViewDir;
vec3 position = geometryPosition;
vec3 lightPos = rectAreaLight.position;
vec3 halfWidth = rectAreaLight.halfWidth;
vec3 halfHeight = rectAreaLight.halfHeight;
vec3 lightColor = rectAreaLight.color;
float roughness = material.roughness;
vec3 rectCoords[ 4 ];
rectCoords[ 0 ] = lightPos + halfWidth - halfHeight; rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
vec2 uv = LTC_Uv( normal, viewDir, roughness );
vec4 t1 = texture2D( ltc_1, uv );
vec4 t2 = texture2D( ltc_2, uv );
mat3 mInv = mat3(
vec3( t1.x, 0, t1.y ),
vec3( 0, 1, 0 ),
vec3( t1.z, 0, t1.w )
);
vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
}
#endif
void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
vec3 irradiance = dotNL * directLight.color;
#ifdef USE_CLEARCOAT
float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
vec3 ccIrradiance = dotNLcc * directLight.color;
clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
#endif
#ifdef USE_SHEEN
sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
#endif
reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
}
void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
#ifdef USE_CLEARCOAT
clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
#endif
#ifdef USE_SHEEN
sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
#endif
vec3 singleScattering = vec3( 0.0 );
vec3 multiScattering = vec3( 0.0 );
vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
#ifdef USE_IRIDESCENCE
computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
#else
computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
#endif
vec3 totalScattering = singleScattering + multiScattering;
vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
reflectedLight.indirectSpecular += radiance * singleScattering;
reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
}
#define RE_Direct RE_Direct_Physical
#define RE_Direct_RectArea RE_Direct_RectArea_Physical
#define RE_IndirectDiffuse RE_IndirectDiffuse_Physical
#define RE_IndirectSpecular RE_IndirectSpecular_Physical
float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
}`,Nve=`
vec3 geometryPosition = - vViewPosition;
vec3 geometryNormal = normal;
vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
vec3 geometryClearcoatNormal = vec3( 0.0 );
#ifdef USE_CLEARCOAT
geometryClearcoatNormal = clearcoatNormal;
#endif
#ifdef USE_IRIDESCENCE
float dotNVi = saturate( dot( normal, geometryViewDir ) );
if ( material.iridescenceThickness == 0.0 ) {
material.iridescence = 0.0;
} else {
material.iridescence = saturate( material.iridescence );
}
if ( material.iridescence > 0.0 ) {
material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
}
#endif
IncidentLight directLight;
#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
PointLight pointLight;
#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
pointLight = pointLights[ i ];
getPointLightInfo( pointLight, geometryPosition, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
pointLightShadow = pointLightShadows[ i ];
directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
SpotLight spotLight;
vec4 spotColor;
vec3 spotLightCoord;
bool inSpotLightMap;
#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
spotLight = spotLights[ i ];
getSpotLightInfo( spotLight, geometryPosition, directLight );
#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
#else
#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
#endif
#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
#endif
#undef SPOT_LIGHT_MAP_INDEX
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
spotLightShadow = spotLightShadows[ i ];
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
DirectionalLight directionalLight;
#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLightShadow;
#endif
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
directionalLight = directionalLights[ i ];
getDirectionalLightInfo( directionalLight, directLight );
#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
directionalLightShadow = directionalLightShadows[ i ];
directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
#endif
RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
RectAreaLight rectAreaLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
rectAreaLight = rectAreaLights[ i ];
RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
}
#pragma unroll_loop_end
#endif
#if defined( RE_IndirectDiffuse )
vec3 iblIrradiance = vec3( 0.0 );
vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
#if defined( USE_LIGHT_PROBES )
irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
#endif
#if ( NUM_HEMI_LIGHTS > 0 )
#pragma unroll_loop_start
for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
}
#pragma unroll_loop_end
#endif
#endif
#if defined( RE_IndirectSpecular )
vec3 radiance = vec3( 0.0 );
vec3 clearcoatRadiance = vec3( 0.0 );
#endif`,Pve=`#if defined( RE_IndirectDiffuse )
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
irradiance += lightMapIrradiance;
#endif
#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
iblIrradiance += getIBLIrradiance( geometryNormal );
#endif
#endif
#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
#ifdef USE_ANISOTROPY
radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
#else
radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
#endif
#ifdef USE_CLEARCOAT
clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
#endif
#endif`,Dve=`#if defined( RE_IndirectDiffuse )
RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif
#if defined( RE_IndirectSpecular )
RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
#endif`,Lve=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
#endif`,Ove=`#if defined( USE_LOGARITHMIC_DEPTH_BUFFER )
uniform float logDepthBufFC;
varying float vFragDepth;
varying float vIsPerspective;
#endif`,Ive=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
varying float vFragDepth;
varying float vIsPerspective;
#endif`,zve=`#ifdef USE_LOGARITHMIC_DEPTH_BUFFER
vFragDepth = 1.0 + gl_Position.w;
vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
#endif`,Bve=`#ifdef USE_MAP
vec4 sampledDiffuseColor = texture2D( map, vMapUv );
#ifdef DECODE_VIDEO_TEXTURE
sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
#endif
diffuseColor *= sampledDiffuseColor;
#endif`,Uve=`#ifdef USE_MAP
uniform sampler2D map;
#endif`,jve=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
#if defined( USE_POINTS_UV )
vec2 uv = vUv;
#else
vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
#endif
#endif
#ifdef USE_MAP
diffuseColor *= texture2D( map, uv );
#endif
#ifdef USE_ALPHAMAP
diffuseColor.a *= texture2D( alphaMap, uv ).g;
#endif`,Fve=`#if defined( USE_POINTS_UV )
varying vec2 vUv;
#else
#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
uniform mat3 uvTransform;
#endif
#endif
#ifdef USE_MAP
uniform sampler2D map;
#endif
#ifdef USE_ALPHAMAP
uniform sampler2D alphaMap;
#endif`,Vve=`float metalnessFactor = metalness;
#ifdef USE_METALNESSMAP
vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
metalnessFactor *= texelMetalness.b;
#endif`,kve=`#ifdef USE_METALNESSMAP
uniform sampler2D metalnessMap;
#endif`,Hve=`#ifdef USE_INSTANCING_MORPH
float morphTargetInfluences[ MORPHTARGETS_COUNT ];
float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
morphTargetInfluences[i] = texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
}
#endif`,$ve=`#if defined( USE_MORPHCOLORS )
vColor *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
#if defined( USE_COLOR_ALPHA )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
#elif defined( USE_COLOR )
if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
#endif
}
#endif`,Gve=`#ifdef USE_MORPHNORMALS
objectNormal *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
}
#endif`,Wve=`#ifdef USE_MORPHTARGETS
#ifndef USE_INSTANCING_MORPH
uniform float morphTargetBaseInfluence;
uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
#endif
uniform sampler2DArray morphTargetsTexture;
uniform ivec2 morphTargetsTextureSize;
vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
int y = texelIndex / morphTargetsTextureSize.x;
int x = texelIndex - y * morphTargetsTextureSize.x;
ivec3 morphUV = ivec3( x, y, morphTargetIndex );
return texelFetch( morphTargetsTexture, morphUV, 0 );
}
#endif`,Kve=`#ifdef USE_MORPHTARGETS
transformed *= morphTargetBaseInfluence;
for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
}
#endif`,Xve=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
#ifdef FLAT_SHADED
vec3 fdx = dFdx( vViewPosition );
vec3 fdy = dFdy( vViewPosition );
vec3 normal = normalize( cross( fdx, fdy ) );
#else
vec3 normal = normalize( vNormal );
#ifdef DOUBLE_SIDED
normal *= faceDirection;
#endif
#endif
#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
#ifdef USE_TANGENT
mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
#else
mat3 tbn = getTangentFrame( - vViewPosition, normal,
#if defined( USE_NORMALMAP )
vNormalMapUv
#elif defined( USE_CLEARCOAT_NORMALMAP )
vClearcoatNormalMapUv
#else
vUv
#endif
);
#endif
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
tbn[0] *= faceDirection;
tbn[1] *= faceDirection;
#endif
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
#ifdef USE_TANGENT
mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
#else
mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
#endif
#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
tbn2[0] *= faceDirection;
tbn2[1] *= faceDirection;
#endif
#endif
vec3 nonPerturbedNormal = normal;`,qve=`#ifdef USE_NORMALMAP_OBJECTSPACE
normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
#ifdef FLIP_SIDED
normal = - normal;
#endif
#ifdef DOUBLE_SIDED
normal = normal * faceDirection;
#endif
normal = normalize( normalMatrix * normal );
#elif defined( USE_NORMALMAP_TANGENTSPACE )
vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
mapN.xy *= normalScale;
normal = normalize( tbn * mapN );
#elif defined( USE_BUMPMAP )
normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
#endif`,Yve=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,Zve=`#ifndef FLAT_SHADED
varying vec3 vNormal;
#ifdef USE_TANGENT
varying vec3 vTangent;
varying vec3 vBitangent;
#endif
#endif`,Qve=`#ifndef FLAT_SHADED
vNormal = normalize( transformedNormal );
#ifdef USE_TANGENT
vTangent = normalize( transformedTangent );
vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
#endif
#endif`,Jve=`#ifdef USE_NORMALMAP
uniform sampler2D normalMap;
uniform vec2 normalScale;
#endif
#ifdef USE_NORMALMAP_OBJECTSPACE
uniform mat3 normalMatrix;
#endif
#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
vec3 q0 = dFdx( eye_pos.xyz );
vec3 q1 = dFdy( eye_pos.xyz );
vec2 st0 = dFdx( uv.st );
vec2 st1 = dFdy( uv.st );
vec3 N = surf_norm;
vec3 q1perp = cross( q1, N );
vec3 q0perp = cross( N, q0 );
vec3 T = q1perp * st0.x + q0perp * st1.x;
vec3 B = q1perp * st0.y + q0perp * st1.y;
float det = max( dot( T, T ), dot( B, B ) );
float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
return mat3( T * scale, B * scale, N );
}
#endif`,eye=`#ifdef USE_CLEARCOAT
vec3 clearcoatNormal = nonPerturbedNormal;
#endif`,tye=`#ifdef USE_CLEARCOAT_NORMALMAP
vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
clearcoatMapN.xy *= clearcoatNormalScale;
clearcoatNormal = normalize( tbn2 * clearcoatMapN );
#endif`,nye=`#ifdef USE_CLEARCOATMAP
uniform sampler2D clearcoatMap;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform sampler2D clearcoatNormalMap;
uniform vec2 clearcoatNormalScale;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform sampler2D clearcoatRoughnessMap;
#endif`,iye=`#ifdef USE_IRIDESCENCEMAP
uniform sampler2D iridescenceMap;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform sampler2D iridescenceThicknessMap;
#endif`,aye=`#ifdef OPAQUE
diffuseColor.a = 1.0;
#endif
#ifdef USE_TRANSMISSION
diffuseColor.a *= material.transmissionAlpha;
#endif
gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,sye=`vec3 packNormalToRGB( const in vec3 normal ) {
return normalize( normal ) * 0.5 + 0.5;
}
vec3 unpackRGBToNormal( const in vec3 rgb ) {
return 2.0 * rgb.xyz - 1.0;
}
const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
const float Inv255 = 1. / 255.;
const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
vec4 packDepthToRGBA( const in float v ) {
if( v <= 0.0 )
return vec4( 0., 0., 0., 0. );
if( v >= 1.0 )
return vec4( 1., 1., 1., 1. );
float vuf;
float af = modf( v * PackFactors.a, vuf );
float bf = modf( vuf * ShiftRight8, vuf );
float gf = modf( vuf * ShiftRight8, vuf );
return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
}
vec3 packDepthToRGB( const in float v ) {
if( v <= 0.0 )
return vec3( 0., 0., 0. );
if( v >= 1.0 )
return vec3( 1., 1., 1. );
float vuf;
float bf = modf( v * PackFactors.b, vuf );
float gf = modf( vuf * ShiftRight8, vuf );
return vec3( vuf * Inv255, gf * PackUpscale, bf );
}
vec2 packDepthToRG( const in float v ) {
if( v <= 0.0 )
return vec2( 0., 0. );
if( v >= 1.0 )
return vec2( 1., 1. );
float vuf;
float gf = modf( v * 256., vuf );
return vec2( vuf * Inv255, gf );
}
float unpackRGBAToDepth( const in vec4 v ) {
return dot( v, UnpackFactors4 );
}
float unpackRGBToDepth( const in vec3 v ) {
return dot( v, UnpackFactors3 );
}
float unpackRGToDepth( const in vec2 v ) {
return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
}
vec4 pack2HalfToRGBA( const in vec2 v ) {
vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
}
vec2 unpackRGBATo2Half( const in vec4 v ) {
return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
}
float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
return ( viewZ + near ) / ( near - far );
}
float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
return depth * ( near - far ) - near;
}
float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
}
float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
return ( near * far ) / ( ( far - near ) * depth - far );
}`,rye=`#ifdef PREMULTIPLIED_ALPHA
gl_FragColor.rgb *= gl_FragColor.a;
#endif`,oye=`vec4 mvPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
mvPosition = batchingMatrix * mvPosition;
#endif
#ifdef USE_INSTANCING
mvPosition = instanceMatrix * mvPosition;
#endif
mvPosition = modelViewMatrix * mvPosition;
gl_Position = projectionMatrix * mvPosition;`,lye=`#ifdef DITHERING
gl_FragColor.rgb = dithering( gl_FragColor.rgb );
#endif`,cye=`#ifdef DITHERING
vec3 dithering( vec3 color ) {
float grid_position = rand( gl_FragCoord.xy );
vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
return color + dither_shift_RGB;
}
#endif`,uye=`float roughnessFactor = roughness;
#ifdef USE_ROUGHNESSMAP
vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
roughnessFactor *= texelRoughness.g;
#endif`,dye=`#ifdef USE_ROUGHNESSMAP
uniform sampler2D roughnessMap;
#endif`,fye=`#if NUM_SPOT_LIGHT_COORDS > 0
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#if NUM_SPOT_LIGHT_MAPS > 0
uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
struct SpotLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
float depth = unpackRGBAToDepth( texture2D( depths, uv ) );
#ifdef USE_REVERSED_DEPTH_BUFFER
return step( depth, compare );
#else
return step( compare, depth );
#endif
}
vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
return unpackRGBATo2Half( texture2D( shadow, uv ) );
}
float VSMShadow( sampler2D shadow, vec2 uv, float compare ) {
float occlusion = 1.0;
vec2 distribution = texture2DDistribution( shadow, uv );
#ifdef USE_REVERSED_DEPTH_BUFFER
float hard_shadow = step( distribution.x, compare );
#else
float hard_shadow = step( compare, distribution.x );
#endif
if ( hard_shadow != 1.0 ) {
float distance = compare - distribution.x;
float variance = max( 0.00000, distribution.y * distribution.y );
float softness_probability = variance / (variance + distance * distance ); softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 ); occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
}
return occlusion;
}
float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
float shadow = 1.0;
shadowCoord.xyz /= shadowCoord.w;
shadowCoord.z += shadowBias;
bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
if ( frustumTest ) {
#if defined( SHADOWMAP_TYPE_PCF )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx0 = - texelSize.x * shadowRadius;
float dy0 = - texelSize.y * shadowRadius;
float dx1 = + texelSize.x * shadowRadius;
float dy1 = + texelSize.y * shadowRadius;
float dx2 = dx0 / 2.0;
float dy2 = dy0 / 2.0;
float dx3 = dx1 / 2.0;
float dy3 = dy1 / 2.0;
shadow = (
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
) * ( 1.0 / 17.0 );
#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
float dx = texelSize.x;
float dy = texelSize.y;
vec2 uv = shadowCoord.xy;
vec2 f = fract( uv * shadowMapSize + 0.5 );
uv -= f * texelSize;
shadow = (
texture2DCompare( shadowMap, uv, shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
f.x ) +
mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
f.y ) +
mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
f.x ),
mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
f.x ),
f.y )
) * ( 1.0 / 9.0 );
#elif defined( SHADOWMAP_TYPE_VSM )
shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
#else
shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
#endif
}
return mix( 1.0, shadow, shadowIntensity );
}
vec2 cubeToUV( vec3 v, float texelSizeY ) {
vec3 absV = abs( v );
float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
absV *= scaleToCube;
v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
vec2 planar = v.xy;
float almostATexel = 1.5 * texelSizeY;
float almostOne = 1.0 - almostATexel;
if ( absV.z >= almostOne ) {
if ( v.z > 0.0 )
planar.x = 4.0 - v.x;
} else if ( absV.x >= almostOne ) {
float signX = sign( v.x );
planar.x = v.z * signX + 2.0 * signX;
} else if ( absV.y >= almostOne ) {
float signY = sign( v.y );
planar.x = v.x + 2.0 * signY + 2.0;
planar.y = v.z * signY - 2.0;
}
return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
}
float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
float shadow = 1.0;
vec3 lightToPosition = shadowCoord.xyz;
float lightToPositionLength = length( lightToPosition );
if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear ); dp += shadowBias;
vec3 bd3D = normalize( lightToPosition );
vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
shadow = (
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
) * ( 1.0 / 9.0 );
#else
shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
#endif
}
return mix( 1.0, shadow, shadowIntensity );
}
#endif`,hye=`#if NUM_SPOT_LIGHT_COORDS > 0
uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
#endif
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
struct DirectionalLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
struct SpotLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
};
uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
struct PointLightShadow {
float shadowIntensity;
float shadowBias;
float shadowNormalBias;
float shadowRadius;
vec2 shadowMapSize;
float shadowCameraNear;
float shadowCameraFar;
};
uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
#endif
#endif`,pye=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
vec4 shadowWorldPosition;
#endif
#if defined( USE_SHADOWMAP )
#if NUM_DIR_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif
#endif
#if NUM_SPOT_LIGHT_COORDS > 0
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
shadowWorldPosition = worldPosition;
#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
#endif
vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
}
#pragma unroll_loop_end
#endif`,mye=`float getShadowMask() {
float shadow = 1.0;
#ifdef USE_SHADOWMAP
#if NUM_DIR_LIGHT_SHADOWS > 0
DirectionalLightShadow directionalLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
directionalLight = directionalLightShadows[ i ];
shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_SPOT_LIGHT_SHADOWS > 0
SpotLightShadow spotLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
spotLight = spotLightShadows[ i ];
shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
}
#pragma unroll_loop_end
#endif
#if NUM_POINT_LIGHT_SHADOWS > 0
PointLightShadow pointLight;
#pragma unroll_loop_start
for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
pointLight = pointLightShadows[ i ];
shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
}
#pragma unroll_loop_end
#endif
#endif
return shadow;
}`,gye=`#ifdef USE_SKINNING
mat4 boneMatX = getBoneMatrix( skinIndex.x );
mat4 boneMatY = getBoneMatrix( skinIndex.y );
mat4 boneMatZ = getBoneMatrix( skinIndex.z );
mat4 boneMatW = getBoneMatrix( skinIndex.w );
#endif`,vye=`#ifdef USE_SKINNING
uniform mat4 bindMatrix;
uniform mat4 bindMatrixInverse;
uniform highp sampler2D boneTexture;
mat4 getBoneMatrix( const in float i ) {
int size = textureSize( boneTexture, 0 ).x;
int j = int( i ) * 4;
int x = j % size;
int y = j / size;
vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
return mat4( v1, v2, v3, v4 );
}
#endif`,yye=`#ifdef USE_SKINNING
vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
vec4 skinned = vec4( 0.0 );
skinned += boneMatX * skinVertex * skinWeight.x;
skinned += boneMatY * skinVertex * skinWeight.y;
skinned += boneMatZ * skinVertex * skinWeight.z;
skinned += boneMatW * skinVertex * skinWeight.w;
transformed = ( bindMatrixInverse * skinned ).xyz;
#endif`,bye=`#ifdef USE_SKINNING
mat4 skinMatrix = mat4( 0.0 );
skinMatrix += skinWeight.x * boneMatX;
skinMatrix += skinWeight.y * boneMatY;
skinMatrix += skinWeight.z * boneMatZ;
skinMatrix += skinWeight.w * boneMatW;
skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
#ifdef USE_TANGENT
objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
#endif
#endif`,xye=`float specularStrength;
#ifdef USE_SPECULARMAP
vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
specularStrength = texelSpecular.r;
#else
specularStrength = 1.0;
#endif`,_ye=`#ifdef USE_SPECULARMAP
uniform sampler2D specularMap;
#endif`,Sye=`#if defined( TONE_MAPPING )
gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
#endif`,wye=`#ifndef saturate
#define saturate( a ) clamp( a, 0.0, 1.0 )
#endif
uniform float toneMappingExposure;
vec3 LinearToneMapping( vec3 color ) {
return saturate( toneMappingExposure * color );
}
vec3 ReinhardToneMapping( vec3 color ) {
color *= toneMappingExposure;
return saturate( color / ( vec3( 1.0 ) + color ) );
}
vec3 CineonToneMapping( vec3 color ) {
color *= toneMappingExposure;
color = max( vec3( 0.0 ), color - 0.004 );
return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
}
vec3 RRTAndODTFit( vec3 v ) {
vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
return a / b;
}
vec3 ACESFilmicToneMapping( vec3 color ) {
const mat3 ACESInputMat = mat3(
vec3( 0.59719, 0.07600, 0.02840 ), vec3( 0.35458, 0.90834, 0.13383 ),
vec3( 0.04823, 0.01566, 0.83777 )
);
const mat3 ACESOutputMat = mat3(
vec3( 1.60475, -0.10208, -0.00327 ), vec3( -0.53108, 1.10813, -0.07276 ),
vec3( -0.07367, -0.00605, 1.07602 )
);
color *= toneMappingExposure / 0.6;
color = ACESInputMat * color;
color = RRTAndODTFit( color );
color = ACESOutputMat * color;
return saturate( color );
}
const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
vec3( 1.6605, - 0.1246, - 0.0182 ),
vec3( - 0.5876, 1.1329, - 0.1006 ),
vec3( - 0.0728, - 0.0083, 1.1187 )
);
const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
vec3( 0.6274, 0.0691, 0.0164 ),
vec3( 0.3293, 0.9195, 0.0880 ),
vec3( 0.0433, 0.0113, 0.8956 )
);
vec3 agxDefaultContrastApprox( vec3 x ) {
vec3 x2 = x * x;
vec3 x4 = x2 * x2;
return + 15.5 * x4 * x2
- 40.14 * x4 * x
+ 31.96 * x4
- 6.868 * x2 * x
+ 0.4298 * x2
+ 0.1191 * x
- 0.00232;
}
vec3 AgXToneMapping( vec3 color ) {
const mat3 AgXInsetMatrix = mat3(
vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
);
const mat3 AgXOutsetMatrix = mat3(
vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
);
const float AgxMinEv = - 12.47393; const float AgxMaxEv = 4.026069;
color *= toneMappingExposure;
color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
color = AgXInsetMatrix * color;
color = max( color, 1e-10 ); color = log2( color );
color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
color = clamp( color, 0.0, 1.0 );
color = agxDefaultContrastApprox( color );
color = AgXOutsetMatrix * color;
color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
color = clamp( color, 0.0, 1.0 );
return color;
}
vec3 NeutralToneMapping( vec3 color ) {
const float StartCompression = 0.8 - 0.04;
const float Desaturation = 0.15;
color *= toneMappingExposure;
float x = min( color.r, min( color.g, color.b ) );
float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
color -= offset;
float peak = max( color.r, max( color.g, color.b ) );
if ( peak < StartCompression ) return color;
float d = 1. - StartCompression;
float newPeak = 1. - d * d / ( peak + d - StartCompression );
color *= newPeak / peak;
float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
return mix( color, vec3( newPeak ), g );
}
vec3 CustomToneMapping( vec3 color ) { return color; }`,Eye=`#ifdef USE_TRANSMISSION
material.transmission = transmission;
material.transmissionAlpha = 1.0;
material.thickness = thickness;
material.attenuationDistance = attenuationDistance;
material.attenuationColor = attenuationColor;
#ifdef USE_TRANSMISSIONMAP
material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
#endif
#ifdef USE_THICKNESSMAP
material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
#endif
vec3 pos = vWorldPosition;
vec3 v = normalize( cameraPosition - pos );
vec3 n = inverseTransformDirection( normal, viewMatrix );
vec4 transmitted = getIBLVolumeRefraction(
n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
material.attenuationColor, material.attenuationDistance );
material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
#endif`,Mye=`#ifdef USE_TRANSMISSION
uniform float transmission;
uniform float thickness;
uniform float attenuationDistance;
uniform vec3 attenuationColor;
#ifdef USE_TRANSMISSIONMAP
uniform sampler2D transmissionMap;
#endif
#ifdef USE_THICKNESSMAP
uniform sampler2D thicknessMap;
#endif
uniform vec2 transmissionSamplerSize;
uniform sampler2D transmissionSamplerMap;
uniform mat4 modelMatrix;
uniform mat4 projectionMatrix;
varying vec3 vWorldPosition;
float w0( float a ) {
return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
}
float w1( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * ( 3.0 * a - 6.0 ) + 4.0 );
}
float w2( float a ){
return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
}
float w3( float a ) {
return ( 1.0 / 6.0 ) * ( a * a * a );
}
float g0( float a ) {
return w0( a ) + w1( a );
}
float g1( float a ) {
return w2( a ) + w3( a );
}
float h0( float a ) {
return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
}
float h1( float a ) {
return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
}
vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
uv = uv * texelSize.zw + 0.5;
vec2 iuv = floor( uv );
vec2 fuv = fract( uv );
float g0x = g0( fuv.x );
float g1x = g1( fuv.x );
float h0x = h0( fuv.x );
float h1x = h1( fuv.x );
float h0y = h0( fuv.y );
float h1y = h1( fuv.y );
vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
}
vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
vec2 fLodSizeInv = 1.0 / fLodSize;
vec2 cLodSizeInv = 1.0 / cLodSize;
vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
return mix( fSample, cSample, fract( lod ) );
}
vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
vec3 modelScale;
modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
return normalize( refractionVector ) * thickness * modelScale;
}
float applyIorToRoughness( const in float roughness, const in float ior ) {
return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
}
vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
}
vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
if ( isinf( attenuationDistance ) ) {
return vec3( 1.0 );
} else {
vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance ); return transmittance;
}
}
vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
const in vec3 attenuationColor, const in float attenuationDistance ) {
vec4 transmittedLight;
vec3 transmittance;
#ifdef USE_DISPERSION
float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
for ( int i = 0; i < 3; i ++ ) {
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
vec3 refractedRayExit = position + transmissionRay;
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
refractionCoords += 1.0;
refractionCoords /= 2.0;
vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
transmittedLight[ i ] = transmissionSample[ i ];
transmittedLight.a += transmissionSample.a;
transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
}
transmittedLight.a /= 3.0;
#else
vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
vec3 refractedRayExit = position + transmissionRay;
vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
vec2 refractionCoords = ndcPos.xy / ndcPos.w;
refractionCoords += 1.0;
refractionCoords /= 2.0;
transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
#endif
vec3 attenuatedColor = transmittance * transmittedLight.rgb;
vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
}
#endif`,Tye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
varying vec2 vUv;
#endif
#ifdef USE_MAP
varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
varying vec2 vNormalMapUv;
#endif
#ifdef USE_EMISSIVEMAP
varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_SPECULARMAP
varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
uniform mat3 transmissionMapTransform;
varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
uniform mat3 thicknessMapTransform;
varying vec2 vThicknessMapUv;
#endif`,Cye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
varying vec2 vUv;
#endif
#ifdef USE_MAP
uniform mat3 mapTransform;
varying vec2 vMapUv;
#endif
#ifdef USE_ALPHAMAP
uniform mat3 alphaMapTransform;
varying vec2 vAlphaMapUv;
#endif
#ifdef USE_LIGHTMAP
uniform mat3 lightMapTransform;
varying vec2 vLightMapUv;
#endif
#ifdef USE_AOMAP
uniform mat3 aoMapTransform;
varying vec2 vAoMapUv;
#endif
#ifdef USE_BUMPMAP
uniform mat3 bumpMapTransform;
varying vec2 vBumpMapUv;
#endif
#ifdef USE_NORMALMAP
uniform mat3 normalMapTransform;
varying vec2 vNormalMapUv;
#endif
#ifdef USE_DISPLACEMENTMAP
uniform mat3 displacementMapTransform;
varying vec2 vDisplacementMapUv;
#endif
#ifdef USE_EMISSIVEMAP
uniform mat3 emissiveMapTransform;
varying vec2 vEmissiveMapUv;
#endif
#ifdef USE_METALNESSMAP
uniform mat3 metalnessMapTransform;
varying vec2 vMetalnessMapUv;
#endif
#ifdef USE_ROUGHNESSMAP
uniform mat3 roughnessMapTransform;
varying vec2 vRoughnessMapUv;
#endif
#ifdef USE_ANISOTROPYMAP
uniform mat3 anisotropyMapTransform;
varying vec2 vAnisotropyMapUv;
#endif
#ifdef USE_CLEARCOATMAP
uniform mat3 clearcoatMapTransform;
varying vec2 vClearcoatMapUv;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
uniform mat3 clearcoatNormalMapTransform;
varying vec2 vClearcoatNormalMapUv;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
uniform mat3 clearcoatRoughnessMapTransform;
varying vec2 vClearcoatRoughnessMapUv;
#endif
#ifdef USE_SHEEN_COLORMAP
uniform mat3 sheenColorMapTransform;
varying vec2 vSheenColorMapUv;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
uniform mat3 sheenRoughnessMapTransform;
varying vec2 vSheenRoughnessMapUv;
#endif
#ifdef USE_IRIDESCENCEMAP
uniform mat3 iridescenceMapTransform;
varying vec2 vIridescenceMapUv;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
uniform mat3 iridescenceThicknessMapTransform;
varying vec2 vIridescenceThicknessMapUv;
#endif
#ifdef USE_SPECULARMAP
uniform mat3 specularMapTransform;
varying vec2 vSpecularMapUv;
#endif
#ifdef USE_SPECULAR_COLORMAP
uniform mat3 specularColorMapTransform;
varying vec2 vSpecularColorMapUv;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
uniform mat3 specularIntensityMapTransform;
varying vec2 vSpecularIntensityMapUv;
#endif
#ifdef USE_TRANSMISSIONMAP
uniform mat3 transmissionMapTransform;
varying vec2 vTransmissionMapUv;
#endif
#ifdef USE_THICKNESSMAP
uniform mat3 thicknessMapTransform;
varying vec2 vThicknessMapUv;
#endif`,Aye=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
vUv = vec3( uv, 1 ).xy;
#endif
#ifdef USE_MAP
vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ALPHAMAP
vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_LIGHTMAP
vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_AOMAP
vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_BUMPMAP
vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_NORMALMAP
vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_DISPLACEMENTMAP
vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_EMISSIVEMAP
vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_METALNESSMAP
vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ROUGHNESSMAP
vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_ANISOTROPYMAP
vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOATMAP
vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_NORMALMAP
vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_CLEARCOAT_ROUGHNESSMAP
vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCEMAP
vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_IRIDESCENCE_THICKNESSMAP
vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_COLORMAP
vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULARMAP
vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_COLORMAP
vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_TRANSMISSIONMAP
vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
#endif
#ifdef USE_THICKNESSMAP
vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
#endif`,Rye=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
vec4 worldPosition = vec4( transformed, 1.0 );
#ifdef USE_BATCHING
worldPosition = batchingMatrix * worldPosition;
#endif
#ifdef USE_INSTANCING
worldPosition = instanceMatrix * worldPosition;
#endif
worldPosition = modelMatrix * worldPosition;
#endif`;const Nye=`varying vec2 vUv;
uniform mat3 uvTransform;
void main() {
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
gl_Position = vec4( position.xy, 1.0, 1.0 );
}`,Pye=`uniform sampler2D t2D;
uniform float backgroundIntensity;
varying vec2 vUv;
void main() {
vec4 texColor = texture2D( t2D, vUv );
#ifdef DECODE_VIDEO_TEXTURE
texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
#endif
texColor.rgb *= backgroundIntensity;
gl_FragColor = texColor;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,Dye=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,Lye=`#ifdef ENVMAP_TYPE_CUBE
uniform samplerCube envMap;
#elif defined( ENVMAP_TYPE_CUBE_UV )
uniform sampler2D envMap;
#endif
uniform float flipEnvMap;
uniform float backgroundBlurriness;
uniform float backgroundIntensity;
uniform mat3 backgroundRotation;
varying vec3 vWorldDirection;
#include <cube_uv_reflection_fragment>
void main() {
#ifdef ENVMAP_TYPE_CUBE
vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
#elif defined( ENVMAP_TYPE_CUBE_UV )
vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
#else
vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
#endif
texColor.rgb *= backgroundIntensity;
gl_FragColor = texColor;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,Oye=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
gl_Position.z = gl_Position.w;
}`,Iye=`uniform samplerCube tCube;
uniform float tFlip;
uniform float opacity;
varying vec3 vWorldDirection;
void main() {
vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
gl_FragColor = texColor;
gl_FragColor.a *= opacity;
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,zye=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
varying vec2 vHighPrecisionZW;
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <skinbase_vertex>
#include <morphinstance_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vHighPrecisionZW = gl_Position.zw;
}`,Bye=`#if DEPTH_PACKING == 3200
uniform float opacity;
#endif
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
varying vec2 vHighPrecisionZW;
void main() {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#if DEPTH_PACKING == 3200
diffuseColor.a = opacity;
#endif
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <logdepthbuf_fragment>
#ifdef USE_REVERSED_DEPTH_BUFFER
float fragCoordZ = vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ];
#else
float fragCoordZ = 0.5 * vHighPrecisionZW[ 0 ] / vHighPrecisionZW[ 1 ] + 0.5;
#endif
#if DEPTH_PACKING == 3200
gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
#elif DEPTH_PACKING == 3201
gl_FragColor = packDepthToRGBA( fragCoordZ );
#elif DEPTH_PACKING == 3202
gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
#elif DEPTH_PACKING == 3203
gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
#endif
}`,Uye=`#define DISTANCE
varying vec3 vWorldPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <skinbase_vertex>
#include <morphinstance_vertex>
#ifdef USE_DISPLACEMENTMAP
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <worldpos_vertex>
#include <clipping_planes_vertex>
vWorldPosition = worldPosition.xyz;
}`,jye=`#define DISTANCE
uniform vec3 referencePosition;
uniform float nearDistance;
uniform float farDistance;
varying vec3 vWorldPosition;
#include <common>
#include <packing>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <clipping_planes_pars_fragment>
void main () {
vec4 diffuseColor = vec4( 1.0 );
#include <clipping_planes_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
float dist = length( vWorldPosition - referencePosition );
dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
dist = saturate( dist );
gl_FragColor = packDepthToRGBA( dist );
}`,Fye=`varying vec3 vWorldDirection;
#include <common>
void main() {
vWorldDirection = transformDirection( position, modelMatrix );
#include <begin_vertex>
#include <project_vertex>
}`,Vye=`uniform sampler2D tEquirect;
varying vec3 vWorldDirection;
#include <common>
void main() {
vec3 direction = normalize( vWorldDirection );
vec2 sampleUV = equirectUv( direction );
gl_FragColor = texture2D( tEquirect, sampleUV );
#include <tonemapping_fragment>
#include <colorspace_fragment>
}`,kye=`uniform float scale;
attribute float lineDistance;
varying float vLineDistance;
#include <common>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
vLineDistance = scale * lineDistance;
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,Hye=`uniform vec3 diffuse;
uniform float opacity;
uniform float dashSize;
uniform float totalSize;
varying float vLineDistance;
#include <common>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
if ( mod( vLineDistance, totalSize ) > dashSize ) {
discard;
}
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,$ye=`#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#endif
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <envmap_vertex>
#include <fog_vertex>
}`,Gye=`uniform vec3 diffuse;
uniform float opacity;
#ifndef FLAT_SHADED
varying vec3 vNormal;
#endif
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
#ifdef USE_LIGHTMAP
vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
#else
reflectedLight.indirectDiffuse += vec3( 1.0 );
#endif
#include <aomap_fragment>
reflectedLight.indirectDiffuse *= diffuseColor.rgb;
vec3 outgoingLight = reflectedLight.indirectDiffuse;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,Wye=`#define LAMBERT
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,Kye=`#define LAMBERT
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_lambert_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_lambert_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,Xye=`#define MATCAP
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <color_pars_vertex>
#include <displacementmap_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
vViewPosition = - mvPosition.xyz;
}`,qye=`#define MATCAP
uniform vec3 diffuse;
uniform float opacity;
uniform sampler2D matcap;
varying vec3 vViewPosition;
#include <common>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
vec3 viewDir = normalize( vViewPosition );
vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
vec3 y = cross( viewDir, x );
vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
#ifdef USE_MATCAP
vec4 matcapColor = texture2D( matcap, uv );
#else
vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
#endif
vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,Yye=`#define NORMAL
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
vViewPosition = - mvPosition.xyz;
#endif
}`,Zye=`#define NORMAL
uniform float opacity;
#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
varying vec3 vViewPosition;
#endif
#include <packing>
#include <uv_pars_fragment>
#include <normal_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
#include <clipping_planes_fragment>
#include <logdepthbuf_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
#ifdef OPAQUE
gl_FragColor.a = 1.0;
#endif
}`,Qye=`#define PHONG
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <envmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <envmap_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,Jye=`#define PHONG
uniform vec3 diffuse;
uniform vec3 emissive;
uniform vec3 specular;
uniform float shininess;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_phong_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <specularmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <specularmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_phong_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
#include <envmap_fragment>
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,ebe=`#define STANDARD
varying vec3 vViewPosition;
#ifdef USE_TRANSMISSION
varying vec3 vWorldPosition;
#endif
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
#ifdef USE_TRANSMISSION
vWorldPosition = worldPosition.xyz;
#endif
}`,tbe=`#define STANDARD
#ifdef PHYSICAL
#define IOR
#define USE_SPECULAR
#endif
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float roughness;
uniform float metalness;
uniform float opacity;
#ifdef IOR
uniform float ior;
#endif
#ifdef USE_SPECULAR
uniform float specularIntensity;
uniform vec3 specularColor;
#ifdef USE_SPECULAR_COLORMAP
uniform sampler2D specularColorMap;
#endif
#ifdef USE_SPECULAR_INTENSITYMAP
uniform sampler2D specularIntensityMap;
#endif
#endif
#ifdef USE_CLEARCOAT
uniform float clearcoat;
uniform float clearcoatRoughness;
#endif
#ifdef USE_DISPERSION
uniform float dispersion;
#endif
#ifdef USE_IRIDESCENCE
uniform float iridescence;
uniform float iridescenceIOR;
uniform float iridescenceThicknessMinimum;
uniform float iridescenceThicknessMaximum;
#endif
#ifdef USE_SHEEN
uniform vec3 sheenColor;
uniform float sheenRoughness;
#ifdef USE_SHEEN_COLORMAP
uniform sampler2D sheenColorMap;
#endif
#ifdef USE_SHEEN_ROUGHNESSMAP
uniform sampler2D sheenRoughnessMap;
#endif
#endif
#ifdef USE_ANISOTROPY
uniform vec2 anisotropyVector;
#ifdef USE_ANISOTROPYMAP
uniform sampler2D anisotropyMap;
#endif
#endif
varying vec3 vViewPosition;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <iridescence_fragment>
#include <cube_uv_reflection_fragment>
#include <envmap_common_pars_fragment>
#include <envmap_physical_pars_fragment>
#include <fog_pars_fragment>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_physical_pars_fragment>
#include <transmission_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <clearcoat_pars_fragment>
#include <iridescence_pars_fragment>
#include <roughnessmap_pars_fragment>
#include <metalnessmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <roughnessmap_fragment>
#include <metalnessmap_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <clearcoat_normal_fragment_begin>
#include <clearcoat_normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_physical_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
#include <transmission_fragment>
vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
#ifdef USE_SHEEN
float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
#endif
#ifdef USE_CLEARCOAT
float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
#endif
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,nbe=`#define TOON
varying vec3 vViewPosition;
#include <common>
#include <batching_pars_vertex>
#include <uv_pars_vertex>
#include <displacementmap_pars_vertex>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <normal_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <shadowmap_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <normal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <displacementmap_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
vViewPosition = - mvPosition.xyz;
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,ibe=`#define TOON
uniform vec3 diffuse;
uniform vec3 emissive;
uniform float opacity;
#include <common>
#include <packing>
#include <dithering_pars_fragment>
#include <color_pars_fragment>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <aomap_pars_fragment>
#include <lightmap_pars_fragment>
#include <emissivemap_pars_fragment>
#include <gradientmap_pars_fragment>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <normal_pars_fragment>
#include <lights_toon_pars_fragment>
#include <shadowmap_pars_fragment>
#include <bumpmap_pars_fragment>
#include <normalmap_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
vec3 totalEmissiveRadiance = emissive;
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <color_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
#include <normal_fragment_begin>
#include <normal_fragment_maps>
#include <emissivemap_fragment>
#include <lights_toon_fragment>
#include <lights_fragment_begin>
#include <lights_fragment_maps>
#include <lights_fragment_end>
#include <aomap_fragment>
vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
#include <dithering_fragment>
}`,abe=`uniform float size;
uniform float scale;
#include <common>
#include <color_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
#ifdef USE_POINTS_UV
varying vec2 vUv;
uniform mat3 uvTransform;
#endif
void main() {
#ifdef USE_POINTS_UV
vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
#endif
#include <color_vertex>
#include <morphinstance_vertex>
#include <morphcolor_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <project_vertex>
gl_PointSize = size;
#ifdef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
#endif
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <worldpos_vertex>
#include <fog_vertex>
}`,sbe=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <color_pars_fragment>
#include <map_particle_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_particle_fragment>
#include <color_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
#include <premultiplied_alpha_fragment>
}`,rbe=`#include <common>
#include <batching_pars_vertex>
#include <fog_pars_vertex>
#include <morphtarget_pars_vertex>
#include <skinning_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <shadowmap_pars_vertex>
void main() {
#include <batching_vertex>
#include <beginnormal_vertex>
#include <morphinstance_vertex>
#include <morphnormal_vertex>
#include <skinbase_vertex>
#include <skinnormal_vertex>
#include <defaultnormal_vertex>
#include <begin_vertex>
#include <morphtarget_vertex>
#include <skinning_vertex>
#include <project_vertex>
#include <logdepthbuf_vertex>
#include <worldpos_vertex>
#include <shadowmap_vertex>
#include <fog_vertex>
}`,obe=`uniform vec3 color;
uniform float opacity;
#include <common>
#include <packing>
#include <fog_pars_fragment>
#include <bsdfs>
#include <lights_pars_begin>
#include <logdepthbuf_pars_fragment>
#include <shadowmap_pars_fragment>
#include <shadowmask_pars_fragment>
void main() {
#include <logdepthbuf_fragment>
gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,lbe=`uniform float rotation;
uniform vec2 center;
#include <common>
#include <uv_pars_vertex>
#include <fog_pars_vertex>
#include <logdepthbuf_pars_vertex>
#include <clipping_planes_pars_vertex>
void main() {
#include <uv_vertex>
vec4 mvPosition = modelViewMatrix[ 3 ];
vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
#ifndef USE_SIZEATTENUATION
bool isPerspective = isPerspectiveMatrix( projectionMatrix );
if ( isPerspective ) scale *= - mvPosition.z;
#endif
vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
vec2 rotatedPosition;
rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
mvPosition.xy += rotatedPosition;
gl_Position = projectionMatrix * mvPosition;
#include <logdepthbuf_vertex>
#include <clipping_planes_vertex>
#include <fog_vertex>
}`,cbe=`uniform vec3 diffuse;
uniform float opacity;
#include <common>
#include <uv_pars_fragment>
#include <map_pars_fragment>
#include <alphamap_pars_fragment>
#include <alphatest_pars_fragment>
#include <alphahash_pars_fragment>
#include <fog_pars_fragment>
#include <logdepthbuf_pars_fragment>
#include <clipping_planes_pars_fragment>
void main() {
vec4 diffuseColor = vec4( diffuse, opacity );
#include <clipping_planes_fragment>
vec3 outgoingLight = vec3( 0.0 );
#include <logdepthbuf_fragment>
#include <map_fragment>
#include <alphamap_fragment>
#include <alphatest_fragment>
#include <alphahash_fragment>
outgoingLight = diffuseColor.rgb;
#include <opaque_fragment>
#include <tonemapping_fragment>
#include <colorspace_fragment>
#include <fog_fragment>
}`,$n={alphahash_fragment:Pge,alphahash_pars_fragment:Dge,alphamap_fragment:Lge,alphamap_pars_fragment:Oge,alphatest_fragment:Ige,alphatest_pars_fragment:zge,aomap_fragment:Bge,aomap_pars_fragment:Uge,batching_pars_vertex:jge,batching_vertex:Fge,begin_vertex:Vge,beginnormal_vertex:kge,bsdfs:Hge,iridescence_fragment:$ge,bumpmap_pars_fragment:Gge,clipping_planes_fragment:Wge,clipping_planes_pars_fragment:Kge,clipping_planes_pars_vertex:Xge,clipping_planes_vertex:qge,color_fragment:Yge,color_pars_fragment:Zge,color_pars_vertex:Qge,color_vertex:Jge,common:eve,cube_uv_reflection_fragment:tve,defaultnormal_vertex:nve,displacementmap_pars_vertex:ive,displacementmap_vertex:ave,emissivemap_fragment:sve,emissivemap_pars_fragment:rve,colorspace_fragment:ove,colorspace_pars_fragment:lve,envmap_fragment:cve,envmap_common_pars_fragment:uve,envmap_pars_fragment:dve,envmap_pars_vertex:fve,envmap_physical_pars_fragment:wve,envmap_vertex:hve,fog_vertex:pve,fog_pars_vertex:mve,fog_fragment:gve,fog_pars_fragment:vve,gradientmap_pars_fragment:yve,lightmap_pars_fragment:bve,lights_lambert_fragment:xve,lights_lambert_pars_fragment:_ve,lights_pars_begin:Sve,lights_toon_fragment:Eve,lights_toon_pars_fragment:Mve,lights_phong_fragment:Tve,lights_phong_pars_fragment:Cve,lights_physical_fragment:Ave,lights_physical_pars_fragment:Rve,lights_fragment_begin:Nve,lights_fragment_maps:Pve,lights_fragment_end:Dve,logdepthbuf_fragment:Lve,logdepthbuf_pars_fragment:Ove,logdepthbuf_pars_vertex:Ive,logdepthbuf_vertex:zve,map_fragment:Bve,map_pars_fragment:Uve,map_particle_fragment:jve,map_particle_pars_fragment:Fve,metalnessmap_fragment:Vve,metalnessmap_pars_fragment:kve,morphinstance_vertex:Hve,morphcolor_vertex:$ve,morphnormal_vertex:Gve,morphtarget_pars_vertex:Wve,morphtarget_vertex:Kve,normal_fragment_begin:Xve,normal_fragment_maps:qve,normal_pars_fragment:Yve,normal_pars_vertex:Zve,normal_vertex:Qve,normalmap_pars_fragment:Jve,clearcoat_normal_fragment_begin:eye,clearcoat_normal_fragment_maps:tye,clearcoat_pars_fragment:nye,iridescence_pars_fragment:iye,opaque_fragment:aye,packing:sye,premultiplied_alpha_fragment:rye,project_vertex:oye,dithering_fragment:lye,dithering_pars_fragment:cye,roughnessmap_fragment:uye,roughnessmap_pars_fragment:dye,shadowmap_pars_fragment:fye,shadowmap_pars_vertex:hye,shadowmap_vertex:pye,shadowmask_pars_fragment:mye,skinbase_vertex:gye,skinning_pars_vertex:vye,skinning_vertex:yye,skinnormal_vertex:bye,specularmap_fragment:xye,specularmap_pars_fragment:_ye,tonemapping_fragment:Sye,tonemapping_pars_fragment:wye,transmission_fragment:Eye,transmission_pars_fragment:Mye,uv_pars_fragment:Tye,uv_pars_vertex:Cye,uv_vertex:Aye,worldpos_vertex:Rye,background_vert:Nye,background_frag:Pye,backgroundCube_vert:Dye,backgroundCube_frag:Lye,cube_vert:Oye,cube_frag:Iye,depth_vert:zye,depth_frag:Bye,distanceRGBA_vert:Uye,distanceRGBA_frag:jye,equirect_vert:Fye,equirect_frag:Vye,linedashed_vert:kye,linedashed_frag:Hye,meshbasic_vert:$ye,meshbasic_frag:Gye,meshlambert_vert:Wye,meshlambert_frag:Kye,meshmatcap_vert:Xye,meshmatcap_frag:qye,meshnormal_vert:Yye,meshnormal_frag:Zye,meshphong_vert:Qye,meshphong_frag:Jye,meshphysical_vert:ebe,meshphysical_frag:tbe,meshtoon_vert:nbe,meshtoon_frag:ibe,points_vert:abe,points_frag:sbe,shadow_vert:rbe,shadow_frag:obe,sprite_vert:lbe,sprite_frag:cbe},Gt={common:{diffuse:{value:new Wt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new jn},alphaMap:{value:null},alphaMapTransform:{value:new jn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new jn}},envmap:{envMap:{value:null},envMapRotation:{value:new jn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new jn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new jn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new jn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new jn},normalScale:{value:new _t(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new jn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new jn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new jn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new jn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Wt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Wt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new jn},alphaTest:{value:0},uvTransform:{value:new jn}},sprite:{diffuse:{value:new Wt(16777215)},opacity:{value:1},center:{value:new _t(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new jn},alphaMap:{value:null},alphaMapTransform:{value:new jn},alphaTest:{value:0}}},lc={basic:{uniforms:Fr([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.fog]),vertexShader:$n.meshbasic_vert,fragmentShader:$n.meshbasic_frag},lambert:{uniforms:Fr([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Wt(0)}}]),vertexShader:$n.meshlambert_vert,fragmentShader:$n.meshlambert_frag},phong:{uniforms:Fr([Gt.common,Gt.specularmap,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,Gt.lights,{emissive:{value:new Wt(0)},specular:{value:new Wt(1118481)},shininess:{value:30}}]),vertexShader:$n.meshphong_vert,fragmentShader:$n.meshphong_frag},standard:{uniforms:Fr([Gt.common,Gt.envmap,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.roughnessmap,Gt.metalnessmap,Gt.fog,Gt.lights,{emissive:{value:new Wt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:$n.meshphysical_vert,fragmentShader:$n.meshphysical_frag},toon:{uniforms:Fr([Gt.common,Gt.aomap,Gt.lightmap,Gt.emissivemap,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.gradientmap,Gt.fog,Gt.lights,{emissive:{value:new Wt(0)}}]),vertexShader:$n.meshtoon_vert,fragmentShader:$n.meshtoon_frag},matcap:{uniforms:Fr([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,Gt.fog,{matcap:{value:null}}]),vertexShader:$n.meshmatcap_vert,fragmentShader:$n.meshmatcap_frag},points:{uniforms:Fr([Gt.points,Gt.fog]),vertexShader:$n.points_vert,fragmentShader:$n.points_frag},dashed:{uniforms:Fr([Gt.common,Gt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:$n.linedashed_vert,fragmentShader:$n.linedashed_frag},depth:{uniforms:Fr([Gt.common,Gt.displacementmap]),vertexShader:$n.depth_vert,fragmentShader:$n.depth_frag},normal:{uniforms:Fr([Gt.common,Gt.bumpmap,Gt.normalmap,Gt.displacementmap,{opacity:{value:1}}]),vertexShader:$n.meshnormal_vert,fragmentShader:$n.meshnormal_frag},sprite:{uniforms:Fr([Gt.sprite,Gt.fog]),vertexShader:$n.sprite_vert,fragmentShader:$n.sprite_frag},background:{uniforms:{uvTransform:{value:new jn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:$n.background_vert,fragmentShader:$n.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new jn}},vertexShader:$n.backgroundCube_vert,fragmentShader:$n.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:$n.cube_vert,fragmentShader:$n.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:$n.equirect_vert,fragmentShader:$n.equirect_frag},distanceRGBA:{uniforms:Fr([Gt.common,Gt.displacementmap,{referencePosition:{value:new fe},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:$n.distanceRGBA_vert,fragmentShader:$n.distanceRGBA_frag},shadow:{uniforms:Fr([Gt.lights,Gt.fog,{color:{value:new Wt(0)},opacity:{value:1}}]),vertexShader:$n.shadow_vert,fragmentShader:$n.shadow_frag}};lc.physical={uniforms:Fr([lc.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new jn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new jn},clearcoatNormalScale:{value:new _t(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new jn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new jn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new jn},sheen:{value:0},sheenColor:{value:new Wt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new jn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new jn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new jn},transmissionSamplerSize:{value:new _t},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new jn},attenuationDistance:{value:0},attenuationColor:{value:new Wt(0)},specularColor:{value:new Wt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new jn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new jn},anisotropyVector:{value:new _t},anisotropyMap:{value:null},anisotropyMapTransform:{value:new jn}}]),vertexShader:$n.meshphysical_vert,fragmentShader:$n.meshphysical_frag};const Z_={r:0,b:0,g:0},Ep=new xo,ube=new wn;function dbe(t,e,n,i,a,s,r){const o=new Wt(0);let c=s===!0?0:1,u,h,d=null,p=0,g=null;function b(C){let A=C.isScene===!0?C.background:null;return A&&A.isTexture&&(A=(C.backgroundBlurriness>0?n:e).get(A)),A}function w(C){let A=!1;const N=b(C);N===null?S(o,c):N&&N.isColor&&(S(N,1),A=!0);const R=t.xr.getEnvironmentBlendMode();R==="additive"?i.buffers.color.setClear(0,0,0,1,r):R==="alpha-blend"&&i.buffers.color.setClear(0,0,0,0,r),(t.autoClear||A)&&(i.buffers.depth.setTest(!0),i.buffers.depth.setMask(!0),i.buffers.color.setMask(!0),t.clear(t.autoClearColor,t.autoClearDepth,t.autoClearStencil))}function x(C,A){const N=b(A);N&&(N.isCubeTexture||N.mapping===cv)?(h===void 0&&(h=new Qt(new fo(1,1,1),new pc({name:"BackgroundCubeMaterial",uniforms:Wg(lc.backgroundCube.uniforms),vertexShader:lc.backgroundCube.vertexShader,fragmentShader:lc.backgroundCube.fragmentShader,side:Kr,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),h.geometry.deleteAttribute("normal"),h.geometry.deleteAttribute("uv"),h.onBeforeRender=function(R,D,B){this.matrixWorld.copyPosition(B.matrixWorld)},Object.defineProperty(h.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),a.update(h)),Ep.copy(A.backgroundRotation),Ep.x*=-1,Ep.y*=-1,Ep.z*=-1,N.isCubeTexture&&N.isRenderTargetTexture===!1&&(Ep.y*=-1,Ep.z*=-1),h.material.uniforms.envMap.value=N,h.material.uniforms.flipEnvMap.value=N.isCubeTexture&&N.isRenderTargetTexture===!1?-1:1,h.material.uniforms.backgroundBlurriness.value=A.backgroundBlurriness,h.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,h.material.uniforms.backgroundRotation.value.setFromMatrix4(ube.makeRotationFromEuler(Ep)),h.material.toneMapped=mi.getTransfer(N.colorSpace)!==Bi,(d!==N||p!==N.version||g!==t.toneMapping)&&(h.material.needsUpdate=!0,d=N,p=N.version,g=t.toneMapping),h.layers.enableAll(),C.unshift(h,h.geometry,h.material,0,0,null)):N&&N.isTexture&&(u===void 0&&(u=new Qt(new Bo(2,2),new pc({name:"BackgroundMaterial",uniforms:Wg(lc.background.uniforms),vertexShader:lc.background.vertexShader,fragmentShader:lc.background.fragmentShader,side:Ed,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),u.geometry.deleteAttribute("normal"),Object.defineProperty(u.material,"map",{get:function(){return this.uniforms.t2D.value}}),a.update(u)),u.material.uniforms.t2D.value=N,u.material.uniforms.backgroundIntensity.value=A.backgroundIntensity,u.material.toneMapped=mi.getTransfer(N.colorSpace)!==Bi,N.matrixAutoUpdate===!0&&N.updateMatrix(),u.material.uniforms.uvTransform.value.copy(N.matrix),(d!==N||p!==N.version||g!==t.toneMapping)&&(u.material.needsUpdate=!0,d=N,p=N.version,g=t.toneMapping),u.layers.enableAll(),C.unshift(u,u.geometry,u.material,0,0,null))}function S(C,A){C.getRGB(Z_,p$(t)),i.buffers.color.setClear(Z_.r,Z_.g,Z_.b,A,r)}function M(){h!==void 0&&(h.geometry.dispose(),h.material.dispose(),h=void 0),u!==void 0&&(u.geometry.dispose(),u.material.dispose(),u=void 0)}return{getClearColor:function(){return o},setClearColor:function(C,A=1){o.set(C),c=A,S(o,c)},getClearAlpha:function(){return c},setClearAlpha:function(C){c=C,S(o,c)},render:w,addToRenderList:x,dispose:M}}function fbe(t,e){const n=t.getParameter(t.MAX_VERTEX_ATTRIBS),i={},a=p(null);let s=a,r=!1;function o(I,U,$,G,k){let X=!1;const V=d(G,$,U);s!==V&&(s=V,u(s.object)),X=g(I,G,$,k),X&&b(I,G,$,k),k!==null&&e.update(k,t.ELEMENT_ARRAY_BUFFER),(X||r)&&(r=!1,A(I,U,$,G),k!==null&&t.bindBuffer(t.ELEMENT_ARRAY_BUFFER,e.get(k).buffer))}function c(){return t.createVertexArray()}function u(I){return t.bindVertexArray(I)}function h(I){return t.deleteVertexArray(I)}function d(I,U,$){const G=$.wireframe===!0;let k=i[I.id];k===void 0&&(k={},i[I.id]=k);let X=k[U.id];X===void 0&&(X={},k[U.id]=X);let V=X[G];return V===void 0&&(V=p(c()),X[G]=V),V}function p(I){const U=[],$=[],G=[];for(let k=0;k<n;k++)U[k]=0,$[k]=0,G[k]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:U,enabledAttributes:$,attributeDivisors:G,object:I,attributes:{},index:null}}function g(I,U,$,G){const k=s.attributes,X=U.attributes;let V=0;const H=$.getAttributes();for(const W in H)if(H[W].location>=0){const Y=k[W];let K=X[W];if(K===void 0&&(W==="instanceMatrix"&&I.instanceMatrix&&(K=I.instanceMatrix),W==="instanceColor"&&I.instanceColor&&(K=I.instanceColor)),Y===void 0||Y.attribute!==K||K&&Y.data!==K.data)return!0;V++}return s.attributesNum!==V||s.index!==G}function b(I,U,$,G){const k={},X=U.attributes;let V=0;const H=$.getAttributes();for(const W in H)if(H[W].location>=0){let Y=X[W];Y===void 0&&(W==="instanceMatrix"&&I.instanceMatrix&&(Y=I.instanceMatrix),W==="instanceColor"&&I.instanceColor&&(Y=I.instanceColor));const K={};K.attribute=Y,Y&&Y.data&&(K.data=Y.data),k[W]=K,V++}s.attributes=k,s.attributesNum=V,s.index=G}function w(){const I=s.newAttributes;for(let U=0,$=I.length;U<$;U++)I[U]=0}function x(I){S(I,0)}function S(I,U){const $=s.newAttributes,G=s.enabledAttributes,k=s.attributeDivisors;$[I]=1,G[I]===0&&(t.enableVertexAttribArray(I),G[I]=1),k[I]!==U&&(t.vertexAttribDivisor(I,U),k[I]=U)}function M(){const I=s.newAttributes,U=s.enabledAttributes;for(let $=0,G=U.length;$<G;$++)U[$]!==I[$]&&(t.disableVertexAttribArray($),U[$]=0)}function C(I,U,$,G,k,X,V){V===!0?t.vertexAttribIPointer(I,U,$,k,X):t.vertexAttribPointer(I,U,$,G,k,X)}function A(I,U,$,G){w();const k=G.attributes,X=$.getAttributes(),V=U.defaultAttributeValues;for(const H in X){const W=X[H];if(W.location>=0){let J=k[H];if(J===void 0&&(H==="instanceMatrix"&&I.instanceMatrix&&(J=I.instanceMatrix),H==="instanceColor"&&I.instanceColor&&(J=I.instanceColor)),J!==void 0){const Y=J.normalized,K=J.itemSize,ee=e.get(J);if(ee===void 0)continue;const ie=ee.buffer,Z=ee.type,ue=ee.bytesPerElement,se=Z===t.INT||Z===t.UNSIGNED_INT||J.gpuType===Tw;if(J.isInterleavedBufferAttribute){const ae=J.data,ce=ae.stride,pe=J.offset;if(ae.isInstancedInterleavedBuffer){for(let ye=0;ye<W.locationSize;ye++)S(W.location+ye,ae.meshPerAttribute);I.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=ae.meshPerAttribute*ae.count)}else for(let ye=0;ye<W.locationSize;ye++)x(W.location+ye);t.bindBuffer(t.ARRAY_BUFFER,ie);for(let ye=0;ye<W.locationSize;ye++)C(W.location+ye,K/W.locationSize,Z,Y,ce*ue,(pe+K/W.locationSize*ye)*ue,se)}else{if(J.isInstancedBufferAttribute){for(let ae=0;ae<W.locationSize;ae++)S(W.location+ae,J.meshPerAttribute);I.isInstancedMesh!==!0&&G._maxInstanceCount===void 0&&(G._maxInstanceCount=J.meshPerAttribute*J.count)}else for(let ae=0;ae<W.locationSize;ae++)x(W.location+ae);t.bindBuffer(t.ARRAY_BUFFER,ie);for(let ae=0;ae<W.locationSize;ae++)C(W.location+ae,K/W.locationSize,Z,Y,K*ue,K/W.locationSize*ae*ue,se)}}else if(V!==void 0){const Y=V[H];if(Y!==void 0)switch(Y.length){case 2:t.vertexAttrib2fv(W.location,Y);break;case 3:t.vertexAttrib3fv(W.location,Y);break;case 4:t.vertexAttrib4fv(W.location,Y);break;default:t.vertexAttrib1fv(W.location,Y)}}}}M()}function N(){B();for(const I in i){const U=i[I];for(const $ in U){const G=U[$];for(const k in G)h(G[k].object),delete G[k];delete U[$]}delete i[I]}}function R(I){if(i[I.id]===void 0)return;const U=i[I.id];for(const $ in U){const G=U[$];for(const k in G)h(G[k].object),delete G[k];delete U[$]}delete i[I.id]}function D(I){for(const U in i){const $=i[U];if($[I.id]===void 0)continue;const G=$[I.id];for(const k in G)h(G[k].object),delete G[k];delete $[I.id]}}function B(){z(),r=!0,s!==a&&(s=a,u(s.object))}function z(){a.geometry=null,a.program=null,a.wireframe=!1}return{setup:o,reset:B,resetDefaultState:z,dispose:N,releaseStatesOfGeometry:R,releaseStatesOfProgram:D,initAttributes:w,enableAttribute:x,disableUnusedAttributes:M}}function hbe(t,e,n){let i;function a(u){i=u}function s(u,h){t.drawArrays(i,u,h),n.update(h,i,1)}function r(u,h,d){d!==0&&(t.drawArraysInstanced(i,u,h,d),n.update(h,i,d))}function o(u,h,d){if(d===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(i,u,0,h,0,d);let g=0;for(let b=0;b<d;b++)g+=h[b];n.update(g,i,1)}function c(u,h,d,p){if(d===0)return;const g=e.get("WEBGL_multi_draw");if(g===null)for(let b=0;b<u.length;b++)r(u[b],h[b],p[b]);else{g.multiDrawArraysInstancedWEBGL(i,u,0,h,0,p,0,d);let b=0;for(let w=0;w<d;w++)b+=h[w]*p[w];n.update(b,i,1)}}this.setMode=a,this.render=s,this.renderInstances=r,this.renderMultiDraw=o,this.renderMultiDrawInstances=c}function pbe(t,e,n,i){let a;function s(){if(a!==void 0)return a;if(e.has("EXT_texture_filter_anisotropic")===!0){const D=e.get("EXT_texture_filter_anisotropic");a=t.getParameter(D.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else a=0;return a}function r(D){return!(D!==fr&&i.convert(D)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_FORMAT))}function o(D){const B=D===bm&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(D!==Pl&&i.convert(D)!==t.getParameter(t.IMPLEMENTATION_COLOR_READ_TYPE)&&D!==Hr&&!B)}function c(D){if(D==="highp"){if(t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.HIGH_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.HIGH_FLOAT).precision>0)return"highp";D="mediump"}return D==="mediump"&&t.getShaderPrecisionFormat(t.VERTEX_SHADER,t.MEDIUM_FLOAT).precision>0&&t.getShaderPrecisionFormat(t.FRAGMENT_SHADER,t.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let u=n.precision!==void 0?n.precision:"highp";const h=c(u);h!==u&&(console.warn("THREE.WebGLRenderer:",u,"not supported, using",h,"instead."),u=h);const d=n.logarithmicDepthBuffer===!0,p=n.reversedDepthBuffer===!0&&e.has("EXT_clip_control"),g=t.getParameter(t.MAX_TEXTURE_IMAGE_UNITS),b=t.getParameter(t.MAX_VERTEX_TEXTURE_IMAGE_UNITS),w=t.getParameter(t.MAX_TEXTURE_SIZE),x=t.getParameter(t.MAX_CUBE_MAP_TEXTURE_SIZE),S=t.getParameter(t.MAX_VERTEX_ATTRIBS),M=t.getParameter(t.MAX_VERTEX_UNIFORM_VECTORS),C=t.getParameter(t.MAX_VARYING_VECTORS),A=t.getParameter(t.MAX_FRAGMENT_UNIFORM_VECTORS),N=b>0,R=t.getParameter(t.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:s,getMaxPrecision:c,textureFormatReadable:r,textureTypeReadable:o,precision:u,logarithmicDepthBuffer:d,reversedDepthBuffer:p,maxTextures:g,maxVertexTextures:b,maxTextureSize:w,maxCubemapSize:x,maxAttributes:S,maxVertexUniforms:M,maxVaryings:C,maxFragmentUniforms:A,vertexTextures:N,maxSamples:R}}function mbe(t){const e=this;let n=null,i=0,a=!1,s=!1;const r=new Rf,o=new jn,c={value:null,needsUpdate:!1};this.uniform=c,this.numPlanes=0,this.numIntersection=0,this.init=function(d,p){const g=d.length!==0||p||i!==0||a;return a=p,i=d.length,g},this.beginShadows=function(){s=!0,h(null)},this.endShadows=function(){s=!1},this.setGlobalState=function(d,p){n=h(d,p,0)},this.setState=function(d,p,g){const b=d.clippingPlanes,w=d.clipIntersection,x=d.clipShadows,S=t.get(d);if(!a||b===null||b.length===0||s&&!x)s?h(null):u();else{const M=s?0:i,C=M*4;let A=S.clippingState||null;c.value=A,A=h(b,p,C,g);for(let N=0;N!==C;++N)A[N]=n[N];S.clippingState=A,this.numIntersection=w?this.numPlanes:0,this.numPlanes+=M}};function u(){c.value!==n&&(c.value=n,c.needsUpdate=i>0),e.numPlanes=i,e.numIntersection=0}function h(d,p,g,b){const w=d!==null?d.length:0;let x=null;if(w!==0){if(x=c.value,b!==!0||x===null){const S=g+w*4,M=p.matrixWorldInverse;o.getNormalMatrix(M),(x===null||x.length<S)&&(x=new Float32Array(S));for(let C=0,A=g;C!==w;++C,A+=4)r.copy(d[C]).applyMatrix4(M,o),r.normal.toArray(x,A),x[A+3]=r.constant}c.value=x,c.needsUpdate=!0}return e.numPlanes=w,e.numIntersection=0,x}}function gbe(t){let e=new WeakMap;function n(r,o){return o===_1?r.mapping=Md:o===S1&&(r.mapping=Jf),r}function i(r){if(r&&r.isTexture){const o=r.mapping;if(o===_1||o===S1)if(e.has(r)){const c=e.get(r).texture;return n(c,r.mapping)}else{const c=r.image;if(c&&c.height>0){const u=new v$(c.height);return u.fromEquirectangularTexture(t,r),e.set(r,u),r.addEventListener("dispose",a),n(u.texture,r.mapping)}else return null}}return r}function a(r){const o=r.target;o.removeEventListener("dispose",a);const c=e.get(o);c!==void 0&&(e.delete(o),c.dispose())}function s(){e=new WeakMap}return{get:i,dispose:s}}const xg=4,HL=[.125,.215,.35,.446,.526,.582],Np=20,kM=new px,$L=new Wt;let HM=null,$M=0,GM=0,WM=!1;const Rp=(1+Math.sqrt(5))/2,eg=1/Rp,GL=[new fe(-Rp,eg,0),new fe(Rp,eg,0),new fe(-eg,0,Rp),new fe(eg,0,Rp),new fe(0,Rp,-eg),new fe(0,Rp,eg),new fe(-1,1,-1),new fe(1,1,-1),new fe(-1,1,1),new fe(1,1,1)],vbe=new fe;class k5{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,n=0,i=.1,a=100,s={}){const{size:r=256,position:o=vbe}=s;HM=this._renderer.getRenderTarget(),$M=this._renderer.getActiveCubeFace(),GM=this._renderer.getActiveMipmapLevel(),WM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(r);const c=this._allocateTargets();return c.depthBuffer=!0,this._sceneToCubeUV(e,i,a,c,o),n>0&&this._blur(c,0,0,n),this._applyPMREM(c),this._cleanup(c),c}fromEquirectangular(e,n=null){return this._fromTexture(e,n)}fromCubemap(e,n=null){return this._fromTexture(e,n)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=XL(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=KL(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(HM,$M,GM),this._renderer.xr.enabled=WM,e.scissorTest=!1,Q_(e,0,0,e.width,e.height)}_fromTexture(e,n){e.mapping===Md||e.mapping===Jf?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),HM=this._renderer.getRenderTarget(),$M=this._renderer.getActiveCubeFace(),GM=this._renderer.getActiveMipmapLevel(),WM=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const i=n||this._allocateTargets();return this._textureToCubeUV(e,i),this._applyPMREM(i),this._cleanup(i),i}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),n=4*this._cubeSize,i={magFilter:ja,minFilter:ja,generateMipmaps:!1,type:bm,format:fr,colorSpace:eh,depthBuffer:!1},a=WL(e,n,i);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==n){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=WL(e,n,i);const{_lodMax:s}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=ybe(s)),this._blurMaterial=bbe(s,e,n)}return a}_compileMaterial(e){const n=new Qt(this._lodPlanes[0],e);this._renderer.compile(n,kM)}_sceneToCubeUV(e,n,i,a,s){const c=new Ms(90,1,n,i),u=[1,-1,1,1,1,1],h=[1,1,1,-1,-1,-1],d=this._renderer,p=d.autoClear,g=d.toneMapping;d.getClearColor($L),d.toneMapping=mu,d.autoClear=!1,d.state.buffers.depth.getReversed()&&(d.setRenderTarget(a),d.clearDepth(),d.setRenderTarget(null));const w=new Eu({name:"PMREM.Background",side:Kr,depthWrite:!1,depthTest:!1}),x=new Qt(new fo,w);let S=!1;const M=e.background;M?M.isColor&&(w.color.copy(M),e.background=null,S=!0):(w.color.copy($L),S=!0);for(let C=0;C<6;C++){const A=C%3;A===0?(c.up.set(0,u[C],0),c.position.set(s.x,s.y,s.z),c.lookAt(s.x+h[C],s.y,s.z)):A===1?(c.up.set(0,0,u[C]),c.position.set(s.x,s.y,s.z),c.lookAt(s.x,s.y+h[C],s.z)):(c.up.set(0,u[C],0),c.position.set(s.x,s.y,s.z),c.lookAt(s.x,s.y,s.z+h[C]));const N=this._cubeSize;Q_(a,A*N,C>2?N:0,N,N),d.setRenderTarget(a),S&&d.render(x,c),d.render(e,c)}x.geometry.dispose(),x.material.dispose(),d.toneMapping=g,d.autoClear=p,e.background=M}_textureToCubeUV(e,n){const i=this._renderer,a=e.mapping===Md||e.mapping===Jf;a?(this._cubemapMaterial===null&&(this._cubemapMaterial=XL()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=KL());const s=a?this._cubemapMaterial:this._equirectMaterial,r=new Qt(this._lodPlanes[0],s),o=s.uniforms;o.envMap.value=e;const c=this._cubeSize;Q_(n,0,0,3*c,2*c),i.setRenderTarget(n),i.render(r,kM)}_applyPMREM(e){const n=this._renderer,i=n.autoClear;n.autoClear=!1;const a=this._lodPlanes.length;for(let s=1;s<a;s++){const r=Math.sqrt(this._sigmas[s]*this._sigmas[s]-this._sigmas[s-1]*this._sigmas[s-1]),o=GL[(a-s-1)%GL.length];this._blur(e,s-1,s,r,o)}n.autoClear=i}_blur(e,n,i,a,s){const r=this._pingPongRenderTarget;this._halfBlur(e,r,n,i,a,"latitudinal",s),this._halfBlur(r,e,i,i,a,"longitudinal",s)}_halfBlur(e,n,i,a,s,r,o){const c=this._renderer,u=this._blurMaterial;r!=="latitudinal"&&r!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const h=3,d=new Qt(this._lodPlanes[a],u),p=u.uniforms,g=this._sizeLods[i]-1,b=isFinite(s)?Math.PI/(2*g):2*Math.PI/(2*Np-1),w=s/b,x=isFinite(s)?1+Math.floor(h*w):Np;x>Np&&console.warn(`sigmaRadians, ${s}, is too large and will clip, as it requested ${x} samples when the maximum is set to ${Np}`);const S=[];let M=0;for(let D=0;D<Np;++D){const B=D/w,z=Math.exp(-B*B/2);S.push(z),D===0?M+=z:D<x&&(M+=2*z)}for(let D=0;D<S.length;D++)S[D]=S[D]/M;p.envMap.value=e.texture,p.samples.value=x,p.weights.value=S,p.latitudinal.value=r==="latitudinal",o&&(p.poleAxis.value=o);const{_lodMax:C}=this;p.dTheta.value=b,p.mipInt.value=C-i;const A=this._sizeLods[a],N=3*A*(a>C-xg?a-C+xg:0),R=4*(this._cubeSize-A);Q_(n,N,R,3*A,2*A),c.setRenderTarget(n),c.render(d,kM)}}function ybe(t){const e=[],n=[],i=[];let a=t;const s=t-xg+1+HL.length;for(let r=0;r<s;r++){const o=Math.pow(2,a);n.push(o);let c=1/o;r>t-xg?c=HL[r-t+xg-1]:r===0&&(c=0),i.push(c);const u=1/(o-2),h=-u,d=1+u,p=[h,h,d,h,d,d,h,h,d,d,h,d],g=6,b=6,w=3,x=2,S=1,M=new Float32Array(w*b*g),C=new Float32Array(x*b*g),A=new Float32Array(S*b*g);for(let R=0;R<g;R++){const D=R%3*2/3-1,B=R>2?0:-1,z=[D,B,0,D+2/3,B,0,D+2/3,B+1,0,D,B,0,D+2/3,B+1,0,D,B+1,0];M.set(z,w*b*R),C.set(p,x*b*R);const I=[R,R,R,R,R,R];A.set(I,S*b*R)}const N=new Pn;N.setAttribute("position",new $i(M,w)),N.setAttribute("uv",new $i(C,x)),N.setAttribute("faceIndex",new $i(A,S)),e.push(N),a>xg&&a--}return{lodPlanes:e,sizeLods:n,sigmas:i}}function WL(t,e,n){const i=new hc(t,e,n);return i.texture.mapping=cv,i.texture.name="PMREM.cubeUv",i.scissorTest=!0,i}function Q_(t,e,n,i,a){t.viewport.set(e,n,i,a),t.scissor.set(e,n,i,a)}function bbe(t,e,n){const i=new Float32Array(Np),a=new fe(0,1,0);return new pc({name:"SphericalGaussianBlur",defines:{n:Np,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/n,CUBEUV_MAX_MIP:`${t}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:i},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:a}},vertexShader:U6(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
uniform int samples;
uniform float weights[ n ];
uniform bool latitudinal;
uniform float dTheta;
uniform float mipInt;
uniform vec3 poleAxis;
#define ENVMAP_TYPE_CUBE_UV
#include <cube_uv_reflection_fragment>
vec3 getSample( float theta, vec3 axis ) {
float cosTheta = cos( theta );
// Rodrigues' axis-angle rotation
vec3 sampleDirection = vOutputDirection * cosTheta
+ cross( axis, vOutputDirection ) * sin( theta )
+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
return bilinearCubeUV( envMap, sampleDirection, mipInt );
}
void main() {
vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
}
axis = normalize( axis );
gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
for ( int i = 1; i < n; i++ ) {
if ( i >= samples ) {
break;
}
float theta = dTheta * float( i );
gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
}
}
`,blending:xd,depthTest:!1,depthWrite:!1})}function KL(){return new pc({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:U6(),fragmentShader:`
precision mediump float;
precision mediump int;
varying vec3 vOutputDirection;
uniform sampler2D envMap;
#include <common>
void main() {
vec3 outputDirection = normalize( vOutputDirection );
vec2 uv = equirectUv( outputDirection );
gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
}
`,blending:xd,depthTest:!1,depthWrite:!1})}function XL(){return new pc({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:U6(),fragmentShader:`
precision mediump float;
precision mediump int;
uniform float flipEnvMap;
varying vec3 vOutputDirection;
uniform samplerCube envMap;
void main() {
gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
}
`,blending:xd,depthTest:!1,depthWrite:!1})}function U6(){return`
precision mediump float;
precision mediump int;
attribute float faceIndex;
varying vec3 vOutputDirection;
// RH coordinate system; PMREM face-indexing convention
vec3 getDirection( vec2 uv, float face ) {
uv = 2.0 * uv - 1.0;
vec3 direction = vec3( uv, 1.0 );
if ( face == 0.0 ) {
direction = direction.zyx; // ( 1, v, u ) pos x
} else if ( face == 1.0 ) {
direction = direction.xzy;
direction.xz *= -1.0; // ( -u, 1, -v ) pos y
} else if ( face == 2.0 ) {
direction.x *= -1.0; // ( -u, v, 1 ) pos z
} else if ( face == 3.0 ) {
direction = direction.zyx;
direction.xz *= -1.0; // ( -1, v, -u ) neg x
} else if ( face == 4.0 ) {
direction = direction.xzy;
direction.xy *= -1.0; // ( -u, -1, v ) neg y
} else if ( face == 5.0 ) {
direction.z *= -1.0; // ( u, v, -1 ) neg z
}
return direction;
}
void main() {
vOutputDirection = getDirection( uv, faceIndex );
gl_Position = vec4( position, 1.0 );
}
`}function xbe(t){let e=new WeakMap,n=null;function i(o){if(o&&o.isTexture){const c=o.mapping,u=c===_1||c===S1,h=c===Md||c===Jf;if(u||h){let d=e.get(o);const p=d!==void 0?d.texture.pmremVersion:0;if(o.isRenderTargetTexture&&o.pmremVersion!==p)return n===null&&(n=new k5(t)),d=u?n.fromEquirectangular(o,d):n.fromCubemap(o,d),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),d.texture;if(d!==void 0)return d.texture;{const g=o.image;return u&&g&&g.height>0||h&&g&&a(g)?(n===null&&(n=new k5(t)),d=u?n.fromEquirectangular(o):n.fromCubemap(o),d.texture.pmremVersion=o.pmremVersion,e.set(o,d),o.addEventListener("dispose",s),d.texture):null}}}return o}function a(o){let c=0;const u=6;for(let h=0;h<u;h++)o[h]!==void 0&&c++;return c===u}function s(o){const c=o.target;c.removeEventListener("dispose",s);const u=e.get(c);u!==void 0&&(e.delete(c),u.dispose())}function r(){e=new WeakMap,n!==null&&(n.dispose(),n=null)}return{get:i,dispose:r}}function _be(t){const e={};function n(i){if(e[i]!==void 0)return e[i];let a;switch(i){case"WEBGL_depth_texture":a=t.getExtension("WEBGL_depth_texture")||t.getExtension("MOZ_WEBGL_depth_texture")||t.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":a=t.getExtension("EXT_texture_filter_anisotropic")||t.getExtension("MOZ_EXT_texture_filter_anisotropic")||t.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":a=t.getExtension("WEBGL_compressed_texture_s3tc")||t.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":a=t.getExtension("WEBGL_compressed_texture_pvrtc")||t.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:a=t.getExtension(i)}return e[i]=a,a}return{has:function(i){return n(i)!==null},init:function(){n("EXT_color_buffer_float"),n("WEBGL_clip_cull_distance"),n("OES_texture_float_linear"),n("EXT_color_buffer_half_float"),n("WEBGL_multisampled_render_to_texture"),n("WEBGL_render_shared_exponent")},get:function(i){const a=n(i);return a===null&&N1("THREE.WebGLRenderer: "+i+" extension not supported."),a}}}function Sbe(t,e,n,i){const a={},s=new WeakMap;function r(d){const p=d.target;p.index!==null&&e.remove(p.index);for(const b in p.attributes)e.remove(p.attributes[b]);p.removeEventListener("dispose",r),delete a[p.id];const g=s.get(p);g&&(e.remove(g),s.delete(p)),i.releaseStatesOfGeometry(p),p.isInstancedBufferGeometry===!0&&delete p._maxInstanceCount,n.memory.geometries--}function o(d,p){return a[p.id]===!0||(p.addEventListener("dispose",r),a[p.id]=!0,n.memory.geometries++),p}function c(d){const p=d.attributes;for(const g in p)e.update(p[g],t.ARRAY_BUFFER)}function u(d){const p=[],g=d.index,b=d.attributes.position;let w=0;if(g!==null){const M=g.array;w=g.version;for(let C=0,A=M.length;C<A;C+=3){const N=M[C+0],R=M[C+1],D=M[C+2];p.push(N,R,R,D,D,N)}}else if(b!==void 0){const M=b.array;w=b.version;for(let C=0,A=M.length/3-1;C<A;C+=3){const N=C+0,R=C+1,D=C+2;p.push(N,R,R,D,D,N)}}else return;const x=new(u$(p)?d6:u6)(p,1);x.version=w;const S=s.get(d);S&&e.remove(S),s.set(d,x)}function h(d){const p=s.get(d);if(p){const g=d.index;g!==null&&p.version<g.version&&u(d)}else u(d);return s.get(d)}return{get:o,update:c,getWireframeAttribute:h}}function wbe(t,e,n){let i;function a(p){i=p}let s,r;function o(p){s=p.type,r=p.bytesPerElement}function c(p,g){t.drawElements(i,g,s,p*r),n.update(g,i,1)}function u(p,g,b){b!==0&&(t.drawElementsInstanced(i,g,s,p*r,b),n.update(g,i,b))}function h(p,g,b){if(b===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(i,g,0,s,p,0,b);let x=0;for(let S=0;S<b;S++)x+=g[S];n.update(x,i,1)}function d(p,g,b,w){if(b===0)return;const x=e.get("WEBGL_multi_draw");if(x===null)for(let S=0;S<p.length;S++)u(p[S]/r,g[S],w[S]);else{x.multiDrawElementsInstancedWEBGL(i,g,0,s,p,0,w,0,b);let S=0;for(let M=0;M<b;M++)S+=g[M]*w[M];n.update(S,i,1)}}this.setMode=a,this.setIndex=o,this.render=c,this.renderInstances=u,this.renderMultiDraw=h,this.renderMultiDrawInstances=d}function Ebe(t){const e={geometries:0,textures:0},n={frame:0,calls:0,triangles:0,points:0,lines:0};function i(s,r,o){switch(n.calls++,r){case t.TRIANGLES:n.triangles+=o*(s/3);break;case t.LINES:n.lines+=o*(s/2);break;case t.LINE_STRIP:n.lines+=o*(s-1);break;case t.LINE_LOOP:n.lines+=o*s;break;case t.POINTS:n.points+=o*s;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",r);break}}function a(){n.calls=0,n.triangles=0,n.points=0,n.lines=0}return{memory:e,render:n,programs:null,autoReset:!0,reset:a,update:i}}function Mbe(t,e,n){const i=new WeakMap,a=new xi;function s(r,o,c){const u=r.morphTargetInfluences,h=o.morphAttributes.position||o.morphAttributes.normal||o.morphAttributes.color,d=h!==void 0?h.length:0;let p=i.get(o);if(p===void 0||p.count!==d){let z=function(){D.dispose(),i.delete(o),o.removeEventListener("dispose",z)};p!==void 0&&p.texture.dispose();const g=o.morphAttributes.position!==void 0,b=o.morphAttributes.normal!==void 0,w=o.morphAttributes.color!==void 0,x=o.morphAttributes.position||[],S=o.morphAttributes.normal||[],M=o.morphAttributes.color||[];let C=0;g===!0&&(C=1),b===!0&&(C=2),w===!0&&(C=3);let A=o.attributes.position.count*C,N=1;A>e.maxTextureSize&&(N=Math.ceil(A/e.maxTextureSize),A=e.maxTextureSize);const R=new Float32Array(A*N*4*d),D=new Lw(R,A,N,d);D.type=Hr,D.needsUpdate=!0;const B=C*4;for(let I=0;I<d;I++){const U=x[I],$=S[I],G=M[I],k=A*N*4*I;for(let X=0;X<U.count;X++){const V=X*B;g===!0&&(a.fromBufferAttribute(U,X),R[k+V+0]=a.x,R[k+V+1]=a.y,R[k+V+2]=a.z,R[k+V+3]=0),b===!0&&(a.fromBufferAttribute($,X),R[k+V+4]=a.x,R[k+V+5]=a.y,R[k+V+6]=a.z,R[k+V+7]=0),w===!0&&(a.fromBufferAttribute(G,X),R[k+V+8]=a.x,R[k+V+9]=a.y,R[k+V+10]=a.z,R[k+V+11]=G.itemSize===4?a.w:1)}}p={count:d,texture:D,size:new _t(A,N)},i.set(o,p),o.addEventListener("dispose",z)}if(r.isInstancedMesh===!0&&r.morphTexture!==null)c.getUniforms().setValue(t,"morphTexture",r.morphTexture,n);else{let g=0;for(let w=0;w<u.length;w++)g+=u[w];const b=o.morphTargetsRelative?1:1-g;c.getUniforms().setValue(t,"morphTargetBaseInfluence",b),c.getUniforms().setValue(t,"morphTargetInfluences",u)}c.getUniforms().setValue(t,"morphTargetsTexture",p.texture,n),c.getUniforms().setValue(t,"morphTargetsTextureSize",p.size)}return{update:s}}function Tbe(t,e,n,i){let a=new WeakMap;function s(c){const u=i.render.frame,h=c.geometry,d=e.get(c,h);if(a.get(d)!==u&&(e.update(d),a.set(d,u)),c.isInstancedMesh&&(c.hasEventListener("dispose",o)===!1&&c.addEventListener("dispose",o),a.get(c)!==u&&(n.update(c.instanceMatrix,t.ARRAY_BUFFER),c.instanceColor!==null&&n.update(c.instanceColor,t.ARRAY_BUFFER),a.set(c,u))),c.isSkinnedMesh){const p=c.skeleton;a.get(p)!==u&&(p.update(),a.set(p,u))}return d}function r(){a=new WeakMap}function o(c){const u=c.target;u.removeEventListener("dispose",o),n.remove(u.instanceMatrix),u.instanceColor!==null&&n.remove(u.instanceColor)}return{update:s,dispose:r}}const mG=new Na,qL=new kw(1,1),gG=new Lw,vG=new Ow,yG=new ux,YL=[],ZL=[],QL=new Float32Array(16),JL=new Float32Array(9),e9=new Float32Array(4);function hv(t,e,n){const i=t[0];if(i<=0||i>0)return t;const a=e*n;let s=YL[a];if(s===void 0&&(s=new Float32Array(a),YL[a]=s),e!==0){i.toArray(s,0);for(let r=1,o=0;r!==e;++r)o+=n,t[r].toArray(s,o)}return s}function us(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;n++)if(t[n]!==e[n])return!1;return!0}function ds(t,e){for(let n=0,i=e.length;n<i;n++)t[n]=e[n]}function n4(t,e){let n=ZL[e];n===void 0&&(n=new Int32Array(e),ZL[e]=n);for(let i=0;i!==e;++i)n[i]=t.allocateTextureUnit();return n}function Cbe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1f(this.addr,e),n[0]=e)}function Abe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2f(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(us(n,e))return;t.uniform2fv(this.addr,e),ds(n,e)}}function Rbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3f(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else if(e.r!==void 0)(n[0]!==e.r||n[1]!==e.g||n[2]!==e.b)&&(t.uniform3f(this.addr,e.r,e.g,e.b),n[0]=e.r,n[1]=e.g,n[2]=e.b);else{if(us(n,e))return;t.uniform3fv(this.addr,e),ds(n,e)}}function Nbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4f(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(us(n,e))return;t.uniform4fv(this.addr,e),ds(n,e)}}function Pbe(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(us(n,e))return;t.uniformMatrix2fv(this.addr,!1,e),ds(n,e)}else{if(us(n,i))return;e9.set(i),t.uniformMatrix2fv(this.addr,!1,e9),ds(n,i)}}function Dbe(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(us(n,e))return;t.uniformMatrix3fv(this.addr,!1,e),ds(n,e)}else{if(us(n,i))return;JL.set(i),t.uniformMatrix3fv(this.addr,!1,JL),ds(n,i)}}function Lbe(t,e){const n=this.cache,i=e.elements;if(i===void 0){if(us(n,e))return;t.uniformMatrix4fv(this.addr,!1,e),ds(n,e)}else{if(us(n,i))return;QL.set(i),t.uniformMatrix4fv(this.addr,!1,QL),ds(n,i)}}function Obe(t,e){const n=this.cache;n[0]!==e&&(t.uniform1i(this.addr,e),n[0]=e)}function Ibe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2i(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(us(n,e))return;t.uniform2iv(this.addr,e),ds(n,e)}}function zbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3i(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(us(n,e))return;t.uniform3iv(this.addr,e),ds(n,e)}}function Bbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4i(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(us(n,e))return;t.uniform4iv(this.addr,e),ds(n,e)}}function Ube(t,e){const n=this.cache;n[0]!==e&&(t.uniform1ui(this.addr,e),n[0]=e)}function jbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y)&&(t.uniform2ui(this.addr,e.x,e.y),n[0]=e.x,n[1]=e.y);else{if(us(n,e))return;t.uniform2uiv(this.addr,e),ds(n,e)}}function Fbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z)&&(t.uniform3ui(this.addr,e.x,e.y,e.z),n[0]=e.x,n[1]=e.y,n[2]=e.z);else{if(us(n,e))return;t.uniform3uiv(this.addr,e),ds(n,e)}}function Vbe(t,e){const n=this.cache;if(e.x!==void 0)(n[0]!==e.x||n[1]!==e.y||n[2]!==e.z||n[3]!==e.w)&&(t.uniform4ui(this.addr,e.x,e.y,e.z,e.w),n[0]=e.x,n[1]=e.y,n[2]=e.z,n[3]=e.w);else{if(us(n,e))return;t.uniform4uiv(this.addr,e),ds(n,e)}}function kbe(t,e,n){const i=this.cache,a=n.allocateTextureUnit();i[0]!==a&&(t.uniform1i(this.addr,a),i[0]=a);let s;this.type===t.SAMPLER_2D_SHADOW?(qL.compareFunction=o6,s=qL):s=mG,n.setTexture2D(e||s,a)}function Hbe(t,e,n){const i=this.cache,a=n.allocateTextureUnit();i[0]!==a&&(t.uniform1i(this.addr,a),i[0]=a),n.setTexture3D(e||vG,a)}function $be(t,e,n){const i=this.cache,a=n.allocateTextureUnit();i[0]!==a&&(t.uniform1i(this.addr,a),i[0]=a),n.setTextureCube(e||yG,a)}function Gbe(t,e,n){const i=this.cache,a=n.allocateTextureUnit();i[0]!==a&&(t.uniform1i(this.addr,a),i[0]=a),n.setTexture2DArray(e||gG,a)}function Wbe(t){switch(t){case 5126:return Cbe;case 35664:return Abe;case 35665:return Rbe;case 35666:return Nbe;case 35674:return Pbe;case 35675:return Dbe;case 35676:return Lbe;case 5124:case 35670:return Obe;case 35667:case 35671:return Ibe;case 35668:case 35672:return zbe;case 35669:case 35673:return Bbe;case 5125:return Ube;case 36294:return jbe;case 36295:return Fbe;case 36296:return Vbe;case 35678:case 36198:case 36298:case 36306:case 35682:return kbe;case 35679:case 36299:case 36307:return Hbe;case 35680:case 36300:case 36308:case 36293:return $be;case 36289:case 36303:case 36311:case 36292:return Gbe}}function Kbe(t,e){t.uniform1fv(this.addr,e)}function Xbe(t,e){const n=hv(e,this.size,2);t.uniform2fv(this.addr,n)}function qbe(t,e){const n=hv(e,this.size,3);t.uniform3fv(this.addr,n)}function Ybe(t,e){const n=hv(e,this.size,4);t.uniform4fv(this.addr,n)}function Zbe(t,e){const n=hv(e,this.size,4);t.uniformMatrix2fv(this.addr,!1,n)}function Qbe(t,e){const n=hv(e,this.size,9);t.uniformMatrix3fv(this.addr,!1,n)}function Jbe(t,e){const n=hv(e,this.size,16);t.uniformMatrix4fv(this.addr,!1,n)}function e1e(t,e){t.uniform1iv(this.addr,e)}function t1e(t,e){t.uniform2iv(this.addr,e)}function n1e(t,e){t.uniform3iv(this.addr,e)}function i1e(t,e){t.uniform4iv(this.addr,e)}function a1e(t,e){t.uniform1uiv(this.addr,e)}function s1e(t,e){t.uniform2uiv(this.addr,e)}function r1e(t,e){t.uniform3uiv(this.addr,e)}function o1e(t,e){t.uniform4uiv(this.addr,e)}function l1e(t,e,n){const i=this.cache,a=e.length,s=n4(n,a);us(i,s)||(t.uniform1iv(this.addr,s),ds(i,s));for(let r=0;r!==a;++r)n.setTexture2D(e[r]||mG,s[r])}function c1e(t,e,n){const i=this.cache,a=e.length,s=n4(n,a);us(i,s)||(t.uniform1iv(this.addr,s),ds(i,s));for(let r=0;r!==a;++r)n.setTexture3D(e[r]||vG,s[r])}function u1e(t,e,n){const i=this.cache,a=e.length,s=n4(n,a);us(i,s)||(t.uniform1iv(this.addr,s),ds(i,s));for(let r=0;r!==a;++r)n.setTextureCube(e[r]||yG,s[r])}function d1e(t,e,n){const i=this.cache,a=e.length,s=n4(n,a);us(i,s)||(t.uniform1iv(this.addr,s),ds(i,s));for(let r=0;r!==a;++r)n.setTexture2DArray(e[r]||gG,s[r])}function f1e(t){switch(t){case 5126:return Kbe;case 35664:return Xbe;case 35665:return qbe;case 35666:return Ybe;case 35674:return Zbe;case 35675:return Qbe;case 35676:return Jbe;case 5124:case 35670:return e1e;case 35667:case 35671:return t1e;case 35668:case 35672:return n1e;case 35669:case 35673:return i1e;case 5125:return a1e;case 36294:return s1e;case 36295:return r1e;case 36296:return o1e;case 35678:case 36198:case 36298:case 36306:case 35682:return l1e;case 35679:case 36299:case 36307:return c1e;case 35680:case 36300:case 36308:case 36293:return u1e;case 36289:case 36303:case 36311:case 36292:return d1e}}class h1e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.setValue=Wbe(n.type)}}class p1e{constructor(e,n,i){this.id=e,this.addr=i,this.cache=[],this.type=n.type,this.size=n.size,this.setValue=f1e(n.type)}}class m1e{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,n,i){const a=this.seq;for(let s=0,r=a.length;s!==r;++s){const o=a[s];o.setValue(e,n[o.id],i)}}}const KM=/(\w+)(\])?(\[|\.)?/g;function t9(t,e){t.seq.push(e),t.map[e.id]=e}function g1e(t,e,n){const i=t.name,a=i.length;for(KM.lastIndex=0;;){const s=KM.exec(i),r=KM.lastIndex;let o=s[1];const c=s[2]==="]",u=s[3];if(c&&(o=o|0),u===void 0||u==="["&&r+2===a){t9(n,u===void 0?new h1e(o,t,e):new p1e(o,t,e));break}else{let d=n.map[o];d===void 0&&(d=new m1e(o),t9(n,d)),n=d}}}class _S{constructor(e,n){this.seq=[],this.map={};const i=e.getProgramParameter(n,e.ACTIVE_UNIFORMS);for(let a=0;a<i;++a){const s=e.getActiveUniform(n,a),r=e.getUniformLocation(n,s.name);g1e(s,r,this)}}setValue(e,n,i,a){const s=this.map[n];s!==void 0&&s.setValue(e,i,a)}setOptional(e,n,i){const a=n[i];a!==void 0&&this.setValue(e,i,a)}static upload(e,n,i,a){for(let s=0,r=n.length;s!==r;++s){const o=n[s],c=i[o.id];c.needsUpdate!==!1&&o.setValue(e,c.value,a)}}static seqWithValue(e,n){const i=[];for(let a=0,s=e.length;a!==s;++a){const r=e[a];r.id in n&&i.push(r)}return i}}function n9(t,e,n){const i=t.createShader(e);return t.shaderSource(i,n),t.compileShader(i),i}const v1e=37297;let y1e=0;function b1e(t,e){const n=t.split(`
`),i=[],a=Math.max(e-6,0),s=Math.min(e+6,n.length);for(let r=a;r<s;r++){const o=r+1;i.push(`${o===e?">":" "} ${o}: ${n[r]}`)}return i.join(`
`)}const i9=new jn;function x1e(t){mi._getMatrix(i9,mi.workingColorSpace,t);const e=`mat3( ${i9.elements.map(n=>n.toFixed(4))} )`;switch(mi.getTransfer(t)){case C1:return[e,"LinearTransferOETF"];case Bi:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",t),[e,"LinearTransferOETF"]}}function a9(t,e,n){const i=t.getShaderParameter(e,t.COMPILE_STATUS),s=(t.getShaderInfoLog(e)||"").trim();if(i&&s==="")return"";const r=/ERROR: 0:(\d+)/.exec(s);if(r){const o=parseInt(r[1]);return n.toUpperCase()+`
`+s+`
`+b1e(t.getShaderSource(e),o)}else return s}function _1e(t,e){const n=x1e(e);return[`vec4 ${t}( vec4 value ) {`,` return ${n[1]}( vec4( value.rgb * ${n[0]}, value.a ) );`,"}"].join(`
`)}function S1e(t,e){let n;switch(e){case $H:n="Linear";break;case GH:n="Reinhard";break;case WH:n="Cineon";break;case ZA:n="ACESFilmic";break;case XH:n="AgX";break;case qH:n="Neutral";break;case KH:n="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),n="Linear"}return"vec3 "+t+"( vec3 color ) { return "+n+"ToneMapping( color ); }"}const J_=new fe;function w1e(){mi.getLuminanceCoefficients(J_);const t=J_.x.toFixed(4),e=J_.y.toFixed(4),n=J_.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",` const vec3 weights = vec3( ${t}, ${e}, ${n} );`," return dot( weights, rgb );","}"].join(`
`)}function E1e(t){return[t.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",t.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(_b).join(`
`)}function M1e(t){const e=[];for(const n in t){const i=t[n];i!==!1&&e.push("#define "+n+" "+i)}return e.join(`
`)}function T1e(t,e){const n={},i=t.getProgramParameter(e,t.ACTIVE_ATTRIBUTES);for(let a=0;a<i;a++){const s=t.getActiveAttrib(e,a),r=s.name;let o=1;s.type===t.FLOAT_MAT2&&(o=2),s.type===t.FLOAT_MAT3&&(o=3),s.type===t.FLOAT_MAT4&&(o=4),n[r]={type:s.type,location:t.getAttribLocation(e,r),locationSize:o}}return n}function _b(t){return t!==""}function s9(t,e){const n=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return t.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,n).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function r9(t,e){return t.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const C1e=/^[ \t]*#include +<([\w\d./]+)>/gm;function H5(t){return t.replace(C1e,R1e)}const A1e=new Map;function R1e(t,e){let n=$n[e];if(n===void 0){const i=A1e.get(e);if(i!==void 0)n=$n[i],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,i);else throw new Error("Can not resolve #include <"+e+">")}return H5(n)}const N1e=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function o9(t){return t.replace(N1e,P1e)}function P1e(t,e,n,i){let a="";for(let s=parseInt(e);s<parseInt(n);s++)a+=i.replace(/\[\s*i\s*\]/g,"[ "+s+" ]").replace(/UNROLLED_LOOP_INDEX/g,s);return a}function l9(t){let e=`precision ${t.precision} float;
precision ${t.precision} int;
precision ${t.precision} sampler2D;
precision ${t.precision} samplerCube;
precision ${t.precision} sampler3D;
precision ${t.precision} sampler2DArray;
precision ${t.precision} sampler2DShadow;
precision ${t.precision} samplerCubeShadow;
precision ${t.precision} sampler2DArrayShadow;
precision ${t.precision} isampler2D;
precision ${t.precision} isampler3D;
precision ${t.precision} isamplerCube;
precision ${t.precision} isampler2DArray;
precision ${t.precision} usampler2D;
precision ${t.precision} usampler3D;
precision ${t.precision} usamplerCube;
precision ${t.precision} usampler2DArray;
`;return t.precision==="highp"?e+=`
#define HIGH_PRECISION`:t.precision==="mediump"?e+=`
#define MEDIUM_PRECISION`:t.precision==="lowp"&&(e+=`
#define LOW_PRECISION`),e}function D1e(t){let e="SHADOWMAP_TYPE_BASIC";return t.shadowMapType===Ew?e="SHADOWMAP_TYPE_PCF":t.shadowMapType===Ib?e="SHADOWMAP_TYPE_PCF_SOFT":t.shadowMapType===rc&&(e="SHADOWMAP_TYPE_VSM"),e}function L1e(t){let e="ENVMAP_TYPE_CUBE";if(t.envMap)switch(t.envMapMode){case Md:case Jf:e="ENVMAP_TYPE_CUBE";break;case cv:e="ENVMAP_TYPE_CUBE_UV";break}return e}function O1e(t){let e="ENVMAP_MODE_REFLECTION";if(t.envMap)switch(t.envMapMode){case Jf:e="ENVMAP_MODE_REFRACTION";break}return e}function I1e(t){let e="ENVMAP_BLENDING_NONE";if(t.envMap)switch(t.combine){case lx:e="ENVMAP_BLENDING_MULTIPLY";break;case kH:e="ENVMAP_BLENDING_MIX";break;case HH:e="ENVMAP_BLENDING_ADD";break}return e}function z1e(t){const e=t.envMapCubeUVHeight;if(e===null)return null;const n=Math.log2(e)-2,i=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,n),112)),texelHeight:i,maxMip:n}}function B1e(t,e,n,i){const a=t.getContext(),s=n.defines;let r=n.vertexShader,o=n.fragmentShader;const c=D1e(n),u=L1e(n),h=O1e(n),d=I1e(n),p=z1e(n),g=E1e(n),b=M1e(s),w=a.createProgram();let x,S,M=n.glslVersion?"#version "+n.glslVersion+`
`:"";n.isRawShaderMaterial?(x=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(_b).join(`
`),x.length>0&&(x+=`
`),S=["#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b].filter(_b).join(`
`),S.length>0&&(S+=`
`)):(x=[l9(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.extensionClipCullDistance?"#define USE_CLIP_DISTANCE":"",n.batching?"#define USE_BATCHING":"",n.batchingColor?"#define USE_BATCHING_COLOR":"",n.instancing?"#define USE_INSTANCING":"",n.instancingColor?"#define USE_INSTANCING_COLOR":"",n.instancingMorph?"#define USE_INSTANCING_MORPH":"",n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.map?"#define USE_MAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+h:"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.displacementMap?"#define USE_DISPLACEMENTMAP":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.mapUv?"#define MAP_UV "+n.mapUv:"",n.alphaMapUv?"#define ALPHAMAP_UV "+n.alphaMapUv:"",n.lightMapUv?"#define LIGHTMAP_UV "+n.lightMapUv:"",n.aoMapUv?"#define AOMAP_UV "+n.aoMapUv:"",n.emissiveMapUv?"#define EMISSIVEMAP_UV "+n.emissiveMapUv:"",n.bumpMapUv?"#define BUMPMAP_UV "+n.bumpMapUv:"",n.normalMapUv?"#define NORMALMAP_UV "+n.normalMapUv:"",n.displacementMapUv?"#define DISPLACEMENTMAP_UV "+n.displacementMapUv:"",n.metalnessMapUv?"#define METALNESSMAP_UV "+n.metalnessMapUv:"",n.roughnessMapUv?"#define ROUGHNESSMAP_UV "+n.roughnessMapUv:"",n.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+n.anisotropyMapUv:"",n.clearcoatMapUv?"#define CLEARCOATMAP_UV "+n.clearcoatMapUv:"",n.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+n.clearcoatNormalMapUv:"",n.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+n.clearcoatRoughnessMapUv:"",n.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+n.iridescenceMapUv:"",n.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+n.iridescenceThicknessMapUv:"",n.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+n.sheenColorMapUv:"",n.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+n.sheenRoughnessMapUv:"",n.specularMapUv?"#define SPECULARMAP_UV "+n.specularMapUv:"",n.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+n.specularColorMapUv:"",n.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+n.specularIntensityMapUv:"",n.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+n.transmissionMapUv:"",n.thicknessMapUv?"#define THICKNESSMAP_UV "+n.thicknessMapUv:"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.flatShading?"#define FLAT_SHADED":"",n.skinning?"#define USE_SKINNING":"",n.morphTargets?"#define USE_MORPHTARGETS":"",n.morphNormals&&n.flatShading===!1?"#define USE_MORPHNORMALS":"",n.morphColors?"#define USE_MORPHCOLORS":"",n.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+n.morphTextureStride:"",n.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+n.morphTargetsCount:"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.sizeAttenuation?"#define USE_SIZEATTENUATION":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING"," attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR"," attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH"," uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1"," attribute vec2 uv1;","#endif","#ifdef USE_UV2"," attribute vec2 uv2;","#endif","#ifdef USE_UV3"," attribute vec2 uv3;","#endif","#ifdef USE_TANGENT"," attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )"," attribute vec4 color;","#elif defined( USE_COLOR )"," attribute vec3 color;","#endif","#ifdef USE_SKINNING"," attribute vec4 skinIndex;"," attribute vec4 skinWeight;","#endif",`
`].filter(_b).join(`
`),S=[l9(n),"#define SHADER_TYPE "+n.shaderType,"#define SHADER_NAME "+n.shaderName,b,n.useFog&&n.fog?"#define USE_FOG":"",n.useFog&&n.fogExp2?"#define FOG_EXP2":"",n.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",n.map?"#define USE_MAP":"",n.matcap?"#define USE_MATCAP":"",n.envMap?"#define USE_ENVMAP":"",n.envMap?"#define "+u:"",n.envMap?"#define "+h:"",n.envMap?"#define "+d:"",p?"#define CUBEUV_TEXEL_WIDTH "+p.texelWidth:"",p?"#define CUBEUV_TEXEL_HEIGHT "+p.texelHeight:"",p?"#define CUBEUV_MAX_MIP "+p.maxMip+".0":"",n.lightMap?"#define USE_LIGHTMAP":"",n.aoMap?"#define USE_AOMAP":"",n.bumpMap?"#define USE_BUMPMAP":"",n.normalMap?"#define USE_NORMALMAP":"",n.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",n.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",n.emissiveMap?"#define USE_EMISSIVEMAP":"",n.anisotropy?"#define USE_ANISOTROPY":"",n.anisotropyMap?"#define USE_ANISOTROPYMAP":"",n.clearcoat?"#define USE_CLEARCOAT":"",n.clearcoatMap?"#define USE_CLEARCOATMAP":"",n.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",n.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",n.dispersion?"#define USE_DISPERSION":"",n.iridescence?"#define USE_IRIDESCENCE":"",n.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",n.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",n.specularMap?"#define USE_SPECULARMAP":"",n.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",n.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",n.roughnessMap?"#define USE_ROUGHNESSMAP":"",n.metalnessMap?"#define USE_METALNESSMAP":"",n.alphaMap?"#define USE_ALPHAMAP":"",n.alphaTest?"#define USE_ALPHATEST":"",n.alphaHash?"#define USE_ALPHAHASH":"",n.sheen?"#define USE_SHEEN":"",n.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",n.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",n.transmission?"#define USE_TRANSMISSION":"",n.transmissionMap?"#define USE_TRANSMISSIONMAP":"",n.thicknessMap?"#define USE_THICKNESSMAP":"",n.vertexTangents&&n.flatShading===!1?"#define USE_TANGENT":"",n.vertexColors||n.instancingColor||n.batchingColor?"#define USE_COLOR":"",n.vertexAlphas?"#define USE_COLOR_ALPHA":"",n.vertexUv1s?"#define USE_UV1":"",n.vertexUv2s?"#define USE_UV2":"",n.vertexUv3s?"#define USE_UV3":"",n.pointsUvs?"#define USE_POINTS_UV":"",n.gradientMap?"#define USE_GRADIENTMAP":"",n.flatShading?"#define FLAT_SHADED":"",n.doubleSided?"#define DOUBLE_SIDED":"",n.flipSided?"#define FLIP_SIDED":"",n.shadowMapEnabled?"#define USE_SHADOWMAP":"",n.shadowMapEnabled?"#define "+c:"",n.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",n.numLightProbes>0?"#define USE_LIGHT_PROBES":"",n.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",n.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",n.logarithmicDepthBuffer?"#define USE_LOGARITHMIC_DEPTH_BUFFER":"",n.reversedDepthBuffer?"#define USE_REVERSED_DEPTH_BUFFER":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",n.toneMapping!==mu?"#define TONE_MAPPING":"",n.toneMapping!==mu?$n.tonemapping_pars_fragment:"",n.toneMapping!==mu?S1e("toneMapping",n.toneMapping):"",n.dithering?"#define DITHERING":"",n.opaque?"#define OPAQUE":"",$n.colorspace_pars_fragment,_1e("linearToOutputTexel",n.outputColorSpace),w1e(),n.useDepthPacking?"#define DEPTH_PACKING "+n.depthPacking:"",`
`].filter(_b).join(`
`)),r=H5(r),r=s9(r,n),r=r9(r,n),o=H5(o),o=s9(o,n),o=r9(o,n),r=o9(r),o=o9(o),n.isRawShaderMaterial!==!0&&(M=`#version 300 es
`,x=[g,"#define attribute in","#define varying out","#define texture2D texture"].join(`
`)+`
`+x,S=["#define varying in",n.glslVersion===O5?"":"layout(location = 0) out highp vec4 pc_fragColor;",n.glslVersion===O5?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
`)+`
`+S);const C=M+x+r,A=M+S+o,N=n9(a,a.VERTEX_SHADER,C),R=n9(a,a.FRAGMENT_SHADER,A);a.attachShader(w,N),a.attachShader(w,R),n.index0AttributeName!==void 0?a.bindAttribLocation(w,0,n.index0AttributeName):n.morphTargets===!0&&a.bindAttribLocation(w,0,"position"),a.linkProgram(w);function D(U){if(t.debug.checkShaderErrors){const $=a.getProgramInfoLog(w)||"",G=a.getShaderInfoLog(N)||"",k=a.getShaderInfoLog(R)||"",X=$.trim(),V=G.trim(),H=k.trim();let W=!0,J=!0;if(a.getProgramParameter(w,a.LINK_STATUS)===!1)if(W=!1,typeof t.debug.onShaderError=="function")t.debug.onShaderError(a,w,N,R);else{const Y=a9(a,N,"vertex"),K=a9(a,R,"fragment");console.error("THREE.WebGLProgram: Shader Error "+a.getError()+" - VALIDATE_STATUS "+a.getProgramParameter(w,a.VALIDATE_STATUS)+`
Material Name: `+U.name+`
Material Type: `+U.type+`
Program Info Log: `+X+`
`+Y+`
`+K)}else X!==""?console.warn("THREE.WebGLProgram: Program Info Log:",X):(V===""||H==="")&&(J=!1);J&&(U.diagnostics={runnable:W,programLog:X,vertexShader:{log:V,prefix:x},fragmentShader:{log:H,prefix:S}})}a.deleteShader(N),a.deleteShader(R),B=new _S(a,w),z=T1e(a,w)}let B;this.getUniforms=function(){return B===void 0&&D(this),B};let z;this.getAttributes=function(){return z===void 0&&D(this),z};let I=n.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return I===!1&&(I=a.getProgramParameter(w,v1e)),I},this.destroy=function(){i.releaseStatesOfProgram(this),a.deleteProgram(w),this.program=void 0},this.type=n.shaderType,this.name=n.shaderName,this.id=y1e++,this.cacheKey=e,this.usedTimes=1,this.program=w,this.vertexShader=N,this.fragmentShader=R,this}let U1e=0;class j1e{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const n=e.vertexShader,i=e.fragmentShader,a=this._getShaderStage(n),s=this._getShaderStage(i),r=this._getShaderCacheForMaterial(e);return r.has(a)===!1&&(r.add(a),a.usedTimes++),r.has(s)===!1&&(r.add(s),s.usedTimes++),this}remove(e){const n=this.materialCache.get(e);for(const i of n)i.usedTimes--,i.usedTimes===0&&this.shaderCache.delete(i.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const n=this.materialCache;let i=n.get(e);return i===void 0&&(i=new Set,n.set(e,i)),i}_getShaderStage(e){const n=this.shaderCache;let i=n.get(e);return i===void 0&&(i=new F1e(e),n.set(e,i)),i}}class F1e{constructor(e){this.id=U1e++,this.code=e,this.usedTimes=0}}function V1e(t,e,n,i,a,s,r){const o=new Gg,c=new j1e,u=new Set,h=[],d=a.logarithmicDepthBuffer,p=a.vertexTextures;let g=a.precision;const b={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function w(z){return u.add(z),z===0?"uv":`uv${z}`}function x(z,I,U,$,G){const k=$.fog,X=G.geometry,V=z.isMeshStandardMaterial?$.environment:null,H=(z.isMeshStandardMaterial?n:e).get(z.envMap||V),W=H&&H.mapping===cv?H.image.height:null,J=b[z.type];z.precision!==null&&(g=a.getMaxPrecision(z.precision),g!==z.precision&&console.warn("THREE.WebGLProgram.getParameters:",z.precision,"not supported, using",g,"instead."));const Y=X.morphAttributes.position||X.morphAttributes.normal||X.morphAttributes.color,K=Y!==void 0?Y.length:0;let ee=0;X.morphAttributes.position!==void 0&&(ee=1),X.morphAttributes.normal!==void 0&&(ee=2),X.morphAttributes.color!==void 0&&(ee=3);let ie,Z,ue,se;if(J){const rn=lc[J];ie=rn.vertexShader,Z=rn.fragmentShader}else ie=z.vertexShader,Z=z.fragmentShader,c.update(z),ue=c.getVertexShaderID(z),se=c.getFragmentShaderID(z);const ae=t.getRenderTarget(),ce=t.state.buffers.depth.getReversed(),pe=G.isInstancedMesh===!0,ye=G.isBatchedMesh===!0,_e=!!z.map,me=!!z.matcap,ne=!!H,be=!!z.aoMap,xe=!!z.lightMap,he=!!z.bumpMap,ve=!!z.normalMap,Oe=!!z.displacementMap,Le=!!z.emissiveMap,Ae=!!z.metalnessMap,et=!!z.roughnessMap,tt=z.anisotropy>0,re=z.clearcoat>0,te=z.dispersion>0,we=z.iridescence>0,Ce=z.sheen>0,Ie=z.transmission>0,Pe=tt&&!!z.anisotropyMap,Ze=re&&!!z.clearcoatMap,We=re&&!!z.clearcoatNormalMap,mt=re&&!!z.clearcoatRoughnessMap,nt=we&&!!z.iridescenceMap,Ye=we&&!!z.iridescenceThicknessMap,Je=Ce&&!!z.sheenColorMap,jt=Ce&&!!z.sheenRoughnessMap,wt=!!z.specularMap,Et=!!z.specularColorMap,zt=!!z.specularIntensityMap,Te=Ie&&!!z.transmissionMap,pt=Ie&&!!z.thicknessMap,at=!!z.gradientMap,St=!!z.alphaMap,ct=z.alphaTest>0,it=!!z.alphaHash,Nt=!!z.extensions;let kt=mu;z.toneMapped&&(ae===null||ae.isXRRenderTarget===!0)&&(kt=t.toneMapping);const Xt={shaderID:J,shaderType:z.type,shaderName:z.name,vertexShader:ie,fragmentShader:Z,defines:z.defines,customVertexShaderID:ue,customFragmentShaderID:se,isRawShaderMaterial:z.isRawShaderMaterial===!0,glslVersion:z.glslVersion,precision:g,batching:ye,batchingColor:ye&&G._colorsTexture!==null,instancing:pe,instancingColor:pe&&G.instanceColor!==null,instancingMorph:pe&&G.morphTexture!==null,supportsVertexTextures:p,outputColorSpace:ae===null?t.outputColorSpace:ae.isXRRenderTarget===!0?ae.texture.colorSpace:eh,alphaToCoverage:!!z.alphaToCoverage,map:_e,matcap:me,envMap:ne,envMapMode:ne&&H.mapping,envMapCubeUVHeight:W,aoMap:be,lightMap:xe,bumpMap:he,normalMap:ve,displacementMap:p&&Oe,emissiveMap:Le,normalMapObjectSpace:ve&&z.normalMapType===n$,normalMapTangentSpace:ve&&z.normalMapType===hh,metalnessMap:Ae,roughnessMap:et,anisotropy:tt,anisotropyMap:Pe,clearcoat:re,clearcoatMap:Ze,clearcoatNormalMap:We,clearcoatRoughnessMap:mt,dispersion:te,iridescence:we,iridescenceMap:nt,iridescenceThicknessMap:Ye,sheen:Ce,sheenColorMap:Je,sheenRoughnessMap:jt,specularMap:wt,specularColorMap:Et,specularIntensityMap:zt,transmission:Ie,transmissionMap:Te,thicknessMap:pt,gradientMap:at,opaque:z.transparent===!1&&z.blending===Wp&&z.alphaToCoverage===!1,alphaMap:St,alphaTest:ct,alphaHash:it,combine:z.combine,mapUv:_e&&w(z.map.channel),aoMapUv:be&&w(z.aoMap.channel),lightMapUv:xe&&w(z.lightMap.channel),bumpMapUv:he&&w(z.bumpMap.channel),normalMapUv:ve&&w(z.normalMap.channel),displacementMapUv:Oe&&w(z.displacementMap.channel),emissiveMapUv:Le&&w(z.emissiveMap.channel),metalnessMapUv:Ae&&w(z.metalnessMap.channel),roughnessMapUv:et&&w(z.roughnessMap.channel),anisotropyMapUv:Pe&&w(z.anisotropyMap.channel),clearcoatMapUv:Ze&&w(z.clearcoatMap.channel),clearcoatNormalMapUv:We&&w(z.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:mt&&w(z.clearcoatRoughnessMap.channel),iridescenceMapUv:nt&&w(z.iridescenceMap.channel),iridescenceThicknessMapUv:Ye&&w(z.iridescenceThicknessMap.channel),sheenColorMapUv:Je&&w(z.sheenColorMap.channel),sheenRoughnessMapUv:jt&&w(z.sheenRoughnessMap.channel),specularMapUv:wt&&w(z.specularMap.channel),specularColorMapUv:Et&&w(z.specularColorMap.channel),specularIntensityMapUv:zt&&w(z.specularIntensityMap.channel),transmissionMapUv:Te&&w(z.transmissionMap.channel),thicknessMapUv:pt&&w(z.thicknessMap.channel),alphaMapUv:St&&w(z.alphaMap.channel),vertexTangents:!!X.attributes.tangent&&(ve||tt),vertexColors:z.vertexColors,vertexAlphas:z.vertexColors===!0&&!!X.attributes.color&&X.attributes.color.itemSize===4,pointsUvs:G.isPoints===!0&&!!X.attributes.uv&&(_e||St),fog:!!k,useFog:z.fog===!0,fogExp2:!!k&&k.isFogExp2,flatShading:z.flatShading===!0&&z.wireframe===!1,sizeAttenuation:z.sizeAttenuation===!0,logarithmicDepthBuffer:d,reversedDepthBuffer:ce,skinning:G.isSkinnedMesh===!0,morphTargets:X.morphAttributes.position!==void 0,morphNormals:X.morphAttributes.normal!==void 0,morphColors:X.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:ee,numDirLights:I.directional.length,numPointLights:I.point.length,numSpotLights:I.spot.length,numSpotLightMaps:I.spotLightMap.length,numRectAreaLights:I.rectArea.length,numHemiLights:I.hemi.length,numDirLightShadows:I.directionalShadowMap.length,numPointLightShadows:I.pointShadowMap.length,numSpotLightShadows:I.spotShadowMap.length,numSpotLightShadowsWithMaps:I.numSpotLightShadowsWithMaps,numLightProbes:I.numLightProbes,numClippingPlanes:r.numPlanes,numClipIntersection:r.numIntersection,dithering:z.dithering,shadowMapEnabled:t.shadowMap.enabled&&U.length>0,shadowMapType:t.shadowMap.type,toneMapping:kt,decodeVideoTexture:_e&&z.map.isVideoTexture===!0&&mi.getTransfer(z.map.colorSpace)===Bi,decodeVideoTextureEmissive:Le&&z.emissiveMap.isVideoTexture===!0&&mi.getTransfer(z.emissiveMap.colorSpace)===Bi,premultipliedAlpha:z.premultipliedAlpha,doubleSided:z.side===xl,flipSided:z.side===Kr,useDepthPacking:z.depthPacking>=0,depthPacking:z.depthPacking||0,index0AttributeName:z.index0AttributeName,extensionClipCullDistance:Nt&&z.extensions.clipCullDistance===!0&&i.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(Nt&&z.extensions.multiDraw===!0||ye)&&i.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:i.has("KHR_parallel_shader_compile"),customProgramCacheKey:z.customProgramCacheKey()};return Xt.vertexUv1s=u.has(1),Xt.vertexUv2s=u.has(2),Xt.vertexUv3s=u.has(3),u.clear(),Xt}function S(z){const I=[];if(z.shaderID?I.push(z.shaderID):(I.push(z.customVertexShaderID),I.push(z.customFragmentShaderID)),z.defines!==void 0)for(const U in z.defines)I.push(U),I.push(z.defines[U]);return z.isRawShaderMaterial===!1&&(M(I,z),C(I,z),I.push(t.outputColorSpace)),I.push(z.customProgramCacheKey),I.join()}function M(z,I){z.push(I.precision),z.push(I.outputColorSpace),z.push(I.envMapMode),z.push(I.envMapCubeUVHeight),z.push(I.mapUv),z.push(I.alphaMapUv),z.push(I.lightMapUv),z.push(I.aoMapUv),z.push(I.bumpMapUv),z.push(I.normalMapUv),z.push(I.displacementMapUv),z.push(I.emissiveMapUv),z.push(I.metalnessMapUv),z.push(I.roughnessMapUv),z.push(I.anisotropyMapUv),z.push(I.clearcoatMapUv),z.push(I.clearcoatNormalMapUv),z.push(I.clearcoatRoughnessMapUv),z.push(I.iridescenceMapUv),z.push(I.iridescenceThicknessMapUv),z.push(I.sheenColorMapUv),z.push(I.sheenRoughnessMapUv),z.push(I.specularMapUv),z.push(I.specularColorMapUv),z.push(I.specularIntensityMapUv),z.push(I.transmissionMapUv),z.push(I.thicknessMapUv),z.push(I.combine),z.push(I.fogExp2),z.push(I.sizeAttenuation),z.push(I.morphTargetsCount),z.push(I.morphAttributeCount),z.push(I.numDirLights),z.push(I.numPointLights),z.push(I.numSpotLights),z.push(I.numSpotLightMaps),z.push(I.numHemiLights),z.push(I.numRectAreaLights),z.push(I.numDirLightShadows),z.push(I.numPointLightShadows),z.push(I.numSpotLightShadows),z.push(I.numSpotLightShadowsWithMaps),z.push(I.numLightProbes),z.push(I.shadowMapType),z.push(I.toneMapping),z.push(I.numClippingPlanes),z.push(I.numClipIntersection),z.push(I.depthPacking)}function C(z,I){o.disableAll(),I.supportsVertexTextures&&o.enable(0),I.instancing&&o.enable(1),I.instancingColor&&o.enable(2),I.instancingMorph&&o.enable(3),I.matcap&&o.enable(4),I.envMap&&o.enable(5),I.normalMapObjectSpace&&o.enable(6),I.normalMapTangentSpace&&o.enable(7),I.clearcoat&&o.enable(8),I.iridescence&&o.enable(9),I.alphaTest&&o.enable(10),I.vertexColors&&o.enable(11),I.vertexAlphas&&o.enable(12),I.vertexUv1s&&o.enable(13),I.vertexUv2s&&o.enable(14),I.vertexUv3s&&o.enable(15),I.vertexTangents&&o.enable(16),I.anisotropy&&o.enable(17),I.alphaHash&&o.enable(18),I.batching&&o.enable(19),I.dispersion&&o.enable(20),I.batchingColor&&o.enable(21),I.gradientMap&&o.enable(22),z.push(o.mask),o.disableAll(),I.fog&&o.enable(0),I.useFog&&o.enable(1),I.flatShading&&o.enable(2),I.logarithmicDepthBuffer&&o.enable(3),I.reversedDepthBuffer&&o.enable(4),I.skinning&&o.enable(5),I.morphTargets&&o.enable(6),I.morphNormals&&o.enable(7),I.morphColors&&o.enable(8),I.premultipliedAlpha&&o.enable(9),I.shadowMapEnabled&&o.enable(10),I.doubleSided&&o.enable(11),I.flipSided&&o.enable(12),I.useDepthPacking&&o.enable(13),I.dithering&&o.enable(14),I.transmission&&o.enable(15),I.sheen&&o.enable(16),I.opaque&&o.enable(17),I.pointsUvs&&o.enable(18),I.decodeVideoTexture&&o.enable(19),I.decodeVideoTextureEmissive&&o.enable(20),I.alphaToCoverage&&o.enable(21),z.push(o.mask)}function A(z){const I=b[z.type];let U;if(I){const $=lc[I];U=m$.clone($.uniforms)}else U=z.uniforms;return U}function N(z,I){let U;for(let $=0,G=h.length;$<G;$++){const k=h[$];if(k.cacheKey===I){U=k,++U.usedTimes;break}}return U===void 0&&(U=new B1e(t,I,z,s),h.push(U)),U}function R(z){if(--z.usedTimes===0){const I=h.indexOf(z);h[I]=h[h.length-1],h.pop(),z.destroy()}}function D(z){c.remove(z)}function B(){c.dispose()}return{getParameters:x,getProgramCacheKey:S,getUniforms:A,acquireProgram:N,releaseProgram:R,releaseShaderCache:D,programs:h,dispose:B}}function k1e(){let t=new WeakMap;function e(r){return t.has(r)}function n(r){let o=t.get(r);return o===void 0&&(o={},t.set(r,o)),o}function i(r){t.delete(r)}function a(r,o,c){t.get(r)[o]=c}function s(){t=new WeakMap}return{has:e,get:n,remove:i,update:a,dispose:s}}function H1e(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.material.id!==e.material.id?t.material.id-e.material.id:t.z!==e.z?t.z-e.z:t.id-e.id}function c9(t,e){return t.groupOrder!==e.groupOrder?t.groupOrder-e.groupOrder:t.renderOrder!==e.renderOrder?t.renderOrder-e.renderOrder:t.z!==e.z?e.z-t.z:t.id-e.id}function u9(){const t=[];let e=0;const n=[],i=[],a=[];function s(){e=0,n.length=0,i.length=0,a.length=0}function r(d,p,g,b,w,x){let S=t[e];return S===void 0?(S={id:d.id,object:d,geometry:p,material:g,groupOrder:b,renderOrder:d.renderOrder,z:w,group:x},t[e]=S):(S.id=d.id,S.object=d,S.geometry=p,S.material=g,S.groupOrder=b,S.renderOrder=d.renderOrder,S.z=w,S.group=x),e++,S}function o(d,p,g,b,w,x){const S=r(d,p,g,b,w,x);g.transmission>0?i.push(S):g.transparent===!0?a.push(S):n.push(S)}function c(d,p,g,b,w,x){const S=r(d,p,g,b,w,x);g.transmission>0?i.unshift(S):g.transparent===!0?a.unshift(S):n.unshift(S)}function u(d,p){n.length>1&&n.sort(d||H1e),i.length>1&&i.sort(p||c9),a.length>1&&a.sort(p||c9)}function h(){for(let d=e,p=t.length;d<p;d++){const g=t[d];if(g.id===null)break;g.id=null,g.object=null,g.geometry=null,g.material=null,g.group=null}}return{opaque:n,transmissive:i,transparent:a,init:s,push:o,unshift:c,finish:h,sort:u}}function $1e(){let t=new WeakMap;function e(i,a){const s=t.get(i);let r;return s===void 0?(r=new u9,t.set(i,[r])):a>=s.length?(r=new u9,s.push(r)):r=s[a],r}function n(){t=new WeakMap}return{get:e,dispose:n}}function G1e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={direction:new fe,color:new Wt};break;case"SpotLight":n={position:new fe,direction:new fe,color:new Wt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":n={position:new fe,color:new Wt,distance:0,decay:0};break;case"HemisphereLight":n={direction:new fe,skyColor:new Wt,groundColor:new Wt};break;case"RectAreaLight":n={color:new Wt,position:new fe,halfWidth:new fe,halfHeight:new fe};break}return t[e.id]=n,n}}}function W1e(){const t={};return{get:function(e){if(t[e.id]!==void 0)return t[e.id];let n;switch(e.type){case"DirectionalLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t};break;case"SpotLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t};break;case"PointLight":n={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new _t,shadowCameraNear:1,shadowCameraFar:1e3};break}return t[e.id]=n,n}}}let K1e=0;function X1e(t,e){return(e.castShadow?2:0)-(t.castShadow?2:0)+(e.map?1:0)-(t.map?1:0)}function q1e(t){const e=new G1e,n=W1e(),i={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let u=0;u<9;u++)i.probe.push(new fe);const a=new fe,s=new wn,r=new wn;function o(u){let h=0,d=0,p=0;for(let z=0;z<9;z++)i.probe[z].set(0,0,0);let g=0,b=0,w=0,x=0,S=0,M=0,C=0,A=0,N=0,R=0,D=0;u.sort(X1e);for(let z=0,I=u.length;z<I;z++){const U=u[z],$=U.color,G=U.intensity,k=U.distance,X=U.shadow&&U.shadow.map?U.shadow.map.texture:null;if(U.isAmbientLight)h+=$.r*G,d+=$.g*G,p+=$.b*G;else if(U.isLightProbe){for(let V=0;V<9;V++)i.probe[V].addScaledVector(U.sh.coefficients[V],G);D++}else if(U.isDirectionalLight){const V=e.get(U);if(V.color.copy(U.color).multiplyScalar(U.intensity),U.castShadow){const H=U.shadow,W=n.get(U);W.shadowIntensity=H.intensity,W.shadowBias=H.bias,W.shadowNormalBias=H.normalBias,W.shadowRadius=H.radius,W.shadowMapSize=H.mapSize,i.directionalShadow[g]=W,i.directionalShadowMap[g]=X,i.directionalShadowMatrix[g]=U.shadow.matrix,M++}i.directional[g]=V,g++}else if(U.isSpotLight){const V=e.get(U);V.position.setFromMatrixPosition(U.matrixWorld),V.color.copy($).multiplyScalar(G),V.distance=k,V.coneCos=Math.cos(U.angle),V.penumbraCos=Math.cos(U.angle*(1-U.penumbra)),V.decay=U.decay,i.spot[w]=V;const H=U.shadow;if(U.map&&(i.spotLightMap[N]=U.map,N++,H.updateMatrices(U),U.castShadow&&R++),i.spotLightMatrix[w]=H.matrix,U.castShadow){const W=n.get(U);W.shadowIntensity=H.intensity,W.shadowBias=H.bias,W.shadowNormalBias=H.normalBias,W.shadowRadius=H.radius,W.shadowMapSize=H.mapSize,i.spotShadow[w]=W,i.spotShadowMap[w]=X,A++}w++}else if(U.isRectAreaLight){const V=e.get(U);V.color.copy($).multiplyScalar(G),V.halfWidth.set(U.width*.5,0,0),V.halfHeight.set(0,U.height*.5,0),i.rectArea[x]=V,x++}else if(U.isPointLight){const V=e.get(U);if(V.color.copy(U.color).multiplyScalar(U.intensity),V.distance=U.distance,V.decay=U.decay,U.castShadow){const H=U.shadow,W=n.get(U);W.shadowIntensity=H.intensity,W.shadowBias=H.bias,W.shadowNormalBias=H.normalBias,W.shadowRadius=H.radius,W.shadowMapSize=H.mapSize,W.shadowCameraNear=H.camera.near,W.shadowCameraFar=H.camera.far,i.pointShadow[b]=W,i.pointShadowMap[b]=X,i.pointShadowMatrix[b]=U.shadow.matrix,C++}i.point[b]=V,b++}else if(U.isHemisphereLight){const V=e.get(U);V.skyColor.copy(U.color).multiplyScalar(G),V.groundColor.copy(U.groundColor).multiplyScalar(G),i.hemi[S]=V,S++}}x>0&&(t.has("OES_texture_float_linear")===!0?(i.rectAreaLTC1=Gt.LTC_FLOAT_1,i.rectAreaLTC2=Gt.LTC_FLOAT_2):(i.rectAreaLTC1=Gt.LTC_HALF_1,i.rectAreaLTC2=Gt.LTC_HALF_2)),i.ambient[0]=h,i.ambient[1]=d,i.ambient[2]=p;const B=i.hash;(B.directionalLength!==g||B.pointLength!==b||B.spotLength!==w||B.rectAreaLength!==x||B.hemiLength!==S||B.numDirectionalShadows!==M||B.numPointShadows!==C||B.numSpotShadows!==A||B.numSpotMaps!==N||B.numLightProbes!==D)&&(i.directional.length=g,i.spot.length=w,i.rectArea.length=x,i.point.length=b,i.hemi.length=S,i.directionalShadow.length=M,i.directionalShadowMap.length=M,i.pointShadow.length=C,i.pointShadowMap.length=C,i.spotShadow.length=A,i.spotShadowMap.length=A,i.directionalShadowMatrix.length=M,i.pointShadowMatrix.length=C,i.spotLightMatrix.length=A+N-R,i.spotLightMap.length=N,i.numSpotLightShadowsWithMaps=R,i.numLightProbes=D,B.directionalLength=g,B.pointLength=b,B.spotLength=w,B.rectAreaLength=x,B.hemiLength=S,B.numDirectionalShadows=M,B.numPointShadows=C,B.numSpotShadows=A,B.numSpotMaps=N,B.numLightProbes=D,i.version=K1e++)}function c(u,h){let d=0,p=0,g=0,b=0,w=0;const x=h.matrixWorldInverse;for(let S=0,M=u.length;S<M;S++){const C=u[S];if(C.isDirectionalLight){const A=i.directional[d];A.direction.setFromMatrixPosition(C.matrixWorld),a.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(a),A.direction.transformDirection(x),d++}else if(C.isSpotLight){const A=i.spot[g];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(x),A.direction.setFromMatrixPosition(C.matrixWorld),a.setFromMatrixPosition(C.target.matrixWorld),A.direction.sub(a),A.direction.transformDirection(x),g++}else if(C.isRectAreaLight){const A=i.rectArea[b];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(x),r.identity(),s.copy(C.matrixWorld),s.premultiply(x),r.extractRotation(s),A.halfWidth.set(C.width*.5,0,0),A.halfHeight.set(0,C.height*.5,0),A.halfWidth.applyMatrix4(r),A.halfHeight.applyMatrix4(r),b++}else if(C.isPointLight){const A=i.point[p];A.position.setFromMatrixPosition(C.matrixWorld),A.position.applyMatrix4(x),p++}else if(C.isHemisphereLight){const A=i.hemi[w];A.direction.setFromMatrixPosition(C.matrixWorld),A.direction.transformDirection(x),w++}}}return{setup:o,setupView:c,state:i}}function d9(t){const e=new q1e(t),n=[],i=[];function a(h){u.camera=h,n.length=0,i.length=0}function s(h){n.push(h)}function r(h){i.push(h)}function o(){e.setup(n)}function c(h){e.setupView(n,h)}const u={lightsArray:n,shadowsArray:i,camera:null,lights:e,transmissionRenderTarget:{}};return{init:a,state:u,setupLights:o,setupLightsView:c,pushLight:s,pushShadow:r}}function Y1e(t){let e=new WeakMap;function n(a,s=0){const r=e.get(a);let o;return r===void 0?(o=new d9(t),e.set(a,[o])):s>=r.length?(o=new d9(t),r.push(o)):o=r[s],o}function i(){e=new WeakMap}return{get:n,dispose:i}}const Z1e=`void main() {
gl_Position = vec4( position, 1.0 );
}`,Q1e=`uniform sampler2D shadow_pass;
uniform vec2 resolution;
uniform float radius;
#include <packing>
void main() {
const float samples = float( VSM_SAMPLES );
float mean = 0.0;
float squared_mean = 0.0;
float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
for ( float i = 0.0; i < samples; i ++ ) {
float uvOffset = uvStart + i * uvStride;
#ifdef HORIZONTAL_PASS
vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
mean += distribution.x;
squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
#else
float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
mean += depth;
squared_mean += depth * depth;
#endif
}
mean = mean / samples;
squared_mean = squared_mean / samples;
float std_dev = sqrt( squared_mean - mean * mean );
gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
}`;function J1e(t,e,n){let i=new dv;const a=new _t,s=new _t,r=new xi,o=new E6({depthPacking:t$}),c=new M6,u={},h=n.maxTextureSize,d={[Ed]:Kr,[Kr]:Ed,[xl]:xl},p=new pc({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new _t},radius:{value:4}},vertexShader:Z1e,fragmentShader:Q1e}),g=p.clone();g.defines.HORIZONTAL_PASS=1;const b=new Pn;b.setAttribute("position",new $i(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const w=new Qt(b,p),x=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=Ew;let S=this.type;this.render=function(R,D,B){if(x.enabled===!1||x.autoUpdate===!1&&x.needsUpdate===!1||R.length===0)return;const z=t.getRenderTarget(),I=t.getActiveCubeFace(),U=t.getActiveMipmapLevel(),$=t.state;$.setBlending(xd),$.buffers.depth.getReversed()===!0?$.buffers.color.setClear(0,0,0,0):$.buffers.color.setClear(1,1,1,1),$.buffers.depth.setTest(!0),$.setScissorTest(!1);const G=S!==rc&&this.type===rc,k=S===rc&&this.type!==rc;for(let X=0,V=R.length;X<V;X++){const H=R[X],W=H.shadow;if(W===void 0){console.warn("THREE.WebGLShadowMap:",H,"has no shadow.");continue}if(W.autoUpdate===!1&&W.needsUpdate===!1)continue;a.copy(W.mapSize);const J=W.getFrameExtents();if(a.multiply(J),s.copy(W.mapSize),(a.x>h||a.y>h)&&(a.x>h&&(s.x=Math.floor(h/J.x),a.x=s.x*J.x,W.mapSize.x=s.x),a.y>h&&(s.y=Math.floor(h/J.y),a.y=s.y*J.y,W.mapSize.y=s.y)),W.map===null||G===!0||k===!0){const K=this.type!==rc?{minFilter:Fs,magFilter:Fs}:{};W.map!==null&&W.map.dispose(),W.map=new hc(a.x,a.y,K),W.map.texture.name=H.name+".shadowMap",W.camera.updateProjectionMatrix()}t.setRenderTarget(W.map),t.clear();const Y=W.getViewportCount();for(let K=0;K<Y;K++){const ee=W.getViewport(K);r.set(s.x*ee.x,s.y*ee.y,s.x*ee.z,s.y*ee.w),$.viewport(r),W.updateMatrices(H,K),i=W.getFrustum(),A(D,B,W.camera,H,this.type)}W.isPointLightShadow!==!0&&this.type===rc&&M(W,B),W.needsUpdate=!1}S=this.type,x.needsUpdate=!1,t.setRenderTarget(z,I,U)};function M(R,D){const B=e.update(w);p.defines.VSM_SAMPLES!==R.blurSamples&&(p.defines.VSM_SAMPLES=R.blurSamples,g.defines.VSM_SAMPLES=R.blurSamples,p.needsUpdate=!0,g.needsUpdate=!0),R.mapPass===null&&(R.mapPass=new hc(a.x,a.y)),p.uniforms.shadow_pass.value=R.map.texture,p.uniforms.resolution.value=R.mapSize,p.uniforms.radius.value=R.radius,t.setRenderTarget(R.mapPass),t.clear(),t.renderBufferDirect(D,null,B,p,w,null),g.uniforms.shadow_pass.value=R.mapPass.texture,g.uniforms.resolution.value=R.mapSize,g.uniforms.radius.value=R.radius,t.setRenderTarget(R.map),t.clear(),t.renderBufferDirect(D,null,B,g,w,null)}function C(R,D,B,z){let I=null;const U=B.isPointLight===!0?R.customDistanceMaterial:R.customDepthMaterial;if(U!==void 0)I=U;else if(I=B.isPointLight===!0?c:o,t.localClippingEnabled&&D.clipShadows===!0&&Array.isArray(D.clippingPlanes)&&D.clippingPlanes.length!==0||D.displacementMap&&D.displacementScale!==0||D.alphaMap&&D.alphaTest>0||D.map&&D.alphaTest>0||D.alphaToCoverage===!0){const $=I.uuid,G=D.uuid;let k=u[$];k===void 0&&(k={},u[$]=k);let X=k[G];X===void 0&&(X=I.clone(),k[G]=X,D.addEventListener("dispose",N)),I=X}if(I.visible=D.visible,I.wireframe=D.wireframe,z===rc?I.side=D.shadowSide!==null?D.shadowSide:D.side:I.side=D.shadowSide!==null?D.shadowSide:d[D.side],I.alphaMap=D.alphaMap,I.alphaTest=D.alphaToCoverage===!0?.5:D.alphaTest,I.map=D.map,I.clipShadows=D.clipShadows,I.clippingPlanes=D.clippingPlanes,I.clipIntersection=D.clipIntersection,I.displacementMap=D.displacementMap,I.displacementScale=D.displacementScale,I.displacementBias=D.displacementBias,I.wireframeLinewidth=D.wireframeLinewidth,I.linewidth=D.linewidth,B.isPointLight===!0&&I.isMeshDistanceMaterial===!0){const $=t.properties.get(I);$.light=B}return I}function A(R,D,B,z,I){if(R.visible===!1)return;if(R.layers.test(D.layers)&&(R.isMesh||R.isLine||R.isPoints)&&(R.castShadow||R.receiveShadow&&I===rc)&&(!R.frustumCulled||i.intersectsObject(R))){R.modelViewMatrix.multiplyMatrices(B.matrixWorldInverse,R.matrixWorld);const G=e.update(R),k=R.material;if(Array.isArray(k)){const X=G.groups;for(let V=0,H=X.length;V<H;V++){const W=X[V],J=k[W.materialIndex];if(J&&J.visible){const Y=C(R,J,z,I);R.onBeforeShadow(t,R,D,B,G,Y,W),t.renderBufferDirect(B,null,G,Y,R,W),R.onAfterShadow(t,R,D,B,G,Y,W)}}}else if(k.visible){const X=C(R,k,z,I);R.onBeforeShadow(t,R,D,B,G,X,null),t.renderBufferDirect(B,null,G,X,R,null),R.onAfterShadow(t,R,D,B,G,X,null)}}const $=R.children;for(let G=0,k=$.length;G<k;G++)A($[G],D,B,z,I)}function N(R){R.target.removeEventListener("dispose",N);for(const B in u){const z=u[B],I=R.target.uuid;I in z&&(z[I].dispose(),delete z[I])}}}const exe={[r3]:o3,[l3]:d3,[c3]:f3,[nm]:u3,[o3]:r3,[d3]:l3,[f3]:c3,[u3]:nm};function txe(t,e){function n(){let Te=!1;const pt=new xi;let at=null;const St=new xi(0,0,0,0);return{setMask:function(ct){at!==ct&&!Te&&(t.colorMask(ct,ct,ct,ct),at=ct)},setLocked:function(ct){Te=ct},setClear:function(ct,it,Nt,kt,Xt){Xt===!0&&(ct*=kt,it*=kt,Nt*=kt),pt.set(ct,it,Nt,kt),St.equals(pt)===!1&&(t.clearColor(ct,it,Nt,kt),St.copy(pt))},reset:function(){Te=!1,at=null,St.set(-1,0,0,0)}}}function i(){let Te=!1,pt=!1,at=null,St=null,ct=null;return{setReversed:function(it){if(pt!==it){const Nt=e.get("EXT_clip_control");it?Nt.clipControlEXT(Nt.LOWER_LEFT_EXT,Nt.ZERO_TO_ONE_EXT):Nt.clipControlEXT(Nt.LOWER_LEFT_EXT,Nt.NEGATIVE_ONE_TO_ONE_EXT),pt=it;const kt=ct;ct=null,this.setClear(kt)}},getReversed:function(){return pt},setTest:function(it){it?ae(t.DEPTH_TEST):ce(t.DEPTH_TEST)},setMask:function(it){at!==it&&!Te&&(t.depthMask(it),at=it)},setFunc:function(it){if(pt&&(it=exe[it]),St!==it){switch(it){case r3:t.depthFunc(t.NEVER);break;case o3:t.depthFunc(t.ALWAYS);break;case l3:t.depthFunc(t.LESS);break;case nm:t.depthFunc(t.LEQUAL);break;case c3:t.depthFunc(t.EQUAL);break;case u3:t.depthFunc(t.GEQUAL);break;case d3:t.depthFunc(t.GREATER);break;case f3:t.depthFunc(t.NOTEQUAL);break;default:t.depthFunc(t.LEQUAL)}St=it}},setLocked:function(it){Te=it},setClear:function(it){ct!==it&&(pt&&(it=1-it),t.clearDepth(it),ct=it)},reset:function(){Te=!1,at=null,St=null,ct=null,pt=!1}}}function a(){let Te=!1,pt=null,at=null,St=null,ct=null,it=null,Nt=null,kt=null,Xt=null;return{setTest:function(rn){Te||(rn?ae(t.STENCIL_TEST):ce(t.STENCIL_TEST))},setMask:function(rn){pt!==rn&&!Te&&(t.stencilMask(rn),pt=rn)},setFunc:function(rn,ge,Se){(at!==rn||St!==ge||ct!==Se)&&(t.stencilFunc(rn,ge,Se),at=rn,St=ge,ct=Se)},setOp:function(rn,ge,Se){(it!==rn||Nt!==ge||kt!==Se)&&(t.stencilOp(rn,ge,Se),it=rn,Nt=ge,kt=Se)},setLocked:function(rn){Te=rn},setClear:function(rn){Xt!==rn&&(t.clearStencil(rn),Xt=rn)},reset:function(){Te=!1,pt=null,at=null,St=null,ct=null,it=null,Nt=null,kt=null,Xt=null}}}const s=new n,r=new i,o=new a,c=new WeakMap,u=new WeakMap;let h={},d={},p=new WeakMap,g=[],b=null,w=!1,x=null,S=null,M=null,C=null,A=null,N=null,R=null,D=new Wt(0,0,0),B=0,z=!1,I=null,U=null,$=null,G=null,k=null;const X=t.getParameter(t.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let V=!1,H=0;const W=t.getParameter(t.VERSION);W.indexOf("WebGL")!==-1?(H=parseFloat(/^WebGL (\d)/.exec(W)[1]),V=H>=1):W.indexOf("OpenGL ES")!==-1&&(H=parseFloat(/^OpenGL ES (\d)/.exec(W)[1]),V=H>=2);let J=null,Y={};const K=t.getParameter(t.SCISSOR_BOX),ee=t.getParameter(t.VIEWPORT),ie=new xi().fromArray(K),Z=new xi().fromArray(ee);function ue(Te,pt,at,St){const ct=new Uint8Array(4),it=t.createTexture();t.bindTexture(Te,it),t.texParameteri(Te,t.TEXTURE_MIN_FILTER,t.NEAREST),t.texParameteri(Te,t.TEXTURE_MAG_FILTER,t.NEAREST);for(let Nt=0;Nt<at;Nt++)Te===t.TEXTURE_3D||Te===t.TEXTURE_2D_ARRAY?t.texImage3D(pt,0,t.RGBA,1,1,St,0,t.RGBA,t.UNSIGNED_BYTE,ct):t.texImage2D(pt+Nt,0,t.RGBA,1,1,0,t.RGBA,t.UNSIGNED_BYTE,ct);return it}const se={};se[t.TEXTURE_2D]=ue(t.TEXTURE_2D,t.TEXTURE_2D,1),se[t.TEXTURE_CUBE_MAP]=ue(t.TEXTURE_CUBE_MAP,t.TEXTURE_CUBE_MAP_POSITIVE_X,6),se[t.TEXTURE_2D_ARRAY]=ue(t.TEXTURE_2D_ARRAY,t.TEXTURE_2D_ARRAY,1,1),se[t.TEXTURE_3D]=ue(t.TEXTURE_3D,t.TEXTURE_3D,1,1),s.setClear(0,0,0,1),r.setClear(1),o.setClear(0),ae(t.DEPTH_TEST),r.setFunc(nm),he(!1),ve(A5),ae(t.CULL_FACE),be(xd);function ae(Te){h[Te]!==!0&&(t.enable(Te),h[Te]=!0)}function ce(Te){h[Te]!==!1&&(t.disable(Te),h[Te]=!1)}function pe(Te,pt){return d[Te]!==pt?(t.bindFramebuffer(Te,pt),d[Te]=pt,Te===t.DRAW_FRAMEBUFFER&&(d[t.FRAMEBUFFER]=pt),Te===t.FRAMEBUFFER&&(d[t.DRAW_FRAMEBUFFER]=pt),!0):!1}function ye(Te,pt){let at=g,St=!1;if(Te){at=p.get(pt),at===void 0&&(at=[],p.set(pt,at));const ct=Te.textures;if(at.length!==ct.length||at[0]!==t.COLOR_ATTACHMENT0){for(let it=0,Nt=ct.length;it<Nt;it++)at[it]=t.COLOR_ATTACHMENT0+it;at.length=ct.length,St=!0}}else at[0]!==t.BACK&&(at[0]=t.BACK,St=!0);St&&t.drawBuffers(at)}function _e(Te){return b!==Te?(t.useProgram(Te),b=Te,!0):!1}const me={[Lf]:t.FUNC_ADD,[MH]:t.FUNC_SUBTRACT,[TH]:t.FUNC_REVERSE_SUBTRACT};me[CH]=t.MIN,me[AH]=t.MAX;const ne={[RH]:t.ZERO,[NH]:t.ONE,[PH]:t.SRC_COLOR,[a3]:t.SRC_ALPHA,[BH]:t.SRC_ALPHA_SATURATE,[IH]:t.DST_COLOR,[LH]:t.DST_ALPHA,[DH]:t.ONE_MINUS_SRC_COLOR,[s3]:t.ONE_MINUS_SRC_ALPHA,[zH]:t.ONE_MINUS_DST_COLOR,[OH]:t.ONE_MINUS_DST_ALPHA,[UH]:t.CONSTANT_COLOR,[jH]:t.ONE_MINUS_CONSTANT_COLOR,[FH]:t.CONSTANT_ALPHA,[VH]:t.ONE_MINUS_CONSTANT_ALPHA};function be(Te,pt,at,St,ct,it,Nt,kt,Xt,rn){if(Te===xd){w===!0&&(ce(t.BLEND),w=!1);return}if(w===!1&&(ae(t.BLEND),w=!0),Te!==EH){if(Te!==x||rn!==z){if((S!==Lf||A!==Lf)&&(t.blendEquation(t.FUNC_ADD),S=Lf,A=Lf),rn)switch(Te){case Wp:t.blendFuncSeparate(t.ONE,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case R5:t.blendFunc(t.ONE,t.ONE);break;case N5:t.blendFuncSeparate(t.ZERO,t.ONE_MINUS_SRC_COLOR,t.ZERO,t.ONE);break;case P5:t.blendFuncSeparate(t.DST_COLOR,t.ONE_MINUS_SRC_ALPHA,t.ZERO,t.ONE);break;default:console.error("THREE.WebGLState: Invalid blending: ",Te);break}else switch(Te){case Wp:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE_MINUS_SRC_ALPHA,t.ONE,t.ONE_MINUS_SRC_ALPHA);break;case R5:t.blendFuncSeparate(t.SRC_ALPHA,t.ONE,t.ONE,t.ONE);break;case N5:console.error("THREE.WebGLState: SubtractiveBlending requires material.premultipliedAlpha = true");break;case P5:console.error("THREE.WebGLState: MultiplyBlending requires material.premultipliedAlpha = true");break;default:console.error("THREE.WebGLState: Invalid blending: ",Te);break}M=null,C=null,N=null,R=null,D.set(0,0,0),B=0,x=Te,z=rn}return}ct=ct||pt,it=it||at,Nt=Nt||St,(pt!==S||ct!==A)&&(t.blendEquationSeparate(me[pt],me[ct]),S=pt,A=ct),(at!==M||St!==C||it!==N||Nt!==R)&&(t.blendFuncSeparate(ne[at],ne[St],ne[it],ne[Nt]),M=at,C=St,N=it,R=Nt),(kt.equals(D)===!1||Xt!==B)&&(t.blendColor(kt.r,kt.g,kt.b,Xt),D.copy(kt),B=Xt),x=Te,z=!1}function xe(Te,pt){Te.side===xl?ce(t.CULL_FACE):ae(t.CULL_FACE);let at=Te.side===Kr;pt&&(at=!at),he(at),Te.blending===Wp&&Te.transparent===!1?be(xd):be(Te.blending,Te.blendEquation,Te.blendSrc,Te.blendDst,Te.blendEquationAlpha,Te.blendSrcAlpha,Te.blendDstAlpha,Te.blendColor,Te.blendAlpha,Te.premultipliedAlpha),r.setFunc(Te.depthFunc),r.setTest(Te.depthTest),r.setMask(Te.depthWrite),s.setMask(Te.colorWrite);const St=Te.stencilWrite;o.setTest(St),St&&(o.setMask(Te.stencilWriteMask),o.setFunc(Te.stencilFunc,Te.stencilRef,Te.stencilFuncMask),o.setOp(Te.stencilFail,Te.stencilZFail,Te.stencilZPass)),Le(Te.polygonOffset,Te.polygonOffsetFactor,Te.polygonOffsetUnits),Te.alphaToCoverage===!0?ae(t.SAMPLE_ALPHA_TO_COVERAGE):ce(t.SAMPLE_ALPHA_TO_COVERAGE)}function he(Te){I!==Te&&(Te?t.frontFace(t.CW):t.frontFace(t.CCW),I=Te)}function ve(Te){Te!==_H?(ae(t.CULL_FACE),Te!==U&&(Te===A5?t.cullFace(t.BACK):Te===SH?t.cullFace(t.FRONT):t.cullFace(t.FRONT_AND_BACK))):ce(t.CULL_FACE),U=Te}function Oe(Te){Te!==$&&(V&&t.lineWidth(Te),$=Te)}function Le(Te,pt,at){Te?(ae(t.POLYGON_OFFSET_FILL),(G!==pt||k!==at)&&(t.polygonOffset(pt,at),G=pt,k=at)):ce(t.POLYGON_OFFSET_FILL)}function Ae(Te){Te?ae(t.SCISSOR_TEST):ce(t.SCISSOR_TEST)}function et(Te){Te===void 0&&(Te=t.TEXTURE0+X-1),J!==Te&&(t.activeTexture(Te),J=Te)}function tt(Te,pt,at){at===void 0&&(J===null?at=t.TEXTURE0+X-1:at=J);let St=Y[at];St===void 0&&(St={type:void 0,texture:void 0},Y[at]=St),(St.type!==Te||St.texture!==pt)&&(J!==at&&(t.activeTexture(at),J=at),t.bindTexture(Te,pt||se[Te]),St.type=Te,St.texture=pt)}function re(){const Te=Y[J];Te!==void 0&&Te.type!==void 0&&(t.bindTexture(Te.type,null),Te.type=void 0,Te.texture=void 0)}function te(){try{t.compressedTexImage2D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function we(){try{t.compressedTexImage3D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Ce(){try{t.texSubImage2D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Ie(){try{t.texSubImage3D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Pe(){try{t.compressedTexSubImage2D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Ze(){try{t.compressedTexSubImage3D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function We(){try{t.texStorage2D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function mt(){try{t.texStorage3D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function nt(){try{t.texImage2D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Ye(){try{t.texImage3D(...arguments)}catch(Te){console.error("THREE.WebGLState:",Te)}}function Je(Te){ie.equals(Te)===!1&&(t.scissor(Te.x,Te.y,Te.z,Te.w),ie.copy(Te))}function jt(Te){Z.equals(Te)===!1&&(t.viewport(Te.x,Te.y,Te.z,Te.w),Z.copy(Te))}function wt(Te,pt){let at=u.get(pt);at===void 0&&(at=new WeakMap,u.set(pt,at));let St=at.get(Te);St===void 0&&(St=t.getUniformBlockIndex(pt,Te.name),at.set(Te,St))}function Et(Te,pt){const St=u.get(pt).get(Te);c.get(pt)!==St&&(t.uniformBlockBinding(pt,St,Te.__bindingPointIndex),c.set(pt,St))}function zt(){t.disable(t.BLEND),t.disable(t.CULL_FACE),t.disable(t.DEPTH_TEST),t.disable(t.POLYGON_OFFSET_FILL),t.disable(t.SCISSOR_TEST),t.disable(t.STENCIL_TEST),t.disable(t.SAMPLE_ALPHA_TO_COVERAGE),t.blendEquation(t.FUNC_ADD),t.blendFunc(t.ONE,t.ZERO),t.blendFuncSeparate(t.ONE,t.ZERO,t.ONE,t.ZERO),t.blendColor(0,0,0,0),t.colorMask(!0,!0,!0,!0),t.clearColor(0,0,0,0),t.depthMask(!0),t.depthFunc(t.LESS),r.setReversed(!1),t.clearDepth(1),t.stencilMask(4294967295),t.stencilFunc(t.ALWAYS,0,4294967295),t.stencilOp(t.KEEP,t.KEEP,t.KEEP),t.clearStencil(0),t.cullFace(t.BACK),t.frontFace(t.CCW),t.polygonOffset(0,0),t.activeTexture(t.TEXTURE0),t.bindFramebuffer(t.FRAMEBUFFER,null),t.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),t.bindFramebuffer(t.READ_FRAMEBUFFER,null),t.useProgram(null),t.lineWidth(1),t.scissor(0,0,t.canvas.width,t.canvas.height),t.viewport(0,0,t.canvas.width,t.canvas.height),h={},J=null,Y={},d={},p=new WeakMap,g=[],b=null,w=!1,x=null,S=null,M=null,C=null,A=null,N=null,R=null,D=new Wt(0,0,0),B=0,z=!1,I=null,U=null,$=null,G=null,k=null,ie.set(0,0,t.canvas.width,t.canvas.height),Z.set(0,0,t.canvas.width,t.canvas.height),s.reset(),r.reset(),o.reset()}return{buffers:{color:s,depth:r,stencil:o},enable:ae,disable:ce,bindFramebuffer:pe,drawBuffers:ye,useProgram:_e,setBlending:be,setMaterial:xe,setFlipSided:he,setCullFace:ve,setLineWidth:Oe,setPolygonOffset:Le,setScissorTest:Ae,activeTexture:et,bindTexture:tt,unbindTexture:re,compressedTexImage2D:te,compressedTexImage3D:we,texImage2D:nt,texImage3D:Ye,updateUBOMapping:wt,uniformBlockBinding:Et,texStorage2D:We,texStorage3D:mt,texSubImage2D:Ce,texSubImage3D:Ie,compressedTexSubImage2D:Pe,compressedTexSubImage3D:Ze,scissor:Je,viewport:jt,reset:zt}}function nxe(t,e,n,i,a,s,r){const o=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,c=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),u=new _t,h=new WeakMap;let d;const p=new WeakMap;let g=!1;try{g=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function b(re,te){return g?new OffscreenCanvas(re,te):R1("canvas")}function w(re,te,we){let Ce=1;const Ie=tt(re);if((Ie.width>we||Ie.height>we)&&(Ce=we/Math.max(Ie.width,Ie.height)),Ce<1)if(typeof HTMLImageElement<"u"&&re instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&re instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&re instanceof ImageBitmap||typeof VideoFrame<"u"&&re instanceof VideoFrame){const Pe=Math.floor(Ce*Ie.width),Ze=Math.floor(Ce*Ie.height);d===void 0&&(d=b(Pe,Ze));const We=te?b(Pe,Ze):d;return We.width=Pe,We.height=Ze,We.getContext("2d").drawImage(re,0,0,Pe,Ze),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+Ie.width+"x"+Ie.height+") to ("+Pe+"x"+Ze+")."),We}else return"data"in re&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+Ie.width+"x"+Ie.height+")."),re;return re}function x(re){return re.generateMipmaps}function S(re){t.generateMipmap(re)}function M(re){return re.isWebGLCubeRenderTarget?t.TEXTURE_CUBE_MAP:re.isWebGL3DRenderTarget?t.TEXTURE_3D:re.isWebGLArrayRenderTarget||re.isCompressedArrayTexture?t.TEXTURE_2D_ARRAY:t.TEXTURE_2D}function C(re,te,we,Ce,Ie=!1){if(re!==null){if(t[re]!==void 0)return t[re];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+re+"'")}let Pe=te;if(te===t.RED&&(we===t.FLOAT&&(Pe=t.R32F),we===t.HALF_FLOAT&&(Pe=t.R16F),we===t.UNSIGNED_BYTE&&(Pe=t.R8)),te===t.RED_INTEGER&&(we===t.UNSIGNED_BYTE&&(Pe=t.R8UI),we===t.UNSIGNED_SHORT&&(Pe=t.R16UI),we===t.UNSIGNED_INT&&(Pe=t.R32UI),we===t.BYTE&&(Pe=t.R8I),we===t.SHORT&&(Pe=t.R16I),we===t.INT&&(Pe=t.R32I)),te===t.RG&&(we===t.FLOAT&&(Pe=t.RG32F),we===t.HALF_FLOAT&&(Pe=t.RG16F),we===t.UNSIGNED_BYTE&&(Pe=t.RG8)),te===t.RG_INTEGER&&(we===t.UNSIGNED_BYTE&&(Pe=t.RG8UI),we===t.UNSIGNED_SHORT&&(Pe=t.RG16UI),we===t.UNSIGNED_INT&&(Pe=t.RG32UI),we===t.BYTE&&(Pe=t.RG8I),we===t.SHORT&&(Pe=t.RG16I),we===t.INT&&(Pe=t.RG32I)),te===t.RGB_INTEGER&&(we===t.UNSIGNED_BYTE&&(Pe=t.RGB8UI),we===t.UNSIGNED_SHORT&&(Pe=t.RGB16UI),we===t.UNSIGNED_INT&&(Pe=t.RGB32UI),we===t.BYTE&&(Pe=t.RGB8I),we===t.SHORT&&(Pe=t.RGB16I),we===t.INT&&(Pe=t.RGB32I)),te===t.RGBA_INTEGER&&(we===t.UNSIGNED_BYTE&&(Pe=t.RGBA8UI),we===t.UNSIGNED_SHORT&&(Pe=t.RGBA16UI),we===t.UNSIGNED_INT&&(Pe=t.RGBA32UI),we===t.BYTE&&(Pe=t.RGBA8I),we===t.SHORT&&(Pe=t.RGBA16I),we===t.INT&&(Pe=t.RGBA32I)),te===t.RGB&&(we===t.UNSIGNED_INT_5_9_9_9_REV&&(Pe=t.RGB9_E5),we===t.UNSIGNED_INT_10F_11F_11F_REV&&(Pe=t.R11F_G11F_B10F)),te===t.RGBA){const Ze=Ie?C1:mi.getTransfer(Ce);we===t.FLOAT&&(Pe=t.RGBA32F),we===t.HALF_FLOAT&&(Pe=t.RGBA16F),we===t.UNSIGNED_BYTE&&(Pe=Ze===Bi?t.SRGB8_ALPHA8:t.RGBA8),we===t.UNSIGNED_SHORT_4_4_4_4&&(Pe=t.RGBA4),we===t.UNSIGNED_SHORT_5_5_5_1&&(Pe=t.RGB5_A1)}return(Pe===t.R16F||Pe===t.R32F||Pe===t.RG16F||Pe===t.RG32F||Pe===t.RGBA16F||Pe===t.RGBA32F)&&e.get("EXT_color_buffer_float"),Pe}function A(re,te){let we;return re?te===null||te===Td||te===Fg?we=t.DEPTH24_STENCIL8:te===Hr?we=t.DEPTH32F_STENCIL8:te===jg&&(we=t.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):te===null||te===Td||te===Fg?we=t.DEPTH_COMPONENT24:te===Hr?we=t.DEPTH_COMPONENT32F:te===jg&&(we=t.DEPTH_COMPONENT16),we}function N(re,te){return x(re)===!0||re.isFramebufferTexture&&re.minFilter!==Fs&&re.minFilter!==ja?Math.log2(Math.max(te.width,te.height))+1:re.mipmaps!==void 0&&re.mipmaps.length>0?re.mipmaps.length:re.isCompressedTexture&&Array.isArray(re.image)?te.mipmaps.length:1}function R(re){const te=re.target;te.removeEventListener("dispose",R),B(te),te.isVideoTexture&&h.delete(te)}function D(re){const te=re.target;te.removeEventListener("dispose",D),I(te)}function B(re){const te=i.get(re);if(te.__webglInit===void 0)return;const we=re.source,Ce=p.get(we);if(Ce){const Ie=Ce[te.__cacheKey];Ie.usedTimes--,Ie.usedTimes===0&&z(re),Object.keys(Ce).length===0&&p.delete(we)}i.remove(re)}function z(re){const te=i.get(re);t.deleteTexture(te.__webglTexture);const we=re.source,Ce=p.get(we);delete Ce[te.__cacheKey],r.memory.textures--}function I(re){const te=i.get(re);if(re.depthTexture&&(re.depthTexture.dispose(),i.remove(re.depthTexture)),re.isWebGLCubeRenderTarget)for(let Ce=0;Ce<6;Ce++){if(Array.isArray(te.__webglFramebuffer[Ce]))for(let Ie=0;Ie<te.__webglFramebuffer[Ce].length;Ie++)t.deleteFramebuffer(te.__webglFramebuffer[Ce][Ie]);else t.deleteFramebuffer(te.__webglFramebuffer[Ce]);te.__webglDepthbuffer&&t.deleteRenderbuffer(te.__webglDepthbuffer[Ce])}else{if(Array.isArray(te.__webglFramebuffer))for(let Ce=0;Ce<te.__webglFramebuffer.length;Ce++)t.deleteFramebuffer(te.__webglFramebuffer[Ce]);else t.deleteFramebuffer(te.__webglFramebuffer);if(te.__webglDepthbuffer&&t.deleteRenderbuffer(te.__webglDepthbuffer),te.__webglMultisampledFramebuffer&&t.deleteFramebuffer(te.__webglMultisampledFramebuffer),te.__webglColorRenderbuffer)for(let Ce=0;Ce<te.__webglColorRenderbuffer.length;Ce++)te.__webglColorRenderbuffer[Ce]&&t.deleteRenderbuffer(te.__webglColorRenderbuffer[Ce]);te.__webglDepthRenderbuffer&&t.deleteRenderbuffer(te.__webglDepthRenderbuffer)}const we=re.textures;for(let Ce=0,Ie=we.length;Ce<Ie;Ce++){const Pe=i.get(we[Ce]);Pe.__webglTexture&&(t.deleteTexture(Pe.__webglTexture),r.memory.textures--),i.remove(we[Ce])}i.remove(re)}let U=0;function $(){U=0}function G(){const re=U;return re>=a.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+re+" texture units while this GPU supports only "+a.maxTextures),U+=1,re}function k(re){const te=[];return te.push(re.wrapS),te.push(re.wrapT),te.push(re.wrapR||0),te.push(re.magFilter),te.push(re.minFilter),te.push(re.anisotropy),te.push(re.internalFormat),te.push(re.format),te.push(re.type),te.push(re.generateMipmaps),te.push(re.premultiplyAlpha),te.push(re.flipY),te.push(re.unpackAlignment),te.push(re.colorSpace),te.join()}function X(re,te){const we=i.get(re);if(re.isVideoTexture&&Ae(re),re.isRenderTargetTexture===!1&&re.isExternalTexture!==!0&&re.version>0&&we.__version!==re.version){const Ce=re.image;if(Ce===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ce.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{se(we,re,te);return}}else re.isExternalTexture&&(we.__webglTexture=re.sourceTexture?re.sourceTexture:null);n.bindTexture(t.TEXTURE_2D,we.__webglTexture,t.TEXTURE0+te)}function V(re,te){const we=i.get(re);if(re.isRenderTargetTexture===!1&&re.version>0&&we.__version!==re.version){se(we,re,te);return}n.bindTexture(t.TEXTURE_2D_ARRAY,we.__webglTexture,t.TEXTURE0+te)}function H(re,te){const we=i.get(re);if(re.isRenderTargetTexture===!1&&re.version>0&&we.__version!==re.version){se(we,re,te);return}n.bindTexture(t.TEXTURE_3D,we.__webglTexture,t.TEXTURE0+te)}function W(re,te){const we=i.get(re);if(re.version>0&&we.__version!==re.version){ae(we,re,te);return}n.bindTexture(t.TEXTURE_CUBE_MAP,we.__webglTexture,t.TEXTURE0+te)}const J={[w1]:t.REPEAT,[El]:t.CLAMP_TO_EDGE,[E1]:t.MIRRORED_REPEAT},Y={[Fs]:t.NEAREST,[QA]:t.NEAREST_MIPMAP_NEAREST,[vg]:t.NEAREST_MIPMAP_LINEAR,[ja]:t.LINEAR,[zb]:t.LINEAR_MIPMAP_NEAREST,[cu]:t.LINEAR_MIPMAP_LINEAR},K={[i$]:t.NEVER,[c$]:t.ALWAYS,[a$]:t.LESS,[o6]:t.LEQUAL,[s$]:t.EQUAL,[l$]:t.GEQUAL,[r$]:t.GREATER,[o$]:t.NOTEQUAL};function ee(re,te){if(te.type===Hr&&e.has("OES_texture_float_linear")===!1&&(te.magFilter===ja||te.magFilter===zb||te.magFilter===vg||te.magFilter===cu||te.minFilter===ja||te.minFilter===zb||te.minFilter===vg||te.minFilter===cu)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),t.texParameteri(re,t.TEXTURE_WRAP_S,J[te.wrapS]),t.texParameteri(re,t.TEXTURE_WRAP_T,J[te.wrapT]),(re===t.TEXTURE_3D||re===t.TEXTURE_2D_ARRAY)&&t.texParameteri(re,t.TEXTURE_WRAP_R,J[te.wrapR]),t.texParameteri(re,t.TEXTURE_MAG_FILTER,Y[te.magFilter]),t.texParameteri(re,t.TEXTURE_MIN_FILTER,Y[te.minFilter]),te.compareFunction&&(t.texParameteri(re,t.TEXTURE_COMPARE_MODE,t.COMPARE_REF_TO_TEXTURE),t.texParameteri(re,t.TEXTURE_COMPARE_FUNC,K[te.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(te.magFilter===Fs||te.minFilter!==vg&&te.minFilter!==cu||te.type===Hr&&e.has("OES_texture_float_linear")===!1)return;if(te.anisotropy>1||i.get(te).__currentAnisotropy){const we=e.get("EXT_texture_filter_anisotropic");t.texParameterf(re,we.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(te.anisotropy,a.getMaxAnisotropy())),i.get(te).__currentAnisotropy=te.anisotropy}}}function ie(re,te){let we=!1;re.__webglInit===void 0&&(re.__webglInit=!0,te.addEventListener("dispose",R));const Ce=te.source;let Ie=p.get(Ce);Ie===void 0&&(Ie={},p.set(Ce,Ie));const Pe=k(te);if(Pe!==re.__cacheKey){Ie[Pe]===void 0&&(Ie[Pe]={texture:t.createTexture(),usedTimes:0},r.memory.textures++,we=!0),Ie[Pe].usedTimes++;const Ze=Ie[re.__cacheKey];Ze!==void 0&&(Ie[re.__cacheKey].usedTimes--,Ze.usedTimes===0&&z(te)),re.__cacheKey=Pe,re.__webglTexture=Ie[Pe].texture}return we}function Z(re,te,we){return Math.floor(Math.floor(re/we)/te)}function ue(re,te,we,Ce){const Pe=re.updateRanges;if(Pe.length===0)n.texSubImage2D(t.TEXTURE_2D,0,0,0,te.width,te.height,we,Ce,te.data);else{Pe.sort((Ye,Je)=>Ye.start-Je.start);let Ze=0;for(let Ye=1;Ye<Pe.length;Ye++){const Je=Pe[Ze],jt=Pe[Ye],wt=Je.start+Je.count,Et=Z(jt.start,te.width,4),zt=Z(Je.start,te.width,4);jt.start<=wt+1&&Et===zt&&Z(jt.start+jt.count-1,te.width,4)===Et?Je.count=Math.max(Je.count,jt.start+jt.count-Je.start):(++Ze,Pe[Ze]=jt)}Pe.length=Ze+1;const We=t.getParameter(t.UNPACK_ROW_LENGTH),mt=t.getParameter(t.UNPACK_SKIP_PIXELS),nt=t.getParameter(t.UNPACK_SKIP_ROWS);t.pixelStorei(t.UNPACK_ROW_LENGTH,te.width);for(let Ye=0,Je=Pe.length;Ye<Je;Ye++){const jt=Pe[Ye],wt=Math.floor(jt.start/4),Et=Math.ceil(jt.count/4),zt=wt%te.width,Te=Math.floor(wt/te.width),pt=Et,at=1;t.pixelStorei(t.UNPACK_SKIP_PIXELS,zt),t.pixelStorei(t.UNPACK_SKIP_ROWS,Te),n.texSubImage2D(t.TEXTURE_2D,0,zt,Te,pt,at,we,Ce,te.data)}re.clearUpdateRanges(),t.pixelStorei(t.UNPACK_ROW_LENGTH,We),t.pixelStorei(t.UNPACK_SKIP_PIXELS,mt),t.pixelStorei(t.UNPACK_SKIP_ROWS,nt)}}function se(re,te,we){let Ce=t.TEXTURE_2D;(te.isDataArrayTexture||te.isCompressedArrayTexture)&&(Ce=t.TEXTURE_2D_ARRAY),te.isData3DTexture&&(Ce=t.TEXTURE_3D);const Ie=ie(re,te),Pe=te.source;n.bindTexture(Ce,re.__webglTexture,t.TEXTURE0+we);const Ze=i.get(Pe);if(Pe.version!==Ze.__version||Ie===!0){n.activeTexture(t.TEXTURE0+we);const We=mi.getPrimaries(mi.workingColorSpace),mt=te.colorSpace===md?null:mi.getPrimaries(te.colorSpace),nt=te.colorSpace===md||We===mt?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,te.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,te.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,nt);let Ye=w(te.image,!1,a.maxTextureSize);Ye=et(te,Ye);const Je=s.convert(te.format,te.colorSpace),jt=s.convert(te.type);let wt=C(te.internalFormat,Je,jt,te.colorSpace,te.isVideoTexture);ee(Ce,te);let Et;const zt=te.mipmaps,Te=te.isVideoTexture!==!0,pt=Ze.__version===void 0||Ie===!0,at=Pe.dataReady,St=N(te,Ye);if(te.isDepthTexture)wt=A(te.format===kg,te.type),pt&&(Te?n.texStorage2D(t.TEXTURE_2D,1,wt,Ye.width,Ye.height):n.texImage2D(t.TEXTURE_2D,0,wt,Ye.width,Ye.height,0,Je,jt,null));else if(te.isDataTexture)if(zt.length>0){Te&&pt&&n.texStorage2D(t.TEXTURE_2D,St,wt,zt[0].width,zt[0].height);for(let ct=0,it=zt.length;ct<it;ct++)Et=zt[ct],Te?at&&n.texSubImage2D(t.TEXTURE_2D,ct,0,0,Et.width,Et.height,Je,jt,Et.data):n.texImage2D(t.TEXTURE_2D,ct,wt,Et.width,Et.height,0,Je,jt,Et.data);te.generateMipmaps=!1}else Te?(pt&&n.texStorage2D(t.TEXTURE_2D,St,wt,Ye.width,Ye.height),at&&ue(te,Ye,Je,jt)):n.texImage2D(t.TEXTURE_2D,0,wt,Ye.width,Ye.height,0,Je,jt,Ye.data);else if(te.isCompressedTexture)if(te.isCompressedArrayTexture){Te&&pt&&n.texStorage3D(t.TEXTURE_2D_ARRAY,St,wt,zt[0].width,zt[0].height,Ye.depth);for(let ct=0,it=zt.length;ct<it;ct++)if(Et=zt[ct],te.format!==fr)if(Je!==null)if(Te){if(at)if(te.layerUpdates.size>0){const Nt=V5(Et.width,Et.height,te.format,te.type);for(const kt of te.layerUpdates){const Xt=Et.data.subarray(kt*Nt/Et.data.BYTES_PER_ELEMENT,(kt+1)*Nt/Et.data.BYTES_PER_ELEMENT);n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ct,0,0,kt,Et.width,Et.height,1,Je,Xt)}te.clearLayerUpdates()}else n.compressedTexSubImage3D(t.TEXTURE_2D_ARRAY,ct,0,0,0,Et.width,Et.height,Ye.depth,Je,Et.data)}else n.compressedTexImage3D(t.TEXTURE_2D_ARRAY,ct,wt,Et.width,Et.height,Ye.depth,0,Et.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else Te?at&&n.texSubImage3D(t.TEXTURE_2D_ARRAY,ct,0,0,0,Et.width,Et.height,Ye.depth,Je,jt,Et.data):n.texImage3D(t.TEXTURE_2D_ARRAY,ct,wt,Et.width,Et.height,Ye.depth,0,Je,jt,Et.data)}else{Te&&pt&&n.texStorage2D(t.TEXTURE_2D,St,wt,zt[0].width,zt[0].height);for(let ct=0,it=zt.length;ct<it;ct++)Et=zt[ct],te.format!==fr?Je!==null?Te?at&&n.compressedTexSubImage2D(t.TEXTURE_2D,ct,0,0,Et.width,Et.height,Je,Et.data):n.compressedTexImage2D(t.TEXTURE_2D,ct,wt,Et.width,Et.height,0,Et.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):Te?at&&n.texSubImage2D(t.TEXTURE_2D,ct,0,0,Et.width,Et.height,Je,jt,Et.data):n.texImage2D(t.TEXTURE_2D,ct,wt,Et.width,Et.height,0,Je,jt,Et.data)}else if(te.isDataArrayTexture)if(Te){if(pt&&n.texStorage3D(t.TEXTURE_2D_ARRAY,St,wt,Ye.width,Ye.height,Ye.depth),at)if(te.layerUpdates.size>0){const ct=V5(Ye.width,Ye.height,te.format,te.type);for(const it of te.layerUpdates){const Nt=Ye.data.subarray(it*ct/Ye.data.BYTES_PER_ELEMENT,(it+1)*ct/Ye.data.BYTES_PER_ELEMENT);n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,it,Ye.width,Ye.height,1,Je,jt,Nt)}te.clearLayerUpdates()}else n.texSubImage3D(t.TEXTURE_2D_ARRAY,0,0,0,0,Ye.width,Ye.height,Ye.depth,Je,jt,Ye.data)}else n.texImage3D(t.TEXTURE_2D_ARRAY,0,wt,Ye.width,Ye.height,Ye.depth,0,Je,jt,Ye.data);else if(te.isData3DTexture)Te?(pt&&n.texStorage3D(t.TEXTURE_3D,St,wt,Ye.width,Ye.height,Ye.depth),at&&n.texSubImage3D(t.TEXTURE_3D,0,0,0,0,Ye.width,Ye.height,Ye.depth,Je,jt,Ye.data)):n.texImage3D(t.TEXTURE_3D,0,wt,Ye.width,Ye.height,Ye.depth,0,Je,jt,Ye.data);else if(te.isFramebufferTexture){if(pt)if(Te)n.texStorage2D(t.TEXTURE_2D,St,wt,Ye.width,Ye.height);else{let ct=Ye.width,it=Ye.height;for(let Nt=0;Nt<St;Nt++)n.texImage2D(t.TEXTURE_2D,Nt,wt,ct,it,0,Je,jt,null),ct>>=1,it>>=1}}else if(zt.length>0){if(Te&&pt){const ct=tt(zt[0]);n.texStorage2D(t.TEXTURE_2D,St,wt,ct.width,ct.height)}for(let ct=0,it=zt.length;ct<it;ct++)Et=zt[ct],Te?at&&n.texSubImage2D(t.TEXTURE_2D,ct,0,0,Je,jt,Et):n.texImage2D(t.TEXTURE_2D,ct,wt,Je,jt,Et);te.generateMipmaps=!1}else if(Te){if(pt){const ct=tt(Ye);n.texStorage2D(t.TEXTURE_2D,St,wt,ct.width,ct.height)}at&&n.texSubImage2D(t.TEXTURE_2D,0,0,0,Je,jt,Ye)}else n.texImage2D(t.TEXTURE_2D,0,wt,Je,jt,Ye);x(te)&&S(Ce),Ze.__version=Pe.version,te.onUpdate&&te.onUpdate(te)}re.__version=te.version}function ae(re,te,we){if(te.image.length!==6)return;const Ce=ie(re,te),Ie=te.source;n.bindTexture(t.TEXTURE_CUBE_MAP,re.__webglTexture,t.TEXTURE0+we);const Pe=i.get(Ie);if(Ie.version!==Pe.__version||Ce===!0){n.activeTexture(t.TEXTURE0+we);const Ze=mi.getPrimaries(mi.workingColorSpace),We=te.colorSpace===md?null:mi.getPrimaries(te.colorSpace),mt=te.colorSpace===md||Ze===We?t.NONE:t.BROWSER_DEFAULT_WEBGL;t.pixelStorei(t.UNPACK_FLIP_Y_WEBGL,te.flipY),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,te.premultiplyAlpha),t.pixelStorei(t.UNPACK_ALIGNMENT,te.unpackAlignment),t.pixelStorei(t.UNPACK_COLORSPACE_CONVERSION_WEBGL,mt);const nt=te.isCompressedTexture||te.image[0].isCompressedTexture,Ye=te.image[0]&&te.image[0].isDataTexture,Je=[];for(let it=0;it<6;it++)!nt&&!Ye?Je[it]=w(te.image[it],!0,a.maxCubemapSize):Je[it]=Ye?te.image[it].image:te.image[it],Je[it]=et(te,Je[it]);const jt=Je[0],wt=s.convert(te.format,te.colorSpace),Et=s.convert(te.type),zt=C(te.internalFormat,wt,Et,te.colorSpace),Te=te.isVideoTexture!==!0,pt=Pe.__version===void 0||Ce===!0,at=Ie.dataReady;let St=N(te,jt);ee(t.TEXTURE_CUBE_MAP,te);let ct;if(nt){Te&&pt&&n.texStorage2D(t.TEXTURE_CUBE_MAP,St,zt,jt.width,jt.height);for(let it=0;it<6;it++){ct=Je[it].mipmaps;for(let Nt=0;Nt<ct.length;Nt++){const kt=ct[Nt];te.format!==fr?wt!==null?Te?at&&n.compressedTexSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt,0,0,kt.width,kt.height,wt,kt.data):n.compressedTexImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt,zt,kt.width,kt.height,0,kt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):Te?at&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt,0,0,kt.width,kt.height,wt,Et,kt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt,zt,kt.width,kt.height,0,wt,Et,kt.data)}}}else{if(ct=te.mipmaps,Te&&pt){ct.length>0&&St++;const it=tt(Je[0]);n.texStorage2D(t.TEXTURE_CUBE_MAP,St,zt,it.width,it.height)}for(let it=0;it<6;it++)if(Ye){Te?at&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,Je[it].width,Je[it].height,wt,Et,Je[it].data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,zt,Je[it].width,Je[it].height,0,wt,Et,Je[it].data);for(let Nt=0;Nt<ct.length;Nt++){const Xt=ct[Nt].image[it].image;Te?at&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt+1,0,0,Xt.width,Xt.height,wt,Et,Xt.data):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt+1,zt,Xt.width,Xt.height,0,wt,Et,Xt.data)}}else{Te?at&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,0,0,wt,Et,Je[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,0,zt,wt,Et,Je[it]);for(let Nt=0;Nt<ct.length;Nt++){const kt=ct[Nt];Te?at&&n.texSubImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt+1,0,0,wt,Et,kt.image[it]):n.texImage2D(t.TEXTURE_CUBE_MAP_POSITIVE_X+it,Nt+1,zt,wt,Et,kt.image[it])}}}x(te)&&S(t.TEXTURE_CUBE_MAP),Pe.__version=Ie.version,te.onUpdate&&te.onUpdate(te)}re.__version=te.version}function ce(re,te,we,Ce,Ie,Pe){const Ze=s.convert(we.format,we.colorSpace),We=s.convert(we.type),mt=C(we.internalFormat,Ze,We,we.colorSpace),nt=i.get(te),Ye=i.get(we);if(Ye.__renderTarget=te,!nt.__hasExternalTextures){const Je=Math.max(1,te.width>>Pe),jt=Math.max(1,te.height>>Pe);Ie===t.TEXTURE_3D||Ie===t.TEXTURE_2D_ARRAY?n.texImage3D(Ie,Pe,mt,Je,jt,te.depth,0,Ze,We,null):n.texImage2D(Ie,Pe,mt,Je,jt,0,Ze,We,null)}n.bindFramebuffer(t.FRAMEBUFFER,re),Le(te)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,Ce,Ie,Ye.__webglTexture,0,Oe(te)):(Ie===t.TEXTURE_2D||Ie>=t.TEXTURE_CUBE_MAP_POSITIVE_X&&Ie<=t.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&t.framebufferTexture2D(t.FRAMEBUFFER,Ce,Ie,Ye.__webglTexture,Pe),n.bindFramebuffer(t.FRAMEBUFFER,null)}function pe(re,te,we){if(t.bindRenderbuffer(t.RENDERBUFFER,re),te.depthBuffer){const Ce=te.depthTexture,Ie=Ce&&Ce.isDepthTexture?Ce.type:null,Pe=A(te.stencilBuffer,Ie),Ze=te.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,We=Oe(te);Le(te)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,We,Pe,te.width,te.height):we?t.renderbufferStorageMultisample(t.RENDERBUFFER,We,Pe,te.width,te.height):t.renderbufferStorage(t.RENDERBUFFER,Pe,te.width,te.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ze,t.RENDERBUFFER,re)}else{const Ce=te.textures;for(let Ie=0;Ie<Ce.length;Ie++){const Pe=Ce[Ie],Ze=s.convert(Pe.format,Pe.colorSpace),We=s.convert(Pe.type),mt=C(Pe.internalFormat,Ze,We,Pe.colorSpace),nt=Oe(te);we&&Le(te)===!1?t.renderbufferStorageMultisample(t.RENDERBUFFER,nt,mt,te.width,te.height):Le(te)?o.renderbufferStorageMultisampleEXT(t.RENDERBUFFER,nt,mt,te.width,te.height):t.renderbufferStorage(t.RENDERBUFFER,mt,te.width,te.height)}}t.bindRenderbuffer(t.RENDERBUFFER,null)}function ye(re,te){if(te&&te.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(n.bindFramebuffer(t.FRAMEBUFFER,re),!(te.depthTexture&&te.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Ce=i.get(te.depthTexture);Ce.__renderTarget=te,(!Ce.__webglTexture||te.depthTexture.image.width!==te.width||te.depthTexture.image.height!==te.height)&&(te.depthTexture.image.width=te.width,te.depthTexture.image.height=te.height,te.depthTexture.needsUpdate=!0),X(te.depthTexture,0);const Ie=Ce.__webglTexture,Pe=Oe(te);if(te.depthTexture.format===Vg)Le(te)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ie,0,Pe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.TEXTURE_2D,Ie,0);else if(te.depthTexture.format===kg)Le(te)?o.framebufferTexture2DMultisampleEXT(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ie,0,Pe):t.framebufferTexture2D(t.FRAMEBUFFER,t.DEPTH_STENCIL_ATTACHMENT,t.TEXTURE_2D,Ie,0);else throw new Error("Unknown depthTexture format")}function _e(re){const te=i.get(re),we=re.isWebGLCubeRenderTarget===!0;if(te.__boundDepthTexture!==re.depthTexture){const Ce=re.depthTexture;if(te.__depthDisposeCallback&&te.__depthDisposeCallback(),Ce){const Ie=()=>{delete te.__boundDepthTexture,delete te.__depthDisposeCallback,Ce.removeEventListener("dispose",Ie)};Ce.addEventListener("dispose",Ie),te.__depthDisposeCallback=Ie}te.__boundDepthTexture=Ce}if(re.depthTexture&&!te.__autoAllocateDepthBuffer){if(we)throw new Error("target.depthTexture not supported in Cube render targets");const Ce=re.texture.mipmaps;Ce&&Ce.length>0?ye(te.__webglFramebuffer[0],re):ye(te.__webglFramebuffer,re)}else if(we){te.__webglDepthbuffer=[];for(let Ce=0;Ce<6;Ce++)if(n.bindFramebuffer(t.FRAMEBUFFER,te.__webglFramebuffer[Ce]),te.__webglDepthbuffer[Ce]===void 0)te.__webglDepthbuffer[Ce]=t.createRenderbuffer(),pe(te.__webglDepthbuffer[Ce],re,!1);else{const Ie=re.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=te.__webglDepthbuffer[Ce];t.bindRenderbuffer(t.RENDERBUFFER,Pe),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ie,t.RENDERBUFFER,Pe)}}else{const Ce=re.texture.mipmaps;if(Ce&&Ce.length>0?n.bindFramebuffer(t.FRAMEBUFFER,te.__webglFramebuffer[0]):n.bindFramebuffer(t.FRAMEBUFFER,te.__webglFramebuffer),te.__webglDepthbuffer===void 0)te.__webglDepthbuffer=t.createRenderbuffer(),pe(te.__webglDepthbuffer,re,!1);else{const Ie=re.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Pe=te.__webglDepthbuffer;t.bindRenderbuffer(t.RENDERBUFFER,Pe),t.framebufferRenderbuffer(t.FRAMEBUFFER,Ie,t.RENDERBUFFER,Pe)}}n.bindFramebuffer(t.FRAMEBUFFER,null)}function me(re,te,we){const Ce=i.get(re);te!==void 0&&ce(Ce.__webglFramebuffer,re,re.texture,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,0),we!==void 0&&_e(re)}function ne(re){const te=re.texture,we=i.get(re),Ce=i.get(te);re.addEventListener("dispose",D);const Ie=re.textures,Pe=re.isWebGLCubeRenderTarget===!0,Ze=Ie.length>1;if(Ze||(Ce.__webglTexture===void 0&&(Ce.__webglTexture=t.createTexture()),Ce.__version=te.version,r.memory.textures++),Pe){we.__webglFramebuffer=[];for(let We=0;We<6;We++)if(te.mipmaps&&te.mipmaps.length>0){we.__webglFramebuffer[We]=[];for(let mt=0;mt<te.mipmaps.length;mt++)we.__webglFramebuffer[We][mt]=t.createFramebuffer()}else we.__webglFramebuffer[We]=t.createFramebuffer()}else{if(te.mipmaps&&te.mipmaps.length>0){we.__webglFramebuffer=[];for(let We=0;We<te.mipmaps.length;We++)we.__webglFramebuffer[We]=t.createFramebuffer()}else we.__webglFramebuffer=t.createFramebuffer();if(Ze)for(let We=0,mt=Ie.length;We<mt;We++){const nt=i.get(Ie[We]);nt.__webglTexture===void 0&&(nt.__webglTexture=t.createTexture(),r.memory.textures++)}if(re.samples>0&&Le(re)===!1){we.__webglMultisampledFramebuffer=t.createFramebuffer(),we.__webglColorRenderbuffer=[],n.bindFramebuffer(t.FRAMEBUFFER,we.__webglMultisampledFramebuffer);for(let We=0;We<Ie.length;We++){const mt=Ie[We];we.__webglColorRenderbuffer[We]=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,we.__webglColorRenderbuffer[We]);const nt=s.convert(mt.format,mt.colorSpace),Ye=s.convert(mt.type),Je=C(mt.internalFormat,nt,Ye,mt.colorSpace,re.isXRRenderTarget===!0),jt=Oe(re);t.renderbufferStorageMultisample(t.RENDERBUFFER,jt,Je,re.width,re.height),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+We,t.RENDERBUFFER,we.__webglColorRenderbuffer[We])}t.bindRenderbuffer(t.RENDERBUFFER,null),re.depthBuffer&&(we.__webglDepthRenderbuffer=t.createRenderbuffer(),pe(we.__webglDepthRenderbuffer,re,!0)),n.bindFramebuffer(t.FRAMEBUFFER,null)}}if(Pe){n.bindTexture(t.TEXTURE_CUBE_MAP,Ce.__webglTexture),ee(t.TEXTURE_CUBE_MAP,te);for(let We=0;We<6;We++)if(te.mipmaps&&te.mipmaps.length>0)for(let mt=0;mt<te.mipmaps.length;mt++)ce(we.__webglFramebuffer[We][mt],re,te,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+We,mt);else ce(we.__webglFramebuffer[We],re,te,t.COLOR_ATTACHMENT0,t.TEXTURE_CUBE_MAP_POSITIVE_X+We,0);x(te)&&S(t.TEXTURE_CUBE_MAP),n.unbindTexture()}else if(Ze){for(let We=0,mt=Ie.length;We<mt;We++){const nt=Ie[We],Ye=i.get(nt);let Je=t.TEXTURE_2D;(re.isWebGL3DRenderTarget||re.isWebGLArrayRenderTarget)&&(Je=re.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(Je,Ye.__webglTexture),ee(Je,nt),ce(we.__webglFramebuffer,re,nt,t.COLOR_ATTACHMENT0+We,Je,0),x(nt)&&S(Je)}n.unbindTexture()}else{let We=t.TEXTURE_2D;if((re.isWebGL3DRenderTarget||re.isWebGLArrayRenderTarget)&&(We=re.isWebGL3DRenderTarget?t.TEXTURE_3D:t.TEXTURE_2D_ARRAY),n.bindTexture(We,Ce.__webglTexture),ee(We,te),te.mipmaps&&te.mipmaps.length>0)for(let mt=0;mt<te.mipmaps.length;mt++)ce(we.__webglFramebuffer[mt],re,te,t.COLOR_ATTACHMENT0,We,mt);else ce(we.__webglFramebuffer,re,te,t.COLOR_ATTACHMENT0,We,0);x(te)&&S(We),n.unbindTexture()}re.depthBuffer&&_e(re)}function be(re){const te=re.textures;for(let we=0,Ce=te.length;we<Ce;we++){const Ie=te[we];if(x(Ie)){const Pe=M(re),Ze=i.get(Ie).__webglTexture;n.bindTexture(Pe,Ze),S(Pe),n.unbindTexture()}}}const xe=[],he=[];function ve(re){if(re.samples>0){if(Le(re)===!1){const te=re.textures,we=re.width,Ce=re.height;let Ie=t.COLOR_BUFFER_BIT;const Pe=re.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT,Ze=i.get(re),We=te.length>1;if(We)for(let nt=0;nt<te.length;nt++)n.bindFramebuffer(t.FRAMEBUFFER,Ze.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+nt,t.RENDERBUFFER,null),n.bindFramebuffer(t.FRAMEBUFFER,Ze.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+nt,t.TEXTURE_2D,null,0);n.bindFramebuffer(t.READ_FRAMEBUFFER,Ze.__webglMultisampledFramebuffer);const mt=re.texture.mipmaps;mt&&mt.length>0?n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ze.__webglFramebuffer[0]):n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ze.__webglFramebuffer);for(let nt=0;nt<te.length;nt++){if(re.resolveDepthBuffer&&(re.depthBuffer&&(Ie|=t.DEPTH_BUFFER_BIT),re.stencilBuffer&&re.resolveStencilBuffer&&(Ie|=t.STENCIL_BUFFER_BIT)),We){t.framebufferRenderbuffer(t.READ_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.RENDERBUFFER,Ze.__webglColorRenderbuffer[nt]);const Ye=i.get(te[nt]).__webglTexture;t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,Ye,0)}t.blitFramebuffer(0,0,we,Ce,0,0,we,Ce,Ie,t.NEAREST),c===!0&&(xe.length=0,he.length=0,xe.push(t.COLOR_ATTACHMENT0+nt),re.depthBuffer&&re.resolveDepthBuffer===!1&&(xe.push(Pe),he.push(Pe),t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,he)),t.invalidateFramebuffer(t.READ_FRAMEBUFFER,xe))}if(n.bindFramebuffer(t.READ_FRAMEBUFFER,null),n.bindFramebuffer(t.DRAW_FRAMEBUFFER,null),We)for(let nt=0;nt<te.length;nt++){n.bindFramebuffer(t.FRAMEBUFFER,Ze.__webglMultisampledFramebuffer),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0+nt,t.RENDERBUFFER,Ze.__webglColorRenderbuffer[nt]);const Ye=i.get(te[nt]).__webglTexture;n.bindFramebuffer(t.FRAMEBUFFER,Ze.__webglFramebuffer),t.framebufferTexture2D(t.DRAW_FRAMEBUFFER,t.COLOR_ATTACHMENT0+nt,t.TEXTURE_2D,Ye,0)}n.bindFramebuffer(t.DRAW_FRAMEBUFFER,Ze.__webglMultisampledFramebuffer)}else if(re.depthBuffer&&re.resolveDepthBuffer===!1&&c){const te=re.stencilBuffer?t.DEPTH_STENCIL_ATTACHMENT:t.DEPTH_ATTACHMENT;t.invalidateFramebuffer(t.DRAW_FRAMEBUFFER,[te])}}}function Oe(re){return Math.min(a.maxSamples,re.samples)}function Le(re){const te=i.get(re);return re.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&te.__useRenderToTexture!==!1}function Ae(re){const te=r.render.frame;h.get(re)!==te&&(h.set(re,te),re.update())}function et(re,te){const we=re.colorSpace,Ce=re.format,Ie=re.type;return re.isCompressedTexture===!0||re.isVideoTexture===!0||we!==eh&&we!==md&&(mi.getTransfer(we)===Bi?(Ce!==fr||Ie!==Pl)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",we)),te}function tt(re){return typeof HTMLImageElement<"u"&&re instanceof HTMLImageElement?(u.width=re.naturalWidth||re.width,u.height=re.naturalHeight||re.height):typeof VideoFrame<"u"&&re instanceof VideoFrame?(u.width=re.displayWidth,u.height=re.displayHeight):(u.width=re.width,u.height=re.height),u}this.allocateTextureUnit=G,this.resetTextureUnits=$,this.setTexture2D=X,this.setTexture2DArray=V,this.setTexture3D=H,this.setTextureCube=W,this.rebindTextures=me,this.setupRenderTarget=ne,this.updateRenderTargetMipmap=be,this.updateMultisampleRenderTarget=ve,this.setupDepthRenderbuffer=_e,this.setupFrameBufferTexture=ce,this.useMultisampledRTT=Le}function bG(t,e){function n(i,a=md){let s;const r=mi.getTransfer(a);if(i===Pl)return t.UNSIGNED_BYTE;if(i===Cw)return t.UNSIGNED_SHORT_4_4_4_4;if(i===Aw)return t.UNSIGNED_SHORT_5_5_5_1;if(i===t6)return t.UNSIGNED_INT_5_9_9_9_REV;if(i===n6)return t.UNSIGNED_INT_10F_11F_11F_REV;if(i===JA)return t.BYTE;if(i===e6)return t.SHORT;if(i===jg)return t.UNSIGNED_SHORT;if(i===Tw)return t.INT;if(i===Td)return t.UNSIGNED_INT;if(i===Hr)return t.FLOAT;if(i===bm)return t.HALF_FLOAT;if(i===i6)return t.ALPHA;if(i===a6)return t.RGB;if(i===fr)return t.RGBA;if(i===Vg)return t.DEPTH_COMPONENT;if(i===kg)return t.DEPTH_STENCIL;if(i===Rw)return t.RED;if(i===cx)return t.RED_INTEGER;if(i===s6)return t.RG;if(i===Nw)return t.RG_INTEGER;if(i===Pw)return t.RGBA_INTEGER;if(i===Bb||i===Ub||i===jb||i===Fb)if(r===Bi)if(s=e.get("WEBGL_compressed_texture_s3tc_srgb"),s!==null){if(i===Bb)return s.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(i===Ub)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(i===jb)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(i===Fb)return s.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(s=e.get("WEBGL_compressed_texture_s3tc"),s!==null){if(i===Bb)return s.COMPRESSED_RGB_S3TC_DXT1_EXT;if(i===Ub)return s.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(i===jb)return s.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(i===Fb)return s.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(i===h3||i===p3||i===m3||i===g3)if(s=e.get("WEBGL_compressed_texture_pvrtc"),s!==null){if(i===h3)return s.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(i===p3)return s.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(i===m3)return s.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(i===g3)return s.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(i===v3||i===y3||i===b3)if(s=e.get("WEBGL_compressed_texture_etc"),s!==null){if(i===v3||i===y3)return r===Bi?s.COMPRESSED_SRGB8_ETC2:s.COMPRESSED_RGB8_ETC2;if(i===b3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:s.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(i===x3||i===_3||i===S3||i===w3||i===E3||i===M3||i===T3||i===C3||i===A3||i===R3||i===N3||i===P3||i===D3||i===L3)if(s=e.get("WEBGL_compressed_texture_astc"),s!==null){if(i===x3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:s.COMPRESSED_RGBA_ASTC_4x4_KHR;if(i===_3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:s.COMPRESSED_RGBA_ASTC_5x4_KHR;if(i===S3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:s.COMPRESSED_RGBA_ASTC_5x5_KHR;if(i===w3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:s.COMPRESSED_RGBA_ASTC_6x5_KHR;if(i===E3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:s.COMPRESSED_RGBA_ASTC_6x6_KHR;if(i===M3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:s.COMPRESSED_RGBA_ASTC_8x5_KHR;if(i===T3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:s.COMPRESSED_RGBA_ASTC_8x6_KHR;if(i===C3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:s.COMPRESSED_RGBA_ASTC_8x8_KHR;if(i===A3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:s.COMPRESSED_RGBA_ASTC_10x5_KHR;if(i===R3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:s.COMPRESSED_RGBA_ASTC_10x6_KHR;if(i===N3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:s.COMPRESSED_RGBA_ASTC_10x8_KHR;if(i===P3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:s.COMPRESSED_RGBA_ASTC_10x10_KHR;if(i===D3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:s.COMPRESSED_RGBA_ASTC_12x10_KHR;if(i===L3)return r===Bi?s.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:s.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(i===O3||i===I3||i===z3)if(s=e.get("EXT_texture_compression_bptc"),s!==null){if(i===O3)return r===Bi?s.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:s.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(i===I3)return s.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(i===z3)return s.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(i===B3||i===U3||i===j3||i===F3)if(s=e.get("EXT_texture_compression_rgtc"),s!==null){if(i===B3)return s.COMPRESSED_RED_RGTC1_EXT;if(i===U3)return s.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(i===j3)return s.COMPRESSED_RED_GREEN_RGTC2_EXT;if(i===F3)return s.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return i===Fg?t.UNSIGNED_INT_24_8:t[i]!==void 0?t[i]:null}return{convert:n}}const ixe=`
void main() {
gl_Position = vec4( position, 1.0 );
}`,axe=`
uniform sampler2DArray depthColor;
uniform float depthWidth;
uniform float depthHeight;
void main() {
vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
if ( coord.x >= 1.0 ) {
gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
} else {
gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
}
}`;class sxe{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,n){if(this.texture===null){const i=new g6(e.texture);(e.depthNear!==n.depthNear||e.depthFar!==n.depthFar)&&(this.depthNear=e.depthNear,this.depthFar=e.depthFar),this.texture=i}}getMesh(e){if(this.texture!==null&&this.mesh===null){const n=e.cameras[0].viewport,i=new pc({vertexShader:ixe,fragmentShader:axe,uniforms:{depthColor:{value:this.texture},depthWidth:{value:n.z},depthHeight:{value:n.w}}});this.mesh=new Qt(new Bo(20,20),i)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class rxe extends wu{constructor(e,n){super();const i=this;let a=null,s=1,r=null,o="local-floor",c=1,u=null,h=null,d=null,p=null,g=null,b=null;const w=typeof XRWebGLBinding<"u",x=new sxe,S={},M=n.getContextAttributes();let C=null,A=null;const N=[],R=[],D=new _t;let B=null;const z=new Ms;z.viewport=new xi;const I=new Ms;I.viewport=new xi;const U=[z,I],$=new cG;let G=null,k=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getTargetRaySpace()},this.getControllerGrip=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getGripSpace()},this.getHand=function(se){let ae=N[se];return ae===void 0&&(ae=new xS,N[se]=ae),ae.getHandSpace()};function X(se){const ae=R.indexOf(se.inputSource);if(ae===-1)return;const ce=N[ae];ce!==void 0&&(ce.update(se.inputSource,se.frame,u||r),ce.dispatchEvent({type:se.type,data:se.inputSource}))}function V(){a.removeEventListener("select",X),a.removeEventListener("selectstart",X),a.removeEventListener("selectend",X),a.removeEventListener("squeeze",X),a.removeEventListener("squeezestart",X),a.removeEventListener("squeezeend",X),a.removeEventListener("end",V),a.removeEventListener("inputsourceschange",H);for(let se=0;se<N.length;se++){const ae=R[se];ae!==null&&(R[se]=null,N[se].disconnect(ae))}G=null,k=null,x.reset();for(const se in S)delete S[se];e.setRenderTarget(C),g=null,p=null,d=null,a=null,A=null,ue.stop(),i.isPresenting=!1,e.setPixelRatio(B),e.setSize(D.width,D.height,!1),i.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(se){s=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(se){o=se,i.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return u||r},this.setReferenceSpace=function(se){u=se},this.getBaseLayer=function(){return p!==null?p:g},this.getBinding=function(){return d===null&&w&&(d=new XRWebGLBinding(a,n)),d},this.getFrame=function(){return b},this.getSession=function(){return a},this.setSession=async function(se){if(a=se,a!==null){if(C=e.getRenderTarget(),a.addEventListener("select",X),a.addEventListener("selectstart",X),a.addEventListener("selectend",X),a.addEventListener("squeeze",X),a.addEventListener("squeezestart",X),a.addEventListener("squeezeend",X),a.addEventListener("end",V),a.addEventListener("inputsourceschange",H),M.xrCompatible!==!0&&await n.makeXRCompatible(),B=e.getPixelRatio(),e.getSize(D),w&&"createProjectionLayer"in XRWebGLBinding.prototype){let ce=null,pe=null,ye=null;M.depth&&(ye=M.stencil?n.DEPTH24_STENCIL8:n.DEPTH_COMPONENT24,ce=M.stencil?kg:Vg,pe=M.stencil?Fg:Td);const _e={colorFormat:n.RGBA8,depthFormat:ye,scaleFactor:s};d=this.getBinding(),p=d.createProjectionLayer(_e),a.updateRenderState({layers:[p]}),e.setPixelRatio(1),e.setSize(p.textureWidth,p.textureHeight,!1),A=new hc(p.textureWidth,p.textureHeight,{format:fr,type:Pl,depthTexture:new kw(p.textureWidth,p.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,ce),stencilBuffer:M.stencil,colorSpace:e.outputColorSpace,samples:M.antialias?4:0,resolveDepthBuffer:p.ignoreDepthValues===!1,resolveStencilBuffer:p.ignoreDepthValues===!1})}else{const ce={antialias:M.antialias,alpha:!0,depth:M.depth,stencil:M.stencil,framebufferScaleFactor:s};g=new XRWebGLLayer(a,n,ce),a.updateRenderState({baseLayer:g}),e.setPixelRatio(1),e.setSize(g.framebufferWidth,g.framebufferHeight,!1),A=new hc(g.framebufferWidth,g.framebufferHeight,{format:fr,type:Pl,colorSpace:e.outputColorSpace,stencilBuffer:M.stencil,resolveDepthBuffer:g.ignoreDepthValues===!1,resolveStencilBuffer:g.ignoreDepthValues===!1})}A.isXRRenderTarget=!0,this.setFoveation(c),u=null,r=await a.requestReferenceSpace(o),ue.setContext(a),ue.start(),i.isPresenting=!0,i.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(a!==null)return a.environmentBlendMode},this.getDepthTexture=function(){return x.getDepthTexture()};function H(se){for(let ae=0;ae<se.removed.length;ae++){const ce=se.removed[ae],pe=R.indexOf(ce);pe>=0&&(R[pe]=null,N[pe].disconnect(ce))}for(let ae=0;ae<se.added.length;ae++){const ce=se.added[ae];let pe=R.indexOf(ce);if(pe===-1){for(let _e=0;_e<N.length;_e++)if(_e>=R.length){R.push(ce),pe=_e;break}else if(R[_e]===null){R[_e]=ce,pe=_e;break}if(pe===-1)break}const ye=N[pe];ye&&ye.connect(ce)}}const W=new fe,J=new fe;function Y(se,ae,ce){W.setFromMatrixPosition(ae.matrixWorld),J.setFromMatrixPosition(ce.matrixWorld);const pe=W.distanceTo(J),ye=ae.projectionMatrix.elements,_e=ce.projectionMatrix.elements,me=ye[14]/(ye[10]-1),ne=ye[14]/(ye[10]+1),be=(ye[9]+1)/ye[5],xe=(ye[9]-1)/ye[5],he=(ye[8]-1)/ye[0],ve=(_e[8]+1)/_e[0],Oe=me*he,Le=me*ve,Ae=pe/(-he+ve),et=Ae*-he;if(ae.matrixWorld.decompose(se.position,se.quaternion,se.scale),se.translateX(et),se.translateZ(Ae),se.matrixWorld.compose(se.position,se.quaternion,se.scale),se.matrixWorldInverse.copy(se.matrixWorld).invert(),ye[10]===-1)se.projectionMatrix.copy(ae.projectionMatrix),se.projectionMatrixInverse.copy(ae.projectionMatrixInverse);else{const tt=me+Ae,re=ne+Ae,te=Oe-et,we=Le+(pe-et),Ce=be*ne/re*tt,Ie=xe*ne/re*tt;se.projectionMatrix.makePerspective(te,we,Ce,Ie,tt,re),se.projectionMatrixInverse.copy(se.projectionMatrix).invert()}}function K(se,ae){ae===null?se.matrixWorld.copy(se.matrix):se.matrixWorld.multiplyMatrices(ae.matrixWorld,se.matrix),se.matrixWorldInverse.copy(se.matrixWorld).invert()}this.updateCamera=function(se){if(a===null)return;let ae=se.near,ce=se.far;x.texture!==null&&(x.depthNear>0&&(ae=x.depthNear),x.depthFar>0&&(ce=x.depthFar)),$.near=I.near=z.near=ae,$.far=I.far=z.far=ce,(G!==$.near||k!==$.far)&&(a.updateRenderState({depthNear:$.near,depthFar:$.far}),G=$.near,k=$.far),$.layers.mask=se.layers.mask|6,z.layers.mask=$.layers.mask&3,I.layers.mask=$.layers.mask&5;const pe=se.parent,ye=$.cameras;K($,pe);for(let _e=0;_e<ye.length;_e++)K(ye[_e],pe);ye.length===2?Y($,z,I):$.projectionMatrix.copy(z.projectionMatrix),ee(se,$,pe)};function ee(se,ae,ce){ce===null?se.matrix.copy(ae.matrixWorld):(se.matrix.copy(ce.matrixWorld),se.matrix.invert(),se.matrix.multiply(ae.matrixWorld)),se.matrix.decompose(se.position,se.quaternion,se.scale),se.updateMatrixWorld(!0),se.projectionMatrix.copy(ae.projectionMatrix),se.projectionMatrixInverse.copy(ae.projectionMatrixInverse),se.isPerspectiveCamera&&(se.fov=$g*2*Math.atan(1/se.projectionMatrix.elements[5]),se.zoom=1)}this.getCamera=function(){return $},this.getFoveation=function(){if(!(p===null&&g===null))return c},this.setFoveation=function(se){c=se,p!==null&&(p.fixedFoveation=se),g!==null&&g.fixedFoveation!==void 0&&(g.fixedFoveation=se)},this.hasDepthSensing=function(){return x.texture!==null},this.getDepthSensingMesh=function(){return x.getMesh($)},this.getCameraTexture=function(se){return S[se]};let ie=null;function Z(se,ae){if(h=ae.getViewerPose(u||r),b=ae,h!==null){const ce=h.views;g!==null&&(e.setRenderTargetFramebuffer(A,g.framebuffer),e.setRenderTarget(A));let pe=!1;ce.length!==$.cameras.length&&($.cameras.length=0,pe=!0);for(let ne=0;ne<ce.length;ne++){const be=ce[ne];let xe=null;if(g!==null)xe=g.getViewport(be);else{const ve=d.getViewSubImage(p,be);xe=ve.viewport,ne===0&&(e.setRenderTargetTextures(A,ve.colorTexture,ve.depthStencilTexture),e.setRenderTarget(A))}let he=U[ne];he===void 0&&(he=new Ms,he.layers.enable(ne),he.viewport=new xi,U[ne]=he),he.matrix.fromArray(be.transform.matrix),he.matrix.decompose(he.position,he.quaternion,he.scale),he.projectionMatrix.fromArray(be.projectionMatrix),he.projectionMatrixInverse.copy(he.projectionMatrix).invert(),he.viewport.set(xe.x,xe.y,xe.width,xe.height),ne===0&&($.matrix.copy(he.matrix),$.matrix.decompose($.position,$.quaternion,$.scale)),pe===!0&&$.cameras.push(he)}const ye=a.enabledFeatures;if(ye&&ye.includes("depth-sensing")&&a.depthUsage=="gpu-optimized"&&w){d=i.getBinding();const ne=d.getDepthInformation(ce[0]);ne&&ne.isValid&&ne.texture&&x.init(ne,a.renderState)}if(ye&&ye.includes("camera-access")&&w){e.state.unbindTexture(),d=i.getBinding();for(let ne=0;ne<ce.length;ne++){const be=ce[ne].camera;if(be){let xe=S[be];xe||(xe=new g6,S[be]=xe);const he=d.getCameraImage(be);xe.sourceTexture=he}}}}for(let ce=0;ce<N.length;ce++){const pe=R[ce],ye=N[ce];pe!==null&&ye!==void 0&&ye.update(pe,ae,u||r)}ie&&ie(se,ae),ae.detectedPlanes&&i.dispatchEvent({type:"planesdetected",data:ae}),b=null}const ue=new pG;ue.setAnimationLoop(Z),this.setAnimationLoop=function(se){ie=se},this.dispose=function(){}}}const Mp=new xo,oxe=new wn;function lxe(t,e){function n(x,S){x.matrixAutoUpdate===!0&&x.updateMatrix(),S.value.copy(x.matrix)}function i(x,S){S.color.getRGB(x.fogColor.value,p$(t)),S.isFog?(x.fogNear.value=S.near,x.fogFar.value=S.far):S.isFogExp2&&(x.fogDensity.value=S.density)}function a(x,S,M,C,A){S.isMeshBasicMaterial||S.isMeshLambertMaterial?s(x,S):S.isMeshToonMaterial?(s(x,S),d(x,S)):S.isMeshPhongMaterial?(s(x,S),h(x,S)):S.isMeshStandardMaterial?(s(x,S),p(x,S),S.isMeshPhysicalMaterial&&g(x,S,A)):S.isMeshMatcapMaterial?(s(x,S),b(x,S)):S.isMeshDepthMaterial?s(x,S):S.isMeshDistanceMaterial?(s(x,S),w(x,S)):S.isMeshNormalMaterial?s(x,S):S.isLineBasicMaterial?(r(x,S),S.isLineDashedMaterial&&o(x,S)):S.isPointsMaterial?c(x,S,M,C):S.isSpriteMaterial?u(x,S):S.isShadowMaterial?(x.color.value.copy(S.color),x.opacity.value=S.opacity):S.isShaderMaterial&&(S.uniformsNeedUpdate=!1)}function s(x,S){x.opacity.value=S.opacity,S.color&&x.diffuse.value.copy(S.color),S.emissive&&x.emissive.value.copy(S.emissive).multiplyScalar(S.emissiveIntensity),S.map&&(x.map.value=S.map,n(S.map,x.mapTransform)),S.alphaMap&&(x.alphaMap.value=S.alphaMap,n(S.alphaMap,x.alphaMapTransform)),S.bumpMap&&(x.bumpMap.value=S.bumpMap,n(S.bumpMap,x.bumpMapTransform),x.bumpScale.value=S.bumpScale,S.side===Kr&&(x.bumpScale.value*=-1)),S.normalMap&&(x.normalMap.value=S.normalMap,n(S.normalMap,x.normalMapTransform),x.normalScale.value.copy(S.normalScale),S.side===Kr&&x.normalScale.value.negate()),S.displacementMap&&(x.displacementMap.value=S.displacementMap,n(S.displacementMap,x.displacementMapTransform),x.displacementScale.value=S.displacementScale,x.displacementBias.value=S.displacementBias),S.emissiveMap&&(x.emissiveMap.value=S.emissiveMap,n(S.emissiveMap,x.emissiveMapTransform)),S.specularMap&&(x.specularMap.value=S.specularMap,n(S.specularMap,x.specularMapTransform)),S.alphaTest>0&&(x.alphaTest.value=S.alphaTest);const M=e.get(S),C=M.envMap,A=M.envMapRotation;C&&(x.envMap.value=C,Mp.copy(A),Mp.x*=-1,Mp.y*=-1,Mp.z*=-1,C.isCubeTexture&&C.isRenderTargetTexture===!1&&(Mp.y*=-1,Mp.z*=-1),x.envMapRotation.value.setFromMatrix4(oxe.makeRotationFromEuler(Mp)),x.flipEnvMap.value=C.isCubeTexture&&C.isRenderTargetTexture===!1?-1:1,x.reflectivity.value=S.reflectivity,x.ior.value=S.ior,x.refractionRatio.value=S.refractionRatio),S.lightMap&&(x.lightMap.value=S.lightMap,x.lightMapIntensity.value=S.lightMapIntensity,n(S.lightMap,x.lightMapTransform)),S.aoMap&&(x.aoMap.value=S.aoMap,x.aoMapIntensity.value=S.aoMapIntensity,n(S.aoMap,x.aoMapTransform))}function r(x,S){x.diffuse.value.copy(S.color),x.opacity.value=S.opacity,S.map&&(x.map.value=S.map,n(S.map,x.mapTransform))}function o(x,S){x.dashSize.value=S.dashSize,x.totalSize.value=S.dashSize+S.gapSize,x.scale.value=S.scale}function c(x,S,M,C){x.diffuse.value.copy(S.color),x.opacity.value=S.opacity,x.size.value=S.size*M,x.scale.value=C*.5,S.map&&(x.map.value=S.map,n(S.map,x.uvTransform)),S.alphaMap&&(x.alphaMap.value=S.alphaMap,n(S.alphaMap,x.alphaMapTransform)),S.alphaTest>0&&(x.alphaTest.value=S.alphaTest)}function u(x,S){x.diffuse.value.copy(S.color),x.opacity.value=S.opacity,x.rotation.value=S.rotation,S.map&&(x.map.value=S.map,n(S.map,x.mapTransform)),S.alphaMap&&(x.alphaMap.value=S.alphaMap,n(S.alphaMap,x.alphaMapTransform)),S.alphaTest>0&&(x.alphaTest.value=S.alphaTest)}function h(x,S){x.specular.value.copy(S.specular),x.shininess.value=Math.max(S.shininess,1e-4)}function d(x,S){S.gradientMap&&(x.gradientMap.value=S.gradientMap)}function p(x,S){x.metalness.value=S.metalness,S.metalnessMap&&(x.metalnessMap.value=S.metalnessMap,n(S.metalnessMap,x.metalnessMapTransform)),x.roughness.value=S.roughness,S.roughnessMap&&(x.roughnessMap.value=S.roughnessMap,n(S.roughnessMap,x.roughnessMapTransform)),S.envMap&&(x.envMapIntensity.value=S.envMapIntensity)}function g(x,S,M){x.ior.value=S.ior,S.sheen>0&&(x.sheenColor.value.copy(S.sheenColor).multiplyScalar(S.sheen),x.sheenRoughness.value=S.sheenRoughness,S.sheenColorMap&&(x.sheenColorMap.value=S.sheenColorMap,n(S.sheenColorMap,x.sheenColorMapTransform)),S.sheenRoughnessMap&&(x.sheenRoughnessMap.value=S.sheenRoughnessMap,n(S.sheenRoughnessMap,x.sheenRoughnessMapTransform))),S.clearcoat>0&&(x.clearcoat.value=S.clearcoat,x.clearcoatRoughness.value=S.clearcoatRoughness,S.clearcoatMap&&(x.clearcoatMap.value=S.clearcoatMap,n(S.clearcoatMap,x.clearcoatMapTransform)),S.clearcoatRoughnessMap&&(x.clearcoatRoughnessMap.value=S.clearcoatRoughnessMap,n(S.clearcoatRoughnessMap,x.clearcoatRoughnessMapTransform)),S.clearcoatNormalMap&&(x.clearcoatNormalMap.value=S.clearcoatNormalMap,n(S.clearcoatNormalMap,x.clearcoatNormalMapTransform),x.clearcoatNormalScale.value.copy(S.clearcoatNormalScale),S.side===Kr&&x.clearcoatNormalScale.value.negate())),S.dispersion>0&&(x.dispersion.value=S.dispersion),S.iridescence>0&&(x.iridescence.value=S.iridescence,x.iridescenceIOR.value=S.iridescenceIOR,x.iridescenceThicknessMinimum.value=S.iridescenceThicknessRange[0],x.iridescenceThicknessMaximum.value=S.iridescenceThicknessRange[1],S.iridescenceMap&&(x.iridescenceMap.value=S.iridescenceMap,n(S.iridescenceMap,x.iridescenceMapTransform)),S.iridescenceThicknessMap&&(x.iridescenceThicknessMap.value=S.iridescenceThicknessMap,n(S.iridescenceThicknessMap,x.iridescenceThicknessMapTransform))),S.transmission>0&&(x.transmission.value=S.transmission,x.transmissionSamplerMap.value=M.texture,x.transmissionSamplerSize.value.set(M.width,M.height),S.transmissionMap&&(x.transmissionMap.value=S.transmissionMap,n(S.transmissionMap,x.transmissionMapTransform)),x.thickness.value=S.thickness,S.thicknessMap&&(x.thicknessMap.value=S.thicknessMap,n(S.thicknessMap,x.thicknessMapTransform)),x.attenuationDistance.value=S.attenuationDistance,x.attenuationColor.value.copy(S.attenuationColor)),S.anisotropy>0&&(x.anisotropyVector.value.set(S.anisotropy*Math.cos(S.anisotropyRotation),S.anisotropy*Math.sin(S.anisotropyRotation)),S.anisotropyMap&&(x.anisotropyMap.value=S.anisotropyMap,n(S.anisotropyMap,x.anisotropyMapTransform))),x.specularIntensity.value=S.specularIntensity,x.specularColor.value.copy(S.specularColor),S.specularColorMap&&(x.specularColorMap.value=S.specularColorMap,n(S.specularColorMap,x.specularColorMapTransform)),S.specularIntensityMap&&(x.specularIntensityMap.value=S.specularIntensityMap,n(S.specularIntensityMap,x.specularIntensityMapTransform))}function b(x,S){S.matcap&&(x.matcap.value=S.matcap)}function w(x,S){const M=e.get(S).light;x.referencePosition.value.setFromMatrixPosition(M.matrixWorld),x.nearDistance.value=M.shadow.camera.near,x.farDistance.value=M.shadow.camera.far}return{refreshFogUniforms:i,refreshMaterialUniforms:a}}function cxe(t,e,n,i){let a={},s={},r=[];const o=t.getParameter(t.MAX_UNIFORM_BUFFER_BINDINGS);function c(M,C){const A=C.program;i.uniformBlockBinding(M,A)}function u(M,C){let A=a[M.id];A===void 0&&(b(M),A=h(M),a[M.id]=A,M.addEventListener("dispose",x));const N=C.program;i.updateUBOMapping(M,N);const R=e.render.frame;s[M.id]!==R&&(p(M),s[M.id]=R)}function h(M){const C=d();M.__bindingPointIndex=C;const A=t.createBuffer(),N=M.__size,R=M.usage;return t.bindBuffer(t.UNIFORM_BUFFER,A),t.bufferData(t.UNIFORM_BUFFER,N,R),t.bindBuffer(t.UNIFORM_BUFFER,null),t.bindBufferBase(t.UNIFORM_BUFFER,C,A),A}function d(){for(let M=0;M<o;M++)if(r.indexOf(M)===-1)return r.push(M),M;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function p(M){const C=a[M.id],A=M.uniforms,N=M.__cache;t.bindBuffer(t.UNIFORM_BUFFER,C);for(let R=0,D=A.length;R<D;R++){const B=Array.isArray(A[R])?A[R]:[A[R]];for(let z=0,I=B.length;z<I;z++){const U=B[z];if(g(U,R,z,N)===!0){const $=U.__offset,G=Array.isArray(U.value)?U.value:[U.value];let k=0;for(let X=0;X<G.length;X++){const V=G[X],H=w(V);typeof V=="number"||typeof V=="boolean"?(U.__data[0]=V,t.bufferSubData(t.UNIFORM_BUFFER,$+k,U.__data)):V.isMatrix3?(U.__data[0]=V.elements[0],U.__data[1]=V.elements[1],U.__data[2]=V.elements[2],U.__data[3]=0,U.__data[4]=V.elements[3],U.__data[5]=V.elements[4],U.__data[6]=V.elements[5],U.__data[7]=0,U.__data[8]=V.elements[6],U.__data[9]=V.elements[7],U.__data[10]=V.elements[8],U.__data[11]=0):(V.toArray(U.__data,k),k+=H.storage/Float32Array.BYTES_PER_ELEMENT)}t.bufferSubData(t.UNIFORM_BUFFER,$,U.__data)}}}t.bindBuffer(t.UNIFORM_BUFFER,null)}function g(M,C,A,N){const R=M.value,D=C+"_"+A;if(N[D]===void 0)return typeof R=="number"||typeof R=="boolean"?N[D]=R:N[D]=R.clone(),!0;{const B=N[D];if(typeof R=="number"||typeof R=="boolean"){if(B!==R)return N[D]=R,!0}else if(B.equals(R)===!1)return B.copy(R),!0}return!1}function b(M){const C=M.uniforms;let A=0;const N=16;for(let D=0,B=C.length;D<B;D++){const z=Array.isArray(C[D])?C[D]:[C[D]];for(let I=0,U=z.length;I<U;I++){const $=z[I],G=Array.isArray($.value)?$.value:[$.value];for(let k=0,X=G.length;k<X;k++){const V=G[k],H=w(V),W=A%N,J=W%H.boundary,Y=W+J;A+=J,Y!==0&&N-Y<H.storage&&(A+=N-Y),$.__data=new Float32Array(H.storage/Float32Array.BYTES_PER_ELEMENT),$.__offset=A,A+=H.storage}}}const R=A%N;return R>0&&(A+=N-R),M.__size=A,M.__cache={},this}function w(M){const C={boundary:0,storage:0};return typeof M=="number"||typeof M=="boolean"?(C.boundary=4,C.storage=4):M.isVector2?(C.boundary=8,C.storage=8):M.isVector3||M.isColor?(C.boundary=16,C.storage=12):M.isVector4?(C.boundary=16,C.storage=16):M.isMatrix3?(C.boundary=48,C.storage=48):M.isMatrix4?(C.boundary=64,C.storage=64):M.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",M),C}function x(M){const C=M.target;C.removeEventListener("dispose",x);const A=r.indexOf(C.__bindingPointIndex);r.splice(A,1),t.deleteBuffer(a[C.id]),delete a[C.id],delete s[C.id]}function S(){for(const M in a)t.deleteBuffer(a[M]);r=[],a={},s={}}return{bind:c,update:u,dispose:S}}class xG{constructor(e={}){const{canvas:n=d$(),context:i=null,depth:a=!0,stencil:s=!1,alpha:r=!1,antialias:o=!1,premultipliedAlpha:c=!0,preserveDrawingBuffer:u=!1,powerPreference:h="default",failIfMajorPerformanceCaveat:d=!1,reversedDepthBuffer:p=!1}=e;this.isWebGLRenderer=!0;let g;if(i!==null){if(typeof WebGLRenderingContext<"u"&&i instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");g=i.getContextAttributes().alpha}else g=r;const b=new Uint32Array(4),w=new Int32Array(4);let x=null,S=null;const M=[],C=[];this.domElement=n,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=mu,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const A=this;let N=!1;this._outputColorSpace=rr;let R=0,D=0,B=null,z=-1,I=null;const U=new xi,$=new xi;let G=null;const k=new Wt(0);let X=0,V=n.width,H=n.height,W=1,J=null,Y=null;const K=new xi(0,0,V,H),ee=new xi(0,0,V,H);let ie=!1;const Z=new dv;let ue=!1,se=!1;const ae=new wn,ce=new fe,pe=new xi,ye={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let _e=!1;function me(){return B===null?W:1}let ne=i;function be(le,Re){return n.getContext(le,Re)}try{const le={alpha:!0,depth:a,stencil:s,antialias:o,premultipliedAlpha:c,preserveDrawingBuffer:u,powerPreference:h,failIfMajorPerformanceCaveat:d};if("setAttribute"in n&&n.setAttribute("data-engine",`three.js r${ww}`),n.addEventListener("webglcontextlost",at,!1),n.addEventListener("webglcontextrestored",St,!1),n.addEventListener("webglcontextcreationerror",ct,!1),ne===null){const Re="webgl2";if(ne=be(Re,le),ne===null)throw be(Re)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(le){throw console.error("THREE.WebGLRenderer: "+le.message),le}let xe,he,ve,Oe,Le,Ae,et,tt,re,te,we,Ce,Ie,Pe,Ze,We,mt,nt,Ye,Je,jt,wt,Et,zt;function Te(){xe=new _be(ne),xe.init(),wt=new bG(ne,xe),he=new pbe(ne,xe,e,wt),ve=new txe(ne,xe),he.reversedDepthBuffer&&p&&ve.buffers.depth.setReversed(!0),Oe=new Ebe(ne),Le=new k1e,Ae=new nxe(ne,xe,ve,Le,he,wt,Oe),et=new gbe(A),tt=new xbe(A),re=new Nge(ne),Et=new fbe(ne,re),te=new Sbe(ne,re,Oe,Et),we=new Tbe(ne,te,re,Oe),Ye=new Mbe(ne,he,Ae),We=new mbe(Le),Ce=new V1e(A,et,tt,xe,he,Et,We),Ie=new lxe(A,Le),Pe=new $1e,Ze=new Y1e(xe),nt=new dbe(A,et,tt,ve,we,g,c),mt=new J1e(A,we,he),zt=new cxe(ne,Oe,he,ve),Je=new hbe(ne,xe,Oe),jt=new wbe(ne,xe,Oe),Oe.programs=Ce.programs,A.capabilities=he,A.extensions=xe,A.properties=Le,A.renderLists=Pe,A.shadowMap=mt,A.state=ve,A.info=Oe}Te();const pt=new rxe(A,ne);this.xr=pt,this.getContext=function(){return ne},this.getContextAttributes=function(){return ne.getContextAttributes()},this.forceContextLoss=function(){const le=xe.get("WEBGL_lose_context");le&&le.loseContext()},this.forceContextRestore=function(){const le=xe.get("WEBGL_lose_context");le&&le.restoreContext()},this.getPixelRatio=function(){return W},this.setPixelRatio=function(le){le!==void 0&&(W=le,this.setSize(V,H,!1))},this.getSize=function(le){return le.set(V,H)},this.setSize=function(le,Re,Be=!0){if(pt.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}V=le,H=Re,n.width=Math.floor(le*W),n.height=Math.floor(Re*W),Be===!0&&(n.style.width=le+"px",n.style.height=Re+"px"),this.setViewport(0,0,le,Re)},this.getDrawingBufferSize=function(le){return le.set(V*W,H*W).floor()},this.setDrawingBufferSize=function(le,Re,Be){V=le,H=Re,W=Be,n.width=Math.floor(le*Be),n.height=Math.floor(Re*Be),this.setViewport(0,0,le,Re)},this.getCurrentViewport=function(le){return le.copy(U)},this.getViewport=function(le){return le.copy(K)},this.setViewport=function(le,Re,Be,ke){le.isVector4?K.set(le.x,le.y,le.z,le.w):K.set(le,Re,Be,ke),ve.viewport(U.copy(K).multiplyScalar(W).round())},this.getScissor=function(le){return le.copy(ee)},this.setScissor=function(le,Re,Be,ke){le.isVector4?ee.set(le.x,le.y,le.z,le.w):ee.set(le,Re,Be,ke),ve.scissor($.copy(ee).multiplyScalar(W).round())},this.getScissorTest=function(){return ie},this.setScissorTest=function(le){ve.setScissorTest(ie=le)},this.setOpaqueSort=function(le){J=le},this.setTransparentSort=function(le){Y=le},this.getClearColor=function(le){return le.copy(nt.getClearColor())},this.setClearColor=function(){nt.setClearColor(...arguments)},this.getClearAlpha=function(){return nt.getClearAlpha()},this.setClearAlpha=function(){nt.setClearAlpha(...arguments)},this.clear=function(le=!0,Re=!0,Be=!0){let ke=0;if(le){let ze=!1;if(B!==null){const yt=B.texture.format;ze=yt===Pw||yt===Nw||yt===cx}if(ze){const yt=B.texture.type,Pt=yt===Pl||yt===Td||yt===jg||yt===Fg||yt===Cw||yt===Aw,Ht=nt.getClearColor(),Ke=nt.getClearAlpha(),Tt=Ht.r,qt=Ht.g,Jt=Ht.b;Pt?(b[0]=Tt,b[1]=qt,b[2]=Jt,b[3]=Ke,ne.clearBufferuiv(ne.COLOR,0,b)):(w[0]=Tt,w[1]=qt,w[2]=Jt,w[3]=Ke,ne.clearBufferiv(ne.COLOR,0,w))}else ke|=ne.COLOR_BUFFER_BIT}Re&&(ke|=ne.DEPTH_BUFFER_BIT),Be&&(ke|=ne.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),ne.clear(ke)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){n.removeEventListener("webglcontextlost",at,!1),n.removeEventListener("webglcontextrestored",St,!1),n.removeEventListener("webglcontextcreationerror",ct,!1),nt.dispose(),Pe.dispose(),Ze.dispose(),Le.dispose(),et.dispose(),tt.dispose(),we.dispose(),Et.dispose(),zt.dispose(),Ce.dispose(),pt.dispose(),pt.removeEventListener("sessionstart",Se),pt.removeEventListener("sessionend",De),lt.stop()};function at(le){le.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),N=!0}function St(){console.log("THREE.WebGLRenderer: Context Restored."),N=!1;const le=Oe.autoReset,Re=mt.enabled,Be=mt.autoUpdate,ke=mt.needsUpdate,ze=mt.type;Te(),Oe.autoReset=le,mt.enabled=Re,mt.autoUpdate=Be,mt.needsUpdate=ke,mt.type=ze}function ct(le){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",le.statusMessage)}function it(le){const Re=le.target;Re.removeEventListener("dispose",it),Nt(Re)}function Nt(le){kt(le),Le.remove(le)}function kt(le){const Re=Le.get(le).programs;Re!==void 0&&(Re.forEach(function(Be){Ce.releaseProgram(Be)}),le.isShaderMaterial&&Ce.releaseShaderCache(le))}this.renderBufferDirect=function(le,Re,Be,ke,ze,yt){Re===null&&(Re=ye);const Pt=ze.isMesh&&ze.matrixWorld.determinant()<0,Ht=Mt(le,Re,Be,ke,ze);ve.setMaterial(ke,Pt);let Ke=Be.index,Tt=1;if(ke.wireframe===!0){if(Ke=te.getWireframeAttribute(Be),Ke===void 0)return;Tt=2}const qt=Be.drawRange,Jt=Be.attributes.position;let xn=qt.start*Tt,vn=(qt.start+qt.count)*Tt;yt!==null&&(xn=Math.max(xn,yt.start*Tt),vn=Math.min(vn,(yt.start+yt.count)*Tt)),Ke!==null?(xn=Math.max(xn,0),vn=Math.min(vn,Ke.count)):Jt!=null&&(xn=Math.max(xn,0),vn=Math.min(vn,Jt.count));const ui=vn-xn;if(ui<0||ui===1/0)return;Et.setup(ze,ke,Ht,Be,Ke);let si,zn=Je;if(Ke!==null&&(si=re.get(Ke),zn=jt,zn.setIndex(si)),ze.isMesh)ke.wireframe===!0?(ve.setLineWidth(ke.wireframeLinewidth*me()),zn.setMode(ne.LINES)):zn.setMode(ne.TRIANGLES);else if(ze.isLine){let tn=ke.linewidth;tn===void 0&&(tn=1),ve.setLineWidth(tn*me()),ze.isLineSegments?zn.setMode(ne.LINES):ze.isLineLoop?zn.setMode(ne.LINE_LOOP):zn.setMode(ne.LINE_STRIP)}else ze.isPoints?zn.setMode(ne.POINTS):ze.isSprite&&zn.setMode(ne.TRIANGLES);if(ze.isBatchedMesh)if(ze._multiDrawInstances!==null)N1("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),zn.renderMultiDrawInstances(ze._multiDrawStarts,ze._multiDrawCounts,ze._multiDrawCount,ze._multiDrawInstances);else if(xe.get("WEBGL_multi_draw"))zn.renderMultiDraw(ze._multiDrawStarts,ze._multiDrawCounts,ze._multiDrawCount);else{const tn=ze._multiDrawStarts,Ui=ze._multiDrawCounts,ti=ze._multiDrawCount,Fa=Ke?re.get(Ke).bytesPerElement:1,Wo=Le.get(ke).currentProgram.getUniforms();for(let wa=0;wa<ti;wa++)Wo.setValue(ne,"_gl_DrawID",wa),zn.render(tn[wa]/Fa,Ui[wa])}else if(ze.isInstancedMesh)zn.renderInstances(xn,ui,ze.count);else if(Be.isInstancedBufferGeometry){const tn=Be._maxInstanceCount!==void 0?Be._maxInstanceCount:1/0,Ui=Math.min(Be.instanceCount,tn);zn.renderInstances(xn,ui,Ui)}else zn.render(xn,ui)};function Xt(le,Re,Be){le.transparent===!0&&le.side===xl&&le.forceSinglePass===!1?(le.side=Kr,le.needsUpdate=!0,Lt(le,Re,Be),le.side=Ed,le.needsUpdate=!0,Lt(le,Re,Be),le.side=xl):Lt(le,Re,Be)}this.compile=function(le,Re,Be=null){Be===null&&(Be=le),S=Ze.get(Be),S.init(Re),C.push(S),Be.traverseVisible(function(ze){ze.isLight&&ze.layers.test(Re.layers)&&(S.pushLight(ze),ze.castShadow&&S.pushShadow(ze))}),le!==Be&&le.traverseVisible(function(ze){ze.isLight&&ze.layers.test(Re.layers)&&(S.pushLight(ze),ze.castShadow&&S.pushShadow(ze))}),S.setupLights();const ke=new Set;return le.traverse(function(ze){if(!(ze.isMesh||ze.isPoints||ze.isLine||ze.isSprite))return;const yt=ze.material;if(yt)if(Array.isArray(yt))for(let Pt=0;Pt<yt.length;Pt++){const Ht=yt[Pt];Xt(Ht,Be,ze),ke.add(Ht)}else Xt(yt,Be,ze),ke.add(yt)}),S=C.pop(),ke},this.compileAsync=function(le,Re,Be=null){const ke=this.compile(le,Re,Be);return new Promise(ze=>{function yt(){if(ke.forEach(function(Pt){Le.get(Pt).currentProgram.isReady()&&ke.delete(Pt)}),ke.size===0){ze(le);return}setTimeout(yt,10)}xe.get("KHR_parallel_shader_compile")!==null?yt():setTimeout(yt,10)})};let rn=null;function ge(le){rn&&rn(le)}function Se(){lt.stop()}function De(){lt.start()}const lt=new pG;lt.setAnimationLoop(ge),typeof self<"u"&&lt.setContext(self),this.setAnimationLoop=function(le){rn=le,pt.setAnimationLoop(le),le===null?lt.stop():lt.start()},pt.addEventListener("sessionstart",Se),pt.addEventListener("sessionend",De),this.render=function(le,Re){if(Re!==void 0&&Re.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(N===!0)return;if(le.matrixWorldAutoUpdate===!0&&le.updateMatrixWorld(),Re.parent===null&&Re.matrixWorldAutoUpdate===!0&&Re.updateMatrixWorld(),pt.enabled===!0&&pt.isPresenting===!0&&(pt.cameraAutoUpdate===!0&&pt.updateCamera(Re),Re=pt.getCamera()),le.isScene===!0&&le.onBeforeRender(A,le,Re,B),S=Ze.get(le,C.length),S.init(Re),C.push(S),ae.multiplyMatrices(Re.projectionMatrix,Re.matrixWorldInverse),Z.setFromProjectionMatrix(ae,ko,Re.reversedDepth),se=this.localClippingEnabled,ue=We.init(this.clippingPlanes,se),x=Pe.get(le,M.length),x.init(),M.push(x),pt.enabled===!0&&pt.isPresenting===!0){const yt=A.xr.getDepthSensingMesh();yt!==null&&rt(yt,Re,-1/0,A.sortObjects)}rt(le,Re,0,A.sortObjects),x.finish(),A.sortObjects===!0&&x.sort(J,Y),_e=pt.enabled===!1||pt.isPresenting===!1||pt.hasDepthSensing()===!1,_e&&nt.addToRenderList(x,le),this.info.render.frame++,ue===!0&&We.beginShadows();const Be=S.state.shadowsArray;mt.render(Be,le,Re),ue===!0&&We.endShadows(),this.info.autoReset===!0&&this.info.reset();const ke=x.opaque,ze=x.transmissive;if(S.setupLights(),Re.isArrayCamera){const yt=Re.cameras;if(ze.length>0)for(let Pt=0,Ht=yt.length;Pt<Ht;Pt++){const Ke=yt[Pt];Ut(ke,ze,le,Ke)}_e&&nt.render(le);for(let Pt=0,Ht=yt.length;Pt<Ht;Pt++){const Ke=yt[Pt];Bt(x,le,Ke,Ke.viewport)}}else ze.length>0&&Ut(ke,ze,le,Re),_e&&nt.render(le),Bt(x,le,Re);B!==null&&D===0&&(Ae.updateMultisampleRenderTarget(B),Ae.updateRenderTargetMipmap(B)),le.isScene===!0&&le.onAfterRender(A,le,Re),Et.resetDefaultState(),z=-1,I=null,C.pop(),C.length>0?(S=C[C.length-1],ue===!0&&We.setGlobalState(A.clippingPlanes,S.state.camera)):S=null,M.pop(),M.length>0?x=M[M.length-1]:x=null};function rt(le,Re,Be,ke){if(le.visible===!1)return;if(le.layers.test(Re.layers)){if(le.isGroup)Be=le.renderOrder;else if(le.isLOD)le.autoUpdate===!0&&le.update(Re);else if(le.isLight)S.pushLight(le),le.castShadow&&S.pushShadow(le);else if(le.isSprite){if(!le.frustumCulled||Z.intersectsSprite(le)){ke&&pe.setFromMatrixPosition(le.matrixWorld).applyMatrix4(ae);const Pt=we.update(le),Ht=le.material;Ht.visible&&x.push(le,Pt,Ht,Be,pe.z,null)}}else if((le.isMesh||le.isLine||le.isPoints)&&(!le.frustumCulled||Z.intersectsObject(le))){const Pt=we.update(le),Ht=le.material;if(ke&&(le.boundingSphere!==void 0?(le.boundingSphere===null&&le.computeBoundingSphere(),pe.copy(le.boundingSphere.center)):(Pt.boundingSphere===null&&Pt.computeBoundingSphere(),pe.copy(Pt.boundingSphere.center)),pe.applyMatrix4(le.matrixWorld).applyMatrix4(ae)),Array.isArray(Ht)){const Ke=Pt.groups;for(let Tt=0,qt=Ke.length;Tt<qt;Tt++){const Jt=Ke[Tt],xn=Ht[Jt.materialIndex];xn&&xn.visible&&x.push(le,Pt,xn,Be,pe.z,Jt)}}else Ht.visible&&x.push(le,Pt,Ht,Be,pe.z,null)}}const yt=le.children;for(let Pt=0,Ht=yt.length;Pt<Ht;Pt++)rt(yt[Pt],Re,Be,ke)}function Bt(le,Re,Be,ke){const ze=le.opaque,yt=le.transmissive,Pt=le.transparent;S.setupLightsView(Be),ue===!0&&We.setGlobalState(A.clippingPlanes,Be),ke&&ve.viewport(U.copy(ke)),ze.length>0&&Dt(ze,Re,Be),yt.length>0&&Dt(yt,Re,Be),Pt.length>0&&Dt(Pt,Re,Be),ve.buffers.depth.setTest(!0),ve.buffers.depth.setMask(!0),ve.buffers.color.setMask(!0),ve.setPolygonOffset(!1)}function Ut(le,Re,Be,ke){if((Be.isScene===!0?Be.overrideMaterial:null)!==null)return;S.state.transmissionRenderTarget[ke.id]===void 0&&(S.state.transmissionRenderTarget[ke.id]=new hc(1,1,{generateMipmaps:!0,type:xe.has("EXT_color_buffer_half_float")||xe.has("EXT_color_buffer_float")?bm:Pl,minFilter:cu,samples:4,stencilBuffer:s,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:mi.workingColorSpace}));const yt=S.state.transmissionRenderTarget[ke.id],Pt=ke.viewport||U;yt.setSize(Pt.z*A.transmissionResolutionScale,Pt.w*A.transmissionResolutionScale);const Ht=A.getRenderTarget(),Ke=A.getActiveCubeFace(),Tt=A.getActiveMipmapLevel();A.setRenderTarget(yt),A.getClearColor(k),X=A.getClearAlpha(),X<1&&A.setClearColor(16777215,.5),A.clear(),_e&&nt.render(Be);const qt=A.toneMapping;A.toneMapping=mu;const Jt=ke.viewport;if(ke.viewport!==void 0&&(ke.viewport=void 0),S.setupLightsView(ke),ue===!0&&We.setGlobalState(A.clippingPlanes,ke),Dt(le,Be,ke),Ae.updateMultisampleRenderTarget(yt),Ae.updateRenderTargetMipmap(yt),xe.has("WEBGL_multisampled_render_to_texture")===!1){let xn=!1;for(let vn=0,ui=Re.length;vn<ui;vn++){const si=Re[vn],zn=si.object,tn=si.geometry,Ui=si.material,ti=si.group;if(Ui.side===xl&&zn.layers.test(ke.layers)){const Fa=Ui.side;Ui.side=Kr,Ui.needsUpdate=!0,ot(zn,Be,ke,tn,Ui,ti),Ui.side=Fa,Ui.needsUpdate=!0,xn=!0}}xn===!0&&(Ae.updateMultisampleRenderTarget(yt),Ae.updateRenderTargetMipmap(yt))}A.setRenderTarget(Ht,Ke,Tt),A.setClearColor(k,X),Jt!==void 0&&(ke.viewport=Jt),A.toneMapping=qt}function Dt(le,Re,Be){const ke=Re.isScene===!0?Re.overrideMaterial:null;for(let ze=0,yt=le.length;ze<yt;ze++){const Pt=le[ze],Ht=Pt.object,Ke=Pt.geometry,Tt=Pt.group;let qt=Pt.material;qt.allowOverride===!0&&ke!==null&&(qt=ke),Ht.layers.test(Be.layers)&&ot(Ht,Re,Be,Ke,qt,Tt)}}function ot(le,Re,Be,ke,ze,yt){le.onBeforeRender(A,Re,Be,ke,ze,yt),le.modelViewMatrix.multiplyMatrices(Be.matrixWorldInverse,le.matrixWorld),le.normalMatrix.getNormalMatrix(le.modelViewMatrix),ze.onBeforeRender(A,Re,Be,ke,le,yt),ze.transparent===!0&&ze.side===xl&&ze.forceSinglePass===!1?(ze.side=Kr,ze.needsUpdate=!0,A.renderBufferDirect(Be,Re,ke,ze,le,yt),ze.side=Ed,ze.needsUpdate=!0,A.renderBufferDirect(Be,Re,ke,ze,le,yt),ze.side=xl):A.renderBufferDirect(Be,Re,ke,ze,le,yt),le.onAfterRender(A,Re,Be,ke,ze,yt)}function Lt(le,Re,Be){Re.isScene!==!0&&(Re=ye);const ke=Le.get(le),ze=S.state.lights,yt=S.state.shadowsArray,Pt=ze.state.version,Ht=Ce.getParameters(le,ze.state,yt,Re,Be),Ke=Ce.getProgramCacheKey(Ht);let Tt=ke.programs;ke.environment=le.isMeshStandardMaterial?Re.environment:null,ke.fog=Re.fog,ke.envMap=(le.isMeshStandardMaterial?tt:et).get(le.envMap||ke.environment),ke.envMapRotation=ke.environment!==null&&le.envMap===null?Re.environmentRotation:le.envMapRotation,Tt===void 0&&(le.addEventListener("dispose",it),Tt=new Map,ke.programs=Tt);let qt=Tt.get(Ke);if(qt!==void 0){if(ke.currentProgram===qt&&ke.lightsStateVersion===Pt)return Ot(le,Ht),qt}else Ht.uniforms=Ce.getUniforms(le),le.onBeforeCompile(Ht,A),qt=Ce.acquireProgram(Ht,Ke),Tt.set(Ke,qt),ke.uniforms=Ht.uniforms;const Jt=ke.uniforms;return(!le.isShaderMaterial&&!le.isRawShaderMaterial||le.clipping===!0)&&(Jt.clippingPlanes=We.uniform),Ot(le,Ht),ke.needsLights=wi(le),ke.lightsStateVersion=Pt,ke.needsLights&&(Jt.ambientLightColor.value=ze.state.ambient,Jt.lightProbe.value=ze.state.probe,Jt.directionalLights.value=ze.state.directional,Jt.directionalLightShadows.value=ze.state.directionalShadow,Jt.spotLights.value=ze.state.spot,Jt.spotLightShadows.value=ze.state.spotShadow,Jt.rectAreaLights.value=ze.state.rectArea,Jt.ltc_1.value=ze.state.rectAreaLTC1,Jt.ltc_2.value=ze.state.rectAreaLTC2,Jt.pointLights.value=ze.state.point,Jt.pointLightShadows.value=ze.state.pointShadow,Jt.hemisphereLights.value=ze.state.hemi,Jt.directionalShadowMap.value=ze.state.directionalShadowMap,Jt.directionalShadowMatrix.value=ze.state.directionalShadowMatrix,Jt.spotShadowMap.value=ze.state.spotShadowMap,Jt.spotLightMatrix.value=ze.state.spotLightMatrix,Jt.spotLightMap.value=ze.state.spotLightMap,Jt.pointShadowMap.value=ze.state.pointShadowMap,Jt.pointShadowMatrix.value=ze.state.pointShadowMatrix),ke.currentProgram=qt,ke.uniformsList=null,qt}function vt(le){if(le.uniformsList===null){const Re=le.currentProgram.getUniforms();le.uniformsList=_S.seqWithValue(Re.seq,le.uniforms)}return le.uniformsList}function Ot(le,Re){const Be=Le.get(le);Be.outputColorSpace=Re.outputColorSpace,Be.batching=Re.batching,Be.batchingColor=Re.batchingColor,Be.instancing=Re.instancing,Be.instancingColor=Re.instancingColor,Be.instancingMorph=Re.instancingMorph,Be.skinning=Re.skinning,Be.morphTargets=Re.morphTargets,Be.morphNormals=Re.morphNormals,Be.morphColors=Re.morphColors,Be.morphTargetsCount=Re.morphTargetsCount,Be.numClippingPlanes=Re.numClippingPlanes,Be.numIntersection=Re.numClipIntersection,Be.vertexAlphas=Re.vertexAlphas,Be.vertexTangents=Re.vertexTangents,Be.toneMapping=Re.toneMapping}function Mt(le,Re,Be,ke,ze){Re.isScene!==!0&&(Re=ye),Ae.resetTextureUnits();const yt=Re.fog,Pt=ke.isMeshStandardMaterial?Re.environment:null,Ht=B===null?A.outputColorSpace:B.isXRRenderTarget===!0?B.texture.colorSpace:eh,Ke=(ke.isMeshStandardMaterial?tt:et).get(ke.envMap||Pt),Tt=ke.vertexColors===!0&&!!Be.attributes.color&&Be.attributes.color.itemSize===4,qt=!!Be.attributes.tangent&&(!!ke.normalMap||ke.anisotropy>0),Jt=!!Be.morphAttributes.position,xn=!!Be.morphAttributes.normal,vn=!!Be.morphAttributes.color;let ui=mu;ke.toneMapped&&(B===null||B.isXRRenderTarget===!0)&&(ui=A.toneMapping);const si=Be.morphAttributes.position||Be.morphAttributes.normal||Be.morphAttributes.color,zn=si!==void 0?si.length:0,tn=Le.get(ke),Ui=S.state.lights;if(ue===!0&&(se===!0||le!==I)){const Ea=le===I&&ke.id===z;We.setState(ke,le,Ea)}let ti=!1;ke.version===tn.__version?(tn.needsLights&&tn.lightsStateVersion!==Ui.state.version||tn.outputColorSpace!==Ht||ze.isBatchedMesh&&tn.batching===!1||!ze.isBatchedMesh&&tn.batching===!0||ze.isBatchedMesh&&tn.batchingColor===!0&&ze.colorTexture===null||ze.isBatchedMesh&&tn.batchingColor===!1&&ze.colorTexture!==null||ze.isInstancedMesh&&tn.instancing===!1||!ze.isInstancedMesh&&tn.instancing===!0||ze.isSkinnedMesh&&tn.skinning===!1||!ze.isSkinnedMesh&&tn.skinning===!0||ze.isInstancedMesh&&tn.instancingColor===!0&&ze.instanceColor===null||ze.isInstancedMesh&&tn.instancingColor===!1&&ze.instanceColor!==null||ze.isInstancedMesh&&tn.instancingMorph===!0&&ze.morphTexture===null||ze.isInstancedMesh&&tn.instancingMorph===!1&&ze.morphTexture!==null||tn.envMap!==Ke||ke.fog===!0&&tn.fog!==yt||tn.numClippingPlanes!==void 0&&(tn.numClippingPlanes!==We.numPlanes||tn.numIntersection!==We.numIntersection)||tn.vertexAlphas!==Tt||tn.vertexTangents!==qt||tn.morphTargets!==Jt||tn.morphNormals!==xn||tn.morphColors!==vn||tn.toneMapping!==ui||tn.morphTargetsCount!==zn)&&(ti=!0):(ti=!0,tn.__version=ke.version);let Fa=tn.currentProgram;ti===!0&&(Fa=Lt(ke,Re,ze));let Wo=!1,wa=!1,vc=!1;const Kn=Fa.getUniforms(),Ja=tn.uniforms;if(ve.useProgram(Fa.program)&&(Wo=!0,wa=!0,vc=!0),ke.id!==z&&(z=ke.id,wa=!0),Wo||I!==le){ve.buffers.depth.getReversed()&&le.reversedDepth!==!0&&(le._reversedDepth=!0,le.updateProjectionMatrix()),Kn.setValue(ne,"projectionMatrix",le.projectionMatrix),Kn.setValue(ne,"viewMatrix",le.matrixWorldInverse);const ha=Kn.map.cameraPosition;ha!==void 0&&ha.setValue(ne,ce.setFromMatrixPosition(le.matrixWorld)),he.logarithmicDepthBuffer&&Kn.setValue(ne,"logDepthBufFC",2/(Math.log(le.far+1)/Math.LN2)),(ke.isMeshPhongMaterial||ke.isMeshToonMaterial||ke.isMeshLambertMaterial||ke.isMeshBasicMaterial||ke.isMeshStandardMaterial||ke.isShaderMaterial)&&Kn.setValue(ne,"isOrthographic",le.isOrthographicCamera===!0),I!==le&&(I=le,wa=!0,vc=!0)}if(ze.isSkinnedMesh){Kn.setOptional(ne,ze,"bindMatrix"),Kn.setOptional(ne,ze,"bindMatrixInverse");const Ea=ze.skeleton;Ea&&(Ea.boneTexture===null&&Ea.computeBoneTexture(),Kn.setValue(ne,"boneTexture",Ea.boneTexture,Ae))}ze.isBatchedMesh&&(Kn.setOptional(ne,ze,"batchingTexture"),Kn.setValue(ne,"batchingTexture",ze._matricesTexture,Ae),Kn.setOptional(ne,ze,"batchingIdTexture"),Kn.setValue(ne,"batchingIdTexture",ze._indirectTexture,Ae),Kn.setOptional(ne,ze,"batchingColorTexture"),ze._colorsTexture!==null&&Kn.setValue(ne,"batchingColorTexture",ze._colorsTexture,Ae));const hs=Be.morphAttributes;if((hs.position!==void 0||hs.normal!==void 0||hs.color!==void 0)&&Ye.update(ze,Be,Fa),(wa||tn.receiveShadow!==ze.receiveShadow)&&(tn.receiveShadow=ze.receiveShadow,Kn.setValue(ne,"receiveShadow",ze.receiveShadow)),ke.isMeshGouraudMaterial&&ke.envMap!==null&&(Ja.envMap.value=Ke,Ja.flipEnvMap.value=Ke.isCubeTexture&&Ke.isRenderTargetTexture===!1?-1:1),ke.isMeshStandardMaterial&&ke.envMap===null&&Re.environment!==null&&(Ja.envMapIntensity.value=Re.environmentIntensity),wa&&(Kn.setValue(ne,"toneMappingExposure",A.toneMappingExposure),tn.needsLights&&Ln(Ja,vc),yt&&ke.fog===!0&&Ie.refreshFogUniforms(Ja,yt),Ie.refreshMaterialUniforms(Ja,ke,W,H,S.state.transmissionRenderTarget[le.id]),_S.upload(ne,vt(tn),Ja,Ae)),ke.isShaderMaterial&&ke.uniformsNeedUpdate===!0&&(_S.upload(ne,vt(tn),Ja,Ae),ke.uniformsNeedUpdate=!1),ke.isSpriteMaterial&&Kn.setValue(ne,"center",ze.center),Kn.setValue(ne,"modelViewMatrix",ze.modelViewMatrix),Kn.setValue(ne,"normalMatrix",ze.normalMatrix),Kn.setValue(ne,"modelMatrix",ze.matrixWorld),ke.isShaderMaterial||ke.isRawShaderMaterial){const Ea=ke.uniformsGroups;for(let ha=0,Tu=Ea.length;ha<Tu;ha++){const Cs=Ea[ha];zt.update(Cs,Fa),zt.bind(Cs,Fa)}}return Fa}function Ln(le,Re){le.ambientLightColor.needsUpdate=Re,le.lightProbe.needsUpdate=Re,le.directionalLights.needsUpdate=Re,le.directionalLightShadows.needsUpdate=Re,le.pointLights.needsUpdate=Re,le.pointLightShadows.needsUpdate=Re,le.spotLights.needsUpdate=Re,le.spotLightShadows.needsUpdate=Re,le.rectAreaLights.needsUpdate=Re,le.hemisphereLights.needsUpdate=Re}function wi(le){return le.isMeshLambertMaterial||le.isMeshToonMaterial||le.isMeshPhongMaterial||le.isMeshStandardMaterial||le.isShadowMaterial||le.isShaderMaterial&&le.lights===!0}this.getActiveCubeFace=function(){return R},this.getActiveMipmapLevel=function(){return D},this.getRenderTarget=function(){return B},this.setRenderTargetTextures=function(le,Re,Be){const ke=Le.get(le);ke.__autoAllocateDepthBuffer=le.resolveDepthBuffer===!1,ke.__autoAllocateDepthBuffer===!1&&(ke.__useRenderToTexture=!1),Le.get(le.texture).__webglTexture=Re,Le.get(le.depthTexture).__webglTexture=ke.__autoAllocateDepthBuffer?void 0:Be,ke.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(le,Re){const Be=Le.get(le);Be.__webglFramebuffer=Re,Be.__useDefaultFramebuffer=Re===void 0};const aa=ne.createFramebuffer();this.setRenderTarget=function(le,Re=0,Be=0){B=le,R=Re,D=Be;let ke=!0,ze=null,yt=!1,Pt=!1;if(le){const Ke=Le.get(le);if(Ke.__useDefaultFramebuffer!==void 0)ve.bindFramebuffer(ne.FRAMEBUFFER,null),ke=!1;else if(Ke.__webglFramebuffer===void 0)Ae.setupRenderTarget(le);else if(Ke.__hasExternalTextures)Ae.rebindTextures(le,Le.get(le.texture).__webglTexture,Le.get(le.depthTexture).__webglTexture);else if(le.depthBuffer){const Jt=le.depthTexture;if(Ke.__boundDepthTexture!==Jt){if(Jt!==null&&Le.has(Jt)&&(le.width!==Jt.image.width||le.height!==Jt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");Ae.setupDepthRenderbuffer(le)}}const Tt=le.texture;(Tt.isData3DTexture||Tt.isDataArrayTexture||Tt.isCompressedArrayTexture)&&(Pt=!0);const qt=Le.get(le).__webglFramebuffer;le.isWebGLCubeRenderTarget?(Array.isArray(qt[Re])?ze=qt[Re][Be]:ze=qt[Re],yt=!0):le.samples>0&&Ae.useMultisampledRTT(le)===!1?ze=Le.get(le).__webglMultisampledFramebuffer:Array.isArray(qt)?ze=qt[Be]:ze=qt,U.copy(le.viewport),$.copy(le.scissor),G=le.scissorTest}else U.copy(K).multiplyScalar(W).floor(),$.copy(ee).multiplyScalar(W).floor(),G=ie;if(Be!==0&&(ze=aa),ve.bindFramebuffer(ne.FRAMEBUFFER,ze)&&ke&&ve.drawBuffers(le,ze),ve.viewport(U),ve.scissor($),ve.setScissorTest(G),yt){const Ke=Le.get(le.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_CUBE_MAP_POSITIVE_X+Re,Ke.__webglTexture,Be)}else if(Pt){const Ke=Re;for(let Tt=0;Tt<le.textures.length;Tt++){const qt=Le.get(le.textures[Tt]);ne.framebufferTextureLayer(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0+Tt,qt.__webglTexture,Be,Ke)}}else if(le!==null&&Be!==0){const Ke=Le.get(le.texture);ne.framebufferTexture2D(ne.FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_2D,Ke.__webglTexture,Be)}z=-1},this.readRenderTargetPixels=function(le,Re,Be,ke,ze,yt,Pt,Ht=0){if(!(le&&le.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Ke=Le.get(le).__webglFramebuffer;if(le.isWebGLCubeRenderTarget&&Pt!==void 0&&(Ke=Ke[Pt]),Ke){ve.bindFramebuffer(ne.FRAMEBUFFER,Ke);try{const Tt=le.textures[Ht],qt=Tt.format,Jt=Tt.type;if(!he.textureFormatReadable(qt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!he.textureTypeReadable(Jt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}Re>=0&&Re<=le.width-ke&&Be>=0&&Be<=le.height-ze&&(le.textures.length>1&&ne.readBuffer(ne.COLOR_ATTACHMENT0+Ht),ne.readPixels(Re,Be,ke,ze,wt.convert(qt),wt.convert(Jt),yt))}finally{const Tt=B!==null?Le.get(B).__webglFramebuffer:null;ve.bindFramebuffer(ne.FRAMEBUFFER,Tt)}}},this.readRenderTargetPixelsAsync=async function(le,Re,Be,ke,ze,yt,Pt,Ht=0){if(!(le&&le.isWebGLRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Ke=Le.get(le).__webglFramebuffer;if(le.isWebGLCubeRenderTarget&&Pt!==void 0&&(Ke=Ke[Pt]),Ke)if(Re>=0&&Re<=le.width-ke&&Be>=0&&Be<=le.height-ze){ve.bindFramebuffer(ne.FRAMEBUFFER,Ke);const Tt=le.textures[Ht],qt=Tt.format,Jt=Tt.type;if(!he.textureFormatReadable(qt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!he.textureTypeReadable(Jt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const xn=ne.createBuffer();ne.bindBuffer(ne.PIXEL_PACK_BUFFER,xn),ne.bufferData(ne.PIXEL_PACK_BUFFER,yt.byteLength,ne.STREAM_READ),le.textures.length>1&&ne.readBuffer(ne.COLOR_ATTACHMENT0+Ht),ne.readPixels(Re,Be,ke,ze,wt.convert(qt),wt.convert(Jt),0);const vn=B!==null?Le.get(B).__webglFramebuffer:null;ve.bindFramebuffer(ne.FRAMEBUFFER,vn);const ui=ne.fenceSync(ne.SYNC_GPU_COMMANDS_COMPLETE,0);return ne.flush(),await Kpe(ne,ui,4),ne.bindBuffer(ne.PIXEL_PACK_BUFFER,xn),ne.getBufferSubData(ne.PIXEL_PACK_BUFFER,0,yt),ne.deleteBuffer(xn),ne.deleteSync(ui),yt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(le,Re=null,Be=0){const ke=Math.pow(2,-Be),ze=Math.floor(le.image.width*ke),yt=Math.floor(le.image.height*ke),Pt=Re!==null?Re.x:0,Ht=Re!==null?Re.y:0;Ae.setTexture2D(le,0),ne.copyTexSubImage2D(ne.TEXTURE_2D,Be,0,0,Pt,Ht,ze,yt),ve.unbindTexture()};const ei=ne.createFramebuffer(),Fn=ne.createFramebuffer();this.copyTextureToTexture=function(le,Re,Be=null,ke=null,ze=0,yt=null){yt===null&&(ze!==0?(N1("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),yt=ze,ze=0):yt=0);let Pt,Ht,Ke,Tt,qt,Jt,xn,vn,ui;const si=le.isCompressedTexture?le.mipmaps[yt]:le.image;if(Be!==null)Pt=Be.max.x-Be.min.x,Ht=Be.max.y-Be.min.y,Ke=Be.isBox3?Be.max.z-Be.min.z:1,Tt=Be.min.x,qt=Be.min.y,Jt=Be.isBox3?Be.min.z:0;else{const hs=Math.pow(2,-ze);Pt=Math.floor(si.width*hs),Ht=Math.floor(si.height*hs),le.isDataArrayTexture?Ke=si.depth:le.isData3DTexture?Ke=Math.floor(si.depth*hs):Ke=1,Tt=0,qt=0,Jt=0}ke!==null?(xn=ke.x,vn=ke.y,ui=ke.z):(xn=0,vn=0,ui=0);const zn=wt.convert(Re.format),tn=wt.convert(Re.type);let Ui;Re.isData3DTexture?(Ae.setTexture3D(Re,0),Ui=ne.TEXTURE_3D):Re.isDataArrayTexture||Re.isCompressedArrayTexture?(Ae.setTexture2DArray(Re,0),Ui=ne.TEXTURE_2D_ARRAY):(Ae.setTexture2D(Re,0),Ui=ne.TEXTURE_2D),ne.pixelStorei(ne.UNPACK_FLIP_Y_WEBGL,Re.flipY),ne.pixelStorei(ne.UNPACK_PREMULTIPLY_ALPHA_WEBGL,Re.premultiplyAlpha),ne.pixelStorei(ne.UNPACK_ALIGNMENT,Re.unpackAlignment);const ti=ne.getParameter(ne.UNPACK_ROW_LENGTH),Fa=ne.getParameter(ne.UNPACK_IMAGE_HEIGHT),Wo=ne.getParameter(ne.UNPACK_SKIP_PIXELS),wa=ne.getParameter(ne.UNPACK_SKIP_ROWS),vc=ne.getParameter(ne.UNPACK_SKIP_IMAGES);ne.pixelStorei(ne.UNPACK_ROW_LENGTH,si.width),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,si.height),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Tt),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,qt),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,Jt);const Kn=le.isDataArrayTexture||le.isData3DTexture,Ja=Re.isDataArrayTexture||Re.isData3DTexture;if(le.isDepthTexture){const hs=Le.get(le),Ea=Le.get(Re),ha=Le.get(hs.__renderTarget),Tu=Le.get(Ea.__renderTarget);ve.bindFramebuffer(ne.READ_FRAMEBUFFER,ha.__webglFramebuffer),ve.bindFramebuffer(ne.DRAW_FRAMEBUFFER,Tu.__webglFramebuffer);for(let Cs=0;Cs<Ke;Cs++)Kn&&(ne.framebufferTextureLayer(ne.READ_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,Le.get(le).__webglTexture,ze,Jt+Cs),ne.framebufferTextureLayer(ne.DRAW_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,Le.get(Re).__webglTexture,yt,ui+Cs)),ne.blitFramebuffer(Tt,qt,Pt,Ht,xn,vn,Pt,Ht,ne.DEPTH_BUFFER_BIT,ne.NEAREST);ve.bindFramebuffer(ne.READ_FRAMEBUFFER,null),ve.bindFramebuffer(ne.DRAW_FRAMEBUFFER,null)}else if(ze!==0||le.isRenderTargetTexture||Le.has(le)){const hs=Le.get(le),Ea=Le.get(Re);ve.bindFramebuffer(ne.READ_FRAMEBUFFER,ei),ve.bindFramebuffer(ne.DRAW_FRAMEBUFFER,Fn);for(let ha=0;ha<Ke;ha++)Kn?ne.framebufferTextureLayer(ne.READ_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,hs.__webglTexture,ze,Jt+ha):ne.framebufferTexture2D(ne.READ_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_2D,hs.__webglTexture,ze),Ja?ne.framebufferTextureLayer(ne.DRAW_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,Ea.__webglTexture,yt,ui+ha):ne.framebufferTexture2D(ne.DRAW_FRAMEBUFFER,ne.COLOR_ATTACHMENT0,ne.TEXTURE_2D,Ea.__webglTexture,yt),ze!==0?ne.blitFramebuffer(Tt,qt,Pt,Ht,xn,vn,Pt,Ht,ne.COLOR_BUFFER_BIT,ne.NEAREST):Ja?ne.copyTexSubImage3D(Ui,yt,xn,vn,ui+ha,Tt,qt,Pt,Ht):ne.copyTexSubImage2D(Ui,yt,xn,vn,Tt,qt,Pt,Ht);ve.bindFramebuffer(ne.READ_FRAMEBUFFER,null),ve.bindFramebuffer(ne.DRAW_FRAMEBUFFER,null)}else Ja?le.isDataTexture||le.isData3DTexture?ne.texSubImage3D(Ui,yt,xn,vn,ui,Pt,Ht,Ke,zn,tn,si.data):Re.isCompressedArrayTexture?ne.compressedTexSubImage3D(Ui,yt,xn,vn,ui,Pt,Ht,Ke,zn,si.data):ne.texSubImage3D(Ui,yt,xn,vn,ui,Pt,Ht,Ke,zn,tn,si):le.isDataTexture?ne.texSubImage2D(ne.TEXTURE_2D,yt,xn,vn,Pt,Ht,zn,tn,si.data):le.isCompressedTexture?ne.compressedTexSubImage2D(ne.TEXTURE_2D,yt,xn,vn,si.width,si.height,zn,si.data):ne.texSubImage2D(ne.TEXTURE_2D,yt,xn,vn,Pt,Ht,zn,tn,si);ne.pixelStorei(ne.UNPACK_ROW_LENGTH,ti),ne.pixelStorei(ne.UNPACK_IMAGE_HEIGHT,Fa),ne.pixelStorei(ne.UNPACK_SKIP_PIXELS,Wo),ne.pixelStorei(ne.UNPACK_SKIP_ROWS,wa),ne.pixelStorei(ne.UNPACK_SKIP_IMAGES,vc),yt===0&&Re.generateMipmaps&&ne.generateMipmap(Ui),ve.unbindTexture()},this.initRenderTarget=function(le){Le.get(le).__webglFramebuffer===void 0&&Ae.setupRenderTarget(le)},this.initTexture=function(le){le.isCubeTexture?Ae.setTextureCube(le,0):le.isData3DTexture?Ae.setTexture3D(le,0):le.isDataArrayTexture||le.isCompressedArrayTexture?Ae.setTexture2DArray(le,0):Ae.setTexture2D(le,0),ve.unbindTexture()},this.resetState=function(){R=0,D=0,B=null,ve.reset(),Et.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return ko}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(e){this._outputColorSpace=e;const n=this.getContext();n.drawingBufferColorSpace=mi._getDrawingBufferColorSpace(e),n.unpackColorSpace=mi._getUnpackColorSpace()}}const uxe=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:ZA,AddEquation:Lf,AddOperation:HH,AdditiveAnimationBlendMode:r6,AdditiveBlending:R5,AgXToneMapping:XH,AlphaFormat:i6,AlwaysCompare:c$,AlwaysDepth:o3,AlwaysStencilFunc:L5,AmbientLight:iG,AnimationAction:fG,AnimationClip:z1,AnimationLoader:x0e,AnimationMixer:q0e,AnimationObjectGroup:K0e,AnimationUtils:g0e,ArcCurve:A$,ArrayCamera:cG,ArrowHelper:_ge,AttachedBindMode:D5,Audio:uG,AudioAnalyser:B0e,AudioContext:P6,AudioListener:O0e,AudioLoader:P0e,AxesHelper:Sge,BackSide:Kr,BasicDepthPacking:e$,BasicShadowMap:wH,BatchedMesh:w$,Bone:p6,BooleanKeyframeTrack:xm,Box2:sge,Box3:mr,Box3Helper:bge,BoxGeometry:fo,BoxHelper:yge,BufferAttribute:$i,BufferGeometry:Pn,BufferGeometryLoader:lG,ByteType:JA,Cache:uu,Camera:Iw,CameraHelper:vge,CanvasTexture:jme,CapsuleGeometry:Hw,CatmullRomCurve3:R$,CineonToneMapping:WH,CircleGeometry:$w,ClampToEdgeWrapping:El,Clock:D6,Color:Wt,ColorKeyframeTrack:A6,ColorManagement:mi,CompressedArrayTexture:Bme,CompressedCubeTexture:Ume,CompressedTexture:Vw,CompressedTextureLoader:_0e,ConeGeometry:dx,ConstantAlphaFactor:FH,ConstantColorFactor:UH,Controls:Ege,CubeCamera:g$,CubeReflectionMapping:Md,CubeRefractionMapping:Jf,CubeTexture:ux,CubeTextureLoader:S0e,CubeUVReflectionMapping:cv,CubicBezierCurve:y6,CubicBezierCurve3:N$,CubicInterpolant:q$,CullFaceBack:A5,CullFaceFront:SH,CullFaceFrontBack:Khe,CullFaceNone:_H,Curve:gc,CurvePath:D$,CustomBlending:EH,CustomToneMapping:KH,CylinderGeometry:sr,Cylindrical:age,Data3DTexture:Ow,DataArrayTexture:Lw,DataTexture:gu,DataTextureLoader:w0e,DataUtils:lme,DecrementStencilOp:ope,DecrementWrapStencilOp:cpe,DefaultLoadingManager:Q$,DepthFormat:Vg,DepthStencilFormat:kg,DepthTexture:kw,DetachedBindMode:YH,DirectionalLight:nG,DirectionalLightHelper:gge,DiscreteInterpolant:Y$,DodecahedronGeometry:Gw,DoubleSide:xl,DstAlphaFactor:LH,DstColorFactor:IH,DynamicCopyUsage:Epe,DynamicDrawUsage:ype,DynamicReadUsage:_pe,EdgesGeometry:C$,EllipseCurve:Ww,EqualCompare:s$,EqualDepth:c3,EqualStencilFunc:hpe,EquirectangularReflectionMapping:_1,EquirectangularRefractionMapping:S1,Euler:xo,EventDispatcher:wu,ExternalTexture:g6,ExtrudeGeometry:Kw,FileLoader:Cd,Float16BufferAttribute:mme,Float32BufferAttribute:an,FloatType:Hr,Fog:Bw,FogExp2:zw,FramebufferTexture:zme,FrontSide:Ed,Frustum:dv,FrustumArray:Fw,GLBufferAttribute:ege,GLSL1:Tpe,GLSL3:O5,GreaterCompare:r$,GreaterDepth:d3,GreaterEqualCompare:l$,GreaterEqualDepth:u3,GreaterEqualStencilFunc:vpe,GreaterStencilFunc:mpe,GridHelper:pge,Group:bg,HalfFloatType:bm,HemisphereLight:J$,HemisphereLightHelper:hge,IcosahedronGeometry:Xw,ImageBitmapLoader:N0e,ImageLoader:B1,ImageUtils:f$,IncrementStencilOp:rpe,IncrementWrapStencilOp:lpe,InstancedBufferAttribute:Kg,InstancedBufferGeometry:oG,InstancedInterleavedBuffer:J0e,InstancedMesh:S$,Int16BufferAttribute:hme,Int32BufferAttribute:pme,Int8BufferAttribute:ume,IntType:Tw,InterleavedBuffer:Uw,InterleavedBufferAttribute:im,Interpolant:fx,InterpolateDiscrete:M1,InterpolateLinear:V3,InterpolateSmooth:bS,InterpolationSamplingMode:Rpe,InterpolationSamplingType:Ape,InvertStencilOp:upe,KeepStencilOp:Ap,KeyframeTrack:Ll,LOD:x$,LatheGeometry:qw,Layers:Gg,LessCompare:a$,LessDepth:l3,LessEqualCompare:o6,LessEqualDepth:nm,LessEqualStencilFunc:ppe,LessStencilFunc:fpe,Light:mh,LightProbe:rG,Line:qn,Line3:lge,LineBasicMaterial:xr,LineCurve:b6,LineCurve3:P$,LineDashedMaterial:W$,LineLoop:E$,LineSegments:Mu,LinearFilter:ja,LinearInterpolant:C6,LinearMipMapLinearFilter:Zhe,LinearMipMapNearestFilter:Yhe,LinearMipmapLinearFilter:cu,LinearMipmapNearestFilter:zb,LinearSRGBColorSpace:eh,LinearToneMapping:$H,LinearTransfer:C1,Loader:_o,LoaderUtils:j5,LoadingManager:R6,LoopOnce:ZH,LoopPingPong:JH,LoopRepeat:QH,MOUSE:Ghe,Material:br,MaterialLoader:t4,MathUtils:iu,Matrix2:B6,Matrix3:jn,Matrix4:wn,MaxEquation:AH,Mesh:Qt,MeshBasicMaterial:Eu,MeshDepthMaterial:E6,MeshDistanceMaterial:M6,MeshLambertMaterial:$$,MeshMatcapMaterial:G$,MeshNormalMaterial:H$,MeshPhongMaterial:V$,MeshPhysicalMaterial:F$,MeshStandardMaterial:w6,MeshToonMaterial:k$,MinEquation:CH,MirroredRepeatWrapping:E1,MixOperation:kH,MultiplyBlending:P5,MultiplyOperation:lx,NearestFilter:Fs,NearestMipMapLinearFilter:qhe,NearestMipMapNearestFilter:Xhe,NearestMipmapLinearFilter:vg,NearestMipmapNearestFilter:QA,NeutralToneMapping:qH,NeverCompare:i$,NeverDepth:r3,NeverStencilFunc:dpe,NoBlending:xd,NoColorSpace:md,NoToneMapping:mu,NormalAnimationBlendMode:Dw,NormalBlending:Wp,NotEqualCompare:o$,NotEqualDepth:f3,NotEqualStencilFunc:gpe,NumberKeyframeTrack:O1,Object3D:Jn,ObjectLoader:A0e,ObjectSpaceNormalMap:n$,OctahedronGeometry:bl,OneFactor:NH,OneMinusConstantAlphaFactor:VH,OneMinusConstantColorFactor:jH,OneMinusDstAlphaFactor:OH,OneMinusDstColorFactor:zH,OneMinusSrcAlphaFactor:s3,OneMinusSrcColorFactor:DH,OrthographicCamera:px,PCFShadowMap:Ew,PCFSoftShadowMap:Ib,PMREMGenerator:k5,Path:G3,PerspectiveCamera:Ms,Plane:Rf,PlaneGeometry:Bo,PlaneHelper:xge,PointLight:tG,PointLightHelper:dge,Points:M$,PointsMaterial:m6,PolarGridHelper:mge,PolyhedronGeometry:ph,PositionalAudio:z0e,PropertyBinding:bi,PropertyMixer:dG,QuadraticBezierCurve:x6,QuadraticBezierCurve3:_6,Quaternion:Li,QuaternionKeyframeTrack:hx,QuaternionLinearInterpolant:Z$,RED_GREEN_RGTC2_Format:j3,RED_RGTC1_Format:B3,REVISION:ww,RGBADepthPacking:t$,RGBAFormat:fr,RGBAIntegerFormat:Pw,RGBA_ASTC_10x10_Format:P3,RGBA_ASTC_10x5_Format:A3,RGBA_ASTC_10x6_Format:R3,RGBA_ASTC_10x8_Format:N3,RGBA_ASTC_12x10_Format:D3,RGBA_ASTC_12x12_Format:L3,RGBA_ASTC_4x4_Format:x3,RGBA_ASTC_5x4_Format:_3,RGBA_ASTC_5x5_Format:S3,RGBA_ASTC_6x5_Format:w3,RGBA_ASTC_6x6_Format:E3,RGBA_ASTC_8x5_Format:M3,RGBA_ASTC_8x6_Format:T3,RGBA_ASTC_8x8_Format:C3,RGBA_BPTC_Format:O3,RGBA_ETC2_EAC_Format:b3,RGBA_PVRTC_2BPPV1_Format:g3,RGBA_PVRTC_4BPPV1_Format:m3,RGBA_S3TC_DXT1_Format:Ub,RGBA_S3TC_DXT3_Format:jb,RGBA_S3TC_DXT5_Format:Fb,RGBDepthPacking:npe,RGBFormat:a6,RGBIntegerFormat:Qhe,RGB_BPTC_SIGNED_Format:I3,RGB_BPTC_UNSIGNED_Format:z3,RGB_ETC1_Format:v3,RGB_ETC2_Format:y3,RGB_PVRTC_2BPPV1_Format:p3,RGB_PVRTC_4BPPV1_Format:h3,RGB_S3TC_DXT1_Format:Bb,RGDepthPacking:ipe,RGFormat:s6,RGIntegerFormat:Nw,RawShaderMaterial:j$,Ray:uv,Raycaster:z6,RectAreaLight:aG,RedFormat:Rw,RedIntegerFormat:cx,ReinhardToneMapping:GH,RenderTarget:c6,RenderTarget3D:Y0e,RepeatWrapping:w1,ReplaceStencilOp:spe,ReverseSubtractEquation:TH,RingGeometry:Yw,SIGNED_RED_GREEN_RGTC2_Format:F3,SIGNED_RED_RGTC1_Format:U3,SRGBColorSpace:rr,SRGBTransfer:Bi,Scene:f6,ShaderChunk:$n,ShaderLib:lc,ShaderMaterial:pc,ShadowMaterial:U$,Shape:Xp,ShapeGeometry:Zw,ShapePath:wge,ShapeUtils:cc,ShortType:e6,Skeleton:jw,SkeletonHelper:uge,SkinnedMesh:_$,Source:Uf,Sphere:Vs,SphereGeometry:fv,Spherical:ige,SphericalHarmonics3:sG,SplineCurve:S6,SpotLight:eG,SpotLightHelper:cge,Sprite:b$,SpriteMaterial:h6,SrcAlphaFactor:a3,SrcAlphaSaturateFactor:BH,SrcColorFactor:PH,StaticCopyUsage:wpe,StaticDrawUsage:A1,StaticReadUsage:xpe,StereoCamera:D0e,StreamCopyUsage:Mpe,StreamDrawUsage:bpe,StreamReadUsage:Spe,StringKeyframeTrack:_m,SubtractEquation:MH,SubtractiveBlending:N5,TOUCH:Whe,TangentSpaceNormalMap:hh,TetrahedronGeometry:Qw,Texture:Na,TextureLoader:E0e,TextureUtils:Rge,Timer:tge,TimestampQuery:Cpe,TorusGeometry:jf,TorusKnotGeometry:Jw,Triangle:po,TriangleFanDrawMode:tpe,TriangleStripDrawMode:epe,TrianglesDrawMode:Jhe,TubeGeometry:e4,UVMapping:Mw,Uint16BufferAttribute:u6,Uint32BufferAttribute:d6,Uint8BufferAttribute:dme,Uint8ClampedBufferAttribute:fme,Uniform:I6,UniformsGroup:Q0e,UniformsLib:Gt,UniformsUtils:m$,UnsignedByteType:Pl,UnsignedInt101111Type:n6,UnsignedInt248Type:Fg,UnsignedInt5999Type:t6,UnsignedIntType:Td,UnsignedShort4444Type:Cw,UnsignedShort5551Type:Aw,UnsignedShortType:jg,VSMShadowMap:rc,Vector2:_t,Vector3:fe,Vector4:xi,VectorKeyframeTrack:I1,VideoFrameTexture:Ime,VideoTexture:T$,WebGL3DRenderTarget:Qpe,WebGLArrayRenderTarget:Zpe,WebGLCoordinateSystem:ko,WebGLCubeRenderTarget:v$,WebGLRenderTarget:hc,WebGLRenderer:xG,WebGLUtils:bG,WebGPUCoordinateSystem:Hg,WebXRController:xS,WireframeGeometry:B$,WrapAroundEnding:T1,ZeroCurvatureEnding:jp,ZeroFactor:RH,ZeroSlopeEnding:Fp,ZeroStencilOp:ape,createCanvasElement:d$},Symbol.toStringTag,{value:"Module"}));var XM={exports:{}},qM={};/**
* @license React
* use-sync-external-store-shim/with-selector.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var f9;function dxe(){if(f9)return qM;f9=1;var t=om(),e=OV();function n(u,h){return u===h&&(u!==0||1/u===1/h)||u!==u&&h!==h}var i=typeof Object.is=="function"?Object.is:n,a=e.useSyncExternalStore,s=t.useRef,r=t.useEffect,o=t.useMemo,c=t.useDebugValue;return qM.useSyncExternalStoreWithSelector=function(u,h,d,p,g){var b=s(null);if(b.current===null){var w={hasValue:!1,value:null};b.current=w}else w=b.current;b=o(function(){function S(R){if(!M){if(M=!0,C=R,R=p(R),g!==void 0&&w.hasValue){var D=w.value;if(g(D,R))return A=D}return A=R}if(D=A,i(C,R))return D;var B=p(R);return g!==void 0&&g(D,B)?(C=R,D):(C=R,A=B)}var M=!1,C,A,N=d===void 0?null:d;return[function(){return S(h())},N===null?void 0:function(){return S(N())}]},[h,d,p,g]);var x=a(u,b[0],b[1]);return r(function(){w.hasValue=!0,w.value=x},[x]),c(x),x},qM}var h9;function fxe(){return h9||(h9=1,XM.exports=dxe()),XM.exports}var hxe=fxe();const pxe=Zg(hxe),p9=t=>{let e;const n=new Set,i=(u,h)=>{const d=typeof u=="function"?u(e):u;if(!Object.is(d,e)){const p=e;e=h??(typeof d!="object"||d===null)?d:Object.assign({},e,d),n.forEach(g=>g(e,p))}},a=()=>e,o={setState:i,getState:a,getInitialState:()=>c,subscribe:u=>(n.add(u),()=>n.delete(u))},c=e=t(i,a,o);return o},mxe=(t=>t?p9(t):p9),{useSyncExternalStoreWithSelector:gxe}=pxe,vxe=t=>t;function yxe(t,e=vxe,n){const i=gxe(t.subscribe,t.getState,t.getInitialState,e,n);return ft.useDebugValue(i),i}const m9=(t,e)=>{const n=mxe(t),i=(a,s=e)=>yxe(n,a,s);return Object.assign(i,n),i},bxe=((t,e)=>t?m9(t,e):m9);var YM={exports:{}},ZM={exports:{}},QM={exports:{}},JM={};/**
* @license React
* scheduler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var g9;function xxe(){return g9||(g9=1,(function(t){function e(V,H){var W=V.length;V.push(H);e:for(;0<W;){var J=W-1>>>1,Y=V[J];if(0<a(Y,H))V[J]=H,V[W]=Y,W=J;else break e}}function n(V){return V.length===0?null:V[0]}function i(V){if(V.length===0)return null;var H=V[0],W=V.pop();if(W!==H){V[0]=W;e:for(var J=0,Y=V.length,K=Y>>>1;J<K;){var ee=2*(J+1)-1,ie=V[ee],Z=ee+1,ue=V[Z];if(0>a(ie,W))Z<Y&&0>a(ue,ie)?(V[J]=ue,V[Z]=W,J=Z):(V[J]=ie,V[ee]=W,J=ee);else if(Z<Y&&0>a(ue,W))V[J]=ue,V[Z]=W,J=Z;else break e}}return H}function a(V,H){var W=V.sortIndex-H.sortIndex;return W!==0?W:V.id-H.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;t.unstable_now=function(){return s.now()}}else{var r=Date,o=r.now();t.unstable_now=function(){return r.now()-o}}var c=[],u=[],h=1,d=null,p=3,g=!1,b=!1,w=!1,x=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,M=typeof setImmediate<"u"?setImmediate:null;function C(V){for(var H=n(u);H!==null;){if(H.callback===null)i(u);else if(H.startTime<=V)i(u),H.sortIndex=H.expirationTime,e(c,H);else break;H=n(u)}}function A(V){if(w=!1,C(V),!b)if(n(c)!==null)b=!0,k();else{var H=n(u);H!==null&&X(A,H.startTime-V)}}var N=!1,R=-1,D=5,B=-1;function z(){return!(t.unstable_now()-B<D)}function I(){if(N){var V=t.unstable_now();B=V;var H=!0;try{e:{b=!1,w&&(w=!1,S(R),R=-1),g=!0;var W=p;try{t:{for(C(V),d=n(c);d!==null&&!(d.expirationTime>V&&z());){var J=d.callback;if(typeof J=="function"){d.callback=null,p=d.priorityLevel;var Y=J(d.expirationTime<=V);if(V=t.unstable_now(),typeof Y=="function"){d.callback=Y,C(V),H=!0;break t}d===n(c)&&i(c),C(V)}else i(c);d=n(c)}if(d!==null)H=!0;else{var K=n(u);K!==null&&X(A,K.startTime-V),H=!1}}break e}finally{d=null,p=W,g=!1}H=void 0}}finally{H?U():N=!1}}}var U;if(typeof M=="function")U=function(){M(I)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,G=$.port2;$.port1.onmessage=I,U=function(){G.postMessage(null)}}else U=function(){x(I,0)};function k(){N||(N=!0,U())}function X(V,H){R=x(function(){V(t.unstable_now())},H)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){b||g||(b=!0,k())},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return p},t.unstable_getFirstCallbackNode=function(){return n(c)},t.unstable_next=function(V){switch(p){case 1:case 2:case 3:var H=3;break;default:H=p}var W=p;p=H;try{return V()}finally{p=W}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,H){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var W=p;p=V;try{return H()}finally{p=W}},t.unstable_scheduleCallback=function(V,H,W){var J=t.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0<W?J+W:J):W=J,V){case 1:var Y=-1;break;case 2:Y=250;break;case 5:Y=1073741823;break;case 4:Y=1e4;break;default:Y=5e3}return Y=W+Y,V={id:h++,callback:H,priorityLevel:V,startTime:W,expirationTime:Y,sortIndex:-1},W>J?(V.sortIndex=W,e(u,V),n(c)===null&&V===n(u)&&(w?(S(R),R=-1):w=!0,X(A,W-J))):(V.sortIndex=Y,e(c,V),b||g||(b=!0,k())),V},t.unstable_shouldYield=z,t.unstable_wrapCallback=function(V){var H=p;return function(){var W=p;p=H;try{return V.apply(this,arguments)}finally{p=W}}}})(JM)),JM}var v9;function _G(){return v9||(v9=1,QM.exports=xxe()),QM.exports}/**
* @license React
* react-reconciler.production.js
*
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var y9;function _xe(){return y9||(y9=1,(function(t){t.exports=function(e){function n(m,v,T,O){return new Fv(m,v,T,O)}function i(){}function a(m){var v="https://react.dev/errors/"+m;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var T=2;T<arguments.length;T++)v+="&args[]="+encodeURIComponent(arguments[T])}return"Minified React error #"+m+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(m){return m===null||typeof m!="object"?null:(m=Kv&&m[Kv]||m["@@iterator"],typeof m=="function"?m:null)}function r(m){if(m==null)return null;if(typeof m=="function")return m.$$typeof===Vu?null:m.displayName||m.name||null;if(typeof m=="string")return m;switch(m){case Kd:return"Fragment";case Mo:return"Portal";case Wv:return"Profiler";case Gv:return"StrictMode";case Xm:return"Suspense";case zc:return"SuspenseList"}if(typeof m=="object")switch(m.$$typeof){case el:return(m.displayName||"Context")+".Provider";case Ic:return(m._context.displayName||"Context")+".Consumer";case Xd:var v=m.render;return m=m.displayName,m||(m=v.displayName||v.name||"",m=m!==""?"ForwardRef("+m+")":"ForwardRef"),m;case Bh:return v=m.displayName||null,v!==null?v:r(m.type)||"Memo";case To:v=m._payload,m=m._init;try{return r(m(v))}catch{}}return null}function o(m){if(qm===void 0)try{throw Error()}catch(T){var v=T.stack.trim().match(/\n( *(at )?)/);qm=v&&v[1]||"",Xv=-1<T.stack.indexOf(`
at`)?" (<anonymous>)":-1<T.stack.indexOf("@")?"@unknown:0:0":""}return`
`+qm+m+Xv}function c(m,v){if(!m||Bc)return"";Bc=!0;var T=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var O={DetermineComponentFrameRoot:function(){try{if(v){var $t=function(){throw Error()};if(Object.defineProperty($t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($t,[])}catch(Cn){var Kt=Cn}Reflect.construct(m,[],$t)}else{try{$t.call()}catch(Cn){Kt=Cn}m.call($t.prototype)}}else{try{throw Error()}catch(Cn){Kt=Cn}($t=m())&&typeof $t.catch=="function"&&$t.catch(function(){})}}catch(Cn){if(Cn&&Kt&&typeof Cn.stack=="string")return[Cn.stack,Kt.stack]}return[null,null]}};O.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var F=Object.getOwnPropertyDescriptor(O.DetermineComponentFrameRoot,"name");F&&F.configurable&&Object.defineProperty(O.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var q=O.DetermineComponentFrameRoot(),de=q[0],Ee=q[1];if(de&&Ee){var Fe=de.split(`
`),gt=Ee.split(`
`);for(F=O=0;O<Fe.length&&!Fe[O].includes("DetermineComponentFrameRoot");)O++;for(;F<gt.length&&!gt[F].includes("DetermineComponentFrameRoot");)F++;if(O===Fe.length||F===gt.length)for(O=Fe.length-1,F=gt.length-1;1<=O&&0<=F&&Fe[O]!==gt[F];)F--;for(;1<=O&&0<=F;O--,F--)if(Fe[O]!==gt[F]){if(O!==1||F!==1)do if(O--,F--,0>F||Fe[O]!==gt[F]){var It=`
`+Fe[O].replace(" at new "," at ");return m.displayName&&It.includes("<anonymous>")&&(It=It.replace("<anonymous>",m.displayName)),It}while(1<=O&&0<=F);break}}}finally{Bc=!1,Error.prepareStackTrace=T}return(T=m?m.displayName||m.name:"")?o(T):""}function u(m){switch(m.tag){case 26:case 27:case 5:return o(m.type);case 16:return o("Lazy");case 13:return o("Suspense");case 19:return o("SuspenseList");case 0:case 15:return m=c(m.type,!1),m;case 11:return m=c(m.type.render,!1),m;case 1:return m=c(m.type,!0),m;default:return""}}function h(m){try{var v="";do v+=u(m),m=m.return;while(m);return v}catch(T){return`
Error generating stack: `+T.message+`
`+T.stack}}function d(m){var v=m,T=m;if(m.alternate)for(;v.return;)v=v.return;else{m=v;do v=m,(v.flags&4098)!==0&&(T=v.return),m=v.return;while(m)}return v.tag===3?T:null}function p(m){if(d(m)!==m)throw Error(a(188))}function g(m){var v=m.alternate;if(!v){if(v=d(m),v===null)throw Error(a(188));return v!==m?null:m}for(var T=m,O=v;;){var F=T.return;if(F===null)break;var q=F.alternate;if(q===null){if(O=F.return,O!==null){T=O;continue}break}if(F.child===q.child){for(q=F.child;q;){if(q===T)return p(F),m;if(q===O)return p(F),v;q=q.sibling}throw Error(a(188))}if(T.return!==O.return)T=F,O=q;else{for(var de=!1,Ee=F.child;Ee;){if(Ee===T){de=!0,T=F,O=q;break}if(Ee===O){de=!0,O=F,T=q;break}Ee=Ee.sibling}if(!de){for(Ee=q.child;Ee;){if(Ee===T){de=!0,T=q,O=F;break}if(Ee===O){de=!0,O=q,T=F;break}Ee=Ee.sibling}if(!de)throw Error(a(189))}}if(T.alternate!==O)throw Error(a(190))}if(T.tag!==3)throw Error(a(188));return T.stateNode.current===T?m:v}function b(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(v=b(m),v!==null)return v;m=m.sibling}return null}function w(m){var v=m.tag;if(v===5||v===26||v===27||v===6)return m;for(m=m.child;m!==null;){if(m.tag!==4&&(v=w(m),v!==null))return v;m=m.sibling}return null}function x(m){return{current:m}}function S(m){0>Kl||(m.current=Wh[Kl],Wh[Kl]=null,Kl--)}function M(m,v){Kl++,Wh[Kl]=m.current,m.current=v}function C(m){return m>>>=0,m===0?32:31-(Kh(m)/c2|0)|0}function A(m){var v=m&42;if(v!==0)return v;switch(m&-m){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 m&4194176;case 4194304:case 8388608:case 16777216:case 33554432:return m&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return m}}function N(m,v){var T=m.pendingLanes;if(T===0)return 0;var O=0,F=m.suspendedLanes,q=m.pingedLanes,de=m.warmLanes;m=m.finishedLanes!==0;var Ee=T&134217727;return Ee!==0?(T=Ee&~F,T!==0?O=A(T):(q&=Ee,q!==0?O=A(q):m||(de=Ee&~de,de!==0&&(O=A(de))))):(Ee=T&~F,Ee!==0?O=A(Ee):q!==0?O=A(q):m||(de=T&~de,de!==0&&(O=A(de)))),O===0?0:v!==0&&v!==O&&(v&F)===0&&(F=O&-O,de=v&-v,F>=de||F===32&&(de&4194176)!==0)?v:O}function R(m,v){return(m.pendingLanes&~(m.suspendedLanes&~m.pingedLanes)&v)===0}function D(m,v){switch(m){case 1:case 2:case 4:case 8:return v+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 v+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 B(){var m=Qd;return Qd<<=1,(Qd&4194176)===0&&(Qd=128),m}function z(){var m=Xh;return Xh<<=1,(Xh&62914560)===0&&(Xh=4194304),m}function I(m){for(var v=[],T=0;31>T;T++)v.push(m);return v}function U(m,v){m.pendingLanes|=v,v!==268435456&&(m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0)}function $(m,v,T,O,F,q){var de=m.pendingLanes;m.pendingLanes=T,m.suspendedLanes=0,m.pingedLanes=0,m.warmLanes=0,m.expiredLanes&=T,m.entangledLanes&=T,m.errorRecoveryDisabledLanes&=T,m.shellSuspendCounter=0;var Ee=m.entanglements,Fe=m.expirationTimes,gt=m.hiddenUpdates;for(T=de&~T;0<T;){var It=31-Xs(T),$t=1<<It;Ee[It]=0,Fe[It]=-1;var Kt=gt[It];if(Kt!==null)for(gt[It]=null,It=0;It<Kt.length;It++){var Cn=Kt[It];Cn!==null&&(Cn.lane&=-536870913)}T&=~$t}O!==0&&G(m,O,0),q!==0&&F===0&&m.tag!==0&&(m.suspendedLanes|=q&~(de&~v))}function G(m,v,T){m.pendingLanes|=v,m.suspendedLanes&=~v;var O=31-Xs(v);m.entangledLanes|=v,m.entanglements[O]=m.entanglements[O]|1073741824|T&4194218}function k(m,v){var T=m.entangledLanes|=v;for(m=m.entanglements;T;){var O=31-Xs(T),F=1<<O;F&v|m[O]&v&&(m[O]|=v),T&=~F}}function X(m){return m&=-m,2<m?8<m?(m&134217727)!==0?32:268435456:8:2}function V(m){if(qs&&typeof qs.onCommitFiberRoot=="function")try{qs.onCommitFiberRoot(ef,m,void 0,(m.current.flags&128)===128)}catch{}}function H(m){if(typeof h2=="function"&&My(m),qs&&typeof qs.setStrictMode=="function")try{qs.setStrictMode(ef,m)}catch{}}function W(m,v){return m===v&&(m!==0||1/m===1/v)||m!==m&&v!==v}function J(m,v){if(typeof m=="object"&&m!==null){var T=f0.get(m);return T!==void 0?T:(v={value:m,source:v,stack:h(v)},f0.set(m,v),v)}return{value:m,source:v,stack:h(v)}}function Y(m,v){Ki[oa++]=Zh,Ki[oa++]=Yh,Yh=m,Zh=v}function K(m,v,T){Ar[Rr++]=sl,Ar[Rr++]=Zr,Ar[Rr++]=Co,Co=m;var O=sl;m=Zr;var F=32-Xs(O)-1;O&=~(1<<F),T+=1;var q=32-Xs(v)+F;if(30<q){var de=F-F%5;q=(O&(1<<de)-1).toString(32),O>>=de,F-=de,sl=1<<32-Xs(v)+F|T<<F|O,Zr=q+m}else sl=1<<q|T<<F|O,Zr=m}function ee(m){m.return!==null&&(Y(m,1),K(m,1,0))}function ie(m){for(;m===Yh;)Yh=Ki[--oa],Ki[oa]=null,Zh=Ki[--oa],Ki[oa]=null;for(;m===Co;)Co=Ar[--Rr],Ar[Rr]=null,Zr=Ar[--Rr],Ar[Rr]=null,sl=Ar[--Rr],Ar[Rr]=null}function Z(m,v){M(Ao,v),M(Qh,m),M(Ga,null),m=ku(v),S(Ga),M(Ga,m)}function ue(){S(Ga),S(Qh),S(Ao)}function se(m){m.memoizedState!==null&&M(tf,m);var v=Ga.current,T=kx(v,m.type);v!==T&&(M(Qh,m),M(Ga,T))}function ae(m){Qh.current===m&&(S(Ga),S(Qh)),tf.current===m&&(S(tf),nl?_n._currentValue=Ks:_n._currentValue2=Ks)}function ce(m){var v=Error(a(418,""));throw ne(J(v,m)),Jh}function pe(m,v){if(!Ps)throw Error(a(175));l4(m.stateNode,m.type,m.memoizedProps,v,m)||ce(m)}function ye(m){for(bs=m.return;bs;)switch(bs.tag){case 3:case 27:Qr=!0;return;case 5:case 13:Qr=!1;return;default:bs=bs.return}}function _e(m){if(!Ps||m!==bs)return!1;if(!di)return ye(m),di=!0,!1;var v=!1;if(as?m.tag!==3&&m.tag!==27&&(m.tag!==5||a2(m.type)&&!Fc(m.type,m.memoizedProps))&&(v=!0):m.tag!==3&&(m.tag!==5||a2(m.type)&&!Fc(m.type,m.memoizedProps))&&(v=!0),v&&rs&&ce(m),ye(m),m.tag===13){if(!Ps)throw Error(a(316));if(m=m.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));rs=n2(m)}else rs=bs?fy(m.stateNode):null;return!0}function me(){Ps&&(rs=bs=null,di=!1)}function ne(m){Nr===null?Nr=[m]:Nr.push(m)}function be(){for(var m=kc,v=nf=kc=0;v<m;){var T=Pr[v];Pr[v++]=null;var O=Pr[v];Pr[v++]=null;var F=Pr[v];Pr[v++]=null;var q=Pr[v];if(Pr[v++]=null,O!==null&&F!==null){var de=O.pending;de===null?F.next=F:(F.next=de.next,de.next=F),O.pending=F}q!==0&&Oe(T,F,q)}}function xe(m,v,T,O){Pr[kc++]=m,Pr[kc++]=v,Pr[kc++]=T,Pr[kc++]=O,nf|=O,m.lanes|=O,m=m.alternate,m!==null&&(m.lanes|=O)}function he(m,v,T,O){return xe(m,v,T,O),Le(m)}function ve(m,v){return xe(m,null,null,v),Le(m)}function Oe(m,v,T){m.lanes|=T;var O=m.alternate;O!==null&&(O.lanes|=T);for(var F=!1,q=m.return;q!==null;)q.childLanes|=T,O=q.alternate,O!==null&&(O.childLanes|=T),q.tag===22&&(m=q.stateNode,m===null||m._visibility&1||(F=!0)),m=q,q=q.return;F&&v!==null&&m.tag===3&&(q=m.stateNode,F=31-Xs(T),q=q.hiddenUpdates,m=q[F],m===null?q[F]=[v]:m.push(v),v.lane=T|536870912)}function Le(m){if(50<Ju)throw Ju=0,Os=null,Error(a(185));for(var v=m.return;v!==null;)m=v,v=m.return;return m.tag===3?m.stateNode:null}function Ae(m){m!==Wu&&m.next===null&&(Wu===null?af=Wu=m:Wu=Wu.next=m),tp=!0,ep||(ep=!0,Ce(tt))}function et(m,v){if(!Ro&&tp){Ro=!0;do for(var T=!1,O=af;O!==null;){if(m!==0){var F=O.pendingLanes;if(F===0)var q=0;else{var de=O.suspendedLanes,Ee=O.pingedLanes;q=(1<<31-Xs(42|m)+1)-1,q&=F&~(de&~Ee),q=q&201326677?q&201326677|1:q?q|2:0}q!==0&&(T=!0,we(O,q))}else q=kn,q=N(O,O===Wn?q:0),(q&3)===0||R(O,q)||(T=!0,we(O,q));O=O.next}while(T);Ro=!1}}function tt(){tp=ep=!1;var m=0;Hc!==0&&(Vc()&&(m=Hc),Hc=0);for(var v=ss(),T=null,O=af;O!==null;){var F=O.next,q=re(O,v);q===0?(O.next=null,T===null?af=F:T.next=F,F===null&&(Wu=T)):(T=O,(m!==0||(q&3)!==0)&&(tp=!0)),O=F}et(m)}function re(m,v){for(var T=m.suspendedLanes,O=m.pingedLanes,F=m.expirationTimes,q=m.pendingLanes&-62914561;0<q;){var de=31-Xs(q),Ee=1<<de,Fe=F[de];Fe===-1?((Ee&T)===0||(Ee&O)!==0)&&(F[de]=D(Ee,v)):Fe<=v&&(m.expiredLanes|=Ee),q&=~Ee}if(v=Wn,T=kn,T=N(m,m===v?T:0),O=m.callbackNode,T===0||m===v&&Di===2||m.cancelPendingCommit!==null)return O!==null&&O!==null&&qh(O),m.callbackNode=null,m.callbackPriority=0;if((T&3)===0||R(m,T)){if(v=T&-T,v===m.callbackPriority)return v;switch(O!==null&&qh(O),X(T)){case 2:case 8:T=f2;break;case 32:T=u0;break;case 268435456:T=d0;break;default:T=u0}return O=te.bind(null,m),T=Jd(T,O),m.callbackPriority=v,m.callbackNode=T,v}return O!==null&&O!==null&&qh(O),m.callbackPriority=2,m.callbackNode=null,2}function te(m,v){var T=m.callbackNode;if(Ha()&&m.callbackNode!==T)return null;var O=kn;return O=N(m,m===Wn?O:0),O===0?null:(Dh(m,O,v),re(m,ss()),m.callbackNode!=null&&m.callbackNode===T?te.bind(null,m):null)}function we(m,v){if(Ha())return null;Dh(m,v,!0)}function Ce(m){Ma?Jm(function(){(pn&6)!==0?Jd(Ey,m):m()}):Jd(Ey,m)}function Ie(){return Hc===0&&(Hc=B()),Hc}function Pe(m,v){if(np===null){var T=np=[];h0=0,Ys=Ie(),$c={status:"pending",value:void 0,then:function(O){T.push(O)}}}return h0++,v.then(Ze,Ze),v}function Ze(){if(--h0===0&&np!==null){$c!==null&&($c.status="fulfilled");var m=np;np=null,Ys=0,$c=null;for(var v=0;v<m.length;v++)(0,m[v])()}}function We(m,v){var T=[],O={status:"pending",value:null,reason:null,then:function(F){T.push(F)}};return m.then(function(){O.status="fulfilled",O.value=v;for(var F=0;F<T.length;F++)(0,T[F])(v)},function(F){for(O.status="rejected",O.reason=F,F=0;F<T.length;F++)(0,T[F])(void 0)}),O}function mt(m){m.updateQueue={baseState:m.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function nt(m,v){m=m.updateQueue,v.updateQueue===m&&(v.updateQueue={baseState:m.baseState,firstBaseUpdate:m.firstBaseUpdate,lastBaseUpdate:m.lastBaseUpdate,shared:m.shared,callbacks:null})}function Ye(m){return{lane:m,tag:0,payload:null,callback:null,next:null}}function Je(m,v,T){var O=m.updateQueue;if(O===null)return null;if(O=O.shared,(pn&2)!==0){var F=O.pending;return F===null?v.next=v:(v.next=F.next,F.next=v),O.pending=v,v=Le(m),Oe(m,null,T),v}return xe(m,O,v,T),Le(m)}function jt(m,v,T){if(v=v.updateQueue,v!==null&&(v=v.shared,(T&4194176)!==0)){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,k(m,T)}}function wt(m,v){var T=m.updateQueue,O=m.alternate;if(O!==null&&(O=O.updateQueue,T===O)){var F=null,q=null;if(T=T.firstBaseUpdate,T!==null){do{var de={lane:T.lane,tag:T.tag,payload:T.payload,callback:null,next:null};q===null?F=q=de:q=q.next=de,T=T.next}while(T!==null);q===null?F=q=v:q=q.next=v}else F=q=v;T={baseState:O.baseState,firstBaseUpdate:F,lastBaseUpdate:q,shared:O.shared,callbacks:O.callbacks},m.updateQueue=T;return}m=T.lastBaseUpdate,m===null?T.firstBaseUpdate=v:m.next=v,T.lastBaseUpdate=v}function Et(){if(sf){var m=$c;if(m!==null)throw m}}function zt(m,v,T,O){sf=!1;var F=m.updateQueue;Xl=!1;var q=F.firstBaseUpdate,de=F.lastBaseUpdate,Ee=F.shared.pending;if(Ee!==null){F.shared.pending=null;var Fe=Ee,gt=Fe.next;Fe.next=null,de===null?q=gt:de.next=gt,de=Fe;var It=m.alternate;It!==null&&(It=It.updateQueue,Ee=It.lastBaseUpdate,Ee!==de&&(Ee===null?It.firstBaseUpdate=gt:Ee.next=gt,It.lastBaseUpdate=Fe))}if(q!==null){var $t=F.baseState;de=0,It=gt=Fe=null,Ee=q;do{var Kt=Ee.lane&-536870913,Cn=Kt!==Ee.lane;if(Cn?(kn&Kt)===Kt:(O&Kt)===Kt){Kt!==0&&Kt===Ys&&(sf=!0),It!==null&&(It=It.next={lane:0,tag:Ee.tag,payload:Ee.payload,callback:null,next:null});e:{var er=m,rp=Ee;Kt=v;var ed=T;switch(rp.tag){case 1:if(er=rp.payload,typeof er=="function"){$t=er.call(ed,$t,Kt);break e}$t=er;break e;case 3:er.flags=er.flags&-65537|128;case 0:if(er=rp.payload,Kt=typeof er=="function"?er.call(ed,$t,Kt):er,Kt==null)break e;$t=Fu({},$t,Kt);break e;case 2:Xl=!0}}Kt=Ee.callback,Kt!==null&&(m.flags|=64,Cn&&(m.flags|=8192),Cn=F.callbacks,Cn===null?F.callbacks=[Kt]:Cn.push(Kt))}else Cn={lane:Kt,tag:Ee.tag,payload:Ee.payload,callback:Ee.callback,next:null},It===null?(gt=It=Cn,Fe=$t):It=It.next=Cn,de|=Kt;if(Ee=Ee.next,Ee===null){if(Ee=F.shared.pending,Ee===null)break;Cn=Ee,Ee=Cn.next,Cn.next=null,F.lastBaseUpdate=Cn,F.shared.pending=null}}while(!0);It===null&&(Fe=$t),F.baseState=Fe,F.firstBaseUpdate=gt,F.lastBaseUpdate=It,q===null&&(F.shared.lanes=0),Ir|=de,m.lanes=de,m.memoizedState=$t}}function Te(m,v){if(typeof m!="function")throw Error(a(191,m));m.call(v)}function pt(m,v){var T=m.callbacks;if(T!==null)for(m.callbacks=null,m=0;m<T.length;m++)Te(T[m],v)}function at(m,v){if(Cr(m,v))return!0;if(typeof m!="object"||m===null||typeof v!="object"||v===null)return!1;var T=Object.keys(m),O=Object.keys(v);if(T.length!==O.length)return!1;for(O=0;O<T.length;O++){var F=T[O];if(!ip.call(v,F)||!Cr(m[F],v[F]))return!1}return!0}function St(m){return m=m.status,m==="fulfilled"||m==="rejected"}function ct(){}function it(m,v,T){switch(T=m[T],T===void 0?m.push(v):T!==v&&(v.then(ct,ct),v=T),v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===Ni?Error(a(483)):m;default:if(typeof v.status=="string")v.then(ct,ct);else{if(m=Wn,m!==null&&100<m.shellSuspendCounter)throw Error(a(482));m=v,m.status="pending",m.then(function(O){if(v.status==="pending"){var F=v;F.status="fulfilled",F.value=O}},function(O){if(v.status==="pending"){var F=v;F.status="rejected",F.reason=O}})}switch(v.status){case"fulfilled":return v.value;case"rejected":throw m=v.reason,m===Ni?Error(a(483)):m}throw Ku=v,Ni}}function Nt(){if(Ku===null)throw Error(a(459));var m=Ku;return Ku=null,m}function kt(m){var v=Jr;return Jr+=1,rl===null&&(rl=[]),it(rl,m,v)}function Xt(m,v){v=v.props.ref,m.ref=v!==void 0?v:null}function rn(m,v){throw v.$$typeof===$v?Error(a(525)):(m=Object.prototype.toString.call(v),Error(a(31,m==="[object Object]"?"object with keys {"+Object.keys(v).join(", ")+"}":m)))}function ge(m){var v=m._init;return v(m._payload)}function Se(m){function v(Xe,Ue){if(m){var Qe=Xe.deletions;Qe===null?(Xe.deletions=[Ue],Xe.flags|=16):Qe.push(Ue)}}function T(Xe,Ue){if(!m)return null;for(;Ue!==null;)v(Xe,Ue),Ue=Ue.sibling;return null}function O(Xe){for(var Ue=new Map;Xe!==null;)Xe.key!==null?Ue.set(Xe.key,Xe):Ue.set(Xe.index,Xe),Xe=Xe.sibling;return Ue}function F(Xe,Ue){return Xe=vs(Xe,Ue),Xe.index=0,Xe.sibling=null,Xe}function q(Xe,Ue,Qe){return Xe.index=Qe,m?(Qe=Xe.alternate,Qe!==null?(Qe=Qe.index,Qe<Ue?(Xe.flags|=33554434,Ue):Qe):(Xe.flags|=33554434,Ue)):(Xe.flags|=1048576,Ue)}function de(Xe){return m&&Xe.alternate===null&&(Xe.flags|=33554434),Xe}function Ee(Xe,Ue,Qe,At){return Ue===null||Ue.tag!==6?(Ue=Oc(Qe,Xe.mode,At),Ue.return=Xe,Ue):(Ue=F(Ue,Qe),Ue.return=Xe,Ue)}function Fe(Xe,Ue,Qe,At){var dn=Qe.type;return dn===Kd?It(Xe,Ue,Qe.props.children,At,Qe.key):Ue!==null&&(Ue.elementType===dn||typeof dn=="object"&&dn!==null&&dn.$$typeof===To&&ge(dn)===Ue.type)?(Ue=F(Ue,Qe.props),Xt(Ue,Qe),Ue.return=Xe,Ue):(Ue=qr(Qe.type,Qe.key,Qe.props,null,Xe.mode,At),Xt(Ue,Qe),Ue.return=Xe,Ue)}function gt(Xe,Ue,Qe,At){return Ue===null||Ue.tag!==4||Ue.stateNode.containerInfo!==Qe.containerInfo||Ue.stateNode.implementation!==Qe.implementation?(Ue=Wd(Qe,Xe.mode,At),Ue.return=Xe,Ue):(Ue=F(Ue,Qe.children||[]),Ue.return=Xe,Ue)}function It(Xe,Ue,Qe,At,dn){return Ue===null||Ue.tag!==7?(Ue=kl(Qe,Xe.mode,At,dn),Ue.return=Xe,Ue):(Ue=F(Ue,Qe),Ue.return=Xe,Ue)}function $t(Xe,Ue,Qe){if(typeof Ue=="string"&&Ue!==""||typeof Ue=="number"||typeof Ue=="bigint")return Ue=Oc(""+Ue,Xe.mode,Qe),Ue.return=Xe,Ue;if(typeof Ue=="object"&&Ue!==null){switch(Ue.$$typeof){case Hl:return Qe=qr(Ue.type,Ue.key,Ue.props,null,Xe.mode,Qe),Xt(Qe,Ue),Qe.return=Xe,Qe;case Mo:return Ue=Wd(Ue,Xe.mode,Qe),Ue.return=Xe,Ue;case To:var At=Ue._init;return Ue=At(Ue._payload),$t(Xe,Ue,Qe)}if(Uc(Ue)||s(Ue))return Ue=kl(Ue,Xe.mode,Qe,null),Ue.return=Xe,Ue;if(typeof Ue.then=="function")return $t(Xe,kt(Ue),Qe);if(Ue.$$typeof===el)return $t(Xe,Ch(Xe,Ue),Qe);rn(Xe,Ue)}return null}function Kt(Xe,Ue,Qe,At){var dn=Ue!==null?Ue.key:null;if(typeof Qe=="string"&&Qe!==""||typeof Qe=="number"||typeof Qe=="bigint")return dn!==null?null:Ee(Xe,Ue,""+Qe,At);if(typeof Qe=="object"&&Qe!==null){switch(Qe.$$typeof){case Hl:return Qe.key===dn?Fe(Xe,Ue,Qe,At):null;case Mo:return Qe.key===dn?gt(Xe,Ue,Qe,At):null;case To:return dn=Qe._init,Qe=dn(Qe._payload),Kt(Xe,Ue,Qe,At)}if(Uc(Qe)||s(Qe))return dn!==null?null:It(Xe,Ue,Qe,At,null);if(typeof Qe.then=="function")return Kt(Xe,Ue,kt(Qe),At);if(Qe.$$typeof===el)return Kt(Xe,Ue,Ch(Xe,Qe),At);rn(Xe,Qe)}return null}function Cn(Xe,Ue,Qe,At,dn){if(typeof At=="string"&&At!==""||typeof At=="number"||typeof At=="bigint")return Xe=Xe.get(Qe)||null,Ee(Ue,Xe,""+At,dn);if(typeof At=="object"&&At!==null){switch(At.$$typeof){case Hl:return Xe=Xe.get(At.key===null?Qe:At.key)||null,Fe(Ue,Xe,At,dn);case Mo:return Xe=Xe.get(At.key===null?Qe:At.key)||null,gt(Ue,Xe,At,dn);case To:var Fi=At._init;return At=Fi(At._payload),Cn(Xe,Ue,Qe,At,dn)}if(Uc(At)||s(At))return Xe=Xe.get(Qe)||null,It(Ue,Xe,At,dn,null);if(typeof At.then=="function")return Cn(Xe,Ue,Qe,kt(At),dn);if(At.$$typeof===el)return Cn(Xe,Ue,Qe,Ch(Ue,At),dn);rn(Ue,At)}return null}function er(Xe,Ue,Qe,At){for(var dn=null,Fi=null,Sn=Ue,hi=Ue=0,La=null;Sn!==null&&hi<Qe.length;hi++){Sn.index>hi?(La=Sn,Sn=null):La=Sn.sibling;var pi=Kt(Xe,Sn,Qe[hi],At);if(pi===null){Sn===null&&(Sn=La);break}m&&Sn&&pi.alternate===null&&v(Xe,Sn),Ue=q(pi,Ue,hi),Fi===null?dn=pi:Fi.sibling=pi,Fi=pi,Sn=La}if(hi===Qe.length)return T(Xe,Sn),di&&Y(Xe,hi),dn;if(Sn===null){for(;hi<Qe.length;hi++)Sn=$t(Xe,Qe[hi],At),Sn!==null&&(Ue=q(Sn,Ue,hi),Fi===null?dn=Sn:Fi.sibling=Sn,Fi=Sn);return di&&Y(Xe,hi),dn}for(Sn=O(Sn);hi<Qe.length;hi++)La=Cn(Sn,Xe,hi,Qe[hi],At),La!==null&&(m&&La.alternate!==null&&Sn.delete(La.key===null?hi:La.key),Ue=q(La,Ue,hi),Fi===null?dn=La:Fi.sibling=La,Fi=La);return m&&Sn.forEach(function(tc){return v(Xe,tc)}),di&&Y(Xe,hi),dn}function rp(Xe,Ue,Qe,At){if(Qe==null)throw Error(a(151));for(var dn=null,Fi=null,Sn=Ue,hi=Ue=0,La=null,pi=Qe.next();Sn!==null&&!pi.done;hi++,pi=Qe.next()){Sn.index>hi?(La=Sn,Sn=null):La=Sn.sibling;var tc=Kt(Xe,Sn,pi.value,At);if(tc===null){Sn===null&&(Sn=La);break}m&&Sn&&tc.alternate===null&&v(Xe,Sn),Ue=q(tc,Ue,hi),Fi===null?dn=tc:Fi.sibling=tc,Fi=tc,Sn=La}if(pi.done)return T(Xe,Sn),di&&Y(Xe,hi),dn;if(Sn===null){for(;!pi.done;hi++,pi=Qe.next())pi=$t(Xe,pi.value,At),pi!==null&&(Ue=q(pi,Ue,hi),Fi===null?dn=pi:Fi.sibling=pi,Fi=pi);return di&&Y(Xe,hi),dn}for(Sn=O(Sn);!pi.done;hi++,pi=Qe.next())pi=Cn(Sn,Xe,hi,pi.value,At),pi!==null&&(m&&pi.alternate!==null&&Sn.delete(pi.key===null?hi:pi.key),Ue=q(pi,Ue,hi),Fi===null?dn=pi:Fi.sibling=pi,Fi=pi);return m&&Sn.forEach(function(S0){return v(Xe,S0)}),di&&Y(Xe,hi),dn}function ed(Xe,Ue,Qe,At){if(typeof Qe=="object"&&Qe!==null&&Qe.type===Kd&&Qe.key===null&&(Qe=Qe.props.children),typeof Qe=="object"&&Qe!==null){switch(Qe.$$typeof){case Hl:e:{for(var dn=Qe.key;Ue!==null;){if(Ue.key===dn){if(dn=Qe.type,dn===Kd){if(Ue.tag===7){T(Xe,Ue.sibling),At=F(Ue,Qe.props.children),At.return=Xe,Xe=At;break e}}else if(Ue.elementType===dn||typeof dn=="object"&&dn!==null&&dn.$$typeof===To&&ge(dn)===Ue.type){T(Xe,Ue.sibling),At=F(Ue,Qe.props),Xt(At,Qe),At.return=Xe,Xe=At;break e}T(Xe,Ue);break}else v(Xe,Ue);Ue=Ue.sibling}Qe.type===Kd?(At=kl(Qe.props.children,Xe.mode,At,Qe.key),At.return=Xe,Xe=At):(At=qr(Qe.type,Qe.key,Qe.props,null,Xe.mode,At),Xt(At,Qe),At.return=Xe,Xe=At)}return de(Xe);case Mo:e:{for(dn=Qe.key;Ue!==null;){if(Ue.key===dn)if(Ue.tag===4&&Ue.stateNode.containerInfo===Qe.containerInfo&&Ue.stateNode.implementation===Qe.implementation){T(Xe,Ue.sibling),At=F(Ue,Qe.children||[]),At.return=Xe,Xe=At;break e}else{T(Xe,Ue);break}else v(Xe,Ue);Ue=Ue.sibling}At=Wd(Qe,Xe.mode,At),At.return=Xe,Xe=At}return de(Xe);case To:return dn=Qe._init,Qe=dn(Qe._payload),ed(Xe,Ue,Qe,At)}if(Uc(Qe))return er(Xe,Ue,Qe,At);if(s(Qe)){if(dn=s(Qe),typeof dn!="function")throw Error(a(150));return Qe=dn.call(Qe),rp(Xe,Ue,Qe,At)}if(typeof Qe.then=="function")return ed(Xe,Ue,kt(Qe),At);if(Qe.$$typeof===el)return ed(Xe,Ue,Ch(Xe,Qe),At);rn(Xe,Qe)}return typeof Qe=="string"&&Qe!==""||typeof Qe=="number"||typeof Qe=="bigint"?(Qe=""+Qe,Ue!==null&&Ue.tag===6?(T(Xe,Ue.sibling),At=F(Ue,Qe),At.return=Xe,Xe=At):(T(Xe,Ue),At=Oc(Qe,Xe.mode,At),At.return=Xe,Xe=At),de(Xe)):T(Xe,Ue)}return function(Xe,Ue,Qe,At){try{Jr=0;var dn=ed(Xe,Ue,Qe,At);return rl=null,dn}catch(Sn){if(Sn===Ni)throw Sn;var Fi=n(29,Sn,null,Xe.mode);return Fi.lanes=At,Fi.return=Xe,Fi}finally{}}}function De(m,v){m=No,M(Dr,m),M(ol,v),No=m|v.baseLanes}function lt(){M(Dr,No),M(ol,ol.current)}function rt(){No=Dr.current,S(ol),S(Dr)}function Bt(m){var v=m.alternate;M(Ta,Ta.current&1),M(Lr,m),eo===null&&(v===null||ol.current!==null||v.memoizedState!==null)&&(eo=m)}function Ut(m){if(m.tag===22){if(M(Ta,Ta.current),M(Lr,m),eo===null){var v=m.alternate;v!==null&&v.memoizedState!==null&&(eo=m)}}else Dt()}function Dt(){M(Ta,Ta.current),M(Lr,Lr.current)}function ot(m){S(Lr),eo===m&&(eo=null),S(Ta)}function Lt(m){for(var v=m;v!==null;){if(v.tag===13){var T=v.memoizedState;if(T!==null&&(T=T.dehydrated,T===null||a0(T)||Gh(T)))return v}else if(v.tag===19&&v.memoizedProps.revealOrder!==void 0){if((v.flags&128)!==0)return v}else if(v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return null;v=v.return}v.sibling.return=v.return,v=v.sibling}return null}function vt(){throw Error(a(321))}function Ot(m,v){if(v===null)return!1;for(var T=0;T<v.length&&T<m.length;T++)if(!Cr(m[T],v[T]))return!1;return!0}function Mt(m,v,T,O,F,q){return ll=q,Bn=v,v.memoizedState=null,v.updateQueue=null,v.lanes=0,yn.H=m===null||m.memoizedState===null?Ca:xs,ql=!1,q=T(O,F),ql=!1,Xi&&(q=wi(v,T,O,F)),Ln(m),q}function Ln(m){yn.H=fi;var v=yi!==null&&yi.next!==null;if(ll=0,ma=yi=Bn=null,to=!1,la=0,rf=null,v)throw Error(a(300));m===null||ga||(m=m.dependencies,m!==null&&wc(m)&&(ga=!0))}function wi(m,v,T,O){Bn=m;var F=0;do{if(Xi&&(rf=null),la=0,Xi=!1,25<=F)throw Error(a(301));if(F+=1,ma=yi=null,m.updateQueue!=null){var q=m.updateQueue;q.lastEffect=null,q.events=null,q.stores=null,q.memoCache!=null&&(q.memoCache.index=0)}yn.H=Wc,q=v(T,O)}while(Xi);return q}function aa(){var m=yn.H,v=m.useState()[0];return v=typeof v.then=="function"?ke(v):v,m=m.useState()[0],(yi!==null?yi.memoizedState:null)!==m&&(Bn.flags|=1024),v}function ei(){var m=ap!==0;return ap=0,m}function Fn(m,v,T){v.updateQueue=m.updateQueue,v.flags&=-2053,m.lanes&=~T}function le(m){if(to){for(m=m.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}to=!1}ll=0,ma=yi=Bn=null,Xi=!1,la=ap=0,rf=null}function Re(){var m={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ma===null?Bn.memoizedState=ma=m:ma=ma.next=m,ma}function Be(){if(yi===null){var m=Bn.alternate;m=m!==null?m.memoizedState:null}else m=yi.next;var v=ma===null?Bn.memoizedState:ma.next;if(v!==null)ma=v,yi=m;else{if(m===null)throw Bn.alternate===null?Error(a(467)):Error(a(310));yi=m,m={memoizedState:yi.memoizedState,baseState:yi.baseState,baseQueue:yi.baseQueue,queue:yi.queue,next:null},ma===null?Bn.memoizedState=ma=m:ma=ma.next=m}return ma}function ke(m){var v=la;return la+=1,rf===null&&(rf=[]),m=it(rf,m,v),v=Bn,(ma===null?v.memoizedState:ma.next)===null&&(v=v.alternate,yn.H=v===null||v.memoizedState===null?Ca:xs),m}function ze(m){if(m!==null&&typeof m=="object"){if(typeof m.then=="function")return ke(m);if(m.$$typeof===el)return ts(m)}throw Error(a(438,String(m)))}function yt(m){var v=null,T=Bn.updateQueue;if(T!==null&&(v=T.memoCache),v==null){var O=Bn.alternate;O!==null&&(O=O.updateQueue,O!==null&&(O=O.memoCache,O!=null&&(v={data:O.data.map(function(F){return F.slice()}),index:0})))}if(v==null&&(v={data:[],index:0}),T===null&&(T=m0(),Bn.updateQueue=T),T.memoCache=v,T=v.data[v.index],T===void 0)for(T=v.data[v.index]=Array(m),O=0;O<m;O++)T[O]=Vx;return v.index++,T}function Pt(m,v){return typeof v=="function"?v(m):v}function Ht(m){var v=Be();return Ke(v,yi,m)}function Ke(m,v,T){var O=m.queue;if(O===null)throw Error(a(311));O.lastRenderedReducer=T;var F=m.baseQueue,q=O.pending;if(q!==null){if(F!==null){var de=F.next;F.next=q.next,q.next=de}v.baseQueue=F=q,O.pending=null}if(q=m.baseState,F===null)m.memoizedState=q;else{v=F.next;var Ee=de=null,Fe=null,gt=v,It=!1;do{var $t=gt.lane&-536870913;if($t!==gt.lane?(kn&$t)===$t:(ll&$t)===$t){var Kt=gt.revertLane;if(Kt===0)Fe!==null&&(Fe=Fe.next={lane:0,revertLane:0,action:gt.action,hasEagerState:gt.hasEagerState,eagerState:gt.eagerState,next:null}),$t===Ys&&(It=!0);else if((ll&Kt)===Kt){gt=gt.next,Kt===Ys&&(It=!0);continue}else $t={lane:0,revertLane:gt.revertLane,action:gt.action,hasEagerState:gt.hasEagerState,eagerState:gt.eagerState,next:null},Fe===null?(Ee=Fe=$t,de=q):Fe=Fe.next=$t,Bn.lanes|=Kt,Ir|=Kt;$t=gt.action,ql&&T(q,$t),q=gt.hasEagerState?gt.eagerState:T(q,$t)}else Kt={lane:$t,revertLane:gt.revertLane,action:gt.action,hasEagerState:gt.hasEagerState,eagerState:gt.eagerState,next:null},Fe===null?(Ee=Fe=Kt,de=q):Fe=Fe.next=Kt,Bn.lanes|=$t,Ir|=$t;gt=gt.next}while(gt!==null&&gt!==v);if(Fe===null?de=q:Fe.next=Ee,!Cr(q,m.memoizedState)&&(ga=!0,It&&(T=$c,T!==null)))throw T;m.memoizedState=q,m.baseState=de,m.baseQueue=Fe,O.lastRenderedState=q}return F===null&&(O.lanes=0),[m.memoizedState,O.dispatch]}function Tt(m){var v=Be(),T=v.queue;if(T===null)throw Error(a(311));T.lastRenderedReducer=m;var O=T.dispatch,F=T.pending,q=v.memoizedState;if(F!==null){T.pending=null;var de=F=F.next;do q=m(q,de.action),de=de.next;while(de!==F);Cr(q,v.memoizedState)||(ga=!0),v.memoizedState=q,v.baseQueue===null&&(v.baseState=q),T.lastRenderedState=q}return[q,O]}function qt(m,v,T){var O=Bn,F=Be(),q=di;if(q){if(T===void 0)throw Error(a(407));T=T()}else T=v();var de=!Cr((yi||F).memoizedState,T);if(de&&(F.memoizedState=T,ga=!0),F=F.queue,vh(vn.bind(null,O,F,m),[m]),F.getSnapshot!==v||de||ma!==null&&ma.memoizedState.tag&1){if(O.flags|=2048,Cs(9,xn.bind(null,O,F,T,v),{destroy:void 0},null),Wn===null)throw Error(a(349));q||(ll&60)!==0||Jt(O,v,T)}return T}function Jt(m,v,T){m.flags|=16384,m={getSnapshot:v,value:T},v=Bn.updateQueue,v===null?(v=m0(),Bn.updateQueue=v,v.stores=[m]):(T=v.stores,T===null?v.stores=[m]:T.push(m))}function xn(m,v,T,O){v.value=T,v.getSnapshot=O,ui(v)&&si(m)}function vn(m,v,T){return T(function(){ui(v)&&si(m)})}function ui(m){var v=m.getSnapshot;m=m.value;try{var T=v();return!Cr(m,T)}catch{return!0}}function si(m){var v=ve(m,2);v!==null&&gs(v,m,2)}function zn(m){var v=Re();if(typeof m=="function"){var T=m;if(m=T(),ql){H(!0);try{T()}finally{H(!1)}}}return v.memoizedState=v.baseState=m,v.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:m},v}function tn(m,v,T,O){return m.baseState=T,Ke(m,yi,typeof O=="function"?O:Pt)}function Ui(m,v,T,O,F){if(Nu(m))throw Error(a(485));if(m=v.action,m!==null){var q={payload:F,action:m,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(de){q.listeners.push(de)}};yn.T!==null?T(!0):q.isTransition=!1,O(q),T=v.pending,T===null?(q.next=v.pending=q,ti(v,q)):(q.next=T.next,v.pending=T.next=q)}}function ti(m,v){var T=v.action,O=v.payload,F=m.state;if(v.isTransition){var q=yn.T,de={};yn.T=de;try{var Ee=T(F,O),Fe=yn.S;Fe!==null&&Fe(de,Ee),Fa(m,v,Ee)}catch(gt){wa(m,v,gt)}finally{yn.T=q}}else try{q=T(F,O),Fa(m,v,q)}catch(gt){wa(m,v,gt)}}function Fa(m,v,T){T!==null&&typeof T=="object"&&typeof T.then=="function"?T.then(function(O){Wo(m,v,O)},function(O){return wa(m,v,O)}):Wo(m,v,T)}function Wo(m,v,T){v.status="fulfilled",v.value=T,vc(v),m.state=T,v=m.pending,v!==null&&(T=v.next,T===v?m.pending=null:(T=T.next,v.next=T,ti(m,T)))}function wa(m,v,T){var O=m.pending;if(m.pending=null,O!==null){O=O.next;do v.status="rejected",v.reason=T,vc(v),v=v.next;while(v!==O)}m.action=null}function vc(m){m=m.listeners;for(var v=0;v<m.length;v++)(0,m[v])()}function Kn(m,v){return v}function Ja(m,v){if(di){var T=Wn.formState;if(T!==null){e:{var O=Bn;if(di){if(rs){var F=Xx(rs,Qr);if(F){rs=fy(F),O=qx(F);break e}}ce(O)}O=!1}O&&(v=T[0])}}T=Re(),T.memoizedState=T.baseState=v,O={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Kn,lastRenderedState:v},T.queue=O,T=Tm.bind(null,Bn,O),O.dispatch=T,O=zn(!1);var q=Cm.bind(null,Bn,!1,O.queue);return O=Re(),F={state:v,dispatch:null,action:m,pending:null},O.queue=F,T=Ui.bind(null,Bn,F,q,T),F.dispatch=T,O.memoizedState=m,[v,T,!1]}function hs(m){var v=Be();return Ea(v,yi,m)}function Ea(m,v,T){v=Ke(m,v,Kn)[0],m=Ht(Pt)[0],v=typeof v=="object"&&v!==null&&typeof v.then=="function"?ke(v):v;var O=Be(),F=O.queue,q=F.dispatch;return T!==O.memoizedState&&(Bn.flags|=2048,Cs(9,ha.bind(null,F,T),{destroy:void 0},null)),[v,q,m]}function ha(m,v){m.action=v}function Tu(m){var v=Be(),T=yi;if(T!==null)return Ea(v,T,m);Be(),v=v.memoizedState,T=Be();var O=T.queue.dispatch;return T.memoizedState=m,[v,O,!1]}function Cs(m,v,T,O){return m={tag:m,create:v,inst:T,deps:O,next:null},v=Bn.updateQueue,v===null&&(v=m0(),Bn.updateQueue=v),T=v.lastEffect,T===null?v.lastEffect=m.next=m:(O=T.next,T.next=m,m.next=O,v.lastEffect=m),m}function Cu(){return Be().memoizedState}function Sm(m,v,T,O){var F=Re();Bn.flags|=m,F.memoizedState=Cs(1|v,T,{destroy:void 0},O===void 0?null:O)}function gh(m,v,T,O){var F=Be();O=O===void 0?null:O;var q=F.memoizedState.inst;yi!==null&&O!==null&&Ot(O,yi.memoizedState.deps)?F.memoizedState=Cs(v,T,q,O):(Bn.flags|=m,F.memoizedState=Cs(1|v,T,q,O))}function mv(m,v){Sm(8390656,8,m,v)}function vh(m,v){gh(2048,8,m,v)}function gx(m,v){return gh(4,2,m,v)}function vx(m,v){return gh(4,4,m,v)}function yh(m,v){if(typeof v=="function"){m=m();var T=v(m);return function(){typeof T=="function"?T():v(null)}}if(v!=null)return m=m(),v.current=m,function(){v.current=null}}function Ko(m,v,T){T=T!=null?T.concat([m]):null,gh(4,4,yh.bind(null,v,m),T)}function bh(){}function wm(m,v){var T=Be();v=v===void 0?null:v;var O=T.memoizedState;return v!==null&&Ot(v,O[1])?O[0]:(T.memoizedState=[m,v],m)}function Au(m,v){var T=Be();v=v===void 0?null:v;var O=T.memoizedState;if(v!==null&&Ot(v,O[1]))return O[0];if(O=m(),ql){H(!0);try{m()}finally{H(!1)}}return T.memoizedState=[O,v],O}function yc(m,v,T){return T===void 0||(ll&1073741824)!==0?m.memoizedState=v:(m.memoizedState=T,m=Yo(),Bn.lanes|=m,Ir|=m,T)}function gv(m,v,T,O){return Cr(T,v)?T:ol.current!==null?(m=yc(m,T,O),Cr(m,v)||(ga=!0),m):(ll&42)===0?(ga=!0,m.memoizedState=T):(m=Yo(),Bn.lanes|=m,Ir|=m,v)}function Em(m,v,T,O,F){var q=Pa();ys(q!==0&&8>q?q:8);var de=yn.T,Ee={};yn.T=Ee,Cm(m,!1,v,T);try{var Fe=F(),gt=yn.S;if(gt!==null&&gt(Ee,Fe),Fe!==null&&typeof Fe=="object"&&typeof Fe.then=="function"){var It=We(Fe,O);xc(m,v,It,Ns(m))}else xc(m,v,O,Ns(m))}catch($t){xc(m,v,{then:function(){},status:"rejected",reason:$t},Ns())}finally{ys(q),yn.T=de}}function vv(m){var v=m.memoizedState;if(v!==null)return v;v={memoizedState:Ks,baseState:Ks,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:Ks},next:null};var T={};return v.next={memoizedState:T,baseState:T,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Pt,lastRenderedState:T},next:null},m.memoizedState=v,m=m.alternate,m!==null&&(m.memoizedState=v),v}function Ru(){return ts(_n)}function Xo(){return Be().memoizedState}function Mm(){return Be().memoizedState}function xh(m){for(var v=m.return;v!==null;){switch(v.tag){case 24:case 3:var T=Ns();m=Ye(T);var O=Je(v,m,T);O!==null&&(gs(O,v,T),jt(O,v,T)),v={cache:Dm()},m.payload=v;return}v=v.return}}function bc(m,v,T){var O=Ns();T={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null},Nu(m)?_h(v,T):(T=he(m,v,T,O),T!==null&&(gs(T,m,O),yv(T,v,O)))}function Tm(m,v,T){var O=Ns();xc(m,v,T,O)}function xc(m,v,T,O){var F={lane:O,revertLane:0,action:T,hasEagerState:!1,eagerState:null,next:null};if(Nu(m))_h(v,F);else{var q=m.alternate;if(m.lanes===0&&(q===null||q.lanes===0)&&(q=v.lastRenderedReducer,q!==null))try{var de=v.lastRenderedState,Ee=q(de,T);if(F.hasEagerState=!0,F.eagerState=Ee,Cr(Ee,de))return xe(m,v,F,0),Wn===null&&be(),!1}catch{}finally{}if(T=he(m,v,F,O),T!==null)return gs(T,m,O),yv(T,v,O),!0}return!1}function Cm(m,v,T,O){if(O={lane:2,revertLane:Ie(),action:O,hasEagerState:!1,eagerState:null,next:null},Nu(m)){if(v)throw Error(a(479))}else v=he(m,T,O,2),v!==null&&gs(v,m,2)}function Nu(m){var v=m.alternate;return m===Bn||v!==null&&v===Bn}function _h(m,v){Xi=to=!0;var T=m.pending;T===null?v.next=v:(v.next=T.next,T.next=v),m.pending=v}function yv(m,v,T){if((T&4194176)!==0){var O=v.lanes;O&=m.pendingLanes,T|=O,v.lanes=T,k(m,T)}}function ps(m,v,T,O){v=m.memoizedState,T=T(O,v),T=T==null?v:Fu({},v,T),m.memoizedState=T,m.lanes===0&&(m.updateQueue.baseState=T)}function _c(m,v,T,O,F,q,de){return m=m.stateNode,typeof m.shouldComponentUpdate=="function"?m.shouldComponentUpdate(O,q,de):v.prototype&&v.prototype.isPureReactComponent?!at(T,O)||!at(F,q):!0}function Sh(m,v,T,O){m=v.state,typeof v.componentWillReceiveProps=="function"&&v.componentWillReceiveProps(T,O),typeof v.UNSAFE_componentWillReceiveProps=="function"&&v.UNSAFE_componentWillReceiveProps(T,O),v.state!==m&&g0.enqueueReplaceState(v,v.state,null)}function So(m,v){var T=v;if("ref"in v){T={};for(var O in v)O!=="ref"&&(T[O]=v[O])}if(m=m.defaultProps){T===v&&(T=Fu({},T));for(var F in m)T[F]===void 0&&(T[F]=m[F])}return T}function Am(m,v){try{var T=m.onUncaughtError;T(v.value,{componentStack:v.stack})}catch(O){setTimeout(function(){throw O})}}function Rm(m,v,T){try{var O=m.onCaughtError;O(T.value,{componentStack:T.stack,errorBoundary:v.tag===1?v.stateNode:null})}catch(F){setTimeout(function(){throw F})}}function wh(m,v,T){return T=Ye(T),T.tag=3,T.payload={element:null},T.callback=function(){Am(m,v)},T}function Dd(m){return m=Ye(m),m.tag=3,m}function Eh(m,v,T,O){var F=T.type.getDerivedStateFromError;if(typeof F=="function"){var q=O.value;m.payload=function(){return F(q)},m.callback=function(){Rm(v,T,O)}}var de=T.stateNode;de!==null&&typeof de.componentDidCatch=="function"&&(m.callback=function(){Rm(v,T,O),typeof F!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var Ee=O.stack;this.componentDidCatch(O.value,{componentStack:Ee!==null?Ee:""})})}function yx(m,v,T,O,F){if(T.flags|=32768,O!==null&&typeof O=="object"&&typeof O.then=="function"){if(v=T.alternate,v!==null&&Pu(v,T,F,!0),T=Lr.current,T!==null){switch(T.tag){case 13:return eo===null?Ws():T.alternate===null&&oi===0&&(oi=3),T.flags&=-257,T.flags|=65536,T.lanes=F,O===p0?T.flags|=16384:(v=T.updateQueue,v===null?T.updateQueue=new Set([O]):v.add(O),Wm(m,O,F)),!1;case 22:return T.flags|=65536,O===p0?T.flags|=16384:(v=T.updateQueue,v===null?(v={transitions:null,markerInstances:null,retryQueue:new Set([O])},T.updateQueue=v):(T=v.retryQueue,T===null?v.retryQueue=new Set([O]):T.add(O)),Wm(m,O,F)),!1}throw Error(a(435,T.tag))}return Wm(m,O,F),Ws(),!1}if(di)return v=Lr.current,v!==null?((v.flags&65536)===0&&(v.flags|=256),v.flags|=65536,v.lanes=F,O!==Jh&&(m=Error(a(422),{cause:O}),ne(J(m,T)))):(O!==Jh&&(v=Error(a(423),{cause:O}),ne(J(v,T))),m=m.current.alternate,m.flags|=65536,F&=-F,m.lanes|=F,O=J(O,T),F=wh(m.stateNode,O,F),wt(m,F),oi!==4&&(oi=2)),!1;var q=Error(a(520),{cause:O});if(q=J(q,T),lf===null?lf=[q]:lf.push(q),oi!==4&&(oi=2),v===null)return!0;O=J(O,T),T=v;do{switch(T.tag){case 3:return T.flags|=65536,m=F&-F,T.lanes|=m,m=wh(T.stateNode,O,m),wt(T,m),!1;case 1:if(v=T.type,q=T.stateNode,(T.flags&128)===0&&(typeof v.getDerivedStateFromError=="function"||q!==null&&typeof q.componentDidCatch=="function"&&(Br===null||!Br.has(q))))return T.flags|=65536,F&=-F,T.lanes|=F,F=Dd(F),Eh(F,m,T,O),wt(T,F),!1}T=T.return}while(T!==null);return!1}function es(m,v,T,O){v.child=m===null?Cy(v,null,T,O):Gc(v,m.child,T,O)}function bx(m,v,T,O,F){T=T.render;var q=v.ref;if("ref"in O){var de={};for(var Ee in O)Ee!=="ref"&&(de[Ee]=O[Ee])}else de=O;return Du(v),O=Mt(m,v,T,de,q,F),Ee=ei(),m!==null&&!ga?(Fn(m,v,F),Ol(m,v,F)):(di&&Ee&&ee(v),v.flags|=1,es(m,v,O,F),v.child)}function xx(m,v,T,O,F){if(m===null){var q=T.type;return typeof q=="function"&&!Fl(q)&&q.defaultProps===void 0&&T.compare===null?(v.tag=15,v.type=q,Nm(m,v,q,O,F)):(m=qr(T.type,null,O,v,v.mode,F),m.ref=v.ref,m.return=v,v.child=m)}if(q=m.child,!Mv(m,F)){var de=q.memoizedProps;if(T=T.compare,T=T!==null?T:at,T(de,O)&&m.ref===v.ref)return Ol(m,v,F)}return v.flags|=1,m=vs(q,O),m.ref=v.ref,m.return=v,v.child=m}function Nm(m,v,T,O,F){if(m!==null){var q=m.memoizedProps;if(at(q,O)&&m.ref===v.ref)if(ga=!1,v.pendingProps=O=q,Mv(m,F))(m.flags&131072)!==0&&(ga=!0);else return v.lanes=m.lanes,Ol(m,v,F)}return bv(m,v,T,O,F)}function _x(m,v,T){var O=v.pendingProps,F=O.children,q=(v.stateNode._pendingVisibility&2)!==0,de=m!==null?m.memoizedState:null;if(Mh(m,v),O.mode==="hidden"||q){if((v.flags&128)!==0){if(O=de!==null?de.baseLanes|T:T,m!==null){for(F=v.child=m.child,q=0;F!==null;)q=q|F.lanes|F.childLanes,F=F.sibling;v.childLanes=q&~O}else v.childLanes=0,v.child=null;return Sx(m,v,O,T)}if((T&536870912)!==0)v.memoizedState={baseLanes:0,cachePool:null},m!==null&&Lm(v,de!==null?de.cachePool:null),de!==null?De(v,de):lt(),Ut(v);else return v.lanes=v.childLanes=536870912,Sx(m,v,de!==null?de.baseLanes|T:T,T)}else de!==null?(Lm(v,de.cachePool),De(v,de),Dt(),v.memoizedState=null):(m!==null&&Lm(v,null),lt(),Dt());return es(m,v,F,T),v.child}function Sx(m,v,T,O){var F=Ec();return F=F===null?null:{parent:nl?Ei._currentValue:Ei._currentValue2,pool:F},v.memoizedState={baseLanes:T,cachePool:F},m!==null&&Lm(v,null),lt(),Ut(v),m!==null&&Pu(m,v,O,!0),null}function Mh(m,v){var T=v.ref;if(T===null)m!==null&&m.ref!==null&&(v.flags|=2097664);else{if(typeof T!="function"&&typeof T!="object")throw Error(a(284));(m===null||m.ref!==T)&&(v.flags|=2097664)}}function bv(m,v,T,O,F){return Du(v),T=Mt(m,v,T,O,void 0,F),O=ei(),m!==null&&!ga?(Fn(m,v,F),Ol(m,v,F)):(di&&O&&ee(v),v.flags|=1,es(m,v,T,F),v.child)}function wx(m,v,T,O,F,q){return Du(v),v.updateQueue=null,T=wi(v,O,T,F),Ln(m),O=ei(),m!==null&&!ga?(Fn(m,v,q),Ol(m,v,q)):(di&&O&&ee(v),v.flags|=1,es(m,v,T,q),v.child)}function xv(m,v,T,O,F){if(Du(v),v.stateNode===null){var q=Gu,de=T.contextType;typeof de=="object"&&de!==null&&(q=ts(de)),q=new T(O,q),v.memoizedState=q.state!==null&&q.state!==void 0?q.state:null,q.updater=g0,v.stateNode=q,q._reactInternals=v,q=v.stateNode,q.props=O,q.state=v.memoizedState,q.refs={},mt(v),de=T.contextType,q.context=typeof de=="object"&&de!==null?ts(de):Gu,q.state=v.memoizedState,de=T.getDerivedStateFromProps,typeof de=="function"&&(ps(v,T,de,O),q.state=v.memoizedState),typeof T.getDerivedStateFromProps=="function"||typeof q.getSnapshotBeforeUpdate=="function"||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(de=q.state,typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount(),de!==q.state&&g0.enqueueReplaceState(q,q.state,null),zt(v,O,q,F),Et(),q.state=v.memoizedState),typeof q.componentDidMount=="function"&&(v.flags|=4194308),O=!0}else if(m===null){q=v.stateNode;var Ee=v.memoizedProps,Fe=So(T,Ee);q.props=Fe;var gt=q.context,It=T.contextType;de=Gu,typeof It=="object"&&It!==null&&(de=ts(It));var $t=T.getDerivedStateFromProps;It=typeof $t=="function"||typeof q.getSnapshotBeforeUpdate=="function",Ee=v.pendingProps!==Ee,It||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(Ee||gt!==de)&&Sh(v,q,O,de),Xl=!1;var Kt=v.memoizedState;q.state=Kt,zt(v,O,q,F),Et(),gt=v.memoizedState,Ee||Kt!==gt||Xl?(typeof $t=="function"&&(ps(v,T,$t,O),gt=v.memoizedState),(Fe=Xl||_c(v,T,Fe,O,Kt,gt,de))?(It||typeof q.UNSAFE_componentWillMount!="function"&&typeof q.componentWillMount!="function"||(typeof q.componentWillMount=="function"&&q.componentWillMount(),typeof q.UNSAFE_componentWillMount=="function"&&q.UNSAFE_componentWillMount()),typeof q.componentDidMount=="function"&&(v.flags|=4194308)):(typeof q.componentDidMount=="function"&&(v.flags|=4194308),v.memoizedProps=O,v.memoizedState=gt),q.props=O,q.state=gt,q.context=de,O=Fe):(typeof q.componentDidMount=="function"&&(v.flags|=4194308),O=!1)}else{q=v.stateNode,nt(m,v),de=v.memoizedProps,It=So(T,de),q.props=It,$t=v.pendingProps,Kt=q.context,gt=T.contextType,Fe=Gu,typeof gt=="object"&&gt!==null&&(Fe=ts(gt)),Ee=T.getDerivedStateFromProps,(gt=typeof Ee=="function"||typeof q.getSnapshotBeforeUpdate=="function")||typeof q.UNSAFE_componentWillReceiveProps!="function"&&typeof q.componentWillReceiveProps!="function"||(de!==$t||Kt!==Fe)&&Sh(v,q,O,Fe),Xl=!1,Kt=v.memoizedState,q.state=Kt,zt(v,O,q,F),Et();var Cn=v.memoizedState;de!==$t||Kt!==Cn||Xl||m!==null&&m.dependencies!==null&&wc(m.dependencies)?(typeof Ee=="function"&&(ps(v,T,Ee,O),Cn=v.memoizedState),(It=Xl||_c(v,T,It,O,Kt,Cn,Fe)||m!==null&&m.dependencies!==null&&wc(m.dependencies))?(gt||typeof q.UNSAFE_componentWillUpdate!="function"&&typeof q.componentWillUpdate!="function"||(typeof q.componentWillUpdate=="function"&&q.componentWillUpdate(O,Cn,Fe),typeof q.UNSAFE_componentWillUpdate=="function"&&q.UNSAFE_componentWillUpdate(O,Cn,Fe)),typeof q.componentDidUpdate=="function"&&(v.flags|=4),typeof q.getSnapshotBeforeUpdate=="function"&&(v.flags|=1024)):(typeof q.componentDidUpdate!="function"||de===m.memoizedProps&&Kt===m.memoizedState||(v.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||de===m.memoizedProps&&Kt===m.memoizedState||(v.flags|=1024),v.memoizedProps=O,v.memoizedState=Cn),q.props=O,q.state=Cn,q.context=Fe,O=It):(typeof q.componentDidUpdate!="function"||de===m.memoizedProps&&Kt===m.memoizedState||(v.flags|=4),typeof q.getSnapshotBeforeUpdate!="function"||de===m.memoizedProps&&Kt===m.memoizedState||(v.flags|=1024),O=!1)}return q=O,Mh(m,v),O=(v.flags&128)!==0,q||O?(q=v.stateNode,T=O&&typeof T.getDerivedStateFromError!="function"?null:q.render(),v.flags|=1,m!==null&&O?(v.child=Gc(v,m.child,null,F),v.child=Gc(v,null,T,F)):es(m,v,T,F),v.memoizedState=q.state,m=v.child):m=Ol(m,v,F),m}function Ex(m,v,T,O){return me(),v.flags|=256,es(m,v,T,O),v.child}function _v(m){return{baseLanes:m,cachePool:Rx()}}function Sv(m,v,T){return m=m!==null?m.childLanes&~T:0,v&&(m|=Js),m}function Mx(m,v,T){var O=v.pendingProps,F=!1,q=(v.flags&128)!==0,de;if((de=q)||(de=m!==null&&m.memoizedState===null?!1:(Ta.current&2)!==0),de&&(F=!0,v.flags&=-129),de=(v.flags&32)!==0,v.flags&=-33,m===null){if(di){if(F?Bt(v):Dt(),di){var Ee=rs,Fe;(Fe=Ee)&&(Ee=e2(Ee,Qr),Ee!==null?(v.memoizedState={dehydrated:Ee,treeContext:Co!==null?{id:sl,overflow:Zr}:null,retryLane:536870912},Fe=n(18,null,null,0),Fe.stateNode=Ee,Fe.return=v,v.child=Fe,bs=v,rs=null,Fe=!0):Fe=!1),Fe||ce(v)}if(Ee=v.memoizedState,Ee!==null&&(Ee=Ee.dehydrated,Ee!==null))return Gh(Ee)?v.lanes=16:v.lanes=536870912,null;ot(v)}return Ee=O.children,O=O.fallback,F?(Dt(),F=v.mode,Ee=wv({mode:"hidden",children:Ee},F),O=kl(O,F,T,null),Ee.return=v,O.return=v,Ee.sibling=O,v.child=Ee,F=v.child,F.memoizedState=_v(T),F.childLanes=Sv(m,de,T),v.memoizedState=_s,O):(Bt(v),Th(v,Ee))}if(Fe=m.memoizedState,Fe!==null&&(Ee=Fe.dehydrated,Ee!==null)){if(q)v.flags&256?(Bt(v),v.flags&=-257,v=Ev(m,v,T)):v.memoizedState!==null?(Dt(),v.child=m.child,v.flags|=128,v=null):(Dt(),F=O.fallback,Ee=v.mode,O=wv({mode:"visible",children:O.children},Ee),F=kl(F,Ee,T,null),F.flags|=2,O.return=v,F.return=v,O.sibling=F,v.child=O,Gc(v,m.child,null,T),O=v.child,O.memoizedState=_v(T),O.childLanes=Sv(m,de,T),v.memoizedState=_s,v=F);else if(Bt(v),Gh(Ee))de=Kx(Ee).digest,O=Error(a(419)),O.stack="",O.digest=de,ne({value:O,source:null,stack:null}),v=Ev(m,v,T);else if(ga||Pu(m,v,T,!1),de=(T&m.childLanes)!==0,ga||de){if(de=Wn,de!==null){if(O=T&-T,(O&42)!==0)O=1;else switch(O){case 2:O=1;break;case 8:O=4;break;case 32:O=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:O=64;break;case 268435456:O=134217728;break;default:O=0}if(O=(O&(de.suspendedLanes|T))!==0?0:O,O!==0&&O!==Fe.retryLane)throw Fe.retryLane=O,ve(m,O),gs(de,m,O),m2}a0(Ee)||Ws(),v=Ev(m,v,T)}else a0(Ee)?(v.flags|=128,v.child=m.child,v=Uu.bind(null,m),o4(Ee,v),v=null):(m=Fe.treeContext,Ps&&(rs=Zx(Ee),bs=v,di=!0,Nr=null,Qr=!1,m!==null&&(Ar[Rr++]=sl,Ar[Rr++]=Zr,Ar[Rr++]=Co,sl=m.id,Zr=m.overflow,Co=v)),v=Th(v,O.children),v.flags|=4096);return v}return F?(Dt(),F=O.fallback,Ee=v.mode,Fe=m.child,q=Fe.sibling,O=vs(Fe,{mode:"hidden",children:O.children}),O.subtreeFlags=Fe.subtreeFlags&31457280,q!==null?F=vs(q,F):(F=kl(F,Ee,T,null),F.flags|=2),F.return=v,O.return=v,O.sibling=F,v.child=O,O=F,F=v.child,Ee=m.child.memoizedState,Ee===null?Ee=_v(T):(Fe=Ee.cachePool,Fe!==null?(q=nl?Ei._currentValue:Ei._currentValue2,Fe=Fe.parent!==q?{parent:q,pool:q}:Fe):Fe=Rx(),Ee={baseLanes:Ee.baseLanes|T,cachePool:Fe}),F.memoizedState=Ee,F.childLanes=Sv(m,de,T),v.memoizedState=_s,O):(Bt(v),T=m.child,m=T.sibling,T=vs(T,{mode:"visible",children:O.children}),T.return=v,T.sibling=null,m!==null&&(de=v.deletions,de===null?(v.deletions=[m],v.flags|=16):de.push(m)),v.child=T,v.memoizedState=null,T)}function Th(m,v){return v=wv({mode:"visible",children:v},m.mode),v.return=m,m.child=v}function wv(m,v){return Km(m,v,0,null)}function Ev(m,v,T){return Gc(v,m.child,null,T),m=Th(v,v.pendingProps.children),m.flags|=2,v.memoizedState=null,m}function Tx(m,v,T){m.lanes|=v;var O=m.alternate;O!==null&&(O.lanes|=v),Tv(m.return,v,T)}function Pm(m,v,T,O,F){var q=m.memoizedState;q===null?m.memoizedState={isBackwards:v,rendering:null,renderingStartTime:0,last:O,tail:T,tailMode:F}:(q.isBackwards=v,q.rendering=null,q.renderingStartTime=0,q.last=O,q.tail=T,q.tailMode=F)}function Cx(m,v,T){var O=v.pendingProps,F=O.revealOrder,q=O.tail;if(es(m,v,O.children,T),O=Ta.current,(O&2)!==0)O=O&1|2,v.flags|=128;else{if(m!==null&&(m.flags&128)!==0)e:for(m=v.child;m!==null;){if(m.tag===13)m.memoizedState!==null&&Tx(m,T,v);else if(m.tag===19)Tx(m,T,v);else if(m.child!==null){m.child.return=m,m=m.child;continue}if(m===v)break e;for(;m.sibling===null;){if(m.return===null||m.return===v)break e;m=m.return}m.sibling.return=m.return,m=m.sibling}O&=1}switch(M(Ta,O),F){case"forwards":for(T=v.child,F=null;T!==null;)m=T.alternate,m!==null&&Lt(m)===null&&(F=T),T=T.sibling;T=F,T===null?(F=v.child,v.child=null):(F=T.sibling,T.sibling=null),Pm(v,!1,F,T,q);break;case"backwards":for(T=null,F=v.child,v.child=null;F!==null;){if(m=F.alternate,m!==null&&Lt(m)===null){v.child=F;break}m=F.sibling,F.sibling=T,T=F,F=m}Pm(v,!0,T,null,q);break;case"together":Pm(v,!1,null,null,void 0);break;default:v.memoizedState=null}return v.child}function Ol(m,v,T){if(m!==null&&(v.dependencies=m.dependencies),Ir|=v.lanes,(T&v.childLanes)===0)if(m!==null){if(Pu(m,v,T,!1),(T&v.childLanes)===0)return null}else return null;if(m!==null&&v.child!==m.child)throw Error(a(153));if(v.child!==null){for(m=v.child,T=vs(m,m.pendingProps),v.child=T,T.return=v;m.sibling!==null;)m=m.sibling,T=T.sibling=vs(m,m.pendingProps),T.return=v;T.sibling=null}return v.child}function Mv(m,v){return(m.lanes&v)!==0?!0:(m=m.dependencies,!!(m!==null&&wc(m)))}function a4(m,v,T){switch(v.tag){case 3:Z(v,v.stateNode.containerInfo),Sc(v,Ei,m.memoizedState.cache),me();break;case 27:case 5:se(v);break;case 4:Z(v,v.stateNode.containerInfo);break;case 10:Sc(v,v.type,v.memoizedProps.value);break;case 13:var O=v.memoizedState;if(O!==null)return O.dehydrated!==null?(Bt(v),v.flags|=128,null):(T&v.child.childLanes)!==0?Mx(m,v,T):(Bt(v),m=Ol(m,v,T),m!==null?m.sibling:null);Bt(v);break;case 19:var F=(m.flags&128)!==0;if(O=(T&v.childLanes)!==0,O||(Pu(m,v,T,!1),O=(T&v.childLanes)!==0),F){if(O)return Cx(m,v,T);v.flags|=128}if(F=v.memoizedState,F!==null&&(F.rendering=null,F.tail=null,F.lastEffect=null),M(Ta,Ta.current),O)break;return null;case 22:case 23:return v.lanes=0,_x(m,v,T);case 24:Sc(v,Ei,m.memoizedState.cache)}return Ol(m,v,T)}function Ax(m,v,T){if(m!==null)if(m.memoizedProps!==v.pendingProps)ga=!0;else{if(!Mv(m,T)&&(v.flags&128)===0)return ga=!1,a4(m,v,T);ga=(m.flags&131072)!==0}else ga=!1,di&&(v.flags&1048576)!==0&&K(v,Zh,v.index);switch(v.lanes=0,v.tag){case 16:e:{m=v.pendingProps;var O=v.elementType,F=O._init;if(O=F(O._payload),v.type=O,typeof O=="function")Fl(O)?(m=So(O,m),v.tag=1,v=xv(null,v,O,m,T)):(v.tag=0,v=bv(null,v,O,m,T));else{if(O!=null){if(F=O.$$typeof,F===Xd){v.tag=11,v=bx(null,v,O,m,T);break e}else if(F===Bh){v.tag=14,v=xx(null,v,O,m,T);break e}}throw v=r(O)||O,Error(a(306,v,""))}}return v;case 0:return bv(m,v,v.type,v.pendingProps,T);case 1:return O=v.type,F=So(O,v.pendingProps),xv(m,v,O,F,T);case 3:e:{if(Z(v,v.stateNode.containerInfo),m===null)throw Error(a(387));var q=v.pendingProps;F=v.memoizedState,O=F.element,nt(m,v),zt(v,q,null,T);var de=v.memoizedState;if(q=de.cache,Sc(v,Ei,q),q!==F.cache&&Cv(v,[Ei],T,!0),Et(),q=de.element,Ps&&F.isDehydrated)if(F={element:q,isDehydrated:!1,cache:de.cache},v.updateQueue.baseState=F,v.memoizedState=F,v.flags&256){v=Ex(m,v,q,T);break e}else if(q!==O){O=J(Error(a(424)),v),ne(O),v=Ex(m,v,q,T);break e}else for(Ps&&(rs=Yx(v.stateNode.containerInfo),bs=v,di=!0,Nr=null,Qr=!0),T=Cy(v,null,q,T),v.child=T;T;)T.flags=T.flags&-3|4096,T=T.sibling;else{if(me(),q===O){v=Ol(m,v,T);break e}es(m,v,q,T)}v=v.child}return v;case 26:if(Tr)return Mh(m,v),m===null?(T=c0(v.type,null,v.pendingProps,null))?v.memoizedState=T:di||(v.stateNode=c4(v.type,v.pendingProps,Ao.current,v)):v.memoizedState=c0(v.type,m.memoizedProps,v.pendingProps,m.memoizedState),null;case 27:if(as)return se(v),m===null&&as&&di&&(O=v.stateNode=wy(v.type,v.pendingProps,Ao.current,Ga.current,!1),bs=v,Qr=!0,rs=s0(O)),O=v.pendingProps.children,m!==null||di?es(m,v,O,T):v.child=Gc(v,null,O,T),Mh(m,v),v.child;case 5:return m===null&&di&&(s2(v.type,v.pendingProps,Ga.current),(F=O=rs)&&(O=Qx(O,v.type,v.pendingProps,Qr),O!==null?(v.stateNode=O,bs=v,rs=s0(O),Qr=!1,F=!0):F=!1),F||ce(v)),se(v),F=v.type,q=v.pendingProps,de=m!==null?m.memoizedProps:null,O=q.children,Fc(F,q)?O=null:de!==null&&Fc(F,de)&&(v.flags|=32),v.memoizedState!==null&&(F=Mt(m,v,aa,null,null,T),nl?_n._currentValue=F:_n._currentValue2=F),Mh(m,v),es(m,v,O,T),v.child;case 6:return m===null&&di&&(r2(v.pendingProps,Ga.current),(m=T=rs)&&(T=Jx(T,v.pendingProps,Qr),T!==null?(v.stateNode=T,bs=v,rs=null,m=!0):m=!1),m||ce(v)),null;case 13:return Mx(m,v,T);case 4:return Z(v,v.stateNode.containerInfo),O=v.pendingProps,m===null?v.child=Gc(v,null,O,T):es(m,v,O,T),v.child;case 11:return bx(m,v,v.type,v.pendingProps,T);case 7:return es(m,v,v.pendingProps,T),v.child;case 8:return es(m,v,v.pendingProps.children,T),v.child;case 12:return es(m,v,v.pendingProps.children,T),v.child;case 10:return O=v.pendingProps,Sc(v,v.type,O.value),es(m,v,O.children,T),v.child;case 9:return F=v.type._context,O=v.pendingProps.children,Du(v),F=ts(F),O=O(F),v.flags|=1,es(m,v,O,T),v.child;case 14:return xx(m,v,v.type,v.pendingProps,T);case 15:return Nm(m,v,v.type,v.pendingProps,T);case 19:return Cx(m,v,T);case 22:return _x(m,v,T);case 24:return Du(v),O=ts(Ei),m===null?(F=Ec(),F===null&&(F=Wn,q=Dm(),F.pooledCache=q,q.refCount++,q!==null&&(F.pooledCacheLanes|=T),F=q),v.memoizedState={parent:O,cache:F},mt(v),Sc(v,Ei,F)):((m.lanes&T)!==0&&(nt(m,v),zt(v,null,null,T),Et()),F=m.memoizedState,q=v.memoizedState,F.parent!==O?(F={parent:O,cache:O},v.memoizedState=F,v.lanes===0&&(v.memoizedState=v.updateQueue.baseState=F),Sc(v,Ei,O)):(O=q.cache,Sc(v,Ei,O),O!==F.cache&&Cv(v,[Ei],T,!0))),es(m,v,v.pendingProps.children,T),v.child;case 29:throw v.pendingProps}throw Error(a(156,v.tag))}function Sc(m,v,T){nl?(M(Zs,v._currentValue),v._currentValue=T):(M(Zs,v._currentValue2),v._currentValue2=T)}function Il(m){var v=Zs.current;nl?m._currentValue=v:m._currentValue2=v,S(Zs)}function Tv(m,v,T){for(;m!==null;){var O=m.alternate;if((m.childLanes&v)!==v?(m.childLanes|=v,O!==null&&(O.childLanes|=v)):O!==null&&(O.childLanes&v)!==v&&(O.childLanes|=v),m===T)break;m=m.return}}function Cv(m,v,T,O){var F=m.child;for(F!==null&&(F.return=m);F!==null;){var q=F.dependencies;if(q!==null){var de=F.child;q=q.firstContext;e:for(;q!==null;){var Ee=q;q=F;for(var Fe=0;Fe<v.length;Fe++)if(Ee.context===v[Fe]){q.lanes|=T,Ee=q.alternate,Ee!==null&&(Ee.lanes|=T),Tv(q.return,T,m),O||(de=null);break e}q=Ee.next}}else if(F.tag===18){if(de=F.return,de===null)throw Error(a(341));de.lanes|=T,q=de.alternate,q!==null&&(q.lanes|=T),Tv(de,T,m),de=null}else de=F.child;if(de!==null)de.return=F;else for(de=F;de!==null;){if(de===m){de=null;break}if(F=de.sibling,F!==null){F.return=de.return,de=F;break}de=de.return}F=de}}function Pu(m,v,T,O){m=null;for(var F=v,q=!1;F!==null;){if(!q){if((F.flags&524288)!==0)q=!0;else if((F.flags&262144)!==0)break}if(F.tag===10){var de=F.alternate;if(de===null)throw Error(a(387));if(de=de.memoizedProps,de!==null){var Ee=F.type;Cr(F.pendingProps.value,de.value)||(m!==null?m.push(Ee):m=[Ee])}}else if(F===tf.current){if(de=F.alternate,de===null)throw Error(a(387));de.memoizedState.memoizedState!==F.memoizedState.memoizedState&&(m!==null?m.push(_n):m=[_n])}F=F.return}m!==null&&Cv(v,m,T,O),v.flags|=262144}function wc(m){for(m=m.firstContext;m!==null;){var v=m.context;if(!Cr(nl?v._currentValue:v._currentValue2,m.memoizedValue))return!0;m=m.next}return!1}function Du(m){Kc=m,ca=null,m=m.dependencies,m!==null&&(m.firstContext=null)}function ts(m){return Av(Kc,m)}function Ch(m,v){return Kc===null&&Du(m),Av(m,v)}function Av(m,v){var T=nl?v._currentValue:v._currentValue2;if(v={context:v,memoizedValue:T,next:null},ca===null){if(m===null)throw Error(a(308));ca=v,m.dependencies={lanes:0,firstContext:v},m.flags|=524288}else ca=ca.next=v;return T}function Dm(){return{controller:new g2,data:new Map,refCount:0}}function Ld(m){m.refCount--,m.refCount===0&&Yl(Xu,function(){m.controller.abort()})}function Ec(){var m=Zl.current;return m!==null?m:Wn.pooledCache}function Lm(m,v){v===null?M(Zl,Zl.current):M(Zl,v.pool)}function Rx(){var m=Ec();return m===null?null:{parent:nl?Ei._currentValue:Ei._currentValue2,pool:m}}function _r(m){m.flags|=4}function Rv(m,v){if(m!==null&&m.child===v.child)return!1;if((v.flags&16)!==0)return!0;for(m=v.child;m!==null;){if((m.flags&13878)!==0||(m.subtreeFlags&13878)!==0)return!0;m=m.sibling}return!1}function Om(m,v,T,O){if(is)for(T=v.child;T!==null;){if(T.tag===5||T.tag===6)tl(m,T.stateNode);else if(!(T.tag===4||as&&T.tag===27)&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===v)break;for(;T.sibling===null;){if(T.return===null||T.return===v)return;T=T.return}T.sibling.return=T.return,T=T.sibling}else if(Er)for(var F=v.child;F!==null;){if(F.tag===5){var q=F.stateNode;T&&O&&(q=uy(q,F.type,F.memoizedProps)),tl(m,q)}else if(F.tag===6)q=F.stateNode,T&&O&&(q=dy(q,F.memoizedProps)),tl(m,q);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)q=F.child,q!==null&&(q.return=F),Om(m,F,!0,!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===v)break;for(;F.sibling===null;){if(F.return===null||F.return===v)return;F=F.return}F.sibling.return=F.return,F=F.sibling}}function Od(m,v,T,O){if(Er)for(var F=v.child;F!==null;){if(F.tag===5){var q=F.stateNode;T&&O&&(q=uy(q,F.type,F.memoizedProps)),ly(m,q)}else if(F.tag===6)q=F.stateNode,T&&O&&(q=dy(q,F.memoizedProps)),ly(m,q);else if(F.tag!==4){if(F.tag===22&&F.memoizedState!==null)q=F.child,q!==null&&(q.return=F),Od(m,F,!(F.memoizedProps!==null&&F.memoizedProps.mode==="manual"),!0);else if(F.child!==null){F.child.return=F,F=F.child;continue}}if(F===v)break;for(;F.sibling===null;){if(F.return===null||F.return===v)return;F=F.return}F.sibling.return=F.return,F=F.sibling}}function Id(m,v){if(Er&&Rv(m,v)){m=v.stateNode;var T=m.containerInfo,O=i0();Od(O,v,!1,!1),m.pendingChildren=O,_r(v),Wx(T,O)}}function Nv(m,v,T,O){if(is)m.memoizedProps!==O&&_r(v);else if(Er){var F=m.stateNode,q=m.memoizedProps;if((m=Rv(m,v))||q!==O){var de=Ga.current;q=oy(F,T,q,O,!m,null),q===F?v.stateNode=F:($l(q,T,O,de)&&_r(v),v.stateNode=q,m?Om(q,v,!1,!1):_r(v))}else v.stateNode=F}}function zd(m,v,T){if(Hx(v,T)){if(m.flags|=16777216,!Gl(v,T))if(Lh())m.flags|=8192;else throw Ku=p0,Ty}else m.flags&=-16777217}function Pv(m,v){if(o2(v)){if(m.flags|=16777216,!_y(v))if(Lh())m.flags|=8192;else throw Ku=p0,Ty}else m.flags&=-16777217}function Ah(m,v){v!==null&&(m.flags|=4),m.flags&16384&&(v=m.tag!==22?z():536870912,m.lanes|=v,Jl|=v)}function Lu(m,v){if(!di)switch(m.tailMode){case"hidden":v=m.tail;for(var T=null;v!==null;)v.alternate!==null&&(T=v),v=v.sibling;T===null?m.tail=null:T.sibling=null;break;case"collapsed":T=m.tail;for(var O=null;T!==null;)T.alternate!==null&&(O=T),T=T.sibling;O===null?v||m.tail===null?m.tail=null:m.tail.sibling=null:O.sibling=null}}function Gi(m){var v=m.alternate!==null&&m.alternate.child===m.child,T=0,O=0;if(v)for(var F=m.child;F!==null;)T|=F.lanes|F.childLanes,O|=F.subtreeFlags&31457280,O|=F.flags&31457280,F.return=m,F=F.sibling;else for(F=m.child;F!==null;)T|=F.lanes|F.childLanes,O|=F.subtreeFlags,O|=F.flags,F.return=m,F=F.sibling;return m.subtreeFlags|=O,m.childLanes=T,v}function Nx(m,v,T){var O=v.pendingProps;switch(ie(v),v.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gi(v),null;case 1:return Gi(v),null;case 3:return T=v.stateNode,O=null,m!==null&&(O=m.memoizedState.cache),v.memoizedState.cache!==O&&(v.flags|=2048),Il(Ei),ue(),T.pendingContext&&(T.context=T.pendingContext,T.pendingContext=null),(m===null||m.child===null)&&(_e(v)?_r(v):m===null||m.memoizedState.isDehydrated&&(v.flags&256)===0||(v.flags|=1024,Nr!==null&&(Bl(Nr),Nr=null))),Id(m,v),Gi(v),null;case 26:if(Tr){T=v.type;var F=v.memoizedState;return m===null?(_r(v),F!==null?(Gi(v),Pv(v,F)):(Gi(v),zd(v,T,O))):F?F!==m.memoizedState?(_r(v),Gi(v),Pv(v,F)):(Gi(v),v.flags&=-16777217):(is?m.memoizedProps!==O&&_r(v):Nv(m,v,T,O),Gi(v),zd(v,T,O)),null}case 27:if(as){if(ae(v),T=Ao.current,F=v.type,m!==null&&v.stateNode!=null)is?m.memoizedProps!==O&&_r(v):Nv(m,v,F,O);else{if(!O){if(v.stateNode===null)throw Error(a(166));return Gi(v),null}m=Ga.current,_e(v)?pe(v,m):(m=wy(F,O,T,m,!0),v.stateNode=m,_r(v))}return Gi(v),null}case 5:if(ae(v),T=v.type,m!==null&&v.stateNode!=null)Nv(m,v,T,O);else{if(!O){if(v.stateNode===null)throw Error(a(166));return Gi(v),null}m=Ga.current,_e(v)?pe(v,m):(F=Yv(T,O,Ao.current,m,v),Om(F,v,!1,!1),v.stateNode=F,$l(F,T,O,m)&&_r(v))}return Gi(v),zd(v,v.type,v.pendingProps),null;case 6:if(m&&v.stateNode!=null)T=m.memoizedProps,is?T!==O&&_r(v):Er&&(T!==O?(v.stateNode=Zm(O,Ao.current,Ga.current,v),_r(v)):v.stateNode=m.stateNode);else{if(typeof O!="string"&&v.stateNode===null)throw Error(a(166));if(m=Ao.current,T=Ga.current,_e(v)){if(!Ps)throw Error(a(176));if(m=v.stateNode,T=v.memoizedProps,O=null,F=bs,F!==null)switch(F.tag){case 27:case 5:O=F.memoizedProps}t2(m,T,v,O)||ce(v)}else v.stateNode=Zm(O,m,T,v)}return Gi(v),null;case 13:if(O=v.memoizedState,m===null||m.memoizedState!==null&&m.memoizedState.dehydrated!==null){if(F=_e(v),O!==null&&O.dehydrated!==null){if(m===null){if(!F)throw Error(a(318));if(!Ps)throw Error(a(344));if(F=v.memoizedState,F=F!==null?F.dehydrated:null,!F)throw Error(a(317));Yd(F,v)}else me(),(v.flags&128)===0&&(v.memoizedState=null),v.flags|=4;Gi(v),F=!1}else Nr!==null&&(Bl(Nr),Nr=null),F=!0;if(!F)return v.flags&256?(ot(v),v):(ot(v),null)}if(ot(v),(v.flags&128)!==0)return v.lanes=T,v;if(T=O!==null,m=m!==null&&m.memoizedState!==null,T){O=v.child,F=null,O.alternate!==null&&O.alternate.memoizedState!==null&&O.alternate.memoizedState.cachePool!==null&&(F=O.alternate.memoizedState.cachePool.pool);var q=null;O.memoizedState!==null&&O.memoizedState.cachePool!==null&&(q=O.memoizedState.cachePool.pool),q!==F&&(O.flags|=2048)}return T!==m&&T&&(v.child.flags|=8192),Ah(v,v.updateQueue),Gi(v),null;case 4:return ue(),Id(m,v),m===null&&Jv(v.stateNode.containerInfo),Gi(v),null;case 10:return Il(v.type),Gi(v),null;case 19:if(S(Ta),F=v.memoizedState,F===null)return Gi(v),null;if(O=(v.flags&128)!==0,q=F.rendering,q===null)if(O)Lu(F,!1);else{if(oi!==0||m!==null&&(m.flags&128)!==0)for(m=v.child;m!==null;){if(q=Lt(m),q!==null){for(v.flags|=128,Lu(F,!1),m=q.updateQueue,v.updateQueue=m,Ah(v,m),v.subtreeFlags=0,m=T,T=v.child;T!==null;)Vl(T,m),T=T.sibling;return M(Ta,Ta.current&1|2),v.child}m=m.sibling}F.tail!==null&&ss()>Ji&&(v.flags|=128,O=!0,Lu(F,!1),v.lanes=4194304)}else{if(!O)if(m=Lt(q),m!==null){if(v.flags|=128,O=!0,m=m.updateQueue,v.updateQueue=m,Ah(v,m),Lu(F,!0),F.tail===null&&F.tailMode==="hidden"&&!q.alternate&&!di)return Gi(v),null}else 2*ss()-F.renderingStartTime>Ji&&T!==536870912&&(v.flags|=128,O=!0,Lu(F,!1),v.lanes=4194304);F.isBackwards?(q.sibling=v.child,v.child=q):(m=F.last,m!==null?m.sibling=q:v.child=q,F.last=q)}return F.tail!==null?(v=F.tail,F.rendering=v,F.tail=v.sibling,F.renderingStartTime=ss(),v.sibling=null,m=Ta.current,M(Ta,O?m&1|2:m&1),v):(Gi(v),null);case 22:case 23:return ot(v),rt(),O=v.memoizedState!==null,m!==null?m.memoizedState!==null!==O&&(v.flags|=8192):O&&(v.flags|=8192),O?(T&536870912)!==0&&(v.flags&128)===0&&(Gi(v),v.subtreeFlags&6&&(v.flags|=8192)):Gi(v),T=v.updateQueue,T!==null&&Ah(v,T.retryQueue),T=null,m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),O=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(O=v.memoizedState.cachePool.pool),O!==T&&(v.flags|=2048),m!==null&&S(Zl),null;case 24:return T=null,m!==null&&(T=m.memoizedState.cache),v.memoizedState.cache!==T&&(v.flags|=2048),Il(Ei),Gi(v),null;case 25:return null}throw Error(a(156,v.tag))}function Px(m,v){switch(ie(v),v.tag){case 1:return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 3:return Il(Ei),ue(),m=v.flags,(m&65536)!==0&&(m&128)===0?(v.flags=m&-65537|128,v):null;case 26:case 27:case 5:return ae(v),null;case 13:if(ot(v),m=v.memoizedState,m!==null&&m.dehydrated!==null){if(v.alternate===null)throw Error(a(340));me()}return m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 19:return S(Ta),null;case 4:return ue(),null;case 10:return Il(v.type),null;case 22:case 23:return ot(v),rt(),m!==null&&S(Zl),m=v.flags,m&65536?(v.flags=m&-65537|128,v):null;case 24:return Il(Ei),null;case 25:return null;default:return null}}function Dv(m,v){switch(ie(v),v.tag){case 3:Il(Ei),ue();break;case 26:case 27:case 5:ae(v);break;case 4:ue();break;case 13:ot(v);break;case 19:S(Ta);break;case 10:Il(v.type);break;case 22:case 23:ot(v),rt(),m!==null&&S(Zl);break;case 24:Il(Ei)}}function Rh(m,v){try{var T=v.updateQueue,O=T!==null?T.lastEffect:null;if(O!==null){var F=O.next;T=F;do{if((T.tag&m)===m){O=void 0;var q=T.create,de=T.inst;O=q(),de.destroy=O}T=T.next}while(T!==F)}}catch(Ee){Zn(v,v.return,Ee)}}function Mc(m,v,T){try{var O=v.updateQueue,F=O!==null?O.lastEffect:null;if(F!==null){var q=F.next;O=q;do{if((O.tag&m)===m){var de=O.inst,Ee=de.destroy;if(Ee!==void 0){de.destroy=void 0,F=v;var Fe=T;try{Ee()}catch(gt){Zn(F,Fe,gt)}}}O=O.next}while(O!==q)}}catch(gt){Zn(v,v.return,gt)}}function Dx(m){var v=m.updateQueue;if(v!==null){var T=m.stateNode;try{pt(v,T)}catch(O){Zn(m,m.return,O)}}}function Lx(m,v,T){T.props=So(m.type,m.memoizedProps),T.state=m.memoizedState;try{T.componentWillUnmount()}catch(O){Zn(m,v,O)}}function Ou(m,v){try{var T=m.ref;if(T!==null){var O=m.stateNode;switch(m.tag){case 26:case 27:case 5:var F=qd(O);break;default:F=O}typeof T=="function"?m.refCleanup=T(F):T.current=F}}catch(q){Zn(m,v,q)}}function Wi(m,v){var T=m.ref,O=m.refCleanup;if(T!==null)if(typeof O=="function")try{O()}catch(F){Zn(m,v,F)}finally{m.refCleanup=null,m=m.alternate,m!=null&&(m.refCleanup=null)}else if(typeof T=="function")try{T(null)}catch(F){Zn(m,v,F)}else T.current=null}function Bd(m){var v=m.type,T=m.memoizedProps,O=m.stateNode;try{r4(O,v,T,m)}catch(F){Zn(m,m.return,F)}}function Lv(m,v,T){try{iy(m.stateNode,m.type,T,v,m)}catch(O){Zn(m,m.return,O)}}function Ov(m){return m.tag===5||m.tag===3||(Tr?m.tag===26:!1)||(as?m.tag===27:!1)||m.tag===4}function Im(m){e:for(;;){for(;m.sibling===null;){if(m.return===null||Ov(m.return))return null;m=m.return}for(m.sibling.return=m.return,m=m.sibling;m.tag!==5&&m.tag!==6&&(!as||m.tag!==27)&&m.tag!==18;){if(m.flags&2||m.child===null||m.tag===4)continue e;m.child.return=m,m=m.child}if(!(m.flags&2))return m.stateNode}}function zm(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?sy(T,m,v):$x(T,m);else if(!(O===4||as&&O===27)&&(m=m.child,m!==null))for(zm(m,v,T),m=m.sibling;m!==null;)zm(m,v,T),m=m.sibling}function Ud(m,v,T){var O=m.tag;if(O===5||O===6)m=m.stateNode,v?ay(T,m,v):ny(T,m);else if(!(O===4||as&&O===27)&&(m=m.child,m!==null))for(Ud(m,v,T),m=m.sibling;m!==null;)Ud(m,v,T),m=m.sibling}function Ox(m,v,T){m=m.containerInfo;try{cy(m,T)}catch(O){Zn(v,v.return,O)}}function jd(m,v){for(jc(m.containerInfo),ua=v;ua!==null;)if(m=ua,v=m.child,(m.subtreeFlags&1028)!==0&&v!==null)v.return=m,ua=v;else for(;ua!==null;){m=ua;var T=m.alternate;switch(v=m.flags,m.tag){case 0:break;case 11:case 15:break;case 1:if((v&1024)!==0&&T!==null){v=void 0;var O=m,F=T.memoizedProps;T=T.memoizedState;var q=O.stateNode;try{var de=So(O.type,F,O.elementType===O.type);v=q.getSnapshotBeforeUpdate(de,T),q.__reactInternalSnapshotBeforeUpdate=v}catch(Ee){Zn(O,O.return,Ee)}}break;case 3:(v&1024)!==0&&is&&n0(m.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((v&1024)!==0)throw Error(a(163))}if(v=m.sibling,v!==null){v.return=m.return,ua=v;break}ua=m.return}return de=qu,qu=!1,de}function Bm(m,v,T){var O=T.flags;switch(T.tag){case 0:case 11:case 15:qo(m,T),O&4&&Rh(5,T);break;case 1:if(qo(m,T),O&4)if(m=T.stateNode,v===null)try{m.componentDidMount()}catch(Ee){Zn(T,T.return,Ee)}else{var F=So(T.type,v.memoizedProps);v=v.memoizedState;try{m.componentDidUpdate(F,v,m.__reactInternalSnapshotBeforeUpdate)}catch(Ee){Zn(T,T.return,Ee)}}O&64&&Dx(T),O&512&&Ou(T,T.return);break;case 3:if(qo(m,T),O&64&&(O=T.updateQueue,O!==null)){if(m=null,T.child!==null)switch(T.child.tag){case 27:case 5:m=qd(T.child.stateNode);break;case 1:m=T.child.stateNode}try{pt(O,m)}catch(Ee){Zn(T,T.return,Ee)}}break;case 26:if(Tr){qo(m,T),O&512&&Ou(T,T.return);break}case 27:case 5:qo(m,T),v===null&&O&4&&Bd(T),O&512&&Ou(T,T.return);break;case 12:qo(m,T);break;case 13:qo(m,T),O&4&&Tc(m,T);break;case 22:if(F=T.memoizedState!==null||Da,!F){v=v!==null&&v.memoizedState!==null||Qi;var q=Da,de=Qi;Da=F,(Qi=v)&&!de?Ac(m,T,(T.subtreeFlags&8772)!==0):qo(m,T),Da=q,Qi=de}O&512&&(T.memoizedProps.mode==="manual"?Ou(T,T.return):Wi(T,T.return));break;default:qo(m,T)}}function Fd(m){var v=m.alternate;v!==null&&(m.alternate=null,Fd(v)),m.child=null,m.deletions=null,m.sibling=null,m.tag===5&&(v=m.stateNode,v!==null&&ey(v)),m.stateNode=null,m.return=null,m.dependencies=null,m.memoizedProps=null,m.memoizedState=null,m.pendingProps=null,m.stateNode=null,m.updateQueue=null}function Sr(m,v,T){for(T=T.child;T!==null;)Um(m,v,T),T=T.sibling}function Um(m,v,T){if(qs&&typeof qs.onCommitFiberUnmount=="function")try{qs.onCommitFiberUnmount(ef,T)}catch{}switch(T.tag){case 26:if(Tr){Qi||Wi(T,v),Sr(m,v,T),T.memoizedState?gy(T.memoizedState):T.stateNode&&by(T.stateNode);break}case 27:if(as){Qi||Wi(T,v);var O=va,F=Qs;va=T.stateNode,Sr(m,v,T),l2(T.stateNode),va=O,Qs=F;break}case 5:Qi||Wi(T,v);case 6:if(is){if(O=va,F=Qs,va=null,Sr(m,v,T),va=O,Qs=F,va!==null)if(Qs)try{pa(va,T.stateNode)}catch(q){Zn(T,v,q)}else try{Ds(va,T.stateNode)}catch(q){Zn(T,v,q)}}else Sr(m,v,T);break;case 18:is&&va!==null&&(Qs?hy(va,T.stateNode):i2(va,T.stateNode));break;case 4:is?(O=va,F=Qs,va=T.stateNode.containerInfo,Qs=!0,Sr(m,v,T),va=O,Qs=F):(Er&&Ox(T.stateNode,T,i0()),Sr(m,v,T));break;case 0:case 11:case 14:case 15:Qi||Mc(2,T,v),Qi||Mc(4,T,v),Sr(m,v,T);break;case 1:Qi||(Wi(T,v),O=T.stateNode,typeof O.componentWillUnmount=="function"&&Lx(T,v,O)),Sr(m,v,T);break;case 21:Sr(m,v,T);break;case 22:Qi||Wi(T,v),Qi=(O=Qi)||T.memoizedState!==null,Sr(m,v,T),Qi=O;break;default:Sr(m,v,T)}}function Tc(m,v){if(Ps&&v.memoizedState===null&&(m=v.alternate,m!==null&&(m=m.memoizedState,m!==null&&(m=m.dehydrated,m!==null))))try{o0(m)}catch(T){Zn(v,v.return,T)}}function Vd(m){switch(m.tag){case 13:case 19:var v=m.stateNode;return v===null&&(v=m.stateNode=new of),v;case 22:return m=m.stateNode,v=m._retryCache,v===null&&(v=m._retryCache=new of),v;default:throw Error(a(435,m.tag))}}function Nh(m,v){var T=Vd(m);v.forEach(function(O){var F=jv.bind(null,m,O);T.has(O)||(T.add(O),O.then(F,F))})}function As(m,v){var T=v.deletions;if(T!==null)for(var O=0;O<T.length;O++){var F=T[O],q=m,de=v;if(is){var Ee=de;e:for(;Ee!==null;){switch(Ee.tag){case 27:case 5:va=Ee.stateNode,Qs=!1;break e;case 3:va=Ee.stateNode.containerInfo,Qs=!0;break e;case 4:va=Ee.stateNode.containerInfo,Qs=!0;break e}Ee=Ee.return}if(va===null)throw Error(a(160));Um(q,de,F),va=null,Qs=!1}else Um(q,de,F);q=F.alternate,q!==null&&(q.return=null),F.return=null}if(v.subtreeFlags&13878)for(v=v.child;v!==null;)Cc(v,m),v=v.sibling}function Cc(m,v){var T=m.alternate,O=m.flags;switch(m.tag){case 0:case 11:case 14:case 15:As(v,m),$s(m),O&4&&(Mc(3,m,m.return),Rh(3,m),Mc(5,m,m.return));break;case 1:As(v,m),$s(m),O&512&&(Qi||T===null||Wi(T,T.return)),O&64&&Da&&(m=m.updateQueue,m!==null&&(O=m.callbacks,O!==null&&(T=m.shared.hiddenCallbacks,m.shared.hiddenCallbacks=T===null?O:T.concat(O))));break;case 26:if(Tr){var F=Ls;As(v,m),$s(m),O&512&&(Qi||T===null||Wi(T,T.return)),O&4&&(O=T!==null?T.memoizedState:null,v=m.memoizedState,T===null?v===null?m.stateNode===null?m.stateNode=vy(F,m.type,m.memoizedProps,m):yy(F,m.type,m.stateNode):m.stateNode=my(F,v,m.memoizedProps):O!==v?(O===null?T.stateNode!==null&&by(T.stateNode):gy(O),v===null?yy(F,m.type,m.stateNode):my(F,v,m.memoizedProps)):v===null&&m.stateNode!==null&&Lv(m,m.memoizedProps,T.memoizedProps));break}case 27:if(as&&O&4&&m.alternate===null){F=m.stateNode;var q=m.memoizedProps;try{u4(F),d4(m.type,q,F,m)}catch(It){Zn(m,m.return,It)}}case 5:if(As(v,m),$s(m),O&512&&(Qi||T===null||Wi(T,T.return)),is){if(m.flags&32){v=m.stateNode;try{Hh(v)}catch(It){Zn(m,m.return,It)}}O&4&&m.stateNode!=null&&(v=m.memoizedProps,Lv(m,v,T!==null?T.memoizedProps:v)),O&1024&&(Xc=!0)}break;case 6:if(As(v,m),$s(m),O&4&&is){if(m.stateNode===null)throw Error(a(162));O=m.memoizedProps,T=T!==null?T.memoizedProps:O,v=m.stateNode;try{Gx(v,T,O)}catch(It){Zn(m,m.return,It)}}break;case 3:if(Tr?(xy(),F=Ls,Ls=l0(v.containerInfo),As(v,m),Ls=F):As(v,m),$s(m),O&4){if(is&&Ps&&T!==null&&T.memoizedState.isDehydrated)try{r0(v.containerInfo)}catch(It){Zn(m,m.return,It)}if(Er){O=v.containerInfo,T=v.pendingChildren;try{cy(O,T)}catch(It){Zn(m,m.return,It)}}}Xc&&(Xc=!1,Iv(m));break;case 4:Tr?(T=Ls,Ls=l0(m.stateNode.containerInfo),As(v,m),$s(m),Ls=T):(As(v,m),$s(m)),O&4&&Er&&Ox(m.stateNode,m,m.stateNode.pendingChildren);break;case 12:As(v,m),$s(m);break;case 13:As(v,m),$s(m),m.child.flags&8192&&m.memoizedState!==null!=(T!==null&&T.memoizedState!==null)&&(cl=ss()),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Nh(m,O)));break;case 22:O&512&&(Qi||T===null||Wi(T,T.return)),F=m.memoizedState!==null;var de=T!==null&&T.memoizedState!==null,Ee=Da,Fe=Qi;if(Da=Ee||F,Qi=Fe||de,As(v,m),Qi=Fe,Da=Ee,$s(m),v=m.stateNode,v._current=m,v._visibility&=-3,v._visibility|=v._pendingVisibility&2,O&8192&&(v._visibility=F?v._visibility&-2:v._visibility|1,F&&(v=Da||Qi,T===null||de||v||kd(m)),is&&(m.memoizedProps===null||m.memoizedProps.mode!=="manual"))){e:if(T=null,is)for(v=m;;){if(v.tag===5||Tr&&v.tag===26||as&&v.tag===27){if(T===null){de=T=v;try{q=de.stateNode,F?$h(q):ry(de.stateNode,de.memoizedProps)}catch(It){Zn(de,de.return,It)}}}else if(v.tag===6){if(T===null){de=v;try{var gt=de.stateNode;F?t0(gt):Wl(gt,de.memoizedProps)}catch(It){Zn(de,de.return,It)}}}else if((v.tag!==22&&v.tag!==23||v.memoizedState===null||v===m)&&v.child!==null){v.child.return=v,v=v.child;continue}if(v===m)break e;for(;v.sibling===null;){if(v.return===null||v.return===m)break e;T===v&&(T=null),v=v.return}T===v&&(T=null),v.sibling.return=v.return,v=v.sibling}}O&4&&(O=m.updateQueue,O!==null&&(T=O.retryQueue,T!==null&&(O.retryQueue=null,Nh(m,T))));break;case 19:As(v,m),$s(m),O&4&&(O=m.updateQueue,O!==null&&(m.updateQueue=null,Nh(m,O)));break;case 21:break;default:As(v,m),$s(m)}}function $s(m){var v=m.flags;if(v&2){try{if(is&&(!as||m.tag!==27)){e:{for(var T=m.return;T!==null;){if(Ov(T)){var O=T;break e}T=T.return}throw Error(a(160))}switch(O.tag){case 27:if(as){var F=O.stateNode,q=Im(m);Ud(m,q,F);break}case 5:var de=O.stateNode;O.flags&32&&(Hh(de),O.flags&=-33);var Ee=Im(m);Ud(m,Ee,de);break;case 3:case 4:var Fe=O.stateNode.containerInfo,gt=Im(m);zm(m,gt,Fe);break;default:throw Error(a(161))}}}catch(It){Zn(m,m.return,It)}m.flags&=-3}v&4096&&(m.flags&=-4097)}function Iv(m){if(m.subtreeFlags&1024)for(m=m.child;m!==null;){var v=m;Iv(v),v.tag===5&&v.flags&1024&&Pi(v.stateNode),m=m.sibling}}function qo(m,v){if(v.subtreeFlags&8772)for(v=v.child;v!==null;)Bm(m,v.alternate,v),v=v.sibling}function kd(m){for(m=m.child;m!==null;){var v=m;switch(v.tag){case 0:case 11:case 14:case 15:Mc(4,v,v.return),kd(v);break;case 1:Wi(v,v.return);var T=v.stateNode;typeof T.componentWillUnmount=="function"&&Lx(v,v.return,T),kd(v);break;case 26:case 27:case 5:Wi(v,v.return),kd(v);break;case 22:Wi(v,v.return),v.memoizedState===null&&kd(v);break;default:kd(v)}m=m.sibling}}function Ac(m,v,T){for(T=T&&(v.subtreeFlags&8772)!==0,v=v.child;v!==null;){var O=v.alternate,F=m,q=v,de=q.flags;switch(q.tag){case 0:case 11:case 15:Ac(F,q,T),Rh(4,q);break;case 1:if(Ac(F,q,T),O=q,F=O.stateNode,typeof F.componentDidMount=="function")try{F.componentDidMount()}catch(gt){Zn(O,O.return,gt)}if(O=q,F=O.updateQueue,F!==null){var Ee=O.stateNode;try{var Fe=F.shared.hiddenCallbacks;if(Fe!==null)for(F.shared.hiddenCallbacks=null,F=0;F<Fe.length;F++)Te(Fe[F],Ee)}catch(gt){Zn(O,O.return,gt)}}T&&de&64&&Dx(q),Ou(q,q.return);break;case 26:case 27:case 5:Ac(F,q,T),T&&O===null&&de&4&&Bd(q),Ou(q,q.return);break;case 12:Ac(F,q,T);break;case 13:Ac(F,q,T),T&&de&4&&Tc(F,q);break;case 22:q.memoizedState===null&&Ac(F,q,T),Ou(q,q.return);break;default:Ac(F,q,T)}v=v.sibling}}function zv(m,v){var T=null;m!==null&&m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(T=m.memoizedState.cachePool.pool),m=null,v.memoizedState!==null&&v.memoizedState.cachePool!==null&&(m=v.memoizedState.cachePool.pool),m!==T&&(m!=null&&m.refCount++,T!=null&&Ld(T))}function jm(m,v){m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Ld(m))}function zl(m,v,T,O){if(v.subtreeFlags&10256)for(v=v.child;v!==null;)Fm(m,v,T,O),v=v.sibling}function Fm(m,v,T,O){var F=v.flags;switch(v.tag){case 0:case 11:case 15:zl(m,v,T,O),F&2048&&Rh(9,v);break;case 3:zl(m,v,T,O),F&2048&&(m=null,v.alternate!==null&&(m=v.alternate.memoizedState.cache),v=v.memoizedState.cache,v!==m&&(v.refCount++,m!=null&&Ld(m)));break;case 12:if(F&2048){zl(m,v,T,O),m=v.stateNode;try{var q=v.memoizedProps,de=q.id,Ee=q.onPostCommit;typeof Ee=="function"&&Ee(de,v.alternate===null?"mount":"update",m.passiveEffectDuration,-0)}catch(Fe){Zn(v,v.return,Fe)}}else zl(m,v,T,O);break;case 23:break;case 22:q=v.stateNode,v.memoizedState!==null?q._visibility&4?zl(m,v,T,O):Rc(m,v):q._visibility&4?zl(m,v,T,O):(q._visibility|=4,ms(m,v,T,O,(v.subtreeFlags&10256)!==0)),F&2048&&zv(v.alternate,v);break;case 24:zl(m,v,T,O),F&2048&&jm(v.alternate,v);break;default:zl(m,v,T,O)}}function ms(m,v,T,O,F){for(F=F&&(v.subtreeFlags&10256)!==0,v=v.child;v!==null;){var q=m,de=v,Ee=T,Fe=O,gt=de.flags;switch(de.tag){case 0:case 11:case 15:ms(q,de,Ee,Fe,F),Rh(8,de);break;case 23:break;case 22:var It=de.stateNode;de.memoizedState!==null?It._visibility&4?ms(q,de,Ee,Fe,F):Rc(q,de):(It._visibility|=4,ms(q,de,Ee,Fe,F)),F&&gt&2048&&zv(de.alternate,de);break;case 24:ms(q,de,Ee,Fe,F),F&&gt&2048&&jm(de.alternate,de);break;default:ms(q,de,Ee,Fe,F)}v=v.sibling}}function Rc(m,v){if(v.subtreeFlags&10256)for(v=v.child;v!==null;){var T=m,O=v,F=O.flags;switch(O.tag){case 22:Rc(T,O),F&2048&&zv(O.alternate,O);break;case 24:Rc(T,O),F&2048&&jm(O.alternate,O);break;default:Rc(T,O)}v=v.sibling}}function Va(m){if(m.subtreeFlags&Yu)for(m=m.child;m!==null;)Iu(m),m=m.sibling}function Iu(m){switch(m.tag){case 26:Va(m),m.flags&Yu&&(m.memoizedState!==null?Sy(Ls,m.memoizedState,m.memoizedProps):sa(m.type,m.memoizedProps));break;case 5:Va(m),m.flags&Yu&&sa(m.type,m.memoizedProps);break;case 3:case 4:if(Tr){var v=Ls;Ls=l0(m.stateNode.containerInfo),Va(m),Ls=v}else Va(m);break;case 22:m.memoizedState===null&&(v=m.alternate,v!==null&&v.memoizedState!==null?(v=Yu,Yu=16777216,Va(m),Yu=v):Va(m));break;default:Va(m)}}function Vm(m){var v=m.alternate;if(v!==null&&(m=v.child,m!==null)){v.child=null;do v=m.sibling,m.sibling=null,m=v;while(m!==null)}}function Nc(m){var v=m.deletions;if((m.flags&16)!==0){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];ua=O,Pc(O,m)}Vm(m)}if(m.subtreeFlags&10256)for(m=m.child;m!==null;)Ph(m),m=m.sibling}function Ph(m){switch(m.tag){case 0:case 11:case 15:Nc(m),m.flags&2048&&Mc(9,m,m.return);break;case 3:Nc(m);break;case 12:Nc(m);break;case 22:var v=m.stateNode;m.memoizedState!==null&&v._visibility&4&&(m.return===null||m.return.tag!==13)?(v._visibility&=-5,Hd(m)):Nc(m);break;default:Nc(m)}}function Hd(m){var v=m.deletions;if((m.flags&16)!==0){if(v!==null)for(var T=0;T<v.length;T++){var O=v[T];ua=O,Pc(O,m)}Vm(m)}for(m=m.child;m!==null;){switch(v=m,v.tag){case 0:case 11:case 15:Mc(8,v,v.return),Hd(v);break;case 22:T=v.stateNode,T._visibility&4&&(T._visibility&=-5,Hd(v));break;default:Hd(v)}m=m.sibling}}function Pc(m,v){for(;ua!==null;){var T=ua;switch(T.tag){case 0:case 11:case 15:Mc(8,T,v);break;case 23:case 22:if(T.memoizedState!==null&&T.memoizedState.cachePool!==null){var O=T.memoizedState.cachePool.pool;O!=null&&O.refCount++}break;case 24:Ld(T.memoizedState.cache)}if(O=T.child,O!==null)O.return=T,ua=O;else e:for(T=m;ua!==null;){O=ua;var F=O.sibling,q=O.return;if(Fd(O),O===T){ua=null;break e}if(F!==null){F.return=q,ua=F;break e}ua=q}}}function km(m){var v=Qv(m);if(v!=null){if(typeof v.memoizedProps["data-testname"]!="string")throw Error(a(364));return v}if(m=$u(m),m===null)throw Error(a(362));return m.stateNode.current}function $d(m,v){var T=m.tag;switch(v.$$typeof){case sp:if(m.type===v.value)return!0;break;case b0:e:{for(v=v.value,m=[m,0],T=0;T<m.length;){var O=m[T++],F=O.tag,q=m[T++],de=v[q];if(F!==5&&F!==26&&F!==27||!al(O)){for(;de!=null&&$d(O,de);)q++,de=v[q];if(q===v.length){v=!0;break e}else for(O=O.child;O!==null;)m.push(O,q),O=O.sibling}}v=!1}return v;case x0:if((T===5||T===26||T===27)&&s4(m.stateNode,v.value))return!0;break;case Mi:if((T===5||T===6||T===26||T===27)&&(m=kh(m),m!==null&&0<=m.indexOf(v.value)))return!0;break;case ri:if((T===5||T===26||T===27)&&(m=m.memoizedProps["data-testname"],typeof m=="string"&&m.toLowerCase()===v.value.toLowerCase()))return!0;break;default:throw Error(a(365))}return!1}function Dc(m){switch(m.$$typeof){case sp:return"<"+(r(m.value)||"Unknown")+">";case b0:return":has("+(Dc(m)||"")+")";case x0:return'[role="'+m.value+'"]';case Mi:return'"'+m.value+'"';case ri:return'[data-testname="'+m.value+'"]';default:throw Error(a(365))}}function Ix(m,v){var T=[];m=[m,0];for(var O=0;O<m.length;){var F=m[O++],q=F.tag,de=m[O++],Ee=v[de];if(q!==5&&q!==26&&q!==27||!al(F)){for(;Ee!=null&&$d(F,Ee);)de++,Ee=v[de];if(de===v.length)T.push(F);else for(F=F.child;F!==null;)m.push(F,de),F=F.sibling}}return T}function Rs(m,v){if(!il)throw Error(a(363));m=km(m),m=Ix(m,v),v=[],m=Array.from(m);for(var T=0;T<m.length;){var O=m[T++],F=O.tag;if(F===5||F===26||F===27)al(O)||v.push(O.stateNode);else for(O=O.child;O!==null;)m.push(O),O=O.sibling}return v}function Ns(){if((pn&2)!==0&&kn!==0)return kn&-kn;if(yn.T!==null){var m=Ys;return m!==0?m:Ie()}return Yr()}function Yo(){Js===0&&(Js=(kn&536870912)===0||di?B():536870912);var m=Lr.current;return m!==null&&(m.flags|=32),Js}function gs(m,v,T){(m===Wn&&Di===2||m.cancelPendingCommit!==null)&&(Eo(m,0),wo(m,kn,Js,!1)),U(m,T),((pn&2)===0||m!==Wn)&&(m===Wn&&((pn&2)===0&&(Po|=T),oi===4&&wo(m,kn,Js,!1)),Ae(m))}function Dh(m,v,T){if((pn&6)!==0)throw Error(a(327));var O=!T&&(v&60)===0&&(v&m.expiredLanes)===0||R(m,v),F=O?Jo(m,v):Zo(m,v,!0),q=O;do{if(F===0){Or&&!O&&wo(m,v,0,!1);break}else if(F===6)wo(m,v,0,!Ti);else{if(T=m.current.alternate,q&&!zx(T)){F=Zo(m,v,!1),q=!1;continue}if(F===2){if(q=v,m.errorRecoveryDisabledLanes&q)var de=0;else de=m.pendingLanes&-536870913,de=de!==0?de:de&536870912?536870912:0;if(de!==0){v=de;e:{var Ee=m;F=lf;var Fe=Ps&&Ee.current.memoizedState.isDehydrated;if(Fe&&(Eo(Ee,de).flags|=256),de=Zo(Ee,de,!1),de!==2){if(Ql&&!Fe){Ee.errorRecoveryDisabledLanes|=q,Po|=q,F=4;break e}q=zr,zr=F,q!==null&&Bl(q)}F=de}if(q=!1,F!==2)continue}}if(F===1){Eo(m,0),wo(m,v,0,!0);break}e:{switch(O=m,F){case 0:case 1:throw Error(a(345));case 4:if((v&4194176)===v){wo(O,v,Js,!Ti);break e}break;case 2:zr=null;break;case 3:case 5:break;default:throw Error(a(329))}if(O.finishedWork=T,O.finishedLanes=v,(v&62914560)===v&&(q=cl+300-ss(),10<q)){if(wo(O,v,Js,!Ti),N(O,0)!==0)break e;O.timeoutHandle=Zv(Hm.bind(null,O,T,zr,Do,cf,v,Js,Po,Jl,Ti,2,-0,0),q);break e}Hm(O,T,zr,Do,cf,v,Js,Po,Jl,Ti,0,-0,0)}}break}while(!0);Ae(m)}function Bl(m){zr===null?zr=m:zr.push.apply(zr,m)}function Hm(m,v,T,O,F,q,de,Ee,Fe,gt,It,$t,Kt){var Cn=v.subtreeFlags;if((Cn&8192||(Cn&16785408)===16785408)&&(Mr(),Iu(v),v=Qm(),v!==null)){m.cancelPendingCommit=v(ji.bind(null,m,T,O,F,de,Ee,Fe,1,$t,Kt)),wo(m,q,de,!gt);return}ji(m,T,O,F,de,Ee,Fe,It,$t,Kt)}function zx(m){for(var v=m;;){var T=v.tag;if((T===0||T===11||T===15)&&v.flags&16384&&(T=v.updateQueue,T!==null&&(T=T.stores,T!==null)))for(var O=0;O<T.length;O++){var F=T[O],q=F.getSnapshot;F=F.value;try{if(!Cr(q(),F))return!1}catch{return!1}}if(T=v.child,v.subtreeFlags&16384&&T!==null)T.return=v,v=T;else{if(v===m)break;for(;v.sibling===null;){if(v.return===null||v.return===m)return!0;v=v.return}v.sibling.return=v.return,v=v.sibling}}return!0}function wo(m,v,T,O){v&=~Ss,v&=~Po,m.suspendedLanes|=v,m.pingedLanes&=~v,O&&(m.warmLanes|=v),O=m.expirationTimes;for(var F=v;0<F;){var q=31-Xs(F),de=1<<q;O[q]=-1,F&=~de}T!==0&&G(m,T,v)}function Bv(){return(pn&6)===0?(et(0),!1):!0}function Gs(){if(Rn!==null){if(Di===0)var m=Rn.return;else m=Rn,ca=Kc=null,le(m),rl=null,Jr=0,m=Rn;for(;m!==null;)Dv(m.alternate,m),m=m.return;Rn=null}}function Eo(m,v){m.finishedWork=null,m.finishedLanes=0;var T=m.timeoutHandle;T!==Hu&&(m.timeoutHandle=Hu,Vh(T)),T=m.cancelPendingCommit,T!==null&&(m.cancelPendingCommit=null,T()),Gs(),Wn=m,Rn=T=vs(m.current,null),kn=v,Di=0,ya=null,Ti=!1,Or=R(m,v),Ql=!1,Jl=Js=Ss=Po=Ir=oi=0,zr=lf=null,cf=!1,(v&8)!==0&&(v|=v&32);var O=m.entangledLanes;if(O!==0)for(m=m.entanglements,O&=v;0<O;){var F=31-Xs(O),q=1<<F;v|=m[F],O&=~q}return No=v,be(),T}function zu(m,v){Bn=null,yn.H=fi,v===Ni?(v=Nt(),Di=3):v===Ty?(v=Nt(),Di=4):Di=v===m2?8:v!==null&&typeof v=="object"&&typeof v.then=="function"?6:1,ya=v,Rn===null&&(oi=1,Am(m,J(v,m.current)))}function Lh(){var m=Lr.current;return m===null?!0:(kn&4194176)===kn?eo===null:(kn&62914560)===kn||(kn&536870912)!==0?m===eo:!1}function Gd(){var m=yn.H;return yn.H=fi,m===null?fi:m}function wr(){var m=yn.A;return yn.A=y0,m}function Ws(){oi=4,Ti||(kn&4194176)!==kn&&Lr.current!==null||(Or=!0),(Ir&134217727)===0&&(Po&134217727)===0||Wn===null||wo(Wn,kn,Js,!1)}function Zo(m,v,T){var O=pn;pn|=2;var F=Gd(),q=wr();(Wn!==m||kn!==v)&&(Do=null,Eo(m,v)),v=!1;var de=oi;e:do try{if(Di!==0&&Rn!==null){var Ee=Rn,Fe=ya;switch(Di){case 8:Gs(),de=6;break e;case 3:case 2:case 6:Lr.current===null&&(v=!0);var gt=Di;if(Di=0,ya=null,Lc(m,Ee,Fe,gt),T&&Or){de=0;break e}break;default:gt=Di,Di=0,ya=null,Lc(m,Ee,Fe,gt)}}Qo(),de=oi;break}catch(It){zu(m,It)}while(!0);return v&&m.shellSuspendCounter++,ca=Kc=null,pn=O,yn.H=F,yn.A=q,Rn===null&&(Wn=null,kn=0,be()),de}function Qo(){for(;Rn!==null;)Uv(Rn)}function Jo(m,v){var T=pn;pn|=2;var O=Gd(),F=wr();Wn!==m||kn!==v?(Do=null,Ji=ss()+500,Eo(m,v)):Or=R(m,v);e:do try{if(Di!==0&&Rn!==null){v=Rn;var q=ya;t:switch(Di){case 1:Di=0,ya=null,Lc(m,v,q,1);break;case 2:if(St(q)){Di=0,ya=null,$m(v);break}v=function(){Di===2&&Wn===m&&(Di=7),Ae(m)},q.then(v,v);break e;case 3:Di=7;break e;case 4:Di=5;break e;case 7:St(q)?(Di=0,ya=null,$m(v)):(Di=0,ya=null,Lc(m,v,q,7));break;case 5:var de=null;switch(Rn.tag){case 26:de=Rn.memoizedState;case 5:case 27:var Ee=Rn,Fe=Ee.type,gt=Ee.pendingProps;if(de?_y(de):Gl(Fe,gt)){Di=0,ya=null;var It=Ee.sibling;if(It!==null)Rn=It;else{var $t=Ee.return;$t!==null?(Rn=$t,Oh($t)):Rn=null}break t}}Di=0,ya=null,Lc(m,v,q,5);break;case 6:Di=0,ya=null,Lc(m,v,q,6);break;case 8:Gs(),oi=6;break e;default:throw Error(a(462))}}Ul();break}catch(Kt){zu(m,Kt)}while(!0);return ca=Kc=null,yn.H=O,yn.A=F,pn=T,Rn!==null?0:(Wn=null,kn=0,be(),oi)}function Ul(){for(;Rn!==null&&!u2();)Uv(Rn)}function Uv(m){var v=Ax(m.alternate,m,No);m.memoizedProps=m.pendingProps,v===null?Oh(m):Rn=v}function $m(m){var v=m,T=v.alternate;switch(v.tag){case 15:case 0:v=wx(T,v,v.pendingProps,v.type,void 0,kn);break;case 11:v=wx(T,v,v.pendingProps,v.type.render,v.ref,kn);break;case 5:le(v);default:Dv(T,v),v=Rn=Vl(v,No),v=Ax(T,v,No)}m.memoizedProps=m.pendingProps,v===null?Oh(m):Rn=v}function Lc(m,v,T,O){ca=Kc=null,le(v),rl=null,Jr=0;var F=v.return;try{if(yx(m,F,v,T,kn)){oi=1,Am(m,J(T,m.current)),Rn=null;return}}catch(q){if(F!==null)throw Rn=F,q;oi=1,Am(m,J(T,m.current)),Rn=null;return}v.flags&32768?(di||O===1?m=!0:Or||(kn&536870912)!==0?m=!1:(Ti=m=!0,(O===2||O===3||O===6)&&(O=Lr.current,O!==null&&O.tag===13&&(O.flags|=16384))),ka(v,m)):Oh(v)}function Oh(m){var v=m;do{if((v.flags&32768)!==0){ka(v,Ti);return}m=v.return;var T=Nx(v.alternate,v,No);if(T!==null){Rn=T;return}if(v=v.sibling,v!==null){Rn=v;return}Rn=v=m}while(v!==null);oi===0&&(oi=5)}function ka(m,v){do{var T=Px(m.alternate,m);if(T!==null){T.flags&=32767,Rn=T;return}if(T=m.return,T!==null&&(T.flags|=32768,T.subtreeFlags=0,T.deletions=null),!v&&(m=m.sibling,m!==null)){Rn=m;return}Rn=m=T}while(m!==null);oi=6,Rn=null}function ji(m,v,T,O,F,q,de,Ee,Fe,gt){var It=yn.T,$t=Pa();try{ys(2),yn.T=null,ni(m,v,T,O,$t,F,q,de,Ee,Fe,gt)}finally{yn.T=It,ys($t)}}function ni(m,v,T,O,F,q,de,Ee){do Ha();while(ec!==null);if((pn&6)!==0)throw Error(a(327));var Fe=m.finishedWork;if(O=m.finishedLanes,Fe===null)return null;if(m.finishedWork=null,m.finishedLanes=0,Fe===m.current)throw Error(a(177));m.callbackNode=null,m.callbackPriority=0,m.cancelPendingCommit=null;var gt=Fe.lanes|Fe.childLanes;if(gt|=nf,$(m,O,gt,q,de,Ee),m===Wn&&(Rn=Wn=null,kn=0),(Fe.subtreeFlags&10256)===0&&(Fe.flags&10256)===0||no||(no=!0,_0=gt,Qu=T,Ih(u0,function(){return Ha(),null})),T=(Fe.flags&15990)!==0,(Fe.subtreeFlags&15990)!==0||T?(T=yn.T,yn.T=null,q=Pa(),ys(2),de=pn,pn|=4,jd(m,Fe),Cc(Fe,m),qv(m.containerInfo),m.current=Fe,Bm(m,Fe.alternate,Fe),d2(),pn=de,ys(q),yn.T=T):m.current=Fe,no?(no=!1,ec=m,Zu=O):jl(m,gt),gt=m.pendingLanes,gt===0&&(Br=null),V(Fe.stateNode),Ae(m),v!==null)for(F=m.onRecoverableError,Fe=0;Fe<v.length;Fe++)gt=v[Fe],F(gt.value,{componentStack:gt.stack});return(Zu&3)!==0&&Ha(),gt=m.pendingLanes,(O&4194218)!==0&&(gt&42)!==0?m===Os?Ju++:(Ju=0,Os=m):Ju=0,et(0),null}function jl(m,v){(m.pooledCacheLanes&=v)===0&&(v=m.pooledCache,v!=null&&(m.pooledCache=null,Ld(v)))}function Ha(){if(ec!==null){var m=ec,v=_0;_0=0;var T=X(Zu),O=32>T?32:T;T=yn.T;var F=Pa();try{if(ys(O),yn.T=null,ec===null)var q=!1;else{O=Qu,Qu=null;var de=ec,Ee=Zu;if(ec=null,Zu=0,(pn&6)!==0)throw Error(a(331));var Fe=pn;if(pn|=4,Ph(de.current),Fm(de,de.current,Ee,O),pn=Fe,et(0,!1),qs&&typeof qs.onPostCommitFiberRoot=="function")try{qs.onPostCommitFiberRoot(ef,de)}catch{}q=!0}return q}finally{ys(F),yn.T=T,jl(m,v)}}return!1}function Gm(m,v,T){v=J(T,v),v=wh(m.stateNode,v,2),m=Je(m,v,2),m!==null&&(U(m,2),Ae(m))}function Zn(m,v,T){if(m.tag===3)Gm(m,m,T);else for(;v!==null;){if(v.tag===3){Gm(v,m,T);break}else if(v.tag===1){var O=v.stateNode;if(typeof v.type.getDerivedStateFromError=="function"||typeof O.componentDidCatch=="function"&&(Br===null||!Br.has(O))){m=J(T,m),T=Dd(2),O=Je(v,T,2),O!==null&&(Eh(T,O,v,m),U(O,2),Ae(O));break}}v=v.return}}function Wm(m,v,T){var O=m.pingCache;if(O===null){O=m.pingCache=new Qn;var F=new Set;O.set(v,F)}else F=O.get(v),F===void 0&&(F=new Set,O.set(v,F));F.has(T)||(Ql=!0,F.add(T),m=Bx.bind(null,m,v,T),v.then(m,m))}function Bx(m,v,T){var O=m.pingCache;O!==null&&O.delete(v),m.pingedLanes|=m.suspendedLanes&T,m.warmLanes&=~T,Wn===m&&(kn&T)===T&&(oi===4||oi===3&&(kn&62914560)===kn&&300>ss()-cl?(pn&2)===0&&Eo(m,0):Ss|=T,Jl===kn&&(Jl=0)),Ae(m)}function Bu(m,v){v===0&&(v=z()),m=ve(m,v),m!==null&&(U(m,v),Ae(m))}function Uu(m){var v=m.memoizedState,T=0;v!==null&&(T=v.retryLane),Bu(m,T)}function jv(m,v){var T=0;switch(m.tag){case 13:var O=m.stateNode,F=m.memoizedState;F!==null&&(T=F.retryLane);break;case 19:O=m.stateNode;break;case 22:O=m.stateNode._retryCache;break;default:throw Error(a(314))}O!==null&&O.delete(v),Bu(m,T)}function Ih(m,v){return Jd(m,v)}function Fv(m,v,T,O){this.tag=m,this.key=T,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=v,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=O,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Fl(m){return m=m.prototype,!(!m||!m.isReactComponent)}function vs(m,v){var T=m.alternate;return T===null?(T=n(m.tag,v,m.key,m.mode),T.elementType=m.elementType,T.type=m.type,T.stateNode=m.stateNode,T.alternate=m,m.alternate=T):(T.pendingProps=v,T.type=m.type,T.flags=0,T.subtreeFlags=0,T.deletions=null),T.flags=m.flags&31457280,T.childLanes=m.childLanes,T.lanes=m.lanes,T.child=m.child,T.memoizedProps=m.memoizedProps,T.memoizedState=m.memoizedState,T.updateQueue=m.updateQueue,v=m.dependencies,T.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext},T.sibling=m.sibling,T.index=m.index,T.ref=m.ref,T.refCleanup=m.refCleanup,T}function Vl(m,v){m.flags&=31457282;var T=m.alternate;return T===null?(m.childLanes=0,m.lanes=v,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=T.childLanes,m.lanes=T.lanes,m.child=T.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=T.memoizedProps,m.memoizedState=T.memoizedState,m.updateQueue=T.updateQueue,m.type=T.type,v=T.dependencies,m.dependencies=v===null?null:{lanes:v.lanes,firstContext:v.firstContext}),m}function qr(m,v,T,O,F,q){var de=0;if(O=m,typeof m=="function")Fl(m)&&(de=1);else if(typeof m=="string")de=Tr&&as?py(m,T,Ga.current)?26:Zd(m)?27:5:Tr?py(m,T,Ga.current)?26:5:as&&Zd(m)?27:5;else e:switch(m){case Kd:return kl(T.children,F,q,v);case Gv:de=8,F|=24;break;case Wv:return m=n(12,T,v,F|2),m.elementType=Wv,m.lanes=q,m;case Xm:return m=n(13,T,v,F),m.elementType=Xm,m.lanes=q,m;case zc:return m=n(19,T,v,F),m.elementType=zc,m.lanes=q,m;case Uh:return Km(T,F,q,v);default:if(typeof m=="object"&&m!==null)switch(m.$$typeof){case Fx:case el:de=10;break e;case Ic:de=9;break e;case Xd:de=11;break e;case Bh:de=14;break e;case To:de=16,O=null;break e}de=29,T=Error(a(130,m===null?"null":typeof m,"")),O=null}return v=n(de,T,v,F),v.elementType=m,v.type=O,v.lanes=q,v}function kl(m,v,T,O){return m=n(7,m,O,v),m.lanes=T,m}function Km(m,v,T,O){m=n(22,m,O,v),m.elementType=Uh,m.lanes=T;var F={_visibility:1,_pendingVisibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null,_current:null,detach:function(){var q=F._current;if(q===null)throw Error(a(456));if((F._pendingVisibility&2)===0){var de=ve(q,2);de!==null&&(F._pendingVisibility|=2,gs(de,q,2))}},attach:function(){var q=F._current;if(q===null)throw Error(a(456));if((F._pendingVisibility&2)!==0){var de=ve(q,2);de!==null&&(F._pendingVisibility&=-3,gs(de,q,2))}}};return m.stateNode=F,m}function Oc(m,v,T){return m=n(6,m,null,v),m.lanes=T,m}function Wd(m,v,T){return v=n(4,m.children!==null?m.children:[],m.key,v),v.lanes=T,v.stateNode={containerInfo:m.containerInfo,pendingChildren:null,implementation:m.implementation},v}function ju(m,v,T,O,F,q,de,Ee){this.tag=1,this.containerInfo=m,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=Hu,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=I(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.finishedLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=I(0),this.hiddenUpdates=I(null),this.identifierPrefix=O,this.onUncaughtError=F,this.onCaughtError=q,this.onRecoverableError=de,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Ee,this.incompleteTransitions=new Map}function $a(m,v,T,O,F,q,de,Ee,Fe,gt,It,$t){return m=new ju(m,v,T,de,Ee,Fe,gt,$t),v=1,q===!0&&(v|=24),q=n(3,null,null,v),m.current=q,q.stateNode=m,v=Dm(),v.refCount++,m.pooledCache=v,v.refCount++,q.memoizedState={element:O,isDehydrated:T,cache:v},mt(q),m}function zh(m){return m?(m=Gu,m):Gu}function Vv(m){var v=m._reactInternals;if(v===void 0)throw typeof m.render=="function"?Error(a(188)):(m=Object.keys(m).join(","),Error(a(268,m)));return m=g(v),m=m!==null?b(m):null,m===null?null:qd(m.stateNode)}function Ux(m,v,T,O,F,q){F=zh(F),O.context===null?O.context=F:O.pendingContext=F,O=Ye(v),O.payload={element:T},q=q===void 0?null:q,q!==null&&(O.callback=q),T=Je(m,O,v),T!==null&&(gs(T,m,v),jt(T,m,v))}function jx(m,v){if(m=m.memoizedState,m!==null&&m.dehydrated!==null){var T=m.retryLane;m.retryLane=T!==0&&T<v?T:v}}function kv(m,v){jx(m,v),(m=m.alternate)&&jx(m,v)}var hn={},Hv=om(),ns=_G(),Fu=Object.assign,$v=Symbol.for("react.element"),Hl=Symbol.for("react.transitional.element"),Mo=Symbol.for("react.portal"),Kd=Symbol.for("react.fragment"),Gv=Symbol.for("react.strict_mode"),Wv=Symbol.for("react.profiler"),Fx=Symbol.for("react.provider"),Ic=Symbol.for("react.consumer"),el=Symbol.for("react.context"),Xd=Symbol.for("react.forward_ref"),Xm=Symbol.for("react.suspense"),zc=Symbol.for("react.suspense_list"),Bh=Symbol.for("react.memo"),To=Symbol.for("react.lazy"),Uh=Symbol.for("react.offscreen"),Vx=Symbol.for("react.memo_cache_sentinel"),Kv=Symbol.iterator,Vu=Symbol.for("react.client.reference"),yn=Hv.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,qm,Xv,Bc=!1,Uc=Array.isArray,Ym=e.rendererVersion,jh=e.rendererPackageName,Fh=e.extraDevToolsConfig,qd=e.getPublicInstance,ku=e.getRootHostContext,kx=e.getChildHostContext,jc=e.prepareForCommit,qv=e.resetAfterCommit,Yv=e.createInstance,tl=e.appendInitialChild,$l=e.finalizeInitialChildren,Fc=e.shouldSetTextContent,Zm=e.createTextInstance,Zv=e.scheduleTimeout,Vh=e.cancelTimeout,Hu=e.noTimeout,nl=e.isPrimaryRenderer;e.warnsIfNotActing;var is=e.supportsMutation,Er=e.supportsPersistence,Ps=e.supportsHydration,Qv=e.getInstanceFromNode;e.beforeActiveInstanceBlur,e.afterActiveInstanceBlur;var Jv=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var ys=e.setCurrentUpdatePriority,Pa=e.getCurrentUpdatePriority,Yr=e.resolveUpdatePriority;e.resolveEventType,e.resolveEventTimeStamp;var Vc=e.shouldAttemptEagerTransition,ey=e.detachDeletedInstance;e.requestPostPaintCallback;var Hx=e.maySuspendCommit,Gl=e.preloadInstance,Mr=e.startSuspendingCommit,sa=e.suspendInstance,Qm=e.waitForCommitToBeReady,Ks=e.NotPendingTransition,_n=e.HostTransitionContext,Pi=e.resetFormInstance;e.bindToConsole;var Ma=e.supportsMicrotasks,Jm=e.scheduleMicrotask,il=e.supportsTestSelectors,$u=e.findFiberRoot,e0=e.getBoundingRect,kh=e.getTextContent,al=e.isHiddenSubtree,s4=e.matchAccessibilityRole,ra=e.setFocusIfFocusable,ty=e.setupIntersectionObserver,ny=e.appendChild,$x=e.appendChildToContainer,Gx=e.commitTextUpdate,r4=e.commitMount,iy=e.commitUpdate,ay=e.insertBefore,sy=e.insertInContainerBefore,Ds=e.removeChild,pa=e.removeChildFromContainer,Hh=e.resetTextContent,$h=e.hideInstance,t0=e.hideTextInstance,ry=e.unhideInstance,Wl=e.unhideTextInstance,n0=e.clearContainer,oy=e.cloneInstance,i0=e.createContainerChildSet,ly=e.appendChildToContainerChildSet,Wx=e.finalizeContainerChildren,cy=e.replaceContainerChildren,uy=e.cloneHiddenInstance,dy=e.cloneHiddenTextInstance,a0=e.isSuspenseInstancePending,Gh=e.isSuspenseInstanceFallback,Kx=e.getSuspenseInstanceFallbackErrorDetails,o4=e.registerSuspenseInstanceRetry,Xx=e.canHydrateFormStateMarker,qx=e.isFormStateMarkerMatching,fy=e.getNextHydratableSibling,s0=e.getFirstHydratableChild,Yx=e.getFirstHydratableChildWithinContainer,Zx=e.getFirstHydratableChildWithinSuspenseInstance,Qx=e.canHydrateInstance,Jx=e.canHydrateTextInstance,e2=e.canHydrateSuspenseInstance,l4=e.hydrateInstance,t2=e.hydrateTextInstance,Yd=e.hydrateSuspenseInstance,n2=e.getNextHydratableInstanceAfterSuspenseInstance,r0=e.commitHydratedContainer,o0=e.commitHydratedSuspenseInstance,i2=e.clearSuspenseBoundary,hy=e.clearSuspenseBoundaryFromContainer,a2=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var s2=e.validateHydratableInstance,r2=e.validateHydratableTextInstance,Tr=e.supportsResources,py=e.isHostHoistableType,l0=e.getHoistableRoot,c0=e.getResource,my=e.acquireResource,gy=e.releaseResource,vy=e.hydrateHoistable,yy=e.mountHoistable,by=e.unmountHoistable,c4=e.createHoistableInstance,xy=e.prepareToCommitHoistables,o2=e.mayResourceSuspendCommit,_y=e.preloadResource,Sy=e.suspendResource,as=e.supportsSingletons,wy=e.resolveSingletonInstance,u4=e.clearSingleton,d4=e.acquireSingletonInstance,l2=e.releaseSingletonInstance,Zd=e.isHostSingletonType,Wh=[],Kl=-1,Gu={},Xs=Math.clz32?Math.clz32:C,Kh=Math.log,c2=Math.LN2,Qd=128,Xh=4194304,Jd=ns.unstable_scheduleCallback,qh=ns.unstable_cancelCallback,u2=ns.unstable_shouldYield,d2=ns.unstable_requestPaint,ss=ns.unstable_now,Ey=ns.unstable_ImmediatePriority,f2=ns.unstable_UserBlockingPriority,u0=ns.unstable_NormalPriority,d0=ns.unstable_IdlePriority,h2=ns.log,My=ns.unstable_setDisableYieldValue,ef=null,qs=null,Cr=typeof Object.is=="function"?Object.is:W,f0=new WeakMap,Ki=[],oa=0,Yh=null,Zh=0,Ar=[],Rr=0,Co=null,sl=1,Zr="",Ga=x(null),Qh=x(null),Ao=x(null),tf=x(null),bs=null,rs=null,di=!1,Nr=null,Qr=!1,Jh=Error(a(519)),Pr=[],kc=0,nf=0,af=null,Wu=null,ep=!1,tp=!1,Ro=!1,Hc=0,np=null,h0=0,Ys=0,$c=null,Xl=!1,sf=!1,ip=Object.prototype.hasOwnProperty,Ni=Error(a(460)),Ty=Error(a(474)),p0={then:function(){}},Ku=null,rl=null,Jr=0,Gc=Se(!0),Cy=Se(!1),ol=x(null),Dr=x(0),Lr=x(null),eo=null,Ta=x(0),ll=0,Bn=null,yi=null,ma=null,to=!1,Xi=!1,ql=!1,ap=0,la=0,rf=null,p2=0,m0=function(){return{lastEffect:null,events:null,stores:null,memoCache:null}},fi={readContext:ts,use:ze,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt};fi.useCacheRefresh=vt,fi.useMemoCache=vt,fi.useHostTransitionStatus=vt,fi.useFormState=vt,fi.useActionState=vt,fi.useOptimistic=vt;var Ca={readContext:ts,use:ze,useCallback:function(m,v){return Re().memoizedState=[m,v===void 0?null:v],m},useContext:ts,useEffect:mv,useImperativeHandle:function(m,v,T){T=T!=null?T.concat([m]):null,Sm(4194308,4,yh.bind(null,v,m),T)},useLayoutEffect:function(m,v){return Sm(4194308,4,m,v)},useInsertionEffect:function(m,v){Sm(4,2,m,v)},useMemo:function(m,v){var T=Re();v=v===void 0?null:v;var O=m();if(ql){H(!0);try{m()}finally{H(!1)}}return T.memoizedState=[O,v],O},useReducer:function(m,v,T){var O=Re();if(T!==void 0){var F=T(v);if(ql){H(!0);try{T(v)}finally{H(!1)}}}else F=v;return O.memoizedState=O.baseState=F,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:m,lastRenderedState:F},O.queue=m,m=m.dispatch=bc.bind(null,Bn,m),[O.memoizedState,m]},useRef:function(m){var v=Re();return m={current:m},v.memoizedState=m},useState:function(m){m=zn(m);var v=m.queue,T=Tm.bind(null,Bn,v);return v.dispatch=T,[m.memoizedState,T]},useDebugValue:bh,useDeferredValue:function(m,v){var T=Re();return yc(T,m,v)},useTransition:function(){var m=zn(!1);return m=Em.bind(null,Bn,m.queue,!0,!1),Re().memoizedState=m,[!1,m]},useSyncExternalStore:function(m,v,T){var O=Bn,F=Re();if(di){if(T===void 0)throw Error(a(407));T=T()}else{if(T=v(),Wn===null)throw Error(a(349));(kn&60)!==0||Jt(O,v,T)}F.memoizedState=T;var q={value:T,getSnapshot:v};return F.queue=q,mv(vn.bind(null,O,q,m),[m]),O.flags|=2048,Cs(9,xn.bind(null,O,q,T,v),{destroy:void 0},null),T},useId:function(){var m=Re(),v=Wn.identifierPrefix;if(di){var T=Zr,O=sl;T=(O&~(1<<32-Xs(O)-1)).toString(32)+T,v=":"+v+"R"+T,T=ap++,0<T&&(v+="H"+T.toString(32)),v+=":"}else T=p2++,v=":"+v+"r"+T.toString(32)+":";return m.memoizedState=v},useCacheRefresh:function(){return Re().memoizedState=xh.bind(null,Bn)}};Ca.useMemoCache=yt,Ca.useHostTransitionStatus=Ru,Ca.useFormState=Ja,Ca.useActionState=Ja,Ca.useOptimistic=function(m){var v=Re();v.memoizedState=v.baseState=m;var T={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return v.queue=T,v=Cm.bind(null,Bn,!0,T),T.dispatch=v,[m,v]};var xs={readContext:ts,use:ze,useCallback:wm,useContext:ts,useEffect:vh,useImperativeHandle:Ko,useInsertionEffect:gx,useLayoutEffect:vx,useMemo:Au,useReducer:Ht,useRef:Cu,useState:function(){return Ht(Pt)},useDebugValue:bh,useDeferredValue:function(m,v){var T=Be();return gv(T,yi.memoizedState,m,v)},useTransition:function(){var m=Ht(Pt)[0],v=Be().memoizedState;return[typeof m=="boolean"?m:ke(m),v]},useSyncExternalStore:qt,useId:Xo};xs.useCacheRefresh=Mm,xs.useMemoCache=yt,xs.useHostTransitionStatus=Ru,xs.useFormState=hs,xs.useActionState=hs,xs.useOptimistic=function(m,v){var T=Be();return tn(T,yi,m,v)};var Wc={readContext:ts,use:ze,useCallback:wm,useContext:ts,useEffect:vh,useImperativeHandle:Ko,useInsertionEffect:gx,useLayoutEffect:vx,useMemo:Au,useReducer:Tt,useRef:Cu,useState:function(){return Tt(Pt)},useDebugValue:bh,useDeferredValue:function(m,v){var T=Be();return yi===null?yc(T,m,v):gv(T,yi.memoizedState,m,v)},useTransition:function(){var m=Tt(Pt)[0],v=Be().memoizedState;return[typeof m=="boolean"?m:ke(m),v]},useSyncExternalStore:qt,useId:Xo};Wc.useCacheRefresh=Mm,Wc.useMemoCache=yt,Wc.useHostTransitionStatus=Ru,Wc.useFormState=Tu,Wc.useActionState=Tu,Wc.useOptimistic=function(m,v){var T=Be();return yi!==null?tn(T,yi,m,v):(T.baseState=m,[m,T.queue.dispatch])};var g0={isMounted:function(m){return(m=m._reactInternals)?d(m)===m:!1},enqueueSetState:function(m,v,T){m=m._reactInternals;var O=Ns(),F=Ye(O);F.payload=v,T!=null&&(F.callback=T),v=Je(m,F,O),v!==null&&(gs(v,m,O),jt(v,m,O))},enqueueReplaceState:function(m,v,T){m=m._reactInternals;var O=Ns(),F=Ye(O);F.tag=1,F.payload=v,T!=null&&(F.callback=T),v=Je(m,F,O),v!==null&&(gs(v,m,O),jt(v,m,O))},enqueueForceUpdate:function(m,v){m=m._reactInternals;var T=Ns(),O=Ye(T);O.tag=2,v!=null&&(O.callback=v),v=Je(m,O,T),v!==null&&(gs(v,m,T),jt(v,m,T))}},Ay=typeof reportError=="function"?reportError:function(m){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var v=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof m=="object"&&m!==null&&typeof m.message=="string"?String(m.message):String(m),error:m});if(!window.dispatchEvent(v))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",m);return}console.error(m)},m2=Error(a(461)),ga=!1,_s={dehydrated:null,treeContext:null,retryLane:0},Zs=x(null),Kc=null,ca=null,g2=typeof AbortController<"u"?AbortController:function(){var m=[],v=this.signal={aborted:!1,addEventListener:function(T,O){m.push(O)}};this.abort=function(){v.aborted=!0,m.forEach(function(T){return T()})}},Yl=ns.unstable_scheduleCallback,Xu=ns.unstable_NormalPriority,Ei={$$typeof:el,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},v0=yn.S;yn.S=function(m,v){typeof v=="object"&&v!==null&&typeof v.then=="function"&&Pe(m,v),v0!==null&&v0(m,v)};var Zl=x(null),Da=!1,Qi=!1,Xc=!1,of=typeof WeakSet=="function"?WeakSet:Set,ua=null,qu=!1,va=null,Qs=!1,Ls=null,Yu=8192,y0={getCacheForType:function(m){var v=ts(Ei),T=v.data.get(m);return T===void 0&&(T=m(),v.data.set(m,T)),T}},sp=0,b0=1,x0=2,ri=3,Mi=4;if(typeof Symbol=="function"&&Symbol.for){var Un=Symbol.for;sp=Un("selector.component"),b0=Un("selector.has_pseudo_class"),x0=Un("selector.role"),ri=Un("selector.test_id"),Mi=Un("selector.text")}var Qn=typeof WeakMap=="function"?WeakMap:Map,pn=0,Wn=null,Rn=null,kn=0,Di=0,ya=null,Ti=!1,Or=!1,Ql=!1,No=0,oi=0,Ir=0,Po=0,Ss=0,Js=0,Jl=0,lf=null,zr=null,cf=!1,cl=0,Ji=1/0,Do=null,Br=null,no=!1,ec=null,Zu=0,_0=0,Qu=null,Ju=0,Os=null;return hn.attemptContinuousHydration=function(m){if(m.tag===13){var v=ve(m,67108864);v!==null&&gs(v,m,67108864),kv(m,67108864)}},hn.attemptHydrationAtCurrentPriority=function(m){if(m.tag===13){var v=Ns(),T=ve(m,v);T!==null&&gs(T,m,v),kv(m,v)}},hn.attemptSynchronousHydration=function(m){switch(m.tag){case 3:if(m=m.stateNode,m.current.memoizedState.isDehydrated){var v=A(m.pendingLanes);if(v!==0){for(m.pendingLanes|=2,m.entangledLanes|=2;v;){var T=1<<31-Xs(v);m.entanglements[1]|=T,v&=~T}Ae(m),(pn&6)===0&&(Ji=ss()+500,et(0))}}break;case 13:v=ve(m,2),v!==null&&gs(v,m,2),Bv(),kv(m,2)}},hn.batchedUpdates=function(m,v){return m(v)},hn.createComponentSelector=function(m){return{$$typeof:sp,value:m}},hn.createContainer=function(m,v,T,O,F,q,de,Ee,Fe,gt){return $a(m,v,!1,null,T,O,q,de,Ee,Fe,gt,null)},hn.createHasPseudoClassSelector=function(m){return{$$typeof:b0,value:m}},hn.createHydrationContainer=function(m,v,T,O,F,q,de,Ee,Fe,gt,It,$t,Kt){return m=$a(T,O,!0,m,F,q,Ee,Fe,gt,It,$t,Kt),m.context=zh(null),T=m.current,O=Ns(),F=Ye(O),F.callback=v??null,Je(T,F,O),m.current.lanes=O,U(m,O),Ae(m),m},hn.createPortal=function(m,v,T){var O=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Mo,key:O==null?null:""+O,children:m,containerInfo:v,implementation:T}},hn.createRoleSelector=function(m){return{$$typeof:x0,value:m}},hn.createTestNameSelector=function(m){return{$$typeof:ri,value:m}},hn.createTextSelector=function(m){return{$$typeof:Mi,value:m}},hn.defaultOnCaughtError=function(m){console.error(m)},hn.defaultOnRecoverableError=function(m){Ay(m)},hn.defaultOnUncaughtError=function(m){Ay(m)},hn.deferredUpdates=function(m){var v=yn.T,T=Pa();try{return ys(32),yn.T=null,m()}finally{ys(T),yn.T=v}},hn.discreteUpdates=function(m,v,T,O,F){var q=yn.T,de=Pa();try{return ys(2),yn.T=null,m(v,T,O,F)}finally{ys(de),yn.T=q,pn===0&&(Ji=ss()+500)}},hn.findAllNodes=Rs,hn.findBoundingRects=function(m,v){if(!il)throw Error(a(363));v=Rs(m,v),m=[];for(var T=0;T<v.length;T++)m.push(e0(v[T]));for(v=m.length-1;0<v;v--){T=m[v];for(var O=T.x,F=O+T.width,q=T.y,de=q+T.height,Ee=v-1;0<=Ee;Ee--)if(v!==Ee){var Fe=m[Ee],gt=Fe.x,It=gt+Fe.width,$t=Fe.y,Kt=$t+Fe.height;if(O>=gt&&q>=$t&&F<=It&&de<=Kt){m.splice(v,1);break}else if(O!==gt||T.width!==Fe.width||Kt<q||$t>de){if(!(q!==$t||T.height!==Fe.height||It<O||gt>F)){gt>O&&(Fe.width+=gt-O,Fe.x=O),It<F&&(Fe.width=F-gt),m.splice(v,1);break}}else{$t>q&&(Fe.height+=$t-q,Fe.y=q),Kt<de&&(Fe.height=de-$t),m.splice(v,1);break}}}return m},hn.findHostInstance=Vv,hn.findHostInstanceWithNoPortals=function(m){return m=g(m),m=m!==null?w(m):null,m===null?null:qd(m.stateNode)},hn.findHostInstanceWithWarning=function(m){return Vv(m)},hn.flushPassiveEffects=Ha,hn.flushSyncFromReconciler=function(m){var v=pn;pn|=1;var T=yn.T,O=Pa();try{if(ys(2),yn.T=null,m)return m()}finally{ys(O),yn.T=T,pn=v,(pn&6)===0&&et(0)}},hn.flushSyncWork=Bv,hn.focusWithin=function(m,v){if(!il)throw Error(a(363));for(m=km(m),v=Ix(m,v),v=Array.from(v),m=0;m<v.length;){var T=v[m++],O=T.tag;if(!al(T)){if((O===5||O===26||O===27)&&ra(T.stateNode))return!0;for(T=T.child;T!==null;)v.push(T),T=T.sibling}}return!1},hn.getFindAllNodesFailureDescription=function(m,v){if(!il)throw Error(a(363));var T=0,O=[];m=[km(m),0];for(var F=0;F<m.length;){var q=m[F++],de=q.tag,Ee=m[F++],Fe=v[Ee];if((de!==5&&de!==26&&de!==27||!al(q))&&($d(q,Fe)&&(O.push(Dc(Fe)),Ee++,Ee>T&&(T=Ee)),Ee<v.length))for(q=q.child;q!==null;)m.push(q,Ee),q=q.sibling}if(T<v.length){for(m=[];T<v.length;T++)m.push(Dc(v[T]));return`findAllNodes was able to match part of the selector:
`+(O.join(" > ")+`
No matching component was found for:
`)+m.join(" > ")}return null},hn.getPublicRootInstance=function(m){if(m=m.current,!m.child)return null;switch(m.child.tag){case 27:case 5:return qd(m.child.stateNode);default:return m.child.stateNode}},hn.injectIntoDevTools=function(){var m={bundleType:0,version:Ym,rendererPackageName:jh,currentDispatcherRef:yn,findFiberByHostInstance:Qv,reconcilerVersion:"19.0.0"};if(Fh!==null&&(m.rendererConfig=Fh),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")m=!1;else{var v=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(v.isDisabled||!v.supportsFiber)m=!0;else{try{ef=v.inject(m),qs=v}catch{}m=!!v.checkDCE}}return m},hn.isAlreadyRendering=function(){return!1},hn.observeVisibleRects=function(m,v,T,O){if(!il)throw Error(a(363));m=Rs(m,v);var F=ty(m,T,O).disconnect;return{disconnect:function(){F()}}},hn.shouldError=function(){return null},hn.shouldSuspend=function(){return!1},hn.startHostTransition=function(m,v,T,O){if(m.tag!==5)throw Error(a(476));var F=vv(m).queue;Em(m,F,v,Ks,T===null?i:function(){var q=vv(m).next.queue;return xc(m,q,{},Ns()),T(O)})},hn.updateContainer=function(m,v,T,O){var F=v.current,q=Ns();return Ux(F,q,m,v,T,O),q},hn.updateContainerSync=function(m,v,T,O){return v.tag===0&&Ha(),Ux(v.current,2,m,v,T,O),2},hn},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(ZM)),ZM.exports}var b9;function Sxe(){return b9||(b9=1,YM.exports=_xe()),YM.exports}var wxe=Sxe();const Exe=Zg(wxe);var x9=_G();function j6(t,e,n){if(!t)return;if(n(t)===!0)return t;let i=e?t.return:t.child;for(;i;){const a=j6(i,e,n);if(a)return a;i=e?null:i.sibling}}function SG(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const F6=SG(P.createContext(null));class wG extends P.Component{render(){return P.createElement(F6.Provider,{value:this._reactInternals},this.props.children)}}function EG(){const t=P.useContext(F6);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=P.useId();return P.useMemo(()=>{for(const n of[t,t?.alternate]){if(!n)continue;const i=j6(n,!1,a=>{let s=a.memoizedState;for(;s;){if(s.memoizedState===e)return!0;s=s.next}});if(i)return i}},[t,e])}const Mxe=Symbol.for("react.context"),Txe=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===Mxe;function Cxe(){const t=EG(),[e]=P.useState(()=>new Map);e.clear();let n=t;for(;n;){const i=n.type;Txe(i)&&i!==F6&&!e.has(i)&&e.set(i,P.use(SG(i))),n=n.return}return e}function Axe(){const t=Cxe();return P.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>i=>P.createElement(e,null,P.createElement(n.Provider,{...i,value:t.get(n)})),e=>P.createElement(wG,{...e})),[t])}function MG(t){let e=t.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const TG=t=>t&&t.isOrthographicCamera,Rxe=t=>t&&t.hasOwnProperty("current"),Nxe=t=>t!=null&&(typeof t=="string"||typeof t=="number"||t.isColor),mx=((t,e)=>typeof window<"u"&&(((t=window.document)==null?void 0:t.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?P.useLayoutEffect:P.useEffect;function CG(t){const e=P.useRef(t);return mx(()=>void(e.current=t),[t]),e}function Pxe(){const t=EG(),e=Axe();return P.useMemo(()=>({children:n})=>{const a=!!j6(t,!0,s=>s.type===P.StrictMode)?P.StrictMode:P.Fragment;return _.jsx(a,{children:_.jsx(e,{children:n})})},[t,e])}function Dxe({set:t}){return mx(()=>(t(new Promise(()=>null)),()=>t(!1)),[t]),null}const Lxe=(t=>(t=class extends P.Component{constructor(...n){super(...n),this.state={error:!1}}componentDidCatch(n){this.props.set(n)}render(){return this.state.error?null:this.props.children}},t.getDerivedStateFromError=()=>({error:!0}),t))();function AG(t){var e;const n=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(t)?Math.min(Math.max(t[0],n),t[1]):t}function tg(t){var e;return(e=t.__r3f)==null?void 0:e.root.getState()}const ba={obj:t=>t===Object(t)&&!ba.arr(t)&&typeof t!="function",fun:t=>typeof t=="function",str:t=>typeof t=="string",num:t=>typeof t=="number",boo:t=>typeof t=="boolean",und:t=>t===void 0,nul:t=>t===null,arr:t=>Array.isArray(t),equ(t,e,{arrays:n="shallow",objects:i="reference",strict:a=!0}={}){if(typeof t!=typeof e||!!t!=!!e)return!1;if(ba.str(t)||ba.num(t)||ba.boo(t))return t===e;const s=ba.obj(t);if(s&&i==="reference")return t===e;const r=ba.arr(t);if(r&&n==="reference")return t===e;if((r||s)&&t===e)return!0;let o;for(o in t)if(!(o in e))return!1;if(s&&n==="shallow"&&i==="shallow"){for(o in a?e:t)if(!ba.equ(t[o],e[o],{strict:a,objects:"reference"}))return!1}else for(o in a?e:t)if(t[o]!==e[o])return!1;if(ba.und(o)){if(r&&t.length===0&&e.length===0||s&&Object.keys(t).length===0&&Object.keys(e).length===0)return!0;if(t!==e)return!1}return!0}};function Oxe(t){t.type!=="Scene"&&(t.dispose==null||t.dispose());for(const e in t){const n=t[e];n?.type!=="Scene"&&(n==null||n.dispose==null||n.dispose())}}const RG=["children","key","ref"];function Ixe(t){const e={};for(const n in t)RG.includes(n)||(e[n]=t[n]);return e}function W3(t,e,n,i){const a=t;let s=a?.__r3f;return s||(s={root:e,type:n,parent:null,children:[],props:Ixe(i),object:a,eventCount:0,handlers:{},isHidden:!1},a&&(a.__r3f=s)),s}function U1(t,e){let n=t[e];if(!e.includes("-"))return{root:t,key:e,target:n};n=t;for(const a of e.split("-")){var i;e=a,t=n,n=(i=n)==null?void 0:i[e]}return{root:t,key:e,target:n}}const _9=/-\d+$/;function K3(t,e){if(ba.str(e.props.attach)){if(_9.test(e.props.attach)){const a=e.props.attach.replace(_9,""),{root:s,key:r}=U1(t.object,a);Array.isArray(s[r])||(s[r]=[])}const{root:n,key:i}=U1(t.object,e.props.attach);e.previousAttach=n[i],n[i]=e.object}else ba.fun(e.props.attach)&&(e.previousAttach=e.props.attach(t.object,e.object))}function X3(t,e){if(ba.str(e.props.attach)){const{root:n,key:i}=U1(t.object,e.props.attach),a=e.previousAttach;a===void 0?delete n[i]:n[i]=a}else e.previousAttach==null||e.previousAttach(t.object,e.object);delete e.previousAttach}const $5=[...RG,"args","dispose","attach","object","onUpdate","dispose"],S9=new Map;function zxe(t){let e=S9.get(t.constructor);try{e||(e=new t.constructor,S9.set(t.constructor,e))}catch{}return e}function Bxe(t,e){const n={};for(const i in e)if(!$5.includes(i)&&!ba.equ(e[i],t.props[i])){n[i]=e[i];for(const a in e)a.startsWith(`${i}-`)&&(n[a]=e[a])}for(const i in t.props){if($5.includes(i)||e.hasOwnProperty(i))continue;const{root:a,key:s}=U1(t.object,i);if(a.constructor&&a.constructor.length===0){const r=zxe(a);ba.und(r)||(n[s]=r[s])}else n[s]=0}return n}const Uxe=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],jxe=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function Of(t,e){var n;const i=t.__r3f,a=i&&MG(i).getState(),s=i?.eventCount;for(const o in e){let c=e[o];if($5.includes(o))continue;if(i&&jxe.test(o)){typeof c=="function"?i.handlers[o]=c:delete i.handlers[o],i.eventCount=Object.keys(i.handlers).length;continue}if(c===void 0)continue;let{root:u,key:h,target:d}=U1(t,o);if(d instanceof Gg&&c instanceof Gg)d.mask=c.mask;else if(d instanceof Wt&&Nxe(c))d.set(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof d.copy=="function"&&c!=null&&c.constructor&&d.constructor===c.constructor)d.copy(c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&Array.isArray(c))typeof d.fromArray=="function"?d.fromArray(c):d.set(...c);else if(d!==null&&typeof d=="object"&&typeof d.set=="function"&&typeof c=="number")typeof d.setScalar=="function"?d.setScalar(c):d.set(c);else{var r;u[h]=c,a&&!a.linear&&Uxe.includes(h)&&(r=u[h])!=null&&r.isTexture&&u[h].format===fr&&u[h].type===Pl&&(u[h].colorSpace=rr)}}if(i!=null&&i.parent&&a!=null&&a.internal&&(n=i.object)!=null&&n.isObject3D&&s!==i.eventCount){const o=i.object,c=a.internal.interaction.indexOf(o);c>-1&&a.internal.interaction.splice(c,1),i.eventCount&&o.raycast!==null&&a.internal.interaction.push(o)}return i&&i.props.attach===void 0&&(i.object.isBufferGeometry?i.props.attach="geometry":i.object.isMaterial&&(i.props.attach="material")),i&&pv(i),t}function pv(t){var e;if(!t.parent)return;t.props.onUpdate==null||t.props.onUpdate(t.object);const n=(e=t.root)==null||e.getState==null?void 0:e.getState();n&&n.internal.frames===0&&n.invalidate()}function Fxe(t,e){t.manual||(TG(t)?(t.left=e.width/-2,t.right=e.width/2,t.top=e.height/2,t.bottom=e.height/-2):t.aspect=e.width/e.height,t.updateProjectionMatrix())}const co=t=>t?.isObject3D;function eS(t){return(t.eventObject||t.object).uuid+"/"+t.index+t.instanceId}function NG(t,e,n,i){const a=n.get(e);a&&(n.delete(e),n.size===0&&(t.delete(i),a.target.releasePointerCapture(i)))}function Vxe(t,e){const{internal:n}=t.getState();n.interaction=n.interaction.filter(i=>i!==e),n.initialHits=n.initialHits.filter(i=>i!==e),n.hovered.forEach((i,a)=>{(i.eventObject===e||i.object===e)&&n.hovered.delete(a)}),n.capturedMap.forEach((i,a)=>{NG(n.capturedMap,e,i,a)})}function kxe(t){function e(c){const{internal:u}=t.getState(),h=c.offsetX-u.initialClick[0],d=c.offsetY-u.initialClick[1];return Math.round(Math.sqrt(h*h+d*d))}function n(c){return c.filter(u=>["Move","Over","Enter","Out","Leave"].some(h=>{var d;return(d=u.__r3f)==null?void 0:d.handlers["onPointer"+h]}))}function i(c,u){const h=t.getState(),d=new Set,p=[],g=u?u(h.internal.interaction):h.internal.interaction;for(let S=0;S<g.length;S++){const M=tg(g[S]);M&&(M.raycaster.camera=void 0)}h.previousRoot||h.events.compute==null||h.events.compute(c,h);function b(S){const M=tg(S);if(!M||!M.events.enabled||M.raycaster.camera===null)return[];if(M.raycaster.camera===void 0){var C;M.events.compute==null||M.events.compute(c,M,(C=M.previousRoot)==null?void 0:C.getState()),M.raycaster.camera===void 0&&(M.raycaster.camera=null)}return M.raycaster.camera?M.raycaster.intersectObject(S,!0):[]}let w=g.flatMap(b).sort((S,M)=>{const C=tg(S.object),A=tg(M.object);return!C||!A?S.distance-M.distance:A.events.priority-C.events.priority||S.distance-M.distance}).filter(S=>{const M=eS(S);return d.has(M)?!1:(d.add(M),!0)});h.events.filter&&(w=h.events.filter(w,h));for(const S of w){let M=S.object;for(;M;){var x;(x=M.__r3f)!=null&&x.eventCount&&p.push({...S,eventObject:M}),M=M.parent}}if("pointerId"in c&&h.internal.capturedMap.has(c.pointerId))for(let S of h.internal.capturedMap.get(c.pointerId).values())d.has(eS(S.intersection))||p.push(S.intersection);return p}function a(c,u,h,d){if(c.length){const p={stopped:!1};for(const g of c){let b=tg(g.object);if(b||g.object.traverseAncestors(w=>{const x=tg(w);if(x)return b=x,!1}),b){const{raycaster:w,pointer:x,camera:S,internal:M}=b,C=new fe(x.x,x.y,0).unproject(S),A=z=>{var I,U;return(I=(U=M.capturedMap.get(z))==null?void 0:U.has(g.eventObject))!=null?I:!1},N=z=>{const I={intersection:g,target:u.target};M.capturedMap.has(z)?M.capturedMap.get(z).set(g.eventObject,I):M.capturedMap.set(z,new Map([[g.eventObject,I]])),u.target.setPointerCapture(z)},R=z=>{const I=M.capturedMap.get(z);I&&NG(M.capturedMap,g.eventObject,I,z)};let D={};for(let z in u){let I=u[z];typeof I!="function"&&(D[z]=I)}let B={...g,...D,pointer:x,intersections:c,stopped:p.stopped,delta:h,unprojectedPoint:C,ray:w.ray,camera:S,stopPropagation(){const z="pointerId"in u&&M.capturedMap.get(u.pointerId);if((!z||z.has(g.eventObject))&&(B.stopped=p.stopped=!0,M.hovered.size&&Array.from(M.hovered.values()).find(I=>I.eventObject===g.eventObject))){const I=c.slice(0,c.indexOf(g));s([...I,g])}},target:{hasPointerCapture:A,setPointerCapture:N,releasePointerCapture:R},currentTarget:{hasPointerCapture:A,setPointerCapture:N,releasePointerCapture:R},nativeEvent:u};if(d(B),p.stopped===!0)break}}}return c}function s(c){const{internal:u}=t.getState();for(const h of u.hovered.values())if(!c.length||!c.find(d=>d.object===h.object&&d.index===h.index&&d.instanceId===h.instanceId)){const p=h.eventObject.__r3f;if(u.hovered.delete(eS(h)),p!=null&&p.eventCount){const g=p.handlers,b={...h,intersections:c};g.onPointerOut==null||g.onPointerOut(b),g.onPointerLeave==null||g.onPointerLeave(b)}}}function r(c,u){for(let h=0;h<u.length;h++){const d=u[h].__r3f;d==null||d.handlers.onPointerMissed==null||d.handlers.onPointerMissed(c)}}function o(c){switch(c){case"onPointerLeave":case"onPointerCancel":return()=>s([]);case"onLostPointerCapture":return u=>{const{internal:h}=t.getState();"pointerId"in u&&h.capturedMap.has(u.pointerId)&&requestAnimationFrame(()=>{h.capturedMap.has(u.pointerId)&&(h.capturedMap.delete(u.pointerId),s([]))})}}return function(h){const{onPointerMissed:d,internal:p}=t.getState();p.lastEvent.current=h;const g=c==="onPointerMove",b=c==="onClick"||c==="onContextMenu"||c==="onDoubleClick",x=i(h,g?n:void 0),S=b?e(h):0;c==="onPointerDown"&&(p.initialClick=[h.offsetX,h.offsetY],p.initialHits=x.map(C=>C.eventObject)),b&&!x.length&&S<=2&&(r(h,p.interaction),d&&d(h)),g&&s(x);function M(C){const A=C.eventObject,N=A.__r3f;if(!(N!=null&&N.eventCount))return;const R=N.handlers;if(g){if(R.onPointerOver||R.onPointerEnter||R.onPointerOut||R.onPointerLeave){const D=eS(C),B=p.hovered.get(D);B?B.stopped&&C.stopPropagation():(p.hovered.set(D,C),R.onPointerOver==null||R.onPointerOver(C),R.onPointerEnter==null||R.onPointerEnter(C))}R.onPointerMove==null||R.onPointerMove(C)}else{const D=R[c];D?(!b||p.initialHits.includes(A))&&(r(h,p.interaction.filter(B=>!p.initialHits.includes(B))),D(C)):b&&p.initialHits.includes(A)&&r(h,p.interaction.filter(B=>!p.initialHits.includes(B)))}}a(x,h,S,M)}}return{handlePointer:o}}const w9=t=>!!(t!=null&&t.render),PG=P.createContext(null),Hxe=(t,e)=>{const n=bxe((o,c)=>{const u=new fe,h=new fe,d=new fe;function p(S=c().camera,M=h,C=c().size){const{width:A,height:N,top:R,left:D}=C,B=A/N;M.isVector3?d.copy(M):d.set(...M);const z=S.getWorldPosition(u).distanceTo(d);if(TG(S))return{width:A/S.zoom,height:N/S.zoom,top:R,left:D,factor:1,distance:z,aspect:B};{const I=S.fov*Math.PI/180,U=2*Math.tan(I/2)*z,$=U*(A/N);return{width:$,height:U,top:R,left:D,factor:A/$,distance:z,aspect:B}}}let g;const b=S=>o(M=>({performance:{...M.performance,current:S}})),w=new _t;return{set:o,get:c,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(S=1)=>t(c(),S),advance:(S,M)=>e(S,M,c()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new D6,pointer:w,mouse:w,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const S=c();g&&clearTimeout(g),S.performance.current!==S.performance.min&&b(S.performance.min),g=setTimeout(()=>b(c().performance.max),S.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:p},setEvents:S=>o(M=>({...M,events:{...M.events,...S}})),setSize:(S,M,C=0,A=0)=>{const N=c().camera,R={width:S,height:M,top:C,left:A};o(D=>({size:R,viewport:{...D.viewport,...p(N,h,R)}}))},setDpr:S=>o(M=>{const C=AG(S);return{viewport:{...M.viewport,dpr:C,initialDpr:M.viewport.initialDpr||C}}}),setFrameloop:(S="always")=>{const M=c().clock;M.stop(),M.elapsedTime=0,S!=="never"&&(M.start(),M.elapsedTime=0),o(()=>({frameloop:S}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:P.createRef(),active:!1,frames:0,priority:0,subscribe:(S,M,C)=>{const A=c().internal;return A.priority=A.priority+(M>0?1:0),A.subscribers.push({ref:S,priority:M,store:C}),A.subscribers=A.subscribers.sort((N,R)=>N.priority-R.priority),()=>{const N=c().internal;N!=null&&N.subscribers&&(N.priority=N.priority-(M>0?1:0),N.subscribers=N.subscribers.filter(R=>R.ref!==S))}}}}}),i=n.getState();let a=i.size,s=i.viewport.dpr,r=i.camera;return n.subscribe(()=>{const{camera:o,size:c,viewport:u,gl:h,set:d}=n.getState();if(c.width!==a.width||c.height!==a.height||u.dpr!==s){a=c,s=u.dpr,Fxe(o,c),u.dpr>0&&h.setPixelRatio(u.dpr);const p=typeof HTMLCanvasElement<"u"&&h.domElement instanceof HTMLCanvasElement;h.setSize(c.width,c.height,p)}o!==r&&(r=o,d(p=>({viewport:{...p.viewport,...p.viewport.getCurrentViewport(o)}})))}),n.subscribe(o=>t(o)),n};function DG(){const t=P.useContext(PG);if(!t)throw new Error("R3F: Hooks can only be used within the Canvas component!");return t}function zo(t=n=>n,e){return DG()(t,e)}function $xe(t,e=0){const n=DG(),i=n.getState().internal.subscribe,a=CG(t);return mx(()=>i(a,e,n),[e,i,n]),null}function Gxe(t){const e=Exe(t);return e.injectIntoDevTools({bundleType:0,rendererPackageName:"@react-three/fiber",version:P.version}),e}const LG=0,qg={},Wxe=/^three(?=[A-Z])/,i4=t=>`${t[0].toUpperCase()}${t.slice(1)}`;let Kxe=0;const Xxe=t=>typeof t=="function";function qxe(t){if(Xxe(t)){const e=`${Kxe++}`;return qg[e]=t,e}else Object.assign(qg,t)}function OG(t,e){const n=i4(t),i=qg[n];if(t!=="primitive"&&!i)throw new Error(`R3F: ${n} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(t==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function Yxe(t,e,n){var i;return t=i4(t)in qg?t:t.replace(Wxe,""),OG(t,e),t==="primitive"&&(i=e.object)!=null&&i.__r3f&&delete e.object.__r3f,W3(e.object,n,t,e)}function Zxe(t){if(!t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?X3(t.parent,t):co(t.object)&&(t.object.visible=!1),t.isHidden=!0,pv(t)}}function IG(t){if(t.isHidden){var e;t.props.attach&&(e=t.parent)!=null&&e.object?K3(t.parent,t):co(t.object)&&t.props.visible!==!1&&(t.object.visible=!0),t.isHidden=!1,pv(t)}}function V6(t,e,n){const i=e.root.getState();if(!(!t.parent&&t.object!==i.scene)){if(!e.object){var a,s;const r=qg[i4(e.type)];e.object=(a=e.props.object)!=null?a:new r(...(s=e.props.args)!=null?s:[]),e.object.__r3f=e}if(Of(e.object,e.props),e.props.attach)K3(t,e);else if(co(e.object)&&co(t.object)){const r=t.object.children.indexOf(n?.object);if(n&&r!==-1){const o=t.object.children.indexOf(e.object);if(o!==-1){t.object.children.splice(o,1);const c=o<r?r-1:r;t.object.children.splice(c,0,e.object)}else e.object.parent=t.object,t.object.children.splice(r,0,e.object),e.object.dispatchEvent({type:"added"}),t.object.dispatchEvent({type:"childadded",child:e.object})}else t.object.add(e.object)}for(const r of e.children)V6(e,r);pv(e)}}function eT(t,e){e&&(e.parent=t,t.children.push(e),V6(t,e))}function E9(t,e,n){if(!e||!n)return;e.parent=t;const i=t.children.indexOf(n);i!==-1?t.children.splice(i,0,e):t.children.push(e),V6(t,e,n)}function zG(t){if(typeof t.dispose=="function"){const e=()=>{try{t.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():x9.unstable_scheduleCallback(x9.unstable_IdlePriority,e)}}function G5(t,e,n){if(!e)return;e.parent=null;const i=t.children.indexOf(e);i!==-1&&t.children.splice(i,1),e.props.attach?X3(t,e):co(e.object)&&co(t.object)&&(t.object.remove(e.object),Vxe(MG(e),e.object));const a=e.props.dispose!==null&&n!==!1;for(let s=e.children.length-1;s>=0;s--){const r=e.children[s];G5(e,r,a)}e.children.length=0,delete e.object.__r3f,a&&e.type!=="primitive"&&e.object.type!=="Scene"&&zG(e.object),n===void 0&&pv(e)}function Qxe(t,e){for(const n of[t,t.alternate])if(n!==null)if(typeof n.ref=="function"){n.refCleanup==null||n.refCleanup();const i=n.ref(e);typeof i=="function"&&(n.refCleanup=i)}else n.ref&&(n.ref.current=e)}const SS=[];function Jxe(){for(const[n]of SS){const i=n.parent;if(i){n.props.attach?X3(i,n):co(n.object)&&co(i.object)&&i.object.remove(n.object);for(const a of n.children)a.props.attach?X3(n,a):co(a.object)&&co(n.object)&&n.object.remove(a.object)}n.isHidden&&IG(n),n.object.__r3f&&delete n.object.__r3f,n.type!=="primitive"&&zG(n.object)}for(const[n,i,a]of SS){n.props=i;const s=n.parent;if(s){var t,e;const r=qg[i4(n.type)];n.object=(t=n.props.object)!=null?t:new r(...(e=n.props.args)!=null?e:[]),n.object.__r3f=n,Qxe(a,n.object),Of(n.object,n.props),n.props.attach?K3(s,n):co(n.object)&&co(s.object)&&s.object.add(n.object);for(const o of n.children)o.props.attach?K3(n,o):co(o.object)&&co(n.object)&&n.object.add(o.object);pv(n)}}SS.length=0}const tT=()=>{},M9={};let tS=LG;const e2e=0,t2e=4,W5=Gxe({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:Yxe,removeChild:G5,appendChild:eT,appendInitialChild:eT,insertBefore:E9,appendChildToContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||eT(n,e)},removeChildFromContainer(t,e){const n=t.getState().scene.__r3f;!e||!n||G5(n,e)},insertInContainerBefore(t,e,n){const i=t.getState().scene.__r3f;!e||!n||!i||E9(i,e,n)},getRootHostContext:()=>M9,getChildHostContext:()=>M9,commitUpdate(t,e,n,i,a){var s,r,o;OG(e,i);let c=!1;if((t.type==="primitive"&&n.object!==i.object||((s=i.args)==null?void 0:s.length)!==((r=n.args)==null?void 0:r.length)||(o=i.args)!=null&&o.some((h,d)=>{var p;return h!==((p=n.args)==null?void 0:p[d])}))&&(c=!0),c)SS.push([t,{...i},a]);else{const h=Bxe(t,i);Object.keys(h).length&&(Object.assign(t.props,h),Of(t.object,h))}(a.sibling===null||(a.flags&t2e)===e2e)&&Jxe()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:t=>t?.object,prepareForCommit:()=>null,preparePortalMount:t=>W3(t.getState().scene,t,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:Zxe,unhideInstance:IG,createTextInstance:tT,hideTextInstance:tT,unhideTextInstance:tT,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,startSuspendingCommit(){},suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:P.createContext(null),setCurrentUpdatePriority(t){tS=t},getCurrentUpdatePriority(){return tS},resolveUpdatePriority(){var t;if(tS!==LG)return tS;switch(typeof window<"u"&&((t=window.event)==null?void 0:t.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return yS.DiscreteEventPriority;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return yS.ContinuousEventPriority;default:return yS.DefaultEventPriority}},resetFormInstance(){}}),sm=new Map,ng={objects:"shallow",strict:!1};function n2e(t,e){if(!e&&typeof HTMLCanvasElement<"u"&&t instanceof HTMLCanvasElement&&t.parentElement){const{width:n,height:i,top:a,left:s}=t.parentElement.getBoundingClientRect();return{width:n,height:i,top:a,left:s}}else if(!e&&typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas)return{width:t.width,height:t.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}function i2e(t){const e=sm.get(t),n=e?.fiber,i=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const a=typeof reportError=="function"?reportError:console.error,s=i||Hxe(q5,C9),r=n||W5.createContainer(s,yS.ConcurrentRoot,null,!1,null,"",a,a,a,null);e||sm.set(t,{fiber:r,store:s});let o,c,u=!1,h=null;return{async configure(d={}){let p;h=new Promise(K=>p=K);let{gl:g,size:b,scene:w,events:x,onCreated:S,shadows:M=!1,linear:C=!1,flat:A=!1,legacy:N=!1,orthographic:R=!1,frameloop:D="always",dpr:B=[1,2],performance:z,raycaster:I,camera:U,onPointerMissed:$}=d,G=s.getState(),k=G.gl;if(!G.gl){const K={canvas:t,powerPreference:"high-performance",antialias:!0,alpha:!0},ee=typeof g=="function"?await g(K):g;w9(ee)?k=ee:k=new xG({...K,...g}),G.set({gl:k})}let X=G.raycaster;X||G.set({raycaster:X=new z6});const{params:V,...H}=I||{};if(ba.equ(H,X,ng)||Of(X,{...H}),ba.equ(V,X.params,ng)||Of(X,{params:{...X.params,...V}}),!G.camera||G.camera===c&&!ba.equ(c,U,ng)){c=U;const K=U?.isCamera,ee=K?U:R?new px(0,0,0,0,.1,1e3):new Ms(75,0,.1,1e3);K||(ee.position.z=5,U&&(Of(ee,U),ee.manual||("aspect"in U||"left"in U||"right"in U||"bottom"in U||"top"in U)&&(ee.manual=!0,ee.updateProjectionMatrix())),!G.camera&&!(U!=null&&U.rotation)&&ee.lookAt(0,0,0)),G.set({camera:ee}),X.camera=ee}if(!G.scene){let K;w!=null&&w.isScene?(K=w,W3(K,s,"",{})):(K=new f6,W3(K,s,"",{}),w&&Of(K,w)),G.set({scene:K})}x&&!G.events.handlers&&G.set({events:x(s)});const W=n2e(t,b);if(ba.equ(W,G.size,ng)||G.setSize(W.width,W.height,W.top,W.left),B&&G.viewport.dpr!==AG(B)&&G.setDpr(B),G.frameloop!==D&&G.setFrameloop(D),G.onPointerMissed||G.set({onPointerMissed:$}),z&&!ba.equ(z,G.performance,ng)&&G.set(K=>({performance:{...K.performance,...z}})),!G.xr){var J;const K=(Z,ue)=>{const se=s.getState();se.frameloop!=="never"&&C9(Z,!0,se,ue)},ee=()=>{const Z=s.getState();Z.gl.xr.enabled=Z.gl.xr.isPresenting,Z.gl.xr.setAnimationLoop(Z.gl.xr.isPresenting?K:null),Z.gl.xr.isPresenting||q5(Z)},ie={connect(){const Z=s.getState().gl;Z.xr.addEventListener("sessionstart",ee),Z.xr.addEventListener("sessionend",ee)},disconnect(){const Z=s.getState().gl;Z.xr.removeEventListener("sessionstart",ee),Z.xr.removeEventListener("sessionend",ee)}};typeof((J=k.xr)==null?void 0:J.addEventListener)=="function"&&ie.connect(),G.set({xr:ie})}if(k.shadowMap){const K=k.shadowMap.enabled,ee=k.shadowMap.type;if(k.shadowMap.enabled=!!M,ba.boo(M))k.shadowMap.type=Ib;else if(ba.str(M)){var Y;const ie={basic:wH,percentage:Ew,soft:Ib,variance:rc};k.shadowMap.type=(Y=ie[M])!=null?Y:Ib}else ba.obj(M)&&Object.assign(k.shadowMap,M);(K!==k.shadowMap.enabled||ee!==k.shadowMap.type)&&(k.shadowMap.needsUpdate=!0)}return mi.enabled=!N,u||(k.outputColorSpace=C?eh:rr,k.toneMapping=A?mu:ZA),G.legacy!==N&&G.set(()=>({legacy:N})),G.linear!==C&&G.set(()=>({linear:C})),G.flat!==A&&G.set(()=>({flat:A})),g&&!ba.fun(g)&&!w9(g)&&!ba.equ(g,k,ng)&&Of(k,g),o=S,u=!0,p(),this},render(d){return!u&&!h&&this.configure(),h.then(()=>{W5.updateContainer(_.jsx(a2e,{store:s,children:d,onCreated:o,rootElement:t}),r,null,()=>{})}),s},unmount(){BG(t)}}}function a2e({store:t,children:e,onCreated:n,rootElement:i}){return mx(()=>{const a=t.getState();a.set(s=>({internal:{...s.internal,active:!0}})),n&&n(a),t.getState().events.connected||a.events.connect==null||a.events.connect(i)},[]),_.jsx(PG.Provider,{value:t,children:e})}function BG(t,e){const n=sm.get(t),i=n?.fiber;if(i){const a=n?.store.getState();a&&(a.internal.active=!1),W5.updateContainer(null,i,null,()=>{a&&setTimeout(()=>{try{var s,r,o,c;a.events.disconnect==null||a.events.disconnect(),(s=a.gl)==null||(r=s.renderLists)==null||r.dispose==null||r.dispose(),(o=a.gl)==null||o.forceContextLoss==null||o.forceContextLoss(),(c=a.gl)!=null&&c.xr&&a.xr.disconnect(),Oxe(a.scene),sm.delete(t)}catch{}},500)})}}const s2e=new Set,r2e=new Set,o2e=new Set;function nT(t,e){if(t.size)for(const{callback:n}of t.values())n(e)}function $b(t,e){switch(t){case"before":return nT(s2e,e);case"after":return nT(r2e,e);case"tail":return nT(o2e,e)}}let iT,aT;function K5(t,e,n){let i=e.clock.getDelta();e.frameloop==="never"&&typeof t=="number"&&(i=t-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=t),iT=e.internal.subscribers;for(let a=0;a<iT.length;a++)aT=iT[a],aT.ref.current(aT.store.getState(),i,n);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let q3=!1,X5=!1,sT,T9,ig;function UG(t){T9=requestAnimationFrame(UG),q3=!0,sT=0,$b("before",t),X5=!0;for(const n of sm.values()){var e;ig=n.store.getState(),ig.internal.active&&(ig.frameloop==="always"||ig.internal.frames>0)&&!((e=ig.gl.xr)!=null&&e.isPresenting)&&(sT+=K5(t,ig))}if(X5=!1,$b("after",t),sT===0)return $b("tail",t),q3=!1,cancelAnimationFrame(T9)}function q5(t,e=1){var n;if(!t)return sm.forEach(i=>q5(i.store.getState(),e));(n=t.gl.xr)!=null&&n.isPresenting||!t.internal.active||t.frameloop==="never"||(e>1?t.internal.frames=Math.min(60,t.internal.frames+e):X5?t.internal.frames=2:t.internal.frames=1,q3||(q3=!0,requestAnimationFrame(UG)))}function C9(t,e=!0,n,i){if(e&&$b("before",t),n)K5(t,n,i);else for(const a of sm.values())K5(t,a.store.getState());e&&$b("after",t)}const rT={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function l2e(t){const{handlePointer:e}=kxe(t);return{priority:1,enabled:!0,compute(n,i,a){i.pointer.set(n.offsetX/i.size.width*2-1,-(n.offsetY/i.size.height)*2+1),i.raycaster.setFromCamera(i.pointer,i.camera)},connected:void 0,handlers:Object.keys(rT).reduce((n,i)=>({...n,[i]:e(i)}),{}),update:()=>{var n;const{events:i,internal:a}=t.getState();(n=a.lastEvent)!=null&&n.current&&i.handlers&&i.handlers.onPointerMove(a.lastEvent.current)},connect:n=>{const{set:i,events:a}=t.getState();if(a.disconnect==null||a.disconnect(),i(s=>({events:{...s.events,connected:n}})),a.handlers)for(const s in a.handlers){const r=a.handlers[s],[o,c]=rT[s];n.addEventListener(o,r,{passive:c})}},disconnect:()=>{const{set:n,events:i}=t.getState();if(i.connected){if(i.handlers)for(const a in i.handlers){const s=i.handlers[a],[r]=rT[a];i.connected.removeEventListener(r,s)}n(a=>({events:{...a.events,connected:void 0}}))}}}}function A9(t,e){let n;return(...i)=>{window.clearTimeout(n),n=window.setTimeout(()=>t(...i),e)}}function c2e({debounce:t,scroll:e,polyfill:n,offsetSize:i}={debounce:0,scroll:!1,offsetSize:!1}){const a=n||(typeof window>"u"?class{}:window.ResizeObserver);if(!a)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[s,r]=P.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),o=P.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:s,orientationHandler:null}),c=t?typeof t=="number"?t:t.scroll:null,u=t?typeof t=="number"?t:t.resize:null,h=P.useRef(!1);P.useEffect(()=>(h.current=!0,()=>void(h.current=!1)));const[d,p,g]=P.useMemo(()=>{const S=()=>{if(!o.current.element)return;const{left:M,top:C,width:A,height:N,bottom:R,right:D,x:B,y:z}=o.current.element.getBoundingClientRect(),I={left:M,top:C,width:A,height:N,bottom:R,right:D,x:B,y:z};o.current.element instanceof HTMLElement&&i&&(I.height=o.current.element.offsetHeight,I.width=o.current.element.offsetWidth),Object.freeze(I),h.current&&!h2e(o.current.lastBounds,I)&&r(o.current.lastBounds=I)};return[S,u?A9(S,u):S,c?A9(S,c):S]},[r,i,c,u]);function b(){o.current.scrollContainers&&(o.current.scrollContainers.forEach(S=>S.removeEventListener("scroll",g,!0)),o.current.scrollContainers=null),o.current.resizeObserver&&(o.current.resizeObserver.disconnect(),o.current.resizeObserver=null),o.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",o.current.orientationHandler))}function w(){o.current.element&&(o.current.resizeObserver=new a(g),o.current.resizeObserver.observe(o.current.element),e&&o.current.scrollContainers&&o.current.scrollContainers.forEach(S=>S.addEventListener("scroll",g,{capture:!0,passive:!0})),o.current.orientationHandler=()=>{g()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",o.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",o.current.orientationHandler))}const x=S=>{!S||S===o.current.element||(b(),o.current.element=S,o.current.scrollContainers=jG(S),w())};return d2e(g,!!e),u2e(p),P.useEffect(()=>{b(),w()},[e,g,p]),P.useEffect(()=>b,[]),[x,s,d]}function u2e(t){P.useEffect(()=>{const e=t;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[t])}function d2e(t,e){P.useEffect(()=>{if(e){const n=t;return window.addEventListener("scroll",n,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",n,!0)}},[t,e])}function jG(t){const e=[];if(!t||t===document.body)return e;const{overflow:n,overflowX:i,overflowY:a}=window.getComputedStyle(t);return[n,i,a].some(s=>s==="auto"||s==="scroll")&&e.push(t),[...e,...jG(t.parentElement)]}const f2e=["x","y","top","bottom","left","right","width","height"],h2e=(t,e)=>f2e.every(n=>t[n]===e[n]);function p2e({ref:t,children:e,fallback:n,resize:i,style:a,gl:s,events:r=l2e,eventSource:o,eventPrefix:c,shadows:u,linear:h,flat:d,legacy:p,orthographic:g,frameloop:b,dpr:w,performance:x,raycaster:S,camera:M,scene:C,onPointerMissed:A,onCreated:N,...R}){P.useMemo(()=>qxe(uxe),[]);const D=Pxe(),[B,z]=c2e({scroll:!0,debounce:{scroll:50,resize:0},...i}),I=P.useRef(null),U=P.useRef(null);P.useImperativeHandle(t,()=>I.current);const $=CG(A),[G,k]=P.useState(!1),[X,V]=P.useState(!1);if(G)throw G;if(X)throw X;const H=P.useRef(null);mx(()=>{const J=I.current;if(z.width>0&&z.height>0&&J){H.current||(H.current=i2e(J));async function Y(){await H.current.configure({gl:s,scene:C,events:r,shadows:u,linear:h,flat:d,legacy:p,orthographic:g,frameloop:b,dpr:w,performance:x,raycaster:S,camera:M,size:z,onPointerMissed:(...K)=>$.current==null?void 0:$.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(o?Rxe(o)?o.current:o:U.current),c&&K.setEvents({compute:(ee,ie)=>{const Z=ee[c+"X"],ue=ee[c+"Y"];ie.pointer.set(Z/ie.size.width*2-1,-(ue/ie.size.height)*2+1),ie.raycaster.setFromCamera(ie.pointer,ie.camera)}}),N?.(K)}}),H.current.render(_.jsx(D,{children:_.jsx(Lxe,{set:V,children:_.jsx(P.Suspense,{fallback:_.jsx(Dxe,{set:k}),children:e??null})})}))}Y()}}),P.useEffect(()=>{const J=I.current;if(J)return()=>BG(J)},[]);const W=o?"none":"auto";return _.jsx("div",{ref:U,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:W,...a},...R,children:_.jsx("div",{ref:B,style:{width:"100%",height:"100%"},children:_.jsx("canvas",{ref:I,style:{display:"block"},children:n})})})}function m2e(t){return _.jsx(wG,{children:_.jsx(p2e,{...t})})}var g2e=Object.defineProperty,v2e=(t,e,n)=>e in t?g2e(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,dt=(t,e,n)=>(v2e(t,typeof e!="symbol"?e+"":e,n),n);let y2e=class extends Jn{constructor(e,n){super(),dt(this,"isTransformControls",!0),dt(this,"visible",!1),dt(this,"domElement"),dt(this,"raycaster",new z6),dt(this,"gizmo"),dt(this,"plane"),dt(this,"tempVector",new fe),dt(this,"tempVector2",new fe),dt(this,"tempQuaternion",new Li),dt(this,"unit",{X:new fe(1,0,0),Y:new fe(0,1,0),Z:new fe(0,0,1)}),dt(this,"pointStart",new fe),dt(this,"pointEnd",new fe),dt(this,"offset",new fe),dt(this,"rotationAxis",new fe),dt(this,"startNorm",new fe),dt(this,"endNorm",new fe),dt(this,"rotationAngle",0),dt(this,"cameraPosition",new fe),dt(this,"cameraQuaternion",new Li),dt(this,"cameraScale",new fe),dt(this,"parentPosition",new fe),dt(this,"parentQuaternion",new Li),dt(this,"parentQuaternionInv",new Li),dt(this,"parentScale",new fe),dt(this,"worldPositionStart",new fe),dt(this,"worldQuaternionStart",new Li),dt(this,"worldScaleStart",new fe),dt(this,"worldPosition",new fe),dt(this,"worldQuaternion",new Li),dt(this,"worldQuaternionInv",new Li),dt(this,"worldScale",new fe),dt(this,"eye",new fe),dt(this,"positionStart",new fe),dt(this,"quaternionStart",new Li),dt(this,"scaleStart",new fe),dt(this,"camera"),dt(this,"object"),dt(this,"enabled",!0),dt(this,"axis",null),dt(this,"mode","translate"),dt(this,"translationSnap",null),dt(this,"rotationSnap",null),dt(this,"scaleSnap",null),dt(this,"space","world"),dt(this,"size",1),dt(this,"dragging",!1),dt(this,"showX",!0),dt(this,"showY",!0),dt(this,"showZ",!0),dt(this,"changeEvent",{type:"change"}),dt(this,"mouseDownEvent",{type:"mouseDown",mode:this.mode}),dt(this,"mouseUpEvent",{type:"mouseUp",mode:this.mode}),dt(this,"objectChangeEvent",{type:"objectChange"}),dt(this,"intersectObjectWithRay",(a,s,r)=>{const o=s.intersectObject(a,!0);for(let c=0;c<o.length;c++)if(o[c].object.visible||r)return o[c];return!1}),dt(this,"attach",a=>(this.object=a,this.visible=!0,this)),dt(this,"detach",()=>(this.object=void 0,this.visible=!1,this.axis=null,this)),dt(this,"reset",()=>this.enabled?(this.dragging&&this.object!==void 0&&(this.object.position.copy(this.positionStart),this.object.quaternion.copy(this.quaternionStart),this.object.scale.copy(this.scaleStart),this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent),this.pointStart.copy(this.pointEnd)),this):this),dt(this,"updateMatrixWorld",()=>{this.object!==void 0&&(this.object.updateMatrixWorld(),this.object.parent===null?console.error("TransformControls: The attached 3D object must be a part of the scene graph."):this.object.parent.matrixWorld.decompose(this.parentPosition,this.parentQuaternion,this.parentScale),this.object.matrixWorld.decompose(this.worldPosition,this.worldQuaternion,this.worldScale),this.parentQuaternionInv.copy(this.parentQuaternion).invert(),this.worldQuaternionInv.copy(this.worldQuaternion).invert()),this.camera.updateMatrixWorld(),this.camera.matrixWorld.decompose(this.cameraPosition,this.cameraQuaternion,this.cameraScale),this.eye.copy(this.cameraPosition).sub(this.worldPosition).normalize(),super.updateMatrixWorld()}),dt(this,"pointerHover",a=>{if(this.object===void 0||this.dragging===!0)return;this.raycaster.setFromCamera(a,this.camera);const s=this.intersectObjectWithRay(this.gizmo.picker[this.mode],this.raycaster);s?this.axis=s.object.name:this.axis=null}),dt(this,"pointerDown",a=>{if(!(this.object===void 0||this.dragging===!0||a.button!==0)&&this.axis!==null){this.raycaster.setFromCamera(a,this.camera);const s=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(s){let r=this.space;if(this.mode==="scale"?r="local":(this.axis==="E"||this.axis==="XYZE"||this.axis==="XYZ")&&(r="world"),r==="local"&&this.mode==="rotate"){const o=this.rotationSnap;this.axis==="X"&&o&&(this.object.rotation.x=Math.round(this.object.rotation.x/o)*o),this.axis==="Y"&&o&&(this.object.rotation.y=Math.round(this.object.rotation.y/o)*o),this.axis==="Z"&&o&&(this.object.rotation.z=Math.round(this.object.rotation.z/o)*o)}this.object.updateMatrixWorld(),this.object.parent&&this.object.parent.updateMatrixWorld(),this.positionStart.copy(this.object.position),this.quaternionStart.copy(this.object.quaternion),this.scaleStart.copy(this.object.scale),this.object.matrixWorld.decompose(this.worldPositionStart,this.worldQuaternionStart,this.worldScaleStart),this.pointStart.copy(s.point).sub(this.worldPositionStart)}this.dragging=!0,this.mouseDownEvent.mode=this.mode,this.dispatchEvent(this.mouseDownEvent)}}),dt(this,"pointerMove",a=>{const s=this.axis,r=this.mode,o=this.object;let c=this.space;if(r==="scale"?c="local":(s==="E"||s==="XYZE"||s==="XYZ")&&(c="world"),o===void 0||s===null||this.dragging===!1||a.button!==-1)return;this.raycaster.setFromCamera(a,this.camera);const u=this.intersectObjectWithRay(this.plane,this.raycaster,!0);if(u){if(this.pointEnd.copy(u.point).sub(this.worldPositionStart),r==="translate")this.offset.copy(this.pointEnd).sub(this.pointStart),c==="local"&&s!=="XYZ"&&this.offset.applyQuaternion(this.worldQuaternionInv),s.indexOf("X")===-1&&(this.offset.x=0),s.indexOf("Y")===-1&&(this.offset.y=0),s.indexOf("Z")===-1&&(this.offset.z=0),c==="local"&&s!=="XYZ"?this.offset.applyQuaternion(this.quaternionStart).divide(this.parentScale):this.offset.applyQuaternion(this.parentQuaternionInv).divide(this.parentScale),o.position.copy(this.offset).add(this.positionStart),this.translationSnap&&(c==="local"&&(o.position.applyQuaternion(this.tempQuaternion.copy(this.quaternionStart).invert()),s.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.position.applyQuaternion(this.quaternionStart)),c==="world"&&(o.parent&&o.position.add(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld)),s.search("X")!==-1&&(o.position.x=Math.round(o.position.x/this.translationSnap)*this.translationSnap),s.search("Y")!==-1&&(o.position.y=Math.round(o.position.y/this.translationSnap)*this.translationSnap),s.search("Z")!==-1&&(o.position.z=Math.round(o.position.z/this.translationSnap)*this.translationSnap),o.parent&&o.position.sub(this.tempVector.setFromMatrixPosition(o.parent.matrixWorld))));else if(r==="scale"){if(s.search("XYZ")!==-1){let h=this.pointEnd.length()/this.pointStart.length();this.pointEnd.dot(this.pointStart)<0&&(h*=-1),this.tempVector2.set(h,h,h)}else this.tempVector.copy(this.pointStart),this.tempVector2.copy(this.pointEnd),this.tempVector.applyQuaternion(this.worldQuaternionInv),this.tempVector2.applyQuaternion(this.worldQuaternionInv),this.tempVector2.divide(this.tempVector),s.search("X")===-1&&(this.tempVector2.x=1),s.search("Y")===-1&&(this.tempVector2.y=1),s.search("Z")===-1&&(this.tempVector2.z=1);o.scale.copy(this.scaleStart).multiply(this.tempVector2),this.scaleSnap&&this.object&&(s.search("X")!==-1&&(this.object.scale.x=Math.round(o.scale.x/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Y")!==-1&&(o.scale.y=Math.round(o.scale.y/this.scaleSnap)*this.scaleSnap||this.scaleSnap),s.search("Z")!==-1&&(o.scale.z=Math.round(o.scale.z/this.scaleSnap)*this.scaleSnap||this.scaleSnap))}else if(r==="rotate"){this.offset.copy(this.pointEnd).sub(this.pointStart);const h=20/this.worldPosition.distanceTo(this.tempVector.setFromMatrixPosition(this.camera.matrixWorld));s==="E"?(this.rotationAxis.copy(this.eye),this.rotationAngle=this.pointEnd.angleTo(this.pointStart),this.startNorm.copy(this.pointStart).normalize(),this.endNorm.copy(this.pointEnd).normalize(),this.rotationAngle*=this.endNorm.cross(this.startNorm).dot(this.eye)<0?1:-1):s==="XYZE"?(this.rotationAxis.copy(this.offset).cross(this.eye).normalize(),this.rotationAngle=this.offset.dot(this.tempVector.copy(this.rotationAxis).cross(this.eye))*h):(s==="X"||s==="Y"||s==="Z")&&(this.rotationAxis.copy(this.unit[s]),this.tempVector.copy(this.unit[s]),c==="local"&&this.tempVector.applyQuaternion(this.worldQuaternion),this.rotationAngle=this.offset.dot(this.tempVector.cross(this.eye).normalize())*h),this.rotationSnap&&(this.rotationAngle=Math.round(this.rotationAngle/this.rotationSnap)*this.rotationSnap),c==="local"&&s!=="E"&&s!=="XYZE"?(o.quaternion.copy(this.quaternionStart),o.quaternion.multiply(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)).normalize()):(this.rotationAxis.applyQuaternion(this.parentQuaternionInv),o.quaternion.copy(this.tempQuaternion.setFromAxisAngle(this.rotationAxis,this.rotationAngle)),o.quaternion.multiply(this.quaternionStart).normalize())}this.dispatchEvent(this.changeEvent),this.dispatchEvent(this.objectChangeEvent)}}),dt(this,"pointerUp",a=>{a.button===0&&(this.dragging&&this.axis!==null&&(this.mouseUpEvent.mode=this.mode,this.dispatchEvent(this.mouseUpEvent)),this.dragging=!1,this.axis=null)}),dt(this,"getPointer",a=>{var s;if(this.domElement&&((s=this.domElement.ownerDocument)!=null&&s.pointerLockElement))return{x:0,y:0,button:a.button};{const r=a.changedTouches?a.changedTouches[0]:a,o=this.domElement.getBoundingClientRect();return{x:(r.clientX-o.left)/o.width*2-1,y:-(r.clientY-o.top)/o.height*2+1,button:a.button}}}),dt(this,"onPointerHover",a=>{if(this.enabled)switch(a.pointerType){case"mouse":case"pen":this.pointerHover(this.getPointer(a));break}}),dt(this,"onPointerDown",a=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="none",this.domElement.ownerDocument.addEventListener("pointermove",this.onPointerMove),this.pointerHover(this.getPointer(a)),this.pointerDown(this.getPointer(a)))}),dt(this,"onPointerMove",a=>{this.enabled&&this.pointerMove(this.getPointer(a))}),dt(this,"onPointerUp",a=>{!this.enabled||!this.domElement||(this.domElement.style.touchAction="",this.domElement.ownerDocument.removeEventListener("pointermove",this.onPointerMove),this.pointerUp(this.getPointer(a)))}),dt(this,"getMode",()=>this.mode),dt(this,"setMode",a=>{this.mode=a}),dt(this,"setTranslationSnap",a=>{this.translationSnap=a}),dt(this,"setRotationSnap",a=>{this.rotationSnap=a}),dt(this,"setScaleSnap",a=>{this.scaleSnap=a}),dt(this,"setSize",a=>{this.size=a}),dt(this,"setSpace",a=>{this.space=a}),dt(this,"update",()=>{console.warn("THREE.TransformControls: update function has no more functionality and therefore has been deprecated.")}),dt(this,"connect",a=>{a===document&&console.error('THREE.OrbitControls: "document" should not be used as the target "domElement". Please use "renderer.domElement" instead.'),this.domElement=a,this.domElement.addEventListener("pointerdown",this.onPointerDown),this.domElement.addEventListener("pointermove",this.onPointerHover),this.domElement.ownerDocument.addEventListener("pointerup",this.onPointerUp)}),dt(this,"dispose",()=>{var a,s,r,o,c,u;(a=this.domElement)==null||a.removeEventListener("pointerdown",this.onPointerDown),(s=this.domElement)==null||s.removeEventListener("pointermove",this.onPointerHover),(o=(r=this.domElement)==null?void 0:r.ownerDocument)==null||o.removeEventListener("pointermove",this.onPointerMove),(u=(c=this.domElement)==null?void 0:c.ownerDocument)==null||u.removeEventListener("pointerup",this.onPointerUp),this.traverse(h=>{const d=h;d.geometry&&d.geometry.dispose(),d.material&&d.material.dispose()})}),this.domElement=n,this.camera=e,this.gizmo=new b2e,this.add(this.gizmo),this.plane=new x2e,this.add(this.plane);const i=(a,s)=>{let r=s;Object.defineProperty(this,a,{get:function(){return r!==void 0?r:s},set:function(o){r!==o&&(r=o,this.plane[a]=o,this.gizmo[a]=o,this.dispatchEvent({type:a+"-changed",value:o}),this.dispatchEvent(this.changeEvent))}}),this[a]=s,this.plane[a]=s,this.gizmo[a]=s};i("camera",this.camera),i("object",this.object),i("enabled",this.enabled),i("axis",this.axis),i("mode",this.mode),i("translationSnap",this.translationSnap),i("rotationSnap",this.rotationSnap),i("scaleSnap",this.scaleSnap),i("space",this.space),i("size",this.size),i("dragging",this.dragging),i("showX",this.showX),i("showY",this.showY),i("showZ",this.showZ),i("worldPosition",this.worldPosition),i("worldPositionStart",this.worldPositionStart),i("worldQuaternion",this.worldQuaternion),i("worldQuaternionStart",this.worldQuaternionStart),i("cameraPosition",this.cameraPosition),i("cameraQuaternion",this.cameraQuaternion),i("pointStart",this.pointStart),i("pointEnd",this.pointEnd),i("rotationAxis",this.rotationAxis),i("rotationAngle",this.rotationAngle),i("eye",this.eye),n!==void 0&&this.connect(n)}};class b2e extends Jn{constructor(){super(),dt(this,"isTransformControlsGizmo",!0),dt(this,"type","TransformControlsGizmo"),dt(this,"tempVector",new fe(0,0,0)),dt(this,"tempEuler",new xo),dt(this,"alignVector",new fe(0,1,0)),dt(this,"zeroVector",new fe(0,0,0)),dt(this,"lookAtMatrix",new wn),dt(this,"tempQuaternion",new Li),dt(this,"tempQuaternion2",new Li),dt(this,"identityQuaternion",new Li),dt(this,"unitX",new fe(1,0,0)),dt(this,"unitY",new fe(0,1,0)),dt(this,"unitZ",new fe(0,0,1)),dt(this,"gizmo"),dt(this,"picker"),dt(this,"helper"),dt(this,"rotationAxis",new fe),dt(this,"cameraPosition",new fe),dt(this,"worldPositionStart",new fe),dt(this,"worldQuaternionStart",new Li),dt(this,"worldPosition",new fe),dt(this,"worldQuaternion",new Li),dt(this,"eye",new fe),dt(this,"camera",null),dt(this,"enabled",!0),dt(this,"axis",null),dt(this,"mode","translate"),dt(this,"space","world"),dt(this,"size",1),dt(this,"dragging",!1),dt(this,"showX",!0),dt(this,"showY",!0),dt(this,"showZ",!0),dt(this,"updateMatrixWorld",()=>{let Y=this.space;this.mode==="scale"&&(Y="local");const K=Y==="local"?this.worldQuaternion:this.identityQuaternion;this.gizmo.translate.visible=this.mode==="translate",this.gizmo.rotate.visible=this.mode==="rotate",this.gizmo.scale.visible=this.mode==="scale",this.helper.translate.visible=this.mode==="translate",this.helper.rotate.visible=this.mode==="rotate",this.helper.scale.visible=this.mode==="scale";let ee=[];ee=ee.concat(this.picker[this.mode].children),ee=ee.concat(this.gizmo[this.mode].children),ee=ee.concat(this.helper[this.mode].children);for(let ie=0;ie<ee.length;ie++){const Z=ee[ie];Z.visible=!0,Z.rotation.set(0,0,0),Z.position.copy(this.worldPosition);let ue;if(this.camera.isOrthographicCamera?ue=(this.camera.top-this.camera.bottom)/this.camera.zoom:ue=this.worldPosition.distanceTo(this.cameraPosition)*Math.min(1.9*Math.tan(Math.PI*this.camera.fov/360)/this.camera.zoom,7),Z.scale.set(1,1,1).multiplyScalar(ue*this.size/7),Z.tag==="helper"){Z.visible=!1,Z.name==="AXIS"?(Z.position.copy(this.worldPositionStart),Z.visible=!!this.axis,this.axis==="X"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,0)),Z.quaternion.copy(K).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(K).dot(this.eye))>.9&&(Z.visible=!1)),this.axis==="Y"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,0,Math.PI/2)),Z.quaternion.copy(K).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(K).dot(this.eye))>.9&&(Z.visible=!1)),this.axis==="Z"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),Z.quaternion.copy(K).multiply(this.tempQuaternion),Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(K).dot(this.eye))>.9&&(Z.visible=!1)),this.axis==="XYZE"&&(this.tempQuaternion.setFromEuler(this.tempEuler.set(0,Math.PI/2,0)),this.alignVector.copy(this.rotationAxis),Z.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.zeroVector,this.alignVector,this.unitY)),Z.quaternion.multiply(this.tempQuaternion),Z.visible=this.dragging),this.axis==="E"&&(Z.visible=!1)):Z.name==="START"?(Z.position.copy(this.worldPositionStart),Z.visible=this.dragging):Z.name==="END"?(Z.position.copy(this.worldPosition),Z.visible=this.dragging):Z.name==="DELTA"?(Z.position.copy(this.worldPositionStart),Z.quaternion.copy(this.worldQuaternionStart),this.tempVector.set(1e-10,1e-10,1e-10).add(this.worldPositionStart).sub(this.worldPosition).multiplyScalar(-1),this.tempVector.applyQuaternion(this.worldQuaternionStart.clone().invert()),Z.scale.copy(this.tempVector),Z.visible=this.dragging):(Z.quaternion.copy(K),this.dragging?Z.position.copy(this.worldPositionStart):Z.position.copy(this.worldPosition),this.axis&&(Z.visible=this.axis.search(Z.name)!==-1));continue}Z.quaternion.copy(K),this.mode==="translate"||this.mode==="scale"?((Z.name==="X"||Z.name==="XYZX")&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(K).dot(this.eye))>.99&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),(Z.name==="Y"||Z.name==="XYZY")&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(K).dot(this.eye))>.99&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),(Z.name==="Z"||Z.name==="XYZZ")&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(K).dot(this.eye))>.99&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),Z.name==="XY"&&Math.abs(this.alignVector.copy(this.unitZ).applyQuaternion(K).dot(this.eye))<.2&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),Z.name==="YZ"&&Math.abs(this.alignVector.copy(this.unitX).applyQuaternion(K).dot(this.eye))<.2&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),Z.name==="XZ"&&Math.abs(this.alignVector.copy(this.unitY).applyQuaternion(K).dot(this.eye))<.2&&(Z.scale.set(1e-10,1e-10,1e-10),Z.visible=!1),Z.name.search("X")!==-1&&(this.alignVector.copy(this.unitX).applyQuaternion(K).dot(this.eye)<0?Z.tag==="fwd"?Z.visible=!1:Z.scale.x*=-1:Z.tag==="bwd"&&(Z.visible=!1)),Z.name.search("Y")!==-1&&(this.alignVector.copy(this.unitY).applyQuaternion(K).dot(this.eye)<0?Z.tag==="fwd"?Z.visible=!1:Z.scale.y*=-1:Z.tag==="bwd"&&(Z.visible=!1)),Z.name.search("Z")!==-1&&(this.alignVector.copy(this.unitZ).applyQuaternion(K).dot(this.eye)<0?Z.tag==="fwd"?Z.visible=!1:Z.scale.z*=-1:Z.tag==="bwd"&&(Z.visible=!1))):this.mode==="rotate"&&(this.tempQuaternion2.copy(K),this.alignVector.copy(this.eye).applyQuaternion(this.tempQuaternion.copy(K).invert()),Z.name.search("E")!==-1&&Z.quaternion.setFromRotationMatrix(this.lookAtMatrix.lookAt(this.eye,this.zeroVector,this.unitY)),Z.name==="X"&&(this.tempQuaternion.setFromAxisAngle(this.unitX,Math.atan2(-this.alignVector.y,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),Z.quaternion.copy(this.tempQuaternion)),Z.name==="Y"&&(this.tempQuaternion.setFromAxisAngle(this.unitY,Math.atan2(this.alignVector.x,this.alignVector.z)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),Z.quaternion.copy(this.tempQuaternion)),Z.name==="Z"&&(this.tempQuaternion.setFromAxisAngle(this.unitZ,Math.atan2(this.alignVector.y,this.alignVector.x)),this.tempQuaternion.multiplyQuaternions(this.tempQuaternion2,this.tempQuaternion),Z.quaternion.copy(this.tempQuaternion))),Z.visible=Z.visible&&(Z.name.indexOf("X")===-1||this.showX),Z.visible=Z.visible&&(Z.name.indexOf("Y")===-1||this.showY),Z.visible=Z.visible&&(Z.name.indexOf("Z")===-1||this.showZ),Z.visible=Z.visible&&(Z.name.indexOf("E")===-1||this.showX&&this.showY&&this.showZ),Z.material.tempOpacity=Z.material.tempOpacity||Z.material.opacity,Z.material.tempColor=Z.material.tempColor||Z.material.color.clone(),Z.material.color.copy(Z.material.tempColor),Z.material.opacity=Z.material.tempOpacity,this.enabled?this.axis&&(Z.name===this.axis?(Z.material.opacity=1,Z.material.color.lerp(new Wt(1,1,1),.5)):this.axis.split("").some(function(se){return Z.name===se})?(Z.material.opacity=1,Z.material.color.lerp(new Wt(1,1,1),.5)):(Z.material.opacity*=.25,Z.material.color.lerp(new Wt(1,1,1),.5))):(Z.material.opacity*=.5,Z.material.color.lerp(new Wt(1,1,1),.5))}super.updateMatrixWorld()});const e=new Eu({depthTest:!1,depthWrite:!1,transparent:!0,side:xl,fog:!1,toneMapped:!1}),n=new xr({depthTest:!1,depthWrite:!1,transparent:!0,linewidth:1,fog:!1,toneMapped:!1}),i=e.clone();i.opacity=.15;const a=e.clone();a.opacity=.33;const s=e.clone();s.color.set(16711680);const r=e.clone();r.color.set(65280);const o=e.clone();o.color.set(255);const c=e.clone();c.opacity=.25;const u=c.clone();u.color.set(16776960);const h=c.clone();h.color.set(65535);const d=c.clone();d.color.set(16711935),e.clone().color.set(16776960);const g=n.clone();g.color.set(16711680);const b=n.clone();b.color.set(65280);const w=n.clone();w.color.set(255);const x=n.clone();x.color.set(65535);const S=n.clone();S.color.set(16711935);const M=n.clone();M.color.set(16776960);const C=n.clone();C.color.set(7895160);const A=M.clone();A.opacity=.25;const N=new sr(0,.05,.2,12,1,!1),R=new fo(.125,.125,.125),D=new Pn;D.setAttribute("position",new an([0,0,0,1,0,0],3));const B=(Y,K)=>{const ee=new Pn,ie=[];for(let Z=0;Z<=64*K;++Z)ie.push(0,Math.cos(Z/32*Math.PI)*Y,Math.sin(Z/32*Math.PI)*Y);return ee.setAttribute("position",new an(ie,3)),ee},z=()=>{const Y=new Pn;return Y.setAttribute("position",new an([0,0,0,1,1,1],3)),Y},I={X:[[new Qt(N,s),[1,0,0],[0,0,-Math.PI/2],null,"fwd"],[new Qt(N,s),[1,0,0],[0,0,Math.PI/2],null,"bwd"],[new qn(D,g)]],Y:[[new Qt(N,r),[0,1,0],null,null,"fwd"],[new Qt(N,r),[0,1,0],[Math.PI,0,0],null,"bwd"],[new qn(D,b),null,[0,0,Math.PI/2]]],Z:[[new Qt(N,o),[0,0,1],[Math.PI/2,0,0],null,"fwd"],[new Qt(N,o),[0,0,1],[-Math.PI/2,0,0],null,"bwd"],[new qn(D,w),null,[0,-Math.PI/2,0]]],XYZ:[[new Qt(new bl(.1,0),c.clone()),[0,0,0],[0,0,0]]],XY:[[new Qt(new Bo(.295,.295),u.clone()),[.15,.15,0]],[new qn(D,M),[.18,.3,0],null,[.125,1,1]],[new qn(D,M),[.3,.18,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Qt(new Bo(.295,.295),h.clone()),[0,.15,.15],[0,Math.PI/2,0]],[new qn(D,x),[0,.18,.3],[0,0,Math.PI/2],[.125,1,1]],[new qn(D,x),[0,.3,.18],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Qt(new Bo(.295,.295),d.clone()),[.15,0,.15],[-Math.PI/2,0,0]],[new qn(D,S),[.18,0,.3],null,[.125,1,1]],[new qn(D,S),[.3,0,.18],[0,-Math.PI/2,0],[.125,1,1]]]},U={X:[[new Qt(new sr(.2,0,1,4,1,!1),i),[.6,0,0],[0,0,-Math.PI/2]]],Y:[[new Qt(new sr(.2,0,1,4,1,!1),i),[0,.6,0]]],Z:[[new Qt(new sr(.2,0,1,4,1,!1),i),[0,0,.6],[Math.PI/2,0,0]]],XYZ:[[new Qt(new bl(.2,0),i)]],XY:[[new Qt(new Bo(.4,.4),i),[.2,.2,0]]],YZ:[[new Qt(new Bo(.4,.4),i),[0,.2,.2],[0,Math.PI/2,0]]],XZ:[[new Qt(new Bo(.4,.4),i),[.2,0,.2],[-Math.PI/2,0,0]]]},$={START:[[new Qt(new bl(.01,2),a),null,null,null,"helper"]],END:[[new Qt(new bl(.01,2),a),null,null,null,"helper"]],DELTA:[[new qn(z(),a),null,null,null,"helper"]],X:[[new qn(D,a.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new qn(D,a.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new qn(D,a.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},G={X:[[new qn(B(1,.5),g)],[new Qt(new bl(.04,0),s),[0,0,.99],null,[1,3,1]]],Y:[[new qn(B(1,.5),b),null,[0,0,-Math.PI/2]],[new Qt(new bl(.04,0),r),[0,0,.99],null,[3,1,1]]],Z:[[new qn(B(1,.5),w),null,[0,Math.PI/2,0]],[new Qt(new bl(.04,0),o),[.99,0,0],null,[1,3,1]]],E:[[new qn(B(1.25,1),A),null,[0,Math.PI/2,0]],[new Qt(new sr(.03,0,.15,4,1,!1),A),[1.17,0,0],[0,0,-Math.PI/2],[1,1,.001]],[new Qt(new sr(.03,0,.15,4,1,!1),A),[-1.17,0,0],[0,0,Math.PI/2],[1,1,.001]],[new Qt(new sr(.03,0,.15,4,1,!1),A),[0,-1.17,0],[Math.PI,0,0],[1,1,.001]],[new Qt(new sr(.03,0,.15,4,1,!1),A),[0,1.17,0],[0,0,0],[1,1,.001]]],XYZE:[[new qn(B(1,1),C),null,[0,Math.PI/2,0]]]},k={AXIS:[[new qn(D,a.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]]},X={X:[[new Qt(new jf(1,.1,4,24),i),[0,0,0],[0,-Math.PI/2,-Math.PI/2]]],Y:[[new Qt(new jf(1,.1,4,24),i),[0,0,0],[Math.PI/2,0,0]]],Z:[[new Qt(new jf(1,.1,4,24),i),[0,0,0],[0,0,-Math.PI/2]]],E:[[new Qt(new jf(1.25,.1,2,24),i)]],XYZE:[[new Qt(new fv(.7,10,8),i)]]},V={X:[[new Qt(R,s),[.8,0,0],[0,0,-Math.PI/2]],[new qn(D,g),null,null,[.8,1,1]]],Y:[[new Qt(R,r),[0,.8,0]],[new qn(D,b),null,[0,0,Math.PI/2],[.8,1,1]]],Z:[[new Qt(R,o),[0,0,.8],[Math.PI/2,0,0]],[new qn(D,w),null,[0,-Math.PI/2,0],[.8,1,1]]],XY:[[new Qt(R,u),[.85,.85,0],null,[2,2,.2]],[new qn(D,M),[.855,.98,0],null,[.125,1,1]],[new qn(D,M),[.98,.855,0],[0,0,Math.PI/2],[.125,1,1]]],YZ:[[new Qt(R,h),[0,.85,.85],null,[.2,2,2]],[new qn(D,x),[0,.855,.98],[0,0,Math.PI/2],[.125,1,1]],[new qn(D,x),[0,.98,.855],[0,-Math.PI/2,0],[.125,1,1]]],XZ:[[new Qt(R,d),[.85,0,.85],null,[2,.2,2]],[new qn(D,S),[.855,0,.98],null,[.125,1,1]],[new qn(D,S),[.98,0,.855],[0,-Math.PI/2,0],[.125,1,1]]],XYZX:[[new Qt(new fo(.125,.125,.125),c.clone()),[1.1,0,0]]],XYZY:[[new Qt(new fo(.125,.125,.125),c.clone()),[0,1.1,0]]],XYZZ:[[new Qt(new fo(.125,.125,.125),c.clone()),[0,0,1.1]]]},H={X:[[new Qt(new sr(.2,0,.8,4,1,!1),i),[.5,0,0],[0,0,-Math.PI/2]]],Y:[[new Qt(new sr(.2,0,.8,4,1,!1),i),[0,.5,0]]],Z:[[new Qt(new sr(.2,0,.8,4,1,!1),i),[0,0,.5],[Math.PI/2,0,0]]],XY:[[new Qt(R,i),[.85,.85,0],null,[3,3,.2]]],YZ:[[new Qt(R,i),[0,.85,.85],null,[.2,3,3]]],XZ:[[new Qt(R,i),[.85,0,.85],null,[3,.2,3]]],XYZX:[[new Qt(new fo(.2,.2,.2),i),[1.1,0,0]]],XYZY:[[new Qt(new fo(.2,.2,.2),i),[0,1.1,0]]],XYZZ:[[new Qt(new fo(.2,.2,.2),i),[0,0,1.1]]]},W={X:[[new qn(D,a.clone()),[-1e3,0,0],null,[1e6,1,1],"helper"]],Y:[[new qn(D,a.clone()),[0,-1e3,0],[0,0,Math.PI/2],[1e6,1,1],"helper"]],Z:[[new qn(D,a.clone()),[0,0,-1e3],[0,-Math.PI/2,0],[1e6,1,1],"helper"]]},J=Y=>{const K=new Jn;for(let ee in Y)for(let ie=Y[ee].length;ie--;){const Z=Y[ee][ie][0].clone(),ue=Y[ee][ie][1],se=Y[ee][ie][2],ae=Y[ee][ie][3],ce=Y[ee][ie][4];Z.name=ee,Z.tag=ce,ue&&Z.position.set(ue[0],ue[1],ue[2]),se&&Z.rotation.set(se[0],se[1],se[2]),ae&&Z.scale.set(ae[0],ae[1],ae[2]),Z.updateMatrix();const pe=Z.geometry.clone();pe.applyMatrix4(Z.matrix),Z.geometry=pe,Z.renderOrder=1/0,Z.position.set(0,0,0),Z.rotation.set(0,0,0),Z.scale.set(1,1,1),K.add(Z)}return K};this.gizmo={},this.picker={},this.helper={},this.add(this.gizmo.translate=J(I)),this.add(this.gizmo.rotate=J(G)),this.add(this.gizmo.scale=J(V)),this.add(this.picker.translate=J(U)),this.add(this.picker.rotate=J(X)),this.add(this.picker.scale=J(H)),this.add(this.helper.translate=J($)),this.add(this.helper.rotate=J(k)),this.add(this.helper.scale=J(W)),this.picker.translate.visible=!1,this.picker.rotate.visible=!1,this.picker.scale.visible=!1}}class x2e extends Qt{constructor(){super(new Bo(1e5,1e5,2,2),new Eu({visible:!1,wireframe:!0,side:xl,transparent:!0,opacity:.1,toneMapped:!1})),dt(this,"isTransformControlsPlane",!0),dt(this,"type","TransformControlsPlane"),dt(this,"unitX",new fe(1,0,0)),dt(this,"unitY",new fe(0,1,0)),dt(this,"unitZ",new fe(0,0,1)),dt(this,"tempVector",new fe),dt(this,"dirVector",new fe),dt(this,"alignVector",new fe),dt(this,"tempMatrix",new wn),dt(this,"identityQuaternion",new Li),dt(this,"cameraQuaternion",new Li),dt(this,"worldPosition",new fe),dt(this,"worldQuaternion",new Li),dt(this,"eye",new fe),dt(this,"axis",null),dt(this,"mode","translate"),dt(this,"space","world"),dt(this,"updateMatrixWorld",()=>{let e=this.space;switch(this.position.copy(this.worldPosition),this.mode==="scale"&&(e="local"),this.unitX.set(1,0,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitY.set(0,1,0).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.unitZ.set(0,0,1).applyQuaternion(e==="local"?this.worldQuaternion:this.identityQuaternion),this.alignVector.copy(this.unitY),this.mode){case"translate":case"scale":switch(this.axis){case"X":this.alignVector.copy(this.eye).cross(this.unitX),this.dirVector.copy(this.unitX).cross(this.alignVector);break;case"Y":this.alignVector.copy(this.eye).cross(this.unitY),this.dirVector.copy(this.unitY).cross(this.alignVector);break;case"Z":this.alignVector.copy(this.eye).cross(this.unitZ),this.dirVector.copy(this.unitZ).cross(this.alignVector);break;case"XY":this.dirVector.copy(this.unitZ);break;case"YZ":this.dirVector.copy(this.unitX);break;case"XZ":this.alignVector.copy(this.unitZ),this.dirVector.copy(this.unitY);break;case"XYZ":case"E":this.dirVector.set(0,0,0);break}break;case"rotate":default:this.dirVector.set(0,0,0)}this.dirVector.length()===0?this.quaternion.copy(this.cameraQuaternion):(this.tempMatrix.lookAt(this.tempVector.set(0,0,0),this.dirVector,this.alignVector),this.quaternion.setFromRotationMatrix(this.tempMatrix)),super.updateMatrixWorld()})}}function _2e(t,e,n){const i=zo(g=>g.size),a=zo(g=>g.viewport),s=typeof t=="number"?t:i.width*a.dpr,r=i.height*a.dpr,o=(typeof t=="number"?n:t)||{},{samples:c=0,depth:u,...h}=o,d=u??o.depthBuffer,p=P.useMemo(()=>{const g=new hc(s,r,{minFilter:ja,magFilter:ja,type:bm,...h});return d&&(g.depthTexture=new kw(s,r,Hr)),g.samples=c,g},[]);return P.useLayoutEffect(()=>{p.setSize(s,r),c&&(p.samples=c)},[c,p,s,r]),P.useEffect(()=>()=>p.dispose(),[]),p}const S2e=t=>typeof t=="function",w2e=P.forwardRef(({envMap:t,resolution:e=256,frames:n=1/0,makeDefault:i,children:a,...s},r)=>{const o=zo(({set:x})=>x),c=zo(({camera:x})=>x),u=zo(({size:x})=>x),h=P.useRef(null);P.useImperativeHandle(r,()=>h.current,[]);const d=P.useRef(null),p=_2e(e);P.useLayoutEffect(()=>{s.manual||(h.current.aspect=u.width/u.height)},[u,s]),P.useLayoutEffect(()=>{h.current.updateProjectionMatrix()});let g=0,b=null;const w=S2e(a);return $xe(x=>{w&&(n===1/0||g<n)&&(d.current.visible=!1,x.gl.setRenderTarget(p),b=x.scene.background,t&&(x.scene.background=t),x.gl.render(x.scene,h.current),x.scene.background=b,x.gl.setRenderTarget(null),d.current.visible=!0,g++)}),P.useLayoutEffect(()=>{if(i){const x=c;return o(()=>({camera:h.current})),()=>o(()=>({camera:x}))}},[h,i,o]),P.createElement(P.Fragment,null,P.createElement("perspectiveCamera",s1({ref:h},s),!w&&a),P.createElement("group",{ref:d},w&&a(p.texture)))}),E2e=P.forwardRef(({children:t,domElement:e,onChange:n,onMouseDown:i,onMouseUp:a,onObjectChange:s,object:r,makeDefault:o,camera:c,enabled:u,axis:h,mode:d,translationSnap:p,rotationSnap:g,scaleSnap:b,space:w,size:x,showX:S,showY:M,showZ:C,...A},N)=>{const R=zo(K=>K.controls),D=zo(K=>K.gl),B=zo(K=>K.events),z=zo(K=>K.camera),I=zo(K=>K.invalidate),U=zo(K=>K.get),$=zo(K=>K.set),G=c||z,k=e||B.connected||D.domElement,X=P.useMemo(()=>new y2e(G,k),[G,k]),V=P.useRef(null);P.useLayoutEffect(()=>(r?X.attach(r instanceof Jn?r:r.current):V.current instanceof Jn&&X.attach(V.current),()=>void X.detach()),[r,t,X]),P.useEffect(()=>{if(R){const K=ee=>R.enabled=!ee.value;return X.addEventListener("dragging-changed",K),()=>X.removeEventListener("dragging-changed",K)}},[X,R]);const H=P.useRef(void 0),W=P.useRef(void 0),J=P.useRef(void 0),Y=P.useRef(void 0);return P.useLayoutEffect(()=>void(H.current=n),[n]),P.useLayoutEffect(()=>void(W.current=i),[i]),P.useLayoutEffect(()=>void(J.current=a),[a]),P.useLayoutEffect(()=>void(Y.current=s),[s]),P.useEffect(()=>{const K=ue=>{I(),H.current==null||H.current(ue)},ee=ue=>W.current==null?void 0:W.current(ue),ie=ue=>J.current==null?void 0:J.current(ue),Z=ue=>Y.current==null?void 0:Y.current(ue);return X.addEventListener("change",K),X.addEventListener("mouseDown",ee),X.addEventListener("mouseUp",ie),X.addEventListener("objectChange",Z),()=>{X.removeEventListener("change",K),X.removeEventListener("mouseDown",ee),X.removeEventListener("mouseUp",ie),X.removeEventListener("objectChange",Z)}},[I,X]),P.useEffect(()=>{if(o){const K=U().controls;return $({controls:X}),()=>$({controls:K})}},[o,X]),P.createElement(P.Fragment,null,P.createElement("primitive",{ref:N,object:X,enabled:u,axis:h,mode:d,translationSnap:p,rotationSnap:g,scaleSnap:b,space:w,size:x,showX:S,showY:M,showZ:C}),P.createElement("group",s1({ref:V},A),t))});function M2e(){const{camera:t}=zo(),e=P.useCallback((n,i)=>n>0&&n<90?i:n>-180&&n<-90||n>0?-i:i,[]);return yo("set_camera_position",({position:n,rotation:i})=>{t.position.set(n.x,n.z,-n.y),t.rotation.order="YZX",i&&t.rotation.set(iu.degToRad(i.x),iu.degToRad(e(i.x,i.z)),iu.degToRad(i.y)),t.updateProjectionMatrix()}),_.jsx(w2e,{position:[0,0,10],makeDefault:!0,onUpdate:n=>n.updateProjectionMatrix()})}function T2e(t){const e=sn.c(17),{space:n,mode:i,currentEntity:a,setCurrentEntity:s,onMouseUp:r,onMouseDown:o}=t,c=P.useRef(null),u=vi(dle),h=vi(fle);let d;e[0]!==s?(d=M=>{s(M),!(!M||!M.handle||!M.position||!M.rotation)&&(c.current.rotation.order="YZX",c.current.position.set(M.position.x,M.position.z,-M.position.y),c.current.rotation.set(iu.degToRad(M.rotation.x),iu.degToRad(M.rotation.z),iu.degToRad(-M.rotation.y)))},e[0]=s,e[1]=d):d=e[1],yo("set_gizmo_entity",d);let p;e[2]!==a?.handle?(p=()=>{ut("move_entity",{handle:a?.handle,position:{x:c.current.position.x,y:-c.current.position.z,z:c.current.position.y},rotation:{x:iu.radToDeg(c.current.rotation.x),y:iu.radToDeg(-c.current.rotation.z),z:iu.radToDeg(c.current.rotation.y)}})},e[2]=a?.handle,e[3]=p):p=e[3],a?.handle;const g=p;let b;e[4]===Symbol.for("react.memo_cache_sentinel")?(b=_.jsx("p",{children:"Loading Gizmo"}),e[4]=b):b=e[4];let w;e[5]!==a?.handle||e[6]!==g||e[7]!==i||e[8]!==o||e[9]!==r||e[10]!==h||e[11]!==n||e[12]!==u?(w=a?.handle&&_.jsx(E2e,{onMouseUp:M=>r?.(M),onMouseDown:M=>o?.(M),space:n,size:.5,object:c,mode:i,translationSnap:u,rotationSnap:h,onObjectChange:g}),e[5]=a?.handle,e[6]=g,e[7]=i,e[8]=o,e[9]=r,e[10]=h,e[11]=n,e[12]=u,e[13]=w):w=e[13];let x;e[14]===Symbol.for("react.memo_cache_sentinel")?(x=_.jsx("mesh",{ref:c}),e[14]=x):x=e[14];let S;return e[15]!==w?(S=_.jsx(_.Fragment,{children:_.jsxs(P.Suspense,{fallback:b,children:[w,x]})}),e[15]=w,e[16]=S):S=e[16],S}const C2e="KeyK",A2e="KeyQ",R2e="KeyM",N2e="KeyF3",P2e="Enter";function D2e(){const[t,e]=pu(JV),[n,i]=P.useState("world"),[a,s]=pu(QV),[r,o]=P.useState(!1),[c,u]=pu(hle),h=P.useCallback(()=>{i(n==="world"?"local":"world")},[n]),d=P.useCallback(b=>{b.code===C2e&&e(t==="translate"?"rotate":"translate"),b.code===A2e&&h(),b.code===R2e&&ut("toggle_gizmo_mode"),b.code===N2e&&ut("toggle_free_camera"),b.code===P2e&&ut("open_buy_object_modal")},[t,n,c]);yo("set_gizmo_editor_mode",b=>{e(b)}),yo("toggle_gizmo_mode",b=>{u(b)});const p=async b=>{b.target?.tagName!=="CANVAS"||b.button!==0||r||ut("select_decorate_entity")},g=P.useCallback(b=>o(b),[r]);return P.useEffect(()=>(window.addEventListener("keyup",d),window.addEventListener("mousedown",p),()=>{window.removeEventListener("keyup",d),window.removeEventListener("mousedown",p)}),[t,n,h,e,p]),_.jsx(_.Fragment,{children:_.jsxs(m2e,{style:{zIndex:1},children:[_.jsx(M2e,{}),_.jsx(T2e,{onMouseUp:()=>g(!1),onMouseDown:()=>g(!0),onChangeSpace:h,onChangeMode:e,space:n,mode:t,currentEntity:a,setCurrentEntity:s})]})})}const R9=fs({visible:!1,data:{garages:[],items:[],jobs:[],gangs:[],job:""}});function j1(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"32",d:"M256 112v288m144-144H112"},child:[]}]})(t)}function FG(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M186.62 464H160a16 16 0 0 1-14.57-22.6l64.46-142.25L113.1 297l-35.3 42.77C71.07 348.23 65.7 352 52 352H34.08a17.66 17.66 0 0 1-14.7-7.06c-2.38-3.21-4.72-8.65-2.44-16.41l19.82-71c.15-.53.33-1.06.53-1.58a.38.38 0 0 0 0-.15 14.82 14.82 0 0 1-.53-1.59l-19.84-71.45c-2.15-7.61.2-12.93 2.56-16.06a16.83 16.83 0 0 1 13.6-6.7H52c10.23 0 20.16 4.59 26 12l34.57 42.05 97.32-1.44-64.44-142A16 16 0 0 1 160 48h26.91a25 25 0 0 1 19.35 9.8l125.05 152 57.77-1.52c4.23-.23 15.95-.31 18.66-.31C463 208 496 225.94 496 256c0 9.46-3.78 27-29.07 38.16-14.93 6.6-34.85 9.94-59.21 9.94-2.68 0-14.37-.08-18.66-.31l-57.76-1.54-125.36 152a25 25 0 0 1-19.32 9.75z"},child:[]}]})(t)}function VG(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 473.14a6.83 6.83 0 0 0-3.57-6c-27.07-14.55-51.76-36.82-62.62-48a10.05 10.05 0 0 0-12.72-1.51c-50.33 32.42-111.61 32.44-161.95.05a10.09 10.09 0 0 0-12.82 1.56c-10.77 11.28-35.19 33.3-62.43 47.75a7.11 7.11 0 0 0-3.89 5.73 6.73 6.73 0 0 0 7.92 7.15c20.85-4.18 41-13.68 60.2-23.83a8.71 8.71 0 0 1 8-.06 185.14 185.14 0 0 0 167.81 0 8.82 8.82 0 0 1 8.09.06c19.1 10 39.22 19.59 60 23.8a6.73 6.73 0 0 0 8-6.71zm60.71-226.23c-3.49-8.39-10.9-14.89-20.9-18.35L432 219.08V136a64 64 0 0 0-64-64h-32v-8a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v8h-32a64 64 0 0 0-64 64v83.15l-23.58 9.39c-9.94 3.3-17.63 10-21.15 18.44-2.45 5.89-5.25 15-1.3 26.46l.1.3 46.66 119.44A23.33 23.33 0 0 0 102.58 408c.5 0 1 0 1.53-.05 31.32-2 56-17.27 72.6-31.61C200.42 396.81 228.31 408 256 408s55.43-11.2 79.14-31.7c16.59 14.36 41.3 29.67 72.61 31.65a23.36 23.36 0 0 0 23.37-14.74l46.65-119c3.28-8.09 2.9-17.76-1.06-27.3zM269 154.21l-1.14-.4a39.53 39.53 0 0 0-23.73 0l-.58.18-126.07 50.23a4 4 0 0 1-5.48-3.72V136a32 32 0 0 1 32-32h224a32 32 0 0 1 32 32v64.44a4 4 0 0 1-5.48 3.72z"},child:[]}]})(t)}function N9(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M336 80H176a16 16 0 0 0-16 16v16h192V96a16 16 0 0 0-16-16z"},child:[]},{tag:"path",attr:{d:"M496 176a64.07 64.07 0 0 0-64-64h-48V96a48.05 48.05 0 0 0-48-48H176a48.05 48.05 0 0 0-48 48v16H80a64.07 64.07 0 0 0-64 64v48h480zm-144-64H160V96a16 16 0 0 1 16-16h160a16 16 0 0 1 16 16zm-16 152a24 24 0 0 1-24 24H200a24 24 0 0 1-24-24v-4a4 4 0 0 0-4-4H16v144a64 64 0 0 0 64 64h352a64 64 0 0 0 64-64V256H340a4 4 0 0 0-4 4z"},child:[]}]})(t)}function L2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"circle",attr:{cx:"256",cy:"272",r:"64"},child:[]},{tag:"path",attr:{d:"M432 144h-59c-3 0-6.72-1.94-9.62-5l-25.94-40.94a15.52 15.52 0 0 0-1.37-1.85C327.11 85.76 315 80 302 80h-92c-13 0-25.11 5.76-34.07 16.21a15.52 15.52 0 0 0-1.37 1.85l-25.94 41c-2.22 2.42-5.34 5-8.62 5v-8a16 16 0 0 0-16-16h-24a16 16 0 0 0-16 16v8h-4a48.05 48.05 0 0 0-48 48V384a48.05 48.05 0 0 0 48 48h352a48.05 48.05 0 0 0 48-48V192a48.05 48.05 0 0 0-48-48zM256 368a96 96 0 1 1 96-96 96.11 96.11 0 0 1-96 96z"},child:[]}]})(t)}function Y5(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M494.26 276.22c-3.6-40.41-9.53-48.28-11.77-51.24-5.15-6.84-13.39-11.31-22.11-16a3.6 3.6 0 0 1-.91-5.68 15.93 15.93 0 0 0 4.53-12.53A16.27 16.27 0 0 0 447.65 176h-15.6a17 17 0 0 0-2 .13 8.5 8.5 0 0 0-1.41-.47c-9.24-19.53-21.89-46.27-48.11-59.32C341.64 97 270 96 256 96s-85.64 1-124.48 20.31c-26.22 13.05-38.87 39.79-48.11 59.32l-.08.16a6.52 6.52 0 0 0-1.35.34 17 17 0 0 0-2-.13H64.35A16.27 16.27 0 0 0 48 190.77a15.93 15.93 0 0 0 4.59 12.47 3.6 3.6 0 0 1-.91 5.68c-8.72 4.72-17 9.19-22.11 16-2.24 3-8.16 10.83-11.77 51.24-2 22.74-2.3 46.28-.73 61.44 3.29 31.5 9.46 50.54 9.72 51.33a16 16 0 0 0 13.2 10.87v.2a16 16 0 0 0 16 16h56a16 16 0 0 0 16-16c8.61 0 14.6-1.54 20.95-3.18a158.83 158.83 0 0 1 28-4.91C207.45 389 237.79 388 256 388c17.84 0 49.52 1 80.08 3.91a159.16 159.16 0 0 1 28.11 4.93c6.08 1.56 11.85 3 19.84 3.15a16 16 0 0 0 16 16h56a16 16 0 0 0 16-16v-.12A16 16 0 0 0 485.27 389c.26-.79 6.43-19.83 9.72-51.33 1.57-15.17 1.29-38.67-.73-61.45zm-381.93-86.91c8-17 17.15-36.24 33.44-44.35 23.54-11.72 72.33-17 110.23-17s86.69 5.24 110.23 17c16.29 8.11 25.4 27.36 33.44 44.35l1 2.17a8 8 0 0 1-7.44 11.42C360 202 290 199.12 256 199.12s-104 2.95-137.28 3.85a8 8 0 0 1-7.44-11.42c.35-.74.72-1.49 1.05-2.24zm11.93 79.63A427.17 427.17 0 0 1 72.42 272c-10.6 0-21.53-3-23.56-12.44-1.39-6.35-1.24-9.92-.49-13.51C49 243 50 240.78 55 240c13-2 20.27.51 41.55 6.78 14.11 4.15 24.29 9.68 30.09 14.06 2.91 2.16 1.36 7.8-2.38 8.1zm221.38 82c-13.16 1.5-39.48.95-89.34.95s-76.17.55-89.33-.95c-13.58-1.51-30.89-14.35-19.07-25.79 7.87-7.54 26.23-13.18 50.68-16.35s34.8-4.8 57.62-4.8 32.12 1 57.62 4.81 44.77 9.52 50.68 16.35c10.78 12.24-5.29 24.19-18.86 25.84zm117.5-91.39c-2 9.48-13 12.44-23.56 12.44a455.91 455.91 0 0 1-52.84-3.06c-3.06-.29-4.48-5.66-1.38-8.1 5.71-4.49 16-9.91 30.09-14.06 21.28-6.27 33.55-8.78 44.09-6.69 2.57.51 3.93 3.27 4.09 5a40.64 40.64 0 0 1-.49 14.48z"},child:[]}]})(t)}function kG(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m289.94 256 95-95A24 24 0 0 0 351 127l-95 95-95-95a24 24 0 0 0-34 34l95 95-95 95a24 24 0 1 0 34 34l95-95 95 95a24 24 0 0 0 34-34z"},child:[]}]})(t)}function O2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M473.66 210c-14-10.38-31.2-18-49.36-22.11a16.11 16.11 0 0 1-12.19-12.22c-7.8-34.75-24.59-64.55-49.27-87.13C334.15 62.25 296.21 47.79 256 47.79c-35.35 0-68 11.08-94.37 32.05a150.07 150.07 0 0 0-42.06 53 16 16 0 0 1-11.31 8.87c-26.75 5.4-50.9 16.87-69.34 33.12C13.46 197.33 0 227.24 0 261.39c0 34.52 14.49 66 40.79 88.76 25.12 21.69 58.94 33.64 95.21 33.64h104V230.42l-36.69 36.69a16 16 0 0 1-23.16-.56c-5.8-6.37-5.24-16.3.85-22.39l63.69-63.68a16 16 0 0 1 22.62 0L331 244.14c6.28 6.29 6.64 16.6.39 22.91a16 16 0 0 1-22.68.06L272 230.42v153.37h124c31.34 0 59.91-8.8 80.45-24.77 23.26-18.1 35.55-44 35.55-74.83 0-29.94-13.26-55.61-38.34-74.19zM240 448.21a16 16 0 1 0 32 0v-64.42h-32z"},child:[]}]})(t)}function Yg(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m441 336.2-.06-.05c-9.93-9.18-22.78-11.34-32.16-12.92l-.69-.12c-9.05-1.49-10.48-2.5-14.58-6.17-2.44-2.17-5.35-5.65-5.35-9.94s2.91-7.77 5.34-9.94l30.28-26.87c25.92-22.91 40.2-53.66 40.2-86.59s-14.25-63.68-40.2-86.6c-35.89-31.59-85-49-138.37-49C223.72 48 162 71.37 116 112.11c-43.87 38.77-68 90.71-68 146.24s24.16 107.47 68 146.23c21.75 19.24 47.49 34.18 76.52 44.42a266.17 266.17 0 0 0 86.87 15h1.81c61 0 119.09-20.57 159.39-56.4 9.7-8.56 15.15-20.83 15.34-34.56.21-14.17-5.37-27.95-14.93-36.84zM112 208a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm40 135a32 32 0 1 1 32-32 32 32 0 0 1-32 32zm40-199a32 32 0 1 1 32 32 32 32 0 0 1-32-32zm64 271a48 48 0 1 1 48-48 48 48 0 0 1-48 48zm72-239a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"},child:[]}]})(t)}function vu(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M440.9 136.3a4 4 0 0 0 0-6.91L288.16 40.65a64.14 64.14 0 0 0-64.33 0L71.12 129.39a4 4 0 0 0 0 6.91L254 243.88a4 4 0 0 0 4.06 0zM54 163.51a4 4 0 0 0-6 3.49v173.89a48 48 0 0 0 23.84 41.39L234 479.51a4 4 0 0 0 6-3.46V274.3a4 4 0 0 0-2-3.46zM272 275v201a4 4 0 0 0 6 3.46l162.15-97.23A48 48 0 0 0 464 340.89V167a4 4 0 0 0-6-3.45l-184 108a4 4 0 0 0-2 3.45z"},child:[]}]})(t)}function I2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"circle",attr:{cx:"256",cy:"256",r:"64"},child:[]},{tag:"path",attr:{d:"M490.84 238.6c-26.46-40.92-60.79-75.68-99.27-100.53C349 110.55 302 96 255.66 96c-42.52 0-84.33 12.15-124.27 36.11-40.73 24.43-77.63 60.12-109.68 106.07a31.92 31.92 0 0 0-.64 35.54c26.41 41.33 60.4 76.14 98.28 100.65C162 402 207.9 416 255.66 416c46.71 0 93.81-14.43 136.2-41.72 38.46-24.77 72.72-59.66 99.08-100.92a32.2 32.2 0 0 0-.1-34.76zM256 352a96 96 0 1 1 96-96 96.11 96.11 0 0 1-96 96z"},child:[]}]})(t)}function z2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M472 168H40a24 24 0 0 1 0-48h432a24 24 0 0 1 0 48zm-80 112H120a24 24 0 0 1 0-48h272a24 24 0 0 1 0 48zm-96 112h-80a24 24 0 0 1 0-48h80a24 24 0 0 1 0 48z"},child:[]}]})(t)}function B2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M261.56 101.28a8 8 0 0 0-11.06 0L66.4 277.15a8 8 0 0 0-2.47 5.79L63.9 448a32 32 0 0 0 32 32H192a16 16 0 0 0 16-16V328a8 8 0 0 1 8-8h80a8 8 0 0 1 8 8v136a16 16 0 0 0 16 16h96.06a32 32 0 0 0 32-32V282.94a8 8 0 0 0-2.47-5.79z"},child:[]},{tag:"path",attr:{d:"m490.91 244.15-74.8-71.56V64a16 16 0 0 0-16-16h-48a16 16 0 0 0-16 16v32l-57.92-55.38C272.77 35.14 264.71 32 256 32c-8.68 0-16.72 3.14-22.14 8.63l-212.7 203.5c-6.22 6-7 15.87-1.34 22.37A16 16 0 0 0 43 267.56L250.5 69.28a8 8 0 0 1 11.06 0l207.52 198.28a16 16 0 0 0 22.59-.44c6.14-6.36 5.63-16.86-.76-22.97z"},child:[]}]})(t)}function HG(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M416 64H96a64.07 64.07 0 0 0-64 64v256a64.07 64.07 0 0 0 64 64h320a64.07 64.07 0 0 0 64-64V128a64.07 64.07 0 0 0-64-64zm-80 64a48 48 0 1 1-48 48 48.05 48.05 0 0 1 48-48zM96 416a32 32 0 0 1-32-32v-67.63l94.84-84.3a48.06 48.06 0 0 1 65.8 1.9l64.95 64.81L172.37 416zm352-32a32 32 0 0 1-32 32H217.63l121.42-121.42a47.72 47.72 0 0 1 61.64-.16L448 333.84z"},child:[]}]})(t)}function U2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M256 56C145.72 56 56 145.72 56 256s89.72 200 200 200 200-89.72 200-200S366.28 56 256 56zm0 82a26 26 0 1 1-26 26 26 26 0 0 1 26-26zm48 226h-88a16 16 0 0 1 0-32h28v-88h-16a16 16 0 0 1 0-32h32a16 16 0 0 1 16 16v104h28a16 16 0 0 1 0 32z"},child:[]}]})(t)}function j2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"48",d:"M200.66 352H144a96 96 0 0 1 0-192h55.41m113.18 0H368a96 96 0 0 1 0 192h-56.66m-142.27-96h175.86"},child:[]}]})(t)}function qp(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"circle",attr:{cx:"256",cy:"192",r:"32"},child:[]},{tag:"path",attr:{d:"M256 32c-88.22 0-160 68.65-160 153 0 40.17 18.31 93.59 54.42 158.78 29 52.34 62.55 99.67 80 123.22a31.75 31.75 0 0 0 51.22 0c17.42-23.55 51-70.88 80-123.22C397.69 278.61 416 225.19 416 185c0-84.35-71.78-153-160-153zm0 224a64 64 0 1 1 64-64 64.07 64.07 0 0 1-64 64z"},child:[]}]})(t)}function F2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M368 192h-16v-80a96 96 0 1 0-192 0v80h-16a64.07 64.07 0 0 0-64 64v176a64.07 64.07 0 0 0 64 64h224a64.07 64.07 0 0 0 64-64V256a64.07 64.07 0 0 0-64-64zm-48 0H192v-80a64 64 0 1 1 128 0z"},child:[]}]})(t)}function V2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M368 192H192v-80a64 64 0 1 1 128 0 16 16 0 0 0 32 0 96 96 0 1 0-192 0v80h-16a64.07 64.07 0 0 0-64 64v176a64.07 64.07 0 0 0 64 64h224a64.07 64.07 0 0 0 64-64V256a64.07 64.07 0 0 0-64-64z"},child:[]}]})(t)}function F1(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M467 45.2A44.45 44.45 0 0 0 435.29 32H312.36a30.63 30.63 0 0 0-21.52 8.89L45.09 286.59a44.82 44.82 0 0 0 0 63.32l117 117a44.83 44.83 0 0 0 63.34 0l245.65-245.6A30.6 30.6 0 0 0 480 199.8v-123a44.24 44.24 0 0 0-13-31.6zM384 160a32 32 0 1 1 32-32 32 32 0 0 1-32 32z"},child:[]}]})(t)}function k2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"m465.94 119.76-73.7-73.7A47.68 47.68 0 0 0 358.3 32H96a64 64 0 0 0-64 64v320a64 64 0 0 0 64 64h320a64 64 0 0 0 64-64V153.7a47.68 47.68 0 0 0-14.06-33.94zM120 112h176a8 8 0 0 1 8 8v48a8 8 0 0 1-8 8H120a8 8 0 0 1-8-8v-48a8 8 0 0 1 8-8zm139.75 319.91a80 80 0 1 1 76.16-76.16 80.06 80.06 0 0 1-76.16 76.16z"},child:[]},{tag:"circle",attr:{cx:"256",cy:"352",r:"48"},child:[]}]})(t)}function $G(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M456.69 421.39 362.6 327.3a173.81 173.81 0 0 0 34.84-104.58C397.44 126.38 319.06 48 222.72 48S48 126.38 48 222.72s78.38 174.72 174.72 174.72A173.81 173.81 0 0 0 327.3 362.6l94.09 94.09a25 25 0 0 0 35.3-35.3zM97.92 222.72a124.8 124.8 0 1 1 124.8 124.8 124.95 124.95 0 0 1-124.8-124.8z"},child:[]}]})(t)}function P9(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M479.07 111.35a16 16 0 0 0-13.15-14.75C379.89 81.18 343.69 69.12 266 34.16c-7.76-2.89-12.57-2.84-20 0-77.69 35-113.89 47-199.92 62.44a16 16 0 0 0-13.15 14.75c-3.85 61.1 4.34 118 24.36 169.15a348.86 348.86 0 0 0 71.43 112.41c44.67 47.43 94.2 75.12 119.74 85.6a20 20 0 0 0 15.11 0c27-10.92 74.69-37.82 119.71-85.62a348.86 348.86 0 0 0 71.43-112.39c20.02-51.14 28.21-108.05 24.36-169.15z"},child:[]}]})(t)}function H2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M104 496H72a24 24 0 0 1-24-24V328a24 24 0 0 1 24-24h32a24 24 0 0 1 24 24v144a24 24 0 0 1-24 24zm224 0h-32a24 24 0 0 1-24-24V232a24 24 0 0 1 24-24h32a24 24 0 0 1 24 24v240a24 24 0 0 1-24 24zm112 0h-32a24 24 0 0 1-24-24V120a24 24 0 0 1 24-24h32a24 24 0 0 1 24 24v352a24 24 0 0 1-24 24zm-224 0h-32a24 24 0 0 1-24-24V40a24 24 0 0 1 24-24h32a24 24 0 0 1 24 24v432a24 24 0 0 1-24 24z"},child:[]}]})(t)}function V1(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{fill:"none",d:"M296 64h-80a7.91 7.91 0 0 0-8 8v24h96V72a7.91 7.91 0 0 0-8-8z"},child:[]},{tag:"path",attr:{d:"M432 96h-96V72a40 40 0 0 0-40-40h-80a40 40 0 0 0-40 40v24H80a16 16 0 0 0 0 32h17l19 304.92c1.42 26.85 22 47.08 48 47.08h184c26.13 0 46.3-19.78 48-47l19-305h17a16 16 0 0 0 0-32zM192.57 416H192a16 16 0 0 1-16-15.43l-8-224a16 16 0 1 1 32-1.14l8 224A16 16 0 0 1 192.57 416zM272 400a16 16 0 0 1-32 0V176a16 16 0 0 1 32 0zm32-304h-96V72a7.91 7.91 0 0 1 8-8h80a7.91 7.91 0 0 1 8 8zm32 304.57A16 16 0 0 1 320 416h-.58A16 16 0 0 1 304 399.43l8-224a16 16 0 1 1 32 1.14z"},child:[]}]})(t)}function $2e(t){return en({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M449.07 399.08 278.64 82.58c-12.08-22.44-44.26-22.44-56.35 0L51.87 399.08A32 32 0 0 0 80 446.25h340.89a32 32 0 0 0 28.18-47.17zm-198.6-1.83a20 20 0 1 1 20-20 20 20 0 0 1-20 20zm21.72-201.15-5.74 122a16 16 0 0 1-32 0l-5.74-121.95a21.73 21.73 0 0 1 21.5-22.69h.21a21.74 21.74 0 0 1 21.73 22.7z"},child:[]}]})(t)}const GG=P.createContext(null);function WG({children:t}){const[e,n]=P.useState({}),i=P.useRef({}),a=P.useCallback(o=>{i.current[o.label]=o},[]),s=P.useCallback(o=>{delete i.current[o]},[]),r=P.useCallback(()=>{const o={};let c=null;return Object.values(i.current).forEach(u=>{const h=u.validate();h&&(o[u.label]=h,!c&&u.ref&&u.ref.current&&(c=u.ref.current))}),n(o),c&&setTimeout(()=>{c.scrollIntoView({behavior:"smooth",block:"center"})},100),Object.keys(o).length===0},[]);return _.jsx(GG.Provider,{value:{registerField:a,unregisterField:s,errors:e},children:t({validate:r})})}function nS(t){const e=sn.c(67),{label:n,value:i,onChange:a,icon:s,enableAutoPointer:r,autoPointerOptions:o,description:c,onRemove:u,rayType:h,required:d}=t,p=s===void 0?qp:s,g=r===void 0?!0:r,b=h===void 0?"point":h,w=d===void 0?!1:d,{t:x}=Dn(),S=P.useRef(null),M=P.useContext(GG),C=M?.errors?.[n];let A,N;e[0]!==n||e[1]!==w||e[2]!==x||e[3]!==M||e[4]!==i?(A=()=>{if(!M){console.warn("Vector must be used inside a ValidationProvider");return}return M.registerField({ref:S,label:n,value:i,required:w,validate:()=>w&&!i?x("creator.form.location_required",{label:n}):""}),()=>M.unregisterField(n)},N=[M,n,i,w,x],e[0]=n,e[1]=w,e[2]=x,e[3]=M,e[4]=i,e[5]=A,e[6]=N):(A=e[5],N=e[6]),P.useEffect(A,N);let R;e[7]!==o||e[8]!==g||e[9]!==a||e[10]!==b||e[11]!==i?(R=async()=>{if(ut("play_sound","category_down"),g){try{let ne;b==="point"?ne=await ole(o):ne=await lle(o),a(ne)}catch(ne){console.error("Error selecting point:",ne)}return}a(i)},e[7]=o,e[8]=g,e[9]=a,e[10]=b,e[11]=i,e[12]=R):R=e[12];const D=R,B=!C;let z;e[13]!==C||e[14]!==B?(z=fn({"relative overflow-hidden rounded-xl bg-gradient-to-br from-slate-800/90 via-slate-800/80 to-slate-900/90 border transition-all duration-300":!0,"border-red-500":C,"border-slate-600/30 hover:border-slate-500/50":B}),e[13]=C,e[14]=B,e[15]=z):z=e[15];let I;e[16]===Symbol.for("react.memo_cache_sentinel")?(I=_.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-blue-500/5 via-purple-500/5 to-blue-500/5 opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e[16]=I):I=e[16];let U;e[17]!==p?(U=P.createElement(p,{size:14,className:"text-blue-400"}),e[17]=p,e[18]=U):U=e[18];let $;e[19]!==U?($=_.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-blue-500/20 to-purple-500/20 border border-blue-500/30 flex items-center justify-center",children:U}),e[19]=U,e[20]=$):$=e[20];let G;e[21]===Symbol.for("react.memo_cache_sentinel")?(G=_.jsx("div",{className:"absolute inset-0 rounded-lg bg-blue-500/20 blur-sm opacity-0 group-hover:opacity-100 transition-opacity duration-300"}),e[21]=G):G=e[21];let k;e[22]!==$?(k=_.jsxs("div",{className:"relative",children:[$,G]}),e[22]=$,e[23]=k):k=e[23];let X;e[24]!==n?(X=_.jsx("h3",{className:"text-sm font-semibold text-white leading-tight",children:n}),e[24]=n,e[25]=X):X=e[25];let V;e[26]!==c?(V=c&&_.jsx(_U,{content:c,placement:"top",children:_.jsxs("div",{className:"flex items-center gap-1 mt-0.5",children:[_.jsx(U2e,{size:10,className:"text-slate-400 flex-shrink-0"}),_.jsx("span",{className:"text-xs text-slate-400 truncate max-w-96",children:c})]})}),e[26]=c,e[27]=V):V=e[27];let H;e[28]!==X||e[29]!==V?(H=_.jsxs("div",{className:"flex-1 min-w-0",children:[X,V]}),e[28]=X,e[29]=V,e[30]=H):H=e[30];let W;e[31]!==k||e[32]!==H?(W=_.jsxs("div",{className:"flex items-center gap-2",children:[k,H]}),e[31]=k,e[32]=H,e[33]=W):W=e[33];let J;e[34]===Symbol.for("react.memo_cache_sentinel")?(J=_.jsx(qp,{size:12}),e[34]=J):J=e[34];let Y;e[35]!==x?(Y=x("creator.form.select"),e[35]=x,e[36]=Y):Y=e[36];let K;e[37]!==Y?(K=_.jsx("span",{className:"text-xs font-medium",children:Y}),e[37]=Y,e[38]=K):K=e[38];let ee;e[39]!==D||e[40]!==K?(ee=_.jsx(Zt,{size:"sm",variant:"flat",onPress:D,className:"bg-slate-700/60 hover:bg-slate-600/60 text-slate-200 border border-slate-600/40 hover:border-slate-500/50 transition-all duration-300 shadow-sm hover:shadow-md",startContent:J,children:K}),e[39]=D,e[40]=K,e[41]=ee):ee=e[41];let ie;e[42]!==u||e[43]!==x?(ie=u&&_.jsx(Zt,{size:"sm",variant:"flat",onPress:u,className:"bg-slate-700/60 hover:bg-slate-600/60 text-slate-200 border border-slate-600/40 hover:border-slate-500/50 transition-all duration-300 shadow-sm hover:shadow-md",startContent:_.jsx(V1,{size:12}),children:x("creator.form.remove")}),e[42]=u,e[43]=x,e[44]=ie):ie=e[44];let Z;e[45]!==ee||e[46]!==ie?(Z=_.jsxs("div",{className:"flex items-center gap-2",children:[ee,ie]}),e[45]=ee,e[46]=ie,e[47]=Z):Z=e[47];let ue;e[48]!==W||e[49]!==Z?(ue=_.jsxs("div",{className:"flex items-center justify-between mb-2",children:[W,Z]}),e[48]=W,e[49]=Z,e[50]=ue):ue=e[50];let se;e[51]!==x||e[52]!==i?(se=_.jsx("div",{className:"flex items-center gap-2 p-2 bg-slate-900/30 rounded-lg border border-slate-600/20",children:_.jsx("div",{className:"flex flex-wrap gap-1.5 items-center flex-1",children:i?_.jsx("span",{className:"text-xs text-slate-300 font-mono bg-slate-700/50 px-2 py-0.5 rounded break-all whitespace-pre-wrap",children:JSON.stringify(i)}):_.jsxs("div",{className:"flex flex-col items-center justify-center w-full py-4 animate-fade-in",children:[_.jsx("div",{className:"flex items-center justify-center mb-2",children:_.jsx(qp,{className:"text-blue-400 animate-pulse",size:28})}),_.jsx("span",{className:"text-sm text-slate-400 font-semibold mb-1",children:x("creator.form.no_location_selected")}),_.jsx("span",{className:"text-xs text-slate-500 text-center max-w-xs",children:x("creator.form.no_location_selected_description")})]})})}),e[51]=x,e[52]=i,e[53]=se):se=e[53];let ae;e[54]!==C?(ae=C&&_.jsx("div",{className:"text-xs text-red-500 mt-1 ml-1",children:C}),e[54]=C,e[55]=ae):ae=e[55];let ce;e[56]!==ue||e[57]!==se||e[58]!==ae?(ce=_.jsxs("div",{className:"relative p-3",children:[ue,se,ae]}),e[56]=ue,e[57]=se,e[58]=ae,e[59]=ce):ce=e[59];let pe;e[60]===Symbol.for("react.memo_cache_sentinel")?(pe=_.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-px bg-gradient-to-r from-transparent via-blue-500/50 to-transparent opacity-0 group-hover:opacity-100 transition-opacity duration-500"}),e[60]=pe):pe=e[60];let ye;e[61]!==ce||e[62]!==z?(ye=_.jsxs("div",{className:z,children:[I,ce,pe]}),e[61]=ce,e[62]=z,e[63]=ye):ye=e[63];let _e;e[64]===Symbol.for("react.memo_cache_sentinel")?(_e=_.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-blue-500/20 via-purple-500/20 to-blue-500/20 rounded-xl blur opacity-0 group-hover:opacity-100 transition-opacity duration-500 -z-10"}),e[64]=_e):_e=e[64];let me;return e[65]!==ye?(me=_.jsxs("div",{className:"group relative w-full",children:[ye,_e]}),e[65]=ye,e[66]=me):me=e[66],me}function G2e(t){const e=sn.c(13),{title:n,description:i,enable:a,onEnableChange:s}=t;let r;e[0]!==n?(r=_.jsx("span",{className:"text-lg font-semibold white-subtitle",children:n}),e[0]=n,e[1]=r):r=e[1];let o;e[2]!==i?(o=i&&_.jsx("i",{className:"text-sm text-slate-400",children:i}),e[2]=i,e[3]=o):o=e[3];let c;e[4]!==r||e[5]!==o?(c=_.jsxs("div",{className:"flex flex-col",children:[r,o]}),e[4]=r,e[5]=o,e[6]=c):c=e[6];let u;e[7]!==a||e[8]!==s?(u=typeof a=="boolean"&&s&&_.jsx("div",{className:"flex items-center gap-2",children:_.jsx(a1,{isSelected:a,onValueChange:s})}),e[7]=a,e[8]=s,e[9]=u):u=e[9];let h;return e[10]!==c||e[11]!==u?(h=_.jsxs("div",{className:"col-span-full mb-2 flex items-center justify-between",children:[c,u]}),e[10]=c,e[11]=u,e[12]=h):h=e[12],h}function W2e(t){const e=sn.c(11);let n;e[0]!==t?(n=t===void 0?{}:t,e[0]=t,e[1]=n):n=e[1];const i=n,[a,s]=P.useState(!1),[r,o]=P.useState(!1),c=P.useRef(null);let u,h;e[2]!==r||e[3]!==i.root||e[4]!==i.rootMargin||e[5]!==i.threshold?(u=()=>{const p=c.current;if(!p)return;const g=new IntersectionObserver(b=>{const[w]=b,x=w.isIntersecting;s(x),x&&!r&&o(!0)},{threshold:i.threshold||.1,rootMargin:i.rootMargin||"0px",root:i.root||null});return g.observe(p),()=>{g.unobserve(p)}},h=[i.threshold,i.rootMargin,i.root,r],e[2]=r,e[3]=i.root,e[4]=i.rootMargin,e[5]=i.threshold,e[6]=u,e[7]=h):(u=e[6],h=e[7]),P.useEffect(u,h);let d;return e[8]!==r||e[9]!==a?(d={elementRef:c,isIntersecting:a,hasIntersected:r},e[8]=r,e[9]=a,e[10]=d):d=e[10],d}const rm=P.forwardRef(({id:t,children:e,fallback:n,threshold:i=.1,rootMargin:a="50px",className:s="",onRef:r,preserveHeight:o=!0},c)=>{const[u,h]=Vf(`lazy-load-wrapper-content-height-${t}`,0),{elementRef:d,hasIntersected:p}=W2e({threshold:i,rootMargin:a}),g=P.useRef(null),b=P.useRef(null),w=S=>{d.current=S,typeof c=="function"?c(S):c&&"current"in c&&(c.current=S),r&&r(S)};P.useEffect(()=>{if(p&&g.current&&o){const S=new ResizeObserver(M=>{for(const C of M){const A=C.contentRect.height;A>0&&h(A)}});return S.observe(g.current),b.current=S,()=>{S.disconnect()}}},[p,o]);const x=_.jsx("div",{className:"flex items-center justify-center p-8",children:_.jsx(Yf,{size:"lg",color:"primary"})});return _.jsx("div",{ref:w,className:s,style:!p&&u?{minHeight:`${u}px`}:void 0,children:p?_.jsx(Ve.div,{ref:g,initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,ease:"easeOut"},className:"h-full",children:_.jsx(P.Suspense,{fallback:n||x,children:e})}):_.jsx("div",{className:"flex items-center justify-center p-8",style:u?{height:`${u}px`}:{minHeight:"200px"},children:_.jsx(Yf,{size:"lg",color:"primary"})})})});rm.displayName="LazyLoadWrapper";function Gb(t){const e=sn.c(31),{title:n,description:i,value:a,onChange:s,children:r,customChangeKey:o,ref:c,disableOverflow:u}=t,h=o===void 0?"enable":o,d=u===void 0?!1:u;let p;e[0]!==h||e[1]!==s||e[2]!==a?(p=U=>{ut("play_sound",U?"admin_active":"admin_disable"),s&&s({...a,[h]:U})},e[0]=h,e[1]=s,e[2]=a,e[3]=p):p=e[3];const g=p,b=a?.[h]===void 0||a?.[h]===!0;let w,x,S;e[4]===Symbol.for("react.memo_cache_sentinel")?(w={opacity:0,y:20},x={opacity:1,y:0},S={duration:.3,ease:"easeOut"},e[4]=w,e[5]=x,e[6]=S):(w=e[4],x=e[5],S=e[6]);const M=a?.[h];let C;e[7]!==i||e[8]!==g||e[9]!==M||e[10]!==n?(C=_.jsx(G2e,{title:n,description:i,enable:M,onEnableChange:g}),e[7]=i,e[8]=g,e[9]=M,e[10]=n,e[11]=C):C=e[11];const A=!d;let N;e[12]!==d||e[13]!==A?(N=fn({"col-span-full overflow-hidden":A,"col-span-full":d}),e[12]=d,e[13]=A,e[14]=N):N=e[14];let R;e[15]!==r||e[16]!==d||e[17]!==b?(R=b&&_.jsx(Ve.div,{className:fn({"col-span-full overflow-hidden":!d,"col-span-full":d}),initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.4,ease:"easeInOut",opacity:{duration:.2},height:{duration:.2}},children:r}),e[15]=r,e[16]=d,e[17]=b,e[18]=R):R=e[18];let D;e[19]!==R?(D=_.jsx(Hs,{mode:"wait",children:R}),e[19]=R,e[20]=D):D=e[20];let B;e[21]!==N||e[22]!==D?(B=_.jsx("div",{className:N,children:D}),e[21]=N,e[22]=D,e[23]=B):B=e[23];let z;e[24]!==B||e[25]!==C?(z=_.jsxs(Ve.div,{className:"bg-slate-800/60 rounded-lg p-4 grid grid-cols-1 md:grid-cols-2 gap-4",initial:w,animate:x,transition:S,children:[C,B]}),e[24]=B,e[25]=C,e[26]=z):z=e[26];let I;return e[27]!==c||e[28]!==z||e[29]!==n?(I=_.jsx(rm,{id:n,ref:c,children:z},n),e[27]=c,e[28]=z,e[29]=n,e[30]=I):I=e[30],I}const K2e={vehicle:"t20",plane:"dodo",boat:"speeder"};function X2e(t){const e=sn.c(108),{zone:n,coords:i,shell:a,interiorType:s,price:r,storePrice:o,garageType:c,onZoneChange:u,onCoordsChange:h,onShellChange:d,onPriceChange:p,onStorePriceChange:g}=t,{t:b}=Dn(),[w,x]=P.useState(o!==void 0&&o>0);let S;e[0]!==u?(S=async()=>{ut("close");const We=await ut("creator_select_points");We&&u(We)},e[0]=u,e[1]=S):S=e[1];const M=S;let C;e[2]!==c||e[3]!==s||e[4]!==d||e[5]!==a?.shell?(C=async()=>{ut("close");const We=await ut("creator_select_shell",{garageType:c,currentShellId:a?.shell,interiorType:s});d(We)},e[2]=c,e[3]=s,e[4]=d,e[5]=a?.shell,e[6]=C):C=e[6];const A=C;let N;e[7]!==g||e[8]!==o?(N=We=>{ut("play_sound","item_down"),x(We),g(We?o||0:void 0)},e[7]=g,e[8]=o,e[9]=N):N=e[9];const R=N;let D;e[10]!==b?(D=b("creator.form.location.title"),e[10]=b,e[11]=D):D=e[11];let B;e[12]!==b?(B=b("creator.form.location.zone_points"),e[12]=b,e[13]=B):B=e[13];let z;e[14]!==b?(z=b("creator.form.location.zone_points_description"),e[14]=b,e[15]=z):z=e[15];const I=n?.points;let U;e[16]!==M||e[17]!==B||e[18]!==z||e[19]!==I?(U=_.jsx(nS,{enableAutoPointer:!1,label:B,description:z,value:I,onChange:M,icon:Ple,required:!0}),e[16]=M,e[17]=B,e[18]=z,e[19]=I,e[20]=U):U=e[20];let $;e[21]!==b?($=b("creator.form.location.menu_coords"),e[21]=b,e[22]=$):$=e[22];const G=i?.menuCoords;let k;e[23]!==i||e[24]!==h?(k=We=>h({...i,menuCoords:We}),e[23]=i,e[24]=h,e[25]=k):k=e[25];let X;e[26]!==G||e[27]!==k||e[28]!==$?(X=_.jsx(nS,{label:$,value:G,onChange:k,icon:qp,required:!0}),e[26]=G,e[27]=k,e[28]=$,e[29]=X):X=e[29];let V;e[30]!==b?(V=b("creator.form.location.spawn_coords"),e[30]=b,e[31]=V):V=e[31];const H=i?.spawnCoords;let W;e[32]!==i||e[33]!==h?(W=We=>h({...i,spawnCoords:We}),e[32]=i,e[33]=h,e[34]=W):W=e[34];const J=K2e[c];let Y;e[35]!==J?(Y={pointType:"vehicle",options:{model:J}},e[35]=J,e[36]=Y):Y=e[36];let K;e[37]!==V||e[38]!==H||e[39]!==W||e[40]!==Y?(K=_.jsx(nS,{label:V,value:H,onChange:W,autoPointerOptions:Y,icon:qp,required:!0}),e[37]=V,e[38]=H,e[39]=W,e[40]=Y,e[41]=K):K=e[41];let ee;e[42]!==c||e[43]!==A||e[44]!==a||e[45]!==b?(ee=c!=="boat"&&_.jsx(nS,{enableAutoPointer:!1,label:b("creator.shell_selector.title"),description:b("creator.shell_selector.description"),value:a,onChange:A,icon:Lle,required:!0}),e[42]=c,e[43]=A,e[44]=a,e[45]=b,e[46]=ee):ee=e[46];let ie;e[47]!==X||e[48]!==K||e[49]!==ee||e[50]!==U?(ie=_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[U,X,K,ee]}),e[47]=X,e[48]=K,e[49]=ee,e[50]=U,e[51]=ie):ie=e[51];let Z;e[52]===Symbol.for("react.memo_cache_sentinel")?(Z=_.jsx(o1,{className:"text-blue-400 text-lg"}),e[52]=Z):Z=e[52];let ue;e[53]!==b?(ue=b("creator.price.title"),e[53]=b,e[54]=ue):ue=e[54];let se;e[55]!==ue?(se=_.jsxs("div",{className:"flex items-center gap-2",children:[Z,_.jsx("h4",{className:"text-sm font-semibold text-white",children:ue})]}),e[55]=ue,e[56]=se):se=e[56];let ae;e[57]!==b?(ae=b("creator.price.description"),e[57]=b,e[58]=ae):ae=e[58];let ce;e[59]!==ae?(ce=_.jsx("p",{className:"text-xs text-slate-400",children:ae}),e[59]=ae,e[60]=ce):ce=e[60];const pe=r||0;let ye;e[61]===Symbol.for("react.memo_cache_sentinel")?(ye=_.jsx("div",{className:"pointer-events-none flex items-center",children:_.jsx("span",{className:"text-slate-400 text-sm",children:"$"})}),e[61]=ye):ye=e[61];let _e;e[62]===Symbol.for("react.memo_cache_sentinel")?(_e={input:"text-right",inputWrapper:fn("bg-slate-900/50 border-blue-500/30 hover:border-blue-500/50","data-[hover=true]:bg-slate-900/70")},e[62]=_e):_e=e[62];let me;e[63]!==p||e[64]!==pe?(me=_.jsx(Fo,{value:pe,onValueChange:p,placeholder:"0",min:0,defaultValue:0,startContent:ye,classNames:_e,isRequired:!0}),e[63]=p,e[64]=pe,e[65]=me):me=e[65];let ne;e[66]!==se||e[67]!==ce||e[68]!==me?(ne=_.jsx(js,{className:"bg-gradient-to-br from-blue-500/10 to-blue-500/5 border border-blue-500/30",children:_.jsx(Gr,{className:"p-4",children:_.jsxs("div",{className:"space-y-3",children:[se,ce,me]})})}),e[66]=se,e[67]=ce,e[68]=me,e[69]=ne):ne=e[69];const be=w?"bg-gradient-to-br from-green-500/10 to-emerald-500/10 border-green-500/30":"bg-slate-800/40 border-slate-700/30";let xe;e[70]!==be?(xe=fn("transition-all duration-300 border",be),e[70]=be,e[71]=xe):xe=e[71];let he;e[72]===Symbol.for("react.memo_cache_sentinel")?(he={label:"text-sm font-semibold text-white"},e[72]=he):he=e[72];const ve=w?"text-green-400":"text-slate-400";let Oe;e[73]!==ve?(Oe=fn("text-lg transition-colors",ve),e[73]=ve,e[74]=Oe):Oe=e[74];let Le;e[75]!==Oe?(Le=_.jsx(o1,{className:Oe}),e[75]=Oe,e[76]=Le):Le=e[76];let Ae;e[77]!==b?(Ae=b("creator.store_price.enable"),e[77]=b,e[78]=Ae):Ae=e[78];let et;e[79]!==Ae?(et=_.jsx("span",{children:Ae}),e[79]=Ae,e[80]=et):et=e[80];let tt;e[81]!==Le||e[82]!==et?(tt=_.jsxs("div",{className:"flex items-center gap-2",children:[Le,et]}),e[81]=Le,e[82]=et,e[83]=tt):tt=e[83];let re;e[84]!==R||e[85]!==w||e[86]!==tt?(re=_.jsx(Kae,{isSelected:w,onValueChange:R,classNames:he,children:tt}),e[84]=R,e[85]=w,e[86]=tt,e[87]=re):re=e[87];let te;e[88]!==g||e[89]!==o||e[90]!==w||e[91]!==b?(te=w&&_.jsxs("div",{className:"space-y-2 animate-in fade-in slide-in-from-top-2 duration-300",children:[_.jsx("p",{className:"text-xs text-slate-400",children:b("creator.store_price.description")}),_.jsx(Fo,{value:o||0,onValueChange:g,placeholder:"0",min:0,startContent:_.jsx("div",{className:"pointer-events-none flex items-center",children:_.jsx("span",{className:"text-slate-400 text-sm",children:"$"})}),classNames:{input:"text-right",inputWrapper:fn("bg-slate-900/50 border-green-500/30 hover:border-green-500/50","data-[hover=true]:bg-slate-900/70")}})]}),e[88]=g,e[89]=o,e[90]=w,e[91]=b,e[92]=te):te=e[92];let we;e[93]!==re||e[94]!==te?(we=_.jsx(Gr,{className:"p-4",children:_.jsxs("div",{className:"space-y-3",children:[re,te]})}),e[93]=re,e[94]=te,e[95]=we):we=e[95];let Ce;e[96]!==xe||e[97]!==we?(Ce=_.jsx(js,{className:xe,children:we}),e[96]=xe,e[97]=we,e[98]=Ce):Ce=e[98];let Ie;e[99]!==ne||e[100]!==Ce?(Ie=_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 mt-3",children:[ne,Ce]}),e[99]=ne,e[100]=Ce,e[101]=Ie):Ie=e[101];let Pe;e[102]!==ie||e[103]!==Ie?(Pe=_.jsxs("div",{className:"col-span-full",children:[ie,Ie]}),e[102]=ie,e[103]=Ie,e[104]=Pe):Pe=e[104];let Ze;return e[105]!==D||e[106]!==Pe?(Ze=_.jsx(Gb,{title:D,children:Pe},"location"),e[105]=D,e[106]=Pe,e[107]=Ze):Ze=e[107],Ze}function q2e(t){const e=sn.c(112),{garage:n,onGarageTypeChange:i}=t,{t:a}=Dn(),s=n.type==="vehicle"?"solid":"light",r=n.type==="vehicle"?"primary":"default";let o;e[0]!==i?(o=()=>i("vehicle"),e[0]=i,e[1]=o):o=e[1];const c=n.type==="vehicle",u=n.type!=="vehicle";let h;e[2]!==c||e[3]!==u?(h=fn("p-2 rounded-lg transition-all duration-300",{"bg-blue-500/30 border border-blue-500/50":c,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-blue-500/20":u}),e[2]=c,e[3]=u,e[4]=h):h=e[4];const d=n.type==="vehicle",p=n.type!=="vehicle";let g;e[5]!==d||e[6]!==p?(g=fn("text-xl transition-all duration-300",{"text-blue-200":d,"text-slate-400 group-hover:text-blue-300":p}),e[5]=d,e[6]=p,e[7]=g):g=e[7];let b;e[8]!==g?(b=_.jsx(Y5,{className:g}),e[8]=g,e[9]=b):b=e[9];let w;e[10]!==b||e[11]!==h?(w=_.jsx("div",{className:h,children:b}),e[10]=b,e[11]=h,e[12]=w):w=e[12];const x=n.type==="vehicle",S=n.type!=="vehicle";let M;e[13]!==x||e[14]!==S?(M=fn("font-semibold transition-all duration-300",{"text-blue-100":x,"text-white group-hover:text-blue-100":S}),e[13]=x,e[14]=S,e[15]=M):M=e[15];let C;e[16]!==a?(C=a("creator.garage_type_selector.vehicle"),e[16]=a,e[17]=C):C=e[17];let A;e[18]!==M||e[19]!==C?(A=_.jsx("h4",{className:M,children:C}),e[18]=M,e[19]=C,e[20]=A):A=e[20];let N;e[21]!==a?(N=a("creator.garage_type_selector.vehicle_description"),e[21]=a,e[22]=N):N=e[22];let R;e[23]!==N?(R=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:N}),e[23]=N,e[24]=R):R=e[24];let D;e[25]!==A||e[26]!==R?(D=_.jsxs("div",{className:"flex-1",children:[A,R]}),e[25]=A,e[26]=R,e[27]=D):D=e[27];let B;e[28]!==w||e[29]!==D?(B=_.jsxs("div",{className:"flex items-center gap-3",children:[w,D]}),e[28]=w,e[29]=D,e[30]=B):B=e[30];let z;e[31]!==s||e[32]!==r||e[33]!==B||e[34]!==o?(z=_.jsx(Zt,{variant:s,color:r,onPress:o,className:"block w-full h-full text-left p-4",children:B}),e[31]=s,e[32]=r,e[33]=B,e[34]=o,e[35]=z):z=e[35];const I=n.type==="plane"?"solid":"light",U=n.type==="plane"?"secondary":"default";let $;e[36]!==i?($=()=>i("plane"),e[36]=i,e[37]=$):$=e[37];const G=n.type==="plane",k=n.type!=="plane";let X;e[38]!==G||e[39]!==k?(X=fn("p-2 rounded-lg transition-all duration-300",{"bg-purple-500/30 border border-purple-500/50":G,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-purple-500/20":k}),e[38]=G,e[39]=k,e[40]=X):X=e[40];const V=n.type==="plane",H=n.type!=="plane";let W;e[41]!==V||e[42]!==H?(W=fn("text-xl transition-all duration-300",{"text-purple-200":V,"text-slate-400 group-hover:text-purple-300":H}),e[41]=V,e[42]=H,e[43]=W):W=e[43];let J;e[44]!==W?(J=_.jsx(FG,{className:W}),e[44]=W,e[45]=J):J=e[45];let Y;e[46]!==X||e[47]!==J?(Y=_.jsx("div",{className:X,children:J}),e[46]=X,e[47]=J,e[48]=Y):Y=e[48];const K=n.type==="plane",ee=n.type!=="plane";let ie;e[49]!==K||e[50]!==ee?(ie=fn("font-semibold transition-all duration-300",{"text-purple-100":K,"text-white group-hover:text-purple-100":ee}),e[49]=K,e[50]=ee,e[51]=ie):ie=e[51];let Z;e[52]!==a?(Z=a("creator.garage_type_selector.plane"),e[52]=a,e[53]=Z):Z=e[53];let ue;e[54]!==ie||e[55]!==Z?(ue=_.jsx("h4",{className:ie,children:Z}),e[54]=ie,e[55]=Z,e[56]=ue):ue=e[56];let se;e[57]!==a?(se=a("creator.garage_type_selector.plane_description"),e[57]=a,e[58]=se):se=e[58];let ae;e[59]!==se?(ae=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:se}),e[59]=se,e[60]=ae):ae=e[60];let ce;e[61]!==ue||e[62]!==ae?(ce=_.jsxs("div",{className:"flex-1",children:[ue,ae]}),e[61]=ue,e[62]=ae,e[63]=ce):ce=e[63];let pe;e[64]!==Y||e[65]!==ce?(pe=_.jsxs("div",{className:"flex items-center gap-3",children:[Y,ce]}),e[64]=Y,e[65]=ce,e[66]=pe):pe=e[66];let ye;e[67]!==I||e[68]!==U||e[69]!==$||e[70]!==pe?(ye=_.jsx(Zt,{variant:I,color:U,onPress:$,className:"block w-full h-full text-left p-4",children:pe}),e[67]=I,e[68]=U,e[69]=$,e[70]=pe,e[71]=ye):ye=e[71];const _e=n.type==="boat"?"solid":"light",me=n.type==="boat"?"success":"default";let ne;e[72]!==i?(ne=()=>i("boat"),e[72]=i,e[73]=ne):ne=e[73];const be=n.type==="boat",xe=n.type!=="boat";let he;e[74]!==be||e[75]!==xe?(he=fn("p-2 rounded-lg transition-all duration-300",{"bg-green-500/30 border border-green-500/50":be,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-green-500/20":xe}),e[74]=be,e[75]=xe,e[76]=he):he=e[76];const ve=n.type==="boat",Oe=n.type!=="boat";let Le;e[77]!==ve||e[78]!==Oe?(Le=fn("text-xl transition-all duration-300",{"text-green-200":ve,"text-slate-400 group-hover:text-green-300":Oe}),e[77]=ve,e[78]=Oe,e[79]=Le):Le=e[79];let Ae;e[80]!==Le?(Ae=_.jsx(VG,{className:Le}),e[80]=Le,e[81]=Ae):Ae=e[81];let et;e[82]!==he||e[83]!==Ae?(et=_.jsx("div",{className:he,children:Ae}),e[82]=he,e[83]=Ae,e[84]=et):et=e[84];const tt=n.type==="boat",re=n.type!=="boat";let te;e[85]!==tt||e[86]!==re?(te=fn("font-semibold transition-all duration-300",{"text-green-100":tt,"text-white group-hover:text-green-100":re}),e[85]=tt,e[86]=re,e[87]=te):te=e[87];let we;e[88]!==a?(we=a("creator.garage_type_selector.boat"),e[88]=a,e[89]=we):we=e[89];let Ce;e[90]!==te||e[91]!==we?(Ce=_.jsx("h4",{className:te,children:we}),e[90]=te,e[91]=we,e[92]=Ce):Ce=e[92];let Ie;e[93]!==a?(Ie=a("creator.garage_type_selector.boat_description"),e[93]=a,e[94]=Ie):Ie=e[94];let Pe;e[95]!==Ie?(Pe=_.jsx("p",{className:"text-xs text-slate-300 group-hover:text-slate-300 transition-colors",children:Ie}),e[95]=Ie,e[96]=Pe):Pe=e[96];let Ze;e[97]!==Ce||e[98]!==Pe?(Ze=_.jsxs("div",{className:"flex-1",children:[Ce,Pe]}),e[97]=Ce,e[98]=Pe,e[99]=Ze):Ze=e[99];let We;e[100]!==et||e[101]!==Ze?(We=_.jsxs("div",{className:"flex items-center gap-3",children:[et,Ze]}),e[100]=et,e[101]=Ze,e[102]=We):We=e[102];let mt;e[103]!==_e||e[104]!==me||e[105]!==ne||e[106]!==We?(mt=_.jsx(Zt,{variant:_e,color:me,onPress:ne,className:"block w-full h-full text-left p-4",children:We}),e[103]=_e,e[104]=me,e[105]=ne,e[106]=We,e[107]=mt):mt=e[107];let nt;return e[108]!==z||e[109]!==ye||e[110]!==mt?(nt=_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 p-2 border border-slate-700/50 rounded-lg",children:[z,ye,mt]}),e[108]=z,e[109]=ye,e[110]=mt,e[111]=nt):nt=e[111],nt}function Y2e(t){const e=sn.c(112),{garage:n,onAccessTypeChange:i}=t,{t:a}=Dn(),r=n.isImpound?"impound":n.available?"public":"private",o=r==="public"?"solid":"light",c=r==="public"?"success":"default";let u;e[0]!==i?(u=()=>i("public"),e[0]=i,e[1]=u):u=e[1];const h=r==="public",d=r!=="public";let p;e[2]!==h||e[3]!==d?(p=fn("p-2 rounded-lg transition-all duration-300",{"bg-green-500/30 border border-green-500/50":h,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-green-500/20":d}),e[2]=h,e[3]=d,e[4]=p):p=e[4];const g=r==="public",b=r!=="public";let w;e[5]!==g||e[6]!==b?(w=fn("text-xl transition-all duration-300",{"text-green-200":g,"text-slate-400 group-hover:text-green-300":b}),e[5]=g,e[6]=b,e[7]=w):w=e[7];let x;e[8]!==w?(x=_.jsx(V2e,{className:w}),e[8]=w,e[9]=x):x=e[9];let S;e[10]!==x||e[11]!==p?(S=_.jsx("div",{className:p,children:x}),e[10]=x,e[11]=p,e[12]=S):S=e[12];const M=r==="public",C=r!=="public";let A;e[13]!==M||e[14]!==C?(A=fn("font-semibold transition-all duration-300",{"text-green-100":M,"text-white group-hover:text-green-100":C}),e[13]=M,e[14]=C,e[15]=A):A=e[15];let N;e[16]!==a?(N=a("creator.garage_access_selector.public"),e[16]=a,e[17]=N):N=e[17];let R;e[18]!==A||e[19]!==N?(R=_.jsx("h4",{className:A,children:N}),e[18]=A,e[19]=N,e[20]=R):R=e[20];let D;e[21]!==a?(D=a("creator.garage_access_selector.public_description"),e[21]=a,e[22]=D):D=e[22];let B;e[23]!==D?(B=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:D}),e[23]=D,e[24]=B):B=e[24];let z;e[25]!==R||e[26]!==B?(z=_.jsxs("div",{className:"flex-1",children:[R,B]}),e[25]=R,e[26]=B,e[27]=z):z=e[27];let I;e[28]!==S||e[29]!==z?(I=_.jsxs("div",{className:"flex items-center gap-3",children:[S,z]}),e[28]=S,e[29]=z,e[30]=I):I=e[30];let U;e[31]!==o||e[32]!==c||e[33]!==I||e[34]!==u?(U=_.jsx(Zt,{variant:o,color:c,onPress:u,className:"block w-full h-full text-left p-4",children:I}),e[31]=o,e[32]=c,e[33]=I,e[34]=u,e[35]=U):U=e[35];const $=r==="private"?"solid":"light",G=r==="private"?"primary":"default";let k;e[36]!==i?(k=()=>i("private"),e[36]=i,e[37]=k):k=e[37];const X=r==="private",V=r!=="private";let H;e[38]!==X||e[39]!==V?(H=fn("p-2 rounded-lg transition-all duration-300",{"bg-blue-500/30 border border-blue-500/50":X,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-blue-500/20":V}),e[38]=X,e[39]=V,e[40]=H):H=e[40];const W=r==="private",J=r!=="private";let Y;e[41]!==W||e[42]!==J?(Y=fn("text-xl transition-all duration-300",{"text-blue-200":W,"text-slate-400 group-hover:text-blue-300":J}),e[41]=W,e[42]=J,e[43]=Y):Y=e[43];let K;e[44]!==Y?(K=_.jsx(F2e,{className:Y}),e[44]=Y,e[45]=K):K=e[45];let ee;e[46]!==H||e[47]!==K?(ee=_.jsx("div",{className:H,children:K}),e[46]=H,e[47]=K,e[48]=ee):ee=e[48];const ie=r==="private",Z=r!=="private";let ue;e[49]!==ie||e[50]!==Z?(ue=fn("font-semibold transition-all duration-300",{"text-blue-100":ie,"text-white group-hover:text-blue-100":Z}),e[49]=ie,e[50]=Z,e[51]=ue):ue=e[51];let se;e[52]!==a?(se=a("creator.garage_access_selector.private"),e[52]=a,e[53]=se):se=e[53];let ae;e[54]!==ue||e[55]!==se?(ae=_.jsx("h4",{className:ue,children:se}),e[54]=ue,e[55]=se,e[56]=ae):ae=e[56];let ce;e[57]!==a?(ce=a("creator.garage_access_selector.private_description"),e[57]=a,e[58]=ce):ce=e[58];let pe;e[59]!==ce?(pe=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:ce}),e[59]=ce,e[60]=pe):pe=e[60];let ye;e[61]!==ae||e[62]!==pe?(ye=_.jsxs("div",{className:"flex-1",children:[ae,pe]}),e[61]=ae,e[62]=pe,e[63]=ye):ye=e[63];let _e;e[64]!==ee||e[65]!==ye?(_e=_.jsxs("div",{className:"flex items-center gap-3",children:[ee,ye]}),e[64]=ee,e[65]=ye,e[66]=_e):_e=e[66];let me;e[67]!==$||e[68]!==G||e[69]!==k||e[70]!==_e?(me=_.jsx(Zt,{variant:$,color:G,onPress:k,className:"block w-full h-full text-left p-4",children:_e}),e[67]=$,e[68]=G,e[69]=k,e[70]=_e,e[71]=me):me=e[71];const ne=r==="impound"?"solid":"light",be=r==="impound"?"danger":"default";let xe;e[72]!==i?(xe=()=>i("impound"),e[72]=i,e[73]=xe):xe=e[73];const he=r==="impound",ve=r!=="impound";let Oe;e[74]!==he||e[75]!==ve?(Oe=fn("p-2 rounded-lg transition-all duration-300",{"bg-red-500/30 border border-red-500/50":he,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-red-500/20":ve}),e[74]=he,e[75]=ve,e[76]=Oe):Oe=e[76];const Le=r==="impound",Ae=r!=="impound";let et;e[77]!==Le||e[78]!==Ae?(et=fn("text-xl transition-all duration-300",{"text-red-200":Le,"text-slate-400 group-hover:text-red-300":Ae}),e[77]=Le,e[78]=Ae,e[79]=et):et=e[79];let tt;e[80]!==et?(tt=_.jsx($2e,{className:et}),e[80]=et,e[81]=tt):tt=e[81];let re;e[82]!==Oe||e[83]!==tt?(re=_.jsx("div",{className:Oe,children:tt}),e[82]=Oe,e[83]=tt,e[84]=re):re=e[84];const te=r==="impound",we=r!=="impound";let Ce;e[85]!==te||e[86]!==we?(Ce=fn("font-semibold transition-all duration-300",{"text-red-100":te,"text-white group-hover:text-red-100":we}),e[85]=te,e[86]=we,e[87]=Ce):Ce=e[87];let Ie;e[88]!==a?(Ie=a("creator.garage_access_selector.impound"),e[88]=a,e[89]=Ie):Ie=e[89];let Pe;e[90]!==Ce||e[91]!==Ie?(Pe=_.jsx("h4",{className:Ce,children:Ie}),e[90]=Ce,e[91]=Ie,e[92]=Pe):Pe=e[92];let Ze;e[93]!==a?(Ze=a("creator.garage_access_selector.impound_description"),e[93]=a,e[94]=Ze):Ze=e[94];let We;e[95]!==Ze?(We=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:Ze}),e[95]=Ze,e[96]=We):We=e[96];let mt;e[97]!==Pe||e[98]!==We?(mt=_.jsxs("div",{className:"flex-1",children:[Pe,We]}),e[97]=Pe,e[98]=We,e[99]=mt):mt=e[99];let nt;e[100]!==re||e[101]!==mt?(nt=_.jsxs("div",{className:"flex items-center gap-3",children:[re,mt]}),e[100]=re,e[101]=mt,e[102]=nt):nt=e[102];let Ye;e[103]!==ne||e[104]!==be||e[105]!==xe||e[106]!==nt?(Ye=_.jsx(Zt,{variant:ne,color:be,onPress:xe,className:"block w-full h-full text-left p-4",children:nt}),e[103]=ne,e[104]=be,e[105]=xe,e[106]=nt,e[107]=Ye):Ye=e[107];let Je;return e[108]!==U||e[109]!==me||e[110]!==Ye?(Je=_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 p-2 border border-slate-700/50 rounded-lg",children:[U,me,Ye]}),e[108]=U,e[109]=me,e[110]=Ye,e[111]=Je):Je=e[111],Je}function Z2e(t){const e=sn.c(75),{garage:n,onInteriorTypeChange:i}=t,{t:a}=Dn(),s=n.interior_type==="ipl"?"solid":"light",r=n.interior_type==="ipl"?"primary":"default";let o;e[0]!==i?(o=()=>i("ipl"),e[0]=i,e[1]=o):o=e[1];const c=n.interior_type==="ipl",u=n.interior_type!=="ipl";let h;e[2]!==c||e[3]!==u?(h=fn("p-2 rounded-lg transition-all duration-300",{"bg-blue-500/30 border border-blue-500/50":c,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-blue-500/20":u}),e[2]=c,e[3]=u,e[4]=h):h=e[4];const d=n.interior_type==="ipl",p=n.interior_type!=="ipl";let g;e[5]!==d||e[6]!==p?(g=fn("text-xl transition-all duration-300",{"text-blue-200":d,"text-slate-400 group-hover:text-blue-300":p}),e[5]=d,e[6]=p,e[7]=g):g=e[7];let b;e[8]!==g?(b=_.jsx(B2e,{className:g}),e[8]=g,e[9]=b):b=e[9];let w;e[10]!==b||e[11]!==h?(w=_.jsx("div",{className:h,children:b}),e[10]=b,e[11]=h,e[12]=w):w=e[12];const x=n.interior_type==="ipl",S=n.interior_type!=="ipl";let M;e[13]!==x||e[14]!==S?(M=fn("font-semibold transition-all duration-300",{"text-blue-100":x,"text-white group-hover:text-blue-100":S}),e[13]=x,e[14]=S,e[15]=M):M=e[15];let C;e[16]!==a?(C=a("creator.interior_type_selector.ipl"),e[16]=a,e[17]=C):C=e[17];let A;e[18]!==M||e[19]!==C?(A=_.jsx("h4",{className:M,children:C}),e[18]=M,e[19]=C,e[20]=A):A=e[20];let N;e[21]!==a?(N=a("creator.interior_type_selector.ipl_description"),e[21]=a,e[22]=N):N=e[22];let R;e[23]!==N?(R=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:N}),e[23]=N,e[24]=R):R=e[24];let D;e[25]!==A||e[26]!==R?(D=_.jsxs("div",{className:"flex-1",children:[A,R]}),e[25]=A,e[26]=R,e[27]=D):D=e[27];let B;e[28]!==w||e[29]!==D?(B=_.jsxs("div",{className:"flex items-center gap-3",children:[w,D]}),e[28]=w,e[29]=D,e[30]=B):B=e[30];let z;e[31]!==s||e[32]!==r||e[33]!==B||e[34]!==o?(z=_.jsx(Zt,{variant:s,color:r,onPress:o,className:"block w-full h-full text-left p-4",children:B}),e[31]=s,e[32]=r,e[33]=B,e[34]=o,e[35]=z):z=e[35];const I=n.interior_type==="shell"?"solid":"light",U=n.interior_type==="shell"?"secondary":"default";let $;e[36]!==i?($=()=>i("shell"),e[36]=i,e[37]=$):$=e[37];const G=n.interior_type==="shell",k=n.interior_type!=="shell";let X;e[38]!==G||e[39]!==k?(X=fn("p-2 rounded-lg transition-all duration-300",{"bg-purple-500/30 border border-purple-500/50":G,"bg-slate-600/40 border border-slate-500/30 group-hover:bg-purple-500/20":k}),e[38]=G,e[39]=k,e[40]=X):X=e[40];const V=n.interior_type==="shell",H=n.interior_type!=="shell";let W;e[41]!==V||e[42]!==H?(W=fn("text-xl transition-all duration-300",{"text-purple-200":V,"text-slate-400 group-hover:text-purple-300":H}),e[41]=V,e[42]=H,e[43]=W):W=e[43];let J;e[44]!==W?(J=_.jsx(vu,{className:W}),e[44]=W,e[45]=J):J=e[45];let Y;e[46]!==X||e[47]!==J?(Y=_.jsx("div",{className:X,children:J}),e[46]=X,e[47]=J,e[48]=Y):Y=e[48];const K=n.interior_type==="shell",ee=n.interior_type!=="shell";let ie;e[49]!==K||e[50]!==ee?(ie=fn("font-semibold transition-all duration-300",{"text-purple-100":K,"text-white group-hover:text-purple-100":ee}),e[49]=K,e[50]=ee,e[51]=ie):ie=e[51];let Z;e[52]!==a?(Z=a("creator.interior_type_selector.shell"),e[52]=a,e[53]=Z):Z=e[53];let ue;e[54]!==ie||e[55]!==Z?(ue=_.jsx("h4",{className:ie,children:Z}),e[54]=ie,e[55]=Z,e[56]=ue):ue=e[56];let se;e[57]!==a?(se=a("creator.interior_type_selector.shell_description"),e[57]=a,e[58]=se):se=e[58];let ae;e[59]!==se?(ae=_.jsx("p",{className:"text-xs text-slate-400 group-hover:text-slate-300 transition-colors",children:se}),e[59]=se,e[60]=ae):ae=e[60];let ce;e[61]!==ue||e[62]!==ae?(ce=_.jsxs("div",{className:"flex-1",children:[ue,ae]}),e[61]=ue,e[62]=ae,e[63]=ce):ce=e[63];let pe;e[64]!==Y||e[65]!==ce?(pe=_.jsxs("div",{className:"flex items-center gap-3",children:[Y,ce]}),e[64]=Y,e[65]=ce,e[66]=pe):pe=e[66];let ye;e[67]!==I||e[68]!==U||e[69]!==$||e[70]!==pe?(ye=_.jsx(Zt,{variant:I,color:U,onPress:$,className:"block w-full h-full text-left p-4",children:pe}),e[67]=I,e[68]=U,e[69]=$,e[70]=pe,e[71]=ye):ye=e[71];let _e;return e[72]!==z||e[73]!==ye?(_e=_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-2 border border-slate-700/50 rounded-lg",children:[z,ye]}),e[72]=z,e[73]=ye,e[74]=_e):_e=e[74],_e}const Mf={popoverContent:"bg-slate-800/90 backdrop-blur-sm border border-slate-700"};function Q2e({garage:t,jobs:e,gangs:n,onChange:i,onFormChange:a}){const{t:s}=Dn(),[r,o]=P.useState(""),[c,u]=P.useState([]),[h,d]=P.useState(""),[p,g]=P.useState([]),b=P.useMemo(()=>{const I=t.jobs?.map(U=>U.name)||[];return e.filter(U=>!I.includes(U.name))},[e,t.jobs]),w=P.useMemo(()=>{const I=t.gangs?.map(U=>U.name)||[];return n.filter(U=>!I.includes(U.name))},[n,t.gangs]),x=()=>{if(!r)return;ut("play_sound","item_down");const I=[...t.jobs||[],{name:r,grades:c}];i("jobs",I),o(""),u([])},S=I=>{ut("play_sound","cancel");const U=t.jobs?.filter($=>$.name!==I)||[];i("jobs",U)},M=(I,U)=>{const $=t.jobs?.map(G=>G.name===I?{...G,grades:U}:G)||[];i("jobs",$)},C=()=>{if(!h)return;ut("play_sound","item_down");const I=[...t.gangs||[],{name:h,grades:p}];i("gangs",I),d(""),g([])},A=I=>{ut("play_sound","cancel");const U=t.gangs?.filter($=>$.name!==I)||[];i("gangs",U)},N=(I,U)=>{const $=t.gangs?.map(G=>G.name===I?{...G,grades:U}:G)||[];i("gangs",$)},R=I=>e.find($=>$.name===I)?.grades||[],D=I=>n.find($=>$.name===I)?.grades||[],B=I=>e.find($=>$.name===I)?.label||I,z=I=>n.find($=>$.name===I)?.label||I;return _.jsx(Gb,{title:s("creator.form.access_control.title"),children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(N9,{className:"text-blue-400 text-lg"}),_.jsx("h3",{className:"text-sm font-semibold text-white",children:s("creator.form.access_control.jobs_section")})]}),_.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-2",children:[_.jsx(Af,{label:s("creator.form.access_control.select_job"),selectionMode:"single",classNames:Mf,selectedKeys:r?[r]:[],onOpenChange:I=>{ut("play_sound",I?"category_down":"cancel")},onSelectionChange:I=>{const U=Array.from(I)[0];o(U),u([])},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:b.map(I=>_.jsx(Cf,{children:I.label},I.name))}),_.jsx(Af,{label:s("creator.form.access_control.grades"),selectionMode:"multiple",classNames:Mf,isDisabled:!r,selectedKeys:c.map(String),onOpenChange:I=>{ut("play_sound",I?"category_down":"cancel")},onSelectionChange:I=>{const U=Array.from(I).map($=>isNaN(Number($))?$:Number($));u(U)},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:r?R(r).map(I=>_.jsx(Cf,{children:I.label},String(I.grade))):[]}),_.jsx(Zt,{isIconOnly:!0,color:"primary",onPress:x,isDisabled:!r,className:"mt-auto mb-1 self-end rounded-lg",size:"lg",children:_.jsx(j1,{className:"text-xl"})})]}),_.jsx("div",{className:"space-y-2",children:t.jobs&&t.jobs.length>0?t.jobs.map((I,U)=>_.jsx(Ve.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:U*.05},children:_.jsx(js,{className:"bg-gradient-to-br from-blue-500/10 to-blue-500/5 border border-blue-500/30",children:_.jsx(Gr,{className:"p-3",children:_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("div",{className:"flex items-center gap-2",children:_.jsx(na,{color:"primary",variant:"flat",size:"sm",startContent:_.jsx(N9,{}),children:B(I.name)})}),_.jsx(Zt,{isIconOnly:!0,size:"sm",color:"danger",variant:"flat",onPress:()=>S(I.name),children:_.jsx(V1,{})})]}),_.jsx(Af,{label:s("creator.form.access_control.grades"),selectionMode:"multiple",classNames:{...Mf,trigger:fn(Mf?.trigger||"","bg-slate-900/50")},selectedKeys:I.grades.map(String),onOpenChange:$=>{ut("play_sound",$?"category_down":"cancel")},onSelectionChange:$=>{const G=Array.from($).map(k=>isNaN(Number(k))?k:Number(k));M(I.name,G)},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:R(I.name).map($=>_.jsx(Cf,{children:$.label},String($.grade)))})]})})})},I.name)):_.jsx("div",{className:"text-center py-4 text-slate-400 text-sm",children:s("creator.form.access_control.no_jobs_added")})})]}),n&&n.length>0&&_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(P9,{className:"text-purple-400 text-lg"}),_.jsx("h3",{className:"text-sm font-semibold text-white",children:s("creator.form.access_control.gangs_section")})]}),_.jsxs("div",{className:"grid grid-cols-[1fr,1fr,auto] gap-2",children:[_.jsx(Af,{label:s("creator.form.access_control.select_gang"),selectionMode:"single",classNames:Mf,selectedKeys:h?[h]:[],onOpenChange:I=>{ut("play_sound",I?"category_down":"cancel")},onSelectionChange:I=>{const U=Array.from(I)[0];d(U),g([])},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:w.map(I=>_.jsx(Cf,{children:I.label},I.name))}),_.jsx(Af,{label:s("creator.form.access_control.grades"),selectionMode:"multiple",classNames:Mf,isDisabled:!h,selectedKeys:p.map(String),onOpenChange:I=>{ut("play_sound",I?"category_down":"cancel")},onSelectionChange:I=>{const U=Array.from(I).map($=>isNaN(Number($))?$:Number($));g(U)},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:h?D(h).map(I=>_.jsx(Cf,{children:I.label},String(I.grade))):[]}),_.jsx(Zt,{isIconOnly:!0,color:"secondary",variant:"shadow",onPress:C,isDisabled:!h,className:"mt-auto mb-1",children:_.jsx(j1,{className:"text-xl"})})]}),_.jsx("div",{className:"space-y-2",children:t.gangs&&t.gangs.length>0?t.gangs.map((I,U)=>_.jsx(Ve.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:U*.05},children:_.jsx(js,{className:"bg-gradient-to-br from-purple-500/10 to-purple-500/5 border border-purple-500/30",children:_.jsx(Gr,{className:"p-3",children:_.jsxs("div",{className:"space-y-3",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsx("div",{className:"flex items-center gap-2",children:_.jsx(na,{color:"secondary",variant:"flat",size:"sm",startContent:_.jsx(P9,{}),children:z(I.name)})}),_.jsx(Zt,{isIconOnly:!0,size:"sm",color:"danger",variant:"flat",onPress:()=>A(I.name),children:_.jsx(V1,{})})]}),_.jsx(Af,{label:s("creator.form.access_control.grades"),selectionMode:"multiple",classNames:{...Mf,trigger:fn(Mf?.trigger||"","bg-slate-900/50")},selectedKeys:I.grades.map(String),onOpenChange:$=>{ut("play_sound",$?"category_down":"cancel")},onSelectionChange:$=>{const G=Array.from($).map(k=>isNaN(Number(k))?k:Number(k));N(I.name,G)},listboxProps:{emptyContent:s("creator.form.access_control.empty_list")},children:D(I.name).map($=>_.jsx(Cf,{children:$.label},String($.grade)))})]})})})},I.name)):_.jsx("div",{className:"text-center py-4 text-slate-400 text-sm",children:s("creator.form.access_control.no_gangs_added")})})]}),_.jsx(Ve.div,{className:"bg-slate-800/40 rounded-lg p-3 border border-slate-700/50",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.3,delay:.3},children:_.jsx("p",{className:"text-xs text-slate-400 leading-relaxed",children:s("creator.form.access_control.info")})})]})},"access-control")}function J2e(t){const e=sn.c(35),{formType:n,garage:i,onFormChange:a,onClose:s,onSave:r,jobs:o,gangs:c,saveButtonProps:u,cancelButtonProps:h}=t,{t:d}=Dn(),[p,g]=P.useState(!1);let b;e[0]!==a?(b=(G,k)=>{a(X=>({...X,[G]:k}))},e[0]=a,e[1]=b):b=e[1];const w=b;let x;e[2]!==a?(x=G=>{ut("play_sound","category_down"),a(k=>({...k,type:G}))},e[2]=a,e[3]=x):x=e[3];const S=x;let M;e[4]!==a?(M=G=>{ut("play_sound","category_down"),a(k=>{let X={};return G==="public"?X={owner:!0,available:!0,isImpound:!1}:G==="private"?X={owner:"",available:!1,isImpound:!1}:G==="impound"&&(X={owner:!1,available:!0,isImpound:!0}),{...k,...X}})},e[4]=a,e[5]=M):M=e[5];const C=M;let A;e[6]!==a?(A=G=>{ut("play_sound","category_down"),a(k=>{const X={interior_type:G};return k.shell&&(X.shell=void 0),{...k,...X}})},e[6]=a,e[7]=A):A=e[7];const N=A;let R;e[8]!==p?(R=()=>{p?ut("play_sound","category_down"):ut("play_sound","cancel"),g(e_e)},e[8]=p,e[9]=R):R=e[9];const D=R;let B;e[10]!==i||e[11]!==r||e[12]!==d?(B=(G,k)=>{if(G.preventDefault(),!k())return qa(d("creator.fill_all_fields"),"error"),ut("play_sound","cancel");ut("play_sound","finish"),r(i)},e[10]=i,e[11]=r,e[12]=d,e[13]=B):B=e[13];const z=B;let I;e[14]!==i.name||e[15]!==s?(I=async()=>{await ut("remove_garage",i.name)&&s()},e[14]=i.name,e[15]=s,e[16]=I):I=e[16];const U=I;let $;return e[17]!==h||e[18]!==n||e[19]!==c||e[20]!==i||e[21]!==C||e[22]!==w||e[23]!==U||e[24]!==S||e[25]!==N||e[26]!==z||e[27]!==o||e[28]!==s||e[29]!==a||e[30]!==p||e[31]!==u||e[32]!==d||e[33]!==D?($=_.jsx(WG,{children:G=>{const{validate:k}=G;return _.jsx(yU,{onSubmit:X=>z(X,k),children:_.jsxs(Ve.div,{initial:{opacity:0,scale:.96,y:30},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:30},transition:{duration:.35,ease:"easeOut"},className:"w-full grid grid-cols-1 gap-4 h-full",children:[_.jsx(rm,{id:"creator-header",children:_.jsxs("div",{className:"flex w-full justify-between items-center",children:[_.jsx("h2",{className:"text-2xl title",children:n==="create"?d("creator.form.create_garage"):d("creator.form.edit_garage",{name:i.name})}),_.jsx(Zt,{isIconOnly:!0,variant:"light",size:"sm",color:"primary",onPress:s,children:_.jsx(kG,{className:"text-lg"})})]})}),_.jsx(Gb,{title:d("creator.form.garage_type"),children:_.jsx(q2e,{garage:i,onGarageTypeChange:S})},"garage-type-selection"),_.jsx(Gb,{title:d("creator.garage_access_selector.title"),children:_.jsx(Y2e,{garage:i,onAccessTypeChange:C})},"garage-access-type"),_.jsx(Gb,{title:d("creator.interior_type_selector.title"),children:_.jsx(Z2e,{garage:i,onInteriorTypeChange:N})},"interior-type-selection"),_.jsx(X2e,{zone:i.zone,coords:i.coords,shell:i.shell,interiorType:i.interior_type,price:i.price,storePrice:i.storePrice,garageType:i.type,onZoneChange:X=>w("zone",X),onCoordsChange:X=>w("coords",X),onShellChange:X=>w("shell",X),onPriceChange:X=>w("price",X||0),onStorePriceChange:X=>w("storePrice",X)}),_.jsx(Q2e,{garage:i,jobs:o,gangs:c,onChange:w,onFormChange:a}),_.jsx(rm,{id:"footer",children:_.jsxs("div",{className:"flex justify-end gap-2 mt-2 col-span-full",children:[_.jsxs(sv,{classNames:{content:"bg-slate-800/80 text-white"},isOpen:p,onOpenChange:X=>D(),showArrow:!0,offset:20,backdrop:"blur",children:[_.jsx(av,{children:n==="edit"?_.jsx(Zt,{variant:"solid",color:"danger",children:d("creator.remove.confirm")}):_.jsx(Zt,{variant:"solid",color:"primary",onPress:s,...h||{},children:d("cancel")})}),_.jsx(iv,{children:_.jsxs("div",{className:"px-1 py-2 flex flex-col gap-1",children:[_.jsx("div",{className:"subtitle",children:d(n==="edit"?"creator.remove.title":"creator.cancel.title")}),_.jsx("i",{className:"text-sm text-gray-100/80",children:d(n==="edit"?"creator.remove.description":"creator.cancel.description")}),_.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[_.jsx(Zt,{variant:"solid",color:"primary",onPress:D,children:d("cancel")}),_.jsx(Zt,{variant:"solid",color:"danger",onPress:n==="edit"?U:s,children:d(n==="edit"?"creator.remove.confirm":"creator.cancel.confirm")})]})]})})]}),_.jsx(Zt,{variant:"solid",color:"success",type:"submit",...u||{},children:d(n==="edit"?"creator.form.save":"creator.form.create_garage")})]})})]},i.id)})}}),e[17]=h,e[18]=n,e[19]=c,e[20]=i,e[21]=C,e[22]=w,e[23]=U,e[24]=S,e[25]=N,e[26]=z,e[27]=o,e[28]=s,e[29]=a,e[30]=p,e[31]=u,e[32]=d,e[33]=D,e[34]=$):$=e[34],$}function e_e(t){return!t}function KG({key:t,enabled:e=!0,debounceMs:n=100}){const i=P.useRef(null),a=P.useRef(null),s=P.useCallback(o=>{if(e&&(a.current&&a.current.removeEventListener("scroll",r),a.current=o,o)){const c=sessionStorage.getItem(`scroll-cache-${t}`);if(c){const u=parseInt(c,10);let h=0;const d=()=>{o.scrollTop!==u&&h<10&&(o.scrollTop=u,h++,setTimeout(d,100))};d()}o.addEventListener("scroll",r,{passive:!0})}},[e,t,n]),r=P.useCallback(()=>{!e||!a.current||(i.current&&clearTimeout(i.current),i.current=setTimeout(()=>{sessionStorage.setItem(`scroll-cache-${t}`,a.current.scrollTop.toString())},n))},[e,t,n]);return P.useEffect(()=>{if(!e)return;const o=()=>{i.current&&clearTimeout(i.current),a.current&&sessionStorage.setItem(`scroll-cache-${t}`,a.current.scrollTop.toString())};return document.addEventListener("visibilitychange",o),window.addEventListener("beforeunload",o),()=>{document.removeEventListener("visibilitychange",o),window.removeEventListener("beforeunload",o)}},[e,t]),P.useEffect(()=>()=>{a.current&&a.current.removeEventListener("scroll",r),i.current&&clearTimeout(i.current)},[r]),s}function t_e({handleCreateClick:t,handleSelect:e,selectedGarage:n,creatorData:i}){const{t:a}=Dn(),[s,r]=P.useState(""),[o,c]=P.useState("all"),u=w=>{c(w),ut("play_sound","category_down")},[h,d]=P.useState({}),p=i?.garages?.filter?.(w=>{const x=w.name.toLowerCase().includes(s.toLowerCase()),S=o==="all"||w.type===o;return x&&S}),g=async w=>{try{ut("play_sound","category_down"),d(x=>({...x,[w.id]:!1})),ut("close"),ut("teleport_to_garage",w.name)}catch(x){console.error("Teleport failed:",x)}},b=w=>{ut("play_sound","category_down"),h[w]?ut("play_sound","cancel"):ut("play_sound","category_down"),d(x=>({...x,[w]:!x[w]}))};return _.jsxs(Ve.div,{initial:{opacity:0,x:-50,rotateY:-15},animate:{opacity:1,x:0,rotateY:0},exit:{opacity:0,x:-50,rotateY:-15},transition:{duration:.6,ease:"easeOut"},className:"w-full md:w-96 bg-gradient-to-br from-slate-900/95 via-slate-800/90 to-slate-900/95 rounded-2xl shadow-2xl flex flex-col p-6 gap-4 overflow-hidden h-full min-w-[360px] border border-slate-700/30 backdrop-blur-sm",children:[_.jsxs(Ve.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4},className:"relative",children:[_.jsxs(Ve.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.1,duration:.4},className:"flex gap-2 items-center",children:[_.jsxs("div",{className:"flex-1 relative",children:[_.jsx(go,{isClearable:!0,placeholder:a("creator.left_panel.search_garages_placeholder"),className:"w-full",color:"default",value:s,onChange:w=>r(w.target.value),startContent:_.jsx($G,{className:"text-slate-400 text-lg"}),onClear:()=>r(""),size:"md",classNames:{input:"text-white placeholder:text-slate-400 text-sm pl-2",inputWrapper:"bg-slate-800/40 border-slate-600/30 hover:border-slate-400/50 focus-within:border-blue-500/50 transition-all duration-300 backdrop-blur-sm shadow-lg hover:shadow-xl"}}),s&&_.jsx(Ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"absolute -top-2 -right-2 w-5 h-5 rounded-full bg-blue-500/20 border border-blue-500/30 flex items-center justify-center",children:_.jsx("span",{className:"text-xs text-blue-400 font-bold",children:p?.length||0})})]}),_.jsx(Zt,{color:"primary",isIconOnly:!0,size:"md",className:"bg-gradient-to-br from-blue-500/20 to-slate-500/20 border border-blue-500/30 hover:from-blue-500/30 hover:to-blue-500/30 shadow-lg hover:shadow-xl transition-all duration-300 hover:scale-105",onPress:t,"aria-label":a("creator.left_panel.create_garage"),children:_.jsx(j1,{className:"text-xl text-blue-400"})})]}),_.jsxs(Ve.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4},className:"bg-slate-800/30 rounded-xl p-4 border border-slate-700/30 backdrop-blur-sm mt-3",children:[_.jsxs("div",{className:"flex items-center justify-between mb-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-6 h-6 rounded-md bg-gradient-to-br from-blue-500/20 to-slate-500/20 border border-blue-500/30 flex items-center justify-center",children:_.jsx(z2e,{className:"text-blue-400 text-sm"})}),_.jsx("span",{className:"text-sm font-medium text-slate-300",children:a("creator.left_panel.filters")})]}),_.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-slate-700/50 border border-slate-600/30",children:[_.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400 animate-pulse"}),_.jsx("span",{className:"text-xs text-slate-400",children:a("creator.left_panel.results",{count:p?.length||0,plural:p?.length!==1?"s":""})})]})]}),_.jsxs("div",{className:"flex gap-1",children:[_.jsx(Zt,{size:"sm",variant:o==="all"?"solid":"bordered",className:fn("flex-1 h-8 transition-all duration-300 font-medium",{"bg-gradient-to-r from-slate-500/20 to-slate-400/20 text-slate-300 border-slate-500/40 shadow-lg shadow-slate-500/10":o==="all","bg-slate-700/30 text-slate-400 border-slate-600/40 hover:bg-slate-600/40 hover:border-slate-500/60":o!=="all"}),onPress:()=>u("all"),children:a("creator.left_panel.all_garages")}),_.jsx(Zt,{size:"sm",variant:o==="vehicle"?"solid":"bordered",className:fn("h-8 transition-all duration-300 font-medium",{"bg-gradient-to-r from-blue-500/20 to-slate-500/20 text-blue-400 border-blue-500/40 shadow-lg shadow-blue-500/10":o==="vehicle","bg-slate-700/30 text-slate-400 border-slate-600/40 hover:bg-slate-600/40 hover:border-slate-500/60":o!=="vehicle"}),onPress:()=>u("vehicle"),children:a("creator.left_panel.vehicle")}),_.jsx(Zt,{size:"sm",variant:o==="plane"?"solid":"bordered",className:fn("flex-1 h-8 transition-all duration-300 font-medium",{"bg-gradient-to-r from-purple-500/20 to-slate-500/20 text-purple-400 border-purple-500/40 shadow-lg shadow-purple-500/10":o==="plane","bg-slate-700/30 text-slate-400 border-slate-600/40 hover:bg-slate-600/40 hover:border-slate-500/60":o!=="plane"}),onPress:()=>u("plane"),children:a("creator.left_panel.plane")}),_.jsx(Zt,{size:"sm",variant:o==="boat"?"solid":"bordered",className:fn("flex-1 h-8 transition-all duration-300 font-medium",{"bg-gradient-to-r from-green-500/20 to-slate-500/20 text-green-400 border-green-500/40 shadow-lg shadow-green-500/10":o==="boat","bg-slate-700/30 text-slate-400 border-slate-600/40 hover:bg-slate-600/40 hover:border-slate-500/60":o!=="boat"}),onPress:()=>u("boat"),children:a("creator.left_panel.boat")})]})]})]}),_.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden relative w-full h-full p-2 rounded-2xl text-left transition-all duration-300 block backdrop-blur-sm bg-gradient-to-br from-slate-800/60 to-slate-900/60 border border-slate-600/30",children:p&&p.length>0?_.jsx("div",{className:"flex flex-col gap-2",children:p.map((w,x)=>_.jsx(Ve.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:x*.1,duration:.3},children:_.jsx(Zt,{onPress:()=>e(w),color:"primary",className:fn({"group relative w-full h-full p-4 rounded-2xl text-left transition-all duration-300 block backdrop-blur-sm":!0,"bg-gradient-to-br from-slate-800/60 to-slate-900/60 border border-slate-600/30 hover:border-slate-500/40 hover:shadow-lg hover:shadow-slate-500/10":n?.id!==w.id,"bg-gradient-to-br from-blue-500/20 to-slate-700/20 border border-blue-500/40 shadow-lg":n?.id===w.id}),children:_.jsxs("div",{className:"relative z-10",children:[_.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[_.jsx("div",{className:fn("w-10 h-10 rounded-lg border flex items-center justify-center transition-all duration-300",{"bg-gradient-to-br from-blue-500/30 to-slate-500/30 border-blue-500/50 shadow-lg shadow-blue-500/20":n?.id===w.id&&w.type==="vehicle","bg-gradient-to-br from-purple-500/30 to-slate-500/30 border-purple-500/50 shadow-lg shadow-purple-500/20":n?.id===w.id&&w.type==="plane","bg-gradient-to-br from-green-500/30 to-slate-500/30 border-green-500/50 shadow-lg shadow-green-500/20":n?.id===w.id&&w.type==="boat","bg-gradient-to-br from-slate-700/50 to-slate-800/50 border-slate-600/50 group-hover:from-blue-500/20 group-hover:to-slate-500/20 group-hover:border-blue-400/50":n?.id!==w.id}),children:w.type==="vehicle"?_.jsx(Y5,{className:fn("text-sm transition-all duration-300",{"text-blue-200":n?.id===w.id,"text-slate-400 group-hover:text-blue-300":n?.id!==w.id})}):w.type==="plane"?_.jsx(FG,{className:fn("text-sm transition-all duration-300",{"text-purple-200":n?.id===w.id,"text-slate-400 group-hover:text-purple-300":n?.id!==w.id})}):_.jsx(VG,{className:fn("text-sm transition-all duration-300",{"text-green-200":n?.id===w.id,"text-slate-400 group-hover:text-green-300":n?.id!==w.id})})}),_.jsx("div",{className:"flex flex-1 min-w-0",children:_.jsx("div",{className:"flex flex-1 items-center gap-1",children:_.jsx("h4",{className:"font-semibold text-base bg-gradient-to-r from-slate-200 via-white to-slate-200 bg-clip-text text-transparent truncate w-[calc(100%-2rem)] capitalize",children:w.name||`Garage #${w.id}`})})}),_.jsxs(sv,{classNames:{content:"bg-slate-800/80 text-white"},isOpen:h[w.id]||!1,onOpenChange:()=>b(w.id),showArrow:!0,offset:10,backdrop:"blur",children:[_.jsx(av,{children:_.jsx(Zt,{isIconOnly:!0,size:"sm",className:"h-8 w-8 bg-gradient-to-br from-green-500/20 to-slate-500/20 border border-green-500/30 hover:from-green-500/30 hover:to-green-500/30 shadow-lg hover:shadow-xl transition-all duration-300","aria-label":a("creator.left_panel.teleport_to_garage"),children:_.jsx(qp,{className:"text-sm text-green-400"})})}),_.jsx(iv,{children:_.jsxs("div",{className:"p-3",children:[_.jsxs("div",{className:"text-center mb-3",children:[_.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-br from-green-500/20 to-slate-500/20 border border-green-500/30 flex items-center justify-center mx-auto mb-2",children:_.jsx(qp,{className:"text-green-400 text-xl"})}),_.jsx("h3",{className:"text-sm font-semibold text-slate-200 mb-1",children:a("creator.left_panel.teleport_to_garage")}),_.jsx("p",{className:"text-xs text-slate-400",children:w.name||`Garage #${w.id}`})]}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(Zt,{size:"sm",variant:"light",className:"flex-1 text-slate-400 hover:text-white",onPress:()=>b(w.id),children:a("cancel")}),_.jsx(Zt,{size:"sm",color:"success",className:"flex-1 bg-gradient-to-r from-green-500/20 to-green-600/20 border border-green-500/30 text-green-400 hover:from-green-500/30 hover:to-green-600/30",onPress:()=>g(w),children:a("creator.left_panel.teleport")})]})]})})]})]}),_.jsxs("div",{className:"flex items-center justify-between text-sm",children:[_.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[_.jsx(vu,{className:w.type==="vehicle"?"text-blue-400":w.type==="plane"?"text-purple-400":"text-green-400"}),_.jsx("span",{className:"text-slate-400",children:a("creator.left_panel.garage_type")}),_.jsx("span",{className:`font-semibold ${w.type==="vehicle"?"text-blue-400":w.type==="plane"?"text-purple-400":"text-green-400"}`,children:w.type==="vehicle"?a("creator.left_panel.vehicle"):w.type==="plane"?a("creator.left_panel.plane"):a("creator.left_panel.boat")})]}),_.jsxs("div",{className:"flex items-center gap-1 text-xs",children:[_.jsx(H2e,{className:"text-slate-400"}),_.jsx("span",{className:"text-slate-400",children:a("creator.left_panel.status")}),_.jsx("span",{className:`font-semibold ${w.available?"text-green-400":"text-red-400"}`,children:w.isImpound?a("creator.left_panel.impound"):w.available?a("creator.left_panel.public"):a("creator.left_panel.private")})]})]})]})})},w.id))}):_.jsxs(Ve.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5},className:"flex flex-col items-center justify-center py-16 text-center",children:[_.jsx(Ve.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:500,damping:30,delay:.2},className:"w-20 h-20 rounded-2xl bg-gradient-to-br from-slate-700/50 to-slate-800/50 border border-slate-600/30 flex items-center justify-center mb-6 shadow-lg shadow-slate-500/20",children:_.jsx(Y5,{className:"text-slate-400 text-3xl"})}),_.jsx(Ve.h3,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.3},className:"text-lg font-bold bg-gradient-to-r from-slate-300 via-slate-200 to-slate-300 bg-clip-text text-transparent mb-3",children:a(s?"creator.left_panel.no_garages_found":"creator.left_panel.no_garages_available")}),_.jsx(Ve.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4,duration:.3},className:"text-sm text-slate-400/80 max-w-64 leading-relaxed",children:a(s?"creator.left_panel.try_adjusting_search":"creator.left_panel.create_first_garage_description")})]})})]})}const n_e={name:"",zone:{thickness:50,usePoly:!0},owner:!1,available:!0,isImpound:!1,type:"vehicle",price:0,interior_type:"ipl"};function i_e(t){const e=sn.c(47),{creatorData:n}=t,[i,a]=Vf("creator-form-type","create"),[s,r]=Vf("creator-selected-garage",void 0);let o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o={key:"creator-right-panel",enabled:!0,debounceMs:100},e[0]=o):o=e[0];const c=KG(o),{t:u}=Dn();let h;e[1]!==i?(h=$=>{ut("close"),ut(i==="create"?"create_garage":"update_garage",$),sessionStorage.clear()},e[1]=i,e[2]=h):h=e[2];const d=h;let p;e[3]!==s?.id||e[4]!==a||e[5]!==r?(p=$=>{if(ut("play_sound","item_down"),s?.id===$.id){r(void 0),a("create");return}r($),a("edit")},e[3]=s?.id,e[4]=a,e[5]=r,e[6]=p):p=e[6];const g=p;let b;e[7]!==a||e[8]!==r?(b=()=>{ut("play_sound","item_down"),r({...n_e}),a("create")},e[7]=a,e[8]=r,e[9]=b):b=e[9];const w=b;let x,S;e[10]!==s?(x=()=>{ut("select_garage",s)},S=[s],e[10]=s,e[11]=x,e[12]=S):(x=e[11],S=e[12]),P.useEffect(x,S);let M;e[13]!==u?(M=u("creator.title"),e[13]=u,e[14]=M):M=e[14];let C;e[15]!==M?(C=_.jsx("h1",{className:"title text-xl font-bold",children:M}),e[15]=M,e[16]=C):C=e[16];let A;e[17]!==u?(A=u("creator.description"),e[17]=u,e[18]=A):A=e[18];let N;e[19]!==A?(N=_.jsx("i",{className:"text-xs text-gray-400/70",children:A}),e[19]=A,e[20]=N):N=e[20];let R;e[21]!==N||e[22]!==C?(R=_.jsx(ch,{className:"flex flex-col gap-1 border-b border-slate-800 px-6 pt-6 pb-2",children:_.jsx("div",{className:"flex items-center justify-between",children:_.jsxs("div",{children:[C,N]})})}),e[21]=N,e[22]=C,e[23]=R):R=e[23];let D;e[24]!==n.data||e[25]!==w||e[26]!==g||e[27]!==s?(D=_.jsx(t_e,{handleCreateClick:w,handleSelect:g,selectedGarage:s,creatorData:n.data}),e[24]=n.data,e[25]=w,e[26]=g,e[27]=s,e[28]=D):D=e[28];let B;e[29]!==n.data?.gangs||e[30]!==n.data?.items||e[31]!==n.data?.jobs||e[32]!==i||e[33]!==d||e[34]!==s||e[35]!==r||e[36]!==u?(B=s?_.jsx(J2e,{formType:i,garage:s,onFormChange:r,items:n?.data?.items||[],jobs:n?.data?.jobs||[],gangs:n?.data?.gangs||[],onClose:()=>r(void 0),onSave:d},s.id):_.jsxs("div",{className:"flex flex-col items-center justify-center h-full text-slate-400",children:[_.jsx("span",{className:"text-base font-semibold",children:u("creator.select_garage")}),_.jsx("span",{className:"text-xs",children:u("creator.select_garage_description")})]}),e[29]=n.data?.gangs,e[30]=n.data?.items,e[31]=n.data?.jobs,e[32]=i,e[33]=d,e[34]=s,e[35]=r,e[36]=u,e[37]=B):B=e[37];let z;e[38]!==c||e[39]!==B?(z=_.jsx(rm,{id:"right-panel",ref:c,className:"flex-1 bg-gradient-to-br from-slate-900/95 via-slate-800/90 to-slate-900/95 border border-slate-700/30 rounded-2xl shadow-lg p-4 md:p-6 overflow-y-auto h-full flex flex-col min-w-0",preserveHeight:!0,children:B}),e[38]=c,e[39]=B,e[40]=z):z=e[40];let I;e[41]!==D||e[42]!==z?(I=_.jsxs(oh,{className:"flex flex-col md:flex-row gap-4 md:gap-6 py-4 px-2 md:px-6 h-[80vh]",children:[D,z]}),e[41]=D,e[42]=z,e[43]=I):I=e[43];let U;return e[44]!==R||e[45]!==I?(U=_.jsxs(lh,{className:"bg-gray-950/95 rounded-2xl shadow-xl",children:[R,I]}),e[44]=R,e[45]=I,e[46]=U):U=e[46],U}const D9=fs({visible:!1,navigation:[],furniture:{}});function a_e({furnitureData:t,selectedCategory:e,selectedItem:n,searchQuery:i,onSearchChange:a,onSelectCategory:s,onSelectItem:r,onCreateNewItem:o}){const{t:c}=Dn(),u=vi(vr),h=new Intl.NumberFormat(u.intl.locales,u.intl.options),d=P.useMemo(()=>Object.entries(t||{}).map(([b,w])=>({key:b,...w})).filter(b=>b.dynamic).sort((b,w)=>b.label.localeCompare(w.label)),[t]),p=P.useMemo(()=>{if(!i)return d;const g=i.toLowerCase();return d.filter(b=>{const w=b.label.toLowerCase().includes(g),x=b.items.some(S=>S.label.toLowerCase().includes(g)||S.description.toLowerCase().includes(g)||S.object.toLowerCase().includes(g));return w||x})},[d,i]);return _.jsxs(Ve.div,{initial:{opacity:0,x:-50,rotateY:-15},animate:{opacity:1,x:0,rotateY:0},exit:{opacity:0,x:-50,rotateY:-15},transition:{duration:.6,ease:"easeOut"},className:"w-full md:w-[420px] bg-gradient-to-br from-slate-900/95 via-slate-800/90 to-slate-900/95 rounded-2xl shadow-2xl flex flex-col p-6 gap-4 overflow-hidden h-full min-w-[380px] border border-slate-700/30 backdrop-blur-sm",children:[_.jsxs(Ve.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{delay:.2,duration:.4},className:"relative",children:[_.jsx("div",{className:"flex gap-2 items-center",children:_.jsxs("div",{className:"flex-1 relative",children:[_.jsx(go,{isClearable:!0,placeholder:c("furniture_creator.search_placeholder"),className:"w-full",color:"default",value:i,onChange:g=>a(g.target.value),startContent:_.jsx($G,{className:"text-slate-400 text-lg"}),onClear:()=>a(""),size:"md",classNames:{input:"text-white placeholder:text-slate-400 text-sm pl-2",inputWrapper:"bg-slate-800/40 border-slate-600/30 hover:border-slate-400/50 focus-within:border-blue-500/50 transition-all duration-300 backdrop-blur-sm shadow-lg hover:shadow-xl"}}),i&&_.jsx(Ve.div,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},className:"absolute -top-2 -right-2 w-5 h-5 rounded-full bg-blue-500/20 border border-blue-500/30 flex items-center justify-center",children:_.jsx("span",{className:"text-xs text-blue-400 font-bold",children:p.length})})]})}),_.jsxs(Ve.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.4},className:"bg-slate-800/30 rounded-xl p-4 border border-slate-700/30 backdrop-blur-sm mt-3",children:[_.jsxs("div",{className:"flex items-center justify-between mb-3",children:[_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx("div",{className:"w-6 h-6 rounded-md bg-gradient-to-br from-blue-500/20 to-slate-500/20 border border-blue-500/30 flex items-center justify-center",children:_.jsx(vu,{className:"text-blue-400 text-sm"})}),_.jsx("span",{className:"text-sm font-medium text-slate-300",children:c("furniture_creator.statistics")})]}),_.jsxs("div",{className:"flex items-center gap-2 px-3 py-1 rounded-full bg-slate-700/50 border border-slate-600/30",children:[_.jsx("div",{className:"w-2 h-2 rounded-full bg-green-400 animate-pulse"}),_.jsxs("span",{className:"text-xs text-slate-400",children:[d.length," ",c("furniture_creator.categories")]})]})]}),_.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[_.jsxs("div",{className:"bg-gradient-to-br from-blue-500/10 to-blue-600/10 border border-blue-500/20 rounded-lg p-2 text-center",children:[_.jsx("div",{className:"text-xl font-bold text-blue-400",children:d.reduce((g,b)=>g+b.items.length,0)}),_.jsx("div",{className:"text-[10px] text-slate-400 uppercase tracking-wide",children:c("furniture_creator.total_items")})]}),_.jsxs("div",{className:"bg-gradient-to-br from-slate-500/10 to-slate-600/10 border border-slate-500/20 rounded-lg p-2 text-center",children:[_.jsx("div",{className:"text-xl font-bold text-slate-400",children:d.filter(g=>g.dynamic).length}),_.jsx("div",{className:"text-[10px] text-slate-400 uppercase tracking-wide",children:c("furniture_creator.dynamic")})]}),_.jsxs("div",{className:"bg-gradient-to-br from-cyan-500/10 to-cyan-600/10 border border-cyan-500/20 rounded-lg p-2 text-center",children:[_.jsx("div",{className:"text-xl font-bold text-cyan-400",children:d.reduce((g,b)=>g+b.items.reduce((w,x)=>w+(x.colors?.length||0),0),0)}),_.jsx("div",{className:"text-[10px] text-slate-400 uppercase tracking-wide",children:c("furniture_creator.colors")})]})]})]})]}),_.jsx("div",{className:"flex-1 overflow-y-auto overflow-x-hidden relative w-full h-full rounded-2xl backdrop-blur-sm bg-gradient-to-br from-slate-800/60 to-slate-900/60 border border-slate-600/30",children:_.jsxs(rm,{id:"categories-list",children:[_.jsx(hae,{selectionMode:"multiple",variant:"splitted",itemClasses:{base:"bg-transparent rounded-xl hover:bg-slate-700/30 transition-all duration-300 mt-2",title:"text-slate-200 font-medium"},children:p.map((g,b)=>_.jsx(yae,{"aria-label":g.label,title:_.jsxs(Ve.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{delay:b*.05},className:"flex items-center justify-between w-full",children:[_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:fn("w-10 h-10 rounded-lg border flex items-center justify-center transition-all duration-300",{"bg-gradient-to-br from-slate-500/30 to-slate-500/30 border-slate-500/50 shadow-lg shadow-slate-500/20":e===g.key,"bg-gradient-to-br from-slate-700/50 to-slate-800/50 border-slate-600/50 group-hover:from-blue-500/20 group-hover:to-slate-500/20 group-hover:border-blue-400/50":e!==g.key}),children:g.img?_.jsx("img",{src:g.img,alt:g.label,className:"w-6 h-6 object-contain"}):_.jsx(vu,{className:"text-slate-400 text-lg"})}),_.jsxs("div",{children:[_.jsx("div",{className:"text-sm font-semibold",children:g.label}),_.jsxs("div",{className:"text-xs text-slate-400",children:[g.items.filter(w=>w.creator).length," ",c("furniture_creator.items")]})]})]}),_.jsxs("div",{className:"flex items-center gap-2",children:[g.dynamic&&_.jsx(na,{size:"sm",variant:"flat",color:"secondary",className:"text-[10px]",children:"Dynamic"}),_.jsx(Zt,{isIconOnly:!0,size:"sm",variant:"flat",color:"success",className:"h-7 w-7 min-w-7",onPress:()=>{o(g.key)},children:_.jsx(j1,{className:"text-sm"})})]})]}),className:fn({"bg-slate-700/40":e===g.key}),children:_.jsx("div",{className:"px-2 w-full",style:{height:Math.min(g.items.filter(w=>w.creator===!0).length*84,400)},children:_.jsx(UA,{data:g.items.filter(w=>w.creator===!0),style:{height:"100%"},itemContent:(w,x)=>_.jsx("div",{className:"mb-2 flex-1",children:_.jsx(js,{fullWidth:!0,isPressable:!0,className:fn({"bg-gradient-to-br from-slate-800/40 to-slate-900/40 border border-slate-600/30 hover:border-slate-500/50":n?.object!==x.object||e!==g.key,"bg-gradient-to-br from-blue-500/20 to-blue-500/20 border border-blue-500/40 shadow-lg shadow-blue-500/10":n?.object===x.object&&e===g.key}),onPress:()=>r(g.key,x),children:_.jsx(Gr,{className:"p-3",children:_.jsxs("div",{className:"flex items-center gap-3",children:[_.jsx("div",{className:"w-12 h-12 rounded-lg overflow-hidden bg-slate-700/50 flex-shrink-0",children:x.img?_.jsx("img",{src:x.img,alt:x.label,className:"w-full h-full object-cover"}):_.jsx("div",{className:"w-full h-full flex items-center justify-center",children:_.jsx(vu,{className:"text-slate-400 text-xl"})})}),_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsx("div",{className:"text-sm font-semibold text-slate-200 truncate",children:x.label||x.object}),_.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[_.jsx(na,{size:"sm",variant:"flat",color:"success",className:"text-[10px] h-5",startContent:_.jsx(F1,{className:"text-[10px]"}),children:h.format(x.price)}),x.colors&&x.colors.length>0&&_.jsx(na,{size:"sm",variant:"flat",color:"secondary",className:"text-[10px] h-5",startContent:_.jsx(Yg,{className:"text-[10px]"}),children:x.colors.length})]})]})]})})})})})})},g.key))}),p.length===0&&_.jsxs(Ve.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.5},className:"flex flex-col items-center justify-center py-16 text-center h-full",children:[_.jsx(Ve.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},transition:{type:"spring",stiffness:500,damping:30,delay:.2},className:"w-20 h-20 rounded-2xl bg-gradient-to-br from-slate-700/50 to-slate-800/50 border border-slate-600/30 flex items-center justify-center mb-6 shadow-lg shadow-slate-500/20",children:_.jsx("span",{className:"text-4xl",children:"🔍"})}),_.jsx(Ve.h3,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.3},className:"text-lg font-bold bg-gradient-to-r from-slate-300 via-slate-200 to-slate-300 bg-clip-text text-transparent mb-3",children:c("furniture_creator.no_results")}),_.jsx(Ve.p,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.4,duration:.3},className:"text-sm text-slate-400/80 max-w-64 leading-relaxed",children:c("furniture_creator.try_different_search")})]})]})})]})}function s_e(t){const e=sn.c(35),{isOpen:n,onClose:i,title:a,description:s,children:r,size:o,showFooter:c,footerContent:u,onSave:h,saveButtonText:d,saveButtonDisabled:p,cancelButtonText:g,scrollBehavior:b,backdrop:w,classNames:x}=t,S=o===void 0?"md":o,M=c===void 0?!0:c,C=p===void 0?!1:p,A=b===void 0?"inside":b,N=w===void 0?"blur":w,{t:R}=Dn();let D;e[0]!==i?(D=()=>{ut("play_sound","cancel"),i()},e[0]=i,e[1]=D):D=e[1];const B=D;let z;e[2]!==h?(z=()=>{h&&(ut("play_sound","finish"),h())},e[2]=h,e[3]=z):z=e[3];const I=z;let U;e[4]!==x?(U={base:"bg-slate-800 border border-slate-700",header:"border-b border-slate-700",body:"py-6",footer:"border-t border-slate-700",...x},e[4]=x,e[5]=U):U=e[5];let $;e[6]!==s?($=s&&_.jsx("i",{className:"text-sm text-slate-400",children:s}),e[6]=s,e[7]=$):$=e[7];let G;e[8]!==$||e[9]!==a?(G=_.jsx(ch,{children:_.jsxs("div",{className:"title flex flex-col gap-1",children:[a,$]})}),e[8]=$,e[9]=a,e[10]=G):G=e[10];let k;e[11]!==r?(k=_.jsx(oh,{children:r}),e[11]=r,e[12]=k):k=e[12];let X;e[13]!==g||e[14]!==u||e[15]!==B||e[16]!==I||e[17]!==h||e[18]!==C||e[19]!==d||e[20]!==M||e[21]!==R?(X=M&&_.jsx(rv,{children:u||_.jsxs(_.Fragment,{children:[_.jsx(Zt,{variant:"light",onPress:B,children:g||R("cancel")}),h&&_.jsx(Zt,{color:"primary",onPress:I,isDisabled:C,children:d||R("save")})]})}),e[13]=g,e[14]=u,e[15]=B,e[16]=I,e[17]=h,e[18]=C,e[19]=d,e[20]=M,e[21]=R,e[22]=X):X=e[22];let V;e[23]!==G||e[24]!==k||e[25]!==X?(V=_.jsxs(lh,{children:[G,k,X]}),e[23]=G,e[24]=k,e[25]=X,e[26]=V):V=e[26];let H;return e[27]!==N||e[28]!==B||e[29]!==n||e[30]!==A||e[31]!==S||e[32]!==V||e[33]!==U?(H=_.jsx(Ej,{isOpen:n,onClose:B,size:S,scrollBehavior:A,backdrop:N,classNames:U,children:V}),e[27]=N,e[28]=B,e[29]=n,e[30]=A,e[31]=S,e[32]=V,e[33]=U,e[34]=H):H=e[34],H}const oT={object:"",label:"",price:0,offset:{x:0,y:0,z:0}};function r_e({colors:t,onChange:e}){const{t:n}=Dn(),i=vi(vr),a=new Intl.NumberFormat(i.intl.locales,i.intl.options),[s,r]=P.useState(!1),[o,c]=P.useState(null),[u,h]=P.useState(oT),d=P.useCallback(()=>{ut("play_sound","item_down"),h(oT),c(null),r(!0)},[]),p=P.useCallback(C=>{ut("play_sound","item_down"),h({...t[C]}),c(C),r(!0)},[t]),g=P.useCallback(()=>{if(!u.object||!u.label)return;ut("play_sound","finish");const C=[...t];o!==null?C[o]=u:C.push(u),e(C),r(!1),h(oT),c(null)},[u,t,o,e]),b=P.useCallback(C=>{ut("play_sound","cancel");const A=t.filter((N,R)=>R!==C);e(A)},[t,e]),w=(C,A)=>{h(N=>({...N,[C]:A}))},x=(C,A)=>{const N=u.offset||{x:0,y:0,z:0};h(R=>({...R,offset:{...N,[C]:A}}))},S=C=>{h(C?A=>({...A,type:"stash",stash:{slots:50,maxweight:1e5}}):A=>({...A,type:void 0,stash:void 0}))},M=C=>{h(C?A=>({...A,type:"gardrobe",stash:void 0}):A=>({...A,type:void 0,stash:void 0}))};return _.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("h3",{className:"text-lg font-semibold text-slate-200",children:n("furniture_creator.color_variations")}),_.jsx("p",{className:"text-xs text-slate-400",children:n("furniture_creator.color_variations_description")})]}),_.jsx(Zt,{color:"secondary",variant:"flat",startContent:_.jsx(j1,{}),onPress:d,children:n("furniture_creator.add_color")})]}),_.jsx(Hs,{mode:"popLayout",children:t.length===0?_.jsxs(Ve.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"text-center py-12",children:[_.jsx("div",{className:"text-5xl mb-4",children:_.jsx(Yg,{className:"text-5xl"})}),_.jsx("p",{className:"text-slate-400",children:n("furniture_creator.no_colors")}),_.jsx("p",{className:"text-xs text-slate-500 mt-1",children:n("furniture_creator.add_first_color")})]}):_.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:t.map((C,A)=>_.jsx(Ve.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.9,y:-20},transition:{duration:.3,delay:A*.05},layout:!0,children:_.jsx(js,{isPressable:!0,className:"bg-slate-800/40 border border-slate-700/50 hover:border-blue-500/50 transition-all duration-300",onPress:()=>p(A),children:_.jsx(Gr,{className:"p-4",children:_.jsxs("div",{className:"flex items-start justify-between gap-3",children:[_.jsxs("div",{className:"flex-1 min-w-0",children:[_.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[_.jsx(Yg,{className:"text-purple-400 flex-shrink-0"}),_.jsx("h4",{className:"text-sm font-semibold text-slate-200 truncate",children:C.label})]}),_.jsxs("div",{className:"space-y-1",children:[_.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-400",children:[_.jsx(vu,{className:"text-[10px]"}),_.jsx("span",{className:"truncate",children:C.object})]}),_.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[_.jsx(na,{size:"sm",variant:"flat",color:"success",className:"text-[10px] h-5",startContent:_.jsx(F1,{className:"text-[10px]"}),children:a.format(C.price)}),C.type==="stash"&&_.jsx(na,{size:"sm",variant:"flat",color:"primary",className:"text-[10px] h-5",children:n("furniture_creator.stash")}),C.type==="gardrobe"&&_.jsx(na,{size:"sm",variant:"flat",color:"secondary",className:"text-[10px] h-5",children:n("furniture_creator.gardrobe")})]})]})]}),_.jsx(Zt,{isIconOnly:!0,size:"sm",variant:"flat",color:"danger",className:"flex-shrink-0",onPress:N=>{b(A)},children:_.jsx(V1,{className:"text-sm"})})]})})})},A))})}),_.jsx(s_e,{title:n(o!==null?"furniture_creator.edit_color":"furniture_creator.add_color"),description:n(o!==null?"furniture_creator.edit_color_description":"furniture_creator.add_color_description"),isOpen:s,onClose:()=>r(!1),size:"2xl",saveButtonText:n(o!==null?"furniture_creator.save":"furniture_creator.add"),cancelButtonText:n("cancel"),onSave:g,saveButtonDisabled:!u.object||!u.label,children:_.jsxs("div",{className:"space-y-4",children:[_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[_.jsx(go,{label:n("furniture_creator.object_name"),placeholder:"prop_chair_01_red",value:u.object,onChange:C=>w("object",C.target.value),isRequired:!0,startContent:_.jsx(vu,{className:"text-slate-400"})}),_.jsx(go,{label:n("furniture_creator.label"),placeholder:"Red Variant",value:u.label,onChange:C=>w("label",C.target.value),isRequired:!0})]}),_.jsx(Fo,{label:n("furniture_creator.price"),placeholder:"1000",value:u.price||0,onValueChange:C=>w("price",C),startContent:_.jsx(F1,{className:"text-slate-400"})}),_.jsx(js,{className:"bg-slate-800/40 border border-slate-700/50",children:_.jsxs(Gr,{className:"space-y-4",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200",children:n("furniture_creator.stash")}),_.jsx("p",{className:"text-xs text-slate-400",children:n("furniture_creator.stash_description")})]}),_.jsx(a1,{isSelected:u.type==="stash",onValueChange:S})]}),u.type==="stash"&&u.stash&&_.jsxs(Ve.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-3 pt-2 border-t border-slate-700/50",children:[_.jsx(Fo,{label:n("furniture_creator.slots"),value:u.stash.slots,onValueChange:C=>w("stash",{...u.stash,slots:C}),size:"sm"}),_.jsx(Fo,{label:n("furniture_creator.max_weight"),value:u.stash.maxweight,onValueChange:C=>w("stash",{...u.stash,maxweight:C}),size:"sm"})]}),_.jsxs("div",{className:"flex items-center justify-between border-t border-slate-700/50 pt-4",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200",children:n("furniture_creator.gardrobe")}),_.jsx("p",{className:"text-xs text-slate-400",children:n("furniture_creator.gardrobe_description")})]}),_.jsx(a1,{isSelected:u.type==="gardrobe",onValueChange:M})]})]})}),_.jsx(js,{className:"bg-slate-800/40 border border-slate-700/50",children:_.jsxs(Gr,{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200 mb-3",children:n("furniture_creator.offset")}),_.jsx("div",{className:"grid grid-cols-3 gap-3",children:["x","y","z"].map(C=>_.jsx(Fo,{label:C.toUpperCase(),step:.01,value:u.offset?.[C]||0,onValueChange:A=>x(C,A),size:"sm"},C))})]})})]})})]})}function o_e({imageUrl:t,onChange:e,object:n}){const{t:i}=Dn(),[a,s]=P.useState(!1),[r,o]=P.useState(!1),c=()=>{s(!0)},u=async()=>{o(!0),ut("play_sound","item_down");try{ut("close");const h=await ut("furniture_take_screenshot",n);console.log("result",h),h?(e(h),s(!1),ut("play_sound","finish")):ut("play_sound","cancel")}catch(h){console.error("Screenshot failed:",h),ut("play_sound","cancel")}finally{o(!1)}};return _.jsx(js,{className:"bg-slate-800/40 border border-slate-700/50",children:_.jsxs(Gr,{className:"space-y-4",children:[_.jsx("div",{className:"flex items-center justify-between",children:_.jsxs("div",{children:[_.jsxs("p",{className:"text-sm font-semibold text-slate-200 flex items-center gap-2",children:[_.jsx(HG,{className:"text-purple-400"}),i("furniture_creator.image","Image")]}),_.jsx("p",{className:"text-xs text-slate-400 mt-1",children:i("furniture_creator.image_description","Provide an image URL for this furniture item")})]})}),_.jsxs("div",{className:"flex gap-2",children:[_.jsx(go,{placeholder:"https://example.com/image.png",value:t,onChange:h=>{e(h.target.value),s(!1)},startContent:_.jsx(j2e,{className:"text-slate-400"})}),_.jsx(Zt,{isIconOnly:!0,color:"primary",variant:"flat",className:"bg-gradient-to-br from-blue-500/20 to-cyan-500/20 border border-blue-500/30 hover:from-blue-500/30 hover:to-cyan-500/30",onPress:u,isLoading:r,isDisabled:r,children:_.jsx(L2e,{className:"text-xl"})})]}),_.jsx(Ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.3},className:fn("relative w-full aspect-video rounded-xl overflow-hidden border-2 border-dashed",{"border-slate-600/50 bg-slate-800/50":!t||a,"border-blue-500/30 bg-slate-900/50":t&&!a}),children:t&&!a?_.jsx(Ve.img,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},src:t,alt:"Preview",className:"w-full h-full object-contain",onError:c},t):_.jsx("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-slate-500",children:a?_.jsxs(_.Fragment,{children:[_.jsx("span",{className:"text-4xl mb-2",children:"⚠️"}),_.jsx("p",{className:"text-sm",children:i("furniture_creator.image_error")})]}):_.jsxs(_.Fragment,{children:[_.jsx(O2e,{className:"text-5xl mb-2"}),_.jsx("p",{className:"text-sm",children:i("furniture_creator.no_image")})]})})})]})})}function l_e(t){const e=sn.c(75),{item:n}=t,{t:i}=Dn(),a=vi(vr);let s,r,o,c,u,h,d,p,g,b,w;if(e[0]!==a.intl.locales||e[1]!==a.intl.options||e[2]!==n.description||e[3]!==n.img||e[4]!==n.label||e[5]!==n.price||e[6]!==i){const z=new Intl.NumberFormat(a.intl.locales,a.intl.options);r=js,w="bg-gradient-to-br from-slate-500/10 via-blue-500/10 to-slate-500/10 border border-blue-500/30",s=Gr,g="p-4";let I;e[18]===Symbol.for("react.memo_cache_sentinel")?(I=_.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-slate-500/20 to-blue-500/20 border border-blue-500/30 flex items-center justify-center",children:_.jsx(I2e,{className:"text-blue-400"})}),e[18]=I):I=e[18];let U;e[19]!==i?(U=i("furniture_creator.preview"),e[19]=i,e[20]=U):U=e[20],e[21]!==U?(b=_.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[I,_.jsx("h3",{className:"text-sm font-semibold text-slate-200",children:U})]}),e[21]=U,e[22]=b):b=e[22],d="flex gap-4",e[23]!==n.img||e[24]!==n.label?(p=_.jsx("div",{className:"w-24 h-24 rounded-xl overflow-hidden bg-slate-800/50 border border-slate-700/50 flex-shrink-0",children:n.img?_.jsx(Ve.img,{initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},transition:{duration:.3},src:n.img,alt:n.label||"Preview",className:"w-full h-full object-cover"},n.img):_.jsx("div",{className:"w-full h-full flex items-center justify-center",children:_.jsx(vu,{className:"text-slate-600 text-3xl"})})}),e[23]=n.img,e[24]=n.label,e[25]=p):p=e[25],u="flex-1 min-w-0 space-y-2";let $;e[26]!==n.label||e[27]!==i?($=n.label||i("furniture_creator.unnamed"),e[26]=n.label,e[27]=i,e[28]=$):$=e[28];let G;e[29]!==$?(G=_.jsx("h4",{className:"text-base font-bold text-slate-100 truncate",children:$}),e[29]=$,e[30]=G):G=e[30];let k;e[31]!==n.description||e[32]!==i?(k=n.description||i("furniture_creator.no_description"),e[31]=n.description,e[32]=i,e[33]=k):k=e[33];let X;e[34]!==k?(X=_.jsx("p",{className:"text-xs text-slate-400 line-clamp-2",children:k}),e[34]=k,e[35]=X):X=e[35],e[36]!==G||e[37]!==X?(h=_.jsxs("div",{children:[G,X]}),e[36]=G,e[37]=X,e[38]=h):h=e[38],o="flex flex-wrap gap-2",c=n.price!==void 0&&_.jsx(na,{size:"sm",variant:"flat",color:"success",className:"text-[10px]",startContent:_.jsx(F1,{className:"text-[10px]"}),children:z.format(n.price)}),e[0]=a.intl.locales,e[1]=a.intl.options,e[2]=n.description,e[3]=n.img,e[4]=n.label,e[5]=n.price,e[6]=i,e[7]=s,e[8]=r,e[9]=o,e[10]=c,e[11]=u,e[12]=h,e[13]=d,e[14]=p,e[15]=g,e[16]=b,e[17]=w}else s=e[7],r=e[8],o=e[9],c=e[10],u=e[11],h=e[12],d=e[13],p=e[14],g=e[15],b=e[16],w=e[17];let x;e[39]!==n.colors||e[40]!==i?(x=n.colors&&n.colors.length>0&&_.jsxs(na,{size:"sm",variant:"flat",color:"secondary",className:"text-[10px]",startContent:_.jsx(Yg,{className:"text-[10px]"}),children:[n.colors.length," ",i("furniture_creator.colors")]}),e[39]=n.colors,e[40]=i,e[41]=x):x=e[41];let S;e[42]!==n.type||e[43]!==i?(S=n.type==="stash"&&_.jsx(na,{size:"sm",variant:"flat",color:"primary",className:"text-[10px]",startContent:_.jsx(Zp,{className:"text-[10px]"}),children:i("furniture_creator.stash")}),e[42]=n.type,e[43]=i,e[44]=S):S=e[44];let M;e[45]!==n.type||e[46]!==i?(M=n.type==="gardrobe"&&_.jsx(na,{size:"sm",variant:"flat",color:"warning",className:"text-[10px]",startContent:_.jsx(nk,{className:"text-[10px]"}),children:i("furniture_creator.gardrobe")}),e[45]=n.type,e[46]=i,e[47]=M):M=e[47];let C;e[48]!==o||e[49]!==x||e[50]!==S||e[51]!==M||e[52]!==c?(C=_.jsxs("div",{className:o,children:[c,x,S,M]}),e[48]=o,e[49]=x,e[50]=S,e[51]=M,e[52]=c,e[53]=C):C=e[53];let A;e[54]!==n.object||e[55]!==i?(A=n.object&&_.jsxs("div",{className:"bg-slate-800/50 rounded-lg px-2 py-1 border border-slate-700/30",children:[_.jsx("p",{className:"text-[10px] text-slate-500 uppercase tracking-wider mb-0.5",children:i("furniture_creator.object_name")}),_.jsx("p",{className:"text-xs text-slate-300 font-mono truncate",children:n.object})]}),e[54]=n.object,e[55]=i,e[56]=A):A=e[56];let N;e[57]!==C||e[58]!==A||e[59]!==u||e[60]!==h?(N=_.jsxs("div",{className:u,children:[h,C,A]}),e[57]=C,e[58]=A,e[59]=u,e[60]=h,e[61]=N):N=e[61];let R;e[62]!==N||e[63]!==d||e[64]!==p?(R=_.jsxs("div",{className:d,children:[p,N]}),e[62]=N,e[63]=d,e[64]=p,e[65]=R):R=e[65];let D;e[66]!==s||e[67]!==R||e[68]!==g||e[69]!==b?(D=_.jsxs(s,{className:g,children:[b,R]}),e[66]=s,e[67]=R,e[68]=g,e[69]=b,e[70]=D):D=e[70];let B;return e[71]!==r||e[72]!==D||e[73]!==w?(B=_.jsx(r,{className:w,children:D}),e[71]=r,e[72]=D,e[73]=w,e[74]=B):B=e[74],B}function c_e(t){const e=sn.c(38),{formType:n,item:i,category:a,onClose:s,onSave:r,isSubmitting:o}=t,{t:c}=Dn(),[u,h]=Vf("furniture-creator-active-tab","basic"),[d,p]=Vf("furniture-creator-form-data",i),[g,b]=P.useState(!1);let w;e[0]!==p?(w=(k,X)=>{p(V=>({...V,[k]:X}))},e[0]=p,e[1]=w):w=e[1];const x=w;let S;e[2]!==g?(S=()=>{g?ut("play_sound","category_down"):ut("play_sound","cancel"),b(p_e)},e[2]=g,e[3]=S):S=e[3];const M=S;let C;e[4]!==a||e[5]!==d||e[6]!==r||e[7]!==c?(C=(k,X)=>{if(k.preventDefault(),!X())return qa(c("furniture_creator.fill_all_fields"),"error"),ut("play_sound","cancel");if(!d.object||!d.label)return qa(c("furniture_creator.object_label_required"),"error"),ut("play_sound","cancel");ut("play_sound","finish"),r(d,a)},e[4]=a,e[5]=d,e[6]=r,e[7]=c,e[8]=C):C=e[8];const A=C;let N;e[9]!==a||e[10]!==d.id||e[11]!==s||e[12]!==c?(N=async()=>{if(!d.id){qa(c("furniture_creator.cannot_delete_config_item"),"error");return}await ut("remove_furniture_item",{id:d.id,category:a})&&s()},e[9]=a,e[10]=d.id,e[11]=s,e[12]=c,e[13]=N):N=e[13];const R=N;let D;e[14]!==p?(D=k=>{p(k?h_e:f_e)},e[14]=p,e[15]=D):D=e[15];const B=D;let z;e[16]!==p?(z=k=>{p(k?d_e:u_e)},e[16]=p,e[17]=z):z=e[17];const I=z;let U;e[18]!==d.offset||e[19]!==p?(U=(k,X)=>{const V=d.offset||{x:0,y:0,z:0};p(H=>({...H,offset:{...V,[k]:X}}))},e[18]=d.offset,e[19]=p,e[20]=U):U=e[20];const $=U;let G;return e[21]!==u||e[22]!==a||e[23]!==d||e[24]!==n||e[25]!==x||e[26]!==R||e[27]!==I||e[28]!==$||e[29]!==B||e[30]!==A||e[31]!==o||e[32]!==s||e[33]!==g||e[34]!==h||e[35]!==c||e[36]!==M?(G=_.jsx(WG,{children:k=>{const{validate:X}=k;return _.jsx(yU,{onSubmit:V=>A(V,X),children:_.jsxs("div",{className:"w-full flex flex-col gap-4 h-full",children:[_.jsxs("header",{className:"flex w-full justify-between items-center",children:[_.jsxs("div",{children:[_.jsx("h2",{className:"text-2xl title bg-gradient-to-r from-blue-400 via-cyan-400 to-slate-400 bg-clip-text text-transparent",children:c(n==="create"?"furniture_creator.create_item":"furniture_creator.edit_item")}),_.jsxs("p",{className:"text-xs text-slate-400 mt-1",children:[c("furniture_creator.category"),": ",_.jsx("span",{className:"text-blue-400 font-semibold",children:a})]})]}),_.jsx(Zt,{isIconOnly:!0,variant:"light",size:"sm",color:"primary",onPress:s,children:_.jsx(kG,{className:"text-lg"})})]}),_.jsxs(Nj,{selectedKey:u,onSelectionChange:V=>h(V),color:"primary",variant:"underlined",classNames:{tabList:"gap-6 w-full relative rounded-none p-0 border-b border-slate-700/50",cursor:"w-full bg-gradient-to-r from-blue-500 to-cyan-500",tab:"max-w-fit px-0 h-12",tabContent:"group-data-[selected=true]:text-blue-400"},children:[_.jsx(Nb,{title:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(vu,{}),_.jsx("span",{children:c("furniture_creator.basic_info")})]}),children:_.jsxs("div",{className:"py-4 space-y-4",children:[_.jsx(l_e,{item:d}),_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[_.jsx(go,{label:c("furniture_creator.object_name"),placeholder:"prop_chair_01",value:d.object,onChange:V=>x("object",V.target.value),isRequired:!0,startContent:_.jsx(vu,{className:"text-slate-400"})}),_.jsx(go,{label:c("furniture_creator.label"),placeholder:"Wooden Chair",value:d.label,onChange:V=>x("label",V.target.value),isRequired:!0})]}),_.jsx(CU,{label:c("furniture_creator.item_description"),placeholder:"A comfortable wooden chair",value:d.description,onChange:V=>x("description",V.target.value),minRows:3}),_.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[_.jsx(Fo,{label:c("furniture_creator.price"),placeholder:"1000",value:d.price||0,onValueChange:V=>x("price",V),startContent:_.jsx(F1,{className:"text-slate-400"})}),_.jsx(go,{label:c("furniture_creator.color_label"),placeholder:"Default Color",value:d.colorlabel,onChange:V=>x("colorlabel",V.target.value),startContent:_.jsx(Yg,{className:"text-slate-400"}),isRequired:!0})]})]})},"basic"),_.jsx(Nb,{title:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(HG,{}),_.jsx("span",{children:c("furniture_creator.advanced")})]}),children:_.jsxs("div",{className:"py-4 space-y-4",children:[_.jsx(o_e,{imageUrl:d.img,onChange:V=>x("img",V),object:d.object}),_.jsx(js,{className:"bg-slate-800/40 border border-slate-700/50",children:_.jsxs(Gr,{className:"space-y-4",children:[_.jsxs("div",{className:"flex items-center justify-between",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200",children:c("furniture_creator.stash")}),_.jsx("p",{className:"text-xs text-slate-400",children:c("furniture_creator.stash_description")})]}),_.jsx(a1,{isSelected:d.type==="stash",onValueChange:B})]}),d.type==="stash"&&d.stash&&_.jsxs(Ve.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-3 pt-2 border-t border-slate-700/50",children:[_.jsx(Fo,{label:c("furniture_creator.slots"),value:d.stash.slots,onValueChange:V=>x("stash",{...d.stash,slots:V}),size:"sm"}),_.jsx(Fo,{label:c("furniture_creator.max_weight"),value:d.stash.maxweight,onValueChange:V=>x("stash",{...d.stash,maxweight:V}),size:"sm"})]}),_.jsxs("div",{className:"flex items-center justify-between border-t border-slate-700/50 pt-4",children:[_.jsxs("div",{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200",children:c("furniture_creator.gardrobe")}),_.jsx("p",{className:"text-xs text-slate-400",children:c("furniture_creator.gardrobe_description")})]}),_.jsx(a1,{isSelected:d.type==="gardrobe",onValueChange:I})]})]})}),_.jsx(js,{className:"bg-slate-800/40 border border-slate-700/50",children:_.jsxs(Gr,{children:[_.jsx("p",{className:"text-sm font-semibold text-slate-200 mb-3",children:c("furniture_creator.offset")}),_.jsx("div",{className:"grid grid-cols-3 gap-3",children:["x","y","z"].map(V=>_.jsx("div",{children:_.jsx(Fo,{label:V.toUpperCase(),step:.01,value:d.offset?.[V]||0,onValueChange:H=>$(V,H),size:"sm"})},V))})]})})]})},"advanced"),_.jsx(Nb,{title:_.jsxs("div",{className:"flex items-center gap-2",children:[_.jsx(Yg,{}),_.jsx("span",{children:c("furniture_creator.colors")}),_.jsx(na,{size:"sm",variant:"flat",color:"secondary",children:d.colors?.length||0})]}),children:_.jsx("div",{className:"py-4",children:_.jsx(r_e,{colors:d.colors||[],onChange:V=>x("colors",V)})})},"colors")]}),_.jsxs("div",{className:"flex justify-end items-center mt-auto pb-4 gap-2",children:[n==="edit"&&d.id&&_.jsxs(sv,{classNames:{content:"bg-slate-800/80 text-white"},isOpen:g,onOpenChange:V=>M(),showArrow:!0,offset:20,backdrop:"blur",children:[_.jsx(av,{children:_.jsx(Zt,{color:"danger",startContent:_.jsx(V1,{}),children:c("furniture_creator.delete")})}),_.jsx(iv,{children:_.jsxs("div",{className:"px-1 py-2 flex flex-col gap-1",children:[_.jsx("div",{className:"subtitle",children:c(n==="edit"?"creator.remove.title":"creator.cancel.title")}),_.jsx("i",{className:"text-sm text-gray-100/80",children:c(n==="edit"?"creator.remove.description":"creator.cancel.description")}),_.jsxs("div",{className:"flex justify-end gap-2 mt-2",children:[_.jsx(Zt,{variant:"solid",color:"primary",onPress:M,children:c("cancel")}),_.jsx(Zt,{variant:"solid",color:"danger",onPress:R,children:c("furniture_creator.delete")})]})]})})]}),_.jsx(Zt,{type:"submit",color:"primary",startContent:_.jsx(k2e,{}),isLoading:o,children:c(n==="create"?"furniture_creator.create":"furniture_creator.save")})]})]})})}}),e[21]=u,e[22]=a,e[23]=d,e[24]=n,e[25]=x,e[26]=R,e[27]=I,e[28]=$,e[29]=B,e[30]=A,e[31]=o,e[32]=s,e[33]=g,e[34]=h,e[35]=c,e[36]=M,e[37]=G):G=e[37],G}function u_e(t){return{...t,type:void 0,stash:void 0}}function d_e(t){return{...t,type:"gardrobe",stash:void 0}}function f_e(t){return{...t,type:void 0,stash:void 0}}function h_e(t){return{...t,type:"stash",stash:{slots:50,maxweight:1e5}}}function p_e(t){return!t}const m_e={description:"",price:0,img:"",colors:[],object:"",label:"",colorlabel:"",key:""};function g_e({furnitureData:t,onClose:e}){const[n,i]=Vf("furniture-form-type","category"),[a,s]=Vf("furniture-selected-category",void 0),[r,o]=Vf("furniture-selected-item",void 0),[c,u]=P.useState(""),[h,d]=P.useState(!1),p=KG({key:"furniture-creator-right-panel",enabled:!0,debounceMs:100}),{t:g}=Dn(),b=async(M,C)=>{d(!0),ut("play_sound","finish");let A;n==="create"?A=await ut("create_furniture_item",{item:M,category:C}):A=await ut("update_furniture_item",{item:M,category:C}),d(!1),A&&(o(void 0),i("category"))},w=P.useCallback((M,C)=>{if(window.sessionStorage.removeItem("furniture-creator-form-data"),ut("play_sound","item_down"),r?.id===C.id&&a===M){o(void 0),s(void 0),i("category");return}s(M),o(C),i("edit")},[r?.object,a]),x=P.useCallback(M=>{window.sessionStorage.removeItem("furniture-creator-form-data"),ut("play_sound","item_down"),s(M),o({...m_e,key:M}),i("create")},[]),S=P.useCallback(M=>{if(ut("play_sound","category_down"),a===M&&n==="category"){s(void 0),i("category");return}s(M),o(void 0),i("category")},[a,n]);return _.jsxs(lh,{className:"bg-gray-950/95 rounded-2xl shadow-xl max-w-[95vw]",children:[_.jsx(ch,{className:"flex flex-col gap-1 border-b border-slate-800 px-6 pt-6 pb-2",children:_.jsx(Ve.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5},className:"flex items-center justify-between",children:_.jsxs("div",{children:[_.jsx("h1",{className:"title text-2xl font-bold bg-gradient-to-r from-blue-400 via-cyan-400 to-slate-400 bg-clip-text text-transparent",children:g("furniture_creator.page_title")}),_.jsx("i",{className:"text-xs text-gray-400/70",children:g("furniture_creator.page_description")})]})})}),_.jsxs(oh,{className:"flex flex-col md:flex-row gap-4 md:gap-6 py-4 px-2 md:px-6 h-[85vh]",children:[_.jsx(a_e,{furnitureData:t,selectedCategory:a,selectedItem:r,searchQuery:c,onSearchChange:u,onSelectCategory:S,onSelectItem:w,onCreateNewItem:x}),_.jsx(rm,{id:"furniture-right-panel",ref:p,className:"flex-1 bg-gradient-to-br from-slate-900/95 via-slate-800/90 to-slate-900/95 border border-slate-700/30 rounded-2xl shadow-lg p-4 md:p-6 overflow-y-auto h-full flex flex-col min-w-0",preserveHeight:!0,children:r&&a?_.jsx(c_e,{formType:n,item:r,category:a,onItemChange:o,onClose:()=>{o(void 0),i("category")},onSave:b,isSubmitting:h},r.id||"new"):a?_.jsxs(Ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.4},className:"flex flex-col items-center justify-center h-full text-slate-400",children:[_.jsx("span",{className:"text-lg font-semibold",children:g("furniture_creator.select_item")}),_.jsx("span",{className:"text-sm text-center max-w-md mt-2",children:g("furniture_creator.select_item_description")})]}):_.jsxs(Ve.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},transition:{duration:.4},className:"flex flex-col items-center justify-center h-full text-slate-400",children:[_.jsx("span",{className:"text-lg font-semibold",children:g("furniture_creator.select_category")}),_.jsx("span",{className:"text-sm text-center max-w-md mt-2",children:g("furniture_creator.select_category_description")})]})})]})]})}const v_e="https://converter.quasar-store.com/converter";function y_e(t){const n=t.trim().match(/^data:([\w/+.-]+);base64,(.*)$/);if(!n)throw new Error("Invalid data URI provided");const i=n[1],a=n[2];let s;try{s=atob(a)}catch{throw new Error("Invalid base64 in data URI")}const r=new Uint8Array(s.length);for(let o=0;o<s.length;o++)r[o]=s.charCodeAt(o);return new Blob([r],{type:i})}async function b_e(t){let e=y_e(t);const n=new FormData;n.append("image",e,"upload.png");const i=await fetch(v_e,{method:"POST",body:n});if(!i.ok)throw new Error(`Converter API Error: ${i.status} ${i.statusText}`);return await i.blob()}async function x_e(t,e,n){if(!n)throw new Error("FiveManage token is missing");const i=new FormData;i.append("file",t,`${e}.webp`);const a=await fetch("https://fmapi.net/api/v2/image",{method:"POST",body:i,headers:{Authorization:n}});if(!a.ok)throw console.log("FiveManage API Error",a),new Error(`FiveManage API Error: ${a.status} ${a.statusText}`);const s=await a.json();if(s?.error)throw new Error(`FiveManage Error: ${s.error}`);if(!s?.data?.id||!s?.data?.url)throw new Error("Invalid FiveManage response: missing id or url");return s.data}bu(()=>import("./main-gbLQafMG.js"),[],import.meta.url);function __e(){const t=Wr(vr),e=vi(R9),n=vi(Zf),i=vi(D9);return e3("toggle_creator",R9),e3("toggle_furniture_creator",D9),P.useEffect(()=>{bA()&&(document.body.style.backgroundImage="url(https://wallpapercat.com/w/full/5/1/f/130392-3840x2160-desktop-4k-grand-theft-auto-5-wallpaper-image.jpg)"),ut("initialized")},[]),yo("onUiReady",a=>{yr.use(ace).init({lng:a.languageName,resources:a.resources,fallbackLng:"en",interpolation:{escapeValue:!1}}),t(a.config)}),yo("upload_image",async a=>{try{const s=await b_e(a.image),r=a.fileName||`upload_${Date.now()}`,o=await x_e(s,r,a.fiveManageToken);ut("handle_uploaded_image",{url:o.url,requestId:a.requestId})}catch(s){console.error("Converter error:",s),a5({title:"Image Conversion Failed",description:String(s),variant:"flat",hideCloseButton:!0,size:"lg",color:"danger",timeout:8e3})}}),yo("notification",a=>{ut("play_sound","admin_active"),a5({title:a.type.toUpperCase(),description:a.msg,color:YV[a.type],shouldShowTimeoutProgress:!0,timeout:5e3,variant:"flat"})}),_.jsxs(_.Fragment,{children:[_.jsxs("div",{className:"w-screen h-screen absolute inset-0",children:[_.jsx(Up,{isOpen:e.visible,onClose:()=>ut("close"),children:e.visible&&_.jsx(i_e,{creatorData:e})},"creator-modal"),_.jsx(Up,{isOpen:i.visible,onClose:()=>ut("close"),children:i.visible&&_.jsx(g_e,{furnitureData:i.furniture})},"furniture-creator-modal"),_.jsx(jhe,{}),_.jsx(Vhe,{}),_.jsx(khe,{}),_.jsx(_X,{router:zfe})]}),n.visible&&_.jsx("div",{className:"w-full h-full absolute inset-0",children:_.jsx(D2e,{})})]})}const S_e=new efe;WW.createRoot(document.getElementById("root")).render(_.jsx(P.StrictMode,{children:_.jsxs(Ene,{className:"w-full h-full",children:[_.jsx(Loe,{placement:"top-center"}),_.jsx(nfe,{client:S_e,children:_.jsx(__e,{})})]})}));export{PT as $,Y8 as A,Dg as B,cr as C,jC as D,fu as E,QZ as F,lI as G,VC as H,EC as I,aw as J,Ml as K,V2 as L,bI as M,JZ as N,_te as O,cte as P,P as Q,Yb as R,zO as S,PZ as T,XZ as U,X1 as V,SC as W,MC as X,Jb as Y,$I as Z,CJ as _,ree as a,IO as a$,YJ as a0,UJ as a1,_a as a2,xZ as a3,NZ as a4,cI as a5,NJ as a6,za as a7,PQ as a8,OJ as a9,qQ as aA,Rl as aB,Eb as aC,oee as aD,kr as aE,XQ as aF,_C as aG,IQ as aH,Mte as aI,Ete as aJ,cS as aK,C_e as aL,EI as aM,PS as aN,QQ as aO,tJ as aP,zI as aQ,qb as aR,BI as aS,VQ as aT,Oee as aU,yN as aV,pee as aW,wC as aX,E_e as aY,LO as aZ,OO as a_,DJ as aa,AJ as ab,Pee as ac,qI as ad,NS as ae,wte as af,BZ as ag,q1 as ah,n1 as ai,mJ as aj,bE as ak,yu as al,HQ as am,vJ as an,ZZ as ao,XI as ap,OI as aq,_ as ar,WQ as as,sw as at,w_e as au,Ve as av,Hs as aw,BQ as ax,UQ as ay,Al as az,Sd as b,Ka as b$,Y1 as b0,CC as b1,_l as b2,kO as b3,AC as b4,VO as b5,FO as b6,RC as b7,$O as b8,HO as b9,nI as bA,KO as bB,T_e as bC,mo as bD,xI as bE,sc as bF,MQ as bG,TQ as bH,NQ as bI,SI as bJ,kC as bK,_T as bL,ST as bM,FZ as bN,KZ as bO,fI as bP,tI as bQ,U8 as bR,lE as bS,OC as bT,eI as bU,yZ as bV,gZ as bW,AS as bX,gT as bY,pZ as bZ,qZ as b_,Z1 as ba,kY as bb,GO as bc,HY as bd,UO as be,jO as bf,cQ as bg,M_e as bh,nQ as bi,dI as bj,dQ as bk,NC as bl,PC as bm,TT as bn,yT as bo,LZ as bp,wb as bq,IC as br,RS as bs,_Q as bt,UC as bu,GZ as bv,DZ as bw,mb as bx,oQ as by,SQ as bz,IJ as c,mT as c0,lg as c1,dZ as c2,rE as c3,Dp as c4,Qb as c5,Kf as c6,pI as c7,K8 as c8,yQ as c9,mI as ca,vQ as cb,Zb as cc,Jg as cd,k2 as ce,Tf as cf,hu as cg,I8 as ch,nZ as ci,iZ as cj,hI as ck,gI as cl,LQ as cm,sE as cn,bu as co,$Y as d,$8 as e,WO as f,xte as g,vI as h,bA as i,ta as j,Wf as k,dm as l,TC as m,FC as n,yI as o,WZ as p,Mn as q,wQ as r,oI as s,ev as t,wI as u,au as v,zs as w,kp as x,O8 as y,RZ as z};