gaesup-world 0.9.787 → 0.9.788

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- "use strict";var vi=Object.defineProperty;var Nr=r=>{throw TypeError(r)};var gi=(r,e,t)=>e in r?vi(r,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):r[e]=t;var $=(r,e,t)=>gi(r,typeof e!="symbol"?e+"":e,t),Bt=(r,e,t)=>e.has(r)||Nr("Cannot "+t);var u=(r,e,t)=>(Bt(r,e,"read from private field"),t?t.call(r):e.get(r)),I=(r,e,t)=>e.has(r)?Nr("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(r):e.set(r,t),j=(r,e,t,n)=>(Bt(r,e,"write to private field"),n?n.call(r,t):e.set(r,t),t),A=(r,e,t)=>(Bt(r,e,"access private method"),t);var Ct=(r,e,t,n)=>({set _(i){j(r,e,i,t)},get _(){return u(r,e,n)}});Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const w=require("react"),E=require("@react-three/rapier"),ge=require("three"),Pe=require("@react-three/drei"),je=require("@react-three/fiber");function yi(r){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const t in r)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(r,t);Object.defineProperty(e,t,n.get?n:{enumerable:!0,get:()=>r[t]})}}return e.default=r,Object.freeze(e)}const L=yi(ge);function dn(r){return r&&r.__esModule&&Object.prototype.hasOwnProperty.call(r,"default")?r.default:r}var Yt={exports:{}},ot={};/**
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react"),R=require("@react-three/rapier"),q=require("three"),X=require("@react-three/drei"),H=require("@react-three/fiber");function qt(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const E=qt(q);var je={exports:{}},ae={};/**
2
2
  * @license React
3
3
  * react-jsx-runtime.production.min.js
4
4
  *
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var Ur;function bi(){if(Ur)return ot;Ur=1;var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),n=Object.prototype.hasOwnProperty,i=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(l,s,c){var h,d={},m=null,v=null;c!==void 0&&(m=""+c),s.key!==void 0&&(m=""+s.key),s.ref!==void 0&&(v=s.ref);for(h in s)n.call(s,h)&&!a.hasOwnProperty(h)&&(d[h]=s[h]);if(l&&l.defaultProps)for(h in s=l.defaultProps,s)d[h]===void 0&&(d[h]=s[h]);return{$$typeof:e,type:l,key:m,ref:v,props:d,_owner:i.current}}return ot.Fragment=t,ot.jsx=o,ot.jsxs=o,ot}var st={};/**
9
+ */var Je;function Wt(){if(Je)return ae;Je=1;var e=d,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function c(l,s,y){var u,g={},m=null,x=null;y!==void 0&&(m=""+y),s.key!==void 0&&(m=""+s.key),s.ref!==void 0&&(x=s.ref);for(u in s)r.call(s,u)&&!o.hasOwnProperty(u)&&(g[u]=s[u]);if(l&&l.defaultProps)for(u in s=l.defaultProps,s)g[u]===void 0&&(g[u]=s[u]);return{$$typeof:t,type:l,key:m,ref:x,props:g,_owner:a.current}}return ae.Fragment=n,ae.jsx=c,ae.jsxs=c,ae}var oe={};/**
10
10
  * @license React
11
11
  * react-jsx-runtime.development.js
12
12
  *
@@ -14,68 +14,17 @@
14
14
  *
15
15
  * This source code is licensed under the MIT license found in the
16
16
  * LICENSE file in the root directory of this source tree.
17
- */var Lr;function wi(){return Lr||(Lr=1,process.env.NODE_ENV!=="production"&&function(){var r=w,e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),h=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.offscreen"),p=Symbol.iterator,y="@@iterator";function g(f){if(f===null||typeof f!="object")return null;var b=p&&f[p]||f[y];return typeof b=="function"?b:null}var C=r.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function R(f){{for(var b=arguments.length,O=new Array(b>1?b-1:0),M=1;M<b;M++)O[M-1]=arguments[M];k("error",f,O)}}function k(f,b,O){{var M=C.ReactDebugCurrentFrame,N=M.getStackAddendum();N!==""&&(b+="%s",O=O.concat([N]));var U=O.map(function(z){return String(z)});U.unshift("Warning: "+b),Function.prototype.apply.call(console[f],console,U)}}var P=!1,_=!1,D=!1,V=!1,q=!1,H;H=Symbol.for("react.module.reference");function Ie(f){return!!(typeof f=="string"||typeof f=="function"||f===n||f===a||q||f===i||f===c||f===h||V||f===v||P||_||D||typeof f=="object"&&f!==null&&(f.$$typeof===m||f.$$typeof===d||f.$$typeof===o||f.$$typeof===l||f.$$typeof===s||f.$$typeof===H||f.getModuleId!==void 0))}function rt(f,b,O){var M=f.displayName;if(M)return M;var N=b.displayName||b.name||"";return N!==""?O+"("+N+")":O}function pr(f){return f.displayName||"Context"}function Ee(f){if(f==null)return null;if(typeof f.tag=="number"&&R("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof f=="function")return f.displayName||f.name||null;if(typeof f=="string")return f;switch(f){case n:return"Fragment";case t:return"Portal";case a:return"Profiler";case i:return"StrictMode";case c:return"Suspense";case h:return"SuspenseList"}if(typeof f=="object")switch(f.$$typeof){case l:var b=f;return pr(b)+".Consumer";case o:var O=f;return pr(O._context)+".Provider";case s:return rt(f,f.render,"ForwardRef");case d:var M=f.displayName||null;return M!==null?M:Ee(f.type)||"Memo";case m:{var N=f,U=N._payload,z=N._init;try{return Ee(z(U))}catch{return null}}}return null}var Ne=Object.assign,nt=0,vr,gr,yr,br,wr,Cr,xr;function Sr(){}Sr.__reactDisabledLog=!0;function Bn(){{if(nt===0){vr=console.log,gr=console.info,yr=console.warn,br=console.error,wr=console.group,Cr=console.groupCollapsed,xr=console.groupEnd;var f={configurable:!0,enumerable:!0,value:Sr,writable:!0};Object.defineProperties(console,{info:f,log:f,warn:f,error:f,group:f,groupCollapsed:f,groupEnd:f})}nt++}}function qn(){{if(nt--,nt===0){var f={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Ne({},f,{value:vr}),info:Ne({},f,{value:gr}),warn:Ne({},f,{value:yr}),error:Ne({},f,{value:br}),group:Ne({},f,{value:wr}),groupCollapsed:Ne({},f,{value:Cr}),groupEnd:Ne({},f,{value:xr})})}nt<0&&R("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var Tt=C.ReactCurrentDispatcher,zt;function gt(f,b,O){{if(zt===void 0)try{throw Error()}catch(N){var M=N.stack.trim().match(/\n( *(at )?)/);zt=M&&M[1]||""}return`
18
- `+zt+f}}var Dt=!1,yt;{var $n=typeof WeakMap=="function"?WeakMap:Map;yt=new $n}function Rr(f,b){if(!f||Dt)return"";{var O=yt.get(f);if(O!==void 0)return O}var M;Dt=!0;var N=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var U;U=Tt.current,Tt.current=null,Bn();try{if(b){var z=function(){throw Error()};if(Object.defineProperty(z.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(z,[])}catch(le){M=le}Reflect.construct(f,[],z)}else{try{z.call()}catch(le){M=le}f.call(z.prototype)}}else{try{throw Error()}catch(le){M=le}f()}}catch(le){if(le&&M&&typeof le.stack=="string"){for(var T=le.stack.split(`
19
- `),ae=M.stack.split(`
20
- `),X=T.length-1,J=ae.length-1;X>=1&&J>=0&&T[X]!==ae[J];)J--;for(;X>=1&&J>=0;X--,J--)if(T[X]!==ae[J]){if(X!==1||J!==1)do if(X--,J--,J<0||T[X]!==ae[J]){var ve=`
21
- `+T[X].replace(" at new "," at ");return f.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",f.displayName)),typeof f=="function"&&yt.set(f,ve),ve}while(X>=1&&J>=0);break}}}finally{Dt=!1,Tt.current=U,qn(),Error.prepareStackTrace=N}var Ve=f?f.displayName||f.name:"",Ue=Ve?gt(Ve):"";return typeof f=="function"&&yt.set(f,Ue),Ue}function Vn(f,b,O){return Rr(f,!1)}function Hn(f){var b=f.prototype;return!!(b&&b.isReactComponent)}function bt(f,b,O){if(f==null)return"";if(typeof f=="function")return Rr(f,Hn(f));if(typeof f=="string")return gt(f);switch(f){case c:return gt("Suspense");case h:return gt("SuspenseList")}if(typeof f=="object")switch(f.$$typeof){case s:return Vn(f.render);case d:return bt(f.type,b,O);case m:{var M=f,N=M._payload,U=M._init;try{return bt(U(N),b,O)}catch{}}}return""}var it=Object.prototype.hasOwnProperty,Or={},Ar=C.ReactDebugCurrentFrame;function wt(f){if(f){var b=f._owner,O=bt(f.type,f._source,b?b.type:null);Ar.setExtraStackFrame(O)}else Ar.setExtraStackFrame(null)}function Yn(f,b,O,M,N){{var U=Function.call.bind(it);for(var z in f)if(U(f,z)){var T=void 0;try{if(typeof f[z]!="function"){var ae=Error((M||"React class")+": "+O+" type `"+z+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof f[z]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ae.name="Invariant Violation",ae}T=f[z](b,z,M,O,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(X){T=X}T&&!(T instanceof Error)&&(wt(N),R("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",M||"React class",O,z,typeof T),wt(null)),T instanceof Error&&!(T.message in Or)&&(Or[T.message]=!0,wt(N),R("Failed %s type: %s",O,T.message),wt(null))}}}var Kn=Array.isArray;function It(f){return Kn(f)}function Xn(f){{var b=typeof Symbol=="function"&&Symbol.toStringTag,O=b&&f[Symbol.toStringTag]||f.constructor.name||"Object";return O}}function Zn(f){try{return Er(f),!1}catch{return!0}}function Er(f){return""+f}function jr(f){if(Zn(f))return R("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Xn(f)),Er(f)}var at=C.ReactCurrentOwner,Jn={key:!0,ref:!0,__self:!0,__source:!0},kr,Mr,Nt;Nt={};function Qn(f){if(it.call(f,"ref")){var b=Object.getOwnPropertyDescriptor(f,"ref").get;if(b&&b.isReactWarning)return!1}return f.ref!==void 0}function ei(f){if(it.call(f,"key")){var b=Object.getOwnPropertyDescriptor(f,"key").get;if(b&&b.isReactWarning)return!1}return f.key!==void 0}function ti(f,b){if(typeof f.ref=="string"&&at.current&&b&&at.current.stateNode!==b){var O=Ee(at.current.type);Nt[O]||(R('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Ee(at.current.type),f.ref),Nt[O]=!0)}}function ri(f,b){{var O=function(){kr||(kr=!0,R("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};O.isReactWarning=!0,Object.defineProperty(f,"key",{get:O,configurable:!0})}}function ni(f,b){{var O=function(){Mr||(Mr=!0,R("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",b))};O.isReactWarning=!0,Object.defineProperty(f,"ref",{get:O,configurable:!0})}}var ii=function(f,b,O,M,N,U,z){var T={$$typeof:e,type:f,key:b,ref:O,props:z,_owner:U};return T._store={},Object.defineProperty(T._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(T,"_self",{configurable:!1,enumerable:!1,writable:!1,value:M}),Object.defineProperty(T,"_source",{configurable:!1,enumerable:!1,writable:!1,value:N}),Object.freeze&&(Object.freeze(T.props),Object.freeze(T)),T};function ai(f,b,O,M,N){{var U,z={},T=null,ae=null;O!==void 0&&(jr(O),T=""+O),ei(b)&&(jr(b.key),T=""+b.key),Qn(b)&&(ae=b.ref,ti(b,N));for(U in b)it.call(b,U)&&!Jn.hasOwnProperty(U)&&(z[U]=b[U]);if(f&&f.defaultProps){var X=f.defaultProps;for(U in X)z[U]===void 0&&(z[U]=X[U])}if(T||ae){var J=typeof f=="function"?f.displayName||f.name||"Unknown":f;T&&ri(z,J),ae&&ni(z,J)}return ii(f,T,ae,N,M,at.current,z)}}var Ut=C.ReactCurrentOwner,Pr=C.ReactDebugCurrentFrame;function $e(f){if(f){var b=f._owner,O=bt(f.type,f._source,b?b.type:null);Pr.setExtraStackFrame(O)}else Pr.setExtraStackFrame(null)}var Lt;Lt=!1;function Wt(f){return typeof f=="object"&&f!==null&&f.$$typeof===e}function Fr(){{if(Ut.current){var f=Ee(Ut.current.type);if(f)return`
17
+ */var Ze;function Vt(){return Ze||(Ze=1,process.env.NODE_ENV!=="production"&&function(){var e=d,t=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),s=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),u=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),x=Symbol.for("react.offscreen"),h=Symbol.iterator,p="@@iterator";function w(i){if(i===null||typeof i!="object")return null;var f=h&&i[h]||i[p];return typeof f=="function"?f:null}var M=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function S(i){{for(var f=arguments.length,b=new Array(f>1?f-1:0),C=1;C<f;C++)b[C-1]=arguments[C];F("error",i,b)}}function F(i,f,b){{var C=M.ReactDebugCurrentFrame,k=C.getStackAddendum();k!==""&&(f+="%s",b=b.concat([k]));var P=b.map(function(O){return String(O)});P.unshift("Warning: "+f),Function.prototype.apply.call(console[i],console,P)}}var W=!1,U=!1,V=!1,L=!1,Z=!1,I;I=Symbol.for("react.module.reference");function vt(i){return!!(typeof i=="string"||typeof i=="function"||i===r||i===o||Z||i===a||i===y||i===u||L||i===x||W||U||V||typeof i=="object"&&i!==null&&(i.$$typeof===m||i.$$typeof===g||i.$$typeof===c||i.$$typeof===l||i.$$typeof===s||i.$$typeof===I||i.getModuleId!==void 0))}function ht(i,f,b){var C=i.displayName;if(C)return C;var k=f.displayName||f.name||"";return k!==""?b+"("+k+")":b}function Me(i){return i.displayName||"Context"}function Y(i){if(i==null)return null;if(typeof i.tag=="number"&&S("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case a:return"StrictMode";case y:return"Suspense";case u:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case l:var f=i;return Me(f)+".Consumer";case c:var b=i;return Me(b._context)+".Provider";case s:return ht(i,i.render,"ForwardRef");case g:var C=i.displayName||null;return C!==null?C:Y(i.type)||"Memo";case m:{var k=i,P=k._payload,O=k._init;try{return Y(O(P))}catch{return null}}}return null}var K=Object.assign,ne=0,Pe,Ee,Te,_e,Ae,De,Fe;function ze(){}ze.__reactDisabledLog=!0;function yt(){{if(ne===0){Pe=console.log,Ee=console.info,Te=console.warn,_e=console.error,Ae=console.group,De=console.groupCollapsed,Fe=console.groupEnd;var i={configurable:!0,enumerable:!0,value:ze,writable:!0};Object.defineProperties(console,{info:i,log:i,warn:i,error:i,group:i,groupCollapsed:i,groupEnd:i})}ne++}}function gt(){{if(ne--,ne===0){var i={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:K({},i,{value:Pe}),info:K({},i,{value:Ee}),warn:K({},i,{value:Te}),error:K({},i,{value:_e}),group:K({},i,{value:Ae}),groupCollapsed:K({},i,{value:De}),groupEnd:K({},i,{value:Fe})})}ne<0&&S("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ve=M.ReactCurrentDispatcher,he;function le(i,f,b){{if(he===void 0)try{throw Error()}catch(k){var C=k.stack.trim().match(/\n( *(at )?)/);he=C&&C[1]||""}return`
18
+ `+he+i}}var ye=!1,ce;{var bt=typeof WeakMap=="function"?WeakMap:Map;ce=new bt}function Ie(i,f){if(!i||ye)return"";{var b=ce.get(i);if(b!==void 0)return b}var C;ye=!0;var k=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var P;P=ve.current,ve.current=null,yt();try{if(f){var O=function(){throw Error()};if(Object.defineProperty(O.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(O,[])}catch(N){C=N}Reflect.construct(i,[],O)}else{try{O.call()}catch(N){C=N}i.call(O.prototype)}}else{try{throw Error()}catch(N){C=N}i()}}catch(N){if(N&&C&&typeof N.stack=="string"){for(var j=N.stack.split(`
19
+ `),z=C.stack.split(`
20
+ `),A=j.length-1,D=z.length-1;A>=1&&D>=0&&j[A]!==z[D];)D--;for(;A>=1&&D>=0;A--,D--)if(j[A]!==z[D]){if(A!==1||D!==1)do if(A--,D--,D<0||j[A]!==z[D]){var B=`
21
+ `+j[A].replace(" at new "," at ");return i.displayName&&B.includes("<anonymous>")&&(B=B.replace("<anonymous>",i.displayName)),typeof i=="function"&&ce.set(i,B),B}while(A>=1&&D>=0);break}}}finally{ye=!1,ve.current=P,gt(),Error.prepareStackTrace=k}var ee=i?i.displayName||i.name:"",J=ee?le(ee):"";return typeof i=="function"&&ce.set(i,J),J}function xt(i,f,b){return Ie(i,!1)}function Rt(i){var f=i.prototype;return!!(f&&f.isReactComponent)}function ue(i,f,b){if(i==null)return"";if(typeof i=="function")return Ie(i,Rt(i));if(typeof i=="string")return le(i);switch(i){case y:return le("Suspense");case u:return le("SuspenseList")}if(typeof i=="object")switch(i.$$typeof){case s:return xt(i.render);case g:return ue(i.type,f,b);case m:{var C=i,k=C._payload,P=C._init;try{return ue(P(k),f,b)}catch{}}}return""}var re=Object.prototype.hasOwnProperty,Ne={},Ge=M.ReactDebugCurrentFrame;function fe(i){if(i){var f=i._owner,b=ue(i.type,i._source,f?f.type:null);Ge.setExtraStackFrame(b)}else Ge.setExtraStackFrame(null)}function pt(i,f,b,C,k){{var P=Function.call.bind(re);for(var O in i)if(P(i,O)){var j=void 0;try{if(typeof i[O]!="function"){var z=Error((C||"React class")+": "+b+" type `"+O+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof i[O]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw z.name="Invariant Violation",z}j=i[O](f,O,C,b,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(A){j=A}j&&!(j instanceof Error)&&(fe(k),S("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",C||"React class",b,O,typeof j),fe(null)),j instanceof Error&&!(j.message in Ne)&&(Ne[j.message]=!0,fe(k),S("Failed %s type: %s",b,j.message),fe(null))}}}var wt=Array.isArray;function ge(i){return wt(i)}function Ct(i){{var f=typeof Symbol=="function"&&Symbol.toStringTag,b=f&&i[Symbol.toStringTag]||i.constructor.name||"Object";return b}}function jt(i){try{return Ue(i),!1}catch{return!0}}function Ue(i){return""+i}function $e(i){if(jt(i))return S("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",Ct(i)),Ue(i)}var ie=M.ReactCurrentOwner,Ot={key:!0,ref:!0,__self:!0,__source:!0},Be,qe,be;be={};function St(i){if(re.call(i,"ref")){var f=Object.getOwnPropertyDescriptor(i,"ref").get;if(f&&f.isReactWarning)return!1}return i.ref!==void 0}function kt(i){if(re.call(i,"key")){var f=Object.getOwnPropertyDescriptor(i,"key").get;if(f&&f.isReactWarning)return!1}return i.key!==void 0}function Mt(i,f){if(typeof i.ref=="string"&&ie.current&&f&&ie.current.stateNode!==f){var b=Y(ie.current.type);be[b]||(S('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',Y(ie.current.type),i.ref),be[b]=!0)}}function Pt(i,f){{var b=function(){Be||(Be=!0,S("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};b.isReactWarning=!0,Object.defineProperty(i,"key",{get:b,configurable:!0})}}function Et(i,f){{var b=function(){qe||(qe=!0,S("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",f))};b.isReactWarning=!0,Object.defineProperty(i,"ref",{get:b,configurable:!0})}}var Tt=function(i,f,b,C,k,P,O){var j={$$typeof:t,type:i,key:f,ref:b,props:O,_owner:P};return j._store={},Object.defineProperty(j._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(j,"_self",{configurable:!1,enumerable:!1,writable:!1,value:C}),Object.defineProperty(j,"_source",{configurable:!1,enumerable:!1,writable:!1,value:k}),Object.freeze&&(Object.freeze(j.props),Object.freeze(j)),j};function _t(i,f,b,C,k){{var P,O={},j=null,z=null;b!==void 0&&($e(b),j=""+b),kt(f)&&($e(f.key),j=""+f.key),St(f)&&(z=f.ref,Mt(f,k));for(P in f)re.call(f,P)&&!Ot.hasOwnProperty(P)&&(O[P]=f[P]);if(i&&i.defaultProps){var A=i.defaultProps;for(P in A)O[P]===void 0&&(O[P]=A[P])}if(j||z){var D=typeof i=="function"?i.displayName||i.name||"Unknown":i;j&&Pt(O,D),z&&Et(O,D)}return Tt(i,j,z,k,C,ie.current,O)}}var xe=M.ReactCurrentOwner,We=M.ReactDebugCurrentFrame;function Q(i){if(i){var f=i._owner,b=ue(i.type,i._source,f?f.type:null);We.setExtraStackFrame(b)}else We.setExtraStackFrame(null)}var Re;Re=!1;function pe(i){return typeof i=="object"&&i!==null&&i.$$typeof===t}function Ve(){{if(xe.current){var i=Y(xe.current.type);if(i)return`
22
22
 
23
- Check the render method of \``+f+"`."}return""}}function oi(f){return""}var _r={};function si(f){{var b=Fr();if(!b){var O=typeof f=="string"?f:f.displayName||f.name;O&&(b=`
23
+ Check the render method of \``+i+"`."}return""}}function At(i){return""}var Le={};function Dt(i){{var f=Ve();if(!f){var b=typeof i=="string"?i:i.displayName||i.name;b&&(f=`
24
24
 
25
- Check the top-level render call using <`+O+">.")}return b}}function Tr(f,b){{if(!f._store||f._store.validated||f.key!=null)return;f._store.validated=!0;var O=si(b);if(_r[O])return;_r[O]=!0;var M="";f&&f._owner&&f._owner!==Ut.current&&(M=" It was passed a child from "+Ee(f._owner.type)+"."),$e(f),R('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',O,M),$e(null)}}function zr(f,b){{if(typeof f!="object")return;if(It(f))for(var O=0;O<f.length;O++){var M=f[O];Wt(M)&&Tr(M,b)}else if(Wt(f))f._store&&(f._store.validated=!0);else if(f){var N=g(f);if(typeof N=="function"&&N!==f.entries)for(var U=N.call(f),z;!(z=U.next()).done;)Wt(z.value)&&Tr(z.value,b)}}}function li(f){{var b=f.type;if(b==null||typeof b=="string")return;var O;if(typeof b=="function")O=b.propTypes;else if(typeof b=="object"&&(b.$$typeof===s||b.$$typeof===d))O=b.propTypes;else return;if(O){var M=Ee(b);Yn(O,f.props,"prop",M,f)}else if(b.PropTypes!==void 0&&!Lt){Lt=!0;var N=Ee(b);R("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",N||"Unknown")}typeof b.getDefaultProps=="function"&&!b.getDefaultProps.isReactClassApproved&&R("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ui(f){{for(var b=Object.keys(f.props),O=0;O<b.length;O++){var M=b[O];if(M!=="children"&&M!=="key"){$e(f),R("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",M),$e(null);break}}f.ref!==null&&($e(f),R("Invalid attribute `ref` supplied to `React.Fragment`."),$e(null))}}var Dr={};function Ir(f,b,O,M,N,U){{var z=Ie(f);if(!z){var T="";(f===void 0||typeof f=="object"&&f!==null&&Object.keys(f).length===0)&&(T+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ae=oi();ae?T+=ae:T+=Fr();var X;f===null?X="null":It(f)?X="array":f!==void 0&&f.$$typeof===e?(X="<"+(Ee(f.type)||"Unknown")+" />",T=" Did you accidentally export a JSX literal instead of a component?"):X=typeof f,R("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",X,T)}var J=ai(f,b,O,N,U);if(J==null)return J;if(z){var ve=b.children;if(ve!==void 0)if(M)if(It(ve)){for(var Ve=0;Ve<ve.length;Ve++)zr(ve[Ve],f);Object.freeze&&Object.freeze(ve)}else R("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else zr(ve,f)}if(it.call(b,"key")){var Ue=Ee(f),le=Object.keys(b).filter(function(pi){return pi!=="key"}),Gt=le.length>0?"{key: someKey, "+le.join(": ..., ")+": ...}":"{key: someKey}";if(!Dr[Ue+Gt]){var mi=le.length>0?"{"+le.join(": ..., ")+": ...}":"{}";R(`A props object containing a "key" prop is being spread into JSX:
25
+ Check the top-level render call using <`+b+">.")}return f}}function Ye(i,f){{if(!i._store||i._store.validated||i.key!=null)return;i._store.validated=!0;var b=Dt(f);if(Le[b])return;Le[b]=!0;var C="";i&&i._owner&&i._owner!==xe.current&&(C=" It was passed a child from "+Y(i._owner.type)+"."),Q(i),S('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',b,C),Q(null)}}function He(i,f){{if(typeof i!="object")return;if(ge(i))for(var b=0;b<i.length;b++){var C=i[b];pe(C)&&Ye(C,f)}else if(pe(i))i._store&&(i._store.validated=!0);else if(i){var k=w(i);if(typeof k=="function"&&k!==i.entries)for(var P=k.call(i),O;!(O=P.next()).done;)pe(O.value)&&Ye(O.value,f)}}}function Ft(i){{var f=i.type;if(f==null||typeof f=="string")return;var b;if(typeof f=="function")b=f.propTypes;else if(typeof f=="object"&&(f.$$typeof===s||f.$$typeof===g))b=f.propTypes;else return;if(b){var C=Y(f);pt(b,i.props,"prop",C,i)}else if(f.PropTypes!==void 0&&!Re){Re=!0;var k=Y(f);S("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",k||"Unknown")}typeof f.getDefaultProps=="function"&&!f.getDefaultProps.isReactClassApproved&&S("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function zt(i){{for(var f=Object.keys(i.props),b=0;b<f.length;b++){var C=f[b];if(C!=="children"&&C!=="key"){Q(i),S("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",C),Q(null);break}}i.ref!==null&&(Q(i),S("Invalid attribute `ref` supplied to `React.Fragment`."),Q(null))}}var Xe={};function Ke(i,f,b,C,k,P){{var O=vt(i);if(!O){var j="";(i===void 0||typeof i=="object"&&i!==null&&Object.keys(i).length===0)&&(j+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var z=At();z?j+=z:j+=Ve();var A;i===null?A="null":ge(i)?A="array":i!==void 0&&i.$$typeof===t?(A="<"+(Y(i.type)||"Unknown")+" />",j=" Did you accidentally export a JSX literal instead of a component?"):A=typeof i,S("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",A,j)}var D=_t(i,f,b,k,P);if(D==null)return D;if(O){var B=f.children;if(B!==void 0)if(C)if(ge(B)){for(var ee=0;ee<B.length;ee++)He(B[ee],i);Object.freeze&&Object.freeze(B)}else S("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else He(B,i)}if(re.call(f,"key")){var J=Y(i),N=Object.keys(f).filter(function(Bt){return Bt!=="key"}),we=N.length>0?"{key: someKey, "+N.join(": ..., ")+": ...}":"{key: someKey}";if(!Xe[J+we]){var $t=N.length>0?"{"+N.join(": ..., ")+": ...}":"{}";S(`A props object containing a "key" prop is being spread into JSX:
26
26
  let props = %s;
27
27
  <%s {...props} />
28
28
  React keys must be passed directly to JSX without using spread:
29
29
  let props = %s;
30
- <%s key={someKey} {...props} />`,Gt,Ue,mi,Ue),Dr[Ue+Gt]=!0}}return f===n?ui(J):li(J),J}}function ci(f,b,O){return Ir(f,b,O,!0)}function fi(f,b,O){return Ir(f,b,O,!1)}var hi=fi,di=ci;st.Fragment=n,st.jsx=hi,st.jsxs=di}()),st}process.env.NODE_ENV==="production"?Yt.exports=bi():Yt.exports=wi();var S=Yt.exports;function Wr(r,e,t){return Math.sqrt(Math.pow(r.x-e.x,2)+t+Math.pow(r.z-e.z,2))}function K(r,e,t){return new L.Vector3(r,e,t)}function Ci(){return new L.Vector3(0,0,0)}function xi(){return new L.Vector3(1,1,1)}function Si(r,e,t,n){return new L.Quaternion(r,e,t,n)}function Ri(r,e,t){return new L.Euler(r,e,t)}function Oi(r){const e=K(0,0,1),t=Math.acos(r.dot(e)/r.length()),n=r.cross(e),i=Math.sin(n.y)||1;return Math.PI-t*i}const ue={activeState:{position:K(0,5,5),impulse:E.vec3(),velocity:E.vec3(),acceleration:E.vec3(),quat:E.quat(),euler:E.euler(),rotation:E.euler(),dir:E.vec3(),direction:E.vec3()},mode:{},urls:{characterUrl:null,vehicleUrl:null,airplaneUrl:null,wheelUrl:null,ridingUrl:null},states:{rideableId:null,isMoving:!1,isNotMoving:!1,isOnTheGround:!1,isOnMoving:!1,isRotated:!1,isRunning:!1,isJumping:!1,enableRiding:!1,isRiderOn:!1,isLanding:!1,isFalling:!1,isRiding:!1,isPush:{forward:!1,backward:!1,leftward:!1,rightward:!1}},minimap:{props:{}},clicker:{point:K(0,0,0),angle:Math.PI/2,isOn:!1,isRun:!1},control:{forward:!1,backward:!1,leftward:!1,rightward:!1},refs:null,animationState:{character:{current:"idle",default:"idle",store:{}},vehicle:{current:"idle",default:"idle",store:{}},airplane:{current:"idle",default:"idle",store:{}}},cameraOption:{offset:K(-10,-10,-10),maxDistance:-7,distance:-1,XDistance:20,YDistance:10,ZDistance:20,zoom:1,target:E.vec3(),position:E.vec3(),focus:!1},rideable:{},sizes:{},block:{camera:!1,control:!1,animation:!1,scroll:!0},clickerOption:{isRun:!0,throttle:100,autoStart:!1,track:!1,loop:!1,queue:[],line:!1}},B=w.createContext(null),pe=w.createContext(null),ir=w.forwardRef(({children:r},e)=>S.jsx("group",{ref:e,userData:{intangible:!0},children:r}));function mn(r,e,t={}){const n=new ge.Vector3,i=new ge.Quaternion,a=new ge.Vector3,o=new ge.Matrix4,l=new ge.Matrix4,s=new ge.Matrix4;t.preserveMatrix=t.preserveMatrix!==void 0?t.preserveMatrix:!0,t.preservePosition=t.preservePosition!==void 0?t.preservePosition:!0,t.preserveHipPosition=t.preserveHipPosition!==void 0?t.preserveHipPosition:!1,t.useTargetMatrix=t.useTargetMatrix!==void 0?t.useTargetMatrix:!1,t.hip=t.hip!==void 0?t.hip:"hip",t.names=t.names||{};const c=e.isObject3D?e.skeleton.bones:Et(e),h=r.isObject3D?r.skeleton.bones:Et(r);let d,m,v,p,y;if(r.isObject3D?r.skeleton.pose():(t.useTargetMatrix=!0,t.preserveMatrix=!1),t.preservePosition){y=[];for(let g=0;g<h.length;g++)y.push(h[g].position.clone())}if(t.preserveMatrix){r.updateMatrixWorld(),r.matrixWorld.identity();for(let g=0;g<r.children.length;++g)r.children[g].updateMatrixWorld(!0)}if(t.offsets){d=[];for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,t.offsets[v]&&(m.matrix.multiply(t.offsets[v]),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()),d.push(m.matrixWorld.clone())}for(let g=0;g<h.length;++g){if(m=h[g],v=t.names[m.name]||m.name,p=pn(v,c),s.copy(m.matrixWorld),p){if(p.updateMatrixWorld(),t.useTargetMatrix?l.copy(p.matrixWorld):(l.copy(r.matrixWorld).invert(),l.multiply(p.matrixWorld)),a.setFromMatrixScale(l),l.scale(a.set(1/a.x,1/a.y,1/a.z)),s.makeRotationFromQuaternion(i.setFromRotationMatrix(l)),r.isObject3D){const C=h.indexOf(m),R=d?d[C]:o.copy(r.skeleton.boneInverses[C]).invert();s.multiply(R)}s.copyPosition(l)}m.parent&&m.parent.isBone?(m.matrix.copy(m.parent.matrixWorld).invert(),m.matrix.multiply(s)):m.matrix.copy(s),t.preserveHipPosition&&v===t.hip&&m.matrix.setPosition(n.set(0,m.position.y,0)),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()}if(t.preservePosition)for(let g=0;g<h.length;++g)m=h[g],v=t.names[m.name]||m.name,v!==t.hip&&m.position.copy(y[g]);t.preserveMatrix&&r.updateMatrixWorld(!0)}function Ai(r,e,t,n={}){n.useFirstFramePosition=n.useFirstFramePosition!==void 0?n.useFirstFramePosition:!1,n.fps=n.fps!==void 0?n.fps:30,n.names=n.names||[],e.isObject3D||(e=ji(e));const i=Math.round(t.duration*(n.fps/1e3)*1e3),a=1/n.fps,o=[],l=new ge.AnimationMixer(e),s=Et(r.skeleton),c=[];let h,d,m,v,p;l.clipAction(t).play(),l.update(0),e.updateMatrixWorld();for(let y=0;y<i;++y){const g=y*a;mn(r,e,n);for(let C=0;C<s.length;++C)p=n.names[s[C].name]||s[C].name,m=pn(p,e.skeleton),m&&(d=s[C],v=c[C]=c[C]||{bone:d},n.hip===p&&(v.pos||(v.pos={times:new Float32Array(i),values:new Float32Array(i*3)}),n.useFirstFramePosition&&(y===0&&(h=d.position.clone()),d.position.sub(h)),v.pos.times[y]=g,d.position.toArray(v.pos.values,y*3)),v.quat||(v.quat={times:new Float32Array(i),values:new Float32Array(i*4)}),v.quat.times[y]=g,d.quaternion.toArray(v.quat.values,y*4));l.update(a),e.updateMatrixWorld()}for(let y=0;y<c.length;++y)v=c[y],v&&(v.pos&&o.push(new ge.VectorKeyframeTrack(".bones["+v.bone.name+"].position",v.pos.times,v.pos.values)),o.push(new ge.QuaternionKeyframeTrack(".bones["+v.bone.name+"].quaternion",v.quat.times,v.quat.values)));return l.uncacheAction(t),new ge.AnimationClip(t.name,-1,o)}function Ei(r){const e=new Map,t=new Map,n=r.clone();return vn(r,n,function(i,a){e.set(a,i),t.set(i,a)}),n.traverse(function(i){if(!i.isSkinnedMesh)return;const a=i,o=e.get(i),l=o.skeleton.bones;a.skeleton=o.skeleton.clone(),a.bindMatrix.copy(o.bindMatrix),a.skeleton.bones=l.map(function(s){return t.get(s)}),a.bind(a.skeleton,a.bindMatrix)}),n}function pn(r,e){for(let t=0,n=Et(e);t<n.length;t++)if(r===n[t].name)return n[t]}function Et(r){return Array.isArray(r)?r:r.bones}function ji(r){const e=new ge.SkeletonHelper(r.bones[0]);return e.skeleton=r,e}function vn(r,e,t){t(r,e);for(let n=0;n<r.children.length;n++)vn(r.children[n],e.children[n],t)}const gn={retarget:mn,retargetClip:Ai,clone:Ei};function ft({type:r}){const{animationState:e}=w.useContext(B),t=w.useContext(pe),n=s=>{const c=e[r].store[s];return c?c.condition()?{name:c.animationName,isValid:!0}:{name:e[r].default,isValid:!1}:{name:e[r].default,isValid:!1}},i=()=>{let s=e[r].default;for(const c of Object.keys(e[r].store)){const h=n(c);if(h.isValid){s=h.name;break}}return e[r].current=s,t({type:"update",payload:{animationState:{...e}}}),s},a=s=>{delete e[r].store[s],t({type:"update",payload:{animationState:{...e}}})};return{subscribe:({tag:s,condition:c,action:h,animationName:d,key:m})=>{e[r].store[s]={condition:c,action:h||(()=>{}),animationName:d||s,key:m||s},t({type:"update",payload:{animationState:{...e}}})},subscribeAll:s=>{const c=[];return s.forEach(h=>{e[r].store[h.tag]={condition:h.condition,action:h.action,animationName:h.animationName,key:h.key},c.push(h.tag)}),t({type:"update",payload:{animationState:{...e}}}),()=>{c.forEach(h=>{delete e[r].store[h]}),t({type:"update",payload:{animationState:{...e}}})}},store:e==null?void 0:e[r].store,unsubscribe:a,notify:i}}function ki({type:r}){const{states:e}=w.useContext(B),{subscribeAll:t}=ft({type:r});w.useEffect(()=>{t([{tag:"walk",condition:()=>!e.isRunning&&e.isMoving,action:()=>{},animationName:"walk",key:"walk"},{tag:"run",condition:()=>e.isRunning,action:()=>{},animationName:"run",key:"run"},{tag:"jump",condition:()=>e.isJumping,action:()=>{},animationName:"jump",key:"jump"},{tag:"ride",condition:()=>e.isPush.keyR,action:()=>{},animationName:"ride",key:"ride"},{tag:"land",condition:()=>e.isLanding,action:()=>{},animationName:"land",key:"land"},{tag:"fall",condition:()=>e.isFalling,action:()=>{},animationName:"fall",key:"fall"}])},[])}function ar({type:r,actions:e,animationRef:t,currentAnimation:n,isActive:i}){var m,v;const{mode:a,animationState:o,block:l}=w.useContext(B),s=w.useContext(pe),{notify:c,store:h}=ft({type:r});i&&(n=(m=o==null?void 0:o[r])==null?void 0:m.current);const d=p=>{o[r].current=p;const y=h[p];y!=null&&y.action&&y.action(),s({type:"update",payload:{animationState:{...o}}})};return w.useEffect(()=>{var g;let p="idle";l.animation?p="idle":n?p=n:o[r].current&&(p=o[r].current);const y=(g=e[p])==null?void 0:g.reset().fadeIn(.2).play();return()=>{y==null||y.fadeOut(.2)}},[n,a.type,l.animation,r]),je.useFrame(()=>{if(i){const p=c();d(p)}}),{animationRef:t,currentAnimation:(v=o==null?void 0:o[r])==null?void 0:v.current}}const Mi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(t,n,i))};function Pi(r){const{state:e,worldContext:{cameraOption:t},controllerOptions:{lerp:n}}=r;!e||!e.camera||(e.camera.position.lerp(t.position.clone(),n.cameraPosition),e.camera.lookAt(t.target))}const Fi=(r,e)=>{const{XDistance:t,YDistance:n,ZDistance:i}=e;return r.position.clone().add(K(Math.sin(r.euler.y),1,Math.cos(r.euler.y)).normalize().clone().multiply(K(-t,n,-i)))};function _i(r){const{state:e,worldContext:{activeState:t,cameraOption:n},controllerOptions:{lerp:i}}=r;if(!e||!e.camera)return;const a=Fi(t,n);e.camera.position.lerp(a.clone(),i.cameraTurn),e.camera.quaternion.copy(t.quat.clone().multiply(E.quat().setFromAxisAngle(K(0,1,0),Math.PI))),e.camera.rotation.copy(t.euler),e.camera.lookAt(t.position.clone())}function Ti(r){je.useFrame(e=>{r.state=e,r.worldContext.block.camera||(r.worldContext.mode.control==="orbit"?_i(r):r.worldContext.mode.control==="normal"&&Pi(r))}),je.useFrame(()=>{r.worldContext.cameraOption.focus||(r.worldContext.cameraOption.target=r.worldContext.activeState.position,r.worldContext.cameraOption.position=Mi(r.worldContext.activeState,r.worldContext.cameraOption))})}const Xe={airplane:{angleDelta:K(Math.PI/256,Math.PI/256,Math.PI/256),maxAngle:K(Math.PI/8,Math.PI/8,Math.PI/8),maxSpeed:60,accelRatio:2,brakeRatio:5,buoyancy:.2,linearDamping:1},vehicle:{maxSpeed:60,accelRatio:2,brakeRatio:5,wheelOffset:.1,linearDamping:.5},character:{walkSpeed:10,runSpeed:20,turnSpeed:10,jumpSpeed:1,linearDamping:1},callbacks:{onReady:()=>{},onFrame:()=>{},onDestory:()=>{},onAnimate:()=>{}},refs:{colliderRef:null,rigidBodyRef:null,outerGroupRef:null,innerGroupRef:null,characterInnerRef:null},controllerOptions:{lerp:{cameraTurn:1,cameraPosition:1}}},jt=w.createContext({...Xe}),zi=w.createContext(null);function Di({props:r,actions:e,componentType:t}){const{animationState:n}=w.useContext(B),i=w.useContext(pe),{store:a}=ft({type:t}),{activeState:o,states:l,control:s}=w.useContext(B),{subscribe:c}=ft({type:t}),h=(m,v)=>{if(v in s&&s[v]&&n[t]){n[t].current=m;const p=a[m];p!=null&&p.action&&p.action(),i({type:"update",payload:{animationState:{...n}}})}},d={activeState:o,control:s,states:l,subscribe:c};return w.useEffect(()=>(r.onReady&&r.onReady(d),()=>{r.onDestory&&r.onDestory(d)}),[]),je.useFrame(m=>{r.onFrame&&r.onFrame({...d,...m}),r.onAnimate&&r.onAnimate({...d,...m,actions:e,animationState:n,playAnimation:h})}),{subscribe:c,playAnimation:h,dispatch:i}}const yn=({url:r})=>{const{sizes:e}=w.useContext(B),t=w.useContext(pe),n=Pe.useGLTF(r),{scene:i}=n,a=()=>new L.Box3().setFromObject(i).getSize(new L.Vector3),o=s=>{const c=s||r;return c in e?e[c]:null},l=(s,c)=>{const h=c||r;return h in e||(e[h]=s||a(),t({type:"update",payload:{sizes:{...e}}})),e[h]};return{gltf:n,size:l(),setSize:l,getSize:o}},bn=()=>{const{sizes:r}=w.useContext(B);return{getSizesByUrls:t=>{const n={};return t&&Object.keys(t).forEach(i=>{const a=t[i];a in r?n[i]=r[a]:n[i]=null}),n}}};function Ii(r){const{rigidBodyRef:e,controllerContext:{airplane:t}}=r,{linearDamping:n}=t;e.current.setLinearDamping(n)}function Ni(r){const{innerGroupRef:e,worldContext:{activeState:t,control:n},controllerContext:{airplane:i},matchSizes:a}=r,{forward:o,backward:l,leftward:s,rightward:c,shift:h,space:d}=n,{angleDelta:m,maxAngle:v,accelRatio:p}=i;if(!a||!a.airplaneUrl)return null;let y=0;y=d?Number(h):Number(h)*p;const g=Number(l)-Number(o),C=Number(c)-Number(s),R=K().set(y,y,y);t.euler.y+=-C*m.y;const k=v.x*g,P=v.z*C,_=e.current.rotation.x,D=e.current.rotation.z,V=v.x,q=v.z,H=e.current.clone();_<-V?H.rotation.x=-V+k:_>V?H.rotation.x=V+k:H.rotateX(k),D<-q?H.rotation.z=-q+P:D>q?H.rotation.z=q+P:H.rotateZ(P),t.euler.x=H.rotation.x,t.euler.z=H.rotation.z,H.rotation.y=0,e.current.setRotationFromQuaternion(E.quat().setFromEuler(e.current.rotation.clone()).slerp(E.quat().setFromEuler(H.rotation.clone()),.2)),t.rotation=H.rotation,t.direction=R.multiply(K(Math.sin(t.euler.y),-g,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function Ui(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;e.current.setGravityScale(t.position.y<10?(1-.1)/-10*t.position.y+1:.1,!1)}function Li(r){const{rigidBodyRef:e,worldContext:{activeState:t},controllerContext:{airplane:n}}=r,{maxSpeed:i}=n,a=e.current.linvel();if(E.vec3(a).length()<i){const l=e.current.mass();e.current.applyImpulse(E.vec3({x:t.direction.x,y:t.direction.y,z:t.direction.z}).multiplyScalar(l),!1)}}function Wi(r){const{rigidBodyRef:e,worldContext:{activeState:t},dispatch:n}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel());const i=t.euler.clone();i.x=0,i.z=0,e.current.setRotation(E.quat().setFromEuler(i),!0),n({type:"update",payload:{activeState:{...t}}})}function Gi(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function Bi(r){Ni(r),Li(r),Ii(r),Ui(r),Gi(r),Wi(r)}function qi({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e,s=Number(o)-Number(l),c=Number(i)-Number(a);let h=0;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,h=1;else{if(s===0&&c===0)return;r.euler.y+=s*Math.PI/32,h=c}const d=K(h,0,h);r.direction=d.multiply(K(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y))),r.dir=r.direction.normalize()}function $i({activeState:r,control:e,mode:t,clicker:n}){const{forward:i,backward:a,leftward:o,rightward:l}=e;if(t.controller==="clicker")r.euler.y=Math.PI/2-n.angle,r.dir.set(-Math.sin(r.euler.y),0,-Math.cos(r.euler.y));else{const s=Number(o)-Number(l),c=Number(i)-Number(a);if(s===0&&c===0)return;const h=K(s,0,c),d=Oi(h);r.euler.y=d,r.dir.set(s,0,c)}}function Vi(r){const{worldContext:e}=r;e.mode.control==="normal"?$i(e):e.mode.control==="orbit"&&qi(e)}function Hi(r){const{rigidBodyRef:e,worldContext:{states:t,activeState:n}}=r,{isMoving:i,isRunning:a}=t,{controllerContext:{character:{walkSpeed:o,runSpeed:l,jumpSpeed:s}}}=r,{isOnTheGround:c,isJumping:h}=t,d=E.vec3();if(h&&c&&d.setY(s*e.current.mass()),i){const m=a?l:o,v=E.vec3().addScalar(m).multiply(n.dir.clone().normalize().negate()),p=e.current.mass(),g=v.clone().sub(n.velocity).multiplyScalar(p);d.setX(g.x),d.setZ(g.z)}e.current.applyImpulse(d,!0),n.position=E.vec3(e.current.translation()),n.velocity=E.vec3(e.current.linvel())}function Yi(r){const{rigidBodyRef:e,innerGroupRef:t,controllerContext:{character:{linearDamping:n}},worldContext:{activeState:i,states:a,block:o},delta:l}=r;a.isJumping||e.current.linvel().y<0?e.current.setLinearDamping(n):e.current.setLinearDamping(a.isNotMoving?n*5:n),e.current.setEnabledRotations(!1,!1,!1,!1),t.current.quaternion.rotateTowards(E.quat().setFromEuler(i.euler),10*l)}function Ki(r){var c;const{rigidBodyRef:e,state:t,worldContext:{clicker:n,mode:i,clickerOption:a,block:o}}=r,l=E.vec3((c=e.current)==null?void 0:c.translation());let s=Wr(l,n.point,!1);if(a.autoStart&&a.queue[0]instanceof L.Vector3){n.isOn=!0,s=Wr(l,a.queue[0],!1);const h=E.vec3(a.queue[0]),d=Math.atan2(h.z-l.z,h.x-l.x);n.angle=d}if(s<1&&i.controller==="clicker")if(a.track&&a.queue.length!==0){const h=a.queue.shift();if(h instanceof L.Vector3){n.point=h;const d=E.vec3(n.point),m=Math.atan2(d.z-l.z,d.x-l.x);n.angle=m}else{const{action:d,beforeCB:m,afterCB:v,time:p}=h;d==="stop"&&(t.clock.stop(),m(t),console.log(),setTimeout(()=>{t.clock.start(),v(t)},p))}a.loop&&a.queue.push(h)}else n.isOn=!1,n.isRun=!1}function Xi(r){const{worldContext:{control:e,clicker:t,mode:n}}=r,{keyS:i}=e;i&&n.controller==="clicker"&&(t.isOn=!1,t.isRun=!1)}function Zi(r){Vi(r),Hi(r),Yi(r),Xi(r),Ki(r)}function Ji(r){const{colliderRef:e,groundRay:t,worldContext:{states:n,activeState:i}}=r;if(t.origin.addVectors(i.position,E.vec3(t.offset)),(!t.hit||!t.rayCast||!e.current)&&(n.isOnTheGround=!1),t.hit){const a=t.length*2,o=t.length*.8;t.hit.toi>=a?(n.isFalling=!0,n.isOnTheGround=!1):o<=t.hit.toi&&t.hit.toi<a?n.isFalling=!0:t.hit.toi<o&&(n.isFalling=!1,n.isOnTheGround=!0)}}function Qi(r){const{worldContext:{states:e,mode:t,control:n,clicker:i,clickerOption:a}}=r,{shift:o,space:l}=n;t.controller==="clicker"&&(e.isMoving=i.isOn,e.isNotMoving=!i.isOn,e.isRunning=(o||i.isRun)&&e.isMoving&&a.isRun,e.isJumping=l)}function ea(r){const{worldContext:{states:e,control:t}}=r;Object.keys(t).forEach(n=>{e.isPush[n]=t[n]})}function ta(r){const{worldContext:{states:e}}=r,{isRiderOn:t}=e;t&&e.isPush.keyR&&(e.isRiding=!0)}function ra(r){const{outerGroupRef:e,worldContext:{states:t,activeState:n}}=r;t.isMoving&&e&&e.current&&(t.isRotated=Math.sin(e.current.rotation.y).toFixed(3)===Math.sin(n.euler.y).toFixed(3))}function na(r){Ji(r),Qi(r),ra(r),ea(r),ta(r)}function ia(r){const{rigidBodyRef:e,worldContext:{control:t},controllerContext:{vehicle:n}}=r,{space:i}=t,{brakeRatio:a,linearDamping:o}=n;e.current.setLinearDamping(i?a:o)}function aa(r){const{worldContext:{activeState:e,control:t}}=r,{forward:n,backward:i,leftward:a,rightward:o}=t,l=Number(a)-Number(o),s=Number(n)-Number(i),c=E.vec3().set(s,0,s);return e.euler.y+=l*(Math.PI/64),c}function oa(r){const{worldContext:{mode:e,activeState:t}}=r,n=E.vec3();n.copy(aa(r)),t.direction=n.multiply(K(Math.sin(t.euler.y),0,Math.cos(t.euler.y))),t.dir=t.direction.normalize()}function sa(r){const{rigidBodyRef:e,worldContext:{activeState:t,control:n},controllerContext:{vehicle:i}}=r,{shift:a}=n,{maxSpeed:o,accelRatio:l}=i,s=e.current.linvel();if(E.vec3(s).length()<o){const h=e.current.mass();let d=a?l:1;e.current.applyImpulse(E.vec3().addScalar(d).multiply(t.dir.clone().normalize()).multiplyScalar(h),!1)}}function la(r){const{rigidBodyRef:e,worldContext:{activeState:t}}=r;t.position=E.vec3(e.current.translation()),t.velocity=E.vec3(e.current.linvel()),e.current.setRotation(E.quat().setFromEuler(t.euler.clone()),!1)}function ua(r){const{worldContext:{states:e,rideable:t,mode:n},dispatch:i}=r,{isRiding:a}=e;a&&(t.objectType=null,t.key=null,n.type="character",e.isRiding=!1,e.enableRiding=!1),i({type:"update",payload:{mode:{...n},rideable:{...t}}})}function ca(r){oa(r),sa(r),ia(r),ua(r),la(r)}function fa({groundRay:r,rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i}){const a=w.useContext(B),o=w.useContext(jt),l=w.useContext(pe),{mode:s,activeState:c,block:h}=a,{getSizesByUrls:d}=bn();w.useEffect(()=>{!e||!n||e.current&&n.current&&(e.current.lockRotations(!1,!0),c.euler.set(0,0,0),e.current.setTranslation(c.position.clone().add(K(0,5,0)),!0))},[s.type]),w.useEffect(()=>{e&&e.current&&h.control&&(e.current.resetForces(!1),e.current.resetTorques(!1))},[h.control,e.current]),je.useFrame((m,v)=>{if(!e||!e.current||!t||!t.current||!n||!n.current||h.control)return null;const p={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i,groundRay:r,state:m,delta:v,worldContext:a,controllerContext:o,dispatch:l,matchSizes:d(a==null?void 0:a.urls)};s.type==="vehicle"?ca(p):s.type==="character"?Zi(p):s.type==="airplane"&&Bi(p),na(p)})}function ha({url:r,children:e,offset:t,currentAnimation:n}){const{gltf:i}=yn({url:r}),{animations:a,scene:o}=i,{actions:l,ref:s}=Pe.useAnimations(a),c=w.useMemo(()=>gn.clone(o),[o]),{nodes:h}=je.useGraph(c),d=Object.values(h).find(m=>m.type==="Object3D");return ar({type:"character",currentAnimation:n||"ride",actions:l,animationRef:s,isActive:!1}),S.jsx(S.Fragment,{children:S.jsxs("group",{position:t,children:[d&&S.jsx("primitive",{object:d,visible:!1,receiveShadow:!0,castShadow:!0,ref:s}),Object.keys(h).map((m,v)=>{const p=h[m];if(p instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry,skeleton:p.skeleton},v);if(p instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:p.material,geometry:p.geometry},v)}),e]})})}const da=w.forwardRef((r,e)=>S.jsxs("group",{receiveShadow:!0,castShadow:!0,ref:e,userData:{intangible:!0},children:[r.isRiderOn&&r.enableRiding&&r.isActive&&r.ridingUrl&&S.jsx(ha,{url:r.ridingUrl,offset:r.offset}),r.children,r.objectNode&&r.animationRef&&S.jsx("primitive",{object:r.objectNode,visible:!1,receiveShadow:!0,castShadow:!0,ref:r.animationRef}),Object.keys(r.nodes).map((t,n)=>{const i=r.nodes[t];if(i instanceof L.SkinnedMesh)return S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry,skeleton:i.skeleton},n);if(i instanceof L.Mesh)return S.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:i.material,geometry:i.geometry},n)})]})),ma=({url:r,isActive:e,componentType:t,currentAnimation:n,color:i,skeleton:a})=>{const{scene:o,animations:l}=Pe.useGLTF(r),{actions:s,ref:c}=Pe.useAnimations(l),h=w.useMemo(()=>{const d=[];return o.traverse(m=>{if(m instanceof L.SkinnedMesh){const v=m.clone();v.skeleton=a,v.bind(a,v.bindMatrix),d.push(v)}}),d},[o,a]);return ar({type:t,actions:s,animationRef:c,currentAnimation:e?void 0:n,isActive:e}),S.jsx(S.Fragment,{children:h.map((d,m)=>S.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,geometry:d.geometry,skeleton:a,material:d.name==="color"&&i?new L.MeshStandardMaterial({color:i}):d.material},m))})};function pa(){const r=E.useRapier();return w.useCallback(({ray:t,ref:n})=>r.world.castRay(t.rayCast,t.length,!0,void 0,void 0,n.current,void 0),[r])}function va(){const{rapier:r}=E.useRapier(),e=pa();return({groundRay:n,length:i,colliderRef:a})=>{var o;n.length=i,n.rayCast=new r.Ray(n.origin,n.dir),n.hit=e({ray:n,ref:a}),n.parent=(o=n.hit)==null?void 0:o.collider.parent()}}const or=w.forwardRef((r,e)=>{var p;const{size:t}=yn({url:r.url}),n=va();w.useEffect(()=>{r.groundRay&&r.colliderRef&&n({groundRay:r.groundRay,length:.5,colliderRef:r.colliderRef})},[r.groundRay,r.colliderRef,n]);const{scene:i,animations:a}=Pe.useGLTF(r.url),{actions:o,ref:l}=Pe.useAnimations(a),s=w.useContext(B),c=w.useContext(jt),h=w.useMemo(()=>gn.clone(i),[i]),d=w.useMemo(()=>{let y=null;return h.traverse(g=>{g instanceof L.SkinnedMesh&&(y=g.skeleton)}),y},[h]);if(r.isActive){ki({type:r.componentType,groundRay:r.groundRay,animations:a});const y={state:null,worldContext:s,controllerContext:c,controllerOptions:r.controllerOptions};Ti(y),fa({outerGroupRef:r.outerGroupRef,innerGroupRef:r.innerGroupRef,rigidBodyRef:e,colliderRef:r.colliderRef,groundRay:r.groundRay})}ar({type:r.componentType,actions:o,animationRef:l,currentAnimation:r.isActive?void 0:r.currentAnimation,isActive:r.isActive}),Di({props:r,actions:o,componentType:r.componentType});const{nodes:m}=je.useGraph(h),v=Object.values(m).find(y=>y.type==="Object3D");return je.useFrame(()=>{r.isActive||!r.position||!e||!e.current||e.current.setTranslation(K(L.MathUtils.lerp(e.current.translation().x,r.position.x,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().y,r.position.y,r.controllerOptions.lerp.cameraPosition),L.MathUtils.lerp(e.current.translation().z,r.position.z,r.controllerOptions.lerp.cameraPosition)),!1)}),S.jsxs(E.RigidBody,{colliders:!1,ref:e,name:r.name,rotation:E.euler().set(0,((p=r.rotation)==null?void 0:p.clone().y)||0,0).clone(),userData:r.userData,type:r.rigidbodyType||(r.isActive?"dynamic":"fixed"),sensor:r.sensor,onIntersectionEnter:r.onIntersectionEnter,onCollisionEnter:r.onCollisionEnter,...r.rigidBodyProps,children:[!r.isNotColliding&&S.jsx(E.CapsuleCollider,{ref:r.colliderRef,args:[(t.y/2-t.x)*1.2,t.x*1.2],position:[0,(t.y/2+t.x/2)*1.2,0]}),S.jsxs(da,{objectNode:v,animationRef:l,nodes:m,ref:r.innerGroupRef,isActive:r.isActive,isRiderOn:r.isRiderOn,enableRiding:r.enableRiding,ridingUrl:r.ridingUrl,offset:r.offset,parts:r.parts,children:[r.children,r.parts&&r.parts.length>0&&r.parts.map(({url:y,color:g},C)=>y?S.jsx(ma,{url:y,isActive:r.isActive,componentType:r.componentType,currentAnimation:r.currentAnimation,color:g,skeleton:d},C+y):null)]})]})});function wn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ga(r){return S.jsx(wn,{name:"airplane",isActive:!0,currentAnimation:"idle",componentType:"airplane",ridingUrl:r.ridingUrl,...r,children:r.children})}function Cn(r){const{outerGroupRef:e}=r;return S.jsx(ir,{ref:e,children:S.jsx(or,{name:"character",url:r.url,controllerOptions:r.controllerOptions,ref:r.rigidBodyRef,groundRay:r.groundRay,isNotColliding:r.isNotColliding,...r,children:r.children})})}function ya({children:r,props:e,refs:t,urls:n}){return S.jsx(Cn,{url:n.characterUrl,isActive:!0,componentType:"character",rigidbodyType:"dynamic",controllerOptions:e.controllerOptions,groundRay:e.groundRay,onAnimate:e.onAnimate,onFrame:e.onFrame,onReady:e.onReady,onDestory:e.onDestory,rigidBodyProps:e.rigidBodyProps,parts:e.parts,...t,children:r})}function xn(r){const{rigidBodyRef:e,outerGroupRef:t}=r;return S.jsx(ir,{ref:t,children:S.jsx(or,{ref:e,name:r.name,componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})})}function ba(r){return S.jsx(xn,{name:"vehicle",isActive:!0,currentAnimation:"idle",componentType:"vehicle",ridingUrl:r.ridingUrl,...r,children:r.children})}function Sn({props:r,refs:e}){const{mode:t,states:n,rideable:i,urls:a}=w.useContext(B),{enableRiding:o,isRiderOn:l,rideableId:s}=n;return S.jsxs(S.Fragment,{children:[t.type==="character"&&S.jsx(ya,{props:r,refs:e,urls:a,children:r.children}),t.type==="vehicle"&&S.jsx(ba,{controllerOptions:r.controllerOptions,url:a.vehicleUrl,wheelUrl:a.wheelUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children}),t.type==="airplane"&&S.jsx(ga,{controllerOptions:r.controllerOptions,url:a.airplaneUrl,ridingUrl:a.ridingUrl,enableRiding:o,isRiderOn:l,groundRay:r.groundRay,offset:s&&i[s]?i[s].offset:E.vec3(),...e,children:r.children})]})}function wa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return je.useFrame(()=>{if(n&&n.current){const o=r.rotation.clone();o.y=0,n.current.setRotationFromQuaternion(E.quat().setFromEuler(n.current.rotation.clone()).slerp(E.quat().setFromEuler(o),.2))}e&&e.current&&e.current.setGravityScale(r.position.y<10?(1-.1)/-10*r.position.y+1:.1,!1)}),S.jsx(wn,{isActive:!1,componentType:"airplane",name:"airplane",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Ca(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return w.useEffect(()=>{e&&e.current&&e.current.setEnabledRotations(!1,!1,!1,!1)},[]),S.jsx(Cn,{isActive:!1,componentType:"character",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,groundRay:r.groundRay,currentAnimation:r.currentAnimation,...a,...r,children:r.children})}function xa(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a={rigidBodyRef:e,outerGroupRef:t,innerGroupRef:n,colliderRef:i};return S.jsx(xn,{isActive:!1,componentType:"vehicle",name:"vehicle",controllerOptions:r.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:r.position,rotation:r.rotation,currentAnimation:r.currentAnimation,url:r.url,ridingUrl:r.ridingUrl,...r,...a,children:r.children})}function Sa(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}const Ra=(r,e)=>{e({type:"update",payload:r})};function Oa(r){const e=w.useContext(B),t=w.useContext(pe);w.useEffect(()=>{if(e&&e.control){let o={};e.mode.controller==="clicker"?e.mode.isButton&&(o={...e.control}):o={...e.control},t({type:"update",payload:{control:{...o}}})}},[e==null?void 0:e.mode.controller,e==null?void 0:e.control]);const n=w.useMemo(()=>({origin:E.vec3(),dir:E.vec3({x:0,y:-1,z:0}),offset:E.vec3({x:0,y:-1,z:0}),hit:null,parent:null,rayCast:null,length:10}),[]),i=w.useMemo(()=>({origin:E.vec3(),hit:new L.Raycaster,rayCast:new L.Raycaster(E.vec3(),E.vec3(),0,-7),dir:E.vec3(),position:E.vec3(),length:-e.cameraOption.maxDistance,detected:[],intersects:[],intersectObjectMap:{}}),[]),a=w.useCallback(o=>{Ra({refs:{...o}},t)},[r.refs]);return w.useEffect(()=>{r.refs&&a(r.refs)},[]),{groundRay:n,cameraRay:i}}function Aa(r){return S.jsx(S.Fragment,{children:S.jsx(Ea,{...r,children:r.children})})}function Ea(r){const e=w.useRef(null),t=w.useRef(null),n=w.useRef(null),i=w.useRef(null),a=w.useRef(null),o=w.useRef(null),[l,s]=w.useReducer(Sa,{airplane:Object.assign(Xe.airplane,r.airplane||{}),vehicle:Object.assign(Xe.vehicle,r.vehicle||{}),character:Object.assign(Xe.character,r.character||{}),callbacks:Object.assign(Xe.callbacks,{onReady:r.onReady,onFrame:r.onFrame,onDestory:r.onDestory,onAnimate:r.onAnimate}),refs:{colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a},controllerOptions:Object.assign(Xe.controllerOptions,r.controllerOptions||{})}),c=w.useMemo(()=>({value:l,dispatch:s}),[]),h=w.useMemo(()=>({colliderRef:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:i,characterInnerRef:a,passiveRigidBodyRef:o}),[]),d={...Oa({refs:h}),children:r.children,groupProps:r.groupProps,rigidBodyProps:r.rigidBodyProps,controllerOptions:c.value.controllerOptions,parts:r.parts,...c.value.callbacks,...h},m=Pe.useContextBridge(B,jt);return S.jsx(m,{children:S.jsx(jt.Provider,{value:c.value,children:S.jsx(zi.Provider,{value:c.dispatch,children:S.jsx(Sn,{props:d,refs:h})})})})}function Rn(){const{activeState:r,mode:e}=w.useContext(B),t=w.useContext(pe);return{moveClicker:(i,a,o)=>{if(e.controller!=="clicker"||o!=="ground")return;const l=r.position,s=K(i.point.x,i.point.y,i.point.z),c=Math.atan2(s.z-l.z,s.x-l.x);t({type:"update",payload:{clicker:{point:K(s.x,0,s.z),angle:c,isOn:!0,isRun:a}}})}}}function ja({type:r="normal",text:e,position:t,children:n}){const i=w.useRef(null),{minimap:a,activeState:o,clickerOption:l}=w.useContext(B),s=w.useContext(pe),{moveClicker:c}=Rn();return w.useEffect(()=>{if(i.current){const h=new L.Box3().setFromObject(i.current),d=E.vec3(h.getSize(new L.Vector3)).clone(),m=E.vec3(h.getCenter(new L.Vector3)).clone(),v={type:r||"normal",text:e,size:d,center:m};a.props[e]=v,s({type:"update",payload:{minimap:{...a}}})}},[]),S.jsx("group",{ref:i,position:t,onPointerDown:h=>{h.srcElement instanceof HTMLDivElement||c(h,!1,r)},children:n})}function ka({onMarker:r,runMarker:e}){const{clicker:t,mode:n,clickerOption:i}=w.useContext(B),a=[];for(let o=0;o<i.queue.length;o++)i.queue[o]instanceof L.Vector3&&a.push(i.queue[o]);return S.jsxs(S.Fragment,{children:[n.controller==="clicker"&&S.jsxs("group",{position:t.point,children:[t.isOn&&r,t.isOn&&i.isRun&&t.isRun&&e]}),i.line&&a.map((o,l)=>{if(o instanceof L.Vector3){const s=l,c=l===0?a.length-1:l-1;return S.jsxs("group",{position:[0,1,0],children:[S.jsx(Pe.Line,{worldUnits:!0,points:[a[c],a[s]],color:"turquoise",transparent:!0,opacity:.5,lineWidth:.4}),S.jsxs("mesh",{position:o,children:[S.jsx("sphereGeometry",{args:[.6,30,.6]}),S.jsx("meshStandardMaterial",{color:"turquoise",transparent:!0,opacity:.8})]},l)]},l)}})]})}function On(){const{control:r}=w.useContext(B),e=w.useContext(pe);return{pushKey:(n,i)=>{r[n]=i,e({type:"update",payload:{control:{...r}}})}}}var Gr={},Ma=r=>{var{fileScope:e,css:t}=r,n=e.packageName?[e.packageName,e.filePath].join("/"):e.filePath,i=Gr[n];if(!i){var a=document.createElement("style");e.packageName&&a.setAttribute("data-package",e.packageName),a.setAttribute("data-file",e.filePath),a.setAttribute("type","text/css"),i=Gr[n]=a,document.head.appendChild(a)}i.innerHTML=t};function Pa(r){var e=r.match(/^var\((.*)\)$/);return e?e[1]:r}/*! https://mths.be/cssesc v3.0.0 by @mathias */var Fa={},_a=Fa.hasOwnProperty,Ta=function(e,t){if(!e)return t;var n={};for(var i in t)n[i]=_a.call(e,i)?e[i]:t[i];return n},za=/[ -,\.\/:-@\[-\^`\{-~]/,Da=/[ -,\.\/:-@\[\]\^`\{-~]/,Ia=/(^|\\+)?(\\[A-F0-9]{1,6})\x20(?![a-fA-F0-9\x20])/g,sr=function r(e,t){t=Ta(t,r.options),t.quotes!="single"&&t.quotes!="double"&&(t.quotes="single");for(var n=t.quotes=="double"?'"':"'",i=t.isIdentifier,a=e.charAt(0),o="",l=0,s=e.length;l<s;){var c=e.charAt(l++),h=c.charCodeAt(),d=void 0;if(h<32||h>126){if(h>=55296&&h<=56319&&l<s){var m=e.charCodeAt(l++);(m&64512)==56320?h=((h&1023)<<10)+(m&1023)+65536:l--}d="\\"+h.toString(16).toUpperCase()+" "}else t.escapeEverything?za.test(c)?d="\\"+c:d="\\"+h.toString(16).toUpperCase()+" ":/[\t\n\f\r\x0B]/.test(c)?d="\\"+h.toString(16).toUpperCase()+" ":c=="\\"||!i&&(c=='"'&&n==c||c=="'"&&n==c)||i&&Da.test(c)?d="\\"+c:d=c;o+=d}return i&&(/^-[-\d]/.test(o)?o="\\-"+o.slice(1):/\d/.test(a)&&(o="\\3"+a+" "+o.slice(1))),o=o.replace(Ia,function(v,p,y){return p&&p.length%2?v:(p||"")+y}),!i&&t.wrap?n+o+n:o};sr.options={escapeEverything:!1,isIdentifier:!1,quotes:"single",wrap:!1};sr.version="3.0.0";var Na=sr;const lr=dn(Na);class Ua{constructor(e){const{failure:t,gotoFn:n,output:i}=this._buildTables(e);this.gotoFn=n,this.output=i,this.failure=t}_buildTables(e){const t={0:{}},n={};let i=0;for(const l of e){let s=0;for(const c of l)t[s]&&c in t[s]?s=t[s][c]:(i++,t[s][c]=i,t[i]={},s=i,n[i]=[]);n[s].push(l)}const a={},o=[];for(const l in t[0]){const s=t[0][l];a[s]=0,o.push(s)}for(;o.length>0;){const l=o.shift();if(l!==void 0)for(const s in t[l]){const c=t[l][s];o.push(c);let h=a[l];for(;h>0&&!(s in t[h]);)h=a[h];if(s in t[h]){const d=t[h][s];a[c]=d,n[c]=[...n[c],...n[d]]}else a[c]=0}}return{gotoFn:t,output:n,failure:a}}search(e){let t=0;const n=[];for(let i=0;i<e.length;i++){const a=e[i];for(;t>0&&!(a in this.gotoFn[t]);)t=this.failure[t];if(a in this.gotoFn[t]&&(t=this.gotoFn[t][a],this.output[t].length>0)){const o=this.output[t];n.push([i,o])}}return n}}var La={appendCss:()=>{},registerClassName:()=>{},onEndFileScope:()=>{},registerComposition:()=>{},markCompositionUsed:()=>{},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"},St=[La],pt=()=>{if(St.length<1)throw new Error("No adapter configured");return St[St.length-1]},An=!1,Wa=r=>{An||Ga(r)},Ga=r=>{if(!r)throw new Error('No adapter provided when calling "setAdapter"');An=!0,St.push(r)},Ft=function(){return pt().appendCss(...arguments)},En=function(){return pt().registerClassName(...arguments)},Ba=function(){return pt().registerComposition(...arguments)},jn=function(){return pt().markCompositionUsed(...arguments)},qa=function(){var e=pt();return"getIdentOption"in e?e.getIdentOption(...arguments):process.env.NODE_ENV==="production"?"short":"debug"};function ur(r,e){return e||(e=r.slice(0)),Object.freeze(Object.defineProperties(r,{raw:{value:Object.freeze(e)}}))}var Y;(function(r){r.Attribute="attribute",r.Pseudo="pseudo",r.PseudoElement="pseudo-element",r.Tag="tag",r.Universal="universal",r.Adjacent="adjacent",r.Child="child",r.Descendant="descendant",r.Parent="parent",r.Sibling="sibling",r.ColumnCombinator="column-combinator"})(Y||(Y={}));var ye;(function(r){r.Any="any",r.Element="element",r.End="end",r.Equals="equals",r.Exists="exists",r.Hyphen="hyphen",r.Not="not",r.Start="start"})(ye||(ye={}));const Br=/^[^\\#]?(?:\\(?:[\da-f]{1,6}\s?|.)|[\w\-\u00b0-\uFFFF])+/,$a=/\\([\da-f]{1,6}\s?|(\s)|.)/gi,Va=new Map([[126,ye.Element],[94,ye.Start],[36,ye.End],[42,ye.Any],[33,ye.Not],[124,ye.Hyphen]]),Ha=new Set(["has","not","matches","is","where","host","host-context"]);function Ya(r){switch(r.type){case Y.Adjacent:case Y.Child:case Y.Descendant:case Y.Parent:case Y.Sibling:case Y.ColumnCombinator:return!0;default:return!1}}const Ka=new Set(["contains","icontains"]);function Xa(r,e,t){const n=parseInt(e,16)-65536;return n!==n||t?e:n<0?String.fromCharCode(n+65536):String.fromCharCode(n>>10|55296,n&1023|56320)}function lt(r){return r.replace($a,Xa)}function qt(r){return r===39||r===34}function qr(r){return r===32||r===9||r===10||r===12||r===13}function Za(r){const e=[],t=kn(e,`${r}`,0);if(t<r.length)throw new Error(`Unmatched selector: ${r.slice(t)}`);return e}function kn(r,e,t){let n=[];function i(m){const v=e.slice(t+m).match(Br);if(!v)throw new Error(`Expected name, found ${e.slice(t)}`);const[p]=v;return t+=m+p.length,lt(p)}function a(m){for(t+=m;t<e.length&&qr(e.charCodeAt(t));)t++}function o(){t+=1;const m=t;let v=1;for(;v>0&&t<e.length;t++)e.charCodeAt(t)===40&&!l(t)?v++:e.charCodeAt(t)===41&&!l(t)&&v--;if(v)throw new Error("Parenthesis not matched");return lt(e.slice(m,t-1))}function l(m){let v=0;for(;e.charCodeAt(--m)===92;)v++;return(v&1)===1}function s(){if(n.length>0&&Ya(n[n.length-1]))throw new Error("Did not expect successive traversals.")}function c(m){if(n.length>0&&n[n.length-1].type===Y.Descendant){n[n.length-1].type=m;return}s(),n.push({type:m})}function h(m,v){n.push({type:Y.Attribute,name:m,action:v,value:i(1),namespace:null,ignoreCase:"quirks"})}function d(){if(n.length&&n[n.length-1].type===Y.Descendant&&n.pop(),n.length===0)throw new Error("Empty sub-selector");r.push(n)}if(a(0),e.length===t)return t;e:for(;t<e.length;){const m=e.charCodeAt(t);switch(m){case 32:case 9:case 10:case 12:case 13:{(n.length===0||n[0].type!==Y.Descendant)&&(s(),n.push({type:Y.Descendant})),a(1);break}case 62:{c(Y.Child),a(1);break}case 60:{c(Y.Parent),a(1);break}case 126:{c(Y.Sibling),a(1);break}case 43:{c(Y.Adjacent),a(1);break}case 46:{h("class",ye.Element);break}case 35:{h("id",ye.Equals);break}case 91:{a(1);let v,p=null;e.charCodeAt(t)===124?v=i(1):e.startsWith("*|",t)?(p="*",v=i(2)):(v=i(0),e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==61&&(p=v,v=i(1))),a(0);let y=ye.Exists;const g=Va.get(e.charCodeAt(t));if(g){if(y=g,e.charCodeAt(t+1)!==61)throw new Error("Expected `=`");a(2)}else e.charCodeAt(t)===61&&(y=ye.Equals,a(1));let C="",R=null;if(y!=="exists"){if(qt(e.charCodeAt(t))){const _=e.charCodeAt(t);let D=t+1;for(;D<e.length&&(e.charCodeAt(D)!==_||l(D));)D+=1;if(e.charCodeAt(D)!==_)throw new Error("Attribute value didn't end");C=lt(e.slice(t+1,D)),t=D+1}else{const _=t;for(;t<e.length&&(!qr(e.charCodeAt(t))&&e.charCodeAt(t)!==93||l(t));)t+=1;C=lt(e.slice(_,t))}a(0);const P=e.charCodeAt(t)|32;P===115?(R=!1,a(1)):P===105&&(R=!0,a(1))}if(e.charCodeAt(t)!==93)throw new Error("Attribute selector didn't terminate");t+=1;const k={type:Y.Attribute,name:v,action:y,value:C,namespace:p,ignoreCase:R};n.push(k);break}case 58:{if(e.charCodeAt(t+1)===58){n.push({type:Y.PseudoElement,name:i(2).toLowerCase(),data:e.charCodeAt(t)===40?o():null});continue}const v=i(1).toLowerCase();let p=null;if(e.charCodeAt(t)===40)if(Ha.has(v)){if(qt(e.charCodeAt(t+1)))throw new Error(`Pseudo-selector ${v} cannot be quoted`);if(p=[],t=kn(p,e,t+1),e.charCodeAt(t)!==41)throw new Error(`Missing closing parenthesis in :${v} (${e})`);t+=1}else{if(p=o(),Ka.has(v)){const y=p.charCodeAt(0);y===p.charCodeAt(p.length-1)&&qt(y)&&(p=p.slice(1,-1))}p=lt(p)}n.push({type:Y.Pseudo,name:v,data:p});break}case 44:{d(),n=[],a(1);break}default:{if(e.startsWith("/*",t)){const y=e.indexOf("*/",t+2);if(y<0)throw new Error("Comment was not terminated");t=y+2,n.length===0&&a(0);break}let v=null,p;if(m===42)t+=1,p="*";else if(m===124){if(p="",e.charCodeAt(t+1)===124){c(Y.ColumnCombinator),a(2);break}}else if(Br.test(e.slice(t)))p=i(0);else break e;e.charCodeAt(t)===124&&e.charCodeAt(t+1)!==124&&(v=p,e.charCodeAt(t+1)===42?(p="*",t+=2):p=i(1)),n.push(p==="*"?{type:Y.Universal,namespace:v}:{type:Y.Tag,name:p,namespace:v})}}}return d(),t}function $r(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function Vr(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?$r(Object(t),!0).forEach(function(n){Ja(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):$r(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function Ja(r,e,t){return e=Qa(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Qa(r){var e=eo(r,"string");return typeof e=="symbol"?e:String(e)}function eo(r,e){if(typeof r!="object"||r===null)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}const cr=Mn({});function Mn(r){return e.withOptions=t=>Mn(Vr(Vr({},r),t)),e;function e(t,...n){const i=typeof t=="string"?[t]:t.raw,{escapeSpecialCharacters:a=Array.isArray(t)}=r;let o="";for(let c=0;c<i.length;c++){let h=i[c];a&&(h=h.replace(/\\\n[ \t]*/g,"").replace(/\\`/g,"`").replace(/\\\$/g,"$").replace(/\\\{/g,"{")),o+=h,c<n.length&&(o+=n[c])}const l=o.split(`
31
- `);let s=null;for(const c of l){const h=c.match(/^(\s+)\S+/);if(h){const d=h[1].length;s?s=Math.min(s,d):s=d}}if(s!==null){const c=s;o=l.map(h=>h[0]===" "||h[0]===" "?h.slice(c):h).join(`
32
- `)}return o=o.trim(),a&&(o=o.replace(/\\n/g,`
33
- `)),o}}/*! @license MediaQueryParser - MIT License - Tom Golden (github@tbjgolden.com) *//*! *****************************************************************************
34
- Copyright (c) Microsoft Corporation.
35
-
36
- Permission to use, copy, modify, and/or distribute this software for any
37
- purpose with or without fee is hereby granted.
38
-
39
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
40
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
41
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
42
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
43
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
44
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
45
- PERFORMANCE OF THIS SOFTWARE.
46
- ***************************************************************************** */var kt=function(){return kt=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},kt.apply(this,arguments)};function Kt(r,e){var t={};for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&e.indexOf(n)<0&&(t[n]=r[n]);if(r!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(r);i<n.length;i++)e.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(r,n[i])&&(t[n[i]]=r[n[i]]);return t}function to(r){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&r[e],n=0;if(t)return t.call(r);if(r&&typeof r.length=="number")return{next:function(){return r&&n>=r.length&&(r=void 0),{value:r&&r[n++],done:!r}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function te(r,e){var t=typeof Symbol=="function"&&r[Symbol.iterator];if(!t)return r;var n=t.call(r),i,a=[],o;try{for(;(e===void 0||e-- >0)&&!(i=n.next()).done;)a.push(i.value)}catch(l){o={error:l}}finally{try{i&&!i.done&&(t=n.return)&&t.call(n)}finally{if(o)throw o.error}}return a}var ro=/(\u000D|\u000C|\u000D\u000A)/g,no=/[\u0000\uD800-\uDFFF]/g,io=/(\/\*)[\s\S]*?(\*\/)/g,ao=function(e,t){t===void 0&&(t=0),e=e.replace(ro,`
47
- `).replace(no,"�"),e=e.replace(io,"");for(var n=[];t<e.length;t+=1){var i=e.charCodeAt(t);if(i===9||i===32||i===10){for(var a=e.charCodeAt(++t);a===9||a===32||a===10;)a=e.charCodeAt(++t);t-=1,n.push({type:"<whitespace-token>"})}else if(i===34){var o=Hr(e,t);if(o===null)return null;var l=te(o,2),s=l[0],c=l[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===35){if(t+1<e.length){var h=e.charCodeAt(t+1);if(h===95||h>=65&&h<=90||h>=97&&h<=122||h>=128||h>=48&&h<=57||h===92&&t+2<e.length&&e.charCodeAt(t+2)!==10){var d=Pn(e,t+1)?"id":"unrestricted",o=so(e,t+1);if(o!==null){var m=te(o,2),s=m[0],c=m[1];n.push({type:"<hash-token>",value:c.toLowerCase(),flag:d}),t=s;continue}}}n.push({type:"<delim-token>",value:i})}else if(i===39){var o=Hr(e,t);if(o===null)return null;var v=te(o,2),s=v[0],c=v[1];n.push({type:"<string-token>",value:c}),t=s}else if(i===40)n.push({type:"<(-token>"});else if(i===41)n.push({type:"<)-token>"});else if(i===43){var p=xt(e,t);if(p===null)n.push({type:"<delim-token>",value:i});else{var y=te(p,2),s=y[0],g=y[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}}else if(i===44)n.push({type:"<comma-token>"});else if(i===45){var C=xt(e,t);if(C!==null){var R=te(C,2),s=R[0],g=R[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}if(t+2<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2);if(h===45&&k===62){n.push({type:"<CDC-token>"}),t+=2;continue}}var o=Yr(e,t);if(o!==null){var P=te(o,3),s=P[0],c=P[1],_=P[2];n.push({type:_,value:c}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===46){var C=xt(e,t);if(C===null)n.push({type:"<delim-token>",value:i});else{var D=te(C,2),s=D[0],g=D[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s;continue}}else if(i===58)n.push({type:"<colon-token>"});else if(i===59)n.push({type:"<semicolon-token>"});else if(i===60){if(t+3<e.length){var h=e.charCodeAt(t+1),k=e.charCodeAt(t+2),V=e.charCodeAt(t+3);if(h===33&&k===45&&V===45){n.push({type:"<CDO-token>"}),t+=3;continue}}n.push({type:"<delim-token>",value:i})}else if(i===64){var o=fr(e,t+1);if(o!==null){var q=te(o,2),s=q[0],c=q[1];n.push({type:"<at-keyword-token>",value:c.toLowerCase()}),t=s;continue}n.push({type:"<delim-token>",value:i})}else if(i===91)n.push({type:"<[-token>"});else if(i===92){var o=vt(e,t);if(o===null)return null;var H=te(o,2),s=H[0],c=H[1];e=e.slice(0,t)+c+e.slice(s+1),t-=1}else if(i===93)n.push({type:"<]-token>"});else if(i===123)n.push({type:"<{-token>"});else if(i===125)n.push({type:"<}-token>"});else if(i>=48&&i<=57){var o=xt(e,t),Ie=te(o,2),s=Ie[0],g=Ie[1];g[0]==="<dimension-token>"?n.push({type:"<dimension-token>",value:g[1],unit:g[2].toLowerCase(),flag:"number"}):g[0]==="<number-token>"?n.push({type:g[0],value:g[1],flag:g[2]}):n.push({type:g[0],value:g[1],flag:"number"}),t=s}else if(i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128){var o=Yr(e,t);if(o===null)return null;var rt=te(o,3),s=rt[0],c=rt[1],_=rt[2];n.push({type:_,value:c}),t=s}else n.push({type:"<delim-token>",value:i})}return n.push({type:"<EOF-token>"}),n},Hr=function(e,t){if(e.length<=t+1)return null;for(var n=e.charCodeAt(t),i=[],a=t+1;a<e.length;a+=1){var o=e.charCodeAt(a);if(o===n)return[a,String.fromCharCode.apply(null,i)];if(o===92){var l=vt(e,a);if(l===null)return null;var s=te(l,2),c=s[0],h=s[1];i.push(h),a=c}else{if(o===10)return null;i.push(o)}}return null},Pn=function(e,t){if(e.length<=t)return!1;var n=e.charCodeAt(t);if(n===45){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128)return!0;if(i===92){if(e.length<=t+2)return!1;var a=e.charCodeAt(t+2);return a!==10}else return!1}else{if(n===95||n>=65&&n<=90||n>=97&&n<=122||n>=128)return!0;if(n===92){if(e.length<=t+1)return!1;var i=e.charCodeAt(t+1);return i!==10}else return!1}},vt=function(e,t){if(e.length<=t+1||e.charCodeAt(t)!==92)return null;var n=e.charCodeAt(t+1);if(n===10)return null;if(n>=48&&n<=57||n>=65&&n<=70||n>=97&&n<=102){for(var i=[n],a=Math.min(t+7,e.length),o=t+2;o<a;o+=1){var l=e.charCodeAt(o);if(l>=48&&l<=57||l>=65&&l<=70||l>=97&&l<=102)i.push(l);else break}if(o<e.length){var s=e.charCodeAt(o);(s===9||s===32||s===10)&&(o+=1)}return[o-1,parseInt(String.fromCharCode.apply(null,i),16)]}else return[t+1,n]},xt=function(e,t){var n=oo(e,t);if(n===null)return null;var i=te(n,3),a=i[0],o=i[1],l=i[2],s=fr(e,a+1);if(s!==null){var c=te(s,2),h=c[0],d=c[1];return[h,["<dimension-token>",o,d]]}return a+1<e.length&&e.charCodeAt(a+1)===37?[a+1,["<percentage-token>",o]]:[a,["<number-token>",o,l]]},oo=function(e,t){if(e.length<=t)return null;var n="integer",i=[],a=e.charCodeAt(t);for((a===43||a===45)&&(t+=1,a===45&&i.push(45));t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1);if(l===46&&s>=48&&s<=57)for(i.push(l,s),n="number",t+=2;t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}if(t+1<e.length){var l=e.charCodeAt(t),s=e.charCodeAt(t+1),c=e.charCodeAt(t+2);if(l===69||l===101){var h=s>=48&&s<=57;if(h||(s===43||s===45)&&c>=48&&c<=57)for(n="number",h?(i.push(69,s),t+=2):s===45?(i.push(69,45,c),t+=3):(i.push(69,c),t+=3);t<e.length;){var o=e.charCodeAt(t);if(o>=48&&o<=57)i.push(o),t+=1;else break}}}var d=String.fromCharCode.apply(null,i),m=n==="number"?parseFloat(d):parseInt(d);return m===-0&&(m=0),Number.isNaN(m)?null:[t-1,m,n]},so=function(e,t){if(e.length<=t)return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return t===0?null:[t-1,String.fromCharCode.apply(null,n)]},fr=function(e,t){if(e.length<=t||!Pn(e,t))return null;for(var n=[],i=e.charCodeAt(t);t<e.length;i=e.charCodeAt(++t)){if(i===45||i===95||i>=65&&i<=90||i>=97&&i<=122||i>=128||i>=48&&i<=57){n.push(i);continue}else{var a=vt(e,t);if(a!==null){var o=te(a,2),l=o[0],s=o[1];n.push(s),t=l;continue}}break}return[t-1,String.fromCharCode.apply(null,n)]},lo=function(e,t){for(var n=e.charCodeAt(t);n===9||n===32||n===10;)n=e.charCodeAt(++t);for(var i=[],a=!1;t<e.length;){if(n===41)return[t,String.fromCharCode.apply(null,i)];if(n===34||n===39||n===40)return null;if(n===9||n===32||n===10)!a&&i.length!==0&&(a=!0);else if(n===92){var o=vt(e,t);if(o===null||a)return null;var l=te(o,2),s=l[0],c=l[1];i.push(c),t=s}else{if(a)return null;i.push(n)}n=e.charCodeAt(++t)}return null},Yr=function(e,t){var n=fr(e,t);if(n===null)return null;var i=te(n,2),a=i[0],o=i[1];if(o.toLowerCase()==="url"){if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40){for(var s=2;a+s<e.length;s+=1){var c=e.charCodeAt(a+s);if(c===34||c===39)return[a+1,o.toLowerCase(),"<function-token>"];if(c!==9&&c!==32&&c!==10){var h=lo(e,a+s);if(h===null)return null;var d=te(h,2),m=d[0],v=d[1];return[m,v,"<url-token>"]}}return[a+1,o.toLowerCase(),"<function-token>"]}}}else if(e.length>a+1){var l=e.charCodeAt(a+1);if(l===40)return[a+1,o.toLowerCase(),"<function-token>"]}return[a,o.toLowerCase(),"<ident-token>"]},uo=function(e){for(var t=e.length-1;t>=0;t--)e[t]=co(e[t]);return e},co=function(e){if(e.mediaCondition===null)return e;var t=fo(e.mediaCondition);return t.operator===null&&t.children.length===1&&"children"in t.children[0]&&(t=t.children[0]),{mediaPrefix:e.mediaPrefix,mediaType:e.mediaType,mediaCondition:t}},fo=function r(e){for(var t=e.children.length-1;t>=0;t--){var n=e.children[t];if(!("context"in n)){var i=r(n);if(i.operator===null&&i.children.length===1)e.children[t]=i.children[0];else if(i.operator===e.operator&&(i.operator==="and"||i.operator==="or")){for(var a=[t,1],o=0;o<i.children.length;o++)a.push(i.children[o]);e.children.splice.apply(e.children,a)}}}return e},ce=function(e,t){return t instanceof Error?new Error("".concat(t.message.trim(),`
48
- `).concat(e.trim())):new Error(e.trim())},ho=function(e){return uo(mo(e))},mo=function(e){var t=ao(e.trim());if(t===null)throw ce("Failed tokenizing");var n=0,i=t.length-1;if(t[0].type==="<at-keyword-token>"&&t[0].value==="media"){if(t[1].type!=="<whitespace-token>")throw ce("Expected whitespace after media");n=2;for(var a=2;a<t.length-1;a++){var o=t[a];if(o.type==="<{-token>"){i=a;break}else if(o.type==="<semicolon-token>")throw ce("Expected '{' in media query but found ';'")}}return t=t.slice(n,i),vo(t)},po=function(e){for(var t=[],n=!1,i=0;i<e.length;i++)e[i].type==="<whitespace-token>"?(n=!0,t.length>0&&(t[t.length-1].wsAfter=!0)):(t.push(kt(kt({},e[i]),{wsBefore:n,wsAfter:!1})),n=!1);return t},vo=function(e){for(var t,n,i=[[]],a=0;a<e.length;a++){var o=e[a];o.type==="<comma-token>"?i.push([]):i[i.length-1].push(o)}var l=i.map(po);if(l.length===1&&l[0].length===0)return[{mediaCondition:null,mediaPrefix:null,mediaType:"all"}];var s=l.map(function(v){return v.length===0?null:go(v)}),c=[];try{for(var h=to(s),d=h.next();!d.done;d=h.next()){var m=d.value;m!==null&&c.push(m)}}catch(v){t={error:v}}finally{try{d&&!d.done&&(n=h.return)&&n.call(h)}finally{if(t)throw t.error}}if(c.length===0)throw ce("No valid media queries");return c},go=function(e){var t=e[0];if(t.type==="<(-token>")try{return{mediaPrefix:null,mediaType:"all",mediaCondition:$t(e,!0)}}catch(d){throw ce("Expected media condition after '('",d)}else if(t.type==="<ident-token>"){var n=null,i=void 0,a=t.value;(a==="only"||a==="not")&&(n=a);var o=n===null?0:1;if(e.length<=o)throw ce("Expected extra token in media query");var l=e[o];if(l.type==="<ident-token>"){var s=l.value;if(s==="all")i="all";else if(s==="print"||s==="screen")i=s;else if(s==="tty"||s==="tv"||s==="projection"||s==="handheld"||s==="braille"||s==="embossed"||s==="aural"||s==="speech")n=n==="not"?null:"not",i="all";else throw ce("Unknown ident '".concat(s,"' in media query"))}else if(n==="not"&&l.type==="<(-token>"){var c=[{type:"<(-token>",wsBefore:!1,wsAfter:!1}];c.push.apply(c,e),c.push({type:"<)-token>",wsBefore:!1,wsAfter:!1});try{return{mediaPrefix:null,mediaType:"all",mediaCondition:$t(c,!0)}}catch(d){throw ce("Expected media condition after '('",d)}}else throw ce("Invalid media query");if(o+1===e.length)return{mediaPrefix:n,mediaType:i,mediaCondition:null};if(o+4<e.length){var h=e[o+1];if(h.type==="<ident-token>"&&h.value==="and")try{return{mediaPrefix:n,mediaType:i,mediaCondition:$t(e.slice(o+2),!1)}}catch(d){throw ce("Expected media condition after 'and'",d)}else throw ce("Expected 'and' after media prefix")}else throw ce("Expected media condition after media prefix")}else throw ce("Expected media condition or media prefix")},$t=function r(e,t,n){if(n===void 0&&(n=null),e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media condition");for(var i=e.length-1,a=0,o=0,l=0;l<e.length;l++){var s=e[l];if(s.type==="<(-token>"?(o+=1,a=Math.max(a,o)):s.type==="<)-token>"&&(o-=1),o===0){i=l;break}}if(o!==0)throw new Error(`Mismatched parens
49
- Invalid media condition`);var c,h=e.slice(0,i+1);if(a===1?c=yo(h):h[1].type==="<ident-token>"&&h[1].value==="not"?c=r(h.slice(2,-1),!0,"not"):c=r(h.slice(1,-1),!0),i===e.length-1)return{operator:n,children:[c]};var d=e[i+1];if(d.type!=="<ident-token>")throw new Error(`Invalid operator
50
- Invalid media condition`);if(n!==null&&n!==d.value)throw new Error("'".concat(d.value,"' and '").concat(n,`' must not be at same level
51
- Invalid media condition`));if(d.value==="or"&&!t)throw new Error(`Cannot use 'or' at top level of a media query
52
- Invalid media condition`);if(d.value!=="and"&&d.value!=="or")throw new Error("Invalid operator: '".concat(d.value,`'
53
- Invalid media condition`));var m=r(e.slice(i+2),t,d.value);return{operator:d.value,children:[c].concat(m.children)}},yo=function(e){if(e.length<3||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid media feature");for(var t=[e[0]],n=1;n<e.length;n++){if(n<e.length-2){var i=e[n],a=e[n+1],o=e[n+2];if(i.type==="<number-token>"&&i.value>0&&a.type==="<delim-token>"&&a.value===47&&o.type==="<number-token>"&&o.value>0){t.push({type:"<ratio-token>",numerator:i.value,denominator:o.value,wsBefore:i.wsBefore,wsAfter:o.wsAfter}),n+=2;continue}}t.push(e[n])}var l=t[1];if(l.type==="<ident-token>"&&t.length===3)return{context:"boolean",feature:l.value};if(t.length===5&&t[1].type==="<ident-token>"&&t[2].type==="<colon-token>"){var s=t[3];if(s.type==="<number-token>"||s.type==="<dimension-token>"||s.type==="<ratio-token>"||s.type==="<ident-token>"){var c=t[1].value,h=null,d=c.slice(0,4);d==="min-"?(h="min",c=c.slice(4)):d==="max-"&&(h="max",c=c.slice(4)),s.wsBefore,s.wsAfter;var m=Kt(s,["wsBefore","wsAfter"]);return{context:"value",prefix:h,feature:c,value:m}}}else if(t.length>=5)try{var v=bo(t);return{context:"range",feature:v.featureName,range:v}}catch(p){throw ce("Invalid media feature",p)}throw new Error("Invalid media feature")},bo=function(e){var t,n,i,a;if(e.length<5||e[0].type!=="<(-token>"||e[e.length-1].type!=="<)-token>")throw new Error("Invalid range");var o={leftToken:null,leftOp:null,featureName:"",rightOp:null,rightToken:null},l=e[1].type==="<number-token>"||e[1].type==="<dimension-token>"||e[1].type==="<ratio-token>"||e[1].type==="<ident-token>"&&e[1].value==="infinite";if(e[2].type==="<delim-token>"){if(e[2].value===60)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]="<=":o[l?"leftOp":"rightOp"]="<";else if(e[2].value===62)e[3].type==="<delim-token>"&&e[3].value===61&&!e[3].wsBefore?o[l?"leftOp":"rightOp"]=">=":o[l?"leftOp":"rightOp"]=">";else if(e[2].value===61)o[l?"leftOp":"rightOp"]="=";else throw new Error("Invalid range");if(l)o.leftToken=e[1];else if(e[1].type==="<ident-token>")o.featureName=e[1].value;else throw new Error("Invalid range");var s=2+((n=(t=o[l?"leftOp":"rightOp"])===null||t===void 0?void 0:t.length)!==null&&n!==void 0?n:0),c=e[s];if(l)if(c.type==="<ident-token>"){if(o.featureName=c.value,e.length>=7){var h=e[s+1],d=e[s+2];if(h.type==="<delim-token>"){var m=h.value;if(m===60)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp="<=":o.rightOp="<";else if(m===62)d.type==="<delim-token>"&&d.value===61&&!d.wsBefore?o.rightOp=">=":o.rightOp=">";else throw new Error("Invalid range");var v=e[s+1+((a=(i=o.rightOp)===null||i===void 0?void 0:i.length)!==null&&a!==void 0?a:0)];o.rightToken=v}else throw new Error("Invalid range")}else if(s+2!==e.length)throw new Error("Invalid range")}else throw new Error("Invalid range");else o.rightToken=c;var p=null,y=o.leftToken,g=o.leftOp,C=o.featureName,R=o.rightOp,k=o.rightToken,P=null;if(y!==null){if(y.type==="<ident-token>"){var _=y.type,D=y.value;D==="infinite"&&(P={type:_,value:D})}else if(y.type==="<number-token>"||y.type==="<dimension-token>"||y.type==="<ratio-token>"){y.wsBefore,y.wsAfter;var V=Kt(y,["wsBefore","wsAfter"]);P=V}}var q=null;if(k!==null){if(k.type==="<ident-token>"){var _=k.type,D=k.value;D==="infinite"&&(q={type:_,value:D})}else if(k.type==="<number-token>"||k.type==="<dimension-token>"||k.type==="<ratio-token>"){k.wsBefore,k.wsAfter;var H=Kt(k,["wsBefore","wsAfter"]);q=H}}if(P!==null&&q!==null)if((g==="<"||g==="<=")&&(R==="<"||R==="<="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q};else if((g===">"||g===">=")&&(R===">"||R===">="))p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q};else throw new Error("Invalid range");else P===null&&g===null&&R!==null&&q!==null?p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q}:P!==null&&g!==null&&R===null&&q===null&&(p={leftToken:P,leftOp:g,featureName:C,rightOp:R,rightToken:q});return p}else throw new Error("Invalid range")};function wo(r,e){if(typeof r!="object"||!r)return r;var t=r[Symbol.toPrimitive];if(t!==void 0){var n=t.call(r,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(r)}function Co(r){var e=wo(r,"string");return typeof e=="symbol"?e:String(e)}function xo(r,e,t){return e=Co(e),e in r?Object.defineProperty(r,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):r[e]=t,r}function Kr(r,e){var t=Object.keys(r);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(r);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(r,i).enumerable})),t.push.apply(t,n)}return t}function qe(r){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Kr(Object(t),!0).forEach(function(n){xo(r,n,t[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(t)):Kr(Object(t)).forEach(function(n){Object.defineProperty(r,n,Object.getOwnPropertyDescriptor(t,n))})}return r}function So(r,e){if(r==null)return{};var t={},n=Object.keys(r),i,a;for(a=0;a<n.length;a++)i=n[a],!(e.indexOf(i)>=0)&&(t[i]=r[i]);return t}function Xr(r,e){if(r==null)return{};var t=So(r,e),n,i;if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(r);for(i=0;i<a.length;i++)n=a[i],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(r,n)&&(t[n]=r[n])}return t}function ut(r,e){for(var t in r)e(r[t],t)}function He(r,e){var t={};for(var n in r)e.indexOf(n)===-1&&(t[n]=r[n]);return t}function Ro(r,e){var t={};for(var n in r)t[e(r[n],n)]=r[n];return t}function Xt(r){for(var e=arguments.length,t=new Array(e>1?e-1:0),n=1;n<e;n++)t[n-1]=arguments[n];for(var i of t)i.length!==0&&(typeof i=="string"?i.includes(" ")?Xt(r,...i.trim().split(" ")):r.add(i):Array.isArray(i)&&Xt(r,...i))}function Oo(r){var e=new Set;return Xt(e,...r),Array.from(e).join(" ")}var Zr;function Ao(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Eo=(r,e)=>{var t=()=>{var i=new RegExp(".".concat(Ao(lr(e,{isIdentifier:!0}))),"g");return r.replace(i,"&")},n;try{n=Za(r)}catch{throw new Error("Invalid selector: ".concat(t()))}n.forEach(i=>{try{for(var a=i.length-1;a>=-1;a--){if(!i[a])throw new Error;var o=i[a];if(o.type==="child"||o.type==="parent"||o.type==="sibling"||o.type==="adjacent"||o.type==="descendant")throw new Error;if(o.type==="attribute"&&o.name==="class"&&o.value===e)return}}catch{throw new Error(cr(Zr||(Zr=ur([`
54
- Invalid selector: `,`
55
-
56
- Style selectors must target the '&' character (along with any modifiers), e.g. `," or ",`.
57
-
58
- This is to ensure that each style block only affects the styling of a single class.
59
-
60
- If your selector is targeting another class, you should move it to the style definition for that class, e.g. given we have styles for 'parent' and 'child' elements, instead of adding a selector of `,") to 'parent', you should add ",` to 'child').
61
-
62
- If your selector is targeting something global, use the 'globalStyle' function instead, e.g. if you wanted to write `,", you should instead write 'globalStyle(",`, { ... })'
63
- `])),t(),"`${parent} &`","`${parent} &:hover`","`& ${child}`","`${parent} &`","`& h1`","`${parent} h1`"))}})};class Mt{constructor(){this.ruleset=new Map,this.precedenceLookup=new Map}findOrCreateCondition(e){var t=this.ruleset.get(e);return t||(t={query:e,rules:[],children:new Mt},this.ruleset.set(e,t)),t}getConditionalRulesetByPath(e){var t=this;for(var n of e){var i=t.findOrCreateCondition(n);t=i.children}return t}addRule(e,t,n){var i=this.getConditionalRulesetByPath(n),a=i.findOrCreateCondition(t);if(!a)throw new Error("Failed to add conditional rule");a.rules.push(e)}addConditionPrecedence(e,t){for(var n=this.getConditionalRulesetByPath(e),i=0;i<t.length;i++){var a,o=t[i],l=(a=n.precedenceLookup.get(o))!==null&&a!==void 0?a:new Set;for(var s of t.slice(i+1))l.add(s);n.precedenceLookup.set(o,l)}}isCompatible(e){for(var[t,n]of this.precedenceLookup.entries())for(var i of n){var a;if((a=e.precedenceLookup.get(i))!==null&&a!==void 0&&a.has(t))return!1}for(var{query:o,children:l}of e.ruleset.values()){var s=this.ruleset.get(o);if(s&&!s.children.isCompatible(l))return!1}return!0}merge(e){for(var{query:t,rules:n,children:i}of e.ruleset.values()){var a=this.ruleset.get(t);a?(a.rules.push(...n),a.children.merge(i)):this.ruleset.set(t,{query:t,rules:n,children:i})}for(var[o,l]of e.precedenceLookup.entries()){var s,c=(s=this.precedenceLookup.get(o))!==null&&s!==void 0?s:new Set;this.precedenceLookup.set(o,new Set([...c,...l]))}}mergeIfCompatible(e){return this.isCompatible(e)?(this.merge(e),!0):!1}getSortedRuleset(){var e=this,t=[],n=function(l){var s=e.ruleset.get(i);if(!s)throw new Error("Can't find condition for ".concat(i));var c=t.findIndex(h=>l.has(h.query));c>-1?t.splice(c,0,s):t.push(s)};for(var[i,a]of this.precedenceLookup.entries())n(a);return t}renderToArray(){var e=[];for(var{query:t,rules:n,children:i}of this.getSortedRuleset()){var a={};for(var o of n)a[o.selector]=qe(qe({},a[o.selector]),o.rule);Object.assign(a,...i.renderToArray()),e.push({[t]:a})}return e}}var Fn={":-moz-any-link":!0,":-moz-full-screen":!0,":-moz-placeholder":!0,":-moz-read-only":!0,":-moz-read-write":!0,":-ms-fullscreen":!0,":-ms-input-placeholder":!0,":-webkit-any-link":!0,":-webkit-full-screen":!0,"::-moz-color-swatch":!0,"::-moz-list-bullet":!0,"::-moz-list-number":!0,"::-moz-page-sequence":!0,"::-moz-page":!0,"::-moz-placeholder":!0,"::-moz-progress-bar":!0,"::-moz-range-progress":!0,"::-moz-range-thumb":!0,"::-moz-range-track":!0,"::-moz-scrolled-page-sequence":!0,"::-moz-selection":!0,"::-ms-backdrop":!0,"::-ms-browse":!0,"::-ms-check":!0,"::-ms-clear":!0,"::-ms-fill-lower":!0,"::-ms-fill-upper":!0,"::-ms-fill":!0,"::-ms-reveal":!0,"::-ms-thumb":!0,"::-ms-ticks-after":!0,"::-ms-ticks-before":!0,"::-ms-tooltip":!0,"::-ms-track":!0,"::-ms-value":!0,"::-webkit-backdrop":!0,"::-webkit-inner-spin-button":!0,"::-webkit-input-placeholder":!0,"::-webkit-meter-bar":!0,"::-webkit-meter-even-less-good-value":!0,"::-webkit-meter-inner-element":!0,"::-webkit-meter-optimum-value":!0,"::-webkit-meter-suboptimum-value":!0,"::-webkit-outer-spin-button":!0,"::-webkit-progress-bar":!0,"::-webkit-progress-inner-element":!0,"::-webkit-progress-inner-value":!0,"::-webkit-progress-value":!0,"::-webkit-resizer":!0,"::-webkit-scrollbar-button":!0,"::-webkit-scrollbar-corner":!0,"::-webkit-scrollbar-thumb":!0,"::-webkit-scrollbar-track-piece":!0,"::-webkit-scrollbar-track":!0,"::-webkit-scrollbar":!0,"::-webkit-search-cancel-button":!0,"::-webkit-search-results-button":!0,"::-webkit-slider-runnable-track":!0,"::-webkit-slider-thumb":!0,"::after":!0,"::backdrop":!0,"::before":!0,"::cue":!0,"::file-selector-button":!0,"::first-letter":!0,"::first-line":!0,"::grammar-error":!0,"::marker":!0,"::placeholder":!0,"::selection":!0,"::spelling-error":!0,"::target-text":!0,"::view-transition-group":!0,"::view-transition-image-pair":!0,"::view-transition-new":!0,"::view-transition-old":!0,"::view-transition":!0,":active":!0,":after":!0,":any-link":!0,":before":!0,":blank":!0,":checked":!0,":default":!0,":defined":!0,":disabled":!0,":empty":!0,":enabled":!0,":first-child":!0,":first-letter":!0,":first-line":!0,":first-of-type":!0,":first":!0,":focus-visible":!0,":focus-within":!0,":focus":!0,":fullscreen":!0,":hover":!0,":in-range":!0,":indeterminate":!0,":invalid":!0,":last-child":!0,":last-of-type":!0,":left":!0,":link":!0,":only-child":!0,":only-of-type":!0,":optional":!0,":out-of-range":!0,":placeholder-shown":!0,":read-only":!0,":read-write":!0,":required":!0,":right":!0,":root":!0,":scope":!0,":target":!0,":valid":!0,":visited":!0},jo=Object.keys(Fn),ko=Fn,Jr,Qr=(r,e)=>new Error(cr(Jr||(Jr=ur([`
64
- Invalid media query: "`,`"
65
-
66
- `,`
67
-
68
- Read more on MDN: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries
69
- `])),r,e)),Mo=r=>{if(r==="@media ")throw Qr(r,"Query is empty");try{ho(r)}catch(e){throw Qr(r,e.message)}},Po=["vars"],Fo=["content"],_n="__DECLARATION",_o={animationIterationCount:!0,borderImage:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexShrink:!0,fontWeight:!0,gridArea:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnStart:!0,gridRow:!0,gridRowEnd:!0,gridRowStart:!0,initialLetter:!0,lineClamp:!0,lineHeight:!0,maxLines:!0,opacity:!0,order:!0,orphans:!0,scale:!0,tabSize:!0,WebkitLineClamp:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,maskBorder:!0,maskBorderOutset:!0,maskBorderSlice:!0,maskBorderWidth:!0,shapeImageThreshold:!0,stopOpacity:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0};function To(r){return r.replace(/([A-Z])/g,"-$1").replace(/^ms-/,"-ms-").toLowerCase()}function zo(r,e,t,n){var i=r.slice(0,e),a=r.slice(t);return"".concat(i).concat(n).concat(a)}var Do=" ",Ye=[...jo,"@layer","@media","@supports","@container","selectors"];class Io{constructor(e,t){this.rules=[],this.conditionalRulesets=[new Mt],this.fontFaceRules=[],this.keyframesRules=[],this.localClassNamesMap=new Map(e.map(n=>[n,n])),this.localClassNamesSearch=new Ua(e),this.layers=new Map,this.composedClassLists=t.map(n=>{var{identifier:i,classList:a}=n;return{identifier:i,regex:RegExp("(".concat(a,")"),"g")}}).reverse()}processCssObj(e){if(e.type==="fontFace"){this.fontFaceRules.push(e.rule);return}if(e.type==="keyframes"){e.rule=Object.fromEntries(Object.entries(e.rule).map(a=>{var[o,l]=a;return[o,this.transformProperties(l)]})),this.keyframesRules.push(e);return}if(this.currConditionalRuleset=new Mt,e.type==="layer"){var t="@layer ".concat(e.name);this.addLayer([t])}else{var n=He(e.rule,Ye);this.addRule({selector:e.selector,rule:n}),this.transformLayer(e,e.rule["@layer"]),this.transformMedia(e,e.rule["@media"]),this.transformSupports(e,e.rule["@supports"]),this.transformContainer(e,e.rule["@container"]),this.transformSimplePseudos(e,e.rule),this.transformSelectors(e,e.rule)}var i=this.conditionalRulesets[this.conditionalRulesets.length-1];i.mergeIfCompatible(this.currConditionalRuleset)||this.conditionalRulesets.push(this.currConditionalRuleset)}addConditionalRule(e,t){var n=this.transformVars(this.transformProperties(e.rule)),i=this.transformSelector(e.selector);if(!this.currConditionalRuleset)throw new Error("Couldn't add conditional rule");var a=t[t.length-1],o=t.slice(0,t.length-1);this.currConditionalRuleset.addRule({selector:i,rule:n},a,o)}addRule(e){var t=this.transformVars(this.transformProperties(e.rule)),n=this.transformSelector(e.selector);this.rules.push({selector:n,rule:t})}addLayer(e){var t=e.join(" - ");this.layers.set(t,e)}transformProperties(e){return this.transformContent(this.pixelifyProperties(e))}pixelifyProperties(e){return ut(e,(t,n)=>{typeof t=="number"&&t!==0&&!_o[n]&&(e[n]="".concat(t,"px"))}),e}transformVars(e){var{vars:t}=e,n=Xr(e,Po);return t?qe(qe({},Ro(t,(i,a)=>Pa(a))),n):n}transformContent(e){var{content:t}=e,n=Xr(e,Fo);if(typeof t>"u")return n;var i=Array.isArray(t)?t:[t];return qe({content:i.map(a=>a&&(a.includes('"')||a.includes("'")||/^([A-Za-z\-]+\([^]*|[^]*-quote|inherit|initial|none|normal|revert|unset)(\s|$)/.test(a))?a:'"'.concat(a,'"'))},n)}transformClassname(e){return".".concat(lr(e,{isIdentifier:!0}))}transformSelector(e){var t=e,n=function(v){t=t.replace(a,()=>(jn(v),v))};for(var{identifier:i,regex:a}of this.composedClassLists)n(i);if(this.localClassNamesMap.has(t))return this.transformClassname(t);for(var o=this.localClassNamesSearch.search(t),l=t.length,s=o.length-1;s>=0;s--){var[c,[h]]=o[s],d=c-h.length+1;d>=l||(l=d,t[d-1]!=="."&&(t=zo(t,d,c+1,this.transformClassname(h))))}return t}transformSelectors(e,t,n){ut(t.selectors,(i,a)=>{if(e.type!=="local")throw new Error("Selectors are not allowed within ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));var o=this.transformSelector(a.replace(RegExp("&","g"),e.selector));Eo(o,e.selector);var l={selector:o,rule:He(i,Ye)};n?this.addConditionalRule(l,n):this.addRule(l);var s={type:"selector",selector:o,rule:i};this.transformLayer(s,i["@layer"],n),this.transformSupports(s,i["@supports"],n),this.transformMedia(s,i["@media"],n)})}transformMedia(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(t).map(c=>"@media ".concat(c)));for(var[a,o]of Object.entries(t)){var l="@media ".concat(a);Mo(l);var s=[...n,l];this.addConditionalRule({selector:e.selector,rule:He(o,Ye)},s),e.type==="local"&&(this.transformSimplePseudos(e,o,s),this.transformSelectors(e,o,s)),this.transformLayer(e,o["@layer"],s),this.transformSupports(e,o["@supports"],s),this.transformContainer(e,o["@container"],s)}}}transformContainer(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(t).map(a=>"@container ".concat(a))),ut(t,(a,o)=>{var l="@container ".concat(o),s=[...n,l];this.addConditionalRule({selector:e.selector,rule:He(a,Ye)},s),e.type==="local"&&(this.transformSimplePseudos(e,a,s),this.transformSelectors(e,a,s)),this.transformLayer(e,a["@layer"],s),this.transformSupports(e,a["@supports"],s),this.transformMedia(e,a["@media"],s)})}}transformLayer(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(t).map(a=>"@layer ".concat(a))),ut(t,(a,o)=>{var l=[...n,"@layer ".concat(o)];this.addLayer(l),this.addConditionalRule({selector:e.selector,rule:He(a,Ye)},l),e.type==="local"&&(this.transformSimplePseudos(e,a,l),this.transformSelectors(e,a,l)),this.transformMedia(e,a["@media"],l),this.transformSupports(e,a["@supports"],l),this.transformContainer(e,a["@container"],l)})}}transformSupports(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[];if(t){var i;(i=this.currConditionalRuleset)===null||i===void 0||i.addConditionPrecedence(n,Object.keys(t).map(a=>"@supports ".concat(a))),ut(t,(a,o)=>{var l=[...n,"@supports ".concat(o)];this.addConditionalRule({selector:e.selector,rule:He(a,Ye)},l),e.type==="local"&&(this.transformSimplePseudos(e,a,l),this.transformSelectors(e,a,l)),this.transformLayer(e,a["@layer"],l),this.transformMedia(e,a["@media"],l),this.transformContainer(e,a["@container"],l)})}}transformSimplePseudos(e,t,n){for(var i of Object.keys(t))if(ko[i]){if(e.type!=="local")throw new Error("Simple pseudos are not valid in ".concat(e.type==="global"?'"globalStyle"':'"selectors"'));n?this.addConditionalRule({selector:"".concat(e.selector).concat(i),rule:t[i]},n):this.addRule({conditions:n,selector:"".concat(e.selector).concat(i),rule:t[i]})}}toCss(){var e=[];for(var t of this.fontFaceRules)e.push(Le({"@font-face":t}));for(var n of this.keyframesRules)e.push(Le({["@keyframes ".concat(n.name)]:n.rule}));for(var i of this.layers.values()){var[a,...o]=i.reverse(),l={[a]:_n};for(var s of o)l={[s]:l};e.push(Le(l))}for(var c of this.rules)e.push(Le({[c.selector]:c.rule}));for(var h of this.conditionalRulesets)for(var d of h.renderToArray())e.push(Le(d));return e.filter(Boolean)}}function Le(r){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"",t=[],n=function(o){var l=r[o];if(l&&Array.isArray(l))t.push(...l.map(c=>Le({[o]:c},e)));else if(l&&typeof l=="object"){var s=Object.keys(l).length===0;s||t.push("".concat(e).concat(o,` {
70
- `).concat(Le(l,e+Do),`
71
- `).concat(e,"}"))}else l===_n?t.push("".concat(e).concat(o,";")):t.push("".concat(e).concat(o.startsWith("--")?o:To(o),": ").concat(l,";"))};for(var i of Object.keys(r))n(i);return t.join(`
72
- `)}function No(r){var{localClassNames:e,cssObjs:t,composedClassLists:n}=r,i=new Io(e,n);for(var a of t)i.processCssObj(a);return i.toCss()}function Uo(r){for(var e=0,t,n=0,i=r.length;i>=4;++n,i-=4)t=r.charCodeAt(n)&255|(r.charCodeAt(++n)&255)<<8|(r.charCodeAt(++n)&255)<<16|(r.charCodeAt(++n)&255)<<24,t=(t&65535)*1540483477+((t>>>16)*59797<<16),t^=t>>>24,e=(t&65535)*1540483477+((t>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(i){case 3:e^=(r.charCodeAt(n+2)&255)<<16;case 2:e^=(r.charCodeAt(n+1)&255)<<8;case 1:e^=r.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var en,Lo=0,tn=[];function Me(){if(tn.length===0)throw new Error(cr(en||(en=ur([`
73
- Styles were unable to be assigned to a file. This is generally caused by one of the following:
74
-
75
- - You may have created styles outside of a '.css.ts' context
76
- - You may have incorrect configuration. See https://vanilla-extract.style/documentation/getting-started
77
- `]))));return tn[0]}function Wo(){return Lo++}const Ke=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,Tn=new Set,Zt=typeof process=="object"&&process?process:{},zn=(r,e,t,n)=>{typeof Zt.emitWarning=="function"?Zt.emitWarning(r,e,t,n):console.error(`[${t}] ${e}: ${r}`)};let Pt=globalThis.AbortController,rn=globalThis.AbortSignal;var cn;if(typeof Pt>"u"){rn=class{constructor(){$(this,"onabort");$(this,"_onabort",[]);$(this,"reason");$(this,"aborted",!1)}addEventListener(n,i){this._onabort.push(i)}},Pt=class{constructor(){$(this,"signal",new rn);e()}abort(n){var i,a;if(!this.signal.aborted){this.signal.reason=n,this.signal.aborted=!0;for(const o of this.signal._onabort)o(n);(a=(i=this.signal).onabort)==null||a.call(i,n)}}};let r=((cn=Zt.env)==null?void 0:cn.LRU_CACHE_IGNORE_AC_WARNING)!=="1";const e=()=>{r&&(r=!1,zn("AbortController is not defined. If using lru-cache in node 14, load an AbortController polyfill from the `node-abort-controller` package. A minimal polyfill is provided for use by LRUCache.fetch(), but it should not be relied upon in other contexts (eg, passing it to other APIs that use AbortController/AbortSignal might have undesirable effects). You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",e))}}const Go=r=>!Tn.has(r),Fe=r=>r&&r===Math.floor(r)&&r>0&&isFinite(r),Dn=r=>Fe(r)?r<=Math.pow(2,8)?Uint8Array:r<=Math.pow(2,16)?Uint16Array:r<=Math.pow(2,32)?Uint32Array:r<=Number.MAX_SAFE_INTEGER?Rt:null:null;class Rt extends Array{constructor(e){super(e),this.fill(0)}}var Ze;const We=class We{constructor(e,t){$(this,"heap");$(this,"length");if(!u(We,Ze))throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}static create(e){const t=Dn(e);if(!t)return[];j(We,Ze,!0);const n=new We(e,t);return j(We,Ze,!1),n}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}};Ze=new WeakMap,I(We,Ze,!1);let Jt=We;var fn,hn,be,fe,we,Ce,Je,Qe,ee,xe,Q,G,F,oe,he,ie,re,Se,ne,Re,Oe,de,Ae,De,se,x,er,Ge,ke,dt,me,In,Be,et,mt,_e,Te,tr,Ot,At,W,rr,ct,ze,nr;const mr=class mr{constructor(e){I(this,x);I(this,be);I(this,fe);I(this,we);I(this,Ce);I(this,Je);I(this,Qe);$(this,"ttl");$(this,"ttlResolution");$(this,"ttlAutopurge");$(this,"updateAgeOnGet");$(this,"updateAgeOnHas");$(this,"allowStale");$(this,"noDisposeOnSet");$(this,"noUpdateTTL");$(this,"maxEntrySize");$(this,"sizeCalculation");$(this,"noDeleteOnFetchRejection");$(this,"noDeleteOnStaleGet");$(this,"allowStaleOnFetchAbort");$(this,"allowStaleOnFetchRejection");$(this,"ignoreFetchAbort");I(this,ee);I(this,xe);I(this,Q);I(this,G);I(this,F);I(this,oe);I(this,he);I(this,ie);I(this,re);I(this,Se);I(this,ne);I(this,Re);I(this,Oe);I(this,de);I(this,Ae);I(this,De);I(this,se);I(this,Ge,()=>{});I(this,ke,()=>{});I(this,dt,()=>{});I(this,me,()=>!1);I(this,Be,e=>{});I(this,et,(e,t,n)=>{});I(this,mt,(e,t,n,i)=>{if(n||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0});$(this,fn,"LRUCache");const{max:t=0,ttl:n,ttlResolution:i=1,ttlAutopurge:a,updateAgeOnGet:o,updateAgeOnHas:l,allowStale:s,dispose:c,disposeAfter:h,noDisposeOnSet:d,noUpdateTTL:m,maxSize:v=0,maxEntrySize:p=0,sizeCalculation:y,fetchMethod:g,memoMethod:C,noDeleteOnFetchRejection:R,noDeleteOnStaleGet:k,allowStaleOnFetchRejection:P,allowStaleOnFetchAbort:_,ignoreFetchAbort:D}=e;if(t!==0&&!Fe(t))throw new TypeError("max option must be a nonnegative integer");const V=t?Dn(t):Array;if(!V)throw new Error("invalid max value: "+t);if(j(this,be,t),j(this,fe,v),this.maxEntrySize=p||u(this,fe),this.sizeCalculation=y,this.sizeCalculation){if(!u(this,fe)&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(C!==void 0&&typeof C!="function")throw new TypeError("memoMethod must be a function if defined");if(j(this,Qe,C),g!==void 0&&typeof g!="function")throw new TypeError("fetchMethod must be a function if specified");if(j(this,Je,g),j(this,De,!!g),j(this,Q,new Map),j(this,G,new Array(t).fill(void 0)),j(this,F,new Array(t).fill(void 0)),j(this,oe,new V(t)),j(this,he,new V(t)),j(this,ie,0),j(this,re,0),j(this,Se,Jt.create(t)),j(this,ee,0),j(this,xe,0),typeof c=="function"&&j(this,we,c),typeof h=="function"?(j(this,Ce,h),j(this,ne,[])):(j(this,Ce,void 0),j(this,ne,void 0)),j(this,Ae,!!u(this,we)),j(this,se,!!u(this,Ce)),this.noDisposeOnSet=!!d,this.noUpdateTTL=!!m,this.noDeleteOnFetchRejection=!!R,this.allowStaleOnFetchRejection=!!P,this.allowStaleOnFetchAbort=!!_,this.ignoreFetchAbort=!!D,this.maxEntrySize!==0){if(u(this,fe)!==0&&!Fe(u(this,fe)))throw new TypeError("maxSize must be a positive integer if specified");if(!Fe(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");A(this,x,In).call(this)}if(this.allowStale=!!s,this.noDeleteOnStaleGet=!!k,this.updateAgeOnGet=!!o,this.updateAgeOnHas=!!l,this.ttlResolution=Fe(i)||i===0?i:1,this.ttlAutopurge=!!a,this.ttl=n||0,this.ttl){if(!Fe(this.ttl))throw new TypeError("ttl must be a positive integer if specified");A(this,x,er).call(this)}if(u(this,be)===0&&this.ttl===0&&u(this,fe)===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!u(this,be)&&!u(this,fe)){const q="LRU_CACHE_UNBOUNDED";Go(q)&&(Tn.add(q),zn("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",q,mr))}}static unsafeExposeInternals(e){return{starts:u(e,Oe),ttls:u(e,de),sizes:u(e,Re),keyMap:u(e,Q),keyList:u(e,G),valList:u(e,F),next:u(e,oe),prev:u(e,he),get head(){return u(e,ie)},get tail(){return u(e,re)},free:u(e,Se),isBackgroundFetch:t=>{var n;return A(n=e,x,W).call(n,t)},backgroundFetch:(t,n,i,a)=>{var o;return A(o=e,x,At).call(o,t,n,i,a)},moveToTail:t=>{var n;return A(n=e,x,ct).call(n,t)},indexes:t=>{var n;return A(n=e,x,_e).call(n,t)},rindexes:t=>{var n;return A(n=e,x,Te).call(n,t)},isStale:t=>{var n;return u(n=e,me).call(n,t)}}}get max(){return u(this,be)}get maxSize(){return u(this,fe)}get calculatedSize(){return u(this,xe)}get size(){return u(this,ee)}get fetchMethod(){return u(this,Je)}get memoMethod(){return u(this,Qe)}get dispose(){return u(this,we)}get disposeAfter(){return u(this,Ce)}getRemainingTTL(e){return u(this,Q).has(e)?1/0:0}*entries(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&u(this,G)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,G)[e],u(this,F)[e]])}*rentries(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&u(this,G)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield[u(this,G)[e],u(this,F)[e]])}*keys(){for(const e of A(this,x,_e).call(this)){const t=u(this,G)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*rkeys(){for(const e of A(this,x,Te).call(this)){const t=u(this,G)[e];t!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield t)}}*values(){for(const e of A(this,x,_e).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}*rvalues(){for(const e of A(this,x,Te).call(this))u(this,F)[e]!==void 0&&!A(this,x,W).call(this,u(this,F)[e])&&(yield u(this,F)[e])}[(hn=Symbol.iterator,fn=Symbol.toStringTag,hn)](){return this.entries()}find(e,t={}){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a!==void 0&&e(a,u(this,G)[n],this))return this.get(u(this,G)[n],t)}}forEach(e,t=this){for(const n of A(this,x,_e).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,G)[n],this)}}rforEach(e,t=this){for(const n of A(this,x,Te).call(this)){const i=u(this,F)[n],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;a!==void 0&&e.call(t,a,u(this,G)[n],this)}}purgeStale(){let e=!1;for(const t of A(this,x,Te).call(this,{allowStale:!0}))u(this,me).call(this,t)&&(A(this,x,ze).call(this,u(this,G)[t],"expire"),e=!0);return e}info(e){const t=u(this,Q).get(e);if(t===void 0)return;const n=u(this,F)[t],i=A(this,x,W).call(this,n)?n.__staleWhileFetching:n;if(i===void 0)return;const a={value:i};if(u(this,de)&&u(this,Oe)){const o=u(this,de)[t],l=u(this,Oe)[t];if(o&&l){const s=o-(Ke.now()-l);a.ttl=s,a.start=Date.now()}}return u(this,Re)&&(a.size=u(this,Re)[t]),a}dump(){const e=[];for(const t of A(this,x,_e).call(this,{allowStale:!0})){const n=u(this,G)[t],i=u(this,F)[t],a=A(this,x,W).call(this,i)?i.__staleWhileFetching:i;if(a===void 0||n===void 0)continue;const o={value:a};if(u(this,de)&&u(this,Oe)){o.ttl=u(this,de)[t];const l=Ke.now()-u(this,Oe)[t];o.start=Math.floor(Date.now()-l)}u(this,Re)&&(o.size=u(this,Re)[t]),e.unshift([n,o])}return e}load(e){this.clear();for(const[t,n]of e){if(n.start){const i=Date.now()-n.start;n.start=Ke.now()-i}this.set(t,n.value,n)}}set(e,t,n={}){var m,v,p,y,g;if(t===void 0)return this.delete(e),this;const{ttl:i=this.ttl,start:a,noDisposeOnSet:o=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:s}=n;let{noUpdateTTL:c=this.noUpdateTTL}=n;const h=u(this,mt).call(this,e,t,n.size||0,l);if(this.maxEntrySize&&h>this.maxEntrySize)return s&&(s.set="miss",s.maxEntrySizeExceeded=!0),A(this,x,ze).call(this,e,"set"),this;let d=u(this,ee)===0?void 0:u(this,Q).get(e);if(d===void 0)d=u(this,ee)===0?u(this,re):u(this,Se).length!==0?u(this,Se).pop():u(this,ee)===u(this,be)?A(this,x,Ot).call(this,!1):u(this,ee),u(this,G)[d]=e,u(this,F)[d]=t,u(this,Q).set(e,d),u(this,oe)[u(this,re)]=d,u(this,he)[d]=u(this,re),j(this,re,d),Ct(this,ee)._++,u(this,et).call(this,d,h,s),s&&(s.set="add"),c=!1;else{A(this,x,ct).call(this,d);const C=u(this,F)[d];if(t!==C){if(u(this,De)&&A(this,x,W).call(this,C)){C.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:R}=C;R!==void 0&&!o&&(u(this,Ae)&&((m=u(this,we))==null||m.call(this,R,e,"set")),u(this,se)&&((v=u(this,ne))==null||v.push([R,e,"set"])))}else o||(u(this,Ae)&&((p=u(this,we))==null||p.call(this,C,e,"set")),u(this,se)&&((y=u(this,ne))==null||y.push([C,e,"set"])));if(u(this,Be).call(this,d),u(this,et).call(this,d,h,s),u(this,F)[d]=t,s){s.set="replace";const R=C&&A(this,x,W).call(this,C)?C.__staleWhileFetching:C;R!==void 0&&(s.oldValue=R)}}else s&&(s.set="update")}if(i!==0&&!u(this,de)&&A(this,x,er).call(this),u(this,de)&&(c||u(this,dt).call(this,d,i,a),s&&u(this,ke).call(this,s,d)),!o&&u(this,se)&&u(this,ne)){const C=u(this,ne);let R;for(;R=C==null?void 0:C.shift();)(g=u(this,Ce))==null||g.call(this,...R)}return this}pop(){var e;try{for(;u(this,ee);){const t=u(this,F)[u(this,ie)];if(A(this,x,Ot).call(this,!0),A(this,x,W).call(this,t)){if(t.__staleWhileFetching)return t.__staleWhileFetching}else if(t!==void 0)return t}}finally{if(u(this,se)&&u(this,ne)){const t=u(this,ne);let n;for(;n=t==null?void 0:t.shift();)(e=u(this,Ce))==null||e.call(this,...n)}}}has(e,t={}){const{updateAgeOnHas:n=this.updateAgeOnHas,status:i}=t,a=u(this,Q).get(e);if(a!==void 0){const o=u(this,F)[a];if(A(this,x,W).call(this,o)&&o.__staleWhileFetching===void 0)return!1;if(u(this,me).call(this,a))i&&(i.has="stale",u(this,ke).call(this,i,a));else return n&&u(this,Ge).call(this,a),i&&(i.has="hit",u(this,ke).call(this,i,a)),!0}else i&&(i.has="miss");return!1}peek(e,t={}){const{allowStale:n=this.allowStale}=t,i=u(this,Q).get(e);if(i===void 0||!n&&u(this,me).call(this,i))return;const a=u(this,F)[i];return A(this,x,W).call(this,a)?a.__staleWhileFetching:a}async fetch(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,ttl:o=this.ttl,noDisposeOnSet:l=this.noDisposeOnSet,size:s=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:h=this.noUpdateTTL,noDeleteOnFetchRejection:d=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:m=this.allowStaleOnFetchRejection,ignoreFetchAbort:v=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:y,forceRefresh:g=!1,status:C,signal:R}=t;if(!u(this,De))return C&&(C.fetch="get"),this.get(e,{allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,status:C});const k={allowStale:n,updateAgeOnGet:i,noDeleteOnStaleGet:a,ttl:o,noDisposeOnSet:l,size:s,sizeCalculation:c,noUpdateTTL:h,noDeleteOnFetchRejection:d,allowStaleOnFetchRejection:m,allowStaleOnFetchAbort:p,ignoreFetchAbort:v,status:C,signal:R};let P=u(this,Q).get(e);if(P===void 0){C&&(C.fetch="miss");const _=A(this,x,At).call(this,e,P,k,y);return _.__returned=_}else{const _=u(this,F)[P];if(A(this,x,W).call(this,_)){const Ie=n&&_.__staleWhileFetching!==void 0;return C&&(C.fetch="inflight",Ie&&(C.returnedStale=!0)),Ie?_.__staleWhileFetching:_.__returned=_}const D=u(this,me).call(this,P);if(!g&&!D)return C&&(C.fetch="hit"),A(this,x,ct).call(this,P),i&&u(this,Ge).call(this,P),C&&u(this,ke).call(this,C,P),_;const V=A(this,x,At).call(this,e,P,k,y),H=V.__staleWhileFetching!==void 0&&n;return C&&(C.fetch=D?"stale":"refresh",H&&D&&(C.returnedStale=!0)),H?V.__staleWhileFetching:V.__returned=V}}async forceFetch(e,t={}){const n=await this.fetch(e,t);if(n===void 0)throw new Error("fetch() returned undefined");return n}memo(e,t={}){const n=u(this,Qe);if(!n)throw new Error("no memoMethod provided to constructor");const{context:i,forceRefresh:a,...o}=t,l=this.get(e,o);if(!a&&l!==void 0)return l;const s=n(e,l,{options:o,context:i});return this.set(e,s,o),s}get(e,t={}){const{allowStale:n=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,noDeleteOnStaleGet:a=this.noDeleteOnStaleGet,status:o}=t,l=u(this,Q).get(e);if(l!==void 0){const s=u(this,F)[l],c=A(this,x,W).call(this,s);return o&&u(this,ke).call(this,o,l),u(this,me).call(this,l)?(o&&(o.get="stale"),c?(o&&n&&s.__staleWhileFetching!==void 0&&(o.returnedStale=!0),n?s.__staleWhileFetching:void 0):(a||A(this,x,ze).call(this,e,"expire"),o&&n&&(o.returnedStale=!0),n?s:void 0)):(o&&(o.get="hit"),c?s.__staleWhileFetching:(A(this,x,ct).call(this,l),i&&u(this,Ge).call(this,l),s))}else o&&(o.get="miss")}delete(e){return A(this,x,ze).call(this,e,"delete")}clear(){return A(this,x,nr).call(this,"delete")}};be=new WeakMap,fe=new WeakMap,we=new WeakMap,Ce=new WeakMap,Je=new WeakMap,Qe=new WeakMap,ee=new WeakMap,xe=new WeakMap,Q=new WeakMap,G=new WeakMap,F=new WeakMap,oe=new WeakMap,he=new WeakMap,ie=new WeakMap,re=new WeakMap,Se=new WeakMap,ne=new WeakMap,Re=new WeakMap,Oe=new WeakMap,de=new WeakMap,Ae=new WeakMap,De=new WeakMap,se=new WeakMap,x=new WeakSet,er=function(){const e=new Rt(u(this,be)),t=new Rt(u(this,be));j(this,de,e),j(this,Oe,t),j(this,dt,(a,o,l=Ke.now())=>{if(t[a]=o!==0?l:0,e[a]=o,o!==0&&this.ttlAutopurge){const s=setTimeout(()=>{u(this,me).call(this,a)&&A(this,x,ze).call(this,u(this,G)[a],"expire")},o+1);s.unref&&s.unref()}}),j(this,Ge,a=>{t[a]=e[a]!==0?Ke.now():0}),j(this,ke,(a,o)=>{if(e[o]){const l=e[o],s=t[o];if(!l||!s)return;a.ttl=l,a.start=s,a.now=n||i();const c=a.now-s;a.remainingTTL=l-c}});let n=0;const i=()=>{const a=Ke.now();if(this.ttlResolution>0){n=a;const o=setTimeout(()=>n=0,this.ttlResolution);o.unref&&o.unref()}return a};this.getRemainingTTL=a=>{const o=u(this,Q).get(a);if(o===void 0)return 0;const l=e[o],s=t[o];if(!l||!s)return 1/0;const c=(n||i())-s;return l-c},j(this,me,a=>{const o=t[a],l=e[a];return!!l&&!!o&&(n||i())-o>l})},Ge=new WeakMap,ke=new WeakMap,dt=new WeakMap,me=new WeakMap,In=function(){const e=new Rt(u(this,be));j(this,xe,0),j(this,Re,e),j(this,Be,t=>{j(this,xe,u(this,xe)-e[t]),e[t]=0}),j(this,mt,(t,n,i,a)=>{if(A(this,x,W).call(this,n))return 0;if(!Fe(i))if(a){if(typeof a!="function")throw new TypeError("sizeCalculation must be a function");if(i=a(n,t),!Fe(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.");return i}),j(this,et,(t,n,i)=>{if(e[t]=n,u(this,fe)){const a=u(this,fe)-e[t];for(;u(this,xe)>a;)A(this,x,Ot).call(this,!0)}j(this,xe,u(this,xe)+e[t]),i&&(i.entrySize=n,i.totalCalculatedSize=u(this,xe))})},Be=new WeakMap,et=new WeakMap,mt=new WeakMap,_e=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,re);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,ie)));)t=u(this,he)[t]},Te=function*({allowStale:e=this.allowStale}={}){if(u(this,ee))for(let t=u(this,ie);!(!A(this,x,tr).call(this,t)||((e||!u(this,me).call(this,t))&&(yield t),t===u(this,re)));)t=u(this,oe)[t]},tr=function(e){return e!==void 0&&u(this,Q).get(u(this,G)[e])===e},Ot=function(e){var a,o;const t=u(this,ie),n=u(this,G)[t],i=u(this,F)[t];return u(this,De)&&A(this,x,W).call(this,i)?i.__abortController.abort(new Error("evicted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((a=u(this,we))==null||a.call(this,i,n,"evict")),u(this,se)&&((o=u(this,ne))==null||o.push([i,n,"evict"]))),u(this,Be).call(this,t),e&&(u(this,G)[t]=void 0,u(this,F)[t]=void 0,u(this,Se).push(t)),u(this,ee)===1?(j(this,ie,j(this,re,0)),u(this,Se).length=0):j(this,ie,u(this,oe)[t]),u(this,Q).delete(n),Ct(this,ee)._--,t},At=function(e,t,n,i){const a=t===void 0?void 0:u(this,F)[t];if(A(this,x,W).call(this,a))return a;const o=new Pt,{signal:l}=n;l==null||l.addEventListener("abort",()=>o.abort(l.reason),{signal:o.signal});const s={signal:o.signal,options:n,context:i},c=(y,g=!1)=>{const{aborted:C}=o.signal,R=n.ignoreFetchAbort&&y!==void 0;if(n.status&&(C&&!g?(n.status.fetchAborted=!0,n.status.fetchError=o.signal.reason,R&&(n.status.fetchAbortIgnored=!0)):n.status.fetchResolved=!0),C&&!R&&!g)return d(o.signal.reason);const k=v;return u(this,F)[t]===v&&(y===void 0?k.__staleWhileFetching?u(this,F)[t]=k.__staleWhileFetching:A(this,x,ze).call(this,e,"fetch"):(n.status&&(n.status.fetchUpdated=!0),this.set(e,y,s.options))),y},h=y=>(n.status&&(n.status.fetchRejected=!0,n.status.fetchError=y),d(y)),d=y=>{const{aborted:g}=o.signal,C=g&&n.allowStaleOnFetchAbort,R=C||n.allowStaleOnFetchRejection,k=R||n.noDeleteOnFetchRejection,P=v;if(u(this,F)[t]===v&&(!k||P.__staleWhileFetching===void 0?A(this,x,ze).call(this,e,"fetch"):C||(u(this,F)[t]=P.__staleWhileFetching)),R)return n.status&&P.__staleWhileFetching!==void 0&&(n.status.returnedStale=!0),P.__staleWhileFetching;if(P.__returned===P)throw y},m=(y,g)=>{var R;const C=(R=u(this,Je))==null?void 0:R.call(this,e,a,s);C&&C instanceof Promise&&C.then(k=>y(k===void 0?void 0:k),g),o.signal.addEventListener("abort",()=>{(!n.ignoreFetchAbort||n.allowStaleOnFetchAbort)&&(y(void 0),n.allowStaleOnFetchAbort&&(y=k=>c(k,!0)))})};n.status&&(n.status.fetchDispatched=!0);const v=new Promise(m).then(c,h),p=Object.assign(v,{__abortController:o,__staleWhileFetching:a,__returned:void 0});return t===void 0?(this.set(e,p,{...s.options,status:void 0}),t=u(this,Q).get(e)):u(this,F)[t]=p,p},W=function(e){if(!u(this,De))return!1;const t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof Pt},rr=function(e,t){u(this,he)[t]=e,u(this,oe)[e]=t},ct=function(e){e!==u(this,re)&&(e===u(this,ie)?j(this,ie,u(this,oe)[e]):A(this,x,rr).call(this,u(this,he)[e],u(this,oe)[e]),A(this,x,rr).call(this,u(this,re),e),j(this,re,e))},ze=function(e,t){var i,a,o,l;let n=!1;if(u(this,ee)!==0){const s=u(this,Q).get(e);if(s!==void 0)if(n=!0,u(this,ee)===1)A(this,x,nr).call(this,t);else{u(this,Be).call(this,s);const c=u(this,F)[s];if(A(this,x,W).call(this,c)?c.__abortController.abort(new Error("deleted")):(u(this,Ae)||u(this,se))&&(u(this,Ae)&&((i=u(this,we))==null||i.call(this,c,e,t)),u(this,se)&&((a=u(this,ne))==null||a.push([c,e,t]))),u(this,Q).delete(e),u(this,G)[s]=void 0,u(this,F)[s]=void 0,s===u(this,re))j(this,re,u(this,he)[s]);else if(s===u(this,ie))j(this,ie,u(this,oe)[s]);else{const h=u(this,he)[s];u(this,oe)[h]=u(this,oe)[s];const d=u(this,oe)[s];u(this,he)[d]=u(this,he)[s]}Ct(this,ee)._--,u(this,Se).push(s)}}if(u(this,se)&&((o=u(this,ne))!=null&&o.length)){const s=u(this,ne);let c;for(;c=s==null?void 0:s.shift();)(l=u(this,Ce))==null||l.call(this,...c)}return n},nr=function(e){var t,n,i;for(const a of A(this,x,Te).call(this,{allowStale:!0})){const o=u(this,F)[a];if(A(this,x,W).call(this,o))o.__abortController.abort(new Error("deleted"));else{const l=u(this,G)[a];u(this,Ae)&&((t=u(this,we))==null||t.call(this,o,l,e)),u(this,se)&&((n=u(this,ne))==null||n.push([o,l,e]))}}if(u(this,Q).clear(),u(this,F).fill(void 0),u(this,G).fill(void 0),u(this,de)&&u(this,Oe)&&(u(this,de).fill(0),u(this,Oe).fill(0)),u(this,Re)&&u(this,Re).fill(0),j(this,ie,0),j(this,re,0),u(this,Se).length=0,j(this,xe,0),j(this,ee,0),u(this,se)&&u(this,ne)){const a=u(this,ne);let o;for(;o=a==null?void 0:a.shift();)(i=u(this,Ce))==null||i.call(this,...o)}};let Qt=mr;var Bo=function(e){return qo(e)&&!$o(e)};function qo(r){return!!r&&typeof r=="object"}function $o(r){var e=Object.prototype.toString.call(r);return e==="[object RegExp]"||e==="[object Date]"||Yo(r)}var Vo=typeof Symbol=="function"&&Symbol.for,Ho=Vo?Symbol.for("react.element"):60103;function Yo(r){return r.$$typeof===Ho}function Ko(r){return Array.isArray(r)?[]:{}}function ht(r,e){return e.clone!==!1&&e.isMergeableObject(r)?tt(Ko(r),r,e):r}function Xo(r,e,t){return r.concat(e).map(function(n){return ht(n,t)})}function Zo(r,e){if(!e.customMerge)return tt;var t=e.customMerge(r);return typeof t=="function"?t:tt}function Jo(r){return Object.getOwnPropertySymbols?Object.getOwnPropertySymbols(r).filter(function(e){return Object.propertyIsEnumerable.call(r,e)}):[]}function nn(r){return Object.keys(r).concat(Jo(r))}function Nn(r,e){try{return e in r}catch{return!1}}function Qo(r,e){return Nn(r,e)&&!(Object.hasOwnProperty.call(r,e)&&Object.propertyIsEnumerable.call(r,e))}function es(r,e,t){var n={};return t.isMergeableObject(r)&&nn(r).forEach(function(i){n[i]=ht(r[i],t)}),nn(e).forEach(function(i){Qo(r,i)||(Nn(r,i)&&t.isMergeableObject(e[i])?n[i]=Zo(i,t)(r[i],e[i],t):n[i]=ht(e[i],t))}),n}function tt(r,e,t){t=t||{},t.arrayMerge=t.arrayMerge||Xo,t.isMergeableObject=t.isMergeableObject||Bo,t.cloneUnlessOtherwiseSpecified=ht;var n=Array.isArray(e),i=Array.isArray(r),a=n===i;return a?n?t.arrayMerge(r,e,t):es(r,e,t):ht(e,t)}tt.all=function(e,t){if(!Array.isArray(e))throw new Error("first argument should be an array");return e.reduce(function(n,i){return tt(n,i,t)},{})};var ts=tt,rs=ts;const ns=dn(rs);var an=new Set,on=[],Vt=[],is={appendCss:r=>{Vt.push(r)},registerClassName:r=>{an.add(r)},registerComposition:r=>{on.push(r)},markCompositionUsed:()=>{},onEndFileScope:r=>{var e=No({localClassNames:Array.from(an),composedClassLists:on,cssObjs:Vt}).join(`
78
- `);Ma({fileScope:r,css:e}),Vt=[]},getIdentOption:()=>process.env.NODE_ENV==="production"?"short":"debug"};Wa(is);var sn=(r,e)=>{for(var t=e-1;t>=0;){if(r[t]==="/")return t;t--}return-1},as=r=>{var e,t=r.lastIndexOf(".css");if(t===-1)return"";var n=sn(r,t);if(e=r.slice(n+1,t),n===-1)return e;var i=sn(r,n-1),a=r.slice(i+1,n),o=e!=="index"?e:a;return o},os=()=>{var r=new Qt({max:500});return e=>{var t=r.get(e);if(t)return t;var n=as(e);return r.set(e,n),n}},ss=os();function ls(r){var{debugId:e,debugFileName:t}=r,n=e?[e.replace(/\s/g,"_")]:[];if(t){var{filePath:i}=Me(),a=ss(i);a&&n.unshift(a)}return n.join("_")}function ln(r){return r.match(/^[0-9]/)?"_".concat(r):r}function hr(r){var e=qa(),{debugId:t,debugFileName:n=!0}=qe(qe({},null),null),i=Wo().toString(36),{filePath:a,packageName:o}=Me(),l=Uo(o?"".concat(o).concat(a):a),s="".concat(l).concat(i);if(e==="debug"){var c=ls({debugId:t,debugFileName:n});return c&&(s="".concat(c,"__").concat(s)),ln(s)}if(typeof e=="function"){if(s=e({hash:s,debugId:t,filePath:a,packageName:o}),!s.match(/^[A-Z_][0-9A-Z_-]+$/i))throw new Error('Identifier function returned invalid indentifier: "'.concat(s,'"'));return s}return ln(s)}function us(r,e){var t=hr();En(t,Me());var n=[],i=[];for(var a of r)typeof a=="string"?n.push(a):i.push(a);var o=t;if(n.length>0&&(o="".concat(t," ").concat(Oo(n)),Ba({identifier:t,classList:o},Me()),i.length>0&&jn(t)),i.length>0){var l=ns.all(i,{arrayMerge:(s,c)=>c});Ft({type:"local",selector:t,rule:l},Me())}return o}function Z(r,e){if(Array.isArray(r))return us(r);var t=hr();return En(t,Me()),Ft({type:"local",selector:t,rule:r},Me()),t}function cs(r,e){Ft({type:"global",selector:r,rule:e},Me())}function fs(r,e){var t=lr(hr(),{isIdentifier:!0});return Ft({type:"keyframes",name:t,rule:r},Me()),t}const Un=Z({display:"flex",justifyContent:"center",alignItems:"center",textAlign:"center"}),Ln=Z([Un,{width:"5rem",height:"5rem",cursor:"pointer",transition:"all 0.3s ease-in",boxShadow:"0 0 0.5rem rgba(0, 0, 0, 0.5)",backgroundColor:"rgba(0, 0, 0, 0.5)",color:"white",selectors:{"&:hover":{boxShadow:"0 0 1rem rgba(0, 0, 0, 0.5)"}}}]),dr={width:"18rem",height:"18rem","@media":{"screen and (max-width: 1024px)":{width:"17rem",height:"17rem"},"screen and (max-width: 768px)":{width:"16rem",height:"16rem"}}},Wn=Z({display:"grid",alignItems:"center",justifyContent:"center",gridTemplateColumns:"repeat(3, 1fr)",gridTemplateRows:"repeat(3, 1fr)"}),hs=Z([Ln,{position:"relative",fontSize:"1rem",margin:"0.5rem",borderRadius:"50%",selectors:{"&::after":{content:'""',position:"absolute",width:"4rem",height:"4rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.2)",zIndex:1e5}}}]),ds=Z({background:"radial-gradient(circle at center, rgba(245, 177, 97, 1) 0.4%, rgba(236, 54, 110, 1) 100.2%)",boxShadow:"0 0 1rem rgba(245, 177, 97, 1)",color:"black",transition:"all 0.3s ease-in",borderRadius:"50%",selectors:{"&:hover":{boxShadow:"0 0 2rem rgba(245, 177, 97, 1)"}}});cs(`${Wn} *`,{WebkitTouchCallout:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none",userSelect:"none"});function ms({value:r,name:e,gamePadButtonStyle:t}){const[n,i]=w.useState(!1),{pushKey:a}=On(),o=()=>{a(r,!0),i(!0)},l=()=>{a(r,!1),i(!1)};return S.jsx("button",{className:`${hs} ${n?ds:""}`,onMouseDown:o,onMouseUp:l,onMouseLeave:l,onContextMenu:s=>{s.preventDefault(),l()},onPointerDown:o,onPointerUp:l,style:t,children:e})}function ps(r){const{gamePadStyle:e,gamePadButtonStyle:t,label:n}=r,{control:i,mode:a}=w.useContext(B),o=Object.keys(i).map(l=>{const s=(n==null?void 0:n[l])||l;if(l!=="forward"&&l!=="backward"&&l!=="leftward"&&l!=="rightward")return{tag:l,value:l,name:s}}).filter(l=>l!==void 0).filter(l=>l.tag!=="run");return S.jsx(S.Fragment,{children:a.controller==="clicker"&&S.jsx("div",{className:Wn,style:e,children:o.map((l,s)=>S.jsx(ms,{value:l.value,name:l.name,gamePadButtonStyle:t},s))})})}const vs=fs({"0%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0.7)",opacity:1},"70%":{boxShadow:"0 0 0 10px rgba(255, 255, 255, 0)",opacity:.7},"100%":{boxShadow:"0 0 0 0 rgba(255, 255, 255, 0)",opacity:1}}),gs=Z([{margin:"1rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)",backdropFilter:"blur(1rem)",WebkitBackdropFilter:"blur(1rem)",border:"4px solid rgba(0, 0, 0, 0.5)",overflow:"hidden"},dr]),ys=Z([Un,{position:"absolute",textAlign:"center",overflow:"hidden"},dr]),bs=Z([{position:"relative",display:"flex",top:"50%",left:"50%",transformOrigin:"50% 50%",borderRadius:"50%",overflow:"hidden"},dr]),ws=Z([{position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",top:"50%",left:"50%",transform:"translate(-50%, -50%)",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(5, 222, 250, 1)",boxShadow:"0 0 10px rgba(5, 222, 250, 1)",border:"2px solid transparent",objectFit:"cover",zIndex:100,animation:`${vs} 2s infinite`}]),un=Z([{position:"relative",display:"flex",justifyContent:"center",alignItems:"center",width:"2rem",height:"2rem",borderRadius:"50%",background:"rgba(0, 0, 0, 0.5)",boxShadow:"0 0 5px rgba(0, 0, 0, 0.5)",transition:"all 0.5s ease-in",cursor:"pointer",border:"2px solid transparent",selectors:{"&:hover":{boxShadow:"0 0 10px rgba(0, 0, 0, 0.5)"}}}]),Cs=Z([{position:"absolute",width:"13rem",bottom:"-5rem",left:"50%",transform:"translateX(-50%)",display:"flex",alignItems:"center",justifyContent:"space-between",fontSize:"1.2rem",color:"white",textShadow:"0 0 10px black",padding:"0.5rem",borderRadius:"0.5rem",boxShadow:"0 0 10px black",background:"rgba(0, 0, 0, 0.5)",zIndex:3,WebkitBackdropFilter:"blur(2rem)",backdropFilter:"blur(2rem)",fontFamily:'"Open Sans", sans-serif',fontWeight:300}]),xs=Z({position:"relative",fontSize:"1rem",color:"black",padding:"0.5rem",borderRadius:"0.5rem",background:"rgba(255, 255, 255, 0.5)",boxShadow:"0 0 10px rgba(255, 255, 255, 0.5)",zIndex:3}),Ss=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",borderRadius:"2px",background:"rgba(0, 0, 0, 0.3)"}),Rs=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center",background:`
79
- linear-gradient(to bottom, transparent 95%, rgba(0, 0, 0, 0.2) 20%) 0 0 / 100% 40px repeat-y,
80
- linear-gradient(to right, transparent 38px, rgba(0, 0, 0, 0.2) 38px) 0 0 / 40px 100% repeat-x transparent
81
- `}),Os=Z({position:"absolute",display:"flex",alignItems:"center",justifyContent:"center",textAlign:"center"}),_t=Z({position:"absolute",color:"white",fontSize:"1.5rem",zIndex:2e3}),As=Z([_t,{top:"50%",right:0}]),Es=Z([_t,{top:"50%",left:0}]),js=Z([_t,{top:0,left:"50%"}]),ks=Z([_t,{bottom:0,left:"50%"}]),Ht={scale:.5,minScale:.1,maxScale:2,blockScale:!1};function Ms(r){const{minimap:e,activeState:t,mode:n}=w.useContext(B),[i,a]=w.useState(r.scale||Ht.scale),{minimapInnerStyle:o,textStyle:l,minimapObjectStyle:s,avatarStyle:c,scaleStyle:h,directionStyle:d,plusMinusStyle:m,imageStyle:v,minimapStyle:p,minimapOuterStyle:y}=r,g=w.useCallback(()=>{const R=r.maxScale||Ht.maxScale;a(k=>Math.min(R,k+.1))},[r.maxScale]),C=w.useCallback(()=>{const R=r.minScale||Ht.minScale;a(k=>Math.max(R,k-.1))},[r.minScale]);return S.jsxs("div",{className:gs,onWheel:R=>{r.blockScale||(R.deltaY<=0?g():C())},style:p,children:[S.jsx("div",{className:ys,style:y}),S.jsxs("div",{className:bs,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(${t.euler.y*180/Math.PI+180}deg)`,...o},children:[S.jsx("div",{className:As,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"E"}),S.jsx("div",{className:Es,style:{transform:r.blockRotate||n.control==="normal"?"translate(50%, -50%) rotate(180deg)":`translate(50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"W"}),S.jsx("div",{className:js,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, 50%) rotate(180deg)":`translate(-50%, 50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"S"}),S.jsx("div",{className:ks,style:{transform:r.blockRotate||n.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${t.euler.y*180/Math.PI+180}deg)`,...d},children:"N"}),Object.values(e.props).map(({center:R,size:k,text:P},_)=>{const D=(R.x-t.position.x)*(r.angle?Math.sin(r.angle):1)*i,V=(R.z-t.position.z)*(r.angle?-Math.cos(r.angle):1)*i;return S.jsxs("div",{children:[S.jsx("div",{className:Ss,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:1+_,...s}}),_===0&&S.jsx("div",{className:Rs,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem) rotate(${Math.PI*3/2+r.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:10+_,...v}}),S.jsx("div",{className:Os,style:{width:`${k.x*i}rem`,height:`${k.z*i}rem`,top:"50.1%",left:"50.1%",transform:`translate(-50.1%, -50.1%) translate(${-D}rem, ${-V}rem)`,transformOrigin:"50.1% 50.1%",zIndex:1001+_},children:P&&S.jsx("div",{className:xs,style:{...l,zIndex:1001+_,transform:r.blockRotate||n.control==="normal"?"rotate(180deg)":`rotate(-${t.euler.y*180/Math.PI+180}deg)`},children:P})})]},_)}),S.jsx("div",{className:ws,style:c})]}),!r.blockScaleControl&&S.jsxs("div",{className:Cs,style:h,children:[S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||C()},children:"+"}),"SCALE 1:",Math.round(100/i),S.jsx("div",{className:un,style:m,onClick:()=>{r.blockScale||g()},children:"-"})]})]})}function Ps(r){}function Gn(){const r=w.useContext(B);return{Teleport:t=>{var n,i,a;r&&(r!=null&&r.refs)&&((n=r==null?void 0:r.refs)!=null&&n.rigidBodyRef)&&((a=(i=r==null?void 0:r.refs)==null?void 0:i.rigidBodyRef)!=null&&a.current)&&r.refs.rigidBodyRef.current.setTranslation(t,!0)}}}const Fs=Z([Ln,{margin:"1rem",fontSize:"0.8rem",background:"rgba(0, 0, 0, 0.6)",boxShadow:"0 0 5px 0 rgba(0, 0, 0, 0.6)",transition:"all 0.2s ease-in",borderRadius:"50%"}]);function _s({text:r,position:e,teleportStyle:t}){const{Teleport:n}=Gn();return S.jsx("div",{className:Fs,onClick:()=>{n(e)},style:t,children:r})}function Ts({children:r,...e}){const t=w.useRef(),[n,i]=w.useState(),a=new L.Vector3;return je.useFrame(o=>{const l=o.camera.position.distanceTo(t.current.getWorldPosition(a))<=10;l!==n&&i(l)}),S.jsx("group",{ref:t,children:S.jsx(Pe.Html,{transform:!0,occlude:!0,...e,children:r})})}function zs(r,e){switch(e.type){case"init":return{...r};case"update":return{...r,...e.payload}}}function Ds(r){const[e,t]=w.useReducer(zs,{activeState:{...ue.activeState,position:r.startPosition||ue.activeState.position},cameraOption:Object.assign(ue.cameraOption,r.cameraOption||{}),mode:Object.assign(ue.mode,r.mode||{}),urls:Object.assign(ue.urls,r.urls||{}),refs:null,states:ue.states,rideable:ue.rideable,minimap:ue.minimap,control:ue.control,clicker:ue.clicker,clickerOption:Object.assign(ue.clickerOption,r.clickerOption||{}),animationState:ue.animationState,block:Object.assign(ue.block,r.block||{}),sizes:ue.sizes});return{gaesupProps:w.useMemo(()=>({value:e,dispatch:t}),[e,e.block,t])}}function Is(r){const{gaesupProps:e}=Ds(r);return S.jsx(B.Provider,{value:e.value,children:S.jsx(pe.Provider,{value:e.dispatch,children:r.children})})}function Ns(){const r=w.useContext(B);return{state:r.activeState,mode:r.mode,urls:r.urls,currentAnimation:r.mode.type?r.animationState[r.mode.type].current:"idle"}}function Us(){const{activeState:r,clicker:e}=w.useContext(B),t=w.useContext(pe);return{move:(i,a)=>{const o=r.position,l=E.vec3(i),s=Math.atan2(l.z-o.z,l.x-o.x);t({type:"update",payload:{clicker:{point:K(i.x,0,i.z),angle:s,isOn:!0,isRun:a}}})}}}const Ls={objectkey:null,objectType:null,isRiderOn:!1,url:null,wheelUrl:null,position:E.vec3(),rotation:E.euler(),offset:E.vec3(),visible:!0};function Ws(){const r=w.useContext(B),{urls:e,states:t,rideable:n,mode:i}=r,a=w.useContext(pe),{getSizesByUrls:o}=bn(),l=p=>{n[p.objectkey]={...Ls,...p}},s=p=>{n[p.objectkey]=p},c=p=>n[p],h=p=>{const{activeState:y,refs:g}=r;t.enableRiding=!1,t.isRiderOn=!1,t.rideableId=null;const C=n[p].objectType,{vehicleUrl:R,airplaneUrl:k,characterUrl:P}=o(e),_=C==="vehicle"?R:k,D=P;n[p].visible=!0,n[p].position.copy(y.position.clone()),g&&g.rigidBodyRef&&g.rigidBodyRef.current.setTranslation(y.position.clone().add(_.clone().add(D.clone()).addScalar(1)),!1),a({type:"update",payload:{rideable:{...n},states:{...t},activeState:{...y}}})},d=async p=>{e.ridingUrl=p.ridingUrl||e.characterUrl||null,p.objectType==="vehicle"?(e.vehicleUrl=p.url,e.wheelUrl=p.wheelUrl||null):p.objectType==="airplane"&&(e.airplaneUrl=p.url),a({type:"update",payload:{urls:{...e}}})},m=async p=>{i.type=p.objectType,t.enableRiding=p.enableRiding,t.isRiderOn=!0,t.rideableId=p.objectkey,n[p.objectkey].visible=!1,a({type:"update",payload:{mode:{...i},states:{...t}}})};return{initRideable:l,setRideable:s,getRideable:c,ride:async(p,y)=>{p.other.rigidBodyObject.name==="character"&&(await d(y),await m(y))},landing:h}}function Gs(){const{cameraOption:r}=w.useContext(B),e=w.useContext(pe);return{zoom:n=>{r.zoom=n,e({type:"update",payload:{cameraOption:r}})}}}exports.Clicker=ka;exports.Elr=Ri;exports.GaeSupProps=ja;exports.GaesupComponent=Sn;exports.GaesupController=Aa;exports.GaesupWorld=Is;exports.GaesupWorldContext=B;exports.GamePad=ps;exports.InnerHtml=Ts;exports.MiniMap=Ms;exports.PassiveAirplane=wa;exports.PassiveCharacter=Ca;exports.PassiveVehicle=xa;exports.Qt=Si;exports.Rideable=Ps;exports.V3=K;exports.V30=Ci;exports.V31=xi;exports.teleport=_s;exports.useClicker=Rn;exports.useGaesupAnimation=ft;exports.useGaesupController=Ns;exports.useMovePoint=Us;exports.usePushKey=On;exports.useRideable=Ws;exports.useTeleport=Gn;exports.useZoom=Gs;
30
+ <%s key={someKey} {...props} />`,we,J,$t,J),Xe[J+we]=!0}}return i===r?zt(D):Ft(D),D}}function It(i,f,b){return Ke(i,f,b,!0)}function Nt(i,f,b){return Ke(i,f,b,!1)}var Gt=Nt,Ut=It;oe.Fragment=r,oe.jsx=Gt,oe.jsxs=Ut}()),oe}process.env.NODE_ENV==="production"?je.exports=Wt():je.exports=Vt();var v=je.exports;function Qe(e,t,n){return Math.sqrt(Math.pow(e.x-t.x,2)+n+Math.pow(e.z-t.z,2))}function _(e,t,n){return new E.Vector3(e,t,n)}function Lt(){return new E.Vector3(0,0,0)}function Yt(){return new E.Vector3(1,1,1)}function Ht(e,t,n,r){return new E.Quaternion(e,t,n,r)}function Xt(e,t,n){return new E.Euler(e,t,n)}function Kt(e){const t=_(0,0,1),n=Math.acos(e.dot(t)/e.length()),r=e.cross(t),a=Math.sin(r.y)||1;return Math.PI-n*a}const G={activeState:{position:_(0,5,5),impulse:R.vec3(),velocity:R.vec3(),acceleration:R.vec3(),quat:R.quat(),euler:R.euler(),rotation:R.euler(),dir:R.vec3(),direction:R.vec3()},mode:{},urls:{characterUrl:null,vehicleUrl:null,airplaneUrl:null,wheelUrl:null,ridingUrl:null},states:{rideableId:null,isMoving:!1,isNotMoving:!1,isOnTheGround:!1,isOnMoving:!1,isRotated:!1,isRunning:!1,isJumping:!1,enableRiding:!1,isRiderOn:!1,isLanding:!1,isFalling:!1,isRiding:!1,isPush:{forward:!1,backward:!1,leftward:!1,rightward:!1}},minimap:{props:{}},clicker:{point:_(0,0,0),angle:Math.PI/2,isOn:!1,isRun:!1},control:{forward:!1,backward:!1,leftward:!1,rightward:!1},refs:null,animationState:{character:{current:"idle",default:"idle",store:{}},vehicle:{current:"idle",default:"idle",store:{}},airplane:{current:"idle",default:"idle",store:{}}},cameraOption:{offset:_(-10,-10,-10),maxDistance:-7,distance:-1,XDistance:20,YDistance:10,ZDistance:20,zoom:1,target:R.vec3(),position:R.vec3(),focus:!1},rideable:{},sizes:{},block:{camera:!1,control:!1,animation:!1,scroll:!0},clickerOption:{isRun:!0,throttle:100,autoStart:!1,track:!1,loop:!1,queue:[],line:!1}},T=d.createContext(null),$=d.createContext(null),Oe=d.forwardRef(({children:e},t)=>v.jsx("group",{ref:t,userData:{intangible:!0},children:e}));function tt(e,t,n={}){const r=new q.Vector3,a=new q.Quaternion,o=new q.Vector3,c=new q.Matrix4,l=new q.Matrix4,s=new q.Matrix4;n.preserveMatrix=n.preserveMatrix!==void 0?n.preserveMatrix:!0,n.preservePosition=n.preservePosition!==void 0?n.preservePosition:!0,n.preserveHipPosition=n.preserveHipPosition!==void 0?n.preserveHipPosition:!1,n.useTargetMatrix=n.useTargetMatrix!==void 0?n.useTargetMatrix:!1,n.hip=n.hip!==void 0?n.hip:"hip",n.names=n.names||{};const y=t.isObject3D?t.skeleton.bones:de(t),u=e.isObject3D?e.skeleton.bones:de(e);let g,m,x,h,p;if(e.isObject3D?e.skeleton.pose():(n.useTargetMatrix=!0,n.preserveMatrix=!1),n.preservePosition){p=[];for(let w=0;w<u.length;w++)p.push(u[w].position.clone())}if(n.preserveMatrix){e.updateMatrixWorld(),e.matrixWorld.identity();for(let w=0;w<e.children.length;++w)e.children[w].updateMatrixWorld(!0)}if(n.offsets){g=[];for(let w=0;w<u.length;++w)m=u[w],x=n.names[m.name]||m.name,n.offsets[x]&&(m.matrix.multiply(n.offsets[x]),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()),g.push(m.matrixWorld.clone())}for(let w=0;w<u.length;++w){if(m=u[w],x=n.names[m.name]||m.name,h=nt(x,y),s.copy(m.matrixWorld),h){if(h.updateMatrixWorld(),n.useTargetMatrix?l.copy(h.matrixWorld):(l.copy(e.matrixWorld).invert(),l.multiply(h.matrixWorld)),o.setFromMatrixScale(l),l.scale(o.set(1/o.x,1/o.y,1/o.z)),s.makeRotationFromQuaternion(a.setFromRotationMatrix(l)),e.isObject3D){const M=u.indexOf(m),S=g?g[M]:c.copy(e.skeleton.boneInverses[M]).invert();s.multiply(S)}s.copyPosition(l)}m.parent&&m.parent.isBone?(m.matrix.copy(m.parent.matrixWorld).invert(),m.matrix.multiply(s)):m.matrix.copy(s),n.preserveHipPosition&&x===n.hip&&m.matrix.setPosition(r.set(0,m.position.y,0)),m.matrix.decompose(m.position,m.quaternion,m.scale),m.updateMatrixWorld()}if(n.preservePosition)for(let w=0;w<u.length;++w)m=u[w],x=n.names[m.name]||m.name,x!==n.hip&&m.position.copy(p[w]);n.preserveMatrix&&e.updateMatrixWorld(!0)}function Jt(e,t,n,r={}){r.useFirstFramePosition=r.useFirstFramePosition!==void 0?r.useFirstFramePosition:!1,r.fps=r.fps!==void 0?r.fps:30,r.names=r.names||[],t.isObject3D||(t=Qt(t));const a=Math.round(n.duration*(r.fps/1e3)*1e3),o=1/r.fps,c=[],l=new q.AnimationMixer(t),s=de(e.skeleton),y=[];let u,g,m,x,h;l.clipAction(n).play(),l.update(0),t.updateMatrixWorld();for(let p=0;p<a;++p){const w=p*o;tt(e,t,r);for(let M=0;M<s.length;++M)h=r.names[s[M].name]||s[M].name,m=nt(h,t.skeleton),m&&(g=s[M],x=y[M]=y[M]||{bone:g},r.hip===h&&(x.pos||(x.pos={times:new Float32Array(a),values:new Float32Array(a*3)}),r.useFirstFramePosition&&(p===0&&(u=g.position.clone()),g.position.sub(u)),x.pos.times[p]=w,g.position.toArray(x.pos.values,p*3)),x.quat||(x.quat={times:new Float32Array(a),values:new Float32Array(a*4)}),x.quat.times[p]=w,g.quaternion.toArray(x.quat.values,p*4));l.update(o),t.updateMatrixWorld()}for(let p=0;p<y.length;++p)x=y[p],x&&(x.pos&&c.push(new q.VectorKeyframeTrack(".bones["+x.bone.name+"].position",x.pos.times,x.pos.values)),c.push(new q.QuaternionKeyframeTrack(".bones["+x.bone.name+"].quaternion",x.quat.times,x.quat.values)));return l.uncacheAction(n),new q.AnimationClip(n.name,-1,c)}function Zt(e){const t=new Map,n=new Map,r=e.clone();return rt(e,r,function(a,o){t.set(o,a),n.set(a,o)}),r.traverse(function(a){if(!a.isSkinnedMesh)return;const o=a,c=t.get(a),l=c.skeleton.bones;o.skeleton=c.skeleton.clone(),o.bindMatrix.copy(c.bindMatrix),o.skeleton.bones=l.map(function(s){return n.get(s)}),o.bind(o.skeleton,o.bindMatrix)}),r}function nt(e,t){for(let n=0,r=de(t);n<r.length;n++)if(e===r[n].name)return r[n]}function de(e){return Array.isArray(e)?e:e.bones}function Qt(e){const t=new q.SkeletonHelper(e.bones[0]);return t.skeleton=e,t}function rt(e,t,n){n(e,t);for(let r=0;r<e.children.length;r++)rt(e.children[r],t.children[r],n)}const it={retarget:tt,retargetClip:Jt,clone:Zt};function se({type:e}){const{animationState:t}=d.useContext(T),n=d.useContext($),r=s=>{const y=t[e].store[s];return y?y.condition()?{name:y.animationName,isValid:!0}:{name:t[e].default,isValid:!1}:{name:t[e].default,isValid:!1}},a=()=>{let s=t[e].default;for(const y of Object.keys(t[e].store)){const u=r(y);if(u.isValid){s=u.name;break}}return t[e].current=s,n({type:"update",payload:{animationState:{...t}}}),s},o=s=>{delete t[e].store[s],n({type:"update",payload:{animationState:{...t}}})};return{subscribe:({tag:s,condition:y,action:u,animationName:g,key:m})=>{t[e].store[s]={condition:y,action:u||(()=>{}),animationName:g||s,key:m||s},n({type:"update",payload:{animationState:{...t}}})},subscribeAll:s=>{const y=[];return s.forEach(u=>{t[e].store[u.tag]={condition:u.condition,action:u.action,animationName:u.animationName,key:u.key},y.push(u.tag)}),n({type:"update",payload:{animationState:{...t}}}),()=>{y.forEach(u=>{delete t[e].store[u]}),n({type:"update",payload:{animationState:{...t}}})}},store:t==null?void 0:t[e].store,unsubscribe:o,notify:a}}function en({type:e}){const{states:t}=d.useContext(T),{subscribeAll:n}=se({type:e});d.useEffect(()=>{n([{tag:"walk",condition:()=>!t.isRunning&&t.isMoving,action:()=>{},animationName:"walk",key:"walk"},{tag:"run",condition:()=>t.isRunning,action:()=>{},animationName:"run",key:"run"},{tag:"jump",condition:()=>t.isJumping,action:()=>{},animationName:"jump",key:"jump"},{tag:"ride",condition:()=>t.isPush.keyR,action:()=>{},animationName:"ride",key:"ride"},{tag:"land",condition:()=>t.isLanding,action:()=>{},animationName:"land",key:"land"},{tag:"fall",condition:()=>t.isFalling,action:()=>{},animationName:"fall",key:"fall"}])},[])}function Se({type:e,actions:t,animationRef:n,currentAnimation:r,isActive:a}){var m,x;const{mode:o,animationState:c,block:l}=d.useContext(T),s=d.useContext($),{notify:y,store:u}=se({type:e});a&&(r=(m=c==null?void 0:c[e])==null?void 0:m.current);const g=h=>{c[e].current=h;const p=u[h];p!=null&&p.action&&p.action(),s({type:"update",payload:{animationState:{...c}}})};return d.useEffect(()=>{var w;let h="idle";l.animation?h="idle":r?h=r:c[e].current&&(h=c[e].current);const p=(w=t[h])==null?void 0:w.reset().fadeIn(.2).play();return()=>{p==null||p.fadeOut(.2)}},[r,o.type,l.animation,e]),H.useFrame(()=>{if(a){const h=y();g(h)}}),{animationRef:n,currentAnimation:(x=c==null?void 0:c[e])==null?void 0:x.current}}const tn=(e,t)=>{const{XDistance:n,YDistance:r,ZDistance:a}=t;return e.position.clone().add(_(n,r,a))};function nn(e){const{state:t,worldContext:{cameraOption:n},controllerOptions:{lerp:r}}=e;!t||!t.camera||(t.camera.position.lerp(n.position.clone(),r.cameraPosition),t.camera.lookAt(n.target))}const rn=(e,t)=>{const{XDistance:n,YDistance:r,ZDistance:a}=t;return e.position.clone().add(_(Math.sin(e.euler.y),1,Math.cos(e.euler.y)).normalize().clone().multiply(_(-n,r,-a)))};function an(e){const{state:t,worldContext:{activeState:n,cameraOption:r},controllerOptions:{lerp:a}}=e;if(!t||!t.camera)return;const o=rn(n,r);t.camera.position.lerp(o.clone(),a.cameraTurn),t.camera.quaternion.copy(n.quat.clone().multiply(R.quat().setFromAxisAngle(_(0,1,0),Math.PI))),t.camera.rotation.copy(n.euler),t.camera.lookAt(n.position.clone())}function on(e){H.useFrame(t=>{e.state=t,e.worldContext.block.camera||(e.worldContext.mode.control==="orbit"?an(e):e.worldContext.mode.control==="normal"&&nn(e))}),H.useFrame(()=>{e.worldContext.cameraOption.focus||(e.worldContext.cameraOption.target=e.worldContext.activeState.position,e.worldContext.cameraOption.position=tn(e.worldContext.activeState,e.worldContext.cameraOption))})}const te={airplane:{angleDelta:_(Math.PI/256,Math.PI/256,Math.PI/256),maxAngle:_(Math.PI/8,Math.PI/8,Math.PI/8),maxSpeed:60,accelRatio:2,brakeRatio:5,buoyancy:.2,linearDamping:1},vehicle:{maxSpeed:60,accelRatio:2,brakeRatio:5,wheelOffset:.1,linearDamping:.5},character:{walkSpeed:10,runSpeed:20,turnSpeed:10,jumpSpeed:1,linearDamping:1},callbacks:{onReady:()=>{},onFrame:()=>{},onDestory:()=>{},onAnimate:()=>{}},refs:{colliderRef:null,rigidBodyRef:null,outerGroupRef:null,innerGroupRef:null,characterInnerRef:null},controllerOptions:{lerp:{cameraTurn:1,cameraPosition:1}}},me=d.createContext({...te}),sn=d.createContext(null);function ln({props:e,actions:t,componentType:n}){const{animationState:r}=d.useContext(T),a=d.useContext($),{store:o}=se({type:n}),{activeState:c,states:l,control:s}=d.useContext(T),{subscribe:y}=se({type:n}),u=(m,x)=>{if(x in s&&s[x]&&r[n]){r[n].current=m;const h=o[m];h!=null&&h.action&&h.action(),a({type:"update",payload:{animationState:{...r}}})}},g={activeState:c,control:s,states:l,subscribe:y};return d.useEffect(()=>(e.onReady&&e.onReady(g),()=>{e.onDestory&&e.onDestory(g)}),[]),H.useFrame(m=>{e.onFrame&&e.onFrame({...g,...m}),e.onAnimate&&e.onAnimate({...g,...m,actions:t,animationState:r,playAnimation:u})}),{subscribe:y,playAnimation:u,dispatch:a}}const at=({url:e})=>{const{sizes:t}=d.useContext(T),n=d.useContext($),r=X.useGLTF(e),{scene:a}=r,o=()=>new E.Box3().setFromObject(a).getSize(new E.Vector3),c=s=>{const y=s||e;return y in t?t[y]:null},l=(s,y)=>{const u=y||e;return u in t||(t[u]=s||o(),n({type:"update",payload:{sizes:{...t}}})),t[u]};return{gltf:r,size:l(),setSize:l,getSize:c}},ot=()=>{const{sizes:e}=d.useContext(T);return{getSizesByUrls:n=>{const r={};return n&&Object.keys(n).forEach(a=>{const o=n[a];o in e?r[a]=e[o]:r[a]=null}),r}}};function cn(e){const{rigidBodyRef:t,controllerContext:{airplane:n}}=e,{linearDamping:r}=n;t.current.setLinearDamping(r)}function un(e){const{innerGroupRef:t,worldContext:{activeState:n,control:r},controllerContext:{airplane:a},matchSizes:o}=e,{forward:c,backward:l,leftward:s,rightward:y,shift:u,space:g}=r,{angleDelta:m,maxAngle:x,accelRatio:h}=a;if(!o||!o.airplaneUrl)return null;let p=0;p=g?Number(u):Number(u)*h;const w=Number(l)-Number(c),M=Number(y)-Number(s),S=_().set(p,p,p);n.euler.y+=-M*m.y;const F=x.x*w,W=x.z*M,U=t.current.rotation.x,V=t.current.rotation.z,L=x.x,Z=x.z,I=t.current.clone();U<-L?I.rotation.x=-L+F:U>L?I.rotation.x=L+F:I.rotateX(F),V<-Z?I.rotation.z=-Z+W:V>Z?I.rotation.z=Z+W:I.rotateZ(W),n.euler.x=I.rotation.x,n.euler.z=I.rotation.z,I.rotation.y=0,t.current.setRotationFromQuaternion(R.quat().setFromEuler(t.current.rotation.clone()).slerp(R.quat().setFromEuler(I.rotation.clone()),.2)),n.rotation=I.rotation,n.direction=S.multiply(_(Math.sin(n.euler.y),-w,Math.cos(n.euler.y))),n.dir=n.direction.normalize()}function fn(e){const{rigidBodyRef:t,worldContext:{activeState:n}}=e;t.current.setGravityScale(n.position.y<10?(1-.1)/-10*n.position.y+1:.1,!1)}function dn(e){const{rigidBodyRef:t,worldContext:{activeState:n},controllerContext:{airplane:r}}=e,{maxSpeed:a}=r,o=t.current.linvel();if(R.vec3(o).length()<a){const l=t.current.mass();t.current.applyImpulse(R.vec3({x:n.direction.x,y:n.direction.y,z:n.direction.z}).multiplyScalar(l),!1)}}function mn(e){const{rigidBodyRef:t,worldContext:{activeState:n},dispatch:r}=e;n.position=R.vec3(t.current.translation()),n.velocity=R.vec3(t.current.linvel());const a=n.euler.clone();a.x=0,a.z=0,t.current.setRotation(R.quat().setFromEuler(a),!0),r({type:"update",payload:{activeState:{...n}}})}function vn(e){const{worldContext:{states:t,rideable:n,mode:r},dispatch:a}=e,{isRiding:o}=t;o&&(n.objectType=null,n.key=null,r.type="character",t.isRiding=!1,t.enableRiding=!1),a({type:"update",payload:{mode:{...r},rideable:{...n}}})}function hn(e){un(e),dn(e),cn(e),fn(e),vn(e),mn(e)}function yn({activeState:e,control:t,mode:n,clicker:r}){const{forward:a,backward:o,leftward:c,rightward:l}=t,s=Number(c)-Number(l),y=Number(a)-Number(o);let u=0;if(n.controller==="clicker")e.euler.y=Math.PI/2-r.angle,u=1;else{if(s===0&&y===0)return;e.euler.y+=s*Math.PI/32,u=y}const g=_(u,0,u);e.direction=g.multiply(_(-Math.sin(e.euler.y),0,-Math.cos(e.euler.y))),e.dir=e.direction.normalize()}function gn({activeState:e,control:t,mode:n,clicker:r}){const{forward:a,backward:o,leftward:c,rightward:l}=t;if(n.controller==="clicker")e.euler.y=Math.PI/2-r.angle,e.dir.set(-Math.sin(e.euler.y),0,-Math.cos(e.euler.y));else{const s=Number(c)-Number(l),y=Number(a)-Number(o);if(s===0&&y===0)return;const u=_(s,0,y),g=Kt(u);e.euler.y=g,e.dir.set(s,0,y)}}function bn(e){const{worldContext:t}=e;t.mode.control==="normal"?gn(t):t.mode.control==="orbit"&&yn(t)}function xn(e){const{rigidBodyRef:t,worldContext:{states:n,activeState:r}}=e,{isMoving:a,isRunning:o}=n,{controllerContext:{character:{walkSpeed:c,runSpeed:l,jumpSpeed:s}}}=e,{isOnTheGround:y,isJumping:u}=n,g=R.vec3();if(u&&y&&g.setY(s*t.current.mass()),a){const m=o?l:c,x=R.vec3().addScalar(m).multiply(r.dir.clone().normalize().negate()),h=t.current.mass(),w=x.clone().sub(r.velocity).multiplyScalar(h);g.setX(w.x),g.setZ(w.z)}t.current.applyImpulse(g,!0),r.position=R.vec3(t.current.translation()),r.velocity=R.vec3(t.current.linvel())}function Rn(e){const{rigidBodyRef:t,innerGroupRef:n,controllerContext:{character:{linearDamping:r}},worldContext:{activeState:a,states:o,block:c},delta:l}=e;o.isJumping||t.current.linvel().y<0?t.current.setLinearDamping(r):t.current.setLinearDamping(o.isNotMoving?r*5:r),t.current.setEnabledRotations(!1,!1,!1,!1),n.current.quaternion.rotateTowards(R.quat().setFromEuler(a.euler),10*l)}function pn(e){var y;const{rigidBodyRef:t,state:n,worldContext:{clicker:r,mode:a,clickerOption:o,block:c}}=e,l=R.vec3((y=t.current)==null?void 0:y.translation());let s=Qe(l,r.point,!1);if(o.autoStart&&o.queue[0]instanceof E.Vector3){r.isOn=!0,s=Qe(l,o.queue[0],!1);const u=R.vec3(o.queue[0]),g=Math.atan2(u.z-l.z,u.x-l.x);r.angle=g}if(s<1&&a.controller==="clicker")if(o.track&&o.queue.length!==0){const u=o.queue.shift();if(u instanceof E.Vector3){r.point=u;const g=R.vec3(r.point),m=Math.atan2(g.z-l.z,g.x-l.x);r.angle=m}else{const{action:g,beforeCB:m,afterCB:x,time:h}=u;g==="stop"&&(n.clock.stop(),m(n),console.log(),setTimeout(()=>{n.clock.start(),x(n)},h))}o.loop&&o.queue.push(u)}else r.isOn=!1,r.isRun=!1}function wn(e){const{worldContext:{control:t,clicker:n,mode:r}}=e,{keyS:a}=t;a&&r.controller==="clicker"&&(n.isOn=!1,n.isRun=!1)}function Cn(e){bn(e),xn(e),Rn(e),wn(e),pn(e)}function jn(e){const{colliderRef:t,groundRay:n,worldContext:{states:r,activeState:a}}=e;if(n.origin.addVectors(a.position,R.vec3(n.offset)),(!n.hit||!n.rayCast||!t.current)&&(r.isOnTheGround=!1),n.hit){const o=n.length*2,c=n.length*.8;n.hit.toi>=o?(r.isFalling=!0,r.isOnTheGround=!1):c<=n.hit.toi&&n.hit.toi<o?r.isFalling=!0:n.hit.toi<c&&(r.isFalling=!1,r.isOnTheGround=!0)}}function On(e){const{worldContext:{states:t,mode:n,control:r,clicker:a,clickerOption:o}}=e,{shift:c,space:l}=r;n.controller==="clicker"&&(t.isMoving=a.isOn,t.isNotMoving=!a.isOn,t.isRunning=(c||a.isRun)&&t.isMoving&&o.isRun,t.isJumping=l)}function Sn(e){const{worldContext:{states:t,control:n}}=e;Object.keys(n).forEach(r=>{t.isPush[r]=n[r]})}function kn(e){const{worldContext:{states:t}}=e,{isRiderOn:n}=t;n&&t.isPush.keyR&&(t.isRiding=!0)}function Mn(e){const{outerGroupRef:t,worldContext:{states:n,activeState:r}}=e;n.isMoving&&t&&t.current&&(n.isRotated=Math.sin(t.current.rotation.y).toFixed(3)===Math.sin(r.euler.y).toFixed(3))}function Pn(e){jn(e),On(e),Mn(e),Sn(e),kn(e)}function En(e){const{rigidBodyRef:t,worldContext:{control:n},controllerContext:{vehicle:r}}=e,{space:a}=n,{brakeRatio:o,linearDamping:c}=r;t.current.setLinearDamping(a?o:c)}function Tn(e){const{worldContext:{activeState:t,control:n}}=e,{forward:r,backward:a,leftward:o,rightward:c}=n,l=Number(o)-Number(c),s=Number(r)-Number(a),y=R.vec3().set(s,0,s);return t.euler.y+=l*(Math.PI/64),y}function _n(e){const{worldContext:{mode:t,activeState:n}}=e,r=R.vec3();r.copy(Tn(e)),n.direction=r.multiply(_(Math.sin(n.euler.y),0,Math.cos(n.euler.y))),n.dir=n.direction.normalize()}function An(e){const{rigidBodyRef:t,worldContext:{activeState:n,control:r},controllerContext:{vehicle:a}}=e,{shift:o}=r,{maxSpeed:c,accelRatio:l}=a,s=t.current.linvel();if(R.vec3(s).length()<c){const u=t.current.mass();let g=o?l:1;t.current.applyImpulse(R.vec3().addScalar(g).multiply(n.dir.clone().normalize()).multiplyScalar(u),!1)}}function Dn(e){const{rigidBodyRef:t,worldContext:{activeState:n}}=e;n.position=R.vec3(t.current.translation()),n.velocity=R.vec3(t.current.linvel()),t.current.setRotation(R.quat().setFromEuler(n.euler.clone()),!1)}function Fn(e){const{worldContext:{states:t,rideable:n,mode:r},dispatch:a}=e,{isRiding:o}=t;o&&(n.objectType=null,n.key=null,r.type="character",t.isRiding=!1,t.enableRiding=!1),a({type:"update",payload:{mode:{...r},rideable:{...n}}})}function zn(e){_n(e),An(e),En(e),Fn(e),Dn(e)}function In({groundRay:e,rigidBodyRef:t,outerGroupRef:n,innerGroupRef:r,colliderRef:a}){const o=d.useContext(T),c=d.useContext(me),l=d.useContext($),{mode:s,activeState:y,block:u}=o,{getSizesByUrls:g}=ot();d.useEffect(()=>{!t||!r||t.current&&r.current&&(t.current.lockRotations(!1,!0),y.euler.set(0,0,0),t.current.setTranslation(y.position.clone().add(_(0,5,0)),!0))},[s.type]),d.useEffect(()=>{t&&t.current&&u.control&&(t.current.resetForces(!1),t.current.resetTorques(!1))},[u.control,t.current]),H.useFrame((m,x)=>{if(!t||!t.current||!n||!n.current||!r||!r.current||u.control)return null;const h={rigidBodyRef:t,outerGroupRef:n,innerGroupRef:r,colliderRef:a,groundRay:e,state:m,delta:x,worldContext:o,controllerContext:c,dispatch:l,matchSizes:g(o==null?void 0:o.urls)};s.type==="vehicle"?zn(h):s.type==="character"?Cn(h):s.type==="airplane"&&hn(h),Pn(h)})}function Nn({url:e,children:t,offset:n,currentAnimation:r}){const{gltf:a}=at({url:e}),{animations:o,scene:c}=a,{actions:l,ref:s}=X.useAnimations(o),y=d.useMemo(()=>it.clone(c),[c]),{nodes:u}=H.useGraph(y),g=Object.values(u).find(m=>m.type==="Object3D");return Se({type:"character",currentAnimation:r||"ride",actions:l,animationRef:s,isActive:!1}),v.jsx(v.Fragment,{children:v.jsxs("group",{position:n,children:[g&&v.jsx("primitive",{object:g,visible:!1,receiveShadow:!0,castShadow:!0,ref:s}),Object.keys(u).map((m,x)=>{const h=u[m];if(h instanceof E.SkinnedMesh)return v.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:h.material,geometry:h.geometry,skeleton:h.skeleton},x);if(h instanceof E.Mesh)return v.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:h.material,geometry:h.geometry},x)}),t]})})}const Gn=d.forwardRef((e,t)=>v.jsxs("group",{receiveShadow:!0,castShadow:!0,ref:t,userData:{intangible:!0},children:[e.isRiderOn&&e.enableRiding&&e.isActive&&e.ridingUrl&&v.jsx(Nn,{url:e.ridingUrl,offset:e.offset}),e.children,e.objectNode&&e.animationRef&&v.jsx("primitive",{object:e.objectNode,visible:!1,receiveShadow:!0,castShadow:!0,ref:e.animationRef}),Object.keys(e.nodes).map((n,r)=>{const a=e.nodes[n];if(a instanceof E.SkinnedMesh)return v.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,material:a.material,geometry:a.geometry,skeleton:a.skeleton},r);if(a instanceof E.Mesh)return v.jsx("mesh",{castShadow:!0,receiveShadow:!0,material:a.material,geometry:a.geometry},r)})]})),Un=({url:e,isActive:t,componentType:n,currentAnimation:r,color:a,skeleton:o})=>{const{scene:c,animations:l}=X.useGLTF(e),{actions:s,ref:y}=X.useAnimations(l),u=d.useMemo(()=>{const g=[];return c.traverse(m=>{if(m instanceof E.SkinnedMesh){const x=m.clone();x.skeleton=o,x.bind(o,x.bindMatrix),g.push(x)}}),g},[c,o]);return Se({type:n,actions:s,animationRef:y,currentAnimation:t?void 0:r,isActive:t}),v.jsx(v.Fragment,{children:u.map((g,m)=>v.jsx("skinnedMesh",{castShadow:!0,receiveShadow:!0,geometry:g.geometry,skeleton:o,material:g.name==="color"&&a?new E.MeshStandardMaterial({color:a}):g.material},m))})};function $n(){const e=R.useRapier();return d.useCallback(({ray:n,ref:r})=>e.world.castRay(n.rayCast,n.length,!0,void 0,void 0,r.current,void 0),[e])}function Bn(){const{rapier:e}=R.useRapier(),t=$n();return({groundRay:r,length:a,colliderRef:o})=>{var c;r.length=a,r.rayCast=new e.Ray(r.origin,r.dir),r.hit=t({ray:r,ref:o}),r.parent=(c=r.hit)==null?void 0:c.collider.parent()}}const ke=d.forwardRef((e,t)=>{var h;const{size:n}=at({url:e.url}),r=Bn();d.useEffect(()=>{e.groundRay&&e.colliderRef&&r({groundRay:e.groundRay,length:.5,colliderRef:e.colliderRef})},[e.groundRay,e.colliderRef,r]);const{scene:a,animations:o}=X.useGLTF(e.url),{actions:c,ref:l}=X.useAnimations(o),s=d.useContext(T),y=d.useContext(me),u=d.useMemo(()=>it.clone(a),[a]),g=d.useMemo(()=>{let p=null;return u.traverse(w=>{w instanceof E.SkinnedMesh&&(p=w.skeleton)}),p},[u]);if(e.isActive){en({type:e.componentType,groundRay:e.groundRay,animations:o});const p={state:null,worldContext:s,controllerContext:y,controllerOptions:e.controllerOptions};on(p),In({outerGroupRef:e.outerGroupRef,innerGroupRef:e.innerGroupRef,rigidBodyRef:t,colliderRef:e.colliderRef,groundRay:e.groundRay})}Se({type:e.componentType,actions:c,animationRef:l,currentAnimation:e.isActive?void 0:e.currentAnimation,isActive:e.isActive}),ln({props:e,actions:c,componentType:e.componentType});const{nodes:m}=H.useGraph(u),x=Object.values(m).find(p=>p.type==="Object3D");return H.useFrame(()=>{e.isActive||!e.position||!t||!t.current||t.current.setTranslation(_(E.MathUtils.lerp(t.current.translation().x,e.position.x,e.controllerOptions.lerp.cameraPosition),E.MathUtils.lerp(t.current.translation().y,e.position.y,e.controllerOptions.lerp.cameraPosition),E.MathUtils.lerp(t.current.translation().z,e.position.z,e.controllerOptions.lerp.cameraPosition)),!1)}),v.jsxs(R.RigidBody,{colliders:!1,ref:t,name:e.name,rotation:R.euler().set(0,((h=e.rotation)==null?void 0:h.clone().y)||0,0).clone(),userData:e.userData,type:e.rigidbodyType||(e.isActive?"dynamic":"fixed"),sensor:e.sensor,onIntersectionEnter:e.onIntersectionEnter,onCollisionEnter:e.onCollisionEnter,...e.rigidBodyProps,children:[!e.isNotColliding&&v.jsx(R.CapsuleCollider,{ref:e.colliderRef,args:[(n.y/2-n.x)*1.2,n.x*1.2],position:[0,(n.y/2+n.x/2)*1.2,0]}),v.jsxs(Gn,{objectNode:x,animationRef:l,nodes:m,ref:e.innerGroupRef,isActive:e.isActive,isRiderOn:e.isRiderOn,enableRiding:e.enableRiding,ridingUrl:e.ridingUrl,offset:e.offset,parts:e.parts,children:[e.children,e.parts&&e.parts.length>0&&e.parts.map(({url:p,color:w},M)=>p?v.jsx(Un,{url:p,isActive:e.isActive,componentType:e.componentType,currentAnimation:e.currentAnimation,color:w,skeleton:g},M+p):null)]})]})});function st(e){const{rigidBodyRef:t,outerGroupRef:n}=e;return v.jsx(Oe,{ref:n,children:v.jsx(ke,{ref:t,name:e.name,componentType:"airplane",ridingUrl:e.ridingUrl,...e,children:e.children})})}function qn(e){return v.jsx(st,{name:"airplane",isActive:!0,currentAnimation:"idle",componentType:"airplane",ridingUrl:e.ridingUrl,...e,children:e.children})}function lt(e){const{outerGroupRef:t}=e;return v.jsx(Oe,{ref:t,children:v.jsx(ke,{name:"character",url:e.url,controllerOptions:e.controllerOptions,ref:e.rigidBodyRef,groundRay:e.groundRay,isNotColliding:e.isNotColliding,...e,children:e.children})})}function Wn({children:e,props:t,refs:n,urls:r}){return v.jsx(lt,{url:r.characterUrl,isActive:!0,componentType:"character",rigidbodyType:"dynamic",controllerOptions:t.controllerOptions,groundRay:t.groundRay,onAnimate:t.onAnimate,onFrame:t.onFrame,onReady:t.onReady,onDestory:t.onDestory,rigidBodyProps:t.rigidBodyProps,parts:t.parts,...n,children:e})}function ct(e){const{rigidBodyRef:t,outerGroupRef:n}=e;return v.jsx(Oe,{ref:n,children:v.jsx(ke,{ref:t,name:e.name,componentType:"vehicle",ridingUrl:e.ridingUrl,...e,children:e.children})})}function Vn(e){return v.jsx(ct,{name:"vehicle",isActive:!0,currentAnimation:"idle",componentType:"vehicle",ridingUrl:e.ridingUrl,...e,children:e.children})}function ut({props:e,refs:t}){const{mode:n,states:r,rideable:a,urls:o}=d.useContext(T),{enableRiding:c,isRiderOn:l,rideableId:s}=r;return v.jsxs(v.Fragment,{children:[n.type==="character"&&v.jsx(Wn,{props:e,refs:t,urls:o,children:e.children}),n.type==="vehicle"&&v.jsx(Vn,{controllerOptions:e.controllerOptions,url:o.vehicleUrl,wheelUrl:o.wheelUrl,ridingUrl:o.ridingUrl,enableRiding:c,isRiderOn:l,groundRay:e.groundRay,offset:s&&a[s]?a[s].offset:R.vec3(),...t,children:e.children}),n.type==="airplane"&&v.jsx(qn,{controllerOptions:e.controllerOptions,url:o.airplaneUrl,ridingUrl:o.ridingUrl,enableRiding:c,isRiderOn:l,groundRay:e.groundRay,offset:s&&a[s]?a[s].offset:R.vec3(),...t,children:e.children})]})}function Ln(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(null),a=d.useRef(null),o={rigidBodyRef:t,outerGroupRef:n,innerGroupRef:r,colliderRef:a};return H.useFrame(()=>{if(r&&r.current){const c=e.rotation.clone();c.y=0,r.current.setRotationFromQuaternion(R.quat().setFromEuler(r.current.rotation.clone()).slerp(R.quat().setFromEuler(c),.2))}t&&t.current&&t.current.setGravityScale(e.position.y<10?(1-.1)/-10*e.position.y+1:.1,!1)}),v.jsx(st,{isActive:!1,componentType:"airplane",name:"airplane",controllerOptions:e.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:e.position,rotation:e.rotation,currentAnimation:e.currentAnimation,ridingUrl:e.ridingUrl,...e,...o,children:e.children})}function Yn(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(null),a=d.useRef(null),o={rigidBodyRef:t,outerGroupRef:n,innerGroupRef:r,colliderRef:a};return d.useEffect(()=>{t&&t.current&&t.current.setEnabledRotations(!1,!1,!1,!1)},[]),v.jsx(lt,{isActive:!1,componentType:"character",controllerOptions:e.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:e.position,rotation:e.rotation,groundRay:e.groundRay,currentAnimation:e.currentAnimation,...o,...e,children:e.children})}function Hn(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(null),a=d.useRef(null),o={rigidBodyRef:t,outerGroupRef:n,innerGroupRef:r,colliderRef:a};return v.jsx(ct,{isActive:!1,componentType:"vehicle",name:"vehicle",controllerOptions:e.controllerOptions||{lerp:{cameraTurn:1,cameraPosition:1}},position:e.position,rotation:e.rotation,currentAnimation:e.currentAnimation,url:e.url,ridingUrl:e.ridingUrl,...e,...o,children:e.children})}function Xn(e,t){switch(t.type){case"init":return{...e};case"update":return{...e,...t.payload}}}const Kn=(e,t)=>{t({type:"update",payload:e})};function Jn(e){const t=d.useContext(T),n=d.useContext($);d.useEffect(()=>{if(t&&t.control){let c={};t.mode.controller==="clicker"?t.mode.isButton&&(c={...t.control}):c={...t.control},n({type:"update",payload:{control:{...c}}})}},[t==null?void 0:t.mode.controller,t==null?void 0:t.control]);const r=d.useMemo(()=>({origin:R.vec3(),dir:R.vec3({x:0,y:-1,z:0}),offset:R.vec3({x:0,y:-1,z:0}),hit:null,parent:null,rayCast:null,length:10}),[]),a=d.useMemo(()=>({origin:R.vec3(),hit:new E.Raycaster,rayCast:new E.Raycaster(R.vec3(),R.vec3(),0,-7),dir:R.vec3(),position:R.vec3(),length:-t.cameraOption.maxDistance,detected:[],intersects:[],intersectObjectMap:{}}),[]),o=d.useCallback(c=>{Kn({refs:{...c}},n)},[e.refs]);return d.useEffect(()=>{e.refs&&o(e.refs)},[]),{groundRay:r,cameraRay:a}}function Zn(e){return v.jsx(v.Fragment,{children:v.jsx(Qn,{...e,children:e.children})})}function Qn(e){const t=d.useRef(null),n=d.useRef(null),r=d.useRef(null),a=d.useRef(null),o=d.useRef(null),c=d.useRef(null),[l,s]=d.useReducer(Xn,{airplane:Object.assign(te.airplane,e.airplane||{}),vehicle:Object.assign(te.vehicle,e.vehicle||{}),character:Object.assign(te.character,e.character||{}),callbacks:Object.assign(te.callbacks,{onReady:e.onReady,onFrame:e.onFrame,onDestory:e.onDestory,onAnimate:e.onAnimate}),refs:{colliderRef:t,rigidBodyRef:n,outerGroupRef:r,innerGroupRef:a,characterInnerRef:o},controllerOptions:Object.assign(te.controllerOptions,e.controllerOptions||{})}),y=d.useMemo(()=>({value:l,dispatch:s}),[]),u=d.useMemo(()=>({colliderRef:t,rigidBodyRef:n,outerGroupRef:r,innerGroupRef:a,characterInnerRef:o,passiveRigidBodyRef:c}),[]),g={...Jn({refs:u}),children:e.children,groupProps:e.groupProps,rigidBodyProps:e.rigidBodyProps,controllerOptions:y.value.controllerOptions,parts:e.parts,...y.value.callbacks,...u},m=X.useContextBridge(T,me);return v.jsx(m,{children:v.jsx(me.Provider,{value:y.value,children:v.jsx(sn.Provider,{value:y.dispatch,children:v.jsx(ut,{props:g,refs:u})})})})}function ft(){const{activeState:e,mode:t}=d.useContext(T),n=d.useContext($);return{moveClicker:(a,o,c)=>{if(t.controller!=="clicker"||c!=="ground")return;const l=e.position,s=_(a.point.x,a.point.y,a.point.z),y=Math.atan2(s.z-l.z,s.x-l.x);n({type:"update",payload:{clicker:{point:_(s.x,0,s.z),angle:y,isOn:!0,isRun:o}}})}}}function er({type:e="normal",text:t,position:n,children:r}){const a=d.useRef(null),{minimap:o,activeState:c,clickerOption:l}=d.useContext(T),s=d.useContext($),{moveClicker:y}=ft();return d.useEffect(()=>{if(a.current){const u=new E.Box3().setFromObject(a.current),g=R.vec3(u.getSize(new E.Vector3)).clone(),m=R.vec3(u.getCenter(new E.Vector3)).clone(),x={type:e||"normal",text:t,size:g,center:m};o.props[t]=x,s({type:"update",payload:{minimap:{...o}}})}},[]),v.jsx("group",{ref:a,position:n,onPointerDown:u=>{u.srcElement instanceof HTMLDivElement||y(u,!1,e)},children:r})}function tr({onMarker:e,runMarker:t}){const{clicker:n,mode:r,clickerOption:a}=d.useContext(T),o=[];for(let c=0;c<a.queue.length;c++)a.queue[c]instanceof E.Vector3&&o.push(a.queue[c]);return v.jsxs(v.Fragment,{children:[r.controller==="clicker"&&v.jsxs("group",{position:n.point,children:[n.isOn&&e,n.isOn&&a.isRun&&n.isRun&&t]}),a.line&&o.map((c,l)=>{if(c instanceof E.Vector3){const s=l,y=l===0?o.length-1:l-1;return v.jsxs("group",{position:[0,1,0],children:[v.jsx(X.Line,{worldUnits:!0,points:[o[y],o[s]],color:"turquoise",transparent:!0,opacity:.5,lineWidth:.4}),v.jsxs("mesh",{position:c,children:[v.jsx("sphereGeometry",{args:[.6,30,.6]}),v.jsx("meshStandardMaterial",{color:"turquoise",transparent:!0,opacity:.8})]},l)]},l)}})]})}function dt(){const{control:e}=d.useContext(T),t=d.useContext($);return{pushKey:(r,a)=>{e[r]=a,t({type:"update",payload:{control:{...e}}})}}}var nr="_14e7l20",rr="_14e7l21 _14ssv4f1 _14ssv4f0",ir="_14e7l22";function ar({value:e,name:t,gamePadButtonStyle:n}){const[r,a]=d.useState(!1),{pushKey:o}=dt(),c=()=>{o(e,!0),a(!0)},l=()=>{o(e,!1),a(!1)};return v.jsx("button",{className:`${rr} ${r?ir:""}`,onMouseDown:c,onMouseUp:l,onMouseLeave:l,onContextMenu:s=>{s.preventDefault(),l()},onPointerDown:c,onPointerUp:l,style:n,children:t})}function or(e){const{gamePadStyle:t,gamePadButtonStyle:n,label:r}=e,{control:a,mode:o}=d.useContext(T),c=Object.keys(a).map(l=>{const s=(r==null?void 0:r[l])||l;if(l!=="forward"&&l!=="backward"&&l!=="leftward"&&l!=="rightward")return{tag:l,value:l,name:s}}).filter(l=>l!==void 0).filter(l=>l.tag!=="run");return v.jsx(v.Fragment,{children:o.controller==="clicker"&&v.jsx("div",{className:nr,style:t,children:c.map((l,s)=>v.jsx(ar,{value:l.value,name:l.name,gamePadButtonStyle:n},s))})})}var sr="_13wajz71",lr="_13wajz72 _14ssv4f0",cr="_13wajz73",ur="_13wajz74",et="_13wajz75",fr="_13wajz76",dr="_13wajz77",mr="_13wajz78",vr="_13wajz79",hr="_13wajz7a",yr="_13wajz7c _13wajz7b",gr="_13wajz7d _13wajz7b",br="_13wajz7e _13wajz7b",xr="_13wajz7f _13wajz7b";const Ce={scale:.5,minScale:.1,maxScale:2,blockScale:!1};function Rr(e){const{minimap:t,activeState:n,mode:r}=d.useContext(T),[a,o]=d.useState(e.scale||Ce.scale),{minimapInnerStyle:c,textStyle:l,minimapObjectStyle:s,avatarStyle:y,scaleStyle:u,directionStyle:g,plusMinusStyle:m,imageStyle:x,minimapStyle:h,minimapOuterStyle:p}=e,w=d.useCallback(()=>{const S=e.maxScale||Ce.maxScale;o(F=>Math.min(S,F+.1))},[e.maxScale]),M=d.useCallback(()=>{const S=e.minScale||Ce.minScale;o(F=>Math.max(S,F-.1))},[e.minScale]);return v.jsxs("div",{className:sr,onWheel:S=>{e.blockScale||(S.deltaY<=0?w():M())},style:h,children:[v.jsx("div",{className:lr,style:p}),v.jsxs("div",{className:cr,style:{transform:e.blockRotate||r.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(${n.euler.y*180/Math.PI+180}deg)`,...c},children:[v.jsx("div",{className:yr,style:{transform:e.blockRotate||r.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${n.euler.y*180/Math.PI+180}deg)`,...g},children:"E"}),v.jsx("div",{className:gr,style:{transform:e.blockRotate||r.control==="normal"?"translate(50%, -50%) rotate(180deg)":`translate(50%, -50%) rotate(-${n.euler.y*180/Math.PI+180}deg)`,...g},children:"W"}),v.jsx("div",{className:br,style:{transform:e.blockRotate||r.control==="normal"?"translate(-50%, 50%) rotate(180deg)":`translate(-50%, 50%) rotate(-${n.euler.y*180/Math.PI+180}deg)`,...g},children:"S"}),v.jsx("div",{className:xr,style:{transform:e.blockRotate||r.control==="normal"?"translate(-50%, -50%) rotate(180deg)":`translate(-50%, -50%) rotate(-${n.euler.y*180/Math.PI+180}deg)`,...g},children:"N"}),Object.values(t.props).map(({center:S,size:F,text:W},U)=>{const V=(S.x-n.position.x)*(e.angle?Math.sin(e.angle):1)*a,L=(S.z-n.position.z)*(e.angle?-Math.cos(e.angle):1)*a;return v.jsxs("div",{children:[v.jsx("div",{className:mr,style:{width:`${F.x*a}rem`,height:`${F.z*a}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-V}rem, ${-L}rem) rotate(${Math.PI*3/2+e.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:1+U,...s}}),U===0&&v.jsx("div",{className:vr,style:{width:`${F.x*a}rem`,height:`${F.z*a}rem`,top:"50%",left:"50%",transform:`translate(-50.1%, -50.1%) translate(${-V}rem, ${-L}rem) rotate(${Math.PI*3/2+e.angle||0}rad)`,transformOrigin:"50% 50%",zIndex:10+U,...x}}),v.jsx("div",{className:hr,style:{width:`${F.x*a}rem`,height:`${F.z*a}rem`,top:"50.1%",left:"50.1%",transform:`translate(-50.1%, -50.1%) translate(${-V}rem, ${-L}rem)`,transformOrigin:"50.1% 50.1%",zIndex:1001+U},children:W&&v.jsx("div",{className:dr,style:{...l,zIndex:1001+U,transform:e.blockRotate||r.control==="normal"?"rotate(180deg)":`rotate(-${n.euler.y*180/Math.PI+180}deg)`},children:W})})]},U)}),v.jsx("div",{className:ur,style:y})]}),!e.blockScaleControl&&v.jsxs("div",{className:fr,style:u,children:[v.jsx("div",{className:et,style:m,onClick:()=>{e.blockScale||M()},children:"+"}),"SCALE 1:",Math.round(100/a),v.jsx("div",{className:et,style:m,onClick:()=>{e.blockScale||w()},children:"-"})]})]})}function pr(e){}function mt(){const e=d.useContext(T);return{Teleport:n=>{var r,a,o;e&&(e!=null&&e.refs)&&((r=e==null?void 0:e.refs)!=null&&r.rigidBodyRef)&&((o=(a=e==null?void 0:e.refs)==null?void 0:a.rigidBodyRef)!=null&&o.current)&&e.refs.rigidBodyRef.current.setTranslation(n,!0)}}}var wr="qzizxb0 _14ssv4f1 _14ssv4f0";function Cr({text:e,position:t,teleportStyle:n}){const{Teleport:r}=mt();return v.jsx("div",{className:wr,onClick:()=>{r(t)},style:n,children:e})}function jr({children:e,...t}){const n=d.useRef(),[r,a]=d.useState(),o=new E.Vector3;return H.useFrame(c=>{const l=c.camera.position.distanceTo(n.current.getWorldPosition(o))<=10;l!==r&&a(l)}),v.jsx("group",{ref:n,children:v.jsx(X.Html,{transform:!0,occlude:!0,...t,children:e})})}function Or(e,t){switch(t.type){case"init":return{...e};case"update":return{...e,...t.payload}}}function Sr(e){const[t,n]=d.useReducer(Or,{activeState:{...G.activeState,position:e.startPosition||G.activeState.position},cameraOption:Object.assign(G.cameraOption,e.cameraOption||{}),mode:Object.assign(G.mode,e.mode||{}),urls:Object.assign(G.urls,e.urls||{}),refs:null,states:G.states,rideable:G.rideable,minimap:G.minimap,control:G.control,clicker:G.clicker,clickerOption:Object.assign(G.clickerOption,e.clickerOption||{}),animationState:G.animationState,block:Object.assign(G.block,e.block||{}),sizes:G.sizes});return{gaesupProps:d.useMemo(()=>({value:t,dispatch:n}),[t,t.block,n])}}function kr(e){const{gaesupProps:t}=Sr(e);return v.jsx(T.Provider,{value:t.value,children:v.jsx($.Provider,{value:t.dispatch,children:e.children})})}function Mr(){const e=d.useContext(T);return{state:e.activeState,mode:e.mode,urls:e.urls,currentAnimation:e.mode.type?e.animationState[e.mode.type].current:"idle"}}function Pr(){const{activeState:e,clicker:t}=d.useContext(T),n=d.useContext($);return{move:(a,o)=>{const c=e.position,l=R.vec3(a),s=Math.atan2(l.z-c.z,l.x-c.x);n({type:"update",payload:{clicker:{point:_(a.x,0,a.z),angle:s,isOn:!0,isRun:o}}})}}}const Er={objectkey:null,objectType:null,isRiderOn:!1,url:null,wheelUrl:null,position:R.vec3(),rotation:R.euler(),offset:R.vec3(),visible:!0};function Tr(){const e=d.useContext(T),{urls:t,states:n,rideable:r,mode:a}=e,o=d.useContext($),{getSizesByUrls:c}=ot(),l=h=>{r[h.objectkey]={...Er,...h}},s=h=>{r[h.objectkey]=h},y=h=>r[h],u=h=>{const{activeState:p,refs:w}=e;n.enableRiding=!1,n.isRiderOn=!1,n.rideableId=null;const M=r[h].objectType,{vehicleUrl:S,airplaneUrl:F,characterUrl:W}=c(t),U=M==="vehicle"?S:F,V=W;r[h].visible=!0,r[h].position.copy(p.position.clone()),w&&w.rigidBodyRef&&w.rigidBodyRef.current.setTranslation(p.position.clone().add(U.clone().add(V.clone()).addScalar(1)),!1),o({type:"update",payload:{rideable:{...r},states:{...n},activeState:{...p}}})},g=async h=>{t.ridingUrl=h.ridingUrl||t.characterUrl||null,h.objectType==="vehicle"?(t.vehicleUrl=h.url,t.wheelUrl=h.wheelUrl||null):h.objectType==="airplane"&&(t.airplaneUrl=h.url),o({type:"update",payload:{urls:{...t}}})},m=async h=>{a.type=h.objectType,n.enableRiding=h.enableRiding,n.isRiderOn=!0,n.rideableId=h.objectkey,r[h.objectkey].visible=!1,o({type:"update",payload:{mode:{...a},states:{...n}}})};return{initRideable:l,setRideable:s,getRideable:y,ride:async(h,p)=>{h.other.rigidBodyObject.name==="character"&&(await g(p),await m(p))},landing:u}}function _r(){const{cameraOption:e}=d.useContext(T),t=d.useContext($);return{zoom:r=>{e.zoom=r,t({type:"update",payload:{cameraOption:e}})}}}exports.Clicker=tr;exports.Elr=Xt;exports.GaeSupProps=er;exports.GaesupComponent=ut;exports.GaesupController=Zn;exports.GaesupWorld=kr;exports.GaesupWorldContext=T;exports.GamePad=or;exports.InnerHtml=jr;exports.MiniMap=Rr;exports.PassiveAirplane=Ln;exports.PassiveCharacter=Yn;exports.PassiveVehicle=Hn;exports.Qt=Ht;exports.Rideable=pr;exports.V3=_;exports.V30=Lt;exports.V31=Yt;exports.teleport=Cr;exports.useClicker=ft;exports.useGaesupAnimation=se;exports.useGaesupController=Mr;exports.useMovePoint=Pr;exports.usePushKey=dt;exports.useRideable=Tr;exports.useTeleport=mt;exports.useZoom=_r;