PageSourceSearch

https://eclipse-protocol-server.onrender.com/assets/index-BAOUnqg5.js

js eclipse-protocol-server.onrender.com collected 2026-10-04 11:40:21 UTC 1,596,418 bytes, 4,501 lines download raw bytes

vendor: 1,137 bytes, line 1
1(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))n(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const l of a.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&n(l)}).observe(document,{childList:!0,subtree:!0});function t(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function n(s){if(s.ep)return;s.ep=!0;const a=t(s);fetch(s.href,a)}})();function mA(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}function gA(i){if(Object.prototype.hasOwnProperty.call(i,"__esModule"))return i;var e=i.default;if(typeof e=="function"){var t=function n(){return this instanceof n?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};t.prototype=e.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}
vendor: 9,073 bytes, lines 1-17
1),Object.keys(i).forEach(function(n){var s=Object.getOwnPropertyDescriptor(i,n);Object.defineProperty(t,n,s.get?s:{enumerable:!0,get:function(){return i[n]}})}),t}var qb={exports:{}},s0={};/**
2 * @license React
3 * react-jsx-runtime.production.js
4 *
5 * Copyright (c) Meta Platforms, Inc. and affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var rE;function LD(){if(rE)return s0;rE=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(n,s,a){var l=null;if(a!==void 0&&(l=""+a),s.key!==void 0&&(l=""+s.key),"key"in s){a={};for(var u in s)u!=="key"&&(a[u]=s[u])}else a=s;return s=a.ref,{$$typeof:i,type:n,key:l,ref:s!==void 0?s:null,props:a}}return s0.Fragment=e,s0.jsx=t,s0.jsxs=t,s0}var aE;function PD(){return aE||(aE=1,qb.exports=LD()),qb.exports}var b=PD(),Yb={exports:{}},Sn={};/**
10 * @license React
11 * react.production.js
12 *
13 * Copyright (c) Meta Platforms, Inc. and affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var oE;function OD(){if(oE)return Sn;oE=1;var i=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),n=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),m=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),x=Symbol.iterator;function _(K){return K===null||typeof K!="object"?null:(K=x&&K[x]||K["@@iterator"],typeof K=="function"?K:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},R=Object.assign,w={};function E(K,ce,re){this.props=K,this.context=ce,this.refs=w,this.updater=re||A}E.prototype.isReactComponent={},E.prototype.setState=function(K,ce){if(typeof K!="object"&&typeof K!="function"&&K!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,K,ce,"setState")},E.prototype.forceUpdate=function(K){this.updater.enqueueForceUpdate(this,K,"forceUpdate")};function D(){}D.prototype=E.prototype;function L(K,ce,re){this.props=K,this.context=ce,this.refs=w,this.updater=re||A}var P=L.prototype=new D;P.constructor=L,R(P,E.prototype),P.isPureReactComponent=!0;var G=Array.isArray;function H(){}var F={H:null,A:null,T:null,S:null},X=Object.prototype.hasOwnProperty;function z(K,ce,re){var oe=re.ref;return{$$typeof:i,type:K,key:ce,ref:oe!==void 0?oe:null,props:re}}function k(K,ce){return z(K.type,ce,K.props)}function ie(K){return typeof K=="object"&&K!==null&&K.$$typeof===i}function ve(K){var ce={"=":"=0",":":"=2"};return"$"+K.replace(/[=:]/g,function(re){return ce[re]})}var J=/\/+/g;function le(K,ce){return typeof K=="object"&&K!==null&&K.key!=null?ve(""+K.key):ce.toString(36)}function ae(K){switch(K.status){case"fulfilled":return K.value;case"rejected":throw K.reason;default:switch(typeof K.status=="string"?K.then(H,H):(K.status="pending",K.then(function(ce){K.status==="pending"&&(K.status="fulfilled",K.value=ce)},function(ce){K.status==="pending"&&(K.status="rejected",K.reason=ce)})),K.status){case"fulfilled":return K.value;case"rejected":throw K.reason}}throw K}function W(K,ce,re,oe,we){var Be=typeof K;(Be==="undefined"||Be==="boolean")&&(K=null);var pe=!1;if(K===null)pe=!0;else switch(Be){case"bigint":case"string":case"number":pe=!0;break;case"object":switch(K.$$typeof){case i:case e:pe=!0;break;case m:return pe=K._init,W(pe(K._payload),ce,re,oe,we)}}if(pe)return we=we(K),pe=oe===""?"."+le(K,0):oe,G(we)?(re="",pe!=null&&(re=pe.replace(J,"$&/")+"/"),W(we,ce,re,"",function(ct){return ct})):we!=null&&(ie(we)&&(we=k(we,re+(we.key==null||K&&K.key===we.key?"":(""+we.key).replace(J,"$&/")+"/")+pe)),ce.push(we)),1;pe=0;var Re=oe===""?".":oe+":";if(G(K))for(var lt=0;lt<K.length;lt++)oe=K[lt],Be=Re+le(oe,lt),pe+=W(oe,ce,re,Be,we);else if(lt=_(K),typeof lt=="function")for(K=lt.call(K),lt=0;!(oe=K.next()).done;)oe=oe.value,Be=Re+le(oe,lt++),pe+=W(oe,ce,re,Be,we);else if(Be==="object"){if(typeof K.then=="function")return W(ae(K),ce,re,oe,we);throw ce=String(K),Error("Objects are not valid as a React child (found: "+(ce==="[object Object]"?"object with keys {"+Object.keys(K).join(", ")+"}":ce)+"). If you meant to render a collection of children, use an array instead.")}return pe}function ee(K,ce,re){if(K==null)return K;var oe=[],we=0;return W(K,oe,"","",function(Be){return ce.call(re,Be,we++)}),oe}function te(K){if(K._status===-1){var ce=K._result;ce=ce(),ce.then(function(re){(K._status===0||K._status===-1)&&(K._status=1,K._result=re)},function(re){(K._status===0||K._status===-1)&&(K._status=2,K._result=re)}),K._status===-1&&(K._status=0,K._result=ce)}if(K._status===1)return K._result.default;throw K._result}var ue=typeof reportError=="function"?reportError:function(K){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ce=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof K=="object"&&K!==null&&typeof K.message=="string"?String(K.message):String(K),error:K});if(!window.dispatchEvent(ce))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",K);return}console.error(K)},he={map:ee,forEach:function(K,ce,re){ee(K,function(){ce.apply(this,arguments)},re)},count:function(K){var ce=0;return ee(K,function(){ce++}),ce},toArray:function(K){return ee(K,function(ce){return ce})||[]},only:function(K){if(!ie(K))throw Error("React.Children.only expected to receive a single React element child.");return K}};return Sn.Activity=v,Sn.Children=he,Sn.Component=E,Sn.Fragment=t,Sn.Profiler=s,Sn.PureComponent=L,Sn.StrictMode=n,Sn.Suspense=h,Sn.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=F,Sn.__COMPILER_RUNTIME={__proto__:null,c:function(K){return F.H.useMemoCache(K)}},Sn.cache=function(K){return function(){return K.apply(null,arguments)}},Sn.cacheSignal=function(){return null},Sn.cloneElement=function(K,ce,re){if(K==null)throw Error("The argument must be a React element, but you passed "+K+".");var oe=R({},K.props),we=K.key;if(ce!=null)for(Be in ce.key!==void 0&&(we=""+ce.key),ce)!X.call(ce,Be)||Be==="key"||Be==="__self"||Be==="__source"||Be==="ref"&&ce.ref===void 0||(oe[Be]=ce[Be]);var Be=arguments.length-2;if(Be===1)oe.children=re;else if(1<Be){for(var pe=Array(Be),Re=0;Re<Be;Re++)pe[Re]=arguments[Re+2];oe.children=pe}return z(K.type,we,oe)},Sn.createContext=function(K){return K={$$typeof:l,_currentValue:K,_currentValue2:K,_threadCount:0,Provider:null,Consumer:null},K.Provider=K,K.Consumer={$$typeof:a,_context:K},K},Sn.createElement=function(K,ce,re){var oe,we={},Be=null;if(ce!=null)for(oe in ce.key!==void 0&&(Be=""+ce.key),ce)X.call(ce,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(we[oe]=ce[oe]);var pe=arguments.length-2;if(pe===1)we.children=re;else if(1<pe){for(var Re=Array(pe),lt=0;lt<pe;lt++)Re[lt]=arguments[lt+2];we.children=Re}if(K&&K.defaultProps)for(oe in pe=K.defaultProps,pe)we[oe]===void 0&&(we[oe]=pe[oe]);return z(K,Be,we)},Sn.createRef=function(){return{current:null}},Sn.forwardRef=function(K){return{$$typeof:u,render:K}},Sn.isValidElement=ie,Sn.lazy=function(K){return{$$typeof:m,_payload:{_status:-1,_result:K},_init:te}},Sn.memo=function(K,ce){return{$$typeof:p,type:K,compare:ce===void 0?null:ce}},Sn.startTransition=function(K){var ce=F.T,re={};F.T=re;try{var oe=K(),we=F.S;we!==null&&we(re,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(H,ue)}catch(Be){ue(Be)}finally{ce!==null&&re.types!==null&&(ce.types=re.types),F.T=ce}},Sn.unstable_useCacheRefresh=function(){return F.H.useCacheRefresh()},Sn.use=function(K){return F.H.use(K)},Sn.useActionState=function(K,ce,re){return F.H.useActionState(K,ce,re)},Sn.useCallback=function(K,ce){return F.H.useCallback(K,ce)},Sn.useContext=function(K){return F.H.useContext(K)},Sn.useDebugValue=function(){},Sn.useDeferredValue=function(K,ce){return F.H.useDeferredValue(K,ce)},Sn.useEffect=function(K,ce){return F.H.useEffect(K,ce)},Sn.useEffectEvent=function(K){return F.H.useEffectEvent(K)},Sn.useId=function(){return F.H.useId()},Sn.useImperativeHandle=function(K,ce,re){return F.H.useImperativeHandle(K,ce,re)},Sn.useInsertionEffect=function(K,ce){return F.H.useInsertionEffect(K,ce)},Sn.useLayoutEffect=function(K,ce){return F.H.useLayoutEffect(K,ce)},Sn.useMemo=function(K,ce){return F.H.useMemo(K,ce)},Sn.useOptimistic=function(K,ce){return F.H.useOptimistic(K,ce)},Sn.useReducer=function(K,ce,re){return F.H.useReducer(K,ce,re)},Sn.useRef=function(K){return F.H.useRef(K)},Sn.useState=function(K){return F.H.useState(K)},Sn.useSyncExternalStore=function(K,ce,re){return F.H.useSyncExternalStore(K,ce,re)},Sn.useTransition=function(){return F.H.useTransition()},Sn.version="19.2.5",Sn}var lE;function ig(){return lE||(lE=1,Yb.exports=OD()),Yb.exports}
vendor: 13,160 bytes, lines 17-43
17var q=ig();const ld=mA(q);var Jb={exports:{}},r0={},Kb={exports:{}},Zb={};/**
18 * @license React
19 * scheduler.production.js
20 *
21 * Copyright (c) Meta Platforms, Inc. and affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */var cE;function ND(){return cE||(cE=1,(function(i){function e(W,ee){var te=W.length;W.push(ee);e:for(;0<te;){var ue=te-1>>>1,he=W[ue];if(0<s(he,ee))W[ue]=ee,W[te]=he,te=ue;else break e}}function t(W){return W.length===0?null:W[0]}function n(W){if(W.length===0)return null;var ee=W[0],te=W.pop();if(te!==ee){W[0]=te;e:for(var ue=0,he=W.length,K=he>>>1;ue<K;){var ce=2*(ue+1)-1,re=W[ce],oe=ce+1,we=W[oe];if(0>s(re,te))oe<he&&0>s(we,re)?(W[ue]=we,W[oe]=te,ue=oe):(W[ue]=re,W[ce]=te,ue=ce);else if(oe<he&&0>s(we,te))W[ue]=we,W[oe]=te,ue=oe;else break e}}return ee}function s(W,ee){var te=W.sortIndex-ee.sortIndex;return te!==0?te:W.id-ee.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;i.unstable_now=function(){return a.now()}}else{var l=Date,u=l.now();i.unstable_now=function(){return l.now()-u}}var h=[],p=[],m=1,v=null,x=3,_=!1,A=!1,R=!1,w=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,L=typeof setImmediate<"u"?setImmediate:null;function P(W){for(var ee=t(p);ee!==null;){if(ee.callback===null)n(p);else if(ee.startTime<=W)n(p),ee.sortIndex=ee.expirationTime,e(h,ee);else break;ee=t(p)}}function G(W){if(R=!1,P(W),!A)if(t(h)!==null)A=!0,H||(H=!0,ve());else{var ee=t(p);ee!==null&&ae(G,ee.startTime-W)}}var H=!1,F=-1,X=5,z=-1;function k(){return w?!0:!(i.unstable_now()-z<X)}function ie(){if(w=!1,H){var W=i.unstable_now();z=W;var ee=!0;try{e:{A=!1,R&&(R=!1,D(F),F=-1),_=!0;var te=x;try{t:{for(P(W),v=t(h);v!==null&&!(v.expirationTime>W&&k());){var ue=v.callback;if(typeof ue=="function"){v.callback=null,x=v.priorityLevel;var he=ue(v.expirationTime<=W);if(W=i.unstable_now(),typeof he=="function"){v.callback=he,P(W),ee=!0;break t}v===t(h)&&n(h),P(W)}else n(h);v=t(h)}if(v!==null)ee=!0;else{var K=t(p);K!==null&&ae(G,K.startTime-W),ee=!1}}break e}finally{v=null,x=te,_=!1}ee=void 0}}finally{ee?ve():H=!1}}}var ve;if(typeof L=="function")ve=function(){L(ie)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,le=J.port2;J.port1.onmessage=ie,ve=function(){le.postMessage(null)}}else ve=function(){E(ie,0)};function ae(W,ee){F=E(function(){W(i.unstable_now())},ee)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(W){W.callback=null},i.unstable_forceFrameRate=function(W){0>W||125<W?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):X=0<W?Math.floor(1e3/W):5},i.unstable_getCurrentPriorityLevel=function(){return x},i.unstable_next=function(W){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var te=x;x=ee;try{return W()}finally{x=te}},i.unstable_requestPaint=function(){w=!0},i.unstable_runWithPriority=function(W,ee){switch(W){case 1:case 2:case 3:case 4:case 5:break;default:W=3}var te=x;x=W;try{return ee()}finally{x=te}},i.unstable_scheduleCallback=function(W,ee,te){var ue=i.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?ue+te:ue):te=ue,W){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=te+he,W={id:m++,callback:ee,priorityLevel:W,startTime:te,expirationTime:he,sortIndex:-1},te>ue?(W.sortIndex=te,e(p,W),t(h)===null&&W===t(p)&&(R?(D(F),F=-1):R=!0,ae(G,te-ue))):(W.sortIndex=he,e(h,W),A||_||(A=!0,H||(H=!0,ve()))),W},i.unstable_shouldYield=k,i.unstable_wrapCallback=function(W){var ee=x;return function(){var te=x;x=ee;try{return W.apply(this,arguments)}finally{x=te}}}})(Zb)),Zb}var uE;function nR(){return uE||(uE=1,Kb.exports=ND()),Kb.exports}var Qb={exports:{}},Vr={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var fE;function UD(){if(fE)return Vr;fE=1;var i=ig();function e(h){var p="https://react.dev/errors/"+h;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var m=2;m<arguments.length;m++)p+="&args[]="+encodeURIComponent(arguments[m])}return"Minified React error #"+h+"; visit "+p+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var n={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(h,p,m){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:v==null?null:""+v,children:h,containerInfo:p,implementation:m}}var l=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function u(h,p){if(h==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return Vr.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=n,Vr.createPortal=function(h,p){var m=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(e(299));return a(h,p,null,m)},Vr.flushSync=function(h){var p=l.T,m=n.p;try{if(l.T=null,n.p=2,h)return h()}finally{l.T=p,n.p=m,n.d.f()}},Vr.preconnect=function(h,p){typeof h=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,n.d.C(h,p))},Vr.prefetchDNS=function(h){typeof h=="string"&&n.d.D(h)},Vr.preinit=function(h,p){if(typeof h=="string"&&p&&typeof p.as=="string"){var m=p.as,v=u(m,p.crossOrigin),x=typeof p.integrity=="string"?p.integrity:void 0,_=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;m==="style"?n.d.S(h,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:v,integrity:x,fetchPriority:_}):m==="script"&&n.d.X(h,{crossOrigin:v,integrity:x,fetchPriority:_,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},Vr.preinitModule=function(h,p){if(typeof h=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var m=u(p.as,p.crossOrigin);n.d.M(h,{crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&n.d.M(h)},Vr.preload=function(h,p){if(typeof h=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var m=p.as,v=u(m,p.crossOrigin);n.d.L(h,m,{crossOrigin:v,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},Vr.preloadModule=function(h,p){if(typeof h=="string")if(p){var m=u(p.as,p.crossOrigin);n.d.m(h,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:m,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else n.d.m(h)},Vr.requestFormReset=function(h){n.d.r(h)},Vr.unstable_batchedUpdates=function(h,p){return h(p)},Vr.useFormState=function(h,p,m){return l.H.useFormState(h,p,m)},Vr.useFormStatus=function(){return l.H.useHostTransitionStatus()},Vr.version="19.2.5",Vr}var dE;function iR(){if(dE)return Qb.exports;dE=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Qb.exports=UD(),Qb.exports}/**
34 * @license React
35 * react-dom-client.production.js
36 *
37 * Copyright (c) Meta Platforms, Inc. and affiliates.
38 *
39 * This source code is licensed under the MIT license found in the
40 * LICENSE file in the root directory of this source tree.
41 */var hE;function zD(){if(hE)return r0;hE=1;var i=nR(),e=ig(),t=iR();function n(r){var o="https://react.dev/errors/"+r;if(1<arguments.length){o+="?args[]="+encodeURIComponent(arguments[1]);for(var d=2;d<arguments.length;d++)o+="&args[]="+encodeURIComponent(arguments[d])}return"Minified React error #"+r+"; visit "+o+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function a(r){var o=r,d=r;if(r.alternate)for(;o.return;)o=o.return;else{r=o;do o=r,(o.flags&4098)!==0&&(d=o.return),r=o.return;while(r)}return o.tag===3?d:null}function l(r){if(r.tag===13){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function u(r){if(r.tag===31){var o=r.memoizedState;if(o===null&&(r=r.alternate,r!==null&&(o=r.memoizedState)),o!==null)return o.dehydrated}return null}function h(r){if(a(r)!==r)throw Error(n(188))}function p(r){var o=r.alternate;if(!o){if(o=a(r),o===null)throw Error(n(188));return o!==r?null:r}for(var d=r,g=o;;){var M=d.return;if(M===null)break;var C=M.alternate;if(C===null){if(g=M.return,g!==null){d=g;continue}break}if(M.child===C.child){for(C=M.child;C;){if(C===d)return h(M),r;if(C===g)return h(M),o;C=C.sibling}throw Error(n(188))}if(d.return!==g.return)d=M,g=C;else{for(var U=!1,$=M.child;$;){if($===d){U=!0,d=M,g=C;break}if($===g){U=!0,g=M,d=C;break}$=$.sibling}if(!U){for($=C.child;$;){if($===d){U=!0,d=C,g=M;break}if($===g){U=!0,g=C,d=M;break}$=$.sibling}if(!U)throw Error(n(189))}}if(d.alternate!==g)throw Error(n(190))}if(d.tag!==3)throw Error(n(188));return d.stateNode.current===d?r:o}function m(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r;for(r=r.child;r!==null;){if(o=m(r),o!==null)return o;r=r.sibling}return null}var v=Object.assign,x=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),L=Symbol.for("react.context"),P=Symbol.for("react.forward_ref"),G=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),F=Symbol.for("react.memo"),X=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),k=Symbol.for("react.memo_cache_sentinel"),ie=Symbol.iterator;function ve(r){return r===null||typeof r!="object"?null:(r=ie&&r[ie]||r["@@iterator"],typeof r=="function"?r:null)}var J=Symbol.for("react.client.reference");function le(r){if(r==null)return null;if(typeof r=="function")return r.$$typeof===J?null:r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case R:return"Fragment";case E:return"Profiler";case w:return"StrictMode";case G:return"Suspense";case H:return"SuspenseList";case z:return"Activity"}if(typeof r=="object")switch(r.$$typeof){case A:return"Portal";case L:return r.displayName||"Context";case D:return(r._context.displayName||"Context")+".Consumer";case P:var o=r.render;return r=r.displayName,r||(r=o.displayName||o.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case F:return o=r.displayName||null,o!==null?o:le(r.type)||"Memo";case X:o=r._payload,r=r._init;try{return le(r(o))}catch{}}return null}var ae=Array.isArray,W=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,te={pending:!1,data:null,method:null,action:null},ue=[],he=-1;function K(r){return{current:r}}function ce(r){0>he||(r.current=ue[he],ue[he]=null,he--)}function re(r,o){he++,ue[he]=r.current,r.current=o}var oe=K(null),we=K(null),Be=K(null),pe=K(null);function Re(r,o){switch(re(Be,o),re(we,r),re(oe,null),o.nodeType){case 9:case 11:r=(r=o.documentElement)&&(r=r.namespaceURI)?CM(r):0;break;default:if(r=o.tagName,o=o.namespaceURI)o=CM(o),r=RM(o,r);else switch(r){case"svg":r=1;break;case"math":r=2;break;default:r=0}}ce(oe),re(oe,r)}function lt(){ce(oe),ce(we),ce(Be)}function ct(r){r.memoizedState!==null&&re(pe,r);var o=oe.current,d=RM(o,r.type);o!==d&&(re(we,r),re(oe,d))}function vt(r){we.current===r&&(ce(oe),ce(we)),pe.current===r&&(ce(pe),e0._currentValue=te)}var qt,Wt;function de(r){if(qt===void 0)try{throw Error()}catch(d){var o=d.stack.trim().match(/\n( *(at )?)/);qt=o&&o[1]||"",Wt=-1<d.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<d.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+qt+r+Wt}var an=!1;function $e(r,o){if(!r||an)return"";an=!0;var d=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var g={DetermineComponentFrameRoot:function(){try{if(o){var ut=function(){throw Error()};if(Object.defineProperty(ut.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ut,[])}catch(Ke){var Ge=Ke}Reflect.construct(r,[],ut)}else{try{ut.call()}catch(Ke){Ge=Ke}r.call(ut.prototype)}}else{try{throw Error()}catch(Ke){Ge=Ke}(ut=r())&&typeof ut.catch=="function"&&ut.catch(function(){})}}
vendor: 6,306 bytes, lines 43-48
43catch(Ke){if(Ke&&Ge&&typeof Ke.stack=="string")return[Ke.stack,Ge.stack]}return[null,null]}};g.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var M=Object.getOwnPropertyDescriptor(g.DetermineComponentFrameRoot,"name");M&&M.configurable&&Object.defineProperty(g.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var C=g.DetermineComponentFrameRoot(),U=C[0],$=C[1];if(U&&$){var me=U.split(`
44`),ze=$.split(`
45`);for(M=g=0;g<me.length&&!me[g].includes("DetermineComponentFrameRoot");)g++;for(;M<ze.length&&!ze[M].includes("DetermineComponentFrameRoot");)M++;if(g===me.length||M===ze.length)for(g=me.length-1,M=ze.length-1;1<=g&&0<=M&&me[g]!==ze[M];)M--;for(;1<=g&&0<=M;g--,M--)if(me[g]!==ze[M]){if(g!==1||M!==1)do if(g--,M--,0>M||me[g]!==ze[M]){var rt=`
46`+me[g].replace(" at new "," at ");return r.displayName&&rt.includes("<anonymous>")&&(rt=rt.replace("<anonymous>",r.displayName)),rt}while(1<=g&&0<=M);break}}}finally{an=!1,Error.prepareStackTrace=d}return(d=r?r.displayName||r.name:"")?de(d):""}function Qe(r,o){switch(r.tag){case 26:case 27:case 5:return de(r.type);case 16:return de("Lazy");case 13:return r.child!==o&&o!==null?de("Suspense Fallback"):de("Suspense");case 19:return de("SuspenseList");case 0:case 15:return $e(r.type,!1);case 11:return $e(r.type.render,!1);case 1:return $e(r.type,!0);case 31:return de("Activity");default:return""}}function Ye(r){try{var o="",d=null;do o+=Qe(r,d),d=r,r=r.return;while(r);return o}catch(g){return`
47Error generating stack: `+g.message+`
48`+g.stack}}var pt=Object.prototype.hasOwnProperty,Ve=i.unstable_scheduleCallback,ne=i.unstable_cancelCallback,V=i.unstable_shouldYield,Se=i.unstable_requestPaint,Ie=i.unstable_now,et=i.unstable_getCurrentPriorityLevel,Fe=i.unstable_ImmediatePriority,Rt=i.unstable_UserBlockingPriority,qe=i.unstable_NormalPriority,yt=i.unstable_LowPriority,At=i.unstable_IdlePriority,it=i.log,Oe=i.unstable_setDisableYieldValue,Ct=null,Ft=null;function ft(r){if(typeof it=="function"&&Oe(r),Ft&&typeof Ft.setStrictMode=="function")try{Ft.setStrictMode(Ct,r)}catch{}}var Zt=Math.clz32?Math.clz32:_e,sn=Math.log,cn=Math.LN2;function _e(r){return r>>>=0,r===0?32:31-(sn(r)/cn|0)|0}var Bt=256,Ue=262144,nt=4194304;function bt(r){var o=r&42;if(o!==0)return o;switch(r&-r){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return r&261888;case 262144:case 524288:case 1048576:case 2097152:return r&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return r&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return r}}function mt(r,o,d){var g=r.pendingLanes;if(g===0)return 0;var M=0,C=r.suspendedLanes,U=r.pingedLanes;r=r.warmLanes;var $=g&134217727;return $!==0?(g=$&~C,g!==0?M=bt(g):(U&=$,U!==0?M=bt(U):d||(d=$&~r,d!==0&&(M=bt(d))))):($=g&~C,$!==0?M=bt($):U!==0?M=bt(U):d||(d=g&~r,d!==0&&(M=bt(d)))),M===0?0:o!==0&&o!==M&&(o&C)===0&&(C=M&-M,d=o&-o,C>=d||C===32&&(d&4194048)!==0)?o:M}function nn(r,o){return(r.pendingLanes&~(r.suspendedLanes&~r.pingedLanes)&o)===0}function kn(r,o){switch(r){case 1:case 2:case 4:case 8:case 64:return o+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return o+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Dt(){var r=nt;return nt<<=1,(nt&62914560)===0&&(nt=4194304),r}function Tt(r){for(var o=[],d=0;31>d;d++)o.push(r);return o}function gn(r,o){r.pendingLanes|=o,o!==268435456&&(r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0)}function En(r,o,d,g,M,C){var U=r.pendingLanes;r.pendingLanes=d,r.suspendedLanes=0,r.pingedLanes=0,r.warmLanes=0,r.expiredLanes&=d,r.entangledLanes&=d,r.errorRecoveryDisabledLanes&=d,r.shellSuspendCounter=0;var $=r.entanglements,me=r.expirationTimes,ze=r.hiddenUpdates;for(d=U&~d;0<d;){var rt=31-Zt(d),ut=1<<rt;$[rt]=0,me[rt]=-1;var Ge=ze[rt];if(Ge!==null)for(ze[rt]=null,rt=0;rt<Ge.length;rt++){var Ke=Ge[rt];Ke!==null&&(Ke.lane&=-536870913)}d&=~ut}g!==0&&Lr(r,g,0),C!==0&&M===0&&r.tag!==0&&(r.suspendedLanes|=C&~(U&~o))}function Lr(r,o,d){r.pendingLanes|=o,r.suspendedLanes&=~o;var g=31-Zt(o);r.entangledLanes|=o,r.entanglements[g]=r.entanglements[g]|1073741824|d&261930}function yr(r,o){var d=r.entangledLanes|=o;for(r=r.entanglements;d;){var g=31-Zt(d),M=1<<g;M&o|r[g]&o&&(r[g]|=o),d&=~M}}function er(r,o){var d=o&-o;return d=(d&42)!==0?1:Vs(d),(d&(r.suspendedLanes|o))!==0?0:d}function Vs(r){switch(r){case 2:r=1;break;case 8:r=4;break;case 32:r=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:r=128;break;case 268435456:r=134217728;break;default:r=0}return r}function xr(r){return r&=-r,2<r?8<r?(r&134217727)!==0?32:268435456:8:2}function ia(){var r=ee.p;return r!==0?r:(r=window.event,r===void 0?32:QM(r.type))}function Ws(r,o){var d=ee.p;try{return ee.p=r,o()}finally{ee.p=d}}var Ps=Math.random().toString(36).slice(2),hi="__reactFiber$"+Ps,Fi="__reactProps$"+Ps,_r="__reactContainer$"+Ps,ui="__reactEvents$"+Ps,tr="__reactListeners$"+Ps,xa="__reactHandles$"+Ps,It="__reactResources$"+Ps,Ot="__reactMarker$"+Ps;function Ln(r){delete r[hi],delete r[Fi],delete r[ui],delete r[tr],delete r[xa]}function Q(r){var o=r[hi];if(o)return o;for(var d=r.parentNode;d;){if(o=d[_r]||d[hi]){if(d=o.alternate,o.child!==null||d!==null&&d.child!==null)for(r=NM(r);r!==null;){if(d=r[hi])return d;r=NM(r)}return o}r=d,d=r.parentNode}return null}function ye(r){if(r=r[hi]||r[_r]){var o=r.tag;if(o===5||o===6||o===13||o===31||o===26||o===27||o===3)return r}return null}function De(r){var o=r.tag;if(o===5||o===26||o===27||o===6)return r.stateNode;throw Error(n(33))}function Le(r){var o=r[It];return o||(o=r[It]={hoistableStyles:new Map,hoistableScripts:new Map}),o}function xe(r){r[Ot]=!0}
vendor: 6,963 bytes, line 48
48var dt=new Set,xt={};function Et(r,o){Nt(r,o),Nt(r+"Capture",o)}function Nt(r,o){for(xt[r]=o,r=0;r<o.length;r++)dt.add(o[r])}var Kt=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),rn={},zt={};function xn(r){return pt.call(zt,r)?!0:pt.call(rn,r)?!1:Kt.test(r)?zt[r]=!0:(rn[r]=!0,!1)}function Pn(r,o,d){if(xn(o))if(d===null)r.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":r.removeAttribute(o);return;case"boolean":var g=o.toLowerCase().slice(0,5);if(g!=="data-"&&g!=="aria-"){r.removeAttribute(o);return}}r.setAttribute(o,""+d)}}function _i(r,o,d){if(d===null)r.removeAttribute(o);else{switch(typeof d){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(o);return}r.setAttribute(o,""+d)}}function Vn(r,o,d,g){if(g===null)r.removeAttribute(d);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":r.removeAttribute(d);return}r.setAttributeNS(o,d,""+g)}}function Xt(r){switch(typeof r){case"bigint":case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Yt(r){var o=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(o==="checkbox"||o==="radio")}function Qi(r,o,d){var g=Object.getOwnPropertyDescriptor(r.constructor.prototype,o);if(!r.hasOwnProperty(o)&&typeof g<"u"&&typeof g.get=="function"&&typeof g.set=="function"){var M=g.get,C=g.set;return Object.defineProperty(r,o,{configurable:!0,get:function(){return M.call(this)},set:function(U){d=""+U,C.call(this,U)}}),Object.defineProperty(r,o,{enumerable:g.enumerable}),{getValue:function(){return d},setValue:function(U){d=""+U},stopTracking:function(){r._valueTracker=null,delete r[o]}}}}function Tn(r){if(!r._valueTracker){var o=Yt(r)?"checked":"value";r._valueTracker=Qi(r,o,""+r[o])}}function pi(r){if(!r)return!1;var o=r._valueTracker;if(!o)return!0;var d=o.getValue(),g="";return r&&(g=Yt(r)?r.checked?"true":"false":r.value),r=g,r!==d?(o.setValue(r),!0):!1}function Kn(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}var Es=/[\n"\\]/g;function Bi(r){return r.replace(Es,function(o){return"\\"+o.charCodeAt(0).toString(16)+" "})}function Un(r,o,d,g,M,C,U,$){r.name="",U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?r.type=U:r.removeAttribute("type"),o!=null?U==="number"?(o===0&&r.value===""||r.value!=o)&&(r.value=""+Xt(o)):r.value!==""+Xt(o)&&(r.value=""+Xt(o)):U!=="submit"&&U!=="reset"||r.removeAttribute("value"),o!=null?mi(r,U,Xt(o)):d!=null?mi(r,U,Xt(d)):g!=null&&r.removeAttribute("value"),M==null&&C!=null&&(r.defaultChecked=!!C),M!=null&&(r.checked=M&&typeof M!="function"&&typeof M!="symbol"),$!=null&&typeof $!="function"&&typeof $!="symbol"&&typeof $!="boolean"?r.name=""+Xt($):r.removeAttribute("name")}function Gi(r,o,d,g,M,C,U,$){if(C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(r.type=C),o!=null||d!=null){if(!(C!=="submit"&&C!=="reset"||o!=null)){Tn(r);return}d=d!=null?""+Xt(d):"",o=o!=null?""+Xt(o):d,$||o===r.value||(r.value=o),r.defaultValue=o}g=g??M,g=typeof g!="function"&&typeof g!="symbol"&&!!g,r.checked=$?r.checked:!!g,r.defaultChecked=!!g,U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"&&(r.name=U),Tn(r)}function mi(r,o,d){o==="number"&&Kn(r.ownerDocument)===r||r.defaultValue===""+d||(r.defaultValue=""+d)}function wi(r,o,d,g){if(r=r.options,o){o={};for(var M=0;M<d.length;M++)o["$"+d[M]]=!0;for(d=0;d<r.length;d++)M=o.hasOwnProperty("$"+r[d].value),r[d].selected!==M&&(r[d].selected=M),M&&g&&(r[d].defaultSelected=!0)}else{for(d=""+Xt(d),o=null,M=0;M<r.length;M++){if(r[M].value===d){r[M].selected=!0,g&&(r[M].defaultSelected=!0);return}o!==null||r[M].disabled||(o=r[M])}o!==null&&(o.selected=!0)}}function ms(r,o,d){if(o!=null&&(o=""+Xt(o),o!==r.value&&(r.value=o),d==null)){r.defaultValue!==o&&(r.defaultValue=o);return}r.defaultValue=d!=null?""+Xt(d):""}function no(r,o,d,g){if(o==null){if(g!=null){if(d!=null)throw Error(n(92));if(ae(g)){if(1<g.length)throw Error(n(93));g=g[0]}d=g}d==null&&(d=""),o=d}d=Xt(o),r.defaultValue=d,g=r.textContent,g===d&&g!==""&&g!==null&&(r.value=g),Tn(r)}function Y(r,o){if(o){var d=r.firstChild;if(d&&d===r.lastChild&&d.nodeType===3){d.nodeValue=o;return}}r.textContent=o}var T=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function I(r,o,d){var g=o.indexOf("--")===0;d==null||typeof d=="boolean"||d===""?g?r.setProperty(o,""):o==="float"?r.cssFloat="":r[o]="":g?r.setProperty(o,d):typeof d!="number"||d===0||T.has(o)?o==="float"?r.cssFloat=d:r[o]=(""+d).trim():r[o]=d+"px"}function N(r,o,d){if(o!=null&&typeof o!="object")throw Error(n(62));if(r=r.style,d!=null){for(var g in d)!d.hasOwnProperty(g)||o!=null&&o.hasOwnProperty(g)||(g.indexOf("--")===0?r.setProperty(g,""):g==="float"?r.cssFloat="":r[g]="");for(var M in o)g=o[M],o.hasOwnProperty(M)&&d[M]!==g&&I(r,M,g)}else for(var C in o)o.hasOwnProperty(C)&&I(r,C,o[C])}function j(r){if(r.indexOf("-")===-1)return!1;switch(r){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var fe=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRen
48dering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Ae=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function tt(r){return Ae.test(""+r)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":r}function Pe(){}var We=null;function Ze(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var je=null,Lt=null;function Ut(r){var o=ye(r);if(o&&(r=o.stateNode)){var d=r[Fi]||null;e:switch(r=o.stateNode,o.type){case"input":if(Un(r,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name),o=d.name,d.type==="radio"&&o!=null){for(d=r;d.parentNode;)d=d.parentNode;for(d=d.querySelectorAll('input[name="'+Bi(""+o)+'"][type="radio"]'),o=0;o<d.length;o++){var g=d[o];if(g!==r&&g.form===r.form){var M=g[Fi]||null;if(!M)throw Error(n(90));Un(g,M.value,M.defaultValue,M.defaultValue,M.checked,M.defaultChecked,M.type,M.name)}}for(o=0;o<d.length;o++)g=d[o],g.form===r.form&&pi(g)}break e;case"textarea":ms(r,d.value,d.defaultValue);break e;case"select":o=d.value,o!=null&&wi(r,!!d.multiple,o,!1)}}}var Mt=!1;function _t(r,o,d){if(Mt)return r(o,d);Mt=!0;try{var g=r(o);return g}finally{if(Mt=!1,(je!==null||Lt!==null)&&(qa(),je&&(o=je,r=Lt,Lt=je=null,Ut(o),r)))for(o=0;o<r.length;o++)Ut(r[o])}}function Ht(r,o){var d=r.stateNode;if(d===null)return null;var g=d[Fi]||null;if(g===null)return null;d=g[o];e:switch(o){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(g=!g.disabled)||(r=r.type,g=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!g;break e;default:r=!1}if(r)return null;if(d&&typeof d!="function")throw Error(n(231,o,typeof d));return d}var ni=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ii=!1;if(ni)try{var Ts={};Object.defineProperty(Ts,"passive",{get:function(){Ii=!0}}),window.addEventListener("test",Ts,Ts),window.removeEventListener("test",Ts,Ts)}catch{Ii=!1}var Di=null,sa=null,_a=null;function rf(){if(_a)return _a;var r,o=sa,d=o.length,g,M="value"in Di?Di.value:Di.textContent,C=M.length;for(r=0;r<d&&o[r]===M[r];r++);var U=d-r;for(g=1;g<=U&&o[d-g]===M[C-g];g++);return _a=M.slice(r,1<g?1-g:void 0)}function af(r){var o=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&o===13&&(r=13)):r=o,r===10&&(r=13),32<=r||r===13?r:0}function Wc(){return!0}function bg(){return!1}function br(r){function o(d,g,M,C,U){this._reactName=d,this._targetInst=M,this.type=g,this.nativeEvent=C,this.target=U,this.currentTarget=null;for(var $ in r)r.hasOwnProperty($)&&(d=r[$],this[$]=d?d(C):C[$]);return this.isDefaultPrevented=(C.defaultPrevented!=null?C.defaultPrevented:C.returnValue===!1)?Wc:bg,this.isPropagationStopped=bg,this}return v(o.prototype,{preventDefault:function(){this.defaultPrevented=!0;var d=this.nativeEvent;d&&(d.preventDefault?d.preventDefault():typeof d.returnValue!="unknown"&&(d.returnValue=!1),this.isDefaultPrevented=Wc)},stopPropagation:function(){var d=this.nativeEvent;d&&(d.stopPropagation?d.stopPropagation():typeof d.cancelBubble!="unknown"&&(d.cancelBubble=!0),this.isPropagationStopped=Wc)},persist:function(){}
vendor: 4,333 bytes, line 48
48,isPersistent:Wc}),o}var dl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},of=br(dl),Xc=v({},dl,{view:0,detail:0}),Sg=br(Xc),lf,Fd,qc,Yc=v({},Xc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jd,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==qc&&(qc&&r.type==="mousemove"?(lf=r.screenX-qc.screenX,Fd=r.screenY-qc.screenY):Fd=lf=0,qc=r),lf)},movementY:function(r){return"movementY"in r?r.movementY:Fd}}),zp=br(Yc),Ag=v({},Yc,{dataTransfer:0}),Mg=br(Ag),Fp=v({},Xc,{relatedTarget:0}),kd=br(Fp),Eg=v({},dl,{animationName:0,elapsedTime:0,pseudoElement:0}),hb=br(Eg),pb=v({},dl,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),Tg=br(pb),cf=v({},dl,{data:0}),Hd=br(cf),Gd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Cg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function kp(r){var o=this.nativeEvent;return o.getModifierState?o.getModifierState(r):(r=Cg[r])?!!o[r]:!1}function jd(){return kp}var Rg=v({},Xc,{key:function(r){if(r.key){var o=Gd[r.key]||r.key;if(o!=="Unidentified")return o}return r.type==="keypress"?(r=af(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?wg[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jd,charCode:function(r){return r.type==="keypress"?af(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?af(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),Xl=br(Rg),Vd=v({},Yc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hp=br(Vd),Gp=v({},Xc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jd}),Bg=br(Gp),Ig=v({},dl,{propertyName:0,elapsedTime:0,pseudoElement:0}),mb=br(Ig),nr=v({},Yc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),Dg=br(nr),Lg=v({},dl,{newState:0,oldState:0}),Pg=br(Lg),Og=[9,13,27,32],ql=ni&&"CompositionEvent"in window,Jc=null;ni&&"documentMode"in document&&(Jc=document.documentMode);var Wd=ni&&"TextEvent"in window&&!Jc,jp=ni&&(!ql||Jc&&8<Jc&&11>=Jc),Ng=" ",uf=!1;function Xd(r,o){switch(r){case"keyup":return Og.indexOf(o.keyCode)!==-1;case"keydown":return o.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vp(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Yl=!1;function Ug(r,o){switch(r){case"compositionend":return Vp(o);case"keypress":return o.which!==32?null:(uf=!0,Ng);case"textInput":return r=o.data,r===Ng&&uf?null:r;default:return null}}function Wp(r,o){if(Yl)return r==="compositionend"||!ql&&Xd(r,o)?(r=rf(),_a=sa=Di=null,Yl=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(o.ctrlKey||o.altKey||o.metaKey)||o.ctrlKey&&o.altKey){if(o.char&&1<o.char.length)return o.char;if(o.which)return String.fromCharCode(o.which)}return null;case"compositionend":return jp&&o.locale!=="ko"?null:o.data;default:return null}}var Xp={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function qp(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o==="input"?!!Xp[r.type]:o==="textarea"}
vendor: 5,876 bytes, line 48
48function qd(r,o,d,g){je?Lt?Lt.push(g):Lt=[g]:je=g,o=Gv(o,"onChange"),0<o.length&&(d=new of("onChange","change",null,d,g),r.push({event:d,listeners:o}))}var hl=null,Jl=null;function zg(r){SM(r,0)}function Kc(r){var o=De(r);if(pi(o))return r}function Yp(r,o){if(r==="change")return o}var io=!1;if(ni){var ff;if(ni){var Jp="oninput"in document;if(!Jp){var Kp=document.createElement("div");Kp.setAttribute("oninput","return;"),Jp=typeof Kp.oninput=="function"}ff=Jp}else ff=!1;io=ff&&(!document.documentMode||9<document.documentMode)}function ba(){hl&&(hl.detachEvent("onpropertychange",df),Jl=hl=null)}function df(r){if(r.propertyName==="value"&&Kc(Jl)){var o=[];qd(o,Jl,r,Ze(r)),_t(zg,o)}}function Fg(r,o,d){r==="focusin"?(ba(),hl=o,Jl=d,hl.attachEvent("onpropertychange",df)):r==="focusout"&&ba()}function Zp(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Kc(Jl)}function kg(r,o){if(r==="click")return Kc(o)}function Hg(r,o){if(r==="input"||r==="change")return Kc(o)}function Qp(r,o){return r===o&&(r!==0||1/r===1/o)||r!==r&&o!==o}var Sr=typeof Object.is=="function"?Object.is:Qp;function Zc(r,o){if(Sr(r,o))return!0;if(typeof r!="object"||r===null||typeof o!="object"||o===null)return!1;var d=Object.keys(r),g=Object.keys(o);if(d.length!==g.length)return!1;for(g=0;g<d.length;g++){var M=d[g];if(!pt.call(o,M)||!Sr(r[M],o[M]))return!1}return!0}function hf(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function Qc(r,o){var d=hf(r);r=0;for(var g;d;){if(d.nodeType===3){if(g=r+d.textContent.length,r<=o&&g>=o)return{node:d,offset:o-r};r=g}e:{for(;d;){if(d.nextSibling){d=d.nextSibling;break e}d=d.parentNode}d=void 0}d=hf(d)}}function Li(r,o){return r&&o?r===o?!0:r&&r.nodeType===3?!1:o&&o.nodeType===3?Li(r,o.parentNode):"contains"in r?r.contains(o):r.compareDocumentPosition?!!(r.compareDocumentPosition(o)&16):!1:!1}function Gg(r){r=r!=null&&r.ownerDocument!=null&&r.ownerDocument.defaultView!=null?r.ownerDocument.defaultView:window;for(var o=Kn(r.document);o instanceof r.HTMLIFrameElement;){try{var d=typeof o.contentWindow.location.href=="string"}catch{d=!1}if(d)r=o.contentWindow;else break;o=Kn(r.document)}return o}function $p(r){var o=r&&r.nodeName&&r.nodeName.toLowerCase();return o&&(o==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||o==="textarea"||r.contentEditable==="true")}var jg=ni&&"documentMode"in document&&11>=document.documentMode,so=null,ro=null,$c=null,Yd=!1;function eu(r,o,d){var g=d.window===d?d.document:d.nodeType===9?d:d.ownerDocument;Yd||so==null||so!==Kn(g)||(g=so,"selectionStart"in g&&$p(g)?g={start:g.selectionStart,end:g.selectionEnd}:(g=(g.ownerDocument&&g.ownerDocument.defaultView||window).getSelection(),g={anchorNode:g.anchorNode,anchorOffset:g.anchorOffset,focusNode:g.focusNode,focusOffset:g.focusOffset}),$c&&Zc($c,g)||($c=g,g=Gv(ro,"onSelect"),0<g.length&&(o=new of("onSelect","select",null,o,d),r.push({event:o,listeners:g}),o.target=so)))}function cr(r,o){var d={};return d[r.toLowerCase()]=o.toLowerCase(),d["Webkit"+r]="webkit"+o,d["Moz"+r]="moz"+o,d}var Kl={animationend:cr("Animation","AnimationEnd"),animationiteration:cr("Animation","AnimationIteration"),animationstart:cr("Animation","AnimationStart"),transitionrun:cr("Transition","TransitionRun"),transitionstart:cr("Transition","TransitionStart"),transitioncancel:cr("Transition","TransitionCancel"),transitionend:cr("Transition","TransitionEnd")},pf={},em={};ni&&(em=document.createElement("div").style,"AnimationEvent"in window||(delete Kl.animationend.animation,delete Kl.animationiteration.animation,delete Kl.animationstart.animation),"TransitionEvent"in window||delete Kl.transitionend.transition);function Oo(r){if(pf[r])return pf[r];if(!Kl[r])return r;var o=Kl[r],d;for(d in o)if(o.hasOwnProperty(d)&&d in em)return pf[r]=o[d];return r}var Jd=Oo("animationend"),mf=Oo("animationiteration"),tm=Oo("animationstart"),Vg=Oo("transitionrun"),gb=Oo("transitionstart"),Wg=Oo("transitioncancel"),nm=Oo("transitionend"),Sa=new Map,gf="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");gf.push("scrollEnd");function Aa(r,o){Sa.set(r,o),Et(o,[r])}var vf=typeof reportError=="function"?reportError:function(r){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var o=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof r=="object"&&r!==null&&typeof r.message=="string"?String(r.message):String(r),error:r});if(!window.dispatchEvent(o))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",r);return}console.error(r)},Ma=[],No=0,Xs=0;function yf(){for(var r=No,o=Xs=No=0;o<r;){var d=Ma[o];Ma[o++]=null;var g=Ma[o];Ma[o++]=null;var M=Ma[o];Ma[o++]=null;var C=Ma[o];if(Ma[o++]=null,g!==null&&M!==null){var U=g.pending;U===null?M.next=M:(M.next=U.next,U.next=M),g.pending=M}C!==0&&pl(d,M,C)}}function qs(r,o,d,g){Ma[No++]=r,Ma[No++]=o,Ma[No++]=d,Ma[No++]=g,Xs|=g,r.lanes|=g,r=r.alternate,r!==null&&(r.lanes|=g)}function Kd(r,o,d,g){return qs(r,o,d,g),Ea(r)}function Ar(r,o){return qs(r,null,null,o),Ea(r)}function pl(r,o,d){r.lanes|=d;var g=r.alternate;g!==null&&(g.lanes|=d);for(var M=!1,C=r.return;C!==null;)C.childLanes|=d,g=C.alternate,g!==null&&(g.childLanes|=d),C.tag===22&&(r=C.stateNode,r===null||r._visibility&1||(M=!0)),r
vendor: 18,544 bytes, line 48
48=C,C=C.return;return r.tag===3?(C=r.stateNode,M&&o!==null&&(M=31-Zt(d),r=C.hiddenUpdates,g=r[M],g===null?r[M]=[o]:g.push(o),o.lane=d|536870912),C):null}function Ea(r){if(50<Ll)throw Ll=0,gc=null,Error(n(185));for(var o=r.return;o!==null;)r=o,o=r.return;return r.tag===3?r.stateNode:null}var ml={};function im(r,o,d,g){this.tag=r,this.key=d,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=o,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=g,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function $i(r,o,d,g){return new im(r,o,d,g)}function Zd(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Pr(r,o){var d=r.alternate;return d===null?(d=$i(r.tag,o,r.key,r.mode),d.elementType=r.elementType,d.type=r.type,d.stateNode=r.stateNode,d.alternate=r,r.alternate=d):(d.pendingProps=o,d.type=r.type,d.flags=0,d.subtreeFlags=0,d.deletions=null),d.flags=r.flags&65011712,d.childLanes=r.childLanes,d.lanes=r.lanes,d.child=r.child,d.memoizedProps=r.memoizedProps,d.memoizedState=r.memoizedState,d.updateQueue=r.updateQueue,o=r.dependencies,d.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext},d.sibling=r.sibling,d.index=r.index,d.ref=r.ref,d.refCleanup=r.refCleanup,d}function tu(r,o){r.flags&=65011714;var d=r.alternate;return d===null?(r.childLanes=0,r.lanes=o,r.child=null,r.subtreeFlags=0,r.memoizedProps=null,r.memoizedState=null,r.updateQueue=null,r.dependencies=null,r.stateNode=null):(r.childLanes=d.childLanes,r.lanes=d.lanes,r.child=d.child,r.subtreeFlags=0,r.deletions=null,r.memoizedProps=d.memoizedProps,r.memoizedState=d.memoizedState,r.updateQueue=d.updateQueue,r.type=d.type,o=d.dependencies,r.dependencies=o===null?null:{lanes:o.lanes,firstContext:o.firstContext}),r}function ao(r,o,d,g,M,C){var U=0;if(g=r,typeof r=="function")Zd(r)&&(U=1);else if(typeof r=="string")U=bD(r,d,oe.current)?26:r==="html"||r==="head"||r==="body"?27:5;else e:switch(r){case z:return r=$i(31,d,o,M),r.elementType=z,r.lanes=C,r;case R:return gl(d.children,M,C,o);case w:U=8,M|=24;break;case E:return r=$i(12,d,o,M|2),r.elementType=E,r.lanes=C,r;case G:return r=$i(13,d,o,M),r.elementType=G,r.lanes=C,r;case H:return r=$i(19,d,o,M),r.elementType=H,r.lanes=C,r;default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case L:U=10;break e;case D:U=9;break e;case P:U=11;break e;case F:U=14;break e;case X:U=16,g=null;break e}U=29,d=Error(n(130,r===null?"null":typeof r,"")),g=null}return o=$i(U,d,o,M),o.elementType=r,o.type=g,o.lanes=C,o}function gl(r,o,d,g){return r=$i(7,r,g,o),r.lanes=d,r}function Qd(r,o,d){return r=$i(6,r,null,o),r.lanes=d,r}function nu(r){var o=$i(18,null,null,0);return o.stateNode=r,o}function $d(r,o,d){return o=$i(4,r.children!==null?r.children:[],r.key,o),o.lanes=d,o.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},o}var xf=new WeakMap;function ra(r,o){if(typeof r=="object"&&r!==null){var d=xf.get(r);return d!==void 0?d:(o={value:r,source:o,stack:Ye(o)},xf.set(r,o),o)}return{value:r,source:o,stack:Ye(o)}}var vl=[],yl=0,iu=null,su=0,Or=[],ji=0,Uo=null,es=1,ja="";function oo(r,o){vl[yl++]=su,vl[yl++]=iu,iu=r,su=o}function Xg(r,o,d){Or[ji++]=es,Or[ji++]=ja,Or[ji++]=Uo,Uo=r;var g=es;r=ja;var M=32-Zt(g)-1;g&=~(1<<M),d+=1;var C=32-Zt(o)+M;if(30<C){var U=M-M%5;C=(g&(1<<U)-1).toString(32),g>>=U,M-=U,es=1<<32-Zt(o)+M|d<<M|g,ja=C+r}else es=1<<C|d<<M|g,ja=r}function lo(r){r.return!==null&&(oo(r,1),Xg(r,1,0))}function eh(r){for(;r===iu;)iu=vl[--yl],vl[yl]=null,su=vl[--yl],vl[yl]=null;for(;r===Uo;)Uo=Or[--ji],Or[ji]=null,ja=Or[--ji],Or[ji]=null,es=Or[--ji],Or[ji]=null}function th(r,o){Or[ji++]=es,Or[ji++]=ja,Or[ji++]=Uo,es=o.id,ja=o.overflow,Uo=r}var os=null,Pi=null,Wn=!1,zo=null,aa=!1,ru=Error(n(519));function co(r){var o=Error(n(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw uo(ra(o,r)),ru}function qg(r){var o=r.stateNode,d=r.type,g=r.memoizedProps;switch(o[hi]=r,o[Fi]=g,d){case"dialog":Yn("cancel",o),Yn("close",o);break;case"iframe":case"object":case"embed":Yn("load",o);break;case"video":case"audio":for(d=0;d<za.length;d++)Yn(za[d],o);break;case"source":Yn("error",o);break;case"img":case"image":case"link":Yn("error",o),Yn("load",o);break;case"details":Yn("toggle",o);break;case"input":Yn("invalid",o),Gi(o,g.value,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name,!0);break;case"select":Yn("invalid",o);break;case"textarea":Yn("invalid",o),no(o,g.value,g.defaultValue,g.children)}d=g.children,typeof d!="string"&&typeof d!="number"&&typeof d!="bigint"||o.textContent===""+d||g.suppressHydrationWarning===!0||TM(o.textContent,d)?(g.popover!=null&&(Yn("beforetoggle",o),Yn("toggle",o)),g.onScroll!=null&&Yn("scroll",o),g.onScrollEnd!=null&&Yn("scrollend",o),g.onClick!=null&&(o.onclick=Pe),o=!0):o=!1,o||co(r,!0)}function Yg(r){for(os=r.return;os;)switch(os.tag){case 5:case 31:case 13:aa=!1;return;case 27:case 3:aa=!0;return;default:os=os.return}}function au(r){if(r!==os)return!1;if(!Wn)return Yg(r),Wn=!0,!1;var o=r.tag,d;if((d=o!==3&&o!==27)&&((d=o===5)&&(d=r.type,d=!(d!=="form"&&d!=="button")||Db(r.type,r.memoizedProps)),d=!d),d&&Pi&&co(r),Yg(r),o===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Pi=OM(r)}else if(o===31){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));Pi=OM(r)}else o===27?(o=Pi,Tu(r.type)?(r=Ub,Ub=null,Pi=r):Pi=o):Pi=os?Eo(r.stateNode.nextSibling):null;return!0}function xl(){Pi=os=null,Wn=!1}function nh(){var r=zo;return r!==null&&(cs===null?cs=r:cs.push.apply(cs,r),zo=null),r}function uo(r){zo===null?zo=[r]:zo.push(r)}var ou=K(null),_l=null,fo=null;function Fo(r,o,d){re(ou,o._currentValue),o._currentValue=d}function ho(r){r._currentValue=ou.current,ce(ou)}function ih(r,o,d){for(;r!==null;){var g=r.alternate;if((r.childLanes&o)!==o?(r.childLanes|=o,g!==null&&(g.childLanes|=o)):g!==null&&(g.childLanes&o)!==o&&(g.childLanes|=o),r===d)break;r=r.return}}function sh(r,o,d,g){var M=r.child;for(M!==null&&(M.return=r);M!==null;){var C=M.dependencies;if(C!==null){var U=M.child;C=C.firstContext;e:for(;C!==null;){var $=C;C=M;for(var me=0;me<o.length;me++)if($.context===o[me]){C.lanes|=d,$=C.alternate,$!==null&&($.lanes|=d),ih(C.return,d,r),g||(U=null);break e}C=$.next}}else if(M.tag===18){if(U=M.return,U===null)throw Error(n(341));U.lanes|=d,C=U.alternate,C!==null&&(C.lanes|=d),ih(U,d,r),U=null}else U=M.child;if(U!==null)U.return=M;else for(U=M;U!==null;){if(U===r){U=null;break}if(M=U.sibling,M!==null){M.return=U.return,U=M;break}U=U.return}M=U}}function po(r,o,d,g){r=null;for(var M=o,C=!1;M!==null;){if(!C){if((M.flags&524288)!==0)C=!0;else if((M.flags&262144)!==0)break}if(M.tag===10){var U=M.alternate;if(U===null)throw Error(n(387));if(U=U.memoizedProps,U!==null){var $=M.type;Sr(M.pendingProps.value,U.value)||(r!==null?r.push($):r=[$])}}else if(M===pe.current){if(U=M.alternate,U===null)throw Error(n(387));U.memoizedState.memoizedState!==M.memoizedState.memoizedState&&(r!==null?r.push(e0):r=[e0])}M=M.return}r!==null&&sh(o,r,d,g),o.flags|=262144}function _f(r){for(r=r.firstContext;r!==null;){if(!Sr(r.context._currentValue,r.memoizedValue))return!0;r=r.next}return!1}function bl(r){_l=r,fo=null,r=r.dependencies,r!==null&&(r.firstContext=null)}function pn(r){return Jg(_l,r)}function lu(r,o){return _l===null&&bl(r),Jg(r,o)}function Jg(r,o){var d=o._currentValue;if(o={context:o,memoizedValue:d,next:null},fo===null){if(r===null)throw Error(n(308));fo=o,r.dependencies={lanes:0,firstContext:o},r.flags|=524288}else fo=fo.next=o;return d}var Kg=typeof AbortController<"u"?AbortController:function(){var r=[],o=this.signal={aborted:!1,addEventListener:function(d,g){r.push(g)}};this.abort=function(){o.aborted=!0,r.forEach(function(d){return d()})}},vb=i.unstable_scheduleCallback,yb=i.unstable_NormalPriority,ws={$$typeof:L,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function sm(){return{controller:new Kg,data:new Map,refCount:0}}function Zl(r){r.refCount--,r.refCount===0&&vb(yb,function(){r.controller.abort()})}var oa=null,rh=0,ko=0,Ta=null;function rm(r,o){if(oa===null){var d=oa=[];rh=0,ko=Xe(),Ta={status:"pending",value:void 0,then:function(g){d.push(g)}}}return rh++,o.then(am,am),o}function am(){if(--rh===0&&oa!==null){Ta!==null&&(Ta.status="fulfilled");var r=oa;oa=null,ko=0,Ta=null;for(var o=0;o<r.length;o++)(0,r[o])()}}function om(r,o){var d=[],g={status:"pending",value:null,reason:null,then:function(M){d.push(M)}};return r.then(function(){g.status="fulfilled",g.value=o;for(var M=0;M<d.length;M++)(0,d[M])(o)},function(M){for(g.status="rejected",g.reason=M,M=0;M<d.length;M++)(0,d[M])(void 0)}),g}var Zg=W.S;W.S=function(r,o){Ym=Ie(),typeof o=="object"&&o!==null&&typeof o.then=="function"&&rm(r,o),Zg!==null&&Zg(r,o)};var Sl=K(null);function ah(){var r=Sl.current;return r!==null?r:mn.pooledCache}function bf(r,o){o===null?re(Sl,Sl.current):re(Sl,o.pool)}function lm(){var r=ah();return r===null?null:{parent:ws._currentValue,pool:r}}var Ql=Error(n(460)),Sf=Error(n(474)),Rn=Error(n(542)),oh={then:function(){}};function Nr(r){return r=r.status,r==="fulfilled"||r==="rejected"}function lh(r,o,d){switch(d=r[d],d===void 0?r.push(o):d!==o&&(o.then(Pe,Pe),o=d),o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,tc(r),r;default:if(typeof o.status=="string")o.then(Pe,Pe);else{if(r=mn,r!==null&&100<r.shellSuspendCounter)throw Error(n(482));r=o,r.status="pending",r.then(function(g){if(o.status==="pending"){var M=o;M.status="fulfilled",M.value=g}},function(g){if(o.status==="pending"){var M=o;M.status="rejected",M.reason=g}})}switch(o.status){case"fulfilled":return o.value;case"rejected":throw r=o.reason,tc(r),r}throw mo=o,Ql}}function $l(r){try{var o=r._init;return o(r._payload)}catch(d){throw d!==null&&typeof d=="object"&&typeof d.then=="function"?(mo=d,Ql):d}}var mo=null;function ec(){if(mo===null)throw Error(n(459));var r=mo;return mo=null,r}function tc(r){if(r===Ql||r===Rn)throw Error(n(483))}var nc=null,ic=0;function Af(r){var o=ic;return ic+=1,nc===null&&(nc=[]),lh(nc,r,o)}function wa(r,o){o=o.props.ref,r.ref=o!==void 0?o:null}function cu(r,o){throw o.$$typeof===x?Error(n(525)):(r=Object.prototype.toString.call(o),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(o).join(", ")+"}":r)))}function ch(r){function o(Ee,be){if(r){var Ne=Ee.deletions;Ne===null?(Ee.deletions=[be],Ee.flags|=16):Ne.push(be)}}function d(Ee,be){if(!r)return null;for(;be!==null;)o(Ee,be),be=be.sibling;return null}function g(Ee){for(var be=new Map;Ee!==null;)Ee.key!==null?be.set(Ee.key,Ee):be.set(Ee.index,Ee),Ee=Ee.sibling;return be}function M(Ee,be){return Ee=Pr(Ee,be),Ee.index=0,Ee.sibling=null,Ee}function C(Ee,be,Ne){return Ee.index=Ne,r?(Ne=Ee.alternate,Ne!==null?(Ne=Ne.index,Ne<be?(Ee.flags|=67108866,be):Ne):(Ee.flags|=67108866,be)):(Ee.flags|=1048576,be)}function U(Ee){return r&&Ee.alternate===null&&(Ee.flags|=67108866),Ee}function $(Ee,be,Ne,at){return be===null||be.tag!==6?(be=Qd(Ne,Ee.mode,at),be.return=Ee,be):(be=M(be,Ne),be.return=Ee,be)}function me(Ee,be,Ne,at){var ln=Ne.type;return ln===R?rt(Ee,be,Ne.props.children,at,Ne.key):be!==null&&(be.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===X&&$l(ln)===be.type)?(be=M(be,Ne.props),wa(be,Ne),be.return=Ee,be):(be=ao(Ne.type,Ne.key,Ne.props,null,Ee.mode,at),wa(be,Ne),be.return=Ee,be)}function ze(Ee,be,Ne,at){return be===null||be.tag!==4||be.stateNode.containerInfo!==Ne.containerInfo||be.stateNode.implementation!==Ne.implementation?(be=$d(Ne,Ee.mode,at),be.return=Ee,be):(be=M(be,Ne.children||[]),be.return=Ee,be)}function rt(Ee,be,Ne,at,ln){return be===null||be.tag!==7?(be=gl(Ne,Ee.mode,at,ln),be.return=Ee,be):(be=M(be,Ne),be.return=Ee,be)}function ut(Ee,be,Ne){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return be=Qd(""+be,Ee.mode,Ne),be.return=Ee,be;if(typeof be=="object"&&be!==null){switch(be.$$typeof){case _:return Ne=ao(be.type,be.key,be.props,null,Ee.mode,Ne),wa(Ne,be),Ne.return=Ee,Ne;case A:return be=$d(be,Ee.mode,Ne),be.return=Ee,be;case X:return be=$l(be),ut(Ee,be,Ne)}if(ae(be)||ve(be))return be=gl(be,Ee.mode,Ne,null),be.return=Ee,be;if(typeof be.then=="function")return ut(Ee,Af(be),Ne);if(be.$$typeof===L)return ut(Ee,lu(Ee,be),Ne);cu(Ee,be)}return null}function Ge(Ee,be,Ne,at){var ln=be!==null?be.key:null;if(typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint")return ln!==null?null:$(Ee,be,""+Ne,at);if(typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case _:return Ne.key===ln?me(Ee,be,Ne,at):null;case A:return Ne.key===ln?ze(Ee,be,Ne,at):null;case X:return Ne=$l(Ne),Ge(Ee,be,Ne,at)}if(ae(Ne)||ve(Ne))return ln!==null?null:rt(Ee,be,Ne,at,null);if(typeof Ne.then=="function")return Ge(Ee,be,Af(Ne),at);if(Ne.$$typeof===L)return Ge(Ee,be,lu(Ee,Ne),at);cu(Ee,Ne)}return null}function Ke(Ee,be,Ne,at,ln){if(typeof at=="string"&&at!==""||typeof at=="number"||typeof at=="bigint")return Ee=Ee.get(Ne)||null,$(be,Ee,""+at,ln);if(typeof at=="object"&&at!==null){switch(at.$$typeof){case _:return Ee=Ee.get(at.key===null?Ne:at.key)||null,me(be,Ee,at,ln);case A:return Ee=Ee.get(at.key===null?Ne:at.key)||null,ze(be,Ee,at,ln);case X:return at=$l(at),Ke(Ee,be,Ne,at,ln)}if(ae(at)||ve(at))return Ee=Ee.get(Ne)||null,rt(be,Ee,at,ln,null);if(typeof at.then=="function")return Ke(Ee,be,Ne,Af(at),ln);if(at.$$typeof===L)return Ke(Ee,be,Ne,lu(be,at),ln);cu(be,at)}return null}function Jt(Ee,be,Ne,at){for(var ln=null,gi=null,Qt=be,On=be=0,Qn=null;Qt!==null&&On<Ne.length;On++){Qt.index>On?(Qn=Qt,Qt=null):Qn=Qt.sibling;var vi=Ge(Ee,Qt,Ne[On],at);if(vi===null){Qt===null&&(Qt=Qn);break}r&&Qt&&vi.alternate===null&&o(Ee,Qt),be=C(vi,be,On),gi===null?ln=vi:gi.sibling=vi,gi=vi,Qt=Qn}if(On===Ne.length)return d(Ee,Qt),Wn&&oo(Ee,On),ln;if(Qt===null){for(;On<Ne.length;On++)Qt=ut(Ee,Ne[On],at),Qt!==null&&(be=C(Qt,be,On),gi===null?ln=Qt:gi.sibling=Qt,gi=Qt);return Wn&&oo(Ee,On),ln}for(Qt=g(Qt);On<Ne.length;On++)Qn=Ke(Qt,Ee,On,Ne[On],at),Qn!==null&&(r&&Qn.alternate!==null&&Qt.delete(Qn.key===null?On:Qn.key),be=C(Qn,be,On),gi===null?ln=Qn:gi.sibling=Qn,gi=Qn);return r&&Qt.forEach(function(Iu){return o(Ee,Iu)}),Wn&&oo(Ee,On),ln}function hn(Ee,be,Ne,at){if(Ne==null)throw Error(n(151));for(var ln=null,gi=null,Qt=be,On=be=0,Qn=null,vi=Ne.next();Qt!==null&&!vi.done;On++,vi=Ne.next()){Qt.index>On?(Qn=Qt,Qt=null):Qn=Qt.sibling;var Iu=Ge(Ee,Qt,vi.value,at);if(Iu===null){Qt===null&&(Qt=Qn);break}r&&Qt&&Iu.alternate===null&&o(Ee,Qt),be=C(Iu,be,On),gi===null?ln=Iu:gi.sibling=Iu,gi=Iu,Qt=Qn}if(vi.done)return d(Ee,Qt),Wn&&oo(Ee,On),ln;if(Qt===null){for(;!vi.done;On++,vi=Ne.next())vi=ut(Ee,vi.value,at),vi!==null&&(be=C(vi,be,On),gi===null?ln=vi:gi.sibling=vi,gi=vi);return Wn&&oo(Ee,On),ln}for(Qt=g(Qt);!vi.done;On++,vi=Ne.next())vi=Ke(Qt,Ee,On,vi.value,at),vi!==null&&(r&&vi.alternate!==null&&Qt.delete(vi.key===null?On:vi.key),be=C(vi,be,On),gi===null?ln=vi:gi.sibling=vi,gi=vi);return r&&Qt.forEach(function(DD){return o(Ee,DD)}),Wn&&oo(Ee,On),ln}function Ui(Ee,be,Ne,at){if(typeof Ne=="object"&&Ne!==null&&Ne.type===R&&Ne.key===null&&(Ne=Ne.props.children),typeof Ne=="object"&&Ne!==null){switch(Ne.$$typeof){case _:e:{for(var ln=Ne.key;be!==null;){if(be.key===ln){if(ln=Ne.type,ln===R){if(be.tag===7){d(Ee,be.sibling),at=M(be,Ne.props.children),at.return=Ee,Ee=at;break e}}else if(be.elementType===ln||typeof ln=="object"&&ln!==null&&ln.$$typeof===X&&$l(ln)===be.type){d(Ee,be.sibling),at=M(be,Ne.props),wa(at,Ne),at.return=Ee,Ee=at;break e}d(Ee,be);break}else o(Ee,be);be=be.sibling}Ne.type===R?(at=gl(Ne.props.children,Ee.mode,at,Ne.key),at.return=Ee,Ee=at):(at=ao(Ne.type,Ne.key,Ne.props,null,Ee.mode,at),wa(at,Ne),at.return=Ee,Ee=at)}return U(Ee);case A:e:{for(ln=Ne.key;be!==null;){if(be.key===ln)if(be.tag===4&&be.stateNode.containerInfo===Ne.containerInfo&&be.stateNode.implementation===Ne.implementation){d(Ee,be.sibling),at=M(be,Ne.children||[]),at.return=Ee,Ee=at;break e}else{d(Ee,be);break}else o(Ee,be);be=be.sibling}at=$d(Ne,Ee.mode,at),at.return=Ee,Ee=at}return U(Ee);case X:return Ne=$l(Ne),Ui(Ee,be,Ne,at)}if(ae(Ne))return Jt(Ee,be,Ne,at);if(ve(Ne)){if(ln=ve(Ne),typeof ln!="function")throw Error(n(150));return Ne=ln.call(Ne),hn(Ee,be,Ne,at)}if(typeof Ne.then=="function")return Ui(Ee,be,Af(Ne),at);if(Ne.$$typeof===L)return Ui(Ee,be,lu(Ee,Ne),at);cu(Ee,Ne)}return typeof Ne=="string"&&Ne!==""||typeof Ne=="number"||typeof Ne=="bigint"?(Ne=""+Ne,be!==null&&be.tag===6?(d(Ee,be.sibling),at=M(be,Ne),at.return=Ee,Ee=at):(d(Ee,be),at=Qd(Ne,Ee.mode,at),at.return=Ee,Ee=at),U(Ee)):d(Ee,be)}return function(Ee,be,Ne,at){try{ic=0;var ln=Ui(Ee,be,Ne,at);return nc=null,ln}catch(Qt){if(Qt===Ql||Qt===Rn)throw Qt;var gi=$i(29,Qt,null,Ee.mode);return gi.lanes=at,gi.return=Ee,gi}finally{}}}var Ho=ch(!0),uh=ch(!1),Mr=!1;function Mf(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function cm(r,o){r=r.updateQueue,o.updateQueue===r&&(o.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,callbacks:null})}function Go(r){return{lane:r,tag:0,payload:null,callback:null,next:null}}function Al(r,o,d){var g=r.updateQueue;if(g===null)return null;if(g=g.shared,(en&2)!==0){var M=g.pending;return M===null?o.next=o:(o.next=M.next,M.next=o),g.pending=o,o=Ea(r),pl(r,null,d),o}return qs(r,g,o,d),Ea(r)}function Ml(r,o,d){if(o=o.updateQueue,o!==null&&(o=o.shared,(d&4194048)!==0)){var g=o.lanes;g&=r.pendingLanes,d|=g,o.lanes=d,yr(r,d)}}function on(r,o){var d=r.updateQueue,g=r.alternate;if(g!==null&&(g=g.updateQueue,d===g)){var M=null,C=null;if(d=d.firstBaseUpdate,d!==null){do{var U={lane:d.lane,tag:d.tag,payload:d.payload,callback:null,next:null};C===null?M=C=U:C=C.next=U,d=d.next}while(d!==null);C===null?M=C=o:C=C.next=o}else M=C=o;d={baseState:g.baseState,firstBaseUpdate:M,lastBaseUpdate:C,shared:g.shared,callbacks:g.callbacks},r.updateQueue=d;return}r=d.lastBaseUpdate,r===null?d.firstBaseUpdate=o:r.next=o,d.lastBaseUpdate=o}var um=!1;function Ef(){if(um){var r=Ta;if(r!==null)throw r}}function uu(r,o,d,g){um=!1;var M=r.updateQueue;Mr=!1;var C=M.firstBaseUpdate,U=M.lastBaseUpdate,$=M.shared.pending;if($!==null){M.shared.pending=null;var me=$,ze=me.next;me.next=null,U===null?C=ze:U.next=ze,U=me;var rt=r.alternate;rt!==null&&(rt=rt.updateQueue,$=rt.lastBaseUpdate,$!==U&&($===null?rt.f
vendor: 6,252 bytes, line 48
48irstBaseUpdate=ze:$.next=ze,rt.lastBaseUpdate=me))}if(C!==null){var ut=M.baseState;U=0,rt=ze=me=null,$=C;do{var Ge=$.lane&-536870913,Ke=Ge!==$.lane;if(Ke?(wn&Ge)===Ge:(g&Ge)===Ge){Ge!==0&&Ge===ko&&(um=!0),rt!==null&&(rt=rt.next={lane:0,tag:$.tag,payload:$.payload,callback:null,next:null});e:{var Jt=r,hn=$;Ge=o;var Ui=d;switch(hn.tag){case 1:if(Jt=hn.payload,typeof Jt=="function"){ut=Jt.call(Ui,ut,Ge);break e}ut=Jt;break e;case 3:Jt.flags=Jt.flags&-65537|128;case 0:if(Jt=hn.payload,Ge=typeof Jt=="function"?Jt.call(Ui,ut,Ge):Jt,Ge==null)break e;ut=v({},ut,Ge);break e;case 2:Mr=!0}}Ge=$.callback,Ge!==null&&(r.flags|=64,Ke&&(r.flags|=8192),Ke=M.callbacks,Ke===null?M.callbacks=[Ge]:Ke.push(Ge))}else Ke={lane:Ge,tag:$.tag,payload:$.payload,callback:$.callback,next:null},rt===null?(ze=rt=Ke,me=ut):rt=rt.next=Ke,U|=Ge;if($=$.next,$===null){if($=M.shared.pending,$===null)break;Ke=$,$=Ke.next,Ke.next=null,M.lastBaseUpdate=Ke,M.shared.pending=null}}while(!0);rt===null&&(me=ut),M.baseState=me,M.firstBaseUpdate=ze,M.lastBaseUpdate=rt,C===null&&(M.shared.lanes=0),So|=U,r.lanes=U,r.memoizedState=ut}}function fu(r,o){if(typeof r!="function")throw Error(n(191,r));r.call(o)}function Qg(r,o){var d=r.callbacks;if(d!==null)for(r.callbacks=null,r=0;r<d.length;r++)fu(d[r],o)}var du=K(null),fh=K(0);function $g(r,o){r=fa,re(fh,r),re(du,o),fa=r|o.baseLanes}function fm(){re(fh,fa),re(du,du.current)}function Tf(){fa=fh.current,ce(du),ce(fh)}var Ur=K(null),Er=null;function jo(r){var o=r.alternate;re(Xn,Xn.current&1),re(Ur,r),Er===null&&(o===null||du.current!==null||o.memoizedState!==null)&&(Er=r)}function dm(r){re(Xn,Xn.current),re(Ur,r),Er===null&&(Er=r)}function ev(r){r.tag===22?(re(Xn,Xn.current),re(Ur,r),Er===null&&(Er=r)):zr()}function zr(){re(Xn,Xn.current),re(Ur,Ur.current)}function gs(r){ce(Ur),Er===r&&(Er=null),ce(Xn)}var Xn=K(0);function la(r){for(var o=r;o!==null;){if(o.tag===13){var d=o.memoizedState;if(d!==null&&(d=d.dehydrated,d===null||Ob(d)||Nb(d)))return o}else if(o.tag===19&&(o.memoizedProps.revealOrder==="forwards"||o.memoizedProps.revealOrder==="backwards"||o.memoizedProps.revealOrder==="unstable_legacy-backwards"||o.memoizedProps.revealOrder==="together")){if((o.flags&128)!==0)return o}else if(o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return null;o=o.return}o.sibling.return=o.return,o=o.sibling}return null}var Vi=0,_n=null,Ei=null,Hn=null,Ca=!1,hu=!1,sc=!1,dh=0,wf=0,pu=null,hm=0;function ts(){throw Error(n(321))}function pm(r,o){if(o===null)return!1;for(var d=0;d<o.length&&d<r.length;d++)if(!Sr(r[d],o[d]))return!1;return!0}function hh(r,o,d,g,M,C){return Vi=C,_n=o,o.memoizedState=null,o.updateQueue=null,o.lanes=0,W.H=r===null||r.memoizedState===null?Dv:Pm,sc=!1,C=d(g,M),sc=!1,hu&&(C=rc(o,d,g,M)),tv(r),C}function tv(r){W.H=mu;var o=Ei!==null&&Ei.next!==null;if(Vi=0,Hn=Ei=_n=null,Ca=!1,wf=0,pu=null,o)throw Error(n(300));r===null||Cs||(r=r.dependencies,r!==null&&_f(r)&&(Cs=!0))}function rc(r,o,d,g){_n=r;var M=0;do{if(hu&&(pu=null),wf=0,hu=!1,25<=M)throw Error(n(301));if(M+=1,Hn=Ei=null,r.updateQueue!=null){var C=r.updateQueue;C.lastEffect=null,C.events=null,C.stores=null,C.memoCache!=null&&(C.memoCache.index=0)}W.H=Ra,C=o(d,g)}while(hu);return C}function ac(){var r=W.H,o=r.useState()[0];return o=typeof o.then=="function"?Cf(o):o,r=r.useState()[0],(Ei!==null?Ei.memoizedState:null)!==r&&(_n.flags|=1024),o}function mm(){var r=dh!==0;return dh=0,r}function gm(r,o,d){o.updateQueue=r.updateQueue,o.flags&=-2053,r.lanes&=~d}function vm(r){if(Ca){for(r=r.memoizedState;r!==null;){var o=r.queue;o!==null&&(o.pending=null),r=r.next}Ca=!1}Vi=0,Hn=Ei=_n=null,hu=!1,wf=dh=0,pu=null}function Os(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Hn===null?_n.memoizedState=Hn=r:Hn=Hn.next=r,Hn}function vs(){if(Ei===null){var r=_n.alternate;r=r!==null?r.memoizedState:null}else r=Ei.next;var o=Hn===null?_n.memoizedState:Hn.next;if(o!==null)Hn=o,Ei=r;else{if(r===null)throw _n.alternate===null?Error(n(467)):Error(n(310));Ei=r,r={memoizedState:Ei.memoizedState,baseState:Ei.baseState,baseQueue:Ei.baseQueue,queue:Ei.queue,next:null},Hn===null?_n.memoizedState=Hn=r:Hn=Hn.next=r}return Hn}function ph(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Cf(r){var o=wf;return wf+=1,pu===null&&(pu=[]),r=lh(pu,r,o),o=_n,(Hn===null?o.memoizedState:Hn.next)===null&&(o=o.alternate,W.H=o===null||o.memoizedState===null?Dv:Pm),r}function El(r){if(r!==null&&typeof r=="object"){if(typeof r.then=="function")return Cf(r);if(r.$$typeof===L)return pn(r)}throw Error(n(438,String(r)))}function ym(r){var o=null,d=_n.updateQueue;if(d!==null&&(o=d.memoCache),o==null){var g=_n.alternate;g!==null&&(g=g.updateQueue,g!==null&&(g=g.memoCache,g!=null&&(o={data:g.data.map(function(M){return M.slice()}),index:0})))}if(o==null&&(o={data:[],index:0}),d===null&&(d=ph(),_n.updateQueue=d),d.memoCache=o,d=o.data[o.index],d===void 0)for(d=o.data[o.index]=Array(r),g=0;g<r;g++)d[g]=k;return o.index++,d}function Vo(r,o){return typeof o=="function"?o(r):o}function mh(r){var o=vs();return xm(o,Ei,r)}function xm(r,o,d){var g=r.queue;if(g===null)throw Error(n(311));g.lastRenderedReducer=d;var M=r.baseQueue,C=g.pending;if(C!==null){if(M!==null){var U=M.next;M.next=C.next,C.next=U}o.baseQueue=M=C,g.pending=null}if(C=r.baseState,M===null)r.memoizedState=C;else{o=M.next;var $=U=null,me=null,ze=o,rt=!1;do{var ut=ze.lane&-536870913;if(ut!==ze.lane?(wn&ut)===ut:(Vi&ut)===ut){var Ge=ze.revertLane;if(Ge===0)me!==null&&(me=me.next={lane:0,revertLane:0,gesture:null,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null}),ut===ko&&(rt=!0);else if((Vi&Ge)===Ge){ze=ze.next,Ge===ko&&(rt=!0);continue}else ut={lane:0,revertLane:ze.revertLane,gesture:null,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null},me===null?($=me=ut,U=C):me=me.next=ut,_n.lanes|=Ge,So|=Ge;ut=ze.action,sc&&d(C,ut),C=ze.hasEagerState?ze.eagerState:d(C,ut)}else Ge={lane:ut,revertLane:ze.revertLane,gesture:ze.gesture,action:ze.action,hasEagerState:ze.hasEagerState,eagerState:ze.eagerState,next:null},me===null?($=me=Ge,U=C):me=me.next=Ge,_n.lanes|=ut,So|=ut;ze=ze.next}
vendor: 9,546 bytes, line 48
48while(ze!==null&&ze!==o);if(me===null?U=C:me.next=$,!Sr(C,r.memoizedState)&&(Cs=!0,rt&&(d=Ta,d!==null)))throw d;r.memoizedState=C,r.baseState=U,r.baseQueue=me,g.lastRenderedState=C}return M===null&&(g.lanes=0),[r.memoizedState,g.dispatch]}function _m(r){var o=vs(),d=o.queue;if(d===null)throw Error(n(311));d.lastRenderedReducer=r;var g=d.dispatch,M=d.pending,C=o.memoizedState;if(M!==null){d.pending=null;var U=M=M.next;do C=r(C,U.action),U=U.next;while(U!==M);Sr(C,o.memoizedState)||(Cs=!0),o.memoizedState=C,o.baseQueue===null&&(o.baseState=C),d.lastRenderedState=C}return[C,g]}function nv(r,o,d){var g=_n,M=vs(),C=Wn;if(C){if(d===void 0)throw Error(n(407));d=d()}else d=o();var U=!Sr((Ei||M).memoizedState,d);if(U&&(M.memoizedState=d,Cs=!0),M=M.queue,Cm(rv.bind(null,g,M,r),[r]),M.getSnapshot!==o||U||Hn!==null&&Hn.memoizedState.tag&1){if(g.flags|=2048,Tl(9,{destroy:void 0},sv.bind(null,g,M,d,o),null),mn===null)throw Error(n(349));C||(Vi&127)!==0||iv(g,o,d)}return d}function iv(r,o,d){r.flags|=16384,r={getSnapshot:o,value:d},o=_n.updateQueue,o===null?(o=ph(),_n.updateQueue=o,o.stores=[r]):(d=o.stores,d===null?o.stores=[r]:d.push(r))}function sv(r,o,d,g){o.value=d,o.getSnapshot=g,av(o)&&ov(r)}function rv(r,o,d){return d(function(){av(o)&&ov(r)})}function av(r){var o=r.getSnapshot;r=r.value;try{var d=o();return!Sr(r,d)}catch{return!0}}function ov(r){var o=Ar(r,2);o!==null&&In(o,r,2)}function bm(r){var o=Os();if(typeof r=="function"){var d=r;if(r=d(),sc){ft(!0);try{d()}finally{ft(!1)}}}return o.memoizedState=o.baseState=r,o.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:r},o}function Sm(r,o,d,g){return r.baseState=d,xm(r,Ei,typeof g=="function"?g:Vo)}function xb(r,o,d,g,M){if(xh(r))throw Error(n(485));if(r=o.action,r!==null){var C={payload:M,action:r,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){C.listeners.push(U)}};W.T!==null?d(!0):C.isTransition=!1,g(C),d=o.pending,d===null?(C.next=o.pending=C,lv(o,C)):(C.next=d.next,o.pending=d.next=C)}}function lv(r,o){var d=o.action,g=o.payload,M=r.state;if(o.isTransition){var C=W.T,U={};W.T=U;try{var $=d(M,g),me=W.S;me!==null&&me(U,$),cv(r,o,$)}catch(ze){Am(r,o,ze)}finally{C!==null&&U.types!==null&&(C.types=U.types),W.T=C}}else try{C=d(M,g),cv(r,o,C)}catch(ze){Am(r,o,ze)}}function cv(r,o,d){d!==null&&typeof d=="object"&&typeof d.then=="function"?d.then(function(g){uv(r,o,g)},function(g){return Am(r,o,g)}):uv(r,o,d)}function uv(r,o,d){o.status="fulfilled",o.value=d,fv(o),r.state=d,o=r.pending,o!==null&&(d=o.next,d===o?r.pending=null:(d=d.next,o.next=d,lv(r,d)))}function Am(r,o,d){var g=r.pending;if(r.pending=null,g!==null){g=g.next;do o.status="rejected",o.reason=d,fv(o),o=o.next;while(o!==g)}r.action=null}function fv(r){r=r.listeners;for(var o=0;o<r.length;o++)(0,r[o])()}function Mm(r,o){return o}function Em(r,o){if(Wn){var d=mn.formState;if(d!==null){e:{var g=_n;if(Wn){if(Pi){t:{for(var M=Pi,C=aa;M.nodeType!==8;){if(!C){M=null;break t}if(M=Eo(M.nextSibling),M===null){M=null;break t}}C=M.data,M=C==="F!"||C==="F"?M:null}if(M){Pi=Eo(M.nextSibling),g=M.data==="F!";break e}}co(g)}g=!1}g&&(o=d[0])}}return d=Os(),d.memoizedState=d.baseState=o,g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mm,lastRenderedState:o},d.queue=g,d=Rv.bind(null,_n,g),g.dispatch=d,g=bm(!1),C=Lm.bind(null,_n,!1,g.queue),g=Os(),M={state:o,dispatch:null,action:r,pending:null},g.queue=M,d=xb.bind(null,_n,M,C,d),M.dispatch=d,g.memoizedState=r,[o,d,!1]}function dv(r){var o=vs();return Tm(o,Ei,r)}function Tm(r,o,d){if(o=xm(r,o,Mm)[0],r=mh(Vo)[0],typeof o=="object"&&o!==null&&typeof o.then=="function")try{var g=Cf(o)}catch(U){throw U===Ql?Rn:U}else g=o;o=vs();var M=o.queue,C=M.dispatch;return d!==o.memoizedState&&(_n.flags|=2048,Tl(9,{destroy:void 0},hv.bind(null,M,d),null)),[g,C,r]}function hv(r,o){r.action=o}function wm(r){var o=vs(),d=Ei;if(d!==null)return Tm(o,d,r);vs(),o=o.memoizedState,d=vs();var g=d.queue.dispatch;return d.memoizedState=r,[o,g,!1]}function Tl(r,o,d,g){return r={tag:r,create:d,deps:g,inst:o,next:null},o=_n.updateQueue,o===null&&(o=ph(),_n.updateQueue=o),d=o.lastEffect,d===null?o.lastEffect=r.next=r:(g=d.next,d.next=r,r.next=g,o.lastEffect=r),r}function gh(){return vs().memoizedState}function vh(r,o,d,g){var M=Os();_n.flags|=r,M.memoizedState=Tl(1|o,{destroy:void 0},d,g===void 0?null:g)}function yh(r,o,d,g){var M=vs();g=g===void 0?null:g;var C=M.memoizedState.inst;Ei!==null&&g!==null&&pm(g,Ei.memoizedState.deps)?M.memoizedState=Tl(o,C,d,g):(_n.flags|=r,M.memoizedState=Tl(1|o,C,d,g))}function pv(r,o){vh(8390656,8,r,o)}function Cm(r,o){yh(2048,8,r,o)}function mv(r){_n.flags|=4;var o=_n.updateQueue;if(o===null)o=ph(),_n.updateQueue=o,o.events=[r];else{var d=o.events;d===null?o.events=[r]:d.push(r)}}function gv(r){var o=vs().memoizedState;return mv({ref:o,nextImpl:r}),function(){if((en&2)!==0)throw Error(n(440));return o.impl.apply(void 0,arguments)}}function vv(r,o){return yh(4,2,r,o)}function yv(r,o){return yh(4,4,r,o)}function xv(r,o){if(typeof o=="function"){r=r();var d=o(r);return function(){typeof d=="function"?d():o(null)}}if(o!=null)return r=r(),o.current=r,function(){o.current=null}}function _v(r,o,d){d=d!=null?d.concat([r]):null,yh(4,4,xv.bind(null,o,r),d)}function Rm(){}function bv(r,o){var d=vs();o=o===void 0?null:o;var g=d.memoizedState;return o!==null&&pm(o,g[1])?g[0]:(d.memoizedState=[r,o],r)}function Sv(r,o){var d=vs();o=o===void 0?null:o;var g=d.memoizedState;if(o!==null&&pm(o,g[1]))return g[0];if(g=r(),sc){ft(!0);try{r()}finally{ft(!1)}}return d.memoizedState=[g,o],g}function Bm(r,o,d){return d===void 0||(Vi&1073741824)!==0&&(wn&261930)===0?r.memoizedState=o:(r.memoizedState=d,r=zn(),_n.lanes|=r,So|=r,d)}function Av(r,o,d,g){return Sr(d,o)?d:du.current!==null?(r=Bm(r,d,g),Sr(r,o)||(Cs=!0),r):(Vi&42)===0||(Vi&1073741824)!==0&&(wn&261930)===0?(Cs=!0,r.memoizedState=d):(r=zn(),_n.lanes|=r,So|=r,o)}function Mv(r,o,d,g,M){var C=ee.p;ee.p=C!==0&&8>C?C:8;var U=W.T,$={};W.T=$,Lm(r,!1,o,d);try{var me=M(),ze=W.S;if(ze!==null&&ze($,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var rt=om(me,g);Rf(r,o,rt,ha(r))}else Rf(r,o,g,ha(r))}catch(ut){Rf(r,o,{then:function(){},status:"rejected",reason:ut},ha())}finally{ee.p=C,U!==null&&$.types!==null&&(U.types=$.types),W.T=U}}function _b(){}function Im(r,o,d,g){if(r.tag!==5)throw Error(n(476));var M=Ev(r).queue;Mv(r,M,o,te,d===null?_b:function(){return Tv(r),d(g)})}function Ev(r){var o=r.memoizedState;if(o!==null)return o;o={memoizedState:te,baseState:te,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:te},next:null};var d={};return o.next={memoizedState:d,baseState:d,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vo,lastRenderedState:d},next:null},r.memoizedState=o,r=r.alternate,r!==null&&(r.memoizedState=o),o}function Tv(r){var o=Ev(r);o.next===null&&(o=r.alternate.memoizedState),Rf(r,o.next.queue,{},ha())}function Dm(){return pn(e0)}function wv(){return vs().memoizedState}function Cv(){return vs().memoizedState}function bb(r){for(var o=r.return;o!==null;){switch(o.tag){case 24:case 3:var d=ha();r=Go(d);var g=Al(o,r,d);g!==null&&(In(g,o,d),Ml(g,o,d)),o={cache:sm()},r.payload=o;return}o=o.return}}function Sb(r,o,d){var g=ha();d={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null},xh(r)?Bv(o,d):(d=Kd(r,o,d,g),d!==null&&(In(d,r,g),Iv(d,o,g)))}function Rv(r,o,d){var g=ha();Rf(r,o,d,g)}function Rf(r,o,d,g){var M={lane:g,revertLane:0,gesture:null,action:d,hasEagerState:!1,eagerState:null,next:null};if(xh(r))Bv(o,M);else{var C=r.alternate;if(r.lanes===0&&(C===null||C.lanes===0)&&(C=o.lastRenderedReducer,C!==null))try{var U=o.lastRenderedState,$=C(U,d);if(M.hasEagerState=!0,M.eagerState=$,Sr($,U))return qs(r,o,M,0),mn===null&&yf(),!1}catch{}finally{}if(d=Kd(r,o,M,g),d!==null)return In(d,r,g),Iv(d,o,g),!0}return!1}function Lm(r,o,d,g){if(g={lane:2,revertLane:Xe(),gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},xh(r)){if(o)throw Error(n(479))}else o=Kd(r,d,g,2),o!==null&&In(o,r,2)}function xh(r){var o=r.alternate;return r===_n||o!==null&&o===_n}function Bv(r,o){hu=Ca=!0;var d=r.pending;d===null?o.next=o:(o.next=d.next,d.next=o),r.pending=o}function Iv(r,o,d){if((d&4194048)!==0){var g=o.lanes;g&=r.pendingLanes,d|=g,o.lanes=d,yr(r,d)}}var mu={readContext:pn,use:El,useCallback:ts,useContext:ts,useEffect:ts,useImperativeHandle:ts,useLayoutEffect:ts,useInsertionEffect:ts,useMemo:ts,useReducer:ts,useRef:ts,useState:ts,useDebugValue:ts,useDeferredValue:ts,useTransition:ts,useSyncExternalStore:ts,useId:ts,useHostTransitionStatus:ts,useFormState:ts,useActionState:ts,useOptimistic:ts,useMemoCache:ts,useCacheRefresh:ts};mu.useEffectEvent=ts;var Dv={readContext:pn,use:El,useCallback:function(r,o){return Os().memoizedState=[r,o===void 0?null:o],r},useContext:pn,useEffect:pv,useImperativeHandle:function(r,o,d){d=d!=null?d.concat([r]):null,vh(4194308,4,xv.bind(null,o,r),d)},useLayoutEffect:function(r,o){return vh(4194308,4,r,o)},useInsertionEffect:function(r,o){vh(4,2,r,o)},useMemo:function(r,o){var d=Os();o=o===void 0?null:o;var g=r();if(sc){ft(!0);try{r()}finally{ft(!1)}}return d.memoizedState=[g,o],g},useReducer:function(r,o,d){var g=Os();if(d!==void 0){var M=d(o);if(sc){ft(!0);try{d(o)}finally{ft(!1)}}}else M=o;return g.memoizedState=g.baseState=M,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:M},g.queue=r,r=r.dispatch=Sb.bind(null,_n,r),[g.memoizedState,r]}
vendor: 16,625 bytes, line 48
48,useRef:function(r){var o=Os();return r={current:r},o.memoizedState=r},useState:function(r){r=bm(r);var o=r.queue,d=Rv.bind(null,_n,o);return o.dispatch=d,[r.memoizedState,d]},useDebugValue:Rm,useDeferredValue:function(r,o){var d=Os();return Bm(d,r,o)},useTransition:function(){var r=bm(!1);return r=Mv.bind(null,_n,r.queue,!0,!1),Os().memoizedState=r,[!1,r]},useSyncExternalStore:function(r,o,d){var g=_n,M=Os();if(Wn){if(d===void 0)throw Error(n(407));d=d()}else{if(d=o(),mn===null)throw Error(n(349));(wn&127)!==0||iv(g,o,d)}M.memoizedState=d;var C={value:d,getSnapshot:o};return M.queue=C,pv(rv.bind(null,g,C,r),[r]),g.flags|=2048,Tl(9,{destroy:void 0},sv.bind(null,g,C,d,o),null),d},useId:function(){var r=Os(),o=mn.identifierPrefix;if(Wn){var d=ja,g=es;d=(g&~(1<<32-Zt(g)-1)).toString(32)+d,o="_"+o+"R_"+d,d=dh++,0<d&&(o+="H"+d.toString(32)),o+="_"}else d=hm++,o="_"+o+"r_"+d.toString(32)+"_";return r.memoizedState=o},useHostTransitionStatus:Dm,useFormState:Em,useActionState:Em,useOptimistic:function(r){var o=Os();o.memoizedState=o.baseState=r;var d={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return o.queue=d,o=Lm.bind(null,_n,!0,d),d.dispatch=o,[r,o]},useMemoCache:ym,useCacheRefresh:function(){return Os().memoizedState=bb.bind(null,_n)},useEffectEvent:function(r){var o=Os(),d={impl:r};return o.memoizedState=d,function(){if((en&2)!==0)throw Error(n(440));return d.impl.apply(void 0,arguments)}}},Pm={readContext:pn,use:El,useCallback:bv,useContext:pn,useEffect:Cm,useImperativeHandle:_v,useInsertionEffect:vv,useLayoutEffect:yv,useMemo:Sv,useReducer:mh,useRef:gh,useState:function(){return mh(Vo)},useDebugValue:Rm,useDeferredValue:function(r,o){var d=vs();return Av(d,Ei.memoizedState,r,o)},useTransition:function(){var r=mh(Vo)[0],o=vs().memoizedState;return[typeof r=="boolean"?r:Cf(r),o]},useSyncExternalStore:nv,useId:wv,useHostTransitionStatus:Dm,useFormState:dv,useActionState:dv,useOptimistic:function(r,o){var d=vs();return Sm(d,Ei,r,o)},useMemoCache:ym,useCacheRefresh:Cv};Pm.useEffectEvent=gv;var Ra={readContext:pn,use:El,useCallback:bv,useContext:pn,useEffect:Cm,useImperativeHandle:_v,useInsertionEffect:vv,useLayoutEffect:yv,useMemo:Sv,useReducer:_m,useRef:gh,useState:function(){return _m(Vo)},useDebugValue:Rm,useDeferredValue:function(r,o){var d=vs();return Ei===null?Bm(d,r,o):Av(d,Ei.memoizedState,r,o)},useTransition:function(){var r=_m(Vo)[0],o=vs().memoizedState;return[typeof r=="boolean"?r:Cf(r),o]},useSyncExternalStore:nv,useId:wv,useHostTransitionStatus:Dm,useFormState:wm,useActionState:wm,useOptimistic:function(r,o){var d=vs();return Ei!==null?Sm(d,Ei,r,o):(d.baseState=r,[r,d.queue.dispatch])},useMemoCache:ym,useCacheRefresh:Cv};Ra.useEffectEvent=gv;function _h(r,o,d,g){o=r.memoizedState,d=d(g,o),d=d==null?o:v({},o,d),r.memoizedState=d,r.lanes===0&&(r.updateQueue.baseState=d)}var Bf={enqueueSetState:function(r,o,d){r=r._reactInternals;var g=ha(),M=Go(g);M.payload=o,d!=null&&(M.callback=d),o=Al(r,M,g),o!==null&&(In(o,r,g),Ml(o,r,g))},enqueueReplaceState:function(r,o,d){r=r._reactInternals;var g=ha(),M=Go(g);M.tag=1,M.payload=o,d!=null&&(M.callback=d),o=Al(r,M,g),o!==null&&(In(o,r,g),Ml(o,r,g))},enqueueForceUpdate:function(r,o){r=r._reactInternals;var d=ha(),g=Go(d);g.tag=2,o!=null&&(g.callback=o),o=Al(r,g,d),o!==null&&(In(o,r,d),Ml(o,r,d))}};function Om(r,o,d,g,M,C,U){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(g,C,U):o.prototype&&o.prototype.isPureReactComponent?!Zc(d,g)||!Zc(M,C):!0}function Nm(r,o,d,g){r=o.state,typeof o.componentWillReceiveProps=="function"&&o.componentWillReceiveProps(d,g),typeof o.UNSAFE_componentWillReceiveProps=="function"&&o.UNSAFE_componentWillReceiveProps(d,g),o.state!==r&&Bf.enqueueReplaceState(o,o.state,null)}function wl(r,o){var d=o;if("ref"in o){d={};for(var g in o)g!=="ref"&&(d[g]=o[g])}if(r=r.defaultProps){d===o&&(d=v({},d));for(var M in r)d[M]===void 0&&(d[M]=r[M])}return d}function Lv(r){vf(r)}function Um(r){console.error(r)}function zm(r){vf(r)}function bh(r,o){try{var d=r.onUncaughtError;d(o.value,{componentStack:o.stack})}catch(g){setTimeout(function(){throw g})}}function Pv(r,o,d){try{var g=r.onCaughtError;g(d.value,{componentStack:d.stack,errorBoundary:o.tag===1?o.stateNode:null})}catch(M){setTimeout(function(){throw M})}}function Fm(r,o,d){return d=Go(d),d.tag=3,d.payload={element:null},d.callback=function(){bh(r,o)},d}function km(r){return r=Go(r),r.tag=3,r}function Ov(r,o,d,g){var M=d.type.getDerivedStateFromError;if(typeof M=="function"){var C=g.value;r.payload=function(){return M(C)},r.callback=function(){Pv(o,d,g)}}var U=d.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(r.callback=function(){Pv(o,d,g),typeof M!="function"&&(_s===null?_s=new Set([this]):_s.add(this));var $=g.stack;this.componentDidCatch(g.value,{componentStack:$!==null?$:""})})}function Ns(r,o,d,g,M){if(d.flags|=32768,g!==null&&typeof g=="object"&&typeof g.then=="function"){if(o=d.alternate,o!==null&&po(o,d,M,!0),d=Ur.current,d!==null){switch(d.tag){case 31:case 13:return Er===null?Su():d.alternate===null&&ns===0&&(ns=3),d.flags&=-257,d.flags|=65536,d.lanes=M,g===oh?d.flags|=16384:(o=d.updateQueue,o===null?d.updateQueue=new Set([g]):o.add(g),Gf(r,g,M)),!1;case 22:return d.flags|=65536,g===oh?d.flags|=16384:(o=d.updateQueue,o===null?(o={transitions:null,markerInstances:null,retryQueue:new Set([g])},d.updateQueue=o):(d=o.retryQueue,d===null?o.retryQueue=new Set([g]):d.add(g)),Gf(r,g,M)),!1}throw Error(n(435,d.tag))}return Gf(r,g,M),Su(),!1}if(Wn)return o=Ur.current,o!==null?((o.flags&65536)===0&&(o.flags|=256),o.flags|=65536,o.lanes=M,g!==ru&&(r=Error(n(422),{cause:g}),uo(ra(r,d)))):(g!==ru&&(o=Error(n(423),{cause:g}),uo(ra(o,d))),r=r.current.alternate,r.flags|=65536,M&=-M,r.lanes|=M,g=ra(g,d),M=Fm(r.stateNode,g,M),on(r,M),ns!==4&&(ns=2)),!1;var C=Error(n(520),{cause:g});if(C=ra(C,d),mc===null?mc=[C]:mc.push(C),ns!==4&&(ns=2),o===null)return!0;g=ra(g,d),d=o;do{switch(d.tag){case 3:return d.flags|=65536,r=M&-M,d.lanes|=r,r=Fm(d.stateNode,g,r),on(d,r),!1;case 1:if(o=d.type,C=d.stateNode,(d.flags&128)===0&&(typeof o.getDerivedStateFromError=="function"||C!==null&&typeof C.componentDidCatch=="function"&&(_s===null||!_s.has(C))))return d.flags|=65536,M&=-M,d.lanes|=M,M=km(M),Ov(M,r,d,g),on(d,M),!1}d=d.return}while(d!==null);return!1}var Sh=Error(n(461)),Cs=!1;function Ys(r,o,d,g){o.child=r===null?uh(o,null,d,g):Ho(o,r.child,d,g)}function Hm(r,o,d,g,M){d=d.render;var C=o.ref;if("ref"in g){var U={};for(var $ in g)$!=="ref"&&(U[$]=g[$])}else U=g;return bl(o),g=hh(r,o,d,U,C,M),$=mm(),r!==null&&!Cs?(gm(r,o,M),ys(r,o,M)):(Wn&&$&&lo(o),o.flags|=1,Ys(r,o,g,M),o.child)}function oc(r,o,d,g,M){if(r===null){var C=d.type;return typeof C=="function"&&!Zd(C)&&C.defaultProps===void 0&&d.compare===null?(o.tag=15,o.type=C,Ah(r,o,C,g,M)):(r=ao(d.type,null,g,o,o.mode,M),r.ref=o.ref,r.return=o,o.child=r)}if(C=r.child,!Rh(r,M)){var U=C.memoizedProps;if(d=d.compare,d=d!==null?d:Zc,d(U,g)&&r.ref===o.ref)return ys(r,o,M)}return o.flags|=1,r=Pr(C,g),r.ref=o.ref,r.return=o,o.child=r}function Ah(r,o,d,g,M){if(r!==null){var C=r.memoizedProps;if(Zc(C,g)&&r.ref===o.ref)if(Cs=!1,o.pendingProps=g=C,Rh(r,M))(r.flags&131072)!==0&&(Cs=!0);else return o.lanes=r.lanes,ys(r,o,M)}return gu(r,o,d,g,M)}function lc(r,o,d,g){var M=g.children,C=r!==null?r.memoizedState:null;if(r===null&&o.stateNode===null&&(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),g.mode==="hidden"){if((o.flags&128)!==0){if(C=C!==null?C.baseLanes|d:d,r!==null){for(g=o.child=r.child,M=0;g!==null;)M=M|g.lanes|g.childLanes,g=g.sibling;g=M&~C}else g=0,o.child=null;return Fr(r,o,C,d,g)}if((d&536870912)!==0)o.memoizedState={baseLanes:0,cachePool:null},r!==null&&bf(o,C!==null?C.cachePool:null),C!==null?$g(o,C):fm(),ev(o);else return g=o.lanes=536870912,Fr(r,o,C!==null?C.baseLanes|d:d,d,g)}else C!==null?(bf(o,C.cachePool),$g(o,C),zr(),o.memoizedState=null):(r!==null&&bf(o,null),fm(),zr());return Ys(r,o,M,d),o.child}function go(r,o){return r!==null&&r.tag===22||o.stateNode!==null||(o.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),o.sibling}function Fr(r,o,d,g,M){var C=ah();return C=C===null?null:{parent:ws._currentValue,pool:C},o.memoizedState={baseLanes:d,cachePool:C},r!==null&&bf(o,null),fm(),ev(o),r!==null&&po(r,o,g,!0),o.childLanes=M,null}function Mh(r,o){return o=Ch({mode:o.mode,children:o.children},r.mode),o.ref=r.ref,r.child=o,o.return=r,o}function Nv(r,o,d){return Ho(o,r.child,null,d),r=Mh(o,o.pendingProps),r.flags|=2,gs(o),o.memoizedState=null,r}function Eh(r,o,d){var g=o.pendingProps,M=(o.flags&128)!==0;if(o.flags&=-129,r===null){if(Wn){if(g.mode==="hidden")return r=Mh(o,g),o.lanes=536870912,go(null,r);if(dm(o),(r=Pi)?(r=PM(r,aa),r=r!==null&&r.data==="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Uo!==null?{id:es,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},d=nu(r),d.return=o,o.child=d,os=o,Pi=null)):r=null,r===null)throw co(o);return o.lanes=536870912,null}return Mh(o,g)}var C=r.memoizedState;if(C!==null){var U=C.dehydrated;if(dm(o),M)if(o.flags&256)o.flags&=-257,o=Nv(r,o,d);else if(o.memoizedState!==null)o.child=r.child,o.flags|=128,o=null;else throw Error(n(558));else if(Cs||po(r,o,d,!1),M=(d&r.childLanes)!==0,Cs||M){if(g=mn,g!==null&&(U=er(g,d),U!==0&&U!==C.retryLane))throw C.retryLane=U,Ar(r,U),In(g,r,U),Sh;Su(),o=Nv(r,o,d)}else r=C.treeContext,Pi=Eo(U.nextSibling),os=o,Wn=!0,zo=null,aa=!1,r!==null&&th(o,r),o=Mh(o,g),o.flags|=4096;return o}return r=Pr(r.child,{mode:g.mode,children:g.children}),r.ref=o.ref,o.child=r,r.return=o,r}function uc(r,o){var d=o.ref;if(d===null)r!==null&&r.ref!==null&&(o.flags|=4194816);else{if(typeof d!="function"&&typeof d!="object")throw Error(n(284));(r===null||r.ref!==d)&&(o.flags|=4194816)}}function gu(r,o,d,g,M){return bl(o),d=hh(r,o,d,g,void 0,M),g=mm(),r!==null&&!Cs?(gm(r,o,M),ys(r,o,M)):(Wn&&g&&lo(o),o.flags|=1,Ys(r,o,d,M),o.child)}function If(r,o,d,g,M,C){return bl(o),o.updateQueue=null,d=rc(o,g,d,M),tv(r),g=mm(),r!==null&&!Cs?(gm(r,o,C),ys(r,o,C)):(Wn&&g&&lo(o),o.flags|=1,Ys(r,o,d,C),o.child)}function Th(r,o,d,g,M){if(bl(o),o.stateNode===null){var C=ml,U=d.contextType;typeof U=="object"&&U!==null&&(C=pn(U)),C=new d(g,C),o.memoizedState=C.state!==null&&C.state!==void 0?C.state:null,C.updater=Bf,o.stateNode=C,C._reactInternals=o,C=o.stateNode,C.props=g,C.state=o.memoizedState,C.refs={},Mf(o),U=d.contextType,C.context=typeof U=="object"&&U!==null?pn(U):ml,C.state=o.memoizedState,U=d.getDerivedStateFromProps,typeof U=="function"&&(_h(o,d,U,g),C.state=o.memoizedState),typeof d.getDerivedStateFromProps=="function"||typeof C.getSnapshotBeforeUpdate=="function"||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(U=C.state,typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount(),U!==C.state&&Bf.enqueueReplaceState(C,C.state,null),uu(o,g,C,M),Ef(),C.state=o.memoizedState),typeof C.componentDidMount=="function"&&(o.flags|=4194308),g=!0}else if(r===null){C=o.stateNode;var $=o.memoizedProps,me=wl(d,$);C.props=me;var ze=C.context,rt=d.contextType;U=ml,typeof rt=="object"&&rt!==null&&(U=pn(rt));var ut=d.getDerivedStateFromProps;rt=typeof ut=="function"||typeof C.getSnapshotBeforeUpdate=="function",$=o.pendingProps!==$,rt||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||($||ze!==U)&&Nm(o,C,g,U),Mr=!1;var Ge=o.memoizedState;C.state=Ge,uu(o,g,C,M),Ef(),ze=o.memoizedState,$||Ge!==ze||Mr?(typeof ut=="function"&&(_h(o,d,ut,g),ze=o.memoizedState),(me=Mr||Om(o,d,me,g,Ge,ze,U))?(rt||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(o.flags|=4194308)):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),o.memoizedProps=g,o.memoizedState=ze),C.props=g,C.state=ze,C.context=U,g=me):(typeof C.componentDidMount=="function"&&(o.flags|=4194308),g=!1)}else{C=o.stateNode,cm(r,o),U=o.memoizedProps,rt=wl(d,U),C.props=rt,ut=o.pendingProps,Ge=C.context,ze=d.contextType,me=ml,typeof ze=="object"&&ze!==null&&(me=pn(ze)),$=d.getDerivedStateFromProps,(ze=typeof $=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(U!==ut||Ge!==me)&&Nm(o,C,g,me),Mr=!1,Ge=o.memoizedState,C.state=Ge,uu(o,g,C,M),Ef();var Ke=o.memoizedState;U!==ut||Ge!==Ke||Mr||r!==null&&r.dependencies!==null&&_f(r.dependencies)?(typeof $=="function"&&(_h(o,d,$,g),Ke=o.memoizedState),(rt=Mr||Om(o,d,rt,g,Ge,Ke,me)||r!==null&&r.dependencies!==null&&_f(r.dependencies))?(ze||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(g,Ke,me),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(g,Ke,me)),typeof C.componentDidUpdate=="function"&&(o.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(o.flags|=1024)):(typeof C.componentDidUpdate!="function"||U===r.memoizedProps&&Ge===r.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||U===r.memoizedProps&&Ge===r.memoizedState||(o.flags|=1024),o.memoizedProps=g,o.memoizedState=Ke),C.props=g,C.state=Ke,C.context=me,g=rt):(typeof C.componentDidUpdate!="function"||U===r.memoizedProps&&Ge===r.memoizedState||(o.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||U===r.memoizedProps&&Ge===r.memoizedState||(o.flags|=1024),g=!1)}return C=g,uc(r,o),g=(o.flags&128)!==0,C||g?(C=o.stateNode,d=g&&typeof d.getDerivedStateFromError!="function"?null:C.render(),o.flags|=1,r!==null&&g?(o.child=Ho(o,r.child,null,M),o.child=Ho(o,null,d,M)):Ys(r,o,d,M),o.memoizedState=C.state,r=o.child):r=ys(r,o,M),r}function Uv(r,o,d,g){return xl(),o.flags|=256,Ys(r,o,d,g),o.child}var Gm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function ur(r){return{baseLanes:r,cachePool:lm()}}function wh(r,o,d){return r=r!==null?r.childLanes&~d:0,o&&(r|=Cr),r}function zv(r,o,d){var g=o.pendingProps,M=!1,C=(o.flags&128)!==0,U;if((U=C)||(U=r!==null&&r.memoizedState===null?!1:(Xn.current&2)!==0),U&&(M=!0,o.flags&=-129),U=(o.flags&32)!==0,o.flags&=-33,r===null){if(Wn){if(M?jo(o):zr(),(r=Pi)?(r=PM(r,aa),r=r!==null&&r.data!=="&"?r:null,r!==null&&(o.memoizedState={dehydrated:r,treeContext:Uo!==null?{id:es,overflow:ja}:null,retryLane:536870912,hydrationErrors:null},d=nu(r),d.return=o,o.child=d,os=o,Pi=null)):r=null,r===null)throw co(o);return Nb(r)?o.lanes=32:o.lanes=536870912,null}var $=g.children;return g=g.fallback,M?(zr(),M=o.mode,$=Ch({mode:"hidden",children:$},M),g=gl(g,M,d,null),$.return=o,g.return=o,$.sibling=g,o.child=$,g=o.child,g.memoizedState=ur(d),g.childLanes=wh(r,U,d),o.memoizedState=Gm,go(null,g)):(jo(o),Df(o,$))}var me=r.memoizedState;if(me!==null&&($=me.dehydrated,$!==null)){if(C)o.flags&256?(jo(o),o.flags&=-257,o=jm(r,o,d)):o.memoizedState!==null?(zr(),o.child=r.child,o.flags|=128,o=null):(zr(),$=g.fallback,M=o.mode,g=Ch({mode:"visible",children:g.children},M),$=gl($,M,d,null),$.flags|=2,g.return=o,$.return=o,g.sibling=$,o.child=g,Ho(o,r.child,null,d),g=o.child,g.memoizedState=ur(d),g.childLanes=wh(r,U,d),o.memoizedState=Gm,o=go(null,g));else if(jo(o),Nb($)){if(U=$.nextSibling&&$.nextSibling.dataset,U)var ze=U.dgst;U=ze,g=Error(n(419)),g.stack="",g.digest=U,uo({value:g,source:null,stack:null}),o=jm(r,o,d)}else if(Cs||po(r,o,d,!1),U=(d&r.childLanes)!==0,Cs||U){if(U=mn,U!==null&&(g=er(U,d),g!==0&&g!==me.retryLane))throw me.retryLane=g,Ar(r,g),In(U,r,g),Sh;Ob($)||Su(),o=jm(r,o,d)}else Ob($)?(o.flags|=192,o.child=r.child,o=null):(r=me.treeContext,Pi=Eo($.nextSibling),os=o,Wn=!0,zo=null,aa=!1,r!==null&&th(o,r),o=Df(o,g.children),o.flags|=4096);return o}return M?(zr(),$=g.fallback,M=o.mode,me=r.child,ze=me.sibling,g=Pr(me,{mode:"hidden",children:g.children}),g.subtreeFlags=me.subtreeFlags&65011712,ze!==null?$=Pr(ze,$):($=gl($,M,d,null),$.flags|=2),$.return=o,g.return=o,g.sibling=$,o.child=g,go(null,g),g=o.child,$=r.child.memoizedState,$===null?$=ur(d):(M=$.cachePool,M!==null?(me=ws._currentValue,M=M.parent!==me?{parent:me,pool:me}:M):M=lm(),$={baseLanes:$.baseLanes|d,cachePool:M}),g.memoizedState=$,g.childLanes=wh(r,U,d),o.memoizedState=Gm,go(r.child,g)):(jo(o),d=r.child,r=d.sibling,d=Pr(d,{mode:"visible",children:g.children}
vendor: 5,356 bytes, line 48
48),d.return=o,d.sibling=null,r!==null&&(U=o.deletions,U===null?(o.deletions=[r],o.flags|=16):U.push(r)),o.child=d,o.memoizedState=null,d)}function Df(r,o){return o=Ch({mode:"visible",children:o},r.mode),o.return=r,r.child=o}function Ch(r,o){return r=$i(22,r,null,o),r.lanes=0,r}function jm(r,o,d){return Ho(o,r.child,null,d),r=Df(o,o.pendingProps.children),r.flags|=2,o.memoizedState=null,r}function Fv(r,o,d){r.lanes|=o;var g=r.alternate;g!==null&&(g.lanes|=o),ih(r.return,o,d)}function fc(r,o,d,g,M,C){var U=r.memoizedState;U===null?r.memoizedState={isBackwards:o,rendering:null,renderingStartTime:0,last:g,tail:d,tailMode:M,treeForkCount:C}:(U.isBackwards=o,U.rendering=null,U.renderingStartTime=0,U.last=g,U.tail=d,U.tailMode=M,U.treeForkCount=C)}function kr(r,o,d){var g=o.pendingProps,M=g.revealOrder,C=g.tail;g=g.children;var U=Xn.current,$=(U&2)!==0;if($?(U=U&1|2,o.flags|=128):U&=1,re(Xn,U),Ys(r,o,g,d),g=Wn?su:0,!$&&r!==null&&(r.flags&128)!==0)e:for(r=o.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&Fv(r,d,o);else if(r.tag===19)Fv(r,d,o);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===o)break e;for(;r.sibling===null;){if(r.return===null||r.return===o)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}switch(M){case"forwards":for(d=o.child,M=null;d!==null;)r=d.alternate,r!==null&&la(r)===null&&(M=d),d=d.sibling;d=M,d===null?(M=o.child,o.child=null):(M=d.sibling,d.sibling=null),fc(o,!1,M,d,C,g);break;case"backwards":case"unstable_legacy-backwards":for(d=null,M=o.child,o.child=null;M!==null;){if(r=M.alternate,r!==null&&la(r)===null){o.child=M;break}r=M.sibling,M.sibling=d,d=M,M=r}fc(o,!0,d,null,C,g);break;case"together":fc(o,!1,null,null,void 0,g);break;default:o.memoizedState=null}return o.child}function ys(r,o,d){if(r!==null&&(o.dependencies=r.dependencies),So|=o.lanes,(d&o.childLanes)===0)if(r!==null){if(po(r,o,d,!1),(d&o.childLanes)===0)return null}else return null;if(r!==null&&o.child!==r.child)throw Error(n(153));if(o.child!==null){for(r=o.child,d=Pr(r,r.pendingProps),o.child=d,d.return=o;r.sibling!==null;)r=r.sibling,d=d.sibling=Pr(r,r.pendingProps),d.return=o;d.sibling=null}return o.child}function Rh(r,o){return(r.lanes&o)!==0?!0:(r=r.dependencies,!!(r!==null&&_f(r)))}function Ab(r,o,d){switch(o.tag){case 3:Re(o,o.stateNode.containerInfo),Fo(o,ws,r.memoizedState.cache),xl();break;case 27:case 5:ct(o);break;case 4:Re(o,o.stateNode.containerInfo);break;case 10:Fo(o,o.type,o.memoizedProps.value);break;case 31:if(o.memoizedState!==null)return o.flags|=128,dm(o),null;break;case 13:var g=o.memoizedState;if(g!==null)return g.dehydrated!==null?(jo(o),o.flags|=128,null):(d&o.child.childLanes)!==0?zv(r,o,d):(jo(o),r=ys(r,o,d),r!==null?r.sibling:null);jo(o);break;case 19:var M=(r.flags&128)!==0;if(g=(d&o.childLanes)!==0,g||(po(r,o,d,!1),g=(d&o.childLanes)!==0),M){if(g)return kr(r,o,d);o.flags|=128}if(M=o.memoizedState,M!==null&&(M.rendering=null,M.tail=null,M.lastEffect=null),re(Xn,Xn.current),g)break;return null;case 22:return o.lanes=0,lc(r,o,d,o.pendingProps);case 24:Fo(o,ws,r.memoizedState.cache)}return ys(r,o,d)}function Bh(r,o,d){if(r!==null)if(r.memoizedProps!==o.pendingProps)Cs=!0;else{if(!Rh(r,d)&&(o.flags&128)===0)return Cs=!1,Ab(r,o,d);Cs=(r.flags&131072)!==0}else Cs=!1,Wn&&(o.flags&1048576)!==0&&Xg(o,su,o.index);switch(o.lanes=0,o.tag){case 16:e:{var g=o.pendingProps;if(r=$l(o.elementType),o.type=r,typeof r=="function")Zd(r)?(g=wl(r,g),o.tag=1,o=Th(null,o,r,g,d)):(o.tag=0,o=gu(null,o,r,g,d));else{if(r!=null){var M=r.$$typeof;if(M===P){o.tag=11,o=Hm(null,o,r,g,d);break e}else if(M===F){o.tag=14,o=oc(null,o,r,g,d);break e}}throw o=le(r)||r,Error(n(306,o,""))}}return o;case 0:return gu(r,o,o.type,o.pendingProps,d);case 1:return g=o.type,M=wl(g,o.pendingProps),Th(r,o,g,M,d);case 3:e:{if(Re(o,o.stateNode.containerInfo),r===null)throw Error(n(387));g=o.pendingProps;var C=o.memoizedState;M=C.element,cm(r,o),uu(o,g,null,d);var U=o.memoizedState;if(g=U.cache,Fo(o,ws,g),g!==C.cache&&sh(o,[ws],d,!0),Ef(),g=U.element,C.isDehydrated)if(C={element:g,isDehydrated:!1,cache:U.cache},o.updateQueue.baseState=C,o.memoizedState=C,o.flags&256){o=Uv(r,o,g,d);break e}else if(g!==M){M=ra(Error(n(424)),o),uo(M),o=Uv(r,o,g,d);break e}else{switch(r=o.stateNode.containerInfo,r.nodeType){case 9:r=r.body;break;default:r=r.nodeName==="HTML"?r.ownerDocument.body:r}for(Pi=Eo(r.firstChild),os=o,Wn=!0,zo=null,aa=!0,d=uh(o,null,g,d),o.child=d;d;)d.flags=d.flags&-3|4096,d=d.sibling}else{if(xl(),g===M){o=ys(r,o,d);break e}Ys(r,o,g,d)}o=o.child}return o;case 26:return uc(r,o),r===null?(d=kM(o.type,null,o.pendingProps,null))?o.memoizedState=d:Wn||(d=o.type,r=o.pendingProps,g=jv(Be.current).createElement(d),g[hi]=o,g[Fi]=r,Br(g,d,r),xe(g),o.stateNode=g):o.memoizedState=kM(o.type,r.memoizedProps,o.pendingProps,r.memoizedState),null;case 27:return ct(o),r===null&&Wn&&(g=o.stateNode=UM(o.type,o.pendingProps,Be.current),os=o,aa=!0,M=Pi,Tu(o.type)?(Ub=M,Pi=Eo(g.firstChild)):Pi=M),Ys(r,o,o.pendingProps.children,d),uc(r,o),r===null&&(o.flags|=4194304),o.child;case 5:return r===null&&Wn&&((M=g=Pi)&&(g=lD(g,o.type,o.pendingProps,aa),g!==null?(o.stateNode=g,os=o,Pi=Eo(g.firstChild),aa=!1,M=!0):M=!1),M||co(o)),ct(o),M=o.type,C=o.pendingProps,U=r!==null?r.memoizedProps:null,g=C.children,Db(M,C)?g=null:U!==null&&Db(M,U)&&(o.flags|=32),o.memoizedState!==null&&(M=hh(r,o,ac,null,
vendor: 4,244 bytes, line 48
48null,d),e0._currentValue=M),uc(r,o),Ys(r,o,g,d),o.child;case 6:return r===null&&Wn&&((r=d=Pi)&&(d=cD(d,o.pendingProps,aa),d!==null?(o.stateNode=d,os=o,Pi=null,r=!0):r=!1),r||co(o)),null;case 13:return zv(r,o,d);case 4:return Re(o,o.stateNode.containerInfo),g=o.pendingProps,r===null?o.child=Ho(o,null,g,d):Ys(r,o,g,d),o.child;case 11:return Hm(r,o,o.type,o.pendingProps,d);case 7:return Ys(r,o,o.pendingProps,d),o.child;case 8:return Ys(r,o,o.pendingProps.children,d),o.child;case 12:return Ys(r,o,o.pendingProps.children,d),o.child;case 10:return g=o.pendingProps,Fo(o,o.type,g.value),Ys(r,o,g.children,d),o.child;case 9:return M=o.type._context,g=o.pendingProps.children,bl(o),M=pn(M),g=g(M),o.flags|=1,Ys(r,o,g,d),o.child;case 14:return oc(r,o,o.type,o.pendingProps,d);case 15:return Ah(r,o,o.type,o.pendingProps,d);case 19:return kr(r,o,d);case 31:return Eh(r,o,d);case 22:return lc(r,o,d,o.pendingProps);case 24:return bl(o),g=pn(ws),r===null?(M=ah(),M===null&&(M=mn,C=sm(),M.pooledCache=C,C.refCount++,C!==null&&(M.pooledCacheLanes|=d),M=C),o.memoizedState={parent:g,cache:M},Mf(o),Fo(o,ws,M)):((r.lanes&d)!==0&&(cm(r,o),uu(o,null,null,d),Ef()),M=r.memoizedState,C=o.memoizedState,M.parent!==g?(M={parent:g,cache:g},o.memoizedState=M,o.lanes===0&&(o.memoizedState=o.updateQueue.baseState=M),Fo(o,ws,g)):(g=C.cache,Fo(o,ws,g),g!==M.cache&&sh(o,[ws],d,!0))),Ys(r,o,o.pendingProps.children,d),o.child;case 29:throw o.pendingProps}throw Error(n(156,o.tag))}function vo(r){r.flags|=4}function Lf(r,o,d,g,M){if((o=(r.mode&32)!==0)&&(o=!1),o){if(r.flags|=16777216,(M&335544128)===M)if(r.stateNode.complete)r.flags|=8192;else if(ss())r.flags|=8192;else throw mo=oh,Sf}else r.flags&=-16777217}function Vm(r,o){if(o.type!=="stylesheet"||(o.state.loading&4)!==0)r.flags&=-16777217;else if(r.flags|=16777216,!WM(o))if(ss())r.flags|=8192;else throw mo=oh,Sf}function Wo(r,o){o!==null&&(r.flags|=4),r.flags&16384&&(o=r.tag!==22?Dt():536870912,r.lanes|=o,ki|=o)}function yo(r,o){if(!Wn)switch(r.tailMode){case"hidden":o=r.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?r.tail=null:d.sibling=null;break;case"collapsed":d=r.tail;for(var g=null;d!==null;)d.alternate!==null&&(g=d),d=d.sibling;g===null?o||r.tail===null?r.tail=null:r.tail.sibling=null:g.sibling=null}}function Ti(r){var o=r.alternate!==null&&r.alternate.child===r.child,d=0,g=0;if(o)for(var M=r.child;M!==null;)d|=M.lanes|M.childLanes,g|=M.subtreeFlags&65011712,g|=M.flags&65011712,M.return=r,M=M.sibling;else for(M=r.child;M!==null;)d|=M.lanes|M.childLanes,g|=M.subtreeFlags,g|=M.flags,M.return=r,M=M.sibling;return r.subtreeFlags|=g,r.childLanes=d,o}function Pf(r,o,d){var g=o.pendingProps;switch(eh(o),o.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ti(o),null;case 1:return Ti(o),null;case 3:return d=o.stateNode,g=null,r!==null&&(g=r.memoizedState.cache),o.memoizedState.cache!==g&&(o.flags|=2048),ho(ws),lt(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(r===null||r.child===null)&&(au(o)?vo(o):r===null||r.memoizedState.isDehydrated&&(o.flags&256)===0||(o.flags|=1024,nh())),Ti(o),null;case 26:var M=o.type,C=o.memoizedState;return r===null?(vo(o),C!==null?(Ti(o),Vm(o,C)):(Ti(o),Lf(o,M,null,g,d))):C?C!==r.memoizedState?(vo(o),Ti(o),Vm(o,C)):(Ti(o),o.flags&=-16777217):(r=r.memoizedProps,r!==g&&vo(o),Ti(o),Lf(o,M,r,g,d)),null;case 27:if(vt(o),d=Be.current,M=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==g&&vo(o);else{if(!g){if(o.stateNode===null)throw Error(n(166));return Ti(o),null}r=oe.current,au(o)?qg(o):(r=UM(M,g,d),o.stateNode=r,vo(o))}return Ti(o),null;case 5:if(vt(o),M=o.type,r!==null&&o.stateNode!=null)r.memoizedProps!==g&&vo(o);else{if(!g){if(o.stateNode===null)throw Error(n(166));return Ti(o),null}if(C=oe.current,au(o))qg(o);else{var U=jv(Be.current);switch(C){case 1:C=U.createElementNS("http://www.w3.org/2000/svg",M);break;case 2:C=U.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;default:switch(M){case"svg":C=U.createElementNS("http://www.w3.org/2000/svg",M);break;case"math":C=U.createElementNS("http://www.w3.org/1998/Math/MathML",M);break;case"script":C=U.createElement("div"),C.innerHTML="<script><\/script>",C=C.removeChild(C.firstChild);break;
vendor: 23,707 bytes, line 48
48case"select":C=typeof g.is=="string"?U.createElement("select",{is:g.is}):U.createElement("select"),g.multiple?C.multiple=!0:g.size&&(C.size=g.size);break;default:C=typeof g.is=="string"?U.createElement(M,{is:g.is}):U.createElement(M)}}C[hi]=o,C[Fi]=g;e:for(U=o.child;U!==null;){if(U.tag===5||U.tag===6)C.appendChild(U.stateNode);else if(U.tag!==4&&U.tag!==27&&U.child!==null){U.child.return=U,U=U.child;continue}if(U===o)break e;for(;U.sibling===null;){if(U.return===null||U.return===o)break e;U=U.return}U.sibling.return=U.return,U=U.sibling}o.stateNode=C;e:switch(Br(C,M,g),M){case"button":case"input":case"select":case"textarea":g=!!g.autoFocus;break e;case"img":g=!0;break e;default:g=!1}g&&vo(o)}}return Ti(o),Lf(o,o.type,r===null?null:r.memoizedProps,o.pendingProps,d),null;case 6:if(r&&o.stateNode!=null)r.memoizedProps!==g&&vo(o);else{if(typeof g!="string"&&o.stateNode===null)throw Error(n(166));if(r=Be.current,au(o)){if(r=o.stateNode,d=o.memoizedProps,g=null,M=os,M!==null)switch(M.tag){case 27:case 5:g=M.memoizedProps}r[hi]=o,r=!!(r.nodeValue===d||g!==null&&g.suppressHydrationWarning===!0||TM(r.nodeValue,d)),r||co(o,!0)}else r=jv(r).createTextNode(g),r[hi]=o,o.stateNode=r}return Ti(o),null;case 31:if(d=o.memoizedState,r===null||r.memoizedState!==null){if(g=au(o),d!==null){if(r===null){if(!g)throw Error(n(318));if(r=o.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(557));r[hi]=o}else xl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ti(o),r=!1}else d=nh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=d),r=!0;if(!r)return o.flags&256?(gs(o),o):(gs(o),null);if((o.flags&128)!==0)throw Error(n(558))}return Ti(o),null;case 13:if(g=o.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(M=au(o),g!==null&&g.dehydrated!==null){if(r===null){if(!M)throw Error(n(318));if(M=o.memoizedState,M=M!==null?M.dehydrated:null,!M)throw Error(n(317));M[hi]=o}else xl(),(o.flags&128)===0&&(o.memoizedState=null),o.flags|=4;Ti(o),M=!1}else M=nh(),r!==null&&r.memoizedState!==null&&(r.memoizedState.hydrationErrors=M),M=!0;if(!M)return o.flags&256?(gs(o),o):(gs(o),null)}return gs(o),(o.flags&128)!==0?(o.lanes=d,o):(d=g!==null,r=r!==null&&r.memoizedState!==null,d&&(g=o.child,M=null,g.alternate!==null&&g.alternate.memoizedState!==null&&g.alternate.memoizedState.cachePool!==null&&(M=g.alternate.memoizedState.cachePool.pool),C=null,g.memoizedState!==null&&g.memoizedState.cachePool!==null&&(C=g.memoizedState.cachePool.pool),C!==M&&(g.flags|=2048)),d!==r&&d&&(o.child.flags|=8192),Wo(o,o.updateQueue),Ti(o),null);case 4:return lt(),r===null&&wb(o.stateNode.containerInfo),Ti(o),null;case 10:return ho(o.type),Ti(o),null;case 19:if(ce(Xn),g=o.memoizedState,g===null)return Ti(o),null;if(M=(o.flags&128)!==0,C=g.rendering,C===null)if(M)yo(g,!1);else{if(ns!==0||r!==null&&(r.flags&128)!==0)for(r=o.child;r!==null;){if(C=la(r),C!==null){for(o.flags|=128,yo(g,!1),r=C.updateQueue,o.updateQueue=r,Wo(o,r),o.subtreeFlags=0,r=d,d=o.child;d!==null;)tu(d,r),d=d.sibling;return re(Xn,Xn.current&1|2),Wn&&oo(o,g.treeForkCount),o.child}r=r.sibling}g.tail!==null&&Ie()>xs&&(o.flags|=128,M=!0,yo(g,!1),o.lanes=4194304)}else{if(!M)if(r=la(C),r!==null){if(o.flags|=128,M=!0,r=r.updateQueue,o.updateQueue=r,Wo(o,r),yo(g,!0),g.tail===null&&g.tailMode==="hidden"&&!C.alternate&&!Wn)return Ti(o),null}else 2*Ie()-g.renderingStartTime>xs&&d!==536870912&&(o.flags|=128,M=!0,yo(g,!1),o.lanes=4194304);g.isBackwards?(C.sibling=o.child,o.child=C):(r=g.last,r!==null?r.sibling=C:o.child=C,g.last=C)}return g.tail!==null?(r=g.tail,g.rendering=r,g.tail=r.sibling,g.renderingStartTime=Ie(),r.sibling=null,d=Xn.current,re(Xn,M?d&1|2:d&1),Wn&&oo(o,g.treeForkCount),r):(Ti(o),null);case 22:case 23:return gs(o),Tf(),g=o.memoizedState!==null,r!==null?r.memoizedState!==null!==g&&(o.flags|=8192):g&&(o.flags|=8192),g?(d&536870912)!==0&&(o.flags&128)===0&&(Ti(o),o.subtreeFlags&6&&(o.flags|=8192)):Ti(o),d=o.updateQueue,d!==null&&Wo(o,d.retryQueue),d=null,r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),g=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(g=o.memoizedState.cachePool.pool),g!==d&&(o.flags|=2048),r!==null&&ce(Sl),null;case 24:return d=null,r!==null&&(d=r.memoizedState.cache),o.memoizedState.cache!==d&&(o.flags|=2048),ho(ws),Ti(o),null;case 25:return null;case 30:return null}throw Error(n(156,o.tag))}function Ba(r,o){switch(eh(o),o.tag){case 1:return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 3:return ho(ws),lt(),r=o.flags,(r&65536)!==0&&(r&128)===0?(o.flags=r&-65537|128,o):null;case 26:case 27:case 5:return vt(o),null;case 31:if(o.memoizedState!==null){if(gs(o),o.alternate===null)throw Error(n(340));xl()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 13:if(gs(o),r=o.memoizedState,r!==null&&r.dehydrated!==null){if(o.alternate===null)throw Error(n(340));xl()}return r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 19:return ce(Xn),null;case 4:return lt(),null;case 10:return ho(o.type),null;case 22:case 23:return gs(o),Tf(),r!==null&&ce(Sl),r=o.flags,r&65536?(o.flags=r&-65537|128,o):null;case 24:return ho(ws),null;case 25:return null;default:return null}}function ca(r,o){switch(eh(o),o.tag){case 3:ho(ws),lt();break;case 26:case 27:case 5:vt(o);break;case 4:lt();break;case 31:o.memoizedState!==null&&gs(o);break;case 13:gs(o);break;case 19:ce(Xn);break;case 10:ho(o.type);break;case 22:case 23:gs(o),Tf(),r!==null&&ce(Sl);break;case 24:ho(ws)}}function Ia(r,o){try{var d=o.updateQueue,g=d!==null?d.lastEffect:null;if(g!==null){var M=g.next;d=M;do{if((d.tag&r)===r){g=void 0;var C=d.create,U=d.inst;g=C(),U.destroy=g}d=d.next}while(d!==M)}}catch($){ii(o,o.return,$)}}function ir(r,o,d){try{var g=o.updateQueue,M=g!==null?g.lastEffect:null;if(M!==null){var C=M.next;g=C;do{if((g.tag&r)===r){var U=g.inst,$=U.destroy;if($!==void 0){U.destroy=void 0,M=o;var me=d,ze=$;try{ze()}catch(rt){ii(M,me,rt)}}}g=g.next}while(g!==C)}}catch(rt){ii(o,o.return,rt)}}function Va(r){var o=r.updateQueue;if(o!==null){var d=r.stateNode;try{Qg(o,d)}catch(g){ii(r,r.return,g)}}}function Js(r,o,d){d.props=wl(r.type,r.memoizedProps),d.state=r.memoizedState;try{d.componentWillUnmount()}catch(g){ii(r,o,g)}}function Xo(r,o){try{var d=r.ref;if(d!==null){switch(r.tag){case 26:case 27:case 5:var g=r.stateNode;break;case 30:g=r.stateNode;break;default:g=r.stateNode}typeof d=="function"?r.refCleanup=d(g):d.current=g}}catch(M){ii(r,o,M)}}function sr(r,o){var d=r.ref,g=r.refCleanup;if(d!==null)if(typeof g=="function")try{g()}catch(M){ii(r,o,M)}finally{r.refCleanup=null,r=r.alternate,r!=null&&(r.refCleanup=null)}else if(typeof d=="function")try{d(null)}catch(M){ii(r,o,M)}else d.current=null}function Of(r){var o=r.type,d=r.memoizedProps,g=r.stateNode;try{e:switch(o){case"button":case"input":case"select":case"textarea":d.autoFocus&&g.focus();break e;case"img":d.src?g.src=d.src:d.srcSet&&(g.srcset=d.srcSet)}}catch(M){ii(r,r.return,M)}}function Us(r,o,d){try{var g=r.stateNode;nD(g,r.type,d,o),g[Fi]=o}catch(M){ii(r,r.return,M)}}function Wi(r){return r.tag===5||r.tag===3||r.tag===26||r.tag===27&&Tu(r.type)||r.tag===4}function Gn(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||Wi(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.tag===27&&Tu(r.type)||r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function xo(r,o,d){var g=r.tag;if(g===5||g===6)r=r.stateNode,o?(d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d).insertBefore(r,o):(o=d.nodeType===9?d.body:d.nodeName==="HTML"?d.ownerDocument.body:d,o.appendChild(r),d=d._reactRootContainer,d!=null||o.onclick!==null||(o.onclick=Pe));else if(g!==4&&(g===27&&Tu(r.type)&&(d=r.stateNode,o=null),r=r.child,r!==null))for(xo(r,o,d),r=r.sibling;r!==null;)xo(r,o,d),r=r.sibling}function Tr(r,o,d){var g=r.tag;if(g===5||g===6)r=r.stateNode,o?d.insertBefore(r,o):d.appendChild(r);else if(g!==4&&(g===27&&Tu(r.type)&&(d=r.stateNode),r=r.child,r!==null))for(Tr(r,o,d),r=r.sibling;r!==null;)Tr(r,o,d),r=r.sibling}function Ih(r){var o=r.stateNode,d=r.memoizedProps;try{for(var g=r.type,M=o.attributes;M.length;)o.removeAttributeNode(M[0]);Br(o,g,d),o[hi]=r,o[Fi]=d}catch(C){ii(r,r.return,C)}}var Da=!1,Oi=!1,Wa=!1,kv=typeof WeakSet=="function"?WeakSet:Set,Ks=null;function Mb(r,o){if(r=r.containerInfo,Bb=Kv,r=Gg(r),$p(r)){if("selectionStart"in r)var d={start:r.selectionStart,end:r.selectionEnd};else e:{d=(d=r.ownerDocument)&&d.defaultView||window;var g=d.getSelection&&d.getSelection();if(g&&g.rangeCount!==0){d=g.anchorNode;var M=g.anchorOffset,C=g.focusNode;g=g.focusOffset;try{d.nodeType,C.nodeType}catch{d=null;break e}var U=0,$=-1,me=-1,ze=0,rt=0,ut=r,Ge=null;t:for(;;){for(var Ke;ut!==d||M!==0&&ut.nodeType!==3||($=U+M),ut!==C||g!==0&&ut.nodeType!==3||(me=U+g),ut.nodeType===3&&(U+=ut.nodeValue.length),(Ke=ut.firstChild)!==null;)Ge=ut,ut=Ke;for(;;){if(ut===r)break t;if(Ge===d&&++ze===M&&($=U),Ge===C&&++rt===g&&(me=U),(Ke=ut.nextSibling)!==null)break;ut=Ge,Ge=ut.parentNode}ut=Ke}d=$===-1||me===-1?null:{start:$,end:me}}else d=null}d=d||{start:0,end:0}}else d=null;for(Ib={focusedElem:r,selectionRange:d},Kv=!1,Ks=o;Ks!==null;)if(o=Ks,r=o.child,(o.subtreeFlags&1028)!==0&&r!==null)r.return=o,Ks=r;else for(;Ks!==null;){switch(o=Ks,C=o.alternate,r=o.flags,o.tag){case 0:if((r&4)!==0&&(r=o.updateQueue,r=r!==null?r.events:null,r!==null))for(d=0;d<r.length;d++)M=r[d],M.ref.impl=M.nextImpl;break;case 11:case 15:break;case 1:if((r&1024)!==0&&C!==null){r=void 0,d=o,M=C.memoizedProps,C=C.memoizedState,g=d.stateNode;try{var Jt=wl(d.type,M);r=g.getSnapshotBeforeUpdate(Jt,C),g.__reactInternalSnapshotBeforeUpdate=r}catch(hn){ii(d,d.return,hn)}}break;case 3:if((r&1024)!==0){if(r=o.stateNode.containerInfo,d=r.nodeType,d===9)Pb(r);else if(d===1)switch(r.nodeName){case"HEAD":case"HTML":case"BODY":Pb(r);break;default:r.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((r&1024)!==0)throw Error(n(163))}if(r=o.sibling,r!==null){r.return=o.return,Ks=r;break}Ks=o.return}}function Xi(r,o,d){var g=d.flags;switch(d.tag){case 0:case 11:case 15:Oa(r,d),g&4&&Ia(5,d);break;case 1:if(Oa(r,d),g&4)if(r=d.stateNode,o===null)try{r.componentDidMount()}catch(U){ii(d,d.return,U)}else{var M=wl(d.type,o.memoizedProps);o=o.memoizedState;try{r.componentDidUpdate(M,o,r.__reactInternalSnapshotBeforeUpdate)}catch(U){ii(d,d.return,U)}}g&64&&Va(d),g&512&&Xo(d,d.return);break;case 3:if(Oa(r,d),g&64&&(r=d.updateQueue,r!==null)){if(o=null,d.child!==null)switch(d.child.tag){case 27:case 5:o=d.child.stateNode;break;case 1:o=d.child.stateNode}try{Qg(r,o)}catch(U){ii(d,d.return,U)}}break;case 27:o===null&&g&4&&Ih(d);case 26:case 5:Oa(r,d),o===null&&g&4&&Of(d),g&512&&Xo(d,d.return);break;case 12:Oa(r,d);break;case 31:Oa(r,d),g&4&&Cl(r,d);break;case 13:Oa(r,d),g&4&&vu(r,d),g&64&&(r=d.memoizedState,r!==null&&(r=r.dehydrated,r!==null&&(d=y.bind(null,d),uD(r,d))));break;case 22:if(g=d.memoizedState!==null||Da,!g){o=o!==null&&o.memoizedState!==null||Oi,M=Da;var C=Oi;Da=g,(Oi=o)&&!C?wr(r,d,(d.subtreeFlags&8772)!==0):Oa(r,d),Da=M,Oi=C}break;case 30:break;default:Oa(r,d)}}function Nf(r){var o=r.alternate;o!==null&&(r.alternate=null,Nf(o)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(o=r.stateNode,o!==null&&Ln(o)),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}var bi=null,fr=!1;function La(r,o,d){for(d=d.child;d!==null;)Dh(r,o,d),d=d.sibling}function Dh(r,o,d){if(Ft&&typeof Ft.onCommitFiberUnmount=="function")try{Ft.onCommitFiberUnmount(Ct,d)}catch{}switch(d.tag){case 26:Oi||sr(d,o),La(r,o,d),d.memoizedState?d.memoizedState.count--:d.stateNode&&(d=d.stateNode,d.parentNode.removeChild(d));break;case 27:Oi||sr(d,o);var g=bi,M=fr;Tu(d.type)&&(bi=d.stateNode,fr=!1),La(r,o,d),Zm(d.stateNode),bi=g,fr=M;break;case 5:Oi||sr(d,o);case 6:if(g=bi,M=fr,bi=null,La(r,o,d),bi=g,fr=M,bi!==null)if(fr)try{(bi.nodeType===9?bi.body:bi.nodeName==="HTML"?bi.ownerDocument.body:bi).removeChild(d.stateNode)}catch(C){ii(d,o,C)}else try{bi.removeChild(d.stateNode)}catch(C){ii(d,o,C)}break;case 18:bi!==null&&(fr?(r=bi,DM(r.nodeType===9?r.body:r.nodeName==="HTML"?r.ownerDocument.body:r,d.stateNode),kh(r)):DM(bi,d.stateNode));break;case 4:g=bi,M=fr,bi=d.stateNode.containerInfo,fr=!0,La(r,o,d),bi=g,fr=M;break;case 0:case 11:case 14:case 15:ir(2,d,o),Oi||ir(4,d,o),La(r,o,d);break;case 1:Oi||(sr(d,o),g=d.stateNode,typeof g.componentWillUnmount=="function"&&Js(d,o,g)),La(r,o,d);break;case 21:La(r,o,d);break;case 22:Oi=(g=Oi)||d.memoizedState!==null,La(r,o,d),Oi=g;break;default:La(r,o,d)}}function Cl(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null))){r=r.dehydrated;try{kh(r)}catch(d){ii(o,o.return,d)}}}function vu(r,o){if(o.memoizedState===null&&(r=o.alternate,r!==null&&(r=r.memoizedState,r!==null&&(r=r.dehydrated,r!==null))))try{kh(r)}catch(d){ii(o,o.return,d)}}function Wm(r){switch(r.tag){case 31:case 13:case 19:var o=r.stateNode;return o===null&&(o=r.stateNode=new kv),o;case 22:return r=r.stateNode,o=r._retryCache,o===null&&(o=r._retryCache=new kv),o;default:throw Error(n(435,r.tag))}}function qo(r,o){var d=Wm(r);o.forEach(function(g){if(!d.has(g)){d.add(g);var M=S.bind(null,r,g);g.then(M,M)}})}function zs(r,o){var d=o.deletions;if(d!==null)for(var g=0;g<d.length;g++){var M=d[g],C=r,U=o,$=U;e:for(;$!==null;){switch($.tag){case 27:if(Tu($.type)){bi=$.stateNode,fr=!1;break e}break;case 5:bi=$.stateNode,fr=!1;break e;case 3:case 4:bi=$.stateNode.containerInfo,fr=!0;break e}$=$.return}if(bi===null)throw Error(n(160));Dh(C,U,M),bi=null,fr=!1,C=M.alternate,C!==null&&(C.return=null),M.return=null}if(o.subtreeFlags&13886)for(o=o.child;o!==null;)Rl(o,r),o=o.sibling}var Pa=null;function Rl(r,o){var d=r.alternate,g=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:zs(o,r),Fs(r),g&4&&(ir(3,r,r.return),Ia(3,r),ir(5,r,r.return));break;case 1:zs(o,r),Fs(r),g&512&&(Oi||d===null||sr(d,d.return)),g&64&&Da&&(r=r.updateQueue,r!==null&&(g=r.callbacks,g!==null&&(d=r.shared.hiddenCallbacks,r.shared.hiddenCallbacks=d===null?g:d.concat(g))));break;case 26:var M=Pa;if(zs(o,r),Fs(r),g&512&&(Oi||d===null||sr(d,d.return)),g&4){var C=d!==null?d.memoizedState:null;if(g=r.memoizedState,d===null)if(g===null)if(r.stateNode===null){e:{g=r.type,d=r.memoizedProps,M=M.ownerDocument||M;t:switch(g){case"title":C=M.getElementsByTagName("title")[0],(!C||C[Ot]||C[hi]||C.namespaceURI==="http://www.w3.org/2000/svg"||C.hasAttribute("itemprop"))&&(C=M.createElement(g),M.head.insertBefore(C,M.querySelector("head > title"))),Br(C,g,d),C[hi]=r,xe(C),g=C;break e;case"link":var U=jM("link","href",M).get(g+(d.href||""));if(U){for(var $=0;$<U.length;$++)if(C=U[$],C.getAttribute("href")===(d.href==null||d.href===""?null:d.href)&&C.getAttribute("rel")===(d.rel==null?null:d.rel)&&C.getAttribute("title")===(d.title==null?null:d.title)&&C.getAttribute("crossorigin")===(d.crossOrigin==null?null:d.crossOrigin)){U.splice($,1);break t}}C=M.createElement(g),Br(C,g,d),M.head.appendChild(C);break;case"meta":if(U=jM("meta","content",M).get(g+(d.content||""))){for($=0;$<U.length;$++)if(C=U[$],C.getAttribute("content")===(d.content==null?null:""+d.content)&&C.getAttribute("name")===(d.name==null?null:d.name)&&C.getAttribute("property")===(d.property==null?null:d.property)&&C.getAttribute("http-equiv")===(d.httpEquiv==null?null:d.httpEquiv)&&C.getAttribute("charset")===(d.charSet==null?null:d.charSet)){U.splice($,1);break t}}C=M.createElement(g),Br(C,g,d),M.head.appendChild(C);break;default:throw Error(n(468,g))}C[hi]=r,xe(C),g=C}r.stateNode=g}else VM(M,r.type,r.stateNode);else r.stateNode=GM(M,g,r.memoizedProps);else C!==g?(C===null?d.stateNode!==null&&(d=d.stateNode,d.parentNode.removeChild(d)):C.count--,g===null?VM(M,r.type,r.stateNode):GM(M,g,r.memoizedProps)):g===null&&r.stateNode!==null&&Us(r,r.memoizedProps,d.memoizedProps)}break;case 27:zs(o,r),Fs(r),g&512&&(Oi||d===null||sr(d,d.return)),d!==null&&g&4&&Us(r,r.memoizedProps,d.memoizedProps);break;case 5:if(zs(o,r),Fs(r),g&512&&(Oi||d===null||sr(d,d.return)),r.flags&32){M=r.stateNode;try{Y(M,"")}catch(Jt){ii(r,r.return,Jt)}}g&4&&r.stateNode!=null&&(M=r.memoizedProps,Us(r,M,d!==null?d.memoizedProps:M)),g&1024&&(Wa=!0);break;case 6:if(zs(o,r),Fs(r),g&4){if(r.stateNode===null)throw Error(n(162));g=r.memoizedProps,d=r.stateNode;try{d.nodeValue=g}catch(Jt){ii(r,r.return,Jt)}}break;case 3:if(Xv=null,M=Pa,Pa=Vv(o.containerInfo),zs(o,r),Pa=M,Fs(r),g&4&&d!==null&&d.memoizedState.isDehydrated)try{kh(o.containerInfo)}catch(Jt){ii(r,r.return,Jt)}Wa&&(Wa=!1,Lh(r));break;case 4:g=Pa,Pa=Vv(r.stateNode.containerInfo),zs(o,r),Fs(r),Pa=g;break;case 12:zs(o,r),Fs(r);break;case 31:zs(o,r),Fs(r),g&4&&(g=r.updateQueue,g!==null&&(r.updateQueue=null,qo(r,g)));break;case 13:zs(o,r),Fs(r),r.child.flags&8192&&r.memoizedState!==null!=(d!==null&&d.memoizedState!==null)&&(yu=Ie()),g&4&&(g=r.updateQueue,g!==null&&(r.updateQueue=null,qo(r,g)));break;case 22:M=r.memoizedState!==null;var me=d!==null&&d.memoizedState!==null,ze=Da,rt=Oi;if(Da=ze||M,Oi=rt||me,zs(o,r),Oi=rt,Da=ze,Fs(r),g&8192)e:for(o=r.stateNode,o._visibility=M?o._visibility&-2:o._visibility|1,M&&(d===null||me||Da||Oi||_o(r)),d=null,o=r;;){if(o.tag===5||o.tag===26){if(d===null){me=d=o;try{if(C=me.stateNode,M)U=C.style,typeof U.setProperty=="function"?U.setProperty("display","none","important"):U.display="none";else{$=me.stateNode;var ut=me.memoizedProps.style,Ge=ut!=null&&ut.hasOwnProperty("display")?ut.display:null;$.style.display=Ge==null||typeof Ge=="boolean"?"":(""+Ge).trim()}}catch(Jt){ii(me,me.return,Jt)}}}else if(o.tag===6){if(d===null){me=o;try{me.stateNode.nodeValue=M?"":me.memoizedProps}catch(Jt){ii(me,me.return,Jt)}}}else if(o.tag===18){if(d===null){me=o;try{var Ke=me.stateNode;M?LM(Ke,!0):LM(me.stateNode,!1)}catch(Jt){ii(me,me.return,Jt)}}}else if((o.tag!==22&&o.tag!==23||o.memoizedState===null||o===r)&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===r)break e;for(;o.sibling===null;){if(o.return===null||o.return===r)break e;d===o&&(d=null),o=o.return}d===o&&(d=null),o.sibling.return=o.return,o=o.sibling}g&4&&(g=r.updateQueue,g!==null&&(d=g.retryQueue,d!==null&&(g.retryQueue=null,qo(r,d))));break;case 19:zs(o,r),Fs(r),g&4&&(g=r.updateQueue,g!==null&&(r.updateQueue=null,qo(r,g)));break;case 30:break;case 21:break;default:zs(o,r),Fs(r)}}function Fs(r){var o=r.flags;if(o&2){try{for(var d,g=r.return;g!==null;){if(Wi(g)){d=g;break}g=g.return}if(d==null)throw Error(n(160));switch(d.tag){case 27:var M=d.stateNode,C=Gn(r);Tr(r,C,M);break;case 5:var U=d.stateNode;d.flags&32&&(Y(U,""),d.flags&=-33);var $=Gn(r);Tr(r,$,U);break;case 3:case 4:var me=d.stateNode.containerInfo,ze=Gn(r);xo(r,ze,me);break;default:throw Error(n(161))}}catch(rt){ii(r,r.return,rt)}r.flags&=-3}o&4096&&(r.flags&=-4097)}function Lh(r){if(r.subtreeFlags&1024)for(r=r.child;r!==null;){var o=r;Lh(o),o.tag===5&&o.flags&1024&&o.stateNode.reset(),r=r.sibling}}function Oa(r,o){if(o.subtreeFlags&8772)for(o=o.child;o!==null;)Xi(r,o.alternate,o),o=o.sibling}function _o(r){for(r=r.child;r!==null;){var o=r;switch(o.tag){case 0:case 11:case 14:case 15:ir(4,o,o.return),_o(o);break;case 1:sr(o,o.return);var d=o.stateNode;typeof d.componentWillUnmount=="function"&&Js(o,o.return,d),_o(o);break;case 27:Zm(o.stateNode);case 26:case 5:sr(o,o.return),_o(o);break;case 22:o.memoizedState===null&&_o(o);break;case 30:_o(o);break;default:_o(o)}r=r.sibling}}function wr(r,o,d){for(d=d&&(o.subtreeFlags&8772)!==0,o=o.child;o!==null;){var g=o.alternate,M=r,C=o,U=C.flags;switch(C.tag){case 0:case 11:case 15:wr(M,C,d),Ia(4,C);break;case 1:if(wr(M,C,d),g=C,M=g.stateNode,typeof M.componentDidMount=="function")try{M.componentDidMount()}catch(ze){ii(g,g.return,ze)}if(g=C,M=g.updateQueue,M!==null){var $=g.stateNode;try{var me=M.shared.hiddenCallbacks;if(me!==null)for(M.shared.hiddenCallbacks=null,M=0;M<me.length;M++)fu(me[M],$)}catch(ze){ii(g,g.return,ze)}}d&&U&64&&Va(C),Xo(C,C.return);break;case 27:Ih(C);case 26:case 5:wr(M,C,d),d&&g===null&&U&4&&Of(C),Xo(C,C.return);break;case 12:wr(M,C,d);break;case 31:wr(M,C,d),d&&U&4&&Cl(M,C);break;case 13:wr(M,C,d),d&&U&4&&vu(M,C);break;case 22:C.memoizedState===null&&wr(M,C,d),Xo(C,C.return);break;case 30:break;default:wr(M,C,d)}o=o.sibling}}function Bl(r,o){var d=null;r!==null&&r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),r=null,o.memoizedState!==null&&o.memoizedState.cachePool!==null&&(r=o.memoizedState.cachePool.pool),r!==d&&(r!=null&&r.refCount++,d!=null&&Zl(d))}function dc(r,o){r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zl(r))}function rr(r,o,d,g){if(o.subtreeFlags&10256)for(o=o.child;o!==null;)Xm(r,o,d,g),o=o.sibling}function Xm(r,o,d,g){var M=o.flags;switch(o.tag){case 0:case 11:case 15:rr(r,o,d,g),M&2048&&Ia(9,o);break;case 1:rr(r,o,d,g);break;case 3:rr(r,o,d,g),M&2048&&(r=null,o.alternate!==null&&(r=o.alternate.memoizedState.cache),o=o.memoizedState.cache,o!==r&&(o.refCount++,r!=null&&Zl(r)));break;case 12:if(M&2048){rr(r,o,d,g),r=o.stateNode;try{var C=o.memoizedProps,U=C.id,$=C.onPostCommit;typeof $=="function"&&$(U,o.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(me){ii(o,o.return,me)}}else rr(r,o,d,g);break;case 31:rr(r,o,d,g);break;case 13:rr(r,o,d,g);break;case 23:break;case 22:C=o.stateNode,U=o.alternate,o.memoizedState!==null?C._visibility&2?rr(r,o,d,g):bo(r,o):C._visibility&2?rr(r,o,d,g):(C._visibility|=2,ar(r,o,d,g,(o.subtreeFlags&10256)!==0||!1)),M&2048&&Bl(U,o);break;case 24:rr(r,o,d,g),M&2048&&dc(o.alternate,o);break;default:rr(r,o,d,g)}}function ar(r,o,d,g,M){for(M=M&&((o.subtreeFlags&10256)!==0||!1),o=o.child;o!==null;){var C=r,U=o,$=d,me=g,ze=U.flags;switch(U.tag){case 0:case 11:case 15:ar(C,U,$,me,M),Ia(8,U);break;case 23:break;case 22:var rt=U.stateNode;U.memoizedState!==null?rt._visibility&2?ar(C,U,$,me,M):bo(C,U):(rt._visibility|=2,ar(C,U,$,me,M)),M&&ze&2048&&Bl(U.alternate,U);break;case 24:ar(C,U,$,me,M),M&&ze&2048&&dc(U.alternate,U);break;default:ar(C,U,$,me,M)}o=o.sibling}}function bo(r,o){if(o.subtreeFlags&10256)for(o=o.child;o!==null;){var d=r,g=o,M=g.flags;switch(g.tag){case 22:bo(d,g),M&2048&&Bl(g.alternate,g);break;case 24:bo(d,g),M&2048&&dc(g.alternate,g);break;default:bo(d,g)}o=o.sibling}}var hc=8192;function ua(r,o,d){if(r.subtreeFlags&hc)for(r=r.child;r!==null;)Ph(r,o,d),r=r.sibling}function Ph(r,o,d){switch(r.tag){case 26:ua(r,o,d),r.flags&hc&&r.memoizedState!==null&&SD(d,Pa,r.memoizedState,r.memoizedProps);break;case 5:ua(r,o,d);break;case 3:case 4:var g=Pa;Pa=Vv(r.stateNode.containerInfo),ua(r,o,d),Pa=g;break;case 22:r.memoizedState===null&&(g=r.alternate,g!==null&&g.memoizedState!==null?(g=hc,hc=16777216,ua(r,o,d),hc=g):ua(r,o,d));break;default:ua(r,o,d)}}function pc(r){var o=r.alternate;if(o!==null&&(r=o.child,r!==null)){o.child=null;do o=r.sibling,r.sibling=null,r=o;while(r!==null)}}function Il(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];Ks=g,ls(g,r)}pc(r)}if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Hr(r),r=r.sibling}function Hr(r){switch(r.tag){case 0:case 11:case 15:Il(r),r.flags&2048&&ir(9,r,r.return);break;case 3:Il(r);break;case 12:Il(r);break;case 22:var o=r.stateNode;r.memoizedState!==null&&o._visibility&2&&(r.return===null||r.return.tag!==13)?(o._visibility&=-3,Gr(r)):Il(r);break;default:Il(r)}}function Gr(r){var o=r.deletions;if((r.flags&16)!==0){if(o!==null)for(var d=0;d<o.length;d++){var g=o[d];Ks=g,ls(g,r)}pc(r)}for(r=r.child;r!==null;
vendor: 20,088 bytes, line 48
48){switch(o=r,o.tag){case 0:case 11:case 15:ir(8,o,o.return),Gr(o);break;case 22:d=o.stateNode,d._visibility&2&&(d._visibility&=-3,Gr(o));break;default:Gr(o)}r=r.sibling}}function ls(r,o){for(;Ks!==null;){var d=Ks;switch(d.tag){case 0:case 11:case 15:ir(8,d,o);break;case 23:case 22:if(d.memoizedState!==null&&d.memoizedState.cachePool!==null){var g=d.memoizedState.cachePool.pool;g!=null&&g.refCount++}break;case 24:Zl(d.memoizedState.cache)}if(g=d.child,g!==null)g.return=d,Ks=g;else e:for(d=r;Ks!==null;){g=Ks;var M=g.sibling,C=g.return;if(Nf(g),g===d){Ks=null;break e}if(M!==null){M.return=C,Ks=M;break e}Ks=C}}}var Yo={getCacheForType:function(r){var o=pn(ws),d=o.data.get(r);return d===void 0&&(d=r(),o.data.set(r,d)),d},cacheSignal:function(){return pn(ws).controller.signal}},bn=typeof WeakMap=="function"?WeakMap:Map,en=0,mn=null,Bn=null,wn=0,qn=0,dr=null,Na=!1,Xa=!1,qm=!1,fa=0,ns=0,So=0,Dl=0,Uf=0,Cr=0,ki=0,mc=null,cs=null,us=!1,yu=0,Ym=0,xs=1/0,is=null,_s=null,Si=0,da=null,xu=null,Ua=0,_u=0,bu=null,zf=null,Ll=0,gc=null;function ha(){return(en&2)!==0&&wn!==0?wn&-wn:W.T!==null?Xe():ia()}function zn(){if(Cr===0)if((wn&536870912)===0||Wn){var r=Ue;Ue<<=1,(Ue&3932160)===0&&(Ue=262144),Cr=r}else Cr=536870912;return r=Ur.current,r!==null&&(r.flags|=32),Cr}function In(r,o,d){(r===mn&&(qn===2||qn===9)||r.cancelPendingCommit!==null)&&(Ol(r,0),Rs(r,wn,Cr,!1)),gn(r,d),((en&2)===0||r!==mn)&&(r===mn&&((en&2)===0&&(Dl|=d),ns===4&&Rs(r,wn,Cr,!1)),gt(r))}function Fn(r,o,d){if((en&6)!==0)throw Error(n(327));var g=!d&&(o&127)===0&&(o&r.expiredLanes)===0||nn(r,o),M=g?Ff(r,o):Rr(r,o,!0),C=g;do{if(M===0){Xa&&!g&&Rs(r,o,0,!1);break}else{if(d=r.current.alternate,C&&!Ai(d)){M=Rr(r,o,!1),C=!1;continue}if(M===2){if(C=o,r.errorRecoveryDisabledLanes&C)var U=0;else U=r.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){o=U;e:{var $=r;M=mc;var me=$.current.memoizedState.isDehydrated;if(me&&(Ol($,U).flags|=256),U=Rr($,U,!1),U!==2){if(qm&&!me){$.errorRecoveryDisabledLanes|=C,Dl|=C,M=4;break e}C=cs,cs=M,C!==null&&(cs===null?cs=C:cs.push.apply(cs,C))}M=U}if(C=!1,M!==2)continue}}if(M===1){Ol(r,0),Rs(r,o,0,!0);break}e:{switch(g=r,C=M,C){case 0:case 1:throw Error(n(345));case 4:if((o&4194048)!==o)break;case 6:Rs(g,o,Cr,!Na);break e;case 2:cs=null;break;case 3:case 5:break;default:throw Error(n(329))}if((o&62914560)===o&&(M=yu+300-Ie(),10<M)){if(Rs(g,o,Cr,!Na),mt(g,0,!0)!==0)break e;Ua=o,g.timeoutHandle=BM(jn.bind(null,g,d,cs,is,us,o,Cr,Dl,ki,Na,C,"Throttled",-0,0),M);break e}jn(g,d,cs,is,us,o,Cr,Dl,ki,Na,C,null,-0,0)}}break}while(!0);gt(r)}function jn(r,o,d,g,M,C,U,$,me,ze,rt,ut,Ge,Ke){if(r.timeoutHandle=-1,ut=o.subtreeFlags,ut&8192||(ut&16785408)===16785408){ut={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Pe},Ph(o,C,ut);var Jt=(C&62914560)===C?yu-Ie():(C&4194048)===C?Ym-Ie():0;if(Jt=AD(ut,Jt),Jt!==null){Ua=C,r.cancelPendingCommit=Jt(Ko.bind(null,r,o,C,d,g,M,U,$,me,rt,ut,null,Ge,Ke)),Rs(r,C,U,!ze);return}}Ko(r,o,C,d,g,M,U,$,me)}function Ai(r){for(var o=r;;){var d=o.tag;if((d===0||d===11||d===15)&&o.flags&16384&&(d=o.updateQueue,d!==null&&(d=d.stores,d!==null)))for(var g=0;g<d.length;g++){var M=d[g],C=M.getSnapshot;M=M.value;try{if(!Sr(C(),M))return!1}catch{return!1}}if(d=o.child,o.subtreeFlags&16384&&d!==null)d.return=o,o=d;else{if(o===r)break;for(;o.sibling===null;){if(o.return===null||o.return===r)return!0;o=o.return}o.sibling.return=o.return,o=o.sibling}}return!0}function Rs(r,o,d,g){o&=~Uf,o&=~Dl,r.suspendedLanes|=o,r.pingedLanes&=~o,g&&(r.warmLanes|=o),g=r.expirationTimes;for(var M=o;0<M;){var C=31-Zt(M),U=1<<C;g[C]=-1,M&=~U}d!==0&&Lr(r,d,o)}function qa(){return(en&6)===0?(jt(0),!1):!0}function Pl(){if(Bn!==null){if(qn===0)var r=Bn.return;else r=Bn,fo=_l=null,vm(r),nc=null,ic=0,r=Bn;for(;r!==null;)ca(r.alternate,r),r=r.return;Bn=null}}function Ol(r,o){var d=r.timeoutHandle;d!==-1&&(r.timeoutHandle=-1,rD(d)),d=r.cancelPendingCommit,d!==null&&(r.cancelPendingCommit=null,d()),Ua=0,Pl(),mn=r,Bn=d=Pr(r.current,null),wn=o,qn=0,dr=null,Na=!1,Xa=nn(r,o),qm=!1,ki=Cr=Uf=Dl=So=ns=0,cs=mc=null,us=!1,(o&8)!==0&&(o|=o&32);var g=r.entangledLanes;if(g!==0)for(r=r.entanglements,g&=o;0<g;){var M=31-Zt(g),C=1<<M;o|=r[M],g&=~C}return fa=o,yf(),d}function Ao(r,o){_n=null,W.H=mu,o===Ql||o===Rn?(o=ec(),qn=3):o===Sf?(o=ec(),qn=4):qn=o===Sh?8:o!==null&&typeof o=="object"&&typeof o.then=="function"?6:1,dr=o,Bn===null&&(ns=1,bh(r,ra(o,r.current)))}function ss(){var r=Ur.current;return r===null?!0:(wn&4194048)===wn?Er===null:(wn&62914560)===wn||(wn&536870912)!==0?r===Er:!1}function Jo(){var r=W.H;return W.H=mu,r===null?mu:r}function Nl(){var r=W.A;return W.A=Yo,r}function Su(){ns=4,Na||(wn&4194048)!==wn&&Ur.current!==null||(Xa=!0),(So&134217727)===0&&(Dl&134217727)===0||mn===null||Rs(mn,wn,Cr,!1)}function Rr(r,o,d){var g=en;en|=2;var M=Jo(),C=Nl();(mn!==r||wn!==o)&&(is=null,Ol(r,o)),o=!1;var U=ns;e:do try{if(qn!==0&&Bn!==null){var $=Bn,me=dr;switch(qn){case 8:Pl(),U=6;break e;case 3:case 2:case 9:case 6:Ur.current===null&&(o=!0);var ze=qn;if(qn=0,dr=null,vc(r,$,me,ze),d&&Xa){U=0;break e}break;default:ze=qn,qn=0,dr=null,vc(r,$,me,ze)}}Au(),U=ns;break}catch(rt){Ao(r,rt)}while(!0);return o&&r.shellSuspendCounter++,fo=_l=null,en=g,W.H=M,W.A=C,Bn===null&&(mn=null,wn=0,yf()),U}function Au(){for(;Bn!==null;)Oh(Bn)}function Ff(r,o){var d=en;en|=2;var g=Jo(),M=Nl();mn!==r||wn!==o?(is=null,xs=Ie()+500,Ol(r,o)):Xa=nn(r,o);e:do try{if(qn!==0&&Bn!==null){o=Bn;var C=dr;t:switch(qn){case 1:qn=0,dr=null,vc(r,o,C,1);break;case 2:case 9:if(Nr(C)){qn=0,dr=null,kf(o);break}o=function(){qn!==2&&qn!==9||mn!==r||(qn=7),gt(r)},C.then(o,o);break e;case 3:qn=7;break e;case 4:qn=5;break e;case 7:Nr(C)?(qn=0,dr=null,kf(o)):(qn=0,dr=null,vc(r,o,C,7));break;case 5:var U=null;switch(Bn.tag){case 26:U=Bn.memoizedState;case 5:case 27:var $=Bn;if(U?WM(U):$.stateNode.complete){qn=0,dr=null;var me=$.sibling;if(me!==null)Bn=me;else{var ze=$.return;ze!==null?(Bn=ze,Ul(ze)):Bn=null}break t}}qn=0,dr=null,vc(r,o,C,5);break;case 6:qn=0,dr=null,vc(r,o,C,6);break;case 8:Pl(),ns=6;break e;default:throw Error(n(462))}}jr();break}catch(rt){Ao(r,rt)}while(!0);return fo=_l=null,W.H=g,W.A=M,en=d,Bn!==null?0:(mn=null,wn=0,yf(),ns)}function jr(){for(;Bn!==null&&!V();)Oh(Bn)}function Oh(r){var o=Bh(r.alternate,r,fa);r.memoizedProps=r.pendingProps,o===null?Ul(r):Bn=o}function kf(r){var o=r,d=o.alternate;switch(o.tag){case 15:case 0:o=If(d,o,o.pendingProps,o.type,void 0,wn);break;case 11:o=If(d,o,o.pendingProps,o.type.render,o.ref,wn);break;case 5:vm(o);default:ca(d,o),o=Bn=tu(o,fa),o=Bh(d,o,fa)}r.memoizedProps=r.pendingProps,o===null?Ul(r):Bn=o}function vc(r,o,d,g){fo=_l=null,vm(o),nc=null,ic=0;var M=o.return;try{if(Ns(r,M,o,d,wn)){ns=1,bh(r,ra(d,r.current)),Bn=null;return}}catch(C){if(M!==null)throw Bn=M,C;ns=1,bh(r,ra(d,r.current)),Bn=null;return}o.flags&32768?(Wn||g===1?r=!0:Xa||(wn&536870912)!==0?r=!1:(Na=r=!0,(g===2||g===9||g===3||g===6)&&(g=Ur.current,g!==null&&g.tag===13&&(g.flags|=16384))),Hf(o,r)):Ul(o)}function Ul(r){var o=r;do{if((o.flags&32768)!==0){Hf(o,Na);return}r=o.return;var d=Pf(o.alternate,o,fa);if(d!==null){Bn=d;return}if(o=o.sibling,o!==null){Bn=o;return}Bn=o=r}while(o!==null);ns===0&&(ns=5)}function Hf(r,o){do{var d=Ba(r.alternate,r);if(d!==null){d.flags&=32767,Bn=d;return}if(d=r.return,d!==null&&(d.flags|=32768,d.subtreeFlags=0,d.deletions=null),!o&&(r=r.sibling,r!==null)){Bn=r;return}Bn=r=d}while(r!==null);ns=6,Bn=null}function Ko(r,o,d,g,M,C,U,$,me){r.cancelPendingCommit=null;do Mu();while(Si!==0);if((en&6)!==0)throw Error(n(327));if(o!==null){if(o===r.current)throw Error(n(177));if(C=o.lanes|o.childLanes,C|=Xs,En(r,d,C,U,$,me),r===mn&&(Bn=mn=null,wn=0),xu=o,da=r,Ua=d,_u=C,bu=M,zf=g,(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?(r.callbackNode=null,r.callbackPriority=0,B(qe,function(){return Nh(),null})):(r.callbackNode=null,r.callbackPriority=0),g=(o.flags&13878)!==0,(o.subtreeFlags&13878)!==0||g){g=W.T,W.T=null,M=ee.p,ee.p=2,U=en,en|=4;try{Mb(r,o,d)}finally{en=U,ee.p=M,W.T=g}}Si=1,Bs(),Zo(),yc()}}function Bs(){if(Si===1){Si=0;var r=da,o=xu,d=(o.flags&13878)!==0;if((o.subtreeFlags&13878)!==0||d){d=W.T,W.T=null;var g=ee.p;ee.p=2;var M=en;en|=4;try{Rl(o,r);var C=Ib,U=Gg(r.containerInfo),$=C.focusedElem,me=C.selectionRange;if(U!==$&&$&&$.ownerDocument&&Li($.ownerDocument.documentElement,$)){if(me!==null&&$p($)){var ze=me.start,rt=me.end;if(rt===void 0&&(rt=ze),"selectionStart"in $)$.selectionStart=ze,$.selectionEnd=Math.min(rt,$.value.length);else{var ut=$.ownerDocument||document,Ge=ut&&ut.defaultView||window;if(Ge.getSelection){var Ke=Ge.getSelection(),Jt=$.textContent.length,hn=Math.min(me.start,Jt),Ui=me.end===void 0?hn:Math.min(me.end,Jt);!Ke.extend&&hn>Ui&&(U=Ui,Ui=hn,hn=U);var Ee=Qc($,hn),be=Qc($,Ui);if(Ee&&be&&(Ke.rangeCount!==1||Ke.anchorNode!==Ee.node||Ke.anchorOffset!==Ee.offset||Ke.focusNode!==be.node||Ke.focusOffset!==be.offset)){var Ne=ut.createRange();Ne.setStart(Ee.node,Ee.offset),Ke.removeAllRanges(),hn>Ui?(Ke.addRange(Ne),Ke.extend(be.node,be.offset)):(Ne.setEnd(be.node,be.offset),Ke.addRange(Ne))}}}}for(ut=[],Ke=$;Ke=Ke.parentNode;)Ke.nodeType===1&&ut.push({element:Ke,left:Ke.scrollLeft,top:Ke.scrollTop});for(typeof $.focus=="function"&&$.focus(),$=0;$<ut.length;$++){var at=ut[$];at.element.scrollLeft=at.left,at.element.scrollTop=at.top}}Kv=!!Bb,Ib=Bb=null}finally{en=M,ee.p=g,W.T=d}}r.current=o,Si=2}}function Zo(){if(Si===2){Si=0;var r=da,o=xu,d=(o.flags&8772)!==0;if((o.subtreeFlags&8772)!==0||d){d=W.T,W.T=null;var g=ee.p;ee.p=2;var M=en;en|=4;try{Xi(r,o.alternate,o)}finally{en=M,ee.p=g,W.T=d}}Si=3}}function yc(){if(Si===4||Si===3){Si=0,Se();var r=da,o=xu,d=Ua,g=zf;(o.subtreeFlags&10256)!==0||(o.flags&10256)!==0?Si=5:(Si=0,xu=da=null,Mo(r,r.pendingLanes));var M=r.pendingLanes;if(M===0&&(_s=null),xr(d),o=o.stateNode,Ft&&typeof Ft.onCommitFiberRoot=="function")try{Ft.onCommitFiberRoot(Ct,o,void 0,(o.current.flags&128)===128)}catch{}if(g!==null){o=W.T,M=ee.p,ee.p=2,W.T=null;try{for(var C=r.onRecoverableError,U=0;U<g.length;U++){var $=g[U];C($.value,{componentStack:$.stack})}}finally{W.T=o,ee.p=M}}(Ua&3)!==0&&Mu(),gt(r),M=r.pendingLanes,(d&261930)!==0&&(M&42)!==0?r===gc?Ll++:(Ll=0,gc=r):Ll=0,jt(0)}}function Mo(r,o){(r.pooledCacheLanes&=o)===0&&(o=r.pooledCache,o!=null&&(r.pooledCache=null,Zl(o)))}function Mu(){return Bs(),Zo(),yc(),Nh()}function Nh(){if(Si!==5)return!1;var r=da,o=_u;_u=0;var d=xr(Ua),g=W.T,M=ee.p;try{ee.p=32>d?32:d,W.T=null,d=bu,bu=null;var C=da,U=Ua;if(Si=0,xu=da=null,Ua=0,(en&6)!==0)throw Error(n(331));var $=en;if(en|=4,Hr(C.current),Xm(C,C.current,U,d),en=$,jt(0,!1),Ft&&typeof Ft.onPostCommitFiberRoot=="function")try{Ft.onPostCommitFiberRoot(Ct,C)}catch{}return!0}finally{ee.p=M,W.T=g,Mo(r,o)}}function Jm(r,o,d){o=ra(d,o),o=Fm(r.stateNode,o,2),r=Al(r,o,2),r!==null&&(gn(r,2),gt(r))}function ii(r,o,d){if(r.tag===3)Jm(r,r,d);else for(;o!==null;){if(o.tag===3){Jm(o,r,d);break}else if(o.tag===1){var g=o.stateNode;if(typeof o.type.getDerivedStateFromError=="function"||typeof g.componentDidCatch=="function"&&(_s===null||!_s.has(g))){r=ra(d,r),d=km(2),g=Al(o,d,2),g!==null&&(Ov(d,g,o,r),gn(g,2),gt(g));break}}o=o.return}}function Gf(r,o,d){var g=r.pingCache;if(g===null){g=r.pingCache=new bn;var M=new Set;g.set(o,M)}else M=g.get(o),M===void 0&&(M=new Set,g.set(o,M));M.has(d)||(qm=!0,M.add(d),r=c.bind(null,r,o,d),o.then(r,r))}function c(r,o,d){var g=r.pingCache;g!==null&&g.delete(o),r.pingedLanes|=r.suspendedLanes&d,r.warmLanes&=~d,mn===r&&(wn&d)===d&&(ns===4||ns===3&&(wn&62914560)===wn&&300>Ie()-yu?(en&2)===0&&Ol(r,0):Uf|=d,ki===wn&&(ki=0)),gt(r)}function f(r,o){o===0&&(o=Dt()),r=Ar(r,o),r!==null&&(gn(r,o),gt(r))}function y(r){var o=r.memoizedState,d=0;o!==null&&(d=o.retryLane),f(r,d)}function S(r,o){var d=0;switch(r.tag){case 31:case 13:var g=r.stateNode,M=r.memoizedState;M!==null&&(d=M.retryLane);break;case 19:g=r.stateNode;break;case 22:g=r.stateNode._retryCache;break;default:throw Error(n(314))}g!==null&&g.delete(o),f(r,d)}function B(r,o){return Ve(r,o)}var O=null,Z=null,ge=!1,Je=!1,ht=!1,wt=0;function gt(r){r!==Z&&r.next===null&&(Z===null?O=Z=r:Z=Z.next=r),Je=!0,ge||(ge=!0,Ce())}function jt(r,o){if(!ht&&Je){ht=!0;do for(var d=!1,g=O;g!==null;){if(r!==0){var M=g.pendingLanes;if(M===0)var C=0;else{var U=g.suspendedLanes,$=g.pingedLanes;C=(1<<31-Zt(42|r)+1)-1,C&=M&~(U&~$),C=C&201326741?C&201326741|1:C?C|2:0}C!==0&&(d=!0,He(g,C))}else C=wn,C=mt(g,g===mn?C:0,g.cancelPendingCommit!==null||g.timeoutHandle!==-1),(C&3)===0||nn(g,C)||(d=!0,He(g,C));g=g.next}while(d);ht=!1}}function yn(){bs()}function bs(){Je=ge=!1;var r=0;wt!==0&&sD()&&(r=wt);for(var o=Ie(),d=null,g=O;g!==null;){var M=g.next,C=Eu(g,o);C===0?(g.next=null,d===null?O=M:d.next=M,M===null&&(Z=d)):(d=g,(r!==0||(C&3)!==0)&&(Je=!0)),g=M}Si!==0&&Si!==5||jt(r),wt!==0&&(wt=0)}function Eu(r,o){for(var d=r.suspendedLanes,g=r.pingedLanes,M=r.expirationTimes,C=r.pendingLanes&-62914561;0<C;){var U=31-Zt(C),$=1<<U,me=M[U];me===-1?(($&d)===0||($&g)!==0)&&(M[U]=kn($,o)):me<=o&&(r.expiredLanes|=$),C&=~$}if(o=mn,d=wn,d=mt(r,r===o?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),g=r.callbackNode,d===0||r===o&&(qn===2||qn===9)||r.cancelPendingCommit!==null)return g!==null&&g!==null&&ne(g),r.callbackNode=null,r.callbackPriority=0;if((d&3)===0||nn(r,d)){if(o=d&-d,o===r.callbackPriority)return o;switch(g!==null&&ne(g),xr(d)){case 2:case 8:d=Rt;break;case 32:d=qe;break;case 268435456:d=At;break;default:d=qe}return g=zl.bind(null,r),d=Ve(d,g),r.callbackPriority=o,r.callbackNode=d,o}return g!==null&&g!==null&&ne(g),r.callbackPriority=2,r.callbackNode=null,2}function zl(r,o){if(Si!==0&&Si!==5)return r.callbackNode=null,r.callbackPriority=0,null;var d=r.callbackNode;if(Mu()&&r.callbackNode!==d)return null;var g=wn;return g=mt(r,r===mn?g:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),g===0?null:(Fn(r,g,o),Eu(r,Ie()),r.callbackNode!=null&&r.callbackNode===d?zl.bind(null,r):null)}function He(r,o){if(Mu())return null;Fn(r,o,!0)}function Ce(){aD(function(){(en&6)!==0?Ve(Fe,yn):bs()})}function Xe(){if(wt===0){var r=ko;r===0&&(r=Bt,Bt<<=1,(Bt&261888)===0&&(Bt=256)),wt=r}return wt}function St(r){return r==null||typeof r=="symbol"||typeof r=="boolean"?null:typeof r=="function"?r:tt(""+r)}function un(r,o){var d=o.ownerDocument.createElement("input");return d.name=o.name,d.value=o.value,r.id&&d.setAttribute("form",r.id),o.parentNode.insertBefore(d,o),r=new FormData(r),d.parentNode.removeChild(d),r}function rs(r,o,d,g,M){if(o==="submit"&&d&&d.stateNode===M){var C=St((M[Fi]||null).action),U=g.submitter;U&&(o=(o=U[Fi]||null)?St(o.formAction):U.getAttribute("formAction"),o!==null&&(C=o,U=null));var $=new of("action","action",null,g,M);r.push({event:$,listeners:[{instance:null,listener:function(){if(g.defaultPrevented){if(wt!==0){var me=U?un(M,U):new FormData(M);Im(d,{pending:!0,data:me,method:M.method,action:C},null,me)}}else typeof C=="function"&&($.preventDefault(),me=U?un(M,U):new FormData(M),Im(d,{pending:!0,data:me,method:M.method,action:C},C,me))},currentTarget:M}]})}}for(var fn=0;fn<gf.length;fn++){var Zn=gf[fn],Zs=Zn.toLowerCase(),fi=Zn[0].toUpperCase()+Zn.slice(1);Aa(Zs,"on"+fi)}Aa(Jd,"onAnimationEnd"),Aa(mf,"onAnimationIteration"),Aa(tm,"onAnimationStart"),Aa("dblclick","onDoubleClick"),Aa("focusin","onFocus"),Aa("focusout","onBlur"),Aa(Vg,"onTransitionRun"),Aa(gb,"onTransitionStart"),Aa(Wg,"onTransitionCancel"),Aa(nm,"onTransitionEnd"),Nt("onMouseEnter",["mouseout","mouseover"]),Nt("onMouseLeave",["mouseout","mouseover"]),Nt("onPointerEnter",["pointerout","pointerover"]),Nt("onPointerLeave",["pointerout","pointerover"]),Et("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Et("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Et("onBeforeInput",["compositionend","keypress","textInput","paste"]),Et("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Et("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Et("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var za="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Eb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(za));function SM(r,o){o=(o&4)!==0;for(var d=0;d<r.length;d++){var g=r[d],M=g.event;g=g.listeners;e:{var C=void 0;if(o)for(var U=g.length-1;0<=U;U--){var $=g[U],me=$.instance,ze=$.currentTarget;if($=$.listener,me!==C&&M.isPropagationStopped())break e;C=$,M.currentTarget=ze;try{C(M)}catch(rt){vf(rt)}M.currentTarget=null,C=me}else for(U=0;U<g.length;U++){if($=g[U],me=$.instance,ze=$.currentTarget,$=$.listener,me!==C&&M.isPropagationStopped())break e;C=$,M.currentTarget=ze;try{C(M)}catch(rt){vf(rt)}M.currentTarget=null,C=me}}}}function Yn(r,o){var d=o[ui];d===void 0&&(d=o[ui]=new Set);var g=r+"__bubble";d.has(g)||(AM(o,r,2,!1),d.add(g))}function Tb(r,o,d){var g=0;o&&(g|=4),AM(d,r,g,o)}var Hv="_reactListening"+Math.random().toString(36).slice(2);function wb(r){if(!r[Hv]){r[Hv]=!0,dt.forEach(function(d){d!=="selectionchange"&&(Eb.has(d)||Tb(d,!1,r),Tb(d,!0,r))});var o=r.nodeType===9?r:r.ownerDocument;o===null||o[Hv]||(o[Hv]=!0,Tb("selectionchange",!1,o))}}function AM(r,o,d,g){switch(QM(o)){case 2:var M=TD;break;case 8:M=wD;break;default:M=Gb}d=M.bind(null,o,d,r),M=void 0,!Ii||o!=="touchstart"&&o!=="touchmove"&&o!=="wheel"||(M=!0),g?M!==void 0?r.addEventListener(o,d,{capture:!0,passive:M}):r.addEventListener(o,d,!0):M!==void 0?r.addEventListener(o,d,{passive:M}):r.addEventListener(o,d,!1)}function Cb(r,o,d,g,M){var C=g;if((o&1)===0&&(o&2)===0&&g!==null)e:for(;;){if(g===null)return;var U=g.tag;if(U===3||U===4){var $=g.stateNode.containerInfo;if($===M)break;if(U===4)for(U=g.return;U!==null;){var me=U.tag;if((me===3||me===4)&&U.stateNode.containerInfo===M)return;U=U.return}for(;$!==null;){if(U=Q($),U===null)return;if(me=U.tag,me===5||me===6||me===26||me===27){g=C=U;continue e}$=$.parentNode}}g=g.return}_t(function(){var ze=C,rt=Ze(d),ut=[];e:{var Ge=Sa.get(r);if(Ge!==void 0){var Ke=of,Jt=r;switch(r){case"keypress":if(af(d)===0)break e;case"keydown":case"keyup":Ke=Xl;break;case"focusin":Jt="focus",Ke=kd;break;case"focusout":Jt="blur",Ke=kd;break;case"beforeblur":case"afterblur":Ke=kd;break;case"click":if(d.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Ke=zp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Ke=Mg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Ke=Bg;break;case Jd:case mf:case tm:Ke=hb;break;case nm:Ke=mb;break;case"scroll":case"scrollend":Ke=Sg;break;case"wheel":Ke=Dg;break;case"copy":case"cut":case"paste":Ke=Tg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Ke=Hp;break;case"toggle":case"beforetoggle":Ke=Pg}var hn=(o&4)!==0,Ui=!hn&&(r==="scroll"||r==="scrollend"),Ee=hn?Ge!==null?Ge+"Capture":null:Ge;hn=[];for(var be=ze,Ne;be!==null;){var at=be;if(Ne=at.stateNode,at=at.tag,at!==5&&at!==26&&at!==27||Ne===null||Ee===null||(at=Ht(be,Ee),at!=null&&hn.push(Km(be,at,Ne))),Ui)break;be=be.return}0<hn.length&&(Ge=new Ke(Ge,Jt,null,d,rt),ut.push({event:Ge,listeners:hn}))}}if((o&7)===0){e:{if(Ge=r==="mouseover"||r==="pointerover",Ke=r==="mouseout"||r==="pointerout",Ge&&d!==We&&(Jt=d.relatedTarget||d.fromElement)&&(Q(Jt)||Jt[_r]))break e;if((Ke||Ge)&&(Ge=rt.window===rt?rt:(Ge=rt.ownerDocument)?Ge.defaultView||Ge.parentWindow:window,Ke?(Jt=d.relatedTarget||d.toElement,Ke=ze,Jt=Jt?Q(Jt):null,Jt!==null&&(Ui=a(Jt),hn=Jt.tag,Jt!==Ui||hn!==5&&hn!==27&&hn!==6)&&(Jt=null)):(Ke=null,Jt=ze),Ke!==Jt)){if(hn=zp,at="onMouseLeave",Ee="onMouseEnter",be="mou
48se",(r==="pointerout"||r==="pointerover")&&(hn=Hp,at="onPointerLeave",Ee="onPointerEnter",be="pointer"),Ui=Ke==null?Ge:De(Ke),Ne=Jt==null?Ge:De(Jt),Ge=new hn(at,be+"leave",Ke,d,rt),Ge.target=Ui,Ge.relatedTarget=Ne,at=null,Q(rt)===ze&&(hn=new hn(Ee,be+"enter",Jt,d,rt),hn.target=Ne,hn.relatedTarget=Ui,at=hn),Ui=at,Ke&&Jt)t:{for(hn=$3,Ee=Ke,be=Jt,Ne=0,at=Ee;at;at=hn(at))Ne++;at=0;for(var ln=be;ln;ln=hn(ln))at++;for(;0<Ne-at;)Ee=hn(Ee),Ne--;for(;0<at-Ne;)be=hn(be),at--;for(;Ne--;){if(Ee===be||be!==null&&Ee===be.alternate){hn=Ee;break t}Ee=hn(Ee),be=hn(be)}hn=null}else hn=null;Ke!==null&&MM(ut,Ge,Ke,hn,!1),Jt!==null&&Ui!==null&&MM(ut,Ui,Jt,hn,!0)}}e:{if(Ge=ze?De(ze):window,Ke=Ge.nodeName&&Ge.nodeName.toLowerCase(),Ke==="select"||Ke==="input"&&Ge.type==="file")var gi=Yp;else if(qp(Ge))if(io)gi=Hg;else{gi=Zp;var Qt=Fg}else Ke=Ge.nodeName,!Ke||Ke.toLowerCase()!=="input"||Ge.type!=="checkbox"&&Ge.type!=="radio"?ze&&j(ze.elementType)&&(gi=Yp):gi=kg;if(gi&&(gi=gi(r,ze))){qd(ut,gi,d,rt);break e}Qt&&Qt(r,Ge,ze),r==="focusout"&&ze&&Ge.type==="number"&&ze.memoizedProps.value!=null&&mi(Ge,"number",Ge.value)}switch(Qt=ze?De(ze):window,r){case"focusin":(qp(Qt)||Qt.contentEditable==="true")&&(so=Qt,ro=ze,$c=null);break;case"focusout":$c=ro=so=null;break;case"mousedown":Yd=!0;break;case"contextmenu":case"mouseup":case"dragend":Yd=!1,eu(ut,d,rt);break;case"selectionchange":if(jg)break;case"keydown":case"keyup":eu(ut,d,rt)}var On;if(ql)e:{switch(r){case"compositionstart":var Qn="onCompositionStart";break e;case"compositionend":Qn="onCompositionEnd";break e;case"compositionupdate":Qn="onCompositionUpdate";break e}Qn=void 0}else Yl?Xd(r,d)&&(Qn="onCompositionEnd"):r==="keydown"&&d.keyCode===229&&(Qn="onCompositionStart");Qn&&(jp&&d.locale!=="ko"&&(Yl||Qn!=="onCompositionStart"?Qn==="onCompositionEnd"&&Yl&&(On=rf()):(Di=rt,sa="value"in Di?Di.value:Di.textContent,Yl=!0)),Qt=Gv(ze,Qn),0<Qt.length&&(Qn=new Hd(Qn,r,null,d,rt),ut.push({event:Qn,listeners:Qt}),On?Qn.data=On:(On=Vp(d),On!==null&&(Qn.data=On)))),(On=Wd?Ug(r,d):Wp(r,d))&&(Qn=Gv(ze,"onBeforeInput"),0<Qn.length&&(Qt=new Hd("onBeforeInput","beforeinput",null,d,rt),ut.push({event:Qt,listeners:Qn}),Qt.data=On)),rs(ut,r,ze,d,rt)}SM(ut,o)})}function Km(r,o,d){return{instance:r,listener:o,currentTarget:d}}function Gv(r,o){for(var d=o+"Capture",g=[];r!==null;){var M=r,C=M.stateNode;if(M=M.tag,M!==5&&M!==26&&M!==27||C===null||(M=Ht(r,d),M!=null&&g.unshift(Km(r,M,C)),M=Ht(r,o),M!=null&&g.push(Km(r,M,C))),r.tag===3)return g;r=r.return}return[]}function $3(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5&&r.tag!==27);return r||null}function MM(r,o,d,g,M){for(var C=o._reactName,U=[];d!==null&&d!==g;){var $=d,me=$.alternate,ze=$.stateNode;if($=$.tag,me!==null&&me===g)break;$!==5&&$!==26&&$!==27||ze===null||(me=ze,M?(ze=Ht(d,C),ze!=null&&U.unshift(Km(d,ze,me))):M||(ze=Ht(d,C),ze!=null&&U.push(Km(d,ze,me)))),d=d.return}U.length!==0&&r.push({event:o,listeners:U})}var eD=/\r\n?/g,tD=/\u0000|\uFFFD/g;function EM(r){return(typeof r=="string"?r:""+r).replace(eD,`
49`).replace(tD,"")}function TM(r,o){return o=EM(o),EM(r)===o}function Ni(r,o,d,g,M,C){switch(d){case"children":typeof g=="string"?o==="body"||o==="textarea"&&g===""||Y(r,g):(typeof g=="number"||typeof g=="bigint")&&o!=="body"&&Y(r,""+g);break;case"className":_i(r,"class",g);break;case"tabIndex":_i(r,"tabindex",g);break;case"dir":case"role":case"viewBox":case"width":case"height":_i(r,d,g);break;case"style":N(r,g,C);break;case"data":if(o!=="object"){_i(r,"data",g);break}case"src":case"href":if(g===""&&(o!=="a"||d!=="href")){r.removeAttribute(d);break}if(g==null||typeof g=="function"||typeof g=="symbol"||typeof g=="boolean"){r.removeAttribute(d);break}g=tt(""+g),r.setAttribute(d,g);break;case"action":case"formAction":if(typeof g=="function"){r.setAttribute(d,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof C=="function"&&(d==="formAction"?(o!=="input"&&Ni(r,o,"name",M.name,M,null),Ni(r,o,"formEncType",M.formEncType,M,null),Ni(r,o,"formMethod",M.formMethod,M,null),Ni(r,o,"formTarget",M.formTarget,M,null)):(Ni(r,o,"encType",M.encType,M,null),Ni(r,o,"method",M.method,M,null),Ni(r,o,"target",M.target,M,null)));if(g==null||typeof g=="symbol"||typeof g=="boolean"){r.removeAttribute(d);break}g=tt(""+g),r.setAttribute(d,g);break;case"onClick":g!=null&&(r.onclick=Pe);break;case"onScroll":g!=null&&Yn("scroll",r);break;case"onScrollEnd":g!=null&&Yn("scrollend",r);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(n(61));if(d=g.__html,d!=null){if(M.children!=null)throw Error(n(60));r.innerHTML=d}}break;case"multiple":r.multiple=g&&typeof g!="function"&&typeof g!="symbol";break;case"muted":r.muted=g&&typeof g!="function"&&typeof g!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(g==null||typeof g=="function"||typeof g=="boolean"||typeof g=="symbol"){r.removeAttribute("xlink:href");break}d=tt(""+g),r.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",d);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":g!=null&&typeof g!="function"&&typeof g!="symbol"?r.setAttribute(d,""+g):r.removeAttribute(d);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInl
49ine":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":g&&typeof g!="function"&&typeof g!="symbol"?r.setAttribute(d,""):r.removeAttribute(d);break;case"capture":case"download":g===!0?r.setAttribute(d,""):g!==!1&&g!=null&&typeof g!="function"&&typeof g!="symbol"?r.setAttribute(d,g):r.removeAttribute(d);break;case"cols":case"rows":case"size":case"span":g!=null&&typeof g!="function"&&typeof g!="symbol"&&!isNaN(g)&&1<=g?r.setAttribute(d,g):r.removeAttribute(d);break;case"rowSpan":case"start":g==null||typeof g=="function"||typeof g=="symbol"||isNaN(g)?r.removeAttribute(d):r.setAttribute(d,g);break;case"popover":Yn("beforetoggle",r),Yn("toggle",r),Pn(r,"popover",g);break;case"xlinkActuate":Vn(r,"http://www.w3.org/1999/xlink","xlink:actuate",g);break;case"xlinkArcrole":Vn(r,"http://www.w3.org/1999/xlink","xlink:arcrole",g);break;case"xlinkRole":Vn(r,"http://www.w3.org/1999/xlink","xlink:role",g);break;case"xlinkShow":Vn(r,"http://www.w3.org/1999/xlink","xlink:show",g);break;case"xlinkTitle":Vn(r,"http://www.w3.org/1999/xlink","xlink:title",g);break;case"xlinkType":Vn(r,"http://www.w3.org/1999/xlink","xlink:type",g);break;case"xmlBase":Vn(r,"http://www.w3.org/XML/1998/namespace","xml:base",g);break;case"xmlLang":Vn(r,"http://www.w3.org/XML/1998/namespace","xml:lang",g);break;case"xmlSpace":Vn(r,"http://www.w3.org/XML/1998/namespace","xml:space",g);break;case"is":Pn(r,"is",g);break;case"innerText":case"textContent":break;default:(!(2<d.length)||d[0]!=="o"&&d[0]!=="O"||d[1]!=="n"&&d[1]!=="N")&&(d=fe.get(d)||d,Pn(r,d,g))}}function Rb(r,o,d,g,M,C){switch(d){case"style":N(r,g,C);break;case"dangerouslySetInnerHTML":if(g!=null){if(typeof g!="object"||!("__html"in g))throw Error(n(61));if(d=g.__html,d!=null){if(M.children!=null)throw Error(n(60));r.innerHTML=d}}break;case"children":typeof g=="string"?Y(r,g):(typeof g=="number"||typeof g=="bigint")&&Y(r,""+g);break;case"onScroll":g!=null&&Yn("scroll",r);break;case"onScrollEnd":g!=null&&Yn("scrollend",r);break;case"onClick":g!=null&&(r.onclick=Pe);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!xt.hasOwnProperty(d))e:{if(d[0]==="o"&&d[1]==="n"&&(M=d.endsWith("Capture"),o=d.slice(2,M?d.length-7:void 0),C=r[Fi]||null,C=C!=null?C[d]:null,typeof C=="function"&&r.removeEventListener(o,C,M),typeof g=="function")){typeof C!="function"&&C!==null&&(d in r?r[d]=null:r.hasAttribute(d)&&r.removeAttribute(d)),r.addEventListener(o,g,M);break e}d in r?r[d]=g:g===!0?r.setAttribute(d,""):Pn(r,d,g)}}}function Br(r,o,d){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Yn("error",r),Yn("load",r);var g=!1,M=!1,C;for(C in d)if(d.hasOwnProperty(C)){var U=d[C];if(U!=null)switch(C){case"src":g=!0;break;case"srcSet":M=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n(137,o));default:Ni(r,o,C,U,d,null)}}M&&Ni(r,o,"srcSet",d.srcSet,d,null),g&&Ni(r,o,"src",d.src,d,null);return;case"input":Yn("invalid",r);var $=C=U=M=null,me=null,ze=null;for(g in d)if(d.hasOwnProperty(g)){var rt=d[g];if(rt!=null)switch(g){case"name":M=rt;break;case"type":U=rt;break;case"checked":me=rt;break;case"defaultChecked":ze=rt;break;case"value":C=rt;break;case"defaultValue":$=rt;break;case"children":case"dangerouslySetInnerHTML":if(rt!=null)throw Error(n(137,o));break;default:Ni(r,o,g,rt,d,null)}}Gi(r,C,$,me,ze,U,M,!1);return;case"select":Yn("invalid",r),g=U=C=null;for(M in d)if(d.hasOwnProperty(M)&&($=d[M],$!=null))switch(M){case"value":C=$;break;case"defaultValue":U=$;break;case"multiple":g=$;default:Ni(r,o,M,$,d,null)}o=C,d=U,r.multiple=!!g,o!=null?wi(r,!!g,o,!1):d!=null&&wi(r,!!g,d,!0);return;case"textarea":Yn("invalid",r),C=M=g=null;for(U in d)if(d.hasOwnProperty(U)&&($=d[U],$!=null))switch(U){case"value":g=$;break;case"defaultValue":M=$;break;case"children":C=$;break;case"dangerouslySetInnerHTML":if($!=null)throw Error(n(91));break;default:Ni(r,o,U,$,d,null)}no(r,g,M,C);return;case"option":for(me in d)if(d.hasOwnProperty(me)&&(g=d[me],g!=null))switch(me){case"selected":r.selected=g&&typeof g!="function"&&typeof g!="symbol";break;default:Ni(r,o,me,g,d,null)}return;case"dialog":Yn("beforetoggle",r),Yn("toggle",r),Yn("cancel",r),Yn("close",r);break;case"iframe":case"object":Yn("load",r);break;case"video":case"audio":for(g=0;g<za.length;g++)Yn(za[g],r);break;case"image":Yn("error",r),Yn("load",r);break;case"details":Yn("toggle",r);break;case"embed":case"source":case"link":Yn("error",r),Yn("load",r);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ze in d)if(d.hasOwnProperty(ze)&&(g=d[ze],g!=null))switch(ze){case"children":case"dangerouslySetInnerHTML":throw Error(n(137,o));default:Ni(r,o,ze,g,d,null)}return;default:if(j(o)){for(rt in d)d.hasOwnProperty(rt)&&(g=d[rt],g!==void 0&&Rb(r,o,rt,g,d,void 0));return}}for($ in d)d.hasOwnProperty($)&&(g=d[$],g!=null&&Ni(r,o,$,g,d,null))}function nD(r,o,d,g){switch(o){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var M=null,C=null,U=null,$=null,me=null,ze=null,rt=null;for(Ke in d){var ut=d[Ke];
vendor: 7,844 bytes, line 49
49if(d.hasOwnProperty(Ke)&&ut!=null)switch(Ke){case"checked":break;case"value":break;case"defaultValue":me=ut;default:g.hasOwnProperty(Ke)||Ni(r,o,Ke,null,g,ut)}}for(var Ge in g){var Ke=g[Ge];if(ut=d[Ge],g.hasOwnProperty(Ge)&&(Ke!=null||ut!=null))switch(Ge){case"type":C=Ke;break;case"name":M=Ke;break;case"checked":ze=Ke;break;case"defaultChecked":rt=Ke;break;case"value":U=Ke;break;case"defaultValue":$=Ke;break;case"children":case"dangerouslySetInnerHTML":if(Ke!=null)throw Error(n(137,o));break;default:Ke!==ut&&Ni(r,o,Ge,Ke,g,ut)}}Un(r,U,$,me,ze,rt,C,M);return;case"select":Ke=U=$=Ge=null;for(C in d)if(me=d[C],d.hasOwnProperty(C)&&me!=null)switch(C){case"value":break;case"multiple":Ke=me;default:g.hasOwnProperty(C)||Ni(r,o,C,null,g,me)}for(M in g)if(C=g[M],me=d[M],g.hasOwnProperty(M)&&(C!=null||me!=null))switch(M){case"value":Ge=C;break;case"defaultValue":$=C;break;case"multiple":U=C;default:C!==me&&Ni(r,o,M,C,g,me)}o=$,d=U,g=Ke,Ge!=null?wi(r,!!d,Ge,!1):!!g!=!!d&&(o!=null?wi(r,!!d,o,!0):wi(r,!!d,d?[]:"",!1));return;case"textarea":Ke=Ge=null;for($ in d)if(M=d[$],d.hasOwnProperty($)&&M!=null&&!g.hasOwnProperty($))switch($){case"value":break;case"children":break;default:Ni(r,o,$,null,g,M)}for(U in g)if(M=g[U],C=d[U],g.hasOwnProperty(U)&&(M!=null||C!=null))switch(U){case"value":Ge=M;break;case"defaultValue":Ke=M;break;case"children":break;case"dangerouslySetInnerHTML":if(M!=null)throw Error(n(91));break;default:M!==C&&Ni(r,o,U,M,g,C)}ms(r,Ge,Ke);return;case"option":for(var Jt in d)if(Ge=d[Jt],d.hasOwnProperty(Jt)&&Ge!=null&&!g.hasOwnProperty(Jt))switch(Jt){case"selected":r.selected=!1;break;default:Ni(r,o,Jt,null,g,Ge)}for(me in g)if(Ge=g[me],Ke=d[me],g.hasOwnProperty(me)&&Ge!==Ke&&(Ge!=null||Ke!=null))switch(me){case"selected":r.selected=Ge&&typeof Ge!="function"&&typeof Ge!="symbol";break;default:Ni(r,o,me,Ge,g,Ke)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var hn in d)Ge=d[hn],d.hasOwnProperty(hn)&&Ge!=null&&!g.hasOwnProperty(hn)&&Ni(r,o,hn,null,g,Ge);for(ze in g)if(Ge=g[ze],Ke=d[ze],g.hasOwnProperty(ze)&&Ge!==Ke&&(Ge!=null||Ke!=null))switch(ze){case"children":case"dangerouslySetInnerHTML":if(Ge!=null)throw Error(n(137,o));break;default:Ni(r,o,ze,Ge,g,Ke)}return;default:if(j(o)){for(var Ui in d)Ge=d[Ui],d.hasOwnProperty(Ui)&&Ge!==void 0&&!g.hasOwnProperty(Ui)&&Rb(r,o,Ui,void 0,g,Ge);for(rt in g)Ge=g[rt],Ke=d[rt],!g.hasOwnProperty(rt)||Ge===Ke||Ge===void 0&&Ke===void 0||Rb(r,o,rt,Ge,g,Ke);return}}for(var Ee in d)Ge=d[Ee],d.hasOwnProperty(Ee)&&Ge!=null&&!g.hasOwnProperty(Ee)&&Ni(r,o,Ee,null,g,Ge);for(ut in g)Ge=g[ut],Ke=d[ut],!g.hasOwnProperty(ut)||Ge===Ke||Ge==null&&Ke==null||Ni(r,o,ut,Ge,g,Ke)}function wM(r){switch(r){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function iD(){if(typeof performance.getEntriesByType=="function"){for(var r=0,o=0,d=performance.getEntriesByType("resource"),g=0;g<d.length;g++){var M=d[g],C=M.transferSize,U=M.initiatorType,$=M.duration;if(C&&$&&wM(U)){for(U=0,$=M.responseEnd,g+=1;g<d.length;g++){var me=d[g],ze=me.startTime;if(ze>$)break;var rt=me.transferSize,ut=me.initiatorType;rt&&wM(ut)&&(me=me.responseEnd,U+=rt*(me<$?1:($-ze)/(me-ze)))}if(--g,o+=8*(C+U)/(M.duration/1e3),r++,10<r)break}}if(0<r)return o/r/1e6}return navigator.connection&&(r=navigator.connection.downlink,typeof r=="number")?r:5}var Bb=null,Ib=null;function jv(r){return r.nodeType===9?r:r.ownerDocument}function CM(r){switch(r){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function RM(r,o){if(r===0)switch(o){case"svg":return 1;case"math":return 2;default:return 0}return r===1&&o==="foreignObject"?0:r}function Db(r,o){return r==="textarea"||r==="noscript"||typeof o.children=="string"||typeof o.children=="number"||typeof o.children=="bigint"||typeof o.dangerouslySetInnerHTML=="object"&&o.dangerouslySetInnerHTML!==null&&o.dangerouslySetInnerHTML.__html!=null}var Lb=null;function sD(){var r=window.event;return r&&r.type==="popstate"?r===Lb?!1:(Lb=r,!0):(Lb=null,!1)}var BM=typeof setTimeout=="function"?setTimeout:void 0,rD=typeof clearTimeout=="function"?clearTimeout:void 0,IM=typeof Promise=="function"?Promise:void 0,aD=typeof queueMicrotask=="function"?queueMicrotask:typeof IM<"u"?function(r){return IM.resolve(null).then(r).catch(oD)}:BM;function oD(r){setTimeout(function(){throw r})}function Tu(r){return r==="head"}function DM(r,o){var d=o,g=0;do{var M=d.nextSibling;if(r.removeChild(d),M&&M.nodeType===8)if(d=M.data,d==="/$"||d==="/&"){if(g===0){r.removeChild(M),kh(o);return}g--}else if(d==="$"||d==="$?"||d==="$~"||d==="$!"||d==="&")g++;else if(d==="html")Zm(r.ownerDocument.documentElement);else if(d==="head"){d=r.ownerDocument.head,Zm(d);for(var C=d.firstChild;C;){var U=C.nextSibling,$=C.nodeName;C[Ot]||$==="SCRIPT"||$==="STYLE"||$==="LINK"&&C.rel.toLowerCase()==="stylesheet"||d.removeChild(C),C=U}}else d==="body"&&Zm(r.ownerDocument.body);d=M}while(d);kh(o)}function LM(r,o){var d=r;r=0;do{var g=d.nextSibling;if(d.nodeType===1?o?(d._stashedDisplay=d.style.display,d.style.display="none"):(d.style.display=d._stashedDisplay||"",d.getAttribute("style")===""&&d.removeAttribute("style")):d.nodeType===3&&(o?(d._stashedText=d.nodeValue,d.nodeValue=""):d.nodeValue=d._stashedText||""),g&&g.nodeType===8)if(d=g.data,d==="/$"){if(r===0)break;r--}else d!=="$"&&d!=="$?"&&d!=="$~"&&d!=="$!"||r++;d=g}while(d)}function Pb(r){var o=r.firstChild;for(o&&o.nodeType===10&&(o=o.nextSibling);o;){var d=o;switch(o=o.nextSibling,d.nodeName){case"HTML":case"HEAD":case"BODY":Pb(d),Ln(d);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(d.rel.toLowerCase()==="stylesheet")continue}r.removeChild(d)}}function lD(r,o,d,g){for(;r.nodeType===1;){var M=d;if(r.nodeName.toLowerCase()!==o.toLowerCase()){if(!g&&(r.nodeName!=="INPUT"||r.type!=="hidden"))break}else if(g){if(!r[Ot])switch(o){case"meta":if(!r.hasAttribute("itemprop"))break;return r;case"link":if(C=r.getAttribute("rel"),C==="stylesheet"&&r.hasAttribute("data-precedence"))break;if(C!==M.rel||r.getAttribute("href")!==(M.href==null||M.href===""?null:M.href)||r.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin)||r.getAttribute("title")!==(M.title==null?null:M.title))break;return r;case"style":if(r.hasAttribute("data-precedence"))break;return r;case"script":if(C=r.getAttribute("src"),(C!==(M.src==null?null:M.src)||r.getAttribute("type")!==(M.type==null?null:M.type)||r.getAttribute("crossorigin")!==(M.crossOrigin==null?null:M.crossOrigin))&&C&&r.hasAttribute("async")&&!r.hasAttribute("itemprop"))break;return r;default:return r}}else if(o==="input"&&r.type==="hidden"){var C=M.name==null?null:""+M.name;if(M.type==="hidden"&&r.getAttribute("name")===C)return r}else return r;if(r=Eo(r.nextSibling),r===null)break}return null}function cD(r,o,d){if(o==="")return null;for(;r.nodeType!==3;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!d||(r=Eo(r.nextSibling),r===null))return null;return r}function PM(r,o){for(;r.nodeType!==8;)if((r.nodeType!==1||r.nodeName!=="INPUT"||r.type!=="hidden")&&!o||(r=Eo(r.nextSibling),r===null))return null;return r}function Ob(r){return r.data==="$?"||r.data==="$~"}function Nb(r){return r.data==="$!"||r.data==="$?"&&r.ownerDocument.readyState!=="loading"}function uD(r,o){var d=r.ownerDocument;if(r.data==="$~")r._reactRetry=o;else if(r.data!=="$?"||d.readyState!=="loading")o();else{var g=function(){o(),d.removeEventListener("DOMContentLoaded",g)};d.addEventListener("DOMContentLoaded",g),r._reactRetry=g}}function Eo(r){for(;r!=null;r=r.nextSibling){var o=r.nodeType;if(o===1||o===3)break;if(o===8){if(o=r.data,o==="$"||o==="$!"||o==="$?"||o==="$~"||o==="&"||o==="F!"||o==="F")break;
vendor: 10,037 bytes, line 49
49if(o==="/$"||o==="/&")return null}}return r}var Ub=null;function OM(r){r=r.nextSibling;for(var o=0;r;){if(r.nodeType===8){var d=r.data;if(d==="/$"||d==="/&"){if(o===0)return Eo(r.nextSibling);o--}else d!=="$"&&d!=="$!"&&d!=="$?"&&d!=="$~"&&d!=="&"||o++}r=r.nextSibling}return null}function NM(r){r=r.previousSibling;for(var o=0;r;){if(r.nodeType===8){var d=r.data;if(d==="$"||d==="$!"||d==="$?"||d==="$~"||d==="&"){if(o===0)return r;o--}else d!=="/$"&&d!=="/&"||o++}r=r.previousSibling}return null}function UM(r,o,d){switch(o=jv(d),r){case"html":if(r=o.documentElement,!r)throw Error(n(452));return r;case"head":if(r=o.head,!r)throw Error(n(453));return r;case"body":if(r=o.body,!r)throw Error(n(454));return r;default:throw Error(n(451))}}function Zm(r){for(var o=r.attributes;o.length;)r.removeAttributeNode(o[0]);Ln(r)}var To=new Map,zM=new Set;function Vv(r){return typeof r.getRootNode=="function"?r.getRootNode():r.nodeType===9?r:r.ownerDocument}var xc=ee.d;ee.d={f:fD,r:dD,D:hD,C:pD,L:mD,m:gD,X:yD,S:vD,M:xD};function fD(){var r=xc.f(),o=qa();return r||o}function dD(r){var o=ye(r);o!==null&&o.tag===5&&o.type==="form"?Tv(o):xc.r(r)}var Uh=typeof document>"u"?null:document;function FM(r,o,d){var g=Uh;if(g&&typeof o=="string"&&o){var M=Bi(o);M='link[rel="'+r+'"][href="'+M+'"]',typeof d=="string"&&(M+='[crossorigin="'+d+'"]'),zM.has(M)||(zM.add(M),r={rel:r,crossOrigin:d,href:o},g.querySelector(M)===null&&(o=g.createElement("link"),Br(o,"link",r),xe(o),g.head.appendChild(o)))}}function hD(r){xc.D(r),FM("dns-prefetch",r,null)}function pD(r,o){xc.C(r,o),FM("preconnect",r,o)}function mD(r,o,d){xc.L(r,o,d);var g=Uh;if(g&&r&&o){var M='link[rel="preload"][as="'+Bi(o)+'"]';o==="image"&&d&&d.imageSrcSet?(M+='[imagesrcset="'+Bi(d.imageSrcSet)+'"]',typeof d.imageSizes=="string"&&(M+='[imagesizes="'+Bi(d.imageSizes)+'"]')):M+='[href="'+Bi(r)+'"]';var C=M;switch(o){case"style":C=zh(r);break;case"script":C=Fh(r)}To.has(C)||(r=v({rel:"preload",href:o==="image"&&d&&d.imageSrcSet?void 0:r,as:o},d),To.set(C,r),g.querySelector(M)!==null||o==="style"&&g.querySelector(Qm(C))||o==="script"&&g.querySelector($m(C))||(o=g.createElement("link"),Br(o,"link",r),xe(o),g.head.appendChild(o)))}}function gD(r,o){xc.m(r,o);var d=Uh;if(d&&r){var g=o&&typeof o.as=="string"?o.as:"script",M='link[rel="modulepreload"][as="'+Bi(g)+'"][href="'+Bi(r)+'"]',C=M;switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":C=Fh(r)}if(!To.has(C)&&(r=v({rel:"modulepreload",href:r},o),To.set(C,r),d.querySelector(M)===null)){switch(g){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(d.querySelector($m(C)))return}g=d.createElement("link"),Br(g,"link",r),xe(g),d.head.appendChild(g)}}}function vD(r,o,d){xc.S(r,o,d);var g=Uh;if(g&&r){var M=Le(g).hoistableStyles,C=zh(r);o=o||"default";var U=M.get(C);if(!U){var $={loading:0,preload:null};if(U=g.querySelector(Qm(C)))$.loading=5;else{r=v({rel:"stylesheet",href:r,"data-precedence":o},d),(d=To.get(C))&&zb(r,d);var me=U=g.createElement("link");xe(me),Br(me,"link",r),me._p=new Promise(function(ze,rt){me.onload=ze,me.onerror=rt}),me.addEventListener("load",function(){$.loading|=1}),me.addEventListener("error",function(){$.loading|=2}),$.loading|=4,Wv(U,o,g)}U={type:"stylesheet",instance:U,count:1,state:$},M.set(C,U)}}}function yD(r,o){xc.X(r,o);var d=Uh;if(d&&r){var g=Le(d).hoistableScripts,M=Fh(r),C=g.get(M);C||(C=d.querySelector($m(M)),C||(r=v({src:r,async:!0},o),(o=To.get(M))&&Fb(r,o),C=d.createElement("script"),xe(C),Br(C,"link",r),d.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(M,C))}}function xD(r,o){xc.M(r,o);var d=Uh;if(d&&r){var g=Le(d).hoistableScripts,M=Fh(r),C=g.get(M);C||(C=d.querySelector($m(M)),C||(r=v({src:r,async:!0,type:"module"},o),(o=To.get(M))&&Fb(r,o),C=d.createElement("script"),xe(C),Br(C,"link",r),d.head.appendChild(C)),C={type:"script",instance:C,count:1,state:null},g.set(M,C))}}function kM(r,o,d,g){var M=(M=Be.current)?Vv(M):null;if(!M)throw Error(n(446));switch(r){case"meta":case"title":return null;case"style":return typeof d.precedence=="string"&&typeof d.href=="string"?(o=zh(d.href),d=Le(M).hoistableStyles,g=d.get(o),g||(g={type:"style",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};case"link":if(d.rel==="stylesheet"&&typeof d.href=="string"&&typeof d.precedence=="string"){r=zh(d.href);var C=Le(M).hoistableStyles,U=C.get(r);if(U||(M=M.ownerDocument||M,U={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},C.set(r,U),(C=M.querySelector(Qm(r)))&&!C._p&&(U.instance=C,U.state.loading=5),To.has(r)||(d={rel:"preload",as:"style",href:d.href,crossOrigin:d.crossOrigin,integrity:d.integrity,media:d.media,hrefLang:d.hrefLang,referrerPolicy:d.referrerPolicy},To.set(r,d),C||_D(M,r,d,U.state))),o&&g===null)throw Error(n(528,""));return U}if(o&&g!==null)throw Error(n(529,""));return null;case"script":return o=d.async,d=d.src,typeof d=="string"&&o&&typeof o!="function"&&typeof o!="symbol"?(o=Fh(d),d=Le(M).hoistableScripts,g=d.get(o),g||(g={type:"script",instance:null,count:0,state:null},d.set(o,g)),g):{type:"void",instance:null,count:0,state:null};default:throw Error(n(444,r))}}function zh(r){return'href="'+Bi(r)+'"'}function Qm(r){return'link[rel="stylesheet"]['+r+"]"}function HM(r){return v({},r,{"data-precedence":r.precedence,precedence:null})}function _D(r,o,d,g){r.querySelector('link[rel="preload"][as="style"]['+o+"]")?g.loading=1:(o=r.createElement("link"),g.preload=o,o.addEventListener("load",function(){return g.loading|=1}),o.addEventListener("error",function(){return g.loading|=2}),Br(o,"link",d),xe(o),r.head.appendChild(o))}function Fh(r){return'[src="'+Bi(r)+'"]'}function $m(r){return"script[async]"+r}function GM(r,o,d){if(o.count++,o.instance===null)switch(o.type){case"style":var g=r.querySelector('style[data-href~="'+Bi(d.href)+'"]');if(g)return o.instance=g,xe(g),g;var M=v({},d,{"data-href":d.href,"data-precedence":d.precedence,href:null,precedence:null});return g=(r.ownerDocument||r).createElement("style"),xe(g),Br(g,"style",M),Wv(g,d.precedence,r),o.instance=g;case"stylesheet":M=zh(d.href);var C=r.querySelector(Qm(M));if(C)return o.state.loading|=4,o.instance=C,xe(C),C;g=HM(d),(M=To.get(M))&&zb(g,M),C=(r.ownerDocument||r).createElement("link"),xe(C);var U=C;return U._p=new Promise(function($,me){U.onload=$,U.onerror=me}),Br(C,"link",g),o.state.loading|=4,Wv(C,d.precedence,r),o.instance=C;case"script":return C=Fh(d.src),(M=r.querySelector($m(C)))?(o.instance=M,xe(M),M):(g=d,(M=To.get(C))&&(g=v({},d),Fb(g,M)),r=r.ownerDocument||r,M=r.createElement("script"),xe(M),Br(M,"link",g),r.head.appendChild(M),o.instance=M);case"void":return null;default:throw Error(n(443,o.type))}else o.type==="stylesheet"&&(o.state.loading&4)===0&&(g=o.instance,o.state.loading|=4,Wv(g,d.precedence,r));return o.instance}function Wv(r,o,d){for(var g=d.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),M=g.length?g[g.length-1]:null,C=M,U=0;U<g.length;U++){var $=g[U];if($.dataset.precedence===o)C=$;else if(C!==M)break}C?C.parentNode.insertBefore(r,C.nextSibling):(o=d.nodeType===9?d.head:d,o.insertBefore(r,o.firstChild))}function zb(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.title==null&&(r.title=o.title)}function Fb(r,o){r.crossOrigin==null&&(r.crossOrigin=o.crossOrigin),r.referrerPolicy==null&&(r.referrerPolicy=o.referrerPolicy),r.integrity==null&&(r.integrity=o.integrity)}var Xv=null;function jM(r,o,d){if(Xv===null){var g=new Map,M=Xv=new Map;M.set(d,g)}else M=Xv,g=M.get(d),g||(g=new Map,M.set(d,g));if(g.has(r))return g;for(g.set(r,null),d=d.getElementsByTagName(r),M=0;M<d.length;M++){var C=d[M];if(!(C[Ot]||C[hi]||r==="link"&&C.getAttribute("rel")==="stylesheet")&&C.namespaceURI!=="http://www.w3.org/2000/svg"){var U=C.getAttribute(o)||"";U=r+U;var $=g.get(U);$?$.push(C):g.set(U,[C])}}return g}function VM(r,o,d){r=r.ownerDocument||r,r.head.insertBefore(d,o==="title"?r.querySelector("head > title"):null)}function bD(r,o,d){if(d===1||o.itemProp!=null)return!1;switch(r){case"meta":case"title":return!0;case"style":if(typeof o.precedence!="string"||typeof o.href!="string"||o.href==="")break;return!0;case"link":if(typeof o.rel!="string"||typeof o.href!="string"||o.href===""||o.onLoad||o.onError)break;switch(o.rel){case"stylesheet":return r=o.disabled,typeof o.precedence=="string"&&r==null;default:return!0}case"script":if(o.async&&typeof o.async!="function"&&typeof o.async!="symbol"&&!o.onLoad&&!o.onError&&o.src&&typeof o.src=="string")return!0}return!1}function WM(r){return!(r.type==="stylesheet"&&(r.state.loading&3)===0)}function SD(r,o,d,g){if(d.type==="stylesheet"&&(typeof g.media!="string"||matchMedia(g.media).matches!==!1)&&(d.state.loading&4)===0){if(d.instance===null){var M=zh(g.href),C=o.querySelector(Qm(M));if(C){o=C._p,o!==null&&typeof o=="object"&&typeof o.then=="function"&&(r.count++,r=qv.bind(r),o.then(r,r)),d.state.loading|=4,d.instance=C,xe(C);return}C=o.ownerDocument||o,g=HM(g),(M=To.get(M))&&zb(g,M),C=C.createElement("link"),xe(C);var U=C;U._p=new Promise(function($,me){U.onload=$,U.onerror=me}),Br(C,"link",g),d.instance=C}r.stylesheets===null&&(r.stylesheets=new Map),r.stylesheets.set(d,o),(o=d.state.preload)&&(d.state.loading&3)===0&&(r.count++,d=qv.bind(r),o.addEventListener("load",d),o.addEventListener("error",d))}}var kb=0;function AD(r,o){return r.stylesheets&&r.count===0&&Jv(r,r.stylesheets),0<r.count||0<r.imgCount?function(d){var g=setTimeout(function(){if(r.stylesheets&&Jv(r,r.stylesheets),r.unsuspend){var C=r.unsuspend;r.unsuspend=null,C()}},6e4+o);0<r.imgBytes&&kb===0&&(kb=62500*iD());var M=setTimeout(function(){if(r.waitingForImages=!1,r.count===0&&(r.stylesheets&&Jv(r,r.stylesheets),r.unsuspend)){var C=r.unsuspend;r.unsuspend=null,C()}},(r.imgBytes>kb?50:800)+o);return r.unsuspend=d,function(){r.unsuspend=null,clearTimeout(g),clearTimeout(
vendor: 4,097 bytes, line 49
49M)}}:null}function qv(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Jv(this,this.stylesheets);else if(this.unsuspend){var r=this.unsuspend;this.unsuspend=null,r()}}}var Yv=null;function Jv(r,o){r.stylesheets=null,r.unsuspend!==null&&(r.count++,Yv=new Map,o.forEach(MD,r),Yv=null,qv.call(r))}function MD(r,o){if(!(o.state.loading&4)){var d=Yv.get(r);if(d)var g=d.get(null);else{d=new Map,Yv.set(r,d);for(var M=r.querySelectorAll("link[data-precedence],style[data-precedence]"),C=0;C<M.length;C++){var U=M[C];(U.nodeName==="LINK"||U.getAttribute("media")!=="not all")&&(d.set(U.dataset.precedence,U),g=U)}g&&d.set(null,g)}M=o.instance,U=M.getAttribute("data-precedence"),C=d.get(U)||g,C===g&&d.set(null,M),d.set(U,M),this.count++,g=qv.bind(this),M.addEventListener("load",g),M.addEventListener("error",g),C?C.parentNode.insertBefore(M,C.nextSibling):(r=r.nodeType===9?r.head:r,r.insertBefore(M,r.firstChild)),o.state.loading|=4}}var e0={$$typeof:L,Provider:null,Consumer:null,_currentValue:te,_currentValue2:te,_threadCount:0};function ED(r,o,d,g,M,C,U,$,me){this.tag=1,this.containerInfo=r,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Tt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Tt(0),this.hiddenUpdates=Tt(null),this.identifierPrefix=g,this.onUncaughtError=M,this.onCaughtError=C,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=me,this.incompleteTransitions=new Map}function XM(r,o,d,g,M,C,U,$,me,ze,rt,ut){return r=new ED(r,o,d,U,me,ze,rt,ut,$),o=1,C===!0&&(o|=24),C=$i(3,null,null,o),r.current=C,C.stateNode=r,o=sm(),o.refCount++,r.pooledCache=o,o.refCount++,C.memoizedState={element:g,isDehydrated:d,cache:o},Mf(C),r}function qM(r){return r?(r=ml,r):ml}function YM(r,o,d,g,M,C){M=qM(M),g.context===null?g.context=M:g.pendingContext=M,g=Go(o),g.payload={element:d},C=C===void 0?null:C,C!==null&&(g.callback=C),d=Al(r,g,o),d!==null&&(In(d,r,o),Ml(d,r,o))}function JM(r,o){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var d=r.retryLane;r.retryLane=d!==0&&d<o?d:o}}function Hb(r,o){JM(r,o),(r=r.alternate)&&JM(r,o)}function KM(r){if(r.tag===13||r.tag===31){var o=Ar(r,67108864);o!==null&&In(o,r,67108864),Hb(r,67108864)}}function ZM(r){if(r.tag===13||r.tag===31){var o=ha();o=Vs(o);var d=Ar(r,o);d!==null&&In(d,r,o),Hb(r,o)}}var Kv=!0;function TD(r,o,d,g){var M=W.T;W.T=null;var C=ee.p;try{ee.p=2,Gb(r,o,d,g)}finally{ee.p=C,W.T=M}}function wD(r,o,d,g){var M=W.T;W.T=null;var C=ee.p;try{ee.p=8,Gb(r,o,d,g)}finally{ee.p=C,W.T=M}}function Gb(r,o,d,g){if(Kv){var M=jb(g);if(M===null)Cb(r,o,g,Zv,d),$M(r,g);else if(RD(M,r,o,d,g))g.stopPropagation();else if($M(r,g),o&4&&-1<CD.indexOf(r)){for(;M!==null;){var C=ye(M);if(C!==null)switch(C.tag){case 3:if(C=C.stateNode,C.current.memoizedState.isDehydrated){var U=bt(C.pendingLanes);if(U!==0){var $=C;for($.pendingLanes|=2,$.entangledLanes|=2;U;){var me=1<<31-Zt(U);$.entanglements[1]|=me,U&=~me}gt(C),(en&6)===0&&(xs=Ie()+500,jt(0))}}break;case 31:case 13:$=Ar(C,2),$!==null&&In($,C,2),qa(),Hb(C,2)}if(C=jb(g),C===null&&Cb(r,o,g,Zv,d),C===M)break;M=C}M!==null&&g.stopPropagation()}else Cb(r,o,g,null,d)}}function jb(r){return r=Ze(r),Vb(r)}var Zv=null;function Vb(r){if(Zv=null,r=Q(r),r!==null){var o=a(r);if(o===null)r=null;else{var d=o.tag;if(d===13){if(r=l(o),r!==null)return r;r=null}else if(d===31){if(r=u(o),r!==null)return r;r=null}else if(d===3){if(o.stateNode.current.memoizedState.isDehydrated)return o.tag===3?o.stateNode.containerInfo:null;r=null}else o!==r&&(r=null)}}return Zv=r,null}function QM(r){switch(r){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invali
49d":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(et()){case Fe:return 2;case Rt:return 8;case qe:case yt:return 32;case At:return 268435456;default:return 32}default:return 32}}var Wb=!1,wu=null,Cu=null,Ru=null,t0=new Map,n0=new Map,Bu=[],CD="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function $M(r,o){switch(r){case"focusin":case"focusout":wu=null;break;case"dragenter":case"dragleave":Cu=null;break;case"mouseover":case"mouseout":Ru=null;break;case"pointerover":case"pointerout":t0.delete(o.pointerId);break;case"gotpointercapture":case"lostpointercapture":n0.delete(o.pointerId)}}function i0(r,o,d,g,M,C){return r===null||r.nativeEvent!==C?(r={blockedOn:o,domEventName:d,eventSystemFlags:g,nativeEvent:C,targetContainers:[M]},o!==null&&(o=ye(o),o!==null&&KM(o)),r):(r.eventSystemFlags|=g,o=r.targetContainers,M!==null&&o.indexOf(M)===-1&&o.push(M),r)}function RD(r,o,d,g,M){switch(o){case"focusin":return wu=i0(wu,r,o,d,g,M),!0;case"dragenter":return Cu=i0(Cu,r,o,d,g,M),!0;case"mouseover":return Ru=i0(Ru,r,o,d,g,M),!0;case"pointerover":var C=M.pointerId;return t0.set(C,i0(t0.get(C)||null,r,o,d,g,M)),!0;case"gotpointercapture":return C=M.pointerId,n0.set(C,i0(n0.get(C)||null,r,o,d,g,M)),!0}return!1}function eE(r){var o=Q(r.target);if(o!==null){var d=a(o);if(d!==null){if(o=d.tag,o===13){if(o=l(d),o!==null){r.blockedOn=o,Ws(r.priority,function(){ZM(d)});return}}else if(o===31){if(o=u(d),o!==null){r.blockedOn=o,Ws(r.priority,function(){ZM(d)});return}}else if(o===3&&d.stateNode.current.memoizedState.isDehydrated){r.blockedOn=d.tag===3?d.stateNode.containerInfo:null;return}}}r.blockedOn=null}function Qv(r){if(r.blockedOn!==null)return!1;for(var o=r.targetContainers;0<o.length;){var d=jb(r.nativeEvent);if(d===null){d=r.nativeEvent;var g=new d.constructor(d.type,d);We=g,d.target.dispatchEvent(g),We=null}else return o=ye(d),o!==null&&KM(o),r.blockedOn=d,!1;o.shift()}return!0}function tE(r,o,d){Qv(r)&&d.delete(o)}function BD(){Wb=!1,wu!==null&&Qv(wu)&&(wu=null),Cu!==null&&Qv(Cu)&&(Cu=null),Ru!==null&&Qv(Ru)&&(Ru=null),t0.forEach(tE),n0.forEach(tE)}function $v(r,o){r.blockedOn===o&&(r.blockedOn=null,Wb||(Wb=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,BD)))}var ey=null;function nE(r){ey!==r&&(ey=r,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ey===r&&(ey=null);for(var o=0;o<r.length;o+=3){var d=r[o],g=r[o+1],M=r[o+2];if(typeof g!="function"){if(Vb(g||d)===null)continue;break}var C=ye(d);C!==null&&(r.splice(o,3),o-=3,Im(C,{pending:!0,data:M,method:d.method,action:g},g,M))}}))}function kh(r){function o(me){return $v(me,r)}wu!==null&&$v(wu,r),Cu!==null&&$v(Cu,r),Ru!==null&&$v(Ru,r),t0.forEach(o),n0.forEach(o);for(var d=0;d<Bu.length;d++){var g=Bu[d];g.blockedOn===r&&(g.blockedOn=null)}for(;0<Bu.length&&(d=Bu[0],d.blockedOn===null);)eE(d),d.blockedOn===null&&Bu.shift();if(d=(r.ownerDocument||r).$$reactFormReplay,d!=null)for(g=0;g<d.length;g+=3){var M=d[g],C=d[g+1],U=M[Fi]||null;if(typeof C=="function")U||nE(d);else if(U){var $=null;if(C&&C.hasAttribute("formAction")){if(M=C,U=C[Fi]||null)$=U.formAction;else if(Vb(M)!==null)continue}else $=U.action;typeof $=="function"?d[g+1]=$:(d.splice(g,3),g-=3),nE(d)}}}function iE(){function r(C){C.canIntercept&&C.info==="react-transition"&&C.intercept({handler:function(){return new Promise(function(U){return M=U})},focusReset:"manual",scroll:"manual"})}function o(){M!==null&&(M(),M=null),g||setTimeout(d,20)}function d(){if(!g&&!navigation.transition){var C=navigation.currentEntry;
49C&&C.url!=null&&navigation.navigate(C.url,{state:C.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var g=!1,M=null;return navigation.addEventListener("navigate",r),navigation.addEventListener("navigatesuccess",o),navigation.addEventListener("navigateerror",o),setTimeout(d,100),function(){g=!0,navigation.removeEventListener("navigate",r),navigation.removeEventListener("navigatesuccess",o),navigation.removeEventListener("navigateerror",o),M!==null&&(M(),M=null)}}}function Xb(r){this._internalRoot=r}ty.prototype.render=Xb.prototype.render=function(r){var o=this._internalRoot;if(o===null)throw Error(n(409));var d=o.current,g=ha();YM(d,g,r,o,null,null)},ty.prototype.unmount=Xb.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var o=r.containerInfo;YM(r.current,2,null,r,null,null),qa(),o[_r]=null}};function ty(r){this._internalRoot=r}ty.prototype.unstable_scheduleHydration=function(r){if(r){var o=ia();r={blockedOn:null,target:r,priority:o};for(var d=0;d<Bu.length&&o!==0&&o<Bu[d].priority;d++);Bu.splice(d,0,r),d===0&&eE(r)}};var sE=e.version;if(sE!=="19.2.5")throw Error(n(527,sE,"19.2.5"));ee.findDOMNode=function(r){var o=r._reactInternals;if(o===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=p(o),r=r!==null?m(r):null,r=r===null?null:r.stateNode,r};var ID={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:W,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ny=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ny.isDisabled&&ny.supportsFiber)try{Ct=ny.inject(ID),Ft=ny}catch{}}return r0.createRoot=function(r,o){if(!s(r))throw Error(n(299));var d=!1,g="",M=Lv,C=Um,U=zm;return o!=null&&(o.unstable_strictMode===!0&&(d=!0),o.identifierPrefix!==void 0&&(g=o.identifierPrefix),o.onUncaughtError!==void 0&&(M=o.onUncaughtError),o.onCaughtError!==void 0&&(C=o.onCaughtError),o.onRecoverableError!==void 0&&(U=o.onRecoverableError)),o=XM(r,1,!1,null,null,d,g,null,M,C,U,iE),r[_r]=o.current,wb(r),new Xb(o)},r0.hydrateRoot=function(r,o,d){if(!s(r))throw Error(n(299));var g=!1,M="",C=Lv,U=Um,$=zm,me=null;return d!=null&&(d.unstable_strictMode===!0&&(g=!0),d.identifierPrefix!==void 0&&(M=d.identifierPrefix),d.onUncaughtError!==void 0&&(C=d.onUncaughtError),d.onCaughtError!==void 0&&(U=d.onCaughtError),d.onRecoverableError!==void 0&&($=d.onRecoverableError),d.formState!==void 0&&(me=d.formState)),o=XM(r,1,!0,o,d??null,g,M,me,C,U,$,iE),o.context=qM(null),d=o.current,g=ha(),g=Vs(g),M=Go(g),M.callback=null,Al(d,M,g),d=g,o.current.lanes=d,gn(o,d),gt(o),r[_r]=o.current,wb(r),new ty(o)},r0.version="19.2.5",r0}var pE;function FD(){if(pE)return Jb.exports;pE=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(e){console.error(e)}}return i(),Jb.exports=zD(),Jb.exports}var sR=FD();const mE=i=>{let e;const t=new Set,n=(p,m)=>{const v=typeof p=="function"?p(e):p;if(!Object.is(v,e)){const x=e;e=m??(typeof v!="object"||v===null)?v:Object.assign({},e,v),t.forEach(_=>_(e,x))}},s=()=>e,u={setState:n,getState:s,getInitialState:()=>h,subscribe:p=>(t.add(p),()=>t.delete(p))},h=e=i(n,s,u);return u},rR=(i=>i?mE(i):mE),kD=i=>i;function HD(i,e=kD){const t=ld.useSyncExternalStore(i.subscribe,ld.useCallback(()=>e(i.getState()),[i,e]),ld.useCallback(()=>e(i.getInitialState()),[i,e]));return ld.useDebugValue(t),t}const gE=i=>{const e=rR(i),t=n=>HD(e,n);return Object.assign(t,e),t},jc=(i=>i?gE(i):gE),k0={shadow_runner:"#00f5ff",pulse_tank:"#ff2d2d",neon_striker:"#ffe600"},vA={shadow_runner:{hp:80,speed:8,stamina:120,favoriteWeapon:"faca + pistola",visual:"Preto neon azul"},pulse_tank:{hp:140,speed:4,stamina:80,favoriteWeapon:"metralhadora + barra_metal",visual:"Armadura vermelha industrial"},neon_striker:{hp:100,speed:6,stamina:100,favoriteWeapon:"espada + SMG",visual:"Amarelo neon cyber armor"}},aR={pistola:{damage:28,fireRate:3,magazineSize:12,reloadTime:1.5,range:25},metralhadora:{damage:18,fireRate:8,magazineSize:30,reloadTime:2.3,range:20},laser_rifle:{damage:45,fireRate:2.5,magazineSize:30,reloadTime:3,range:60}},GD=300*1e3,jD=10*1e3,md=8,VD=900*1e3,WD=GD,$b=2,XD=200,vE=2,oR=60,qD=380,YD=["AD","AE","AF","AG","AI","AL","AM","AO","AQ","AR","AS","AT","AU","AW","AX","AZ","BA","BB","BD","BE","BF","BG","BH","BI","BJ","BL","BM","BN","BO","BQ","BR","BS","BT","BV","BW","BY","BZ","CA","CC","CD","CF","CG","CH","CI","CK","CL","CM","CN","CO","CR","CU","CV","CW","CX","CY","CZ","DE","DJ","DK","DM","DO","DZ","EC","EE","EG","EH","E
49R","ES","ET","FI","FJ","FK","FM","FO","FR","GA","GB","GD","GE","GF","GG","GH","GI","GL","GM","GN","GP","GQ","GR","GS","GT","GU","GW","GY","HK","HM","HN","HR","HT","HU","ID","IE","IL","IM","IN","IO","IQ","IR","IS","IT","JE","JM","JO","JP","KE","KG","KH","KI","KM","KN","KP","KR","KW","KY","KZ","LA","LB","LC","LI","LK","LR","LS","LT","LU","LV","LY","MA","MC","MD","ME","MF","MG","MH","MK","ML","MM","MN","MO","MP","MQ","MR","MS","MT","MU","MV","MW","MX","MY","MZ","NA","NC","NE","NF","NG","NI","NL","NO","NP","NR","NU","NZ","OM","PA","PE","PF","PG","PH","PK","PL","PM","PN","PR","PS","PT","PW","PY","QA","RE","RO","RS","RU","RW","SA","SB","SC","SD","SE","SG","SH","SI","SJ","SK","SL","SM","SN","SO","SR","SS","ST","SV","SX","SY","SZ","TC","TD","TF","TG","TH","TJ","TK","TL","TM","TN","TO","TR","TT","TV","TW","TZ","UA","UG","UM","US","UY","UZ","VA","VC","VE","VG","VI","VN","VU","WF","WS","XK","YE","YT","ZA","ZM","ZW"],yE=127462;function sg(i){const e=(i??"").toUpperCase().replace(/[^A-Z]/g,"");if(e.length!==2)return"🌍";const t=e.charCodeAt(0)-65,n=e.charCodeAt(1)-65;return t<0||t>25||n<0||n>25?"🌍":String.fromCodePoint(yE+t,yE+n)}const JD=["",...YD],KD=22,ZD=9,QD=-12,Hh=.9,xE=0,a0=.4,lR=6.4,$D=2.05,e5=.62,t5=1.3,xp=148,cR=2;function uR(i,e,t,n=0){for(const a of t){if(a.top!==void 0&&i.y!==void 0&&i.y-n>=a.top-.05)continue;const l=i.x-a.cx,u=i.z-a.cz,h=a.hw+e-Math.abs(l),p=a.hd+e-Math.abs(u);h>0&&p>0&&(h<p?i.x+=l>=0?h:-h:i.z+=u>=0?p:-p)}const s=Math.sqrt(i.x*i.x+i.z*i.z);if(s>xp-e){const a=(xp-e)/s;i.x*=a,i.z*=a}}function n5(i,e,t){const n=t*2;for(const s of e){const a=i.x-s.x,l=i.z-s.z,u=a*a+l*l;if(u<n*n&&u>1e-4){const h=Math.sqrt(u),p=(n-h)*.5;i.x+=a/h*p,i.z+=l/h*p}}}const iy=(i,e,t,n,s)=>({cx:i,cz:e,hw:t,hd:n,top:s}),i5=[iy(-42,0,1,2,6.6),iy(42,0,1,2,6.6),iy(0,-42,2,1,6.6),iy(0,42,2,1,6.6)],sy=(i,e,t)=>({cx:i,cz:e,hw:t,hd:t}),s5=[sy(-42,0,.34),sy(42,0,.34),sy(0,-42,.34),sy(0,42,.34)],M0=(i,e,t,n)=>({cx:i,cz:e,hw:t,hd:n}),Hi=(i,e,t,n)=>[M0(i,e,t,n),M0(-i,e,t,n),M0(i,-e,t,n),M0(-i,-e,t,n)],r5=[...Hi(16,16,2.5,2.5),...Hi(16,28,2.5,2.5),...Hi(28,16,2.5,2.5),...Hi(16,37,2.5,2),...Hi(37,16,2,2.5),...Hi(37,28,2,2.5),...Hi(28,37,2.5,2),...Hi(37,37,2,2),...Hi(52,16,2,2),...Hi(52,28,2,2.5),...Hi(52,37,2,2),...Hi(52,52,2.5,2.5),...Hi(16,52,2,2.5),...Hi(28,52,2.5,2),...Hi(37,52,2,2),...Hi(61,16,2.5,2.5),...Hi(61,37,2.5,2.5),...Hi(61,61,2.5,2.5),...Hi(37,61,2.5,2.5),...Hi(16,61,2.5,2),...Hi(80,28,3,3),...Hi(28,80,3,3),...Hi(80,80,3.5,3.5),...Hi(80,52,2.5,3),...Hi(52,80,3,2.5),...Hi(61,80,2.5,3),...Hi(80,61,3,2.5)],y_=[{id:"flag_01",x:0,z:90},{id:"flag_02",x:0,z:-90},{id:"flag_03",x:90,z:0},{id:"flag_04",x:-90,z:0},{id:"flag_05",x:90,z:90},{id:"flag_06",x:-90,z:-90},{id:"flag_07",x:90,z:-90},{id:"flag_08",x:-90,z:90},{id:"flag_09",x:45,z:45},{id:"flag_10",x:-45,z:-45},{id:"flag_11",x:45,z:-45},{id:"flag_12",x:-45,z:45}],a5=y_.map(i=>M0(i.x,i.z,.24,.24)),hp=[...r5,...a5,...s5],o5=[{id:"flame_01",x:-8,z:16,radius:2.5},{id:"flame_02",x:8,z:-16,radius:2.5},{id:"flame_03",x:-30,z:-5,radius:3},{id:"flame_04",x:30,z:5,radius:3},{id:"flame_05",x:16,z:35,radius:2},{id:"flame_06",x:-16,z:-35,radius:2}],eS=1e-5;function l5(i){return i.top!==void 0?{y0:0,y1:i.top+.4}:{y0:0,y1:42}}function c5(i,e,t,n,s,a,l,u,h,p,m,v,x,_=.04){let A=0,R=x;const w=[{o:i,d:n,m0:l,m1:p},{o:e,d:s,m0:u,m1:m},{o:t,d:a,m0:h,m1:v}];for(const D of w){if(Math.abs(D.d)<eS){if(D.o<D.m0-eS||D.o>D.m1+eS)return null;continue}const L=1/D.d;let P=(D.m0-D.o)*L,G=(D.m1-D.o)*L;if(P>G){const H=P;P=G,G=H}if(A=Math.max(A,P),R=Math.min(R,G),A>R)return null}if(R<_)return null;const E=A>=_?A:R>=_&&A<_?R:null;return E??null}function u5(i,e,t,n,s,a,l=oR,u=hp){let h=null;for(const p of u){const{y0:m,y1:v}=l5(p),x=p.cx-p.hw,_=p.cx+p.hw,A=p.cz-p.hd,R=p.cz+p.hd,w=c5(i,e,t,n,s,a,x,m,A,_,v,R,l);w!=null&&(h==null||w<h)&&(h=w)}return h}const f5=[...hp,...i5],d5=[[16,16,2.5,2.5,20,"tower"],[16,28,2.5,2.5,8,"apartment"],[28,16,2.5,2.5,10,"apartment"],[16,37,2.5,2,5,"shop"],[37,16,2,2.5,5,"shop"],[37,28,2,2.5,7,"warehouse"],[28,37,2.5,2,7,"warehouse"],[37,37,2,2,28,"skyscraper"],[52,16,2,2,20,"tower"],[52,28,2,2.5,24,"tower"],[52,37,2,2,16,"apartment"],[52,52,2.5,2.5,44,"skyscraper"],[16,52,2,2.5,18,"tower"],[28,52,2.5,2,22,"tower"],[37,52,2,2,14,"apartment"],[61,16,2.5,2.5,26,"tower"],[61,37,2.5,2.5,20,"apartment"],[61,61,2.5,2.5,52,"skyscraper"],[37,61,2.5,2.5,22,"tower"],[16,61,2.5,2,16,"apartment"],[80,28,3,3,38,"skyscraper"],[28,80,3,3,34,"skyscraper"],[80,80,3.5,3.5,62,"skyscraper"],[80,52,2.5,3,30,"tower"],[52,80,3,2.5,28,"tower"],[61,80,2.5,3,22,"apartment"],[80,61,3,2.5,26,"apartment"]];function h5(i){return i.flatMap(([e,t,n,s,a,l])=>[[1,1],[-1,1],[1,-1],[-1,-1]].map(([u,h])=>[e*u,t*h,n,s,a,l]))}const fR=[],pp=xp/68,p5=[[18*pp,"rgba(0,200,255,0.18)",.8,[3,6]],[34*pp,"rgba(120,0,255,0.15)",.8,[3,6]],[52*pp,"rgba(0,200,255,0.12)",.8,[3,6]],[xp,"rgba(0,220,255,0.40)",1.4,[]]],m5=[[0,-26*pp,"INNER","rgba(0,220,255,0.28)"],[0,-43*pp,"MID","rgba(120,80,255,0.22)"],[0,-59*pp,"OUTER","rgba(0,180,220,0.18)"]];fR.length;const ot=jc((i,e)=>({phase:"menu",endScreen:null,setEndScreen:t=>i({endScreen:t}),clearEndScreen:()=>i({endScreen:null}),selectedClass:null,score:0,kills:0,deaths:0,localPos:{x:0,z:0,rotY:0},isPaused:!1,isInventoryOpen:!1,isCommsTyping:!1,hitFlashAt:0,hitFlashType:"punch",hp:100,maxHp:100,damageFlashAt:0,hazardText:null,hazardSeq:0,showHazard:t=>i(n=>({hazardText:t,hazardSeq:n.hazardSeq+1})),clearHazard:()=>i({hazardText:null}),vehicleHitAt:0,equippedWeapon:"laser_rifle",ammo:30,isReloading:!1,isAiming:!1,hitMarkerAt:0,zoomLevel:1,graphicsQuality:"performance",forcePosition:null,pendingKnockback:null,ammoBoxes:0,healthCapsules:0,isEliminated:!1,serverRoomPhase:"",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:0,lobbyMaxPlayers:md,respawnsLeft:0,autoReloadLeft:0,autoHealLeft:0,setPhase:t=>i({phase:t}),setClass:t=>i({selectedClass:t}),setScore:t=>i({score:t}),addScore:t=>i(n=>({score:n.score+t})),addKill:()=>i(t=>({kills:t.kills+1})),addDeath:()=>i(t=>({deaths:t.deaths+1})),setLocalPos:(t,n,s)=>i({localPos:{x:t,z:n,rotY:s}}),setPaused:t=>i({isPaused:t}),setCommsTyping:t=>i({isCommsTyping:t}),toggleInventory:()=>i(t=>({isInventoryOpen:!t.isInventoryOpen})),triggerHitFlash:t=>i({hitFlashAt:Date.now(),hitFlashType:t}),setHp:(t,n)=>i(s=>({hp:t,maxHp:n,damageFlashAt:t<s.hp&&s.hp>0?Date.now():s.damageFlashAt})),setWeapon:t=>i({equippedWeapon:t}),consumeAmmo:()=>{const{ammo:t}=e();return t<=0?!1:(i({ammo:t-1}),!0)},startReload:()=>{const{ammoBoxes:t,isReloading:n}=e();return n||t<=0?!1:(i({isReloading:!0}),!0)},finishReload:t=>i(n=>({ammo:n.ammo+t,isReloading:!1})),triggerVehicleHit:()=>i({vehicleHitAt:Date.now()}),setAiming:t=>i({isAiming:t}),triggerHitMarker:()=>i({hitMarkerAt:Date.now()}),setZoomLevel:t=>i({zoomLevel:t}),setGraphicsQuality:t=>i({graphicsQuality:t}),setServerPos:(t,n,s)=>{},setForcePosition:(t,n,s)=>i({forcePosition:{x:t,y:n,z:s}}),clearForcePosition:()=>i({forcePosition:null}),setKnockback:(t,n,s)=>i({pendingKnockback:{kbX:t,kbZ:n,kbY:s}}),clearKnockback:()=>i({pendingKnockback:null}),setInventory:(t,n)=>i({ammoBoxes:t,healthCapsules:n}),setEliminated:t=>i({isEliminated:t}),setServerMatchInfo:t=>i({serverRoomPhase:t.roomPhase,lobbyTimeLeft:t.lobbyTimeLeft,lobbyStartIn:t.lobbyStartIn??0,matchTimeLeft:t.matchTimeLeft,lobbyM
49axPlayers:t.lobbyMaxPlayers??md}),setResupplyMeta:t=>i({respawnsLeft:t.respawnsLeft,autoReloadLeft:t.autoReloadLeft,autoHealLeft:t.autoHealLeft}),reset:()=>i({endScreen:null,score:0,kills:0,deaths:0,phase:"menu",selectedClass:null,isPaused:!1,isInventoryOpen:!1,isCommsTyping:!1,hitFlashAt:0,equippedWeapon:"laser_rifle",ammo:30,isReloading:!1,graphicsQuality:"performance",ammoBoxes:0,healthCapsules:0,isEliminated:!1,serverRoomPhase:"",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:0,lobbyMaxPlayers:md,respawnsLeft:0,autoReloadLeft:0,autoHealLeft:0,hazardText:null,hazardSeq:0})})),_d=new Map,bd=new Map,Sd=new Map,Ad=new Map;let N1="";function g5(){_d.clear(),bd.clear(),Sd.clear(),Ad.clear(),N1=""}function v5(i){let e=_d.get(i);return e||(e={id:i,displayName:"",countryCode:"",playerClass:"neon_striker",x:0,y:0,z:0,rotY:0,hp:100,maxHp:100,isDead:!1,animBits:0,weaponId:1},_d.set(i,e)),e}function y5(i){let e=bd.get(i);return e||(e={id:i,displayName:"",countryCode:"",playerClass:"neon_striker",hp:100,maxHp:100,score:0,kills:0,deaths:0,flagsCaptured:0,isDead:!1,respawnsLeft:0,autoReloadLeft:0,autoHealLeft:0},bd.set(i,e)),e}function x5(i){let e=Sd.get(i);return e||(e={id:i,x:0,z:0,ownerId:"",isBeingCaptured:!1,captureProgress:0,capturingPlayerId:""},Sd.set(i,e)),e}function _5(i){let e=Ad.get(i);return e||(e={id:i,type:"ammo",x:0,z:0,active:!0},Ad.set(i,e)),e}function b5(i,e){if(!i?.players)return{remotePlayerIds:[],remoteMembershipChanged:!1};const t=new Set,n=new Set;i.players.forEach((u,h)=>{n.add(h);const p=y5(h);if(p.displayName=u.displayName||h.slice(0,6),p.countryCode=typeof u.countryCode=="string"?u.countryCode:"",p.playerClass=u.playerClass||"neon_striker",p.hp=u.hp??100,p.maxHp=u.maxHp??100,p.score=u.score??0,p.kills=u.kills??0,p.deaths=u.deaths??0,p.flagsCaptured=u.flagsCaptured??0,p.isDead=u.isDead??!1,p.respawnsLeft=u.respawnsLeft??0,p.autoReloadLeft=u.autoReloadLeft??0,p.autoHealLeft=u.autoHealLeft??0,h!==e){t.add(h);const m=v5(h);
49m.displayName=p.displayName,m.countryCode=p.countryCode,m.playerClass=p.playerClass,m.x=u.x??0,m.y=u.y??0,m.z=u.z??0,m.rotY=u.rotY??0,m.hp=p.hp,m.maxHp=p.maxHp,m.isDead=p.isDead,m.animBits=u.animBits??0,m.weaponId=u.weaponId??1}});for(const u of[..._d.keys()])t.has(u)||_d.delete(u);for(const u of[...bd.keys()])n.has(u)||bd.delete(u);const s=[...t].sort(),a=s.join("|"),l=a!==N1;if(N1=a,i.flags){const u=new Set;i.flags.forEach((h,p)=>{u.add(p);const m=x5(p);m.x=h.x??0,m.z=h.z??0,m.ownerId=h.ownerId??"",m.isBeingCaptured=h.isBeingCaptured??!1,m.captureProgress=h.captureProgress??0,m.capturingPlayerId=h.capturingPlayerId??""});for(const h of[...Sd.keys()])u.has(h)||Sd.delete(h)}if(i.loot){const u=new Set;i.loot.forEach((h,p)=>{u.add(p);const m=_5(p);m.type=h.type??"ammo",m.x=h.x??0,m.z=h.z??0,m.active=h.active??!0});for(const h of[...Ad.keys()])u.has(h)||Ad.delete(h)}return{remotePlayerIds:s,remoteMembershipChanged:l}}const tn=jc((i,e)=>({room:null,sessionId:null,connected:!1,connecting:!1,error:null,isSpectator:!1,remotePlayers:_d,allPlayers:bd,flags:Sd,loot:Ad,remotePlayerIds:[],syncRevision:0,remoteActions:new Map,remoteWeapons:new Map,chatMessages:[],setRoom:(t,n)=>i({room:t,sessionId:n,connected:!0,connecting:!1,error:null}),setConnecting:t=>i({connecting:t}),setError:t=>i({error:t,connecting:!1}),setSpectator:t=>i({isSpectator:t}),applyNetSyncTick:t=>i(n=>({syncRevision:n.syncRevision+1,...t.remotePlayerIds!==void 0?{remotePlayerIds:t.remotePlayerIds}:{}})),setRemoteAction:(t,n)=>i(s=>{const a=new Map(s.remoteActions);return a.set(t,n),{remoteActions:a}}),setRemoteWeapon:(t,n)=>i(s=>{const a=new Map(s.remoteWeapons);return a.set(t,n),{remoteWeapons:a}}),addChatMessage:t=>i(n=>({chatMessages:[...n.chatMessages.slice(-99),t]})),disconnect:()=>{const{room:t}=e();t?.leave(),g5(),i({room:null,sessionId:null,connected:!1,isSpectator:!1,remotePlayers:_d,allPlayers:bd,flags:Sd,loot:Ad,remotePlayerIds:[],syncRevision:0,remoteActions:new Map,remoteWeapons:new Map,chatMessages:[]})}}));var tS={},_E={},bE;function S5(){return bE||(bE=1,ArrayBuffer.isView||(ArrayBuffer.isView=i=>i!==null&&typeof i=="object"&&i.buffer instanceof ArrayBuffer),typeof globalThis>"u"&&typeof window<"u"&&(window.globalThis=window),typeof FormData>"u"&&(globalThis.FormData=class{})),_E}var ry={},U1=function(i,e){return U1=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var s in n)Object.prototype.hasOwnProperty.call(n,s)&&(t[s]=n[s])},U1(i,e)};function dR(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");U1(i,e);function t(){this.constructor=i}i.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var Mx=function(){return Mx=Object.assign||function(e){for(var t,n=1,s=arguments.length;n<s;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},Mx.apply(this,arguments)};function hR(i,e){var t={};for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&e.indexOf(n)<0&&(t[n]=i[n]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(i);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(i,n[s])&&(t[n[s]]=i[n[s]]);return t}function pR(i,e,t,n){var s=arguments.length,a=s<3?e:n===null?n=Object.getOwnPropertyDescriptor(e,t):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(i,e,t,n);else for(var u=i.length-1;u>=0;u--)(l=i[u])&&(a=(s<3?l(a):s>3?l(e,t,a):l(e,t))||a);return s>3&&a&&Object.defineProperty(e,t,a),a}function mR(i,e){return function(t,n){e(t,n,i)}}function gR(i,e,t,n,s,a){function l(E){if(E!==void 0&&typeof E!="function")throw new TypeError("Function expected");return E}for(var u=n.kind,h=u==="getter"?"get":u==="setter"?"set":"value",p=!e&&i?n.static?i:i.prototype:null,m=e||(p?Object.getOwnPropertyDescriptor(p,n.name):{}),v,x=!1,_=t.length-1;_>=0;_--){var A={};for(var R in n)A[R]=R==="access"?{}:n[R];for(var R in n.access)A.access[R]=n.access[R];A.addInitializer=function(E){if(x)throw new TypeError("Cannot add initializer
vendor: 4,813 bytes, line 49
49s after decoration has completed");a.push(l(E||null))};var w=(0,t[_])(u==="accessor"?{get:m.get,set:m.set}:m[h],A);if(u==="accessor"){if(w===void 0)continue;if(w===null||typeof w!="object")throw new TypeError("Object expected");(v=l(w.get))&&(m.get=v),(v=l(w.set))&&(m.set=v),(v=l(w.init))&&s.unshift(v)}else(v=l(w))&&(u==="field"?s.unshift(v):m[h]=v)}p&&Object.defineProperty(p,n.name,m),x=!0}function vR(i,e,t){for(var n=arguments.length>2,s=0;s<e.length;s++)t=n?e[s].call(i,t):e[s].call(i);return n?t:void 0}function yR(i){return typeof i=="symbol"?i:"".concat(i)}function xR(i,e,t){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(i,"name",{configurable:!0,value:t?"".concat(t," ",e):e})}function _R(i,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(i,e)}function bR(i,e,t,n){function s(a){return a instanceof t?a:new t(function(l){l(a)})}return new(t||(t=Promise))(function(a,l){function u(m){try{p(n.next(m))}catch(v){l(v)}}function h(m){try{p(n.throw(m))}catch(v){l(v)}}function p(m){m.done?a(m.value):s(m.value).then(u,h)}p((n=n.apply(i,e||[])).next())})}function SR(i,e){var t={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,s,a,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=u(0),l.throw=u(1),l.return=u(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function u(p){return function(m){return h([p,m])}}function h(p){if(n)throw new TypeError("Generator is already executing.");for(;l&&(l=0,p[0]&&(t=0)),t;)try{if(n=1,s&&(a=p[0]&2?s.return:p[0]?s.throw||((a=s.return)&&a.call(s),0):s.next)&&!(a=a.call(s,p[1])).done)return a;switch(s=0,a&&(p=[p[0]&2,a.value]),p[0]){case 0:case 1:a=p;break;case 4:return t.label++,{value:p[1],done:!1};case 5:t.label++,s=p[1],p=[0];continue;case 7:p=t.ops.pop(),t.trys.pop();continue;default:if(a=t.trys,!(a=a.length>0&&a[a.length-1])&&(p[0]===6||p[0]===2)){t=0;continue}if(p[0]===3&&(!a||p[1]>a[0]&&p[1]<a[3])){t.label=p[1];break}if(p[0]===6&&t.label<a[1]){t.label=a[1],a=p;break}if(a&&t.label<a[2]){t.label=a[2],t.ops.push(p);break}a[2]&&t.ops.pop(),t.trys.pop();continue}p=e.call(i,t)}catch(m){p=[6,m],s=0}finally{n=a=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}}var x_=Object.create?(function(i,e,t,n){n===void 0&&(n=t);var s=Object.getOwnPropertyDescriptor(e,t);(!s||("get"in s?!e.__esModule:s.writable||s.configurable))&&(s={enumerable:!0,get:function(){return e[t]}}),Object.defineProperty(i,n,s)}):(function(i,e,t,n){n===void 0&&(n=t),i[n]=e[t]});function AR(i,e){for(var t in i)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&x_(e,i,t)}function Ex(i){var e=typeof Symbol=="function"&&Symbol.iterator,t=e&&i[e],n=0;if(t)return t.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&n>=i.length&&(i=void 0),{value:i&&i[n++],done:!i}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function yA(i,e){var t=typeof Symbol=="function"&&i[Symbol.iterator];if(!t)return i;var n=t.call(i),s,a=[],l;try{for(;(e===void 0||e-- >0)&&!(s=n.next()).done;)a.push(s.value)}catch(u){l={error:u}}finally{try{s&&!s.done&&(t=n.return)&&t.call(n)}finally{if(l)throw l.error}}return a}function MR(){for(var i=[],e=0;e<arguments.length;e++)i=i.concat(yA(arguments[e]));return i}function ER(){for(var i=0,e=0,t=arguments.length;e<t;e++)i+=arguments[e].length;for(var n=Array(i),s=0,e=0;e<t;e++)for(var a=arguments[e],l=0,u=a.length;l<u;l++,s++)n[s]=a[l];return n}function TR(i,e,t){if(t||arguments.length===2)for(var n=0,s=e.length,a;n<s;n++)(a||!(n in e))&&(a||(a=Array.prototype.slice.call(e,0,n)),a[n]=e[n]);return i.concat(a||Array.prototype.slice.call(e))}function _p(i){return this instanceof _p?(this.v=i,this):new _p(i)}function wR(i,e,t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=t.apply(i,e||[]),s,a=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",l),s[Symbol.asyncIterator]=function(){return this},s;function l(_){return function(A){return Promise.resolve(A).then(_,v)}}function u(_,A){n[_]&&(s[_]=function(R){return new Promise(function(w,E){a.push([_,R,w,E])>1||h(_,R)})},A&&(s[_]=A(s[_])))}function h(_,A){try{p(n[_](A))}catch(R){x(a[0][3],R)}}function p(_){_.value instanceof _p?Promise.resolve(_.value.v).then(m,v):x(a[0][2],_)}function m(_){h("next",_)}function v(_){h("throw",_)}function x(_,A){_(A),a.shift(),a.length&&h(a[0][0],a[0][1])}}function CR(i){var e,t;return e={},n("next"),n("throw",function(s){throw s}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(s,a){e[s]=i[s]?function(l){return(t=!t)?{value:_p(i[s](l)),done:!1}:a?a(l):l}:a}}
vendor: 3,719 bytes, line 49
49function RR(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=i[Symbol.asyncIterator],t;return e?e.call(i):(i=typeof Ex=="function"?Ex(i):i[Symbol.iterator](),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(a){t[a]=i[a]&&function(l){return new Promise(function(u,h){l=i[a](l),s(u,h,l.done,l.value)})}}function s(a,l,u,h){Promise.resolve(h).then(function(p){a({value:p,done:u})},l)}}function BR(i,e){return Object.defineProperty?Object.defineProperty(i,"raw",{value:e}):i.raw=e,i}var A5=Object.create?(function(i,e){Object.defineProperty(i,"default",{enumerable:!0,value:e})}):function(i,e){i.default=e},z1=function(i){return z1=Object.getOwnPropertyNames||function(e){var t=[];for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[t.length]=n);return t},z1(i)};function IR(i){if(i&&i.__esModule)return i;var e={};if(i!=null)for(var t=z1(i),n=0;n<t.length;n++)t[n]!=="default"&&x_(e,i,t[n]);return A5(e,i),e}function DR(i){return i&&i.__esModule?i:{default:i}}function LR(i,e,t,n){if(t==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?i!==e||!n:!e.has(i))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?n:t==="a"?n.call(i):n?n.value:e.get(i)}function PR(i,e,t,n,s){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!s)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?i!==e||!s:!e.has(i))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?s.call(i,t):s?s.value=t:e.set(i,t),t}function OR(i,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof i=="function"?e===i:i.has(e)}function NR(i,e,t){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,s;if(t){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],t&&(s=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");s&&(n=function(){try{s.call(this)}catch(a){return Promise.reject(a)}}),i.stack.push({value:e,dispose:n,async:t})}else t&&i.stack.push({async:!0});return e}var M5=typeof SuppressedError=="function"?SuppressedError:function(i,e,t){var n=new Error(t);return n.name="SuppressedError",n.error=i,n.suppressed=e,n};function UR(i){function e(a){i.error=i.hasError?new M5(a,i.error,"An error was suppressed during disposal."):a,i.hasError=!0}var t,n=0;function s(){for(;t=i.stack.pop();)try{if(!t.async&&n===1)return n=0,i.stack.push(t),Promise.resolve().then(s);if(t.dispose){var a=t.dispose.call(t.value);if(t.async)return n|=2,Promise.resolve(a).then(s,function(l){return e(l),s()})}else n|=1}catch(l){e(l)}if(n===1)return i.hasError?Promise.reject(i.error):Promise.resolve();if(i.hasError)throw i.error}return s()}function zR(i,e){return typeof i=="string"&&/^\.\.?\//.test(i)?i.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(t,n,s,a,l){return n?e?".jsx":".js":s&&(!a||!l)?t:s+a+"."+l.toLowerCase()+"js"}):i}const E5={__extends:dR,__assign:Mx,__rest:hR,__decorate:pR,__param:mR,__esDecorate:gR,__runInitializers:vR,__propKey:yR,__setFunctionName:xR,__metadata:_R,__awaiter:bR,__generator:SR,__createBinding:x_,__exportStar:AR,__values:Ex,__read:yA,__spread:MR,__spreadArrays:ER,__spreadArray:TR,__await:_p,__asyncGenerator:wR,__asyncDelegator:CR,__asyncValues:RR,__makeTemplateOb
49ject:BR,__importStar:IR,__importDefault:DR,__classPrivateFieldGet:LR,__classPrivateFieldSet:PR,__classPrivateFieldIn:OR,__addDisposableResource:NR,__disposeResources:UR,__rewriteRelativeImportExtension:zR},T5=Object.freeze(Object.defineProperty({__proto__:null,__addDisposableResource:NR,get __assign(){return Mx},__asyncDelegator:CR,__asyncGenerator:wR,__asyncValues:RR,__await:_p,__awaiter:bR,__classPrivateFieldGet:LR,__classPrivateFieldIn:OR,__classPrivateFieldSet:PR,__createBinding:x_,__decorate:pR,__disposeResources:UR,__esDecorate:gR,__exportStar:AR,__extends:dR,__generator:SR,__importDefault:DR,__importStar:IR,__makeTemplateObject:BR,__metadata:_R,__param:mR,__propKey:yR,__read:yA,__rest:hR,__rewriteRelativeImportExtension:zR,__runInitializers:vR,__setFunctionName:xR,__spread:MR,__spreadArray:TR,__spreadArrays:ER,__values:Ex,default:E5},Symbol.toStringTag,{value:"Module"})),__=gA(T5);var nS={},SE;function b_(){return SE||(SE=1,(function(i){i.CloseCode=void 0,(function(n){n[n.CONSENTED=4e3]="CONSENTED",n[n.DEVMODE_RESTART=4010]="DEVMODE_RESTART"})(i.CloseCode||(i.CloseCode={}));class e extends Error{constructor(s,a){super(a),this.name="ServerError",this.code=s}}class t extends Error{constructor(s){super(s),this.name="AbortError"}}i.AbortError=t,i.ServerError=e})(nS)),nS}var iS={},sS={},rS={},E0={exports:{}},w5=E0.exports,AE;function xA(){return AE||(AE=1,(function(i,e){(function(t,n){n(e)})(w5,(function(t){t.OPERATION=void 0,(function(Y){Y[Y.ADD=128]="ADD",Y[Y.REPLACE=0]="REPLACE",Y[Y.DELETE=64]="DELETE",Y[Y.DELETE_AND_MOVE=96]="DELETE_AND_MOVE",Y[Y.MOVE_AND_ADD=160]="MOVE_AND_ADD",Y[Y.DELETE_AND_ADD=192]="DELETE_AND_ADD",Y[Y.CLEAR=10]="CLEAR",Y[Y.REVERSE=15]="REVERSE",Y[Y.MOVE=32]="MOVE",Y[Y.DELETE_BY_REFID=33]="DELETE_BY_REFID",Y[Y.ADD_BY_REFID=129]="ADD_BY_REFID"})(t.OPERATION||(t.OPERATION={})),Symbol.metadata??=Symbol.for("Symbol.metadata");const a="~track",l="~encoder",u="~decoder",h="~filter",p="~getByIndex",m="~deleteByIndex",v="~changes",x="~childType",_="~onEncodeEnd",A="~onDecodeEnd",R="~descriptors",w="~__numFields",E="~__refTypeFieldIndexes",D="~__viewFieldIndexes",L="$__fieldIndexesByViewTag";let P;try{P=new TextEncoder}catch{}const G=new ArrayBuffer(8),H=new Int32Array(G),F=new Float32Array(G),X=new Float64Array(G),z=new BigInt64Array(G),ie=typeof Buffer<"u"&&Buffer.byteLength?Buffer.byteLength:function(Y,T){for(var I=0,N=0,j=0,fe=Y.length;j<fe;j++)I=Y.charCodeAt(j),I<128?N+=1:I<2048?N+=2:I<55296||I>=57344?N+=3:(j++,N+=4);return N};function ve(Y,T,I){for(var N=0,j=0,fe=T.length;j<fe;j++)N=T.charCodeAt(j),N<128?Y[I.offset++]=N:N<2048?(Y[I.offset]=192|N>>6,Y[I.offset+1]=128|N&63,I.offset+=2):N<55296||N>=57344?(Y[I.offset]=224|N>>12,Y[I.offset+1]=128|N>>6&63,Y[I.offset+2]=128|N&63,I.offset+=3):(j++,N=65536+((N&1023)<<10|T.charCodeAt(j)&1023),Y[I.offset]=240|N>>18,Y[I.offset+1]=128|N>>12&63,Y[I.offset+2]=128|N>>6&63,Y[I.offset+3]=128|N&63,I.offset+=4)}function J(Y,T,I){Y[I.offset++]=T&255}function le(Y,T,I){Y[I.offset++]=T&255}function ae(Y,T,I){Y[I.offset++]=T&255,Y[I.offset++]=T>>8&255}function W(Y,T,I){Y[I.offset++]=T&255,Y[I.offset++]=T>>8&255}function ee(Y,T,I){Y[I.offset++]=T&255,Y[I.offset++]=T>>8&255,Y[I.offset++]=T>>16&255,Y[I.offset++]=T>>24&255}function te(Y,T,I){const N=T>>24,j=T>>16,fe=T>>8,Ae=T;Y[I.offset++]=Ae&255,Y[I.offset++]=fe&255,Y[I.offset++]=j&255,Y[I.offset++]=N&255}function ue(Y,T,I){const N=Math.floor(T/Math.pow(2,32)),j=T>>>0;te(Y,j,I),te(Y,N,I)}function he(Y,T,I){const N=T/Math.pow(2,32)>>0,j=T>>>0;te(Y,j,I),te(Y,N,I)}function K(Y,T,I){z[0]=BigInt.asIntN(64,T),ee(Y,H[0],I),ee(Y,H[1],I)}function ce(Y,T,I){z[0]=BigInt.asIntN(64,T),ee(Y,H[0],I),ee(Y,H[1],I)}function re(Y,T,I){F[0]=T,ee(Y,H[0],I)}function oe(Y,T,I){X[0]=T,ee(Y,H[0],I),ee(Y,H[1],I)}function we(Y,T,I){Y[I.offset++]=T?1:0}function Be(Y,T,I){T||(T="");let N=ie(T,"utf8"),j=0;if(N<32)Y[I.offset++]=N|160,j=1;else if(N<256)Y[I.offset++]=217,Y[I.offset++]=N%255,j=2;else if(N<65536)Y[I.offset++]=218,W(Y,N,I),j=3;else if(N<4294967296)Y[I.offset++]=219,te(Y,N,I),j=5;else throw new Error("String too long");return ve(Y,T,I),j+N}function pe(Y,T,I){if(isNaN(T))return pe(Y,0,I);if(isFinite(T)){if(T!==(T|0))return Math.abs(T)<=34028235e31&&(F[0]=T,Math.abs(Math.abs(F[0])-Math.abs(T))<1e-4)?(Y[I.offset++]=202,re(Y,T,I),5):(Y[I.offset++]=203,oe(Y,T,I),9)}else return pe(Y,T>0?Number.MAX_SAFE_INTEGER:-Number.MAX_SAFE_INTEGER,I);return T>=0?T<128?(Y[I.offset++]=T&255,1):T<256?(Y[I.offset++]=204,Y[I.offset++]=T&255,2):T<65536?(Y[I.offset++]=205,W(Y,T,I),3):T<4294967296?(Y[I.offset++]=206,te(Y,T,I),5):(Y[I.offset++]=207,he(Y,T,I),9):T>=-32?(Y[I.offset++]=224|T+32,1):T>=-128?(Y[I.offset++]=208,J(Y,T,I),2):T>
vendor: 4,348 bytes, lines 49-50
49=-32768?(Y[I.offset++]=209,ae(Y,T,I),3):T>=-2147483648?(Y[I.offset++]=210,ee(Y,T,I),5):(Y[I.offset++]=211,ue(Y,T,I),9)}const Re={int8:J,uint8:le,int16:ae,uint16:W,int32:ee,uint32:te,int64:ue,uint64:he,bigint64:K,biguint64:ce,float32:re,float64:oe,boolean:we,string:Be,number:pe,utf8Write:ve,utf8Length:ie},lt=new ArrayBuffer(8),ct=new Int32Array(lt),vt=new Float32Array(lt),qt=new Float64Array(lt),Wt=new BigUint64Array(lt),de=new BigInt64Array(lt);function an(Y,T,I){I>Y.length-T.offset&&(I=Y.length-T.offset);for(var N="",j=0,fe=T.offset,Ae=T.offset+I;fe<Ae;fe++){var tt=Y[fe];if((tt&128)===0){N+=String.fromCharCode(tt);continue}if((tt&224)===192){N+=String.fromCharCode((tt&31)<<6|Y[++fe]&63);continue}if((tt&240)===224){N+=String.fromCharCode((tt&15)<<12|(Y[++fe]&63)<<6|(Y[++fe]&63)<<0);continue}if((tt&248)===240){j=(tt&7)<<18|(Y[++fe]&63)<<12|(Y[++fe]&63)<<6|(Y[++fe]&63)<<0,j>=65536?(j-=65536,N+=String.fromCharCode((j>>>10)+55296,(j&1023)+56320)):N+=String.fromCharCode(j);continue}console.error("decode.utf8Read(): Invalid byte "+tt+" at offset "+fe+". Skip to end of string: "+(T.offset+I));break}return T.offset+=I,N}function $e(Y,T){return Qe(Y,T)<<24>>24}function Qe(Y,T){return Y[T.offset++]}function Ye(Y,T){return pt(Y,T)<<16>>16}function pt(Y,T){return Y[T.offset++]|Y[T.offset++]<<8}function Ve(Y,T){return Y[T.offset++]|Y[T.offset++]<<8|Y[T.offset++]<<16|Y[T.offset++]<<24}function ne(Y,T){return Ve(Y,T)>>>0}function V(Y,T){return ct[0]=Ve(Y,T),vt[0]}function Se(Y,T){return ct[0]=Ve(Y,T),ct[1]=Ve(Y,T),qt[0]}function Ie(Y,T){const I=ne(Y,T);return Ve(Y,T)*Math.pow(2,32)+I}function et(Y,T){const I=ne(Y,T);return ne(Y,T)*Math.pow(2,32)+I}function Fe(Y,T){return ct[0]=Ve(Y,T),ct[1]=Ve(Y,T),de[0]}function Rt(Y,T){return ct[0]=Ve(Y,T),ct[1]=Ve(Y,T),Wt[0]}function qe(Y,T){return Qe(Y,T)>0}function yt(Y,T){const I=Y[T.offset++];let N;return I<192?N=I&31:I===217?N=Qe(Y,T):I===218?N=pt(Y,T):I===219&&(N=ne(Y,T)),an(Y,T,N)}function At(Y,T){const I=Y[T.offset++];if(I<128)return I;if(I===202)return V(Y,T);if(I===203)return Se(Y,T);if(I===204)return Qe(Y,T);if(I===205)return pt(Y,T);if(I===206)return ne(Y,T);if(I===207)return et(Y,T);if(I===208)return $e(Y,T);if(I===209)return Ye(Y,T);if(I===210)return Ve(Y,T);if(I===211)return Ie(Y,T);if(I>223)return(255-I+1)*-1}function it(Y,T){const I=Y[T.offset];return I<192&&I>160||I===217||I===218||I===219}const Oe={utf8Read:an,int8:$e,uint8:Qe,int16:Ye,uint16:pt,int32:Ve,uint32:ne,float32:V,float64:Se,int64:Ie,uint64:et,bigint64:Fe,biguint64:Rt,boolean:qe,string:yt,number:At,stringCheck:it},Ct={},Ft=new Map;function ft(Y,T){T.constructor&&(Ft.set(T.constructor,Y),Ct[Y]=T),T.encode&&(Re[Y]=T.encode),T.decode&&(Oe[Y]=T.decode)}function Zt(Y){return Ct[Y]}function sn(Y){for(const T in Y)ft(T,Y[T]);return T=>Et(T)}class cn{static{this.inheritedTypes=new Map}static{this.cachedContexts=new Map}static register(T){const I=Object.getPrototypeOf(T);if(I!==Xt){let N=cn.inheritedTypes.get(I);N||(N=new Set,cn.inheritedTypes.set(I,N)),N.add(T)}}static cache(T){let I=cn.cachedContexts.get(T);return I||(I=new cn(T),cn.cachedContexts.set(T,I)),I}constructor(T){this.types={},this.schemas=new Map,this.hasFilters=!1,this.parentFiltered={},T&&this.discoverTypes(T)}has(T){return this.schemas.has(T)}get(T){return this.types[T]}add(T,I=this.schemas.size){return this.schemas.has(T)?!1:(this.types[I]=T,T[Symbol.metadata]===void 0&&Ue.initialize(T),this.schemas.set(T,I),!0)}getTypeId(T){return this.schemas.get(T)}discoverTypes(T,I,N,j){if(j&&this.registerFilteredByParent(T,I,N),!this.add(T))return;cn.inheritedTypes.get(T)?.forEach(tt=>{this.discoverTypes(tt,I,N,j)});let fe=T;for(;(fe=Object.getPrototypeOf(fe))&&fe!==Xt&&fe!==Function.prototype;)this.discoverTypes(fe);const Ae=T[Symbol.metadata]??={};Ae[D]&&(this.hasFilters=!0);for(const tt in Ae){const Pe=tt,We=Ae[Pe].type,Ze=Ae[Pe].tag!==void 0;if(typeof We!="string")if(typeof We=="function")this.discoverTypes(We,T,Pe,j||Ze);else{const je=Object.values(We)[0];if(typeof je=="string")continue;this.discoverTypes(je,T,Pe,j||Ze)}}}registerFilteredByParent(T,I,N){let fe=`${this.schemas.get(T)??this.schemas.size}`;I&&(fe+=`-${this.schemas.get(I)}`),fe+=`-${N}`,this.parentFiltered[fe]=!0}debug(){let T="";for(const I in this.parentFiltered){const N=I.split("-").map(Number),j=N.pop();T+=`
50		`,T+=`${I}: ${N.reverse().map((fe,Ae)=>
50{const tt=this.types[fe],Pe=tt[Symbol.metadata];let We=tt.name;return Ae===0&&(We+=`[${Pe[j].name}]`),`${We}`}).join(" -> ")}`}return`TypeContext ->
51	Schema types: ${this.schemas.size}
52	hasFilters: ${this.hasFilters}
53	parentFiltered:${T}`}}function _e(Y){if(Array.isArray(Y))return{array:_e(Y[0])};if(typeof Y.type<"u")return Y.type;if(Bt(Y))return Object.keys(Y).every(T=>typeof Y[T]=="string")?"string":"number";if(typeof Y=="object"&&Y!==null){const T=Object.keys(Y).find(I=>Ct[I]!==void 0);if(T)return Y[T]=_e(Y[T]),Y}return Y}function Bt(Y){if(typeof Y=="function"&&Y[Symbol.metadata])return!1;const T=Object.keys(Y),I=T.filter(N=>/\d+/.test(N));return!!(I.length>0&&I.length===T.length/2&&Y[Y[I[0]]]==I[0]||T.length>0&&T.every(N=>typeof Y[N]=="string"&&Y[N]===N))}const Ue={addField(Y,T,I,N,j){if(T>64)throw new Error(`Can't define field '${I}'.
54Schema instances may only have up to 64 fields.`);Y[T]=Object.assign(Y[T]||{},{type:_e(N),index:T,name:I}),Object.defineProperty(Y,R,{value:Y[R]||{},enumerable:!1,configurable:!0}),j?(Y[R][I]=j,Y[R][`_${I}`]={value:void 0,writable:!0,enumerable:!1,configurable:!0}):Y[R][I]={value:void 0,writable:!0,enumerable:!0,configurable:!0},Object.defineProperty(Y,w,{value:T,enumerable:!1,configurable:!0}),Object.defineProperty(Y,I,{value:T,enumerable:!1,configurable:!0}),typeof Y[T].type!="string"&&(Y[E]===void 0&&Object.defineProperty(Y,E,{value:[],enumerable:!1,configurable:!0}),Y[E].push(T))},setTag(Y,T,I){const N=Y[T],j=Y[N];j.tag=I,Y[D]||(Object.defineProperty(Y,D,{value:[],enumerable:!1,configurable:!0}),Object.defineProperty(Y,L,{value:{},enumerable:!1,configurable:!0})),Y[D].push(N),Y[L][I]||(Y[L][I]=[]),Y[L][I].push(N)},setFields(Y,T){const I=Y.prototype.constructor;cn.register(I);const N=Object.getPrototypeOf(I),j=N&&N[Symbol.metadata],fe=Ue.initialize(I);I[a]||(I[a]=Xt[a]),I[l]||(I[l]=Xt[l]),I[u]||(I[u]=Xt[u]),I.prototype.toJSON||(I.prototype.toJSON=Xt.prototype.toJSON);let Ae=fe[w]??(j&&j[w])??-1;Ae++;for(const tt in T){const Pe=_e(T[tt]),We=typeof Object.keys(Pe)[0]=="string"&&Zt(Object.keys(Pe)[0]),Ze=We?Ob
54ject.values(Pe)[0]:Pe;Ue.addField(fe,Ae,tt,Pe,Nt(`_${tt}`,Ae,Ze,We)),Ae++}return Y},isDeprecated(Y,T){return Y[T].deprecated===!0},init(Y){const T={};Y[Symbol.metadata]=T,Object.defineProperty(T,w,{value:0,enumerable:!1,configurable:!0})},initialize(Y){const T=Object.getPrototypeOf(Y),I=T[Symbol.metadata];let N=Y[Symbol.metadata]??Object.create(null);return T!==Xt&&N===I&&(N=Object.create(null),I&&(Object.setPrototypeOf(N,I),Object.defineProperty(N,w,{value:I[w],enumerable:!1,configurable:!0,writable:!0}),I[D]!==void 0&&(Object.defineProperty(N,D,{value:[...I[D]],enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(N,L,{value:{...I[L]},enumerable:!1,configurable:!0,writable:!0})),I[E]!==void 0&&Object.defineProperty(N,E,{value:[...I[E]],enumerable:!1,configurable:!0,writable:!0}),Object.defineProperty(N,R,{value:{...I[R]},enumerable:!1,configurable:!0,writable:!0}))),Object.defineProperty(Y,Symbol.metadata,{value:N,writable:!1,configurable:!0}),N},isValidInstance(Y){return Y.constructor[Symbol.metadata]&&Object.prototype.hasOwnProperty.call(Y.constructor[Symbol.metadata],w)},getFields(Y){const T=Y[Symbol.metadata],I={};for(let N=0;N<=T[w];N++)I[T[N].name]=T[N].type;return I},hasViewTagAtIndex(Y,T){return Y?.[D]?.includes(T)}};function nt(Y){return{indexes:{},operations:[],queueRootNode:Y}}function bt(){return{next:void 0,tail:void 0}}function mt(Y,T){const I=Y.indexes[T];I===void 0?Y.indexes[T]=Y.operations.push(T)-1:Y.operations[I]=T}function nn(Y,T){let I=Y.indexes[T];I===void 0&&(I=Object.values(Y.indexes).at(-1),T=Object.entries(Y.indexes).find(([N,j])=>j===I)?.[0]),Y.operations[I]=void 0,delete Y.indexes[T]}class kn{constructor(T){this.isFiltered=!1,this.indexedOperations={},this.changes={indexes:{},operations:[]},this.allChanges={indexes:{},operations:[]},this.isNew=!0,this.ref=T,this.metadata=T.constructor[Symbol.metadata],this.metadata?.[D]&&(this.allFilteredChanges={indexes:{},operations:[]},this.filteredChanges={indexes:{},operations:[]})}setRoot(T){this.root=T;const I=this.root.add(this);this.checkIsFiltered(this.parent,this.parentIndex,I),I&&this.forEachChild((N,j)=>{N.root!==T?N.setRoot(T):T.add(N)})}setParent(T,I,N){if(this.addParent(T,N),!I)return;const j=I.add(this);I!==this.root&&(this.root=I,this.checkIsFiltered(T,N,j)),j&&this.forEachChild((fe,Ae)=>{if(fe.root===I){I.add(fe),I.moveNextToParent(fe);return}fe.setParent(this.ref,I,Ae)})}forEachChild(T){if(this.ref[x]){if(typeof this.ref[x]!="string")for(const[I,N]of this.ref.entries())N&&T(N[v],this.indexes?.[I]??I)}else for(const I of this.metadata?.[E]??[]){const N=this.metadata[I],j=this.ref[N.name];j&&T(j[v],I)}}operation(T){this.filteredChanges!==void 0?(this.filteredChanges.operations.push(-T),this.root?.enqueueChangeTree(this,"filteredChanges")):(this.changes.operations.push(-T),this.root?.enqueueChangeTree(this,"changes"))}change(T,I=t.OPERATION.ADD){const N=this.isFiltered||this.metadata?.[T]?.tag!==void 0,j=N?this.filteredChanges:this.changes,fe=this.indexedOperations[T];if(!fe||fe===t.OPERATION.DELETE){const Ae=fe&&fe===t.OPERATION.DELETE?t.OPERATION.DELETE_AND_ADD:I;this.indexedOperations[T]=Ae}mt(j,T),N?(mt(this.allFilteredChanges,T),this.root&&(this.root.enqueueChangeTree(this,"filteredChanges"),this.root.enqueueChangeTree(this,"allFilteredChanges"))):(mt(this.allChanges,T),this.root?.enqueueChangeTree(this,"changes"))}shiftChangeIndexes(T){const I=this.isFiltered?this.filteredChanges:this.changes,N={},j={};for(const fe in this.indexedOperations)N[Number(fe)+T]=this.indexedOperations[fe],j[Number(fe)+T]=I.indexes[fe];this.indexedOperations=N,I.indexes=j,I.operations=I.operations.map(fe=>fe+T)}shiftAllChangeIndexes(T,I=0){this.filteredChanges!==void 0?(this._shiftAllChangeIndexes(T,I,this.allFilteredChanges),this._shiftAllChangeIndexes(T,I,this.allChanges)):this._shiftAllChangeIndexes(T,I,this.allChanges)}_shiftAllChangeIndexes(T,I=0,N){const j={};let fe=0;for(const Ae in N.indexes)j[fe++]=N.indexes[Ae];N.indexes=j;for(let Ae=0;Ae<N.operations.length;Ae++){const tt=N.operations[Ae];tt>I&&(N.operations[Ae]=tt+T)}}indexedOperation(T,I,N=T){this.indexedOperations[T]=I,this.filteredChanges!==void 0?(mt(this.allFilteredChanges,N),mt(this.filteredChanges,T),this.root?.enqueueChangeTree(this,"filteredChanges")):(mt(this.allChanges,N),mt(this.changes,T),this.root?.enqueueChangeTree(this,"changes"))}getType(T){return this.ref[x]||this.metadata[T].type}getChange(T){return this.indexedOperations[T]}getValue(T,I=!1){return this.ref[p](T,I)}delete(T,I,N=T){if(T===void 0){try{throw new Error(`@colyseus/schema ${this.ref.constructor.name}: trying to delete non-existing index '${T}'`)}catch(Ae){console.warn(Ae)}return}const j=this.filteredChanges!==void 0?this.filteredChanges:this.changes;this.indexedOperations[T]=I??t.OPERATION.DELETE,mt(j,T),nn(this.allChanges,N);const fe=this.getValue(T);return fe&&fe[v]&&this.root?.remove(fe[v]),this.filteredChanges!==void 0?(nn(this.allFilteredChanges,N),this.root?.enqueueChangeTree(this,"filteredChanges")):this.root?.enqueueChangeTree(this,"changes"),fe}endEncode(T){this.indexedOperations={},this[T]=nt(),this.ref[_]?.(),this.isNew=!1}discard(T=!1){this.ref[_]?.(),this.indexedOperations={},this.changes=nt(this.changes.queueRootNode),this.filteredChanges!==void 0&&(this.filteredChanges=nt(this.filteredChanges.queueRootNode)),T&&(this.allChanges=nt(this.allChanges.queueRootNode),this.allFilteredChanges!==void 0&&(this.allFilteredChanges=nt(this.allFilteredChanges.queueRootNode)))}discardAll(){const T=Object.keys(this.indexedOperations);for(let I=0,N=T.length;I<N;I++){const j=this.getValue(Number(T[I]));j&&j[v]&&j[v].discardAll()}this.discard()}get changed(){return Object.entries(this.indexedOperations).length>0}
54checkIsFiltered(T,I,N){this.root.types.hasFilters&&(this._checkFilteredByParent(T,I),this.filteredChanges!==void 0&&(this.root?.enqueueChangeTree(this,"filteredChanges"),N&&this.root?.enqueueChangeTree(this,"allFilteredChanges"))),this.isFiltered||(this.root?.enqueueChangeTree(this,"changes"),N&&this.root?.enqueueChangeTree(this,"allChanges"))}_checkFilteredByParent(T,I){if(!T)return;const N=Ue.isValidInstance(this.ref)?this.ref.constructor:this.ref[x];let j,fe=!Ue.isValidInstance(T);fe?(j=T[v],T=j.parent,I=j.parentIndex):j=T[v];const Ae=T.constructor;let tt=`${this.root.types.getTypeId(N)}`;Ae&&(tt+=`-${this.root.types.schemas.get(Ae)}`),tt+=`-${I}`;const Pe=Ue.hasViewTagAtIndex(Ae?.[Symbol.metadata],I);this.isFiltered=T[v].isFiltered||this.root.types.parentFiltered[tt]||Pe,this.isFiltered&&(this.isVisibilitySharedWithParent=j.isFiltered&&typeof N!="string"&&!Pe&&fe,this.filteredChanges||(this.filteredChanges=nt(),this.allFilteredChanges=nt()),this.changes.operations.length>0&&(this.changes.operations.forEach(We=>mt(this.filteredChanges,We)),this.allChanges.operations.forEach(We=>mt(this.allFilteredChanges,We)),this.changes=nt(),this.allChanges=nt()))}get parent(){return this.parentChain?.ref}get parentIndex(){return this.parentChain?.index}addParent(T,I){if(this.hasParent((N,j)=>N[v]===T[v])){this.parentChain.index=I;return}this.parentChain={ref:T,index:I,next:this.parentChain}}removeParent(T=this.parent){let I=this.parentChain,N=null;for(;I;){if(I.ref[v]===T[v])return N?N.next=I.next:this.parentChain=I.next,!0;N=I,I=I.next}return this.parentChain===void 0}findParent(T){let I=this.parentChain;for(;I;){if(T(I.ref,I.index))return I;I=I.next}}hasParent(T){return this.findParent(T)!==void 0}getAllParents(){const T=[];let I=this.parentChain;for(;I;)T.push({ref:I.ref,index:I.index}),I=I.next;return T}}function Dt(Y,T,I,N,j,fe){typeof I=="string"?Re[I]?.(T,N,fe):I[Symbol.metadata]!==void 0?(Re.number(T,N[v].refId,fe),(j&t.OPERATION.ADD)===t.OPERATION.ADD&&Y.tryEncodeTypeId(T,I,N.constructor,fe)):Re.number(T,N[v].refId,fe)}const Tt=function(Y,T,I,N,j,fe,Ae,tt,Pe){if(T[fe.offset++]=(N|j)&255,j===t.OPERATION.DELETE)return;const We=I.ref,Ze=Pe[N];Dt(Y,T,Pe[N].type,We[Ze.name],j,fe)},gn=function(Y,T,I,N,j,fe){if(T[fe.offset++]=j&255,Re.number(T,N,fe),j===t.OPERATION.DELETE)return;const Ae=I.ref;if((j&t.OPERATION.ADD)===t.OPERATION.ADD&&typeof Ae.set=="function"){const We=I.ref.$indexes.get(N);Re.string(T,We,fe)}const tt=Ae[x],Pe=Ae[p](N);Dt(Y,T,tt,Pe,j,fe)},En=function(Y,T,I,N,j,fe,Ae,tt){const Pe=I.ref,We=tt&&I.isFiltered&&typeof I.getType(N)!="string";let Ze;if(We){const Ut=Pe.tmpItems[N];if(!Ut)return;Ze=Ut[v].refId,j===t.OPERATION.DELETE?j=t.OPERATION.DELETE_BY_REFID:j===t.OPERATION.ADD&&(j=t.OPERATION.ADD_BY_REFID)}else Ze=N;if(T[fe.offset++]=j&255,Re.number(T,Ze,fe),j===t.OPERATION.DELETE||j===t.OPERATION.DELETE_BY_REFID)return;const je=I.getType(N),Lt=I.getValue(N,Ae);Dt(Y,T,je,Lt,j,fe)},Lr=-1;function yr(Y,T,I,N,j,fe,Ae,tt){const Pe=Y.root,We=I[p](N);let Ze;if((T&t.OPERATION.DELETE)===t.OPERATION.DELETE){const je=Pe.refIds.get(We);je!==void 0&&Pe.removeRef(je),T!==t.OPERATION.DELETE_AND_ADD&&I[m](N),Ze=void 0}if(T!==t.OPERATION.DELETE)if(Xt.is(j)){const je=Oe.number(fe,Ae);if(Ze=Pe.refs.get(je),(T&t.OPERATION.ADD)===t.OPERATION.ADD){const Lt=Y.getInstanceType(fe,Ae,j);Ze||(Ze=Y.createInstanceOfType(Lt)),Pe.addRef(je,Ze,Ze!==We||T===t.OPERATION.DELETE_AND_ADD&&Ze===We)}}else if(typeof j=="string")Ze=Oe[j](fe,Ae);else{const je=Zt(Object.keys(j)[0]),Lt=Oe.number(fe,Ae),Ut=Pe.refs.has(Lt)?We||Pe.refs.get(Lt):new je.constructor;if(Ze=Ut.clone(!0),Ze[x]=Object.values(j)[0],We){let Mt=Pe.refIds.get(We);if(Mt!==void 0&&Lt!==Mt){const _t=We.entries();let Ht;for(;(Ht=_t.next())&&!Ht.done;){const[ni,Ii]=Ht.value;typeof Ii=="object"&&(Mt=Pe.refIds.get(Ii),Pe.removeRef(Mt)),tt.push({ref:We,refId:Mt,op:t.OPERATION.DELETE,field:ni,value:void 0,previousValue:Ii})}}}Pe.addRef(Lt,Ze,Ut!==We||T===t.OPERATION.DELETE_AND_ADD&&Ut===We)}return{value:Ze,previousValue:We}}const er=function(Y,T,I,N,j){const fe=T[I.offset++],Ae=N.constructor[Symbol.metadata],tt=fe>>6<<6,Pe=fe%(tt||255),We=Ae[Pe];if(We===void 0)return console.warn("@colyseus/schema: field not defined at",{index:Pe,ref:N.constructor.name,metadata:Ae}),Lr;const{value:Ze,previousValue:je}=yr(Y,tt,N,Pe,We.type,T,I,j);Ze!=null&&(N[We.name]=Ze),je!==Ze&&j.push({ref:N,refId:Y.currentRefId,op:tt,field:We.name,value:Ze,previousValue:je})},Vs=function(Y,T,I,N,j){const fe=T[I.offset++];if(fe===t.OPERATION.CLEAR){Y.removeChildRefs(N,j),N.clear();return}const Ae=Oe.number(T,I),tt=N[x];let Pe;(fe&t.OPERATION.ADD)===t.OPERATION.ADD?typeof N.set=="function"?(Pe=Oe.string(T,I),N.setIndex(Ae,Pe)):Pe=Ae:Pe=N.getIndex(Ae);const{value:We,previousValue:Ze}=yr(Y,fe,N,Ae,tt,T,I,j);if(We!=null){if(typeof N.set=="function")N.$items.set(Pe,We);else if(typeof N.$setAt=="function")N.$setAt(Ae,We,fe);else if(typeof N.add=="function"){const je=N.add(We);typeof je=="number"&&N.setIndex(je,je)}}Ze!==We&&j.push({ref:N,refId:Y.currentRefId,op:fe,field:"",dynamicIndex:Pe,value:We,previousValue:Ze})},xr=function(Y,T,I,N,j){let fe=T[I.offset++],Ae;if(fe===t.OPERATION.CLEAR){Y.removeChildRefs(N,j),N.clear();return}else if(fe===t.OPERATION.REVERSE){N.reverse();return}else if(fe===t.OPERATION.DELETE_BY_REFID){const je=Oe.number(T,I),Lt=Y.root.refs.get(je);Ae=N.findIndex(Ut=>Ut===Lt),N[m](Ae),j.push({ref:N,refId:Y.currentRefId,op:t.OPERATION.DELETE,field:"",dynamicIndex:Ae,value:void 0,previousValue:Lt});return}else if(fe===t.OPERATION.ADD_BY_REFID){const je=Oe.number(T,I),Lt=Y.root.refs.get(je);Lt&&(Ae=N.findIndex(Ut=>Ut===Lt)),(Ae===-1||Ae===void 0)&&(Ae=N.length)}else Ae=Oe.number(T,I);const tt=N[x];let Pe=Ae;const{value:We,previousValue:Ze}=yr(Y,fe,N,Ae,tt,T,I,j);We!=null&&We!==Ze&&N.$setAt(Ae,We,fe),Ze!==We&&j.push({ref:N,refId:Y.currentRefId,op:fe,field:"",dynamicIndex:Pe,value:We,previousValue:Ze})};
54class ia extends Error{}function Ws(Y,T,I,N){let j,fe=!1;switch(T){case"number":case"int8":case"uint8":case"int16":case"uint16":case"int32":case"uint32":case"int64":case"uint64":case"float32":case"float64":j="number",isNaN(Y)&&console.log(`trying to encode "NaN" in ${I.constructor.name}#${N}`);break;case"bigint64":case"biguint64":j="bigint";break;case"string":j="string",fe=!0;break;case"boolean":return;default:return}if(typeof Y!==j&&(!fe||fe&&Y!==null)){let Ae=`'${JSON.stringify(Y)}'${Y&&Y.constructor&&` (${Y.constructor.name})`||""}`;throw new ia(`a '${j}' was expected, but ${Ae} was provided in ${I.constructor.name}#${N}`)}}function Ps(Y,T,I,N){if(!(Y instanceof T))throw new ia(`a '${T.name}' was expected, but '${Y&&Y.constructor.name}' was provided in ${I.constructor.name}#${N}`)}var hi,Fi;const _r=(Y,T)=>{const I=Y.toString(),N=T.toString();return I<N?-1:I>N?1:0};class ui{static{this[hi]=En}static{this[Fi]=xr}static[(hi=l,Fi=u,h)](T,I,N){return!N||typeof T[x]=="string"||N.isChangeTreeVisible(T.tmpItems[I]?.[v])}static is(T){return Array.isArray(T)||T.array!==void 0}static from(T){return new ui(...Array.from(T))}constructor(...T){this.items=[],this.tmpItems=[],this.deletedIndexes={},this.isMovingItems=!1,Object.defineProperty(this,x,{value:void 0,enumerable:!1,writable:!0,configurable:!0});const I=new Proxy(this,{get:(N,j)=>typeof j!="symbol"&&!isNaN(j)?this.items[j]:Reflect.get(N,j),set:(N,j,fe)=>{if(typeof j!="symbol"&&!isNaN(j)){if(fe==null)N.$deleteAt(j);else{if(fe[v]){Ps(fe,N[x],N,j);const Ae=N.items[j];N.isMovingItems?(Ae!==void 0?fe[v].isNew?N[v].indexedOperation(Number(j),t.OPERATION.MOVE_AND_ADD):(N[v].getChange(Number(j))&t.OPERATION.DELETE)===t.OPERATION.DELETE?N[v].indexedOperation(Number(j),t.OPERATION.DELETE_AND_MOVE):N[v].indexedOperation(Number(j),t.OPERATION.MOVE):fe[v].isNew&&N[v].indexedOperation(Number(j),t.OPERATION.ADD),fe[v].setParent(this,N[v].root,j)):N.$changeAt(Number(j),fe),Ae!==void 0&&Ae[v].root?.remove(Ae[v])}else N.$changeAt(Number(j),fe);N.items[j]=fe,N.tmpItems[j]=fe}return!0}else return Reflect.set(N,j,fe)},deleteProperty:(N,j)=>(typeof j=="number"?N.$deleteAt(j):delete N[j],!0),has:(N,j)=>typeof j!="symbol"&&!isNaN(Number(j))?Reflect.has(this.items,j):Reflect.has(N,j)});return Object.defineProperty(this,v,{value:new kn(I),enumerable:!1,writable:!0}),T.length>0&&this.push(...T),I}set length(T){T===0?this.clear():T<this.items.length?this.splice(T,this.length-T):console.warn("ArraySchema: can't set .length to a higher value than its length.")}get length(){return this.items.length}push(...T){let I=this.tmpItems.length;const N=this[v];for(let j=0,fe=T.length;j<fe;j++,I++){const Ae=T[j];if(Ae==null)return;typeof Ae=="object"&&this[x]&&Ps(Ae,this[x],this,j),N.indexedOperation(I,t.OPERATION.ADD,this.items.length),this.items.push(Ae),this.tmpItems.push(Ae),Ae[v]?.setParent(this,N.root,I)}return I}pop(){let T=-1;for(let I=this.tmpItems.length-1;I>=0;I--)if(this.deletedIndexes[I]!==!0){T=I;break}if(!(T<0))return this[v].delete(T,void 0,this.items.length-1),this.deletedIndexes[T]=!0,this.items.pop()}at(T){return T<0&&(T+=this.length),this.items[T]}$changeAt(T,I){if(I==null){console.error("ArraySchema items cannot be null nor undefined; Use `deleteAt(index)` instead.");return}if(this.items[T]===I)return;const N=this.items[T]!==void 0?typeof I=="object"?t.OPERATION.DELETE_AND_ADD:t.OPERATION.REPLACE:t.OPERATION.ADD,j=this[v];j.change(T,N),I[v]?.setParent(this,j.root,T)}$deleteAt(T,I){this[v].delete(T,I)}$setAt(T,I,N){T===0&&N===t.OPERATION.ADD&&this.items[T]!==void 0?this.items.unshift(I):N===t.OPERATION.DELETE_AND_MOVE?(this.items.splice(T,1),this.items[T]=I):this.items[T]=I}clear(){if(this.items.length===0)return;const T=this[v];T.forEachChild((I,N)=>{T.root?.remove(I)}),T.discard(!0),T.operation(t.OPERATION.CLEAR),this.items.length=0,this.tmpItems.length=0}concat(...T){return new ui(...this.items.concat(...T))}join(T){return this.items.join(T)}reverse(){return this[v].operation(t.OPERATION.REVERSE),this.items.reverse(),this.tmpItems.reverse(),this}shift(){if(this.items.length===0)return;const T=this[v],I=this.tmpItems.findIndex(j=>j===this.items[0]),N=this.items.findIndex(j=>j===this.items[0]);return T.delete(I,t.OPERATION.DELETE,N),T.shiftAllChangeIndexes(-1,N),this.deletedIndexes[I]=!0,this.items.shift()}slice(T,I){const N=new ui;return N.push(...this.items.slice(T,I)),N}sort(T=_r){this.isMovingItems=!0;const I=this[v];return this.items.sort(T).forEach((j,fe)=>I.change(fe,t.OPERATION.REPLACE)),this.tmpItems.sort(T),this.isMovingItems=!1,this}splice(T,I,...N){const j=this[v],fe=this.items.length,Ae=this.tmpItems.length,tt=N.length,Pe=[];for(let We=0;We<Ae;We++)this.deletedIndexes[We]!==!0&&Pe.push(We);if(fe>T){I===void 0&&(I=fe-T);for(let We=T;
54We<T+I;We++){const Ze=Pe[We];j.delete(Ze,t.OPERATION.DELETE),this.deletedIndexes[Ze]=!0}}else I=0;if(tt>0){if(tt>I)throw console.error("Inserting more elements than deleting during ArraySchema#splice()"),new Error("ArraySchema#splice(): insertCount must be equal or lower than deleteCount.");for(let We=0;We<tt;We++){const Ze=(Pe[T]??fe)+We;j.indexedOperation(Ze,this.deletedIndexes[Ze]?t.OPERATION.DELETE_AND_ADD:t.OPERATION.ADD),N[We][v]?.setParent(this,j.root,Ze)}}return I>tt&&j.shiftAllChangeIndexes(-(I-tt),Pe[T+tt]),j.filteredChanges!==void 0?j.root?.enqueueChangeTree(j,"filteredChanges"):j.root?.enqueueChangeTree(j,"changes"),this.items.splice(T,I,...N)}unshift(...T){const I=this[v];return I.shiftChangeIndexes(T.length),I.isFiltered?mt(I.filteredChanges,this.items.length):mt(I.allChanges,this.items.length),T.forEach((N,j)=>{I.change(j,t.OPERATION.ADD)}),this.tmpItems.unshift(...T),this.items.unshift(...T)}indexOf(T,I){return this.items.indexOf(T,I)}lastIndexOf(T,I=this.length-1){return this.items.lastIndexOf(T,I)}every(T,I){return this.items.every(T,I)}some(T,I){return this.items.some(T,I)}forEach(T,I){return this.items.forEach(T,I)}map(T,I){return this.items.map(T,I)}filter(T,I){return this.items.filter(T,I)}reduce(T,I){return this.items.reduce(T,I)}reduceRight(T,I){return this.items.reduceRight(T,I)}find(T,I){return this.items.find(T,I)}findIndex(T,I){return this.items.findIndex(T,I)}fill(T,I,N){throw new Error("ArraySchema#fill() not implemented")}copyWithin(T,I,N){throw new Error("ArraySchema#copyWithin() not implemented")}toString(){return this.items.toString()}toLocaleString(){return this.items.toLocaleString()}[Symbol.iterator](){return this.items[Symbol.iterator]()}static get[Symbol.species](){return ui}entries(){return this.items.entries()}keys(){return this.items.keys()}values(){return this.items.values()}includes(T,I){return this.items.includes(T,I)}flatMap(T,I){throw new Error("ArraySchema#flatMap() is not supported.")}flat(T){throw new Error("ArraySchema#flat() is not supported.")}findLast(){return this.items.findLast.apply(this.items,arguments)}findLastIndex(...T){return this.items.findLastIndex.apply(this.items,arguments)}with(T,I){const N=this.items.slice();return T<0&&(T+=this.length),N[T]=I,new ui(...N)}toReversed(){return this.items.slice().reverse()}toSorted(T){return this.items.slice().sort(T)}toSpliced(T,I,...N){return this.items.toSpliced.apply(copy,arguments)}shuffle(){return this.move(T=>{let I=this.items.length;for(;I!=0;){let N=Math.floor(Math.random()*I);I--,[this[I],this[N]]=[this[N],this[I]]}})}move(T){return this.isMovingItems=!0,T(this),this.isMovingItems=!1,this}[p](T,I=!1){return I?this.items[T]:this.deletedIndexes[T]?this.items[T]:this.tmpItems[T]||this.items[T]}[m](T){this.items[T]=void 0,this.tmpItems[T]=void 0}[_](){this.tmpItems=this.items.slice(),this.deletedIndexes={}}[A](){this.items=this.items.filter(T=>T!==void 0),this.tmpItems=this.items.slice()}toArray(){return this.items.slice(0)}toJSON(){return this.toArray().map(T=>typeof T.toJSON=="function"?T.toJSON():T)}clone(T){let I;return T?(I=new ui,I.push(...this.items)):I=new ui(...this.map(N=>N[v]?N.clone():N)),I}}ft("array",{constructor:ui});var tr,xa;class It{static{this[tr]=gn}static{this[xa]=Vs}static[(tr=l,xa=u,h)](T,I,N){return!N||typeof T[x]=="string"||N.isChangeTreeVisible((T[p](I)??T.deletedItems[I])[v])}static is(T){return T.map!==void 0}constructor(T){this.$items=new Map,this.$indexes=new Map,this.deletedItems={};const I=new kn(this);if(I.indexes={},Object.defineProperty(this,v,{value:I,enumerable:!1,writable:!0}),T)if(T instanceof Map||T instanceof It)T.forEach((N,j)=>this.set(j,N));else for(const N in T)this.set(N,T[N]);Object.defineProperty(this,x,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}[Symbol.iterator](){return this.$items[Symbol.iterator]()}get[Symbol.toStringTag](){return this.$items[Symbol.toStringTag]}static get[Symbol.species](){return It}set(T,I){if(I==null)throw new Error(`MapSchema#set('${T}', ${I}): trying to set ${I} value on '${T}'.`);typeof I=="object"&&this[x]&&Ps(I,this[x],this,T),T=T.toString();const N=this[v],j=I[v]!==void 0;let fe,Ae;if(typeof N.indexes[T]<"u"){fe=N.indexes[T],Ae=t.OPERATION.REPLACE;const tt=this.$items.get(T);if(tt===I)return;j&&(Ae=t.OPERATION.DELETE_AND_ADD,tt!==void 0&&tt[v].root?.remove(tt[v])),this.deletedItems[fe]&&delete this.deletedItems[fe]}else fe=N.indexes[w]??0,Ae=t.OPERATION.ADD,this.$indexes.set(fe,T),N.indexes[T]=fe,N.indexes[w]=fe+1;return this.$items.set(T,I),N.change(fe,Ae),j&&I[v].setParent(this,N.root,fe),this}get(T){return this.$items.get(T)}delete(T){if(!this.$items.has(T))return!1;const I=this[v].indexes[T];return this.deletedItems[I]=this[v].delete(I),this.$items.delete(T)}clear(){const T=this[v];T.discard(!0),T.indexes={},T.forEachChild((I,N)=>{T.root?.remove(I)}),this.$indexes.clear(),this.$items.clear(),T.operation(t.OPERATION.CLEAR)}has(T){return this.$items.has(T)}
54forEach(T){this.$items.forEach(T)}entries(){return this.$items.entries()}keys(){return this.$items.keys()}values(){return this.$items.values()}get size(){return this.$items.size}setIndex(T,I){this.$indexes.set(T,I)}getIndex(T){return this.$indexes.get(T)}[p](T){return this.$items.get(this.$indexes.get(T))}[m](T){const I=this.$indexes.get(T);this.$items.delete(I),this.$indexes.delete(T)}[_](){const T=this[v];for(const I in this.deletedItems){const N=parseInt(I),j=this.$indexes.get(N);delete T.indexes[j],this.$indexes.delete(N)}this.deletedItems={}}toJSON(){const T={};return this.forEach((I,N)=>{T[N]=typeof I.toJSON=="function"?I.toJSON():I}),T}clone(T){let I;return T?I=Object.assign(new It,this):(I=new It,this.forEach((N,j)=>{N[v]?I.set(j,N.clone()):I.set(j,N)})),I}}ft("map",{constructor:It});var Ot,Ln;class Q{static{this[Ot]=gn}static{this[Ln]=Vs}static[(Ot=l,Ln=u,h)](T,I,N){return!N||typeof T[x]=="string"||N.isChangeTreeVisible((T[p](I)??T.deletedItems[I])[v])}static is(T){return T.collection!==void 0}constructor(T){this.$items=new Map,this.$indexes=new Map,this.deletedItems={},this.$refId=0,this[v]=new kn(this),this[v].indexes={},T&&T.forEach(I=>this.add(I)),Object.defineProperty(this,x,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}add(T){const I=this.$refId++;return T[v]!==void 0&&T[v].setParent(this,this[v].root,I),this[v].indexes[I]=I,this.$indexes.set(I,I),this.$items.set(I,T),this[v].change(I),I}at(T){const I=Array.from(this.$items.keys())[T];return this.$items.get(I)}entries(){return this.$items.entries()}delete(T){const I=this.$items.entries();let N,j;for(;(j=I.next())&&!j.done;)if(T===j.value[1]){N=j.value[0];break}return N===void 0?!1:(this.deletedItems[N]=this[v].delete(N),this.$indexes.delete(N),this.$items.delete(N))}clear(){const T=this[v];T.discard(!0),T.indexes={},T.forEachChild((I,N)=>{T.root?.remove(I)}),this.$indexes.clear(),this.$items.clear(),T.operation(t.OPERATION.CLEAR)}has(T){return Array.from(this.$items.values()).some(I=>I===T)}forEach(T){this.$items.forEach((I,N,j)=>T(I,N,this))}values(){return this.$items.values()}get size(){return this.$items.size}[Symbol.iterator](){return this.$items.values()}setIndex(T,I){this.$indexes.set(T,I)}getIndex(T){return this.$indexes.get(T)}[p](T){return this.$items.get(this.$indexes.get(T))}[m](T){const I=this.$indexes.get(T);this.$items.delete(I),this.$indexes.delete(T)}[_](){this.deletedItems={}}toArray(){return Array.from(this.$items.values())}toJSON(){const T=[];return this.forEach((I,N)=>{T.push(typeof I.toJSON=="function"?I.toJSON():I)}),T}clone(T){let I;return T?I=Object.assign(new Q,this):(I=new Q,this.forEach(N=>{N[v]?I.add(N.clone()):I.add(N)})),I}}ft("collection",{constructor:Q});var ye,De;class Le{static{this[ye]=gn}static{this[De]=Vs}static[(ye=l,De=u,h)](T,I,N){return!N||typeof T[x]=="string"||N.visible.has((T[p](I)??T.deletedItems[I])[v])}static is(T){return T.set!==void 0}constructor(T){this.$items=new Map,this.$indexes=new Map,this.deletedItems={},this.$refId=0,this[v]=new kn(this),this[v].indexes={},T&&T.forEach(I=>this.add(I)),Object.defineProperty(this,x,{value:void 0,enumerable:!1,writable:!0,configurable:!0})}add(T){if(this.has(T))return!1;const I=this.$refId++;T[v]!==void 0&&T[v].setParent(this,this[v].root,I);const N=this[v].indexes[I]?.op??t.OPERATION.ADD;return this[v].indexes[I]=I,this.$indexes.set(I,I),this.$items.set(I,T),this[v].change(I,N),I}entries(){return this.$items.entries()}delete(T){const I=this.$items.entries();let N,j;for(;(j=I.next())&&!j.done;)if(T===j.value[1]){N=j.value[0];break}return N===void 0?!1:(this.deletedItems[N]=this[v].delete(N),this.$indexes.delete(N),this.$items.delete(N))}clear(){const T=this[v];T.discard(!0),T.indexes={},this.$indexes.clear(),this.$items.clear(),T.operation(t.OPERATION.CLEAR)}has(T){const I=this.$items.values();let N=!1,j;for(;(j=I.next())&&!j.done;)if(T===j.value){N=!0;break}return N}forEach(T){this.$items.forEach((I,N,j)=>T(I,N,this))}values(){return this.$items.values()}get size(){return this.$items.size}[Symbol.iterator](){return this.$items.values()}setIndex(T,I){this.$indexes.set(T,I)}getIndex(T){return this.$indexes.get(T)}[p](T){return this.$items.get(this.$indexes.get(T))}[m](T){const I=this.$indexes.get(T);this.$items.delete(I),this.$indexes.delete(T)}[_](){this.deletedItems={}}toArray(){return Array.from(this.$items.values())}toJSON(){const T=[];return this.forEach((I,N)=>{T.push(typeof I.toJSON=="function"?I.toJSON():I)}),T}clone(T){let I;return T?I=Object.assign(new Le,this):(I=new Le,this.forEach(N=>{N[v]?I.add(N.clone()):I.add(N)})),I}}
54ft("set",{constructor:Le});const xe=-1;function dt(Y){return cn.register(Y),Y}function xt(Y=xe){return function(T,I){const N=T.constructor,fe=Object.getPrototypeOf(N)[Symbol.metadata],Ae=N[Symbol.metadata]??=Object.assign({},N[Symbol.metadata],fe??Object.create(null));Ue.setTag(Ae,I,Y)}}function Et(Y,T){return function(I,N){const j=I.constructor;if(!Y)throw new Error(`${j.name}: @type() reference provided for "${N}" is undefined. Make sure you don't have any circular dependencies.`);Y=_e(Y),cn.register(j);const Ae=Object.getPrototypeOf(j)[Symbol.metadata],tt=Ue.initialize(j);let Pe=tt[N];if(tt[Pe]!==void 0){if(tt[Pe].deprecated)return;if(tt[Pe].type!==void 0)try{throw new Error(`@colyseus/schema: Duplicate '${N}' definition on '${j.name}'.
55Check @type() annotation`)}catch(We){const Ze=We.stack.split(`
56`)[4].trim();throw new Error(`${We.message} ${Ze}`)}}else Pe=tt[w]??(Ae&&Ae[w])??-1,Pe++;if(T&&T.manual)Ue.addField(tt,Pe,N,Y,{enumerable:!0,configurable:!0,writable:!0});else{const We=typeof Object.keys(Y)[0]=="string"&&Zt(Object.keys(Y)[0]),Ze=We?Ob
56ject.values(Y)[0]:Y;Ue.addField(tt,Pe,N,Y,Nt(`_${N}`,Pe,Ze,We))}}}function Nt(Y,T,I,N){return{get:function(){return this[Y]},set:function(j){const fe=this[Y]??void 0;if(j!==fe){if(j!=null){N?(N.constructor===ui&&!(j instanceof ui)&&(j=new ui(...j)),N.constructor===It&&!(j instanceof It)&&(j=new It(j)),j[x]=I):typeof I!="string"?Ps(j,I,this,Y.substring(1)):Ws(j,I,this,Y.substring(1));const Ae=this[v];fe!==void 0&&fe[v]?(Ae.root?.remove(fe[v]),this.constructor[a](Ae,T,t.OPERATION.DELETE_AND_ADD)):this.constructor[a](Ae,T,t.OPERATION.ADD),j[v]?.setParent(this,Ae.root,T)}else fe!==void 0&&this[v].delete(T);this[Y]=j}},enumerable:!0,configurable:!0}}function Kt(Y=!0){return function(T,I){const N=T.constructor,fe=Object.getPrototypeOf(N)[Symbol.metadata],Ae=N[Symbol.metadata]??=Object.assign({},N[Symbol.metadata],fe??Object.create(null)),tt=Ae[I];Ae[tt].deprecated=!0,Y&&(Ae[R]??={},Ae[R][I]={get:function(){throw new Error(`${I} is deprecated.`)},set:function(Pe){},enumerable:!1,configurable:!0}),Object.defineProperty(Ae,tt,{value:Ae[tt],enumerable:!1,configurable:!0})}}function rn(Y,T,I){for(let N in T)Et(T[N],I)(Y.prototype,N);return Y}function zt(Y,T,I=Xt){const N={},j={},fe={},Ae={};for(let Ze in Y){const je=Y[Ze];typeof je=="object"?(je.view!==void 0&&(Ae[Ze]=typeof je.view=="boolean"?xe:je.view),N[Ze]=_e(je),Object.prototype.hasOwnProperty.call(je,"default")?fe[Ze]=je.default:Array.isArray(je)||je.array!==void 0?fe[Ze]=new ui:je.map!==void 0?fe[Ze]=new It:je.collection!==void 0?fe[Ze]=new Q:je.set!==void 0?fe[Ze]=new Le:je.type!==void 0&&Xt.is(je.type)&&(!je.type.prototype.initialize||je.type.prototype.initialize.length===0)&&(fe[Ze]=new je.type)):typeof je=="function"?Xt.is(je)?((!je.prototype.initialize||je.prototype.initialize.length===0)&&(fe[Ze]=new je),N[Ze]=_e(je)):j[Ze]=je:N[Ze]=_e(je)}const tt=()=>{const Ze={};for(const je in fe){const Lt=fe[je];Lt&&typeof Lt.clone=="function"?Ze[je]=Lt.clone():Ze[je]=Lt}return Ze},Pe=Ze=>{const je=Object.keys(N),Lt={};for(const Ut in Ze)je.includes(Ut)||(Lt[Ut]=Ze[Ut]);return Lt},We=Ue.setFields(class extends I{constructor(...Ze){j.initialize&&typeof j.initialize=="function"?(super(Object.assign({},tt(),Pe(Ze[0]||{}))),new.target===We&&j.initialize.apply(this,Ze)):super(Object.assign({},tt(),Ze[0]||{}))}},N);We._getDefaultValues=tt,Object.assign(We.prototype,j);for(let Ze in Ae)xt(Ae[Ze])(We.prototype,Ze);return T&&Object.defineProperty(We,"name",{value:T}),We.extends=(Ze,je)=>zt(Ze,je,We),We}function xn(Y){return new Array(Y).fill(0).map((T,I)=>I===Y-1?"└─ ":"   ").join("")}function Pn(Y){const T=Y[v].root,I={ops:{},refs:[]};let N=T.changes.next;for(;N;){const j=N.changeTree;if(j===void 0){N=N.next;continue}const fe=j.indexedOperations;I.refs.push(`refId#${j.refId}`);for(const Ae in fe){const tt=fe[Ae],Pe=t.OPERATION[tt];I.ops[Pe]||(I.ops[Pe]=0),I.ops[t.OPERATION[tt]]++}N=N.next}return I}var _i,Vn;class Xt{static{this[_i]=Tt}static{this[Vn]=er}static initialize(T){Object.defineProperty(T,v,{value:new kn(T),enumerable:!1,writable:!0}),Object.defineProperties(T,T.constructor[Symbol.metadata]?.[R]||{})}static is(T){return typeof T[Symbol.metadata]=="object"}static[(_i=l,Vn=u,a)](T,I,N=t.OPERATION.ADD){T.change(I,N)}static[h](T,I,N){const fe=T.constructor[Symbol.metadata][I]?.tag;if(N===void 0)return fe===void 0;if(fe===void 0)return!0;if(fe===xe)return N.isChangeTreeVisible(T[v]);{const Ae=N.tags?.get(T[v]);return Ae&&Ae.has(fe)}}constructor(T){Xt.initialize(this),T&&Object.assign(this,T)}assign(T){return Object.assign(this,T),this}setDirty(T,I){const N=this.constructor[Symbol.metadata];this[v].change(N[N[T]].index,I)}clone(){const T=Object.create(this.constructor.prototype);Xt.initialize(T);const I=this.constructor[Symbol.metadata];for(const N in I){const j=I[N].name;typeof this[j]=="object"&&typeof this[j]?.clone=="function"?T[j]=this[j].clone():T[j]=this[j]}return T}toJSON(){const T={},I=this.constructor[Symbol.metadata];for(const N in I){const j=I[N],fe=j.name;!j.deprecated&&this[fe]!==null&&typeof this[fe]<"u"&&(T[fe]=typeof this[fe].toJSON=="function"?this[fe].toJSON():this[fe])}return T}discardAllChanges(){this[v].discardAll()}[p](T){const I=this.constructor[Symbol.metadata];return this[I[T].name]}[m](T){const I=this.constructor[Symbol.metadata];this[I[T].name]=void 0}static debugRefIds(T,I=!1,N=0,j,fe=""){const Ae=I?` - ${JSON.stringify(T.toJSON())}`:"",tt=T[v],Pe=j?j.root.refIds.get(T):tt.refId,We=j?j.root:tt.root,Ze=We?.refCount?.[Pe]>1?` [×${We.refCount[Pe]}]`:"";let je=`${xn(N)}${fe}${T.constructor.name} (refId: ${Pe})${Ze}${Ae}
57`;return tt.forEachChild((Lt,Ut)=>{let Mt=Ut;typeof Ut=="number"&&T.$indexes&&(Mt=T.$indexes.get(Ut)??Ut);const _t=T.forEach!==void 0&&Mt!==void 0?`["${Mt}"]: `:"";je+=this.debugRefIds(Lt.ref,I,N+1,j,_t)}),je}static debugRefIdEncodingOrder(T,I="allChanges"){let N=[],j=T[v].root[I].next;for(;j;)j.changeTree&&N.push(j.changeTree.refId),j=j.next;return N}static debugRefIdsFromDecoder(T){return this.debugRefIds(T.state,!1,0,T)}static debugChanges(T,I=!1){const N=T[v],j=I?N.allChanges:N.changes,fe=I?"allChanges":"changes";let Ae=`${T.constructor.name} (${N.refId}) -> .${fe}:
58`;function tt(Pe){Pe.operations.filter(We=>We).forEach(We=>{const Ze=N.indexedOperations[We];Ae+=`- [${We}]: ${t.OPERATION[Ze]} (${JSON.stringify(N.getValue(Number(We),I))})
59`})}return tt(j),!I&&N.filteredChanges&&N.filteredChanges.operations.filter(Pe=>Pe).length>0&&(Ae+=`${T.constructor.name} (${N.refId}) -> .filteredChanges:
60`,tt(N.filteredChanges)),I&&N.allFilteredChanges&&N.allFilteredChanges.operations.filter(Pe=>Pe).length>0&&(Ae+=`${T.constructor.name} (${N.refId}) -> .allFilteredChanges:
61`,tt(N.allFilteredChanges)),Ae}static debugChangesDeep(T,I="changes"){let N="";const j=T[v],fe=j.root,Ae=new Map,tt=[];let Pe=0;for(const[Ze,je]of Object.entries(fe[I])){const Lt=fe.changeTrees[Ze];if(!Lt)continue;let Ut=!1,Mt=[],_t=Lt.parent?.[v];
61if(Lt===j)Ut=!0;else for(;_t!==void 0;){if(Mt.push(_t),_t.ref===T){Ut=!0;break}_t=_t.parent?.[v]}Ut&&(tt.push(Lt.refId),Pe+=Object.keys(je).length,Ae.set(Lt,Mt.reverse()))}N+=`---
62`,N+=`root refId: ${j.refId}
63`,N+=`Total instances: ${tt.length} (refIds: ${tt.join(", ")})
64`,N+=`Total changes: ${Pe}
65`,N+=`---
66`;const We=new WeakSet;for(const[Ze,je]of Ae.entries()){je.forEach((Ht,ni)=>{We.has(Ht)||(N+=`${xn(ni)}${Ht.ref.constructor.name} (refId: ${Ht.refId})
67`,We.add(Ht))});const Lt=Ze.indexedOperations,Ut=je.length,Mt=xn(Ut),_t=Ut>0?`(${Ze.parentIndex}) `:"";N+=`${Mt}${_t}${Ze.ref.constructor.name} (refId: ${Ze.refId}) - changes: ${Object.keys(Lt).length}
68`;for(const Ht in Lt){const ni=Lt[Ht];N+=`${xn(Ut+1)}${t.OPERATION[ni]}: ${Ht}
69`}}return`${N}`}}function Yt(Y,T,I,N){var j=arguments.length,fe=j<3?T:N,Ae;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")fe=Reflect.decorate(Y,T,I,N);else for(var tt=Y.length-1;tt>=0;tt--)(Ae=Y[tt])&&(fe=(j<3?Ae(fe):j>3?Ae(T,I,fe):Ae(T,I))||fe);return j>3&&fe&&Object.defineProperty(T,I,fe),fe}typeof SuppressedError=="function"&&SuppressedError;class Qi{constructor(T){this.types=T,this.nextUniqueId=0,this.refCount={},this.changeTrees={},this.allChanges=bt(),this.allFilteredChanges=bt(),this.changes=bt(),this.filteredChanges=bt()}getNextUniqueId(){return this.nextUniqueId++}add(T){T.refId===void 0&&(T.refId=this.getNextUniqueId());const I=this.changeTrees[T.refId]===void 0;I&&(this.changeTrees[T.refId]=T);const N=this.refCount[T.refId];if(N===0){const j=T.allChanges.operations;let fe=j.length;for(;fe--;)T.indexedOperations[j[fe]]=t.OPERATION.ADD,mt(T.changes,fe)}return this.refCount[T.refId]=(N||0)+1,I}remove(T){const I=this.refCount[T.refId]-1;return I<=0?(T.root=void 0,delete this.changeTrees[T.refId],this.removeChangeFromChangeSet("allChanges",T),this.removeChangeFromChangeSet("changes",T),T.filteredChanges&&(this.removeChangeFromChangeSet("allFilteredChanges",T),this.removeChangeFromChangeSet("filteredChanges",T)),this.refCount[T.refId]=0,T.forEachChild((N,j)=>{N.removeParent(T.ref)&&(N.parentChain===void 0||N.parentChain&&this.refCount[N.refId]>0?this.remove(N):N.parentChain&&this.moveNextToParent(N))})):(this.refCount[T.refId]=I,this.recursivelyMoveNextToParent(T)),I}recursivelyMoveNextToParent(T){this.moveNextToParent(T),T.forEachChild((I,N)=>this.recursivelyMoveNextToParent(I))}moveNextToParent(T){T.filteredChanges?(this.moveNextToParentInChangeTreeList("filteredChanges",T),this.moveNextToParentInChangeTreeList("allFilteredChanges",T)):(this.moveNextToParentInChangeTreeList("changes",T),this.moveNextToParentInChangeTreeList("allChanges",T))}moveNextToParentInChangeTreeList(T,I){const N=this[T],j=I[T].queueRootNode;if(!j)return;const fe=I.parent;if(!fe||!fe[v])return;const Ae=fe[v][T]?.queueRootNode;if(!Ae||Ae===j)return;const tt=Ae.position;j.position>tt||(j.prev?j.prev.next=j.next:N.next=j.next,j.next?j.next.prev=j.prev:N.tail=j.prev,j.prev=Ae,j.next=Ae.next,Ae.next?Ae.next.prev=j:N.tail=j,Ae.next=j,this.updatePositionsAfterMove(N,j,tt+1))}enqueueChangeTree(T,I,N=T[I].queueRootNode){N||(T[I].queueRootNode=this.addToChangeTreeList(this[I],T))}addToChangeTreeList(T,I){const N={changeTree:I,next:void 0,prev:void 0,position:T.tail?T.tail.position+1:0};return T.next?(N.prev=T.tail,T.tail.next=N,T.tail=N):(T.next=N,T.tail=N),N}updatePositionsAfterRemoval(T,I){let N=T.next,j=0;for(;N;)j>=I&&(N.position=j),N=N.next,j++}updatePositionsAfterMove(T,I,N){let j=T.next,fe=0;for(;j;)j.position=fe,j=j.next,fe++}removeChangeFromChangeSet(T,I){const N=this[T],j=I[T].queueRootNode;if(j&&j.changeTree===I){const fe=j.position;return j.prev?j.prev.next=j.next:N.next=j.next,j.next?j.next.prev=j.prev:N.tail=j.prev,this.updatePositionsAfterRemoval(N,fe),I[T].queueRootNode=void 0,!0}return!1}}class Tn{static{this.BUFFER_SIZE=typeof Buffer<"u"&&Buffer.poolSize||8*1024}constructor(T){this.sharedBuffer=Buffer.allocUnsafe(Tn.BUFFER_SIZE),this.context=cn.cache(T.constructor),this.root=new Qi(this.context),this.setState(T)}setState(T){this.state=T,this.state[v].setRoot(this.root)}encode(T={offset:0},I,N=this.sharedBuffer,j="changes",fe=j==="allChanges",Ae=T.offset){const tt=I!==void 0,Pe=this.state[v];let We=this.root[j];for(;We=We.next;){const Ze=We.changeTree;
69if(tt){if(!I.isChangeTreeVisible(Ze)){I.invisible.add(Ze);continue}I.invisible.delete(Ze)}const je=Ze[j],Lt=Ze.ref,Ut=je.operations.length;if(Ut===0)continue;const Mt=Lt.constructor,_t=Mt[l],Ht=Mt[h],ni=Mt[Symbol.metadata];(tt||T.offset>Ae||Ze!==Pe)&&(N[T.offset++]=255,Re.number(N,Ze.refId,T));for(let Ii=0;Ii<Ut;Ii++){const Ts=je.operations[Ii];if(Ts<0){N[T.offset++]=Math.abs(Ts)&255;continue}const Di=fe?t.OPERATION.ADD:Ze.indexedOperations[Ts];Ts===void 0||Di===void 0||Ht&&!Ht(Lt,Ts,I)||_t(this,N,Ze,Ts,Di,T,fe,tt,ni)}}if(T.offset>N.byteLength){const Ze=Math.ceil(T.offset/(Buffer.poolSize??8192))*(Buffer.poolSize??8192);return console.warn(`@colyseus/schema buffer overflow. Encoded state is higher than default BUFFER_SIZE. Use the following to increase default BUFFER_SIZE:
70
71    import { Encoder } from "@colyseus/schema";
72    Encoder.BUFFER_SIZE = ${Math.round(Ze/1024)} * 1024; // ${Math.round(Ze/1024)} KB
73`),N=Buffer.alloc(Ze,N),N===this.sharedBuffer&&(this.sharedBuffer=N),this.encode({offset:Ae},I,N,j,fe)}else return N.subarray(0,T.offset)}encodeAll(T={offset:0},I=this.sharedBuffer){return this.encode(T,void 0,I,"allChanges",!0)}encodeAllView(T,I,N,j=this.sharedBuffer){const fe=N.offset;return this.encode(N,T,j,"allFilteredChanges",!0,fe),Buffer.concat([j.subarray(0,I),j.subarray(fe,N.offset)])}encodeView(T,I,N,j=this.sharedBuffer){const fe=N.offset;for(const[Ae,tt]of T.changes){const Pe=this.root.changeTrees[Ae];if(Pe===void 0){T.changes.delete(Ae);continue}const We=Object.keys(tt);if(We.length===0)continue;const je=Pe.ref.constructor,Lt=je[l],Ut=je[Symbol.metadata];j[N.offset++]=255,Re.number(j,Pe.refId,N);for(let Mt=0,_t=We.length;Mt<_t;Mt++){const Ht=Number(We[Mt]),Ii=Pe.ref[p](Ht)!==void 0&&tt[Ht]||t.OPERATION.DELETE;Lt(this,j,Pe,Ht,Ii,N,!1,!0,Ut)}}return T.changes.clear(),this.encode(N,T,j,"filteredChanges",!1,fe),Buffer.concat([j.subarray(0,I),j.subarray(fe,N.offset)])}discardChanges(){let T=this.root.changes.next;for(;T;)T.changeTree.endEncode("changes"),T=T.next;for(this.root.changes=bt(),T=this.root.filteredChanges.next;T;)T.changeTree.endEncode("filteredChanges"),T=T.next;this.root.filteredChanges=bt()}tryEncodeTypeId(T,I,N,j){const fe=this.context.getTypeId(I),Ae=this.context.getTypeId(N);if(Ae===void 0){console.warn(`@colyseus/schema WARNING: Class "${N.name}" is not registered on TypeRegistry - Please either tag the class with @entity or define a @type() field.`);return}fe!==Ae&&(T[j.offset++]=213,Re.number(T,Ae,j))}get hasChanges(){return this.root.changes.next!==void 0||this.root.filteredChanges.next!==void 0}}function pi(Y,T){if(T===-1||T>=Y.length)return!1;const I=Y.length-1;for(let N=T;N<I;N++)Y[N]=Y[N+1];return Y.length=I,!0}
73class Kn extends Error{constructor(T){super(T),this.name="DecodingWarning"}}class Es{constructor(){this.refs=new Map,this.refIds=new WeakMap,this.refCount={},this.deletedRefs=new Set,this.callbacks={},this.nextUniqueId=0}getNextUniqueId(){return this.nextUniqueId++}addRef(T,I,N=!0){this.refs.set(T,I),this.refIds.set(I,T),N&&(this.refCount[T]=(this.refCount[T]||0)+1),this.deletedRefs.has(T)&&this.deletedRefs.delete(T)}removeRef(T){const I=this.refCount[T];if(I===void 0){try{throw new Kn("trying to remove refId that doesn't exist: "+T)}catch(N){console.warn(N)}return}if(I===0){try{const N=this.refs.get(T);throw new Kn(`trying to remove refId '${T}' with 0 refCount (${N.constructor.name}: ${JSON.stringify(N)})`)}catch(N){console.warn(N)}return}(this.refCount[T]=I-1)<=0&&this.deletedRefs.add(T)}clearRefs(){this.refs.clear(),this.deletedRefs.clear(),this.callbacks={},this.refCount={}}garbageCollectDeletedRefs(){this.deletedRefs.forEach(T=>{if(this.refCount[T]>0)return;const I=this.refs.get(T);if(I.constructor[Symbol.metadata]!==void 0){const N=I.constructor[Symbol.metadata];for(const j in N){const fe=N[j].name,Ae=typeof I[fe]=="object"&&this.refIds.get(I[fe]);Ae&&!this.deletedRefs.has(Ae)&&this.removeRef(Ae)}}else typeof I[x]=="function"&&Array.from(I.values()).forEach(N=>{const j=this.refIds.get(N);this.deletedRefs.has(j)||this.removeRef(j)});this.refs.delete(T),delete this.refCount[T],delete this.callbacks[T]}),this.deletedRefs.clear()}addCallback(T,I,N){if(T===void 0){const j=typeof I=="number"?t.OPERATION[I]:I;throw new Error(`Can't addCallback on '${j}' (refId is undefined)`)}return this.callbacks[T]||(this.callbacks[T]={}),this.callbacks[T][I]||(this.callbacks[T][I]=[]),this.callbacks[T][I].push(N),()=>this.removeCallback(T,I,N)}removeCallback(T,I,N){const j=this.callbacks?.[T]?.[I]?.indexOf(N);j!==void 0&&j!==-1&&pi(this.callbacks[T][I],j)}}class Bi{constructor(T,I){this.currentRefId=0,this.setState(T),this.context=I||new cn(T.constructor)}setState(T){this.state=T,this.root=new Es,this.root.addRef(0,T)}decode(T,I={offset:0},N=this.state){const j=[],fe=this.root,Ae=T.byteLength;let tt=N.constructor[u];for(this.currentRefId=0;I.offset<Ae;){if(T[I.offset]==255){I.offset++,N[A]?.();const We=Oe.number(T,I),Ze=fe.refs.get(We);Ze?(N=Ze,tt=N.constructor[u],this.currentRefId=We):(console.error(`"refId" not found: ${We}`,{previousRef:N,previousRefId:this.currentRefId}),console.warn("Please report this issue to the developers."),this.skipCurrentStructure(T,I,Ae));continue}if(tt(this,T,I,N,j)===Lr){console.warn("@colyseus/schema: definition mismatch"),this.skipCurrentStructure(T,I,Ae);continue}}return N[A]?.(),this.triggerChanges?.(j),fe.garbageCollectDeletedRefs(),j}skipCurrentStructure(T,I,N){const j={offset:I.offset};for(;I.offset<N&&!(T[I.offset]===255&&(j.offset=I.offset+1,this.root.refs.has(Oe.number(T,j))));)I.offset++}getInstanceType(T,I,N){let j;if(T[I.offset]===213){I.offset++;const fe=Oe.number(T,I);j=this.context.get(fe)}return j||N}createInstanceOfType(T){return new T}removeChildRefs(T,I){const N=typeof T[x]!="string",j=this.root.refIds.get(T);T.forEach((fe,Ae)=>{I.push({ref:T,refId:j,op:t.OPERATION.DELETE,field:Ae,value:void 0,previousValue:fe}),N&&this.root.removeRef(this.root.refIds.get(fe))})}}class Un extends Xt{}Yt([Et("string")],Un.prototype,"name",void 0),Yt([Et("string")],Un.prototype,"type",void 0),Yt([Et("number")],Un.prototype,"referencedType",void 0);class Gi extends Xt{constructor(){super(...arguments),this.fields=new ui}}Yt([Et("number")],Gi.prototype,"id",void 0),Yt([Et("number")],Gi.prototype,"extendsId",void 0),Yt([Et([Un])],Gi.prototype,"fields",void 0);class mi extends Xt{constructor(){super(...arguments),this.types=new ui}static encode(T,I={offset:0}){const N=T.context,j=new mi,fe=new Tn(j),Ae=N.schemas.get(T.state.constructor);Ae>0&&(j.rootType=Ae);const tt=new Set,Pe={},We=je=>{if(je.extendsId===void 0||tt.has(je.extendsId)){tt.add(je.id),j.types.push(je);const Lt=Pe[je.id];Lt!==void 0&&(delete Pe[je.id],Lt.forEach(Ut=>We(Ut)))}else Pe[je.extendsId]===void 0&&(Pe[je.extendsId]=[]),Pe[je.extendsId].push(je)};N.schemas.forEach((je,Lt)=>
73{const Ut=new Gi;Ut.id=Number(je);const Mt=Object.getPrototypeOf(Lt);Mt!==Xt&&(Ut.extendsId=N.schemas.get(Mt));const _t=Lt[Symbol.metadata];if(_t!==Mt[Symbol.metadata])for(const Ht in _t){const ni=Number(Ht),Ii=_t[ni].name;if(!Object.prototype.hasOwnProperty.call(_t,Ii))continue;const Ts=new Un;Ts.name=Ii;let Di;const sa=_t[ni];if(typeof sa.type=="string")Di=sa.type;else{let _a;Xt.is(sa.type)?(Di="ref",_a=sa.type):(Di=Object.keys(sa.type)[0],typeof sa.type[Di]=="string"?Di+=":"+sa.type[Di]:_a=sa.type[Di]),Ts.referencedType=_a?N.getTypeId(_a):-1}Ts.type=Di,Ut.fields.push(Ts)}We(Ut)});for(const je in Pe)Pe[je].forEach(Lt=>j.types.push(Lt));return fe.encodeAll(I).slice(0,I.offset)}static decode(T,I){const N=new mi;new Bi(N).decode(T,I);const fe=new cn;N.types.forEach(Pe=>{const We=fe.get(Pe.extendsId)??Xt,Ze=class extends We{};cn.register(Ze),fe.add(Ze,Pe.id)},{});const Ae=(Pe,We,Ze)=>{We.fields.forEach((je,Lt)=>{const Ut=Ze+Lt;if(je.referencedType!==void 0){let Mt=je.type,_t=fe.get(je.referencedType);if(!_t){const Ht=je.type.split(":");Mt=Ht[0],_t=Ht[1]}Mt==="ref"?Ue.addField(Pe,Ut,je.name,_t):Ue.addField(Pe,Ut,je.name,{[Mt]:_t})}else Ue.addField(Pe,Ut,je.name,je.type)})};N.types.forEach(Pe=>{const We=fe.get(Pe.id),Ze=Ue.initialize(We),je=[];let Lt=Pe;do je.push(Lt),Lt=N.types.find(Mt=>Mt.id===Lt.extendsId);while(Lt);let Ut=0;je.reverse().forEach(Mt=>{Ae(Ze,Mt,Ut),Ut+=Mt.fields.length})});const tt=new(fe.get(N.rootType||0));return new Bi(tt,fe)}}Yt([Et([Gi])],mi.prototype,"types",void 0),Yt([Et("number")],mi.prototype,"rootType",void 0);function wi(Y){const T=Y.root,I=T.callbacks,N=new WeakMap;let j;Y.triggerChanges=function(tt){const Pe=new Set;for(let We=0,Ze=tt.length;We<Ze;We++){const je=tt[We],Lt=je.refId,Ut=je.ref,Mt=I[Lt];if(Mt){if((je.op&t.OPERATION.DELETE)===t.OPERATION.DELETE&&je.previousValue instanceof Xt){const _t=I[T.refIds.get(je.previousValue)]?.[t.OPERATION.DELETE];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht]()}if(Ut instanceof Xt){if(!Pe.has(Lt)){const _t=Mt?.[t.OPERATION.REPLACE];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht]()}if(Mt.hasOwnProperty(je.field)){const _t=Mt[je.field];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht](je.value,je.previousValue)}}else{if((je.op&t.OPERATION.DELETE)===t.OPERATION.DELETE){if(je.previousValue!==void 0){const _t=Mt[t.OPERATION.DELETE];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht](je.previousValue,je.dynamicIndex??je.field)}if((je.op&t.OPERATION.ADD)===t.OPERATION.ADD){const _t=Mt[t.OPERATION.ADD];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht](je.value,je.dynamicIndex??je.field)}}else if((je.op&t.OPERATION.ADD)===t.OPERATION.ADD&&je.previousValue!==je.value){const _t=Mt[t.OPERATION.ADD];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht](je.value,je.dynamicIndex??je.field)}if(je.value!==je.previousValue&&(je.value!==void 0||je.previousValue!==void 0)){const _t=Mt[t.OPERATION.REPLACE];for(let Ht=_t?.length-1;Ht>=0;Ht--)_t[Ht](je.value,je.dynamicIndex??je.field)}}Pe.add(Lt)}}};function fe(tt,Pe){let We=Pe.instance?.constructor[Symbol.metadata]||tt,Ze=Pe.instance&&typeof Pe.instance.forEach=="function"||tt&&typeof tt[Symbol.metadata]>"u";if(We&&!Ze){const je=function(Lt,Ut,Mt,_t){return _t&&Pe.instance[Ut]!==void 0&&!N.has(j)&&Mt(Pe.instance[Ut],void 0),T.addCallback(T.refIds.get(Lt),Ut,Mt)};return new Proxy({listen:function(Ut,Mt,_t=!0){if(Pe.instance)return je(Pe.instance,Ut,Mt,_t);{let Ht=()=>{};return Pe.onInstanceAvailable((ni,Ii)=>{Ht=je(ni,Ut,Mt,_t&&Ii&&!N.has(j))}),()=>Ht()}},onChange:function(Ut){return T.addCallback(T.refIds.get(Pe.instance),t.OPERATION.REPLACE,Ut)},bindTo:function(Ut,Mt){return Mt||(Mt=Object.keys(We).map(_t=>We[_t].name)),T.addCallback(T.refIds.get(Pe.instance),t.OPERATION.REPLACE,()=>{Mt.forEach(_t=>Ut[_t]=Pe.instance[_t])})}},{get(Lt,Ut){const Mt=We[We[Ut]];if(Mt){const _t=Pe.instance?.[Ut],Ht=(ni=>{const Ii=Ae(Pe.instance).listen(Ut,(Ts,Di)=>{ni(Ts,!1),Ii?.()},!1);T.refIds.get(_t)!==void 0&&ni(_t,!0)});return fe(Mt.type,{instance:T.refIds.get(_t)&&_t,parentInstance:Pe.instance,onInstanceAvailable:Ht})}else return Lt[Ut]},has(Lt,Ut){return We[Ut]!==void 0},set(Lt,Ut,Mt){throw new Error("not allowed")},deleteProperty(Lt,Ut){throw new Error("not allowed")}})}else{const je=function(Mt,_t,Ht){return Ht&&Mt.forEach((ni,Ii)=>_t(ni,Ii)),T.addCallback(T.refIds.get(Mt),t.OPERATION.ADD,(ni,Ii)=>{N.set(_t,!0),j=_t,_t(ni,Ii),N.delete(_t),j=void 0})},Lt=function(Mt,_t){return T.addCallback(T.refIds.get(Mt),t.OPERATION.DELETE,_t)},Ut=function(Mt,_t){return T.addCallback(T.refIds.get(Mt),t.OPERATION.REPLACE,_t)};return new Proxy({onAdd:function(Mt,_t=!0){if(Pe.instance)return je(Pe.instance,Mt,_t&&!N.has(j));if(Pe.onInstanceAvailable){let Ht=()=>{};return Pe.onInstanceAvailable((ni,Ii)=>{Ht=je(ni,Mt,_t&&Ii&&!N.has(j))}),()=>Ht()}},onRemove:function(Mt){if(Pe.instance)return Lt(Pe.instance,Mt);if(Pe.onInstanceAvailable){let _t=()=>{};return Pe.onInstanceAvailable(Ht=>{_t=Lt(Ht,Mt)}),()=>_t()}},onChange:function(Mt){if(Pe.instance)return Ut(Pe.instance,Mt);if(Pe.onInstanceAvailable){let _t=()=>{};return Pe.onInstanceAvailable(Ht=>{_t=Ut(Ht,Mt)}),()=>_t()}}},{get(Mt,_t){if(!Mt[_t])throw new Error(`Can't access '${_t}' through callback proxy. access the instance directly.`);return Mt[_t]},has(Mt,_t){return Mt[_t]!==void 0},set(Mt,_t,Ht){throw new Error("not allowed")},deleteProperty(Mt,_t){throw new Error("not allowed")}})}}function Ae(tt){return fe(void 0,{instance:tt})}return Ae}function ms(Y,T){Y.triggerChanges=T}class no{constructor(T=!1){this.iterable=T,this.visible=new WeakSet,this.invisible=new WeakSet,this.changes=new Map,T&&(this.items=[])}add(T,I=xe,N=!0){const j=T?.[v],fe=j.parent;if(j){if(!fe&&j.refId!==0)throw new Error(`Cannot add a detached instance to the StateView. Make sure to assign the "${j.ref.constructor.name}" instance to the state before calling view.add()`)}else return console.warn("StateView#add(), invalid object:",T),!1;const Ae=T.constructor[Symbol.metadata];this.visible.add(j),this.iterable&&N&&this.items.push(T),N&&fe&&this.addParentOf(j,I);let tt=this.changes.get(j.refId);tt===void 0&&(tt={},this.changes.set(j.refId,tt));let Pe=!1;if(j.forEachChild((We,Ze)=>{Ae&&Ae[Ze].tag!==void 0&&Ae[Ze].tag!==I||this.add(We.ref,I,!1)&&(Pe=!0)}),I!==xe){this.tags||(this.tags=new WeakMap);let We;this.tags.has(j)?We=this.tags.get(j):(We=new Set,this.tags.set(j,We)),We.add(I),Ae?.[L]?.[I]?.forEach(Ze=>{j.getChange(Ze)!==t.OPERATION.DELETE&&(tt[Ze]=t.OPERATION.ADD)})}else if(!j.isNew||Pe){const We=j.filteredChanges!==void 0?j.allFilteredChanges:j.allChanges,Ze=this.invisible.has(j);for(let je=0,Lt=We.operations.length;je<Lt;je++){const Ut=We.operations[je];
73if(Ut===void 0)continue;const Mt=j.indexedOperations[Ut]??t.OPERATION.ADD,_t=Ae?.[Ut].tag;Mt!==t.OPERATION.DELETE&&(Ze||_t===void 0||_t===I)&&(tt[Ut]=Mt,Pe=!0)}}return Pe}addParentOf(T,I){const N=T.parent[v],j=T.parentIndex;if(!this.visible.has(N)){this.visible.add(N);const fe=N.parent?.[v];fe&&fe.filteredChanges!==void 0&&this.addParentOf(N,I)}if(N.getChange(j)!==t.OPERATION.DELETE){let fe=this.changes.get(N.refId);fe===void 0&&(fe={},this.changes.set(N.refId,fe)),this.tags||(this.tags=new WeakMap);let Ae;this.tags.has(N)?Ae=this.tags.get(N):(Ae=new Set,this.tags.set(N,Ae)),Ae.add(I),fe[j]=t.OPERATION.ADD}}remove(T,I=xe,N=!1){const j=T[v];if(!j)return console.warn("StateView#remove(), invalid object:",T),this;this.visible.delete(j),this.iterable&&!N&&pi(this.items,this.items.indexOf(T));const Ae=j.ref.constructor[Symbol.metadata];let tt=this.changes.get(j.refId);if(tt===void 0&&(tt={},this.changes.set(j.refId,tt)),I===xe){const Pe=j.parent;if(Pe&&!Ue.isValidInstance(Pe)&&j.isFiltered){const We=Pe[v];let Ze=this.changes.get(We.refId);Ze===void 0?(Ze={},this.changes.set(We.refId,Ze)):Ze[j.parentIndex]===t.OPERATION.ADD&&this.changes.delete(j.refId),Ze[j.parentIndex]=t.OPERATION.DELETE,this._recursiveDeleteVisibleChangeTree(j)}else Ae?.[D]?.forEach(We=>tt[We]=t.OPERATION.DELETE)}else Ae?.[L][I].forEach(Pe=>tt[Pe]=t.OPERATION.DELETE);if(this.tags&&this.tags.has(j)){const Pe=this.tags.get(j);I===void 0?this.tags.delete(j):(Pe.delete(I),Pe.size===0&&this.tags.delete(j))}return this}has(T){return this.visible.has(T[v])}hasTag(T,I=xe){return this.tags?.get(T[v])?.has(I)??!1}clear(){if(!this.iterable)throw new Error("StateView#clear() is only available for iterable StateView's. Use StateView(iterable: true) constructor.");for(let T=0,I=this.items.length;T<I;T++)this.remove(this.items[T],xe,!0);this.items.length=0}isChangeTreeVisible(T){let I=this.visible.has(T);return!I&&T.isVisibilitySharedWithParent&&this.visible.has(T.parent[v])&&(this.visible.add(T),I=!0),I}_recursiveDeleteVisibleChangeTree(T){T.forEachChild(I=>{this.visible.delete(I),this._recursiveDeleteVisibleChangeTree(I)})}}ft("map",{constructor:It}),ft("array",{constructor:ui}
73),ft("set",{constructor:Le}),ft("collection",{constructor:Q}),t.$changes=v,t.$childType=x,t.$decoder=u,t.$deleteByIndex=m,t.$encoder=l,t.$filter=h,t.$getByIndex=p,t.$track=a,t.ArraySchema=ui,t.ChangeTree=kn,t.CollectionSchema=Q,t.Decoder=Bi,t.Encoder=Tn,t.MapSchema=It,t.Metadata=Ue,t.Reflection=mi,t.ReflectionField=Un,t.ReflectionType=Gi,t.Schema=Xt,t.SetSchema=Le,t.StateView=no,t.TypeContext=cn,t.decode=Oe,t.decodeKeyValueOperation=Vs,t.decodeSchemaOperation=er,t.defineCustomTypes=sn,t.defineTypes=rn,t.deprecated=Kt,t.dumpChanges=Pn,t.encode=Re,t.encodeArray=En,t.encodeKeyValueOperation=gn,t.encodeSchemaOperation=Tt,t.entity=dt,t.getDecoderStateCallbacks=wi,t.getRawChangesCallback=ms,t.registerType=ft,t.schema=zt,t.type=Et,t.view=xt}))})(E0,E0.exports)),E0.exports}var ME;function C5(){if(ME)return rS;ME=1;var i=__,e=xA();class t{constructor(s){this.events=s,this.isOpen=!1,this.lengthPrefixBuffer=new Uint8Array(9)}connect(s,a={}){const l=a.fingerprint&&{serverCertificateHashes:[{algorithm:"sha-256",value:new Uint8Array(a.fingerprint).buffer}]}||void 0;this.wt=new WebTransport(s,l),this.wt.ready.then(u=>{console.log("WebTransport ready!",u),this.isOpen=!0,this.unreliableReader=this.wt.datagrams.readable.getReader(),this.unreliableWriter=this.wt.datagrams.writable.getWriter(),this.wt.incomingBidirectionalStreams.getReader().read().then(p=>{this.reader=p.value.readable.getReader(),this.writer=p.value.writable.getWriter(),this.sendSeatReservation(a.room.roomId,a.sessionId,a.reconnectionToken),this.readIncomingData(),this.readIncomingUnreliableData()}).catch(p=>{console.error("failed to read incoming stream",p),console.error("TODO: close the connection")})}).catch(u=>{console.log("WebTransport not ready!",u),this._close()}),this.wt.closed.then(u=>{console.log("WebTransport closed w/ success",u),this.events.onclose({code:u.closeCode,reason:u.reason})}).catch(u=>{console.log("WebTransport closed w/ error",u),this.events.onerror(u),this.events.onclose({code:u.closeCode,reason:u.reason})}).finally(()=>{this._close()})}send(s){const a=e.encode.number(this.lengthPrefixBuffer,s.length,{offset:0}),l=new Uint8Array(a+s.length);l.set(this.lengthPrefixBuffer.subarray(0,a),0),l.set(s,a),this.writer.write(l)}sendUnreliable(s){const a=e.encode.number(this.lengthPrefixBuffer,s.length,{offset:0}),l=new Uint8Array(a+s.length);l.set(this.lengthPrefixBuffer.subarray(0,a),0),l.set(s,a),this.unreliableWriter.write(l)}close(s,a){try{this.wt.close({closeCode:s,reason:a})}catch(l){console.error(l)}}readIncomingData(){return i.__awaiter(this,void 0,void 0,function*(){let s;for(;this.isOpen;){try{s=yield this.reader.read();const a=s.value,l={offset:0};do{const u=e.decode.number(a,l);this.events.onmessage({data:a.subarray(l.offset,l.offset+u)}),l.offset+=u}while(l.offset<a.length)}catch(a){a.message.indexOf("session is closed")===-1&&console.error("H3Transport: failed to read incoming data",a);break}if(s.done)break}})}readIncomingUnreliableData(){return i.__awaiter(this,void 0,void 0,function*(){let s;for(;this.isOpen;){try{s=yield this.unreliableReader.read();const a=s.value,l={offset:0};do{const u=e.decode.number(a,l);this.events.onmessage({data:a.subarray(l.offset,l.offset+u)}),l.offset+=u}while(l.offset<a.length)}catch(a){a.message.indexOf("session is closed")===-1&&console.error("H3Transport: failed to read incoming data",a);break}if(s.done)break}})}sendSeatReservation(s,a,l){const u={offset:0},h=[];e.encode.string(h,s,u),e.encode.string(h,a,u),l&&e.encode.string(h,l,u),this.writer.write(new Uint8Array(h).buffer)}_close(){this.isOpen=!1}}return rS.H3TransportTransport=t,rS}var aS={},oS,EE;function R5(){return EE||(EE=1,oS=function(){throw new Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}),oS}var TE;function B5(){if(TE)return aS;TE=1;var i=R5();const e=globalThis.WebSocket||i;let t=class{constructor(s){this.events=s}send(s){this.ws.send(s)}sendUnreliable(s){console.warn("colyseus.js: The WebSocket transport does not support unreliable messages")}connect(s,a){try{this.ws=new e(s,{headers:a,protocols:this.protocols})}catch{this.ws=new e(s,this.protocols)}this.ws.binaryType="arraybuffer",this.ws.onopen=this.events.onopen,this.ws.onmessage=this.events.onmessage,this.ws.onclose
73=this.events.onclose,this.ws.onerror=this.events.onerror}close(s,a){this.ws.close(s,a)}get isOpen(){return this.ws.readyState===e.OPEN}};return aS.WebSocketTransport=t,aS}var wE;function I5(){if(wE)return sS;wE=1;var i=C5(),e=B5();let t=class{constructor(s){switch(this.events={},s){case"h3":this.transport=new i.H3TransportTransport(this.events);break;default:this.transport=new e.WebSocketTransport(this.events);break}}connect(s,a){this.transport.connect.call(this.transport,s,a)}send(s){this.transport.send(s)}sendUnreliable(s){this.transport.sendUnreliable(s)}close(s,a){this.transport.close(s,a)}get isOpen(){return this.transport.isOpen}};return sS.Connection=t,sS}var lS={},CE;function FR(){return CE||(CE=1,(function(i){i.Protocol=void 0,(function(e){e[e.HANDSHAKE=9]="HANDSHAKE",e[e.JOIN_ROOM=10]="JOIN_ROOM",e[e.ERROR=11]="ERROR",e[e.LEAVE_ROOM=12]="LEAVE_ROOM",e[e.ROOM_DATA=13]="ROOM_DATA",e[e.ROOM_STATE=14]="ROOM_STATE",e[e.ROOM_STATE_PATCH=15]="ROOM_STATE_PATCH",e[e.ROOM_DATA_SCHEMA=16]="ROOM_DATA_SCHEMA",e[e.ROOM_DATA_BYTES=17]="ROOM_DATA_BYTES"})(i.Protocol||(i.Protocol={})),i.ErrorCode=void 0,(function(e){e[e.MATCHMAKE_NO_HANDLER=4210]="MATCHMAKE_NO_HANDLER",e[e.MATCHMAKE_INVALID_CRITERIA=4211]="MATCHMAKE_INVALID_CRITERIA",e[e.MATCHMAKE_INVALID_ROOM_ID=4212]="MATCHMAKE_INVALID_ROOM_ID",e[e.MATCHMAKE_UNHANDLED=4213]="MATCHMAKE_UNHANDLED",e[e.MATCHMAKE_EXPIRED=4214]="MATCHMAKE_EXPIRED",e[e.AUTH_FAILED=4215]="AUTH_FAILED",e[e.APPLICATION_ERROR=4216]="APPLICATION_ERROR"})(i.ErrorCode||(i.ErrorCode={}))})(lS)),lS}var ay={},RE;function kR(){if(RE)return ay;RE=1;const i={};function e(n,s){i[n]=s}function t(n){const s=i[n];if(!s)throw new Error("missing serializer: "+n);return s}return ay.getSerializer=t,ay.registerSerializer=e,ay}var cS={},BE;function HR(){if(BE)return cS;BE=1;const i=()=>({emit(e,...t){let n=this.events[e]||[];for(let s=0,a=n.length;s<a;s++)n[s](...t)},events:{},on(e,t){var n;return!((n=this.events[e])===null||n===void 0)&&n.push(t)||(this.events[e]=[t]),()=>{var s;this.events[e]=(s=this.events[e])===null||s===void 0?void 0:s.filter(a=>t!==a)}}});return cS.createNanoEvents=i,cS}var oy={},IE;function D5(){if(IE)return oy;IE=1;class i{constructor(){this.handlers=[]}register(n,s=!1){return this.handlers.push(n),this}invoke(...n){this.handlers.forEach(s=>s.apply(this,n))}invokeAsync(...n){return Promise.all(this.handlers.map(s=>s.apply(this,n)))}remove(n){const s=this.handlers.indexOf(n);this.handlers[s]=this.handlers[this.handlers.length-1],this.handlers.pop()}clear(){this.handlers=[]}}function e(){const t=new i;function n(s){return t.register(s,this===null)}return n.once=s=>{const a=function(...l){s.apply(this,l),t.remove(a)};t.register(a)},n.remove=s=>t.remove(s),n.invoke=(...s)=>t.invoke(...s),n.invokeAsync=(...s)=>t.invokeAsync(...s),n.clear=()=>t.clear(),n}return oy.EventEmitter=i,oy.createSignal=e,oy}var ly={},DE;function GR(){if(DE)return ly;DE=1;var i=xA();function e(n){try{return i.getDecoderStateCallbacks(n.serializer.decoder)}catch{return}}let t=class{setState(s,a){this.decoder.decode(s,a)}getState(){return this.state}patch(s,a){return this.decoder.decode(s,a)}teardown(){this.decoder.root.clearRefs()}handshake(s,a){this.state?(i.Reflection.decode(s,a),this.decoder=new i.Decoder(this.state)):(this.decoder=i.Reflection.decode(s,a),this.state=this.decoder.state)}};return ly.SchemaSerializer=t,ly.getStateCallbacks=e,ly}var F1;try{F1=new TextDecoder}catch{}var Gt,Gl,Me=0,Yi={},ri,Vu,Io=0,Hl=0,mr,Oc,ea=[],ei,LE={useRecords:!1,mapsAsObjects:!0};
vendor: 27,039 bytes, line 73
73class jR{}const _A=new jR;_A.name="MessagePack 0xC1";var Xu=!1,VR=2,L5;try{new Function("")}catch{VR=1/0}class Ju{constructor(e){e&&(e.useRecords===!1&&e.mapsAsObjects===void 0&&(e.mapsAsObjects=!0),e.sequential&&e.trusted!==!1&&(e.trusted=!0,!e.structures&&e.useRecords!=!1&&(e.structures=[],e.maxSharedStructures||(e.maxSharedStructures=0))),e.structures?e.structures.sharedLength=e.structures.length:e.getStructures&&((e.structures=[]).uninitialized=!0,e.structures.sharedLength=0),e.int64AsNumber&&(e.int64AsType="number")),Object.assign(this,e)}unpack(e,t){if(Gt)return KR(()=>(Tx(),this?this.unpack(e,t):Ju.prototype.unpack.call(LE,e,t)));!e.buffer&&e.constructor===ArrayBuffer&&(e=typeof Buffer<"u"?Buffer.from(e):new Uint8Array(e)),typeof t=="object"?(Gl=t.end||e.length,Me=t.start||0):(Me=0,Gl=t>-1?t:e.length),Hl=0,Vu=null,mr=null,Gt=e;try{ei=e.dataView||(e.dataView=new DataView(e.buffer,e.byteOffset,e.byteLength))}catch(n){throw Gt=null,e instanceof Uint8Array?n:new Error("Source must be a Uint8Array or Buffer but was a "+(e&&typeof e=="object"?e.constructor.name:typeof e))}if(this instanceof Ju){if(Yi=this,this.structures)return ri=this.structures,cy(t);(!ri||ri.length>0)&&(ri=[])}else Yi=LE,(!ri||ri.length>0)&&(ri=[]);return cy(t)}unpackMultiple(e,t){let n,s=0;try{Xu=!0;let a=e.length,l=this?this.unpack(e,a):A_.unpack(e,a);if(t){if(t(l,s,Me)===!1)return;for(;Me<a;)if(s=Me,t(cy(),s,Me)===!1)return}else{for(n=[l];Me<a;)s=Me,n.push(cy());return n}}catch(a){throw a.lastPosition=s,a.values=n,a}finally{Xu=!1,Tx()}}_mergeStructures(e,t){e=e||[],Object.isFrozen(e)&&(e=e.map(n=>n.slice(0)));for(let n=0,s=e.length;n<s;n++){let a=e[n];a&&(a.isShared=!0,n>=32&&(a.highByte=n-32>>5))}e.sharedLength=e.length;for(let n in t||[])if(n>=0){let s=e[n],a=t[n];a&&(s&&((e.restoreStructures||(e.restoreStructures=[]))[n]=s),e[n]=a)}return this.structures=e}decode(e,t){return this.unpack(e,t)}}function cy(i){try{if(!Yi.trusted&&!Xu){let t=ri.sharedLength||0;t<ri.length&&(ri.length=t)}let e;if(Yi.randomAccessStructure&&Gt[Me]<64&&Gt[Me]>=32&&L5||(e=Hs()),mr&&(Me=mr.postBundlePosition,mr=null),Xu&&(ri.restoreStructures=null),Me==Gl)ri&&ri.restoreStructures&&PE(),ri=null,Gt=null,Oc&&(Oc=null);else{if(Me>Gl)throw new Error("Unexpected end of MessagePack data");if(!Xu){let t;try{t=JSON.stringify(e,(n,s)=>typeof s=="bigint"?`${s}n`:s).slice(0,100)}catch(n){t="(JSON view not available "+n+")"}throw new Error("Data read, but end of buffer not reached "+t)}}return e}catch(e){throw ri&&ri.restoreStructures&&PE(),Tx(),(e instanceof RangeError||e.message.startsWith("Unexpected end of buffer")||Me>Gl)&&(e.incomplete=!0),e}}function PE(){for(let i in ri.restoreStructures)ri[i]=ri.restoreStructures[i];ri.restoreStructures=null}function Hs(){let i=Gt[Me++];if(i<160)if(i<128){if(i<64)return i;{let e=ri[i&63]||Yi.getStructures&&WR()[i&63];return e?(e.read||(e.read=bA(e,i&63)),e.read()):i}}else if(i<144)if(i-=128,Yi.mapsAsObjects){let e={};for(let t=0;t<i;t++){let n=qR();n==="__proto__"&&(n="__proto_"),e[n]=Hs()}return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(Hs(),Hs());return e}else{i-=144;let e=new Array(i);for(let t=0;t<i;t++)e[t]=Hs();return Yi.freezeData?Object.freeze(e):e}else if(i<192){let e=i-160;if(Hl>=Me)return Vu.slice(Me-Io,(Me+=e)-Io);if(Hl==0&&Gl<140){let t=e<16?SA(e):XR(e);if(t!=null)return t}return k1(e)}else{let e;switch(i){case 192:return null;case 193:return mr?(e=Hs(),e>0?mr[1].slice(mr.position1,mr.position1+=e):mr[0].slice(mr.position0,mr.position0-=e)):_A;case 194:return!1;case 195:return!0;case 196:if(e=Gt[Me++],e===void 0)throw new Error("Unexpected end of buffer");return uS(e);case 197:return e=ei.getUint16(Me),Me+=2,uS(e);case 198:return e=ei.getUint32(Me),Me+=4,uS(e);case 199:return jf(Gt[Me++]);case 200:return e=ei.getUint16(Me),Me+=2,jf(e);case 201:return e=ei.getUint32(Me),Me+=4,jf(e);case 202:if(e=ei.getFloat32(Me),Yi.useFloat32>2){let t=S_[(Gt[Me]&127)<<1|Gt[Me+1]>>7];return Me+=4,(t*e+(e>0?.5:-.5)>>0)/t}return Me+=4,e;case 203:return e=ei.getFloat64(Me),Me+=8,e;case 204:return Gt[Me++];case 205:return e=ei.getUint16(Me),Me+=2,e;case 206:return e=ei.getUint32(Me),Me+=4,e;case 207:return Yi.int64AsType==="number"?(e=ei.getUint32(Me)*4294967296,e+=ei.getUint32(Me+4)):Yi.int64AsType==="string"?e=ei.getBigUint64(Me).toString():Yi.int64AsType==="auto"?(e=ei.getBigUint64(Me),e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=ei.getBigUint64(Me),Me+=8,e;case 208:return ei.getInt8(Me++);case 209:return e=ei.getInt16(Me),Me+=2,e;case 210:return e=ei.getInt32(Me),Me+=4,e;case 211:return Yi.int64AsType==="number"?(e=ei.getInt32(Me)*4294967296,e+=ei.getUint32(Me+4)):Yi.int64AsType==="string"?e=ei.getBigInt64(Me).toString():Yi.int64AsType==="auto"?(e=ei.getBigInt64(Me),e>=BigInt(-2)<<BigInt(52)&&e<=BigInt(2)<<BigInt(52)&&(e=Number(e))):e=ei.getBigInt64(Me),Me+=8,e;case 212:if(e=Gt[Me++],e==114)return kE(Gt[Me++]&63);{let t=ea[e];if(t)return t.read?(Me++,t.read(Hs())):t.noBuffer?(Me++,t()):t(Gt.subarray(Me,++Me));throw new Error("Unknown extension "+e)}case 213:return e=Gt[Me],e==114?(Me++,kE(Gt[Me++]&63,Gt[Me++])):jf(2);case 214:return jf(4);case 215:return jf(8);case 216:return jf(16);case 217:return e=Gt[Me++],Hl>=Me?Vu.slice(Me-Io,(Me+=e)-Io):O5(e);case 218:return e=ei.getUint16(Me),Me+=2,Hl>=Me?Vu.slice(Me-Io,(Me+=e)-Io):N5(e);case 219:return e=ei.getUint32(Me),Me+=4,Hl>=Me?Vu.slice(Me-Io,(Me+=e)-Io):U5(e);case 220:return e=ei.getUint16(Me),Me+=2,NE(e);case 221:return e=ei.getUint32(Me),Me+=4,NE(e);case 222:return e=ei.getUint16(Me),Me+=2,UE(e);case 223:return e=ei.getUint32(Me),Me+=4,UE(e);default:if(i>=224)return i-256;if(i===void 0){let t=new Error("Unexpected end of MessagePack data");throw t.incomplete=!0,t}throw new Error("Unknown MessagePack token "+i)}}}const P5=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function bA(i,e){function t(){if(t.count++>VR){let s=i.read=new Function("r","return function(){return "+(Yi.freezeData?"Object.freeze":"")+"({"+i.map(a=>a==="__proto__"?"__proto_:r()":P5.test(a)?a+":r()":"["+JSON.stringify(a)+"]:r()").join(",")+"})}")(Hs);return i.highByte===0&&(i.read=OE(e,i.read)),s()}let n={};for(let s=0,a=i.length;s<a;s++){let l=i[s];l==="__proto__"&&(l="__proto_"),n[l]=Hs()}return Yi.freezeData?Object.freeze(n):n}return t.count=0,i.highByte===0?OE(e,t):t}const OE=(i,e)=>function(){let t=Gt[Me++];if(t===0)return e();let n=i<32?-(i+(t<<5)):i+(t<<5),s=ri[n]||WR()[n];if(!s)throw new Error("Record id is not defined for "+n);return s.read||(s.read=bA(s,i)),s.read()};function WR(){let i=KR(()=>(Gt=null,Yi.getStructures()));return ri=Yi._mergeStructures(i,ri)}var k1=rg,O5=rg,N5=rg,U5=rg;let z5=!1;function rg(i){let e;if(i<16&&(e=SA(i)))return e;if(i>64&&F1)return F1.decode(Gt.subarray(Me,Me+=i));const t=Me+i,n=[];for(e="";Me<t;){const s=Gt[Me++];if((s&128)===0)n.push(s);else if((s&224)===192){const a=Gt[Me++]&63;n.push((s&31)<<6|a)}else if((s&240)===224){const a=Gt[Me++]&63,l=Gt[Me++]&63;n.push((s&31)<<12|a<<6|l)}else if((s&248)===240){const a=Gt[Me++]&63,l=Gt[Me++]&63,u=Gt[Me++]&63;let h=(s&7)<<18|a<<12|l<<6|u;h>65535&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|h&1023),n.push(h)}else n.push(s);n.length>=4096&&(e+=pr.apply(String,n),n.length=0)}return n.length>0&&(e+=pr.apply(String,n)),e}function NE(i){let e=new Array(i);for(let t=0;t<i;t++)e[t]=Hs();return Yi.freezeData?Object.freeze(e):e}function UE(i){if(Yi.mapsAsObjects){let e={};for(let t=0;t<i;t++){let n=qR();n==="__proto__"&&(n="__proto_"),e[n]=Hs()}return e}else{let e=new Map;for(let t=0;t<i;t++)e.set(Hs(),Hs());return e}}var pr=String.fromCharCode;function XR(i){let e=Me,t=new Array(i);for(let n=0;n<i;n++){const s=Gt[Me++];if((s&128)>0){Me=e;return}t[n]=s}return pr.apply(String,t)}function SA(i){if(i<4)if(i<2){if(i===0)return"";{let e=Gt[Me++];if((e&128)>1){Me-=1;return}return pr(e)}}else{let e=Gt[Me++],t=Gt[Me++];if((e&128)>0||(t&128)>0){Me-=2;return}if(i<3)return pr(e,t);let n=Gt[Me++];if((n&128)>0){Me-=3;return}return pr(e,t,n)}else{let e=Gt[Me++],t=Gt[Me++],n=Gt[Me++],s=Gt[Me++];if((e&128)>0||(t&128)>0||(n&128)>0||(s&128)>0){Me-=4;return}if(i<6){if(i===4)return pr(e,t,n,s);{let a=Gt[Me++];if((a&128)>0){Me-=5;return}return pr(e,t,n,s,a)}}else if(i<8){let a=Gt[Me++],l=Gt[Me++];if((a&128)>0||(l&128)>0){Me-=6;return}if(i<7)return pr(e,t,n,s,a,l);let u=Gt[Me++];if((u&128)>0){Me-=7;return}return pr(e,t,n,s,a,l,u)}else{let a=Gt[Me++],l=Gt[Me++],u=Gt[Me++],h=Gt[Me++];if((a&128)>0||(l&128)>0||(u&128)>0||(h&128)>0){Me-=8;return}if(i<10){if(i===8)return pr(e,t,n,s,a,l,u,h);{let p=Gt[Me++];if((p&128)>0){Me-=9;return}return pr(e,t,n,s,a,l,u,h,p)}}else if(i<12){let p=Gt[Me++],m=Gt[Me++];if((p&128)>0||(m&128)>0){Me-=10;return}if(i<11)return pr(e,t,n,s,a,l,u,h,p,m);let v=Gt[Me++];if((v&128)>0){Me-=11;return}return pr(e,t,n,s,a,l,u,h,p,m,v)}else{let p=Gt[Me++],m=Gt[Me++],v=Gt[Me++],x=Gt[Me++];if((p&128)>0||(m&128)>0||(v&128)>0||(x&128)>0){Me-=12;return}if(i<14){if(i===12)return pr(e,t,n,s,a,l,u,h,p,m,v,x);{let _=Gt[Me++];if((_&128)>0){Me-=13;return}return pr(e,t,n,s,a,l,u,h,p,m,v,x,_)}}else{let _=Gt[Me++],A=Gt[Me++];if((_&128)>0||(A&128)>0){Me-=14;return}if(i<15)return pr(e,t,n,s,a,l,u,h,p,m,v,x,_,A);let R=Gt[Me++];if((R&128)>0){Me-=15;return}return pr(e,t,n,s,a,l,u,h,p,m,v,x,_,A,R)}}}}}function zE(){let i=Gt[Me++],e;if(i<192)e=i-160;else switch(i){case 217:e=Gt[Me++];break;case 218:e=ei.getUint16(Me),Me+=2;break;case 219:e=ei.getUint32(Me),Me+=4;break;default:throw new Error("Expected string")}return rg(e)}function uS(i){return Yi.copyBuffers?Uint8Array.prototype.slice.call(Gt,Me,Me+=i):Gt.subarray(Me,Me+=i)}function jf(i){let e=Gt[Me++];if(ea[e]){let t;return ea[e](Gt.subarray(Me,t=Me+=i),n=>{Me=n;try{return Hs()}finally{Me=t}})}else throw new Error("Unknown extension type "+e)}var FE=new Array(4096);function qR(){let i=Gt[Me++];if(i>=160&&i<192){if(i=i-160,Hl>=Me)return Vu.slice(Me-Io,(Me+=i)-Io);if(!(Hl==0&&Gl<180))return k1(i)}else return Me--,YR(Hs());let e=(i<<5^(i>1?ei.getUint16(Me):i>0?Gt[Me]:0))&4095,t=FE[e],n=Me,s=Me+i-3,a,l=0;if(t&&t.bytes==i){for(;n<s;){if(a=ei.getUint32(n),a!=t[l++]){n=1879048192;break}n+=4}for(s+=3;n<s;)if(a=Gt[n++],a!=t[l++]){n=1879048192;break}if(n===s)return Me=n,t.string;s-=3,n=Me}for(t=[],FE[e]=t,t.bytes=i;n<s;)a=ei.getUint32(n),t.push(a),n+=4;for(s+=3;n<s;)a=Gt[n++],t.push(a);let u=i<16?SA(i):XR(i);return u!=null?t.string=u:t.string=k1(i)}function YR(i){if(typeof i=="string")return i;if(typeof i=="number"||typeof i=="boolean"||typeof i=="bigint")return i.toString();if(i==null)return i+"";if(Yi.allowArraysInMapKeys&&Array.isArray(i)&&i.flat().every(e=>["string","number","boolean","bigint"].includes(typeof e)))return i.flat().toString();throw new Error(`Invalid property type for record: ${typeof i}`)}const kE=(i,e)=>{let t=Hs().map(YR),n=i;e!==void 0&&(i=i<32?-((e<<5)+i):(e<<5)+i,t.highByte=e);let s=ri[i];return s&&(s.isShared||Xu)&&((ri.restoreStructures||(ri.restoreStructures=[]))[i]=s),ri[i]=t,t.read=bA(t,n),t.read()};ea[0]=()=>{};ea[0].noBuffer=!0;ea[66]=i=>{let e=i.length,t=BigInt(i[0]&128?i[0]-256:i[0]);for(let n=1;n<e;n++)t<<=BigInt(8),t+=BigInt(i[n]);return t};let F5={Error,TypeError,ReferenceError};ea[101]=()=>{let i=Hs();return(F5[i[0]]||Error)(i[1],{cause:i[2]})};ea[105]=i=>{if(Yi.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=ei.getUint32(Me-4);Oc||(Oc=new Map);let t=Gt[Me],n;t>=144&&t<160||t==220||t==221?n=[]:n={};let s={target:n};Oc.set(e,s);let a=Hs();return s.used?Object.assign(n,a):(s.target=a,a)};ea[112]=i=>{if(Yi.structuredClone===!1)throw new Error("Structured clone extension is disabled");let e=ei.getUint32(Me-4),t=Oc.get(e);return t.used=!0,t.target};ea[115]=()=>new Set(Hs());const JR=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(i=>i+"Array");let k5=typeof globalThis=="object"?globalThis:window;ea[116]=i=>{let e=i[0],t=JR[e];if(!t){if(e===16){let n=new ArrayBuffer(i.length-1);return new Uint8Array(n).set(i.subarray(1)),n}throw new Error("Could not find typed array for code "+e)}return new k5[t](Uint8Array.prototype.slice.call(i,1).buffer)};ea[120]=()=>{let i=Hs();return new RegExp(i[0],i[1])};const H5=[];ea[98]=i=>{let e=(i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3],t=Me;return Me+=e-i.length,mr=H5,mr=[zE(),zE()],mr.position0=0,mr.position1=0,mr.postBundlePosition=Me,Me=t,Hs()};ea[255]=i=>i.length==4?new Date((i[0]*16777216+(i[1]<<16)+(i[2]<<8)+i[3])*1e3):i.length==8?new Date(((i[0]<<22)+(i[1]<<14)+(i[2]<<6)+(i[3]>>2))/1e6+((i[3]&3)*4294967296+i[4]*16777216+(i[5]<<16)+(i[6]<<8)+i[7])*1e3):i.length==12?new Date(((i[0]<<24)+(i[1]<<16)+(i[2]<<8)+i[3])/1e6+((i[4]&128?-281474976710656:0)+i[6]*1099511627776+i[7]*4294967296+i[8]*16777216+(i[9]<<16)+(i[10]<<8)+i[11])*1e3):new Date("invalid");function KR(i){let e=Gl,t=Me,n=Io,s=Hl,a=Vu,l=Oc,u=mr,h=new Uint8Array(Gt.slice(0,Gl)),p=ri,m=ri.slice(0,ri.length),v=Yi,x=Xu,_=i();return Gl=e,Me=t,Io=n,Hl=s,Vu=a,Oc=l,mr=u,Gt=h,Xu=x,ri=p,ri.splice(0,ri.length,...m),Yi=v,ei=new DataView(Gt.buffer,Gt.byteOffset,Gt.byteLength),_}function Tx(){Gt=null,Oc=null,ri=null}function G5(i){i.unpack?ea[i.type]=i.unpack:ea[i.type]=i}const S_=new Array(147);for(let i=0;i<256;i++)S_[i]=+("1e"+Math.floor(45.15-i*.30103));const j5=Ju;var A_=new Ju({useRecords:!1});const V5=A_.unpack,W5=A_.unpackMultiple,X5=A_.unpack,ZR={NEVER:0,ALWAYS:1,DECIMAL_ROUND:3,DECIMAL_FIT:4};let QR=new Float32Array(1),HE=new Uint8Array(QR.buffer,0,4);function q5(i){QR[0]=i;let e=S_[(HE[3]&127)<<1|HE[2]>>7];return(e*i+(i>0?.5:-.5)>>0)/e}let vx;try{vx=new TextEncoder}catch{}let wx,AA;const M_=typeof Buffer<"u",uy=M_?function(i){return Buffer.allocUnsafeSlow(i)}:Uint8Array,$R=M_?Buffer:Uint8Array,GE=M_?4294967296:2144337920;let ke,o0,qi,Te=0,pa,Ss=null,Y5;const J5=21760,K5=/[\u0080-\uFFFF]/,Gh=Symbol("record-id");class ag extends Ju{constructor(e){super(e),this.offset=0;let t,n,s,a,l=$R.prototype.utf8Write?function(J,le){return ke.utf8Write(J,le,ke.byteLength-le)}:vx&&vx.encodeInto?function(J,le){return vx.encodeInto(J,ke.subarray(le)).written}:!1,u=this;e||(e={});let h=e&&e.sequential,p=e.structures||e.saveStructures,m=e.maxSharedStructures;if(m==null&&(m=p?32:0),m>8160)throw new Error("Maximum maxSharedStructure is 8160");e.structuredClone&&e.moreTypes==null&&(this.moreTypes=!0);let v=e.maxOwnStructures;v==null&&(v=p?32:64),!this.structures&&e.useRecords!=!1&&(this.structures=[]);let x=m>32||v+m>64,_=m+64,A=m+v+64;if(A>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let R=[],w=0,E=0;this.pack=this.encode=function(J,le){if(ke||(ke=new uy(8192),qi=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,8192)),Te=0),pa=ke.length-10,pa-Te<2048?(ke=new uy(ke.length),qi=ke.dataView||(ke.dataView=new DataView(ke.buffer,0,ke.length)),pa=ke.length-10,Te=0):Te=Te+7&2147483640,t=Te,le&iB&&(Te+=le&255),a=u.structuredClone?new Map:null,u.bundleStrings&&typeof J!="string"?(Ss=[],Ss.size=1/0):Ss=null,s=u.structures,s){s.uninitialized&&(s=u._mergeStructures(u.getStructures()));let W=s.sharedLength||0;if(W>m)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+s.sharedLength);if(!s.transitions){s.transitions=Object.create(null);for(let ee=0;ee<W;ee++){let te=s[ee];if(!te)continue;let ue,he=s.transitions;for(let K=0,ce=te.length;K<ce;K++){let re=te[K];ue=he[re],ue||(ue=he[re]=Object.create(null)),he=ue}he[Gh]=ee+64}this.lastNamedStructuresLength=W}h||(s.nextId=W+64)}n&&(n=!1);let ae;try{u.randomAccessStructure&&J&&J.constructor&&J.constructor===Object?ve(J):P(J);let W=Ss;if(Ss&&WE(t,P,0),a&&a.idsToInsert){let ee=a.idsToInsert.sort((K,ce)=>K.offset>ce.offset?1:-1),te=ee.length,ue=-1;for(;W&&te>0;){let K=ee[--te].offset+t;K<W.stringsPosition+t&&ue===-1&&(ue=0),K>W.position+t?ue>=0&&(ue+=6):(ue>=0&&(qi.setUint32(W.position+t,qi.getUint32(W.position+t)+ue),ue=-1),W=W.previous,te++)}ue>=0&&W&&qi.setUint32(W.position+t,qi.getUint32(W.position+t)+ue),Te+=ee.length*6,Te>pa&&z(Te),u.offset=Te;let he=Q5(ke.subarray(t,Te),ee);return a=null,he}return u.offset=Te,le&tB?(ke.start=t,ke.end=Te,ke):ke.subarray(t,Te)}catch(W){throw ae=W,W}finally{if(s&&(D(),n&&u.saveStructures)){let W=s.sharedLength||0,ee=ke.subarray(t,Te),te=eL(s,u);if(!ae)return u.saveStructures(te,te.isCompatible)===!1?u.pack(J,le):(u.lastNamedStructuresLength=W,ke.length>1073741824&&(ke=null),ee)}ke.length>1073741824&&(ke=null),le&nB&&(Te=t)}};const D=()=>{E<10&&E++;let J=s.sharedLength||0;if(s.length>J&&!h&&(s.length=J),w>1e4)s.transitions=null,E=0,w=0,R.length>0&&(R=[]);else if(R.length>0&&!h){for(let le=0,ae=R.length;le<ae;le++)R[le][Gh]=0;R=[]}},L=J=>{var le=J.length;le<16?ke[Te++]=144|le:le<65536?(ke[Te++]=220,ke[Te++]=le>>8,ke[Te++]=le&255):(ke[Te++]=221,qi.setUint32(Te,le),Te+=4);for(let ae=0;ae<le;ae++)P(J[ae])},P=J=>{Te>pa&&(ke=z(Te));var le=typeof J,ae;if(le==="string"){let W=J.length;if(Ss&&W>=4&&W<4096){if((Ss.size+=W)>J5){let he,K=(Ss[0]?Ss[0].length*3+Ss[1].length:0)+10;Te+K>pa&&(ke=z(Te+K));let ce;Ss.position?(ce=Ss,ke[Te]=200,Te+=3,ke[Te++]=98,he=Te-t,Te+=4,WE(t,P,0),qi.setUint16(he+t-3,Te-t-he)):(ke[Te++]=214,ke[Te++]=98,he=Te-t,Te+=4),Ss=["",""],Ss.previous=ce,Ss.size=0,Ss.position=he}let ue=K5.test(J);Ss[ue?0:1]+=J,ke[Te++]=193,P(ue?-W:W);return}let ee;W<32?ee=1:W<256?ee=2:W<65536?ee=3:ee=5;let te=W*3;if(Te+te>pa&&(ke=z(Te+te)),W<64||!l){let ue,he,K,ce=Te+ee;for(ue=0;ue<W;ue++)he=J.charCodeAt(ue),he<128?ke[ce++]=he:he<2048?(ke[ce++]=he>>6|192,ke[ce++]=he&63|128):(he&64512)===55296&&((K=J.charCodeAt(ue+1))&64512)===56320?(he=65536+((he&1023)<<10)+(K&1023),ue++,ke[ce++]=he>>18|240,ke[ce++]=he>>12&63|128,ke[ce++]=he>>6&63|128,ke[ce++]=he&63|128):(ke[ce++]=he>>12|224,ke[ce++]=he>>6&63|128,ke[ce++]=he&63|128);ae=ce-Te-ee}else ae=l(J,Te+ee);ae<32?ke[Te++]=160|ae:ae<256?(ee<2&&ke.copyWithin(Te+2,Te+1,Te+1+ae),ke[Te++]=217,ke[Te++]=ae):ae<65536?(ee<3&&ke.copyWithin(Te+3,Te+2,Te+2+ae),ke[Te++]=218,ke[Te++]=ae>>8,ke[Te++]=ae&255):(ee<5&&ke.copyWithin(Te+5,Te+3,Te+3+ae),ke[Te++]=219,qi.setUint32(Te,ae),Te+=4),Te+=ae}else if(le==="number")if(J>>>0===J)J<32||J<128&&this.useRecords===!1||J<64&&!this.randomAccessStructure?ke[Te++]=J:J<256?(ke[Te++]=204,ke[Te++]=J):J<65536?(ke[Te++]=205,ke[Te++]=J>>8,ke[Te++]=J&255):(ke[Te++]=206,qi.setUint32(Te,J),Te+=4);else if(J>>0===J)J>=-32?ke[Te++]=256+J:J>=-128?(ke[Te++]=208,ke[Te++]=J+256):J>=-32768?(ke[Te++]=209,qi.setInt16(Te,J),Te+=2):(ke[Te++]=210,qi.setInt32(Te,J),Te+=4);else{let W;if((W=this.useFloat32)>0&&J<4294967296&&J>=-2147483648){ke[Te++]=202,qi.setFloat32(Te,J);let ee;if(W<4||(ee=J*S_[(ke[Te]&127)<<1|ke[Te+1]>>7])>>0===ee){Te+=4;return}else Te--}ke[Te++]=203,qi.setFloat64(Te,J),Te+=8}else if(le==="object"||le==="function")if(!J)ke[Te++]=192;else{if(a){let ee=a.get(J);if(ee){if(!ee.id){let te=a.idsToInsert||(a.idsToInsert=[]);ee.id=te.push(ee)}ke[Te++]=214,ke[Te++]=112,qi.setUint32(Te,ee.id),Te+=4;return}else a.set(J,{offset:Te-t})}let W=J.constructor;if(W===Object)X(J);else if(W===Array)L(J);else if(W===Map)if(this.mapAsEmptyObject)ke[Te++]=128;else{ae=J.size,ae<16?ke[Te++]=128|ae:ae<65536?(ke[Te++]=222,ke[Te++]=ae>>8,ke[Te++]=ae&255):(ke[Te++]=223,qi.setUint32(Te,ae),Te+=4);for(let[ee,te]of J)P(ee),P(te)}else{for(let ee=0,te=wx.length;ee<te;ee++){let ue=AA[ee];if(J instanceof ue){let he=wx[ee];if(he.write){he.type&&(ke[Te++]=212,ke[Te++]=he.type,ke[Te++]=0);let we=he.write.call(this,J);we===J?Array.isArray(J)?L(J):X(J):P(we);return}let K=ke,ce=qi,re=Te;ke=null;let oe;try{oe=he.pack.call(this,J,we=>(ke=K,K=null,Te+=we,Te>pa&&z(Te),{target:ke,targetView:qi,position:Te-we}),P)}finally{K&&(ke=K,qi=ce,Te=re,pa=ke.length-10)}oe&&(oe.length+Te>pa&&z(oe.length+Te),Te=Z5(oe,ke,Te,he.type));return}}if(Array.isArray(J))L(J);else{if(J.toJSON){const ee=J.toJSON();if(ee!==J)return P(ee)}if(le==="function")return P(this.writeFunction&&this.writeFunction(J));X(J)}}}else if(le==="boolean")ke[Te++]=J?195:194;else if(le==="bigint"){if(J<BigInt(1)<<BigInt(63)&&J>=-(BigInt(1)<<BigInt(63)))ke[Te++]=211,qi.setBigInt64(Te,J);else if(J<BigInt(1)<<BigInt(64)&&J>0)ke[Te++]=207,qi.setBigUint64(Te,J);else if(this.largeBigIntToFloat)ke[Te++]=203,qi.setFloat64(Te,Number(J));else{if(this.largeBigIntToString)return P(J.toString());if(this.useBigIntExtension&&J<BigInt(2)**BigInt(1023)&&J>-(BigInt(2)**BigInt(1023))){ke[Te++]=199,Te++,ke[Te++]=66;let W=[],ee;do{let te=J&BigInt(255);ee=(te&BigInt(128))===(J<BigInt(0)?BigInt(128):BigInt(0)),W.push(te),J>>=BigInt(8)}while(!((J===BigInt(0)||J===BigInt(-1))&&ee));ke[Te-2]=W.length;for(let te=W.length;te>0;)ke[Te++]=Number(W[--te]);return}else throw new RangeError(J+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}Te+=8}else if(le==="undefined")this.encodeUndefinedAsNil?ke[Te++]=192:(ke[Te++]=212,ke[Te++]=0,ke[Te++]=0);else throw new Error("Unknown type: "+le)},G=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?J=>{let le;if(this.skipValues){le=[];for(let ee in J)(typeof J.hasOwnProperty!="function"||J.hasOwnProperty(ee))&&!this.skipValues.includes(J[ee])&&le.push(ee)}else le=Object.keys(J);let ae=le.length;ae<16?ke[Te++]=128|ae:ae<65536?(ke[Te++]=222,ke[Te++]=ae>>8,ke[Te++]=ae&255):(ke[Te++]=223,qi.setUint32(Te,ae),Te+=4);let W;if(this.coercibleKeyAsNumber)for(let ee=0;ee<ae;ee++){W=le[ee];let te=Number(W);P(isNaN(te)?W:te),P(J[W])}else for(let ee=0;ee<ae;ee++)P(W=le[ee]),P(J[W])}:J=>{ke[Te++]=222;let le=Te-t;Te+=2;let ae=0;for(let W in J)(typeof J.hasOwnProperty!="function"||J.hasOwnProperty(W))&&(P(W),P(J[W]),ae++);if(ae>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');ke[le+++t]=ae>>8,ke[le+t]=ae&255},H=this.useRecords===!1?G:e.progressiveRecords&&!x?J=>{let le,ae=s.transitions||(s.transitions=Object.create(null)),W=Te++-t,ee;for(let te in J)if(typeof J.hasOwnProperty!="function"||J.hasOwnProperty(te)){if(le=ae[te],le)ae=le;else{let ue=Object.keys(J),he=ae;ae=s.transitions;let K=0;for(let ce=0,re=ue.length;ce<re;ce++){let oe=ue[ce];le=ae[oe],le||(le=ae[oe]=Object.create(null),K++),ae=le}W+t+1==Te?(Te--,k(ae,ue,K)):ie(ae,ue,W,K),ee=!0,ae=he[te]}P(J[te])}if(!ee){let te=ae[Gh];te?ke[W+t]=te:ie(ae,Object.keys(J),W,0)}}:J=>{let le,ae=s.transitions||(s.transitions=Object.create(null)),W=0;for(let te in J)(typeof J.hasOwnProperty!="function"||J.hasOwnProperty(te))&&(le=ae[te],le||(le=ae[te]=Object.create(null),W++),ae=le);let ee=ae[Gh];ee?ee>=96&&x?(ke[Te++]=((ee-=96)&31)+96,ke[Te++]=ee>>5):ke[Te++]=ee:k(ae,ae.__keys__||Object.keys(J),W);for(let te in J)(typeof J.hasOwnProperty!="function"||J.hasOwnProperty(te))&&P(J[te])},F=typeof this.useRecords=="function"&&this.useRecords,X=F?J=>{F(J)?H(J):G(J)}:H,z=J=>{let le;if(J>16777216){if(J-t>GE)throw new Error("Packed buffer would be larger than maximum buffer size");le=Math.min(GE,Math.round(Math.max((J-t)*(J>67108864?1.25:2),4194304)/4096)*4096)}else le=(Math.max(J-t<<2,ke.length-1)>>12)+1<<12;let ae=new uy(le);return qi=ae.dataView||(ae.dataView=new DataView(ae.buffer,0,le)),J=Math.min(J,ke.length),ke.copy?ke.copy(ae,0,t,J):ae.set(ke.slice(t,J)),Te-=t,t=0,pa=ae.length-10,ke=ae},k=(J,le,ae)=>{let W=s.nextId;W||(W=64),W<_&&this.shouldShareStructure&&!this.shouldShareStructure(le)?(W=s.nextOwnId,W<A||(W=_),s.nextOwnId=W+1):(W>=A&&(W=_),s.nextId=W+1);let ee=le.highByte=W>=96&&x?W-96>>5:-1;J[Gh]=W,J.__keys__=le,s[W-64]=le,W<_?(le.isShared=!0,s.sharedLength=W-63,n=!0,ee>=0?(ke[Te++]=(W&31)+96,ke[Te++]=ee):ke[Te++]=W):(ee>=0?(ke[Te++]=213,ke[Te++]=114,ke[Te++]=(W&31)+96,ke[Te++]=ee):(ke[Te++]=212,ke[Te++]=114,ke[Te++]=W),ae&&(w+=E*ae),R.length>=v&&(R.shift()[Gh]=0),R.push(J),P(le))},ie=(J,le,ae,W)=>{let ee=ke,te=Te,ue=pa,he=t;ke=o0,Te=0,t=0,ke||(o0=ke=new uy(8192)),pa=ke.length-10,k(J,le,W),o0=ke;let K=Te;if(ke=ee,Te=te,pa=ue,t=he,K>1){let ce=Te+K-1;ce>pa&&z(ce);let re=ae+t;ke.copyWithin(re+K,re+1,Te),ke.set(o0.slice(0,K),re),Te=ce}else ke[ae+t]=o0[0]},ve=J=>{let le=Y5(J,ke,t,Te,s,z,(ae,W,ee)=>{if(ee)return n=!0;Te=W;let te=ke;return P(ae),D(),te!==ke?{position:Te,targetView:qi,target:ke}:Te},this);if(le===0)return X(J);Te=le}}useBuffer(e){ke=e,ke.dataView||(ke.dataView=new DataView(ke.buffer,ke.byteOffset,ke.byteLength)),Te=0}set position(e){Te=e}get position(){return Te}set buffer(e){ke=e}get buffer(){return ke}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}AA=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,jR];wx=[{pack(i,e,t){let n=i.getTime()/1e3;if((this.useTimestamp32||i.getMilliseconds()===0)&&n>=0&&n<4294967296){let{target:s,targetView:a,position:l}=e(6);s[l++]=214,s[l++]=255,a.setUint32(l,n)}else if(n>0&&n<4294967296){let{target:s,targetView:a,position:l}=e(10);s[l++]=215,s[l++]=255,a.setUint32(l,i.getMilliseconds()*4e6+(n/1e3/4294967296>>0)),a.setUint32(l+4,n)}else if(isNaN(n)){if(this.onInvalidDate)return e(0),t(this.onInvalidDate());let{target:s,targetView:a,position:l}=e(3);s[l++]=212,s[l++]=255,s[l++]=255}else{let{target:s,targetView:a,position:l}=e(15);s[l++]=199,s[l++]=12,s[l++]=255,a.setUint32(l,i.getMilliseconds()*1e6),a.setBigInt64(l+4,BigInt(Math.floor(n)))}}},{pack(i,e,t){if(this.setAsEmptyObject)return e(0),t({});let n=Array.from(i),{target:s,position:a}=e(this.moreTypes?3:0);this.moreTypes&&(s[a++]=212,s[a++]=115,s[a++]=0),t(n)}},{pack(i,e,t){let{target:n,position:s}=e(this.moreTypes?3:0);this.moreTypes&&(n[s++]=212,n[s++]=101,n[s++]=0),t([i.name,i.message,i.cause])}},{pack(i,e,t){let{target:n,position:s}=e(this.moreTypes?3:0);this.moreTypes&&(n[s++]=212,n[s++]=120,n[s++]=0),t([i.source,i.flags])}},{pack(i,e){this.moreTypes?jE(i,16,e):VE(M_?Buffer.from(i):new Uint8Array(i),e)}},{pack(i,e){let t=i.constructor;t!==$R&&this.moreTypes?jE(i,JR.indexOf(t.name),e):VE(i,e)}},{pack(i,e){let{target:t,position:n}=e(1);t[n]=193}}];function jE(i,e,t,n){let s=i.byteLength;if(s+1<256){var{target:a,position:l}=t(4+s);a[l++]=199,a[l++]=s+1}else if(s+1<65536){var{target:a,position:l}=t(5+s);a[l++]=200,a[l++]=s+1>>8,a[l++]=s+1&255}else{var{target:a,position:l,targetView:u}=t(7+s);a[l++]=201,u.setUint32(l,s+1),l+=4}a[l++]=116,a[l++]=e,i.buffer||(i=new Uint8Array(i)),a.set(new Uint8Array(i.buffer,i.byteOffset,i.byteLength),l)}function VE(i,e){let t=i.byteLength;var n,s;if(t<256){var{target:n,position:s}=e(t+2);n[s++]=196,n[s++]=t}else if(t<65536){var{target:n,position:s}=e(t+3);n[s++]=197,n[s++]=t>>8,n[s++]=t&255}else{var{target:n,position:s,targetView:a}=e(t+5);n[s++]=198,a.setUint32(s,t),s+=4}n.set(i,s)}function Z5(i,e,t,n){let s=i.length;switch(s){case 1:e[t++]=212;break;case 2:e[t++]=213;break;case 4:e[t++]=214;break;case 8:e[t++]=215;break;case 16:e[t++]=216;break;default:s<256?(e[t++]=199,e[t++]=s):s<65536?(e[t++]=200,e[t++]=s>>8,e[t++]=s&255):(e[t++]=201,e[t++]=s>>24,e[t++]=s>>16&255,e[t++]=s>>8&255,e[t++]=s&255)}return e[t++]=n,e.set(i,t),t+=s,t}function Q5(i,e){let t,n=e.length*6,s=i.length-n;for(;t=e.pop();){let a=t.offset,l=t.id;i.copyWithin(a+n,a,s),n-=6;let u=a+n;
73i[u++]=214,i[u++]=105,i[u++]=l>>24,i[u++]=l>>16&255,i[u++]=l>>8&255,i[u++]=l&255,s=a}return i}function WE(i,e,t){if(Ss.length>0){qi.setUint32(Ss.position+i,Te+t-Ss.position-i),Ss.stringsPosition=Te-i;let n=Ss;Ss=null,e(n[0]),e(n[1])}}function $5(i){if(i.Class){if(!i.pack&&!i.write)throw new Error("Extension has no pack or write function");if(i.pack&&!i.type)throw new Error("Extension has no type (numeric code to identify the extension)");AA.unshift(i.Class),wx.unshift(i)}G5(i)}function eL(i,e){return i.isCompatible=t=>{let n=!t||(e.lastNamedStructuresLength||0)===t.length;return n||e._mergeStructures(t),n},i}let eB=new ag({useRecords:!1});const tL=eB.pack,nL=eB.pack,iL=ag,{NEVER:sL,ALWAYS:rL,DECIMAL_ROUND:aL,DECIMAL_FIT:oL}=ZR,tB=512,nB=1024,iB=2048;function lL(i,e={}){if(!i||typeof i!="object")throw new Error("first argument must be an Iterable, Async Iterable, or a Promise for an Async Iterable");if(typeof i[Symbol.iterator]=="function")return cL(i,e);if(typeof i.then=="function"||typeof i[Symbol.asyncIterator]=="function")return uL(i,e);throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a Promise")}function*cL(i,e){const t=new ag(e);for(const n of i)yield t.pack(n)}async function*uL(i,e){const t=new ag(e);for await(const n of i)yield t.pack(n)}function fL(i,e={}){if(!i||typeof i!="object")throw new Error("first argument must be an Iterable, Async Iterable, Iterator, Async Iterator, or a promise");const t=new Ju(e);let n;const s=a=>{let l;n&&(a=Buffer.concat([n,a]),n=void 0);try{l=t.unpackMultiple(a)}catch(u){if(u.incomplete)n=a.slice(u.lastPosition),l=u.values;else throw u}return l};if(typeof i[Symbol.iterator]=="function")return(function*(){for(const l of i)yield*s(l)})();if(typeof i[Symbol.asyncIterator]=="function")return(async function*(){for await(const l of i)yield*s(l)})()}const dL=fL,hL=lL,pL=!1,mL=!0,gL=Object.freeze(Object.defineProperty({__proto__:null,ALWAYS:rL,C1:_A,DECIMAL_FIT:oL,DECIMAL_ROUND:aL,Decoder:j5,Encoder:iL,FLOAT32_OPTIONS:ZR,NEVER:sL,Packr:ag,RESERVE_START_SPACE:iB,RESET_BUFFER_MODE:nB,REUSE_BUFFER_MODE:tB,Unpackr:Ju,addExtension:$5,clearSource:Tx,decode:X5,decodeIter:dL,encode:nL,encodeIter:hL,isNativeAccelerationEnabled:z5,mapsAsObjects:mL,pack:tL,roundFloat32:q5,unpack:V5,unpackMultiple:W5,useRecords:pL},Symbol.toStringTag,{value:"Module"})),vL=gA(gL);var XE;function rB(){if(XE)return iS;XE=1;var i=I5(),e=FR(),t=kR(),n=HR(),s=D5(),a=xA(),l=GR(),u=b_(),h=vL;let p=class sB{constructor(v,x){this.onStateChange=s.createSignal(),this.onError=s.createSignal(),this.onLeave=s.createSignal(),this.onJoin=s.createSignal(),this.hasJoined=!1,this.onMessageHandlers=n.createNanoEvents(),this.roomId=null,this.name=v,this.packr=new h.Packr,this.packr.encode(void 0),x&&(this.serializer=new(t.getSerializer("schema")),this.rootSchema=x,this.serializer.state=new x),this.onError((_,A)=>{var R;return(R=console.warn)===null||R===void 0?void 0:R.call(console,`colyseus.js - onError => (${_}) ${A}`)}),this.onLeave(()=>this.removeAllListeners())}connect(v,x,_=this,A,R){const w=new i.Connection(A.protocol);if(_.connection=w,w.events.onmessage=sB.prototype.onMessageCallback.bind(_),w.events.onclose=function(E){var D;if(!_.hasJoined){(D=console.warn)===null||D===void 0||D.call(console,`Room connection was closed unexpectedly (${E.code}): ${E.reason}`),_.onError.invoke(E.code,E.reason);return}E.code===u.CloseCode.DEVMODE_RESTART&&x?x():(_.onLeave.invoke(E.code,E.reason),_.destroy())},w.events.onerror=function(E){var D;(D=console.warn)===null||D===void 0||D.call(console,`Room, onError (${E.code}): ${E.reason}`),_.onError.invoke(E.code,E.reason)},A.protocol==="h3"){const E=new URL(v);w.connect(E.origin,A)}else w.connect(v,R)}leave(v=!0){return new Promise(x=>{this.onLeave(_=>x(_)),this.connection?v?(this.packr.buffer[0]=e.Protocol.LEAVE_ROOM,this.connection.send(this.packr.buffer.subarray(0,1))):this.connection.close():this.onLeave.invoke(u.CloseCode.CONSENTED)})}onMessage(v,x){return this.onMessageHandlers.on(this.getMessageHandlerKey(v),x)}send(v,x){const _={offset:1};this.packr.buffer[0]=e.Protocol.ROOM_DATA,typeof v=="string"?a.encode.string(this.packr.buffer,v,_):a.encode.number(this.packr.buffer,v,_),this.packr.position=0;const A=x!==void 0?this.packr.pack(x,2048+_.offset):this.packr.buffer.subarray(0,_.offset);this.connection.send(A)}sendUnreliable(v,x){const _={offset:1};this.packr.buffer[0]=e.Protocol.ROOM_DATA,typeof v=="string"?a.encode.string(this.packr.buffer,v,_):a.encode.number(this.packr.buffer,v,_),this.packr.position=0;const A=x!==void 0?this.packr.pack(x,2048+_.offset):this.packr.buffer.subarray(0,_.offset);this.connection.sendUnreliable(A)}sendBytes(v,x){const _={offset:1};if(this.packr.buffer[0]=e.Protocol.ROOM_DATA_BYTES,typeof v=="string"?a.encode.string(this.packr.buffer,v,_):a.encode.number(this.packr.buffer,v,_),x.byteLength+_.offset>this.packr.buffer.byteLength){const A=new Uint8Array(_.offset+x.byteLength);A.set(this.packr.buffer),this.packr.useBuffer(A)}this.packr.buffer.set(x,_.offset),this.connection.send(this.packr.buffer.subarray(0,_.offset+x.byteLength))}get state(){return this.serializer.getState()}removeAllListeners(){this.onJoin.clear(),this.onStateChange.clear(),this.onError.clear(),this.onLeave.clear(),this.onMessageHandlers.events={},this.serializer instanceof l.SchemaSerializer&&(this.serializer.decoder.root.callbacks={})}onMessageCallback(v){const x=new Uint8Array(v.data),_={offset:1},A=x[0];if(A===e.Protocol.JOIN_ROOM){const R=a.decode.utf8Read(x,_,x[_.offset++]);if(this.serializerId=a.decode.utf8Read(x,_,x[_.offset++]),!this.serializer){const w=t.getSerializer(this.serializerId);
73this.serializer=new w}x.byteLength>_.offset&&this.serializer.handshake&&this.serializer.handshake(x,_),this.reconnectionToken=`${this.roomId}:${R}`,this.hasJoined=!0,this.onJoin.invoke(),this.packr.buffer[0]=e.Protocol.JOIN_ROOM,this.connection.send(this.packr.buffer.subarray(0,1))}else if(A===e.Protocol.ERROR){const R=a.decode.number(x,_),w=a.decode.string(x,_);this.onError.invoke(R,w)}else if(A===e.Protocol.LEAVE_ROOM)this.leave();else if(A===e.Protocol.ROOM_STATE)this.serializer.setState(x,_),this.onStateChange.invoke(this.serializer.getState());else if(A===e.Protocol.ROOM_STATE_PATCH)this.serializer.patch(x,_),this.onStateChange.invoke(this.serializer.getState());else if(A===e.Protocol.ROOM_DATA){const R=a.decode.stringCheck(x,_)?a.decode.string(x,_):a.decode.number(x,_),w=x.byteLength>_.offset?h.unpack(x,{start:_.offset}):void 0;this.dispatchMessage(R,w)}else if(A===e.Protocol.ROOM_DATA_BYTES){const R=a.decode.stringCheck(x,_)?a.decode.string(x,_):a.decode.number(x,_);this.dispatchMessage(R,x.subarray(_.offset))}}dispatchMessage(v,x){var _;const A=this.getMessageHandlerKey(v);this.onMessageHandlers.events[A]?this.onMessageHandlers.emit(A,x):this.onMessageHandlers.events["*"]?this.onMessageHandlers.emit("*",v,x):(_=console.warn)===null||_===void 0||_.call(console,`colyseus.js: onMessage() not registered for type '${v}'.`)}destroy(){this.serializer&&this.serializer.teardown()}getMessageHandlerKey(v){switch(typeof v){case"string":return v;case"number":return`i${v}`;default:throw new Error("invalid message type.")}}};return iS.Room=p,iS}var fS={};function qE(i,e){e.headers=i.headers||{},e.statusMessage=i.statusText,e.statusCode=i.status,e.data=i.response}function ll(i,e,t){return new Promise(function(n,s){t=t||{};var a=new XMLHttpRequest,l,u,h,p=t.body,m=t.headers||{};t.timeout&&(a.timeout=t.timeout),a.ontimeout=a.onerror=function(v){v.timeout=v.type=="timeout",s(v)},a.onabort=function(v){v.aborted=!0,s(v)},a.open(i,e.href||e),a.onload=function(){for(h=a.getAllResponseHeaders().trim().split(/[\r\n]+/),qE(a,a);u=h.shift();)u=u.split(": "),a.headers[u.shift().toLowerCase()]=u.join(": ");if(u=a.headers["content-type"],u&&~u.indexOf("application/json"))try{a.data=JSON.parse(a.data,t.reviver)}catch(v){return qE(a,v),s(v)}(a.status>=400?s:n)(a)},typeof FormData<"u"&&p instanceof FormData||p&&typeof p=="object"&&(m["content-type"]="application/json",p=JSON.stringify(p)),a.withCredentials=!!t.withCredentials;for(l in m)a.setRequestHeader(l,m[l]);a.send(p),t.signal&&t.signal.addEventListener("abort",function(){a.abort()})})}var yL=ll.bind(ll,"GET"),xL=ll.bind(ll,"POST"),_L=ll.bind(ll,"PATCH"),bL=ll.bind(ll,"DELETE"),SL=ll.bind(ll,"PUT");const AL=Object.freeze(Object.defineProperty({__proto__:null,del:bL,get:yL,patch:_L,post:xL,put:SL,send:ll},Symbol.toStringTag,{value:"Module"})),ML=gA(AL);var YE;function EL(){if(YE)return fS;YE=1;var i=b_(),e=ML;function t(a){var l=Object.create(null);return a&&Object.keys(a).forEach(function(u){if(u!=="default"){var h=Object.getOwnPropertyDescriptor(a,u);Object.defineProperty(l,u,h.get?h:{enumerable:!0,get:function(){return a[u]}})}}),l.default=a,Object.freeze(l)}var n=t(e);let s=class{constructor(l,u={}){this.client=l,this.headers=u}get(l,u={}){return this.request("get",l,u)}post(l,u={}){return this.request("post",l,u)}del(l,u={}){return this.request("del",l,u)}put(l,u={}){return this.request("put",l,u)}request(l,u,h={}){return n[l](this.client.getHttpEndpoint(u),this.getOptions(h)).catch(p=>{var m;if(p.aborted)throw new i.AbortError("Request aborted");const v=p.statusCode,x=((m=p.data)===null||m===void 0?void 0:m.error)||p.statusMessage||p.message;throw!v&&!x?p:new i.ServerError(v,x)})}getOptions(l){return l.headers=Object.assign({},this.headers,l.headers),this.authToken&&(l.headers.Authorization=`Bearer ${this.authToken}`),typeof cc<"u"&&cc.sys&&cc.sys.isNative||(l.withCredentials=!0),l}};return fS.HTTP=s,fS}var dS={},l0={},JE;function TL(){if(JE)return l0;JE=1;var i=__;let e;function t(){if(!e)try{e=typeof cc<"u"&&cc.sys&&cc.sys.localStorage?cc.sys.localStorage:window.localStorage}catch{}return!e&&typeof globalThis.indexedDB<"u"&&(e=new l),e||(e={cache:{},setItem:function(u,h){this.cache[u]=h},getItem:function(u){this.cache[u]},removeItem:function(u){delete this.cache[u]}}),e}function n(u,h){t().setItem(u,h)}function s(u){t().removeItem(u)}function a(u,h){const p=t().getItem(u);typeof Promise>"u"||!(p instanceof Promise)?h(p):p.then(m=>h(m))}class l{constructor(){this.dbPromise=new Promise(h=>{const p=indexedDB.open("_colyseus_storage",1);p.onupgradeneeded=()=>p.result.createObjectStore("store"),p.onsuccess=()=>h(p.result)})}tx(h,p){return i.__awaiter(this,void 0,void 0,function*(){const v=(yield this.dbPromise).transaction("store",h).objectStore("store");return p(v)})}setItem(h,p){return this.tx("readwrite",m=>m.put(p,h)).then()}getItem(h){return i.__awaiter(this,void 0,void 0,function*(){const p=yield this.tx("readonly",m=>m.get(h));return new Promise(m=>{p.onsuccess=()=>m(p.result)})})}removeItem(h){return this.tx("readwrite",p=>p.delete(h)).then()}}return l0.getItem=a,l0.removeItem=s,l0.setItem=n,l0}var KE;function aB(){if(KE)return dS;KE=1;var i=__,e=TL(),t=HR(),n,s,a,l;let u=class{constructor(p){this.http=p,this.settings={path:"/auth",key:"colyseus-auth-token"},n.set(this,!1),s.set(this,void 0),a.set(this,void 0),l.set(this,t.createNanoEvents()),e.getItem(this.settings.key,m=>this.token=m)}set token(p){this.http.authToken=p}get token(){return this.http.authToken}onChange(p){const m=i.__classPrivateFieldGet(this,l,"f").on("change",p);return i.__classPrivateFieldGet(this,n,"f")||i.__classPrivateFieldSet(this,s,new Promise((v,x)=>{this.getUserData().then(_=>{this.emitChange(Object.assign(Object.assign({},_),{token:this.token}
73))}).catch(_=>{this.emitChange({user:null,token:void 0})}).finally(()=>{v()})}),"f"),i.__classPrivateFieldSet(this,n,!0,"f"),m}getUserData(){return i.__awaiter(this,void 0,void 0,function*(){if(this.token)return(yield this.http.get(`${this.settings.path}/userdata`)).data;throw new Error("missing auth.token")})}registerWithEmailAndPassword(p,m,v){return i.__awaiter(this,void 0,void 0,function*(){const x=(yield this.http.post(`${this.settings.path}/register`,{body:{email:p,password:m,options:v}})).data;return this.emitChange(x),x})}signInWithEmailAndPassword(p,m){return i.__awaiter(this,void 0,void 0,function*(){const v=(yield this.http.post(`${this.settings.path}/login`,{body:{email:p,password:m}})).data;return this.emitChange(v),v})}signInAnonymously(p){return i.__awaiter(this,void 0,void 0,function*(){const m=(yield this.http.post(`${this.settings.path}/anonymous`,{body:{options:p}})).data;return this.emitChange(m),m})}sendPasswordResetEmail(p){return i.__awaiter(this,void 0,void 0,function*(){return(yield this.http.post(`${this.settings.path}/forgot-password`,{body:{email:p}})).data})}signInWithProvider(p){return i.__awaiter(this,arguments,void 0,function*(m,v={}){return new Promise((x,_)=>{const A=v.width||480,R=v.height||768,w=this.token?`?token=${this.token}`:"",E=`Login with ${m[0].toUpperCase()+m.substring(1)}`,D=this.http.client.getHttpEndpoint(`${v.prefix||`${this.settings.path}/provider`}/${m}${w}`),L=screen.width/2-A/2,P=screen.height/2-R/2;i.__classPrivateFieldSet(this,a,window.open(D,E,"toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no, width="+A+", height="+R+", top="+P+", left="+L),"f");const G=F=>{F.data.user===void 0&&F.data.token===void 0||(clearInterval(H),i.__classPrivateFieldGet(this,a,"f").close(),i.__classPrivateFieldSet(this,a,void 0,"f"),window.removeEventListener("message",G),F.data.error!==void 0?_(F.data.error):(x(F.data),this.emitChange(F.data)))},H=setInterval(()=>{(!i.__classPrivateFieldGet(this,a,"f")||i.__classPrivateFieldGet(this,a,"f").closed)&&(i.__classPrivateFieldSet(this,a,void 0,"f"),_("cancelled"),window.removeEventListener("message",G))},200);window.addEventListener("message",G)})})}signOut(){return i.__awaiter(this,void 0,void 0,function*(){this.emitChange({user:null,token:null})})}emitChange(p){p.token!==void 0&&(this.token=p.token,p.token===null?e.removeItem(this.settings.key):e.setItem(this.settings.key,p.token)),i.__classPrivateFieldGet(this,l,"f").emit("change",p)}};return n=new WeakMap,s=new WeakMap,a=new WeakMap,l=new WeakMap,dS.Auth=u,dS}var hS={},ZE;function wL(){if(ZE)return hS;ZE=1;function i(e){var t;const n=((t=window?.location)===null||t===void 0?void 0:t.hostname)||"localhost",s=e.hostname.split("."),a=!e.hostname.includes("trycloudflare.com")&&!e.hostname.includes("discordsays.com")&&s.length>2?`/${s[0]}`:"";return e.pathname.startsWith("/.proxy")?`${e.protocol}//${n}${a}${e.pathname}${e.search}`:`${e.protocol}//${n}/.proxy/colyseus${a}${e.pathname}${e.search}`}return hS.discordURLBuilder=i,hS}var QE;function CL(){if(QE)return ry;QE=1;var i=__,e=b_(),t=rB(),n=EL(),s=aB(),a=wL(),l;class u extends Error{constructor(v,x){super(v),this.code=x,this.name="MatchMakeError",Object.setPrototypeOf(this,u.prototype)}}const h=typeof window<"u"&&typeof((l=window?.location)===null||l===void 0?void 0:l.hostname)<"u"?`${window.location.protocol.replace("http","ws")}//${window.location.hostname}${window.location.port&&`:${window.location.port}`}`:"ws://127.0.0.1:2567";let p=class{constructor(v=h,x){var _,A;if(typeof v=="string"){const R=v.startsWith("/")?new URL(v,h):new URL(v),w=R.protocol==="https:"||R.protocol==="wss:",E=Number(R.port||(w?443:80));this.settings={hostname:R.hostname,pathname:R.pathname,port:E,secure:w,searchParams:R.searchParams.toString()||void 0}}else v.port===void 0&&(v.port=v.secure?443:80),v.pathname===void 0&&(v.pathname=""),this.settings=v;this.settings.pathname.endsWith("/")&&(this.settings.pathname=this.settings.pathname.slice(0,-1)),this.http=new n.HTTP(this,x?.headers||{}),this.auth=new s.Auth(this.http),this.urlBuilder=x?.urlBuilder,!this.urlBuilder&&typeof window<"u"&&(!((A=(_=window?.location)===null||_===void 0?void 0:_.hostname)===null||A===void 0)&&A.includes("discordsays.com"))&&(this.urlBuilder=a.discordURLBuilder,console.log("Colyseus SDK: Discord Embedded SDK detected. Using custom URL builder."))}joinOrCreate(v){return i.__awaiter(this,arguments,void 0,function*(x,_={}
73,A){return yield this.createMatchMakeRequest("joinOrCreate",x,_,A)})}create(v){return i.__awaiter(this,arguments,void 0,function*(x,_={},A){return yield this.createMatchMakeRequest("create",x,_,A)})}join(v){return i.__awaiter(this,arguments,void 0,function*(x,_={},A){return yield this.createMatchMakeRequest("join",x,_,A)})}joinById(v){return i.__awaiter(this,arguments,void 0,function*(x,_={},A){return yield this.createMatchMakeRequest("joinById",x,_,A)})}reconnect(v,x){return i.__awaiter(this,void 0,void 0,function*(){if(typeof v=="string"&&typeof x=="string")throw new Error("DEPRECATED: .reconnect() now only accepts 'reconnectionToken' as argument.\nYou can get this token from previously connected `room.reconnectionToken`");const[_,A]=v.split(":");if(!_||!A)throw new Error(`Invalid reconnection token format.
74The format should be roomId:reconnectionToken`);return yield this.createMatchMakeRequest("reconnect",_,{reconnectionToken:A},x)})}consumeSeatReservation(v,x,_){return i.__awaiter(this,void 0,void 0,function*(){const A=this.createRoom(v.room.name,x);A.roomId=v.room.roomId,A.sessionId=v.sessionId;const R={sessionId:A.sessionId};v.reconnectionToken&&(R.reconnectionToken=v.reconnectionToken);const w=_||A;return A.connect(this.buildEndpoint(v.room,R,v.protocol),v.devMode&&(()=>i.__awaiter(this,void 0,void 0,function*(){console.info(`[Colyseus devMode]: ${String.fromCodePoint(128260)} Re-establishing connection with room id '${A.roomId}'...`);let E=0,D=8;const L=()=>i.__awaiter(this,void 0,void 0,function*(){E++;try{yield this.consumeSeatReservation(v,x,w),console.info(`[Colyseus devMode]: ${String.fromCodePoint(9989)} Successfully re-established connection with room '${A.roomId}'`)}catch{E<D?(console.info(`[Colyseus devMode]: ${String.fromCodePoint(128260)} retrying... (${E} out of ${D})`),setTimeout(L,2e3)):console.info(`[Colyseus devMode]: ${String.fromCodePoint(10060)} Failed to reconnect. Is your server running? Please check server logs.`)}});setTimeout(L,2e3)})),w,v,this.http.headers),new Promise((E,D)=>{const L=(P,G)=>D(new e.ServerError(P,G));w.onError.once(L),w.onJoin.once(()=>{w.onError.remove(L),E(w)})})})}createMatchMakeRequest(v,x){return i.__awaiter(this,arguments,void 0,function*(_,A,R={},w,E){const D=(yield this.http.post(`matchmake/${_}/${A}`,{headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(R)})).data;if(D.error)throw new u(D.error,D.code);return _==="reconnect"&&(D.reconnectionToken=R.reconnectionToken),yield this.consumeSeatReservation(D,w,E)})}createRoom(v,x){return new t.Room(v,x)}buildEndpoint(v,x={},_="ws"){let A=this.settings.searchParams||"";this.http.authToken&&(x._authToken=this.http.authToken);for(const E in x)x.hasOwnProperty(E)&&(A+=(A?"&":"")+`${E}=${x[E]}`);_==="h3"&&(_="http");let R=this.settings.secure?`${_}s://`:`${_}://`;v.publicAddress?R+=`${v.publicAddress}`:R+=`${this.settings.hostname}${this.getEndpointPort()}${this.settings.pathname}`;const w=`${R}/${v.processId}/${v.roomId}?${A}`;return this.urlBuilder?this.urlBuilder(new URL(w)):w}getHttpEndpoint(v=""){const x=v.startsWith("/")?v:`/${v}`;let _=`${this.settings.secure?"https":"http"}://${this.settings.hostname}${this.getEndpointPort()}${this.settings.pathname}${x}`;return this.settings.searchParams&&(_+=`?${this.settings.searchParams}`),this.urlBuilder?this.urlBuilder(new URL(_)):_}getEndpointPort(){return this.settings.port!==80&&this.settings.port!==443?`:${this.settings.port}`:""}};return p.VERSION="0.16.22",ry.Client=p,ry.MatchMakeError=u,ry}var pS={},$E;function RL(){if($E)return pS;$E=1;let i=class{setState(t){}getState(){return null}patch(t){}teardown(){}handshake(t){}};return pS.NoneSerializer=i,pS}var eT;function BL(){return eT||(eT=1,(function(i){S5();var e=CL(),t=FR(),n=rB(),s=aB(),a=b_(),l=GR(),u=RL(),h=kR();h.registerSerializer("schema",l.SchemaSerializer),h.registerSerializer("none",u.NoneSerializer),i.Client=e.Client,i.MatchMakeError=e.MatchMakeError,Object.defineProperty(i,"ErrorCode",{enumerable:!0,get:function(){return t.ErrorCode}}),Object.defineProperty(i,"Protocol",{enumerable:!0,get:function(){return t.Protocol}}),i.Room=n.Room,i.Auth=s.Auth,i.ServerError=a.ServerError,i.SchemaSerializer
74=l.SchemaSerializer,i.getStateCallbacks=l.getStateCallbacks,i.registerSerializer=h.registerSerializer})(tS)),tS}var oB=BL();const fy=300;let IL=0;const ti=jc(i=>({vehicles:[],localVehicleId:-1,targetedVehicleId:-1,targetedPlayerId:"",targetScreenNdcX:0,targetScreenNdcY:0,setVehicles:e=>i({vehicles:e}),applyServerSnapshot:e=>i(t=>{if(!e?.length)return t;const n=e.map(s=>({id:Number(s.id),x:s.x,y:s.y,z:s.z,rotY:s.rotY,speed:s.speed??0,driverId:s.driverId??"",hp:s.hp??fy,maxHp:s.maxHp??fy}));return n.sort((s,a)=>s.id-a.id),{vehicles:n}}),initVehicles:e=>i({vehicles:e.map(t=>({...t,id:IL++,speed:0,driverId:"",hp:fy,maxHp:fy}))}),setLocalVehicle:e=>i({localVehicleId:e}),setTargetedVehicle:e=>i({targetedVehicleId:e}),setTargetedPlayer:e=>i({targetedPlayerId:e}),setTargetScreenNdc:(e,t)=>i({targetScreenNdcX:e,targetScreenNdcY:t}),updateVehicle:(e,t)=>i(n=>({vehicles:n.vehicles.map(s=>s.id===e?{...s,...t}:s)})),setDriver:(e,t)=>i(n=>({vehicles:n.vehicles.map(s=>s.id===e?{...s,driverId:t}:s)})),setVehicleHp:(e,t)=>i(n=>({vehicles:n.vehicles.map(s=>s.id===e?{...s,hp:t}:s)}))})),DL=38,mS=oR;function LL(i){switch(i){case"player":return 24;case"vehicle":return 22;case"wall":return 16;case"post":return 18;default:return 12}}function PL(i,e){const t=[],n=LL(e);for(let s=0;s<n;s++){const a=Math.random(),l=Math.random(),u=2*Math.PI*a,h=Math.acos(2*l-1),p=4+(8+12*i)*Math.random()*(e==="vehicle"?1.15:1),m=Math.sin(h),v=p*Math.cos(u)*m,x=p*.42+9*Math.random()*i,_=p*Math.sin(u)*m,A=e==="post"||e==="wall"?.05:.03;t.push({offX:0,offY:0,offZ:0,scale:.05+(.11+.05*(e==="player"?.2:0))*(.45+.55*i)+Math.random()*A,vx:v,vy:x,vz:_,rotX:Math.random()*Math.PI*2,rotY:Math.random()*Math.PI*2,rotZ:Math.random()*Math.PI*2,wX:9+20*Math.random(),wY:9+20*Math.random(),wZ:9+20*Math.random()})}return t}const Nc=jc((i,e)=>({projectiles:[],impacts:[],shrapnelBursts:[],_nextId:0,addProjectile(t,n,s,a,l,u,h){const p=e()._nextId;i(m=>({_nextId:m._nextId+1,projectiles:[...m.projectiles.slice(-95),{id:p,px:t,py:n,pz:s,dx:a,dy:l,dz:u,color:h}]}))},removeProjectile(t){i(n=>({projectiles:n.projectiles.filter(s=>s.id!==t)}))},addImpact(t,n,s,a){const l=e()._nextId;i(u=>({_nextId:u._nextId+1,impacts:[...u.impacts.slice(-47),{id:l,px:t,py:n,pz:s,color:a}]}))},removeImpact(t){i(n=>({impacts:n.impacts.filter(s=>s.id!==t)}))},addShrapnelBurst(t,n,s,a,l){const u=e()._nextId,h=l==="player"?1:l==="vehicle"?.88:l==="wall"?.6:l==="post"?.7:.4;i(p=>({_nextId:p._nextId+1,shrapnelBursts:[...p.shrapnelBursts.slice(-13),{id:u,px:t,py:n,pz:s,color:a,intensity:h,impactKind:l,fragments:PL(h,l),_born:performance.now()}]}))},removeShrapnelBurst(t){i(n=>({shrapnelBursts:n.shrapnelBursts.filter(s=>s.id!==t)}))}})),OL=i=>(e,t,n)=>{const s=n.subscribe;return n.subscribe=((l,u,h)=>{let p=l;if(u){const m=h?.equalityFn||Object.is;let v=l(n.getState());p=x=>{const _=l(x);if(!m(v,_)){const A=v;u(v=_,A)}},h?.fireImmediately&&u(v,v)}return s(p)}),i(e,t,n)},NL=OL;function UL(i,e){let t;try{t=i()}catch{return}return{getItem:s=>{var a;const l=h=>h===null?null:JSON.parse(h,void 0),u=(a=t.getItem(s))!=null?a:null;return u instanceof Promise?u.then(l):l(u)},setItem:(s,a)=>t.setItem(s,JSON.stringify(a,void 0)),removeItem:s=>t.removeItem(s)}}const H1=i=>e=>{try{const t=i(e);return t instanceof Promise?t:{then(n){return H1(n)(t)},catch(n){return this}}}catch(t){return{then(n){return this},catch(n){return H1(n)(t)}}}},zL=(i,e)=>(t,n,s)=>{let a={storage:UL(()=>window.localStorage),partialize:w=>w,version:0,merge:(w,E)=>({...E,...w}),...e},l=!1,u=0;const h=new Set,p=new Set;let m=a.storage;if(!m)return i((...w)=>{console.warn(`[zustand persist middleware] Unable to update item '${a.name}', the given storage is currently unavailable.`),t(...w)},n,s);const v=()=>{const w=a.partialize({...n()});return m.setItem(a.name,{state:w,version:a.version})},x=s.setState;s.setState=(w,E)=>(x(w,E),v());const _=i((...w)=>(t(...w),v()),n,s);s.getInitialState=()=>_;let A;const R=()=>{var w,E;if(!m)return;const D=++u;l=!1,h.forEach(P=>{var G;return P((G=n())!=null?G:_)});const L=((E=a.onRehydrateStorage)==null?void 0:E.call(a,(w=n())!=null?w:_))||void 0;return H1(m.getItem.bind(m))(a.name).then(P=>{if(P)if(typeof P.version=="number"&&P.version!==a.version){if(a.migrate){const G=a.migrate(P.state,P.version);return G instanceof Promise?G.then(H=>[!0,H]):[!0,G]}console.error("State loaded from storage couldn't be migrated since no migrate function was provided")}else return[!1,P.state];return[!1,void 0]}).then(P=>{var G;if(D!==u)return;const[H,F]=P;if(A=a.merge(F,(G=n())!=null?G:_),t(A,!0),H)return v()}).then(()=>{D===u&&(L?.(n(),void 0),A=n(),l=!0,p.forEach(P=>P(A)))}).catch(P=>{D===u&&L?.(void 0,P)})};return s.persist={setOptions:w=>{a={...a,...w},w.storage&&(m=w.storage)},clearStorage:()=>{m?.removeItem(a.name)},getOptions:()=>a,rehydrate:()=>R(),hasHydrated:()=>l,onHydrate:w=>(h.add(w),()=>{h.delete(w)}),onFinishHydration:w=>(p.add(w),()=>{p.delete(w)})},a.skipHydration||R(),A||_},FL=zL,Ic=jc()(FL(i=>({musicVolume:.1,sfxVolume:.8,isMuted:!1,setMusicVolume:e=>i({musicVolume:Math.max(0,Math.min(1,e))}),setSfxVolume:e=>i({sfxVolume:Math.max(0,Math.min(1,e))}),toggleMute:()=>i(e=>({isMuted:!e.isMuted}
74))}),{name:"eclipse-protocol-audio"}));let gS=null,dy=null,tT=0,nT=0;function E_(){return gS||(gS=new AudioContext),gS}function T_(i){if(i.state!=="suspended")return;const e=performance.now();e-nT<400||(nT=e,i.resume())}function kL(i,e){if(dy&&dy.sampleRate===i.sampleRate)return dy;const t=Math.floor(i.sampleRate*e),n=i.createBuffer(1,t,i.sampleRate),s=n.getChannelData(0);for(let a=0;a<t;a++)s[a]=Math.random()*2-1;return dy=n,n}function w_(i){const{isMuted:e,sfxVolume:t}=Ic.getState();return e?0:i*t}function HL(){try{const i=E_();T_(i);const e=w_(.32);if(e===0)return;const t=i.currentTime,n=i.createOscillator(),s=i.createGain();n.type="sawtooth",n.frequency.setValueAtTime(1300,t),n.frequency.exponentialRampToValueAtTime(280,t+.15),s.gain.setValueAtTime(e,t),s.gain.exponentialRampToValueAtTime(.001,t+.2),n.connect(s),s.connect(i.destination),n.start(t),n.stop(t+.2)}catch{}}function GL(){try{const i=performance.now();if(i-tT<45)return;tT=i;const e=E_();T_(e);const t=w_(.28);if(t===0)return;const n=e.currentTime,s=e.createBufferSource();s.buffer=kL(e,.18);const a=e.createBiquadFilter();a.type="bandpass",a.frequency.value=2200,a.Q.value=1.8;const l=e.createGain();l.gain.setValueAtTime(t*1.2,n),l.gain.exponentialRampToValueAtTime(.001,n+.16),s.connect(a),a.connect(l),l.connect(e.destination),s.start(n),s.stop(n+.16);const u=e.createOscillator(),h=e.createGain();u.type="sine",u.frequency.setValueAtTime(550,n),u.frequency.exponentialRampToValueAtTime(70,n+.09),h.gain.setValueAtTime(t*.65,n),h.gain.exponentialRampToValueAtTime(.001,n+.09),u.connect(h),h.connect(e.destination),u.start(n),u.stop(n+.09)}catch{}}function jL(i){try{const e=E_();T_(e);const t=w_(.34);if(t===0)return;const n=e.currentTime,s=[[.3,2800,260,1,1],[.26,2400,320,.9,1],[.22,3200,420,1.1,.95],[.18,3800,600,1.3,.9]],[a,l,u,h,p]=s[i],m=Math.floor(e.sampleRate*a),v=e.createBuffer(1,m,e.sampleRate),x=v.getChannelData(0);for(let w=0;w<m;w++)x[w]=Math.random()*2-1;const _=e.createBufferSource();_.buffer=v;const A=e.createBiquadFilter();A.type="bandpass",A.frequency.setValueAtTime(l,n),A.frequency.exponentialRampToValueAtTime(u,n+a),A.Q.value=h;const R=e.createGain();R.gain.setValueAtTime(0,n),R.gain.linearRampToValueAtTime(t*p,n+.012),R.gain.setValueAtTime(t*p,n+a*.35),R.gain.exponentialRampToValueAtTime(.001,n+a),_.connect(A),A.connect(R),R.connect(e.destination),_.start(n),_.stop(n+a)}catch{}}function VL(){try{const i=E_();T_(i);const e=w_(.7);if(e===0)return;const t=i.currentTime,n=i.createOscillator();n.type="sine",n.frequency.setValueAtTime(80,t),n.frequency.exponentialRampToValueAtTime(15,t+.35);const s=i.createGain();s.gain.setValueAtTime(0,t),s.gain.linearRampToValueAtTime(e,t+.01),s.gain.exponentialRampToValueAtTime(.001,t+.35),n.connect(s),s.connect(i.destination),n.start(t),n.stop(t+.35);const a=Math.floor(i.sampleRate*.18),l=i.createBuffer(1,a,i.sampleRate),u=l.getChannelData(0);for(let _=0;_<a;_++)u[_]=Math.random()*2-1;const h=i.createBufferSource();h.buffer=l;const p=i.createBiquadFilter();p.type="highpass",p.frequency.value=900;const m=i.createGain();m.gain.setValueAtTime(0,t),m.gain.linearRampToValueAtTime(e*.45,t+.005),m.gain.exponentialRampToValueAtTime(.001,t+.18),h.connect(p),p.connect(m),m.connect(i.destination),h.start(t);const v=i.createOscillator();v.type="sawtooth",v.frequency.setValueAtTime(320,t+.02),v.frequency.exponentialRampToValueAtTime(80,t+.12);const x=i.createGain();x.gain.setValueAtTime(0,t+.02),x.gain.linearRampToValueAtTime(e*.25,t+.04),x.gain.exponentialRampToValueAtTime(.001,t+.14),v.connect(x),x.connect(i.destination),v.start(t+.02),v.stop(t+.14)}catch{}}function lB(){Number.isFinite(NaN)}function cB(){return""}function WL(i){return i.replace(/^wss:\/\//i,"https://").replace(/^ws:\/\//i,"http://")}function uB(){if(typeof window>"u"||!window.location)return!0;const i=window.location.port;return!i||i==="80"||i==="443"}function XL(){if(typeof window>"u"||!window.location?.hostname)return"http://localhost:2567";const{protocol:i,hostname:e}=window.location,t=lB();return t?`${i}//${e}:${t}`:uB()?`${i}//${e}`:`${i}//${e}:2567`}function qL(){if(typeof window>"u"||!window.location?.hostname)return"ws://localhost:2567";const i=window.location.hostname,e=lB();return e?`${window.location.protocol==="https:"?"wss":"ws"}://${i}:${e}`:uB()?window.location.protocol==="https:"?`wss://${i}`:`ws://${i}`:`${window.location.protocol==="https:"?"wss":"ws"}://${i}:2567`}function T0(){const i=cB();return i?WL(i):XL()}function YL(){const i=cB();return i||qL()}const vS={en:{menu_subtitle:"Arena PvP · pick a class, country & name, then join",menu_live_follow_intro:"A match is in progress. Live scoreboard below; you can join when it ends.",menu_live_loading:"Syncing live data…",menu_hint_no_rooms:"No rooms listed? That’s normal: press {{enter}} below and the server will create or place you in a match. The list only shows lobbies opened in another window.",menu_enter_bold:"ENTER ARENA",menu_hint_match_live:"A match is in progress on the server. The forming-rooms list stays hidden until it ends. You can still use {{enter}} for a new lobby if the server has capacity.",menu_forming_title:"FORMING LOBBIES (max. {{max}} players / room)",menu_player_count:"{{n}} player(s) · id {{id}}…",menu_join_arena:"Join arena",room_main:"Main Arena",menu_private_title:"Private room (invite link)",menu_private_create:"Create private room",menu_private_creating:"Creating…",menu_private_link_label:"Share this link (copied to clipboard):",menu_private_copy:"Copy link",menu_private_url_invite:"You opened an invite link — use the button below to join this room. “Main arena” is for public matchmaking.",menu_watch_spectate:"Watch match",menu_left_nav_kicker:"Discover",menu_left_nav_create_title:"Private arena",menu_left_nav_create_sub:"New room & invite link",menu_forming_main:"An arena is filling up: {{n}} player(s) already in open lobbies. Choose a class and use the main button to 
74join in.",menu_forming_private:"This room is taking shape: {{n}} / {{max}} in the waiting area. Get ready below — jump in while there’s time ({{time}} left in the lobby).",menu_private_join_invite:"Join this private room",menu_private_main_arena:"Main arena (public)",menu_private_error_resolve:"Could not find that room. It may have ended.",menu_private_error_create:"Could not create a private room (server may be at capacity).",menu_more_options:"More",menu_more_caption:"Lobbies and leaderboard — each opens in a pop-up",menu_tile_lobbies:"Lobbies",menu_tile_lobbies_desc:"Forming & join",menu_tile_ranking:"Leaderboard",menu_tile_ranking_desc:"Main arena only",menu_no_ranking_yet:"No scores yet. Play a match in any public arena to appear here.",menu_ranking_scope_note:"Top scores from all public arenas. Private rooms are not ranked.",hub_tab_arenas:"Arenas",hub_tab_create:"Create",hub_tab_ranking:"Ranking",hub_lobbies_title:"OPEN LOBBIES",hub_playing_title:"MATCHES IN PROGRESS",hub_empty_lobbies:"No open arenas. Create one to get started!",hub_empty_playing:"No matches running right now.",hub_join:"Join",hub_watch:"Watch",hub_create_public_title:"PUBLIC ARENA",hub_create_public_desc:"Open to everyone — appears in the lobby list.",hub_create_private_title:"PRIVATE ARENA",hub_create_private_desc:"Invite-only via link — not listed publicly.",hub_arena_name_label:"Arena name (optional)",hub_arena_name_placeholder:"e.g. Cyberstrike, Neon Rift…",hub_max_players_label:"Max players",hub_creating:"Creating…",hub_create_public_btn:"Create Public Arena",hub_create_private_btn:"Private Room Setup →",hub_players_count:"{{n}} / {{max}}",hub_time_left:"{{m}}:{{s}} left",hub_lobby_time:"Lobby: {{m}}:{{s}}",hub_ranking_empty:"No scores yet across public arenas.",hub_ranking_scope:"Top scores from all public arenas.",hub_invite_banner:"You have a private invite",hub_invite_join:"Enter Private Room",hub_error_create:"Could not create arena (server may be full).",hub_error_join:"Could not join arena. It may have started or ended.",menu_nav_home:"Home",menu_close_modal:"Close",menu_private_link_cta:"Private room (full setup)",menu_private_full_page:"Open full setup page",private_cfg_mode_badge:"PRIVATE SESSION",private_cfg_title:"Private room",private_cfg_lead:"Choose max players and how long the lobby waits for a second player. Then share the link — it stays valid until the match ends or the lobby times out.",private_cfg_max_players:"Max players (combat slots)",private_cfg_lobby_wait:"Lobby wait (until 2+ players needed)",private_cfg_wait_1:"1 min",private_cfg_wait_3:"3 min",private_cfg_wait_5:"5 min",private_cfg_wait_10:"10 min",private_cfg_wait_15:"15 min",private_cfg_submit:"Create room & get link",private_cfg_link_ready:"Your invite link (also copied if the browser allows):",private_cfg_open_link:"Open invite link",private_cfg_hint_join:"Everyone uses the same URL. The main menu’s big button joins the invited room when you opened this link from there.",private_cfg_back_menu:"← Back to main menu",menu_live_col_rs:"RS",menu_live_status:"Status",menu_live_alive:"Active",menu_live_out:"Out",menu_display_placeholder:"Display name (optional)",menu_country_label:"Country",menu_country_intl:"International",menu_identity_hint:"Shown next to your name in-game",menu_country_search:"Search country…",menu_live_title:"LIVE MATCH",menu_top_matches:"ALL-TIME LEADERBOARD (BEST SCORES)",menu_pts:"pts",menu_connecting:"CONNECTING…",menu_in_lobby:"IN THE LOBBY — SWITCH TO THE GAME",menu_enter_arena:"ENTER ARENA",menu_stat_hp:"HP",menu_stat_speed:"Speed",menu_stat_stamina:"Stamina",menu_lang_label:"Language",menu_live_kd:"K{{k}} D{{d}}",last_match_title:"LAST MATCH (MAIN ARENA)",last_match_winner:"Winner",last_match_time:"Ended",last_match_lobby_cd:"Default lobby countdown: {{n}}s",last_match_all_in:"Everyone who played ({{n}}) — by score",last_match_no_data:"Play a full match to see results here.",last_match_rank:"#",last_match_name:"Player",last_match_k:"K",last_match_d:"D",last_match_score:"Pts",comms_title:"ROOM · CHAT & VOICE",comms_btn_open:"CHAT · ENTER · /",comms_mic_pending:"MIC …",comms_mic_on:"MIC ON · V",comms_mic_off:"MIC · V",comms_listen_on:"LISTENING · L",comms_listen_off:"ROOM LISTEN · L",comms_title_mic:"Turn on mic (asks permission). Shortcut V.",comms_title_listen:"Listen to room without a mic (useful off HTTPS/localhost). Shortcut L.",comms_empty_hint:"Enter or / opens the chat. F2/F3 toggle this panel. With MIC ON the browser may ask for permission; you only hear other players (open two tabs to test). There is no local echo with one player.",comms_send:"SEND",comms_placeholder:"Message to the room…",lobby_title:"LOBBY — WAITING",lobby_subtitle:"Up to {{max}}
74 players in this session. When 2+ are connected, a ~{{cd}}s countdown runs before the match. Wait here — no need to refresh.",lobby_subtitle_private:"Private room — up to {{max}} players. When 2+ are connected, the match starts using the lobby timing you chose (no extra public countdown).",lobby_starts:"Starts in ~{{n}} s",lobby_global:"Global lobby time left: {{time}}",lobby_leave:"Leave queue",end_title:"MATCH ENDED",end_closing:"The arena will close in a moment…",end_dismiss_hint:"Press any key or click to return to the menu.",end_kick_hint:"If you wait, the server closes the connection in ~{{n}}s.",end_winner:"Winner",end_duel_badge:"1v1 — final result",end_participants:"All participants ({{n}})",end_reason_time:"Time’s up. Highest score at the clock wins — that’s the match.",end_reason_last_standing:"The last player still in the arena takes the win. Everyone’s scores for this session are below.",end_you_won:"You won this match",end_you:"(you)",end_elim_title:"ELIMINATED",end_elim_body:"You were removed after {{deaths}} deaths — no lives left. You had {{lives}} lives this match: your first life plus {{extra}} respawns.",end_elim_by:"Last elimination credited to: {{name}}",end_elim_hazard:"Hazard or arena damage got you (no other player for the last hit).",end_state_elimination:"OUT OF LIVES",end_state_spectator:"Spectator",end_state_winner:"Winner",end_state_defeat:"Defeat",end_state_match_end:"Match result",end_state_reason_time:"Match end · time limit",end_state_reason_last_standing:"Match end · last player",end_state_reason_other:"Match end",end_spectator_note:"You watched this match as a spectator.",end_not_winner_line:"Another player took the win this time — full scores below.",end_banner_time_title:"TIME’S UP",end_banner_time_sub:"Highest score when the clock stopped wins.",end_banner_last_title:"LAST STANDING",end_banner_last_sub:"One player remained when the dust settled.",end_banner_default_title:"MATCH OVER",end_banner_default_sub:"Final scores for this session.",arena_pointer_line1:"CLICK THE GAME FOR AIM AND CAMERA (POINTER LOCK)",arena_pointer_line2:"[ENTER] chat · [V]/[L] voice · [Ctrl+Shift+I] pack · [H] heal · [B] ammo",spec_title:"SPECTATOR MODE",spec_sub:"You’re following the room in real time (no game control).",spec_players:"{{n}} player(s) in the room",spec_global:"Global lobby: {{time}}",spec_starts:"Match starts in ~{{n}} s",spec_match:"Match — {{time}}",spec_leave:"Leave",err_lobby_timeout:"A second player didn’t show up in time. Return to the menu.",err_lobby_cancel:"The waiting room was cancelled.",err_connect:"Failed to connect: {{msg}}",err_room:"Error {{code}}: {{message}}",hazard_fire:"Damage: toxic fire (orange on the ground) — move out.",voice_not_supported:"This page can’t use the mic here (use Chrome/Firefox on localhost or HTTPS).",voice_blocked:"Mic blocked: use the lock icon in the address bar and allow the microphone for this site.",voice_no_device:"No microphone found on this system.",voice_in_use:"The microphone is in use by another app.",voice_generic:"Couldn’t start the mic. Try again or check your browser settings.",voice_channel_starting:"Voice channel is still starting — join the room and try again.",voice_off:"Voice off.",voice_step_listen_enter:"Entering listen mode…",voice_step_listening:"Listening to the room (no mic).",voice_request_mic:"Requesting microphone permission…",voice_mic_active:"Mic on",voice_error_prefix:"Error: {{err}}"},pt:{menu_subtitle:"Arena PvP · escolhe classe, país e nome, depois entra",menu_live_follow_intro:"Há uma partida a decorrer. Painel abaixo em tempo real; podes entrar quando terminar.",menu_live_loading:"A sincronizar estado ao vivo…",menu_hint_no_rooms:"Não vês nenhuma sala? Carrega em {{enter}} abaixo — o servidor cria ou coloca numa partida. A lista só mostra lobbies abertos doutra janela.",menu_enter_bold:"ENTRAR NA ARENA",menu_hint_match_live:"Há uma partida a decorrer no servidor. A lista de lobbies fica em pausa até acabar. Ainda podes usar {{enter}} para uma lobby nova se houver vaga.",menu_forming_title:"SALAS A FORMAR (máx. {{max}} jogadores / sala)",menu_player_count:"{{n}} jogador(es) · id {{id}}…",menu_join_arena:"Juntar à arena",room_main:"Arena principal",menu_private_title:"Sala privada (link de convite)",menu_private_create:"Criar sala privada",menu_private_creating:"A criar…",menu_private_link_label:"Partilha este link (cópia para a área de transferência):",menu_private_copy:"Copiar link",menu_private_url_invite:"Abriste um link de convite — usa o botão abaixo para entrar nesta sala. “Arena principalâ€
74 é para matchmaking público.",menu_watch_spectate:"Ver partida",menu_left_nav_kicker:"Explorar",menu_left_nav_create_title:"Arena privada",menu_left_nav_create_sub:"Nova sala e link de convite",menu_forming_main:"A formar: já há {{n}} jogador(es) em lobbies abertas. Escolhe uma classe e usa o botão principal para entrar.",menu_forming_private:"A sala a formar: {{n}} / {{max}} na zona de espera. Prepara-te abaixo — entra enquanto há tempo (faltam {{time}} de lobby).",menu_private_join_invite:"Entrar nesta sala privada",menu_private_main_arena:"Arena principal (público)",menu_private_error_resolve:"Essa sala não foi encontrada. Pode já ter terminado.",menu_private_error_create:"Não foi possível criar sala privada (servidor cheio ou erro).",menu_private_full_page:"Abrir página de configuração",menu_more_options:"Mais",menu_more_caption:"Lobbies e ranking — cada um abre num pop-up",menu_tile_lobbies:"Lobbies",menu_tile_lobbies_desc:"A formar e juntar",menu_tile_ranking:"Ranking",menu_tile_ranking_desc:"Só arena principal",menu_no_ranking_yet:"Ainda sem pontos. Joga numa arena pública para apareceres aqui.",menu_ranking_scope_note:"Lista melhores pontuações de todas as arenas públicas — salas privadas não entram no ranking.",hub_tab_arenas:"Arenas",hub_tab_create:"Criar",hub_tab_ranking:"Ranking",hub_lobbies_title:"LOBBIES ABERTOS",hub_playing_title:"PARTIDAS EM CURSO",hub_empty_lobbies:"Sem arenas abertas. Cria uma para começar!",hub_empty_playing:"Nenhuma partida a decorrer agora.",hub_join:"Entrar",hub_watch:"Ver",hub_create_public_title:"ARENA PÚBLICA",hub_create_public_desc:"Aberta a todos — aparece na lista de lobbies.",hub_create_private_title:"ARENA PRIVADA",hub_create_private_desc:"Só por convite via link — não aparece na lista pública.",hub_arena_name_label:"Nome da arena (opcional)",hub_arena_name_placeholder:"ex: Cyberstrike, Neon Rift…",hub_max_players_label:"Máx. jogadores",hub_creating:"A criar…",hub_create_public_btn:"Criar Arena Pública",hub_create_private_btn:"Configurar Sala Privada →",hub_players_count:"{{n}} / {{max}}",hub_time_left:"{{m}}:{{s}} restantes",hub_lobby_time:"Lobby: {{m}}:{{s}}",hub_ranking_empty:"Ainda sem pontos em arenas públicas.",hub_ranking_scope:"Melhores pontuações de todas as arenas públicas.",hub_invite_banner:"Tens um convite privado",hub_invite_join:"Entrar na Sala Privada",hub_error_create:"Não foi possível criar arena (servidor cheio ou erro).",hub_error_join:"Não foi possível entrar na arena. Pode já ter começado ou terminado.",menu_nav_home:"Início",menu_close_modal:"Fechar",menu_private_link_cta:"Sala privada (configuração completa)",private_cfg_mode_badge:"SESSÃO PRIVADA",private_cfg_title:"Sala privada",private_cfg_lead:"Define o máximo de jogadores e quanto tempo o lobby espera por um 2.º jogador. Depois partilha o link — mantém-se válido até a partida acabar ou o lobby expirar.",private_cfg_max_players:"Máx. de jogadores (combate)",private_cfg_lobby_wait:"Tempo de espera do lobby (até serem precisos 2+)",private_cfg_wait_1:"1 min",private_cfg_wait_3:"3 min",private_cfg_wait_5:"5 min",private_cfg_wait_10:"10 min",private_cfg_wait_15:"15 min",private_cfg_submit:"Criar sala e obter link",private_cfg_link_ready:"O teu link de convite (também copiado se o browser permitir):",private_cfg_open_link:"Abrir link de convite",private_cfg_hint_join:"Toda a gente usa o mesmo URL. No menu principal, o botão grande entra na sala de convite quando abriste o link a partir dali.",private_cfg_back_menu:"← Voltar ao menu",menu_live_col_rs:"Vidas",menu_live_status:"Estado",menu_live_alive:"Em jogo",menu_live_out:"Fora",menu_display_placeholder:"Nome (opcional)",menu_country_label:"País",menu_country_intl:"Internacional",menu_identity_hint:"Aparece ao lado do teu nome no jogo",menu_country_search:"Pesquisar país…",menu_live_title:"PARTIDA AO VIVO",menu_top_matches:"MELHORES PONTUAÇÕES (HISTÓRICO)",menu_pts:"pts",menu_connecting:"A LIGAR…",menu_in_lobby:"NA SALA — VAI AO JOGO",menu_enter_arena:"ENTRAR NA ARENA",menu_stat_hp:"HP",menu_stat_speed:"Vel.",menu_stat_stamina:"Stam.",menu_lang_label:"Idioma",menu_live_k
74d:"K{{k}} M{{d}}",last_match_title:"ÚLTIMA PARTIDA (ARENA PRINCIPAL)",last_match_winner:"Vencedor",last_match_time:"Terminou",last_match_lobby_cd:"Contagem típica de lobby: {{n}}s",last_match_all_in:"Quem jogou ({{n}}) — por pontos",last_match_no_data:"Joga uma partida completa para veres aqui o resultado.",last_match_rank:"#",last_match_name:"Jogador",last_match_k:"K",last_match_d:"M",last_match_score:"Pts",comms_title:"SALA · CHAT E VOZ",comms_btn_open:"CHAT · ENTER · /",comms_mic_pending:"MIC …",comms_mic_on:"MIC ON · V",comms_mic_off:"MIC · V",comms_listen_on:"A OUVIR · L",comms_listen_off:"OUVIR SALA · L",comms_title_mic:"Ligar micro (pede permissão). Atalho V.",comms_title_listen:"Ouvir a sala sem micro (útil fora de HTTPS/localhost). Atalho L.",comms_empty_hint:"Enter ou / abre o chat. F2/F3 alternam o painel. Com MIC ON o browser pode pedir permissão; ouves os outros (abre duas abas para testar). Sózinho não há eco local.",comms_send:"ENVIAR",comms_placeholder:"Mensagem para a sala…",lobby_title:"SALA — ESPERA",lobby_subtitle:"Até {{max}} jogadores na mesma sessão. Com 2+ ligados, corre uma contagem de ~{{cd}}s antes do combate. Aguarda aqui — sem recarregar.",lobby_subtitle_private:"Sala privada — até {{max}} jogadores. Com 2+ ligados, a partida inicia com o tempo de lobby que escolheste (sem contagem extra de 10s da arena pública).",lobby_starts:"Início em ~{{n}} s",lobby_global:"Prazo global do lobby: {{time}}",lobby_leave:"Sair da espera",end_title:"PARTIDA TERMINADA",end_closing:"A ligação à arena vai fechar em instantes…",end_dismiss_hint:"Clica em qualquer sítio ou carrega numa tecla para voltar ao menu.",end_kick_hint:"Se esperares, o servidor encerra a ligação em ~{{n}}s.",end_winner:"Vencedor",end_duel_badge:"1v1 — resultado final",end_participants:"Todos os jogadores ({{n}})",end_reason_time:"Fim do tempo. Ganha quem tiver mais pontos — aí está o resultado.",end_reason_last_standing:"Último jogador na arena leva a vitória. Abaixo ficam as pontuações de todos na sessão.",end_you_won:"Ganhaste esta partida",end_you:"(tu)",end_elim_title:"ELIMINADO",end_elim_body:"Saíste após {{deaths}} mortes — sem vidas. Cada jogador tem {{lives}} vidas: a de arranque e {{extra}} respawns.",end_elim_by:"Última eliminação: {{name}}",end_elim_hazard:"O que te eliminou foi o ambiente (hazard), não outro jogador no último hit.",end_state_elimination:"SEM VIDAS",end_state_spectator:"Espectador",end_state_winner:"Vitória",end_state_defeat:"Derrota",end_state_match_end:"Resultado",end_state_reason_time:"Fim · tempo esgotado",end_state_reason_last_standing:"Fim · último jogador",end_state_reason_other:"Fim da partida",end_spectator_note:"Seguiste esta partida como espectador.",end_not_winner_line:"Outro jogador ganhou desta vez — pontuações abaixo.",end_banner_time_title:"TEMPO ESGOTADO",end_banner_time_sub:"Ganha quem tiver mais pontos quando o relógio parou.",end_banner_last_title:"ÚLTIMO EM PÉ",end_banner_last_sub:"Ficou um jogador em campo quando a poeira baixou.",end_banner_default_title:"PARTIDA TERMINADA",end_banner_default_sub:"Pontuações finais desta sessão.",arena_pointer_line1:"CLICA NO JOGO PARA MIRA E CÂMARA (POINTER LOCK)",arena_pointer_line2:"[ENTER] chat · [V]/[L] voz · [Ctrl+Shift+I] mochila · [H] vida · [B] munição",spec_title:"MODO ESPECTADOR",spec_sub:"Segue a sala em tempo real (sem controlar o jogo).",spec_players:"{{n}} jogador(es) na sala",spec_global:"Prazo global: {{time}}",spec_starts:"Partida em ~{{n}} s",spec_match:"Partida — {{time}}",spec_leave:"Sair",err_lobby_timeout:"Não surgiu um segundo jogador a tempo. Volta ao menu.",err_lobby_cancel:"A sala de espera foi cancelada.",err_connect:"Falha ao conectar: {{msg}}",err_room:"Erro {{code}}: {{message}}",hazard_fire:"Dano: fogo tóxico (áreas laranja no chão) — move-te.",voice_not_supported:"Esta página não consegue usar o micro (usa Chrome/Firefox em localhost ou HTTPS).",voice_blocked:"Micro bloqueado: clica no cadeado no endereço e permite o micro para o site.",voice_no_device:"Não foi encontrado microfone no sistema.",voice_in_use:"O micro está a ser usado por outra aplicação.",voice_generic:"Não foi possível ligar o micro. Tenta de novo ou verifica o browser.",voice_channel_starting:"O canal de voz ainda a iniciar — entra na sala e tenta de novo.",voice_off:"Voz desligada.",voice_step_listen_enter:"A entrar em modo de ouvir…",voice_step_listening:"A ouvir a sala (sem micro).",voice_request_mic:"A pedir permissão do micro…",voice_mic_active:"Micro activo",voice_error_prefix:"Erro: {{err}}
74"}};function JL(i,e){return e?i.replace(/\{\{(\w+)\}\}/g,(t,n)=>String(e[n]??"")):i}function KL(i,e,t){const s=(vS[i]??vS.en)[e]??vS.en[e]??e;return JL(s,t)}const fB="eclipse_lang";function ZL(){try{const i=localStorage.getItem(fB);if(i==="pt"||i==="en")return i}catch{}return"en"}const Lo=jc((i,e)=>({lang:ZL(),setLang:t=>{try{localStorage.setItem(fB,t)}catch{}i({lang:t})},t:(t,n)=>KL(e().lang,t,n)}));function Ir(i,e){return Lo.getState().t(i,e)}const QL="eclipse_last_match";function $L(i){const e={at:Date.now(),...i,standings:i.standings??[]};try{localStorage.setItem(QL,JSON.stringify(e))}catch{}}const eP=[{urls:"stun:stun.l.google.com:19302"}],Mi=(...i)=>console.log("[VOICE]",...i),Vf=(...i)=>console.warn("[VOICE]",...i);let qu=null,up=null,yx=[];function iT(i){if(qu=i,!i)Mi("Bridge removido."),up=null,yx=[];else{Mi("Bridge registado."),up&&(Mi("Flush pendingVoiceRoomState →",up),i.onVoiceRoomState(up),up=null);for(const e of yx)Mi("Flush pendingVoicePeer →",e.sid,e.enabled,e.listenOnly),i.onVoicePeer(e.sid,e.enabled,e.listenOnly);yx=[]}}function tP(i,e,t=!1){Mi("dispatchVoicePeer →",i,e,t,qu?"(bridge ok)":"(sem bridge — guardado)"),qu?qu.onVoicePeer(i,e,t):yx.push({sid:i,enabled:e,listenOnly:t})}function nP(i,e){Mi("dispatchVoiceSignal ←",i,e.type),qu?.onVoiceSignal(i,e)}function yS(i){Mi("dispatchVoiceRoomState →",i,qu?"(bridge ok)":"(sem bridge — guardado)"),qu?qu.onVoiceRoomState(i):up=i.map(e=>({...e}))}class iP{constructor(e,t,n){this.voiceState="off",this.voiceRequestEpoch=0,this.localStream=null,this.remoteVoiceOn=new Set,this.remoteListenOnly=new Set,this.peers=new Map,this.remoteAudio=new Map,this.room=e,this.localId=t,this.voiceUi=n,Mi("VoiceRoomManager criado. localId =",t),iT(this)}dispose(){Mi("dispose() chamado."),iT(null),this.setVoiceMode("off")}getVoiceState(){return this.voiceState}setVoiceMode(e){if(Mi("setVoiceMode(",e,") actual:",this.voiceState),e===this.voiceState&&e==="listen"){Mi("→ já a ouvir, ignorado.");return}if(e==="mic"&&this.voiceState==="mic"&&this.localStream){Mi("→ já em mic com stream, ignorado.");return}if(e==="off"){this.voiceRequestEpoch++,this.voiceState="off",this.voiceUi?.onStep?.(Ir("voice_off"));try{this.room.send("voice_announce",{enabled:!1}),Mi("voice_announce(false) enviado.")}catch{Vf("room.send falhou (sala fechada?)")}this.localStream?.getTracks().forEach(t=>t.stop()),this.localStream=null,this.closeAllPeers();return}if(e==="listen"){if(this.voiceRequestEpoch++,this.voiceState==="mic"&&this.localStream){this.localStream.getTracks().forEach(t=>t.stop()),this.localStream=null;try{this.room.send("voice_announce",{enabled:!1})}catch{}this.closeAllPeers()}this.voiceState="listen",this.voiceUi?.onStep?.(Ir("voice_step_listen_enter"));try{this.room.send("voice_announce",{enabled:!0,listenOnly:!0}),Mi("voice_announce(listen) enviado.")}catch(t){Vf("voice_announce listen falhou:",t),this.voiceState="off",this.voiceUi?.onFailed?.("room_closed");return}for(const t of this.remoteVoiceOn)t!==this.localId&&this.shouldOffer(t)&&this.tryOffer(t);this.voiceUi?.onStep?.(Ir("voice_step_listening")),this.voiceUi?.onListenLive?.();return}if(e==="mic"){this.voiceRequestEpoch++;const t=this.voiceRequestEpoch;if(this.voiceState==="listen"){try{this.room.send("voice_announce",{enabled:!1})}catch{}this.closeAllPeers()}if(this.voiceState="off",!navigator.mediaDevices?.getUserMedia){Vf("getUserMedia não disponível."),this.voiceUi?.onFailed?.("not_supported");return}this.voiceUi?.onStep?.(Ir("voice_request_mic")),navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0},video:!1}).then(n=>{if(t!==this.voiceRequestEpoch){n.getTracks().forEach(s=>s.stop());return}this.voiceState="mic",this.localStream=n;try{this.room.send("voice_announce",{enabled:!0,listenOnly:!1}),Mi("voice_announce(mic) enviado.")}catch{Vf("voice_announce(mic) falhou."),this.voiceState="off",n.getTracks().forEach(s=>s.stop()),this.localStream=null,this.voiceUi?.onFailed?.("room_closed");return}for(const s of this.remoteVoiceOn)s!==this.localId&&this.shouldOffer(s)&&this.tryOffer(s);this.voiceUi?.onStep?.(Ir("voice_mic_active")),this.voiceUi?.onLive?.(n)}).catch(n=>{this.voiceState="off",this.localStream=null,Vf("getUserMedia falhou:",n?.name,n?.message),this.voiceUi?.onStep?.(Ir("voice_error_prefix",{err:n?.name??"unknown"})),this.voiceUi?.onFailed?.(n?.name??"unknown")})}}onVoiceRoomState(e){Mi("onVoiceRoomState —",e);for(const{sid:t,listenOnly:n}
74of e)!t||t===this.localId||(this.remoteVoiceOn.add(t),n?this.remoteListenOnly.add(t):this.remoteListenOnly.delete(t));this.flushPendingNegotiation()}onVoicePeer(e,t,n){if(Mi("onVoicePeer →",e,t,n),!(!e||e===this.localId)){if(!t){this.remoteVoiceOn.delete(e),this.remoteListenOnly.delete(e),this.closePeer(e);return}this.remoteVoiceOn.add(e),n?this.remoteListenOnly.add(e):this.remoteListenOnly.delete(e),this.flushPendingNegotiation()}}flushPendingNegotiation(){if(this.voiceState==="mic"&&this.localStream)for(const e of this.remoteVoiceOn)e!==this.localId&&this.shouldOffer(e)&&this.tryOffer(e);else if(this.voiceState==="listen")for(const e of this.remoteVoiceOn)e!==this.localId&&this.shouldOffer(e)&&this.tryOffer(e)}onVoiceSignal(e,t){Mi("onVoiceSignal ←",e,t.type),!(!e||e===this.localId)&&this.handleSignal(e,t)}shouldOffer(e){return this.localId<e}async tryOffer(e){if(!this.shouldOffer(e))return;if(this.peers.has(e)){Mi("tryOffer →",e,"(já tem peer, skip)");return}if(this.voiceState==="off")return;if(this.voiceState==="listen"&&this.remoteListenOnly.has(e)){Mi("tryOffer: ambos só a ouvir, skip",e);return}if(this.voiceState==="mic"&&!this.localStream)return;Mi("tryOffer → criando RTCPeerConnection para",e);const t=this.makePc(e);if(this.peers.set(e,t),this.voiceState==="mic"&&this.localStream)for(const s of this.localStream.getTracks())t.addTrack(s,this.localStream);else if(this.voiceState==="listen")try{t.addTransceiver("audio",{direction:"recvonly"})}catch(s){Vf("addTransceiver(recvonly) falhou:",s),this.peers.delete(e),t.close();return}else{this.peers.delete(e),t.close();return}const n=await t.createOffer();await t.setLocalDescription(n),Mi("offer enviado para",e),this.room.send("voice_signal",{to:e,payload:{type:"offer",sdp:n.sdp}})}async handleSignal(e,t){if(t.type==="offer"){Mi("handleSignal: offer de",e);let n=this.peers.get(e);if(!n&&(n=this.makePc(e),this.peers.set(e,n),this.localStream))for(const a of this.localStream.getTracks())n.addTrack(a,this.localStream);await n.setRemoteDescription(new RTCSessionDescription({type:"offer",sdp:t.sdp}));const s=await n.createAnswer();await n.setLocalDescription(s),Mi("answer →",e),this.room.send("voice_signal",{to:e,payload:{type:"answer",sdp:s.sdp}});return}if(t.type==="answer"){Mi("handleSignal: answer de",e);const n=this.peers.get(e);n&&await n.setRemoteDescription(new RTCSessionDescription({type:"answer",sdp:t.sdp}));return}if(t.type==="ice"&&t.candidate){const n=this.peers.get(e);if(n)try{await n.addIceCandidate(new RTCIceCandidate(t.candidate))}catch{}}}makePc(e){Mi("makePc →",e);const t=new RTCPeerConnection({iceServers:eP});return t.onconnectionstatechange=()=>{Mi("connectionState →",e,t.connectionState)},t.oniceconnectionstatechange=()=>{Mi("iceConnectionState →",e,t.iceConnectionState)},t.ontrack=n=>{const[s]=n.streams;Mi("ontrack de",e,s?.id);let a=this.remoteAudio.get(e);a||(a=document.createElement("audio"),a.autoplay=!0,a.setAttribute("playsinline","true"),a.volume=1,document.body.appendChild(a),this.remoteAudio.set(e,a)),s&&(a.srcObject=s,a.play().catch(l=>{Vf("el.play() bloqueado:",l)}))},t.onicecandidate=n=>{n.candidate?this.room.send("voice_signal",{to:e,payload:{type:"ice",candidate:n.candidate.toJSON()}}):Mi("ICE gathering completo →",e)},t}closePeer(e){Mi("closePeer →",e);const t=this.peers.get(e);t&&(t.close(),this.peers.delete(e));const n=this.remoteAudio.get(e);n&&(n.remove(),this.remoteAudio.delete(e))}closeAllPeers(){for(const e of[...this.peers.keys()])this.closePeer(e)}}let xS=null;function sT(){return xS||(xS=new oB.Client(YL())),xS}function sP(){const i=q.useRef(null),{setRoom:e,applyNetSyncTick:t,setRemoteAction:n,setRemoteWeapon:s,addChatMessage:a,disconnect:l,setError:u,setConnecting:h,setSpectator:p}=tn(),{addKill:m,addDeath:v,addScore:x,setHp:_,setForcePosition:A,setInventory:R,setEliminated:w,setPhase:E,finishReload:D,setServerMatchInfo:L,setResupplyMeta:P,setEndScreen:G}=ot();return{connect:async(J,le,ae="arena",W)=>{const ee=tn.getState();if(!(ee.room||ee.connecting)){W?.spectate||p(!1),h(!0);try{const te=W?.spectate?{spectate:!0}:{playerClass:J,displayName:le,countryCode:W?.countryCode??""},ue=W?.roomId?await sT().joinById(W.roomId,te):await sT().joinOrCreate(ae,te);i.current=ue,e(ue,ue.sessionId),W?.spectate?(p(!0),L({roomPhase:"lobby",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:0}),E("spectate")):(L({roomPhase:"lobby",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:0}),E("lobby"));const he=re=>{const oe=re?.players!=null?re:ue.state;if(!oe)return;if(oe?.roomPhase!==void 0){const pe=ot.getState();L({roomPhase:oe.roomPhase,lobbyTimeLeft:oe.lobbyTimeLeft??0,lobbyStartIn:oe.lobbyStartIn??0,matchTimeLeft:oe.matchTimeLeft??0,lobbyMaxPlayers:oe.lobbyM
74axPlayers}),oe.roomPhase==="playing"&&pe.phase==="lobby"&&!tn.getState().isSpectator&&E("playing")}if(!oe?.players)return;const we=b5(oe,ue.sessionId);t({...we.remoteMembershipChanged?{remotePlayerIds:we.remotePlayerIds}:{}});const Be=oe.players?.get(ue.sessionId);if(Be){if(Be.score!==void 0&&ot.setState({score:Be.score}),Be.hp!==void 0&&ot.getState().setHp(Be.hp,Be.maxHp??100),Be.ammoBoxes!==void 0||Be.healthCapsules!==void 0){const pe=ot.getState();pe.setInventory(Be.ammoBoxes??pe.ammoBoxes,Be.healthCapsules??pe.healthCapsules)}if(Be.respawnsLeft!==void 0||Be.autoReloadLeft!==void 0||Be.autoHealLeft!==void 0){const pe=ot.getState();P({respawnsLeft:Be.respawnsLeft??pe.respawnsLeft,autoReloadLeft:Be.autoReloadLeft??pe.autoReloadLeft,autoHealLeft:Be.autoHealLeft??pe.autoHealLeft})}}if(oe.vehicles){const pe=[];oe.vehicles.forEach(Re=>{pe.push({id:Re.id,x:Re.x??0,y:Re.y??0,z:Re.z??0,rotY:Re.rotY??0,speed:Re.speed??0,driverId:Re.driverId??"",hp:Re.hp??300,maxHp:Re.maxHp??300})}),ti.getState().applyServerSnapshot(pe)}};ue.onStateChange(()=>{he()}),ue.state&&he(ue.state);const K=oB.getStateCallbacks(ue);if(K(ue.state).players.onAdd(()=>{he()}),K(ue.state).players.onRemove(()=>{he()}),!W?.spectate){const re=ue.state?.players?.get(ue.sessionId);re&&re.x!==void 0&&A(re.x,re.y??.9,re.z)}Object.entries({force_position:re=>{A(re.x,re.y,re.z)},remote_action:re=>{n(re.sid,{type:re.type,ts:Date.now(),x:re.x,y:re.y,z:re.z,rotY:re.rotY,ox:re.ox,oy:re.oy,oz:re.oz,dirX:re.dirX,dirY:re.dirY,dirZ:re.dirZ})},laser_fx:re=>{const oe=Nc.getState();oe.addShrapnelBurst(re.px,re.py,re.pz,re.color,re.kind),oe.addImpact(re.px,re.py,re.pz,re.color),(re.kind==="player"||re.kind==="vehicle"||re.kind==="wall"||re.kind==="post")&&GL(),(re.kind==="player"||re.kind==="vehicle")&&re.attackerId===ue.sessionId&&ot.getState().triggerHitMarker()},remote_weapon:re=>{s(re.sid,{weapon:re.weapon,ts:Date.now()})},kill_confirmed:()=>m(),death:()=>v(),score_update:re=>x(re.delta),loot_collected:re=>{const oe=ot.getState();R(re.ammoBoxes??oe.ammoBoxes,re.healthCapsules??oe.healthCapsules)},item_used:re=>{const oe=ot.getState();re.type==="health"&&re.hp!==void 0?(_(re.hp,oe.maxHp),R(oe.ammoBoxes,re.healthCapsules??oe.healthCapsules),re.autoHealLeft!==void 0&&P({respawnsLeft:oe.respawnsLeft,autoReloadLeft:oe.autoReloadLeft,autoHealLeft:re.autoHealLeft})):re.type==="ammo"&&re.rounds!==void 0&&(D(re.rounds),R(re.ammoBoxes??oe.ammoBoxes,oe.healthCapsules),re.autoReloadLeft!==void 0&&P({respawnsLeft:oe.respawnsLeft,autoReloadLeft:re.autoReloadLeft,autoHealLeft:oe.autoHealLeft}))},damage_received:re=>{if(re.type==="vehicle_ram"){ot.getState().triggerVehicleHit(),VL(),re.kbX!==void 0&&ot.getState().setKnockback(re.kbX,re.kbZ??0,re.kbY??0);return}re.type==="fire"&&ot.getState().showHazard(Ir("hazard_fire"))},vehicle_destroyed:re=>{const{localVehicleId:oe,setLocalVehicle:we,setDriver:Be}=ti.getState();oe===re.vehicleId&&(we(-1),Be(re.vehicleId,""))},lobby_cancelled:re=>{u(re?.reason==="timeout"?Ir("err_lobby_timeout"):Ir("err_lobby_cancel")),E("menu"),i.current?.leave(),i.current=null,l()},match_started:()=>{if(tn.getState().isSpectator){L({roomPhase:"playing",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:ot.getState().matchTimeLeft,lobbyMaxPlayers:ot.getState().lobbyMaxPlayers});return}E("playing"),L({roomPhase:"playing",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:ot.getState().matchTimeLeft,lobbyMaxPlayers:ot.getState().lobbyMaxPlayers});const re=()=>{const oe=i.current?.state,we=i.current?.sessionId;if(!oe?.players||!we||tn.getState().isSpectator)return;const Be=oe.players.get(we);Be&&Be.x!==void 0&&A(Be.x,Be.y??.9,Be.z)};re(),queueMicrotask(re),ot.setState({ammo:aR.laser_rifle.magazineSize,isReloading:!1})},match_ended:re=>{const oe=ue.name!=="private_arena";if(oe)try{const pe="eclipse_match_ranking",Re=re?.standings?.[0];if(Re){const lt=JSON.parse(localStorage.getItem(pe)||"[]");lt.push({name:Re.name,score:Re.score,at:Date.now(),countryCode:Re.countryCode}),lt.sort((ct,vt)=>vt.score-ct.score),localStorage.setItem(pe,JSON.stringify(lt.slice(0,20)))}}catch{}const we=(re.standings??[]).map(pe=>({id:pe.id,name:pe.name,countryCode:pe.countryCode,score:pe.score,kills:pe.kills??0,deaths:
74pe.deaths??0})),Be={winnerId:re.winnerId,winnerName:re.winnerName,reason:re.reason,standings:we};oe&&$L(Be),G({kind:"match",winnerId:re.winnerId??"",winnerName:re.winnerName??"—",reason:re.reason??"",standings:we,isDuel:re.isDuel??we.length===2}),E("end")},eliminated:re=>{w(!0),G({kind:"eliminated",totalDeaths:re.totalDeaths??0,livesPerMatch:1+vE,extraRespawns:vE,killerName:re.killerName,environmental:re.killerId==="env"}),E("end")},chat_message:re=>{a({senderId:re.senderId,displayName:re.displayName,countryCode:re.countryCode,text:re.text,ts:re.ts})},voice_peer:re=>{tP(re.sid,re.enabled,re.listenOnly??!1)},voice_room_state:re=>{Array.isArray(re.peers)?yS(re.peers):re.sids?.length?yS(re.sids.map(oe=>({sid:oe,listenOnly:!1}))):yS([])},voice_signal:re=>{nP(re.from,re.payload)}}).forEach(([re,oe])=>{ue.onMessage(re,oe)}),ue.onLeave(()=>{i.current=null,l(),ot.getState().clearEndScreen(),ot.getState().setPhase("menu")}),ue.onError((re,oe)=>u(Ir("err_room",{code:String(re),message:oe??""}))),h(!1);{const re=ue.state;re?.roomPhase==="playing"?(tn.getState().isSpectator||E("playing"),L({roomPhase:"playing",lobbyTimeLeft:0,lobbyStartIn:0,matchTimeLeft:re.matchTimeLeft??0,lobbyMaxPlayers:re.lobbyMaxPlayers})):re?.lobbyTimeLeft!=null&&L({roomPhase:"lobby",lobbyTimeLeft:re.lobbyTimeLeft,lobbyStartIn:re.lobbyStartIn??0,matchTimeLeft:0,lobbyMaxPlayers:re.lobbyMaxPlayers})}}catch(te){h(!1);const ue=te instanceof Error?te.message:String(te);throw u(Ir("err_connect",{msg:ue})),te instanceof Error?te:new Error(ue)}}},sendMove:(J,le,ae,W,ee,te,ue,he)=>{i.current?.send("move",{x:J,y:le,z:ae,vx:W,vz:ee,rotY:te,animBits:ue,weaponId:he})},sendAttack:(J,le)=>{i.current?.send("attack",{type:J,targetId:le})},sendChat:J=>{i.current?.send("chat",{text:J})},sendUseItem:J=>{i.current?.send("use_item",{type:J})},sendAutoResupply:J=>{i.current?.send("auto_resupply",{type:J})},leave:()=>{i.current?.leave(),i.current=null,l()}}}var rP=iR();function hy(i){return i.normalize("NFD").replace(/\p{M}/gu,"")}function aP({options:i,value:e,onChange:t,searchPlaceholder:n,"aria-label":s,disabled:a=!1}){const l=q.useRef(null),u=q.useRef(null),[h,p]=q.useState(!1),[m,v]=q.useState(""),[x,_]=q.useState(null),R=q.useMemo(()=>{const L=new Map;for(const P of i)L.set(P.value,P);return L},[i]).get(e)??i[0],w=q.useMemo(()=>{const L=m.trim();if(!L)return i;const P=hy(L.toLowerCase());return i.filter(G=>{const H=hy(G.searchText.toLowerCase()),F=hy(G.value.toLowerCase()),X=hy(G.label.toLowerCase());return H.includes(P)||F.includes(P)||X.includes(P)})},[i,m]),E=q.useCallback(()=>{p(!1),v(""),_(null)},[]),D=q.useCallback(()=>{const L=l.current;if(!L)return;const P=L.getBoundingClientRect();_({top:P.bottom+4,left:P.left,width:P.width})},[]);return q.useLayoutEffect(()=>{h&&D()},[h,D,w.length,m]),q.useEffect(()=>{if(!h)return;const L=()=>D();return window.addEventListener("scroll",L,!0),window.addEventListener("resize",L),()=>{window.removeEventListener("scroll",L,!0),window.removeEventListener("resize",L)}},[h,D]),q.useEffect(()=>{if(!h)return;const L=P=>{const G=P.target;l.current?.contains(G)||document.querySelector("[data-eclipse-country-panel]")?.contains(G)||E()};return document.addEventListener("mousedown",L,!0),()=>document.removeEventListener("mousedown",L,!0)},[h,E]),q.useLayoutEffect(()=>{h&&u.current&&u.current.focus()},[h]),q.useEffect(()=>{if(!h)return;const L=P=>{P.key==="Escape"&&(P.preventDefault(),E())};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[h,E]),b.jsxs("div",{ref:l,style:oP,children:[b.jsxs("button",{type:"button",style:{...lP,opacity:a?.5:1,cursor:a?"not-allowed":"pointer"},disabled:a,"aria-expanded":h,"aria-haspopup":"listbox","aria-label":s,onClick:()=>{if(a)return;if(h){E();return}const L=l.current;if(L){const P=L.getBoundingClientRect();_({top:P.bottom+4,left:P.left,width:P.width})}p(!0)},children:[b.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",textAlign:"left",flex:1,minWidth:0},children:R?.label??"—"}),b.jsx("span",{style:{color:"#5a7a8a",fontSize:"0.65rem",marginLeft:6},children:h?"▲":"▼"})]}),h&&x&&typeof document<"u"&&rP.createPortal(b.jsxs("div",{"data-eclipse-country-panel":!0,style:{...cP,position:"fixed",top:(()=>{const L=typeof window<"u"?window.innerHeight:800;return Math.max(8,Math.min(x.top,L-280))})(),left:Math.max(8,Math.min(x.left,(typeof window<"u"?window.innerWidth:400)-x.width-8)),width:x.width},role:"listbox","aria-label":s,children:[b.jsx("input",{ref:u,type:"search",value:m,onChange:L=>v(L.target.value),placeholder:n,style:uP,onClick:L=>L.stopPropagation(),onKeyDown:L=>L.stopPropagation(),autoComplete:"off",autoCorrect:"off",spellCheck:!1}),b.jsx("div",{style:fP,children:w.length===0?b.jsx("div",{style:hP,children:"—"}):w.map(L=>{const P=L.value===e;return b.jsx("button",{type:"button",role:"option","aria-selected":P,style:{...dP,background:P?"rgba(0, 200, 255, 0.12)":"transparent"},onClick:()=>{t(L.value),E()},children:L.label},L.value||"__intl")})})]}),document.body)]})}const oP={position:"relative",flex:"0 1 220px",minWidth:160,maxWidth:"100%",alignSelf:"flex-start",zIndex:1},lP={width:"100%",minHeight:44,display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"space-between",background:"rgba(6, 14, 24, 0.95)",border:"1px solid rgba(0, 200, 255, 0.25)",color:"#e8f4ff",padding:"10px 12px",fontSize:"0.82rem",borderRadius:8,outline:"none",fontFamily:"inherit",boxSizing:"border-box"},cP={zIndex:1e4,background:"rgba(6, 10, 18, 0.98)",border:"1px solid rgba(0, 200, 255, 0.28)",borderRadius:8,boxShadow:"0 12px 40px rgba(0,0,0,0.55)",overflow:"hidden",display:"flex",flexDirection:"column",maxHeight:280},uP={width:"100%",boxSizing:"border-box",border:"none",borderBottom:"1px solid rgba(0, 200, 255, 0.15)",background:"rgba(0,0,0,0.35)",color:"#dff7ff",padding:"8px 10px",fontSize:"0.78rem",outline:"none",fontFamily:"inherit"},fP={flex:1,minHeight:0,overflowY:"auto",WebkitOverflowScrolling:"touch",maxHeight:220,padding:4},dP={width:"100%",textAlign:"left",border:"none",color:"#e0eef8",fontSize:"0.8rem",padding:"8px 10px",borderRadius:6,cursor:"pointer",fontFamily:"inherit",lineHeight:1.3},hP={padding:"12px 10px",color:"#567",fontSize:"0.78rem",textAlign:"center"};/**
75 * @license
76 * Copyright 2010-2025 Three.js Authors
77 * SPDX-License-Identifier: MIT
78 */const $u="175",pP={LEFT:0,MIDDLE:1,RIGHT:2,ROTATE:0,DOLLY:1,PAN:2},mP={ROTATE:0,PAN:1,DOLLY_PAN:2,DOLLY_ROTATE:3},dB=0,G1=1,hB=2,gP=3,pB=0,C_=1,mp=2,nl=3,cl=0,$s=1,Gs=2,Qr=0,gd=1,H0=2,j1=3,V1=4,mB=5,Gu=100,gB=101,vB=102,yB=103,xB=104,_B=200,bB=201,SB=202,AB=203,Cx=204,Rx=205,MB=206,EB=207,TB=208,wB=209,CB=210,RB=211,BB=212,IB=213,DB=214,Bx=0,G0=1,Ix=2,Md=3,Dx=4,Lx=5,Px=6,Ox=7,og=0,LB=1,PB=2,ol=0,OB=1,NB=2,UB=3,R_=4,zB=5,FB=6,kB=7,W1="attached",HB="detached",B_=300,Fc=301,Ku=302,j0=303,V0=304,Dp=306,Zu=1e3,Ka=1001,bp=1002,Ls=1003,I_=1004,vP=1004,cd=1005,yP=1005,as=1006,gp=1007,xP=1007,Do=1008,_P=1008,vr=1009,MA=1010,EA=1011,Sp=1012,D_=1013,kc=1014,Yr=1015,Pd=1016,L_=1017,P_=1018,Ed=1020,TA=35902,wA=1021,CA=1022,Jr=1023,RA=1024,BA=1025,Ap=1026,Td=1027,O_=1028,lg=1029,IA=1030,N_=1031,bP=1032,U_=1033,B0=33776,I0=33777,D0=33778,L0=33779,Nx=35840,Ux=35841,zx=35842,Fx=35843,kx=36196,Hx=37492,Gx=37496,jx=37808,Vx=37809,Wx=37810,Xx=37811,qx=37812,Yx=37813,Jx=37814,Kx=37815,Zx=37816,Qx=37817,$x=37818,e_=37819,t_=37820,n_=37821,P0=36492,i_=36494,s_=36495,DA=36283,r_=36284,a_=36285,o_=36286,GB=2200,jB=2201,VB=2202,Mp=2300,Ep=2301,xx=2302,ud=2400,fd=2401,W0=2402,z_=2500,LA=2501,WB=0,PA=1,l_=2,ef=3200,XB=3201,SP=3202,AP=3203,tf=0,qB=1,sl="",xi="srgb",Wl="srgb-linear",X0="linear",Ri="srgb",MP=0,rd=7680,EP=7681,TP=7682,wP=7683,CP=34055,RP=34056,BP=5386,IP=512,DP=513,LP=514,PP=515,OP=516,NP=517,UP=518,X1=519,YB=512,JB=513,
vendor: 5,972 bytes, line 78
78KB=514,OA=515,ZB=516,QB=517,$B=518,eI=519,q0=35044,zP=35048,FP=35040,kP=35045,HP=35049,GP=35041,jP=35046,VP=35050,WP=35042,XP="100",q1="300 es",al=2e3,Y0=2001,qP={COMPUTE:"compute",RENDER:"render"};class eo{addEventListener(e,t){this._listeners===void 0&&(this._listeners={});const n=this._listeners;n[e]===void 0&&(n[e]=[]),n[e].indexOf(t)===-1&&n[e].push(t)}hasEventListener(e,t){const n=this._listeners;return n===void 0?!1:n[e]!==void 0&&n[e].indexOf(t)!==-1}removeEventListener(e,t){const n=this._listeners;if(n===void 0)return;const s=n[e];if(s!==void 0){const a=s.indexOf(t);a!==-1&&s.splice(a,1)}}dispatchEvent(e){const t=this._listeners;if(t===void 0)return;const n=t[e.type];if(n!==void 0){e.target=this;const s=n.slice(0);for(let a=0,l=s.length;a<l;a++)s[a].call(this,e);e.target=null}}}const Wr=["00","01","02","03","04","05","06","07","08","09","0a","0b","0c","0d","0e","0f","10","11","12","13","14","15","16","17","18","19","1a","1b","1c","1d","1e","1f","20","21","22","23","24","25","26","27","28","29","2a","2b","2c","2d","2e","2f","30","31","32","33","34","35","36","37","38","39","3a","3b","3c","3d","3e","3f","40","41","42","43","44","45","46","47","48","49","4a","4b","4c","4d","4e","4f","50","51","52","53","54","55","56","57","58","59","5a","5b","5c","5d","5e","5f","60","61","62","63","64","65","66","67","68","69","6a","6b","6c","6d","6e","6f","70","71","72","73","74","75","76","77","78","79","7a","7b","7c","7d","7e","7f","80","81","82","83","84","85","86","87","88","89","8a","8b","8c","8d","8e","8f","90","91","92","93","94","95","96","97","98","99","9a","9b","9c","9d","9e","9f","a0","a1","a2","a3","a4","a5","a6","a7","a8","a9","aa","ab","ac","ad","ae","af","b0","b1","b2","b3","b4","b5","b6","b7","b8","b9","ba","bb","bc","bd","be","bf","c0","c1","c2","c3","c4","c5","c6","c7","c8","c9","ca","cb","cc","cd","ce","cf","d0","d1","d2","d3","d4","d5","d6","d7","d8","d9","da","db","dc","dd","de","df","e0","e1","e2","e3","e4","e5","e6","e7","e8","e9","ea","eb","ec","ed","ee","ef","f0","f1","f2","f3","f4","f5","f6","f7","f8","f9","fa","fb","fc","fd","fe","ff"];let rT=1234567;const vd=Math.PI/180,Tp=180/Math.PI;function Za(){const i=Math.random()*4294967295|0,e=Math.random()*4294967295|0,t=Math.random()*4294967295|0,n=Math.random()*4294967295|0;return(Wr[i&255]+Wr[i>>8&255]+Wr[i>>16&255]+Wr[i>>24&255]+"-"+Wr[e&255]+Wr[e>>8&255]+"-"+Wr[e>>16&15|64]+Wr[e>>24&255]+"-"+Wr[t&63|128]+Wr[t>>8&255]+"-"+Wr[t>>16&255]+Wr[t>>24&255]+Wr[n&255]+Wr[n>>8&255]+Wr[n>>16&255]+Wr[n>>24&255]).toLowerCase()}function An(i,e,t){return Math.max(e,Math.min(t,i))}function NA(i,e){return(i%e+e)%e}function YP(i,e,t,n,s){return n+(i-e)*(s-n)/(t-e)}function JP(i,e,t){return i!==e?(t-i)/(e-i):0}function O0(i,e,t){return(1-t)*i+t*e}function KP(i,e,t,n){return O0(i,e,1-Math.exp(-t*n))}function ZP(i,e=1){return e-Math.abs(NA(i,e*2)-e)}function QP(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*(3-2*i))}function $P(i,e,t){return i<=e?0:i>=t?1:(i=(i-e)/(t-e),i*i*i*(i*(i*6-15)+10))}function eO(i,e){return i+Math.floor(Math.random()*(e-i+1))}function tO(i,e){return i+Math.random()*(e-i)}function nO(i){return i*(.5-Math.random())}function iO(i){i!==void 0&&(rT=i);let e=rT+=1831565813;return e=Math.imul(e^e>>>15,e|1),e^=e+Math.imul(e^e>>>7,e|61),((e^e>>>14)>>>0)/4294967296}function sO(i){return i*vd}function rO(i){return i*Tp}function aO(i){return(i&i-1)===0&&i!==0}function oO(i){return Math.pow(2,Math.ceil(Math.log(i)/Math.LN2))}function lO(i){return Math.pow(2,Math.floor(Math.log(i)/Math.LN2))}function cO(i,e,t,n,s){const a=Math.cos,l=Math.sin,u=a(t/2),h=l(t/2),p=a((e+n)/2),m=l((e+n)/2),v=a((e-n)/2),x=l((e-n)/2),_=a((n-e)/2),A=l((n-e)/2);switch(s){case"XYX":i.set(u*m,h*v,h*x,u*p);break;case"YZY":i.set(h*x,u*m,h*v,u*p);break;case"ZXZ":i.set(h*v,h*x,u*m,u*p);break;case"XZX":i.set(u*m,h*A,h*_,u*p);break;case"YXY":i.set(h*_,u*m,h*A,u*p);break;case"ZYZ":i.set(h*A,h*_,u*m,u*p);break;default:console.warn("THREE.MathUtils: .setQuaternionFromProperEuler() encountered an unknown order: "+s)}}function ya(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return i/4294967295;case Uint16Array:return i/65535;case Uint8Array:return i/255;case Int32Array:return Math.max(i/2147483647,-1);case Int16Array:return Math.max(i/32767,-1);case Int8Array:return Math.max(i/127,-1);default:throw new Error("Invalid component type.")}}function Dn(i,e){switch(e.constructor){case Float32Array:return i;case Uint32Array:return Math.round(i*4294967295);case Uint16Array:return Math.round(i*65535);case Uint8Array:return Math.round(i*255);case Int32Array:return Math.round(i*2147483647);case Int16Array:return Math.round(i*32767);case Int8Array:return Math.round(i*127);default:throw new Error("Invalid component type.")}}const vn={DEG2RAD:vd,RAD2DEG:Tp,generateUUID:Za,clamp:An,euclideanModulo:NA,mapLinear:YP,inverseLerp:JP,lerp:O0,damp:KP,pingpong:ZP,smoothstep:QP,smootherstep:$P,randInt:eO,randFloat:tO,randFloatSpread:nO,seededRandom:iO,degToRad:sO,radToDeg:rO,isPowerOfTwo:aO,ceilPowerOfTwo:oO,floorPowerOfTwo:lO,setQuaternionFromProperEuler:cO,normalize:Dn,denormalize:ya};class st{constructor(e=0,t=0){st.prototype.isVector2=!0,this.x=e,this.y=t}get width(){return this.x}set width(e){this.x=e}get height(){return this.y}set height(e){this.y=e}set(e,t){return this.x=e,this.y=t,this}setScalar(e){return this.x=e,this.y=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y)}copy(e){return this.x=e.x,this.y=e.y,this}add(e){return this.x+=e.x,this.y+=e.y,this}addScalar(e){return this.x+=e,this.y+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this}
vendor: 6,509 bytes, line 78
78sub(e){return this.x-=e.x,this.y-=e.y,this}subScalar(e){return this.x-=e,this.y-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this}multiply(e){return this.x*=e.x,this.y*=e.y,this}multiplyScalar(e){return this.x*=e,this.y*=e,this}divide(e){return this.x/=e.x,this.y/=e.y,this}divideScalar(e){return this.multiplyScalar(1/e)}applyMatrix3(e){const t=this.x,n=this.y,s=e.elements;return this.x=s[0]*t+s[3]*n+s[6],this.y=s[1]*t+s[4]*n+s[7],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this}clamp(e,t){return this.x=An(this.x,e.x,t.x),this.y=An(this.y,e.y,t.y),this}clampScalar(e,t){return this.x=An(this.x,e,t),this.y=An(this.y,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(An(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this}negate(){return this.x=-this.x,this.y=-this.y,this}dot(e){return this.x*e.x+this.y*e.y}cross(e){return this.x*e.y-this.y*e.x}lengthSq(){return this.x*this.x+this.y*this.y}length(){return Math.sqrt(this.x*this.x+this.y*this.y)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)}normalize(){return this.divideScalar(this.length()||1)}angle(){return Math.atan2(-this.y,-this.x)+Math.PI}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(An(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y;return t*t+n*n}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this}equals(e){return e.x===this.x&&e.y===this.y}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this}rotateAround(e,t){const n=Math.cos(t),s=Math.sin(t),a=this.x-e.x,l=this.y-e.y;return this.x=a*n-l*s+e.x,this.y=a*s+l*n+e.y,this}random(){return this.x=Math.random(),this.y=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y}}class Cn{constructor(e,t,n,s,a,l,u,h,p){Cn.prototype.isMatrix3=!0,this.elements=[1,0,0,0,1,0,0,0,1],e!==void 0&&this.set(e,t,n,s,a,l,u,h,p)}set(e,t,n,s,a,l,u,h,p){const m=this.elements;return m[0]=e,m[1]=s,m[2]=u,m[3]=t,m[4]=a,m[5]=h,m[6]=n,m[7]=l,m[8]=p,this}identity(){return this.set(1,0,0,0,1,0,0,0,1),this}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],this}extractBasis(e,t,n){return e.setFromMatrix3Column(this,0),t.setFromMatrix3Column(this,1),n.setFromMatrix3Column(this,2),this}setFromMatrix4(e){const t=e.elements;return this.set(t[0],t[4],t[8],t[1],t[5],t[9],t[2],t[6],t[10]),this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,a=this.elements,l=n[0],u=n[3],h=n[6],p=n[1],m=n[4],v=n[7],x=n[2],_=n[5],A=n[8],R=s[0],w=s[3],E=s[6],D=s[1],L=s[4],P=s[7],G=s[2],H=s[5],F=s[8];return a[0]=l*R+u*D+h*G,a[3]=l*w+u*L+h*H,a[6]=l*E+u*P+h*F,a[1]=p*R+m*D+v*G,a[4]=p*w+m*L+v*H,a[7]=p*E+m*P+v*F,a[2]=x*R+_*D+A*G,a[5]=x*w+_*L+A*H,a[8]=x*E+_*P+A*F,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[3]*=e,t[6]*=e,t[1]*=e,t[4]*=e,t[7]*=e,t[2]*=e,t[5]*=e,t[8]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[1],s=e[2],a=e[3],l=e[4],u=e[5],h=e[6],p=e[7],m=e[8];return t*l*m-t*u*p-n*a*m+n*u*h+s*a*p-s*l*h}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],a=e[3],l=e[4],u=e[5],h=e[6],p=e[7],m=e[8],v=m*l-u*p,x=u*h-m*a,_=p*a-l*h,A=t*v+n*x+s*_;if(A===0)return this.set(0,0,0,0,0,0,0,0,0);const R=1/A;return e[0]=v*R,e[1]=(s*p-m*n)*R,e[2]=(u*n-s*l)*R,e[3]=x*R,e[4]=(m*t-s*h)*R,e[5]=(s*a-u*t)*R,e[6]=_*R,e[7]=(n*h-p*t)*R,e[8]=(l*t-n*a)*R,this}transpose(){let e;const t=this.elements;return e=t[1],t[1]=t[3],t[3]=e,e=t[2],t[2]=t[6],t[6]=e,e=t[5],t[5]=t[7],t[7]=e,this}getNormalMatrix(e){return this.setFromMatrix4(e).invert().transpose()}transposeIntoArray(e){const t=this.elements;return e[0]=t[0],e[1]=t[3],e[2]=t[6],e[3]=t[1],e[4]=t[4],e[5]=t[7],e[6]=t[2],e[7]=t[5],e[8]=t[8],this}setUvTransform(e,t,n,s,a,l,u){const h=Math.cos(a),p=Math.sin(a);return this.set(n*h,n*p,-n*(h*l+p*u)+l+e,-s*p,s*h,-s*(-p*l+h*u)+u+t,0,0,1),this}scale(e,t){return this.premultiply(_S.makeScale(e,t)),this}rotate(e){return this.premultiply(_S.makeRotation(-e)),this}translate(e,t){return this.premultiply(_S.makeTranslation(e,t)),this}makeTranslation(e,t){return e.isVector2?this.set(1,0,e.x,0,1,e.y,0,0,1):this.set(1,0,e,0,1,t,0,0,1),this}makeRotation(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,n,t,0,0,0,1),this}makeScale(e,t){return this.set(e,0,0,0,t,0,0,0,1),this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<9;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<9;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e}clone(){return new this.constructor().fromArray(this.elements)}}const _S=new Cn;function tI(i){for(let e=i.length-1;e>=0;--e)if(i[e]>=65535)return!0;return!1}const uO={Int8Array,Uint8Array,Uint8ClampedArray,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array};function fp(i,e){return new uO[i](e)}function J0(i){return document.createElementNS("http://www.w3.org/1999/xhtml",i)}function nI(){const i=J0("canvas");return i.style.display="block",i}const aT={};function _x(i){i in aT||(aT[i]=!0,console.warn(i))}function fO(i,e,t){return new Promise(function(n,s){function a(){switch(i.clientWaitSync(e,i.SYNC_FLUSH_COMMANDS_BIT,0)){case i.WAIT_FAILED:s();break;case i.TIMEOUT_EXPIRED:setTimeout(a,t);break;default:n()}}setTimeout(a,t)})}function dO(i){const e=i.elements;e[2]=.5*e[2]+.5*e[3],e[6]=.5*e[6]+.5*e[7],e[10]=.5*e[10]+.5*e[11],e[14]=.5*e[14]+.5*e[15]}function hO(i){const e=i.elements;e[11]===-1?(e[10]=-e[10]-1,e[14]=-e[14]):(e[10]=-e[10],e[14]=-e[14]+1)}
vendor: 4,729 bytes, line 78
78const oT=new Cn().set(.4123908,.3575843,.1804808,.212639,.7151687,.0721923,.0193308,.1191948,.9505322),lT=new Cn().set(3.2409699,-1.5373832,-.4986108,-.9692436,1.8759675,.0415551,.0556301,-.203977,1.0569715);function pO(){const i={enabled:!0,workingColorSpace:Wl,spaces:{},convert:function(s,a,l){return this.enabled===!1||a===l||!a||!l||(this.spaces[a].transfer===Ri&&(s.r=Uc(s.r),s.g=Uc(s.g),s.b=Uc(s.b)),this.spaces[a].primaries!==this.spaces[l].primaries&&(s.applyMatrix3(this.spaces[a].toXYZ),s.applyMatrix3(this.spaces[l].fromXYZ)),this.spaces[l].transfer===Ri&&(s.r=vp(s.r),s.g=vp(s.g),s.b=vp(s.b))),s},fromWorkingColorSpace:function(s,a){return this.convert(s,this.workingColorSpace,a)},toWorkingColorSpace:function(s,a){return this.convert(s,a,this.workingColorSpace)},getPrimaries:function(s){return this.spaces[s].primaries},getTransfer:function(s){return s===sl?X0:this.spaces[s].transfer},getLuminanceCoefficients:function(s,a=this.workingColorSpace){return s.fromArray(this.spaces[a].luminanceCoefficients)},define:function(s){Object.assign(this.spaces,s)},_getMatrix:function(s,a,l){return s.copy(this.spaces[a].toXYZ).multiply(this.spaces[l].fromXYZ)},_getDrawingBufferColorSpace:function(s){return this.spaces[s].outputColorSpaceConfig.drawingBufferColorSpace},_getUnpackColorSpace:function(s=this.workingColorSpace){return this.spaces[s].workingColorSpaceConfig.unpackColorSpace}},e=[.64,.33,.3,.6,.15,.06],t=[.2126,.7152,.0722],n=[.3127,.329];return i.define({[Wl]:{primaries:e,whitePoint:n,transfer:X0,toXYZ:oT,fromXYZ:lT,luminanceCoefficients:t,workingColorSpaceConfig:{unpackColorSpace:xi},outputColorSpaceConfig:{drawingBufferColorSpace:xi}},[xi]:{primaries:e,whitePoint:n,transfer:Ri,toXYZ:oT,fromXYZ:lT,luminanceCoefficients:t,outputColorSpaceConfig:{drawingBufferColorSpace:xi}}}),i}const si=pO();function Uc(i){return i<.04045?i*.0773993808:Math.pow(i*.9478672986+.0521327014,2.4)}function vp(i){return i<.0031308?i*12.92:1.055*Math.pow(i,.41666)-.055}let jh;class iI{static getDataURL(e,t="image/png"){if(/^data:/i.test(e.src)||typeof HTMLCanvasElement>"u")return e.src;let n;if(e instanceof HTMLCanvasElement)n=e;else{jh===void 0&&(jh=J0("canvas")),jh.width=e.width,jh.height=e.height;const s=jh.getContext("2d");e instanceof ImageData?s.putImageData(e,0,0):s.drawImage(e,0,0,e.width,e.height),n=jh}return n.toDataURL(t)}static sRGBToLinear(e){if(typeof HTMLImageElement<"u"&&e instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&e instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&e instanceof ImageBitmap){const t=J0("canvas");t.width=e.width,t.height=e.height;const n=t.getContext("2d");n.drawImage(e,0,0,e.width,e.height);const s=n.getImageData(0,0,e.width,e.height),a=s.data;for(let l=0;l<a.length;l++)a[l]=Uc(a[l]/255)*255;return n.putImageData(s,0,0),t}else if(e.data){const t=e.data.slice(0);for(let n=0;n<t.length;n++)t instanceof Uint8Array||t instanceof Uint8ClampedArray?t[n]=Math.floor(Uc(t[n]/255)*255):t[n]=Uc(t[n]);return{data:t,width:e.width,height:e.height}}else return console.warn("THREE.ImageUtils.sRGBToLinear(): Unsupported image type. No color space conversion applied."),e}}let mO=0;class Wu{constructor(e=null){this.isSource=!0,Object.defineProperty(this,"id",{value:mO++}),this.uuid=Za(),this.data=e,this.dataReady=!0,this.version=0}set needsUpdate(e){e===!0&&this.version++}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.images[this.uuid]!==void 0)return e.images[this.uuid];const n={uuid:this.uuid,url:""},s=this.data;if(s!==null){let a;if(Array.isArray(s)){a=[];for(let l=0,u=s.length;l<u;l++)s[l].isDataTexture?a.push(bS(s[l].image)):a.push(bS(s[l]))}else a=bS(s);n.url=a}return t||(e.images[this.uuid]=n),n}}function bS(i){return typeof HTMLImageElement<"u"&&i instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&i instanceof ImageBitmap?iI.getDataURL(i):i.data?{data:Array.from(i.data),width:i.width,height:i.height,type:i.data.constructor.name}:(console.warn("THREE.Texture: Unable to serialize Texture."),{})}let gO=0;class Ki extends eo{constructor(e=Ki.DEFAULT_IMAGE,t=Ki.DEFAULT_MAPPING,n=Ka,s=Ka,a=as,l=Do,u=Jr,h=vr,p=Ki.DEFAULT_ANISOTROPY,m=sl){super(),this.isTexture=!0,Object.defineProperty(this,"id",{value:gO++}),this.uuid=Za(),this.name="",this.source=new Wu(e),this.mipmaps=[],this.mapping=t,this.channel=0,this.wrapS=n,this.wrapT=s,this.magFilter=a,this.minFilter=l,this.anisotropy=p,this.format=u,this.internalFormat=null,this.type=h,this.offset=new st(0,0),this.repeat=new st(1,1),this.center=new st(0,0),this.rotation=0,this.matrixAutoUpdate=!0,this.matrix=new Cn,this.generateMipmaps=!0,this.premultiplyAlpha=!1,this.flipY=!0,this.unpackAlignment=4,this.colorSpace
vendor: 5,175 bytes, line 78
78=m,this.userData={},this.version=0,this.onUpdate=null,this.renderTarget=null,this.isRenderTargetTexture=!1,this.pmremVersion=0}get image(){return this.source.data}set image(e=null){this.source.data=e}updateMatrix(){this.matrix.setUvTransform(this.offset.x,this.offset.y,this.repeat.x,this.repeat.y,this.rotation,this.center.x,this.center.y)}clone(){return new this.constructor().copy(this)}copy(e){return this.name=e.name,this.source=e.source,this.mipmaps=e.mipmaps.slice(0),this.mapping=e.mapping,this.channel=e.channel,this.wrapS=e.wrapS,this.wrapT=e.wrapT,this.magFilter=e.magFilter,this.minFilter=e.minFilter,this.anisotropy=e.anisotropy,this.format=e.format,this.internalFormat=e.internalFormat,this.type=e.type,this.offset.copy(e.offset),this.repeat.copy(e.repeat),this.center.copy(e.center),this.rotation=e.rotation,this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrix.copy(e.matrix),this.generateMipmaps=e.generateMipmaps,this.premultiplyAlpha=e.premultiplyAlpha,this.flipY=e.flipY,this.unpackAlignment=e.unpackAlignment,this.colorSpace=e.colorSpace,this.renderTarget=e.renderTarget,this.isRenderTargetTexture=e.isRenderTargetTexture,this.userData=JSON.parse(JSON.stringify(e.userData)),this.needsUpdate=!0,this}toJSON(e){const t=e===void 0||typeof e=="string";if(!t&&e.textures[this.uuid]!==void 0)return e.textures[this.uuid];const n={metadata:{version:4.6,type:"Texture",generator:"Texture.toJSON"},uuid:this.uuid,name:this.name,image:this.source.toJSON(e).uuid,mapping:this.mapping,channel:this.channel,repeat:[this.repeat.x,this.repeat.y],offset:[this.offset.x,this.offset.y],center:[this.center.x,this.center.y],rotation:this.rotation,wrap:[this.wrapS,this.wrapT],format:this.format,internalFormat:this.internalFormat,type:this.type,colorSpace:this.colorSpace,minFilter:this.minFilter,magFilter:this.magFilter,anisotropy:this.anisotropy,flipY:this.flipY,generateMipmaps:this.generateMipmaps,premultiplyAlpha:this.premultiplyAlpha,unpackAlignment:this.unpackAlignment};return Object.keys(this.userData).length>0&&(n.userData=this.userData),t||(e.textures[this.uuid]=n),n}dispose(){this.dispatchEvent({type:"dispose"})}transformUv(e){if(this.mapping!==B_)return e;if(e.applyMatrix3(this.matrix),e.x<0||e.x>1)switch(this.wrapS){case Zu:e.x=e.x-Math.floor(e.x);break;case Ka:e.x=e.x<0?0:1;break;case bp:Math.abs(Math.floor(e.x)%2)===1?e.x=Math.ceil(e.x)-e.x:e.x=e.x-Math.floor(e.x);break}if(e.y<0||e.y>1)switch(this.wrapT){case Zu:e.y=e.y-Math.floor(e.y);break;case Ka:e.y=e.y<0?0:1;break;case bp:Math.abs(Math.floor(e.y)%2)===1?e.y=Math.ceil(e.y)-e.y:e.y=e.y-Math.floor(e.y);break}return this.flipY&&(e.y=1-e.y),e}set needsUpdate(e){e===!0&&(this.version++,this.source.needsUpdate=!0)}set needsPMREMUpdate(e){e===!0&&this.pmremVersion++}}Ki.DEFAULT_IMAGE=null;Ki.DEFAULT_MAPPING=B_;Ki.DEFAULT_ANISOTROPY=1;class oi{constructor(e=0,t=0,n=0,s=1){oi.prototype.isVector4=!0,this.x=e,this.y=t,this.z=n,this.w=s}get width(){return this.z}set width(e){this.z=e}get height(){return this.w}set height(e){this.w=e}set(e,t,n,s){return this.x=e,this.y=t,this.z=n,this.w=s,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this.w=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setW(e){return this.w=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;case 3:this.w=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;case 3:return this.w;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z,this.w)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this.w=e.w!==void 0?e.w:1,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this.w+=e.w,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this.w+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this.w=e.w+t.w,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this.w+=e.w*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this.w-=e.w,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this.w-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this.w=e.w-t.w,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this.w*=e.w,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this.w*=e,this}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,a=this.w,l=e.elements;return this.x=l[0]*t+l[4]*n+l[8]*s+l[12]*a,this.y=l[1]*t+l[5]*n+l[9]*s+l[13]*a,this.z=l[2]*t+l[6]*n+l[10]*s+l[14]*a,this.w=l[3]*t+l[7]*n+l[11]*s+l[15]*a,this}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this.w/=e.w,this}divideScalar(e){return this.multiplyScalar(1/e)}setAxisAngleFromQuaternion(e){this.w=2*Math.acos(e.w);const t=Math.sqrt(1-e.w*e.w);return t<1e-4?(this.x=1,this.y=0,this.z=0):(this.x=e.x/t,this.y=e.y/t,this.z=e.z/t),this}setAxisAngleFromRotationMatrix(e){let t,n,s,a;const h=e.elements,p=h[0],m=h[4],v=h[8],x=h[1],_=h[5],A=h[9],R=h[2],w=h[6],E=h[10];if(Math.abs(m-x)<.01&&Math.abs(v-R)<.01&&Math.abs(A-w)<.01){if(Math.abs(m+x)<.1&&Math.abs(v+R)<.1&&Math.abs(A+w)<.
vendor: 5,374 bytes, line 78
781&&Math.abs(p+_+E-3)<.1)return this.set(1,0,0,0),this;t=Math.PI;const L=(p+1)/2,P=(_+1)/2,G=(E+1)/2,H=(m+x)/4,F=(v+R)/4,X=(A+w)/4;return L>P&&L>G?L<.01?(n=0,s=.707106781,a=.707106781):(n=Math.sqrt(L),s=H/n,a=F/n):P>G?P<.01?(n=.707106781,s=0,a=.707106781):(s=Math.sqrt(P),n=H/s,a=X/s):G<.01?(n=.707106781,s=.707106781,a=0):(a=Math.sqrt(G),n=F/a,s=X/a),this.set(n,s,a,t),this}let D=Math.sqrt((w-A)*(w-A)+(v-R)*(v-R)+(x-m)*(x-m));return Math.abs(D)<.001&&(D=1),this.x=(w-A)/D,this.y=(v-R)/D,this.z=(x-m)/D,this.w=Math.acos((p+_+E-1)/2),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this.w=t[15],this}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this.w=Math.min(this.w,e.w),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this.w=Math.max(this.w,e.w),this}clamp(e,t){return this.x=An(this.x,e.x,t.x),this.y=An(this.y,e.y,t.y),this.z=An(this.z,e.z,t.z),this.w=An(this.w,e.w,t.w),this}clampScalar(e,t){return this.x=An(this.x,e,t),this.y=An(this.y,e,t),this.z=An(this.z,e,t),this.w=An(this.w,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(An(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this.w=Math.floor(this.w),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this.w=Math.ceil(this.w),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this.w=Math.round(this.w),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this.w=Math.trunc(this.w),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this.w=-this.w,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z+this.w*e.w}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z+this.w*this.w)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)+Math.abs(this.w)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this.w+=(e.w-this.w)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this.w=e.w+(t.w-e.w)*n,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z&&e.w===this.w}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this.w=e[t+3],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e[t+3]=this.w,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this.w=e.getW(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this.w=Math.random(),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z,yield this.w}}class F_ extends eo{constructor(e=1,t=1,n={}){super(),this.isRenderTarget=!0,this.width=e,this.height=t,this.depth=1,this.scissor=new oi(0,0,e,t),this.scissorTest=!1,this.viewport=new oi(0,0,e,t);const s={width:e,height:t,depth:1};n=Object.assign({generateMipmaps:!1,internalFormat:null,minFilter:as,depthBuffer:!0,stencilBuffer:!1,resolveDepthBuffer:!0,resolveStencilBuffer:!0,depthTexture:null,samples:0,count:1},n);const a=new Ki(s,n.mapping,n.wrapS,n.wrapT,n.magFilter,n.minFilter,n.format,n.type,n.anisotropy,n.colorSpace);a.flipY=!1,a.generateMipmaps=n.generateMipmaps,a.internalFormat=n.internalFormat,this.textures=[];const l=n.count;for(let u=0;u<l;u++)this.textures[u]=a.clone(),this.textures[u].isRenderTargetTexture=!0,this.textures[u].renderTarget=this;this.depthBuffer=n.depthBuffer,this.stencilBuffer=n.stencilBuffer,this.resolveDepthBuffer=n.resolveDepthBuffer,this.resolveStencilBuffer=n.resolveStencilBuffer,this._depthTexture=n.depthTexture,this.samples=n.samples}get texture(){return this.textures[0]}set texture(e){this.textures[0]=e}set depthTexture(e){this._depthTexture!==null&&(this._depthTexture.renderTarget=null),e!==null&&(e.renderTarget=this),this._depthTexture=e}get depthTexture(){return this._depthTexture}setSize(e,t,n=1){if(this.width!==e||this.height!==t||this.depth!==n){this.width=e,this.height=t,this.depth=n;for(let s=0,a=this.textures.length;s<a;s++)this.textures[s].image.width=e,this.textures[s].image.height=t,this.textures[s].image.depth=n;this.dispose()}this.viewport.set(0,0,e,t),this.scissor.set(0,0,e,t)}clone(){return new this.constructor().copy(this)}copy(e){this.width=e.width,this.height=e.height,this.depth=e.depth,this.scissor.copy(e.scissor),this.scissorTest=e.scissorTest,this.viewport.copy(e.viewport),this.textures.length=0;for(let t=0,n=e.textures.length;t<n;t++){this.textures[t]=e.textures[t].clone(),this.textures[t].isRenderTargetTexture=!0,this.textures[t].renderTarget=this;const s=Object.assign({},e.textures[t].image);this.textures[t].source=new Wu(s)}return this.depthBuffer=e.depthBuffer,this.stencilBuffer=e.stencilBuffer,this.resolveDepthBuffer=e.resolveDepthBuffer,this.resolveStencilBuffer=e.resolveStencilBuffer,e.depthTexture!==null&&(this.depthTexture=e.depthTexture.clone()),this.samples=e.samples,this}dispose(){this.dispatchEvent({type:"dispose"})}}class Ms extends F_{constructor(e=1,t=1,n={}
vendor: 8,641 bytes, line 78
78){super(e,t,n),this.isWebGLRenderTarget=!0}}class cg extends Ki{constructor(e=null,t=1,n=1,s=1){super(null),this.isDataArrayTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Ls,this.minFilter=Ls,this.wrapR=Ka,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class vO extends Ms{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGLArrayRenderTarget=!0,this.depth=n,this.texture=new cg(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class k_ extends Ki{constructor(e=null,t=1,n=1,s=1){super(null),this.isData3DTexture=!0,this.image={data:e,width:t,height:n,depth:s},this.magFilter=Ls,this.minFilter=Ls,this.wrapR=Ka,this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}class yO extends Ms{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isWebGL3DRenderTarget=!0,this.depth=n,this.texture=new k_(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class gr{constructor(e=0,t=0,n=0,s=1){this.isQuaternion=!0,this._x=e,this._y=t,this._z=n,this._w=s}static slerpFlat(e,t,n,s,a,l,u){let h=n[s+0],p=n[s+1],m=n[s+2],v=n[s+3];const x=a[l+0],_=a[l+1],A=a[l+2],R=a[l+3];if(u===0){e[t+0]=h,e[t+1]=p,e[t+2]=m,e[t+3]=v;return}if(u===1){e[t+0]=x,e[t+1]=_,e[t+2]=A,e[t+3]=R;return}if(v!==R||h!==x||p!==_||m!==A){let w=1-u;const E=h*x+p*_+m*A+v*R,D=E>=0?1:-1,L=1-E*E;if(L>Number.EPSILON){const G=Math.sqrt(L),H=Math.atan2(G,E*D);w=Math.sin(w*H)/G,u=Math.sin(u*H)/G}const P=u*D;if(h=h*w+x*P,p=p*w+_*P,m=m*w+A*P,v=v*w+R*P,w===1-u){const G=1/Math.sqrt(h*h+p*p+m*m+v*v);h*=G,p*=G,m*=G,v*=G}}e[t]=h,e[t+1]=p,e[t+2]=m,e[t+3]=v}static multiplyQuaternionsFlat(e,t,n,s,a,l){const u=n[s],h=n[s+1],p=n[s+2],m=n[s+3],v=a[l],x=a[l+1],_=a[l+2],A=a[l+3];return e[t]=u*A+m*v+h*_-p*x,e[t+1]=h*A+m*x+p*v-u*_,e[t+2]=p*A+m*_+u*x-h*v,e[t+3]=m*A-u*v-h*x-p*_,e}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get w(){return this._w}set w(e){this._w=e,this._onChangeCallback()}set(e,t,n,s){return this._x=e,this._y=t,this._z=n,this._w=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._w)}copy(e){return this._x=e.x,this._y=e.y,this._z=e.z,this._w=e.w,this._onChangeCallback(),this}setFromEuler(e,t=!0){const n=e._x,s=e._y,a=e._z,l=e._order,u=Math.cos,h=Math.sin,p=u(n/2),m=u(s/2),v=u(a/2),x=h(n/2),_=h(s/2),A=h(a/2);switch(l){case"XYZ":this._x=x*m*v+p*_*A,this._y=p*_*v-x*m*A,this._z=p*m*A+x*_*v,this._w=p*m*v-x*_*A;break;case"YXZ":this._x=x*m*v+p*_*A,this._y=p*_*v-x*m*A,this._z=p*m*A-x*_*v,this._w=p*m*v+x*_*A;break;case"ZXY":this._x=x*m*v-p*_*A,this._y=p*_*v+x*m*A,this._z=p*m*A+x*_*v,this._w=p*m*v-x*_*A;break;case"ZYX":this._x=x*m*v-p*_*A,this._y=p*_*v+x*m*A,this._z=p*m*A-x*_*v,this._w=p*m*v+x*_*A;break;case"YZX":this._x=x*m*v+p*_*A,this._y=p*_*v+x*m*A,this._z=p*m*A-x*_*v,this._w=p*m*v-x*_*A;break;case"XZY":this._x=x*m*v-p*_*A,this._y=p*_*v-x*m*A,this._z=p*m*A+x*_*v,this._w=p*m*v+x*_*A;break;default:console.warn("THREE.Quaternion: .setFromEuler() encountered an unknown order: "+l)}return t===!0&&this._onChangeCallback(),this}setFromAxisAngle(e,t){const n=t/2,s=Math.sin(n);return this._x=e.x*s,this._y=e.y*s,this._z=e.z*s,this._w=Math.cos(n),this._onChangeCallback(),this}setFromRotationMatrix(e){const t=e.elements,n=t[0],s=t[4],a=t[8],l=t[1],u=t[5],h=t[9],p=t[2],m=t[6],v=t[10],x=n+u+v;if(x>0){const _=.5/Math.sqrt(x+1);this._w=.25/_,this._x=(m-h)*_,this._y=(a-p)*_,this._z=(l-s)*_}else if(n>u&&n>v){const _=2*Math.sqrt(1+n-u-v);this._w=(m-h)/_,this._x=.25*_,this._y=(s+l)/_,this._z=(a+p)/_}else if(u>v){const _=2*Math.sqrt(1+u-n-v);this._w=(a-p)/_,this._x=(s+l)/_,this._y=.25*_,this._z=(h+m)/_}else{const _=2*Math.sqrt(1+v-n-u);this._w=(l-s)/_,this._x=(a+p)/_,this._y=(h+m)/_,this._z=.25*_}return this._onChangeCallback(),this}setFromUnitVectors(e,t){let n=e.dot(t)+1;return n<Number.EPSILON?(n=0,Math.abs(e.x)>Math.abs(e.z)?(this._x=-e.y,this._y=e.x,this._z=0,this._w=n):(this._x=0,this._y=-e.z,this._z=e.y,this._w=n)):(this._x=e.y*t.z-e.z*t.y,this._y=e.z*t.x-e.x*t.z,this._z=e.x*t.y-e.y*t.x,this._w=n),this.normalize()}angleTo(e){return 2*Math.acos(Math.abs(An(this.dot(e),-1,1)))}rotateTowards(e,t){const n=this.angleTo(e);if(n===0)return this;const s=Math.min(1,t/n);return this.slerp(e,s),this}identity(){return this.set(0,0,0,1)}invert(){return this.conjugate()}conjugate(){return this._x*=-1,this._y*=-1,this._z*=-1,this._onChangeCallback(),this}dot(e){return this._x*e._x+this._y*e._y+this._z*e._z+this._w*e._w}lengthSq(){return this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w}length(){return Math.sqrt(this._x*this._x+this._y*this._y+this._z*this._z+this._w*this._w)}normalize(){let e=this.length();return e===0?(this._x=0,this._y=0,this._z=0,this._w=1):(e=1/e,this._x=this._x*e,this._y=this._y*e,this._z=this._z*e,this._w=this._w*e),this._onChangeCallback(),this}multiply(e){return this.multiplyQuaternions(this,e)}premultiply(e){return this.multiplyQuaternions(e,this)}multiplyQuaternions(e,t){const n=e._x,s=e._y,a=e._z,l=e._w,u=t._x,h=t._y,p=t._z,m=t._w;return this._x=n*m+l*u+s*p-a*h,this._y=s*m+l*h+a*u-n*p,this._z=a*m+l*p+n*h-s*u,this._w=l*m-n*u-s*h-a*p,this._onChangeCallback(),this}slerp(e,t){if(t===0)return this;if(t===1)return this.copy(e);const n=this._x,s=this._y,a=this._z,l=this._w;let u=l*e._w+n*e._x+s*e._y+a*e._z;if(u<0?(this._w=-e._w,this._x=-e._x,this._y=-e._y,this._z=-e._z,u=-u):this.copy(e),u>=1)return this._w=l,this._x=n,this._y=s,this._z=a,this;const h=1-u*u;if(h<=Number.EPSILON){const _=1-t;return this._w=_*l+t*this._w,this._x=_*n+t*this._x,this._y=_*s+t*this._y,this._z=_*a+t*this._z,this.normalize(),this}const p=Math.sqrt(h),m=Math.atan2(p,u),v=Math.sin((1-t)*m)/p,x=Math.sin(t*m)/p;return this._w=l*v+this._w*x,this._x=n*v+this._x*x,this._y=s*v+this._y*x,this._z=a*v+this._z*x,this._onChangeCallback(),this}slerpQuaternions(e,t,n){return this.copy(e).slerp(t,n)}random(){const e=2*Math.PI*Math.random(),t=2*Math.PI*Math.random(),n=Math.random(),s=Math.sqrt(1-n),a=Math.sqrt(n);return this.set(s*Math.sin(e),s*Math.cos(e),a*Math.sin(t),a*Math.cos(t))}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._w===this._w}fromArray(e,t=0){return this._x=e[t],this._y=e[t+1],this._z=e[t+2],this._w=e[t+3],this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._w,e}fromBufferAttribute(e,t){return this._x=e.getX(t),this._y=e.getY(t),this._z=e.getZ(t),this._w=e.getW(t),this._onChangeCallback(),this}toJSON(){return this.toArray()}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._w}}class se{constructor(e=0,t=0,n=0){se.prototype.isVector3=!0,this.x=e,this.y=t,this.z=n}set(e,t,n){return n===void 0&&(n=this.z),this.x=e,this.y=t,this.z=n,this}setScalar(e){return this.x=e,this.y=e,this.z=e,this}setX(e){return this.x=e,this}setY(e){return this.y=e,this}setZ(e){return this.z=e,this}setComponent(e,t){switch(e){case 0:this.x=t;break;case 1:this.y=t;break;case 2:this.z=t;break;default:throw new Error("index is out of range: "+e)}return this}getComponent(e){switch(e){case 0:return this.x;case 1:return this.y;case 2:return this.z;default:throw new Error("index is out of range: "+e)}}clone(){return new this.constructor(this.x,this.y,this.z)}copy(e){return this.x=e.x,this.y=e.y,this.z=e.z,this}add(e){return this.x+=e.x,this.y+=e.y,this.z+=e.z,this}addScalar(e){return this.x+=e,this.y+=e,this.z+=e,this}addVectors(e,t){return this.x=e.x+t.x,this.y=e.y+t.y,this.z=e.z+t.z,this}addScaledVector(e,t){return this.x+=e.x*t,this.y+=e.y*t,this.z+=e.z*t,this}sub(e){return this.x-=e.x,this.y-=e.y,this.z-=e.z,this}subScalar(e){return this.x-=e,this.y-=e,this.z-=e,this}subVectors(e,t){return this.x=e.x-t.x,this.y=e.y-t.y,this.z=e.z-t.z,this}multiply(e){return this.x*=e.x,this.y*=e.y,this.z*=e.z,this}multiplyScalar(e){return this.x*=e,this.y*=e,this.z*=e,this}multiplyVectors(e,t){return this.x=e.x*t.x,this.y=e.y*t.y,this.z=e.z*t.z,this}applyEuler(e){return this.applyQuaternion(cT.setFromEuler(e))}applyAxisAngle(e,t){return this.applyQuaternion(cT.setFromAxisAngle(e,t))}applyMatrix3(e){const t=this.x,n=this.y,s=this.z,a=e.elements;return this.x=a[0]*t+a[3]*n+a[6]*s,this.y=a[1]*t+a[4]*n+a[7]*s,this.z=a[2]*t+a[5]*n+a[8]*s,this}applyNormalMatrix(e){return this.applyMatrix3(e).normalize()}applyMatrix4(e){const t=this.x,n=this.y,s=this.z,a=e.elements,l=1/(a[3]*t+a[7]*n+a[11]*s+a[15]);
vendor: 7,302 bytes, line 78
78return this.x=(a[0]*t+a[4]*n+a[8]*s+a[12])*l,this.y=(a[1]*t+a[5]*n+a[9]*s+a[13])*l,this.z=(a[2]*t+a[6]*n+a[10]*s+a[14])*l,this}applyQuaternion(e){const t=this.x,n=this.y,s=this.z,a=e.x,l=e.y,u=e.z,h=e.w,p=2*(l*s-u*n),m=2*(u*t-a*s),v=2*(a*n-l*t);return this.x=t+h*p+l*v-u*m,this.y=n+h*m+u*p-a*v,this.z=s+h*v+a*m-l*p,this}project(e){return this.applyMatrix4(e.matrixWorldInverse).applyMatrix4(e.projectionMatrix)}unproject(e){return this.applyMatrix4(e.projectionMatrixInverse).applyMatrix4(e.matrixWorld)}transformDirection(e){const t=this.x,n=this.y,s=this.z,a=e.elements;return this.x=a[0]*t+a[4]*n+a[8]*s,this.y=a[1]*t+a[5]*n+a[9]*s,this.z=a[2]*t+a[6]*n+a[10]*s,this.normalize()}divide(e){return this.x/=e.x,this.y/=e.y,this.z/=e.z,this}divideScalar(e){return this.multiplyScalar(1/e)}min(e){return this.x=Math.min(this.x,e.x),this.y=Math.min(this.y,e.y),this.z=Math.min(this.z,e.z),this}max(e){return this.x=Math.max(this.x,e.x),this.y=Math.max(this.y,e.y),this.z=Math.max(this.z,e.z),this}clamp(e,t){return this.x=An(this.x,e.x,t.x),this.y=An(this.y,e.y,t.y),this.z=An(this.z,e.z,t.z),this}clampScalar(e,t){return this.x=An(this.x,e,t),this.y=An(this.y,e,t),this.z=An(this.z,e,t),this}clampLength(e,t){const n=this.length();return this.divideScalar(n||1).multiplyScalar(An(n,e,t))}floor(){return this.x=Math.floor(this.x),this.y=Math.floor(this.y),this.z=Math.floor(this.z),this}ceil(){return this.x=Math.ceil(this.x),this.y=Math.ceil(this.y),this.z=Math.ceil(this.z),this}round(){return this.x=Math.round(this.x),this.y=Math.round(this.y),this.z=Math.round(this.z),this}roundToZero(){return this.x=Math.trunc(this.x),this.y=Math.trunc(this.y),this.z=Math.trunc(this.z),this}negate(){return this.x=-this.x,this.y=-this.y,this.z=-this.z,this}dot(e){return this.x*e.x+this.y*e.y+this.z*e.z}lengthSq(){return this.x*this.x+this.y*this.y+this.z*this.z}length(){return Math.sqrt(this.x*this.x+this.y*this.y+this.z*this.z)}manhattanLength(){return Math.abs(this.x)+Math.abs(this.y)+Math.abs(this.z)}normalize(){return this.divideScalar(this.length()||1)}setLength(e){return this.normalize().multiplyScalar(e)}lerp(e,t){return this.x+=(e.x-this.x)*t,this.y+=(e.y-this.y)*t,this.z+=(e.z-this.z)*t,this}lerpVectors(e,t,n){return this.x=e.x+(t.x-e.x)*n,this.y=e.y+(t.y-e.y)*n,this.z=e.z+(t.z-e.z)*n,this}cross(e){return this.crossVectors(this,e)}crossVectors(e,t){const n=e.x,s=e.y,a=e.z,l=t.x,u=t.y,h=t.z;return this.x=s*h-a*u,this.y=a*l-n*h,this.z=n*u-s*l,this}projectOnVector(e){const t=e.lengthSq();if(t===0)return this.set(0,0,0);const n=e.dot(this)/t;return this.copy(e).multiplyScalar(n)}projectOnPlane(e){return SS.copy(this).projectOnVector(e),this.sub(SS)}reflect(e){return this.sub(SS.copy(e).multiplyScalar(2*this.dot(e)))}angleTo(e){const t=Math.sqrt(this.lengthSq()*e.lengthSq());if(t===0)return Math.PI/2;const n=this.dot(e)/t;return Math.acos(An(n,-1,1))}distanceTo(e){return Math.sqrt(this.distanceToSquared(e))}distanceToSquared(e){const t=this.x-e.x,n=this.y-e.y,s=this.z-e.z;return t*t+n*n+s*s}manhattanDistanceTo(e){return Math.abs(this.x-e.x)+Math.abs(this.y-e.y)+Math.abs(this.z-e.z)}setFromSpherical(e){return this.setFromSphericalCoords(e.radius,e.phi,e.theta)}setFromSphericalCoords(e,t,n){const s=Math.sin(t)*e;return this.x=s*Math.sin(n),this.y=Math.cos(t)*e,this.z=s*Math.cos(n),this}setFromCylindrical(e){return this.setFromCylindricalCoords(e.radius,e.theta,e.y)}setFromCylindricalCoords(e,t,n){return this.x=e*Math.sin(t),this.y=n,this.z=e*Math.cos(t),this}setFromMatrixPosition(e){const t=e.elements;return this.x=t[12],this.y=t[13],this.z=t[14],this}setFromMatrixScale(e){const t=this.setFromMatrixColumn(e,0).length(),n=this.setFromMatrixColumn(e,1).length(),s=this.setFromMatrixColumn(e,2).length();return this.x=t,this.y=n,this.z=s,this}setFromMatrixColumn(e,t){return this.fromArray(e.elements,t*4)}setFromMatrix3Column(e,t){return this.fromArray(e.elements,t*3)}setFromEuler(e){return this.x=e._x,this.y=e._y,this.z=e._z,this}setFromColor(e){return this.x=e.r,this.y=e.g,this.z=e.b,this}equals(e){return e.x===this.x&&e.y===this.y&&e.z===this.z}fromArray(e,t=0){return this.x=e[t],this.y=e[t+1],this.z=e[t+2],this}toArray(e=[],t=0){return e[t]=this.x,e[t+1]=this.y,e[t+2]=this.z,e}fromBufferAttribute(e,t){return this.x=e.getX(t),this.y=e.getY(t),this.z=e.getZ(t),this}random(){return this.x=Math.random(),this.y=Math.random(),this.z=Math.random(),this}randomDirection(){const e=Math.random()*Math.PI*2,t=Math.random()*2-1,n=Math.sqrt(1-t*t);return this.x=n*Math.cos(e),this.y=t,this.z=n*Math.sin(e),this}*[Symbol.iterator](){yield this.x,yield this.y,yield this.z}}const SS=new se,cT=new gr;class $r{constructor(e=new se(1/0,1/0,1/0),t=new se(-1/0,-1/0,-1/0)){this.isBox3=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromArray(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t+=3)this.expandByPoint(Qo.fromArray(e,t));return this}setFromBufferAttribute(e){this.makeEmpty();for(let t=0,n=e.count;t<n;t++)this.expandByPoint(Qo.fromBufferAttribute(e,t));return this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=Qo.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}setFromObject(e,t=!1){return this.makeEmpty(),this.expandByObject(e,t)}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=this.min.z=1/0,this.max.x=this.max.y=this.max.z=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y||this.max.z<this.min.z}getCenter(e){return this.isEmpty()?e.set(0,0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}expandByObject(e,t=!1){e.updateWorldMatrix(!1,!1);const n=e.geometry;if(n!==void 0){const a=n.getAttribute("position");if(t===!0&&a!==void 0&&e.isInstancedMesh!==!0)for(let l=0,u=a.count;l<u;l++)e.isMesh===!0?e.getVertexPosition(l,Qo):Qo.fromBufferAttribute(a,l),Qo.applyMatrix4(e.matrixWorld),this.expandByPoint(Qo);else e.boundingBox!==void 0?(e.boundingBox===null&&e.computeBoundingBox(),py.copy(e.boundingBox)):(n.boundingBox===null&&n.computeBoundingBox(),py.copy(n.boundingBox)),py.applyMatrix4(e.matrixWorld),this.union(py)}const s=e.children;for(let a=0,l=s.length;a<l;a++)this.expandByObject(s[a],t);return this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y&&e.z>=this.min.z&&e.z<=this.max.z}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y&&this.min.z<=e.min.z&&e.max.z<=this.max.z}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y),(e.z-this.min.z)/(this.max.z-this.min.z))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y&&e.max.z>=this.min.z&&e.min.z<=this.max.z}intersectsSphere(e){return this.clampPoint(e.center,Qo),Qo.distanceToSquared(e.center)<=e.radius*e.radiu
vendor: 19,896 bytes, line 78
78s}intersectsPlane(e){let t,n;return e.normal.x>0?(t=e.normal.x*this.min.x,n=e.normal.x*this.max.x):(t=e.normal.x*this.max.x,n=e.normal.x*this.min.x),e.normal.y>0?(t+=e.normal.y*this.min.y,n+=e.normal.y*this.max.y):(t+=e.normal.y*this.max.y,n+=e.normal.y*this.min.y),e.normal.z>0?(t+=e.normal.z*this.min.z,n+=e.normal.z*this.max.z):(t+=e.normal.z*this.max.z,n+=e.normal.z*this.min.z),t<=-e.constant&&n>=-e.constant}intersectsTriangle(e){if(this.isEmpty())return!1;this.getCenter(c0),my.subVectors(this.max,c0),Vh.subVectors(e.a,c0),Wh.subVectors(e.b,c0),Xh.subVectors(e.c,c0),Du.subVectors(Wh,Vh),Lu.subVectors(Xh,Wh),Wf.subVectors(Vh,Xh);let t=[0,-Du.z,Du.y,0,-Lu.z,Lu.y,0,-Wf.z,Wf.y,Du.z,0,-Du.x,Lu.z,0,-Lu.x,Wf.z,0,-Wf.x,-Du.y,Du.x,0,-Lu.y,Lu.x,0,-Wf.y,Wf.x,0];return!AS(t,Vh,Wh,Xh,my)||(t=[1,0,0,0,1,0,0,0,1],!AS(t,Vh,Wh,Xh,my))?!1:(gy.crossVectors(Du,Lu),t=[gy.x,gy.y,gy.z],AS(t,Vh,Wh,Xh,my))}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,Qo).distanceTo(e)}getBoundingSphere(e){return this.isEmpty()?e.makeEmpty():(this.getCenter(e.center),e.radius=this.getSize(Qo).length()*.5),e}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}applyMatrix4(e){return this.isEmpty()?this:(_c[0].set(this.min.x,this.min.y,this.min.z).applyMatrix4(e),_c[1].set(this.min.x,this.min.y,this.max.z).applyMatrix4(e),_c[2].set(this.min.x,this.max.y,this.min.z).applyMatrix4(e),_c[3].set(this.min.x,this.max.y,this.max.z).applyMatrix4(e),_c[4].set(this.max.x,this.min.y,this.min.z).applyMatrix4(e),_c[5].set(this.max.x,this.min.y,this.max.z).applyMatrix4(e),_c[6].set(this.max.x,this.max.y,this.min.z).applyMatrix4(e),_c[7].set(this.max.x,this.max.y,this.max.z).applyMatrix4(e),this.setFromPoints(_c),this)}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const _c=[new se,new se,new se,new se,new se,new se,new se,new se],Qo=new se,py=new $r,Vh=new se,Wh=new se,Xh=new se,Du=new se,Lu=new se,Wf=new se,c0=new se,my=new se,gy=new se,Xf=new se;function AS(i,e,t,n,s){for(let a=0,l=i.length-3;a<=l;a+=3){Xf.fromArray(i,a);const u=s.x*Math.abs(Xf.x)+s.y*Math.abs(Xf.y)+s.z*Math.abs(Xf.z),h=e.dot(Xf),p=t.dot(Xf),m=n.dot(Xf);if(Math.max(-Math.max(h,p,m),Math.min(h,p,m))>u)return!1}return!0}const xO=new $r,u0=new se,MS=new se;class Dr{constructor(e=new se,t=-1){this.isSphere=!0,this.center=e,this.radius=t}set(e,t){return this.center.copy(e),this.radius=t,this}setFromPoints(e,t){const n=this.center;t!==void 0?n.copy(t):xO.setFromPoints(e).getCenter(n);let s=0;for(let a=0,l=e.length;a<l;a++)s=Math.max(s,n.distanceToSquared(e[a]));return this.radius=Math.sqrt(s),this}copy(e){return this.center.copy(e.center),this.radius=e.radius,this}isEmpty(){return this.radius<0}makeEmpty(){return this.center.set(0,0,0),this.radius=-1,this}containsPoint(e){return e.distanceToSquared(this.center)<=this.radius*this.radius}distanceToPoint(e){return e.distanceTo(this.center)-this.radius}intersectsSphere(e){const t=this.radius+e.radius;return e.center.distanceToSquared(this.center)<=t*t}intersectsBox(e){return e.intersectsSphere(this)}intersectsPlane(e){return Math.abs(e.distanceToPoint(this.center))<=this.radius}clampPoint(e,t){const n=this.center.distanceToSquared(e);return t.copy(e),n>this.radius*this.radius&&(t.sub(this.center).normalize(),t.multiplyScalar(this.radius).add(this.center)),t}getBoundingBox(e){return this.isEmpty()?(e.makeEmpty(),e):(e.set(this.center,this.center),e.expandByScalar(this.radius),e)}applyMatrix4(e){return this.center.applyMatrix4(e),this.radius=this.radius*e.getMaxScaleOnAxis(),this}translate(e){return this.center.add(e),this}expandByPoint(e){if(this.isEmpty())return this.center.copy(e),this.radius=0,this;u0.subVectors(e,this.center);const t=u0.lengthSq();if(t>this.radius*this.radius){const n=Math.sqrt(t),s=(n-this.radius)*.5;this.center.addScaledVector(u0,s/n),this.radius+=s}return this}union(e){return e.isEmpty()?this:this.isEmpty()?(this.copy(e),this):(this.center.equals(e.center)===!0?this.radius=Math.max(this.radius,e.radius):(MS.subVectors(e.center,this.center).setLength(e.radius),this.expandByPoint(u0.copy(e.center).add(MS)),this.expandByPoint(u0.copy(e.center).sub(MS))),this)}equals(e){return e.center.equals(this.center)&&e.radius===this.radius}clone(){return new this.constructor().copy(this)}}const bc=new se,ES=new se,vy=new se,Pu=new se,TS=new se,yy=new se,wS=new se;class Lp{constructor(e=new se,t=new se(0,0,-1)){this.origin=e,this.direction=t}set(e,t){return this.origin.copy(e),this.direction.copy(t),this}copy(e){return this.origin.copy(e.origin),this.direction.copy(e.direction),this}at(e,t){return t.copy(this.origin).addScaledVector(this.direction,e)}lookAt(e){return this.direction.copy(e).sub(this.origin).normalize(),this}recast(e){return this.origin.copy(this.at(e,bc)),this}closestPointToPoint(e,t){t.subVectors(e,this.origin);const n=t.dot(this.direction);return n<0?t.copy(this.origin):t.copy(this.origin).addScaledVector(this.direction,n)}distanceToPoint(e){return Math.sqrt(this.distanceSqToPoint(e))}distanceSqToPoint(e){const t=bc.subVectors(e,this.origin).dot(this.direction);return t<0?this.origin.distanceToSquared(e):(bc.copy(this.origin).addScaledVector(this.direction,t),bc.distanceToSquared(e))}distanceSqToSegment(e,t,n,s){ES.copy(e).add(t).multiplyScalar(.5),vy.copy(t).sub(e).normalize(),Pu.copy(this.origin).sub(ES);const a=e.distanceTo(t)*.5,l=-this.direction.dot(vy),u=Pu.dot(this.direction),h=-Pu.dot(vy),p=Pu.lengthSq(),m=Math.abs(1-l*l);let v,x,_,A;if(m>0)if(v=l*h-u,x=l*u-h,A=a*m,v>=0)if(x>=-A)if(x<=A){const R=1/m;v*=R,x*=R,_=v*(v+l*x+2*u)+x*(l*v+x+2*h)+p}else x=a,v=Math.max(0,-(l*x+u)),_=-v*v+x*(x+2*h)+p;else x=-a,v=Math.max(0,-(l*x+u)),_=-v*v+x*(x+2*h)+p;else x<=-A?(v=Math.max(0,-(-l*a+u)),x=v>0?-a:Math.min(Math.max(-a,-h),a),_=-v*v+x*(x+2*h)+p):x<=A?(v=0,x=Math.min(Math.max(-a,-h),a),_=x*(x+2*h)+p):(v=Math.max(0,-(l*a+u)),x=v>0?a:Math.min(Math.max(-a,-h),a),_=-v*v+x*(x+2*h)+p);else x=l>0?-a:a,v=Math.max(0,-(l*x+u)),_=-v*v+x*(x+2*h)+p;return n&&n.copy(this.origin).addScaledVector(this.direction,v),s&&s.copy(ES).addScaledVector(vy,x),_}intersectSphere(e,t){bc.subVectors(e.center,this.origin);const n=bc.dot(this.direction),s=bc.dot(bc)-n*n,a=e.radius*e.radius;if(s>a)return null;const l=Math.sqrt(a-s),u=n-l,h=n+l;return h<0?null:u<0?this.at(h,t):this.at(u,t)}intersectsSphere(e){return this.distanceSqToPoint(e.center)<=e.radius*e.radius}distanceToPlane(e){const t=e.normal.dot(this.direction);if(t===0)return e.distanceToPoint(this.origin)===0?0:null;const n=-(this.origin.dot(e.normal)+e.constant)/t;return n>=0?n:null}intersectPlane(e,t){const n=this.distanceToPlane(e);return n===null?null:this.at(n,t)}intersectsPlane(e){const t=e.distanceToPoint(this.origin);return t===0||e.normal.dot(this.direction)*t<0}intersectBox(e,t){let n,s,a,l,u,h;const p=1/this.direction.x,m=1/this.direction.y,v=1/this.direction.z,x=this.origin;return p>=0?(n=(e.min.x-x.x)*p,s=(e.max.x-x.x)*p):(n=(e.max.x-x.x)*p,s=(e.min.x-x.x)*p),m>=0?(a=(e.min.y-x.y)*m,l=(e.max.y-x.y)*m):(a=(e.max.y-x.y)*m,l=(e.min.y-x.y)*m),n>l||a>s||((a>n||isNaN(n))&&(n=a),(l<s||isNaN(s))&&(s=l),v>=0?(u=(e.min.z-x.z)*v,h=(e.max.z-x.z)*v):(u=(e.max.z-x.z)*v,h=(e.min.z-x.z)*v),n>h||u>s)||((u>n||n!==n)&&(n=u),(h<s||s!==s)&&(s=h),s<0)?null:this.at(n>=0?n:s,t)}intersectsBox(e){return this.intersectBox(e,bc)!==null}intersectTriangle(e,t,n,s,a){TS.subVectors(t,e),yy.subVectors(n,e),wS.crossVectors(TS,yy);let l=this.direction.dot(wS),u;if(l>0){if(s)return null;u=1}else if(l<0)u=-1,l=-l;else return null;Pu.subVectors(this.origin,e);const h=u*this.direction.dot(yy.crossVectors(Pu,yy));if(h<0)return null;const p=u*this.direction.dot(TS.cross(Pu));if(p<0||h+p>l)return null;const m=-u*Pu.dot(wS);return m<0?null:this.at(m/l,a)}applyMatrix4(e){return this.origin.applyMatrix4(e),this.direction.transformDirection(e),this}equals(e){return e.origin.equals(this.origin)&&e.direction.equals(this.direction)}clone(){return new this.constructor().copy(this)}}class dn{constructor(e,t,n,s,a,l,u,h,p,m,v,x,_,A,R,w){dn.prototype.isMatrix4=!0,this.elements=[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1],e!==void 0&&this.set(e,t,n,s,a,l,u,h,p,m,v,x,_,A,R,w)}set(e,t,n,s,a,l,u,h,p,m,v,x,_,A,R,w){const E=this.elements;return E[0]=e,E[4]=t,E[8]=n,E[12]=s,E[1]=a,E[5]=l,E[9]=u,E[13]=h,E[2]=p,E[6]=m,E[10]=v,E[14]=x,E[3]=_,E[7]=A,E[11]=R,E[15]=w,this}identity(){return this.set(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1),this}clone(){return new dn().fromArray(this.elements)}copy(e){const t=this.elements,n=e.elements;return t[0]=n[0],t[1]=n[1],t[2]=n[2],t[3]=n[3],t[4]=n[4],t[5]=n[5],t[6]=n[6],t[7]=n[7],t[8]=n[8],t[9]=n[9],t[10]=n[10],t[11]=n[11],t[12]=n[12],t[13]=n[13],t[14]=n[14],t[15]=n[15],this}copyPosition(e){const t=this.elements,n=e.elements;return t[12]=n[12],t[13]=n[13],t[14]=n[14],this}setFromMatrix3(e){const t=e.elements;return this.set(t[0],t[3],t[6],0,t[1],t[4],t[7],0,t[2],t[5],t[8],0,0,0,0,1),this}extractBasis(e,t,n){return e.setFromMatrixColumn(this,0),t.setFromMatrixColumn(this,1),n.setFromMatrixColumn(this,2),this}makeBasis(e,t,n){return this.set(e.x,t.x,n.x,0,e.y,t.y,n.y,0,e.z,t.z,n.z,0,0,0,0,1),this}extractRotation(e){const t=this.elements,n=e.elements,s=1/qh.setFromMatrixColumn(e,0).length(),a=1/qh.setFromMatrixColumn(e,1).length(),l=1/qh.setFromMatrixColumn(e,2).length();return t[0]=n[0]*s,t[1]=n[1]*s,t[2]=n[2]*s,t[3]=0,t[4]=n[4]*a,t[5]=n[5]*a,t[6]=n[6]*a,t[7]=0,t[8]=n[8]*l,t[9]=n[9]*l,t[10]=n[10]*l,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromEuler(e){const t=this.elements,n=e.x,s=e.y,a=e.z,l=Math.cos(n),u=Math.sin(n),h=Math.cos(s),p=Math.sin(s),m=Math.cos(a),v=Math.sin(a);if(e.order==="XYZ"){const x=l*m,_=l*v,A=u*m,R=u*v;t[0]=h*m,t[4]=-h*v,t[8]=p,t[1]=_+A*p,t[5]=x-R*p,t[9]=-u*h,t[2]=R-x*p,t[6]=A+_*p,t[10]=l*h}else if(e.order==="YXZ"){const x=h*m,_=h*v,A=p*m,R=p*v;t[0]=x+R*u,t[4]=A*u-_,t[8]=l*p,t[1]=l*v,t[5]=l*m,t[9]=-u,t[2]=_*u-A,t[6]=R+x*u,t[10]=l*h}else if(e.order==="ZXY"){const x=h*m,_=h*v,A=p*m,R=p*v;t[0]=x-R*u,t[4]=-l*v,t[8]=A+_*u,t[1]=_+A*u,t[5]=l*m,t[9]=R-x*u,t[2]=-l*p,t[6]=u,t[10]=l*h}else if(e.order==="ZYX"){const x=l*m,_=l*v,A=u*m,R=u*v;t[0]=h*m,t[4]=A*p-_,t[8]=x*p+R,t[1]=h*v,t[5]=R*p+x,t[9]=_*p-A,t[2]=-p,t[6]=u*h,t[10]=l*h}else if(e.order==="YZX"){const x=l*h,_=l*p,A=u*h,R=u*p;t[0]=h*m,t[4]=R-x*v,t[8]=A*v+_,t[1]=v,t[5]=l*m,t[9]=-u*m,t[2]=-p*m,t[6]=_*v+A,t[10]=x-R*v}else if(e.order==="XZY"){const x=l*h,_=l*p,A=u*h,R=u*p;t[0]=h*m,t[4]=-v,t[8]=p*m,t[1]=x*v+R,t[5]=l*m,t[9]=_*v-A,t[2]=A*v-_,t[6]=u*m,t[10]=R*v+x}return t[3]=0,t[7]=0,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,this}makeRotationFromQuaternion(e){return this.compose(_O,e,bO)}lookAt(e,t,n){const s=this.elements;return Ya.subVectors(e,t),Ya.lengthSq()===0&&(Ya.z=1),Ya.normalize(),Ou.crossVectors(n,Ya),Ou.lengthSq()===0&&(Math.abs(n.z)===1?Ya.x+=1e-4:Ya.z+=1e-4,Ya.normalize(),Ou.crossVectors(n,Ya)),Ou.normalize(),xy.crossVectors(Ya,Ou),s[0]=Ou.x,s[4]=xy.x,s[8]=Ya.x,s[1]=Ou.y,s[5]=xy.y,s[9]=Ya.y,s[2]=Ou.z,s[6]=xy.z,s[10]=Ya.z,this}multiply(e){return this.multiplyMatrices(this,e)}premultiply(e){return this.multiplyMatrices(e,this)}multiplyMatrices(e,t){const n=e.elements,s=t.elements,a=this.elements,l=n[0],u=n[4],h=n[8],p=n[12],m=n[1],v=n[5],x=n[9],_=n[13],A=n[2],R=n[6],w=n[10],E=n[14],D=n[3],L=n[7],P=n[11],G=n[15],H=s[0],F=s[4],X=s[8],z=s[12],k=s[1],ie=s[5],ve=s[9],J=s[13],le=s[2],ae=s[6],W=s[10],ee=s[14],te=s[3],ue=s[7],he=s[11],K=s[15];return a[0]=l*H+u*k+h*le+p*te,a[4]=l*F+u*ie+h*ae+p*ue,a[8]=l*X+u*ve+h*W+p*he,a[12]=l*z+u*J+h*ee+p*K,a[1]=m*H+v*k+x*le+_*te,a[5]=m*F+v*ie+x*ae+_*ue,a[9]=m*X+v*ve+x*W+_*he,a[13]=m*z+v*J+x*ee+_*K,a[2]=A*H+R*k+w*le+E*te,a[6]=A*F+R*ie+w*ae+E*ue,a[10]=A*X+R*ve+w*W+E*he,a[14]=A*z+R*J+w*ee+E*K,a[3]=D*H+L*k+P*le+G*te,a[7]=D*F+L*ie+P*ae+G*ue,a[11]=D*X+L*ve+P*W+G*he,a[15]=D*z+L*J+P*ee+G*K,this}multiplyScalar(e){const t=this.elements;return t[0]*=e,t[4]*=e,t[8]*=e,t[12]*=e,t[1]*=e,t[5]*=e,t[9]*=e,t[13]*=e,t[2]*=e,t[6]*=e,t[10]*=e,t[14]*=e,t[3]*=e,t[7]*=e,t[11]*=e,t[15]*=e,this}determinant(){const e=this.elements,t=e[0],n=e[4],s=e[8],a=e[12],l=e[1],u=e[5],h=e[9],p=e[13],m=e[2],v=e[6],x=e[10],_=e[14],A=e[3],R=e[7],w=e[11],E=e[15];return A*(+a*h*v-s*p*v-a*u*x+n*p*x+s*u*_-n*h*_)+R*(+t*h*_-t*p*x+a*l*x-s*l*_+s*p*m-a*h*m)+w*(+t*p*v-t*u*_-a*l*v+n*l*_+a*u*m-n*p*m)+E*(-s*u*m-t*h*v+t*u*x+s*l*v-n*l*x+n*h*m)}transpose(){const e=this.elements;let t;return t=e[1],e[1]=e[4],e[4]=t,t=e[2],e[2]=e[8],e[8]=t,t=e[6],e[6]=e[9],e[9]=t,t=e[3],e[3]=e[12],e[12]=t,t=e[7],e[7]=e[13],e[13]=t,t=e[11],e[11]=e[14],e[14]=t,this}setPosition(e,t,n){const s=this.elements;return e.isVector3?(s[12]=e.x,s[13]=e.y,s[14]=e.z):(s[12]=e,s[13]=t,s[14]=n),this}invert(){const e=this.elements,t=e[0],n=e[1],s=e[2],a=e[3],l=e[4],u=e[5],h=e[6],p=e[7],m=e[8],v=e[9],x=e[10],_=e[11],A=e[12],R=e[13],w=e[14],E=e[15],D=v*w*p-R*x*p+R*h*_-u*w*_-v*h*E+u*x*E,L=A*x*p-m*w*p-A*h*_+l*w*_+m*h*E-l*x*E,P=m*R*p-A*v*p+A*u*_-l*R*_-m*u*E+l*v*E,G=A*v*h-m*R*h-A*u*x+l*R*x+m*u*w-l*v*w,H=t*D+n*L+s*P+a*G;if(H===0)return this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0);const F=1/H;return e[0]=D*F,e[1]=(R*x*a-v*w*a-R*s*_+n*w*_+v*s*E-n*x*E)*F,e[2]=(u*w*a-R*h*a+R*s*p-n*w*p-u*s*E+n*h*E)*F,e[3]=(v*h*a-u*x*a-v*s*p+n*x*p+u*s*_-n*h*_)*F,e[4]=L*F,e[5]=(m*w*a-A*x*a+A*s*_-t*w*_-m*s*E+t*x*E)*F,e[6]=(A*h*a-l*w*a-A*s*p+t*w*p+l*s*E-t*h*E)*F,e[7]=(l*x*a-m*h*a+m*s*p-t*x*p-l*s*_+t*h*_)*F,e[8]=P*F,e[9]=(A*v*a-m*R*a-A*n*_+t*R*_+m*n*E-t*v*E)*F,e[10]=(l*R*a-A*u*a+A*n*p-t*R*p-l*n*E+t*u*E)*F,e[11]=(m*u*a-l*v*a-m*n*p+t*v*p+l*n*_-t*u*_)*F,e[12]=G*F,e[13]=(m*R*s-A*v*s+A*n*x-t*R*x-m*n*w+t*v*w)*F,e[14]=(A*u*s-l*R*s-A*n*h+t*R*h+l*n*w-t*u*w)*F,e[15]=(l*v*s-m*u*s+m*n*h-t*v*h-l*n*x+t*u*x)*F,this}scale(e){const t=this.elements,n=e.x,s=e.y,a=e.z;return t[0]*=n,t[4]*=s,t[8]*=a,t[1]*=n,t[5]*=s,t[9]*=a,t[2]*=n,t[6]*=s,t[10]*=a,t[3]*=n,t[7]*=s,t[11]*=a,this}getMaxScaleOnAxis(){const e=this.elements,t=e[0]*e[0]+e[1]*e[1]+e[2]*e[2],n=e[4]*e[4]+e[5]*e[5]+e[6]*e[6],s=e[8]*e[8]+e[9]*e[9]+e[10]*e[10];return Math.sqrt(Math.max(t,n,s))}makeTranslation(e,t,n){return e.isVector3?this.set(1,0,0,e.x,0,1,0,e.y,0,0,1,e.z,0,0,0,1):this.set(1,0,0,e,0,1,0,t,0,0,1,n,0,0,0,1),this}makeRotationX(e){const t=Math.cos(e),n=Math.sin(e);return this.set(1,0,0,0,0,t,-n,0,0,n,t,0,0,0,0,1),this}makeRotationY(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,0,n,0,0,1,0,0,-n,0,t,0,0,0,0,1),this}makeRotationZ(e){const t=Math.cos(e),n=Math.sin(e);return this.set(t,-n,0,0,n,t,0,0,0,0,1,0,0,0,0,1),this}makeRotationAxis(e,t){const n=Math.cos(t),s=Math.sin(t),a=1-n,l=e.x,u=e.y,h=e.z,p=a*l,m=a*u;return this.set(p*l+n,p*u-s*h,p*h+s*u,0,p*u+s*h,m*u+n,m*h-s*l,0,p*h-s*u,m*h+s*l,a*h*h+n,0,0,0,0,1),this}makeScale(e,t,n){return this.set(e,0,0,0,0,t,0,0,0,0,n,0,0,0,0,1),this}makeShear(e,t,n,s,a,l){return this.set(1,n,a,0,e,1,l,0,t,s,1,0,0,0,0,1),this}compose(e,t,n){const s=this.elements,a=t._x,l=t._y,u=t._z,h=t._w,p=a+a,m=l+l,v=u+u,x=a*p,_=a*m,A=a*v,R=l*m,w=l*v,E=u*v,D=h*p,L=h*m,P=h*v,G=n.x,H=n.y,F=n.z;return s[0]=(1-(R+E))*G,s[1]=(_+P)*G,s[2]=(A-L)*G,s[3]=0,s[4]=(_-P)*H,s[5]=(1-(x+E))*H,s[6]=(w+D)*H,s[7]=0,s[8]=(A+L)*F,s[9]=(w-D)*F,s[10]=(1-(x+R))*F,s[11]=0,s[12]=e.x,s[13]=e.y,s[14]=e.z,s[15]=1,this}decompose(e,t,n){const s=this.elements;let a=qh.set(s[0],s[1],s[2]).length();const l=qh.set(s[4],s[5],s[6]).length(),u=qh.set(s[8],s[9],s[10]).length();this.determinant()<0&&(a=-a),e.x=s[12],e.y=s[13],e.z=s[14],$o.copy(this);const p=1/a,m=1/l,v=1/u;return $o.elements[0]*=p,$o.elements[1]*=p,$o.elements[2]*=p,$o.elements[4]*=m,$o.elements[5]*=m,$o.elements[6]*=m,$o.elements[8]*=v,$o.elements[9]*=v,$o.elements[10]*=v,t.setFromRotationMatrix($o),n.x=a,n.y=l,n.z=u,this}makePerspective(e,t,n,s,a,l,u=al){const h=this.elements,p=2*a/(t-e),m=2*a/(n-s),v=(t+e)/(t-e),x=(n+s)/(n-s);let _,A;if(u===al)_=-(l+a)/(l-a),A=-2*l*a/(l-a);else if(u===Y0)_=-l/(l-a),A=-l*a/(l-a);else throw new Error("THREE.Matrix4.makePerspective(): Invalid coordinate system: "+u);return h[0]=p,h[4]=0,h[8]=v,h[12]=0,h[1]=0,h[5]=m,h[9]=x,h[13]=0,h[2]=0,h[6]=0,h[10]=_,h[14]=A,h[3]=0,h[7]=0,h[11]=-1,h[15]=0,this}makeOrthographic(e,t,n,s,a,l,u=al){const h=this.elements,p=1/(t-e),m=1/(n-s),v=1/(l-a),x=(t+e)*p,_=(n+s)*m;let A,R;if(u===al)A=(l+a)*v,R=-2*v;else if(u===Y0)A=a*v,R=-1*v;else throw new Error("THREE.Matrix4.makeOrthographic(): Invalid coordinate system: "+u);return h[0]=2*p,h[4]=0,h[8]=0,h[12]=-x,h[1]=0,h[5]=2*m,h[9]=0,h[13]=-_,h[2]=0,h[6]=0,h[10]=R,h[14]=-A,h[3]=0,h[7]=0,h[11]=0,h[15]=1,this}equals(e){const t=this.elements,n=e.elements;for(let s=0;s<16;s++)if(t[s]!==n[s])return!1;return!0}fromArray(e,t=0){for(let n=0;n<16;n++)this.elements[n]=e[n+t];return this}toArray(e=[],t=0){const n=this.elements;return e[t]=n[0],e[t+1]=n[1],e[t+2]=n[2],e[t+3]=n[3],e[t+4]=n[4],e[t+5]=n[5],e[t+6]=n[6],e[t+7]=n[7],e[t+8]=n[8],e[t+9]=n[9],e[t+10]=n[10],e[t+11]=n[11],e[t+12]=n[12],e[t+13]=n[13],e[t+14]=n[14],e[t+15]=n[15],e}}const qh=new se,$o=new dn,_O=new se(0,0,0),bO=new se(1,1,1),Ou=new se,xy=new se,Ya=new se,uT=new dn,fT=new gr;class Qa{constructor(e=0,t=0,n=0,s=Qa.DEFAULT_ORDER){this.isEuler=!0,this._x=e,this._y=t,this._z=n,this._order=s}get x(){return this._x}set x(e){this._x=e,this._onChangeCallback()}get y(){return this._y}set y(e){this._y=e,this._onChangeCallback()}get z(){return this._z}set z(e){this._z=e,this._onChangeCallback()}get order(){return this._order}set order(e){this._order=e,this._onChangeCallback()}set(e,t,n,s=this._order){return this._x=e,this._y=t,this._z=n,this._order=s,this._onChangeCallback(),this}clone(){return new this.constructor(this._x,this._y,this._z,this._order)}copy(e){return this._x=e._x,this._y=e._y,this._z=e._z,this._order=e._order,this._onChangeCallback(),this}setFromRotationMatrix(e,t=this._order,n=!0){const s=e.elements,a=s[0],l=s[4],u=s[8],h=s[1],p=s[5],m=s[9],v=s[2],x=s[6],_=s[10];switch(t){case"XYZ":this._y=Math.asin(An(u,-1,1)),Math.abs(u)<.9999999?(this._x=Math.atan2(-m,_),this._z=Math.atan2(-l,a)):(this._x=Math.atan2(x,p),this._z=0);break;case"YXZ":this._x=Math.asin(-An(m,-1,1)),Math.abs(m)<.9999999?(this._y=Math.atan2(u,_),this._z=Math.atan2(h,p)):(this._y=Math.atan2(-v,a),this._z=0);break;case"ZXY":this._x=Math.asin(An(x,-1,1)),Math.abs(x)<.9999999?(this._y=Math.atan2(-v,_),this._z=Math.atan2(-l,p)):(this._y=0,this._z=Math.atan2(h,a));break;case"ZYX":this._y=Math.asin(-An(v,-1,1)),Math.abs(v)<.9999999?(this._x=Math.atan2(x,_),this._z=Math.atan2(h,a)):(this._x=0,this._z=Math.atan2(-l,p));break;case"YZX":this._z=Math.asin(An(h,-1,1)),Math.abs(h)<.9999999?(this._x=Math.atan2(-m,p),this._y=Math.atan2(-v,a)):(this._x=0,this._y=Math.atan2(u,_));break;case"XZY":this._z=Math.asin(-An(l,-1,1)),Math.abs(l)<.9999999?(this._x=Math.atan2(x,p),this._y=Math.atan2(u,a)):(this._x=Math.atan2(-m,_),this._y=0);break;default:console.warn("THREE.Euler: .setFromRotationMatrix() encountered an unknown order: "+t)}return this._order=t,n===!0&&this._onChangeCallback(),this}setFromQuaternion(e,t,n){return uT.makeRotationFromQuaternion(e),this.setFromRotationMatrix(uT,t,n)}setFromVector3(e,t=this._order){return this.set(e.x,e.y,e.z,t)}reorder(e){return fT.setFromEuler(this),this.setFromQuaternion(fT,e)}equals(e){return e._x===this._x&&e._y===this._y&&e._z===this._z&&e._order===this._order}fromArray(e){return this._x=e[0],this._y=e[1],this._z=e[2],e[3]!==void 0&&(this._order=e[3]),this._onChangeCallback(),this}toArray(e=[],t=0){return e[t]=this._x,e[t+1]=this._y,e[t+2]=this._z,e[t+3]=this._order,e}_onChange(e){return this._onChangeCallback=e,this}_onChangeCallback(){}*[Symbol.iterator](){yield this._x,yield this._y,yield this._z,yield this._order}}Qa.DEFAULT_ORDER="XYZ";class wp{constructor(){this.mask=1}set(e){this.mask=(1<<e|0)>>>0}enable(e){this.mask|=1<<e|0}enableAll(){this.mask=-1}toggle(e){this.mask^=1<<e|0}disable(e){this.mask&=~(1<<e|0)}disableAll(){this.mask=0}test(e){return(this.mask&e.mask)!==0}
vendor: 5,651 bytes, line 78
78isEnabled(e){return(this.mask&(1<<e|0))!==0}}let SO=0;const dT=new se,Yh=new gr,Sc=new dn,_y=new se,f0=new se,AO=new se,MO=new gr,hT=new se(1,0,0),pT=new se(0,1,0),mT=new se(0,0,1),gT={type:"added"},EO={type:"removed"},Jh={type:"childadded",child:null},CS={type:"childremoved",child:null};class li extends eo{constructor(){super(),this.isObject3D=!0,Object.defineProperty(this,"id",{value:SO++}),this.uuid=Za(),this.name="",this.type="Object3D",this.parent=null,this.children=[],this.up=li.DEFAULT_UP.clone();const e=new se,t=new Qa,n=new gr,s=new se(1,1,1);function a(){n.setFromEuler(t,!1)}function l(){t.setFromQuaternion(n,void 0,!1)}t._onChange(a),n._onChange(l),Object.defineProperties(this,{position:{configurable:!0,enumerable:!0,value:e},rotation:{configurable:!0,enumerable:!0,value:t},quaternion:{configurable:!0,enumerable:!0,value:n},scale:{configurable:!0,enumerable:!0,value:s},modelViewMatrix:{value:new dn},normalMatrix:{value:new Cn}}),this.matrix=new dn,this.matrixWorld=new dn,this.matrixAutoUpdate=li.DEFAULT_MATRIX_AUTO_UPDATE,this.matrixWorldAutoUpdate=li.DEFAULT_MATRIX_WORLD_AUTO_UPDATE,this.matrixWorldNeedsUpdate=!1,this.layers=new wp,this.visible=!0,this.castShadow=!1,this.receiveShadow=!1,this.frustumCulled=!0,this.renderOrder=0,this.animations=[],this.customDepthMaterial=void 0,this.customDistanceMaterial=void 0,this.userData={}}onBeforeShadow(){}onAfterShadow(){}onBeforeRender(){}onAfterRender(){}applyMatrix4(e){this.matrixAutoUpdate&&this.updateMatrix(),this.matrix.premultiply(e),this.matrix.decompose(this.position,this.quaternion,this.scale)}applyQuaternion(e){return this.quaternion.premultiply(e),this}setRotationFromAxisAngle(e,t){this.quaternion.setFromAxisAngle(e,t)}setRotationFromEuler(e){this.quaternion.setFromEuler(e,!0)}setRotationFromMatrix(e){this.quaternion.setFromRotationMatrix(e)}setRotationFromQuaternion(e){this.quaternion.copy(e)}rotateOnAxis(e,t){return Yh.setFromAxisAngle(e,t),this.quaternion.multiply(Yh),this}rotateOnWorldAxis(e,t){return Yh.setFromAxisAngle(e,t),this.quaternion.premultiply(Yh),this}rotateX(e){return this.rotateOnAxis(hT,e)}rotateY(e){return this.rotateOnAxis(pT,e)}rotateZ(e){return this.rotateOnAxis(mT,e)}translateOnAxis(e,t){return dT.copy(e).applyQuaternion(this.quaternion),this.position.add(dT.multiplyScalar(t)),this}translateX(e){return this.translateOnAxis(hT,e)}translateY(e){return this.translateOnAxis(pT,e)}translateZ(e){return this.translateOnAxis(mT,e)}localToWorld(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(this.matrixWorld)}worldToLocal(e){return this.updateWorldMatrix(!0,!1),e.applyMatrix4(Sc.copy(this.matrixWorld).invert())}lookAt(e,t,n){e.isVector3?_y.copy(e):_y.set(e,t,n);const s=this.parent;this.updateWorldMatrix(!0,!1),f0.setFromMatrixPosition(this.matrixWorld),this.isCamera||this.isLight?Sc.lookAt(f0,_y,this.up):Sc.lookAt(_y,f0,this.up),this.quaternion.setFromRotationMatrix(Sc),s&&(Sc.extractRotation(s.matrixWorld),Yh.setFromRotationMatrix(Sc),this.quaternion.premultiply(Yh.invert()))}add(e){if(arguments.length>1){for(let t=0;t<arguments.length;t++)this.add(arguments[t]);return this}return e===this?(console.error("THREE.Object3D.add: object can't be added as a child of itself.",e),this):(e&&e.isObject3D?(e.removeFromParent(),e.parent=this,this.children.push(e),e.dispatchEvent(gT),Jh.child=e,this.dispatchEvent(Jh),Jh.child=null):console.error("THREE.Object3D.add: object not an instance of THREE.Object3D.",e),this)}remove(e){if(arguments.length>1){for(let n=0;n<arguments.length;n++)this.remove(arguments[n]);return this}const t=this.children.indexOf(e);return t!==-1&&(e.parent=null,this.children.splice(t,1),e.dispatchEvent(EO),CS.child=e,this.dispatchEvent(CS),CS.child=null),this}removeFromParent(){const e=this.parent;return e!==null&&e.remove(this),this}clear(){return this.remove(...this.children)}attach(e){return this.updateWorldMatrix(!0,!1),Sc.copy(this.matrixWorld).invert(),e.parent!==null&&(e.parent.updateWorldMatrix(!0,!1),Sc.multiply(e.parent.matrixWorld)),e.applyMatrix4(Sc),e.removeFromParent(),e.parent=this,this.children.push(e),e.updateWorldMatrix(!1,!0),e.dispatchEvent(gT),Jh.child=e,this.dispatchEvent(Jh),Jh.child=null,this}getObjectById(e){return this.getObjectByProperty("id",e)}getObjectByName(e){return this.getObjectByProperty("name",e)}getObjectByProperty(e,t){if(this[e]===t)return this;for(let n=0,s=this.children.length;n<s;n++){const l=this.children[n].getObjectByProperty(e,t);if(l!==void 0)return l}}getObjectsByProperty(e,t,n=[]){this[e]===t&&n.push(this);const s=this.children;for(let a=0,l=s.length;a<l;a++)s[a].getObjectsByProperty(e,t,n);return n}getWorldPosition(e){return this.updateWorldMatrix(!0,!1),e.setFromMatrixPosition(this.matrixWorld)}getWorldQuaternion(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(f0,e,AO),e}getWorldScale(e){return this.updateWorldMatrix(!0,!1),this.matrixWorld.decompose(f0,MO,e),e}getWorldDirection(e){this.updateWorldMatrix(!0,!1);const t=this.matrixWorld.elements;return e.set(t[8],t[9],t[10]).normalize()}raycast(){}traverse(e){e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverse(e)}traverseVisible(e){if(this.visible===!1)return;e(this);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].traverseVisible(e)}traverseAncestors(e){const t=this.parent;t!==null&&(e(t),t.traverseAncestors(e))}updateMatrix(){this.matrix.compose(this.position,this.quaternion,this.scale),this.matrixWorldNeedsUpdate=!0}updateMatrixWorld(e){this.matrixAutoUpdate&&this.updateMatrix(),(this.matrixWorldNeedsUpdate||e)&&(this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix
vendor: 7,902 bytes, line 78
78):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),this.matrixWorldNeedsUpdate=!1,e=!0);const t=this.children;for(let n=0,s=t.length;n<s;n++)t[n].updateMatrixWorld(e)}updateWorldMatrix(e,t){const n=this.parent;if(e===!0&&n!==null&&n.updateWorldMatrix(!0,!1),this.matrixAutoUpdate&&this.updateMatrix(),this.matrixWorldAutoUpdate===!0&&(this.parent===null?this.matrixWorld.copy(this.matrix):this.matrixWorld.multiplyMatrices(this.parent.matrixWorld,this.matrix)),t===!0){const s=this.children;for(let a=0,l=s.length;a<l;a++)s[a].updateWorldMatrix(!1,!0)}}toJSON(e){const t=e===void 0||typeof e=="string",n={};t&&(e={geometries:{},materials:{},textures:{},images:{},shapes:{},skeletons:{},animations:{},nodes:{}},n.metadata={version:4.6,type:"Object",generator:"Object3D.toJSON"});const s={};s.uuid=this.uuid,s.type=this.type,this.name!==""&&(s.name=this.name),this.castShadow===!0&&(s.castShadow=!0),this.receiveShadow===!0&&(s.receiveShadow=!0),this.visible===!1&&(s.visible=!1),this.frustumCulled===!1&&(s.frustumCulled=!1),this.renderOrder!==0&&(s.renderOrder=this.renderOrder),Object.keys(this.userData).length>0&&(s.userData=this.userData),s.layers=this.layers.mask,s.matrix=this.matrix.toArray(),s.up=this.up.toArray(),this.matrixAutoUpdate===!1&&(s.matrixAutoUpdate=!1),this.isInstancedMesh&&(s.type="InstancedMesh",s.count=this.count,s.instanceMatrix=this.instanceMatrix.toJSON(),this.instanceColor!==null&&(s.instanceColor=this.instanceColor.toJSON())),this.isBatchedMesh&&(s.type="BatchedMesh",s.perObjectFrustumCulled=this.perObjectFrustumCulled,s.sortObjects=this.sortObjects,s.drawRanges=this._drawRanges,s.reservedRanges=this._reservedRanges,s.visibility=this._visibility,s.active=this._active,s.bounds=this._bounds.map(u=>({boxInitialized:u.boxInitialized,boxMin:u.box.min.toArray(),boxMax:u.box.max.toArray(),sphereInitialized:u.sphereInitialized,sphereRadius:u.sphere.radius,sphereCenter:u.sphere.center.toArray()})),s.maxInstanceCount=this._maxInstanceCount,s.maxVertexCount=this._maxVertexCount,s.maxIndexCount=this._maxIndexCount,s.geometryInitialized=this._geometryInitialized,s.geometryCount=this._geometryCount,s.matricesTexture=this._matricesTexture.toJSON(e),this._colorsTexture!==null&&(s.colorsTexture=this._colorsTexture.toJSON(e)),this.boundingSphere!==null&&(s.boundingSphere={center:s.boundingSphere.center.toArray(),radius:s.boundingSphere.radius}),this.boundingBox!==null&&(s.boundingBox={min:s.boundingBox.min.toArray(),max:s.boundingBox.max.toArray()}));function a(u,h){return u[h.uuid]===void 0&&(u[h.uuid]=h.toJSON(e)),h.uuid}if(this.isScene)this.background&&(this.background.isColor?s.background=this.background.toJSON():this.background.isTexture&&(s.background=this.background.toJSON(e).uuid)),this.environment&&this.environment.isTexture&&this.environment.isRenderTargetTexture!==!0&&(s.environment=this.environment.toJSON(e).uuid);else if(this.isMesh||this.isLine||this.isPoints){s.geometry=a(e.geometries,this.geometry);const u=this.geometry.parameters;if(u!==void 0&&u.shapes!==void 0){const h=u.shapes;if(Array.isArray(h))for(let p=0,m=h.length;p<m;p++){const v=h[p];a(e.shapes,v)}else a(e.shapes,h)}}if(this.isSkinnedMesh&&(s.bindMode=this.bindMode,s.bindMatrix=this.bindMatrix.toArray(),this.skeleton!==void 0&&(a(e.skeletons,this.skeleton),s.skeleton=this.skeleton.uuid)),this.material!==void 0)if(Array.isArray(this.material)){const u=[];for(let h=0,p=this.material.length;h<p;h++)u.push(a(e.materials,this.material[h]));s.material=u}else s.material=a(e.materials,this.material);if(this.children.length>0){s.children=[];for(let u=0;u<this.children.length;u++)s.children.push(this.children[u].toJSON(e).object)}if(this.animations.length>0){s.animations=[];for(let u=0;u<this.animations.length;u++){const h=this.animations[u];s.animations.push(a(e.animations,h))}}if(t){const u=l(e.geometries),h=l(e.materials),p=l(e.textures),m=l(e.images),v=l(e.shapes),x=l(e.skeletons),_=l(e.animations),A=l(e.nodes);u.length>0&&(n.geometries=u),h.length>0&&(n.materials=h),p.length>0&&(n.textures=p),m.length>0&&(n.images=m),v.length>0&&(n.shapes=v),x.length>0&&(n.skeletons=x),_.length>0&&(n.animations=_),A.length>0&&(n.nodes=A)}return n.object=s,n;function l(u){const h=[];for(const p in u){const m=u[p];delete m.metadata,h.push(m)}return h}}clone(e){return new this.constructor().copy(this,e)}copy(e,t=!0){if(this.name=e.name,this.up.copy(e.up),this.position.copy(e.position),this.rotation.order=e.rotation.order,this.quaternion.copy(e.quaternion),this.scale.copy(e.scale),this.matrix.copy(e.matrix),this.matrixWorld.copy(e.matrixWorld),this.matrixAutoUpdate=e.matrixAutoUpdate,this.matrixWorldAutoUpdate=e.matrixWorldAutoUpdate,this.matrixWorldNeedsUpdate=e.matrixWorldNeedsUpdate,this.layers.mask=e.layers.mask,this.visible=e.visible,this.castShadow=e.castShadow,this.receiveShadow=e.receiveShadow,this.frustumCulled=e.frustumCulled,this.renderOrder=e.renderOrder,this.animations=e.animations.slice(),this.userData=JSON.parse(JSON.stringify(e.userData)),t===!0)for(let n=0;n<e.children.length;n++){const s=e.children[n];this.add(s.clone())}return this}}li.DEFAULT_UP=new se(0,1,0);li.DEFAULT_MATRIX_AUTO_UPDATE=!0;li.DEFAULT_MATRIX_WORLD_AUTO_UPDATE=!0;const el=new se,Ac=new se,RS=new se,Mc=new se,Kh=new se,Zh=new se,vT=new se,BS=new se,IS=new se,DS=new se,LS=new oi,PS=new oi,OS=new oi;class Ha{constructor(e=new se,t=new se,n=new se){this.a=e,this.b=t,this.c=n}static getNormal(e,t,n,s){s.subVectors(n,t),el.subVectors(e,t),s.cross(el);const a=s.lengthSq();return a>0?s.multiplyScalar(1/Math.sqrt(a)):s.set(0,0,0)}static getBarycoord(e,t,n,s,a){el.subVectors(s,t),Ac.subVectors(n,t),RS.subVectors(e,t);const l=el.dot(el),u=el.dot(Ac),h=el.dot(RS),p=Ac.dot(Ac),m=Ac.dot(RS),v=l*p-u*u;if(v===0)return a.set(0,0,0),null;const x=1/v,_=(p*h-u*m)*x,A=(l*m-u*h)*x;return a.set(1-_-A,A,_)}static containsPoint(e,t,n,s){return this.getBarycoord(e,t,n,s,Mc)===null?!1:Mc.x>=0&&Mc.y>=0&&Mc.x+Mc.y<=1}static getInterpolation(e,t,n,s,a,l,u,h){return this.getBarycoord(e,t,n,s,Mc)===null?(h.x=0,h.y=0,"z"in h&&(h.z=0),"w"in h&&(h.w=0),null):(h.setScalar(0),h.addScaledVector(a,Mc.x),h.addScaledVector(l,Mc.y),h.addScaledVector(u,Mc.z),h)}static getInterpolatedAttribute(e,t,n,s,a,l){return LS.setScalar(0),PS.setScalar(0),OS.setScalar(0),LS.fromBufferAttribute(e,t),PS.fromBufferAttribute(e,n),OS.fromBufferAttribute(e,s),l.setScalar(0),l.addScaledVector(LS,a.x),l.addScaledVector(PS,a.y),l.addScaledVector(OS,a.z),l}static isFrontFacing(e,t,n,s){return el.subVectors(n,t),Ac.subVectors(e,t),el.cross(Ac).dot(s)<0}set(e,t,n){return this.a.copy(e),this.b.copy(t),this.c.copy(n),this}setFromPointsAndIndices(e,t,n,s){return this.a.copy(e[t]),this.b.copy(e[n]),this.c.copy(e[s]),this}setFromAttributeAndIndices(e,t,n,s){return this.a.fromBufferAttribute(e,t),this.b.fromBufferAttribute(e,n),this.c.fromBufferAttribute(e,s),this}clone(){return new this.constructor().copy(this)}copy(e){return this.a.copy(e.a),this.b.copy(e.b),this.c.copy(e.c),this}getArea(){return el.subVectors(this.c,this.b),Ac.subVectors(this.a,this.b),el.cross(Ac).length()*.5}getMidpoint(e){return e.addVectors(this.a,this.b).add(this.c).multiplyScalar(1/3)}getNormal(e){return Ha.getNormal(this.a,this.b,this.c,e)}getPlane(e){return e.setFromCoplanarPoints(this.a,this.b,this.c)}getBarycoord(e,t){return Ha.getBarycoord(e,this.a,this.b,this.c,t)}getInterpolation(e,t,n,s,a){return Ha.getInterpolation(e,this.a,this.b,this.c,t,n,s,a)}containsPoint(e){return Ha.containsPoint(e,this.a,this.b,this.c)}isFrontFacing(e){return Ha.isFrontFacing(this.a,this.b,this.c,e)}intersectsBox(e){return e.intersectsTriangle(this)}closestPointToPoint(e,t){const n=this.a,s=this.b,a=this.c;let l,u;Kh.subVectors(s,n),Zh.subVectors(a,n),BS.subVectors(e,n);const h=Kh.dot(BS),p=Zh.dot(BS);if(h<=0&&p<=0)return t.copy(n);IS.subVectors(e,s);const m=Kh.dot(IS),v=Zh.dot(IS);if(m>=0&&v<=m)return t.copy(s);
vendor: 4,200 bytes, line 78
78const x=h*v-m*p;if(x<=0&&h>=0&&m<=0)return l=h/(h-m),t.copy(n).addScaledVector(Kh,l);DS.subVectors(e,a);const _=Kh.dot(DS),A=Zh.dot(DS);if(A>=0&&_<=A)return t.copy(a);const R=_*p-h*A;if(R<=0&&p>=0&&A<=0)return u=p/(p-A),t.copy(n).addScaledVector(Zh,u);const w=m*A-_*v;if(w<=0&&v-m>=0&&_-A>=0)return vT.subVectors(a,s),u=(v-m)/(v-m+(_-A)),t.copy(s).addScaledVector(vT,u);const E=1/(w+R+x);return l=R*E,u=x*E,t.copy(n).addScaledVector(Kh,l).addScaledVector(Zh,u)}equals(e){return e.a.equals(this.a)&&e.b.equals(this.b)&&e.c.equals(this.c)}}const sI={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074},Nu={h:0,s:0,l:0},by={h:0,s:0,l:0};function NS(i,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?i+(e-i)*6*t:t<1/2?e:t<2/3?i+(e-i)*6*(2/3-t):i}class Pt{constructor(e,t,n){return this.isColor=!0,this.r=1,this.g=1,this.b=1,this.set(e,t,n)}set(e,t,n){if(t===void 0&&n===void 0){const s=e;s&&s.isColor?this.copy(s):typeof s=="number"?this.setHex(s):typeof s=="string"&&this.setStyle(s)}else this.setRGB(e,t,n);return this}setScalar(e){return this.r=e,this.g=e,this.b=e,this}setHex(e,t=xi){return e=Math.floor(e),this.r=(e>>16&255)/255,this.g=(e>>8&255)/255,this.b=(e&255)/255,si.toWorkingColorSpace(this,t),this}setRGB(e,t,n,s=si.workingColorSpace){return this.r=e,this.g=t,this.b=n,si.toWorkingColorSpace(this,s),this}setHSL(e,t,n,s=si.workingColorSpace){if(e=NA(e,1),t=An(t,0,1),n=An(n,0,1),t===0)this.r=this.g=this.b=n;else{const a=n<=.5?n*(1+t):n+t-n*t,l=2*n-a;this.r=NS(l,a,e+1/3),this.g=NS(l,a,e),this.b=NS(l,a,e-1/3)}return si.toWorkingColorSpace(this,s),this}
vendor: 5,968 bytes, line 78
78setStyle(e,t=xi){function n(a){a!==void 0&&parseFloat(a)<1&&console.warn("THREE.Color: Alpha component of "+e+" will be ignored.")}let s;if(s=/^(\w+)\(([^\)]*)\)/.exec(e)){let a;const l=s[1],u=s[2];switch(l){case"rgb":case"rgba":if(a=/^\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(a[4]),this.setRGB(Math.min(255,parseInt(a[1],10))/255,Math.min(255,parseInt(a[2],10))/255,Math.min(255,parseInt(a[3],10))/255,t);if(a=/^\s*(\d+)\%\s*,\s*(\d+)\%\s*,\s*(\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(a[4]),this.setRGB(Math.min(100,parseInt(a[1],10))/100,Math.min(100,parseInt(a[2],10))/100,Math.min(100,parseInt(a[3],10))/100,t);break;case"hsl":case"hsla":if(a=/^\s*(\d*\.?\d+)\s*,\s*(\d*\.?\d+)\%\s*,\s*(\d*\.?\d+)\%\s*(?:,\s*(\d*\.?\d+)\s*)?$/.exec(u))return n(a[4]),this.setHSL(parseFloat(a[1])/360,parseFloat(a[2])/100,parseFloat(a[3])/100,t);break;default:console.warn("THREE.Color: Unknown color model "+e)}}else if(s=/^\#([A-Fa-f\d]+)$/.exec(e)){const a=s[1],l=a.length;if(l===3)return this.setRGB(parseInt(a.charAt(0),16)/15,parseInt(a.charAt(1),16)/15,parseInt(a.charAt(2),16)/15,t);if(l===6)return this.setHex(parseInt(a,16),t);console.warn("THREE.Color: Invalid hex color "+e)}else if(e&&e.length>0)return this.setColorName(e,t);return this}setColorName(e,t=xi){const n=sI[e.toLowerCase()];return n!==void 0?this.setHex(n,t):console.warn("THREE.Color: Unknown color "+e),this}clone(){return new this.constructor(this.r,this.g,this.b)}copy(e){return this.r=e.r,this.g=e.g,this.b=e.b,this}copySRGBToLinear(e){return this.r=Uc(e.r),this.g=Uc(e.g),this.b=Uc(e.b),this}copyLinearToSRGB(e){return this.r=vp(e.r),this.g=vp(e.g),this.b=vp(e.b),this}convertSRGBToLinear(){return this.copySRGBToLinear(this),this}convertLinearToSRGB(){return this.copyLinearToSRGB(this),this}getHex(e=xi){return si.fromWorkingColorSpace(Xr.copy(this),e),Math.round(An(Xr.r*255,0,255))*65536+Math.round(An(Xr.g*255,0,255))*256+Math.round(An(Xr.b*255,0,255))}getHexString(e=xi){return("000000"+this.getHex(e).toString(16)).slice(-6)}getHSL(e,t=si.workingColorSpace){si.fromWorkingColorSpace(Xr.copy(this),t);const n=Xr.r,s=Xr.g,a=Xr.b,l=Math.max(n,s,a),u=Math.min(n,s,a);let h,p;const m=(u+l)/2;if(u===l)h=0,p=0;else{const v=l-u;switch(p=m<=.5?v/(l+u):v/(2-l-u),l){case n:h=(s-a)/v+(s<a?6:0);break;case s:h=(a-n)/v+2;break;case a:h=(n-s)/v+4;break}h/=6}return e.h=h,e.s=p,e.l=m,e}getRGB(e,t=si.workingColorSpace){return si.fromWorkingColorSpace(Xr.copy(this),t),e.r=Xr.r,e.g=Xr.g,e.b=Xr.b,e}getStyle(e=xi){si.fromWorkingColorSpace(Xr.copy(this),e);const t=Xr.r,n=Xr.g,s=Xr.b;return e!==xi?`color(${e} ${t.toFixed(3)} ${n.toFixed(3)} ${s.toFixed(3)})`:`rgb(${Math.round(t*255)},${Math.round(n*255)},${Math.round(s*255)})`}offsetHSL(e,t,n){return this.getHSL(Nu),this.setHSL(Nu.h+e,Nu.s+t,Nu.l+n)}add(e){return this.r+=e.r,this.g+=e.g,this.b+=e.b,this}addColors(e,t){return this.r=e.r+t.r,this.g=e.g+t.g,this.b=e.b+t.b,this}addScalar(e){return this.r+=e,this.g+=e,this.b+=e,this}sub(e){return this.r=Math.max(0,this.r-e.r),this.g=Math.max(0,this.g-e.g),this.b=Math.max(0,this.b-e.b),this}multiply(e){return this.r*=e.r,this.g*=e.g,this.b*=e.b,this}multiplyScalar(e){return this.r*=e,this.g*=e,this.b*=e,this}lerp(e,t){return this.r+=(e.r-this.r)*t,this.g+=(e.g-this.g)*t,this.b+=(e.b-this.b)*t,this}lerpColors(e,t,n){return this.r=e.r+(t.r-e.r)*n,this.g=e.g+(t.g-e.g)*n,this.b=e.b+(t.b-e.b)*n,this}lerpHSL(e,t){this.getHSL(Nu),e.getHSL(by);const n=O0(Nu.h,by.h,t),s=O0(Nu.s,by.s,t),a=O0(Nu.l,by.l,t);return this.setHSL(n,s,a),this}setFromVector3(e){return this.r=e.x,this.g=e.y,this.b=e.z,this}applyMatrix3(e){const t=this.r,n=this.g,s=this.b,a=e.elements;return this.r=a[0]*t+a[3]*n+a[6]*s,this.g=a[1]*t+a[4]*n+a[7]*s,this.b=a[2]*t+a[5]*n+a[8]*s,this}equals(e){return e.r===this.r&&e.g===this.g&&e.b===this.b}fromArray(e,t=0){return this.r=e[t],this.g=e[t+1],this.b=e[t+2],this}toArray(e=[],t=0){return e[t]=this.r,e[t+1]=this.g,e[t+2]=this.b,e}fromBufferAttribute(e,t){return this.r=e.getX(t),this.g=e.getY(t),this.b=e.getZ(t),this}toJSON(){return this.getHex()}*[Symbol.iterator](){yield this.r,yield this.g,yield this.b}}const Xr=new Pt;Pt.NAMES=sI;let TO=0;class js extends eo{constructor(){super(),this.isMaterial=!0,Object.defineProperty(this,"id",{value:TO++}),this.uuid=Za(),this.name="",this.type="Material",this.blending=gd,this.side=cl,this.vertexColors=!1,this.opacity=1,this.transparent=!1,this.alphaHash=!1,this.blendSrc=Cx,this.blendDst=Rx,this.blendEquation=Gu,this.blendSrcAlpha=null,this.blendDstAlpha=null,this.blendEquationAlpha=null,this.blendColor=new Pt(0,0,0),this.blendAlpha=0,this.depthFunc=Md,this.depthTest=!0,this.depthWrite=!0,this.stencilWriteMask=255,this.stencilFunc=X1,this.stencilRef=0,this.stencilFuncMask=255,this.stencilFail=rd,this.stencilZFail=rd,this.stencilZPass=rd,this.stencilWrite=!1,this.clippingPlanes=null,this.clipIntersection=!1,this.clipShadows=!1,this.shadowSide=null,this.colorWrite=!0,this.precision=null,this.polygonOffset=!1,this.polygonOffsetFactor=0,this.polygonOffsetUnits=0,this.dithering=!1,this.alphaToCoverage=!1,this.premultipliedAlpha=!1,this.forceSinglePass=!1,this.allowOverride=!0,this.visible=!0,this.toneMapped=!0,this.userData={},this.version=0,this._alphaTest=0}get alphaTest(){return this._alphaTest}set alphaTest(e){this._alphaTest>0!=e>0&&this.version++,this._alphaTest=e}onBeforeRender(){}onBeforeCompile(){}customProgramCacheKey(){return this.onBeforeCompile.toString()}setValues(e){if(e!==void 0)for(const t in e){const n=e[t];if(n===void 0){console.warn(`THREE.Material: parameter '${t}' has value of undefined.`);continue}const s=this[t];if(s===void 0){console.warn(`THREE.Material: '${t}' is not a property of THREE.${this.type}.`);continue}s&&s.isColor?s.set(n):s&&s.isVector3&&n&&n.isVector3?s.copy(n):this[t]=n}}toJSON(e){const t=e===void 0||typeof e=="string";t&&(e={textures:{},images:{}});const n={metadata:{version:4.6,type:"Material",generator:"Material.toJSON"}};
vendor: 8,832 bytes, line 78
78n.uuid=this.uuid,n.type=this.type,this.name!==""&&(n.name=this.name),this.color&&this.color.isColor&&(n.color=this.color.getHex()),this.roughness!==void 0&&(n.roughness=this.roughness),this.metalness!==void 0&&(n.metalness=this.metalness),this.sheen!==void 0&&(n.sheen=this.sheen),this.sheenColor&&this.sheenColor.isColor&&(n.sheenColor=this.sheenColor.getHex()),this.sheenRoughness!==void 0&&(n.sheenRoughness=this.sheenRoughness),this.emissive&&this.emissive.isColor&&(n.emissive=this.emissive.getHex()),this.emissiveIntensity!==void 0&&this.emissiveIntensity!==1&&(n.emissiveIntensity=this.emissiveIntensity),this.specular&&this.specular.isColor&&(n.specular=this.specular.getHex()),this.specularIntensity!==void 0&&(n.specularIntensity=this.specularIntensity),this.specularColor&&this.specularColor.isColor&&(n.specularColor=this.specularColor.getHex()),this.shininess!==void 0&&(n.shininess=this.shininess),this.clearcoat!==void 0&&(n.clearcoat=this.clearcoat),this.clearcoatRoughness!==void 0&&(n.clearcoatRoughness=this.clearcoatRoughness),this.clearcoatMap&&this.clearcoatMap.isTexture&&(n.clearcoatMap=this.clearcoatMap.toJSON(e).uuid),this.clearcoatRoughnessMap&&this.clearcoatRoughnessMap.isTexture&&(n.clearcoatRoughnessMap=this.clearcoatRoughnessMap.toJSON(e).uuid),this.clearcoatNormalMap&&this.clearcoatNormalMap.isTexture&&(n.clearcoatNormalMap=this.clearcoatNormalMap.toJSON(e).uuid,n.clearcoatNormalScale=this.clearcoatNormalScale.toArray()),this.dispersion!==void 0&&(n.dispersion=this.dispersion),this.iridescence!==void 0&&(n.iridescence=this.iridescence),this.iridescenceIOR!==void 0&&(n.iridescenceIOR=this.iridescenceIOR),this.iridescenceThicknessRange!==void 0&&(n.iridescenceThicknessRange=this.iridescenceThicknessRange),this.iridescenceMap&&this.iridescenceMap.isTexture&&(n.iridescenceMap=this.iridescenceMap.toJSON(e).uuid),this.iridescenceThicknessMap&&this.iridescenceThicknessMap.isTexture&&(n.iridescenceThicknessMap=this.iridescenceThicknessMap.toJSON(e).uuid),this.anisotropy!==void 0&&(n.anisotropy=this.anisotropy),this.anisotropyRotation!==void 0&&(n.anisotropyRotation=this.anisotropyRotation),this.anisotropyMap&&this.anisotropyMap.isTexture&&(n.anisotropyMap=this.anisotropyMap.toJSON(e).uuid),this.map&&this.map.isTexture&&(n.map=this.map.toJSON(e).uuid),this.matcap&&this.matcap.isTexture&&(n.matcap=this.matcap.toJSON(e).uuid),this.alphaMap&&this.alphaMap.isTexture&&(n.alphaMap=this.alphaMap.toJSON(e).uuid),this.lightMap&&this.lightMap.isTexture&&(n.lightMap=this.lightMap.toJSON(e).uuid,n.lightMapIntensity=this.lightMapIntensity),this.aoMap&&this.aoMap.isTexture&&(n.aoMap=this.aoMap.toJSON(e).uuid,n.aoMapIntensity=this.aoMapIntensity),this.bumpMap&&this.bumpMap.isTexture&&(n.bumpMap=this.bumpMap.toJSON(e).uuid,n.bumpScale=this.bumpScale),this.normalMap&&this.normalMap.isTexture&&(n.normalMap=this.normalMap.toJSON(e).uuid,n.normalMapType=this.normalMapType,n.normalScale=this.normalScale.toArray()),this.displacementMap&&this.displacementMap.isTexture&&(n.displacementMap=this.displacementMap.toJSON(e).uuid,n.displacementScale=this.displacementScale,n.displacementBias=this.displacementBias),this.roughnessMap&&this.roughnessMap.isTexture&&(n.roughnessMap=this.roughnessMap.toJSON(e).uuid),this.metalnessMap&&this.metalnessMap.isTexture&&(n.metalnessMap=this.metalnessMap.toJSON(e).uuid),this.emissiveMap&&this.emissiveMap.isTexture&&(n.emissiveMap=this.emissiveMap.toJSON(e).uuid),this.specularMap&&this.specularMap.isTexture&&(n.specularMap=this.specularMap.toJSON(e).uuid),this.specularIntensityMap&&this.specularIntensityMap.isTexture&&(n.specularIntensityMap=this.specularIntensityMap.toJSON(e).uuid),this.specularColorMap&&this.specularColorMap.isTexture&&(n.specularColorMap=this.specularColorMap.toJSON(e).uuid),this.envMap&&this.envMap.isTexture&&(n.envMap=this.envMap.toJSON(e).uuid,this.combine!==void 0&&(n.combine=this.combine)),this.envMapRotation!==void 0&&(n.envMapRotation=this.envMapRotation.toArray()),this.envMapIntensity!==void 0&&(n.envMapIntensity=this.envMapIntensity),this.reflectivity!==void 0&&(n.reflectivity=this.reflectivity),this.refractionRatio!==void 0&&(n.refractionRatio=this.refractionRatio),this.gradientMap&&this.gradientMap.isTexture&&(n.gradientMap=this.gradientMap.toJSON(e).uuid),this.transmission!==void 0&&(n.transmission=this.transmission),this.transmissionMap&&this.transmissionMap.isTexture&&(n.transmissionMap=this.transmissionMap.toJSON(e).uuid),this.thickness!==void 0&&(n.thickness=this.thickness),this.thicknessMap&&this.thicknessMap.isTexture&&(n.thicknessMap=this.thicknessMap.toJSON(e).uuid),this.attenuationDistance!==void 0&&this.attenuationDistance!==1/0&&(n.attenuationDistance=this.attenuationDistance),this.attenuationColor!==void 0&&(n.attenuationColor=this.attenuationColor.getHex()),this.size!==void 0&&(n.size=this.size),this.shadowSide!==null&&(n.shadowSide=this.shadowSide),this.sizeAttenuation!==void 0&&(n.sizeAttenuation=this.sizeAttenuation),this.blending!==gd&&(n.blending=this.blending),this.side!==cl&&(n.side=this.side),this.vertexColors===!0&&(n.vertexColors=!0),this.opacity<1&&(n.opacity=this.opacity),this.transparent===!0&&(n.transparent=!0),this.blendSrc!==Cx&&(n.blendSrc=this.blendSrc),this.blendDst!==Rx&&(n.blendDst=this.blendDst),this.blendEquation!==Gu&&(n.blendEquation=this.blendEquation),this.blendSrcAlpha!==null&&(n.blendSrcAlpha=this.blendSrcAlpha),this.blendDstAlpha!==null&&(n.blendDstAlpha=this.blendDstAlpha),this.blendEquationAlpha!==null&&(n.blendEquationAlpha=this.blendEquationAlpha),this.blendColor&&this.blendColor.isColor&&(n.blendColor=this.blendColor.getHex()),this.blendAlpha!==0&&(n.blendAlpha=this.blendAlpha),this.depthFunc!==Md&&(n.depthFunc=this.depthFunc),this.depthTest===!1&&(n.depthTest=this.depthTest),this.depthWrite===!1&&(n.depthWrite=this.depthWrite),this.colorWrite===!1&&(n.colorWrite=this.colorWrite),this.stencilWriteMask!==255&&(n.stencilWriteMask=this.stencilWriteMask),this.stencilFunc!==X1&&(n.stencilFunc=this.stencilFunc),this.stencilRef!==0&&(n.stencilRef=this.stencilRef),this.stencilFuncMask!==255&&(n.stencilFuncMask=this.stencilFuncMask),this.stencilFail!==rd&&(n.stencilFail=this.stencilFail),this.stencilZFail!==rd&&(n.stencilZFail=this.stencilZFail),this.stencilZPass!==rd&&(n.stencilZPass=this.stencilZPass),this.stencilWrite===!0&&(n.stencilWrite=this.stencilWrite),this.rotation!==void 0&&this.rotation!==0&&(n.rotation=this.rotation),this.polygonOffset===!0&&(n.polygonOffset=!0),this.polygonOffsetFactor!==0&&(n.polygonOffsetFactor=this.polygonOffsetFactor),this.polygonOffsetUnits!==0&&(n.polygonOffsetUnits=this.polygonOffsetUnits),this.linewidth!==void 0&&this.linewidth!==1&&(n.linewidth=this.linewidth),this.dashSize!==void 0&&(n.dashSize=this.dashSize),this.gapSize!==void 0&&(n.gapSize=this.gapSize),this.scale!==void 0&&(n.scale=this.scale),this.dithering===!0&&(n.dithering=!0),this.alphaTest>0&&(n.alphaTest=this.alphaTest),this.alphaHash===!0&&(n.alphaHash=!0),this.alphaToCoverage===!0&&(n.alphaToCoverage=!0),this.premultipliedAlpha===!0&&(n.premultipliedAlpha=!0),this.forceSinglePass===!0&&(n.forceSinglePass=!0),this.wireframe===!0&&(n.wireframe=!0),this.wireframeLinewidth>1&&(n.wireframeLinewidth=this.wireframeLinewidth),this.wireframeLinecap!=="round"&&(n.wireframeLinecap=this.wireframeLinecap),this.wireframeLinejoin!=="round"&&(n.wireframeLinejoin=this.wireframeLinejoin),this.flatShading===!0&&(n.flatShading=!0),this.visible===!1&&(n.visible=!1),this.toneMapped===!1&&(n.toneMapped=!1),this.fog===!1&&(n.fog=!1),Object.keys(this.userData).length>0&&(n.userData=this.userData);function s(a){const l=[];for(const u in a){const h=a[u];delete h.metadata,l.push(h)}return l}if(t){const a=s(e.textures),l=s(e.images);a.length>0&&(n.textures=a),l.length>0&&(n.images=l)}return n}clone(){return new this.constructor().copy(this)}copy(e){this.name=e.name,this.blending=e.blending,this.side=e.side,this.vertexColors=e.vertexColors,this.opacity=e.opacity,this.transparent=e.transparent,this.blendSrc=e.blendSrc,this.blendDst=e.blendDst,this.blendEquation=e.blendEquation,this.blendSrcAlpha=e.blendSrcAlpha,this.blendDstAlpha=e.blendDstAlpha,this.blendEquationAlpha=e.blendEquationAlpha,this.blendColor.copy(e.blendColor),this.blendAlpha=e.blendAlpha,this.depthFunc=e.depthFunc,this.depthTest=e.depthTest,this.depthWrite=e.depthWrite,this.stencilWriteMask=e.stencilWriteMask,this.stencilFunc=e.stencilFunc,this.stencilRef=e.stencilRef,this.stencilFuncMask=e.stencilFuncMask,this.stencilFail=e.stencilFail,this.stencilZFail=e.stencilZFail,this.stencilZPass=e.stencilZPass,this.stencilWrite=e.stencilWrite;const t=e.clippingPlanes;let n=null;if(t!==null){const s=t.length;n=new Array(s);for(let a=0;a!==s;++a)n[a]=t[a].clone()}return this.clippingPlanes=n,this.clipIntersection=e.clipIntersection,this.clipShadows=e.clipSh
vendor: 6,422 bytes, line 78
78adows,this.shadowSide=e.shadowSide,this.colorWrite=e.colorWrite,this.precision=e.precision,this.polygonOffset=e.polygonOffset,this.polygonOffsetFactor=e.polygonOffsetFactor,this.polygonOffsetUnits=e.polygonOffsetUnits,this.dithering=e.dithering,this.alphaTest=e.alphaTest,this.alphaHash=e.alphaHash,this.alphaToCoverage=e.alphaToCoverage,this.premultipliedAlpha=e.premultipliedAlpha,this.forceSinglePass=e.forceSinglePass,this.visible=e.visible,this.toneMapped=e.toneMapped,this.userData=JSON.parse(JSON.stringify(e.userData)),this}dispose(){this.dispatchEvent({type:"dispose"})}set needsUpdate(e){e===!0&&this.version++}onBuild(){console.warn("Material: onBuild() has been removed.")}}class Kr extends js{constructor(e){super(),this.isMeshBasicMaterial=!0,this.type="MeshBasicMaterial",this.color=new Pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qa,this.combine=og,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}const Dc=wO();function wO(){const i=new ArrayBuffer(4),e=new Float32Array(i),t=new Uint32Array(i),n=new Uint32Array(512),s=new Uint32Array(512);for(let h=0;h<256;++h){const p=h-127;p<-27?(n[h]=0,n[h|256]=32768,s[h]=24,s[h|256]=24):p<-14?(n[h]=1024>>-p-14,n[h|256]=1024>>-p-14|32768,s[h]=-p-1,s[h|256]=-p-1):p<=15?(n[h]=p+15<<10,n[h|256]=p+15<<10|32768,s[h]=13,s[h|256]=13):p<128?(n[h]=31744,n[h|256]=64512,s[h]=24,s[h|256]=24):(n[h]=31744,n[h|256]=64512,s[h]=13,s[h|256]=13)}const a=new Uint32Array(2048),l=new Uint32Array(64),u=new Uint32Array(64);for(let h=1;h<1024;++h){let p=h<<13,m=0;for(;(p&8388608)===0;)p<<=1,m-=8388608;p&=-8388609,m+=947912704,a[h]=p|m}for(let h=1024;h<2048;++h)a[h]=939524096+(h-1024<<13);for(let h=1;h<31;++h)l[h]=h<<23;l[31]=1199570944,l[32]=2147483648;for(let h=33;h<63;++h)l[h]=2147483648+(h-32<<23);l[63]=3347054592;for(let h=1;h<64;++h)h!==32&&(u[h]=1024);return{floatView:e,uint32View:t,baseTable:n,shiftTable:s,mantissaTable:a,exponentTable:l,offsetTable:u}}function ka(i){Math.abs(i)>65504&&console.warn("THREE.DataUtils.toHalfFloat(): Value out of range."),i=An(i,-65504,65504),Dc.floatView[0]=i;const e=Dc.uint32View[0],t=e>>23&511;return Dc.baseTable[t]+((e&8388607)>>Dc.shiftTable[t])}function w0(i){const e=i>>10;return Dc.uint32View[0]=Dc.mantissaTable[Dc.offsetTable[e]+(i&1023)]+Dc.exponentTable[e],Dc.floatView[0]}class CO{static toHalfFloat(e){return ka(e)}static fromHalfFloat(e){return w0(e)}}const Qs=new se,Sy=new st;let RO=0;class ci{constructor(e,t,n=!1){if(Array.isArray(e))throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");this.isBufferAttribute=!0,Object.defineProperty(this,"id",{value:RO++}),this.name="",this.array=e,this.itemSize=t,this.count=e!==void 0?e.length/t:0,this.normalized=n,this.usage=q0,this.updateRanges=[],this.gpuType=Yr,this.version=0}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.name=e.name,this.array=new e.array.constructor(e.array),this.itemSize=e.itemSize,this.count=e.count,this.normalized=e.normalized,this.usage=e.usage,this.gpuType=e.gpuType,this}copyAt(e,t,n){e*=this.itemSize,n*=t.itemSize;for(let s=0,a=this.itemSize;s<a;s++)this.array[e+s]=t.array[n+s];return this}copyArray(e){return this.array.set(e),this}applyMatrix3(e){if(this.itemSize===2)for(let t=0,n=this.count;t<n;t++)Sy.fromBufferAttribute(this,t),Sy.applyMatrix3(e),this.setXY(t,Sy.x,Sy.y);else if(this.itemSize===3)for(let t=0,n=this.count;t<n;t++)Qs.fromBufferAttribute(this,t),Qs.applyMatrix3(e),this.setXYZ(t,Qs.x,Qs.y,Qs.z);return this}applyMatrix4(e){for(let t=0,n=this.count;t<n;t++)Qs.fromBufferAttribute(this,t),Qs.applyMatrix4(e),this.setXYZ(t,Qs.x,Qs.y,Qs.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)Qs.fromBufferAttribute(this,t),Qs.applyNormalMatrix(e),this.setXYZ(t,Qs.x,Qs.y,Qs.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)Qs.fromBufferAttribute(this,t),Qs.transformDirection(e),this.setXYZ(t,Qs.x,Qs.y,Qs.z);return this}set(e,t=0){return this.array.set(e,t),this}getComponent(e,t){let n=this.array[e*this.itemSize+t];return this.normalized&&(n=ya(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Dn(n,this.array)),this.array[e*this.itemSize+t]=n,this}getX(e){let t=this.array[e*this.itemSize];return this.normalized&&(t=ya(t,this.array)),t}setX(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize]=t,this}getY(e){let t=this.array[e*this.itemSize+1];return this.normalized&&(t=ya(t,this.array)),t}setY(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+1]=t,this}getZ(e){let t=this.array[e*this.itemSize+2];return this.normalized&&(t=ya(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+2]=t,this}getW(e){let t=this.array[e*this.itemSize+3];return this.normalized&&(t=ya(t,this.array)),t}setW(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+3]=t,this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array)),this.array[e+0]=t,this.array[e+1]=n,this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this}setXYZW(e,t,n,s,a){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array),a=Dn(a,this.array)),this.array[e+0]=t,this.array[e+1]=n,this.array[e+2]=s,this.array[e+3]=a,this}
vendor: 4,270 bytes, line 78
78onUpload(e){return this.onUploadCallback=e,this}clone(){return new this.constructor(this.array,this.itemSize).copy(this)}toJSON(){const e={itemSize:this.itemSize,type:this.array.constructor.name,array:Array.from(this.array),normalized:this.normalized};return this.name!==""&&(e.name=this.name),this.usage!==q0&&(e.usage=this.usage),e}}class BO extends ci{constructor(e,t,n){super(new Int8Array(e),t,n)}}class IO extends ci{constructor(e,t,n){super(new Uint8Array(e),t,n)}}class DO extends ci{constructor(e,t,n){super(new Uint8ClampedArray(e),t,n)}}class LO extends ci{constructor(e,t,n){super(new Int16Array(e),t,n)}}class UA extends ci{constructor(e,t,n){super(new Uint16Array(e),t,n)}}class PO extends ci{constructor(e,t,n){super(new Int32Array(e),t,n)}}class zA extends ci{constructor(e,t,n){super(new Uint32Array(e),t,n)}}class OO extends ci{constructor(e,t,n){super(new Uint16Array(e),t,n),this.isFloat16BufferAttribute=!0}getX(e){let t=w0(this.array[e*this.itemSize]);return this.normalized&&(t=ya(t,this.array)),t}setX(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize]=ka(t),this}getY(e){let t=w0(this.array[e*this.itemSize+1]);return this.normalized&&(t=ya(t,this.array)),t}setY(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+1]=ka(t),this}getZ(e){let t=w0(this.array[e*this.itemSize+2]);return this.normalized&&(t=ya(t,this.array)),t}setZ(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+2]=ka(t),this}getW(e){let t=w0(this.array[e*this.itemSize+3]);return this.normalized&&(t=ya(t,this.array)),t}setW(e,t){return this.normalized&&(t=Dn(t,this.array)),this.array[e*this.itemSize+3]=ka(t),this}setXY(e,t,n){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array)),this.array[e+0]=ka(t),this.array[e+1]=ka(n),this}setXYZ(e,t,n,s){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array)),this.array[e+0]=ka(t),this.array[e+1]=ka(n),this.array[e+2]=ka(s),this}setXYZW(e,t,n,s,a){return e*=this.itemSize,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array),a=Dn(a,this.array)),this.array[e+0]=ka(t),this.array[e+1]=ka(n),this.array[e+2]=ka(s),this.array[e+3]=ka(a),this}}class $t extends ci{constructor(e,t,n){super(new Float32Array(e),t,n)}}let NO=0;const wo=new dn,US=new li,Qh=new se,Ja=new $r,d0=new $r,hr=new se;class Mn extends eo{constructor(){super(),this.isBufferGeometry=!0,Object.defineProperty(this,"id",{value:NO++}),this.uuid=Za(),this.name="",this.type="BufferGeometry",this.index=null,this.indirect=null,this.attributes={},this.morphAttributes={},this.morphTargetsRelative=!1,this.groups=[],this.boundingBox=null,this.boundingSphere=null,this.drawRange={start:0,count:1/0},this.userData={}}getIndex(){return this.index}setIndex(e){return Array.isArray(e)?this.index=new(tI(e)?zA:UA)(e,1):this.index=e,this}setIndirect(e){return this.indirect=e,this}getIndirect(){return this.indirect}getAttribute(e){return this.attributes[e]}setAttribute(e,t){return this.attributes[e]=t,this}deleteAttribute(e){return delete this.attributes[e],this}hasAttribute(e){return this.attributes[e]!==void 0}addGroup(e,t,n=0){this.groups.push({start:e,count:t,materialIndex:n})}clearGroups(){this.groups=[]}setDrawRange(e,t){this.drawRange.start=e,this.drawRange.count=t}applyMatrix4(e){const t=this.attributes.position;t!==void 0&&(t.applyMatrix4(e),t.needsUpdate=!0);const n=this.attributes.normal;if(n!==void 0){const a=new Cn().getNormalMatrix(e);n.applyNormalMatrix(a),n.needsUpdate=!0}const s=this.attributes.tangent;return s!==void 0&&(s.transformDirection(e),s.needsUpdate=!0),this.boundingBox!==null&&this.computeBoundingBox(),this.boundingSphere!==null&&this.computeBoundingSphere(),this}applyQuaternion(e){return wo.makeRotationFromQuaternion(e),this.applyMatrix4(wo),this}rotateX(e){return wo.makeRotationX(e),this.applyMatrix4(wo),this}rotateY(e){return wo.makeRotationY(e),this.applyMatrix4(wo),this}rotateZ(e){return wo.makeRotationZ(e),this.applyMatrix4(wo),this}translate(e,t,n){return wo.makeTranslation(e,t,n),this.applyMatrix4(wo),this}scale(e,t,n){return wo.makeScale(e,t,n),this.applyMatrix4(wo),this}lookAt(e){return US.lookAt(e),US.updateMatrix(),this.applyMatrix4(US.matrix
vendor: 4,687 bytes, line 78
78),this}center(){return this.computeBoundingBox(),this.boundingBox.getCenter(Qh).negate(),this.translate(Qh.x,Qh.y,Qh.z),this}setFromPoints(e){const t=this.getAttribute("position");if(t===void 0){const n=[];for(let s=0,a=e.length;s<a;s++){const l=e[s];n.push(l.x,l.y,l.z||0)}this.setAttribute("position",new $t(n,3))}else{const n=Math.min(e.length,t.count);for(let s=0;s<n;s++){const a=e[s];t.setXYZ(s,a.x,a.y,a.z||0)}e.length>t.count&&console.warn("THREE.BufferGeometry: Buffer size too small for points data. Use .dispose() and create a new geometry."),t.needsUpdate=!0}return this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new $r);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingBox(): GLBufferAttribute requires a manual bounding box.",this),this.boundingBox.set(new se(-1/0,-1/0,-1/0),new se(1/0,1/0,1/0));return}if(e!==void 0){if(this.boundingBox.setFromBufferAttribute(e),t)for(let n=0,s=t.length;n<s;n++){const a=t[n];Ja.setFromBufferAttribute(a),this.morphTargetsRelative?(hr.addVectors(this.boundingBox.min,Ja.min),this.boundingBox.expandByPoint(hr),hr.addVectors(this.boundingBox.max,Ja.max),this.boundingBox.expandByPoint(hr)):(this.boundingBox.expandByPoint(Ja.min),this.boundingBox.expandByPoint(Ja.max))}}else this.boundingBox.makeEmpty();(isNaN(this.boundingBox.min.x)||isNaN(this.boundingBox.min.y)||isNaN(this.boundingBox.min.z))&&console.error('THREE.BufferGeometry.computeBoundingBox(): Computed min/max have NaN values. The "position" attribute is likely to have NaN values.',this)}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dr);const e=this.attributes.position,t=this.morphAttributes.position;if(e&&e.isGLBufferAttribute){console.error("THREE.BufferGeometry.computeBoundingSphere(): GLBufferAttribute requires a manual bounding sphere.",this),this.boundingSphere.set(new se,1/0);return}if(e){const n=this.boundingSphere.center;if(Ja.setFromBufferAttribute(e),t)for(let a=0,l=t.length;a<l;a++){const u=t[a];d0.setFromBufferAttribute(u),this.morphTargetsRelative?(hr.addVectors(Ja.min,d0.min),Ja.expandByPoint(hr),hr.addVectors(Ja.max,d0.max),Ja.expandByPoint(hr)):(Ja.expandByPoint(d0.min),Ja.expandByPoint(d0.max))}Ja.getCenter(n);let s=0;for(let a=0,l=e.count;a<l;a++)hr.fromBufferAttribute(e,a),s=Math.max(s,n.distanceToSquared(hr));if(t)for(let a=0,l=t.length;a<l;a++){const u=t[a],h=this.morphTargetsRelative;for(let p=0,m=u.count;p<m;p++)hr.fromBufferAttribute(u,p),h&&(Qh.fromBufferAttribute(e,p),hr.add(Qh)),s=Math.max(s,n.distanceToSquared(hr))}this.boundingSphere.radius=Math.sqrt(s),isNaN(this.boundingSphere.radius)&&console.error('THREE.BufferGeometry.computeBoundingSphere(): Computed radius is NaN. The "position" attribute is likely to have NaN values.',this)}}computeTangents(){const e=this.index,t=this.attributes;if(e===null||t.position===void 0||t.normal===void 0||t.uv===void 0){console.error("THREE.BufferGeometry: .computeTangents() failed. Missing required attributes (index, position, normal or uv)");return}const n=t.position,s=t.normal,a=t.uv;this.hasAttribute("tangent")===!1&&this.setAttribute("tangent",new ci(new Float32Array(4*n.count),4));const l=this.getAttribute("tangent"),u=[],h=[];for(let X=0;X<n.count;X++)u[X]=new se,h[X]=new se;const p=new se,m=new se,v=new se,x=new st,_=new st,A=new st,R=new se,w=new se;function E(X,z,k){p.fromBufferAttribute(n,X),m.fromBufferAttribute(n,z),v.fromBufferAttribute(n,k),x.fromBufferAttribute(a,X),_.fromBufferAttribute(a,z),A.fromBufferAttribute(a,k),m.sub(p),v.sub(p),_.sub(x),A.sub(x);const ie=1/(_.x*A.y-A.x*_.y);isFinite(ie)&&(R.copy(m).multiplyScalar(A.y).addScaledVector(v,-_.y).multiplyScalar(ie),w.copy(v).multiplyScalar(_.x).addScaledVector(m,-A.x).multiplyScalar(ie),u[X].add(R),u[z].add(R),u[k].add(R),h[X].add(w),h[z].add(w),h[k].add(w))}let D=this.groups;D.length===0&&(D=[{start:0,count:e.count}]);for(let X=0,z=D.length;X<z;++X){const k=D[X],ie=k.start,ve=k.count;for(let J=ie,le=ie+ve;J<le;J+=3)E(e.getX(J+0),e.getX(J+1),e.getX(J+2))}const L=new se,P=new se,G=new se,H=new se;function F(X){G.fromBufferAttribute(s,X),H.copy(G);const z=u[X];L.copy(z),L.sub(G.multiplyScalar(G.dot(z))).normalize(),P.crossVectors(H,z);const ie=P.dot(h[X])<0?-1:1;l.setXYZW(X,L.x,L.y,L.z,ie)}for(let X=0,z=D.length;X<z;++X){const k=D[X],ie=k.start,ve=k.count;for(let J=ie,le=ie+ve;J<le;J+=3)F(e.getX(J+0)),F(e.getX(J+1)),F(e.getX(J+2))}}computeVertexNormals(){const e=this.index,t=this.getAttribute("position");if(t!==void 0){let n=this.getAttribute("normal");if(n===void 0)n=new ci(new Float32Array(t.count*3),3),this.setAttribute("normal",n
vendor: 13,422 bytes, lines 78-82
78);else for(let x=0,_=n.count;x<_;x++)n.setXYZ(x,0,0,0);const s=new se,a=new se,l=new se,u=new se,h=new se,p=new se,m=new se,v=new se;if(e)for(let x=0,_=e.count;x<_;x+=3){const A=e.getX(x+0),R=e.getX(x+1),w=e.getX(x+2);s.fromBufferAttribute(t,A),a.fromBufferAttribute(t,R),l.fromBufferAttribute(t,w),m.subVectors(l,a),v.subVectors(s,a),m.cross(v),u.fromBufferAttribute(n,A),h.fromBufferAttribute(n,R),p.fromBufferAttribute(n,w),u.add(m),h.add(m),p.add(m),n.setXYZ(A,u.x,u.y,u.z),n.setXYZ(R,h.x,h.y,h.z),n.setXYZ(w,p.x,p.y,p.z)}else for(let x=0,_=t.count;x<_;x+=3)s.fromBufferAttribute(t,x+0),a.fromBufferAttribute(t,x+1),l.fromBufferAttribute(t,x+2),m.subVectors(l,a),v.subVectors(s,a),m.cross(v),n.setXYZ(x+0,m.x,m.y,m.z),n.setXYZ(x+1,m.x,m.y,m.z),n.setXYZ(x+2,m.x,m.y,m.z);this.normalizeNormals(),n.needsUpdate=!0}}normalizeNormals(){const e=this.attributes.normal;for(let t=0,n=e.count;t<n;t++)hr.fromBufferAttribute(e,t),hr.normalize(),e.setXYZ(t,hr.x,hr.y,hr.z)}toNonIndexed(){function e(u,h){const p=u.array,m=u.itemSize,v=u.normalized,x=new p.constructor(h.length*m);let _=0,A=0;for(let R=0,w=h.length;R<w;R++){u.isInterleavedBufferAttribute?_=h[R]*u.data.stride+u.offset:_=h[R]*m;for(let E=0;E<m;E++)x[A++]=p[_++]}return new ci(x,m,v)}if(this.index===null)return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."),this;const t=new Mn,n=this.index.array,s=this.attributes;for(const u in s){const h=s[u],p=e(h,n);t.setAttribute(u,p)}const a=this.morphAttributes;for(const u in a){const h=[],p=a[u];for(let m=0,v=p.length;m<v;m++){const x=p[m],_=e(x,n);h.push(_)}t.morphAttributes[u]=h}t.morphTargetsRelative=this.morphTargetsRelative;const l=this.groups;for(let u=0,h=l.length;u<h;u++){const p=l[u];t.addGroup(p.start,p.count,p.materialIndex)}return t}toJSON(){const e={metadata:{version:4.6,type:"BufferGeometry",generator:"BufferGeometry.toJSON"}};if(e.uuid=this.uuid,e.type=this.type,this.name!==""&&(e.name=this.name),Object.keys(this.userData).length>0&&(e.userData=this.userData),this.parameters!==void 0){const h=this.parameters;for(const p in h)h[p]!==void 0&&(e[p]=h[p]);return e}e.data={attributes:{}};const t=this.index;t!==null&&(e.data.index={type:t.array.constructor.name,array:Array.prototype.slice.call(t.array)});const n=this.attributes;for(const h in n){const p=n[h];e.data.attributes[h]=p.toJSON(e.data)}const s={};let a=!1;for(const h in this.morphAttributes){const p=this.morphAttributes[h],m=[];for(let v=0,x=p.length;v<x;v++){const _=p[v];m.push(_.toJSON(e.data))}m.length>0&&(s[h]=m,a=!0)}a&&(e.data.morphAttributes=s,e.data.morphTargetsRelative=this.morphTargetsRelative);const l=this.groups;l.length>0&&(e.data.groups=JSON.parse(JSON.stringify(l)));const u=this.boundingSphere;return u!==null&&(e.data.boundingSphere={center:u.center.toArray(),radius:u.radius}),e}clone(){return new this.constructor().copy(this)}copy(e){this.index=null,this.attributes={},this.morphAttributes={},this.groups=[],this.boundingBox=null,this.boundingSphere=null;const t={};this.name=e.name;const n=e.index;n!==null&&this.setIndex(n.clone());const s=e.attributes;for(const p in s){const m=s[p];this.setAttribute(p,m.clone(t))}const a=e.morphAttributes;for(const p in a){const m=[],v=a[p];for(let x=0,_=v.length;x<_;x++)m.push(v[x].clone(t));this.morphAttributes[p]=m}this.morphTargetsRelative=e.morphTargetsRelative;const l=e.groups;for(let p=0,m=l.length;p<m;p++){const v=l[p];this.addGroup(v.start,v.count,v.materialIndex)}const u=e.boundingBox;u!==null&&(this.boundingBox=u.clone());const h=e.boundingSphere;return h!==null&&(this.boundingSphere=h.clone()),this.drawRange.start=e.drawRange.start,this.drawRange.count=e.drawRange.count,this.userData=e.userData,this}dispose(){this.dispatchEvent({type:"dispose"})}}const yT=new dn,qf=new Lp,Ay=new Dr,xT=new se,My=new se,Ey=new se,Ty=new se,zS=new se,wy=new se,_T=new se,Cy=new se;class hs extends li{constructor(e=new Mn,t=new Kr){super(),this.isMesh=!0,this.type="Mesh",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),e.morphTargetInfluences!==void 0&&(this.morphTargetInfluences=e.morphTargetInfluences.slice()),e.morphTargetDictionary!==void 0&&(this.morphTargetDictionary=Object.assign({},e.morphTargetDictionary)),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=s.length;a<l;a++){const u=s[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=a}}}}getVertexPosition(e,t){const n=this.geometry,s=n.attributes.position,a=n.morphAttributes.position,l=n.morphTargetsRelative;t.fromBufferAttribute(s,e);const u=this.morphTargetInfluences;if(a&&u){wy.set(0,0,0);for(let h=0,p=a.length;h<p;h++){const m=u[h],v=a[h];m!==0&&(zS.fromBufferAttribute(v,e),l?wy.addScaledVector(zS,m):wy.addScaledVector(zS.sub(t),m))}t.add(wy)}return t}raycast(e,t){const n=this.geometry,s=this.material,a=this.matrixWorld;s!==void 0&&(n.boundingSphere===null&&n.computeBoundingSphere(),Ay.copy(n.boundingSphere),Ay.applyMatrix4(a),qf.copy(e.ray).recast(e.near),!(Ay.containsPoint(qf.origin)===!1&&(qf.intersectSphere(Ay,xT)===null||qf.origin.distanceToSquared(xT)>(e.far-e.near)**2))&&(yT.copy(a).invert(),qf.copy(e.ray).applyMatrix4(yT),!(n.boundingBox!==null&&qf.intersectsBox(n.boundingBox)===!1)&&this._computeIntersections(e,t,qf)))}_computeIntersections(e,t,n){let s;const a=this.geometry,l=this.material,u=a.index,h=a.attributes.position,p=a.attributes.uv,m=a.attributes.uv1,v=a.attributes.normal,x=a.groups,_=a.drawRange;if(u!==null)if(Array.isArray(l))for(let A=0,R=x.length;A<R;A++){const w=x[A],E=l[w.materialIndex],D=Math.max(w.start,_.start),L=Math.min(u.count,Math.min(w.start+w.count,_.start+_.count));for(let P=D,G=L;P<G;P+=3){const H=u.getX(P),F=u.getX(P+1),X=u.getX(P+2);s=Ry(this,E,e,n,p,m,v,H,F,X),s&&(s.faceIndex=Math.floor(P/3),s.face.materialIndex=w.materialIndex,t.push(s))}}else{const A=Math.max(0,_.start),R=Math.min(u.count,_.start+_.count);for(let w=A,E=R;w<E;w+=3){const D=u.getX(w),L=u.getX(w+1),P=u.getX(w+2);s=Ry(this,l,e,n,p,m,v,D,L,P),s&&(s.faceIndex=Math.floor(w/3),t.push(s))}}else if(h!==void 0)if(Array.isArray(l))for(let A=0,R=x.length;A<R;A++){const w=x[A],E=l[w.materialIndex],D=Math.max(w.start,_.start),L=Math.min(h.count,Math.min(w.start+w.count,_.start+_.count));for(let P=D,G=L;P<G;P+=3){const H=P,F=P+1,X=P+2;s=Ry(this,E,e,n,p,m,v,H,F,X),s&&(s.faceIndex=Math.floor(P/3),s.face.materialIndex=w.materialIndex,t.push(s))}}else{const A=Math.max(0,_.start),R=Math.min(h.count,_.start+_.count);for(let w=A,E=R;w<E;w+=3){const D=w,L=w+1,P=w+2;s=Ry(this,l,e,n,p,m,v,D,L,P),s&&(s.faceIndex=Math.floor(w/3),t.push(s))}}}}function UO(i,e,t,n,s,a,l,u){let h;if(e.side===$s?h=n.intersectTriangle(l,a,s,!0,u):h=n.intersectTriangle(s,a,l,e.side===cl,u),h===null)return null;Cy.copy(u),Cy.applyMatrix4(i.matrixWorld);const p=t.ray.origin.distanceTo(Cy);return p<t.near||p>t.far?null:{distance:p,point:Cy.clone(),object:i}}function Ry(i,e,t,n,s,a,l,u,h,p){i.getVertexPosition(u,My),i.getVertexPosition(h,Ey),i.getVertexPosition(p,Ty);const m=UO(i,e,t,n,My,Ey,Ty,_T);if(m){const v=new se;Ha.getBarycoord(_T,My,Ey,Ty,v),s&&(m.uv=Ha.getInterpolatedAttribute(s,u,h,p,v,new st)),a&&(m.uv1=Ha.getInterpolatedAttribute(a,u,h,p,v,new st)),l&&(m.normal=Ha.getInterpolatedAttribute(l,u,h,p,v,new se),m.normal.dot(n.direction)>0&&m.normal.multiplyScalar(-1));const x={a:u,b:h,c:p,normal:new se,materialIndex:0};Ha.getNormal(My,Ey,Ty,x.normal),m.face=x,m.barycoord=v}return m}class Od extends Mn{constructor(e=1,t=1,n=1,s=1,a=1,l=1){super(),this.type="BoxGeometry",this.parameters={width:e,height:t,depth:n,widthSegments:s,heightSegments:a,depthSegments:l};const u=this;s=Math.floor(s),a=Math.floor(a),l=Math.floor(l);const h=[],p=[],m=[],v=[];let x=0,_=0;A("z","y","x",-1,-1,n,t,e,l,a,0),A("z","y","x",1,-1,n,t,-e,l,a,1),A("x","z","y",1,1,e,n,t,s,l,2),A("x","z","y",1,-1,e,n,-t,s,l,3),A("x","y","z",1,-1,e,t,n,s,a,4),A("x","y","z",-1,-1,e,t,-n,s,a,5),this.setIndex(h),this.setAttribute("position",new $t(p,3)),this.setAttribute("normal",new $t(m,3)),this.setAttribute("uv",new $t(v,2));function A(R,w,E,D,L,P,G,H,F,X,z){const k=P/F,ie=G/X,ve=P/2,J=G/2,le=H/2,ae=F+1,W=X+1;let ee=0,te=0;const ue=new se;for(let he=0;he<W;he++){const K=he*ie-J;for(let ce=0;ce<ae;ce++){const re=ce*k-ve;ue[R]=re*D,ue[w]=K*L,ue[E]=le,p.push(ue.x,ue.y,ue.z),ue[R]=0,ue[w]=0,ue[E]=H>0?1:-1,m.push(ue.x,ue.y,ue.z),v.push(ce/F),v.push(1-he/X),ee+=1}}for(let he=0;he<X;he++)for(let K=0;K<F;K++){const ce=x+K+ae*he,re=x+K+ae*(he+1),oe=x+(K+1)+ae*(he+1),we=x+(K+1)+ae*he;h.push(ce,re,we),h.push(re,oe,we),te+=6}u.addGroup(_,te,z),_+=te,x+=ee}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Od(e.width,e.height,e.depth,e.widthSegments,e.heightSegments,e.depthSegments)}}function Cp(i){const e={};for(const t in i){e[t]={};for(const n in i[t]){const s=i[t][n];s&&(s.isColor||s.isMatrix3||s.isMatrix4||s.isVector2||s.isVector3||s.isVector4||s.isTexture||s.isQuaternion)?s.isRenderTargetTexture?(console.warn("UniformsUtils: Textures of render targets cannot be cloned via cloneUniforms() or mergeUniforms()."),e[t][n]=null):e[t][n]=s.clone():Array.isArray(s)?e[t][n]=s.slice():e[t][n]=s}}return e}function ga(i){const e={};for(let t=0;t<i.length;t++){const n=Cp(i[t]);for(const s in n)e[s]=n[s]}return e}function zO(i){const e=[];for(let t=0;t<i.length;t++)e.push(i[t].clone());return e}function rI(i){const e=i.getRenderTarget();return e===null?i.outputColorSpace:e.isXRRenderTarget===!0?e.texture.colorSpace:si.workingColorSpace}const aI={clone:Cp,merge:ga};var FO=`void main() {
79	gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
80}`,kO=`void main() {
81	gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );
82}`;class Zi extends js{constructor(e){super(),this.isShaderMaterial=!0,this.type="ShaderMaterial",this.defines={},this.uniforms={},this.uniformsGroups=[],this.vertexShader=FO,this.fragmentShader=kO,this.linewidth=1,this.wireframe=!1,this.wireframeLinewidth=1,this.fog=!1,this.lights=!1,this.clipping=!1,this.forceSinglePass=!0,this.extensions={clipCullDistance:!1,multiDraw:!1},this.defaultAttributeValues={color:[1,1,1],uv:[0,0],uv1:[0,0]},this.index0AttributeName=void 0,this.uniformsNeedUpdate=!1,this.glslVersion=null,e!==void 0&&this.setValues(e)}copy(e){return super.copy(e),this.fragmentShader=e.fragmentShader,this.vertexShader=e.vertexShader,this.uniforms=Cp(e.uniforms),this.uniformsGroups=zO(e.uniformsGroups),this.defines=Object.assign({},e.defines),this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.fog=e.fog,this.lights=e.lights,this.clipping=e.clipping,this.extensions=Object.assign({},e.extensions),this.glslVersion=e.glslVersion,this}toJSON(e){const t=super.toJSON(e);t.glslVersion=this.glslVersion,t.uniforms={};for(const s in this.uniforms){const l=this.uniforms[s].value;l&&l.isTexture?t.uniforms[s]={type:"t",value:l.toJSON(e).uuid}:l&&l.isColor?t.uniforms[s]={type:"c",value:l.getHex()}:l&&l.isVector2?t.uniforms[s]={type:"v2",value:l.toArray()}:l&&l.isVector3?t.uniforms[s]={type:"v3",value:l.toArray()}:l&&l.isVector4?t.uniforms[s]={type:"v4",value:l.toArray()}:l&&l.isMatrix3?t.uniforms[s]={type:"m3",value:l.toArray()}:l&&l.isMatrix4?t.uniforms[s]={type:"m4",value:l.toArray()}:t.uniforms[s]={value:l}}Object.keys(this.defines).length>0&&(t.defines=this.defines),t.vertexShader=this.vertexShader,t.fragmentShader=this.fragmentShader,t.lights=this.lights,t.clipping=this.clipping;const n={};for(const s in this.extensions)this.extensions[s]===!0&&(n[s]=!0);return Object.keys(n).length>0&&(t.extensions=n),t}}class H_ extends li{constructor(){super(),this.isCamera=!0,this.type="Camera",this.matrixWorldInverse=new dn,this.projectionMatrix=new dn,this.projectionMatrixInverse=new dn,this.coordinateSystem=al}copy(e,t){return super.copy(e,t),this.matrixWorldInverse.copy(e.matrixWorldInverse),this.projectionMatrix.copy(e.projectionMatrix),this.projectionMatrixInverse.copy(e.projectionMatrixInverse),this.coordinateSystem=e.coordinateSystem,this}getWorldDirection(e){return super.getWorldDirection(e).negate()}updateMatrixWorld(e){super.updateMatrixWorld(e),this.matrixWorldInverse.copy(this.matrixWorld).invert()}updateWorldMatrix(e,t){super.updateWorldMatrix(e,t),this.matrixWorldInverse.copy(this.matrixWorld).invert()}clone(){return new this.constructor().copy(this)}}const Uu=new se,bT=new st,ST=new st;class Ds extends H_{constructor(e=50,t=1,n=.1,s=2e3){super(),this.isPerspectiveCamera=!0,this.type="PerspectiveCamera",this.fov=e,this.zoom=1,this.near=n,this.far=s,this.focus=10,this.aspect=t,this.view=null,this.filmGauge=35,this.filmOffset=0,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.fov=e.fov,this.zoom=e.zoom,this.near=e.near,this.far=e.far,this.focus=e.focus,this.aspect=e.aspect,this.view=e.view===null?null:Object.assign({},e.view),this.filmGauge=e.filmGauge,this.filmOffset=e.filmOffset,this}setFocalLength(e){const t=.5*this.getFilmHeight()/e;this.fov=Tp*2*Math.atan(t),this.updateProjectionMatrix()}getFocalLength(){const e=Math.tan(vd*.5*this.fov);return .5*this.getFilmHeight()/e}
vendor: 20,271 bytes, lines 82-117
82getEffectiveFOV(){return Tp*2*Math.atan(Math.tan(vd*.5*this.fov)/this.zoom)}getFilmWidth(){return this.filmGauge*Math.min(this.aspect,1)}getFilmHeight(){return this.filmGauge/Math.max(this.aspect,1)}getViewBounds(e,t,n){Uu.set(-1,-1,.5).applyMatrix4(this.projectionMatrixInverse),t.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z),Uu.set(1,1,.5).applyMatrix4(this.projectionMatrixInverse),n.set(Uu.x,Uu.y).multiplyScalar(-e/Uu.z)}getViewSize(e,t){return this.getViewBounds(e,bT,ST),t.subVectors(ST,bT)}setViewOffset(e,t,n,s,a,l){this.aspect=e/t,this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=this.near;let t=e*Math.tan(vd*.5*this.fov)/this.zoom,n=2*t,s=this.aspect*n,a=-.5*s;const l=this.view;if(this.view!==null&&this.view.enabled){const h=l.fullWidth,p=l.fullHeight;a+=l.offsetX*s/h,t-=l.offsetY*n/p,s*=l.width/h,n*=l.height/p}const u=this.filmOffset;u!==0&&(a+=e*u/this.getFilmWidth()),this.projectionMatrix.makePerspective(a,a+s,t,t-n,e,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.fov=this.fov,t.object.zoom=this.zoom,t.object.near=this.near,t.object.far=this.far,t.object.focus=this.focus,t.object.aspect=this.aspect,this.view!==null&&(t.object.view=Object.assign({},this.view)),t.object.filmGauge=this.filmGauge,t.object.filmOffset=this.filmOffset,t}}const $h=-90,ep=1;class oI extends li{constructor(e,t,n){super(),this.type="CubeCamera",this.renderTarget=n,this.coordinateSystem=null,this.activeMipmapLevel=0;const s=new Ds($h,ep,e,t);s.layers=this.layers,this.add(s);const a=new Ds($h,ep,e,t);a.layers=this.layers,this.add(a);const l=new Ds($h,ep,e,t);l.layers=this.layers,this.add(l);const u=new Ds($h,ep,e,t);u.layers=this.layers,this.add(u);const h=new Ds($h,ep,e,t);h.layers=this.layers,this.add(h);const p=new Ds($h,ep,e,t);p.layers=this.layers,this.add(p)}updateCoordinateSystem(){const e=this.coordinateSystem,t=this.children.concat(),[n,s,a,l,u,h]=t;for(const p of t)this.remove(p);if(e===al)n.up.set(0,1,0),n.lookAt(1,0,0),s.up.set(0,1,0),s.lookAt(-1,0,0),a.up.set(0,0,-1),a.lookAt(0,1,0),l.up.set(0,0,1),l.lookAt(0,-1,0),u.up.set(0,1,0),u.lookAt(0,0,1),h.up.set(0,1,0),h.lookAt(0,0,-1);else if(e===Y0)n.up.set(0,-1,0),n.lookAt(-1,0,0),s.up.set(0,-1,0),s.lookAt(1,0,0),a.up.set(0,0,1),a.lookAt(0,1,0),l.up.set(0,0,-1),l.lookAt(0,-1,0),u.up.set(0,-1,0),u.lookAt(0,0,1),h.up.set(0,-1,0),h.lookAt(0,0,-1);else throw new Error("THREE.CubeCamera.updateCoordinateSystem(): Invalid coordinate system: "+e);for(const p of t)this.add(p),p.updateMatrixWorld()}update(e,t){this.parent===null&&this.updateMatrixWorld();const{renderTarget:n,activeMipmapLevel:s}=this;this.coordinateSystem!==e.coordinateSystem&&(this.coordinateSystem=e.coordinateSystem,this.updateCoordinateSystem());const[a,l,u,h,p,m]=this.children,v=e.getRenderTarget(),x=e.getActiveCubeFace(),_=e.getActiveMipmapLevel(),A=e.xr.enabled;e.xr.enabled=!1;const R=n.texture.generateMipmaps;n.texture.generateMipmaps=!1,e.setRenderTarget(n,0,s),e.render(t,a),e.setRenderTarget(n,1,s),e.render(t,l),e.setRenderTarget(n,2,s),e.render(t,u),e.setRenderTarget(n,3,s),e.render(t,h),e.setRenderTarget(n,4,s),e.render(t,p),n.texture.generateMipmaps=R,e.setRenderTarget(n,5,s),e.render(t,m),e.setRenderTarget(v,x,_),e.xr.enabled=A,n.texture.needsPMREMUpdate=!0}}class ug extends Ki{constructor(e=[],t=Fc,n,s,a,l,u,h,p,m){super(e,t,n,s,a,l,u,h,p,m),this.isCubeTexture=!0,this.flipY=!1}get images(){return this.image}set images(e){this.image=e}}class lI extends Ms{constructor(e=1,t={}){super(e,e,t),this.isWebGLCubeRenderTarget=!0;const n={width:e,height:e,depth:1},s=[n,n,n,n,n,n];this.texture=new ug(s,t.mapping,t.wrapS,t.wrapT,t.magFilter,t.minFilter,t.format,t.type,t.anisotropy,t.colorSpace),this.texture.isRenderTargetTexture=!0,this.texture.generateMipmaps=t.generateMipmaps!==void 0?t.generateMipmaps:!1,this.texture.minFilter=t.minFilter!==void 0?t.minFilter:as}fromEquirectangularTexture(e,t){this.texture.type=t.type,this.texture.colorSpace=t.colorSpace,this.texture.generateMipmaps=t.generateMipmaps,this.texture.minFilter=t.minFilter,this.texture.magFilter=t.magFilter;const n={uniforms:{tEquirect:{value:null}},vertexShader:`
83
84				varying vec3 vWorldDirection;
85
86				vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
87
88					return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
89
90				}
91
92				void main() {
93
94					vWorldDirection = transformDirection( position, modelMatrix );
95
96					#include <begin_vertex>
97					#include <project_vertex>
98
99				}
100			`,fragmentShader:`
101
102				uniform sampler2D tEquirect;
103
104				varying vec3 vWorldDirection;
105
106				#include <common>
107
108				void main() {
109
110					vec3 direction = normalize( vWorldDirection );
111
112					vec2 sampleUV = equirectUv( direction );
113
114					gl_FragColor = texture2D( tEquirect, sampleUV );
115
116				}
117			`},s=new Od(5,5,5),a=new Zi({name:"CubemapFromEquirect",uniforms:Cp(n.uniforms),vertexShader:n.vertexShader,fragmentShader:n.fragmentShader,side:$s,blending:Qr});a.uniforms.tEquirect.value=t;const l=new hs(s,a),u=t.minFilter;return t.minFilter===Do&&(t.minFilter=as),new oI(1,10,this).update(e,l),t.minFilter=u,l.geometry.dispose(),l.material.dispose(),this}clear(e,t=!0,n=!0,s=!0){const a=e.getRenderTarget();for(let l=0;l<6;l++)e.setRenderTarget(this,l),e.clear(t,n,s);e.setRenderTarget(a)}}class Lc extends li{constructor(){super(),this.isGroup=!0,this.type="Group"}}const HO={type:"move"};class bx{constructor(){this._targetRay=null,this._grip=null,this._hand=null}getHandSpace(){return this._hand===null&&(this._hand=new Lc,this._hand.matrixAutoUpdate=!1,this._hand.visible=!1,this._hand.joints={},this._hand.inputState={pinching:!1}),this._hand}getTargetRaySpace(){return this._targetRay===null&&(this._targetRay=new Lc,this._targetRay.matrixAutoUpdate=!1,this._targetRay.visible=!1,this._targetRay.hasLinearVelocity=!1,this._targetRay.linearVelocity=new se,this._targetRay.hasAngularVelocity=!1,this._targetRay.angularVelocity=new se),this._targetRay}getGripSpace(){return this._grip===null&&(this._grip=new Lc,this._grip.matrixAutoUpdate=!1,this._grip.visible=!1,this._grip.hasLinearVelocity=!1,this._grip.linearVelocity=new se,this._grip.hasAngularVelocity=!1,this._grip.angularVelocity=new se),this._grip}dispatchEvent(e){return this._targetRay!==null&&this._targetRay.dispatchEvent(e),this._grip!==null&&this._grip.dispatchEvent(e),this._hand!==null&&this._hand.dispatchEvent(e),this}connect(e){if(e&&e.hand){const t=this._hand;if(t)for(const n of e.hand.values())this._getHandJoint(t,n)}return this.dispatchEvent({type:"connected",data:e}),this}disconnect(e){return this.dispatchEvent({type:"disconnected",data:e}),this._targetRay!==null&&(this._targetRay.visible=!1),this._grip!==null&&(this._grip.visible=!1),this._hand!==null&&(this._hand.visible=!1),this}update(e,t,n){let s=null,a=null,l=null;const u=this._targetRay,h=this._grip,p=this._hand;if(e&&t.session.visibilityState!=="visible-blurred"){if(p&&e.hand){l=!0;for(const R of e.hand.values()){const w=t.getJointPose(R,n),E=this._getHandJoint(p,R);w!==null&&(E.matrix.fromArray(w.transform.matrix),E.matrix.decompose(E.position,E.rotation,E.scale),E.matrixWorldNeedsUpdate=!0,E.jointRadius=w.radius),E.visible=w!==null}const m=p.joints["index-finger-tip"],v=p.joints["thumb-tip"],x=m.position.distanceTo(v.position),_=.02,A=.005;p.inputState.pinching&&x>_+A?(p.inputState.pinching=!1,this.dispatchEvent({type:"pinchend",handedness:e.handedness,target:this})):!p.inputState.pinching&&x<=_-A&&(p.inputState.pinching=!0,this.dispatchEvent({type:"pinchstart",handedness:e.handedness,target:this}))}else h!==null&&e.gripSpace&&(a=t.getPose(e.gripSpace,n),a!==null&&(h.matrix.fromArray(a.transform.matrix),h.matrix.decompose(h.position,h.rotation,h.scale),h.matrixWorldNeedsUpdate=!0,a.linearVelocity?(h.hasLinearVelocity=!0,h.linearVelocity.copy(a.linearVelocity)):h.hasLinearVelocity=!1,a.angularVelocity?(h.hasAngularVelocity=!0,h.angularVelocity.copy(a.angularVelocity)):h.hasAngularVelocity=!1));u!==null&&(s=t.getPose(e.targetRaySpace,n),s===null&&a!==null&&(s=a),s!==null&&(u.matrix.fromArray(s.transform.matrix),u.matrix.decompose(u.position,u.rotation,u.scale),u.matrixWorldNeedsUpdate=!0,s.linearVelocity?(u.hasLinearVelocity=!0,u.linearVelocity.copy(s.linearVelocity)):u.hasLinearVelocity=!1,s.angularVelocity?(u.hasAngularVelocity=!0,u.angularVelocity.copy(s.angularVelocity)):u.hasAngularVelocity=!1,this.dispatchEvent(HO)))}return u!==null&&(u.visible=s!==null),h!==null&&(h.visible=a!==null),p!==null&&(p.visible=l!==null),this}_getHandJoint(e,t){if(e.joints[t.jointName]===void 0){const n=new Lc;n.matrixAutoUpdate=!1,n.visible=!1,e.joints[t.jointName]=n,e.add(n)}return e.joints[t.jointName]}}class G_{constructor(e,t=25e-5){this.isFogExp2=!0,this.name="",this.color=new Pt(e),this.density=t}clone(){return new G_(this.color,this.density)}toJSON(){return{type:"FogExp2",name:this.name,color:this.color.getHex(),density:this.density}}}class j_{constructor(e,t=1,n=1e3){this.isFog=!0,this.name="",this.color=new Pt(e),this.near=t,this.far=n}clone(){return new j_(this.color,this.near,this.far)}toJSON(){return{type:"Fog",name:this.name,color:this.color.getHex(),near:this.near,far:this.far}}}class K0 extends li{constructor(){super(),this.isScene=!0,this.type="Scene",this.background=null,this.environment=null,this.fog=null,this.backgroundBlurriness=0,this.backgroundIntensity=1,this.backgroundRotation=new Qa,this.environmentIntensity=1,this.environmentRotation=new Qa,this.overrideMaterial=null,typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}copy(e,t){return super.copy(e,t),e.background!==null&&(this.background=e.background.clone()),e.environment!==null&&(this.environment=e.environment.clone()),e.fog!==null&&(this.fog=e.fog.clone()),this.backgroundBlurriness=e.backgroundBlurriness,this.backgroundIntensity=e.backgroundIntensity,this.backgroundRotation.copy(e.backgroundRotation),this.environmentIntensity=e.environmentIntensity,this.environmentRotation.copy(e.environmentRotation),e.overrideMaterial!==null&&(this.overrideMaterial=e.overrideMaterial.clone()),this.matrixAutoUpdate=e.matrixAutoUpdate,this}toJSON(e){const t=super.toJSON(e);return this.fog!==null&&(t.object.fog=this.fog.toJSON()),this.backgroundBlurriness>0&&(t.object.backgroundBlurriness=this.backgroundBlurriness),this.backgroundIntensity!==1&&(t.object.backgroundIntensity=this.backgroundIntensity),t.object.backgroundRotation=this.backgroundRotation.toArray(),this.environmentIntensity!==1&&(t.object.environmentIntensity=this.environmentIntensity),t.object.environmentRotation=this.environmentRotation.toArray(),t}}class fg{constructor(e,t){this.isInterleavedBuffer=!0,this.array=e,this.stride=t,this.count=e!==void 0?e.length/t:0,this.usage=q0,this.updateRanges=[],this.version=0,this.uuid=Za()}onUploadCallback(){}set needsUpdate(e){e===!0&&this.version++}setUsage(e){return this.usage=e,this}addUpdateRange(e,t){this.updateRanges.push({start:e,count:t})}clearUpdateRanges(){this.updateRanges.length=0}copy(e){return this.array=new e.array.constructor(e.array),this.count=e.count,this.stride=e.stride,this.usage=e.usage,this}copyAt(e,t,n){e*=this.stride,n*=t.stride;for(let s=0,a=this.stride;s<a;s++)this.array[e+s]=t.array[n+s];return this}set(e,t=0){return this.array.set(e,t),this}clone(e){e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Za()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=this.array.slice(0).buffer);const t=new this.array.constructor(e.arrayBuffers[this.array.buffer._uuid]),n=new this.constructor(t,this.stride);return n.setUsage(this.usage),n}onUpload(e){return this.onUploadCallback=e,this}toJSON(e){return e.arrayBuffers===void 0&&(e.arrayBuffers={}),this.array.buffer._uuid===void 0&&(this.array.buffer._uuid=Za()),e.arrayBuffers[this.array.buffer._uuid]===void 0&&(e.arrayBuffers[this.array.buffer._uuid]=Array.from(new Uint32Array(this.array.buffer))),{uuid:this.uuid,buffer:this.array.buffer._uuid,type:this.array.constructor.name,stride:this.stride}}}const ma=new se;class Qu{constructor(e,t,n,s=!1){this.isInterleavedBufferAttribute=!0,this.name="",this.data=e,this.itemSize=t,this.offset=n,this.normalized=s}get count(){return this.data.count}get array(){return this.data.array}set needsUpdate(e){this.data.needsUpdate=e}applyMatrix4(e){for(let t=0,n=this.data.count;t<n;t++)ma.fromBufferAttribute(this,t),ma.applyMatrix4(e),this.setXYZ(t,ma.x,ma.y,ma.z);return this}applyNormalMatrix(e){for(let t=0,n=this.count;t<n;t++)ma.fromBufferAttribute(this,t),ma.applyNormalMatrix(e),this.setXYZ(t,ma.x,ma.y,ma.z);return this}transformDirection(e){for(let t=0,n=this.count;t<n;t++)ma.fromBufferAttribute(this,t),ma.transformDirection(e),this.setXYZ(t,ma.x,ma.y,ma.z);return this}getComponent(e,t){let n=this.array[e*this.data.stride+this.offset+t];return this.normalized&&(n=ya(n,this.array)),n}setComponent(e,t,n){return this.normalized&&(n=Dn(n,this.array)),this.data.array[e*this.data.stride+this.offset+t]=n,this}setX(e,t){return this.normalized&&(t=Dn(t,this.array)),this.data.array[e*this.data.stride+this.offset]=t,this}setY(e,t){return this.normalized&&(t=Dn(t,this.array)),this.data.array[e*this.data.stride+this.offset+1]=t,this}setZ(e,t){return this.normalized&&(t=Dn(t,this.array)),this.data.array[e*this.data.stride+this.offset+2]=t,this}setW(e,t){return this.normalized&&(t=Dn(t,this.array)),this.data.array[e*this.data.stride+this.offset+3]=t,this}getX(e){let t=this.data.array[e*this.data.stride+this.offset];return this.normalized&&(t=ya(t,this.array)),t}getY(e){let t=this.data.array[e*this.data.stride+this.offset+1];return this.normalized&&(t=ya(t,this.array)),t}getZ(e){let t=this.data.array[e*this.data.stride+this.offset+2];return this.normalized&&(t=ya(t,this.array)),t}getW(e){let t=this.data.array[e*this.data.stride+this.offset+3];return this.normalized&&(t=ya(t,this.array)),t}setXY(e,t,n){return e=e*this.data.stride+this.offset,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this}setXYZ(e,t,n,s){return e=e*this.data.stride+this.offset,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this}setXYZW(e,t,n,s,a){return e=e*this.data.stride+this.offset,this.normalized&&(t=Dn(t,this.array),n=Dn(n,this.array),s=Dn(s,this.array),a=Dn(a,this.array)),this.data.array[e+0]=t,this.data.array[e+1]=n,this.data.array[e+2]=s,this.data.array[e+3]=a,this}clone(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.clone(): Cloning an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[s+a])}return new ci(new this.array.constructor(t),this.itemSize,this.normalized)}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.clone(e)),new Qu(e.interleavedBuffers[this.data.uuid],this.itemSize,this.offset,this.normalized)}toJSON(e){if(e===void 0){console.log("THREE.InterleavedBufferAttribute.toJSON(): Serializing an interleaved buffer attribute will de-interleave buffer data.");const t=[];for(let n=0;n<this.count;n++){const s=n*this.data.stride+this.offset;for(let a=0;a<this.itemSize;a++)t.push(this.data.array[s+a])}return{itemSize:this.itemSize,type:this.array.constructor.name,array:t,normalized:this.normalized}}else return e.interleavedBuffers===void 0&&(e.interleavedBuffers={}),e.interleavedBuffers[this.data.uuid]===void 0&&(e.interleavedBuffers[this.data.uuid]=this.data.toJSON(e)),{isInterleavedBufferAttribute:!0,itemSize:this.itemSize,data:this.data.uuid,offset:this.offset,normalized:this.normalized}}}class FA extends js{constructor(e){super(),this.isSpriteMaterial=!0,this.type="SpriteMaterial",this.color=new Pt(16777215),this.map=null,this.alphaMap=null,this.rotation=0,this.sizeAttenuation=!0,this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.rotation=e.rotation,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}let tp;const h0=new se,np=new se,ip=new se,sp=new st,p0=new st,cI=new dn,By=new se,m0=new se,Iy=new se,AT=new st,FS=new st,MT=new st;class uI extends li{constructor(e=new FA){if(super(),this.isSprite=!0,this.type="Sprite",tp===void 0){tp=new Mn;const t=new Float32Array([-.5,-.5,0,0,0,.5,-.5,0,1,0,.5,.5,0,1,1,-.5,.5,0,0,1]),n=new fg(t,5);tp.setIndex([0,1,2,0,2,3]),tp.setAttribute("position",new Qu(n,3,0,!1)),tp.setAttribute("uv",new Qu(n,2,3,!1))}this.geometry=tp,this.material=e,this.center=new st(.5,.5)}raycast(e,t){e.camera===null&&console.error('THREE.Sprite: "Raycaster.camera" needs to be set in order to raycast against sprites.'),np.setFromMatrixScale(this.matrixWorld),cI.copy(e.camera.matrixWorld),this.modelViewMatrix.multiplyMatrices(e.camera.matrixWorldInverse,this.matrixWorld),ip.setFromMatrixPosition(this.modelViewMatrix),e.camera.isPerspectiveCamera&&this.material.sizeAttenuation===!1&&np.multiplyScalar(-ip.z);const n=this.material.rotation;let s,a;n!==0&&(a=Math.cos(n),s=Math.sin(n));const l=this.center;Dy(By.set(-.5,-.5,0),ip,l,np,s,a),Dy(m0.set(.5,-.5,0),ip,l,np,s,a),Dy(Iy.set(.5,.5,0),ip,l,np,s,a),AT.set(0,0),FS.set(1,0),MT.set(1,1);let u=e.ray.intersectTriangle(By,m0,Iy,!1,h0);if(u===null&&(Dy(m0.set(-.5,.5,0),ip,l,np,s,a),FS.set(0,1),u=e.ray.intersectTriangle(By,Iy,m0,!1,h0),u===null))return;const h=e.ray.origin.distanceTo(h0);h<e.near||h>e.far||t.push({distance:h,point:h0.clone(),uv:Ha.getInterpolation(h0,By,m0,Iy,AT,FS,MT,new st),face:null,object:this})}copy(e,t){return super.copy(e,t),e.center!==void 0&&this.center.copy(e.center),this.material=e.material,this}}function Dy(i,e,t,n,s,a){sp.subVectors(i,t).addScalar(.5).multiply(n),s!==void 0?(p0.x=a*sp.x-s*sp.y,p0.y=s*sp.x+a*sp.y):p0.copy(sp),i.copy(e),i.x+=p0.x,i.y+=p0.y,i.applyMatrix4(cI)}const Ly=new se,ET=new se;class fI extends li{constructor(){super(),this.isLOD=!0,this._currentLevel=0,this.type="LOD",Object.defineProperties(this,{levels:{enumerable:!0,value:[]}}),this.autoUpdate=!0}copy(e){super.copy(e,!1);const t=e.levels;for(let n=0,s=t.length;n<s;n++){const a=t[n];this.addLevel(a.object.clone(),a.distance,a.hysteresis)}return this.autoUpdate=e.autoUpdate,this}addLevel(e,t=0,n=0){t=Math.abs(t);const s=this.levels;let a;for(a=0;a<s.length&&!(t<s[a].distance);a++);return s.splice(a,0,{distance:t,hysteresis:n,object:e}),this.add(e),this}removeLevel(e){const t=this.levels;for(let n=0;n<t.length;n++)if(t[n].distance===e){const s=t.splice(n,1);return this.remove(s[0].object),!0}return!1}getCurrentLevel(){return this._currentLevel}getObjectForDistance(e){const t=this.levels;if(t.length>0){let n,s;for(n=1,s=t.length;n<s;n++){let a=t[n].distance;if(t[n].object.visible&&(a-=a*t[n].hysteresis),e<a)break}return t[n-1].object}return null}raycast(e,t){if(this.levels.length>0){Ly.setFromMatrixPosition(this.matrixWorld);const s=e.ray.origin.distanceTo(Ly);this.getObjectForDistance(s).raycast(e,t)}}update(e){const t=this.levels;if(t.length>1){Ly.setFromMatrixPosition(e.matrixWorld),ET.setFromMatrixPosition(this.matrixWorld);const n=Ly.distanceTo(ET)/e.zoom;t[0].object.visible=!0;let s,a;for(s=1,a=t.length;s<a;s++){let l=t[s].distance;if(t[s].object.visible&&(l-=l*t[s].hysteresis),n>=l)t[s-1].object.visible=!1,t[s].object.visible=!0;else break}for(this._currentLevel=s-1;s<a;s++)t[s].object.visible=!1}}toJSON(e){const t=super.toJSON(e);this.autoUpdate===!1&&(t.object.autoUpdate=!1),t.object.levels=[];const n=this.levels;for(let s=0,a=n.length;s<a;s++){const l=n[s];t.object.levels.push({object:l.object.uuid,distance:l.distance,hysteresis:l.hysteresis})}return t}}
vendor: 8,091 bytes, line 117
117const TT=new se,wT=new oi,CT=new oi,GO=new se,RT=new dn,Py=new se,kS=new Dr,BT=new dn,HS=new Lp;class kA extends hs{constructor(e,t){super(e,t),this.isSkinnedMesh=!0,this.type="SkinnedMesh",this.bindMode=W1,this.bindMatrix=new dn,this.bindMatrixInverse=new dn,this.boundingBox=null,this.boundingSphere=null}computeBoundingBox(){const e=this.geometry;this.boundingBox===null&&(this.boundingBox=new $r),this.boundingBox.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Py),this.boundingBox.expandByPoint(Py)}computeBoundingSphere(){const e=this.geometry;this.boundingSphere===null&&(this.boundingSphere=new Dr),this.boundingSphere.makeEmpty();const t=e.getAttribute("position");for(let n=0;n<t.count;n++)this.getVertexPosition(n,Py),this.boundingSphere.expandByPoint(Py)}copy(e,t){return super.copy(e,t),this.bindMode=e.bindMode,this.bindMatrix.copy(e.bindMatrix),this.bindMatrixInverse.copy(e.bindMatrixInverse),this.skeleton=e.skeleton,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}raycast(e,t){const n=this.material,s=this.matrixWorld;n!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),kS.copy(this.boundingSphere),kS.applyMatrix4(s),e.ray.intersectsSphere(kS)!==!1&&(BT.copy(s).invert(),HS.copy(e.ray).applyMatrix4(BT),!(this.boundingBox!==null&&HS.intersectsBox(this.boundingBox)===!1)&&this._computeIntersections(e,t,HS)))}getVertexPosition(e,t){return super.getVertexPosition(e,t),this.applyBoneTransform(e,t),t}bind(e,t){this.skeleton=e,t===void 0&&(this.updateMatrixWorld(!0),this.skeleton.calculateInverses(),t=this.matrixWorld),this.bindMatrix.copy(t),this.bindMatrixInverse.copy(t).invert()}pose(){this.skeleton.pose()}normalizeSkinWeights(){const e=new oi,t=this.geometry.attributes.skinWeight;for(let n=0,s=t.count;n<s;n++){e.fromBufferAttribute(t,n);const a=1/e.manhattanLength();a!==1/0?e.multiplyScalar(a):e.set(1,0,0,0),t.setXYZW(n,e.x,e.y,e.z,e.w)}}updateMatrixWorld(e){super.updateMatrixWorld(e),this.bindMode===W1?this.bindMatrixInverse.copy(this.matrixWorld).invert():this.bindMode===HB?this.bindMatrixInverse.copy(this.bindMatrix).invert():console.warn("THREE.SkinnedMesh: Unrecognized bindMode: "+this.bindMode)}applyBoneTransform(e,t){const n=this.skeleton,s=this.geometry;wT.fromBufferAttribute(s.attributes.skinIndex,e),CT.fromBufferAttribute(s.attributes.skinWeight,e),TT.copy(t).applyMatrix4(this.bindMatrix),t.set(0,0,0);for(let a=0;a<4;a++){const l=CT.getComponent(a);if(l!==0){const u=wT.getComponent(a);RT.multiplyMatrices(n.bones[u].matrixWorld,n.boneInverses[u]),t.addScaledVector(GO.copy(TT).applyMatrix4(RT),l)}}return t.applyMatrix4(this.bindMatrixInverse)}}class V_ extends li{constructor(){super(),this.isBone=!0,this.type="Bone"}}class jl extends Ki{constructor(e=null,t=1,n=1,s,a,l,u,h,p=Ls,m=Ls,v,x){super(null,l,u,h,p,m,s,a,v,x),this.isDataTexture=!0,this.image={data:e,width:t,height:n},this.generateMipmaps=!1,this.flipY=!1,this.unpackAlignment=1}}const IT=new dn,jO=new dn;class dg{constructor(e=[],t=[]){this.uuid=Za(),this.bones=e.slice(0),this.boneInverses=t,this.boneMatrices=null,this.boneTexture=null,this.init()}init(){const e=this.bones,t=this.boneInverses;if(this.boneMatrices=new Float32Array(e.length*16),t.length===0)this.calculateInverses();else if(e.length!==t.length){console.warn("THREE.Skeleton: Number of inverse bone matrices does not match amount of bones."),this.boneInverses=[];for(let n=0,s=this.bones.length;n<s;n++)this.boneInverses.push(new dn)}}calculateInverses(){this.boneInverses.length=0;for(let e=0,t=this.bones.length;e<t;e++){const n=new dn;this.bones[e]&&n.copy(this.bones[e].matrixWorld).invert(),this.boneInverses.push(n)}}pose(){for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&n.matrixWorld.copy(this.boneInverses[e]).invert()}for(let e=0,t=this.bones.length;e<t;e++){const n=this.bones[e];n&&(n.parent&&n.parent.isBone?(n.matrix.copy(n.parent.matrixWorld).invert(),n.matrix.multiply(n.matrixWorld)):n.matrix.copy(n.matrixWorld),n.matrix.decompose(n.position,n.quaternion,n.scale))}}update(){const e=this.bones,t=this.boneInverses,n=this.boneMatrices,s=this.boneTexture;for(let a=0,l=e.length;a<l;a++){const u=e[a]?e[a].matrixWorld:jO;IT.multiplyMatrices(u,t[a]),IT.toArray(n,a*16)}s!==null&&(s.needsUpdate=!0)}clone(){return new dg(this.bones,this.boneInverses)}computeBoneTexture(){let e=Math.sqrt(this.bones.length*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4);t.set(this.boneMatrices);const n=new jl(t,e,e,Jr,Yr);return n.needsUpdate=!0,this.boneMatrices=t,this.boneTexture=n,this}getBoneByName(e){for(let t=0,n=this.bones.length;t<n;t++){const s=this.bones[t];if(s.name===e)return s}}dispose(){this.boneTexture!==null&&(this.boneTexture.dispose(),this.boneTexture=null)}fromJSON(e,t){this.uuid=e.uuid;for(let n=0,s=e.bones.length;n<s;n++){const a=e.bones[n];let l=t[a];l===void 0&&(console.warn("THREE.Skeleton: No bone found with UUID:",a),l=new V_),this.bones.push(l),this.boneInverses.push(new dn().fromArray(e.boneInverses[n]))}return this.init(),this}toJSON(){const e={metadata:{version:4.6,type:"Skeleton",generator:"Skeleton.toJSON"},bones:[],boneInverses:[]};e.uuid=this.uuid;const t=this.bones,n=this.boneInverses;for(let s=0,a=t.length;s<a;s++){const l=t[s];e.bones.push(l.uuid);const u=n[s];e.boneInverses.push(u.toArray())}return e}}class wd extends ci{constructor(e,t,n,s=1){super(e,t,n),this.isInstancedBufferAttribute=!0,this.meshPerAttribute=s}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}toJSON(){const e=super.toJSON();return e.meshPerAttribute=this.meshPerAttribute,e.isInstancedBufferAttribute=!0,e}}const rp=new dn,DT=new dn,Oy=[],LT=new $r,VO=new dn,g0=new hs,v0=new Dr;class HA extends hs{constructor(e,t,n){super(e,t),this.isInstancedMesh=!0,this.instanceMatrix=new wd(new Float32Array(n*16),16),this.instanceColor=null,this.morphTexture=null,this.count=n,this.boundingBox=null,this.boundingSphere=null;for(let s=0;s<n;s++)this.setMatrixAt(s,VO)}computeBoundingBox(){const e=this.geometry,t=this.count;this.boundingBox===null&&(this.boundingBox=new $r),e.boundingBox===null&&e.computeBoundingBox(),this.boundingBox.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,rp),LT.copy(e.boundingBox).applyMatrix4(rp),this.boundingBox.union(LT)}computeBoundingSphere(){const e=this.geometry,t=this.count;this.boundingSphere===null&&(this.boundingSphere=new Dr),e.boundingSphere===null&&e.computeBoundingSphere(),this.boundingSphere.makeEmpty();for(let n=0;n<t;n++)this.getMatrixAt(n,rp),v0.copy(e.boundingSphere).applyMatrix4(rp),this.boundingSphere.union(v0)}copy(e,t){return super.copy(e,t),this.instanceMatrix.copy(e.instanceMatrix),e.morphTexture!==null&&(this.morphTexture=e.morphTexture.clone()),e.instanceColor!==null&&(this.instanceColor=e.instanceColor.clone()),this.count=e.count,e.boundingBox!==null&&(this.boundingBox=e.boundingBox.clone()),e.boundingSphere!==null&&(this.boundingSphere=e.boundingSphere.clone()),this}getColorAt(e,t){t.fromArray(this.instanceColor.array,e*3)}getMatrixAt(e,t){t.fromArray(this.instanceMatrix.array,e*16)}getMorphAt(e,t){const n=t.morphTargetInfluences,s=this.morphTexture.source.data.data,a=n.length+1,l=e*a+1;for(let u=0;u<n.length;u++)n[u]=s[l+u]}raycast(e,t){const n=this.matrixWorld,s=this.count;if(g0.geometry=this.geometry,g0.material=this.material,g0.material!==void 0&&(this.boundingSphere===null&&this.computeBoundingSphere(),v0.copy(this.boundingSphere),v0.applyMatrix4(n),e.ray.intersectsSphere(v0)!==!1))for(let a=0;a<s;a++){this.getMatrixAt(a,rp),DT.multiplyMatrices(n,rp),g0.matrixWorld=DT,g0.raycast(e,Oy);for(let l=0,u=Oy.length;l<u;l++){const h=Oy[l];h.instanceId=a,h.object=this,t.push(h)}Oy.length=0}}setColorAt(e,t){this.instanceColor===null&&(this.instanceColor=new wd(new Float32Array(this.instanceMatrix.count*3).fill(1),3)),t.toArray(this.instanceColor.array,e*3)}setMatrixAt(e,t){t.toArray(this.instanceMatrix.array,e*16)}setMorphAt(e,t){const n=t.morphTargetInfluences,s=n.length+1;
vendor: 4,720 bytes, line 117
117this.morphTexture===null&&(this.morphTexture=new jl(new Float32Array(s*this.count),s,this.count,O_,Yr));const a=this.morphTexture.source.data.data;let l=0;for(let p=0;p<n.length;p++)l+=n[p];const u=this.geometry.morphTargetsRelative?1:1-l,h=s*e;a[h]=u,a.set(n,h+1)}updateMorphTargets(){}dispose(){this.dispatchEvent({type:"dispose"}),this.morphTexture!==null&&(this.morphTexture.dispose(),this.morphTexture=null)}}const GS=new se,WO=new se,XO=new Cn;class Hu{constructor(e=new se(1,0,0),t=0){this.isPlane=!0,this.normal=e,this.constant=t}set(e,t){return this.normal.copy(e),this.constant=t,this}setComponents(e,t,n,s){return this.normal.set(e,t,n),this.constant=s,this}setFromNormalAndCoplanarPoint(e,t){return this.normal.copy(e),this.constant=-t.dot(this.normal),this}setFromCoplanarPoints(e,t,n){const s=GS.subVectors(n,t).cross(WO.subVectors(e,t)).normalize();return this.setFromNormalAndCoplanarPoint(s,e),this}copy(e){return this.normal.copy(e.normal),this.constant=e.constant,this}normalize(){const e=1/this.normal.length();return this.normal.multiplyScalar(e),this.constant*=e,this}negate(){return this.constant*=-1,this.normal.negate(),this}distanceToPoint(e){return this.normal.dot(e)+this.constant}distanceToSphere(e){return this.distanceToPoint(e.center)-e.radius}projectPoint(e,t){return t.copy(e).addScaledVector(this.normal,-this.distanceToPoint(e))}intersectLine(e,t){const n=e.delta(GS),s=this.normal.dot(n);if(s===0)return this.distanceToPoint(e.start)===0?t.copy(e.start):null;const a=-(e.start.dot(this.normal)+this.constant)/s;return a<0||a>1?null:t.copy(e.start).addScaledVector(n,a)}intersectsLine(e){const t=this.distanceToPoint(e.start),n=this.distanceToPoint(e.end);return t<0&&n>0||n<0&&t>0}intersectsBox(e){return e.intersectsPlane(this)}intersectsSphere(e){return e.intersectsPlane(this)}coplanarPoint(e){return e.copy(this.normal).multiplyScalar(-this.constant)}applyMatrix4(e,t){const n=t||XO.getNormalMatrix(e),s=this.coplanarPoint(GS).applyMatrix4(e),a=this.normal.applyMatrix3(n).normalize();return this.constant=-s.dot(a),this}translate(e){return this.constant-=e.dot(this.normal),this}equals(e){return e.normal.equals(this.normal)&&e.constant===this.constant}clone(){return new this.constructor().copy(this)}}const Yf=new Dr,Ny=new se;class hg{constructor(e=new Hu,t=new Hu,n=new Hu,s=new Hu,a=new Hu,l=new Hu){this.planes=[e,t,n,s,a,l]}set(e,t,n,s,a,l){const u=this.planes;return u[0].copy(e),u[1].copy(t),u[2].copy(n),u[3].copy(s),u[4].copy(a),u[5].copy(l),this}copy(e){const t=this.planes;for(let n=0;n<6;n++)t[n].copy(e.planes[n]);return this}setFromProjectionMatrix(e,t=al){const n=this.planes,s=e.elements,a=s[0],l=s[1],u=s[2],h=s[3],p=s[4],m=s[5],v=s[6],x=s[7],_=s[8],A=s[9],R=s[10],w=s[11],E=s[12],D=s[13],L=s[14],P=s[15];if(n[0].setComponents(h-a,x-p,w-_,P-E).normalize(),n[1].setComponents(h+a,x+p,w+_,P+E).normalize(),n[2].setComponents(h+l,x+m,w+A,P+D).normalize(),n[3].setComponents(h-l,x-m,w-A,P-D).normalize(),n[4].setComponents(h-u,x-v,w-R,P-L).normalize(),t===al)n[5].setComponents(h+u,x+v,w+R,P+L).normalize();else if(t===Y0)n[5].setComponents(u,v,R,L).normalize();else throw new Error("THREE.Frustum.setFromProjectionMatrix(): Invalid coordinate system: "+t);return this}intersectsObject(e){if(e.boundingSphere!==void 0)e.boundingSphere===null&&e.computeBoundingSphere(),Yf.copy(e.boundingSphere).applyMatrix4(e.matrixWorld);else{const t=e.geometry;t.boundingSphere===null&&t.computeBoundingSphere(),Yf.copy(t.boundingSphere).applyMatrix4(e.matrixWorld)}return this.intersectsSphere(Yf)}intersectsSprite(e){return Yf.center.set(0,0,0),Yf.radius=.7071067811865476,Yf.applyMatrix4(e.matrixWorld),this.intersectsSphere(Yf)}intersectsSphere(e){const t=this.planes,n=e.center,s=-e.radius;for(let a=0;a<6;a++)if(t[a].distanceToPoint(n)<s)return!1;return!0}intersectsBox(e){const t=this.planes;for(let n=0;n<6;n++){const s=t[n];if(Ny.x=s.normal.x>0?e.max.x:e.min.x,Ny.y=s.normal.y>0?e.max.y:e.min.y,Ny.z=s.normal.z>0?e.max.z:e.min.z,s.distanceToPoint(Ny)<0)return!1}return!0}containsPoint(e){const t=this.planes;for(let n=0;n<6;n++)if(t[n].distanceToPoint(e)<0)return!1;return!0}clone(){return new this.constructor().copy(this)}}function jS(i,e){return i-e}function qO(i,e){return i.z-e.z}function YO(i,e){return e.z-i.z}class JO{constructor(){this.index=0,this.pool=[],this.list=[]}push(e,t,n,s){const a=this.pool,l=this.list;this.index>=a.length&&a.push({start:-1,count:-1,z:-1,index:-1});const u=a[this.index];l.push(u),this.index++,u.start=e,u.count=t,u.z=n,u.index=s}reset(){this.list.length=0,this.index=0}}const Fa=new dn,KO=new Pt(1,1,1),VS=new hg,Uy=new $r,Jf=new Dr,y0=new se,PT=new se,ZO=new se,WS=new JO,qr=new hs,zy=[];function QO(i,e,t=0){const n=e.itemSize;
vendor: 1,944 bytes, line 117
117if(i.isInterleavedBufferAttribute||i.array.constructor!==e.array.constructor){const s=i.count;for(let a=0;a<s;a++)for(let l=0;l<n;l++)e.setComponent(a+t,l,i.getComponent(a,l))}else e.array.set(i.array,t*n);e.needsUpdate=!0}function Kf(i,e){if(i.constructor!==e.constructor){const t=Math.min(i.length,e.length);for(let n=0;n<t;n++)e[n]=i[n]}else{const t=Math.min(i.length,e.length);e.set(new i.constructor(i.buffer,0,t))}}class dI extends hs{constructor(e,t,n=t*2,s){super(new Mn,s),this.isBatchedMesh=!0,this.perObjectFrustumCulled=!0,this.sortObjects=!0,this.boundingBox=null,this.boundingSphere=null,this.customSort=null,this._instanceInfo=[],this._geometryInfo=[],this._availableInstanceIds=[],this._availableGeometryIds=[],this._nextIndexStart=0,this._nextVertexStart=0,this._geometryCount=0,this._visibilityChanged=!0,this._geometryInitialized=!1,this._maxInstanceCount=e,this._maxVertexCount=t,this._maxIndexCount=n,this._multiDrawCounts=new Int32Array(e),this._multiDrawStarts=new Int32Array(e),this._multiDrawCount=0,this._multiDrawInstances=null,this._matricesTexture=null,this._indirectTexture=null,this._colorsTexture=null,this._initMatricesTexture(),this._initIndirectTexture()}get maxInstanceCount(){return this._maxInstanceCount}get instanceCount(){return this._instanceInfo.length-this._availableInstanceIds.length}get unusedVertexCount(){return this._maxVertexCount-this._nextVertexStart}get unusedIndexCount(){return this._maxIndexCount-this._nextIndexStart}_initMatricesTexture(){let e=Math.sqrt(this._maxInstanceCount*4);e=Math.ceil(e/4)*4,e=Math.max(e,4);const t=new Float32Array(e*e*4),n=new jl(t,e,e,Jr,Yr);this._matricesTexture=n}_initIndirectTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Uint32Array(e*e),n=new jl(t,e,e,lg,kc);this._indirectTexture=n}_initColorsTexture(){let e=Math.sqrt(this._maxInstanceCount);e=Math.ceil(e);const t=new Float32Array(e*e*4).fill(1),n=new jl(t,e,e,Jr,Yr);
117n.colorSpace=si.workingColorSpace,this._colorsTexture=n}_initializeGeometry(e){const t=this.geometry,n=this._maxVertexCount,s=this._maxIndexCount;if(this._geometryInitialized===!1){for(const a in e.attributes){const l=e.getAttribute(a),{array:u,itemSize:h,normalized:p}=l,m=new u.constructor(n*h),v=new ci(m,h,p);t.setAttribute(a,v)}if(e.getIndex()!==null){const a=n>65535?new Uint32Array(s):new Uint16Array(s);t.setIndex(new ci(a,1))}this._geometryInitialized=!0}}_validateGeometry(e){const t=this.geometry;if(!!e.getIndex()!=!!t.getIndex())throw new Error('THREE.BatchedMesh: All geometries must consistently have "index".');for(const n in t.attributes){if(!e.hasAttribute(n))throw new Error(`THREE.BatchedMesh: Added geometry missing "${n}". All geometries must have consistent attributes.`);const s=e.getAttribute(n),a=t.getAttribute(n);if(s.itemSize!==a.itemSize||s.normalized!==a.normalized)throw new Error("THREE.BatchedMesh: All attributes must have a consistent itemSize and normalized value.")}}validateInstanceId(e){const t=this._instanceInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid instanceId ${e}. Instance is either out of range or has been deleted.`)}validateGeometryId(e){const t=this._geometryInfo;if(e<0||e>=t.length||t[e].active===!1)throw new Error(`THREE.BatchedMesh: Invalid geometryId ${e}. Geometry is either out of range or has been deleted.`)}setCustomSort(e){return this.customSort=e,this}computeBoundingBox(){this.boundingBox===null&&(this.boundingBox=new $r);const e=this.boundingBox,t=this._instanceInfo;e.makeEmpty();for(let n=0,s=t.length;n<s;n++){if(t[n].active===!1)continue;const a=t[n].geometryIndex;this.getMatrixAt(n,Fa),this.getBoundingBoxAt(a,Uy).applyMatrix4(Fa),e.union(Uy)}}computeBoundingSphere(){this.boundingSphere===null&&(this.boundingSphere=new Dr);const e=this.boundingSphere,t=this._instanceInfo;e.makeEmpty();for(let n=0,s=t.length;n<s;n++){if(t[n].active===!1)continue;const a=t[n].geometryIndex;this.getMatrixAt(n,Fa),this.getBoundingSphereAt(a,Jf).applyMatrix4(Fa),e.union(Jf)}}addInstance(e){if(this._instanceInfo.length>=this.maxInstanceCount&&this._availableInstanceIds.length===0)throw new Error("THREE.BatchedMesh: Maximum item count reached.");const n={visible:!0,active:!0,geometryIndex:e};let s=null;this._availableInstanceIds.length>0?(this._availableInstanceIds.sort(jS),s=this._availableInstanceIds.shift(),this._instanceInfo[s]=n):(s=this._instanceInfo.length,this._instanceInfo.push(n));const a=this._matricesTexture;Fa.identity().toArray(a.image.data,s*16),a.needsUpdate=!0;const l=this._colorsTexture;return l&&(KO.toArray(l.image.data,s*4),l.needsUpdate=!0),this._visibilityChanged=!0,s}addGeometry(e,t=-1,n=-1){this._initializeGeometry(e),this._validateGeometry(e);const s={vertexStart:-1,vertexCount:-1,reservedVertexCount:-1,indexStart:-1,indexCount:-1,reservedIndexCount:-1,start:-1,count:-1,boundingBox:null,boundingSphere:null,active:!0},a=this._geometryInfo;s.vertexStart=this._nextVertexStart,s.reservedVertexCount=t===-1?e.getAttribute("position").count:t;const l=e.getIndex();if(l!==null&&(s.indexStart=this._nextIndexStart,s.reservedIndexCount=n===-1?l.count:n),s.indexStart!==-1&&s.indexStart+s.reservedIndexCount>this._maxIndexCount||s.vertexStart+s.reservedVertexCount>this._maxVertexCount)throw new Error("THREE.BatchedMesh: Reserved space request exceeds the maximum buffer size.");let h;return this._availableGeometryIds.length>0?(this._availableGeometryIds.sort(jS),h=this._availableGeometryIds.shift(),a[h]=s):(h=this._geometryCount,this._geometryCount++,a.push(s)),this.setGeometryAt(h,e),this._nextIndexStart=s.indexStart+s.reservedIndexCount,this._nextVertexStart=s.vertexStart+s.reservedVertexCount,h}setGeometryAt(e,t){if(e>=this._geometryCount)throw new Error("THREE.BatchedMesh: Maximum geometry count reached.");this._validateGeometry(t);const n=this.geometry,s=n.getIndex()!==null,a=n.getIndex(),l=t.getIndex(),u=this._geometryInfo[e];if(s&&l.count>u.reservedIndexCount||t.attributes.position.count>u.reservedVertexCount)throw new Error("THREE.BatchedMesh: Reserved space not large enough for provided geometry.");const h=u.vertexStart,p=u.reservedVertexCount;u.vertexCount=t.getAttribute("position").count;for(const m in n.attributes){const v=t.getAttribute(m),x=n.getAttribute(m);QO(v,x,h);const _=v.itemSize;
vendor: 8,396 bytes, line 117
117for(let A=v.count,R=p;A<R;A++){const w=h+A;for(let E=0;E<_;E++)x.setComponent(w,E,0)}x.needsUpdate=!0,x.addUpdateRange(h*_,p*_)}if(s){const m=u.indexStart,v=u.reservedIndexCount;u.indexCount=t.getIndex().count;for(let x=0;x<l.count;x++)a.setX(m+x,h+l.getX(x));for(let x=l.count,_=v;x<_;x++)a.setX(m+x,h);a.needsUpdate=!0,a.addUpdateRange(m,u.reservedIndexCount)}return u.start=s?u.indexStart:u.vertexStart,u.count=s?u.indexCount:u.vertexCount,u.boundingBox=null,t.boundingBox!==null&&(u.boundingBox=t.boundingBox.clone()),u.boundingSphere=null,t.boundingSphere!==null&&(u.boundingSphere=t.boundingSphere.clone()),this._visibilityChanged=!0,e}deleteGeometry(e){const t=this._geometryInfo;if(e>=t.length||t[e].active===!1)return this;const n=this._instanceInfo;for(let s=0,a=n.length;s<a;s++)n[s].active&&n[s].geometryIndex===e&&this.deleteInstance(s);return t[e].active=!1,this._availableGeometryIds.push(e),this._visibilityChanged=!0,this}deleteInstance(e){return this.validateInstanceId(e),this._instanceInfo[e].active=!1,this._availableInstanceIds.push(e),this._visibilityChanged=!0,this}optimize(){let e=0,t=0;const n=this._geometryInfo,s=n.map((l,u)=>u).sort((l,u)=>n[l].vertexStart-n[u].vertexStart),a=this.geometry;for(let l=0,u=n.length;l<u;l++){const h=s[l],p=n[h];if(p.active!==!1){if(a.index!==null){if(p.indexStart!==t){const{indexStart:m,vertexStart:v,reservedIndexCount:x}=p,_=a.index,A=_.array,R=e-v;for(let w=m;w<m+x;w++)A[w]=A[w]+R;_.array.copyWithin(t,m,m+x),_.addUpdateRange(t,x),p.indexStart=t}t+=p.reservedIndexCount}if(p.vertexStart!==e){const{vertexStart:m,reservedVertexCount:v}=p,x=a.attributes;for(const _ in x){const A=x[_],{array:R,itemSize:w}=A;R.copyWithin(e*w,m*w,(m+v)*w),A.addUpdateRange(e*w,v*w)}p.vertexStart=e}e+=p.reservedVertexCount,p.start=a.index?p.indexStart:p.vertexStart,this._nextIndexStart=a.index?p.indexStart+p.reservedIndexCount:0,this._nextVertexStart=p.vertexStart+p.reservedVertexCount}}return this}getBoundingBoxAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingBox===null){const a=new $r,l=n.index,u=n.attributes.position;for(let h=s.start,p=s.start+s.count;h<p;h++){let m=h;l&&(m=l.getX(m)),a.expandByPoint(y0.fromBufferAttribute(u,m))}s.boundingBox=a}return t.copy(s.boundingBox),t}getBoundingSphereAt(e,t){if(e>=this._geometryCount)return null;const n=this.geometry,s=this._geometryInfo[e];if(s.boundingSphere===null){const a=new Dr;this.getBoundingBoxAt(e,Uy),Uy.getCenter(a.center);const l=n.index,u=n.attributes.position;let h=0;for(let p=s.start,m=s.start+s.count;p<m;p++){let v=p;l&&(v=l.getX(v)),y0.fromBufferAttribute(u,v),h=Math.max(h,a.center.distanceToSquared(y0))}a.radius=Math.sqrt(h),s.boundingSphere=a}return t.copy(s.boundingSphere),t}setMatrixAt(e,t){this.validateInstanceId(e);const n=this._matricesTexture,s=this._matricesTexture.image.data;return t.toArray(s,e*16),n.needsUpdate=!0,this}getMatrixAt(e,t){return this.validateInstanceId(e),t.fromArray(this._matricesTexture.image.data,e*16)}setColorAt(e,t){return this.validateInstanceId(e),this._colorsTexture===null&&this._initColorsTexture(),t.toArray(this._colorsTexture.image.data,e*4),this._colorsTexture.needsUpdate=!0,this}getColorAt(e,t){return this.validateInstanceId(e),t.fromArray(this._colorsTexture.image.data,e*4)}setVisibleAt(e,t){return this.validateInstanceId(e),this._instanceInfo[e].visible===t?this:(this._instanceInfo[e].visible=t,this._visibilityChanged=!0,this)}getVisibleAt(e){return this.validateInstanceId(e),this._instanceInfo[e].visible}setGeometryIdAt(e,t){return this.validateInstanceId(e),this.validateGeometryId(t),this._instanceInfo[e].geometryIndex=t,this}getGeometryIdAt(e){return this.validateInstanceId(e),this._instanceInfo[e].geometryIndex}getGeometryRangeAt(e,t={}){this.validateGeometryId(e);const n=this._geometryInfo[e];return t.vertexStart=n.vertexStart,t.vertexCount=n.vertexCount,t.reservedVertexCount=n.reservedVertexCount,t.indexStart=n.indexStart,t.indexCount=n.indexCount,t.reservedIndexCount=n.reservedIndexCount,t.start=n.start,t.count=n.count,t}setInstanceCount(e){const t=this._availableInstanceIds,n=this._instanceInfo;for(t.sort(jS);t[t.length-1]===n.length;)n.pop(),t.pop();if(e<n.length)throw new Error(`BatchedMesh: Instance ids outside the range ${e} are being used. Cannot shrink instance count.`);const s=new Int32Array(e),a=new Int32Array(e);Kf(this._multiDrawCounts,s),Kf(this._multiDrawStarts,a),this._multiDrawCounts=s,this._multiDrawStarts=a,this._maxInstanceCount=e;const l=this._indirectTexture,u=this._matricesTexture,h=this._colorsTexture;l.dispose(),this._initIndirectTexture(),Kf(l.image.data,this._indirectTexture.image.data),u.dispose(),this._initMatricesTexture(),Kf(u.image.data,this._matricesTexture.image.data),h&&(h.dispose(),this._initColorsTexture(),Kf(h.image.data,this._colorsTexture.image.data))}setGeometrySize(e,t){const n=[...this._geometryInfo].filter(u=>u.active);if(Math.max(...n.map(u=>u.vertexStart+u.reservedVertexCount))>e)throw new Error(`BatchedMesh: Geometry vertex values are being used outside the range ${t}. Cannot shrink further.`);if(this.geometry.index&&Math.max(...n.map(h=>h.indexStart+h.reservedIndexCount))>t)throw new Error(`BatchedMesh: Geometry index values are being used outside the range ${t}. Cannot shrink further.`);const a=this.geometry;a.dispose(),this._maxVertexCount=e,this._maxIndexCount=t,this._geometryInitialized&&(this._geometryInitialized=!1,this.geometry=new Mn,this._initializeGeometry(a));const l=this.geometry;a.index&&Kf(a.index.array,l.index.array);for(const u in a.attributes)Kf(a.attributes[u].array,l.attributes[u].array)}raycast(e,t){const n=this._instanceInfo,s=this._geometryInfo,a=this.matrixWorld,l=this.geometry;qr.material=this.material,qr.geometry.index=l.index,qr.geometry.attributes=l.attributes,qr.geometry.boundingBox===null&&(qr.geometry.boundingBox=new $r),qr.geometry.boundingSphere===null&&(qr.geometry.boundingSphere=new Dr);for(let u=0,h=n.length;u<h;u++){if(!n[u].visible||!n[u].active)continue;const p=n[u].geometryIndex,m=s[p];qr.geometry.setDrawRange(m.start,m.count),this.getMatrixAt(u,qr.matrixWorld).premultiply(a),this.getBoundingBoxAt(p,qr.geometry.boundingBox),this.getBoundingSphereAt(p,qr.geometry.boundingSphere),qr.raycast(e,zy);for(let v=0,x=zy.length;v<x;v++){const _=zy[v];_.object=this,_.batchId=u,t.push(_)}zy.length=0}qr.material=null,qr.geometry.index=null,qr.geometry.attributes={},qr.geometry.setDrawRange(0,1/0)}copy(e){return super.copy(e),this.geometry=e.geometry.clone(),this.perObjectFrustumCulled=e.perObjectFrustumCulled,this.sortObjects=e.sortObjects,this.boundingBox=e.boundingBox!==null?e.boundingBox.clone():null,this.boundingSphere=e.boundingSphere!==null?e.boundingSphere.clone():null,this._geometryInfo=e._geometryInfo.map(t=>({...t,boundingBox:t.boundingBox!==null?t.boundingBox.clone():null,boundingSphere:t.boundingSphere!==null?t.boundingSphere.clone():null})),this._instanceInfo=e._instanceInfo.map(t=>({...t})),this._maxInstanceCount=e._maxInstanceCount,this._maxVertexCount=e._maxVertexCount,this._maxIndexCount=e._maxIndexCount,this._geometryInitialized=e._geometryInitialized,this._geometryCount=e._geometryCount,this._multiDrawCounts=e._multiDrawCounts.slice(),this._multiDrawStarts=e._multiDrawStarts.slice(),this._matricesTexture=e._matricesTexture.clone(),this._matricesTexture.image.data=this._matricesTexture.image.data.slice(),this._colorsTexture!==null&&(this._colorsTexture=e._colorsTexture.clone(),this._colorsTexture.image.data=this._colorsTexture.image.data.slice()),this}dispose(){this.geometry.dispose(),this._matricesTexture.dispose(),this._matricesTexture=null,this._indirectTexture.dispose(),this._indirectTexture=null,this._colorsTexture!==null&&(this._colorsTexture.dispose(),this._colorsTexture=null)}onBeforeRender(e,t,n,s,a){if(!this._visibilityChanged&&!this.perObjectFrustumCulled&&!this.sortObjects)return;const l=s.getIndex(),u=l===null?1:l.array.BYTES_PER_ELEMENT,h=this._instanceInfo,p=this._multiDrawStarts,m=this._multiDrawCounts,v=this._geometryInfo,x=this.perObjectFrustumCulled,_=this._indirectTexture,A=_.image.data;x&&(Fa.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse).multiply(this.matrixWorld),VS.setFromProjectionMatrix(Fa,e.coordinateSystem));let R=0;if(this.sortObjects){Fa.copy(this.matrixWorld).invert(),y0.setFromMatrixPosition(n.matrixWorld).applyMatrix4(Fa),PT.
117set(0,0,-1).transformDirection(n.matrixWorld).transformDirection(Fa);for(let D=0,L=h.length;D<L;D++)if(h[D].visible&&h[D].active){const P=h[D].geometryIndex;this.getMatrixAt(D,Fa),this.getBoundingSphereAt(P,Jf).applyMatrix4(Fa);let G=!1;if(x&&(G=!VS.intersectsSphere(Jf)),!G){const H=v[P],F=ZO.subVectors(Jf.center,y0).dot(PT);WS.push(H.start,H.count,F,D)}}const w=WS.list,E=this.customSort;E===null?w.sort(a.transparent?YO:qO):E.call(this,w,n);for(let D=0,L=w.length;D<L;D++){const P=w[D];p[R]=P.start*u,m[R]=P.count,A[R]=P.index,R++}WS.reset()}else for(let w=0,E=h.length;w<E;w++)if(h[w].visible&&h[w].active){const D=h[w].geometryIndex;let L=!1;if(x&&(this.getMatrixAt(w,Fa),this.getBoundingSphereAt(D,Jf).applyMatrix4(Fa),L=!VS.intersectsSphere(Jf)),!L){const P=v[D];p[R]=P.start*u,m[R]=P.count,A[R]=w,R++}}_.needsUpdate=!0,this._multiDrawCount=R,this._visibilityChanged=!1}onBeforeShadow(e,t,n,s,a,l){this.onBeforeRender(e,null,s,a,l)}}class ta extends js{constructor(e){super(),this.isLineBasicMaterial=!0,this.type="LineBasicMaterial",this.color=new Pt(16777215),this.map=null,this.linewidth=1,this.linecap="round",this.linejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.linewidth=e.linewidth,this.linecap=e.linecap,this.linejoin=e.linejoin,this.fog=e.fog,this}}const c_=new se,u_=new se,OT=new dn,x0=new Lp,Fy=new Dr,XS=new se,NT=new se;class Hc extends li{constructor(e=new Mn,t=new ta){super(),this.isLine=!0,this.type="Line",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[0];for(let s=1,a=t.count;s<a;s++)c_.fromBufferAttribute(t,s-1),u_.fromBufferAttribute(t,s),n[s]=n[s-1],n[s]+=c_.distanceTo(u_);e.setAttribute("lineDistance",new $t(n,1))}else console.warn("THREE.Line.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,a=e.params.Line.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Fy.copy(n.boundingSphere),Fy.applyMatrix4(s),Fy.radius+=a,e.ray.intersectsSphere(Fy)===!1)return;OT.copy(s).invert(),x0.copy(e.ray).applyMatrix4(OT);const u=a/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,p=this.isLineSegments?2:1,m=n.index,x=n.attributes.position;if(m!==null){const _=Math.max(0,l.start),A=Math.min(m.count,l.start+l.count);for(let R=_,w=A-1;R<w;R+=p){const E=m.getX(R),D=m.getX(R+1),L=ky(this,e,x0,h,E,D,R);L&&t.push(L)}if(this.isLineLoop){const R=m.getX(A-1),w=m.getX(_),E=ky(this,e,x0,h,R,w,A-1);E&&t.push(E)}}else{const _=Math.max(0,l.start),A=Math.min(x.count,l.start+l.count);for(let R=_,w=A-1;R<w;R+=p){const E=ky(this,e,x0,h,R,R+1,R);E&&t.push(E)}if(this.isLineLoop){const R=ky(this,e,x0,h,A-1,_,A-1);R&&t.push(R)}}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=s.length;a<l;a++){const u=s[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=a}}}}}function ky(i,e,t,n,s,a,l){const u=i.geometry.attributes.position;if(c_.fromBufferAttribute(u,s),u_.fromBufferAttribute(u,a),t.distanceSqToSegment(c_,u_,XS,NT)>n)return;XS.applyMatrix4(i.matrixWorld);const p=e.ray.origin.distanceTo(XS);if(!(p<e.near||p>e.far))return{distance:p,point:NT.clone().applyMatrix4(i.matrixWorld),index:l,face:null,faceIndex:null,barycoord:null,object:i}}const UT=new se,zT=new se;class ul extends Hc{constructor(e,t){super(e,t),this.isLineSegments=!0,this.type="LineSegments"}computeLineDistances(){const e=this.geometry;if(e.index===null){const t=e.attributes.position,n=[];for(let s=0,a=t.count;s<a;s+=2)UT.fromBufferAttribute(t,s),zT.fromBufferAttribute(t,s+1),n[s]=s===0?0:n[s-1],n[s+1]=n[s]+UT.distanceTo(zT);
vendor: 7,068 bytes, line 117
117e.setAttribute("lineDistance",new $t(n,1))}else console.warn("THREE.LineSegments.computeLineDistances(): Computation only possible with non-indexed BufferGeometry.");return this}}class GA extends Hc{constructor(e,t){super(e,t),this.isLineLoop=!0,this.type="LineLoop"}}class W_ extends js{constructor(e){super(),this.isPointsMaterial=!0,this.type="PointsMaterial",this.color=new Pt(16777215),this.map=null,this.alphaMap=null,this.size=1,this.sizeAttenuation=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.alphaMap=e.alphaMap,this.size=e.size,this.sizeAttenuation=e.sizeAttenuation,this.fog=e.fog,this}}const FT=new dn,Y1=new Lp,Hy=new Dr,Gy=new se;class jA extends li{constructor(e=new Mn,t=new W_){super(),this.isPoints=!0,this.type="Points",this.geometry=e,this.material=t,this.morphTargetDictionary=void 0,this.morphTargetInfluences=void 0,this.updateMorphTargets()}copy(e,t){return super.copy(e,t),this.material=Array.isArray(e.material)?e.material.slice():e.material,this.geometry=e.geometry,this}raycast(e,t){const n=this.geometry,s=this.matrixWorld,a=e.params.Points.threshold,l=n.drawRange;if(n.boundingSphere===null&&n.computeBoundingSphere(),Hy.copy(n.boundingSphere),Hy.applyMatrix4(s),Hy.radius+=a,e.ray.intersectsSphere(Hy)===!1)return;FT.copy(s).invert(),Y1.copy(e.ray).applyMatrix4(FT);const u=a/((this.scale.x+this.scale.y+this.scale.z)/3),h=u*u,p=n.index,v=n.attributes.position;if(p!==null){const x=Math.max(0,l.start),_=Math.min(p.count,l.start+l.count);for(let A=x,R=_;A<R;A++){const w=p.getX(A);Gy.fromBufferAttribute(v,w),kT(Gy,w,h,s,e,t,this)}}else{const x=Math.max(0,l.start),_=Math.min(v.count,l.start+l.count);for(let A=x,R=_;A<R;A++)Gy.fromBufferAttribute(v,A),kT(Gy,A,h,s,e,t,this)}}updateMorphTargets(){const t=this.geometry.morphAttributes,n=Object.keys(t);if(n.length>0){const s=t[n[0]];if(s!==void 0){this.morphTargetInfluences=[],this.morphTargetDictionary={};for(let a=0,l=s.length;a<l;a++){const u=s[a].name||String(a);this.morphTargetInfluences.push(0),this.morphTargetDictionary[u]=a}}}}}function kT(i,e,t,n,s,a,l){const u=Y1.distanceSqToPoint(i);if(u<t){const h=new se;Y1.closestPointToPoint(i,h),h.applyMatrix4(n);const p=s.ray.origin.distanceTo(h);if(p<s.near||p>s.far)return;a.push({distance:p,distanceToRay:Math.sqrt(u),point:h,index:e,face:null,faceIndex:null,barycoord:null,object:l})}}class hI extends Ki{constructor(e,t,n,s,a=as,l=as,u,h,p){super(e,t,n,s,a,l,u,h,p),this.isVideoTexture=!0,this.generateMipmaps=!1;const m=this;function v(){m.needsUpdate=!0,e.requestVideoFrameCallback(v)}"requestVideoFrameCallback"in e&&e.requestVideoFrameCallback(v)}clone(){return new this.constructor(this.image).copy(this)}update(){const e=this.image;"requestVideoFrameCallback"in e===!1&&e.readyState>=e.HAVE_CURRENT_DATA&&(this.needsUpdate=!0)}}class $O extends hI{constructor(e,t,n,s,a,l,u,h){super({},e,t,n,s,a,l,u,h),this.isVideoFrameTexture=!0}update(){}clone(){return new this.constructor().copy(this)}setFrame(e){this.image=e,this.needsUpdate=!0}}class e2 extends Ki{constructor(e,t){super({width:e,height:t}),this.isFramebufferTexture=!0,this.magFilter=Ls,this.minFilter=Ls,this.generateMipmaps=!1,this.needsUpdate=!0}}class X_ extends Ki{constructor(e,t,n,s,a,l,u,h,p,m,v,x){super(null,l,u,h,p,m,s,a,v,x),this.isCompressedTexture=!0,this.image={width:t,height:n},this.mipmaps=e,this.flipY=!1,this.generateMipmaps=!1}}class t2 extends X_{constructor(e,t,n,s,a,l){super(e,t,n,a,l),this.isCompressedArrayTexture=!0,this.image.depth=s,this.wrapR=Ka,this.layerUpdates=new Set}addLayerUpdate(e){this.layerUpdates.add(e)}clearLayerUpdates(){this.layerUpdates.clear()}}class n2 extends X_{constructor(e,t,n){super(void 0,e[0].width,e[0].height,t,n,Fc),this.isCompressedCubeTexture=!0,this.isCubeTexture=!0,this.image=e}}class pg extends Ki{constructor(e,t,n,s,a,l,u,h,p){super(e,t,n,s,a,l,u,h,p),this.isCanvasTexture=!0,this.needsUpdate=!0}}class q_ extends Ki{constructor(e,t,n=kc,s,a,l,u=Ls,h=Ls,p,m=Ap){if(m!==Ap&&m!==Td)throw new Error("DepthTexture format must be either THREE.DepthFormat or THREE.DepthStencilFormat");super(null,s,a,l,u,h,m,n,p),this.isDepthTexture=!0,this.image={width:e,height:t},this.flipY=!1,this.generateMipmaps=!1,this.compareFunction=null}copy(e){return super.copy(e),this.source=new Wu(Object.assign({},e.image)),this.compareFunction=e.compareFunction,this}toJSON(e){const t=super.toJSON(e);return this.compareFunction!==null&&(t.compareFunction=this.compareFunction),t}}class fl{constructor(){this.type="Curve",this.arcLengthDivisions=200,this.needsUpdate=!1,this.cacheArcLengths=null}getPoint(){console.warn("THREE.Curve: .getPoint() not implemented.")}getPointAt(e,t){const n=this.getUtoTmapping(e);return this.getPoint(n,t)}getPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return t}getSpacedPoints(e=5){const t=[];for(let n=0;n<=e;n++)t.push(this.getPointAt(n/e));return t}getLength(){const e=this.getLengths();return e[e.length-1]}getLengths(e=this.arcLengthDivisions){if(this.cacheArcLengths&&this.cacheArcLengths.length===e+1&&!this.needsUpdate)return this.cacheArcLengths;this.needsUpdate=!1;const t=[];let n,s=this.getPoint(0),a=0;t.push(0);for(let l=1;l<=e;l++)n=this.getPoint(l/e),a+=n.distanceTo(s),t.push(a),s=n;return this.cacheArcLengths=t,t}updateArcLengths(){this.needsUpdate=!0,this.getLengths()}getUtoTmapping(e,t=null){const n=this.getLengths();let s=0;const a=n.length;let l;t?l=t:l=e*n[a-1];let u=0,h=a-1,p;for(;u<=h;)if(s=Math.floor(u+(h-u)/2),p=n[s]-l,p<0)u=s+1;else if(p>0)h=s-1;else{h=s;break}if(s=h,n[s]===l)return s/(a-1);const m=n[s],x=n[s+1]-m,_=(l-m)/x;return(s+_)/(a-1)}getTangent(e,t){let s=e-1e-4,a=e+1e-4;s<0&&(s=0),a>1&&(a=1);const l=this.getPoint(s),u=this.getPoint(a),h=t||(l.isVector2?new st:new se);return h.copy(u).sub(l).normalize(),h}getTangentAt(e,t){const n=this.getUtoTmapping(e);return this.getTangent(n,t)}computeFrenetFrames(e,t=!1){const n=new se,s=[],a=[],l=[],u=new se,h=new dn;for(let _=0;_<=e;_++){const A=_/e;s[_]=this.getTangentAt(A,new se)}a[0]=new se,l[0]=new se;let p=Number.MAX_VALUE;const m=Math.abs(s[0].x),v=Math.abs(s[0].y),x=Math.abs(s[0].z);m<=p&&(p=m,n.set(1,0,0)),v<=p&&(p=v,n.set(0,1,0)),x<=p&&n.set(0,0,1),u.crossVectors(s[0],n).normalize(),a[0].crossVectors(s[0],u),l[0].crossVectors(s[0],a[0]);for(let _=1;_<=e;_++){if(a[_]=a[_-1].clone(),l[_]=l[_-1].clone(),u.crossVectors(s[_-1],s[_]),u.length()>Number.EPSILON){u.normalize();const A=Math.acos(An(s[_-1].dot(s[_]),-1,1));a[_].applyMatrix4(h.makeRotationAxis(u,A))}l[_].crossVectors(s[_],a[_])}if(t===!0){let _=Math.acos(An(a[0].dot(a[e]),-1,1));_/=e,s[0].dot(u.crossVectors(a[0],a[e]))>0&&(_=-_);for(let A=1;A<=e;A++)a[A].applyMatrix4(h.makeRotationAxis(s[A],_*A)),l[A].crossVectors(s[A],a[A])}return{tangents:s,normals:a,binormals:l}}clone(){return new this.constructor().copy(this)}copy(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}toJSON(){const e={metadata:{version:4.6,type:"Curve",generator:"Curve.toJSON"}};return e.arcLengthDivisions=this.arcLengthDivisions,e.type=this.t
vendor: 6,032 bytes, line 117
117ype,e}fromJSON(e){return this.arcLengthDivisions=e.arcLengthDivisions,this}}class Y_ extends fl{constructor(e=0,t=0,n=1,s=1,a=0,l=Math.PI*2,u=!1,h=0){super(),this.isEllipseCurve=!0,this.type="EllipseCurve",this.aX=e,this.aY=t,this.xRadius=n,this.yRadius=s,this.aStartAngle=a,this.aEndAngle=l,this.aClockwise=u,this.aRotation=h}getPoint(e,t=new st){const n=t,s=Math.PI*2;let a=this.aEndAngle-this.aStartAngle;const l=Math.abs(a)<Number.EPSILON;for(;a<0;)a+=s;for(;a>s;)a-=s;a<Number.EPSILON&&(l?a=0:a=s),this.aClockwise===!0&&!l&&(a===s?a=-s:a=a-s);const u=this.aStartAngle+e*a;let h=this.aX+this.xRadius*Math.cos(u),p=this.aY+this.yRadius*Math.sin(u);if(this.aRotation!==0){const m=Math.cos(this.aRotation),v=Math.sin(this.aRotation),x=h-this.aX,_=p-this.aY;h=x*m-_*v+this.aX,p=x*v+_*m+this.aY}return n.set(h,p)}copy(e){return super.copy(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}toJSON(){const e=super.toJSON();return e.aX=this.aX,e.aY=this.aY,e.xRadius=this.xRadius,e.yRadius=this.yRadius,e.aStartAngle=this.aStartAngle,e.aEndAngle=this.aEndAngle,e.aClockwise=this.aClockwise,e.aRotation=this.aRotation,e}fromJSON(e){return super.fromJSON(e),this.aX=e.aX,this.aY=e.aY,this.xRadius=e.xRadius,this.yRadius=e.yRadius,this.aStartAngle=e.aStartAngle,this.aEndAngle=e.aEndAngle,this.aClockwise=e.aClockwise,this.aRotation=e.aRotation,this}}class pI extends Y_{constructor(e,t,n,s,a,l){super(e,t,n,n,s,a,l),this.isArcCurve=!0,this.type="ArcCurve"}}function VA(){let i=0,e=0,t=0,n=0;function s(a,l,u,h){i=a,e=u,t=-3*a+3*l-2*u-h,n=2*a-2*l+u+h}return{initCatmullRom:function(a,l,u,h,p){s(l,u,p*(u-a),p*(h-l))},initNonuniformCatmullRom:function(a,l,u,h,p,m,v){let x=(l-a)/p-(u-a)/(p+m)+(u-l)/m,_=(u-l)/m-(h-l)/(m+v)+(h-u)/v;x*=m,_*=m,s(l,u,x,_)},calc:function(a){const l=a*a,u=l*a;return i+e*a+t*l+n*u}}}const jy=new se,qS=new VA,YS=new VA,JS=new VA;class mI extends fl{constructor(e=[],t=!1,n="centripetal",s=.5){super(),this.isCatmullRomCurve3=!0,this.type="CatmullRomCurve3",this.points=e,this.closed=t,this.curveType=n,this.tension=s}getPoint(e,t=new se){const n=t,s=this.points,a=s.length,l=(a-(this.closed?0:1))*e;let u=Math.floor(l),h=l-u;this.closed?u+=u>0?0:(Math.floor(Math.abs(u)/a)+1)*a:h===0&&u===a-1&&(u=a-2,h=1);let p,m;this.closed||u>0?p=s[(u-1)%a]:(jy.subVectors(s[0],s[1]).add(s[0]),p=jy);const v=s[u%a],x=s[(u+1)%a];if(this.closed||u+2<a?m=s[(u+2)%a]:(jy.subVectors(s[a-1],s[a-2]).add(s[a-1]),m=jy),this.curveType==="centripetal"||this.curveType==="chordal"){const _=this.curveType==="chordal"?.5:.25;let A=Math.pow(p.distanceToSquared(v),_),R=Math.pow(v.distanceToSquared(x),_),w=Math.pow(x.distanceToSquared(m),_);R<1e-4&&(R=1),A<1e-4&&(A=R),w<1e-4&&(w=R),qS.initNonuniformCatmullRom(p.x,v.x,x.x,m.x,A,R,w),YS.initNonuniformCatmullRom(p.y,v.y,x.y,m.y,A,R,w),JS.initNonuniformCatmullRom(p.z,v.z,x.z,m.z,A,R,w)}else this.curveType==="catmullrom"&&(qS.initCatmullRom(p.x,v.x,x.x,m.x,this.tension),YS.initCatmullRom(p.y,v.y,x.y,m.y,this.tension),JS.initCatmullRom(p.z,v.z,x.z,m.z,this.tension));return n.set(qS.calc(h),YS.calc(h),JS.calc(h)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(s.clone())}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const s=this.points[t];e.points.push(s.toArray())}return e.closed=this.closed,e.curveType=this.curveType,e.tension=this.tension,e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(new se().fromArray(s))}return this.closed=e.closed,this.curveType=e.curveType,this.tension=e.tension,this}}function HT(i,e,t,n,s){const a=(n-e)*.5,l=(s-t)*.5,u=i*i,h=i*u;return(2*t-2*n+a+l)*h+(-3*t+3*n-2*a-l)*u+a*i+t}function i2(i,e){const t=1-i;return t*t*e}function s2(i,e){return 2*(1-i)*i*e}function r2(i,e){return i*i*e}function N0(i,e,t,n){return i2(i,e)+s2(i,t)+r2(i,n)}function a2(i,e){const t=1-i;return t*t*t*e}function o2(i,e){const t=1-i;return 3*t*t*i*e}function l2(i,e){return 3*(1-i)*i*i*e}function c2(i,e){return i*i*i*e}function U0(i,e,t,n,s){return a2(i,e)+o2(i,t)+l2(i,n)+c2(i,s)}class WA extends fl{constructor(e=new st,t=new st,n=new st,s=new st){super(),this.isCubicBezierCurve=!0,this.type="CubicBezierCurve",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new st){const n=t,s=this.v0,a=this.v1,l=this.v2,u=this.v3;return n.set(U0(e,s.x,a.x,l.x,u.x),U0(e,s.y,a.y,l.y,u.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class gI extends fl{constructor(e=new se,t=new se,n=new se,s=new se){super(),this.isCubicBezierCurve3=!0,this.type="CubicBezierCurve3",this.v0=e,this.v1=t,this.v2=n,this.v3=s}getPoint(e,t=new se){const n=t,s=this.v0,a=this.v1,l=this.v2,u=this.v3;return n.set(U0(e,s.x,a.x,l.x,u.x),U0(e,s.y,a.y,l.y,u.y),U0(e,s.z,a.z,l.z,u.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this.v3.copy(e.v3),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e.v3=this.v3.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this.v3.fromArray(e.v3),this}}class XA extends fl{constructor(e=new st,t=new st){super(),this.isLineCurve=!0,this.type="LineCurve",this.v1=e,this.v2=t}getPoint(e,t=new st){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}
vendor: 4,344 bytes, line 117
117getTangent(e,t=new st){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class vI extends fl{constructor(e=new se,t=new se){super(),this.isLineCurve3=!0,this.type="LineCurve3",this.v1=e,this.v2=t}getPoint(e,t=new se){const n=t;return e===1?n.copy(this.v2):(n.copy(this.v2).sub(this.v1),n.multiplyScalar(e).add(this.v1)),n}getPointAt(e,t){return this.getPoint(e,t)}getTangent(e,t=new se){return t.subVectors(this.v2,this.v1).normalize()}getTangentAt(e,t){return this.getTangent(e,t)}copy(e){return super.copy(e),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class qA extends fl{constructor(e=new st,t=new st,n=new st){super(),this.isQuadraticBezierCurve=!0,this.type="QuadraticBezierCurve",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new st){const n=t,s=this.v0,a=this.v1,l=this.v2;return n.set(N0(e,s.x,a.x,l.x),N0(e,s.y,a.y,l.y)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class YA extends fl{constructor(e=new se,t=new se,n=new se){super(),this.isQuadraticBezierCurve3=!0,this.type="QuadraticBezierCurve3",this.v0=e,this.v1=t,this.v2=n}getPoint(e,t=new se){const n=t,s=this.v0,a=this.v1,l=this.v2;return n.set(N0(e,s.x,a.x,l.x),N0(e,s.y,a.y,l.y),N0(e,s.z,a.z,l.z)),n}copy(e){return super.copy(e),this.v0.copy(e.v0),this.v1.copy(e.v1),this.v2.copy(e.v2),this}toJSON(){const e=super.toJSON();return e.v0=this.v0.toArray(),e.v1=this.v1.toArray(),e.v2=this.v2.toArray(),e}fromJSON(e){return super.fromJSON(e),this.v0.fromArray(e.v0),this.v1.fromArray(e.v1),this.v2.fromArray(e.v2),this}}class JA extends fl{constructor(e=[]){super(),this.isSplineCurve=!0,this.type="SplineCurve",this.points=e}getPoint(e,t=new st){const n=t,s=this.points,a=(s.length-1)*e,l=Math.floor(a),u=a-l,h=s[l===0?l:l-1],p=s[l],m=s[l>s.length-2?s.length-1:l+1],v=s[l>s.length-3?s.length-1:l+2];return n.set(HT(u,h.x,p.x,m.x,v.x),HT(u,h.y,p.y,m.y,v.y)),n}copy(e){super.copy(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.points=[];for(let t=0,n=this.points.length;t<n;t++){const s=this.points[t];e.points.push(s.toArray())}return e}fromJSON(e){super.fromJSON(e),this.points=[];for(let t=0,n=e.points.length;t<n;t++){const s=e.points[t];this.points.push(new st().fromArray(s))}return this}}var f_=Object.freeze({__proto__:null,ArcCurve:pI,CatmullRomCurve3:mI,CubicBezierCurve:WA,CubicBezierCurve3:gI,EllipseCurve:Y_,LineCurve:XA,LineCurve3:vI,QuadraticBezierCurve:qA,QuadraticBezierCurve3:YA,SplineCurve:JA});class yI extends fl{constructor(){super(),this.type="CurvePath",this.curves=[],this.autoClose=!1}add(e){this.curves.push(e)}closePath(){const e=this.curves[0].getPoint(0),t=this.curves[this.curves.length-1].getPoint(1);if(!e.equals(t)){const n=e.isVector2===!0?"LineCurve":"LineCurve3";this.curves.push(new f_[n](t,e))}return this}getPoint(e,t){const n=e*this.getLength(),s=this.getCurveLengths();let a=0;for(;a<s.length;){if(s[a]>=n){const l=s[a]-n,u=this.curves[a],h=u.getLength(),p=h===0?0:1-l/h;return u.getPointAt(p,t)}a++}return null}getLength(){const e=this.getCurveLengths();return e[e.length-1]}updateArcLengths(){this.needsUpdate=!0,this.cacheLengths=null,this.getCurveLengths()}getCurveLengths(){if(this.cacheLengths&&this.cacheLengths.length===this.curves.length)return this.cacheLengths;const e=[];let t=0;for(let n=0,s=this.curves.length;n<s;n++)t+=this.curves[n].getLength(),e.push(t);return this.cacheLengths=e,e}getSpacedPoints(e=40){const t=[];for(let n=0;n<=e;n++)t.push(this.getPoint(n/e));return this.autoClose&&t.push(t[0]),t}getPoints(e=12){const t=[];let n;for(let s=0,a=this.curves;s<a.length;
vendor: 6,723 bytes, line 117
117s++){const l=a[s],u=l.isEllipseCurve?e*2:l.isLineCurve||l.isLineCurve3?1:l.isSplineCurve?e*l.points.length:e,h=l.getPoints(u);for(let p=0;p<h.length;p++){const m=h[p];n&&n.equals(m)||(t.push(m),n=m)}}return this.autoClose&&t.length>1&&!t[t.length-1].equals(t[0])&&t.push(t[0]),t}copy(e){super.copy(e),this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const s=e.curves[t];this.curves.push(s.clone())}return this.autoClose=e.autoClose,this}toJSON(){const e=super.toJSON();e.autoClose=this.autoClose,e.curves=[];for(let t=0,n=this.curves.length;t<n;t++){const s=this.curves[t];e.curves.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.autoClose=e.autoClose,this.curves=[];for(let t=0,n=e.curves.length;t<n;t++){const s=e.curves[t];this.curves.push(new f_[s.type]().fromJSON(s))}return this}}class Z0 extends yI{constructor(e){super(),this.type="Path",this.currentPoint=new st,e&&this.setFromPoints(e)}setFromPoints(e){this.moveTo(e[0].x,e[0].y);for(let t=1,n=e.length;t<n;t++)this.lineTo(e[t].x,e[t].y);return this}moveTo(e,t){return this.currentPoint.set(e,t),this}lineTo(e,t){const n=new XA(this.currentPoint.clone(),new st(e,t));return this.curves.push(n),this.currentPoint.set(e,t),this}quadraticCurveTo(e,t,n,s){const a=new qA(this.currentPoint.clone(),new st(e,t),new st(n,s));return this.curves.push(a),this.currentPoint.set(n,s),this}bezierCurveTo(e,t,n,s,a,l){const u=new WA(this.currentPoint.clone(),new st(e,t),new st(n,s),new st(a,l));return this.curves.push(u),this.currentPoint.set(a,l),this}splineThru(e){const t=[this.currentPoint.clone()].concat(e),n=new JA(t);return this.curves.push(n),this.currentPoint.copy(e[e.length-1]),this}arc(e,t,n,s,a,l){const u=this.currentPoint.x,h=this.currentPoint.y;return this.absarc(e+u,t+h,n,s,a,l),this}absarc(e,t,n,s,a,l){return this.absellipse(e,t,n,n,s,a,l),this}ellipse(e,t,n,s,a,l,u,h){const p=this.currentPoint.x,m=this.currentPoint.y;return this.absellipse(e+p,t+m,n,s,a,l,u,h),this}absellipse(e,t,n,s,a,l,u,h){const p=new Y_(e,t,n,s,a,l,u,h);if(this.curves.length>0){const v=p.getPoint(0);v.equals(this.currentPoint)||this.lineTo(v.x,v.y)}this.curves.push(p);const m=p.getPoint(1);return this.currentPoint.copy(m),this}copy(e){return super.copy(e),this.currentPoint.copy(e.currentPoint),this}toJSON(){const e=super.toJSON();return e.currentPoint=this.currentPoint.toArray(),e}fromJSON(e){return super.fromJSON(e),this.currentPoint.fromArray(e.currentPoint),this}}class mg extends Mn{constructor(e=[new st(0,-.5),new st(.5,0),new st(0,.5)],t=12,n=0,s=Math.PI*2){super(),this.type="LatheGeometry",this.parameters={points:e,segments:t,phiStart:n,phiLength:s},t=Math.floor(t),s=An(s,0,Math.PI*2);const a=[],l=[],u=[],h=[],p=[],m=1/t,v=new se,x=new st,_=new se,A=new se,R=new se;let w=0,E=0;for(let D=0;D<=e.length-1;D++)switch(D){case 0:w=e[D+1].x-e[D].x,E=e[D+1].y-e[D].y,_.x=E*1,_.y=-w,_.z=E*0,R.copy(_),_.normalize(),h.push(_.x,_.y,_.z);break;case e.length-1:h.push(R.x,R.y,R.z);break;default:w=e[D+1].x-e[D].x,E=e[D+1].y-e[D].y,_.x=E*1,_.y=-w,_.z=E*0,A.copy(_),_.x+=R.x,_.y+=R.y,_.z+=R.z,_.normalize(),h.push(_.x,_.y,_.z),R.copy(A)}for(let D=0;D<=t;D++){const L=n+D*m*s,P=Math.sin(L),G=Math.cos(L);for(let H=0;H<=e.length-1;H++){v.x=e[H].x*P,v.y=e[H].y,v.z=e[H].x*G,l.push(v.x,v.y,v.z),x.x=D/t,x.y=H/(e.length-1),u.push(x.x,x.y);const F=h[3*H+0]*P,X=h[3*H+1],z=h[3*H+0]*G;p.push(F,X,z)}}for(let D=0;D<t;D++)for(let L=0;L<e.length-1;L++){const P=L+D*e.length,G=P,H=P+e.length,F=P+e.length+1,X=P+1;a.push(G,H,X),a.push(F,X,H)}this.setIndex(a),this.setAttribute("position",new $t(l,3)),this.setAttribute("uv",new $t(u,2)),this.setAttribute("normal",new $t(p,3))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new mg(e.points,e.segments,e.phiStart,e.phiLength)}}class J_ extends mg{constructor(e=1,t=1,n=4,s=8){const a=new Z0;a.absarc(0,-t/2,e,Math.PI*1.5,0),a.absarc(0,t/2,e,0,Math.PI*.5),super(a.getPoints(n),s),this.type="CapsuleGeometry",this.parameters={radius:e,length:t,capSegments:n,radialSegments:s}}static fromJSON(e){return new J_(e.radius,e.length,e.capSegments,e.radialSegments)}}class K_ extends Mn{constructor(e=1,t=32,n=0,s=Math.PI*2){super(),this.type="CircleGeometry",this.parameters={radius:e,segments:t,thetaStart:n,thetaLength:s},t=Math.max(3,t);const a=[],l=[],u=[],h=[],p=new se,m=new st;l.push(0,0,0),u.push(0,0,1),h.push(.5,.5);for(let v=0,x=3;v<=t;v++,x+=3){const _=n+v/t*s;p.x=e*Math.cos(_),p.y=e*Math.sin(_),l.push(p.x,p.y,p.z),u.push(0,0,1),m.x=(l[x]/e+1)/2,m.y=(l[x+1]/e+1)/2,h.push(m.x,m.y)}for(let v=1;v<=t;v++)a.push(v,v+1,0);this.setIndex(a),this.setAttribute("position",new $t(l,3)),this.setAttribute("normal",new $t(u,3)),this.setAttribute("uv",new $t(h,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new K_(e.radius,e.segments,e.thetaStart,e.thetaLength)}}class Pp extends Mn{constructor(e=1,t=1,n=1,s=32,a=1,l=!1,u=0,h=Math.PI*2){super(),this.type="CylinderGeometry",this.parameters={radiusTop:e,radiusBottom:t,height:n,radialSegments:s,heightSegments:a,openEnded:l,thetaStart:u,thetaLength:h};const p=this;s=Math.floor(s),a=Math.floor(a);const m=[],v=[],x=[],_=[];let A=0;const R=[],w=n/2;let E=0;D(),l===!1&&(e>0&&L(!0),t>0&&L(!1)),this.setIndex(m),this.setAttribute("position",new $t(v,3)),this.setAttribute("normal",new $t(x,3)),this.setAttribute("uv",new $t(_,2));function D(){const P=new se,G=new se;let H=0;const F=(t-e)/n;for(let X=0;X<=a;X++){const z=[],k=X/a,ie=k*(t-e)+e;for(let ve=0;ve<=s;ve++){const J=ve/s,le=J*h+u,ae=Math.sin(le),W=Math.cos(le);G.x=ie*ae,G.y=-k*n+w,G.z=ie*W,v.push(G.x,G.y,G.z),P.set(ae,F,W).normalize(),x.push(P.x,P.y,P.z),_.push(J,1-k),z.push(A++)}R.push(z)}for(let X=0;X<s;X++)for(let z=0;z<a;z++){const k=R[z][X],ie=R[z+1][X],ve=R[z+1][X+1],J=R[z][X+1];(e>0||z!==0)&&(m.push(k,ie,J),H+=3),(t>0||z!==a-1)&&(m.push(ie,ve,J),H+=3)}p.addGroup(E,H,0),E+=H}function L(P){const G=A,H=new st,F=new se;let X=0;const z=P===!0?e:t,k=P===!0?1:-1;for(let ve=1;ve<=s;ve++)v.push(0,w*k,0),x.push(0,k,0),_.push(.5,.5),A++;const ie=A;for(let ve=0;ve<=s;ve++){const le=ve/s*h+u,ae=Math.cos(le),W=Math.sin(le);F.x=z*W,F.y=w*k,F.z=z*ae,v.push(F.x,F.y,F.z),x.push(0,k,0),H.x=ae*.5+.5,H.y=W*.5*k+.5,_.push(H.x,H.y),A++}for(let ve=0;ve<s;ve++){const J=G+ve,le=ie+ve;P===!0?m.push(le,le+1,J):m.push(le+1,le,J),X+=3}p.addGroup(E,X,P===!0?1:2),E+=X}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Pp(e.radiusTop,e.radiusBottom,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class Z_ extends Pp{constructor(e=1,t=1,n=32,s=1,a=!1,l=0,u=Math.PI*2){super(0,e,t,n,s,a,l,u),this.type="C
117oneGeometry",this.parameters={radius:e,height:t,radialSegments:n,heightSegments:s,openEnded:a,thetaStart:l,thetaLength:u}}static fromJSON(e){return new Z_(e.radius,e.height,e.radialSegments,e.heightSegments,e.openEnded,e.thetaStart,e.thetaLength)}}class nf extends Mn{constructor(e=[],t=[],n=1,s=0){super(),this.type="PolyhedronGeometry",this.parameters={vertices:e,indices:t,radius:n,detail:s};const a=[],l=[];u(s),p(n),m(),this.setAttribute("position",new $t(a,3)),this.setAttribute("normal",new $t(a.slice(),3)),this.setAttribute("uv",new $t(l,2)),s===0?this.computeVertexNormals():this.normalizeNormals();function u(D){const L=new se,P=new se,G=new se;for(let H=0;H<t.length;H+=3)_(t[H+0],L),_(t[H+1],P),_(t[H+2],G),h(L,P,G,D)}function h(D,L,P,G){const H=G+1,F=[];for(let X=0;X<=H;X++){F[X]=[];const z=D.clone().lerp(P,X/H),k=L.clone().lerp(P,X/H),ie=H-X;for(let ve=0;ve<=ie;ve++)ve===0&&X===H?F[X][ve]=z:F[X][ve]=z.clone().lerp(k,ve/ie)}for(let X=0;X<H;X++)for(let z=0;z<2*(H-X)-1;z++){const k=Math.floor(z/2);z%2===0?(x(F[X][k+1]),x(F[X+1][k]),x(F[X][k])):(x(F[X][k+1]),x(F[X+1][k+1]),x(F[X+1][k]))}}function p(D){const L=new se;for(let P=0;P<a.length;P+=3)L.x=a[P+0],L.y=a[P+1],L.z=a[P+2],L.normalize().multiplyScalar(D),a[P+0]=L.x,a[P+1]=L.y,a[P+2]=L.z}function m(){const D=new se;for(let L=0;L<a.length;L+=3){D.x=a[L+0],D.y=a[L+1],D.z=a[L+2];const P=w(D)/2/Math.PI+.5,G=E(D)/Math.PI+.5;l.push(P,1-G)}A(),v()}function v(){for(let D=0;D<l.length;D+=6){const L=l[D+0],P=l[D+2],G=l[D+4],H=Math.max(L,P,G),F=Math.min(L,P,G);H>.9&&F<.1&&(L<.2&&(l[D+0]+=1),P<.2&&(l[D+2]+=1),G<.2&&(l[D+4]+=1))}}function x(D){a.push(D.x,D.y,D.z)}function _(D,L){const P=D*3;L.x=e[P+0],L.y=e[P+1],L.z=e[P+2]}function A(){const D=new se,L=new se,P=new se,G=new se,H=new st,F=new st,X=new st;for(let z=0,k=0;z<a.length;z+=9,k+=6){D.set(a[z+0],a[z+1],a[z+2]),L.set(a[z+3],a[z+4],a[z+5]),P.set(a[z+6],a[z+7],a[z+8]),H.set(l[k+0],l[k+1]),F.set(l[k+2],l[k+3]),X.set(l[k+4],l[k+5]),G.copy(D).add(L).add(P).divideScalar(3);const ie=w(G);R(H,k+0,D,ie),R(F,k+2,L,ie),R(X,k+4,P,ie)}}function R(D,L,P,G){G<0&&D.x===1&&(l[L]=D.x-1),P.x===0&&P.z===0&&(l[L]=G/2/Math.PI+.5)}function w(D){return Math.atan2(D.z,-D.x)}function E(D){return Math.atan2(-D.y,Math.sqrt(D.x*D.x+D.z*D.z))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new nf(e.vertices,e.indices,e.radius,e.details)}}class Q_ extends nf{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,s=1/n,a=[-1,-1,-1,-1,-1,1,-1,1,-1,-1,1,1,1,-1,-1,1,-1,1,1,1,-1,1,1,1,0,-s,-n,0,-s,n,0,s,-n,0,s,n,-s,-n,0,-s,n,0,s,-n,0,s,n,0,-n,0,-s,n,0,-s,-n,0,s,n,0,s],l=[3,11,7,3,7,15,3,15,13,7,19,17,7,17,6,7,6,15,17,4,8,17,8,10,17,10,6,8,0,16,8,16,2,8,2,10,0,12,1,0,1,18,0,18,16,6,10,2,6,2,13,6,13,15,2,16,18,2,18,3,2,3,13,18,1,9,18,9,11,18,11,3,4,14,12,4,12,0,4,0,8,11,9,5,11,5,19,11,19,7,
vendor: 4,569 bytes, line 117
11719,5,14,19,14,4,19,4,17,1,12,14,1,14,5,1,5,9];super(a,l,e,t),this.type="DodecahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new Q_(e.radius,e.detail)}}const Vy=new se,Wy=new se,KS=new se,Xy=new Ha;class xI extends Mn{constructor(e=null,t=1){if(super(),this.type="EdgesGeometry",this.parameters={geometry:e,thresholdAngle:t},e!==null){const s=Math.pow(10,4),a=Math.cos(vd*t),l=e.getIndex(),u=e.getAttribute("position"),h=l?l.count:u.count,p=[0,0,0],m=["a","b","c"],v=new Array(3),x={},_=[];for(let A=0;A<h;A+=3){l?(p[0]=l.getX(A),p[1]=l.getX(A+1),p[2]=l.getX(A+2)):(p[0]=A,p[1]=A+1,p[2]=A+2);const{a:R,b:w,c:E}=Xy;if(R.fromBufferAttribute(u,p[0]),w.fromBufferAttribute(u,p[1]),E.fromBufferAttribute(u,p[2]),Xy.getNormal(KS),v[0]=`${Math.round(R.x*s)},${Math.round(R.y*s)},${Math.round(R.z*s)}`,v[1]=`${Math.round(w.x*s)},${Math.round(w.y*s)},${Math.round(w.z*s)}`,v[2]=`${Math.round(E.x*s)},${Math.round(E.y*s)},${Math.round(E.z*s)}`,!(v[0]===v[1]||v[1]===v[2]||v[2]===v[0]))for(let D=0;D<3;D++){const L=(D+1)%3,P=v[D],G=v[L],H=Xy[m[D]],F=Xy[m[L]],X=`${P}_${G}`,z=`${G}_${P}`;z in x&&x[z]?(KS.dot(x[z].normal)<=a&&(_.push(H.x,H.y,H.z),_.push(F.x,F.y,F.z)),x[z]=null):X in x||(x[X]={index0:p[D],index1:p[L],normal:KS.clone()})}}for(const A in x)if(x[A]){const{index0:R,index1:w}=x[A];Vy.fromBufferAttribute(u,R),Wy.fromBufferAttribute(u,w),_.push(Vy.x,Vy.y,Vy.z),_.push(Wy.x,Wy.y,Wy.z)}this.setAttribute("position",new $t(_,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}class yd extends Z0{constructor(e){super(e),this.uuid=Za(),this.type="Shape",this.holes=[]}getPointsHoles(e){const t=[];for(let n=0,s=this.holes.length;n<s;n++)t[n]=this.holes[n].getPoints(e);return t}extractPoints(e){return{shape:this.getPoints(e),holes:this.getPointsHoles(e)}}copy(e){super.copy(e),this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const s=e.holes[t];this.holes.push(s.clone())}return this}toJSON(){const e=super.toJSON();e.uuid=this.uuid,e.holes=[];for(let t=0,n=this.holes.length;t<n;t++){const s=this.holes[t];e.holes.push(s.toJSON())}return e}fromJSON(e){super.fromJSON(e),this.uuid=e.uuid,this.holes=[];for(let t=0,n=e.holes.length;t<n;t++){const s=e.holes[t];this.holes.push(new Z0().fromJSON(s))}return this}}function u2(i,e,t=2){const n=e&&e.length,s=n?e[0]*t:i.length;let a=_I(i,0,s,t,!0);const l=[];if(!a||a.next===a.prev)return l;let u,h,p;if(n&&(a=m2(i,e,a,t)),i.length>80*t){u=1/0,h=1/0;let m=-1/0,v=-1/0;for(let x=t;x<s;x+=t){const _=i[x],A=i[x+1];_<u&&(u=_),A<h&&(h=A),_>m&&(m=_),A>v&&(v=A)}p=Math.max(m-u,v-h),p=p!==0?32767/p:0}return Q0(a,l,t,u,h,p,0),l}function _I(i,e,t,n,s){let a;if(s===T2(i,e,t,n)>0)for(let l=e;l<t;l+=n)a=GT(l/n|0,i[l],i[l+1],a);else for(let l=t-n;l>=e;l-=n)a=GT(l/n|0,i[l],i[l+1],a);return a&&Rp(a,a.next)&&(eg(a),a=a.next),a}function Cd(i,e){if(!i)return i;e||(e=i);let t=i,n;do if(n=!1,!t.steiner&&(Rp(t,t.next)||As(t.prev,t,t.next)===0)){if(eg(t),t=e=t.prev,t===t.next)break;n=!0}else t=t.next;while(n||t!==e);return e}function Q0(i,e,t,n,s,a,l){if(!i)return;!l&&a&&_2(i,n,s,a);let u=i;for(;i.prev!==i.next;){const h=i.prev,p=i.next;if(a?d2(i,n,s,a):f2(i)){e.push(h.i,i.i,p.i),eg(i),i=p.next,u=p.next;continue}if(i=p,i===u){l?l===1?(i=h2(Cd(i),e),Q0(i,e,t,n,s,a,2)):l===2&&p2(i,e,t,n,s,a):Q0(Cd(i),e,t,n,s,a,1);break}}}function f2(i){const e=i.prev,t=i,n=i.next;if(As(e,t,n)>=0)return!1;const s=e.x,a=t.x,l=n.x,u=e.y,h=t.y,p=n.y,m=Math.min(s,a,l),v=Math.min(u,h,p),x=Math.max(s,a,l),_=Math.max(u,h,p);let A=n.next;for(;A!==e;){if(A.x>=m&&A.x<=x&&A.y>=v&&A.y<=_&&C0(s,u,a,h,l,p,A.x,A.y)&&As(A.prev,A,A.next)>=0)return!1;A=A.next}return!0}function d2(i,e,t,n){const s=i.prev,a=i,l=i.next;if(As(s,a,l)>=0)return!1;const u=s.x,h=a.x,p=l.x,m=s.y,v=a.y,x=l.y,_=Math.min(u,h,p),A=Math.min(m,v,x),R=Math.max(u,h,p),w=Math.max(m,v,x),E=J1(_,A,e,t,n),D=J1(R,w,e,t,n);let L=i.prevZ,P=i.nextZ;for(;L&&L.z>=E&&P&&P.z<=D;){if(L.x>=_&&L.x<=R&&L.y>=A&&L.y<=w&&L!==s&&L!==l&&C0(u,m,h,v,p,x,L.x,L.y)&&As(L.prev,L,L.next)>=0||(L=L.prevZ,P.x>=_&&P.x<=R&&P.y>=A&&P.y<=w&&P!==s&&P!==l&&C0(u,m,h,v,p,x,P.x,P.y)&&As(P.prev,P,P.next)>=0))return!1;P=P.nextZ}for(;L&&L.z>=E;){if(L.x>=_&&L.x<=R&&L.y>=A&&L.y<=w&&L!==s&&L!==l&&C0(u,m,h,v,p,x,L.x,L.y)&&As(L.prev,L,L.next)>=0)return!1;L=L.prevZ}for(;P&&P.z<=D;){if(P.x>=_&&P.x<=R&&P.y>=A&&P.y<=w&&P!==s&&P!==l&&C0(u,m,h,v,p,x,P.x,P.y)&&As(P.prev,P,P.next)>=0)return!1;P=P.nextZ}return!0}function h2(i,e){let t=i;do{const n=t.prev,s=t.next.next;!Rp(n,s)&&SI(n,t,t.next,s)&&$0(n,s)&&$0(s,n)&&(e.push(n.i,t.i,s.i),eg(t),eg(t.next),t=i=s),t=t.next}
vendor: 4,153 bytes, line 117
117while(t!==i);return Cd(t)}function p2(i,e,t,n,s,a){let l=i;do{let u=l.next.next;for(;u!==l.prev;){if(l.i!==u.i&&A2(l,u)){let h=AI(l,u);l=Cd(l,l.next),h=Cd(h,h.next),Q0(l,e,t,n,s,a,0),Q0(h,e,t,n,s,a,0);return}u=u.next}l=l.next}while(l!==i)}function m2(i,e,t,n){const s=[];for(let a=0,l=e.length;a<l;a++){const u=e[a]*n,h=a<l-1?e[a+1]*n:i.length,p=_I(i,u,h,n,!1);p===p.next&&(p.steiner=!0),s.push(S2(p))}s.sort(g2);for(let a=0;a<s.length;a++)t=v2(s[a],t);return t}function g2(i,e){let t=i.x-e.x;if(t===0&&(t=i.y-e.y,t===0)){const n=(i.next.y-i.y)/(i.next.x-i.x),s=(e.next.y-e.y)/(e.next.x-e.x);t=n-s}return t}function v2(i,e){const t=y2(i,e);if(!t)return e;const n=AI(t,i);return Cd(n,n.next),Cd(t,t.next)}function y2(i,e){let t=e;const n=i.x,s=i.y;let a=-1/0,l;if(Rp(i,t))return t;do{if(Rp(i,t.next))return t.next;if(s<=t.y&&s>=t.next.y&&t.next.y!==t.y){const v=t.x+(s-t.y)*(t.next.x-t.x)/(t.next.y-t.y);if(v<=n&&v>a&&(a=v,l=t.x<t.next.x?t:t.next,v===n))return l}t=t.next}while(t!==e);if(!l)return null;const u=l,h=l.x,p=l.y;let m=1/0;t=l;do{if(n>=t.x&&t.x>=h&&n!==t.x&&bI(s<p?n:a,s,h,p,s<p?a:n,s,t.x,t.y)){const v=Math.abs(s-t.y)/(n-t.x);$0(t,i)&&(v<m||v===m&&(t.x>l.x||t.x===l.x&&x2(l,t)))&&(l=t,m=v)}t=t.next}while(t!==u);return l}function x2(i,e){return As(i.prev,i,e.prev)<0&&As(e.next,i,i.next)<0}function _2(i,e,t,n){let s=i;do s.z===0&&(s.z=J1(s.x,s.y,e,t,n)),s.prevZ=s.prev,s.nextZ=s.next,s=s.next;while(s!==i);s.prevZ.nextZ=null,s.prevZ=null,b2(s)}function b2(i){let e,t=1;do{let n=i,s;i=null;let a=null;for(e=0;n;){e++;let l=n,u=0;for(let p=0;p<t&&(u++,l=l.nextZ,!!l);p++);let h=t;for(;u>0||h>0&&l;)u!==0&&(h===0||!l||n.z<=l.z)?(s=n,n=n.nextZ,u--):(s=l,l=l.nextZ,h--),a?a.nextZ=s:i=s,s.prevZ=a,a=s;n=l}a.nextZ=null,t*=2}while(e>1);return i}function J1(i,e,t,n,s){return i=(i-t)*s|0,e=(e-n)*s|0,i=(i|i<<8)&16711935,i=(i|i<<4)&252645135,i=(i|i<<2)&858993459,i=(i|i<<1)&1431655765,e=(e|e<<8)&16711935,e=(e|e<<4)&252645135,e=(e|e<<2)&858993459,e=(e|e<<1)&1431655765,i|e<<1}function S2(i){let e=i,t=i;do(e.x<t.x||e.x===t.x&&e.y<t.y)&&(t=e),e=e.next;while(e!==i);return t}function bI(i,e,t,n,s,a,l,u){return(s-l)*(e-u)>=(i-l)*(a-u)&&(i-l)*(n-u)>=(t-l)*(e-u)&&(t-l)*(a-u)>=(s-l)*(n-u)}function C0(i,e,t,n,s,a,l,u){return!(i===l&&e===u)&&bI(i,e,t,n,s,a,l,u)}function A2(i,e){return i.next.i!==e.i&&i.prev.i!==e.i&&!M2(i,e)&&($0(i,e)&&$0(e,i)&&E2(i,e)&&(As(i.prev,i,e.prev)||As(i,e.prev,e))||Rp(i,e)&&As(i.prev,i,i.next)>0&&As(e.prev,e,e.next)>0)}function As(i,e,t){return(e.y-i.y)*(t.x-e.x)-(e.x-i.x)*(t.y-e.y)}function Rp(i,e){return i.x===e.x&&i.y===e.y}function SI(i,e,t,n){const s=Yy(As(i,e,t)),a=Yy(As(i,e,n)),l=Yy(As(t,n,i)),u=Yy(As(t,n,e));return!!(s!==a&&l!==u||s===0&&qy(i,t,e)||a===0&&qy(i,n,e)||l===0&&qy(t,i,n)||u===0&&qy(t,e,n))}function qy(i,e,t){return e.x<=Math.max(i.x,t.x)&&e.x>=Math.min(i.x,t.x)&&e.y<=Math.max(i.y,t.y)&&e.y>=Math.min(i.y,t.y)}function Yy(i){return i>0?1:i<0?-1:0}function M2(i,e){let t=i;do{if(t.i!==i.i&&t.next.i!==i.i&&t.i!==e.i&&t.next.i!==e.i&&SI(t,t.next,i,e))return!0;t=t.next}while(t!==i);return!1}function $0(i,e){return As(i.prev,i,i.next)<0?As(i,e,i.next)>=0&&As(i,i.prev,e)>=0:As(i,e,i.prev)<0||As(i,i.next,e)<0}function E2(i,e){let t=i,n=!1;const s=(i.x+e.x)/2,a=(i.y+e.y)/2;do t.y>a!=t.next.y>a&&t.next.y!==t.y&&s<(t.next.x-t.x)*(a-t.y)/(t.next.y-t.y)+t.x&&(n=!n),t=t.next;while(t!==i);return n}function AI(i,e){const t=K1(i.i,i.x,i.y),n=K1(e.i,e.x,e.y),s=i.next,a=e.prev;return i.next=e,e.prev=i,t.next=s,s.prev=t,n.next=t,t.prev=n,a.next=n,n.prev=a,n}function GT(i,e,t,n){const s=K1(i,e,t);return n?(s.next=n.next,s.prev=n,n.next.prev=s,n.next=s):(s.prev=s,s.next=s),s}function eg(i){i.next.prev=i.prev,i.prev.next=i.next,i.prevZ&&(i.prevZ.nextZ=i.nextZ),i.nextZ&&(i.nextZ.prevZ=i.prevZ)}function K1(i,e,t){return{i,x:e,y:t,prev:null,next:null,z:0,prevZ:null,nextZ:null,steiner:!1}}function T2(i,e,t,n){let s=0;for(let a=e,l=t-n;a<t;a+=n)s+=(i[l]-i[a])*(i[a+1]+i[l+1]),l=a;return s}class w2{static triangulate(e,t,n=2){return u2(e,t,n)}}class Vl{static area(e){const t=e.length;let n=0;for(let s=t-1,a=0;a<t;s=a++)n+=e[s].x*e[a].y-e[a].x*e[s].y;return n*.5}static isClockWise(e){return Vl.area(e)<0}
vendor: 57,141 bytes, line 117
117static triangulateShape(e,t){const n=[],s=[],a=[];jT(e),VT(n,e);let l=e.length;t.forEach(jT);for(let h=0;h<t.length;h++)s.push(l),l+=t[h].length,VT(n,t[h]);const u=w2.triangulate(n,s);for(let h=0;h<u.length;h+=3)a.push(u.slice(h,h+3));return a}}function jT(i){const e=i.length;e>2&&i[e-1].equals(i[0])&&i.pop()}function VT(i,e){for(let t=0;t<e.length;t++)i.push(e[t].x),i.push(e[t].y)}class $_ extends Mn{constructor(e=new yd([new st(.5,.5),new st(-.5,.5),new st(-.5,-.5),new st(.5,-.5)]),t={}){super(),this.type="ExtrudeGeometry",this.parameters={shapes:e,options:t},e=Array.isArray(e)?e:[e];const n=this,s=[],a=[];for(let u=0,h=e.length;u<h;u++){const p=e[u];l(p)}this.setAttribute("position",new $t(s,3)),this.setAttribute("uv",new $t(a,2)),this.computeVertexNormals();function l(u){const h=[],p=t.curveSegments!==void 0?t.curveSegments:12,m=t.steps!==void 0?t.steps:1,v=t.depth!==void 0?t.depth:1;let x=t.bevelEnabled!==void 0?t.bevelEnabled:!0,_=t.bevelThickness!==void 0?t.bevelThickness:.2,A=t.bevelSize!==void 0?t.bevelSize:_-.1,R=t.bevelOffset!==void 0?t.bevelOffset:0,w=t.bevelSegments!==void 0?t.bevelSegments:3;const E=t.extrudePath,D=t.UVGenerator!==void 0?t.UVGenerator:C2;let L,P=!1,G,H,F,X;E&&(L=E.getSpacedPoints(m),P=!0,x=!1,G=E.computeFrenetFrames(m,!1),H=new se,F=new se,X=new se),x||(w=0,_=0,A=0,R=0);const z=u.extractPoints(p);let k=z.shape;const ie=z.holes;if(!Vl.isClockWise(k)){k=k.reverse();for(let $e=0,Qe=ie.length;$e<Qe;$e++){const Ye=ie[$e];Vl.isClockWise(Ye)&&(ie[$e]=Ye.reverse())}}function J($e){const Ye=10000000000000001e-36;let pt=$e[0];for(let Ve=1;Ve<=$e.length;Ve++){const ne=Ve%$e.length,V=$e[ne],Se=V.x-pt.x,Ie=V.y-pt.y,et=Se*Se+Ie*Ie,Fe=Math.max(Math.abs(V.x),Math.abs(V.y),Math.abs(pt.x),Math.abs(pt.y)),Rt=Ye*Fe*Fe;if(et<=Rt){$e.splice(ne,1),Ve--;continue}pt=V}}J(k),ie.forEach(J);const le=ie.length,ae=k;for(let $e=0;$e<le;$e++){const Qe=ie[$e];k=k.concat(Qe)}function W($e,Qe,Ye){return Qe||console.error("THREE.ExtrudeGeometry: vec does not exist"),$e.clone().addScaledVector(Qe,Ye)}const ee=k.length;function te($e,Qe,Ye){let pt,Ve,ne;const V=$e.x-Qe.x,Se=$e.y-Qe.y,Ie=Ye.x-$e.x,et=Ye.y-$e.y,Fe=V*V+Se*Se,Rt=V*et-Se*Ie;if(Math.abs(Rt)>Number.EPSILON){const qe=Math.sqrt(Fe),yt=Math.sqrt(Ie*Ie+et*et),At=Qe.x-Se/qe,it=Qe.y+V/qe,Oe=Ye.x-et/yt,Ct=Ye.y+Ie/yt,Ft=((Oe-At)*et-(Ct-it)*Ie)/(V*et-Se*Ie);pt=At+V*Ft-$e.x,Ve=it+Se*Ft-$e.y;const ft=pt*pt+Ve*Ve;if(ft<=2)return new st(pt,Ve);ne=Math.sqrt(ft/2)}else{let qe=!1;V>Number.EPSILON?Ie>Number.EPSILON&&(qe=!0):V<-Number.EPSILON?Ie<-Number.EPSILON&&(qe=!0):Math.sign(Se)===Math.sign(et)&&(qe=!0),qe?(pt=-Se,Ve=V,ne=Math.sqrt(Fe)):(pt=V,Ve=Se,ne=Math.sqrt(Fe/2))}return new st(pt/ne,Ve/ne)}const ue=[];for(let $e=0,Qe=ae.length,Ye=Qe-1,pt=$e+1;$e<Qe;$e++,Ye++,pt++)Ye===Qe&&(Ye=0),pt===Qe&&(pt=0),ue[$e]=te(ae[$e],ae[Ye],ae[pt]);const he=[];let K,ce=ue.concat();for(let $e=0,Qe=le;$e<Qe;$e++){const Ye=ie[$e];K=[];for(let pt=0,Ve=Ye.length,ne=Ve-1,V=pt+1;pt<Ve;pt++,ne++,V++)ne===Ve&&(ne=0),V===Ve&&(V=0),K[pt]=te(Ye[pt],Ye[ne],Ye[V]);he.push(K),ce=ce.concat(K)}const re=[],oe=[];for(let $e=0;$e<w;$e++){const Qe=$e/w,Ye=_*Math.cos(Qe*Math.PI/2),pt=A*Math.sin(Qe*Math.PI/2)+R;for(let Ve=0,ne=ae.length;Ve<ne;Ve++){const V=W(ae[Ve],ue[Ve],pt);vt(V.x,V.y,-Ye),Qe==0&&re.push(V)}for(let Ve=0,ne=le;Ve<ne;Ve++){const V=ie[Ve];K=he[Ve];const Se=[];for(let Ie=0,et=V.length;Ie<et;Ie++){const Fe=W(V[Ie],K[Ie],pt);vt(Fe.x,Fe.y,-Ye),Qe==0&&Se.push(Fe)}Qe==0&&oe.push(Se)}}const we=Vl.triangulateShape(re,oe),Be=we.length,pe=A+R;for(let $e=0;$e<ee;$e++){const Qe=x?W(k[$e],ce[$e],pe):k[$e];P?(F.copy(G.normals[0]).multiplyScalar(Qe.x),H.copy(G.binormals[0]).multiplyScalar(Qe.y),X.copy(L[0]).add(F).add(H),vt(X.x,X.y,X.z)):vt(Qe.x,Qe.y,0)}for(let $e=1;$e<=m;$e++)for(let Qe=0;Qe<ee;Qe++){const Ye=x?W(k[Qe],ce[Qe],pe):k[Qe];P?(F.copy(G.normals[$e]).multiplyScalar(Ye.x),H.copy(G.binormals[$e]).multiplyScalar(Ye.y),X.copy(L[$e]).add(F).add(H),vt(X.x,X.y,X.z)):vt(Ye.x,Ye.y,v/m*$e)}for(let $e=w-1;$e>=0;$e--){const Qe=$e/w,Ye=_*Math.cos(Qe*Math.PI/2),pt=A*Math.sin(Qe*Math.PI/2)+R;for(let Ve=0,ne=ae.length;Ve<ne;Ve++){const V=W(ae[Ve],ue[Ve],pt);vt(V.x,V.y,v+Ye)}for(let Ve=0,ne=ie.length;Ve<ne;Ve++){const V=ie[Ve];K=he[Ve];for(let Se=0,Ie=V.length;Se<Ie;Se++){const et=W(V[Se],K[Se],pt);P?vt(et.x,et.y+L[m-1].y,L[m-1].x+Ye):vt(et.x,et.y,v+Ye)}}}Re(),lt();function Re(){const $e=s.length/3;if(x){let Qe=0,Ye=ee*Qe;for(let pt=0;pt<Be;pt++){const Ve=we[pt];qt(Ve[2]+Ye,Ve[1]+Ye,Ve[0]+Ye)}Qe=m+w*2,Ye=ee*Qe;for(let pt=0;pt<Be;pt++){const Ve=we[pt];qt(Ve[0]+Ye,Ve[1]+Ye,Ve[2]+Ye)}}else{for(let Qe=0;Qe<Be;Qe++){const Ye=we[Qe];qt(Ye[2],Ye[1],Ye[0])}for(let Qe=0;Qe<Be;Qe++){const Ye=we[Qe];qt(Ye[0]+ee*m,Ye[1]+ee*m,Ye[2]+ee*m)}}n.addGroup($e,s.length/3-$e,0)}function lt(){const $e=s.length/3;let Qe=0;ct(ae,Qe),Qe+=ae.length;for(let Ye=0,pt=ie.length;Ye<pt;Ye++){const Ve=ie[Ye];ct(Ve,Qe),Qe+=Ve.length}n.addGroup($e,s.length/3-$e,1)}function ct($e,Qe){let Ye=$e.length;for(;--Ye>=0;){const pt=Ye;let Ve=Ye-1;Ve<0&&(Ve=$e.length-1);for(let ne=0,V=m+w*2;ne<V;ne++){const Se=ee*ne,Ie=ee*(ne+1),et=Qe+pt+Se,Fe=Qe+Ve+Se,Rt=Qe+Ve+Ie,qe=Qe+pt+Ie;Wt(et,Fe,Rt,qe)}}}function vt($e,Qe,Ye){h.push($e),h.push(Qe),h.push(Ye)}function qt($e,Qe,Ye){de($e),de(Qe),de(Ye);const pt=s.length/3,Ve=D.generateTopUV(n,s,pt-3,pt-2,pt-1);an(Ve[0]),an(Ve[1]),an(Ve[2])}function Wt($e,Qe,Ye,pt){de($e),de(Qe),de(pt),de(Qe),de(Ye),de(pt);const Ve=s.length/3,ne=D.generateSideWallUV(n,s,Ve-6,Ve-3,Ve-2,Ve-1);an(ne[0]),an(ne[1]),an(ne[3]),an(ne[1]),an(ne[2]),an(ne[3])}function de($e){s.push(h[$e*3+0]),s.push(h[$e*3+1]),s.push(h[$e*3+2])}function an($e){a.push($e.x),a.push($e.y)}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes,n=this.parameters.options;return R2(t,n,e)}static fromJSON(e,t){const n=[];for(let a=0,l=e.shapes.length;a<l;a++){const u=t[e.shapes[a]];n.push(u)}const s=e.options.extrudePath;return s!==void 0&&(e.options.extrudePath=new f_[s.type]().fromJSON(s)),new $_(n,e.options)}}const C2={generateTopUV:function(i,e,t,n,s){const a=e[t*3],l=e[t*3+1],u=e[n*3],h=e[n*3+1],p=e[s*3],m=e[s*3+1];return[new st(a,l),new st(u,h),new st(p,m)]},generateSideWallUV:function(i,e,t,n,s,a){const l=e[t*3],u=e[t*3+1],h=e[t*3+2],p=e[n*3],m=e[n*3+1],v=e[n*3+2],x=e[s*3],_=e[s*3+1],A=e[s*3+2],R=e[a*3],w=e[a*3+1],E=e[a*3+2];return Math.abs(u-m)<Math.abs(l-p)?[new st(l,1-h),new st(p,1-v),new st(x,1-A),new st(R,1-E)]:[new st(u,1-h),new st(m,1-v),new st(_,1-A),new st(w,1-E)]}};function R2(i,e,t){if(t.shapes=[],Array.isArray(i))for(let n=0,s=i.length;n<s;n++){const a=i[n];t.shapes.push(a.uuid)}else t.shapes.push(i.uuid);return t.options=Object.assign({},e),e.extrudePath!==void 0&&(t.options.extrudePath=e.extrudePath.toJSON()),t}class eb extends nf{constructor(e=1,t=0){const n=(1+Math.sqrt(5))/2,s=[-1,n,0,1,n,0,-1,-n,0,1,-n,0,0,-1,n,0,1,n,0,-1,-n,0,1,-n,n,0,-1,n,0,1,-n,0,-1,-n,0,1],a=[0,11,5,0,5,1,0,1,7,0,7,10,0,10,11,1,5,9,5,11,4,11,10,2,10,7,6,7,1,8,3,9,4,3,4,2,3,2,6,3,6,8,3,8,9,4,9,5,2,4,11,6,2,10,8,6,7,9,8,1];super(s,a,e,t),this.type="IcosahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new eb(e.radius,e.detail)}}class gg extends nf{constructor(e=1,t=0){const n=[1,0,0,-1,0,0,0,1,0,0,-1,0,0,0,1,0,0,-1],s=[0,2,4,0,4,3,0,3,5,0,5,2,1,2,5,1,5,3,1,3,4,1,4,2];super(n,s,e,t),this.type="OctahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new gg(e.radius,e.detail)}}class Nd extends Mn{constructor(e=1,t=1,n=1,s=1){super(),this.type="PlaneGeometry",this.parameters={width:e,height:t,widthSegments:n,heightSegments:s};const a=e/2,l=t/2,u=Math.floor(n),h=Math.floor(s),p=u+1,m=h+1,v=e/u,x=t/h,_=[],A=[],R=[],w=[];for(let E=0;E<m;E++){const D=E*x-l;for(let L=0;L<p;L++){const P=L*v-a;A.push(P,-D,0),R.push(0,0,1),w.push(L/u),w.push(1-E/h)}}for(let E=0;E<h;E++)for(let D=0;D<u;D++){const L=D+p*E,P=D+p*(E+1),G=D+1+p*(E+1),H=D+1+p*E;_.push(L,P,H),_.push(P,G,H)}this.setIndex(_),this.setAttribute("position",new $t(A,3)),this.setAttribute("normal",new $t(R,3)),this.setAttribute("uv",new $t(w,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new Nd(e.width,e.height,e.widthSegments,e.heightSegments)}}class tb extends Mn{constructor(e=.5,t=1,n=32,s=1,a=0,l=Math.PI*2){super(),this.type="RingGeometry",this.parameters={innerRadius:e,outerRadius:t,thetaSegments:n,phiSegments:s,thetaStart:a,thetaLength:l},n=Math.max(3,n),s=Math.max(1,s);const u=[],h=[],p=[],m=[];let v=e;const x=(t-e)/s,_=new se,A=new st;for(let R=0;R<=s;R++){for(let w=0;w<=n;w++){const E=a+w/n*l;_.x=v*Math.cos(E),_.y=v*Math.sin(E),h.push(_.x,_.y,_.z),p.push(0,0,1),A.x=(_.x/t+1)/2,A.y=(_.y/t+1)/2,m.push(A.x,A.y)}v+=x}for(let R=0;R<s;R++){const w=R*(n+1);for(let E=0;E<n;E++){const D=E+w,L=D,P=D+n+1,G=D+n+2,H=D+1;u.push(L,P,H),u.push(P,G,H)}}this.setIndex(u),this.setAttribute("position",new $t(h,3)),this.setAttribute("normal",new $t(p,3)),this.setAttribute("uv",new $t(m,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new tb(e.innerRadius,e.outerRadius,e.thetaSegments,e.phiSegments,e.thetaStart,e.thetaLength)}}class nb extends Mn{constructor(e=new yd([new st(0,.5),new st(-.5,-.5),new st(.5,-.5)]),t=12){super(),this.type="ShapeGeometry",this.parameters={shapes:e,curveSegments:t};const n=[],s=[],a=[],l=[];let u=0,h=0;if(Array.isArray(e)===!1)p(e);else for(let m=0;m<e.length;m++)p(e[m]),this.addGroup(u,h,m),u+=h,h=0;this.setIndex(n),this.setAttribute("position",new $t(s,3)),this.setAttribute("normal",new $t(a,3)),this.setAttribute("uv",new $t(l,2));function p(m){const v=s.length/3,x=m.extractPoints(t);let _=x.shape;const A=x.holes;Vl.isClockWise(_)===!1&&(_=_.reverse());for(let w=0,E=A.length;w<E;w++){const D=A[w];Vl.isClockWise(D)===!0&&(A[w]=D.reverse())}const R=Vl.triangulateShape(_,A);for(let w=0,E=A.length;w<E;w++){const D=A[w];_=_.concat(D)}for(let w=0,E=_.length;w<E;w++){const D=_[w];s.push(D.x,D.y,0),a.push(0,0,1),l.push(D.x,D.y)}for(let w=0,E=R.length;w<E;w++){const D=R[w],L=D[0]+v,P=D[1]+v,G=D[2]+v;n.push(L,P,G),h+=3}}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON(),t=this.parameters.shapes;return B2(t,e)}static fromJSON(e,t){const n=[];for(let s=0,a=e.shapes.length;s<a;s++){const l=t[e.shapes[s]];n.push(l)}return new nb(n,e.curveSegments)}}function B2(i,e){if(e.shapes=[],Array.isArray(i))for(let t=0,n=i.length;t<n;t++){const s=i[t];e.shapes.push(s.uuid)}else e.shapes.push(i.uuid);return e}class vg extends Mn{constructor(e=1,t=32,n=16,s=0,a=Math.PI*2,l=0,u=Math.PI){super(),this.type="SphereGeometry",this.parameters={radius:e,widthSegments:t,heightSegments:n,phiStart:s,phiLength:a,thetaStart:l,thetaLength:u},t=Math.max(3,Math.floor(t)),n=Math.max(2,Math.floor(n));const h=Math.min(l+u,Math.PI);let p=0;const m=[],v=new se,x=new se,_=[],A=[],R=[],w=[];for(let E=0;E<=n;E++){const D=[],L=E/n;let P=0;E===0&&l===0?P=.5/t:E===n&&h===Math.PI&&(P=-.5/t);for(let G=0;G<=t;G++){const H=G/t;v.x=-e*Math.cos(s+H*a)*Math.sin(l+L*u),v.y=e*Math.cos(l+L*u),v.z=e*Math.sin(s+H*a)*Math.sin(l+L*u),A.push(v.x,v.y,v.z),x.copy(v).normalize(),R.push(x.x,x.y,x.z),w.push(H+P,1-L),D.push(p++)}m.push(D)}for(let E=0;E<n;E++)for(let D=0;D<t;D++){const L=m[E][D+1],P=m[E][D],G=m[E+1][D],H=m[E+1][D+1];(E!==0||l>0)&&_.push(L,P,H),(E!==n-1||h<Math.PI)&&_.push(P,G,H)}this.setIndex(_),this.setAttribute("position",new $t(A,3)),this.setAttribute("normal",new $t(R,3)),this.setAttribute("uv",new $t(w,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new vg(e.radius,e.widthSegments,e.heightSegments,e.phiStart,e.phiLength,e.thetaStart,e.thetaLength)}}class ib extends nf{constructor(e=1,t=0){const n=[1,1,1,-1,-1,1,-1,1,-1,1,-1,-1],s=[2,1,0,0,3,2,1,3,0,2,3,1];super(n,s,e,t),this.type="TetrahedronGeometry",this.parameters={radius:e,detail:t}}static fromJSON(e){return new ib(e.radius,e.detail)}}class sb extends Mn{constructor(e=1,t=.4,n=12,s=48,a=Math.PI*2){super(),this.type="TorusGeometry",this.parameters={radius:e,tube:t,radialSegments:n,tubularSegments:s,arc:a},n=Math.floor(n),s=Math.floor(s);const l=[],u=[],h=[],p=[],m=new se,v=new se,x=new se;for(let _=0;_<=n;_++)for(let A=0;A<=s;A++){const R=A/s*a,w=_/n*Math.PI*2;v.x=(e+t*Math.cos(w))*Math.cos(R),v.y=(e+t*Math.cos(w))*Math.sin(R),v.z=t*Math.sin(w),u.push(v.x,v.y,v.z),m.x=e*Math.cos(R),m.y=e*Math.sin(R),x.subVectors(v,m).normalize(),h.push(x.x,x.y,x.z),p.push(A/s),p.push(_/n)}for(let _=1;_<=n;_++)for(let A=1;A<=s;A++){const R=(s+1)*_+A-1,w=(s+1)*(_-1)+A-1,E=(s+1)*(_-1)+A,D=(s+1)*_+A;l.push(R,w,D),l.push(w,E,D)}this.setIndex(l),this.setAttribute("position",new $t(u,3)),this.setAttribute("normal",new $t(h,3)),this.setAttribute("uv",new $t(p,2))}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new sb(e.radius,e.tube,e.radialSegments,e.tubularSegments,e.arc)}}class rb extends Mn{constructor(e=1,t=.4,n=64,s=8,a=2,l=3){super(),this.type="TorusKnotGeometry",this.parameters={radius:e,tube:t,tubularSegments:n,radialSegments:s,p:a,q:l},n=Math.floor(n),s=Math.floor(s);const u=[],h=[],p=[],m=[],v=new se,x=new se,_=new se,A=new se,R=new se,w=new se,E=new se;for(let L=0;L<=n;++L){const P=L/n*a*Math.PI*2;D(P,a,l,e,_),D(P+.01,a,l,e,A),w.subVectors(A,_),E.addVectors(A,_),R.crossVectors(w,E),E.crossVectors(R,w),R.normalize(),E.normalize();for(let G=0;G<=s;++G){const H=G/s*Math.PI*2,F=-t*Math.cos(H),X=t*Math.sin(H);v.x=_.x+(F*E.x+X*R.x),v.y=_.y+(F*E.y+X*R.y),v.z=_.z+(F*E.z+X*R.z),h.push(v.x,v.y,v.z),x.subVectors(v,_).normalize(),p.push(x.x,x.y,x.z),m.push(L/n),m.push(G/s)}}for(let L=1;L<=n;L++)for(let P=1;P<=s;P++){const G=(s+1)*(L-1)+(P-1),H=(s+1)*L+(P-1),F=(s+1)*L+P,X=(s+1)*(L-1)+P;u.push(G,H,X),u.push(H,F,X)}this.setIndex(u),this.setAttribute("position",new $t(h,3)),this.setAttribute("normal",new $t(p,3)),this.setAttribute("uv",new $t(m,2));function D(L,P,G,H,F){const X=Math.cos(L),z=Math.sin(L),k=G/P*L,ie=Math.cos(k);F.x=H*(2+ie)*.5*X,F.y=H*(2+ie)*z*.5,F.z=H*Math.sin(k)*.5}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}static fromJSON(e){return new rb(e.radius,e.tube,e.tubularSegments,e.radialSegments,e.p,e.q)}}class ab extends Mn{constructor(e=new YA(new se(-1,-1,0),new se(-1,1,0),new se(1,1,0)),t=64,n=1,s=8,a=!1){super(),this.type="TubeGeometry",this.parameters={path:e,tubularSegments:t,radius:n,radialSegments:s,closed:a};const l=e.computeFrenetFrames(t,a);this.tangents=l.tangents,this.normals=l.normals,this.binormals=l.binormals;const u=new se,h=new se,p=new st;let m=new se;const v=[],x=[],_=[],A=[];R(),this.setIndex(A),this.setAttribute("position",new $t(v,3)),this.setAttribute("normal",new $t(x,3)),this.setAttribute("uv",new $t(_,2));function R(){for(let L=0;L<t;L++)w(L);w(a===!1?t:0),D(),E()}function w(L){m=e.getPointAt(L/t,m);const P=l.normals[L],G=l.binormals[L];for(let H=0;H<=s;H++){const F=H/s*Math.PI*2,X=Math.sin(F),z=-Math.cos(F);h.x=z*P.x+X*G.x,h.y=z*P.y+X*G.y,h.z=z*P.z+X*G.z,h.normalize(),x.push(h.x,h.y,h.z),u.x=m.x+n*h.x,u.y=m.y+n*h.y,u.z=m.z+n*h.z,v.push(u.x,u.y,u.z)}}function E(){for(let L=1;L<=t;L++)for(let P=1;P<=s;P++){const G=(s+1)*(L-1)+(P-1),H=(s+1)*L+(P-1),F=(s+1)*L+P,X=(s+1)*(L-1)+P;A.push(G,H,X),A.push(H,F,X)}}function D(){for(let L=0;L<=t;L++)for(let P=0;P<=s;P++)p.x=L/t,p.y=P/s,_.push(p.x,p.y)}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}toJSON(){const e=super.toJSON();return e.path=this.parameters.path.toJSON(),e}static fromJSON(e){return new ab(new f_[e.path.type]().fromJSON(e.path),e.tubularSegments,e.radius,e.radialSegments,e.closed)}}class MI extends Mn{constructor(e=null){if(super(),this.type="WireframeGeometry",this.parameters={geometry:e},e!==null){const t=[],n=new Set,s=new se,a=new se;if(e.index!==null){const l=e.attributes.position,u=e.index;let h=e.groups;h.length===0&&(h=[{start:0,count:u.count,materialIndex:0}]);for(let p=0,m=h.length;p<m;++p){const v=h[p],x=v.start,_=v.count;for(let A=x,R=x+_;A<R;A+=3)for(let w=0;w<3;w++){const E=u.getX(A+w),D=u.getX(A+(w+1)%3);s.fromBufferAttribute(l,E),a.fromBufferAttribute(l,D),WT(s,a,n)===!0&&(t.push(s.x,s.y,s.z),t.push(a.x,a.y,a.z))}}}else{const l=e.attributes.position;for(let u=0,h=l.count/3;u<h;u++)for(let p=0;p<3;p++){const m=3*u+p,v=3*u+(p+1)%3;s.fromBufferAttribute(l,m),a.fromBufferAttribute(l,v),WT(s,a,n)===!0&&(t.push(s.x,s.y,s.z),t.push(a.x,a.y,a.z))}}this.setAttribute("position",new $t(t,3))}}copy(e){return super.copy(e),this.parameters=Object.assign({},e.parameters),this}}function WT(i,e,t){const n=`${i.x},${i.y},${i.z}-${e.x},${e.y},${e.z}`,s=`${e.x},${e.y},${e.z}-${i.x},${i.y},${i.z}`;return t.has(n)===!0||t.has(s)===!0?!1:(t.add(n),t.add(s),!0)}var XT=Object.freeze({__proto__:null,BoxGeometry:Od,CapsuleGeometry:J_,CircleGeometry:K_,ConeGeometry:Z_,CylinderGeometry:Pp,DodecahedronGeometry:Q_,EdgesGeometry:xI,ExtrudeGeometry:$_,IcosahedronGeometry:eb,LatheGeometry:mg,OctahedronGeometry:gg,PlaneGeometry:Nd,PolyhedronGeometry:nf,RingGeometry:tb,ShapeGeometry:nb,SphereGeometry:vg,TetrahedronGeometry:ib,TorusGeometry:sb,TorusKnotGeometry:rb,TubeGeometry:ab,WireframeGeometry:MI});class EI extends js{constructor(e){super(),this.isShadowMaterial=!0,this.type="ShadowMaterial",this.color=new Pt(0),this.transparent=!0,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.fog=e.fog,this}}class TI extends Zi{constructor(e){super(e),this.isRawShaderMaterial=!0,this.type="RawShaderMaterial"}}class rl extends js{constructor(e){super(),this.isMeshStandardMaterial=!0,this.type="MeshStandardMaterial",this.defines={STANDARD:""},this.color=new Pt(16777215),this.roughness=1,this.metalness=0,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.roughnessMap=null,this.metalnessMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qa,this.envMapIntensity=1,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={STANDARD:""},this.color.copy(e.color),this.roughness=e.roughness,this.metalness=e.metalness,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.roughnessMap=e.roughnessMap,this.metalnessMap=e.metalnessMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.envMapIntensity=e.envMapIntensity,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class to extends rl{constructor(e){super(),this.isMeshPhysicalMaterial=!0,this.defines={STANDARD:"",PHYSICAL:""},this.type="MeshPhysicalMaterial",this.anisotropyRotation=0,this.anisotropyMap=null,this.clearcoatMap=null,this.clearcoatRoughness=0,this.clearcoatRoughnessMap=null,this.clearcoatNormalScale=new st(1,1),this.clearcoatNormalMap=null,this.ior=1.5,Object.defineProperty(this,"reflectivity",{get:function(){return An(2.5*(this.ior-1)/(this.ior+1),0,1)},set:function(t){this.ior=(1+.4*t)/(1-.4*t)}}),this.iridescenceMap=null,this.iridescenceIOR=1.3,this.iridescenceThicknessRange=[100,400],this.iridescenceThicknessMap=null,this.sheenColor=new Pt(0),this.sheenColorMap=null,this.sheenRoughness=1,this.sheenRoughnessMap=null,this.transmissionMap=null,this.thickness=0,this.thicknessMap=null,this.attenuationDistance=1/0,this.attenuationColor=new Pt(1,1,1),this.specularIntensity=1,this.specularIntensityMap=null,this.specularColor=new Pt(1,1,1),this.specularColorMap=null,this._anisotropy=0,this._clearcoat=0,this._dispersion=0,this._iridescence=0,this._sheen=0,this._transmission=0,this.setValues(e)}get anisotropy(){return this._anisotropy}set anisotropy(e){this._anisotropy>0!=e>0&&this.version++,this._anisotropy=e}get clearcoat(){return this._clearcoat}set clearcoat(e){this._clearcoat>0!=e>0&&this.version++,this._clearcoat=e}get iridescence(){return this._iridescence}set iridescence(e){this._iridescence>0!=e>0&&this.version++,this._iridescence=e}get dispersion(){return this._dispersion}set dispersion(e){this._dispersion>0!=e>0&&this.version++,this._dispersion=e}get sheen(){return this._sheen}set sheen(e){this._sheen>0!=e>0&&this.version++,this._sheen=e}get transmission(){return this._transmission}set transmission(e){this._transmission>0!=e>0&&this.version++,this._transmission=e}copy(e){return super.copy(e),this.defines={STANDARD:"",PHYSICAL:""},this.anisotropy=e.anisotropy,this.anisotropyRotation=e.anisotropyRotation,this.anisotropyMap=e.anisotropyMap,this.clearcoat=e.clearcoat,this.clearcoatMap=e.clearcoatMap,this.clearcoatRoughness=e.clearcoatRoughness,this.clearcoatRoughnessMap=e.clearcoatRoughnessMap,this.clearcoatNormalMap=e.clearcoatNormalMap,this.clearcoatNormalScale.copy(e.clearcoatNormalScale),this.dispersion=e.dispersion,this.ior=e.ior,this.iridescence=e.iridescence,this.iridescenceMap=e.iridescenceMap,this.iridescenceIOR=e.iridescenceIOR,this.iridescenceThicknessRange=[...e.iridescenceThicknessRange],this.iridescenceThicknessMap=e.iridescenceThicknessMap,this.sheen=e.sheen,this.sheenColor.copy(e.sheenColor),this.sheenColorMap=e.sheenColorMap,this.sheenRoughness=e.sheenRoughness,this.sheenRoughnessMap=e.sheenRoughnessMap,this.transmission=e.transmission,this.transmissionMap=e.transmissionMap,this.thickness=e.thickness,this.thicknessMap=e.thicknessMap,this.attenuationDistance=e.attenuationDistance,this.attenuationColor.copy(e.attenuationColor),this.specularIntensity=e.specularIntensity,this.specularIntensityMap=e.specularIntensityMap,this.specularColor.copy(e.specularColor),this.specularColorMap=e.specularColorMap,this}}class wI extends js{constructor(e){super(),this.isMeshPhongMaterial=!0,this.type="MeshPhongMaterial",this.color=new Pt(16777215),this.specular=new Pt(1118481),this.shininess=30,this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qa,this.combine=og,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.specular.copy(e.specular),this.shininess=e.shininess,this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class CI extends js{constructor(e){super(),this.isMeshToonMaterial=!0,this.defines={TOON:""},this.type="MeshToonMaterial",this.color=new Pt(16777215),this.map=null,this.gradientMap=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.gradientMap=e.gradientMap,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.fog=e.fog,this}}class KA extends js{constructor(e){super(),this.isMeshNormalMaterial=!0,this.type="MeshNormalMaterial",this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.flatShading=!1,this.setValues(e)}copy(e){return super.copy(e),this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.flatShading=e.flatShading,this}}class RI extends js{constructor(e){super(),this.isMeshLambertMaterial=!0,this.type="MeshLambertMaterial",this.color=new Pt(16777215),this.map=null,this.lightMap=null,this.lightMapIntensity=1,this.aoMap=null,this.aoMapIntensity=1,this.emissive=new Pt(0),this.emissiveIntensity=1,this.emissiveMap=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.specularMap=null,this.alphaMap=null,this.envMap=null,this.envMapRotation=new Qa,this.combine=og,this.reflectivity=1,this.refractionRatio=.98,this.wireframe=!1,this.wireframeLinewidth=1,this.wireframeLinecap="round",this.wireframeLinejoin="round",this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.color.copy(e.color),this.map=e.map,this.lightMap=e.lightMap,this.lightMapIntensity=e.lightMapIntensity,this.aoMap=e.aoMap,this.aoMapIntensity=e.aoMapIntensity,this.emissive.copy(e.emissive),this.emissiveMap=e.emissiveMap,this.emissiveIntensity=e.emissiveIntensity,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.specularMap=e.specularMap,this.alphaMap=e.alphaMap,this.envMap=e.envMap,this.envMapRotation.copy(e.envMapRotation),this.combine=e.combine,this.reflectivity=e.reflectivity,this.refractionRatio=e.refractionRatio,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this.wireframeLinecap=e.wireframeLinecap,this.wireframeLinejoin=e.wireframeLinejoin,this.flatShading=e.flatShading,this.fog=e.fog,this}}class ob extends js{constructor(e){super(),this.isMeshDepthMaterial=!0,this.type="MeshDepthMaterial",this.depthPacking=ef,this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.wireframe=!1,this.wireframeLinewidth=1,this.setValues(e)}copy(e){return super.copy(e),this.depthPacking=e.depthPacking,this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.wireframe=e.wireframe,this.wireframeLinewidth=e.wireframeLinewidth,this}}class ZA extends js{constructor(e){super(),this.isMeshDistanceMaterial=!0,this.type="MeshDistanceMaterial",this.map=null,this.alphaMap=null,this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.setValues(e)}copy(e){return super.copy(e),this.map=e.map,this.alphaMap=e.alphaMap,this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this}}class BI extends js{constructor(e){super(),this.isMeshMatcapMaterial=!0,this.defines={MATCAP:""},this.type="MeshMatcapMaterial",this.color=new Pt(16777215),this.matcap=null,this.map=null,this.bumpMap=null,this.bumpScale=1,this.normalMap=null,this.normalMapType=tf,this.normalScale=new st(1,1),this.displacementMap=null,this.displacementScale=1,this.displacementBias=0,this.alphaMap=null,this.flatShading=!1,this.fog=!0,this.setValues(e)}copy(e){return super.copy(e),this.defines={MATCAP:""},this.color.copy(e.color),this.matcap=e.matcap,this.map=e.map,this.bumpMap=e.bumpMap,this.bumpScale=e.bumpScale,this.normalMap=e.normalMap,this.normalMapType=e.normalMapType,this.normalScale.copy(e.normalScale),this.displacementMap=e.displacementMap,this.displacementScale=e.displacementScale,this.displacementBias=e.displacementBias,this.alphaMap=e.alphaMap,this.flatShading=e.flatShading,this.fog=e.fog,this}}class II extends ta{constructor(e){super(),this.isLineDashedMaterial=!0,this.type="LineDashedMaterial",this.scale=1,this.dashSize=3,this.gapSize=1,this.setValues(e)}copy(e){return super.copy(e),this.scale=e.scale,this.dashSize=e.dashSize,this.gapSize=e.gapSize,this}}function dd(i,e){return!i||i.constructor===e?i:typeof e.BYTES_PER_ELEMENT=="number"?new e(i):Array.prototype.slice.call(i)}function DI(i){return ArrayBuffer.isView(i)&&!(i instanceof DataView)}function LI(i){function e(s,a){return i[s]-i[a]}const t=i.length,n=new Array(t);for(let s=0;s!==t;++s)n[s]=s;return n.sort(e),n}function Z1(i,e,t){const n=i.length,s=new i.constructor(n);for(let a=0,l=0;l!==n;++a){const u=t[a]*e;for(let h=0;h!==e;++h)s[l++]=i[u+h]}return s}function QA(i,e,t,n){let s=1,a=i[0];for(;a!==void 0&&a[n]===void 0;)a=i[s++];if(a===void 0)return;let l=a[n];if(l!==void 0)if(Array.isArray(l))do l=a[n],l!==void 0&&(e.push(a.time),t.push(...l)),a=i[s++];while(a!==void 0);else if(l.toArray!==void 0)do l=a[n],l!==void 0&&(e.push(a.time),l.toArray(t,t.length)),a=i[s++];while(a!==void 0);else do l=a[n],l!==void 0&&(e.push(a.time),t.push(l)),a=i[s++];while(a!==void 0)}function I2(i,e,t,n,s=30){const a=i.clone();a.name=e;const l=[];for(let h=0;h<a.tracks.length;++h){const p=a.tracks[h],m=p.getValueSize(),v=[],x=[];for(let _=0;_<p.times.length;++_){const A=p.times[_]*s;if(!(A<t||A>=n)){v.push(p.times[_]);for(let R=0;R<m;++R)x.push(p.values[_*m+R])}}v.length!==0&&(p.times=dd(v,p.times.constructor),p.values=dd(x,p.values.constructor),l.push(p))}a.tracks=l;let u=1/0;for(let h=0;h<a.tracks.length;++h)u>a.tracks[h].times[0]&&(u=a.tracks[h].times[0]);for(let h=0;h<a.tracks.length;++h)a.tracks[h].shift(-1*u);return a.resetDuration(),a}function D2(i,e=0,t=i,n=30){n<=0&&(n=30);const s=t.tracks.length,a=e/n;for(let l=0;l<s;++l){const u=t.tracks[l],h=u.ValueTypeName;if(h==="bool"||h==="string")continue;const p=i.tracks.find(function(E){return E.name===u.name&&E.ValueTypeName===h});if(p===void 0)continue;let m=0;const v=u.getValueSize();u.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(m=v/3);let x=0;const _=p.getValueSize();p.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline&&(x=_/3);const A=u.times.length-1;let R;if(a<=u.times[0]){const E=m,D=v-m;R=u.values.slice(E,D)}else if(a>=u.times[A]){const E=A*v+m,D=E+v-m;R=u.values.slice(E,D)}else{const E=u.createInterpolant(),D=m,L=v-m;E.evaluate(a),R=E.resultBuffer.slice(D,L)}h==="quaternion"&&new gr().fromArray(R).normalize().conjugate().toArray(R);const w=p.times.length;for(let E=0;E<w;++E){const D=E*_+x;if(h==="quaternion")gr.multiplyQuaternionsFlat(p.values,D,R,0,p.values,D);else{const L=_-x*2;for(let P=0;P<L;++P)p.values[D+P]-=R[P]}}}return i.blendMode=LA,i}class L2{static convertArray(e,t){return dd(e,t)}static isTypedArray(e){return DI(e)}static getKeyframeOrder(e){return LI(e)}static sortedArray(e,t,n){return Z1(e,t,n)}static flattenJSON(e,t,n,s){QA(e,t,n,s)}static subclip(e,t,n,s,a=30){return I2(e,t,n,s,a)}static makeClipAdditive(e,t=0,n=e,s=30){return D2(e,t,n,s)}}class Op{constructor(e,t,n,s){this.parameterPositions=e,this._cachedIndex=0,this.resultBuffer=s!==void 0?s:new t.constructor(n),this.sampleValues=t,this.valueSize=n,this.settings=null,this.DefaultSettings_={}}evaluate(e){const t=this.parameterPositions;let n=this._cachedIndex,s=t[n],a=t[n-1];e:{t:{let l;n:{i:if(!(e<s)){for(let u=n+2;;){if(s===void 0){if(e<a)break i;return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}if(n===u)break;if(a=s,s=t[++n],e<s)break t}l=t.length;break n}if(!(e>=a)){const u=t[1];e<u&&(n=2,a=u);for(let h=n-2;;){if(a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(n===h)break;if(s=a,a=t[--n-1],e>=a)break t}l=n,n=0;break n}break e}for(;n<l;){const u=n+l>>>1;e<t[u]?l=u:n=u+1}if(s=t[n],a=t[n-1],a===void 0)return this._cachedIndex=0,this.copySampleValue_(0);if(s===void 0)return n=t.length,this._cachedIndex=n,this.copySampleValue_(n-1)}this._cachedIndex=n,this.intervalChanged_(n,a,s)}return this.interpolate_(n,a,e,s)}getSettings_(){return this.settings||this.DefaultSettings_}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,a=e*s;for(let l=0;l!==s;++l)t[l]=n[a+l];return t}interpolate_(){throw new Error("call to abstract method")}intervalChanged_(){}}class PI extends Op{constructor(e,t,n,s){super(e,t,n,s),this._weightPrev=-0,this._offsetPrev=-0,this._weightNext=-0,this._offsetNext=-0,this.DefaultSettings_={endingStart:ud,endingEnd:ud}}intervalChanged_(e,t,n){const s=this.parameterPositions;let a=e-2,l=e+1,u=s[a],h=s[l];if(u===void 0)switch(this.getSettings_().endingStart){case fd:a=e,u=2*t-n;break;case W0:a=s.length-2,u=t+s[a]-s[a+1];break;default:a=e,u=n}if(h===void 0)switch(this.getSettings_().endingEnd){case fd:l=e,h=2*n-t;break;case W0:l=1,h=n+s[1]-s[0];break;default:l=e-1,h=t}const p=(n-t)*.5,m=this.valueSize;this._weightPrev=p/(t-u),this._weightNext=p/(h-n),this._offsetPrev=a*m,this._offsetNext=l*m}interpolate_(e,t,n,s){const a=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=e*u,p=h-u,m=this._offsetPrev,v=this._offsetNext,x=this._weightPrev,_=this._weightNext,A=(n-t)/(s-t),R=A*A,w=R*A,E=-x*w+2*x*R-x*A,D=(1+x)*w+(-1.5-2*x)*R+(-.5+x)*A+1,L=(-1-_)*w+(1.5+_)*R+.5*A,P=_*w-_*R;for(let G=0;G!==u;++G)a[G]=E*l[m+G]+D*l[p+G]+L*l[h+G]+P*l[v+G];return a}}class $A extends Op{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const a=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=e*u,p=h-u,m=(n-t)/(s-t),v=1-m;for(let x=0;x!==u;++x)a[x]=l[p+x]*v+l[h+x]*m;return a}}class OI extends Op{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e){return this.copySampleValue_(e-1)}}class Po{constructor(e,t,n,s){if(e===void 0)throw new Error("THREE.KeyframeTrack: track name is undefined");if(t===void 0||t.length===0)throw new Error("THREE.KeyframeTrack: no keyframes in track named "+e);this.name=e,this.times=dd(t,this.TimeBufferType),this.values=dd(n,this.ValueBufferType),this.setInterpolation(s||this.DefaultInterpolation)}static toJSON(e){const t=e.constructor;let n;if(t.toJSON!==this.toJSON)n=t.toJSON(e);else{n={name:e.name,times:dd(e.times,Array),values:dd(e.values,Array)};const s=e.getInterpolation();s!==e.DefaultInterpolation&&(n.interpolation=s)}return n.type=e.ValueTypeName,n}InterpolantFactoryMethodDiscrete(e){return new OI(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodLinear(e){return new $A(this.times,this.values,this.getValueSize(),e)}InterpolantFactoryMethodSmooth(e){return new PI(this.times,this.values,this.getValueSize(),e)}setInterpolation(e){let t;switch(e){case Mp:t=this.InterpolantFactoryMethodDiscrete;break;case Ep:t=this.InterpolantFactoryMethodLinear;break;case xx:t=this.InterpolantFactoryMethodSmooth;break}if(t===void 0){const n="unsupported interpolation for "+this.ValueTypeName+" keyframe track named "+this.name;if(this.createInterpolant===void 0)if(e!==this.DefaultInterpolation)this.setInterpolation(this.DefaultInterpolation);else throw new Error(n);return console.warn("THREE.KeyframeTrack:",n),this}return this.createInterpolant=t,this}getInterpolation(){switch(this.createInterpolant){case this.InterpolantFactoryMethodDiscrete:return Mp;case this.InterpolantFactoryMethodLinear:return Ep;case this.InterpolantFactoryMethodSmooth:return xx}}getValueSize(){return this.values.length/this.times.length}shift(e){if(e!==0){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]+=e}return this}scale(e){if(e!==1){const t=this.times;for(let n=0,s=t.length;n!==s;++n)t[n]*=e}return this}trim(e,t){const n=this.times,s=n.length;let a=0,l=s-1;for(;a!==s&&n[a]<e;)++a;for(;l!==-1&&n[l]>t;)--l;if(++l,a!==0||l!==s){a>=l&&(l=Math.max(l,1),a=l-1);const u=this.getValueSize();this.times=n.slice(a,l),this.values=this.values.slice(a*u,l*u)}return this}validate(){let e=!0;const t=this.getValueSize();t-Math.floor(t)!==0&&(console.error("THREE.KeyframeTrack: Invalid value size in track.",this),e=!1);const n=this.times,s=this.values,a=n.length;a===0&&(console.error("THREE.KeyframeTrack: Track is empty.",this),e=!1);let l=null;for(let u=0;u!==a;u++){const h=n[u];if(typeof h=="number"&&isNaN(h)){console.error("THREE.KeyframeTrack: Time is not a valid number.",this,u,h),e=!1;break}if(l!==null&&l>h){console.error("THREE.KeyframeTrack: Out of order keys.",this,u,h,l),e=!1;break}l=h}if(s!==void 0&&DI(s))for(let u=0,h=s.length;u!==h;++u){const p=s[u];if(isNaN(p)){console.error("THREE.KeyframeTrack: Value is not a valid number.",this,u,p),e=!1;break}}return e}optimize(){const e=this.times.slice(),t=this.values.slice(),n=this.getValueSize(),s=this.getInterpolation()===xx,a=e.length-1;let l=1;for(let u=1;u<a;++u){let h=!1;const p=e[u],m=e[u+1];if(p!==m&&(u!==1||p!==e[0]))if(s)h=!0;else{const v=u*n,x=v-n,_=v+n;for(let A=0;A!==n;++A){const R=t[v+A];if(R!==t[x+A]||R!==t[_+A]){h=!0;break}}}if(h){if(u!==l){e[l]=e[u];const v=u*n,x=l*n;for(let _=0;_!==n;++_)t[x+_]=t[v+_]}++l}}if(a>0){e[l]=e[a];for(let u=a*n,h=l*n,p=0;p!==n;++p)t[h+p]=t[u+p];++l}return l!==e.length?(this.times=e.slice(0,l),this.values=t.slice(0,l*n)):(this.times=e,this.values=t),this}clone(){const e=this.times.slice(),t=this.values.slice(),n=this.constructor,s=new n(this.name,e,t);return s.createInterpolant=this.createInterpolant,s}}Po.prototype.ValueTypeName="";Po.prototype.TimeBufferType=Float32Array;Po.prototype.ValueBufferType=Float32Array;Po.prototype.DefaultInterpolation=Ep;class Ud extends Po{constructor(e,t,n){super(e,t,n)}}Ud.prototype.ValueTypeName="bool";Ud.prototype.ValueBufferType=Array;Ud.prototype.DefaultInterpolation=Mp;Ud.prototype.InterpolantFactoryMethodLinear=void 0;Ud.prototype.InterpolantFactoryMethodSmooth=void 0;class eM extends Po{constructor(e,t,n,s){super(e,t,n,s)}}eM.prototype.ValueTypeName="color";class Rd extends Po{constructor(e,t,n,s){super(e,t,n,s)}}Rd.prototype.ValueTypeName="number";class NI extends Op{constructor(e,t,n,s){super(e,t,n,s)}interpolate_(e,t,n,s){const a=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=(n-t)/(s-t);let p=e*u;for(let m=p+u;p!==m;p+=4)gr.slerpFlat(a,0,l,p-u,l,p,h);return a}}class Bd extends Po{constructor(e,t,n,s){super(e,t,n,s)}InterpolantFactoryMethodLinear(e){return new NI(this.times,this.values,this.getValueSize(),e)}}Bd.prototype.ValueTypeName="quaternion";Bd.prototype.InterpolantFactoryMethodSmooth=void 0;class zd extends Po{constructor(e,t,n){super(e,t,n)}}zd.prototype.ValueTypeName="string";zd.prototype.ValueBufferType=Array;zd.prototype.DefaultInterpolation=Mp;zd.prototype.InterpolantFactoryMethodLinear=void 0;zd.prototype.InterpolantFactoryMethodSmooth=void 0;class Id extends Po{constructor(e,t,n,s){super(e,t,n,s)}}Id.prototype.ValueTypeName="vector";class Bp{constructor(e="",t=-1,n=[],s=z_){this.name=e,this.tracks=n,this.duration=t,this.blendMode=s,this.uuid=Za(),this.duration<0&&this.resetDuration()}static parse(e){const t=[],n=e.tracks,s=1/(e.fps||1);for(let l=0,u=n.length;l!==u;++l)t.push(O2(n[l]).scale(s));const a=new this(e.name,e.duration,t,e.blendMode);return a.uuid=e.uuid,a}static toJSON(e){const t=[],n=e.tracks,s={name:e.name,duration:e.duration,tracks:t,uuid:e.uuid,blendMode:e.blendMode};for(let a=0,l=n.length;a!==l;++a)t.push(Po.toJSON(n[a]));return s}static CreateFromMorphTargetSequence(e,t,n,s){const a=t.length,l=[];for(let u=0;u<a;u++){let h=[],p=[];h.push((u+a-1)%a,u,(u+1)%a),p.push(0,1,0);const m=LI(h);h=Z1(h,1,m),p=Z1(p,1,m),!s&&h[0]===0&&(h.push(a),p.push(p[0])),l.push(new Rd(".morphTargetInfluences["+t[u].name+"]",h,p).scale(1/n))}return new this(e,-1,l)}static findByName(e,t){let n=e;if(!Array.isArray(e)){const s=e;n=s.geometry&&s.geometry.animations||s.animations}for(let s=0;s<n.length;s++)if(n[s].name===t)return n[s];return null}static CreateClipsFromMorphTargetSequences(e,t,n){const s={},a=/^([\w-]*?)([\d]+)$/;for(let u=0,h=e.length;u<h;u++){const p=e[u],m=p.name.match(a);if(m&&m.length>1){const v=m[1];let x=s[v];x||(s[v]=x=[]),x.push(p)}}const l=[];for(const u in s)l.push(this.CreateFromMorphTargetSequence(u,s[u],t,n));return l}static parseAnimation(e,t){if(console.warn("THREE.AnimationClip: parseAnimation() is deprecated and will be removed with r185"),!e)return console.error("THREE.AnimationClip: No animation in JSONLoader data."),null;const n=function(v,x,_,A,R){if(_.length!==0){const w=[],E=[];QA(_,w,E,A),w.length!==0&&R.push(new v(x,w,E))}},s=[],a=e.name||"default",l=e.fps||30,u=e.blendMode;let h=e.length||-1;const p=e.hierarchy||[];for(let v=0;v<p.length;v++){const x=p[v].keys;if(!(!x||x.length===0))if(x[0].morphTargets){const _={};let A;for(A=0;A<x.length;A++)if(x[A].morphTargets)for(let R=0;R<x[A].morphTargets.length;R++)_[x[A].morphTargets[R]]=-1;for(const R in _){const w=[],E=[];for(let D=0;D!==x[A].morphTargets.length;++D){const L=x[A];w.push(L.time),E.push(L.morphTarget===R?1:0)}s.push(new Rd(".morphTargetInfluence["+R+"]",w,E))}h=_.length*l}else{const _=".bones["+t[v].name+"]";n(Id,_+".position",x,"pos",s),n(Bd,_+".quaternion",x,"rot",s),n(Id,_+".scale",x,"scl",s)}}return s.length===0?null:new this(a,h,s,u)}resetDuration(){const e=this.tracks;let t=0;for(let n=0,s=e.length;n!==s;++n){const a=this.tracks[n];t=Math.max(t,a.times[a.times.length-1])}return this.duration=t,this}trim(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].trim(0,this.duration);return this}validate(){let e=!0;for(let t=0;t<this.tracks.length;t++)e=e&&this.tracks[t].validate();return e}optimize(){for(let e=0;e<this.tracks.length;e++)this.tracks[e].optimize();return this}clone(){const e=[];for(let t=0;t<this.tracks.length;t++)e.push(this.tracks[t].clone());return new this.constructor(this.name,this.duration,e,this.blendMode)}toJSON(){return this.constructor.toJSON(this)}}function P2(i){switch(i.toLowerCase()){case"scalar":case"double":case"float":case"number":case"integer":return Rd;case"vector":case"vector2":case"vector3":case"vector4":return Id;case"color":return eM;case"quaternion":return Bd;case"bool":case"boolean":return Ud;case"string":return zd}throw new Error("THREE.KeyframeTrack: Unsupported typeName: "+i)}function O2(i){if(i.type===void 0)throw new Error("THREE.KeyframeTrack: track type undefined, can not parse");const e=P2(i.type);if(i.times===void 0){const t=[],n=[];QA(i.keys,t,n,"value"),i.times=t,i.values=n}return e.parse!==void 0?e.parse(i):new e(i.name,i.times,i.values,i.interpolation)}const Pc={enabled:!1,files:{},add:function(i,e){this.enabled!==!1&&(this.files[i]=e)},get:function(i){if(this.enabled!==!1)return this.files[i]},remove:function(i){delete this.files[i]},clear:function(){this.files={}}};class tM{constructor(e,t,n){const s=this;let a=!1,l=0,u=0,h;const p=[];this.onStart=void 0,this.onLoad=e,this.onProgress=t,this.onError=n,this.itemStart=function(m){u++,a===!1&&s.onStart!==void 0&&s.onStart(m,l,u),a=!0},this.itemEnd=function(m){l++,s.onProgress!==void 0&&s.onProgress(m,l,u),l===u&&(a=!1,s.onLoad!==void 0&&s.onLoad())},this.itemError=function(m){s.onError!==void 0&&s.onError(m)},this.resolveURL=function(m){return h?h(m):m},this.setURLModifier=function(m){return h=m,this},this.addHandler=function(m,v){return p.push(m,v),this},this.removeHandler=function(m){const v=p.indexOf(m);return v!==-1&&p.splice(v,2),this},this.getHandler=function(m){for(let v=0,x=p.length;v<x;v+=2){const _=p[v],A=p[v+1];if(_.global&&(_.lastIndex=0),_.test(m))return A}return null}}}const UI=new tM;class na{constructor(e){this.manager=e!==void 0?e:UI,this.crossOrigin="anonymous",this.withCredentials=!1,this.path="",this.resourcePath="",this.requestHeader={}}load(){}loadAsync(e,t){const n=this;return new Promise(function(s,a){n.load(e,s,t,a)})}parse(){}setCrossOrigin(e){return this.crossOrigin=e,this}setWithCredentials(e){return this.withCredentials=e,this}setPath(e){return this.path=e,this}setResourcePath(e){return this.resourcePath=e,this}setRequestHeader(e){return this.requestHeader=e,this}}na.DEFAULT_MATERIAL_NAME="__DEFAULT";const Ec={};class N2 extends Error{constructor(e,t){super(e),this.response=t}}class $a extends na{constructor(e){super(e),this.mimeType="",this.responseType=""}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=Pc.get(e);if(a!==void 0)return this.manager.itemStart(e),setTimeout(()=>{t&&t(a),this.manager.itemEnd(e)},0),a;if(Ec[e]!==void 0){Ec[e].push({onLoad:t,onProgress:n,onError:s});return}Ec[e]=[],Ec[e].push({onLoad:t,onProgress:n,onError:s});const l=new Request(e,{headers:new Headers(this.requestHeader),credentials:this.withCredentials?"include":"same-origin"}),u=this.mimeType,h=this.responseType;fetch(l).then(p=>{if(p.status===200||p.status===0){if(p.status===0&&console.warn("THREE.FileLoader: HTTP Status 0 received."),typeof ReadableStream>"u"||p.body===void 0||p.body.getReader===void 0)return p;const m=Ec[e],v=p.body.getReader(),x=p.headers.get("X-File-Size")||p.headers.get("Content-Length"),_=x?parseInt(x):0,A=_!==0;let R=0;const w=new ReadableStream({start(E){D();function D(){v.read().then(({done:L,value:P})=>{if(L)E.close();else{R+=P.byteLength;const G=new ProgressEvent("progress",{lengthComputable:A,loaded:R,total:_});for(let H=0,F=m.length;H<F;H++){const X=m[H];X.onProgress&&X.onProgress(G)}E.enqueue(P),D()}},L=>{E.error(L)})}}});return new Response(w)}else throw new N2(`fetch for "${p.url}" responded with ${p.status}: ${p.statusText}`,p)}).then(p=>{switch(h){case"arraybuffer":return p.arrayBuffer();case"blob":return p.blob();case"document":return p.text().then(m=>new DOMParser().parseFromString(m,u));case"json":return p.json();default:if(u==="")return p.text();{const v=/charset="?([^;"\s]*)"?/i.exec(u),x=v&&v[1]?v[1].toLowerCase():void 0,_=new TextDecoder(x);return p.arrayBuffer().then(A=>_.decode(A))}}}).then(p=>{Pc.add(e,p);const m=Ec[e];delete Ec[e];for(let v=0,x=m.length;v<x;v++){const _=m[v];_.onLoad&&_.onLoad(p)}}).catch(p=>{const m=Ec[e];if(m===void 0)throw this.manager.itemError(e),p;delete Ec[e];for(let v=0,x=m.length;v<x;v++){const _=m[v];_.onError&&_.onError(p)}this.manager.itemError(e)}).finally(()=>{this.manager.itemEnd(e)}),this.manager.itemStart(e)}setResponseType(e){return this.responseType=e,this}setMimeType(e){return this.mimeType=e,this}}class U2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=new $a(this.manager);l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(u){try{t(a.parse(JSON.parse(u)))}catch(h){s?s(h):console.error(h),a.manager.itemError(e)}},n,s)}parse(e){const t=[];for(let n=0;n<e.length;n++){const s=Bp.parse(e[n]);t.push(s)}return t}}class z2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=[],u=new X_,h=new $a(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(a.withCredentials);let p=0;function m(v){h.load(e[v],function(x){const _=a.parse(x,!0);l[v]={width:_.width,height:_.height,format:_.format,mipmaps:_.mipmaps},p+=1,p===6&&(_.mipmapCount===1&&(u.minFilter=as),u.image=l,u.format=_.format,u.needsUpdate=!0,t&&t(u))},n,s)}if(Array.isArray(e))for(let v=0,x=e.length;v<x;++v)m(v);else h.load(e,function(v){const x=a.parse(v,!0);if(x.isCubemap){const _=x.mipmaps.length/x.mipmapCount;for(let A=0;A<_;A++){l[A]={mipmaps:[]};for(let R=0;R<x.mipmapCount;R++)l[A].mipmaps.push(x.mipmaps[A*x.mipmapCount+R]),l[A].format=x.format,l[A].width=x.width,l[A].height=x.height}u.image=l}else u.image.width=x.width,u.image.height=x.height,u.mipmaps=x.mipmaps;x.mipmapCount===1&&(u.minFilter=as),u.format=x.format,u.needsUpdate=!0,t&&t(u)},n,s);return u}}class tg extends na{constructor(e){super(e)}load(e,t,n,s){this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=Pc.get(e);if(l!==void 0)return a.manager.itemStart(e),setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0),l;const u=J0("img");function h(){m(),Pc.add(e,this),t&&t(this),a.manager.itemEnd(e)}function p(v){m(),s&&s(v),a.manager.itemError(e),a.manager.itemEnd(e)}function m(){u.removeEventListener("load",h,!1),u.removeEventListener("error",p,!1)}return u.addEventListener("load",h,!1),u.addEventListener("error",p,!1),e.slice(0,5)!=="data:"&&this.crossOrigin!==void 0&&(u.crossOrigin=this.crossOrigin),a.manager.itemStart(e),u.src=e,u}}class F2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=new ug;a.colorSpace=xi;const l=new tg(this.manager);l.setCrossOrigin(this.crossOrigin),l.setPath(this.path);let u=0;function h(p){l.load(e[p],function(m){a.images[p]=m,u++,u===6&&(a.needsUpdate=!0,t&&t(a))},void 0,s)}for(let p=0;p<e.length;++p)h(p);return a}}class k2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=new jl,u=new $a(this.manager);return u.setResponseType("arraybuffer"),u.setRequestHeader(this.requestHeader),u.setPath(this.path),u.setWithCredentials(a.withCredentials),u.load(e,function(h){let p;try{p=a.parse(h)}catch(m){if(s!==void 0)s(m);else{console.error(m);return}}p.image!==void 0?l.image=p.image:p.data!==void 0&&(l.image.width=p.width,l.image.height=p.height,l.image.data=p.data),l.wrapS=p.wrapS!==void 0?p.wrapS:Ka,l.wrapT=p.wrapT!==void 0?p.wrapT:Ka,l.magFilter=p.magFilter!==void 0?p.magFilter:as,l.minFilter=p.minFilter!==void 0?p.minFilter:as,l.anisotropy=p.anisotropy!==void 0?p.anisotropy:1,p.colorSpace!==void 0&&(l.colorSpace=p.colorSpace),p.flipY!==void 0&&(l.flipY=p.flipY),p.format!==void 0&&(l.format=p.format),p.type!==void 0&&(l.type=p.type),p.mipmaps!==void 0&&(l.mipmaps=p.mipmaps,l.minFilter=Do),p.mipmapCount===1&&(l.minFilter=as),p.generateMipmaps!==void 0&&(l.generateMipmaps=p.generateMipmaps),l.needsUpdate=!0,t&&t(l,p)},n,s),l}}class zI extends na{constructor(e){super(e)}load(e,t,n,s){const a=new Ki,l=new tg(this.manager);return l.setCrossOrigin(this.crossOrigin),l.setPath(this.path),l.load(e,function(u){a.image=u,a.needsUpdate=!0,t!==void 0&&t(a)},n,s),a}}class sf extends li{constructor(e,t=1){super(),this.isLight=!0,this.type="Light",this.color=new Pt(e),this.intensity=t}dispose(){}copy(e,t){return super.copy(e,t),this.color.copy(e.color),this.intensity=e.intensity,this}toJSON(e){const t=super.toJSON(e);return t.object.color=this.color.getHex(),t.object.intensity=this.intensity,this.groundColor!==void 0&&(t.object.groundColor=this.groundColor.getHex()),this.distance!==void 0&&(t.object.distance=this.distance),this.angle!==void 0&&(t.object.angle=this.angle),this.decay!==void 0&&(t.object.decay=this.decay),this.penumbra!==void 0&&(t.object.penumbra=this.penumbra),this.shadow!==void 0&&(t.object.shadow=this.shadow.toJSON()),this.target!==void 0&&(t.object.target=this.target.uuid),t}}class FI extends sf{constructor(e,t,n){super(e,n),this.isHemisphereLight=!0,this.type="HemisphereLight",this.position.copy(li.DEFAULT_UP),this.updateMatrix(),this.groundColor=new Pt(t)}copy(e,t){return super.copy(e,t),this.groundColor.copy(e.groundColor),this}}const ZS=new dn,qT=new se,YT=new se;class nM{constructor(e){this.camera=e,this.intensity=1,this.bias=0,this.normalBias=0,this.radius=1,this.blurSamples=8,this.mapSize=new st(512,512),this.map=null,this.mapPass=null,this.matrix=new dn,this.autoUpdate=!0,this.needsUpdate=!1,this._frustum=new hg,this._frameExtents=new st(1,1),this._viewportCount=1,this._viewports=[new oi(0,0,1,1)]}getViewportCount(){return this._viewportCount}getFrustum(){return this._frustum}updateMatrices(e){const t=this.camera,n=this.matrix;qT.setFromMatrixPosition(e.matrixWorld),t.position.copy(qT),YT.setFromMatrixPosition(e.target.matrixWorld),t.lookAt(YT),t.updateMatrixWorld(),ZS.multiplyMatrices(t.projectionMatrix,t.matrixWorldInverse),this._frustum.setFromProjectionMatrix(ZS),n.set(.5,0,0,.5,0,.5,0,.5,0,0,.5,.5,0,0,0,1),n.multiply(ZS)}getViewport(e){return this._viewports[e]}getFrameExtents(){return this._frameExtents}dispose(){this.map&&this.map.dispose(),this.mapPass&&this.mapPass.dispose()}copy(e){return this.camera=e.camera.clone(),this.intensity=e.intensity,this.bias=e.bias,this.radius=e.radius,this.mapSize.copy(e.mapSize),this}clone(){return new this.constructor().copy(this)}toJSON(){const e={};return this.intensity!==1&&(e.intensity=this.intensity),this.bias!==0&&(e.bias=this.bias),this.normalBias!==0&&(e.normalBias=this.normalBias),this.radius!==1&&(e.radius=this.radius),(this.mapSize.x!==512||this.mapSize.y!==512)&&(e.mapSize=this.mapSize.toArray()),e.camera=this.camera.toJSON(!1).object,delete e.camera.matrix,e}}class H2 extends nM{constructor(){super(new Ds(50,1,.5,500)),this.isSpotLightShadow=!0,this.focus=1}updateMatrices(e){const t=this.camera,n=Tp*2*e.angle*this.focus,s=this.mapSize.width/this.mapSize.height,a=e.distance||t.far;(n!==t.fov||s!==t.aspect||a!==t.far)&&(t.fov=n,t.aspect=s,t.far=a,t.updateProjectionMatrix()),super.updateMatrices(e)}copy(e){return super.copy(e),this.focus=e.focus,this}}class iM extends sf{constructor(e,t,n=0,s=Math.PI/3,a=0,l=2){super(e,t),this.isSpotLight=!0,this.type="SpotLight",this.position.copy(li.DEFAULT_UP),this.updateMatrix(),this.target=new li,this.distance=n,this.angle=s,this.penumbra=a,this.decay=l,this.map=null,this.shadow=new H2}get power(){return this.intensity*Math.PI}set power(e){this.intensity=e/Math.PI}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.angle=e.angle,this.penumbra=e.penumbra,this.decay=e.decay,this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}const JT=new dn,_0=new se,QS=new se;class G2 extends nM{constructor(){super(new Ds(90,1,.5,500)),this.isPointLightShadow=!0,this._frameExtents=new st(4,2),this._viewportCount=6,this._viewports=[new oi(2,1,1,1),new oi(0,1,1,1),new oi(3,1,1,1),new oi(1,1,1,1),new oi(3,0,1,1),new oi(1,0,1,1)],this._cubeDirections=[new se(1,0,0),new se(-1,0,0),new se(0,0,1),new se(0,0,-1),new se(0,1,0),new se(0,-1,0)],this._cubeUps=[new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,1,0),new se(0,0,1),new se(0,0,-1)]}updateMatrices(e,t=0){const n=this.camera,s=this.matrix,a=e.distance||n.far;a!==n.far&&(n.far=a,n.updateProjectionMatrix()),_0.setFromMatrixPosition(e.matrixWorld),n.position.copy(_0),QS.copy(n.position),QS.add(this._cubeDirections[t]),n.up.copy(this._cubeUps[t]),n.lookAt(QS),n.updateMatrixWorld(),s.makeTranslation(-_0.x,-_0.y,-_0.z),JT.multiplyMatrices(n.projectionMatrix,n.matrixWorldInverse),this._frustum.setFromProjectionMatrix(JT)}}class sM extends sf{constructor(e,t,n=0,s=2){super(e,t),this.isPointLight=!0,this.type="PointLight",this.distance=n,this.decay=s,this.shadow=new G2}get power(){return this.intensity*4*Math.PI}set power(e){this.intensity=e/(4*Math.PI)}dispose(){this.shadow.dispose()}copy(e,t){return super.copy(e,t),this.distance=e.distance,this.decay=e.decay,this.shadow=e.shadow.clone(),this}}class Vc extends H_{constructor(e=-1,t=1,n=1,s=-1,a=.1,l=2e3){super(),this.isOrthographicCamera=!0,this.type="Orthogra
117phicCamera",this.zoom=1,this.view=null,this.left=e,this.right=t,this.top=n,this.bottom=s,this.near=a,this.far=l,this.updateProjectionMatrix()}copy(e,t){return super.copy(e,t),this.left=e.left,this.right=e.right,this.top=e.top,this.bottom=e.bottom,this.near=e.near,this.far=e.far,this.zoom=e.zoom,this.view=e.view===null?null:Object.assign({},e.view),this}setViewOffset(e,t,n,s,a,l){this.view===null&&(this.view={enabled:!0,fullWidth:1,fullHeight:1,offsetX:0,offsetY:0,width:1,height:1}),this.view.enabled=!0,this.view.fullWidth=e,this.view.fullHeight=t,this.view.offsetX=n,this.view.offsetY=s,this.view.width=a,this.view.height=l,this.updateProjectionMatrix()}clearViewOffset(){this.view!==null&&(this.view.enabled=!1),this.updateProjectionMatrix()}updateProjectionMatrix(){const e=(this.right-this.left)/(2*this.zoom),t=(this.top-this.bottom)/(2*this.zoom),n=(this.right+this.left)/2,s=(this.top+this.bottom)/2;let a=n-e,l=n+e,u=s+t,h=s-t;if(this.view!==null&&this.view.enabled){const p=(this.right-this.left)/this.view.fullWidth/this.zoom,m=(this.top-this.bottom)/this.view.fullHeight/this.zoom;a+=p*this.view.offsetX,l=a+p*this.view.width,u-=m*this.view.offsetY,h=u-m*this.view.height}this.projectionMatrix.makeOrthographic(a,l,u,h,this.near,this.far,this.coordinateSystem),this.projectionMatrixInverse.copy(this.projectionMatrix).invert()}toJSON(e){const t=super.toJSON(e);return t.object.zoom=this.zoom,t.object.left=this.left,t.object.right=this.right,t.object.top=this.top,t.object.bottom=this.bottom,t.object.near=this.near,t.object.far=this.far,this.view!==null&&(t.object.view=Object.assign({},this.view)),t}}class j2 extends nM{constructor(){super(new Vc(-5,5,5,-5,.5,500)),this.isDirectionalLightShadow=!0}}class rM extends sf{constructor(e,t){super(e,t),this.isDirectionalLight=!0,this.type="DirectionalLight",this.position.copy(li.DEFAULT_UP),this.updateMatrix(),this.target=new li,this.shadow=new j2}dispose(){this.shadow.dispose()}copy(e){return super.copy(e),this.target=e.target.clone(),this.shadow=e.shadow.clone(),this}}class kI extends sf{constructor(e,t){super(e,t),this.isAmbientLight=!0,this.type="AmbientLight"}}class HI extends sf{constructor(e,t,n=10,s=10){super(e,t),this.isRectAreaLight=!0,this.type="RectAreaLight",this.width=n,this.height=s}get power(){return this.intensity*this.width*this.height*Math.PI}set power(e){this.intensity=e/(this.width*this.height*Math.PI)}copy(e){return super.copy(e),this.width=e.width,this.height=e.height,this}toJSON(e){const t=super.toJSON(e);return t.object.width=this.width,t.object.height=this.height,t}}class GI{constructor(){this.isSphericalHarmonics3=!0,this.coefficients=[];for(let e=0;e<9;e++)this.coefficients.push(new se)}set(e){for(let t=0;t<9;t++)this.coefficients[t].copy(e[t]);return this}zero(){for(let e=0;e<9;e++)this.coefficients[e].set(0,0,0);return this}getAt(e,t){const n=e.x,s=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.282095),t.addScaledVector(l[1],.488603*s),t.addScaledVector(l[2],.488603*a),t.addScaledVector(l[3],.488603*n),t.addScaledVector(l[4],1.092548*(n*s)),t.addScaledVector(l[5],1.092548*(s*a)),t.addScaledVector(l[6],.315392*(3*a*a-1)),t.addScaledVector(l[7],1.092548*(n*a)),t.addScaledVector(l[8],.546274*(n*n-s*s)),t}getIrradianceAt(e,t){const n=e.x,s=e.y,a=e.z,l=this.coefficients;return t.copy(l[0]).multiplyScalar(.886227),t.addScaledVector(l[1],2*.511664*s),t.addScaledVector(l[2],2*.511664*a),t.addScaledVector(l[3],2*.511664*n),t.addScaledVector(l[4],2*.429043*n*s),t.addScaledVector(l[5],2*.429043*s*a),t.addScaledVector(l[6],.743125*a*a-.247708),t.addScaledVector(l[7],2*.429043*n*a),t.addScaledVector(l[8],.429043*(n*n-s*s)),t}add(e){for(let t=0;t<9;t++)this.coefficients[t].add(e.coefficients[t]);return this}addScaledSH(e,t){for(let n=0;n<9;n++)this.coefficients[n].addScaledVector(e.coefficients[n],t);return this}scale(e){for(let t=0;t<9;t++)this.coefficients[t].multiplyScalar(e);return this}lerp(e,t){for(let n=0;n<9;n++)this.coefficients[n].lerp(e.coefficients[n],t);return this}equals(e){for(let t=0;t<9;t++)if(!this.coefficients[t].equals(e.coefficients[t]))return!1;return!0}copy(e){return this.set(e.coefficients)}clone(){return new this.constructor().copy(this)}fromArray(e,t=0){const n=this.coefficients;for(let s=0;s<9;s++)n[s].fromArray(e,t+s*3);return this}toArray(e=[],t=0){const n=this.coefficients;for(let s=0;s<9;s++)n[s].toArray(e,t+s*3);return e}static getBasisAt(e,t){const n=e.x,s=e.y,a=e.z;t[0]=.282095,t[1]=.488603*s,t[2]=.488603*a,t[3]=.488603*n,t[4]=1.092548*n*s,t[5]=1.092548*s*a,t[6]=.315392*(3*a*a-1),t[7]=1.092548*n*a,t[8]=.546274*(n*n-s*s)}}class jI extends sf{constructor(e=new GI,t=1){super(void 0,t),this.isLightProbe=!0,this.sh=e}copy(e){return super.copy(e),this.sh.copy(e.sh),this}fromJSON(e){return this.intensity=e.intensity,this.sh.fromArray(e.sh),this}toJSON(e){const t=super.toJSON(e);return t.object.sh=this.sh.toArray(),t}}class lb extends na{constructor(e){super(e),this.textures={}}load(e,t,n,s){const a=this,l=new $a(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(u){try{t(a.parse(JSON.parse(u)))}catch(h){s?s(h):console.error(h),a.manager.itemError(e)}},n,s)}parse(e){const t=this.textures;function n(a){return t[a]===void 0&&console.warn("THREE.MaterialLoader: Undefined texture",a),t[a]}const s=this.createMaterialFromType(e.type);if(e.uuid!==void 0&&(s.uuid=e.uuid),e.name!==void 0&&(s.name=e.name),e.color!==void 0&&s.color!==void 0&&s.color.setHex(e.color),e.roughness!==void 0&&(s.roughness=e.roughness),e.metalness!==void 0&&(s.metalness=e.metalness),e.sheen!==void 0&&(s.sheen=e.sheen),e.sheenColor!==void 0&&(s.sheenColor=new Pt().setHex(e.sheenColor)),e.sheenRoughness!==void 0&&(s.sheenRoughness=e.sheenRoughness),e.emissive!==void 0&&s.emissive!==void 0&&s.emissive.setHex(e.emissive),e.specular!==void 0&&s.specular!==void 0&&s.specular.setHex(e.specular),e.specularIntensity!==void 0&&(s.specularIntensity=e.specularIntensity),e.specularColor!==void 0&&s.specularColor!==void 0&&s.specularColor.setHex(e.specularColor),e.shininess!==void 0&&(s.shininess=e.shininess),e.clearcoat!==void 0&&(s.clearcoat=e.clearcoat),e.clearcoatRoughness!==void 0&&(s.clearcoatRoughness=e.clearcoatRoughness),e.dispersion!==void 0&&(s.dispersion=e.dispersion),e.iridescence!==void 0&&(s.iridescence=e.iridescence),e.iridescenceIOR!==void 0&&(s.iridescenceIOR=e.iridescenceIOR),e.iridescenceThicknessRange!==void 0&&(s.iridescenceThicknessRange=e.iridescenceThicknessRange),e.transmission!==void 0&&(s.transmission=e.transmission),e.thickness!==void 0&&(s.thickness=e.thickness),e.attenuationDistance!==void 0&&(s.attenuationDistance=e.attenuationDistance),e.attenuationColor!==void 0&&s.attenuationColor!==void 0&&s.attenuationColor.setHex(e.attenuationColor),e.anisotropy!==void 0&&(s.anisotropy=e.anisotropy),e.anisotropyRotation!==void 0&&(s.anisotropyRotation=e.anisotropyRotation),e.fog!==void 0&&(s.fog=e.fog),e.flatShading!==void 0&&(s.flatShading=e.flatShading),e.blending!==void 0&&(s.blending=e.blending),e.combine!==void 0&&(s.combine=e.combine),e.side!==void 0&&(s.side=e.side),e.shadowSide!==void 0&&(s.shadowSide=e.shadowSide),e.opacity!==void 0&&(s.op
vendor: 48,156 bytes, line 117
117acity=e.opacity),e.transparent!==void 0&&(s.transparent=e.transparent),e.alphaTest!==void 0&&(s.alphaTest=e.alphaTest),e.alphaHash!==void 0&&(s.alphaHash=e.alphaHash),e.depthFunc!==void 0&&(s.depthFunc=e.depthFunc),e.depthTest!==void 0&&(s.depthTest=e.depthTest),e.depthWrite!==void 0&&(s.depthWrite=e.depthWrite),e.colorWrite!==void 0&&(s.colorWrite=e.colorWrite),e.blendSrc!==void 0&&(s.blendSrc=e.blendSrc),e.blendDst!==void 0&&(s.blendDst=e.blendDst),e.blendEquation!==void 0&&(s.blendEquation=e.blendEquation),e.blendSrcAlpha!==void 0&&(s.blendSrcAlpha=e.blendSrcAlpha),e.blendDstAlpha!==void 0&&(s.blendDstAlpha=e.blendDstAlpha),e.blendEquationAlpha!==void 0&&(s.blendEquationAlpha=e.blendEquationAlpha),e.blendColor!==void 0&&s.blendColor!==void 0&&s.blendColor.setHex(e.blendColor),e.blendAlpha!==void 0&&(s.blendAlpha=e.blendAlpha),e.stencilWriteMask!==void 0&&(s.stencilWriteMask=e.stencilWriteMask),e.stencilFunc!==void 0&&(s.stencilFunc=e.stencilFunc),e.stencilRef!==void 0&&(s.stencilRef=e.stencilRef),e.stencilFuncMask!==void 0&&(s.stencilFuncMask=e.stencilFuncMask),e.stencilFail!==void 0&&(s.stencilFail=e.stencilFail),e.stencilZFail!==void 0&&(s.stencilZFail=e.stencilZFail),e.stencilZPass!==void 0&&(s.stencilZPass=e.stencilZPass),e.stencilWrite!==void 0&&(s.stencilWrite=e.stencilWrite),e.wireframe!==void 0&&(s.wireframe=e.wireframe),e.wireframeLinewidth!==void 0&&(s.wireframeLinewidth=e.wireframeLinewidth),e.wireframeLinecap!==void 0&&(s.wireframeLinecap=e.wireframeLinecap),e.wireframeLinejoin!==void 0&&(s.wireframeLinejoin=e.wireframeLinejoin),e.rotation!==void 0&&(s.rotation=e.rotation),e.linewidth!==void 0&&(s.linewidth=e.linewidth),e.dashSize!==void 0&&(s.dashSize=e.dashSize),e.gapSize!==void 0&&(s.gapSize=e.gapSize),e.scale!==void 0&&(s.scale=e.scale),e.polygonOffset!==void 0&&(s.polygonOffset=e.polygonOffset),e.polygonOffsetFactor!==void 0&&(s.polygonOffsetFactor=e.polygonOffsetFactor),e.polygonOffsetUnits!==void 0&&(s.polygonOffsetUnits=e.polygonOffsetUnits),e.dithering!==void 0&&(s.dithering=e.dithering),e.alphaToCoverage!==void 0&&(s.alphaToCoverage=e.alphaToCoverage),e.premultipliedAlpha!==void 0&&(s.premultipliedAlpha=e.premultipliedAlpha),e.forceSinglePass!==void 0&&(s.forceSinglePass=e.forceSinglePass),e.visible!==void 0&&(s.visible=e.visible),e.toneMapped!==void 0&&(s.toneMapped=e.toneMapped),e.userData!==void 0&&(s.userData=e.userData),e.vertexColors!==void 0&&(typeof e.vertexColors=="number"?s.vertexColors=e.vertexColors>0:s.vertexColors=e.vertexColors),e.uniforms!==void 0)for(const a in e.uniforms){const l=e.uniforms[a];switch(s.uniforms[a]={},l.type){case"t":s.uniforms[a].value=n(l.value);break;case"c":s.uniforms[a].value=new Pt().setHex(l.value);break;case"v2":s.uniforms[a].value=new st().fromArray(l.value);break;case"v3":s.uniforms[a].value=new se().fromArray(l.value);break;case"v4":s.uniforms[a].value=new oi().fromArray(l.value);break;case"m3":s.uniforms[a].value=new Cn().fromArray(l.value);break;case"m4":s.uniforms[a].value=new dn().fromArray(l.value);break;default:s.uniforms[a].value=l.value}}if(e.defines!==void 0&&(s.defines=e.defines),e.vertexShader!==void 0&&(s.vertexShader=e.vertexShader),e.fragmentShader!==void 0&&(s.fragmentShader=e.fragmentShader),e.glslVersion!==void 0&&(s.glslVersion=e.glslVersion),e.extensions!==void 0)for(const a in e.extensions)s.extensions[a]=e.extensions[a];if(e.lights!==void 0&&(s.lights=e.lights),e.clipping!==void 0&&(s.clipping=e.clipping),e.size!==void 0&&(s.size=e.size),e.sizeAttenuation!==void 0&&(s.sizeAttenuation=e.sizeAttenuation),e.map!==void 0&&(s.map=n(e.map)),e.matcap!==void 0&&(s.matcap=n(e.matcap)),e.alphaMap!==void 0&&(s.alphaMap=n(e.alphaMap)),e.bumpMap!==void 0&&(s.bumpMap=n(e.bumpMap)),e.bumpScale!==void 0&&(s.bumpScale=e.bumpScale),e.normalMap!==void 0&&(s.normalMap=n(e.normalMap)),e.normalMapType!==void 0&&(s.normalMapType=e.normalMapType),e.normalScale!==void 0){let a=e.normalScale;Array.isArray(a)===!1&&(a=[a,a]),s.normalScale=new st().fromArray(a)}return e.displacementMap!==void 0&&(s.displacementMap=n(e.displacementMap)),e.displacementScale!==void 0&&(s.displacementScale=e.displacementScale),e.displacementBias!==void 0&&(s.displacementBias=e.displacementBias),e.roughnessMap!==void 0&&(s.roughnessMap=n(e.roughnessMap)),e.metalnessMap!==void 0&&(s.metalnessMap=n(e.metalnessMap)),e.emissiveMap!==void 0&&(s.emissiveMap=n(e.emissiveMap)),e.emissiveIntensity!==void 0&&(s.emissiveIntensity=e.emissiveIntensity),e.specularMap!==void 0&&(s.specularMap=n(e.specularMap)),e.specularIntensityMap!==void 0&&(s.specularIntensityMap=n(e.specularIntensityMap)),e.specularColorMap!==void 0&&(s.specularColorMap=n(e.specularColorMap)),e.envMap!==void 0&&(s.envMap=n(e.envMap)),e.envMapRotation!==void 0&&s.envMapRotation.fromArray(e.envMapRotation),e.envMapIntensity!==void 0&&(s.envMapIntensity=e.envMapIntensity),e.reflectivity!==void 0&&(s.reflectivity=e.reflectivity),e.refractionRatio!==void 0&&(s.refractionRatio=e.refractionRatio),e.lightMap!==void 0&&(s.lightMap=n(e.lightMap)),e.lightMapIntensity!==void 0&&(s.lightMapIntensity=e.lightMapIntensity),e.aoMap!==void 0&&(s.aoMap=n(e.aoMap)),e.aoMapIntensity!==void 0&&(s.aoMapIntensity=e.aoMapIntensity),e.gradientMap!==void 0&&(s.gradientMap=n(e.gradientMap)),e.clearcoatMap!==void 0&&(s.clearcoatMap=n(e.clearcoatMap)),e.clearcoatRoughnessMap!==void 0&&(s.clearcoatRoughnessMap=n(e.clearcoatRoughnessMap)),e.clearcoatNormalMap!==void 0&&(s.clearcoatNormalMap=n(e.clearcoatNormalMap)),e.clearcoatNormalScale!==void 0&&(s.clearcoatNormalScale=new st().fromArray(e.clearcoatNormalScale)),e.iridescenceMap!==void 0&&(s.iridescenceMap=n(e.iridescenceMap)),e.iridescenceThicknessMap!==void 0&&(s.iridescenceThicknessMap=n(e.iridescenceThicknessMap)),e.transmissionMap!==void 0&&(s.transmissionMap=n(e.transmissionMap)),e.thicknessMap!==void 0&&(s.thicknessMap=n(e.thicknessMap)),e.anisotropyMap!==void 0&&(s.anisotropyMap=n(e.anisotropyMap)),e.sheenColorMap!==void 0&&(s.sheenColorMap=n(e.sheenColorMap)),e.sheenRoughnessMap!==void 0&&(s.sheenRoughnessMap=n(e.sheenRoughnessMap)),s}setTextures(e){return this.textures=e,this}createMaterialFromType(e){return lb.createMaterialFromType(e)}static createMaterialFromType(e){const t={ShadowMaterial:EI,SpriteMaterial:FA,RawShaderMaterial:TI,ShaderMaterial:Zi,PointsMaterial:W_,MeshPhysicalMaterial:to,MeshStandardMaterial:rl,MeshPhongMaterial:wI,MeshToonMaterial:CI,MeshNormalMaterial:KA,MeshLambertMaterial:RI,MeshDepthMaterial:ob,MeshDistanceMaterial:ZA,MeshBasicMaterial:Kr,MeshMatcapMaterial:BI,LineDashedMaterial:II,LineBasicMaterial:ta,Material:js};return new t[e]}}class Yu{static extractUrlBase(e){const t=e.lastIndexOf("/");return t===-1?"./":e.slice(0,t+1)}static resolveURL(e,t){return typeof e!="string"||e===""?"":(/^https?:\/\//i.test(t)&&/^\//.test(e)&&(t=t.replace(/(^https?:\/\/[^\/]+).*/i,"$1")),/^(https?:)?\/\//i.test(e)||/^data:.*,.*$/i.test(e)||/^blob:.*$/i.test(e)?e:t+e)}}class VI extends Mn{constructor(){super(),this.isInstancedBufferGeometry=!0,this.type="InstancedBufferGeometry",this.instanceCount=1/0}copy(e){return super.copy(e),this.instanceCount=e.instanceCount,this}toJSON(){const e=super.toJSON();return e.instanceCount=this.instanceCount,e.isInstancedBufferGeometry=!0,e}}class WI extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=new $a(a.manager);l.setPath(a.path),l.setRequestHeader(a.requestHeader),l.setWithCredentials(a.withCredentials),l.load(e,function(u){try{t(a.parse(JSON.parse(u)))}catch(h){s?s(h):console.error(h),a.manager.itemError(e)}},n,s)}parse(e){const t={},n={};function s(_,A){if(t[A]!==void 0)return t[A];const w=_.interleavedBuffers[A],E=a(_,w.buffer),D=fp(w.type,E),L=new fg(D,w.stride);return L.uuid=w.uuid,t[A]=L,L}function a(_,A){if(n[A]!==void 0)return n[A];const w=_.arrayBuffers[A],E=new Uint32Array(w).buffer;return n[A]=E,E}const l=e.isInstancedBufferGeometry?new VI:new Mn,u=e.data.index;if(u!==void 0){const _=fp(u.type,u.array);l.setIndex(new ci(_,1))}const h=e.data.attributes;for(const _ in h){const A=h[_];let R;if(A.isInterleavedBufferAttribute){const w=s(e.data,A.data);R=new Qu(w,A.itemSize,A.offset,A.normalized)}else{const w=fp(A.type,A.array),E=A.isInstancedBufferAttribute?wd:ci;R=new E(w,A.itemSize,A.normalized)}A.name!==void 0&&(R.name=A.name),A.usage!==void 0&&R.setUsage(A.usage),l.setAttribute(_,R)}const p=e.data.morphAttributes;if(p)for(const _ in p){const A=p[_],R=[];for(let w=0,E=A.length;w<E;w++){const D=A[w];let L;if(D.isInterleavedBufferAttribute){const P=s(e.data,D.data);L=new Qu(P,D.itemSize,D.offset,D.normalized)}else{const P=fp(D.type,D.array);L=new ci(P,D.itemSize,D.normalized)}D.name!==void 0&&(L.name=D.name),R.push(L)}l.morphAttributes[_]=R}e.data.morphTargetsRelative&&(l.morphTargetsRelative=!0);const v=e.data.groups||e.data.drawcalls||e.data.offsets;if(v!==void 0)for(let _=0,A=v.length;_!==A;++_){const R=v[_];l.addGroup(R.start,R.count,R.materialIndex)}const x=e.data.boundingSphere;if(x!==void 0){const _=new se;x.center!==void 0&&_.fromArray(x.center),l.boundingSphere=new Dr(_,x.radius)}return e.name&&(l.name=e.name),e.userData&&(l.userData=e.userData),l}}class V2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=this.path===""?Yu.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||l;const u=new $a(this.manager);u.setPath(this.path),u.setRequestHeader(this.requestHeader),u.setWithCredentials(this.withCredentials),u.load(e,function(h){let p=null;try{p=JSON.parse(h)}catch(v){s!==void 0&&s(v),console.error("THREE:ObjectLoader: Can't parse "+e+".",v.message);return}const m=p.metadata;if(m===void 0||m.type===void 0||m.type.toLowerCase()==="geometry"){s!==void 0&&s(new Error("THREE.ObjectLoader: Can't load "+e)),console.error("THREE.ObjectLoader: Can't load "+e);return}a.parse(p,t)},n,s)}async loadAsync(e,t){const n=this,s=this.path===""?Yu.extractUrlBase(e):this.path;this.resourcePath=this.resourcePath||s;const a=new $a(this.manager);a.setPath(this.path),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials);const l=await a.loadAsync(e,t),u=JSON.parse(l),h=u.metadata;if(h===void 0||h.type===void 0||h.type.toLowerCase()==="geometry")throw new Error("THREE.ObjectLoader: Can't load "+e);return await n.parseAsync(u)}parse(e,t){const n=this.parseAnimations(e.animations),s=this.parseShapes(e.shapes),a=this.parseGeometries(e.geometries,s),l=this.parseImages(e.images,function(){t!==void 0&&t(p)}),u=this.parseTextures(e.textures,l),h=this.parseMaterials(e.materials,u),p=this.parseObject(e.object,a,h,u,n),m=this.parseSkeletons(e.skeletons,p);if(this.bindSkeletons(p,m),this.bindLightTargets(p),t!==void 0){let v=!1;for(const x in l)if(l[x].data instanceof HTMLImageElement){v=!0;break}v===!1&&t(p)}return p}async parseAsync(e){const t=this.parseAnimations(e.animations),n=this.parseShapes(e.shapes),s=this.parseGeometries(e.geometries,n),a=await this.parseImagesAsync(e.images),l=this.parseTextures(e.textures,a),u=this.parseMaterials(e.materials,l),h=this.parseObject(e.object,s,u,l,t),p=this.parseSkeletons(e.skeletons,h);return this.bindSkeletons(h,p),this.bindLightTargets(h),h}parseShapes(e){const t={};if(e!==void 0)for(let n=0,s=e.length;n<s;n++){const a=new yd().fromJSON(e[n]);t[a.uuid]=a}return t}parseSkeletons(e,t){const n={},s={};if(t.traverse(function(a){a.isBone&&(s[a.uuid]=a)}),e!==void 0)for(let a=0,l=e.length;a<l;a++){const u=new dg().fromJSON(e[a],s);n[u.uuid]=u}return n}parseGeometries(e,t){const n={};if(e!==void 0){const s=new WI;for(let a=0,l=e.length;a<l;a++){let u;const h=e[a];switch(h.type){case"BufferGeometry":case"InstancedBufferGeometry":u=s.parse(h);break;default:h.type in XT?u=XT[h.type].fromJSON(h,t):console.warn(`THREE.ObjectLoader: Unsupported geometry type "${h.type}"`)}u.uuid=h.uuid,h.name!==void 0&&(u.name=h.name),h.userData!==void 0&&(u.userData=h.userData),n[h.uuid]=u}}return n}parseMaterials(e,t){const n={},s={};if(e!==void 0){const a=new lb;a.setTextures(t);for(let l=0,u=e.length;l<u;l++){const h=e[l];n[h.uuid]===void 0&&(n[h.uuid]=a.parse(h)),s[h.uuid]=n[h.uuid]}}return s}parseAnimations(e){const t={};if(e!==void 0)for(let n=0;n<e.length;n++){const s=e[n],a=Bp.parse(s);t[a.uuid]=a}return t}parseImages(e,t){const n=this,s={};let a;function l(h){return n.manager.itemStart(h),a.load(h,function(){n.manager.itemEnd(h)},void 0,function(){n.manager.itemError(h),n.manager.itemEnd(h)})}function u(h){if(typeof h=="string"){const p=h,m=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(p)?p:n.resourcePath+p;return l(m)}else return h.data?{data:fp(h.type,h.data),width:h.width,height:h.height}:null}if(e!==void 0&&e.length>0){const h=new tM(t);a=new tg(h),a.setCrossOrigin(this.crossOrigin);for(let p=0,m=e.length;p<m;p++){const v=e[p],x=v.url;if(Array.isArray(x)){const _=[];for(let A=0,R=x.length;A<R;A++){const w=x[A],E=u(w);E!==null&&(E instanceof HTMLImageElement?_.push(E):_.push(new jl(E.data,E.width,E.height)))}s[v.uuid]=new Wu(_)}else{const _=u(v.url);s[v.uuid]=new Wu(_)}}}return s}async parseImagesAsync(e){const t=this,n={};let s;async function a(l){if(typeof l=="string"){const u=l,h=/^(\/\/)|([a-z]+:(\/\/)?)/i.test(u)?u:t.resourcePath+u;return await s.loadAsync(h)}else return l.data?{data:fp(l.type,l.data),width:l.width,height:l.height}:null}if(e!==void 0&&e.length>0){s=new tg(this.manager),s.setCrossOrigin(this.crossOrigin);for(let l=0,u=e.length;l<u;l++){const h=e[l],p=h.url;if(Array.isArray(p)){const m=[];for(let v=0,x=p.length;v<x;v++){const _=p[v],A=await a(_);A!==null&&(A instanceof HTMLImageElement?m.push(A):m.push(new jl(A.data,A.width,A.height)))}n[h.uuid]=new Wu(m)}else{const m=await a(h.url);n[h.uuid]=new Wu(m)}}}return n}parseTextures(e,t){function n(a,l){return typeof a=="number"?a:(console.warn("THREE.ObjectLoader.parseTexture: Constant should be in numeric form.",a),l[a])}const s={};if(e!==void 0)for(let a=0,l=e.length;a<l;a++){const u=e[a];u.image===void 0&&console.warn('THREE.ObjectLoader: No "image" specified for',u.uuid),t[u.image]===void 0&&console.warn("THREE.ObjectLoader: Undefined image",u.image);const h=t[u.image],p=h.data;let m;Array.isArray(p)?(m=new ug,p.length===6&&(m.needsUpdate=!0)):(p&&p.data?m=new jl:m=new Ki,p&&(m.needsUpdate=!0)),m.source=h,m.uuid=u.uuid,u.name!==void 0&&(m.name=u.name),u.mapping!==void 0&&(m.mapping=n(u.mapping,W2)),u.channel!==void 0&&(m.channel=u.channel),u.offset!==void 0&&m.offset.fromArray(u.offset),u.repeat!==void 0&&m.repeat.fromArray(u.repeat),u.center!==void 0&&m.center.fromArray(u.center),u.rotation!==void 0&&(m.rotation=u.rotation),u.wrap!==void 0&&(m.wrapS=n(u.wrap[0],KT),m.wrapT=n(u.wrap[1],KT)),u.format!==void 0&&(m.format=u.format),u.internalFormat!==void 0&&(m.internalFormat=u.internalFormat),u.type!==void 0&&(m.type=u.type),u.colorSpace!==void 0&&(m.colorSpace=u.colorSpace),u.minFilter!==void 0&&(m.minFilter=n(u.minFilter,ZT)),u.magFilter!==void 0&&(m.magFilter=n(u.magFilter,ZT)),u.anisotropy!==void 0&&(m.anisotropy=u.anisotropy),u.flipY!==void 0&&(m.flipY=u.flipY),u.generateMipmaps!==void 0&&(m.generateMipmaps=u.generateMipmaps),u.premultiplyAlpha!==void 0&&(m.premultiplyAlpha=u.premultiplyAlpha),u.unpackAlignment!==void 0&&(m.unpackAlignment=u.unpackAlignment),u.compareFunction!==void 0&&(m.compareFunction=u.compareFunction),u.userData!==void 0&&(m.userData=u.userData),s[u.uuid]=m}return s}parseObject(e,t,n,s,a){let l;function u(x){return t[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined geometry",x),t[x]}function h(x){if(x!==void 0){if(Array.isArray(x)){const _=[];for(let A=0,R=x.length;A<R;A++){const w=x[A];n[w]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",w),_.push(n[w])}return _}return n[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined material",x),n[x]}}function p(x){return s[x]===void 0&&console.warn("THREE.ObjectLoader: Undefined texture",x),s[x]}let m,v;switch(e.type){case"Scene":l=new K0,e.background!==void 0&&(Number.isInteger(e.background)?l.background=new Pt(e.background):l.background=p(e.background)),e.environment!==void 0&&(l.environment=p(e.environment)),e.fog!==void 0&&(e.fog.type==="Fog"?l.fog=new j_(e.fog.color,e.fog.near,e.fog.far):e.fog.type==="FogExp2"&&(l.fog=new G_(e.fog.color,e.fog.density)),e.fog.name!==""&&(l.fog.name=e.fog.name)),e.backgroundBlurriness!==void 0&&(l.backgroundBlurriness=e.backgroundBlurriness),e.backgroundIntensity!==void 0&&(l.backgroundIntensity=e.backgroundIntensity),e.backgroundRotation!==void 0&&l.backgroundRotation.fromArray(e.backgroundRotation),e.environmentIntensity!==void 0&&(l.environmentIntensity=e.environmentIntensity),e.environmentRotation!==void 0&&l.environmentRotation.fromArray(e.environmentRotation);break;case"PerspectiveCamera":l=new Ds(e.fov,e.aspect,e.near,e.far),e.focus!==void 0&&(l.focus=e.focus),e.zoom!==void 0&&(l.zoom=e.zoom),e.filmGauge!==void 0&&(l.filmGauge=e.filmGauge),e.filmOffset!==void 0&&(l.filmOffset=e.filmOffset),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"OrthographicCamera":l=new Vc(e.left,e.right,e.top,e.bottom,e.near,e.far),e.zoom!==void 0&&(l.zoom=e.zoom),e.view!==void 0&&(l.view=Object.assign({},e.view));break;case"AmbientLight":l=new kI(e.color,e.intensity);break;case"DirectionalLight":l=new rM(e.color,e.intensity),l.target=e.target||"";break;case"PointLight":l=new sM(e.color,e.intensity,e.distance,e.decay);break;case"RectAreaLight":l=new HI(e.color,e.intensity,e.width,e.height);break;case"SpotLight":l=new iM(e.color,e.intensity,e.distance,e.angle,e.penumbra,e.decay),l.target=e.target||"";break;case"HemisphereLight":l=new FI(e.color,e.groundColor,e.intensity);break;case"LightProbe":l=new jI().fromJSON(e);break;case"SkinnedMesh":m=u(e.geometry),v=h(e.material),l=new kA(m,v),e.bindMode!==void 0&&(l.bindMode=e.bindMode),e.bindMatrix!==void 0&&l.bindMatrix.fromArray(e.bindMatrix),e.skeleton!==void 0&&(l.skeleton=e.skeleton);break;case"Mesh":m=u(e.geometry),v=h(e.material),l=new hs(m,v);break;case"InstancedMesh":m=u(e.geometry),v=h(e.material);const x=e.count,_=e.instanceMatrix,A=e.instanceColor;l=new HA(m,v,x),l.instanceMatrix=new wd(new Float32Array(_.array),16),A!==void 0&&(l.instanceColor=new wd(new Float32Array(A.array),A.itemSize));break;case"BatchedMesh":m=u(e.geometry),v=h(e.material),l=new dI(e.maxInstanceCount,e.maxVertexCount,e.maxIndexCount,v),l.geometry=m,l.perObjectFrustumCulled=e.perObjectFrustumCulled,l.sortObjects=e.sortObjects,l._drawRanges=e.drawRanges,l._reservedRanges=e.reservedRanges,l._visibility=e.visibility,l._active=e.active,l._bounds=e.bounds.map(R=>{const w=new $r;w.min.fromArray(R.boxMin),w.max.fromArray(R.boxMax);const E=new Dr;return E.radius=R.sphereRadius,E.center.fromArray(R.sphereCenter),{boxInitialized:R.boxInitialized,box:w,sphereInitialized:R.sphereInitialized,sphere:E}}),l._maxInstanceCount=e.maxInstanceCount,l._maxVertexCount=e.maxVertexCount,l._maxIndexCount=e.maxIndexCount,l._geometryInitialized=e.geometryInitialized,l._geometryCount=e.geometryCount,l._matricesTexture=p(e.matricesTexture.uuid),e.colorsTexture!==void 0&&(l._colorsTexture=p(e.colorsTexture.uuid));break;case"LOD":l=new fI;break;case"Line":l=new Hc(u(e.geometry),h(e.material));break;case"LineLoop":l=new GA(u(e.geometry),h(e.material));break;case"LineSegments":l=new ul(u(e.geometry),h(e.material));break;case"PointCloud":case"Points":l=new jA(u(e.geometry),h(e.material));break;case"Sprite":l=new uI(h(e.material));break;case"Group":l=new Lc;break;case"Bone":l=new V_;break;default:l=new li}if(l.uuid=e.uuid,e.name!==void 0&&(l.name=e.name),e.matrix!==void 0?(l.matrix.fromArray(e.matrix),e.matrixAutoUpdate!==void 0&&(l.matrixAutoUpdate=e.matrixAutoUpdate),l.matrixAutoUpdate&&l.matrix.decompose(l.position,l.quaternion,l.scale)):(e.position!==void 0&&l.position.fromArray(e.position),e.rotation!==void 0&&l.rotation.fromArray(e.rotation),e.quaternion!==void 0&&l.quaternion.fromArray(e.quaternion),e.scale!==void 0&&l.scale.fromArray(e.scale)),e.up!==void 0&&l.up.fromArray(e.up),e.castShadow!==void 0&&(l.castShadow=e.castShadow),e.receiveShadow!==void 0&&(l.receiveShadow=e.receiveShadow),e.shadow&&(e.shadow.intensity!==void 0&&(l.shadow.intensity=e.shadow.intensity),e.shadow.bias!==void 0&&(l.shadow.bias=e.shadow.bias),e.shadow.normalBias!==void 0&&(l.shadow.normalBias=e.shadow.normalBias),e.shadow.radius!==void 0&&(l.shadow.radius=e.shadow.radius),e.shadow.mapSize!==void 0&&l.shadow.mapSize.fromArray(e.shadow.mapSize),e.shadow.camera!==void 0&&(l.shadow.camera=this.parseObject(e.shadow.camera))),e.visible!==void 0&&(l.visible=e.visible),e.frustumCulled!==void 0&&(l.frustumCulled=e.frustumCulled),e.renderOrder!==void 0&&(l.renderOrder=e.renderOrder),e.userData!==void 0&&(l.userData=e.userData),e.layers!==void 0&&(l.layers.mask=e.layers),e.children!==void 0){const x=e.children;for(let _=0;_<x.length;_++)l.add(this.parseObject(x[_],t,n,s,a))}if(e.animations!==void 0){const x=e.animations;for(let _=0;_<x.length;_++){const A=x[_];l.animations.push(a[A])}}if(e.type==="LOD"){e.autoUpdate!==void 0&&(l.autoUpdate=e.autoUpdate);const x=e.levels;for(let _=0;_<x.length;_++){const A=x[_],R=l.getObjectByProperty("uuid",A.object);R!==void 0&&l.addLevel(R,A.distance,A.hysteresis)}}return l}bindSkeletons(e,t){Object.keys(t).length!==0&&e.traverse(function(n){if(n.isSkinnedMesh===!0&&n.skeleton!==void 0){const s=t[n.skeleton];s===void 0?console.warn("THREE.ObjectLoader: No skeleton found with UUID:",n.skeleton):n.bind(s,n.bindMatrix)}})}bindLightTargets(e){e.traverse(function(t){if(t.isDirectionalLight||t.isSpotLight){const n=t.target,s=e.getObjectByProperty("uuid",n);s!==void 0?t.target=s:t.target=new li}})}}const W2={UVMapping:B_,CubeReflectionMapping:Fc,CubeRefractionMapping:Ku,EquirectangularReflectionMapping:j0,EquirectangularRefractionMapping:V0,CubeUVReflectionMapping:Dp},KT={RepeatWrapping:Zu,ClampToEdgeWrapping:Ka,MirroredRepeatWrapping:bp},ZT={NearestFilter:Ls,NearestMipmapNearestFilter:I_,NearestMipmapLinearFilter:cd,LinearFilter:as,LinearMipmapNearestFilter:gp,LinearMipmapLinearFilter:Do};class XI extends na{constructor(e){super(e),this.isImageBitmapLoader=!0,typeof createImageBitmap>"u"&&console.warn("THREE.ImageBitmapLoader: createImageBitmap() not supported."),typeof fetch>"u"&&console.warn("THREE.ImageBitmapLoader: fetch() not supported."),this.options={premultiplyAlpha:"none"}}setOptions(e){return this.options=e,this}load(e,t,n,s){e===void 0&&(e=""),this.path!==void 0&&(e=this.path+e),e=this.manager.resolveURL(e);const a=this,l=Pc.get(e);if(l!==void 0){if(a.manager.itemStart(e),l.then){l.then(p=>{t&&t(p),a.manager.itemEnd(e)}).catch(p=>{s&&s(p)});return}return setTimeout(function(){t&&t(l),a.manager.itemEnd(e)},0),l}const u={};u.credentials=this.crossOrigin==="anonymous"?"same-origin":"include",u.headers=this.requestHeader;const h=fetch(e,u).then(function(p){return p.blob()}).then(function(p){return createImageBitmap(p,Object.assign(a.options,{colorSpaceConversion:"none"}))}).then(function(p){return Pc.add(e,p),t&&t(p),a.manager.itemEnd(e),p}).catch(function(p){s&&s(p),Pc.remove(e),a.manager.itemError(e),a.manager.itemEnd(e)});Pc.add(e,h),a.manager.itemStart(e)}}let Jy,aM=class{static getContext(){return Jy===void 0&&(Jy=new(window.AudioContext||window.webkitAudioContext)),Jy}static setContext(e){Jy=e}};class X2 extends na{constructor(e){super(e)}load(e,t,n,s){const a=this,l=new $a(this.manager);l.setResponseType("arraybuffer"),l.setPath(this.path),l.setRequestHeader(this.requestHeader),l.setWithCredentials(this.withCredentials),l.load(e,function(h){try{const p=h.slice(0);aM.getContext().decodeAudioData(p,function(v){t(v)}).catch(u)}catch(p){u(p)}},n,s);function u(h){s?s(h):console.error(h),a.manager.itemError(e)}}}const QT=new dn,$T=new dn,Zf=new dn;class q2{constructor(){this.type="StereoCamera",this.aspect=1,this.eyeSep=.064,this.cameraL=new Ds,this.cameraL.layers.enable(1),this.cameraL.matrixAutoUpdate=!1,this.cameraR=new Ds,this.cameraR.layers.enable(2),this.cameraR.matrixAutoUpdate=!1,this._cache={focus:null,fov:null,aspect:null,near:null,far:null,zoom:null,eyeSep:null}}update(e){const t=this._cache;if(t.focus!==e.focus||t.fov!==e.fov||t.aspect!==e.aspect*this.aspect||t.near!==e.near||t.far!==e.far||t.zoom!==e.zoom||t.eyeSep!==this.eyeSep){t.focus=e.focus,t.fov=e.fov,t.aspect=e.aspect*this.aspect,t.near=e.near,t.far=e.far,t.zoom=e.zoom,t.eyeSep=this.eyeSep,Zf.copy(e.projectionMatrix);const s=t.eyeSep/2,a=s*t.near/t.focus,l=t.near*Math.tan(vd*t.fov*.5)/t.zoom;let u,h;$T.elements[12]=-s,QT.elements[12]=s,u=-l*t.aspect+a,h=l*t.aspect+a,Zf.elements[0]=2*t.near/(h-u),Zf.elements[8]=(h+u)/(h-u),this.cameraL.projectionMatrix.copy(Zf),u=-l*t.aspect-a,h=l*t.aspect-a,Zf.elements[0]=2*t.near/(h-u),Zf.elements[8]=(h+u)/(h-u),this.cameraR.projectionMatrix.copy(Zf)}this.cameraL.matrixWorld.copy(e.matrixWorld).multiply($T),this.cameraR.matrixWorld.copy(e.matrixWorld).multiply(QT)}}class qI extends Ds{constructor(e=[]){super(),this.isArrayCamera=!0,this.cameras=e,this.index=0}}class oM{constructor(e=!0){this.autoStart=e,this.startTime=0,this.oldTime=0,this.elapsedTime=0,this.running=!1}start(){this.startTime=ew(),this.oldTime=this.startTime,this.elapsedTime=0,this.running=!0}stop(){this.getElapsedTime(),this.running=!1,this.autoStart=!1}getElapsedTime(){return this.getDelta(),this.elapsedTime}getDelta(){let e=0;if(this.autoStart&&!this.running)return this.start(),0;if(this.running){const t=ew();e=(t-this.oldTime)/1e3,this.oldTime=t,this.elapsedTime+=e}return e}}function ew(){return performance.now()}const Qf=new se,tw=new gr,Y2=new se,$f=new se;class J2 extends li{constructor(){super(),this.type="AudioListener",this.context=aM.getContext(),this.gain=this.context.createGain(),this.gain.connect(this.context.destination),this.filter=null,this.timeDelta=0,this._clock=new oM}getInput(){return this.gain}removeFilter(){return this.filter!==null&&(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination),this.gain.connect(this.context.destination),this.filter=null),this}getFilter(){return this.filter}setFilter(e){return this.filter!==null?(this.gain.disconnect(this.filter),this.filter.disconnect(this.context.destination)):this.gain.disconnect(this.context.destination),this.filter=e,this.gain.connect(this.filter),this.filter.connect(this.context.destination),this}getMasterVolume(){return this.gain.gain.value}setMasterVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}updateMatrixWorld(e){super.updateMatrixWorld(e);const t=this.context.listener,n=this.up;if(this.timeDelta=this._clock.getDelta(),this.matrixWorld.decompose(Qf,tw,Y2),$f.set(0,0,-1).applyQuaternion(tw),t.positionX){const s=this.context.currentTime+this.timeDelta;t.positionX.linearRampToValueAtTime(Qf.x,s),t.positionY.linearRampToValueAtTime(Qf.y,s),t.positionZ.linearRampToValueAtTime(Qf.z,s),t.forwardX.linearRampToValueAtTime($f.x,s),t.forwardY.linearRampToValueAtTime($f.y,s),t.forwardZ.linearRampToValueAtTime($f.z,s),t.upX.linearRampToValueAtTime(n.x,s),t.upY.linearRampToValueAtTime(n.y,s),t.upZ.linearRampToValueAtTime(n.z,s)}else t.setPosition(Qf.x,Qf.y,Qf.z),t.setOrientation($f.x,$f.y,$f.z,n.x,n.y,n.z)}}class YI extends li{constructor(e){super(),this.type="Audio",this.listener=e,this.context=e.context,this.gain=this.context.createGain(),this.gain.connect(e.getInput()),this.autoplay=!1,this.buffer=null,this.detune=0,this.loop=!1,this.loopStart=0,this.loopEnd=0,this.offset=0,this.duration=void 0,this.playbackRate=1,this.isPlaying=!1,this.hasPlaybackControl=!0,this.source=null,this.sourceType="empty",this._startedAt=0,this._progress=0,this._connected=!1,this.filters=[]}getOutput(){return this.gain}setNodeSource(e){return this.hasPlaybackControl=!1,this.sourceType="audioNode",this.source=e,this.connect(),this}setMediaElementSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaNode",this.source=this.context.createMediaElementSource(e),this.connect(),this}setMediaStreamSource(e){return this.hasPlaybackControl=!1,this.sourceType="mediaStreamNode",this.source=this.context.createMediaStreamSource(e),this.connect(),this}setBuffer(e){return this.buffer=e,this.sourceType="buffer",this.autoplay&&this.play(),this}play(e=0){if(this.isPlaying===!0){console.warn("THREE.Audio: Audio is already playing.");return}if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}this._startedAt=this.context.currentTime+e;const t=this.context.createBufferSource();return t.buffer=this.buffer,t.loop=this.loop,t.loopStart=this.loopStart,t.loopEnd=this.loopEnd,t.onended=this.onEnded.bind(this),t.start(this._startedAt,this._progress+this.offset,this.duration),this.isPlaying=!0,this.source=t,this.setDetune(this.detune),this.setPlaybackRate(this.playbackRate),this.connect()}pause(){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.isPlaying===!0&&(this._progress+=Math.max(this.context.currentTime-this._startedAt,0)*this.playbackRate,this.loop===!0&&(this._progress=this._progress%(this.duration||this.buffer.duration)),this.source.stop(),this.source.onended=null,this.isPlaying=!1),this}stop(e=0){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this._progress=0,this.source!==null&&(this.source.stop(this.context.currentTime+e),this.source.onended=null),this.isPlaying=!1,this}connect(){if(this.filters.length>0){this.source.connect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].connect(this.filters[e]);this.filters[this.filters.length-1].connect(this.getOutput())}else this.source.connect(this.getOutput());return this._connected=!0,this}disconnect(){if(this._connected!==!1){if(this.filters.length>0){this.source.disconnect(this.filters[0]);for(let e=1,t=this.filters.length;e<t;e++)this.filters[e-1].disconnect(this.filters[e]);this.filters[this.filters.length-1].disconnect(this.getOutput())}else this.source.disconnect(this.getOutput());return this._connected=!1,this}}getFilters(){return this.filters}setFilters(e){return e||(e=[]),this._connected===!0?(this.disconnect(),this.filters=e.slice(),this.connect()):this.filters=e.slice(),this}setDetune(e){return this.detune=e,this.isPlaying===!0&&this.source.detune!==void 0&&this.source.detune.setTargetAtTime(this.detune,this.context.currentTime,.01),this}getDetune(){return this.detune}getFilter(){return this.getFilters()[0]}setFilter(e){return this.setFilters(e?[e]:[])}setPlaybackRate(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.playbackRate=e,this.isPlaying===!0&&this.source.playbackRate.setTargetAtTime(this.playbackRate,this.context.currentTime,.01),this}getPlaybackRate(){return this.playbackRate}onEnded(){this.isPlaying=!1,this._progress=0}getLoop(){return this.hasPlaybackControl===!1?(console.warn("THREE.Audio: this Audio has no playback control."),!1):this.loop}setLoop(e){if(this.hasPlaybackControl===!1){console.warn("THREE.Audio: this Audio has no playback control.");return}return this.loop=e,this.isPlaying===!0&&(this.source.loop=this.loop),this}setLoopStart(e){return this.loopStart=e,this}setLoopEnd(e){return this.loopEnd=e,this}getVolume(){return this.gain.gain.value}setVolume(e){return this.gain.gain.setTargetAtTime(e,this.context.currentTime,.01),this}copy(e,t){return super.copy(e,t),e.sourceType!=="buffer"?(console.warn("THREE.Audio: Audio source type cannot be copied."),this):(this.autoplay=e.autoplay,this.buffer=e.buffer,this.detune=e.detune,this.loop=e.loop,this.loopStart=e.loopStart,this.loopEnd=e.loopEnd,this.offset=e.offset,this.duration=e.duration,this.playbackRate=e.playbackRate,this.hasPlaybackControl=e.hasPlaybackControl,this.sourceType=e.sourceType,this.filters=e.filters.slice(),this)}clone(e){return new this.constructor(this.listener).copy(this,e)}}const ed=new se,nw=new gr,K2=new se,td=new se;class Z2 extends YI{constructor(e){super(e),this.panner=this.context.createPanner(),this.panner.panningModel="HRTF",this.panner.connect(this.gain)}connect(){return super.connect(),this.panner.connect(this.gain),this}disconnect(){return super.disconnect(),this.panner.disconnect(this.gain),this}getOutput(){return this.panner}getRefDistance(){return this.panner.refDistance}setRefDistance(e){return this.panner.refDistance=e,this}getRolloffFactor(){return this.panner.rolloffFactor}setRolloffFactor(e){return this.panner.rolloffFactor=e,this}getDistanceModel(){return this.panner.distanceModel}setDistanceModel(e){return this.panner.distanceModel=e,this}getMaxDistance(){return this.panner.maxDistance}setMaxDistance(e){return this.panner.maxDistance=e,this}setDirectionalCone(e,t,n){return this.panner.coneInnerAngle=e,this.panner.coneOuterAngle=t,this.panner.coneOuterGain=n,this}updateMatrixWorld(e){if(super.updateMatrixWorld(e),this.hasPlaybackControl===!0&&this.isPlaying===!1)return;this.matrixWorld.decompose(ed,nw,K2),td.set(0,0,1).applyQuaternion(nw);const t=this.panner;if(t.positionX){const n=this.context.currentTime+this.listener.timeDelta;t.positionX.linearRampToValueAtTime(ed.x,n),t.positionY.linearRampToValueAtTime(ed.y,n),t.positionZ.linearRampToValueAtTime(ed.z,n),t.orientationX.linearRampToValueAtTime(td.x,n),t.orientationY.linearRampToValueAtTime(td.y,n),t.orientationZ.linearRampToValueAtTime(td.z,n)}else t.setPosition(ed.x,ed.y,ed.z),t.setOrientation(td.x,td.y,td.z)}}class Q2{constructor(e,t=2048){this.analyser=e.context.createAnalyser(),this.analyser.fftSize=t,this.data=new Uint8Array(this.analyser.frequencyBinCount),e.getOutput().connect(this.analyser)}getFrequencyData(){return this.analyser.getByteFrequencyData(this.data),this.data}getAverageFrequency(){let e=0;const t=this.getFrequencyData();for(let n=0;n<t.length;n++)e+=t[n];return e/t.length}}class JI{constructor(e,t,n){this.binding=e,this.valueSize=n;let s,a,l;switch(t){case"quaternion":s=this._slerp,a=this._slerpAdditive,l=this._setAdditiveIdentityQuaternion,this.buffer=new Float64Array(n*6),this._workIndex=5;break;case"string":case"bool":s=this._select,a=this._select,l=this._setAdditiveIdentityOther,this.buffer=new Array(n*5);break;default:s=this._lerp,a=this._lerpAdditive,l=this._setAdditiveIdentityNumeric,this.buffer=new Float64Array(n*5)}this._mixBufferRegion=s,this._mixBufferRegionAdditive=a,this._setIdentity=l,this._origIndex=3,this._addIndex=4,this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,this.useCount=0,this.referenceCount=0}accumulate(e,t){const n=this.buffer,s=this.valueSize,a=e*s+s;let l=this.cumulativeWeight;if(l===0){for(let u=0;u!==s;++u)n[a+u]=n[u];l=t}else{l+=t;const u=t/l;this._mixBufferRegion(n,a,0,u,s)}this.cumulativeWeight=l}accumulateAdditive(e){const t=this.buffer,n=this.valueSize,s=n*this._addIndex;this.cumulativeWeightAdditive===0&&this._setIdentity(),this._mixBufferRegionAdditive(t,s,0,e,n),this.cumulativeWeightAdditive+=e}apply(e){const t=this.valueSize,n=this.buffer,s=e*t+t,a=this.cumulativeWeight,l=this.cumulativeWeightAdditive,u=this.binding;if(this.cumulativeWeight=0,this.cumulativeWeightAdditive=0,a<1){const h=t*this._origIndex;this._mixBufferRegion(n,s,h,1-a,t)}l>0&&this._mixBufferRegionAdditive(n,s,this._addIndex*t,1,t);for(let h=t,p=t+t;h!==p;++h)if(n[h]!==n[h+t]){u.setValue(n,s);break}}saveOriginalState(){const e=this.binding,t=this.buffer,n=this.valueSize,s=n*this._origIndex;e.getValue(t,s);for(let a=n,l=s;a!==l;++a)t[a]=t[s+a%n];this._setIdentity(),this.cumulativeWeight=0,this.cumulativeWeightAdditive=0}restoreOriginalState(){const e=this.valueSize*3;this.binding.setValue(this.buffer,e)}_setAdditiveIdentityNumeric(){const e=this._addIndex*this.valueSize,t=e+this.valueSize;for(let n=e;n<t;n++)this.buffer[n]=0}_setAdditiveIdentityQuaternion(){this._setAdditiveIdentityNumeric(),this.buffer[this._addIndex*this.valueSize+3]=1}_setAdditiveIdentityOther(){const e=this._origIndex*this.valueSize,t=this._addIndex*this.valueSize;for(let n=0;n<this.valueSize;n++)this.buffer[t+n]=this.buffer[e+n]}_select(e,t,n,s,a){if(s>=.5)for(let l=0;l!==a;++l)e[t+l]=e[n+l]}_slerp(e,t,n,s){gr.slerpFlat(e,t,e,t,e,n,s)}_slerpAdditive(e,t,n,s,a){const l=this._workIndex*a;gr.multiplyQuaternionsFlat(e,l,e,t,e,n),gr.slerpFlat(e,t,e,t,e,l,s)}_lerp(e,t,n,s,a){const l=1-s;for(let u=0;u!==a;++u){const h=t+u;e[h]=e[h]*l+e[n+u]*s}}_lerpAdditive(e,t,n,s,a){for(let l=0;l!==a;++l){const u=t+l;e[u]=e[u]+e[n+l]*s}}}const lM="\\[\\]\\.:\\/",$2=new RegExp("["+lM+"]","g"),cM="[^"+lM+"]",eN="[^"+lM.replace("\\.","")+"]",tN=/((?:WC+[\/:])*)/.source.replace("WC",cM),nN=/(WCOD+)?/.source.replace("WCOD",eN),iN=/(?:\.(WC+)(?:\[(.+)\])?)?/.source.replace("WC",cM),sN=/\.(WC+)(?:\[(.+)\])?/.source.replace("WC",cM),rN=new RegExp("^"+tN+nN+iN+sN+"$"),aN=["material","materials","bones","map"];class oN{constructor(e,t,n){const s=n||di.parseTrackName(t);this._targetGroup=e,this._bindings=e.subscribe_(t,s)}getValue(e,t){this.bind();const n=this._targetGroup.nCachedObjects_,s=this._bindings[n];s!==void 0&&s.getValue(e,t)}setValue(e,t){const n=this._bindings;for(let s=this._targetGroup.nCachedObjects_,a=n.length;s!==a;++s)n[s].setValue(e,t)}bind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].bind()}unbind(){const e=this._bindings;for(let t=this._targetGroup.nCachedObjects_,n=e.length;t!==n;++t)e[t].unbind()}}class di{constructor(e,t,n){this.path=t,this.parsedPath=n||di.parseTrackName(t),this.node=di.findNode(e,this.parsedPath.nodeName),this.rootNode=e,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}static create(e,t,n){return e&&e.isAnimationObjectGroup?new di.Composite(e,t,n):new di(e,t,n)}static sanitizeNodeName(e){return e.replace(/\s/g,"_").replace($2,"")}static parseTrackName(e){const t=rN.exec(e);if(t===null)throw new Error("PropertyBinding: Cannot parse trackName: "+e);const n={nodeName:t[2],objectName:t[3],objectIndex:t[4],propertyName:t[5],propertyIndex:t[6]},s=n.nodeName&&n.nodeName.lastIndexOf(".");if(s!==void 0&&s!==-1){const a=n.nodeName.substring(s+1);aN.indexOf(a)!==-1&&(n.nodeName=n.nodeName.substring(0,s),n.objectName=a)}if(n.propertyName===null||n.propertyName.length===0)throw new Error("PropertyBinding: can not parse propertyName from trackName: "+e);return n}static findNode(e,t){if(t===void 0||t===""||t==="."||t===-1||t===e.name||t===e.uuid)return e;if(e.skeleton){const n=e.skeleton.getBoneByName(t);if(n!==void 0)return n}if(e.children){const n=function(a){for(let l=0;l<a.length;l++){const u=a[l];if(u.name===t||u.uuid===t)return u;const h=n(u.children);if(h)return h}return null},s=n(e.children);if(s)return s}return null}_getValue_unavailable(){}_setValue_unavailable(){}_getValue_direct(e,t){e[t]=this.targetObject[this.propertyName]}_getValue_array(e,t){const n=this.resolvedProperty;for(let s=0,a=n.length;s!==a;++s)e[t++]=n[s]}_getValue_arrayElement(e,t){e[t]=this.resolvedProperty[this.propertyIndex]}_getValue_toArray(e,t){this.resolvedProperty.toArray(e,t)}_setValue_direct(e,t){this.targetObject[this.propertyName]=e[t]}_setValue_direct_setNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.needsUpdate=!0}_setValue_direct_setMatrixWorldNeedsUpdate(e,t){this.targetObject[this.propertyName]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_array(e,t){const n=this.resolvedProperty;for(let s=0,a=n.length;s!==a;++s)n[s]=e[t++]}_setValue_array_setNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,a=n.length;s!==a;++s)n[s]=e[t++];this.targetObject.needsUpdate=!0}_setValue_array_setMatrixWorldNeedsUpdate(e,t){const n=this.resolvedProperty;for(let s=0,a=n.length;s!==a;++s)n[s]=e[t++];this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_arrayElement(e,t){this.resolvedProperty[this.propertyIndex]=e[t]}_setValue_arrayElement_setNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.needsUpdate=!0}_setValue_arrayElement_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty[this.propertyIndex]=e[t],this.targetObject.matrixWorldNeedsUpdate=!0}_setValue_fromArray(e,t){this.resolvedProperty.fromArray(e,t)}_setValue_fromArray_setNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.needsUpdate=!0}_setValue_fromArray_setMatrixWorldNeedsUpdate(e,t){this.resolvedProperty.fromArray(e,t),this.targetObject.matrixWorldNeedsUpdate=!0}_getValue_unbound(e,t){this.bind(),this.getValue(e,t)}_setValue_unbound(e,t){this.bind(),this.setValue(e,t)}bind(){let e=this.node;const t=this.parsedPath,n=t.objectName,s=t.propertyName;let a=t.propertyIndex;if(e||(e=di.findNode(this.rootNode,t.nodeName),this.node=e),this.getValue=this._getValue_unavailable,this.setValue=this._setValue_unavailable,!e){console.warn("THREE.PropertyBinding: No target node found for track: "+this.path+".");return}if(n){let p=t.objectIndex;switch(n){case"materials":if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.materials){console.error("THREE.PropertyBinding: Can not bind to material.materials as node.material does not have a materials array.",this);return}e=e.material.materials;break;case"bones":if(!e.skeleton){console.error("THREE.PropertyBinding: Can not bind to bones as node does not have a skeleton.",this);return}e=e.skeleton.bones;for(let m=0;m<e.length;m++)if(e[m].name===p){p=m;break}break;case"map":if("map"in e){e=e.map;break}if(!e.material){console.error("THREE.PropertyBinding: Can not bind to material as node does not have a material.",this);return}if(!e.material.map){console.error("THREE.PropertyBinding: Can not bind to material.map as node.material does not have a map.",this);return}e=e.material.map;break;default:if(e[n]===void 0){console.error("THREE.PropertyBinding: Can not bind to objectName of node undefined.",this);return}e=e[n]}if(p!==void 0){if(e[p]===void 0){console.error("THREE.PropertyBinding: Trying to bind to objectIndex of objectName, but is undefined.",this,e);return}e=e[p]}}const l=e[s];if(l===void 0){const p=t.nodeName;console.error("THREE.PropertyBinding: Trying to update property for track: "+p+"."+s+" but it wasn't found.",e);return}let u=this.Versioning.None;this.targetObject=e,e.isMaterial===!0?u=this.Versioning.NeedsUpdate:e.isObject3D===!0&&(u=this.Versioning.MatrixWorldNeedsUpdate);let h=this.BindingType.Direct;if(a!==void 0){if(s==="morphTargetInfluences"){if(!e.geometry){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.",this);return}if(!e.geometry.morphAttributes){console.error("THREE.PropertyBinding: Can not bind to morphTargetInfluences because node does not have a geometry.morphAttributes.",this);return}e.morphTargetDictionary[a]!==void 0&&(a=e.morphTargetDictionary[a])}h=this.BindingType.ArrayElement,this.resolvedProperty=l,this.propertyIndex=a}else l.fromArray!==void 0&&l.toArray!==void 0?(h=this.BindingType.HasFromToArray,this.resolvedProperty=l):Array.isArray(l)?(h=this.BindingType.EntireArray,this.resolvedProperty=l):this.propertyName=s;this.getValue=this.GetterByBindingType[h],this.setValue=this.SetterByBindingTypeAndVersioning[h][u]}unbind(){this.node=null,this.getValue=this._getValue_unbound,this.setValue=this._setValue_unbound}}di.Composite=oN;di.prototype.BindingType={Direct:0,EntireArray:1,ArrayElement:2,HasFromToArray:3};di.prototype.Versioning={None:0,NeedsUpdate:1,MatrixWorldNeedsUpdate:2};di.prototype.GetterByBindingType=[di.prototype._getValue_direct,di.prototype._getValue_array,di.prototype._getValue_arrayElement,di.prototype._getValue_toArray];di.prototype.SetterByBindingTypeAndVersioning=[[di.prototype._setValue_direct,di.prototype._setValue_direct_setNeedsUpdate,di.prototype._setValue_direct_setMatrixWorldNeedsUpdate],[di.prototype._setValue_array,di.prototype._setValue_array_setNeedsUpdate,di.prototype._setValue_array_setMatrixWorldNeedsUpdate],[di.prototype._setValue_arrayElement,di.prototype._setValue_arrayElement_setNeedsUpdate,di.prototype._setValue_arrayElement_setMatrixWorldNeedsUpdate],[di.prototype._setValue_fromArray,di.prototype._setValue_fromArray_setNeedsUpdate,di.prototype._setValue_fromArray_setMatrixWorldNeedsUpdate]];class lN{constructor(){this.isAnimationObjectGroup=!0,this.uuid=Za(),this._objects=Array.prototype.slice.call(arguments),this.nCachedObjects_=0;const e={};this._indicesByUUID=e;for(let n=0,s=arguments.length;n!==s;++n)e[arguments[n].uuid]=n;this._paths=[],this._parsedPaths=[],this._bindings=[],this._bindingsIndicesByPath={};const t=this;this.stats={objects:{get total(){return t._objects.length},get inUse(){return this.total-t.nCachedObjects_}},get bindingsPerObject(){return t._bindings.length}}}add(){const e=this._objects,t=this._indicesByUUID,n=this._paths,s=this._parsedPaths,a=this._bindings,l=a.length;let u,h=e.length,p=this.nCachedObjects_;for(let m=0,v=arguments.length;m!==v;++m){const x=arguments[m],_=x.uuid;let A=t[_];if(A===void 0){A=h++,t[_]=A,e.push(x);for(let R=0,w=l;R!==w;++R)a[R].push(new di(x,n[R],s[R]))}else if(A<p){u=e[A];const R=--p,w=e[R];t[w.uuid]=A,e[A]=w,t[_]=R,e[R]=x;for(let E=0,D=l;E!==D;++E){const L=a[E],P=L[R];let G=L[A];L[A]=P,G===void 0&&(G=new di(x,n[E],s[E])),L[R]=G}}else e[A]!==u&&console.error("THREE.AnimationObjectGroup: Different objects with the same UUID detected. Clean the caches or recreate your infrastructure when reloading scenes.")}this.nCachedObjects_=p}remove(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,s=n.length;let a=this.nCachedObjects_;for(let l=0,u=arguments.length;l!==u;++l){const h=arguments[l],p=h.uuid,m=t[p];if(m!==void 0&&m>=a){const v=a++,x=e[v];t[x.uuid]=m,e[m]=x,t[p]=v,e[v]=h;for(let _=0,A=s;_!==A;++_){const R=n[_],w=R[v],E=R[m];R[m]=w,R[v]=E}}}this.nCachedObjects_=a}uncache(){const e=this._objects,t=this._indicesByUUID,n=this._bindings,s=n.length;let a=this.nCachedObjects_,l=e.length;for(let u=0,h=arguments.length;u!==h;++u){const p=arguments[u],m=p.uuid,v=t[m];if(v!==void 0)if(delete t[m],v<a){const x=--a,_=e[x],A=--l,R=e[A];t[_.uuid]=v,e[v]=_,t[R.uuid]=x,e[x]=R,e.pop();for(let w=0,E=s;w!==E;++w){const D=n[w],L=D[x],P=D[A];D[v]=L,D[x]=P,D.pop()}}else{const x=--l,_=e[x];x>0&&(t[_.uuid]=v),e[v]=_,e.pop();for(let A=0,R=s;A!==R;++A){const w=n[A];w[v]=w[x],w.pop()}}}this.nCachedObjects_=a}subscribe_(e,t){const n=this._bindingsIndicesByPath;let s=n[e];const a=this._bindings;if(s!==void 0)return a[s];const l=this._paths,u=this._parsedPaths,h=this._objects,p=h.length,m=this.nCachedObjects_,v=new Array(p);s=a.length,n[e]=s,l.push(e),u.push(t),a.push(v);for(let x=m,_=h.length;x!==_;++x){const A=h[x];v[x]=new di(A,e,t)}return v}unsubscribe_(e){const t=this._bindingsIndicesByPath,n=t[e];if(n!==void 0){const s=this._paths,a=this._parsedPaths,l=this._bindings,u=l.length-1,h=l[u],p=e[u];t[p]=n,l[n]=h,l.pop(),a[n]=a[u],a.pop(),s[n]=s[u],s.pop()}}}class KI{constructor(e,t,n=null,s=t.blendMode){this._mixer=e,this._clip=t,this._localRoot=n,this.blendMode=s;const a=t.tracks,l=a.length,u=new Array(l),h={endingStart:ud,endingEnd:ud};for(let p=0;p!==l;++p){const m=a[p].createInterpolant(null);u[p]=m,m.settings=h}this._interpolantSettings=h,this._interpolants=u,this._propertyBindings=new Array(l),this._cacheIndex=null,this._byClipCacheIndex=null,this._timeScaleInterpolant=null,this._weightInterpolant=null,this.loop=jB,this._loopCount=-1,this._startTime=null,this.time=0,this.timeScale=1,this._effectiveTimeScale=1,this.weight=1,this._effectiveWeight=1,this.repetitions=1/0,this.paused=!1,this.enabled=!0,this.clampWhenFinished=!1,this.zeroSlopeAtStart=!0,this.zeroSlopeAtEnd=!0}play(){return this._mixer._activateAction(this),this}stop(){return this._mixer._deactivateAction(this),this.reset()}reset(){return this.paused=!1,this.enabled=!0,this.time=0,this._loopCount=-1,this._startTime=null,this.stopFading().stopWarping()}isRunning(){return this.enabled&&!this.paused&&this.timeScale!==0&&this._startTime===null&&this._mixer._isActiveAction(this)}isScheduled(){return this._mixer._isActiveAction(this)}startAt(e){return this._startTime=e,this}setLoop(e,t){return this.loop=e,this.repetitions=t,this}setEffectiveWeight(e){return this.weight=e,this._effectiveWeight=this.enabled?e:0,this.stopFading()}getEffectiveWeight(){return this._effectiveWeight}
vendor: 5,869 bytes, line 117
117fadeIn(e){return this._scheduleFading(e,0,1)}fadeOut(e){return this._scheduleFading(e,1,0)}crossFadeFrom(e,t,n=!1){if(e.fadeOut(t),this.fadeIn(t),n===!0){const s=this._clip.duration,a=e._clip.duration,l=a/s,u=s/a;e.warp(1,l,t),this.warp(u,1,t)}return this}crossFadeTo(e,t,n=!1){return e.crossFadeFrom(this,t,n)}stopFading(){const e=this._weightInterpolant;return e!==null&&(this._weightInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}setEffectiveTimeScale(e){return this.timeScale=e,this._effectiveTimeScale=this.paused?0:e,this.stopWarping()}getEffectiveTimeScale(){return this._effectiveTimeScale}setDuration(e){return this.timeScale=this._clip.duration/e,this.stopWarping()}syncWith(e){return this.time=e.time,this.timeScale=e.timeScale,this.stopWarping()}halt(e){return this.warp(this._effectiveTimeScale,0,e)}warp(e,t,n){const s=this._mixer,a=s.time,l=this.timeScale;let u=this._timeScaleInterpolant;u===null&&(u=s._lendControlInterpolant(),this._timeScaleInterpolant=u);const h=u.parameterPositions,p=u.sampleValues;return h[0]=a,h[1]=a+n,p[0]=e/l,p[1]=t/l,this}stopWarping(){const e=this._timeScaleInterpolant;return e!==null&&(this._timeScaleInterpolant=null,this._mixer._takeBackControlInterpolant(e)),this}getMixer(){return this._mixer}getClip(){return this._clip}getRoot(){return this._localRoot||this._mixer._root}_update(e,t,n,s){if(!this.enabled){this._updateWeight(e);return}const a=this._startTime;if(a!==null){const h=(e-a)*n;h<0||n===0?t=0:(this._startTime=null,t=n*h)}t*=this._updateTimeScale(e);const l=this._updateTime(t),u=this._updateWeight(e);if(u>0){const h=this._interpolants,p=this._propertyBindings;switch(this.blendMode){case LA:for(let m=0,v=h.length;m!==v;++m)h[m].evaluate(l),p[m].accumulateAdditive(u);break;case z_:default:for(let m=0,v=h.length;m!==v;++m)h[m].evaluate(l),p[m].accumulate(s,u)}}}_updateWeight(e){let t=0;if(this.enabled){t=this.weight;const n=this._weightInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopFading(),s===0&&(this.enabled=!1))}}return this._effectiveWeight=t,t}_updateTimeScale(e){let t=0;if(!this.paused){t=this.timeScale;const n=this._timeScaleInterpolant;if(n!==null){const s=n.evaluate(e)[0];t*=s,e>n.parameterPositions[1]&&(this.stopWarping(),t===0?this.paused=!0:this.timeScale=t)}}return this._effectiveTimeScale=t,t}_updateTime(e){const t=this._clip.duration,n=this.loop;let s=this.time+e,a=this._loopCount;const l=n===VB;if(e===0)return a===-1?s:l&&(a&1)===1?t-s:s;if(n===GB){a===-1&&(this._loopCount=0,this._setEndings(!0,!0,!1));e:{if(s>=t)s=t;else if(s<0)s=0;else{this.time=s;break e}this.clampWhenFinished?this.paused=!0:this.enabled=!1,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e<0?-1:1})}}else{if(a===-1&&(e>=0?(a=0,this._setEndings(!0,this.repetitions===0,l)):this._setEndings(this.repetitions===0,!0,l)),s>=t||s<0){const u=Math.floor(s/t);s-=t*u,a+=Math.abs(u);const h=this.repetitions-a;if(h<=0)this.clampWhenFinished?this.paused=!0:this.enabled=!1,s=e>0?t:0,this.time=s,this._mixer.dispatchEvent({type:"finished",action:this,direction:e>0?1:-1});else{if(h===1){const p=e<0;this._setEndings(p,!p,l)}else this._setEndings(!1,!1,l);this._loopCount=a,this.time=s,this._mixer.dispatchEvent({type:"loop",action:this,loopDelta:u})}}else this.time=s;if(l&&(a&1)===1)return t-s}return s}_setEndings(e,t,n){const s=this._interpolantSettings;n?(s.endingStart=fd,s.endingEnd=fd):(e?s.endingStart=this.zeroSlopeAtStart?fd:ud:s.endingStart=W0,t?s.endingEnd=this.zeroSlopeAtEnd?fd:ud:s.endingEnd=W0)}_scheduleFading(e,t,n){const s=this._mixer,a=s.time;let l=this._weightInterpolant;l===null&&(l=s._lendControlInterpolant(),this._weightInterpolant=l);const u=l.parameterPositions,h=l.sampleValues;return u[0]=a,h[0]=t,u[1]=a+e,h[1]=n,this}}const cN=new Float32Array(1);class uN extends eo{constructor(e){super(),this._root=e,this._initMemoryManager(),this._accuIndex=0,this.time=0,this.timeScale=1}_bindAction(e,t){const n=e._localRoot||this._root,s=e._clip.tracks,a=s.length,l=e._propertyBindings,u=e._interpolants,h=n.uuid,p=this._bindingsByRootAndName;let m=p[h];m===void 0&&(m={},p[h]=m);for(let v=0;v!==a;++v){const x=s[v],_=x.name;let A=m[_];if(A!==void 0)++A.referenceCount,l[v]=A;else{if(A=l[v],A!==void 0){A._cacheIndex===null&&(++A.referenceCount,this._addInactiveBinding(A,h,_));continue}const R=t&&t._propertyBindings[v].binding.parsedPath;A=new JI(di.create(n,_,R),x.ValueTypeName,x.getValueSize()),++A.referenceCount,this._addInactiveBinding(A,h,_),l[v]=A}u[v].resultBuffer=A.buffer}}_activateAction(e){if(!this._isActiveAction(e)){if(e._cacheIndex===null){const n=(e._localRoot||this._root).uuid,s=e._clip.uuid,a=this._actionsByClip[s];this._bindAction(e,a&&a.knownActions[0]),this._addInactiveAction(e,s,n)}const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const a=t[n];a.useCount++===0&&(this._lendBinding(a),a.saveOriginalState())}this._lendAction(e)}}_deactivateAction(e){if(this._isActiveAction(e)){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const a=t[n];--a.useCount===0&&(a.restoreOriginalState(),this._takeBackBinding(a))}this._takeBackAction(e)}}_initMemoryManager(){this._actions=[],this._nActiveActions=0,this._actionsByClip={},this._bindings=[],this._nActiveBindings=0,this._bindingsByRootAndName={},this._controlInterpolants=[],this._nActiveControlInterpolants=0;const e=this;this.stats={actions:{get total(){return e._actions.length},get inUse(){return e._nActiveActions}},bindings:{get total(){return e._bindings.length},get inUse(){return e._nActiveBindings}},controlInterpolants:{get total(){return e._controlInterpolants.length},get inUse(){return e._nActiveControlInterpolants}}}}_isActiveAction(e){const t=e._cacheIndex;return t!==null&&t<this._nActiveActions}_addInactiveAction(e,t,n){const s=this._actions,a=this._actionsByClip;let l=a[t];
vendor: 6,589 bytes, line 117
117if(l===void 0)l={knownActions:[e],actionByRoot:{}},e._byClipCacheIndex=0,a[t]=l;else{const u=l.knownActions;e._byClipCacheIndex=u.length,u.push(e)}e._cacheIndex=s.length,s.push(e),l.actionByRoot[n]=e}_removeInactiveAction(e){const t=this._actions,n=t[t.length-1],s=e._cacheIndex;n._cacheIndex=s,t[s]=n,t.pop(),e._cacheIndex=null;const a=e._clip.uuid,l=this._actionsByClip,u=l[a],h=u.knownActions,p=h[h.length-1],m=e._byClipCacheIndex;p._byClipCacheIndex=m,h[m]=p,h.pop(),e._byClipCacheIndex=null;const v=u.actionByRoot,x=(e._localRoot||this._root).uuid;delete v[x],h.length===0&&delete l[a],this._removeInactiveBindingsForAction(e)}_removeInactiveBindingsForAction(e){const t=e._propertyBindings;for(let n=0,s=t.length;n!==s;++n){const a=t[n];--a.referenceCount===0&&this._removeInactiveBinding(a)}}_lendAction(e){const t=this._actions,n=e._cacheIndex,s=this._nActiveActions++,a=t[s];e._cacheIndex=s,t[s]=e,a._cacheIndex=n,t[n]=a}_takeBackAction(e){const t=this._actions,n=e._cacheIndex,s=--this._nActiveActions,a=t[s];e._cacheIndex=s,t[s]=e,a._cacheIndex=n,t[n]=a}_addInactiveBinding(e,t,n){const s=this._bindingsByRootAndName,a=this._bindings;let l=s[t];l===void 0&&(l={},s[t]=l),l[n]=e,e._cacheIndex=a.length,a.push(e)}_removeInactiveBinding(e){const t=this._bindings,n=e.binding,s=n.rootNode.uuid,a=n.path,l=this._bindingsByRootAndName,u=l[s],h=t[t.length-1],p=e._cacheIndex;h._cacheIndex=p,t[p]=h,t.pop(),delete u[a],Object.keys(u).length===0&&delete l[s]}_lendBinding(e){const t=this._bindings,n=e._cacheIndex,s=this._nActiveBindings++,a=t[s];e._cacheIndex=s,t[s]=e,a._cacheIndex=n,t[n]=a}_takeBackBinding(e){const t=this._bindings,n=e._cacheIndex,s=--this._nActiveBindings,a=t[s];e._cacheIndex=s,t[s]=e,a._cacheIndex=n,t[n]=a}_lendControlInterpolant(){const e=this._controlInterpolants,t=this._nActiveControlInterpolants++;let n=e[t];return n===void 0&&(n=new $A(new Float32Array(2),new Float32Array(2),1,cN),n.__cacheIndex=t,e[t]=n),n}_takeBackControlInterpolant(e){const t=this._controlInterpolants,n=e.__cacheIndex,s=--this._nActiveControlInterpolants,a=t[s];e.__cacheIndex=s,t[s]=e,a.__cacheIndex=n,t[n]=a}clipAction(e,t,n){const s=t||this._root,a=s.uuid;let l=typeof e=="string"?Bp.findByName(s,e):e;const u=l!==null?l.uuid:e,h=this._actionsByClip[u];let p=null;if(n===void 0&&(l!==null?n=l.blendMode:n=z_),h!==void 0){const v=h.actionByRoot[a];if(v!==void 0&&v.blendMode===n)return v;p=h.knownActions[0],l===null&&(l=p._clip)}if(l===null)return null;const m=new KI(this,l,t,n);return this._bindAction(m,p),this._addInactiveAction(m,u,a),m}existingAction(e,t){const n=t||this._root,s=n.uuid,a=typeof e=="string"?Bp.findByName(n,e):e,l=a?a.uuid:e,u=this._actionsByClip[l];return u!==void 0&&u.actionByRoot[s]||null}stopAllAction(){const e=this._actions,t=this._nActiveActions;for(let n=t-1;n>=0;--n)e[n].stop();return this}update(e){e*=this.timeScale;const t=this._actions,n=this._nActiveActions,s=this.time+=e,a=Math.sign(e),l=this._accuIndex^=1;for(let p=0;p!==n;++p)t[p]._update(s,e,a,l);const u=this._bindings,h=this._nActiveBindings;for(let p=0;p!==h;++p)u[p].apply(l);return this}setTime(e){this.time=0;for(let t=0;t<this._actions.length;t++)this._actions[t].time=0;return this.update(e)}getRoot(){return this._root}uncacheClip(e){const t=this._actions,n=e.uuid,s=this._actionsByClip,a=s[n];if(a!==void 0){const l=a.knownActions;for(let u=0,h=l.length;u!==h;++u){const p=l[u];this._deactivateAction(p);const m=p._cacheIndex,v=t[t.length-1];p._cacheIndex=null,p._byClipCacheIndex=null,v._cacheIndex=m,t[m]=v,t.pop(),this._removeInactiveBindingsForAction(p)}delete s[n]}}uncacheRoot(e){const t=e.uuid,n=this._actionsByClip;for(const l in n){const u=n[l].actionByRoot,h=u[t];h!==void 0&&(this._deactivateAction(h),this._removeInactiveAction(h))}const s=this._bindingsByRootAndName,a=s[t];if(a!==void 0)for(const l in a){const u=a[l];u.restoreOriginalState(),this._removeInactiveBinding(u)}}uncacheAction(e,t){const n=this.existingAction(e,t);n!==null&&(this._deactivateAction(n),this._removeInactiveAction(n))}}class fN extends F_{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isRenderTarget3D=!0,this.depth=n,this.texture=new k_(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class dN extends F_{constructor(e=1,t=1,n=1,s={}){super(e,t,s),this.isRenderTargetArray=!0,this.depth=n,this.texture=new cg(null,e,t,n),this.texture.isRenderTargetTexture=!0}}class ai{constructor(e){this.value=e}clone(){return new ai(this.value.clone===void 0?this.value:this.value.clone())}}let hN=0;class pN extends eo{constructor(){super(),this.isUniformsGroup=!0,Object.defineProperty(this,"id",{value:hN++}),this.name="",this.usage=q0,this.uniforms=[]}add(e){return this.uniforms.push(e),this}remove(e){const t=this.uniforms.indexOf(e);return t!==-1&&this.uniforms.splice(t,1),this}setName(e){return this.name=e,this}setUsage(e){return this.usage=e,this}dispose(){this.dispatchEvent({type:"dispose"})}copy(e){this.name=e.name,this.usage=e.usage;const t=e.uniforms;this.uniforms.length=0;for(let n=0,s=t.length;n<s;n++){const a=Array.isArray(t[n])?t[n]:[t[n]];for(let l=0;l<a.length;l++)this.uniforms.push(a[l].clone())}return this}clone(){return new this.constructor().copy(this)}}class mN extends fg{constructor(e,t,n=1){super(e,t),this.isInstancedInterleavedBuffer=!0,this.meshPerAttribute=n}copy(e){return super.copy(e),this.meshPerAttribute=e.meshPerAttribute,this}clone(e){const t=super.clone(e);return t.meshPerAttribute=this.meshPerAttribute,t}toJSON(e){const t=super.toJSON(e);return t.isInstancedInterleavedBuffer=!0,t.meshPerAttribute=this.meshPerAttribute,t}}class gN{constructor(e,t,n,s,a){this.isGLBufferAttribute=!0,this.name="",this.buffer=e,this.type=t,this.itemSize=n,this.elementSize=s,this.count=a,this.version=0}set needsUpdate(e){e===!0&&this.version++}setBuffer(e){return this.buffer=e,this}setType(e,t){return this.type=e,this.elementSize=t,this}setItemSize(e){return this.itemSize=e,this}setCount(e){return this.count=e,this}}const iw=new dn;class ZI{constructor(e,t,n=0,s=1/0){this.ray=new Lp(e,t),this.near=n,this.far=s,this.camera=null,this.layers=new wp,this.params={Mesh:{},Line:{threshold:1},LOD:{},Points:{threshold:1},Sprite:{}}}set(e,t){this.ray.set(e,t)}setFromCamera(e,t){t.isPerspectiveCamera?(this.ray.origin.setFromMatrixPosition(t.matrixWorld),this.ray.direction.set(e.x,e.y,.5).unproject(t).sub(this.ray.origin).normalize(),this.camera=t):t.isOrthographicCamera?(this.ray.origin.set(e.x,e.y,(t.near+t.far)/(t.near-t.far)).unproject(t),this.ray.direction.set(0,0,-1).transformDirection(t.matrixWorld),this.camera=t):console.error("THREE.Raycaster: 
117Unsupported camera type: "+t.type)}setFromXRController(e){return iw.identity().extractRotation(e.matrixWorld),this.ray.origin.setFromMatrixPosition(e.matrixWorld),this.ray.direction.set(0,0,-1).applyMatrix4(iw),this}intersectObject(e,t=!0,n=[]){return Q1(e,this,n,t),n.sort(sw),n}intersectObjects(e,t=!0,n=[]){for(let s=0,a=e.length;s<a;s++)Q1(e[s],this,n,t);return n.sort(sw),n}}function sw(i,e){return i.distance-e.distance}function Q1(i,e,t,n){let s=!0;if(i.layers.test(e.layers)&&i.raycast(e,t)===!1&&(s=!1),s===!0&&n===!0){const a=i.children;for(let l=0,u=a.length;l<u;l++)Q1(a[l],e,t,!0)}}class QI{constructor(e=1,t=0,n=0){this.radius=e,this.phi=t,this.theta=n}set(e,t,n){return this.radius=e,this.phi=t,this.theta=n,this}copy(e){return this.radius=e.radius,this.phi=e.phi,this.theta=e.theta,this}makeSafe(){return this.phi=An(this.phi,1e-6,Math.PI-1e-6),this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+t*t+n*n),this.radius===0?(this.theta=0,this.phi=0):(this.theta=Math.atan2(e,n),this.phi=Math.acos(An(t/this.radius,-1,1))),this}clone(){return new this.constructor().copy(this)}}class vN{constructor(e=1,t=0,n=0){this.radius=e,this.theta=t,this.y=n}set(e,t,n){return this.radius=e,this.theta=t,this.y=n,this}copy(e){return this.radius=e.radius,this.theta=e.theta,this.y=e.y,this}setFromVector3(e){return this.setFromCartesianCoords(e.x,e.y,e.z)}setFromCartesianCoords(e,t,n){return this.radius=Math.sqrt(e*e+n*n),this.theta=Math.atan2(e,n),this.y=t,this}clone(){return new this.constructor().copy(this)}}class uM{constructor(e,t,n,s){uM.prototype.isMatrix2=!0,this.elements=[1,0,0,1],e!==void 0&&this.set(e,t,n,s)}identity(){return this.set(1,0,0,1),this}fromArray(e,t=0){for(let n=0;n<4;n++)this.elements[n]=e[n+t];return this}set(e,t,n,s){const a=this.elements;return a[0]=e,a[2]=t,a[1]=n,a[3]=s,this}}const rw=new st;class yN{constructor(e=new st(1/0,1/0),t=new st(-1/0,-1/0)){this.isBox2=!0,this.min=e,this.max=t}set(e,t){return this.min.copy(e),this.max.copy(t),this}setFromPoints(e){this.makeEmpty();for(let t=0,n=e.length;t<n;t++)this.expandByPoint(e[t]);return this}setFromCenterAndSize(e,t){const n=rw.copy(t).multiplyScalar(.5);return this.min.copy(e).sub(n),this.max.copy(e).add(n),this}clone(){return new this.constructor().copy(this)}copy(e){return this.min.copy(e.min),this.max.copy(e.max),this}makeEmpty(){return this.min.x=this.min.y=1/0,this.max.x=this.max.y=-1/0,this}isEmpty(){return this.max.x<this.min.x||this.max.y<this.min.y}getCenter(e){return this.isEmpty()?e.set(0,0):e.addVectors(this.min,this.max).multiplyScalar(.5)}getSize(e){return this.isEmpty()?e.set(0,0):e.subVectors(this.max,this.min)}expandByPoint(e){return this.min.min(e),this.max.max(e),this}expandByVector(e){return this.min.sub(e),this.max.add(e),this}expandByScalar(e){return this.min.addScalar(-e),this.max.addScalar(e),this}containsPoint(e){return e.x>=this.min.x&&e.x<=this.max.x&&e.y>=this.min.y&&e.y<=this.max.y}containsBox(e){return this.min.x<=e.min.x&&e.max.x<=this.max.x&&this.min.y<=e.min.y&&e.max.y<=this.max.y}getParameter(e,t){return t.set((e.x-this.min.x)/(this.max.x-this.min.x),(e.y-this.min.y)/(this.max.y-this.min.y))}intersectsBox(e){return e.max.x>=this.min.x&&e.min.x<=this.max.x&&e.max.y>=this.min.y&&e.min.y<=this.max.y}clampPoint(e,t){return t.copy(e).clamp(this.min,this.max)}distanceToPoint(e){return this.clampPoint(e,rw).distanceTo(e)}intersect(e){return this.min.max(e.min),this.max.min(e.max),this.isEmpty()&&this.makeEmpty(),this}union(e){return this.min.min(e.min),this.max.max(e.max),this}translate(e){return this.min.add(e),this.max.add(e),this}equals(e){return e.min.equals(this.min)&&e.max.equals(this.max)}}const aw=new se,Ky=new se;class xN{constructor(e=new se,t=new se){this.start=e,this.end=t}set(e,t){return this.start.copy(e),this.end.copy(t),this}copy(e){return this.start.copy(e.start),this.end.copy(e.end),this}getCenter(e){return e.addVectors(this.start,this.end).multiplyScalar(.5)}delta(e){return e.subVectors(this.end,this.start)}distanceSq(){return this.start.distanceToSquared(this.end)}distance(){return this.start.distanceTo(this.end)}at(e,t){return this.delta(t).multiplyScalar(e).add(this.start)}closestPointToPointParameter(e,t){aw.subVectors(e,this.start),Ky.subVectors(this.end,this.start);const n=Ky.dot(Ky);let a=Ky.dot(aw)/n;return t&&(a=An(a,0,1)),a}closestPointToPoint(e,t,n){const s=this.closestPointToPointParameter(e,t);return this.delta(n).multiplyScalar(s).add(this.start)}
vendor: 6,486 bytes, line 117
117applyMatrix4(e){return this.start.applyMatrix4(e),this.end.applyMatrix4(e),this}equals(e){return e.start.equals(this.start)&&e.end.equals(this.end)}clone(){return new this.constructor().copy(this)}}const ow=new se;class _N extends li{constructor(e,t){super(),this.light=e,this.matrixAutoUpdate=!1,this.color=t,this.type="SpotLightHelper";const n=new Mn,s=[0,0,0,0,0,1,0,0,0,1,0,1,0,0,0,-1,0,1,0,0,0,0,1,1,0,0,0,0,-1,1];for(let l=0,u=1,h=32;l<h;l++,u++){const p=l/h*Math.PI*2,m=u/h*Math.PI*2;s.push(Math.cos(p),Math.sin(p),1,Math.cos(m),Math.sin(m),1)}n.setAttribute("position",new $t(s,3));const a=new ta({fog:!1,toneMapped:!1});this.cone=new ul(n,a),this.add(this.cone),this.update()}dispose(){this.cone.geometry.dispose(),this.cone.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),this.parent?(this.parent.updateWorldMatrix(!0),this.matrix.copy(this.parent.matrixWorld).invert().multiply(this.light.matrixWorld)):this.matrix.copy(this.light.matrixWorld),this.matrixWorld.copy(this.light.matrixWorld);const e=this.light.distance?this.light.distance:1e3,t=e*Math.tan(this.light.angle);this.cone.scale.set(t,t,e),ow.setFromMatrixPosition(this.light.target.matrixWorld),this.cone.lookAt(ow),this.color!==void 0?this.cone.material.color.set(this.color):this.cone.material.color.copy(this.light.color)}}const zu=new se,Zy=new dn,$S=new dn;class bN extends ul{constructor(e){const t=$I(e),n=new Mn,s=[],a=[],l=new Pt(0,0,1),u=new Pt(0,1,0);for(let p=0;p<t.length;p++){const m=t[p];m.parent&&m.parent.isBone&&(s.push(0,0,0),s.push(0,0,0),a.push(l.r,l.g,l.b),a.push(u.r,u.g,u.b))}n.setAttribute("position",new $t(s,3)),n.setAttribute("color",new $t(a,3));const h=new ta({vertexColors:!0,depthTest:!1,depthWrite:!1,toneMapped:!1,transparent:!0});super(n,h),this.isSkeletonHelper=!0,this.type="SkeletonHelper",this.root=e,this.bones=t,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1}updateMatrixWorld(e){const t=this.bones,n=this.geometry,s=n.getAttribute("position");$S.copy(this.root.matrixWorld).invert();for(let a=0,l=0;a<t.length;a++){const u=t[a];u.parent&&u.parent.isBone&&(Zy.multiplyMatrices($S,u.matrixWorld),zu.setFromMatrixPosition(Zy),s.setXYZ(l,zu.x,zu.y,zu.z),Zy.multiplyMatrices($S,u.parent.matrixWorld),zu.setFromMatrixPosition(Zy),s.setXYZ(l+1,zu.x,zu.y,zu.z),l+=2)}n.getAttribute("position").needsUpdate=!0,super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose()}}function $I(i){const e=[];i.isBone===!0&&e.push(i);for(let t=0;t<i.children.length;t++)e.push(...$I(i.children[t]));return e}class SN extends hs{constructor(e,t,n){const s=new vg(t,4,2),a=new Kr({wireframe:!0,fog:!1,toneMapped:!1});super(s,a),this.light=e,this.color=n,this.type="PointLightHelper",this.matrix=this.light.matrixWorld,this.matrixAutoUpdate=!1,this.update()}dispose(){this.geometry.dispose(),this.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.color!==void 0?this.material.color.set(this.color):this.material.color.copy(this.light.color)}}const AN=new se,lw=new Pt,cw=new Pt;class MN extends li{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="HemisphereLightHelper";const s=new gg(t);s.rotateY(Math.PI*.5),this.material=new Kr({wireframe:!0,fog:!1,toneMapped:!1}),this.color===void 0&&(this.material.vertexColors=!0);const a=s.getAttribute("position"),l=new Float32Array(a.count*3);s.setAttribute("color",new ci(l,3)),this.add(new hs(s,this.material)),this.update()}dispose(){this.children[0].geometry.dispose(),this.children[0].material.dispose()}update(){const e=this.children[0];if(this.color!==void 0)this.material.color.set(this.color);else{const t=e.geometry.getAttribute("color");lw.copy(this.light.color),cw.copy(this.light.groundColor);for(let n=0,s=t.count;n<s;n++){const a=n<s/2?lw:cw;t.setXYZ(n,a.r,a.g,a.b)}t.needsUpdate=!0}this.light.updateWorldMatrix(!0,!1),e.lookAt(AN.setFromMatrixPosition(this.light.matrixWorld).negate())}}class EN extends ul{constructor(e=10,t=10,n=4473924,s=8947848){n=new Pt(n),s=new Pt(s);const a=t/2,l=e/t,u=e/2,h=[],p=[];for(let x=0,_=0,A=-u;x<=t;x++,A+=l){h.push(-u,0,A,u,0,A),h.push(A,0,-u,A,0,u);const R=x===a?n:s;R.toArray(p,_),_+=3,R.toArray(p,_),_+=3,R.toArray(p,_),_+=3,R.toArray(p,_),_+=3}const m=new Mn;m.setAttribute("position",new $t(h,3)),m.setAttribute("color",new $t(p,3));const v=new ta({vertexColors:!0,toneMapped:!1});super(m,v),this.type="GridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}class TN extends ul{constructor(e=10,t=16,n=8,s=64,a=4473924,l=8947848){a=new Pt(a),l=new Pt(l);const u=[],h=[];if(t>1)for(let v=0;v<t;v++){const x=v/t*(Math.PI*2),_=Math.sin(x)*e,A=Math.cos(x)*e;u.push(0,0,0),u.push(_,0,A);const R=v&1?a:l;h.push(R.r,R.g,R.b),h.push(R.r,R.g,R.b)}for(let v=0;v<n;v++){const x=v&1?a:l,_=e-e/n*v;for(let A=0;A<s;A++){let R=A/s*(Math.PI*2),w=Math.sin(R)*_,E=Math.cos(R)*_;u.push(w,0,E),h.push(x.r,x.g,x.b),R=(A+1)/s*(Math.PI*2),w=Math.sin(R)*_,E=Math.cos(R)*_,u.push(w,0,E),h.push(x.r,x.g,x.b)}}const p=new Mn;p.setAttribute("position",new $t(u,3)),p.setAttribute("color",new $t(h,3));const m=new ta({vertexColors:!0,toneMapped:!1});super(p,m),this.type="PolarGridHelper"}dispose(){this.geometry.dispose(),this.material.dispose()}}const uw=new se,Qy=new se,fw=new se;class wN extends li{constructor(e,t,n){super(),this.light=e,this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.color=n,this.type="DirectionalLightHelper",t===void 0&&(t=1);let s=new Mn;s.setAttribute("position",new $t([-t,t,0,t,t,0,t,-t,0,-t,-t,0,-t,t,0],3));const a=new ta({fog:!1,toneMapped:!1});this.lightPlane=new Hc(s,a),this.add(this.lightPlane),s=new Mn,s.setAttribute("position",new $t([0,0,0,0,0,1],3)),this.targetLine=new Hc(s,a),this.add(this.targetLine),this.update()}dispose(){this.lightPlane.geometry.dispose(),this.lightPlane.material.dispose(),this.targetLine.geometry.dispose(),this.targetLine.material.dispose()}update(){this.light.updateWorldMatrix(!0,!1),this.light.target.updateWorldMatrix(!0,!1),uw.setFromMatrixPosition(this.light.matrixWorld),Qy.setFromMatrixPosition(this.light.target.matrixWorld),fw.subVectors(Qy,uw),this.lightPlane.lookAt(Qy),this.color!==void 0?(this.lightPlane.material.color.set(this.color),this.targetLine.material.color.set(this.color)):(this.lightPlane.material.color.copy(this.light.color),this.targetLine.material.color.copy(this.light.color)),this.targetLine.lookAt(Qy),this.targetLine.scale.z
117=fw.length()}}const $y=new se,Is=new H_;class CN extends ul{constructor(e){const t=new Mn,n=new ta({color:16777215,vertexColors:!0,toneMapped:!1}),s=[],a=[],l={};u("n1","n2"),u("n2","n4"),u("n4","n3"),u("n3","n1"),u("f1","f2"),u("f2","f4"),u("f4","f3"),u("f3","f1"),u("n1","f1"),u("n2","f2"),u("n3","f3"),u("n4","f4"),u("p","n1"),u("p","n2"),u("p","n3"),u("p","n4"),u("u1","u2"),u("u2","u3"),u("u3","u1"),u("c","t"),u("p","c"),u("cn1","cn2"),u("cn3","cn4"),u("cf1","cf2"),u("cf3","cf4");function u(A,R){h(A),h(R)}function h(A){s.push(0,0,0),a.push(0,0,0),l[A]===void 0&&(l[A]=[]),l[A].push(s.length/3-1)}t.setAttribute("position",new $t(s,3)),t.setAttribute("color",new $t(a,3)),super(t,n),this.type="CameraHelper",this.camera=e,this.camera.updateProjectionMatrix&&this.camera.updateProjectionMatrix(),this.matrix=e.matrixWorld,this.matrixAutoUpdate=!1,this.pointMap=l,this.update();const p=new Pt(16755200),m=new Pt(16711680),v=new Pt(43775),x=new Pt(16777215),_=new Pt(3355443);this.setColors(p,m,v,x,_)}setColors(e,t,n,s,a){const u=this.geometry.getAttribute("color");u.setXYZ(0,e.r,e.g,e.b),u.setXYZ(1,e.r,e.g,e.b),u.setXYZ(2,e.r,e.g,e.b),u.setXYZ(3,e.r,e.g,e.b),u.setXYZ(4,e.r,e.g,e.b),u.setXYZ(5,e.r,e.g,e.b),u.setXYZ(6,e.r,e.g,e.b),u.setXYZ(7,e.r,e.g,e.b),u.setXYZ(8,e.r,e.g,e.b),u.setXYZ(9,e.r,e.g,e.b),u.setXYZ(10,e.r,e.g,e.b),u.setXYZ(11,e.r,e.g,e.b),u.setXYZ(12,e.r,e.g,e.b),u.setXYZ(13,e.r,e.g,e.b),u.setXYZ(14,e.r,e.g,e.b),u.setXYZ(15,e.r,e.g,e.b),u.setXYZ(16,e.r,e.g,e.b),u.setXYZ(17,e.r,e.g,e.b),u.setXYZ(18,e.r,e.g,e.b),u.setXYZ(19,e.r,e.g,e.b),u.setXYZ(20,e.r,e.g,e.b),u.setXYZ(21,e.r,e.g,e.b),u.setXYZ(22,e.r,e.g,e.b),u.setXYZ(23,e.r,e.g,e.b),u.setXYZ(24,t.r,t.g,t.b),u.setXYZ(25,t.r,t.g,t.b),u.setXYZ(26,t.r,t.g,t.b),u.setXYZ(27,t.r,t.g,t.b),u.setXYZ(28,t.r,t.g,t.b),u.setXYZ(29,t.r,t.g,t.b),u.setXYZ(30,t.r,t.g,t.b),u.setXYZ(31,t.r,t.g,t.b),u.setXYZ(32,n.r,n.g,n.b),u.setXYZ(33,n.r,n.g,n.b),u.setXYZ(34,n.r,n.g,n.b),u.setXYZ(35,n.r,n.g,n.b),u.setXYZ(36,n.r,n.g,n.b),u.setXYZ(37,n.r,n.g,n.b),u.setXYZ(38,s.r,s.g,s.b),u.setXYZ(39,s.r,s.g,s.b),u.setXYZ(40,a.r,a.g,a.b),u.setXYZ(41,a.r,a.g,a.b),u.setXYZ(42,a.r,a.g,a.b),u.setXYZ(43,a.r,a.g,a.b),u.setXYZ(44,a.r,a.g,a.b),u.setXYZ(45,a.r,a.g,a.b),u.setXYZ(46,a.r,a.g,a.b),u.setXYZ(47,a.r,a.g,a.b),u.setXYZ(48,a.r,a.g,a.b),u.setXYZ(49,a.r,a.g,a.b),u.needsUpdate=!0}update(){const e=this.geometry,t=this.pointMap,n=1,s=1;Is.projectionMatrixInverse.copy(this.camera.projectionMatrixInverse);const a=this.camera.coordinateSystem===al?-1:0;ks("c",t,e,Is,0,0,a),ks("t",t,e,Is,0,0,1),ks("n1",t,e,Is,-1,-1,a),ks("n2",t,e,Is,n,-1,a),ks("n3",t,e,Is,-1,s,a),ks("n4",t,e,Is,n,s,a),ks("f1",t,e,Is,-1,-1,1),ks("f2",t,e,Is,n,-1,1),ks("f3",t,e,Is,-1,s,1
vendor: 4,444 bytes, line 117
117),ks("f4",t,e,Is,n,s,1),ks("u1",t,e,Is,n*.7,s*1.1,a),ks("u2",t,e,Is,-1*.7,s*1.1,a),ks("u3",t,e,Is,0,s*2,a),ks("cf1",t,e,Is,-1,0,1),ks("cf2",t,e,Is,n,0,1),ks("cf3",t,e,Is,0,-1,1),ks("cf4",t,e,Is,0,s,1),ks("cn1",t,e,Is,-1,0,a),ks("cn2",t,e,Is,n,0,a),ks("cn3",t,e,Is,0,-1,a),ks("cn4",t,e,Is,0,s,a),e.getAttribute("position").needsUpdate=!0}dispose(){this.geometry.dispose(),this.material.dispose()}}function ks(i,e,t,n,s,a,l){$y.set(s,a,l).unproject(n);const u=e[i];if(u!==void 0){const h=t.getAttribute("position");for(let p=0,m=u.length;p<m;p++)h.setXYZ(u[p],$y.x,$y.y,$y.z)}}const ex=new $r;class RN extends ul{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=new Float32Array(24),a=new Mn;a.setIndex(new ci(n,1)),a.setAttribute("position",new ci(s,3)),super(a,new ta({color:t,toneMapped:!1})),this.object=e,this.type="BoxHelper",this.matrixAutoUpdate=!1,this.update()}update(){if(this.object!==void 0&&ex.setFromObject(this.object),ex.isEmpty())return;const e=ex.min,t=ex.max,n=this.geometry.attributes.position,s=n.array;s[0]=t.x,s[1]=t.y,s[2]=t.z,s[3]=e.x,s[4]=t.y,s[5]=t.z,s[6]=e.x,s[7]=e.y,s[8]=t.z,s[9]=t.x,s[10]=e.y,s[11]=t.z,s[12]=t.x,s[13]=t.y,s[14]=e.z,s[15]=e.x,s[16]=t.y,s[17]=e.z,s[18]=e.x,s[19]=e.y,s[20]=e.z,s[21]=t.x,s[22]=e.y,s[23]=e.z,n.needsUpdate=!0,this.geometry.computeBoundingSphere()}setFromObject(e){return this.object=e,this.update(),this}copy(e,t){return super.copy(e,t),this.object=e.object,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class BN extends ul{constructor(e,t=16776960){const n=new Uint16Array([0,1,1,2,2,3,3,0,4,5,5,6,6,7,7,4,0,4,1,5,2,6,3,7]),s=[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,-1,-1,1,-1,-1,-1,-1,1,-1,-1],a=new Mn;a.setIndex(new ci(n,1)),a.setAttribute("position",new $t(s,3)),super(a,new ta({color:t,toneMapped:!1})),this.box=e,this.type="Box3Helper",this.geometry.computeBoundingSphere()}updateMatrixWorld(e){const t=this.box;t.isEmpty()||(t.getCenter(this.position),t.getSize(this.scale),this.scale.multiplyScalar(.5),super.updateMatrixWorld(e))}dispose(){this.geometry.dispose(),this.material.dispose()}}class IN extends Hc{constructor(e,t=1,n=16776960){const s=n,a=[1,-1,0,-1,1,0,-1,-1,0,1,1,0,-1,1,0,-1,-1,0,1,-1,0,1,1,0],l=new Mn;l.setAttribute("position",new $t(a,3)),l.computeBoundingSphere(),super(l,new ta({color:s,toneMapped:!1})),this.type="PlaneHelper",this.plane=e,this.size=t;const u=[1,1,0,-1,1,0,-1,-1,0,1,1,0,-1,-1,0,1,-1,0],h=new Mn;h.setAttribute("position",new $t(u,3)),h.computeBoundingSphere(),this.add(new hs(h,new Kr({color:s,opacity:.2,transparent:!0,depthWrite:!1,toneMapped:!1})))}updateMatrixWorld(e){this.position.set(0,0,0),this.scale.set(.5*this.size,.5*this.size,1),this.lookAt(this.plane.normal),this.translateZ(-this.plane.constant),super.updateMatrixWorld(e)}dispose(){this.geometry.dispose(),this.material.dispose(),this.children[0].geometry.dispose(),this.children[0].material.dispose()}}const dw=new se;let tx,e1;class DN extends li{constructor(e=new se(0,0,1),t=new se(0,0,0),n=1,s=16776960,a=n*.2,l=a*.2){super(),this.type="ArrowHelper",tx===void 0&&(tx=new Mn,tx.setAttribute("position",new $t([0,0,0,0,1,0],3)),e1=new Pp(0,.5,1,5,1),e1.translate(0,-.5,0)),this.position.copy(t),this.line=new Hc(tx,new ta({color:s,toneMapped:!1})),this.line.matrixAutoUpdate=!1,this.add(this.line),this.cone=new hs(e1,new Kr({color:s,toneMapped:!1})),this.cone.matrixAutoUpdate=!1,this.add(this.cone),this.setDirection(e),this.setLength(n,a,l)}setDirection(e){if(e.y>.99999)this.quaternion.set(0,0,0,1);else if(e.y<-.99999)this.quaternion.set(1,0,0,0);else{dw.set(e.z,0,-e.x).normalize();const t=Math.acos(e.y);this.quaternion.setFromAxisAngle(dw,t)}}setLength(e,t=e*.2,n=t*.2){this.line.scale.set(1,Math.max(1e-4,e-t),1),this.line.updateMatrix(),this.cone.scale.set(n,t,n),this.cone.position.y=e,this.cone.updateMatrix()}setColor(e){this.line.material.color.set(e),this.cone.material.color.set(e)}copy(e){return super.copy(e,!1),this.line.copy(e.line),this.cone.copy(e.cone),this}dispose(){this.line.geometry.dispose(),this.line.material.dispose(),this.cone.geometry.dispose(),this.cone.material.dispose()}}class LN extends ul{constructor(e=1){const t=[0,0,0,e,0,0,0,0,0,0,e,0,0,0,0,0,0,e],n=[1,0,0,1,.6,0,0,1,0,.6,1,0,0,0,1,0,.6,1],s=new Mn;s.setAttribute("position",new $t(t,3)),s.setAttribute("color",new $t(n,3));const a=new ta({vertexColors:!0,toneMapped:!1});super(s,a),this.type="AxesHelper"}
vendor: 5,713 bytes, line 117
117setColors(e,t,n){const s=new Pt,a=this.geometry.attributes.color.array;return s.set(e),s.toArray(a,0),s.toArray(a,3),s.set(t),s.toArray(a,6),s.toArray(a,9),s.set(n),s.toArray(a,12),s.toArray(a,15),this.geometry.attributes.color.needsUpdate=!0,this}dispose(){this.geometry.dispose(),this.material.dispose()}}class PN{constructor(){this.type="ShapePath",this.color=new Pt,this.subPaths=[],this.currentPath=null}moveTo(e,t){return this.currentPath=new Z0,this.subPaths.push(this.currentPath),this.currentPath.moveTo(e,t),this}lineTo(e,t){return this.currentPath.lineTo(e,t),this}quadraticCurveTo(e,t,n,s){return this.currentPath.quadraticCurveTo(e,t,n,s),this}bezierCurveTo(e,t,n,s,a,l){return this.currentPath.bezierCurveTo(e,t,n,s,a,l),this}splineThru(e){return this.currentPath.splineThru(e),this}toShapes(e){function t(E){const D=[];for(let L=0,P=E.length;L<P;L++){const G=E[L],H=new yd;H.curves=G.curves,D.push(H)}return D}function n(E,D){const L=D.length;let P=!1;for(let G=L-1,H=0;H<L;G=H++){let F=D[G],X=D[H],z=X.x-F.x,k=X.y-F.y;if(Math.abs(k)>Number.EPSILON){if(k<0&&(F=D[H],z=-z,X=D[G],k=-k),E.y<F.y||E.y>X.y)continue;if(E.y===F.y){if(E.x===F.x)return!0}else{const ie=k*(E.x-F.x)-z*(E.y-F.y);if(ie===0)return!0;if(ie<0)continue;P=!P}}else{if(E.y!==F.y)continue;if(X.x<=E.x&&E.x<=F.x||F.x<=E.x&&E.x<=X.x)return!0}}return P}const s=Vl.isClockWise,a=this.subPaths;if(a.length===0)return[];let l,u,h;const p=[];if(a.length===1)return u=a[0],h=new yd,h.curves=u.curves,p.push(h),p;let m=!s(a[0].getPoints());m=e?!m:m;const v=[],x=[];let _=[],A=0,R;x[A]=void 0,_[A]=[];for(let E=0,D=a.length;E<D;E++)u=a[E],R=u.getPoints(),l=s(R),l=e?!l:l,l?(!m&&x[A]&&A++,x[A]={s:new yd,p:R},x[A].s.curves=u.curves,m&&A++,_[A]=[]):_[A].push({h:u,p:R[0]});if(!x[0])return t(a);if(x.length>1){let E=!1,D=0;for(let L=0,P=x.length;L<P;L++)v[L]=[];for(let L=0,P=x.length;L<P;L++){const G=_[L];for(let H=0;H<G.length;H++){const F=G[H];let X=!0;for(let z=0;z<x.length;z++)n(F.p,x[z].p)&&(L!==z&&D++,X?(X=!1,v[z].push(F)):E=!0);X&&v[L].push(F)}}D>0&&E===!1&&(_=v)}let w;for(let E=0,D=x.length;E<D;E++){h=x[E].s,p.push(h),w=_[E];for(let L=0,P=w.length;L<P;L++)h.holes.push(w[L].h)}return p}}class ON extends eo{constructor(e,t=null){super(),this.object=e,this.domElement=t,this.enabled=!0,this.state=-1,this.keys={},this.mouseButtons={LEFT:null,MIDDLE:null,RIGHT:null},this.touches={ONE:null,TWO:null}}connect(e){if(e===void 0){console.warn("THREE.Controls: connect() now requires an element.");return}this.domElement!==null&&this.disconnect(),this.domElement=e}disconnect(){}dispose(){}update(){}}function NN(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2):(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0),i}function UN(i,e){const t=i.image&&i.image.width?i.image.width/i.image.height:1;return t>e?(i.repeat.x=e/t,i.repeat.y=1,i.offset.x=(1-i.repeat.x)/2,i.offset.y=0):(i.repeat.x=1,i.repeat.y=t/e,i.offset.x=0,i.offset.y=(1-i.repeat.y)/2),i}function zN(i){return i.repeat.x=1,i.repeat.y=1,i.offset.x=0,i.offset.y=0,i}function $1(i,e,t,n){const s=FN(n);switch(t){case wA:return i*e;case RA:return i*e;case BA:return i*e*2;case O_:return i*e/s.components*s.byteLength;case lg:return i*e/s.components*s.byteLength;case IA:return i*e*2/s.components*s.byteLength;case N_:return i*e*2/s.components*s.byteLength;case CA:return i*e*3/s.components*s.byteLength;case Jr:return i*e*4/s.components*s.byteLength;case U_:return i*e*4/s.components*s.byteLength;case B0:case I0:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case D0:case L0:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Ux:case Fx:return Math.max(i,16)*Math.max(e,8)/4;case Nx:case zx:return Math.max(i,8)*Math.max(e,8)/2;case kx:case Hx:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*8;case Gx:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case jx:return Math.floor((i+3)/4)*Math.floor((e+3)/4)*16;case Vx:return Math.floor((i+4)/5)*Math.floor((e+3)/4)*16;case Wx:return Math.floor((i+4)/5)*Math.floor((e+4)/5)*16;case Xx:return Math.floor((i+5)/6)*Math.floor((e+4)/5)*16;case qx:return Math.floor((i+5)/6)*Math.floor((e+5)/6)*16;case Yx:return Math.floor((i+7)/8)*Math.floor((e+4)/5)*16;case Jx:return Math.floor((i+7)/8)*Math.floor((e+5)/6)*16;case Kx:return Math.floor((i+7)/8)*Math.floor((e+7)/8)*16;case Zx:return Math.floor((i+9)/10)*Math.floor((e+4)/5)*16;case Qx:return Math.floor((i+9)/10)*Math.floor((e+5)/6)*16;case $x:return Math.floor((i+9)/10)*Math.floor((e+7)/8)*16;case e_:return Math.floor((i+9)/10)*Math.floor((e+9)/10)*16;case t_:return Math.floor((i+11)/12)*Math.floor((e+9)/10)*16;case n_:return Math.floor((i+11)/12)*Math.floor((e+11)/12)*16;case P0:case i_:case s_:return Math.ceil(i/4)*Math.ceil(e/4)*16;case DA:case r_:return Math.ceil(i/4)*Math.ceil(e/4)*8;case a_:case o_:return Math.ceil(i/4)*Math.ceil(e/4)*16}throw new Error(`Unable to determine texture byte length for ${t} format.`)}function FN(i){switch(i){case vr:case MA:return{byteLength:1,components:1};case Sp:case EA:case Pd:return{byteLength:2,components:1};case L_:case P_:return{byteLength:2,components:4};case kc:case D_:case Yr:return{byteLength:4,components:1};case TA:return{byteLength:4,components:3}}throw new Error(`Unknown texture type ${i}.`)}class kN{static contain(e,t){return NN(e,t)}static cover(e,t){return UN(e,t)}static fill(e){return zN(e)}static getByteLength(e,t,n,s){return $1(e,t,n,s)}}typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("register",{detail:{revision:$u}}));typeof window<"u"&&(window.__THREE__?console.warn("WARNING: Multiple instances of Three.js being imported."):window.__THREE__=$u);
vendor: 4,507 bytes, lines 117-180
117/**
118 * @license
119 * Copyright 2010-2025 Three.js Authors
120 * SPDX-License-Identifier: MIT
121 */function e3(){let i=null,e=!1,t=null,n=null;function s(a,l){t(a,l),n=i.requestAnimationFrame(s)}return{start:function(){e!==!0&&t!==null&&(n=i.requestAnimationFrame(s),e=!0)},stop:function(){i.cancelAnimationFrame(n),e=!1},setAnimationLoop:function(a){t=a},setContext:function(a){i=a}}}function HN(i){const e=new WeakMap;function t(u,h){const p=u.array,m=u.usage,v=p.byteLength,x=i.createBuffer();i.bindBuffer(h,x),i.bufferData(h,p,m),u.onUploadCallback();let _;if(p instanceof Float32Array)_=i.FLOAT;else if(p instanceof Uint16Array)u.isFloat16BufferAttribute?_=i.HALF_FLOAT:_=i.UNSIGNED_SHORT;else if(p instanceof Int16Array)_=i.SHORT;else if(p instanceof Uint32Array)_=i.UNSIGNED_INT;else if(p instanceof Int32Array)_=i.INT;else if(p instanceof Int8Array)_=i.BYTE;else if(p instanceof Uint8Array)_=i.UNSIGNED_BYTE;else if(p instanceof Uint8ClampedArray)_=i.UNSIGNED_BYTE;else throw new Error("THREE.WebGLAttributes: Unsupported buffer data format: "+p);return{buffer:x,type:_,bytesPerElement:p.BYTES_PER_ELEMENT,version:u.version,size:v}}function n(u,h,p){const m=h.array,v=h.updateRanges;if(i.bindBuffer(p,u),v.length===0)i.bufferSubData(p,0,m);else{v.sort((_,A)=>_.start-A.start);let x=0;for(let _=1;_<v.length;_++){const A=v[x],R=v[_];R.start<=A.start+A.count+1?A.count=Math.max(A.count,R.start+R.count-A.start):(++x,v[x]=R)}v.length=x+1;for(let _=0,A=v.length;_<A;_++){const R=v[_];i.bufferSubData(p,R.start*m.BYTES_PER_ELEMENT,m,R.start,R.count)}h.clearUpdateRanges()}h.onUploadCallback()}function s(u){return u.isInterleavedBufferAttribute&&(u=u.data),e.get(u)}function a(u){u.isInterleavedBufferAttribute&&(u=u.data);const h=e.get(u);h&&(i.deleteBuffer(h.buffer),e.delete(u))}function l(u,h){if(u.isInterleavedBufferAttribute&&(u=u.data),u.isGLBufferAttribute){const m=e.get(u);(!m||m.version<u.version)&&e.set(u,{buffer:u.buffer,type:u.type,bytesPerElement:u.elementSize,version:u.version});return}const p=e.get(u);if(p===void 0)e.set(u,t(u,h));else if(p.version<u.version){if(p.size!==u.array.byteLength)throw new Error("THREE.WebGLAttributes: The size of the buffer attribute's array buffer does not match the original size. Resizing buffer attributes is not supported.");n(p.buffer,u,h),p.version=u.version}}return{get:s,remove:a,update:l}}var GN=`#ifdef USE_ALPHAHASH
122	if ( diffuseColor.a < getAlphaHashThreshold( vPosition ) ) discard;
123#endif`,jN=`#ifdef USE_ALPHAHASH
124	const float ALPHA_HASH_SCALE = 0.05;
125	float hash2D( vec2 value ) {
126		return fract( 1.0e4 * sin( 17.0 * value.x + 0.1 * value.y ) * ( 0.1 + abs( sin( 13.0 * value.y + value.x ) ) ) );
127	}
128	float hash3D( vec3 value ) {
129		return hash2D( vec2( hash2D( value.xy ), value.z ) );
130	}
131	float getAlphaHashThreshold( vec3 position ) {
132		float maxDeriv = max(
133			length( dFdx( position.xyz ) ),
134			length( dFdy( position.xyz ) )
135		);
136		float pixScale = 1.0 / ( ALPHA_HASH_SCALE * maxDeriv );
137		vec2 pixScales = vec2(
138			exp2( floor( log2( pixScale ) ) ),
139			exp2( ceil( log2( pixScale ) ) )
140		);
141		vec2 alpha = vec2(
142			hash3D( floor( pixScales.x * position.xyz ) ),
143			hash3D( floor( pixScales.y * position.xyz ) )
144		);
145		float lerpFactor = fract( log2( pixScale ) );
146		float x = ( 1.0 - lerpFactor ) * alpha.x + lerpFactor * alpha.y;
147		float a = min( lerpFactor, 1.0 - lerpFactor );
148		vec3 cases = vec3(
149			x * x / ( 2.0 * a * ( 1.0 - a ) ),
150			( x - 0.5 * a ) / ( 1.0 - a ),
151			1.0 - ( ( 1.0 - x ) * ( 1.0 - x ) / ( 2.0 * a * ( 1.0 - a ) ) )
152		);
153		float threshold = ( x < ( 1.0 - a ) )
154			? ( ( x < a ) ? cases.x : cases.y )
155			: cases.z;
156		return clamp( threshold , 1.0e-6, 1.0 );
157	}
158#endif`,VN=`#ifdef USE_ALPHAMAP
159	diffuseColor.a *= texture2D( alphaMap, vAlphaMapUv ).g;
160#endif`,WN=`#ifdef USE_ALPHAMAP
161	uniform sampler2D alphaMap;
162#endif`,XN=`#ifdef USE_ALPHATEST
163	#ifdef ALPHA_TO_COVERAGE
164	diffuseColor.a = smoothstep( alphaTest, alphaTest + fwidth( diffuseColor.a ), diffuseColor.a );
165	if ( diffuseColor.a == 0.0 ) discard;
166	#else
167	if ( diffuseColor.a < alphaTest ) discard;
168	#endif
169#endif`,qN=`#ifdef USE_ALPHATEST
170	uniform float alphaTest;
171#endif`,YN=`#ifdef USE_AOMAP
172	float ambientOcclusion = ( texture2D( aoMap, vAoMapUv ).r - 1.0 ) * aoMapIntensity + 1.0;
173	reflectedLight.indirectDiffuse *= ambientOcclusion;
174	#if defined( USE_CLEARCOAT ) 
175		clearcoatSpecularIndirect *= ambientOcclusion;
176	#endif
177	#if defined( USE_SHEEN ) 
178		sheenSpecularIndirect *= ambientOcclusion;
179	#endif
180	#if defined( USE_ENVMAP ) && defined( STANDARD )
181		float dotNV = saturate( dot( geometryNormal, geometryViewDir ) );
182		reflectedLight.indirectSpecular *= computeSpecularOcclusion( dotNV, ambientOcclusion, material.roughness );
183	#endif
184#endif`,JN=`#ifdef USE_AOMAP
185	uniform sampler2D aoMap;
186	uniform float aoMapIntensity;
187#endif`,KN=`#ifdef USE_BATCHING
188	#if ! defined( GL_ANGLE_multi_draw )
189	#define gl_DrawID _gl_DrawID
190	uniform int _gl_DrawID;
191	#endif
192	uniform highp sampler2D batchingTexture;
193	uniform highp usampler2D batchingIdTexture;
194	mat4 getBatchingMatrix( const in float i ) {
195		int size = textureSize( batchingTexture, 0 ).x;
196		int j = int( i ) * 4;
197		int x = j % size;
198		int y = j / size;
199		vec4 v1 = texelFetch( batchingTexture, ivec2( x, y ), 0 );
200		vec4 v2 = texelFetch( batchingTexture, ivec2( x + 1, y ), 0 );
201		vec4 v3 = texelFetch( batchingTexture, ivec2( x + 2, y ), 0 );
202		vec4 v4 = texelFetch( batchingTexture, ivec2( x + 3, y ), 0 );
203		return mat4( v1, v2, v3, v4 );
204	}
205	float getIndirectIndex( const in int i ) {
206		int size = textureSize( batchingIdTexture, 0 ).x;
207		int x = i % size;
208		int y = i / size;
209		return float( texelFetch( batchingIdTexture, ivec2( x, y ), 0 ).r );
210	}
211#endif
212#ifdef USE_BATCHING_COLOR
213	uniform sampler2D batchingColorTexture;
214	vec3 getBatchingColor( const in float i ) {
215		int size = textureSize( batchingColorTexture, 0 ).x;
216		int j = int( i );
217		int x = j % size;
218		int y = j / size;
219		return texelFetch( batchingColorTexture, ivec2( x, y ), 0 ).rgb;
220	}
221#endif`,ZN=`#ifdef USE_BATCHING
222	mat4 batchingMatrix = getBatchingMatrix( getIndirectIndex( gl_DrawID ) );
223#endif`,QN=`vec3 transformed = vec3( position );
224#ifdef USE_ALPHAHASH
225	vPosition = vec3( position );
226#endif`,$N=`vec3 objectNormal = vec3( normal );
227#ifdef USE_TANGENT
228	vec3 objectTangent = vec3( tangent.xyz );
229#endif`,eU=`float G_BlinnPhong_Implicit( ) {
230	return 0.25;
231}
232float D_BlinnPhong( const in float shininess, const in float dotNH ) {
233	return RECIPROCAL_PI * ( shininess * 0.5 + 1.0 ) * pow( dotNH, shininess );
234}
235vec3 BRDF_BlinnPhong( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in vec3 specularColor, const in float shininess ) {
236	vec3 halfDir = normalize( lightDir + viewDir );
237	float dotNH = saturate( dot( normal, halfDir ) );
238	float dotVH = saturate( dot( viewDir, halfDir ) );
239	vec3 F = F_Schlick( specularColor, 1.0, dotVH );
240	float G = G_BlinnPhong_Implicit( );
241	float D = D_BlinnPhong( shininess, dotNH );
242	return F * ( G * D );
243} // validated`,tU=`#ifdef USE_IRIDESCENCE
244	const mat3 XYZ_TO_REC709 = mat3(
245		 3.2404542, -0.9692660,  0.0556434,
246		-1.5371385,  1.8760108, -0.2040259,
247		-0.4985314,  0.0415560,  1.0572252
248	);
249	vec3 Fresnel0ToIor( vec3 fresnel0 ) {
250		vec3 sqrtF0 = sqrt( fresnel0 );
251		return ( vec3( 1.0 ) + sqrtF0 ) / ( vec3( 1.0 ) - sqrtF0 );
252	}
253	vec3 IorToFresnel0( vec3 transmittedIor, float incidentIor ) {
254		return pow2( ( transmittedIor - vec3( incidentIor ) ) / ( transmittedIor + vec3( incidentIor ) ) );
255	}
256	float IorToFresnel0( float transmittedIor, float incidentIor ) {
257		return pow2( ( transmittedIor - incidentIor ) / ( transmittedIor + incidentIor ));
258	}
259	vec3 evalSensitivity( float OPD, vec3 shift ) {
260		float phase = 2.0 * PI * OPD * 1.0e-9;
261		vec3 val = vec3( 5.4856e-13, 4.4201e-13, 5.2481e-13 );
262		vec3 pos = vec3( 1.6810e+06, 1.7953e+06, 2.2084e+06 );
263		vec3 var = vec3( 4.3278e+09, 9.3046e+09, 6.6121e+09 );
264		vec3 xyz = val * sqrt( 2.0 * PI * var ) * cos( pos * phase + shift ) * exp( - pow2( phase ) * var );
265		xyz.x += 9.7470e-14 * sqrt( 2.0 * PI * 4.5282e+09 ) * cos( 2.2399e+06 * phase + shift[ 0 ] ) * exp( - 4.5282e+09 * pow2( phase ) );
266		xyz /= 1.0685e-7;
267		vec3 rgb = XYZ_TO_REC709 * xyz;
268		return rgb;
269	}
270	vec3 evalIridescence( float outsideIOR, float eta2, float cosTheta1, float thinFilmThickness, vec3 baseF0 ) {
271		vec3 I;
272		float iridescenceIOR = mix( outsideIOR, eta2, smoothstep( 0.0, 0.03, thinFilmThickness ) );
273		float sinTheta2Sq = pow2( outsideIOR / iridescenceIOR ) * ( 1.0 - pow2( cosTheta1 ) );
274		float cosTheta2Sq = 1.0 - sinTheta2Sq;
275		if ( cosTheta2Sq < 0.0 ) {
276			return vec3( 1.0 );
277		}
278		float cosTheta2 = sqrt( cosTheta2Sq );
279		float R0 = IorToFresnel0( iridescenceIOR, outsideIOR );
280		float R12 = F_Schlick( R0, 1.0, cosTheta1 );
281		float T121 = 1.0 - R12;
282		float phi12 = 0.0;
283		if ( iridescenceIOR < outsideIOR ) phi12 = PI;
284		float phi21 = PI - phi12;
285		vec3 baseIOR = Fresnel0ToIor( clamp( baseF0, 0.0, 0.9999 ) );		vec3 R1 = IorToFresnel0( baseIOR, iridescenceIOR );
286		vec3 R23 = F_Schlick( R1, 1.0, cosTheta2 );
287		vec3 phi23 = vec3( 0.0 );
288		if ( baseIOR[ 0 ] < iridescenceIOR ) phi23[ 0 ] = PI;
289		if ( baseIOR[ 1 ] < iridescenceIOR ) phi23[ 1 ] = PI;
290		if ( baseIOR[ 2 ] < iridescenceIOR ) phi23[ 2 ] = PI;
291		float OPD = 2.0 * iridescenceIOR * thinFilmThickness * cosTheta2;
292		vec3 phi = vec3( phi21 ) + phi23;
293		vec3 R123 = clamp( R12 * R23, 1e-5, 0.9999 );
294		vec3 r123 = sqrt( R123 );
295		vec3 Rs = pow2( T121 ) * R23 / ( vec3( 1.0 ) - R123 );
296		vec3 C0 = R12 + Rs;
297		I = C0;
298		vec3 Cm = Rs - T121;
299		for ( int m = 1; m <= 2; ++ m ) {
300			Cm *= r123;
301			vec3 Sm = 2.0 * evalSensitivity( float( m ) * OPD, float( m ) * phi );
302			I += Cm * Sm;
303		}
304		return max( I, vec3( 0.0 ) );
305	}
306#endif`,nU=`#ifdef USE_BUMPMAP
307	uniform sampler2D bumpMap;
308	uniform float bumpScale;
309	vec2 dHdxy_fwd() {
310		vec2 dSTdx = dFdx( vBumpMapUv );
311		vec2 dSTdy = dFdy( vBumpMapUv );
312		float Hll = bumpScale * texture2D( bumpMap, vBumpMapUv ).x;
313		float dBx = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdx ).x - Hll;
314		float dBy = bumpScale * texture2D( bumpMap, vBumpMapUv + dSTdy ).x - Hll;
315		return vec2( dBx, dBy );
316	}
317	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, float faceDirection ) {
318		vec3 vSigmaX = normalize( dFdx( surf_pos.xyz ) );
319		vec3 vSigmaY = normalize( dFdy( surf_pos.xyz ) );
320		vec3 vN = surf_norm;
321		vec3 R1 = cross( vSigmaY, vN );
322		vec3 R2 = cross( vN, vSigmaX );
323		float fDet = dot( vSigmaX, R1 ) * faceDirection;
324		vec3 vGrad = sign( fDet ) * ( dHdxy.x * R1 + dHdxy.y * R2 );
325		return normalize( abs( fDet ) * surf_norm - vGrad );
326	}
327#endif`,iU=`#if NUM_CLIPPING_PLANES > 0
328	vec4 plane;
329	#ifdef ALPHA_TO_COVERAGE
330		float distanceToPlane, distanceGradient;
331		float clipOpacity = 1.0;
332		#pragma unroll_loop_start
333		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
334			plane = clippingPlanes[ i ];
335			distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
336			distanceGradient = fwidth( distanceToPlane ) / 2.0;
337			clipOpacity *= smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
338			if ( clipOpacity == 0.0 ) discard;
339		}
340		#pragma unroll_loop_end
341		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
342			float unionClipOpacity = 1.0;
343			#pragma unroll_loop_start
344			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
345				plane = clippingPlanes[ i ];
346				distanceToPlane = - dot( vClipPosition, plane.xyz ) + plane.w;
347				distanceGradient = fwidth( distanceToPlane ) / 2.0;
348				unionClipOpacity *= 1.0 - smoothstep( - distanceGradient, distanceGradient, distanceToPlane );
349			}
350			#pragma unroll_loop_end
351			clipOpacity *= 1.0 - unionClipOpacity;
352		#endif
353		diffuseColor.a *= clipOpacity;
354		if ( diffuseColor.a == 0.0 ) discard;
355	#else
356		#pragma unroll_loop_start
357		for ( int i = 0; i < UNION_CLIPPING_PLANES; i ++ ) {
358			plane = clippingPlanes[ i ];
359			if ( dot( vClipPosition, plane.xyz ) > plane.w ) discard;
360		}
361		#pragma unroll_loop_end
362		#if UNION_CLIPPING_PLANES < NUM_CLIPPING_PLANES
363			bool clipped = true;
364			#pragma unroll_loop_start
365			for ( int i = UNION_CLIPPING_PLANES; i < NUM_CLIPPING_PLANES; i ++ ) {
366				plane = clippingPlanes[ i ];
367				clipped = ( dot( vClipPosition, plane.xyz ) > plane.w ) && clipped;
368			}
369			#pragma unroll_loop_end
370			if ( clipped ) discard;
371		#endif
372	#endif
373#endif`,sU=`#if NUM_CLIPPING_PLANES > 0
374	varying vec3 vClipPosition;
375	uniform vec4 clippingPlanes[ NUM_CLIPPING_PLANES ];
376#endif`,rU=`#if NUM_CLIPPING_PLANES > 0
377	varying vec3 vClipPosition;
378#endif`,aU=`#if NUM_CLIPPING_PLANES > 0
379	vClipPosition = - mvPosition.xyz;
380#endif`,oU=`#if defined( USE_COLOR_ALPHA )
381	diffuseColor *= vColor;
382#elif defined( USE_COLOR )
383	diffuseColor.rgb *= vColor;
384#endif`,lU=`#if defined( USE_COLOR_ALPHA )
385	varying vec4 vColor;
386#elif defined( USE_COLOR )
387	varying vec3 vColor;
388#endif`,cU=`#if defined( USE_COLOR_ALPHA )
389	varying vec4 vColor;
390#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
391	varying vec3 vColor;
392#endif`,uU=`#if defined( USE_COLOR_ALPHA )
393	vColor = vec4( 1.0 );
394#elif defined( USE_COLOR ) || defined( USE_INSTANCING_COLOR ) || defined( USE_BATCHING_COLOR )
395	vColor = vec3( 1.0 );
396#endif
397#ifdef USE_COLOR
398	vColor *= color;
399#endif
400#ifdef USE_INSTANCING_COLOR
401	vColor.xyz *= instanceColor.xyz;
402#endif
403#ifdef USE_BATCHING_COLOR
404	vec3 batchingColor = getBatchingColor( getIndirectIndex( gl_DrawID ) );
405	vColor.xyz *= batchingColor.xyz;
406#endif`,fU=`#define PI 3.141592653589793
407#define PI2 6.283185307179586
408#define PI_HALF 1.5707963267948966
409#define RECIPROCAL_PI 0.3183098861837907
410#define RECIPROCAL_PI2 0.15915494309189535
411#define EPSILON 1e-6
412#ifndef saturate
413#define saturate( a ) clamp( a, 0.0, 1.0 )
414#endif
415#define whiteComplement( a ) ( 1.0 - saturate( a ) )
416float pow2( const in float x ) { return x*x; }
417vec3 pow2( const in vec3 x ) { return x*x; }
418float pow3( const in float x ) { return x*x*x; }
419float pow4( const in float x ) { float x2 = x*x; return x2*x2; }
420float max3( const in vec3 v ) { return max( max( v.x, v.y ), v.z ); }
421float average( const in vec3 v ) { return dot( v, vec3( 0.3333333 ) ); }
422highp float rand( const in vec2 uv ) {
423	const highp float a = 12.9898, b = 78.233, c = 43758.5453;
424	highp float dt = dot( uv.xy, vec2( a,b ) ), sn = mod( dt, PI );
425	return fract( sin( sn ) * c );
426}
427#ifdef HIGH_PRECISION
428	float precisionSafeLength( vec3 v ) { return length( v ); }
429#else
430	float precisionSafeLength( vec3 v ) {
431		float maxComponent = max3( abs( v ) );
432		return length( v / maxComponent ) * maxComponent;
433	}
434#endif
435struct IncidentLight {
436	vec3 color;
437	vec3 direction;
438	bool visible;
439};
440struct ReflectedLight {
441	vec3 directDiffuse;
442	vec3 directSpecular;
443	vec3 indirectDiffuse;
444	vec3 indirectSpecular;
445};
446#ifdef USE_ALPHAHASH
447	varying vec3 vPosition;
448#endif
449vec3 transformDirection( in vec3 dir, in mat4 matrix ) {
450	return normalize( ( matrix * vec4( dir, 0.0 ) ).xyz );
451}
452vec3 inverseTransformDirection( in vec3 dir, in mat4 matrix ) {
453	return normalize( ( vec4( dir, 0.0 ) * matrix ).xyz );
454}
455mat3 transposeMat3( const in mat3 m ) {
456	mat3 tmp;
457	tmp[ 0 ] = vec3( m[ 0 ].x, m[ 1 ].x, m[ 2 ].x );
458	tmp[ 1 ] = vec3( m[ 0 ].y, m[ 1 ].y, m[ 2 ].y );
459	tmp[ 2 ] = vec3( m[ 0 ].z, m[ 1 ].z, m[ 2 ].z );
460	return tmp;
461}
462bool isPerspectiveMatrix( mat4 m ) {
463	return m[ 2 ][ 3 ] == - 1.0;
464}
465vec2 equirectUv( in vec3 dir ) {
466	float u = atan( dir.z, dir.x ) * RECIPROCAL_PI2 + 0.5;
467	float v = asin( clamp( dir.y, - 1.0, 1.0 ) ) * RECIPROCAL_PI + 0.5;
468	return vec2( u, v );
469}
470vec3 BRDF_Lambert( const in vec3 diffuseColor ) {
471	return RECIPROCAL_PI * diffuseColor;
472}
473vec3 F_Schlick( const in vec3 f0, const in float f90, const in float dotVH ) {
474	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
475	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
476}
477float F_Schlick( const in float f0, const in float f90, const in float dotVH ) {
478	float fresnel = exp2( ( - 5.55473 * dotVH - 6.98316 ) * dotVH );
479	return f0 * ( 1.0 - fresnel ) + ( f90 * fresnel );
480} // validated`,dU=`#ifdef ENVMAP_TYPE_CUBE_UV
481	#define cubeUV_minMipLevel 4.0
482	#define cubeUV_minTileSize 16.0
483	float getFace( vec3 direction ) {
484		vec3 absDirection = abs( direction );
485		float face = - 1.0;
486		if ( absDirection.x > absDirection.z ) {
487			if ( absDirection.x > absDirection.y )
488				face = direction.x > 0.0 ? 0.0 : 3.0;
489			else
490				face = direction.y > 0.0 ? 1.0 : 4.0;
491		} else {
492			if ( absDirection.z > absDirection.y )
493				face = direction.z > 0.0 ? 2.0 : 5.0;
494			else
495				face = direction.y > 0.0 ? 1.0 : 4.0;
496		}
497		return face;
498	}
499	vec2 getUV( vec3 direction, float face ) {
500		vec2 uv;
501		if ( face == 0.0 ) {
502			uv = vec2( direction.z, direction.y ) / abs( direction.x );
503		} else if ( face == 1.0 ) {
504			uv = vec2( - direction.x, - direction.z ) / abs( direction.y );
505		} else if ( face == 2.0 ) {
506			uv = vec2( - direction.x, direction.y ) / abs( direction.z );
507		} else if ( face == 3.0 ) {
508			uv = vec2( - direction.z, direction.y ) / abs( direction.x );
509		} else if ( face == 4.0 ) {
510			uv = vec2( - direction.x, direction.z ) / abs( direction.y );
511		} else {
512			uv = vec2( direction.x, direction.y ) / abs( direction.z );
513		}
514		return 0.5 * ( uv + 1.0 );
515	}
516	vec3 bilinearCubeUV( sampler2D envMap, vec3 direction, float mipInt ) {
517		float face = getFace( direction );
518		float filterInt = max( cubeUV_minMipLevel - mipInt, 0.0 );
519		mipInt = max( mipInt, cubeUV_minMipLevel );
520		float faceSize = exp2( mipInt );
521		highp vec2 uv = getUV( direction, face ) * ( faceSize - 2.0 ) + 1.0;
522		if ( face > 2.0 ) {
523			uv.y += faceSize;
524			face -= 3.0;
525		}
526		uv.x += face * faceSize;
527		uv.x += filterInt * 3.0 * cubeUV_minTileSize;
528		uv.y += 4.0 * ( exp2( CUBEUV_MAX_MIP ) - faceSize );
529		uv.x *= CUBEUV_TEXEL_WIDTH;
530		uv.y *= CUBEUV_TEXEL_HEIGHT;
531		#ifdef texture2DGradEXT
532			return texture2DGradEXT( envMap, uv, vec2( 0.0 ), vec2( 0.0 ) ).rgb;
533		#else
534			return texture2D( envMap, uv ).rgb;
535		#endif
536	}
537	#define cubeUV_r0 1.0
538	#define cubeUV_m0 - 2.0
539	#define cubeUV_r1 0.8
540	#define cubeUV_m1 - 1.0
541	#define cubeUV_r4 0.4
542	#define cubeUV_m4 2.0
543	#define cubeUV_r5 0.305
544	#define cubeUV_m5 3.0
545	#define cubeUV_r6 0.21
546	#define cubeUV_m6 4.0
547	float roughnessToMip( float roughness ) {
548		float mip = 0.0;
549		if ( roughness >= cubeUV_r1 ) {
550			mip = ( cubeUV_r0 - roughness ) * ( cubeUV_m1 - cubeUV_m0 ) / ( cubeUV_r0 - cubeUV_r1 ) + cubeUV_m0;
551		} else if ( roughness >= cubeUV_r4 ) {
552			mip = ( cubeUV_r1 - roughness ) * ( cubeUV_m4 - cubeUV_m1 ) / ( cubeUV_r1 - cubeUV_r4 ) + cubeUV_m1;
553		} else if ( roughness >= cubeUV_r5 ) {
554			mip = ( cubeUV_r4 - roughness ) * ( cubeUV_m5 - cubeUV_m4 ) / ( cubeUV_r4 - cubeUV_r5 ) + cubeUV_m4;
555		} else if ( roughness >= cubeUV_r6 ) {
556			mip = ( cubeUV_r5 - roughness ) * ( cubeUV_m6 - cubeUV_m5 ) / ( cubeUV_r5 - cubeUV_r6 ) + cubeUV_m5;
557		} else {
558			mip = - 2.0 * log2( 1.16 * roughness );		}
559		return mip;
560	}
561	vec4 textureCubeUV( sampler2D envMap, vec3 sampleDir, float roughness ) {
562		float mip = clamp( roughnessToMip( roughness ), cubeUV_m0, CUBEUV_MAX_MIP );
563		float mipF = fract( mip );
564		float mipInt = floor( mip );
565		vec3 color0 = bilinearCubeUV( envMap, sampleDir, mipInt );
566		if ( mipF == 0.0 ) {
567			return vec4( color0, 1.0 );
568		} else {
569			vec3 color1 = bilinearCubeUV( envMap, sampleDir, mipInt + 1.0 );
570			return vec4( mix( color0, color1, mipF ), 1.0 );
571		}
572	}
573#endif`,hU=`vec3 transformedNormal = objectNormal;
574#ifdef USE_TANGENT
575	vec3 transformedTangent = objectTangent;
576#endif
577#ifdef USE_BATCHING
578	mat3 bm = mat3( batchingMatrix );
579	transformedNormal /= vec3( dot( bm[ 0 ], bm[ 0 ] ), dot( bm[ 1 ], bm[ 1 ] ), dot( bm[ 2 ], bm[ 2 ] ) );
580	transformedNormal = bm * transformedNormal;
581	#ifdef USE_TANGENT
582		transformedTangent = bm * transformedTangent;
583	#endif
584#endif
585#ifdef USE_INSTANCING
586	mat3 im = mat3( instanceMatrix );
587	transformedNormal /= vec3( dot( im[ 0 ], im[ 0 ] ), dot( im[ 1 ], im[ 1 ] ), dot( im[ 2 ], im[ 2 ] ) );
588	transformedNormal = im * transformedNormal;
589	#ifdef USE_TANGENT
590		transformedTangent = im * transformedTangent;
591	#endif
592#endif
593transformedNormal = normalMatrix * transformedNormal;
594#ifdef FLIP_SIDED
595	transformedNormal = - transformedNormal;
596#endif
597#ifdef USE_TANGENT
598	transformedTangent = ( modelViewMatrix * vec4( transformedTangent, 0.0 ) ).xyz;
599	#ifdef FLIP_SIDED
600		transformedTangent = - transformedTangent;
601	#endif
602#endif`,pU=`#ifdef USE_DISPLACEMENTMAP
603	uniform sampler2D displacementMap;
604	uniform float displacementScale;
605	uniform float displacementBias;
606#endif`,mU=`#ifdef USE_DISPLACEMENTMAP
607	transformed += normalize( objectNormal ) * ( texture2D( displacementMap, vDisplacementMapUv ).x * displacementScale + dis
607placementBias );
608#endif`,gU=`#ifdef USE_EMISSIVEMAP
609	vec4 emissiveColor = texture2D( emissiveMap, vEmissiveMapUv );
610	#ifdef DECODE_VIDEO_TEXTURE_EMISSIVE
611		emissiveColor = sRGBTransferEOTF( emissiveColor );
612	#endif
613	totalEmissiveRadiance *= emissiveColor.rgb;
614#endif`,vU=`#ifdef USE_EMISSIVEMAP
615	uniform sampler2D emissiveMap;
616#endif`,yU="gl_FragColor = linearToOutputTexel( gl_FragColor );",xU=`vec4 LinearTransferOETF( in vec4 value ) {
617	return value;
618}
619vec4 sRGBTransferEOTF( in vec4 value ) {
620	return vec4( mix( pow( value.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), value.rgb * 0.0773993808, vec3( lessThanEqual( value.rgb, vec3( 0.04045 ) ) ) ), value.a );
621}
622vec4 sRGBTransferOETF( in vec4 value ) {
623	return vec4( mix( pow( value.rgb, vec3( 0.41666 ) ) * 1.055 - vec3( 0.055 ), value.rgb * 12.92, vec3( lessThanEqual( value.rgb, vec3( 0.0031308 ) ) ) ), value.a );
624}`,_U=`#ifdef USE_ENVMAP
625	#ifdef ENV_WORLDPOS
626		vec3 cameraToFrag;
627		if ( isOrthographic ) {
628			cameraToFrag = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
629		} else {
630			cameraToFrag = normalize( vWorldPosition - cameraPosition );
631		}
632		vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
633		#ifdef ENVMAP_MODE_REFLECTION
634			vec3 reflectVec = reflect( cameraToFrag, worldNormal );
635		#else
636			vec3 reflectVec = refract( cameraToFrag, worldNormal, refractionRatio );
637		#endif
638	#else
639		vec3 reflectVec = vReflect;
640	#endif
641	#ifdef ENVMAP_TYPE_CUBE
642		vec4 envColor = textureCube( envMap, envMapRotation * vec3( flipEnvMap * reflectVec.x, reflectVec.yz ) );
643	#else
644		vec4 envColor = vec4( 0.0 );
645	#endif
646	#ifdef ENVMAP_BLENDING_MULTIPLY
647		outgoingLight = mix( outgoingLight, outgoingLight * envColor.xyz, specularStrength * reflectivity );
648	#elif defined( ENVMAP_BLENDING_MIX )
649		outgoingLight = mix( outgoingLight, envColor.xyz, specularStrength * reflectivity );
650	#elif defined( ENVMAP_BLENDING_ADD )
651		outgoingLight += envColor.xyz * specularStrength * reflectivity;
652	#endif
653#endif`,bU=`#ifdef USE_ENVMAP
654	uniform float envMapIntensity;
655	uniform float flipEnvMap;
656	uniform mat3 envMapRotation;
657	#ifdef ENVMAP_TYPE_CUBE
658		uniform samplerCube envMap;
659	#else
660		uniform sampler2D envMap;
661	#endif
662	
663#endif`,SU=`#ifdef USE_ENVMAP
664	uniform float reflectivity;
665	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
666		#define ENV_WORLDPOS
667	#endif
668	#ifdef ENV_WORLDPOS
669		varying vec3 vWorldPosition;
670		uniform float refractionRatio;
671	#else
672		varying vec3 vReflect;
673	#endif
674#endif`,AU=`#ifdef USE_ENVMAP
675	#if defined( USE_BUMPMAP ) || defined( USE_NORMALMAP ) || defined( PHONG ) || defined( LAMBERT )
676		#define ENV_WORLDPOS
677	#endif
678	#ifdef ENV_WORLDPOS
679		
680		varying vec3 vWorldPosition;
681	#else
682		varying vec3 vReflect;
683		uniform float refractionRatio;
684	#endif
685#endif`,MU=`#ifdef USE_ENVMAP
686	#ifdef ENV_WORLDPOS
687		vWorldPosition = worldPosition.xyz;
688	#else
689		vec3 cameraToVertex;
690		if ( isOrthographic ) {
691			cameraToVertex = normalize( vec3( - viewMatrix[ 0 ][ 2 ], - viewMatrix[ 1 ][ 2 ], - viewMatrix[ 2 ][ 2 ] ) );
692		} else {
693			cameraToVertex = normalize( worldPosition.xyz - cameraPosition );
694		}
695		vec3 worldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
696		#ifdef ENVMAP_MODE_REFLECTION
697			vReflect = reflect( cameraToVertex, worldNormal );
698		#else
699			vReflect = refract( cameraToVertex, worldNormal, refractionRatio );
700		#endif
701	#endif
702#endif`,EU=`#ifdef USE_FOG
703	vFogDepth = - mvPosition.z;
704#endif`,TU=`#ifdef USE_FOG
705	varying float vFogDepth;
706#endif`,wU=`#ifdef USE_FOG
707	#ifdef FOG_EXP2
708		float fogFactor = 1.0 - exp( - fogDensity * fogDensity * vFogDepth * vFogDepth );
709	#else
710		float fogFactor = smoothstep( fogNear, fogFar, vFogDepth );
711	#endif
712	gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
713#endif`,CU=`#ifdef USE_FOG
714	uniform vec3 fogColor;
715	varying float vFogDepth;
716	#ifdef FOG_EXP2
717		uniform float fogDensity;
718	#else
719		uniform float fogNear;
720		uniform float fogFar;
721	#endif
722#endif`,RU=`#ifdef USE_GRADIENTMAP
723	uniform sampler2D gradientMap;
724#endif
725vec3 getGradientIrradiance( vec3 normal, vec3 lightDirection ) {
726	float dotNL = dot( normal, lightDirection );
727	vec2 coord = vec2( dotNL * 0.5 + 0.5, 0.0 );
728	#ifdef USE_GRADIENTMAP
729		return vec3( texture2D( gradientMap, coord ).r );
730	#else
731		vec2 fw = fwidth( coord ) * 0.5;
732		return mix( vec3( 0.7 ), vec3( 1.0 ), smoothstep( 0.7 - fw.x, 0.7 + fw.x, coord.x ) );
733	#endif
734}`,BU=`#ifdef USE_LIGHTMAP
735	uniform sampler2D lightMap;
736	uniform float lightMapIntensity;
737#endif`,IU=`LambertMaterial material;
738material.diffuseColor = diffuseColor.rgb;
739material.specularStrength = specularStrength;`,DU=`varying vec3 vViewPosition;
740struct LambertMaterial {
741	vec3 diffuseColor;
742	float specularStrength;
743};
744void RE_Direct_Lambert( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
745	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
746	vec3 irradiance = dotNL * directLight.color;
747	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
748}
749void RE_IndirectDiffuse_Lambert( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in LambertMaterial material, inout ReflectedLight reflectedLight ) {
750	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
751}
752#define RE_Direct				RE_Direct_Lambert
753#define RE_IndirectDiffuse		RE_IndirectDiffuse_Lambert`,LU=`uniform bool receiveShadow;
754uniform vec3 ambientLightColor;
755#if defined( USE_LIGHT_PROBES )
756	uniform vec3 lightProbe[ 9 ];
757#endif
758vec3 shGetIrradianceAt( in vec3 normal, in vec3 shCoefficients[ 9 ] ) {
759	float x = normal.x, y = normal.y, z = normal.z;
760	vec3 result = shCoefficients[ 0 ] * 0.886227;
761	result += shCoefficients[ 1 ] * 2.0 * 0.511664 * y;
762	result += shCoefficients[ 2 ] * 2.0 * 0.511664 * z;
763	result += shCoefficients[ 3 ] * 2.0 * 0.511664 * x;
764	result += shCoefficients[ 4 ] * 2.0 * 0.429043 * x * y;
765	result += shCoefficients[ 5 ] * 2.0 * 0.429043 * y * z;
766	result += shCoefficients[ 6 ] * ( 0.743125 * z * z - 0.247708 );
767	result += shCoefficients[ 7 ] * 2.0 * 0.429043 * x * z;
768	result += shCoefficients[ 8 ] * 0.429043 * ( x * x - y * y );
769	return result;
770}
771vec3 getLightProbeIrradiance( const in vec3 lightProbe[ 9 ], const in vec3 normal ) {
772	vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
773	vec3 irradiance = shGetIrradianceAt( worldNormal, lightProbe );
774	return irradiance;
775}
776vec3 getAmbientLightIrradiance( const in vec3 ambientLightColor ) {
777	vec3 irradiance = ambientLightColor;
778	return irradiance;
779}
780float getDistanceAttenuation( const in float lightDistance, const in float cutoffDistance, const in float decayExponent ) {
781	float distanceFalloff = 1.0 / max( pow( lightDistance, decayExponent ), 0.01 );
782	if ( cutoffDistance > 0.0 ) {
783		distanceFalloff *= pow2( saturate( 1.0 - pow4( lightDistance / cutoffDistance ) ) );
784	}
785	return distanceFalloff;
786}
787float getSpotAttenuation( const in float coneCosine, const in float penumbraCosine, const in float angleCosine ) {
788	return smoothstep( coneCosine, penumbraCosine, angleCosine );
789}
790#if NUM_DIR_LIGHTS > 0
791	struct DirectionalLight {
792		vec3 direction;
793		vec3 color;
794	};
795	uniform DirectionalLight directionalLights[ NUM_DIR_LIGHTS ];
796	void getDirectionalLightInfo( const in DirectionalLight directionalLight, out IncidentLight light ) {
797		light.color = directionalLight.color;
798		light.direction = directionalLight.direction;
799		light.visible = true;
800	}
801#endif
802#if NUM_POINT_LIGHTS > 0
803	struct PointLight {
804		vec3 position;
805		vec3 color;
806		float distance;
807		float decay;
808	};
809	uniform PointLight pointLights[ NUM_POINT_LIGHTS ];
810	void getPointLightInfo( const in PointLight pointLight, const in vec3 geometryPosition, out IncidentLight light ) {
811		vec3 lVector = pointLight.position - geometryPosition;
812		light.direction = normalize( lVector );
813		float lightDistance = length( lVector );
814		light.color = pointLight.color;
815		light.color *= getDistanceAttenuation( lightDistance, pointLight.distance, pointLight.decay );
816		light.visible = ( light.color != vec3( 0.0 ) );
817	}
818#endif
819#if NUM_SPOT_LIGHTS > 0
820	struct SpotLight {
821		vec3 position;
822		vec3 direction;
823		vec3 color;
824		float distance;
825		float decay;
826		float coneCos;
827		float penumbraCos;
828	};
829	uniform SpotLight spotLights[ NUM_SPOT_LIGHTS ];
830	void getSpotLightInfo( const in SpotLight spotLight, const in vec3 geometryPosition, out IncidentLight light ) {
831		vec3 lVector = spotLight.position - geometryPosition;
832		light.direction = normalize( lVector );
833		float angleCos = dot( light.direction, spotLight.direction );
834		float spotAttenuation = getSpotAttenuation( spotLight.coneCos, spotLight.penumbraCos, angleCos );
835		if ( spotAttenuation > 0.0 ) {
836			float lightDistance = length( lVector );
837			light.color = spotLight.color * spotAttenuation;
838			light.color *= getDistanceAttenuation( lightDistance, spotLight.distance, spotLight.decay );
839			light.visible = ( light.color != vec3( 0.0 ) );
840		} else {
841			light.color = vec3( 0.0 );
842			light.visible = false;
843		}
844	}
845#endif
846#if NUM_RECT_AREA_LIGHTS > 0
847	struct RectAreaLight {
848		vec3 color;
849		vec3 position;
850		vec3 halfWidth;
851		vec3 halfHeight;
852	};
853	uniform sampler2D ltc_1;	uniform sampler2D ltc_2;
854	uniform RectAreaLight rectAreaLights[ NUM_RECT_AREA_LIGHTS ];
855#endif
856#if NUM_HEMI_LIGHTS > 0
857	struct HemisphereLight {
858		vec3 direction;
859		vec3 skyColor;
860		vec3 groundColor;
861	};
862	uniform HemisphereLight hemisphereLights[ NUM_HEMI_LIGHTS ];
863	vec3 getHemisphereLightIrradiance( const in HemisphereLight hemiLight, const in vec3 normal ) {
864		float dotNL = dot( normal, hemiLight.direction );
865		float hemiDiffuseWeight = 0.5 * dotNL + 0.5;
866		vec3 irradiance = mix( hemiLight.groundColor, hemiLight.skyColor, hemiDiffuseWeight );
867		return irradiance;
868	}
869#endif`,PU=`#ifdef USE_ENVMAP
870	vec3 getIBLIrradiance( const in vec3 normal ) {
871		#ifdef ENVMAP_TYPE_CUBE_UV
872			vec3 worldNormal = inverseTransformDirection( normal, viewMatrix );
873			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * worldNormal, 1.0 );
874			return PI * envMapColor.rgb * envMapIntensity;
875		#else
876			return vec3( 0.0 );
877		#endif
878	}
879	vec3 getIBLRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness ) {
880		#ifdef ENVMAP_TYPE_CUBE_UV
881			vec3 reflectVec = reflect( - viewDir, normal );
882			reflectVec = normalize( mix( reflectVec, normal, roughness * roughness) );
883			reflectVec = inverseTransformDirection( reflectVec, viewMatrix );
884			vec4 envMapColor = textureCubeUV( envMap, envMapRotation * reflectVec, roughness );
885			return envMapColor.rgb * envMapIntensity;
886		#else
887			return vec3( 0.0 );
888		#endif
889	}
890	#ifdef USE_ANISOTROPY
891		vec3 getIBLAnisotropyRadiance( const in vec3 viewDir, const in vec3 normal, const in float roughness, const in vec3 bitangent, const in float anisotropy ) {
892			#ifdef ENVMAP_TYPE_CUBE_UV
893				vec3 bentNormal = cross( bitangent, viewDir );
894				bentNormal = normalize( cross( bentNormal, bitangent ) );
895				bentNormal = normalize( mix( bentNormal, normal, pow2( pow2( 1.0 - anisotropy * ( 1.0 - roughness ) ) ) ) );
896				return getIBLRadiance( viewDir, bentNormal, roughness );
897			#else
898				return vec3( 0.0 );
899			#endif
900		}
901	#endif
902#endif`,OU=`ToonMaterial material;
903material.diffuseColor = diffuseColor.rgb;`,NU=`varying vec3 vViewPosition;
904struct ToonMaterial {
905	vec3 diffuseColor;
906};
907void RE_Direct_Toon( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
908	vec3 irradiance = getGradientIrradiance( geometryNormal, directLight.direction ) * directLight.color;
909	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
910}
911void RE_IndirectDiffuse_Toon( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in ToonMaterial material, inout ReflectedLight reflectedLight ) {
912	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
913}
914#define RE_Direct				RE_Direct_Toon
915#define RE_IndirectDiffuse		RE_IndirectDiffuse_Toon`,UU=`BlinnPhongMaterial material;
916material.diffuseColor = diffuseColor.rgb;
917material.specularColor = specular;
918material.specularShininess = shininess;
919material.specularStrength = specularStrength;`,zU=`varying vec3 vViewPosition;
920struct BlinnPhongMaterial {
921	vec3 diffuseColor;
922	vec3 specularColor;
923	float specularShininess;
924	float specularStrength;
925};
926void RE_Direct_BlinnPhong( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
927	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
928	vec3 irradiance = dotNL * directLight.color;
929	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
930	reflectedLight.directSpecular += irradiance * BRDF_BlinnPhong( directLight.direction, geometryViewDir, geometryNormal, material.specularColor, material.specularShininess ) * material.specularStrength;
931}
932void RE_IndirectDiffuse_BlinnPhong( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in BlinnPhongMaterial material, inout ReflectedLight reflectedLight ) {
933	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
934}
935#define RE_Direct				RE_Direct_BlinnPhong
936#define RE_IndirectDiffuse		RE_IndirectDiffuse_BlinnPhong`,FU=`PhysicalMaterial material;
937material.diffuseColor = diffuseColor.rgb * ( 1.0 - metalnessFactor );
938vec3 dxy = max( abs( dFdx( nonPerturbedNormal ) ), abs( dFdy( nonPerturbedNormal ) ) );
939float geometryRoughness = max( max( dxy.x, dxy.y ), dxy.z );
940material.roughness = max( roughnessFactor, 0.0525 );material.roughness += geometryRoughness;
941material.roughness = min( material.roughness, 1.0 );
942#ifdef IOR
943	material.ior = ior;
944	#ifdef USE_SPECULAR
945		float specularIntensityFactor = specularIntensity;
946		vec3 specularColorFactor = specularColor;
947		#ifdef USE_SPECULAR_COLORMAP
948			specularColorFactor *= texture2D( specularColorMap, vSpecularColorMapUv ).rgb;
949		#endif
950		#ifdef USE_SPECULAR_INTENSITYMAP
951			specularIntensityFactor *= texture2D( specularIntensityMap, vSpecularIntensityMapUv ).a;
952		#endif
953		material.specularF90 = mix( specularIntensityFactor, 1.0, metalnessFactor );
954	#else
955		float specularIntensityFactor = 1.0;
956		vec3 specularColorFactor = vec3( 1.0 );
957		material.specularF90 = 1.0;
958	#endif
959	material.specularColor = mix( min( pow2( ( material.ior - 1.0 ) / ( material.ior + 1.0 ) ) * specularColorFactor, vec3( 1.0 ) ) * specularIntensityFactor, diffuseColor.rgb, metalnessFactor );
960#else
961	material.specularColor = mix( vec3( 0.04 ), diffuseColor.rgb, metalnessFactor );
962	material.specularF90 = 1.0;
963#endif
964#ifdef USE_CLEARCOAT
965	material.clearcoat = clearcoat;
966	material.clearcoatRoughness = clearcoatRoughness;
967	material.clearcoatF0 = vec3( 0.04 );
968	material.clearcoatF90 = 1.0;
969	#ifdef USE_CLEARCOATMAP
970		material.clearcoat *= texture2D( clearcoatMap, vClearcoatMapUv ).x;
971	#endif
972	#ifdef USE_CLEARCOAT_ROUGHNESSMAP
973		material.clearcoatRoughness *= texture2D( clearcoatRoughnessMap, vClearcoatRoughnessMapUv ).y;
974	#endif
975	material.clearcoat = saturate( material.clearcoat );	material.clearcoatRoughness = max( material.clearcoatRoughness, 0.0525 );
976	material.clearcoatRoughness += geometryRoughness;
977	material.clearcoatRoughness = min( material.clearcoatRoughness, 1.0 );
978#endif
979#ifdef USE_DISPERSION
980	material.dispersion = dispersion;
981#endif
982#ifdef USE_IRIDESCENCE
983	material.iridescence = iridescence;
984	material.iridescenceIOR = iridescenceIOR;
985	#ifdef USE_IRIDESCENCEMAP
986		material.iridescence *= texture2D( iridescenceMap, vIridescenceMapUv ).r;
987	#endif
988	#ifdef USE_IRIDESCENCE_THICKNESSMAP
989		material.iridescenceThickness = (iridescenceThicknessMaximum - iridescenceThicknessMinimum) * texture2D( iridescenceThicknessMap, vIridescenceThicknessMapUv ).g + iridescenceThicknessMinimum;
990	#else
991		material.iridescenceThickness = iridescenceThicknessMaximum;
992	#endif
993#endif
994#ifdef USE_SHEEN
995	material.sheenColor = sheenColor;
996	#ifdef USE_SHEEN_COLORMAP
997		material.sheenColor *= texture2D( sheenColorMap, vSheenColorMapUv ).rgb;
998	#endif
999	material.sheenRoughness = clamp( sheenRoughness, 0.07, 1.0 );
1000	#ifdef USE_SHEEN_ROUGHNESSMAP
1001		material.sheenRoughness *= texture2D( sheenRoughnessMap, vSheenRoughnessMapUv ).a;
1002	#endif
1003#endif
1004#ifdef USE_ANISOTROPY
1005	#ifdef USE_ANISOTROPYMAP
1006		mat2 anisotropyMat = mat2( anisotropyVector.x, anisotropyVector.y, - anisotropyVector.y, anisotropyVector.x );
1007		vec3 anisotropyPolar = texture2D( anisotropyMap, vAnisotropyMapUv ).rgb;
1008		vec2 anisotropyV = anisotropyMat * normalize( 2.0 * anisotropyPolar.rg - vec2( 1.0 ) ) * anisotropyPolar.b;
1009	#else
1010		vec2 anisotropyV = anisotropyVector;
1011	#endif
1012	material.anisotropy = length( anisotropyV );
1013	if( material.anisotropy == 0.0 ) {
1014		anisotropyV = vec2( 1.0, 0.0 );
1015	} else {
1016		anisotropyV /= material.anisotropy;
1017		material.anisotropy = saturate( material.anisotropy );
1018	}
1019	material.alphaT = mix( pow2( material.roughness ), 1.0, pow2( material.anisotropy ) );
1020	material.anisotropyT = tbn[ 0 ] * anisotropyV.x + tbn[ 1 ] * anisotropyV.y;
1021	material.anisotropyB = tbn[ 1 ] * anisotropyV.x - tbn[ 0 ] * anisotropyV.y;
1022#endif`,kU
vendor: 14,687 bytes, lines 1022-1323
1022=`struct PhysicalMaterial {
1023	vec3 diffuseColor;
1024	float roughness;
1025	vec3 specularColor;
1026	float specularF90;
1027	float dispersion;
1028	#ifdef USE_CLEARCOAT
1029		float clearcoat;
1030		float clearcoatRoughness;
1031		vec3 clearcoatF0;
1032		float clearcoatF90;
1033	#endif
1034	#ifdef USE_IRIDESCENCE
1035		float iridescence;
1036		float iridescenceIOR;
1037		float iridescenceThickness;
1038		vec3 iridescenceFresnel;
1039		vec3 iridescenceF0;
1040	#endif
1041	#ifdef USE_SHEEN
1042		vec3 sheenColor;
1043		float sheenRoughness;
1044	#endif
1045	#ifdef IOR
1046		float ior;
1047	#endif
1048	#ifdef USE_TRANSMISSION
1049		float transmission;
1050		float transmissionAlpha;
1051		float thickness;
1052		float attenuationDistance;
1053		vec3 attenuationColor;
1054	#endif
1055	#ifdef USE_ANISOTROPY
1056		float anisotropy;
1057		float alphaT;
1058		vec3 anisotropyT;
1059		vec3 anisotropyB;
1060	#endif
1061};
1062vec3 clearcoatSpecularDirect = vec3( 0.0 );
1063vec3 clearcoatSpecularIndirect = vec3( 0.0 );
1064vec3 sheenSpecularDirect = vec3( 0.0 );
1065vec3 sheenSpecularIndirect = vec3(0.0 );
1066vec3 Schlick_to_F0( const in vec3 f, const in float f90, const in float dotVH ) {
1067    float x = clamp( 1.0 - dotVH, 0.0, 1.0 );
1068    float x2 = x * x;
1069    float x5 = clamp( x * x2 * x2, 0.0, 0.9999 );
1070    return ( f - vec3( f90 ) * x5 ) / ( 1.0 - x5 );
1071}
1072float V_GGX_SmithCorrelated( const in float alpha, const in float dotNL, const in float dotNV ) {
1073	float a2 = pow2( alpha );
1074	float gv = dotNL * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNV ) );
1075	float gl = dotNV * sqrt( a2 + ( 1.0 - a2 ) * pow2( dotNL ) );
1076	return 0.5 / max( gv + gl, EPSILON );
1077}
1078float D_GGX( const in float alpha, const in float dotNH ) {
1079	float a2 = pow2( alpha );
1080	float denom = pow2( dotNH ) * ( a2 - 1.0 ) + 1.0;
1081	return RECIPROCAL_PI * a2 / pow2( denom );
1082}
1083#ifdef USE_ANISOTROPY
1084	float V_GGX_SmithCorrelated_Anisotropic( const in float alphaT, const in float alphaB, const in float dotTV, const in float dotBV, const in float dotTL, const in float dotBL, const in float dotNV, const in float dotNL ) {
1085		float gv = dotNL * length( vec3( alphaT * dotTV, alphaB * dotBV, dotNV ) );
1086		float gl = dotNV * length( vec3( alphaT * dotTL, alphaB * dotBL, dotNL ) );
1087		float v = 0.5 / ( gv + gl );
1088		return saturate(v);
1089	}
1090	float D_GGX_Anisotropic( const in float alphaT, const in float alphaB, const in float dotNH, const in float dotTH, const in float dotBH ) {
1091		float a2 = alphaT * alphaB;
1092		highp vec3 v = vec3( alphaB * dotTH, alphaT * dotBH, a2 * dotNH );
1093		highp float v2 = dot( v, v );
1094		float w2 = a2 / v2;
1095		return RECIPROCAL_PI * a2 * pow2 ( w2 );
1096	}
1097#endif
1098#ifdef USE_CLEARCOAT
1099	vec3 BRDF_GGX_Clearcoat( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material) {
1100		vec3 f0 = material.clearcoatF0;
1101		float f90 = material.clearcoatF90;
1102		float roughness = material.clearcoatRoughness;
1103		float alpha = pow2( roughness );
1104		vec3 halfDir = normalize( lightDir + viewDir );
1105		float dotNL = saturate( dot( normal, lightDir ) );
1106		float dotNV = saturate( dot( normal, viewDir ) );
1107		float dotNH = saturate( dot( normal, halfDir ) );
1108		float dotVH = saturate( dot( viewDir, halfDir ) );
1109		vec3 F = F_Schlick( f0, f90, dotVH );
1110		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1111		float D = D_GGX( alpha, dotNH );
1112		return F * ( V * D );
1113	}
1114#endif
1115vec3 BRDF_GGX( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, const in PhysicalMaterial material ) {
1116	vec3 f0 = material.specularColor;
1117	float f90 = material.specularF90;
1118	float roughness = material.roughness;
1119	float alpha = pow2( roughness );
1120	vec3 halfDir = normalize( lightDir + viewDir );
1121	float dotNL = saturate( dot( normal, lightDir ) );
1122	float dotNV = saturate( dot( normal, viewDir ) );
1123	float dotNH = saturate( dot( normal, halfDir ) );
1124	float dotVH = saturate( dot( viewDir, halfDir ) );
1125	vec3 F = F_Schlick( f0, f90, dotVH );
1126	#ifdef USE_IRIDESCENCE
1127		F = mix( F, material.iridescenceFresnel, material.iridescence );
1128	#endif
1129	#ifdef USE_ANISOTROPY
1130		float dotTL = dot( material.anisotropyT, lightDir );
1131		float dotTV = dot( material.anisotropyT, viewDir );
1132		float dotTH = dot( material.anisotropyT, halfDir );
1133		float dotBL = dot( material.anisotropyB, lightDir );
1134		float dotBV = dot( material.anisotropyB, viewDir );
1135		float dotBH = dot( material.anisotropyB, halfDir );
1136		float V = V_GGX_SmithCorrelated_Anisotropic( material.alphaT, alpha, dotTV, dotBV, dotTL, dotBL, dotNV, dotNL );
1137		float D = D_GGX_Anisotropic( material.alphaT, alpha, dotNH, dotTH, dotBH );
1138	#else
1139		float V = V_GGX_SmithCorrelated( alpha, dotNL, dotNV );
1140		float D = D_GGX( alpha, dotNH );
1141	#endif
1142	return F * ( V * D );
1143}
1144vec2 LTC_Uv( const in vec3 N, const in vec3 V, const in float roughness ) {
1145	const float LUT_SIZE = 64.0;
1146	const float LUT_SCALE = ( LUT_SIZE - 1.0 ) / LUT_SIZE;
1147	const float LUT_BIAS = 0.5 / LUT_SIZE;
1148	float dotNV = saturate( dot( N, V ) );
1149	vec2 uv = vec2( roughness, sqrt( 1.0 - dotNV ) );
1150	uv = uv * LUT_SCALE + LUT_BIAS;
1151	return uv;
1152}
1153float LTC_ClippedSphereFormFactor( const in vec3 f ) {
1154	float l = length( f );
1155	return max( ( l * l + f.z ) / ( l + 1.0 ), 0.0 );
1156}
1157vec3 LTC_EdgeVectorFormFactor( const in vec3 v1, const in vec3 v2 ) {
1158	float x = dot( v1, v2 );
1159	float y = abs( x );
1160	float a = 0.8543985 + ( 0.4965155 + 0.0145206 * y ) * y;
1161	float b = 3.4175940 + ( 4.1616724 + y ) * y;
1162	float v = a / b;
1163	float theta_sintheta = ( x > 0.0 ) ? v : 0.5 * inversesqrt( max( 1.0 - x * x, 1e-7 ) ) - v;
1164	return cross( v1, v2 ) * theta_sintheta;
1165}
1166vec3 LTC_Evaluate( const in vec3 N, const in vec3 V, const in vec3 P, const in mat3 mInv, const in vec3 rectCoords[ 4 ] ) {
1167	vec3 v1 = rectCoords[ 1 ] - rectCoords[ 0 ];
1168	vec3 v2 = rectCoords[ 3 ] - rectCoords[ 0 ];
1169	vec3 lightNormal = cross( v1, v2 );
1170	if( dot( lightNormal, P - rectCoords[ 0 ] ) < 0.0 ) return vec3( 0.0 );
1171	vec3 T1, T2;
1172	T1 = normalize( V - N * dot( V, N ) );
1173	T2 = - cross( N, T1 );
1174	mat3 mat = mInv * transposeMat3( mat3( T1, T2, N ) );
1175	vec3 coords[ 4 ];
1176	coords[ 0 ] = mat * ( rectCoords[ 0 ] - P );
1177	coords[ 1 ] = mat * ( rectCoords[ 1 ] - P );
1178	coords[ 2 ] = mat * ( rectCoords[ 2 ] - P );
1179	coords[ 3 ] = mat * ( rectCoords[ 3 ] - P );
1180	coords[ 0 ] = normalize( coords[ 0 ] );
1181	coords[ 1 ] = normalize( coords[ 1 ] );
1182	coords[ 2 ] = normalize( coords[ 2 ] );
1183	coords[ 3 ] = normalize( coords[ 3 ] );
1184	vec3 vectorFormFactor = vec3( 0.0 );
1185	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 0 ], coords[ 1 ] );
1186	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 1 ], coords[ 2 ] );
1187	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 2 ], coords[ 3 ] );
1188	vectorFormFactor += LTC_EdgeVectorFormFactor( coords[ 3 ], coords[ 0 ] );
1189	float result = LTC_ClippedSphereFormFactor( vectorFormFactor );
1190	return vec3( result );
1191}
1192#if defined( USE_SHEEN )
1193float D_Charlie( float roughness, float dotNH ) {
1194	float alpha = pow2( roughness );
1195	float invAlpha = 1.0 / alpha;
1196	float cos2h = dotNH * dotNH;
1197	float sin2h = max( 1.0 - cos2h, 0.0078125 );
1198	return ( 2.0 + invAlpha ) * pow( sin2h, invAlpha * 0.5 ) / ( 2.0 * PI );
1199}
1200float V_Neubelt( float dotNV, float dotNL ) {
1201	return saturate( 1.0 / ( 4.0 * ( dotNL + dotNV - dotNL * dotNV ) ) );
1202}
1203vec3 BRDF_Sheen( const in vec3 lightDir, const in vec3 viewDir, const in vec3 normal, vec3 sheenColor, const in float sheenRoughness ) {
1204	vec3 halfDir = normalize( lightDir + viewDir );
1205	float dotNL = saturate( dot( normal, lightDir ) );
1206	float dotNV = saturate( dot( normal, viewDir ) );
1207	float dotNH = saturate( dot( normal, halfDir ) );
1208	float D = D_Charlie( sheenRoughness, dotNH );
1209	float V = V_Neubelt( dotNV, dotNL );
1210	return sheenColor * ( D * V );
1211}
1212#endif
1213float IBLSheenBRDF( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1214	float dotNV = saturate( dot( normal, viewDir ) );
1215	float r2 = roughness * roughness;
1216	float a = roughness < 0.25 ? -339.2 * r2 + 161.4 * roughness - 25.9 : -8.48 * r2 + 14.3 * roughness - 9.95;
1217	float b = roughness < 0.25 ? 44.0 * r2 - 23.7 * roughness + 3.26 : 1.97 * r2 - 3.27 * roughness + 0.72;
1218	float DG = exp( a * dotNV + b ) + ( roughness < 0.25 ? 0.0 : 0.1 * ( roughness - 0.25 ) );
1219	return saturate( DG * RECIPROCAL_PI );
1220}
1221vec2 DFGApprox( const in vec3 normal, const in vec3 viewDir, const in float roughness ) {
1222	float dotNV = saturate( dot( normal, viewDir ) );
1223	const vec4 c0 = vec4( - 1, - 0.0275, - 0.572, 0.022 );
1224	const vec4 c1 = vec4( 1, 0.0425, 1.04, - 0.04 );
1225	vec4 r = roughness * c0 + c1;
1226	float a004 = min( r.x * r.x, exp2( - 9.28 * dotNV ) ) * r.x + r.y;
1227	vec2 fab = vec2( - 1.04, 1.04 ) * a004 + r.zw;
1228	return fab;
1229}
1230vec3 EnvironmentBRDF( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness ) {
1231	vec2 fab = DFGApprox( normal, viewDir, roughness );
1232	return specularColor * fab.x + specularF90 * fab.y;
1233}
1234#ifdef USE_IRIDESCENCE
1235void computeMultiscatteringIridescence( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float iridescence, const in vec3 iridescenceF0, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1236#else
1237void computeMultiscattering( const in vec3 normal, const in vec3 viewDir, const in vec3 specularColor, const in float specularF90, const in float roughness, inout vec3 singleScatter, inout vec3 multiScatter ) {
1238#endif
1239	vec2 fab = DFGApprox( normal, viewDir, roughness );
1240	#ifdef USE_IRIDESCENCE
1241		vec3 Fr = mix( specularColor, iridescenceF0, iridescence );
1242	#else
1243		vec3 Fr = specularColor;
1244	#endif
1245	vec3 FssEss = Fr * fab.x + specularF90 * fab.y;
1246	float Ess = fab.x + fab.y;
1247	float Ems = 1.0 - Ess;
1248	vec3 Favg = Fr + ( 1.0 - Fr ) * 0.047619;	vec3 Fms = FssEss * Favg / ( 1.0 - Ems * Favg );
1249	singleScatter += FssEss;
1250	multiScatter += Fms * Ems;
1251}
1252#if NUM_RECT_AREA_LIGHTS > 0
1253	void RE_Direct_RectArea_Physical( const in RectAreaLight rectAreaLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1254		vec3 normal = geometryNormal;
1255		vec3 viewDir = geometryViewDir;
1256		vec3 position = geometryPosition;
1257		vec3 lightPos = rectAreaLight.position;
1258		vec3 halfWidth = rectAreaLight.halfWidth;
1259		vec3 halfHeight = rectAreaLight.halfHeight;
1260		vec3 lightColor = rectAreaLight.color;
1261		float roughness = material.roughness;
1262		vec3 rectCoords[ 4 ];
1263		rectCoords[ 0 ] = lightPos + halfWidth - halfHeight;		rectCoords[ 1 ] = lightPos - halfWidth - halfHeight;
1264		rectCoords[ 2 ] = lightPos - halfWidth + halfHeight;
1265		rectCoords[ 3 ] = lightPos + halfWidth + halfHeight;
1266		vec2 uv = LTC_Uv( normal, viewDir, roughness );
1267		vec4 t1 = texture2D( ltc_1, uv );
1268		vec4 t2 = texture2D( ltc_2, uv );
1269		mat3 mInv = mat3(
1270			vec3( t1.x, 0, t1.y ),
1271			vec3(    0, 1,    0 ),
1272			vec3( t1.z, 0, t1.w )
1273		);
1274		vec3 fresnel = ( material.specularColor * t2.x + ( vec3( 1.0 ) - material.specularColor ) * t2.y );
1275		reflectedLight.directSpecular += lightColor * fresnel * LTC_Evaluate( normal, viewDir, position, mInv, rectCoords );
1276		reflectedLight.directDiffuse += lightColor * material.diffuseColor * LTC_Evaluate( normal, viewDir, position, mat3( 1.0 ), rectCoords );
1277	}
1278#endif
1279void RE_Direct_Physical( const in IncidentLight directLight, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1280	float dotNL = saturate( dot( geometryNormal, directLight.direction ) );
1281	vec3 irradiance = dotNL * directLight.color;
1282	#ifdef USE_CLEARCOAT
1283		float dotNLcc = saturate( dot( geometryClearcoatNormal, directLight.direction ) );
1284		vec3 ccIrradiance = dotNLcc * directLight.color;
1285		clearcoatSpecularDirect += ccIrradiance * BRDF_GGX_Clearcoat( directLight.direction, geometryViewDir, geometryClearcoatNormal, material );
1286	#endif
1287	#ifdef USE_SHEEN
1288		sheenSpecularDirect += irradiance * BRDF_Sheen( directLight.direction, geometryViewDir, geometryNormal, material.sheenColor, material.sheenRoughness );
1289	#endif
1290	reflectedLight.directSpecular += irradiance * BRDF_GGX( directLight.direction, geometryViewDir, geometryNormal, material );
1291	reflectedLight.directDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1292}
1293void RE_IndirectDiffuse_Physical( const in vec3 irradiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight ) {
1294	reflectedLight.indirectDiffuse += irradiance * BRDF_Lambert( material.diffuseColor );
1295}
1296void RE_IndirectSpecular_Physical( const in vec3 radiance, const in vec3 irradiance, const in vec3 clearcoatRadiance, const in vec3 geometryPosition, const in vec3 geometryNormal, const in vec3 geometryViewDir, const in vec3 geometryClearcoatNormal, const in PhysicalMaterial material, inout ReflectedLight reflectedLight) {
1297	#ifdef USE_CLEARCOAT
1298		clearcoatSpecularIndirect += clearcoatRadiance * EnvironmentBRDF( geometryClearcoatNormal, geometryViewDir, material.clearcoatF0, material.clearcoatF90, material.clearcoatRoughness );
1299	#endif
1300	#ifdef USE_SHEEN
1301		sheenSpecularIndirect += irradiance * material.sheenColor * IBLSheenBRDF( geometryNormal, geometryViewDir, material.sheenRoughness );
1302	#endif
1303	vec3 singleScattering = vec3( 0.0 );
1304	vec3 multiScattering = vec3( 0.0 );
1305	vec3 cosineWeightedIrradiance = irradiance * RECIPROCAL_PI;
1306	#ifdef USE_IRIDESCENCE
1307		computeMultiscatteringIridescence( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.iridescence, material.iridescenceFresnel, material.roughness, singleScattering, multiScattering );
1308	#else
1309		computeMultiscattering( geometryNormal, geometryViewDir, material.specularColor, material.specularF90, material.roughness, singleScattering, multiScattering );
1310	#endif
1311	vec3 totalScattering = singleScattering + multiScattering;
1312	vec3 diffuse = material.diffuseColor * ( 1.0 - max( max( totalScattering.r, totalScattering.g ), totalScattering.b ) );
1313	reflectedLight.indirectSpecular += radiance * singleScattering;
1314	reflectedLight.indirectSpecular += multiScattering * cosineWeightedIrradiance;
1315	reflectedLight.indirectDiffuse += diffuse * cosineWeightedIrradiance;
1316}
1317#define RE_Direct				RE_Direct_Physical
1318#define RE_Direct_RectArea		RE_Direct_RectArea_Physical
1319#define RE_IndirectDiffuse		RE_IndirectDiffuse_Physical
1320#define RE_IndirectSpecular		RE_IndirectSpecular_Physical
1321float computeSpecularOcclusion( const in float dotNV, const in float ambientOcclusion, const in float roughness ) {
1322	return saturate( pow( dotNV + ambientOcclusion, exp2( - 16.0 * roughness - 1.0 ) ) - 1.0 + ambientOcclusion );
1323}`,
1323HU=`
1324vec3 geometryPosition = - vViewPosition;
1325vec3 geometryNormal = normal;
1326vec3 geometryViewDir = ( isOrthographic ) ? vec3( 0, 0, 1 ) : normalize( vViewPosition );
1327vec3 geometryClearcoatNormal = vec3( 0.0 );
1328#ifdef USE_CLEARCOAT
1329	geometryClearcoatNormal = clearcoatNormal;
1330#endif
1331#ifdef USE_IRIDESCENCE
1332	float dotNVi = saturate( dot( normal, geometryViewDir ) );
1333	if ( material.iridescenceThickness == 0.0 ) {
1334		material.iridescence = 0.0;
1335	} else {
1336		material.iridescence = saturate( material.iridescence );
1337	}
1338	if ( material.iridescence > 0.0 ) {
1339		material.iridescenceFresnel = evalIridescence( 1.0, material.iridescenceIOR, dotNVi, material.iridescenceThickness, material.specularColor );
1340		material.iridescenceF0 = Schlick_to_F0( material.iridescenceFresnel, 1.0, dotNVi );
1341	}
1342#endif
1343IncidentLight directLight;
1344#if ( NUM_POINT_LIGHTS > 0 ) && defined( RE_Direct )
1345	PointLight pointLight;
1346	#if defined( USE_SHADOWMAP ) && NUM_POINT_LIGHT_SHADOWS > 0
1347	PointLightShadow pointLightShadow;
1348	#endif
1349	#pragma unroll_loop_start
1350	for ( int i = 0; i < NUM_POINT_LIGHTS; i ++ ) {
1351		pointLight = pointLights[ i ];
1352		getPointLightInfo( pointLight, geometryPosition, directLight );
1353		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_POINT_LIGHT_SHADOWS )
1354		pointLightShadow = pointLightShadows[ i ];
1355		directLight.color *= ( directLight.visible && receiveShadow ) ? getPointShadow( pointShadowMap[ i ], pointLightShadow.shadowMapSize, pointLightShadow.shadowIntensity, pointLightShadow.shadowBias, pointLightShadow.shadowRadius, vPointShadowCoord[ i ], pointLightShadow.shadowCameraNear, pointLightShadow.shadowCameraFar ) : 1.0;
1356		#endif
1357		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1358	}
1359	#pragma unroll_loop_end
1360#endif
1361#if ( NUM_SPOT_LIGHTS > 0 ) && defined( RE_Direct )
1362	SpotLight spotLight;
1363	vec4 spotColor;
1364	vec3 spotLightCoord;
1365	bool inSpotLightMap;
1366	#if defined( USE_SHADOWMAP ) && NUM_SPOT_LIGHT_SHADOWS > 0
1367	SpotLightShadow spotLightShadow;
1368	#endif
1369	#pragma unroll_loop_start
1370	for ( int i = 0; i < NUM_SPOT_LIGHTS; i ++ ) {
1371		spotLight = spotLights[ i ];
1372		getSpotLightInfo( spotLight, geometryPosition, directLight );
1373		#if ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1374		#define SPOT_LIGHT_MAP_INDEX UNROLLED_LOOP_INDEX
1375		#elif ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1376		#define SPOT_LIGHT_MAP_INDEX NUM_SPOT_LIGHT_MAPS
1377		#else
1378		#define SPOT_LIGHT_MAP_INDEX ( UNROLLED_LOOP_INDEX - NUM_SPOT_LIGHT_SHADOWS + NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS )
1379		#endif
1380		#if ( SPOT_LIGHT_MAP_INDEX < NUM_SPOT_LIGHT_MAPS )
1381			spotLightCoord = vSpotLightCoord[ i ].xyz / vSpotLightCoord[ i ].w;
1382			inSpotLightMap = all( lessThan( abs( spotLightCoord * 2. - 1. ), vec3( 1.0 ) ) );
1383			spotColor = texture2D( spotLightMap[ SPOT_LIGHT_MAP_INDEX ], spotLightCoord.xy );
1384			directLight.color = inSpotLightMap ? directLight.color * spotColor.rgb : directLight.color;
1385		#endif
1386		#undef SPOT_LIGHT_MAP_INDEX
1387		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
1388		spotLightShadow = spotLightShadows[ i ];
1389		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( spotShadowMap[ i ], spotLightShadow.shadowMapSize, spotLightShadow.shadowIntensity, spotLightShadow.shadowBias, spotLightShadow.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
1390		#endif
1391		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1392	}
1393	#pragma unroll_loop_end
1394#endif
1395#if ( NUM_DIR_LIGHTS > 0 ) && defined( RE_Direct )
1396	DirectionalLight directionalLight;
1397	#if defined( USE_SHADOWMAP ) && NUM_DIR_LIGHT_SHADOWS > 0
1398	DirectionalLightShadow directionalLightShadow;
1399	#endif
1400	#pragma unroll_loop_start
1401	for ( int i = 0; i < NUM_DIR_LIGHTS; i ++ ) {
1402		directionalLight = directionalLights[ i ];
1403		getDirectionalLightInfo( directionalLight, directLight );
1404		#if defined( USE_SHADOWMAP ) && ( UNROLLED_LOOP_INDEX < NUM_DIR_LIGHT_SHADOWS )
1405		directionalLightShadow = directionalLightShadows[ i ];
1406		directLight.color *= ( directLight.visible && receiveShadow ) ? getShadow( directionalShadowMap[ i ], directionalLightShadow.shadowMapSize, directionalLightShadow.shadowIntensity, directionalLightShadow.shadowBias, directionalLightShadow.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
1407		#endif
1408		RE_Direct( directLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1409	}
1410	#pragma unroll_loop_end
1411#endif
1412#if ( NUM_RECT_AREA_LIGHTS > 0 ) && defined( RE_Direct_RectArea )
1413	RectAreaLight rectAreaLight;
1414	#pragma unroll_loop_start
1415	for ( int i = 0; i < NUM_RECT_AREA_LIGHTS; i ++ ) {
1416		rectAreaLight = rectAreaLights[ i ];
1417		RE_Direct_RectArea( rectAreaLight, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1418	}
1419	#pragma unroll_loop_end
1420#endif
1421#if defined( RE_IndirectDiffuse )
1422	vec3 iblIrradiance = vec3( 0.0 );
1423	vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );
1424	#if defined( USE_LIGHT_PROBES )
1425		irradiance += getLightProbeIrradiance( lightProbe, geometryNormal );
1426	#endif
1427	#if ( NUM_HEMI_LIGHTS > 0 )
1428		#pragma unroll_loop_start
1429		for ( int i = 0; i < NUM_HEMI_LIGHTS; i ++ ) {
1430			irradiance += getHemisphereLightIrradiance( hemisphereLights[ i ], geometryNormal );
1431		}
1432		#pragma unroll_loop_end
1433	#endif
1434#endif
1435#if defined( RE_IndirectSpecular )
1436	vec3 radiance = vec3( 0.0 );
1437	vec3 clearcoatRadiance = vec3( 0.0 );
1438#endif`,GU=`#if defined( RE_IndirectDiffuse )
1439	#ifdef USE_LIGHTMAP
1440		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
1441		vec3 lightMapIrradiance = lightMapTexel.rgb * lightMapIntensity;
1442		irradiance += lightMapIrradiance;
1443	#endif
1444	#if defined( USE_ENVMAP ) && defined( STANDARD ) && defined( ENVMAP_TYPE_CUBE_UV )
1445		iblIrradiance += getIBLIrradiance( geometryNormal );
1446	#endif
1447#endif
1448#if defined( USE_ENVMAP ) && defined( RE_IndirectSpecular )
1449	#ifdef USE_ANISOTROPY
1450		radiance += getIBLAnisotropyRadiance( geometryViewDir, geometryNormal, material.roughness, material.anisotropyB, material.anisotropy );
1451	#else
1452		radiance += getIBLRadiance( geometryViewDir, geometryNormal, material.roughness );
1453	#endif
1454	#ifdef USE_CLEARCOAT
1455		clearcoatRadiance += getIBLRadiance( geometryViewDir, geometryClearcoatNormal, material.clearcoatRoughness );
1456	#endif
1457#endif`,jU=`#if defined( RE_IndirectDiffuse )
1458	RE_IndirectDiffuse( irradiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1459#endif
1460#if defined( RE_IndirectSpecular )
1461	RE_IndirectSpecular( radiance, iblIrradiance, clearcoatRadiance, geometryPosition, geometryNormal, geometryViewDir, geometryClearcoatNormal, material, reflectedLight );
1462#endif`,VU=`#if defined( USE_LOGDEPTHBUF )
1463	gl_FragDepth = vIsPerspective == 0.0 ? gl_FragCoord.z : log2( vFragDepth ) * logDepthBufFC * 0.5;
1464#endif`,WU=`#if defined( USE_LOGDEPTHBUF )
1465	uniform float logDepthBufFC;
1466	varying float vFragDepth;
1467	varying float vIsPerspective;
1468#endif`,XU=`#ifdef USE_LOGDEPTHBUF
1469	varying float vFragDepth;
1470	varying float vIsPerspective;
1471#endif`,qU=`#ifdef USE_LOGDEPTHBUF
1472	vFragDepth = 1.0 + gl_Position.w;
1473	vIsPerspective = float( isPerspectiveMatrix( projectionMatrix ) );
1474#endif`,YU=`#ifdef USE_MAP
1475	vec4 sampledDiffuseColor = texture2D( map, vMapUv );
1476	#ifdef DECODE_VIDEO_TEXTURE
1477		sampledDiffuseColor = sRGBTransferEOTF( sampledDiffuseColor );
1478	#endif
1479	diffuseColor *= sampledDiffuseColor;
1480#endif`,JU=`#ifdef USE_MAP
1481	uniform sampler2D map;
1482#endif`,KU=`#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1483	#if defined( USE_POINTS_UV )
1484		vec2 uv = vUv;
1485	#else
1486		vec2 uv = ( uvTransform * vec3( gl_PointCoord.x, 1.0 - gl_PointCoord.y, 1 ) ).xy;
1487	#endif
1488#endif
1489#ifdef USE_MAP
1490	diffuseColor *= texture2D( map, uv );
1491#endif
1492#ifdef USE_ALPHAMAP
1493	diffuseColor.a *= texture2D( alphaMap, uv ).g;
1494#endif`,ZU=`#if defined( USE_POINTS_UV )
1495	varying vec2 vUv;
1496#else
1497	#if defined( USE_MAP ) || defined( USE_ALPHAMAP )
1498		uniform mat3 uvTransform;
1499	#endif
1500#endif
1501#ifdef USE_MAP
1502	uniform sampler2D map;
1503#endif
1504#ifdef USE_ALPHAMAP
1505	uniform sampler2D alphaMap;
1506#endif`,QU=`float metalnessFactor = metalness;
1507#ifdef USE_METALNESSMAP
1508	vec4 texelMetalness = texture2D( metalnessMap, vMetalnessMapUv );
1509	metalnessFactor *= texelMetalness.b;
1510#endif`,$U=`#ifdef USE_METALNESSMAP
1511	uniform sampler2D metalnessMap;
1512#endif`,e4=`#ifdef USE_INSTANCING_MORPH
1513	float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1514	float morphTargetBaseInfluence = texelFetch( morphTexture, ivec2( 0, gl_InstanceID ), 0 ).r;
1515	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1516		morphTargetInfluences[i] =  texelFetch( morphTexture, ivec2( i + 1, gl_InstanceID ), 0 ).r;
1517	}
1518#endif`,t4=`#if defined( USE_MORPHCOLORS )
1519	vColor *= morphTargetBaseInfluence;
1520	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1521		#if defined( USE_COLOR_ALPHA )
1522			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ) * morphTargetInfluences[ i ];
1523		#elif defined( USE_COLOR )
1524			if ( morphTargetInfluences[ i ] != 0.0 ) vColor += getMorph( gl_VertexID, i, 2 ).rgb * morphTargetInfluences[ i ];
1525		#endif
1526	}
1527#endif`,n4=`#ifdef USE_MORPHNORMALS
1528	objectNormal *= morphTargetBaseInfluence;
1529	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1530		if ( morphTargetInfluences[ i ] != 0.0 ) objectNormal += getMorph( gl_VertexID, i, 1 ).xyz * morphTargetInfluences[ i ];
1531	}
1532#endif`,i4=`#ifdef USE_MORPHTARGETS
1533	#ifndef USE_INSTANCING_MORPH
1534		uniform float morphTargetBaseInfluence;
1535		uniform float morphTargetInfluences[ MORPHTARGETS_COUNT ];
1536	#endif
1537	uniform sampler2DArray morphTargetsTexture;
1538	uniform ivec2 morphTargetsTextureSize;
1539	vec4 getMorph( const in int vertexIndex, const in int morphTargetIndex, const in int offset ) {
1540		int texelIndex = vertexIndex * MORPHTARGETS_TEXTURE_STRIDE + offset;
1541		int y = texelIndex / morphTargetsTextureSize.x;
1542		int x = texelIndex - y * morphTargetsTextureSize.x;
1543		ivec3 morphUV = ivec3( x, y, morphTargetIndex );
1544		return texelFetch( morphTargetsTexture, morphUV, 0 );
1545	}
1546#endif`,s4=`#ifdef USE_MORPHTARGETS
1547	transformed *= morphTargetBaseInfluence;
1548	for ( int i = 0; i < MORPHTARGETS_COUNT; i ++ ) {
1549		if ( morphTargetInfluences[ i ] != 0.0 ) transformed += getMorph( gl_VertexID, i, 0 ).xyz * morphTargetInfluences[ i ];
1550	}
1551#endif`,r4=`float faceDirection = gl_FrontFacing ? 1.0 : - 1.0;
1552#ifdef FLAT_SHADED
1553	vec3 fdx = dFdx( vViewPosition );
1554	vec3 fdy = dFdy( vViewPosition );
1555	vec3 normal = normalize( cross( fdx, fdy ) );
1556#else
1557	vec3 normal = normalize( vNormal );
1558	#ifdef DOUBLE_SIDED
1559		normal *= faceDirection;
1560	#endif
1561#endif
1562#if defined( USE_NORMALMAP_TANGENTSPACE ) || defined( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY )
1563	#ifdef USE_TANGENT
1564		mat3 tbn = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1565	#else
1566		mat3 tbn = getTangentFrame( - vViewPosition, normal,
1567		#if defined( USE_NORMALMAP )
1568			vNormalMapUv
1569		#elif defined( USE_CLEARCOAT_NORMALMAP )
1570			vClearcoatNormalMapUv
1571		#else
1572			vUv
1573		#endif
1574		);
1575	#endif
1576	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1577		tbn[0] *= faceDirection;
1578		tbn[1] *= faceDirection;
1579	#endif
1580#endif
1581#ifdef USE_CLEARCOAT_NORMALMAP
1582	#ifdef USE_TANGENT
1583		mat3 tbn2 = mat3( normalize( vTangent ), normalize( vBitangent ), normal );
1584	#else
1585		mat3 tbn2 = getTangentFrame( - vViewPosition, normal, vClearcoatNormalMapUv );
1586	#endif
1587	#if defined( DOUBLE_SIDED ) && ! defined( FLAT_SHADED )
1588		tbn2[0] *= faceDirection;
1589		tbn2[1] *= faceDirection;
1590	#endif
1591#endif
1592vec3 nonPerturbedNormal = normal;`,a4=`#ifdef USE_NORMALMAP_OBJECTSPACE
1593	normal = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1594	#ifdef FLIP_SIDED
1595		normal = - normal;
1596	#endif
1597	#ifdef DOUBLE_SIDED
1598		normal = normal * faceDirection;
1599	#endif
1600	normal = normalize( normalMatrix * normal );
1601#elif defined( USE_NORMALMAP_TANGENTSPACE )
1602	vec3 mapN = texture2D( normalMap, vNormalMapUv ).xyz * 2.0 - 1.0;
1603	mapN.xy *= normalScale;
1604	normal = normalize( tbn * mapN );
1605#elif defined( USE_BUMPMAP )
1606	normal = perturbNormalArb( - vViewPosition, normal, dHdxy_fwd(), faceDirection );
1607#endif`,o4=`#ifndef FLAT_SHADED
1608	varying vec3 vNormal;
1609	#ifdef USE_TANGENT
1610		varying vec3 vTangent;
1611		varying vec3 vBitangent;
1612	#endif
1613#endif`,l4=`#ifndef FLAT_SHADED
1614	varying vec3 vNormal;
1615	#ifdef USE_TANGENT
1616		varying vec3 vTangent;
1617		varying vec3 vBitangent;
1618	#endif
1619#endif`,c4=`#ifndef FLAT_SHADED
1620	vNormal = normalize( transformedNormal );
1621	#ifdef USE_TANGENT
1622		vTangent = normalize( transformedTangent );
1623		vBitangent = normalize( cross( vNormal, vTangent ) * tangent.w );
1624	#endif
1625#endif`,u4=`#ifdef USE_NORMALMAP
1626	uniform sampler2D normalMap;
1627	uniform vec2 normalScale;
1628#endif
1629#ifdef USE_NORMALMAP_OBJECTSPACE
1630	uniform mat3 normalMatrix;
1631#endif
1632#if ! defined ( USE_TANGENT ) && ( defined ( USE_NORMALMAP_TANGENTSPACE ) || defined ( USE_CLEARCOAT_NORMALMAP ) || defined( USE_ANISOTROPY ) )
1633	mat3 getTangentFrame( vec3 eye_pos, vec3 surf_norm, vec2 uv ) {
1634		vec3 q0 = dFdx( eye_pos.xyz );
1635		vec3 q1 = dFdy( eye_pos.xyz );
1636		vec2 st0 = dFdx( uv.st );
1637		vec2 st1 = dFdy( uv.st );
1638		vec3 N = surf_norm;
1639		vec3 q1perp = cross( q1, N );
1640		vec3 q0perp = cross( N, q0 );
1641		vec3 T = q1perp * st0.x + q0perp * st1.x;
1642		vec3 B = q1perp * st0.y + q0perp * st1.y;
1643		float det = max( dot( T, T ), dot( B, B ) );
1644		float scale = ( det == 0.0 ) ? 0.0 : inversesqrt( det );
1645		return mat3( T * scale, B * scale, N );
1646	}
1647#endif`,f4=`#ifdef USE_CLEARCOAT
1648	vec3 clearcoatNormal = nonPerturbedNormal;
1649#endif`,d4=`#ifdef USE_CLEARCOAT_NORMALMAP
1650	vec3 clearcoatMapN = texture2D( clearcoatNormalMap, vClearcoatNormalMapUv ).xyz * 2.0 - 1.0;
1651	clearcoatMapN.xy *= clearcoatNormalScale;
1652	clearcoatNormal = normalize( tbn2 * clearcoatMapN );
1653#endif`,h4=`#ifdef USE_CLEARCOATMAP
1654	uniform sampler2D clearcoatMap;
1655#endif
1656#ifdef USE_CLEARCOAT_NORMALMAP
1657	uniform sampler2D clearcoatNormalMap;
1658	uniform vec2 clearcoatNormalScale;
1659#endif
1660#ifdef USE_CLEARCOAT_ROUGHNESSMAP
1661	uniform sampler2D clearcoatRoughnessMap;
1662#endif`,p4=`#ifdef USE_IRIDESCENCEMAP
1663	uniform sampler2D iridescenceMap;
1664#endif
1665#ifdef USE_IRIDESCENCE_THICKNESSMAP
1666	uniform sampler2D iridescenceThicknessMap;
1667#endif`,m4=`#ifdef OPAQUE
1668diffuseColor.a = 1.0;
1669#endif
1670#ifdef USE_TRANSMISSION
1671diffuseColor.a *= material.transmissionAlpha;
1672#endif
1673gl_FragColor = vec4( outgoingLight, diffuseColor.a );`,g4=`vec3 packNormalToRGB( const in vec3 normal ) {
1674	return normalize( normal ) * 0.5 + 0.5;
1675}
1676vec3 unpackRGBToNormal( const in vec3 rgb ) {
1677	return 2.0 * rgb.xyz - 1.0;
1678}
1679const float PackUpscale = 256. / 255.;const float UnpackDownscale = 255. / 256.;const float ShiftRight8 = 1. / 256.;
1680const float Inv255 = 1. / 255.;
1681const vec4 PackFactors = vec4( 1.0, 256.0, 256.0 * 256.0, 256.0 * 256.0 * 256.0 );
1682const vec2 UnpackFactors2 = vec2( UnpackDownscale, 1.0 / PackFactors.g );
1683const vec3 UnpackFactors3 = vec3( UnpackDownscale / PackFactors.rg, 1.0 / PackFactors.b );
1684const vec4 UnpackFactors4 = vec4( UnpackDownscale / PackFactors.rgb, 1.0 / PackFactors.a );
1685vec4 packDepthToRGBA( const in float v ) {
1686	if( v <= 0.0 )
1687		return vec4( 0., 0., 0., 0. );
1688	if( v >= 1.0 )
1689		return vec4( 1., 1., 1., 1. );
1690	float vuf;
1691	float af = modf( v * PackFactors.a, vuf );
1692	float bf = modf( vuf * ShiftRight8, vuf );
1693	float gf = modf( vuf * ShiftRight8, vuf );
1694	return vec4( vuf * Inv255, gf * PackUpscale, bf * PackUpscale, af );
1695}
1696vec3 packDepthToRGB( const in float v ) {
1697	if( v <= 0.0 )
1698		return vec3( 0., 0., 0. );
1699	if( v >= 1.0 )
1700		return vec3( 1., 1., 1. );
1701	float vuf;
1702	float bf = modf( v * PackFactors.b, vuf );
1703	float gf = modf( vuf * ShiftRight8, vuf );
1704	return vec3( vuf * Inv255, gf * PackUpscale, bf );
1705}
1706vec2 packDepthToRG( const in float v ) {
1707	if( v <= 0.0 )
1708		return vec2( 0., 0. );
1709	if( v >= 1.0 )
1710		return vec2( 1., 1. );
1711	float vuf;
1712	float gf = modf( v * 256., vuf );
1713	return vec2( vuf * Inv255, gf );
1714}
1715float unpackRGBAToDepth( const in vec4 v ) {
1716	return dot( v, UnpackFactors4 );
1717}
1718float unpackRGBToDepth( const in vec3 v ) {
1719	return dot( v, UnpackFactors3 );
1720}
1721float unpackRGToDepth( const in vec2 v ) {
1722	return v.r * UnpackFactors2.r + v.g * UnpackFactors2.g;
1723}
1724vec4 pack2HalfToRGBA( const in vec2 v ) {
1725	vec4 r = vec4( v.x, fract( v.x * 255.0 ), v.y, fract( v.y * 255.0 ) );
1726	return vec4( r.x - r.y / 255.0, r.y, r.z - r.w / 255.0, r.w );
1727}
1728vec2 unpackRGBATo2Half( const in vec4 v ) {
1729	return vec2( v.x + ( v.y / 255.0 ), v.z + ( v.w / 255.0 ) );
1730}
1731float viewZToOrthographicDepth( const in float viewZ, const in float near, const in float far ) {
1732	return ( viewZ + near ) / ( near - far );
1733}
1734float orthographicDepthToViewZ( const in float depth, const in float near, const in float far ) {
1735	return depth * ( near - far ) - near;
1736}
1737float viewZToPerspectiveDepth( const in float viewZ, const in float near, const in float far ) {
1738	return ( ( near + viewZ ) * far ) / ( ( far - near ) * viewZ );
1739}
1740float perspectiveDepthToViewZ( const in float depth, const in float near, const in float far ) {
1741	return ( near * far ) / ( ( far - near ) * depth - far );
1742}`,v4=`#ifdef PREMULTIPLIED_ALPHA
1743	gl_FragColor.rgb *= gl_FragColor.a;
1744#endif`,y4=`vec4 mvPosition = vec4( transformed, 1.0 );
1745#ifdef USE_BATCHING
1746	mvPosition = batchingMatrix * mvPosition;
1747#endif
1748#ifdef USE_INSTANCING
1749	mvPosition = instanceMatrix * mvPosition;
1750#endif
1751mvPosition = modelViewMatrix * mvPosition;
1752gl_Position = projectionMatrix * mvPosition;`,x4=`#ifdef DITHERING
1753	gl_FragColor.rgb = dithering( gl_FragColor.rgb );
1754#endif`,_4=`#ifdef DITHERING
1755	vec3 dithering( vec3 color ) {
1756		float grid_position = rand( gl_FragCoord.xy );
1757		vec3 dither_shift_RGB = vec3( 0.25 / 255.0, -0.25 / 255.0, 0.25 / 255.0 );
1758		dither_shift_RGB = mix( 2.0 * dither_shift_RGB, -2.0 * dither_shift_RGB, grid_position );
1759		return color + dither_shift_RGB;
1760	}
1761#endif`,b4=`float roughnessFactor = roughness;
1762#ifdef USE_ROUGHNESSMAP
1763	vec4 texelRoughness = texture2D( roughnessMap, vRoughnessMapUv );
1764	roughnessFactor *= texelRoughness.g;
1765#endif`,S4=`#ifdef USE_ROUGHNESSMAP
1766	uniform sampler2D roughnessMap;
1767#endif`,A4=
vendor: 8,887 bytes, lines 1767-1953
1767`#if NUM_SPOT_LIGHT_COORDS > 0
1768	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1769#endif
1770#if NUM_SPOT_LIGHT_MAPS > 0
1771	uniform sampler2D spotLightMap[ NUM_SPOT_LIGHT_MAPS ];
1772#endif
1773#ifdef USE_SHADOWMAP
1774	#if NUM_DIR_LIGHT_SHADOWS > 0
1775		uniform sampler2D directionalShadowMap[ NUM_DIR_LIGHT_SHADOWS ];
1776		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1777		struct DirectionalLightShadow {
1778			float shadowIntensity;
1779			float shadowBias;
1780			float shadowNormalBias;
1781			float shadowRadius;
1782			vec2 shadowMapSize;
1783		};
1784		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1785	#endif
1786	#if NUM_SPOT_LIGHT_SHADOWS > 0
1787		uniform sampler2D spotShadowMap[ NUM_SPOT_LIGHT_SHADOWS ];
1788		struct SpotLightShadow {
1789			float shadowIntensity;
1790			float shadowBias;
1791			float shadowNormalBias;
1792			float shadowRadius;
1793			vec2 shadowMapSize;
1794		};
1795		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1796	#endif
1797	#if NUM_POINT_LIGHT_SHADOWS > 0
1798		uniform sampler2D pointShadowMap[ NUM_POINT_LIGHT_SHADOWS ];
1799		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1800		struct PointLightShadow {
1801			float shadowIntensity;
1802			float shadowBias;
1803			float shadowNormalBias;
1804			float shadowRadius;
1805			vec2 shadowMapSize;
1806			float shadowCameraNear;
1807			float shadowCameraFar;
1808		};
1809		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1810	#endif
1811	float texture2DCompare( sampler2D depths, vec2 uv, float compare ) {
1812		return step( compare, unpackRGBAToDepth( texture2D( depths, uv ) ) );
1813	}
1814	vec2 texture2DDistribution( sampler2D shadow, vec2 uv ) {
1815		return unpackRGBATo2Half( texture2D( shadow, uv ) );
1816	}
1817	float VSMShadow (sampler2D shadow, vec2 uv, float compare ){
1818		float occlusion = 1.0;
1819		vec2 distribution = texture2DDistribution( shadow, uv );
1820		float hard_shadow = step( compare , distribution.x );
1821		if (hard_shadow != 1.0 ) {
1822			float distance = compare - distribution.x ;
1823			float variance = max( 0.00000, distribution.y * distribution.y );
1824			float softness_probability = variance / (variance + distance * distance );			softness_probability = clamp( ( softness_probability - 0.3 ) / ( 0.95 - 0.3 ), 0.0, 1.0 );			occlusion = clamp( max( hard_shadow, softness_probability ), 0.0, 1.0 );
1825		}
1826		return occlusion;
1827	}
1828	float getShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord ) {
1829		float shadow = 1.0;
1830		shadowCoord.xyz /= shadowCoord.w;
1831		shadowCoord.z += shadowBias;
1832		bool inFrustum = shadowCoord.x >= 0.0 && shadowCoord.x <= 1.0 && shadowCoord.y >= 0.0 && shadowCoord.y <= 1.0;
1833		bool frustumTest = inFrustum && shadowCoord.z <= 1.0;
1834		if ( frustumTest ) {
1835		#if defined( SHADOWMAP_TYPE_PCF )
1836			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1837			float dx0 = - texelSize.x * shadowRadius;
1838			float dy0 = - texelSize.y * shadowRadius;
1839			float dx1 = + texelSize.x * shadowRadius;
1840			float dy1 = + texelSize.y * shadowRadius;
1841			float dx2 = dx0 / 2.0;
1842			float dy2 = dy0 / 2.0;
1843			float dx3 = dx1 / 2.0;
1844			float dy3 = dy1 / 2.0;
1845			shadow = (
1846				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy0 ), shadowCoord.z ) +
1847				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy0 ), shadowCoord.z ) +
1848				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy0 ), shadowCoord.z ) +
1849				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy2 ), shadowCoord.z ) +
1850				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy2 ), shadowCoord.z ) +
1851				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy2 ), shadowCoord.z ) +
1852				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, 0.0 ), shadowCoord.z ) +
1853				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, 0.0 ), shadowCoord.z ) +
1854				texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z ) +
1855				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, 0.0 ), shadowCoord.z ) +
1856				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, 0.0 ), shadowCoord.z ) +
1857				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx2, dy3 ), shadowCoord.z ) +
1858				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy3 ), shadowCoord.z ) +
1859				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx3, dy3 ), shadowCoord.z ) +
1860				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx0, dy1 ), shadowCoord.z ) +
1861				texture2DCompare( shadowMap, shadowCoord.xy + vec2( 0.0, dy1 ), shadowCoord.z ) +
1862				texture2DCompare( shadowMap, shadowCoord.xy + vec2( dx1, dy1 ), shadowCoord.z )
1863			) * ( 1.0 / 17.0 );
1864		#elif defined( SHADOWMAP_TYPE_PCF_SOFT )
1865			vec2 texelSize = vec2( 1.0 ) / shadowMapSize;
1866			float dx = texelSize.x;
1867			float dy = texelSize.y;
1868			vec2 uv = shadowCoord.xy;
1869			vec2 f = fract( uv * shadowMapSize + 0.5 );
1870			uv -= f * texelSize;
1871			shadow = (
1872				texture2DCompare( shadowMap, uv, shadowCoord.z ) +
1873				texture2DCompare( shadowMap, uv + vec2( dx, 0.0 ), shadowCoord.z ) +
1874				texture2DCompare( shadowMap, uv + vec2( 0.0, dy ), shadowCoord.z ) +
1875				texture2DCompare( shadowMap, uv + texelSize, shadowCoord.z ) +
1876				mix( texture2DCompare( shadowMap, uv + vec2( -dx, 0.0 ), shadowCoord.z ),
1877					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 0.0 ), shadowCoord.z ),
1878					 f.x ) +
1879				mix( texture2DCompare( shadowMap, uv + vec2( -dx, dy ), shadowCoord.z ),
1880					 texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, dy ), shadowCoord.z ),
1881					 f.x ) +
1882				mix( texture2DCompare( shadowMap, uv + vec2( 0.0, -dy ), shadowCoord.z ),
1883					 texture2DCompare( shadowMap, uv + vec2( 0.0, 2.0 * dy ), shadowCoord.z ),
1884					 f.y ) +
1885				mix( texture2DCompare( shadowMap, uv + vec2( dx, -dy ), shadowCoord.z ),
1886					 texture2DCompare( shadowMap, uv + vec2( dx, 2.0 * dy ), shadowCoord.z ),
1887					 f.y ) +
1888				mix( mix( texture2DCompare( shadowMap, uv + vec2( -dx, -dy ), shadowCoord.z ),
1889						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, -dy ), shadowCoord.z ),
1890						  f.x ),
1891					 mix( texture2DCompare( shadowMap, uv + vec2( -dx, 2.0 * dy ), shadowCoord.z ),
1892						  texture2DCompare( shadowMap, uv + vec2( 2.0 * dx, 2.0 * dy ), shadowCoord.z ),
1893						  f.x ),
1894					 f.y )
1895			) * ( 1.0 / 9.0 );
1896		#elif defined( SHADOWMAP_TYPE_VSM )
1897			shadow = VSMShadow( shadowMap, shadowCoord.xy, shadowCoord.z );
1898		#else
1899			shadow = texture2DCompare( shadowMap, shadowCoord.xy, shadowCoord.z );
1900		#endif
1901		}
1902		return mix( 1.0, shadow, shadowIntensity );
1903	}
1904	vec2 cubeToUV( vec3 v, float texelSizeY ) {
1905		vec3 absV = abs( v );
1906		float scaleToCube = 1.0 / max( absV.x, max( absV.y, absV.z ) );
1907		absV *= scaleToCube;
1908		v *= scaleToCube * ( 1.0 - 2.0 * texelSizeY );
1909		vec2 planar = v.xy;
1910		float almostATexel = 1.5 * texelSizeY;
1911		float almostOne = 1.0 - almostATexel;
1912		if ( absV.z >= almostOne ) {
1913			if ( v.z > 0.0 )
1914				planar.x = 4.0 - v.x;
1915		} else if ( absV.x >= almostOne ) {
1916			float signX = sign( v.x );
1917			planar.x = v.z * signX + 2.0 * signX;
1918		} else if ( absV.y >= almostOne ) {
1919			float signY = sign( v.y );
1920			planar.x = v.x + 2.0 * signY + 2.0;
1921			planar.y = v.z * signY - 2.0;
1922		}
1923		return vec2( 0.125, 0.25 ) * planar + vec2( 0.375, 0.75 );
1924	}
1925	float getPointShadow( sampler2D shadowMap, vec2 shadowMapSize, float shadowIntensity, float shadowBias, float shadowRadius, vec4 shadowCoord, float shadowCameraNear, float shadowCameraFar ) {
1926		float shadow = 1.0;
1927		vec3 lightToPosition = shadowCoord.xyz;
1928		
1929		float lightToPositionLength = length( lightToPosition );
1930		if ( lightToPositionLength - shadowCameraFar <= 0.0 && lightToPositionLength - shadowCameraNear >= 0.0 ) {
1931			float dp = ( lightToPositionLength - shadowCameraNear ) / ( shadowCameraFar - shadowCameraNear );			dp += shadowBias;
1932			vec3 bd3D = normalize( lightToPosition );
1933			vec2 texelSize = vec2( 1.0 ) / ( shadowMapSize * vec2( 4.0, 2.0 ) );
1934			#if defined( SHADOWMAP_TYPE_PCF ) || defined( SHADOWMAP_TYPE_PCF_SOFT ) || defined( SHADOWMAP_TYPE_VSM )
1935				vec2 offset = vec2( - 1, 1 ) * shadowRadius * texelSize.y;
1936				shadow = (
1937					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyy, texelSize.y ), dp ) +
1938					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyy, texelSize.y ), dp ) +
1939					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xyx, texelSize.y ), dp ) +
1940					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yyx, texelSize.y ), dp ) +
1941					texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp ) +
1942					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxy, texelSize.y ), dp ) +
1943					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxy, texelSize.y ), dp ) +
1944					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.xxx, texelSize.y ), dp ) +
1945					texture2DCompare( shadowMap, cubeToUV( bd3D + offset.yxx, texelSize.y ), dp )
1946				) * ( 1.0 / 9.0 );
1947			#else
1948				shadow = texture2DCompare( shadowMap, cubeToUV( bd3D, texelSize.y ), dp );
1949			#endif
1950		}
1951		return mix( 1.0, shadow, shadowIntensity );
1952	}
1953#endif`,
1953M4=`#if NUM_SPOT_LIGHT_COORDS > 0
1954	uniform mat4 spotLightMatrix[ NUM_SPOT_LIGHT_COORDS ];
1955	varying vec4 vSpotLightCoord[ NUM_SPOT_LIGHT_COORDS ];
1956#endif
1957#ifdef USE_SHADOWMAP
1958	#if NUM_DIR_LIGHT_SHADOWS > 0
1959		uniform mat4 directionalShadowMatrix[ NUM_DIR_LIGHT_SHADOWS ];
1960		varying vec4 vDirectionalShadowCoord[ NUM_DIR_LIGHT_SHADOWS ];
1961		struct DirectionalLightShadow {
1962			float shadowIntensity;
1963			float shadowBias;
1964			float shadowNormalBias;
1965			float shadowRadius;
1966			vec2 shadowMapSize;
1967		};
1968		uniform DirectionalLightShadow directionalLightShadows[ NUM_DIR_LIGHT_SHADOWS ];
1969	#endif
1970	#if NUM_SPOT_LIGHT_SHADOWS > 0
1971		struct SpotLightShadow {
1972			float shadowIntensity;
1973			float shadowBias;
1974			float shadowNormalBias;
1975			float shadowRadius;
1976			vec2 shadowMapSize;
1977		};
1978		uniform SpotLightShadow spotLightShadows[ NUM_SPOT_LIGHT_SHADOWS ];
1979	#endif
1980	#if NUM_POINT_LIGHT_SHADOWS > 0
1981		uniform mat4 pointShadowMatrix[ NUM_POINT_LIGHT_SHADOWS ];
1982		varying vec4 vPointShadowCoord[ NUM_POINT_LIGHT_SHADOWS ];
1983		struct PointLightShadow {
1984			float shadowIntensity;
1985			float shadowBias;
1986			float shadowNormalBias;
1987			float shadowRadius;
1988			vec2 shadowMapSize;
1989			float shadowCameraNear;
1990			float shadowCameraFar;
1991		};
1992		uniform PointLightShadow pointLightShadows[ NUM_POINT_LIGHT_SHADOWS ];
1993	#endif
1994#endif`,E4=`#if ( defined( USE_SHADOWMAP ) && ( NUM_DIR_LIGHT_SHADOWS > 0 || NUM_POINT_LIGHT_SHADOWS > 0 ) ) || ( NUM_SPOT_LIGHT_COORDS > 0 )
1995	vec3 shadowWorldNormal = inverseTransformDirection( transformedNormal, viewMatrix );
1996	vec4 shadowWorldPosition;
1997#endif
1998#if defined( USE_SHADOWMAP )
1999	#if NUM_DIR_LIGHT_SHADOWS > 0
2000		#pragma unroll_loop_start
2001		for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2002			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * directionalLightShadows[ i ].shadowNormalBias, 0 );
2003			vDirectionalShadowCoord[ i ] = directionalShadowMatrix[ i ] * shadowWorldPosition;
2004		}
2005		#pragma unroll_loop_end
2006	#endif
2007	#if NUM_POINT_LIGHT_SHADOWS > 0
2008		#pragma unroll_loop_start
2009		for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2010			shadowWorldPosition = worldPosition + vec4( shadowWorldNormal * pointLightShadows[ i ].shadowNormalBias, 0 );
2011			vPointShadowCoord[ i ] = pointShadowMatrix[ i ] * shadowWorldPosition;
2012		}
2013		#pragma unroll_loop_end
2014	#endif
2015#endif
2016#if NUM_SPOT_LIGHT_COORDS > 0
2017	#pragma unroll_loop_start
2018	for ( int i = 0; i < NUM_SPOT_LIGHT_COORDS; i ++ ) {
2019		shadowWorldPosition = worldPosition;
2020		#if ( defined( USE_SHADOWMAP ) && UNROLLED_LOOP_INDEX < NUM_SPOT_LIGHT_SHADOWS )
2021			shadowWorldPosition.xyz += shadowWorldNormal * spotLightShadows[ i ].shadowNormalBias;
2022		#endif
2023		vSpotLightCoord[ i ] = spotLightMatrix[ i ] * shadowWorldPosition;
2024	}
2025	#pragma unroll_loop_end
2026#endif`,T4=`float getShadowMask() {
2027	float shadow = 1.0;
2028	#ifdef USE_SHADOWMAP
2029	#if NUM_DIR_LIGHT_SHADOWS > 0
2030	DirectionalLightShadow directionalLight;
2031	#pragma unroll_loop_start
2032	for ( int i = 0; i < NUM_DIR_LIGHT_SHADOWS; i ++ ) {
2033		directionalLight = directionalLightShadows[ i ];
2034		shadow *= receiveShadow ? getShadow( directionalShadowMap[ i ], directionalLight.shadowMapSize, directionalLight.shadowIntensity, directionalLight.shadowBias, directionalLight.shadowRadius, vDirectionalShadowCoord[ i ] ) : 1.0;
2035	}
2036	#pragma unroll_loop_end
2037	#endif
2038	#if NUM_SPOT_LIGHT_SHADOWS > 0
2039	SpotLightShadow spotLight;
2040	#pragma unroll_loop_start
2041	for ( int i = 0; i < NUM_SPOT_LIGHT_SHADOWS; i ++ ) {
2042		spotLight = spotLightShadows[ i ];
2043		shadow *= receiveShadow ? getShadow( spotShadowMap[ i ], spotLight.shadowMapSize, spotLight.shadowIntensity, spotLight.shadowBias, spotLight.shadowRadius, vSpotLightCoord[ i ] ) : 1.0;
2044	}
2045	#pragma unroll_loop_end
2046	#endif
2047	#if NUM_POINT_LIGHT_SHADOWS > 0
2048	PointLightShadow pointLight;
2049	#pragma unroll_loop_start
2050	for ( int i = 0; i < NUM_POINT_LIGHT_SHADOWS; i ++ ) {
2051		pointLight = pointLightShadows[ i ];
2052		shadow *= receiveShadow ? getPointShadow( pointShadowMap[ i ], pointLight.shadowMapSize, pointLight.shadowIntensity, pointLight.shadowBias, pointLight.shadowRadius, vPointShadowCoord[ i ], pointLight.shadowCameraNear, pointLight.shadowCameraFar ) : 1.0;
2053	}
2054	#pragma unroll_loop_end
2055	#endif
2056	#endif
2057	return shadow;
2058}`,w4=`#ifdef USE_SKINNING
2059	mat4 boneMatX = getBoneMatrix( skinIndex.x );
2060	mat4 boneMatY = getBoneMatrix( skinIndex.y );
2061	mat4 boneMatZ = getBoneMatrix( skinIndex.z );
2062	mat4 boneMatW = getBoneMatrix( skinIndex.w );
2063#endif`,C4=`#ifdef USE_SKINNING
2064	uniform mat4 bindMatrix;
2065	uniform mat4 bindMatrixInverse;
2066	uniform highp sampler2D boneTexture;
2067	mat4 getBoneMatrix( const in float i ) {
2068		int size = textureSize( boneTexture, 0 ).x;
2069		int j = int( i ) * 4;
2070		int x = j % size;
2071		int y = j / size;
2072		vec4 v1 = texelFetch( boneTexture, ivec2( x, y ), 0 );
2073		vec4 v2 = texelFetch( boneTexture, ivec2( x + 1, y ), 0 );
2074		vec4 v3 = texelFetch( boneTexture, ivec2( x + 2, y ), 0 );
2075		vec4 v4 = texelFetch( boneTexture, ivec2( x + 3, y ), 0 );
2076		return mat4( v1, v2, v3, v4 );
2077	}
2078#endif`,R4=`#ifdef USE_SKINNING
2079	vec4 skinVertex = bindMatrix * vec4( transformed, 1.0 );
2080	vec4 skinned = vec4( 0.0 );
2081	skinned += boneMatX * skinVertex * skinWeight.x;
2082	skinned += boneMatY * skinVertex * skinWeight.y;
2083	skinned += boneMatZ * skinVertex * skinWeight.z;
2084	skinned += boneMatW * skinVertex * skinWeight.w;
2085	transformed = ( bindMatrixInverse * skinned ).xyz;
2086#endif`,B4=`#ifdef USE_SKINNING
2087	mat4 skinMatrix = mat4( 0.0 );
2088	skinMatrix += skinWeight.x * boneMatX;
2089	skinMatrix += skinWeight.y * boneMatY;
2090	skinMatrix += skinWeight.z * boneMatZ;
2091	skinMatrix += skinWeight.w * boneMatW;
2092	skinMatrix = bindMatrixInverse * skinMatrix * bindMatrix;
2093	objectNormal = vec4( skinMatrix * vec4( objectNormal, 0.0 ) ).xyz;
2094	#ifdef USE_TANGENT
2095		objectTangent = vec4( skinMatrix * vec4( objectTangent, 0.0 ) ).xyz;
2096	#endif
2097#endif`,I4=`float specularStrength;
2098#ifdef USE_SPECULARMAP
2099	vec4 texelSpecular = texture2D( specularMap, vSpecularMapUv );
2100	specularStrength = texelSpecular.r;
2101#else
2102	specularStrength = 1.0;
2103#endif`,D4=`#ifdef USE_SPECULARMAP
2104	uniform sampler2D specularMap;
2105#endif`,L4=`#if defined( TONE_MAPPING )
2106	gl_FragColor.rgb = toneMapping( gl_FragColor.rgb );
2107#endif`,P4=`#ifndef saturate
2108#define saturate( a ) clamp( a, 0.0, 1.0 )
2109#endif
2110uniform float toneMappingExposure;
2111vec3 LinearToneMapping( vec3 color ) {
2112	return saturate( toneMappingExposure * color );
2113}
2114vec3 ReinhardToneMapping( vec3 color ) {
2115	color *= toneMappingExposure;
2116	return saturate( color / ( vec3( 1.0 ) + color ) );
2117}
2118vec3 CineonToneMapping( vec3 color ) {
2119	color *= toneMappingExposure;
2120	color = max( vec3( 0.0 ), color - 0.004 );
2121	return pow( ( color * ( 6.2 * color + 0.5 ) ) / ( color * ( 6.2 * color + 1.7 ) + 0.06 ), vec3( 2.2 ) );
2122}
2123vec3 RRTAndODTFit( vec3 v ) {
2124	vec3 a = v * ( v + 0.0245786 ) - 0.000090537;
2125	vec3 b = v * ( 0.983729 * v + 0.4329510 ) + 0.238081;
2126	return a / b;
2127}
2128vec3 ACESFilmicToneMapping( vec3 color ) {
2129	const mat3 ACESInputMat = mat3(
2130		vec3( 0.59719, 0.07600, 0.02840 ),		vec3( 0.35458, 0.90834, 0.13383 ),
2131		vec3( 0.04823, 0.01566, 0.83777 )
2132	);
2133	const mat3 ACESOutputMat = mat3(
2134		vec3(  1.60475, -0.10208, -0.00327 ),		vec3( -0.53108,  1.10813, -0.07276 ),
2135		vec3( -0.07367, -0.00605,  1.07602 )
2136	);
2137	color *= toneMappingExposure / 0.6;
2138	color = ACESInputMat * color;
2139	color = RRTAndODTFit( color );
2140	color = ACESOutputMat * color;
2141	return saturate( color );
2142}
2143const mat3 LINEAR_REC2020_TO_LINEAR_SRGB = mat3(
2144	vec3( 1.6605, - 0.1246, - 0.0182 ),
2145	vec3( - 0.5876, 1.1329, - 0.1006 ),
2146	vec3( - 0.0728, - 0.0083, 1.1187 )
2147);
2148const mat3 LINEAR_SRGB_TO_LINEAR_REC2020 = mat3(
2149	vec3( 0.6274, 0.0691, 0.0164 ),
2150	vec3( 0.3293, 0.9195, 0.0880 ),
2151	vec3( 0.0433, 0.0113, 0.8956 )
2152);
2153vec3 agxDefaultContrastApprox( vec3 x ) {
2154	vec3 x2 = x * x;
2155	vec3 x4 = x2 * x2;
2156	return + 15.5 * x4 * x2
2157		- 40.14 * x4 * x
2158		+ 31.96 * x4
2159		- 6.868 * x2 * x
2160		+ 0.4298 * x2
2161		+ 0.1191 * x
2162		- 0.00232;
2163}
2164vec3 AgXToneMapping( vec3 color ) {
2165	const mat3 AgXInsetMatrix = mat3(
2166		vec3( 0.856627153315983, 0.137318972929847, 0.11189821299995 ),
2167		vec3( 0.0951212405381588, 0.761241990602591, 0.0767994186031903 ),
2168		vec3( 0.0482516061458583, 0.101439036467562, 0.811302368396859 )
2169	);
2170	const mat3 AgXOutsetMatrix = mat3(
2171		vec3( 1.1271005818144368, - 0.1413297634984383, - 0.14132976349843826 ),
2172		vec3( - 0.11060664309660323, 1.157823702216272, - 0.11060664309660294 ),
2173		vec3( - 0.016493938717834573, - 0.016493938717834257, 1.2519364065950405 )
2174	);
2175	const float AgxMinEv = - 12.47393;	const float AgxMaxEv = 4.026069;
2176	color *= toneMappingExposure;
2177	color = LINEAR_SRGB_TO_LINEAR_REC2020 * color;
2178	color = AgXInsetMatrix * color;
2179	color = max( color, 1e-10 );	color = log2( color );
2180	color = ( color - AgxMinEv ) / ( AgxMaxEv - AgxMinEv );
2181	color = clamp( color, 0.0, 1.0 );
2182	color = agxDefaultContrastApprox( color );
2183	color = AgXOutsetMatrix * color;
2184	color = pow( max( vec3( 0.0 ), color ), vec3( 2.2 ) );
2185	color = LINEAR_REC2020_TO_LINEAR_SRGB * color;
2186	color = clamp( color, 0.0, 1.0 );
2187	return color;
2188}
2189vec3 NeutralToneMapping( vec3 color ) {
2190	const float StartCompression = 0.8 - 0.04;
2191	const float Desaturation = 0.15;
2192	color *= toneMappingExposure;
2193	float x = min( color.r, min( color.g, color.b ) );
2194	float offset = x < 0.08 ? x - 6.25 * x * x : 0.04;
2195	color -= offset;
2196	float peak = max( color.r, max( color.g, color.b ) );
2197	if ( peak < StartCompression ) return color;
2198	float d = 1. - StartCompression;
2199	float newPeak = 1. - d * d / ( peak + d - StartCompression );
2200	color *= newPeak / peak;
2201	float g = 1. - 1. / ( Desaturation * ( peak - newPeak ) + 1. );
2202	return mix( color, vec3( newPeak ), g );
2203}
2204vec3 CustomToneMapping( vec3 color ) { return color; }`,O4=`#ifdef USE_TRANSMISSION
2205	material.transmission = transmission;
2206	material.transmissionAlpha = 1.0;
2207	material.thickness = thickness;
2208	material.attenuationDistance = attenuationDistance;
2209	material.attenuationColor = attenuationColor;
2210	#ifdef USE_TRANSMISSIONMAP
2211		material.transmission *= texture2D( transmissionMap, vTransmissionMapUv ).r;
2212	#endif
2213	#ifdef USE_THICKNESSMAP
2214		material.thickness *= texture2D( thicknessMap, vThicknessMapUv ).g;
2215	#endif
2216	vec3 pos = vWorldPosition;
2217	vec3 v = normalize( cameraPosition - pos );
2218	vec3 n = inverseTransformDirection( normal, viewMatrix );
2219	vec4 transmitted = getIBLVolumeRefraction(
2220		n, v, material.roughness, material.diffuseColor, material.specularColor, material.specularF90,
2221		pos, modelMatrix, viewMatrix, projectionMatrix, material.dispersion, material.ior, material.thickness,
2222		material.attenuationColor, material.attenuationDistance );
2223	material.transmissionAlpha = mix( material.transmissionAlpha, transmitted.a, material.transmission );
2224	totalDiffuse = mix( totalDiffuse, transmitted.rgb, material.transmission );
2225#endif`,N4=`#ifdef USE_TRANSMISSION
2226	uniform float transmission;
2227	uniform float thickness;
2228	uniform float attenuationDistance;
2229	uniform vec3 attenuationColor;
2230	#ifdef USE_TRANSMISSIONMAP
2231		uniform sampler2D transmissionMap;
2232	#endif
2233	#ifdef USE_THICKNESSMAP
2234		uniform sampler2D thicknessMap;
2235	#endif
2236	uniform vec2 transmissionSamplerSize;
2237	uniform sampler2D transmissionSamplerMap;
2238	uniform mat4 modelMatrix;
2239	uniform mat4 projectionMatrix;
2240	varying vec3 vWorldPosition;
2241	float w0( float a ) {
2242		return ( 1.0 / 6.0 ) * ( a * ( a * ( - a + 3.0 ) - 3.0 ) + 1.0 );
2243	}
2244	float w1( float a ) {
2245		return ( 1.0 / 6.0 ) * ( a *  a * ( 3.0 * a - 6.0 ) + 4.0 );
2246	}
2247	float w2( float a ){
2248		return ( 1.0 / 6.0 ) * ( a * ( a * ( - 3.0 * a + 3.0 ) + 3.0 ) + 1.0 );
2249	}
2250	float w3( float a ) {
2251		return ( 1.0 / 6.0 ) * ( a * a * a );
2252	}
2253	float g0( float a ) {
2254		return w0( a ) + w1( a );
2255	}
2256	float g1( float a ) {
2257		return w2( a ) + w3( a );
2258	}
2259	float h0( float a ) {
2260		return - 1.0 + w1( a ) / ( w0( a ) + w1( a ) );
2261	}
2262	float h1( float a ) {
2263		return 1.0 + w3( a ) / ( w2( a ) + w3( a ) );
2264	}
2265	vec4 bicubic( sampler2D tex, vec2 uv, vec4 texelSize, float lod ) {
2266		uv = uv * texelSize.zw + 0.5;
2267		vec2 iuv = floor( uv );
2268		vec2 fuv = fract( uv );
2269		float g0x = g0( fuv.x );
2270		float g1x = g1( fuv.x );
2271		float h0x = h0( fuv.x );
2272		float h1x = h1( fuv.x );
2273		float h0y = h0( fuv.y );
2274		float h1y = h1( fuv.y );
2275		vec2 p0 = ( vec2( iuv.x + h0x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2276		vec2 p1 = ( vec2( iuv.x + h1x, iuv.y + h0y ) - 0.5 ) * texelSize.xy;
2277		vec2 p2 = ( vec2( iuv.x + h0x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2278		vec2 p3 = ( vec2( iuv.x + h1x, iuv.y + h1y ) - 0.5 ) * texelSize.xy;
2279		return g0( fuv.y ) * ( g0x * textureLod( tex, p0, lod ) + g1x * textureLod( tex, p1, lod ) ) +
2280			g1( fuv.y ) * ( g0x * textureLod( tex, p2, lod ) + g1x * textureLod( tex, p3, lod ) );
2281	}
2282	vec4 textureBicubic( sampler2D sampler, vec2 uv, float lod ) {
2283		vec2 fLodSize = vec2( textureSize( sampler, int( lod ) ) );
2284		vec2 cLodSize = vec2( textureSize( sampler, int( lod + 1.0 ) ) );
2285		vec2 fLodSizeInv = 1.0 / fLodSize;
2286		vec2 cLodSizeInv = 1.0 / cLodSize;
2287		vec4 fSample = bicubic( sampler, uv, vec4( fLodSizeInv, fLodSize ), floor( lod ) );
2288		vec4 cSample = bicubic( sampler, uv, vec4( cLodSizeInv, cLodSize ), ceil( lod ) );
2289		return mix( fSample, cSample, fract( lod ) );
2290	}
2291	vec3 getVolumeTransmissionRay( const in vec3 n, const in vec3 v, const in float thickness, const in float ior, const in mat4 modelMatrix ) {
2292		vec3 refractionVector = refract( - v, normalize( n ), 1.0 / ior );
2293		vec3 modelScale;
2294		modelScale.x = length( vec3( modelMatrix[ 0 ].xyz ) );
2295		modelScale.y = length( vec3( modelMatrix[ 1 ].xyz ) );
2296		modelScale.z = length( vec3( modelMatrix[ 2 ].xyz ) );
2297		return normalize( refractionVector ) * thickness * modelScale;
2298	}
2299	float applyIorToRoughness( const in float roughness, const in float ior ) {
2300		return roughness * clamp( ior * 2.0 - 2.0, 0.0, 1.0 );
2301	}
2302	vec4 getTransmissionSample( const in vec2 fragCoord, const in float roughness, const in float ior ) {
2303		float lod = log2( transmissionSamplerSize.x ) * applyIorToRoughness( roughness, ior );
2304		return textureBicubic( transmissionSamplerMap, fragCoord.xy, lod );
2305	}
2306	vec3 volumeAttenuation( const in float transmissionDistance, const in vec3 attenuationColor, const in float attenuationDistance ) {
2307		if ( isinf( attenuationDistance ) ) {
2308			return vec3( 1.0 );
2309		} else {
2310			vec3 attenuationCoefficient = -log( attenuationColor ) / attenuationDistance;
2311			vec3 transmittance = exp( - attenuationCoefficient * transmissionDistance );			return transmittance;
2312		}
2313	}
2314	vec4 getIBLVolumeRefraction( const in vec3 n, const in vec3 v, const in float roughness, const in vec3 diffuseColor,
2315		const in vec3 specularColor, const in float specularF90, const in vec3 position, const in mat4 modelMatrix,
2316		const in mat4 viewMatrix, const in mat4 projMatrix, const in float dispersion, const in float ior, const in float thickness,
2317		const in vec3 attenuationColor, const in float attenuationDistance ) {
2318		vec4 transmittedLight;
2319		vec3 transmittance;
2320		#ifdef USE_DISPERSION
2321			float halfSpread = ( ior - 1.0 ) * 0.025 * dispersion;
2322			vec3 iors = vec3( ior - halfSpread, ior, ior + halfSpread );
2323			for ( int i = 0; i < 3; i ++ ) {
2324				vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, iors[ i ], modelMatrix );
2325				vec3 refractedRayExit = position + transmissionRay;
2326				vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2327				vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2328				refractionCoords += 1.0;
2329				refractionCoords /= 2.0;
2330				vec4 transmissionSample = getTransmissionSample( refractionCoords, roughness, iors[ i ] );
2331				transmittedLight[ i ] = transmissionSample[ i ];
2332				transmittedLight.a += transmissionSample.a;
2333				transmittance[ i ] = diffuseColor[ i ] * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance )[ i ];
2334			}
2335			transmittedLight.a /= 3.0;
2336		#else
2337			vec3 transmissionRay = getVolumeTransmissionRay( n, v, thickness, ior, modelMatrix );
2338			vec3 refractedRayExit = position + transmissionRay;
2339			vec4 ndcPos = projMatrix * viewMatrix * vec4( refractedRayExit, 1.0 );
2340			vec2 refractionCoords = ndcPos.xy / ndcPos.w;
2341			refractionCoords += 1.0;
2342			refractionCoords /= 2.0;
2343			transmittedLight = getTransmissionSample( refractionCoords, roughness, ior );
2344			transmittance = diffuseColor * volumeAttenuation( length( transmissionRay ), attenuationColor, attenuationDistance );
2345		#endif
2346		vec3 attenuatedColor = transmittance * transmittedLight.rgb;
2347		vec3 F = EnvironmentBRDF( n, v, specularColor, specularF90, roughness );
2348		float transmittanceFactor = ( transmittance.r + transmittance.g + transmittance.b ) / 3.0;
2349		return vec4( ( 1.0 - F ) * attenuatedColor, 1.0 - ( 1.0 - transmittedLight.a ) * transmittanceFactor );
2350	}
2351#endif`,U4=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2352	varying vec2 vUv;
2353#endif
2354#ifdef USE_MAP
2355	varying vec2 vMapUv;
2356#endif
2357#ifdef USE_ALPHAMAP
2358	varying vec2 vAlphaMapUv;
2359#endif
2360#ifdef USE_LIGHTMAP
2361	varying vec2 vLightMapUv;
2362#endif
2363#ifdef USE_AOMAP
2364	varying vec2 vAoMapUv;
2365#endif
2366#ifdef USE_BUMPMAP
2367	varying vec2 vBumpMapUv;
2368#endif
2369#ifdef USE_NORMALMAP
2370	varying vec2 vNormalMapUv;
2371#endif
2372#ifdef USE_EMISSIVEMAP
2373	varying vec2 vEmissiveMapUv;
2374#endif
2375#ifdef USE_METALNESSMAP
2376	varying vec2 vMetalnessMapUv;
2377#endif
2378#ifdef USE_ROUGHNESSMAP
2379	varying vec2 vRoughnessMapUv;
2380#endif
2381#ifdef USE_ANISOTROPYMAP
2382	varying vec2 vAnisotropyMapUv;
2383#endif
2384#ifdef USE_CLEARCOATMAP
2385	varying vec2 vClearcoatMapUv;
2386#endif
2387#ifdef USE_CLEARCOAT_NORMALMAP
2388	varying vec2 vClearcoatNormalMapUv;
2389#endif
2390#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2391	varying vec2 vClearcoatRoughnessMapUv;
2392#endif
2393#ifdef USE_IRIDESCENCEMAP
2394	varying vec2 vIridescenceMapUv;
2395#endif
2396#ifdef USE_IRIDESCENCE_THICKNESSMAP
2397	varying vec2 vIridescenceThicknessMapUv;
2398#endif
2399#ifdef USE_SHEEN_COLORMAP
2400	varying vec2 vSheenColorMapUv;
2401#endif
2402#ifdef USE_SHEEN_ROUGHNESSMAP
2403	varying vec2 vSheenRoughnessMapUv;
2404#endif
2405#ifdef USE_SPECULARMAP
2406	varying vec2 vSpecularMapUv;
2407#endif
2408#ifdef USE_SPECULAR_COLORMAP
2409	varying vec2 vSpecularColorMapUv;
2410#endif
2411#ifdef USE_SPECULAR_INTENSITYMAP
2412	varying vec2 vSpecularIntensityMapUv;
2413#endif
2414#ifdef USE_TRANSMISSIONMAP
2415	uniform mat3 transmissionMapTransform;
2416	varying vec2 vTransmissionMapUv;
2417#endif
2418#ifdef USE_THICKNESSMAP
2419	uniform mat3 thicknessMapTransform;
2420	varying vec2 vThicknessMapUv;
2421#endif`,z4=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2422	varying vec2 vUv;
2423#endif
2424#ifdef USE_MAP
2425	uniform mat3 mapTransform;
2426	varying vec2 vMapUv;
2427#endif
2428#ifdef USE_ALPHAMAP
2429	uniform mat3 alphaMapTransform;
2430	varying vec2 vAlphaMapUv;
2431#endif
2432#ifdef USE_LIGHTMAP
2433	uniform mat3 lightMapTransform;
2434	varying vec2 vLightMapUv;
2435#endif
2436#ifdef USE_AOMAP
2437	uniform mat3 aoMapTransform;
2438	varying vec2 vAoMapUv;
2439#endif
2440#ifdef USE_BUMPMAP
2441	uniform mat3 bumpMapTransform;
2442	varying vec2 vBumpMapUv;
2443#endif
2444#ifdef USE_NORMALMAP
2445	uniform mat3 normalMapTransform;
2446	varying vec2 vNormalMapUv;
2447#endif
2448#ifdef USE_DISPLACEMENTMAP
2449	uniform mat3 displacementMapTransform;
2450	varying vec2 vDisplacementMapUv;
2451#endif
2452#ifdef USE_EMISSIVEMAP
2453	uniform mat3 emissiveMapTransform;
2454	varying vec2 vEmissiveMapUv;
2455#endif
2456#ifdef USE_METALNESSMAP
2457	uniform mat3 metalnessMapTransform;
2458	varying vec2 vMetalnessMapUv;
2459#endif
2460#ifdef USE_ROUGHNESSMAP
2461	uniform mat3 roughnessMapTransform;
2462	varying vec2 vRoughnessMapUv;
2463#endif
2464#ifdef USE_ANISOTROPYMAP
2465	uniform mat3 anisotropyMapTransform;
2466	varying vec2 vAnisotropyMapUv;
2467#endif
2468#ifdef USE_CLEARCOATMAP
2469	uniform mat3 clearcoatMapTransform;
2470	varying vec2 vClearcoatMapUv;
2471#endif
2472#ifdef USE_CLEARCOAT_NORMALMAP
2473	uniform mat3 clearcoatNormalMapTransform;
2474	varying vec2 vClearcoatNormalMapUv;
2475#endif
2476#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2477	uniform mat3 clearcoatRoughnessMapTransform;
2478	varying vec2 vClearcoatRoughnessMapUv;
2479#endif
2480#ifdef USE_SHEEN_COLORMAP
2481	uniform mat3 sheenColorMapTransform;
2482	varying vec2 vSheenColorMapUv;
2483#endif
2484#ifdef USE_SHEEN_ROUGHNESSMAP
2485	uniform mat3 sheenRoughnessMapTransform;
2486	varying vec2 vSheenRoughnessMapUv;
2487#endif
2488#ifdef USE_IRIDESCENCEMAP
2489	uniform mat3 iridescenceMapTransform;
2490	varying vec2 vIridescenceMapUv;
2491#endif
2492#ifdef USE_IRIDESCENCE_THICKNESSMAP
2493	uniform mat3 iridescenceThicknessMapTransform;
2494	varying vec2 vIridescenceThicknessMapUv;
2495#endif
2496#ifdef USE_SPECULARMAP
2497	uniform mat3 specularMapTransform;
2498	varying vec2 vSpecularMapUv;
2499#endif
2500#ifdef USE_SPECULAR_COLORMAP
2501	uniform mat3 specularColorMapTransform;
2502	varying vec2 vSpecularColorMapUv;
2503#endif
2504#ifdef USE_SPECULAR_INTENSITYMAP
2505	uniform mat3 specularIntensityMapTransform;
2506	varying vec2 vSpecularIntensityMapUv;
2507#endif
2508#ifdef USE_TRANSMISSIONMAP
2509	uniform mat3 transmissionMapTransform;
2510	varying vec2 vTransmissionMapUv;
2511#endif
2512#ifdef USE_THICKNESSMAP
2513	uniform mat3 thicknessMapTransform;
2514	varying vec2 vThicknessMapUv;
2515#endif`,F4=`#if defined( USE_UV ) || defined( USE_ANISOTROPY )
2516	vUv = vec3( uv, 1 ).xy;
2517#endif
2518#ifdef USE_MAP
2519	vMapUv = ( mapTransform * vec3( MAP_UV, 1 ) ).xy;
2520#endif
2521#ifdef USE_ALPHAMAP
2522	vAlphaMapUv = ( alphaMapTransform * vec3( ALPHAMAP_UV, 1 ) ).xy;
2523#endif
2524#ifdef USE_LIGHTMAP
2525	vLightMapUv = ( lightMapTransform * vec3( LIGHTMAP_UV, 1 ) ).xy;
2526#endif
2527#ifdef USE_AOMAP
2528	vAoMapUv = ( aoMapTransform * vec3( AOMAP_UV, 1 ) ).xy;
2529#endif
2530#ifdef USE_BUMPMAP
2531	vBumpMapUv = ( bumpMapTransform * vec3( BUMPMAP_UV, 1 ) ).xy;
2532#endif
2533#ifdef USE_NORMALMAP
2534	vNormalMapUv = ( normalMapTransform * vec3( NORMALMAP_UV, 1 ) ).xy;
2535#endif
2536#ifdef USE_DISPLACEMENTMAP
2537	vDisplacementMapUv = ( displacementMapTransform * vec3( DISPLACEMENTMAP_UV, 1 ) ).xy;
2538#endif
2539#ifdef USE_EMISSIVEMAP
2540	vEmissiveMapUv = ( emissiveMapTransform * vec3( EMISSIVEMAP_UV, 1 ) ).xy;
2541#endif
2542#ifdef USE_METALNESSMAP
2543	vMetalnessMapUv = ( metalnessMapTransform * vec3( METALNESSMAP_UV, 1 ) ).xy;
2544#endif
2545#ifdef USE_ROUGHNESSMAP
2546	vRoughnessMapUv = ( roughnessMapTransform * vec3( ROUGHNESSMAP_UV, 1 ) ).xy;
2547#endif
2548#ifdef USE_ANISOTROPYMAP
2549	vAnisotropyMapUv = ( anisotropyMapTransform * vec3( ANISOTROPYMAP_UV, 1 ) ).xy;
2550#endif
2551#ifdef USE_CLEARCOATMAP
2552	vClearcoatMapUv = ( clearcoatMapTransform * vec3( CLEARCOATMAP_UV, 1 ) ).xy;
2553#endif
2554#ifdef USE_CLEARCOAT_NORMALMAP
2555	vClearcoatNormalMapUv = ( clearcoatNormalMapTransform * vec3( CLEARCOAT_NORMALMAP_UV, 1 ) ).xy;
2556#endif
2557#ifdef USE_CLEARCOAT_ROUGHNESSMAP
2558	vClearcoatRoughnessMapUv = ( clearcoatRoughnessMapTransform * vec3( CLEARCOAT_ROUGHNESSMAP_UV, 1 ) ).xy;
2559#endif
2560#ifdef USE_IRIDESCENCEMAP
2561	vIridescenceMapUv = ( iridescenceMapTransform * vec3( IRIDESCENCEMAP_UV, 1 ) ).xy;
2562#endif
2563#ifdef USE_IRIDESCENCE_THICKNESSMAP
2564	vIridescenceThicknessMapUv = ( iridescenceThicknessMapTransform * vec3( IRIDESCENCE_THICKNESSMAP_UV, 1 ) ).xy;
2565#endif
2566#ifdef USE_SHEEN_COLORMAP
2567	vSheenColorMapUv = ( sheenColorMapTransform * vec3( SHEEN_COLORMAP_UV, 1 ) ).xy;
2568#endif
2569#ifdef USE_SHEEN_ROUGHNESSMAP
2570	vSheenRoughnessMapUv = ( sheenRoughnessMapTransform * vec3( SHEEN_ROUGHNESSMAP_UV, 1 ) ).xy;
2571#endif
2572#ifdef USE_SPECULARMAP
2573	vSpecularMapUv = ( specularMapTransform * vec3( SPECULARMAP_UV, 1 ) ).xy;
2574#endif
2575#ifdef USE_SPECULAR_COLORMAP
2576	vSpecularColorMapUv = ( specularColorMapTransform * vec3( SPECULAR_COLORMAP_UV, 1 ) ).xy;
2577#endif
2578#ifdef USE_SPECULAR_INTENSITYMAP
2579	vSpecularIntensityMapUv = ( specularIntensityMapTransform * vec3( SPECULAR_INTENSITYMAP_UV, 1 ) ).xy;
2580#endif
2581#ifdef USE_TRANSMISSIONMAP
2582	vTransmissionMapUv = ( transmissionMapTransform * vec3( TRANSMISSIONMAP_UV, 1 ) ).xy;
2583#endif
2584#ifdef USE_THICKNESSMAP
2585	vThicknessMapUv = ( thicknessMapTransform * vec3( THICKNESSMAP_UV, 1 ) ).xy;
2586#endif`,k4=`#if defined( USE_ENVMAP ) || defined( DISTANCE ) || defined ( USE_SHADOWMAP ) || defined ( USE_TRANSMISSION ) || NUM_SPOT_LIGHT_COORDS > 0
2587	vec4 worldPosition = vec4( transformed, 1.0 );
2588	#ifdef USE_BATCHING
2589		worldPosition = batchingMatrix * worldPosition;
2590	#endif
2591	#ifdef USE_INSTANCING
2592		worldPosition = instanceMatrix * worldPosition;
2593	#endif
2594	worldPosition = modelMatrix * worldPosition;
2595#endif`;const H4=`varying vec2 vUv;
2596uniform mat3 uvTransform;
2597void main() {
2598	vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
2599	gl_Position = vec4( position.xy, 1.0, 1.0 );
2600}`,G4=`uniform sampler2D t2D;
2601uniform float backgroundIntensity;
2602varying vec2 vUv;
2603void main() {
2604	vec4 texColor = texture2D( t2D, vUv );
2605	#ifdef DECODE_VIDEO_TEXTURE
2606		texColor = vec4( mix( pow( texColor.rgb * 0.9478672986 + vec3( 0.0521327014 ), vec3( 2.4 ) ), texColor.rgb * 0.0773993808, vec3( lessThanEqual( texColor.rgb, vec3( 0.04045 ) ) ) ), texColor.w );
2607	#endif
2608	texColor.rgb *= backgroundIntensity;
2609	gl_FragColor = texColor;
2610	#include <tonemapping_fragment>
2611	#include <colorspace_fragment>
2612}`,j4=`varying vec3 vWorldDirection;
2613#include <common>
2614void main() {
2615	vWorldDirection = transformDirection( position, modelMatrix );
2616	#include <begin_vertex>
2617	#include <project_vertex>
2618	gl_Position.z = gl_Position.w;
2619}`,V4=`#ifdef ENVMAP_TYPE_CUBE
2620	uniform samplerCube envMap;
2621#elif defined( ENVMAP_TYPE_CUBE_UV )
2622	uniform sampler2D envMap;
2623#endif
2624uniform float flipEnvMap;
2625uniform float backgroundBlurriness;
2626uniform float backgroundIntensity;
2627uniform mat3 backgroundRotation;
2628varying vec3 vWorldDirection;
2629#include <cube_uv_reflection_fragment>
2630void main() {
2631	#ifdef ENVMAP_TYPE_CUBE
2632		vec4 texColor = textureCube( envMap, backgroundRotation * vec3( flipEnvMap * vWorldDirection.x, vWorldDirection.yz ) );
2633	#elif defined( ENVMAP_TYPE_CUBE_UV )
2634		vec4 texColor = textureCubeUV( envMap, backgroundRotation * vWorldDirection, backgroundBlurriness );
2635	#else
2636		vec4 texColor = vec4( 0.0, 0.0, 0.0, 1.0 );
2637	#endif
2638	texColor.rgb *= backgroundIntensity;
2639	gl_FragColor = texColor;
2640	#include <tonemapping_fragment>
2641	#include <colorspace_fragment>
2642}`,W4=`varying vec3 vWorldDirection;
2643#include <common>
2644void main() {
2645	vWorldDirection = transformDirection( position, modelMatrix );
2646	#include <begin_vertex>
2647	#include <project_vertex>
2648	gl_Position.z = gl_Position.w;
2649}`,X4=`uniform samplerCube tCube;
2650uniform float tFlip;
2651uniform float opacity;
2652varying vec3 vWorldDirection;
2653void main() {
2654	vec4 texColor = textureCube( tCube, vec3( tFlip * vWorldDirection.x, vWorldDirection.yz ) );
2655	gl_FragColor = texColor;
2656	gl_FragColor.a *= opacity;
2657	#include <tonemapping_fragment>
2658	#include <colorspace_fragment>
2659}`,q4=`#include <common>
2660#include <batching_pars_vertex>
2661#include <uv_pars_vertex>
2662#include <displacementmap_pars_vertex>
2663#include <morphtarget_pars_vertex>
2664#include <skinning_pars_vertex>
2665#include <logdepthbuf_pars_vertex>
2666#include <clipping_planes_pars_vertex>
2667varying vec2 vHighPrecisionZW;
2668void main() {
2669	#include <uv_vertex>
2670	#include <batching_vertex>
2671	#include <skinbase_vertex>
2672	#include <morphinstance_vertex>
2673	#ifdef USE_DISPLACEMENTMAP
2674		#include <beginnormal_vertex>
2675		#include <morphnormal_vertex>
2676		#include <skinnormal_vertex>
2677	#endif
2678	#include <begin_vertex>
2679	#include <morphtarget_vertex>
2680	#include <skinning_vertex>
2681	#include <displacementmap_vertex>
2682	#include <project_vertex>
2683	#include <logdepthbuf_vertex>
2684	#include <clipping_planes_vertex>
2685	vHighPrecisionZW = gl_Position.zw;
2686}`,Y4=`#if DEPTH_PACKING == 3200
2687	uniform float opacity;
2688#endif
2689#include <common>
2690#include <packing>
2691#include <uv_pars_fragment>
2692#include <map_pars_fragment>
2693#include <alphamap_pars_fragment>
2694#include <alphatest_pars_fragment>
2695#include <alphahash_pars_fragment>
2696#include <logdepthbuf_pars_fragment>
2697#include <clipping_planes_pars_fragment>
2698varying vec2 vHighPrecisionZW;
2699void main() {
2700	vec4 diffuseColor = vec4( 1.0 );
2701	#include <clipping_planes_fragment>
2702	#if DEPTH_PACKING == 3200
2703		diffuseColor.a = opacity;
2704	#endif
2705	#include <map_fragment>
2706	#include <alphamap_fragment>
2707	#include <alphatest_fragment>
2708	#include <alphahash_fragment>
2709	#include <logdepthbuf_fragment>
2710	float fragCoordZ = 0.5 * vHighPrecisionZW[0] / vHighPrecisionZW[1] + 0.5;
2711	#if DEPTH_PACKING == 3200
2712		gl_FragColor = vec4( vec3( 1.0 - fragCoordZ ), opacity );
2713	#elif DEPTH_PACKING == 3201
2714		gl_FragColor = packDepthToRGBA( fragCoordZ );
2715	#elif DEPTH_PACKING == 3202
2716		gl_FragColor = vec4( packDepthToRGB( fragCoordZ ), 1.0 );
2717	#elif DEPTH_PACKING == 3203
2718		gl_FragColor = vec4( packDepthToRG( fragCoordZ ), 0.0, 1.0 );
2719	#endif
2720}`,J4=`#define DISTANCE
2721varying vec3 vWorldPosition;
2722#include <common>
2723#include <batching_pars_vertex>
2724#include <uv_pars_vertex>
2725#include <displacementmap_pars_vertex>
2726#include <morphtarget_pars_vertex>
2727#include <skinning_pars_vertex>
2728#include <clipping_planes_pars_vertex>
2729void main() {
2730	#include <uv_vertex>
2731	#include <batching_vertex>
2732	#include <skinbase_vertex>
2733	#include <morphinstance_vertex>
2734	#ifdef USE_DISPLACEMENTMAP
2735		#include <beginnormal_vertex>
2736		#include <morphnormal_vertex>
2737		#include <skinnormal_vertex>
2738	#endif
2739	#include <begin_vertex>
2740	#include <morphtarget_vertex>
2741	#include <skinning_vertex>
2742	#include <displacementmap_vertex>
2743	#include <project_vertex>
2744	#include <worldpos_vertex>
2745	#include <clipping_planes_vertex>
2746	vWorldPosition = worldPosition.xyz;
2747}`,K4=`#define DISTANCE
2748uniform vec3 referencePosition;
2749uniform float nearDistance;
2750uniform float farDistance;
2751varying vec3 vWorldPosition;
2752#include <common>
2753#include <packing>
2754#include <uv_pars_fragment>
2755#include <map_pars_fragment>
2756#include <alphamap_pars_fragment>
2757#include <alphatest_pars_fragment>
2758#include <alphahash_pars_fragment>
2759#include <clipping_planes_pars_fragment>
2760void main () {
2761	vec4 diffuseColor = vec4( 1.0 );
2762	#include <clipping_planes_fragment>
2763	#include <map_fragment>
2764	#include <alphamap_fragment>
2765	#include <alphatest_fragment>
2766	#include <alphahash_fragment>
2767	float dist = length( vWorldPosition - referencePosition );
2768	dist = ( dist - nearDistance ) / ( farDistance - nearDistance );
2769	dist = saturate( dist );
2770	gl_FragColor = packDepthToRGBA( dist );
2771}`,Z4=`varying vec3 vWorldDirection;
2772#include <common>
2773void main() {
2774	vWorldDirection = transformDirection( position, modelMatrix );
2775	#include <begin_vertex>
2776	#include <project_vertex>
2777}`,Q4=`uniform sampler2D tEquirect;
2778varying vec3 vWorldDirection;
2779#include <common>
2780void main() {
2781	vec3 direction = normalize( vWorldDirection );
2782	vec2 sampleUV = equirectUv( direction );
2783	gl_FragColor = texture2D( tEquirect, sampleUV );
2784	#include <tonemapping_fragment>
2785	#include <colorspace_fragment>
2786}`,$4=`uniform float scale;
2787attribute float lineDistance;
2788varying float vLineDistance;
2789#include <common>
2790#include <uv_pars_vertex>
2791#include <color_pars_vertex>
2792#include <fog_pars_vertex>
2793#include <morphtarget_pars_vertex>
2794#include <logdepthbuf_pars_vertex>
2795#include <clipping_planes_pars_vertex>
2796void main() {
2797	vLineDistance = scale * lineDistance;
2798	#include <uv_vertex>
2799	#include <color_vertex>
2800	#include <morphinstance_vertex>
2801	#include <morphcolor_vertex>
2802	#include <begin_vertex>
2803	#include <morphtarget_vertex>
2804	#include <project_vertex>
2805	#include <logdepthbuf_vertex>
2806	#include <clipping_planes_vertex>
2807	#include <fog_vertex>
2808}`,ez=`uniform vec3 diffuse;
2809uniform float opacity;
2810uniform float dashSize;
2811uniform float totalSize;
2812varying float vLineDistance;
2813#include <common>
2814#include <color_pars_fragment>
2815#include <uv_pars_fragment>
2816#include <map_pars_fragment>
2817#include <fog_pars_fragment>
2818#include <logdepthbuf_pars_fragment>
2819#include <clipping_planes_pars_fragment>
2820void main() {
2821	vec4 diffuseColor = vec4( diffuse, opacity );
2822	#include <clipping_planes_fragment>
2823	if ( mod( vLineDistance, totalSize ) > dashSize ) {
2824		discard;
2825	}
2826	vec3 outgoingLight = vec3( 0.0 );
2827	#include <logdepthbuf_fragment>
2828	#include <map_fragment>
2829	#include <color_fragment>
2830	outgoingLight = diffuseColor.rgb;
2831	#include <opaque_fragment>
2832	#include <tonemapping_fragment>
2833	#include <colorspace_fragment>
2834	#include <fog_fragment>
2835	#include <premultiplied_alpha_fragment>
2836}`,tz=`#include <common>
2837#include <batching_pars_vertex>
2838#include <uv_pars_vertex>
2839#include <envmap_pars_vertex>
2840#include <color_pars_vertex>
2841#include <fog_pars_vertex>
2842#include <morphtarget_pars_vertex>
2843#include <skinning_pars_vertex>
2844#include <logdepthbuf_pars_vertex>
2845#include <clipping_planes_pars_vertex>
2846void main() {
2847	#include <uv_vertex>
2848	#include <color_vertex>
2849	#include <morphinstance_vertex>
2850	#include <morphcolor_vertex>
2851	#include <batching_vertex>
2852	#if defined ( USE_ENVMAP ) || defined ( USE_SKINNING )
2853		#include <beginnormal_vertex>
2854		#include <morphnormal_vertex>
2855		#include <skinbase_vertex>
2856		#include <skinnormal_vertex>
2857		#include <defaultnormal_vertex>
2858	#endif
2859	#include <begin_vertex>
2860	#include <morphtarget_vertex>
2861	#include <skinning_vertex>
2862	#include <project_vertex>
2863	#include <logdepthbuf_vertex>
2864	#include <clipping_planes_vertex>
2865	#include <worldpos_vertex>
2866	#include <envmap_vertex>
2867	#include <fog_vertex>
2868}`,nz=`uniform vec3 diffuse;
2869uniform float opacity;
2870#ifndef FLAT_SHADED
2871	varying vec3 vNormal;
2872#endif
2873#include <common>
2874#include <dithering_pars_fragment>
2875#include <color_pars_fragment>
2876#include <uv_pars_fragment>
2877#include <map_pars_fragment>
2878#include <alphamap_pars_fragment>
2879#include <alphatest_pars_fragment>
2880#include <alphahash_pars_fragment>
2881#include <aomap_pars_fragment>
2882#include <lightmap_pars_fragment>
2883#include <envmap_common_pars_fragment>
2884#include <envmap_pars_fragment>
2885#include <fog_pars_fragment>
2886#include <specularmap_pars_fragment>
2887#include <logdepthbuf_pars_fragment>
2888#include <clipping_planes_pars_fragment>
2889void main() {
2890	vec4 diffuseColor = vec4( diffuse, opacity );
2891	#include <clipping_planes_fragment>
2892	#include <logdepthbuf_fragment>
2893	#include <map_fragment>
2894	#include <color_fragment>
2895	#include <alphamap_fragment>
2896	#include <alphatest_fragment>
2897	#include <alphahash_fragment>
2898	#include <specularmap_fragment>
2899	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2900	#ifdef USE_LIGHTMAP
2901		vec4 lightMapTexel = texture2D( lightMap, vLightMapUv );
2902		reflectedLight.indirectDiffuse += lightMapTexel.rgb * lightMapIntensity * RECIPROCAL_PI;
2903	#else
2904		reflectedLight.indirectDiffuse += vec3( 1.0 );
2905	#endif
2906	#include <aomap_fragment>
2907	reflectedLight.indirectDiffuse *= diffuseColor.rgb;
2908	vec3 outgoingLight = reflectedLight.indirectDiffuse;
2909	#include <envmap_fragment>
2910	#include <opaque_fragment>
2911	#include <tonemapping_fragment>
2912	#include <colorspace_fragment>
2913	#include <fog_fragment>
2914	#include <premultiplied_alpha_fragment>
2915	#include <dithering_fragment>
2916}`,iz=`#define LAMBERT
2917varying vec3 vViewPosition;
2918#include <common>
2919#include <batching_pars_vertex>
2920#include <uv_pars_vertex>
2921#include <displacementmap_pars_vertex>
2922#include <envmap_pars_vertex>
2923#include <color_pars_vertex>
2924#include <fog_pars_vertex>
2925#include <normal_pars_vertex>
2926#include <morphtarget_pars_vertex>
2927#include <skinning_pars_vertex>
2928#include <shadowmap_pars_vertex>
2929#include <logdepthbuf_pars_vertex>
2930#include <clipping_planes_pars_vertex>
2931void main() {
2932	#include <uv_vertex>
2933	#include <color_vertex>
2934	#include <morphinstance_vertex>
2935	#include <morphcolor_vertex>
2936	#include <batching_vertex>
2937	#include <beginnormal_vertex>
2938	#include <morphnormal_vertex>
2939	#include <skinbase_vertex>
2940	#include <skinnormal_vertex>
2941	#include <defaultnormal_vertex>
2942	#include <normal_vertex>
2943	#include <begin_vertex>
2944	#include <morphtarget_vertex>
2945	#include <skinning_vertex>
2946	#include <displacementmap_vertex>
2947	#include <project_vertex>
2948	#include <logdepthbuf_vertex>
2949	#include <clipping_planes_vertex>
2950	vViewPosition = - mvPosition.xyz;
2951	#include <worldpos_vertex>
2952	#include <envmap_vertex>
2953	#include <shadowmap_vertex>
2954	#include <fog_vertex>
2955}`,sz=`#define LAMBERT
2956uniform vec3 diffuse;
2957uniform vec3 emissive;
2958uniform float opacity;
2959#include <common>
2960#include <packing>
2961#include <dithering_pars_fragment>
2962#include <color_pars_fragment>
2963#include <uv_pars_fragment>
2964#include <map_pars_fragment>
2965#include <alphamap_pars_fragment>
2966#include <alphatest_pars_fragment>
2967#include <alphahash_pars_fragment>
2968#include <aomap_pars_fragment>
2969#include <lightmap_pars_fragment>
2970#include <emissivemap_pars_fragment>
2971#include <envmap_common_pars_fragment>
2972#include <envmap_pars_fragment>
2973#include <fog_pars_fragment>
2974#include <bsdfs>
2975#include <lights_pars_begin>
2976#include <normal_pars_fragment>
2977#include <lights_lambert_pars_fragment>
2978#include <shadowmap_pars_fragment>
2979#include <bumpmap_pars_fragment>
2980#include <normalmap_pars_fragment>
2981#include <specularmap_pars_fragment>
2982#include <logdepthbuf_pars_fragment>
2983#include <clipping_planes_pars_fragment>
2984void main() {
2985	vec4 diffuseColor = vec4( diffuse, opacity );
2986	#include <clipping_planes_fragment>
2987	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
2988	vec3 totalEmissiveRadiance = emissive;
2989	#include <logdepthbuf_fragment>
2990	#include <map_fragment>
2991	#include <color_fragment>
2992	#include <alphamap_fragment>
2993	#include <alphatest_fragment>
2994	#include <alphahash_fragment>
2995	#include <specularmap_fragment>
2996	#include <normal_fragment_begin>
2997	#include <normal_fragment_maps>
2998	#include <emissivemap_fragment>
2999	#include <lights_lambert_fragment>
3000	#include <lights_fragment_begin>
3001	#include <lights_fragment_maps>
3002	#include <lights_fragment_end>
3003	#include <aomap_fragment>
3004	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3005	#include <envmap_fragment>
3006	#include <opaque_fragment>
3007	#include <tonemapping_fragment>
3008	#include <colorspace_fragment>
3009	#include <fog_fragment>
3010	#include <premultiplied_alpha_fragment>
3011	#include <dithering_fragment>
3012}`,rz=`#define MATCAP
3013varying vec3 vViewPosition;
3014#include <common>
3015#include <batching_pars_vertex>
3016#include <uv_pars_vertex>
3017#include <color_pars_vertex>
3018#include <displacementmap_pars_vertex>
3019#include <fog_pars_vertex>
3020#include <normal_pars_vertex>
3021#include <morphtarget_pars_vertex>
3022#include <skinning_pars_vertex>
3023#include <logdepthbuf_pars_vertex>
3024#include <clipping_planes_pars_vertex>
3025void main() {
3026	#include <uv_vertex>
3027	#include <color_vertex>
3028	#include <morphinstance_vertex>
3029	#include <morphcolor_vertex>
3030	#include <batching_vertex>
3031	#include <beginnormal_vertex>
3032	#include <morphnormal_vertex>
3033	#include <skinbase_vertex>
3034	#include <skinnormal_vertex>
3035	#include <defaultnormal_vertex>
3036	#include <normal_vertex>
3037	#include <begin_vertex>
3038	#include <morphtarget_vertex>
3039	#include <skinning_vertex>
3040	#include <displacementmap_vertex>
3041	#include <project_vertex>
3042	#include <logdepthbuf_vertex>
3043	#include <clipping_planes_vertex>
3044	#include <fog_vertex>
3045	vViewPosition = - mvPosition.xyz;
3046}`,az=`#define MATCAP
3047uniform vec3 diffuse;
3048uniform float opacity;
3049uniform sampler2D matcap;
3050varying vec3 vViewPosition;
3051#include <common>
3052#include <dithering_pars_fragment>
3053#include <color_pars_fragment>
3054#include <uv_pars_fragment>
3055#include <map_pars_fragment>
3056#include <alphamap_pars_fragment>
3057#include <alphatest_pars_fragment>
3058#include <alphahash_pars_fragment>
3059#include <fog_pars_fragment>
3060#include <normal_pars_fragment>
3061#include <bumpmap_pars_fragment>
3062#include <normalmap_pars_fragment>
3063#include <logdepthbuf_pars_fragment>
3064#include <clipping_planes_pars_fragment>
3065void main() {
3066	ve
3066c4 diffuseColor = vec4( diffuse, opacity );
3067	#include <clipping_planes_fragment>
3068	#include <logdepthbuf_fragment>
3069	#include <map_fragment>
3070	#include <color_fragment>
3071	#include <alphamap_fragment>
3072	#include <alphatest_fragment>
3073	#include <alphahash_fragment>
3074	#include <normal_fragment_begin>
3075	#include <normal_fragment_maps>
3076	vec3 viewDir = normalize( vViewPosition );
3077	vec3 x = normalize( vec3( viewDir.z, 0.0, - viewDir.x ) );
3078	vec3 y = cross( viewDir, x );
3079	vec2 uv = vec2( dot( x, normal ), dot( y, normal ) ) * 0.495 + 0.5;
3080	#ifdef USE_MATCAP
3081		vec4 matcapColor = texture2D( matcap, uv );
3082	#else
3083		vec4 matcapColor = vec4( vec3( mix( 0.2, 0.8, uv.y ) ), 1.0 );
3084	#endif
3085	vec3 outgoingLight = diffuseColor.rgb * matcapColor.rgb;
3086	#include <opaque_fragment>
3087	#include <tonemapping_fragment>
3088	#include <colorspace_fragment>
3089	#include <fog_fragment>
3090	#include <premultiplied_alpha_fragment>
3091	#include <dithering_fragment>
3092}`,oz=`#define NORMAL
3093#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3094	varying vec3 vViewPosition;
3095#endif
3096#include <common>
3097#include <batching_pars_vertex>
3098#include <uv_pars_vertex>
3099#include <displacementmap_pars_vertex>
3100#include <normal_pars_vertex>
3101#include <morphtarget_pars_vertex>
3102#include <skinning_pars_vertex>
3103#include <logdepthbuf_pars_vertex>
3104#include <clipping_planes_pars_vertex>
3105void main() {
3106	#include <uv_vertex>
3107	#include <batching_vertex>
3108	#include <beginnormal_vertex>
3109	#include <morphinstance_vertex>
3110	#include <morphnormal_vertex>
3111	#include <skinbase_vertex>
3112	#include <skinnormal_vertex>
3113	#include <defaultnormal_vertex>
3114	#include <normal_vertex>
3115	#include <begin_vertex>
3116	#include <morphtarget_vertex>
3117	#include <skinning_vertex>
3118	#include <displacementmap_vertex>
3119	#include <project_vertex>
3120	#include <logdepthbuf_vertex>
3121	#include <clipping_planes_vertex>
3122#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3123	vViewPosition = - mvPosition.xyz;
3124#endif
3125}`,lz=`#define NORMAL
3126uniform float opacity;
3127#if defined( FLAT_SHADED ) || defined( USE_BUMPMAP ) || defined( USE_NORMALMAP_TANGENTSPACE )
3128	varying vec3 vViewPosition;
3129#endif
3130#include <packing>
3131#include <uv_pars_fragment>
3132#include <normal_pars_fragment>
3133#include <bumpmap_pars_fragment>
3134#include <normalmap_pars_fragment>
3135#include <logdepthbuf_pars_fragment>
3136#include <clipping_planes_pars_fragment>
3137void main() {
3138	vec4 diffuseColor = vec4( 0.0, 0.0, 0.0, opacity );
3139	#include <clipping_planes_fragment>
3140	#include <logdepthbuf_fragment>
3141	#include <normal_fragment_begin>
3142	#include <normal_fragment_maps>
3143	gl_FragColor = vec4( packNormalToRGB( normal ), diffuseColor.a );
3144	#ifdef OPAQUE
3145		gl_FragColor.a = 1.0;
3146	#endif
3147}`,cz=`#define PHONG
3148varying vec3 vViewPosition;
3149#include <common>
3150#include <batching_pars_vertex>
3151#include <uv_pars_vertex>
3152#include <displacementmap_pars_vertex>
3153#include <envmap_pars_vertex>
3154#include <color_pars_vertex>
3155#include <fog_pars_vertex>
3156#include <normal_pars_vertex>
3157#include <morphtarget_pars_vertex>
3158#include <skinning_pars_vertex>
3159#include <shadowmap_pars_vertex>
3160#include <logdepthbuf_pars_vertex>
3161#include <clipping_planes_pars_vertex>
3162void main() {
3163	#include <uv_vertex>
3164	#include <color_vertex>
3165	#include <morphcolor_vertex>
3166	#include <batching_vertex>
3167	#include <beginnormal_vertex>
3168	#include <morphinstance_vertex>
3169	#include <morphnormal_vertex>
3170	#include <skinbase_vertex>
3171	#include <skinnormal_vertex>
3172	#include <defaultnormal_vertex>
3173	#include <normal_vertex>
3174	#include <begin_vertex>
3175	#include <morphtarget_vertex>
3176	#include <skinning_vertex>
3177	#include <displacementmap_vertex>
3178	#include <project_vertex>
3179	#include <logdepthbuf_vertex>
3180	#include <clipping_planes_vertex>
3181	vViewPosition = - mvPosition.xyz;
3182	#include <worldpos_vertex>
3183	#include <envmap_vertex>
3184	#include <shadowmap_vertex>
3185	#include <fog_vertex>
3186}`,uz=`#define PHONG
3187uniform vec3 diffuse;
3188uniform vec3 emissive;
3189uniform vec3 specular;
3190uniform float shininess;
3191uniform float opacity;
3192#include <common>
3193#include <packing>
3194#include <dithering_pars_fragment>
3195#include <color_pars_fragment>
3196#include <uv_pars_fragment>
3197#include <map_pars_fragment>
3198#include <alphamap_pars_fragment>
3199#include <alphatest_pars_fragment>
3200#include <alphahash_pars_fragment>
3201#include <aomap_pars_fragment>
3202#include <lightmap_pars_fragment>
3203#include <emissivemap_pars_fragment>
3204#include <envmap_common_pars_fragment>
3205#include <envmap_pars_fragment>
3206#include <fog_pars_fragment>
3207#include <bsdfs>
3208#include <lights_pars_begin>
3209#include <normal_pars_fragment>
3210#include <lights_phong_pars_fragment>
3211#include <shadowmap_pars_fragment>
3212#include <bumpmap_pars_fragment>
3213#include <normalmap_pars_fragment>
3214#include <specularmap_pars_fragment>
3215#include <logdepthbuf_pars_fragment>
3216#include <clipping_planes_pars_fragment>
3217void main() {
3218	vec4 diffuseColor = vec4( diffuse, opacity );
3219	#include <clipping_planes_fragment>
3220	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3221	vec3 totalEmissiveRadiance = emissive;
3222	#include <logdepthbuf_fragment>
3223	#include <map_fragment>
3224	#include <color_fragment>
3225	#include <alphamap_fragment>
3226	#include <alphatest_fragment>
3227	#include <alphahash_fragment>
3228	#include <specularmap_fragment>
3229	#include <normal_fragment_begin>
3230	#include <normal_fragment_maps>
3231	#include <emissivemap_fragment>
3232	#include <lights_phong_fragment>
3233	#include <lights_fragment_begin>
3234	#include <lights_fragment_maps>
3235	#include <lights_fragment_end>
3236	#include <aomap_fragment>
3237	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + reflectedLight.directSpecular + reflectedLight.indirectSpecular + totalEmissiveRadiance;
3238	#include <envmap_fragment>
3239	#include <opaque_fragment>
3240	#include <tonemapping_fragment>
3241	#include <colorspace_fragment>
3242	#include <fog_fragment>
3243	#include <premultiplied_alpha_fragment>
3244	#include <dithering_fragment>
3245}`,fz=`#define STANDARD
3246varying vec3 vViewPosition;
3247#ifdef USE_TRANSMISSION
3248	varying vec3 vWorldPosition;
3249#endif
3250#include <common>
3251#include <batching_pars_vertex>
3252#include <uv_pars_vertex>
3253#include <displacementmap_pars_vertex>
3254#include <color_pars_vertex>
3255#include <fog_pars_vertex>
3256#include <normal_pars_vertex>
3257#include <morphtarget_pars_vertex>
3258#include <skinning_pars_vertex>
3259#include <shadowmap_pars_vertex>
3260#include <logdepthbuf_pars_vertex>
3261#include <clipping_planes_pars_vertex>
3262void main() {
3263	#include <uv_vertex>
3264	#include <color_vertex>
3265	#include <morphinstance_vertex>
3266	#include <morphcolor_vertex>
3267	#include <batching_vertex>
3268	#include <beginnormal_vertex>
3269	#include <morphnormal_vertex>
3270	#include <skinbase_vertex>
3271	#include <skinnormal_vertex>
3272	#include <defaultnormal_vertex>
3273	#include <normal_vertex>
3274	#include <begin_vertex>
3275	#include <morphtarget_vertex>
3276	#include <skinning_vertex>
3277	#include <displacementmap_vertex>
3278	#include <project_vertex>
3279	#include <logdepthbuf_vertex>
3280	#include <clipping_planes_vertex>
3281	vViewPosition = - mvPosition.xyz;
3282	#include <worldpos_vertex>
3283	#include <shadowmap_vertex>
3284	#include <fog_vertex>
3285#ifdef USE_TRANSMISSION
3286	vWorldPosition = worldPosition.xyz;
3287#endif
3288}`,dz=`#define STANDARD
3289#ifdef PHYSICAL
3290	#define IOR
3291	#define USE_SPECULAR
3292#endif
3293uniform vec3 diffuse;
3294uniform vec3 emissive;
3295uniform float roughness;
3296uniform float metalness;
3297uniform float opacity;
3298#ifdef IOR
3299	uniform float ior;
3300#endif
3301#ifdef USE_SPECULAR
3302	uniform float specularIntensity;
3303	uniform vec3 specularColor;
3304	#ifdef USE_SPECULAR_COLORMAP
3305		uniform sampler2D specularColorMap;
3306	#endif
3307	#ifdef USE_SPECULAR_INTENSITYMAP
3308		uniform sampler2D specularIntensityMap;
3309	#endif
3310#endif
3311#ifdef USE_CLEARCOAT
3312	uniform float clearcoat;
3313	uniform float clearcoatRoughness;
3314#endif
3315#ifdef USE_DISPERSION
3316	uniform float dispersion;
3317#endif
3318#ifdef USE_IRIDESCENCE
3319	uniform float iridescence;
3320	uniform float iridescenceIOR;
3321	uniform float iridescenceThicknessMinimum;
3322	uniform float iridescenceThicknessMaximum;
3323#endif
3324#ifdef USE_SHEEN
3325	uniform vec3 sheenColor;
3326	uniform float sheenRoughness;
3327	#ifdef USE_SHEEN_COLORMAP
3328		uniform sampler2D sheenColorMap;
3329	#endif
3330	#ifdef USE_SHEEN_ROUGHNESSMAP
3331		uniform sampler2D sheenRoughnessMap;
3332	#endif
3333#endif
3334#ifdef USE_ANISOTROPY
3335	uniform vec2 anisotropyVector;
3336	#ifdef USE_ANISOTROPYMAP
3337		uniform sampler2D anisotropyMap;
3338	#endif
3339#endif
3340varying vec3 vViewPosition;
3341#include <common>
3342#include <packing>
3343#include <dithering_pars_fragment>
3344#include <color_pars_fragment>
3345#include <uv_pars_fragment>
3346#include <map_pars_fragment>
3347#include <alphamap_pars_fragment>
3348#include <alphatest_pars_fragment>
3349#include <alphahash_pars_fragment>
3350#include <aomap_pars_fragment>
3351#include <lightmap_pars_fragment>
3352#include <emissivemap_pars_fragment>
3353#include <iridescence_fragment>
3354#include <cube_uv_reflection_fragment>
3355#include <envmap_common_pars_fragment>
3356#include <envmap_physical_pars_fragment>
3357#include <fog_pars_fragment>
3358#include <lights_pars_begin>
3359#include <normal_pars_fragment>
3360#include <lights_physical_pars_fragment>
3361#include <transmission_pars_fragment>
3362#include <shadowmap_pars_fragment>
3363#include <bumpmap_pars_fragment>
3364#include <normalmap_pars_fragment>
3365#include <clearcoat_pars_fragment>
3366#include <iridescence_pars_fragment>
3367#include <roughnessmap_pars_fragment>
3368#include <metalnessmap_pars_fragment>
3369#include <logdepthbuf_pars_fragment>
3370#include <clipping_planes_pars_fragment>
3371void main() {
3372	vec4 diffuseColor = vec4( diffuse, opacity );
3373	#include <clipping_planes_fragment>
3374	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3375	vec3 totalEmissiveRadiance = emissive;
3376	#include <logdepthbuf_fragment>
3377	#include <map_fragment>
3378	#include <color_fragment>
3379	#include <alphamap_fragment>
3380	#include <alphatest_fragment>
3381	#include <alphahash_fragment>
3382	#include <roughnessmap_fragment>
3383	#include <metalnessmap_fragment>
3384	#include <normal_fragment_begin>
3385	#include <normal_fragment_maps>
3386	#include <clearcoat_normal_fragment_begin>
3387	#include <clearcoat_normal_fragment_maps>
3388	#include <emissivemap_fragment>
3389	#include <lights_physical_fragment>
3390	#include <lights_fragment_begin>
3391	#include <lights_fragment_maps>
3392	#include <lights_fragment_end>
3393	#include <aomap_fragment>
3394	vec3 totalDiffuse = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse;
3395	vec3 totalSpecular = reflectedLight.directSpecular + reflectedLight.indirectSpecular;
3396	#include <transmission_fragment>
3397	vec3 outgoingLight = totalDiffuse + totalSpecular + totalEmissiveRadiance;
3398	#ifdef USE_SHEEN
3399		float sheenEnergyComp = 1.0 - 0.157 * max3( material.sheenColor );
3400		outgoingLight = outgoingLight * sheenEnergyComp + sheenSpecularDirect + sheenSpecularIndirect;
3401	#endif
3402	#ifdef USE_CLEARCOAT
3403		float dotNVcc = saturate( dot( geometryClearcoatNormal, geometryViewDir ) );
3404		vec3 Fcc = F_Schlick( material.clearcoatF0, material.clearcoatF90, dotNVcc );
3405		outgoingLight = outgoingLight * ( 1.0 - material.clearcoat * Fcc ) + ( clearcoatSpecularDirect + clearcoatSpecularIndirect ) * material.clearcoat;
3406	#endif
3407	#include <opaque_fragment>
3408	#include <tonemapping_fragment>
3409	#include <colorspace_fragment>
3410	#include <fog_fragment>
3411	#include <premultiplied_alpha_fragment>
3412	#include <dithering_fragment>
3413}`,hz=`#define TOON
3414varying vec3 vViewPosition;
3415#include <common>
3416#include <batching_pars_vertex>
3417#include <uv_pars_vertex>
3418#include <displacementmap_pars_vertex>
3419#include <color_pars_vertex>
3420#include <fog_pars_vertex>
3421#include <normal_pars_vertex>
3422#include <morphtarget_pars_vertex>
3423#include <skinning_pars_vertex>
3424#include <shadowmap_pars_vertex>
3425#include <logdepthbuf_pars_vertex>
3426#include <clipping_planes_pars_vertex>
3427void main() {
3428	#include <uv_vertex>
3429	#include <color_vertex>
3430	#include <morphinstance_vertex>
3431	#include <morphcolor_vertex>
3432	#include <batching_vertex>
3433	#include <beginnormal_vertex>
3434	#include <morphnormal_vertex>
3435	#include <skinbase_vertex>
3436	#include <skinnormal_vertex>
3437	#include <defaultnormal_vertex>
3438	#include <normal_vertex>
3439	#include <begin_vertex>
3440	#include <morphtarget_vertex>
3441	#include <skinning_vertex>
3442	#include <displacementmap_vertex>
3443	#include <project_vertex>
3444	#include <logdepthbuf_vertex>
3445	#include <clipping_planes_vertex>
3446	vViewPosition = - mvPosition.xyz;
3447	#include <worldpos_vertex>
3448	#include <shadowmap_vertex>
3449	#include <fog_vertex>
3450}`,pz=`#define TOON
3451uniform vec3 diffuse;
3452uniform vec3 emissive;
3453uniform float opacity;
3454#include <common>
3455#include <packing>
3456#include <dithering_pars_fragment>
3457#include <color_pars_fragment>
3458#include <uv_pars_fragment>
3459#include <map_pars_fragment>
3460#include <alphamap_pars_fragment>
3461#include <alphatest_pars_fragment>
3462#include <alphahash_pars_fragment>
3463#include <aomap_pars_fragment>
3464#include <lightmap_pars_fragment>
3465#include <emissivemap_pars_fragment>
3466#include <gradientmap_pars_fragment>
3467#include <fog_pars_fragment>
3468#include <bsdfs>
3469#include <lights_pars_begin>
3470#include <normal_pars_fragment>
3471#include <lights_toon_pars_fragment>
3472#include <shadowmap_pars_fragment>
3473#include <bumpmap_pars_fragment>
3474#include <normalmap_pars_fragment>
3475#include <logdepthbuf_pars_fragment>
3476#include <clipping_planes_pars_fragment>
3477void main() {
3478	vec4 diffuseColor = vec4( diffuse, opacity );
3479	#include <clipping_planes_fragment>
3480	ReflectedLight reflectedLight = ReflectedLight( vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ), vec3( 0.0 ) );
3481	vec3 totalEmissiveRadiance = emissive;
3482	#include <logdepthbuf_fragment>
3483	#include <map_fragment>
3484	#include <color_fragment>
3485	#include <alphamap_fragment>
3486	#include <alphatest_fragment>
3487	#include <alphahash_fragment>
3488	#include <normal_fragment_begin>
3489	#include <normal_fragment_maps>
3490	#include <emissivemap_fragment>
3491	#include <lights_toon_fragment>
3492	#include <lights_fragment_begin>
3493	#include <lights_fragment_maps>
3494	#include <lights_fragment_end>
3495	#include <aomap_fragment>
3496	vec3 outgoingLight = reflectedLight.directDiffuse + reflectedLight.indirectDiffuse + totalEmissiveRadiance;
3497	#include <opaque_fragment>
3498	#include <tonemapping_fragment>
3499	#include <colorspace_fragment>
3500	#include <fog_fragment>
3501	#include <premultiplied_alpha_fragment>
3502	#include <dithering_fragment>
3503}`,mz=`uniform float size;
3504uniform float scale;
3505#include <common>
3506#include <color_pars_vertex>
3507#include <fog_pars_vertex>
3508#include <morphtarget_pars_vertex>
3509#include <logdepthbuf_pars_vertex>
3510#include <clipping_planes_pars_vertex>
3511#ifdef USE_POINTS_UV
3512	varying vec2 vUv;
3513	uniform mat3 uvTransform;
3514#endif
3515void main() {
3516	#ifdef USE_POINTS_UV
3517		vUv = ( uvTransform * vec3( uv, 1 ) ).xy;
3518	#endif
3519	#include <color_vertex>
3520	#include <morphinstance_vertex>
3521	#include <morphcolor_vertex>
3522	#include <begin_vertex>
3523	#include <morphtarget_vertex>
3524	#include <project_vertex>
3525	gl_PointSize = size;
3526	#ifdef USE_SIZEATTENUATION
3527		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3528		if ( isPerspective ) gl_PointSize *= ( scale / - mvPosition.z );
3529	#endif
3530	#include <logdepthbuf_vertex>
3531	#include <clipping_planes_vertex>
3532	#include <worldpos_vertex>
3533	#include <fog_vertex>
3534}`,gz=`uniform vec3 diffuse;
3535uniform float opacity;
3536#include <common>
3537#include <color_pars_fragment>
3538#include <map_particle_pars_fragment>
3539#include <alphatest_pars_fragment>
3540#include <alphahash_pars_fragment>
3541#include <fog_pars_fragment>
3542#include <logdepthbuf_pars_fragment>
3543#include <clipping_planes_pars_fragment>
3544void main() {
3545	vec4 diffuseColor = vec4( diffuse, opacity );
3546	#include <clipping_planes_fragment>
3547	vec3 outgoingLight = vec3( 0.0 );
3548	#include <logdepthbuf_fragment>
3549	#include <map_particle_fragment>
3550	#include <color_fragment>
3551	#include <alphatest_fragment>
3552	#include <alphahash_fragment>
3553	outgoingLight = diffuseColor.rgb;
3554	#include <opaque_fragment>
3555	#include <tonemapping_fragment>
3556	#include <colorspace_fragment>
3557	#include <fog_fragment>
3558	#include <premultiplied_alpha_fragment>
3559}`,vz=`#include <common>
3560#include <batching_pars_vertex>
3561#include <fog_pars_vertex>
3562#include <morphtarget_pars_vertex>
3563#include <skinning_pars_vertex>
3564#include <logdepthbuf_pars_vertex>
3565#include <shadowmap_pars_vertex>
3566void main() {
3567	#include <batching_vertex>
3568	#include <beginnormal_vertex>
3569	#include <morphinstance_vertex>
3570	#include <morphnormal_vertex>
3571	#include <skinbase_vertex>
3572	#include <skinnormal_vertex>
3573	#include <defaultnormal_vertex>
3574	#include <begin_vertex>
3575	#include <morphtarget_vertex>
3576	#include <skinning_vertex>
3577	#include <project_vertex>
3578	#include <logdepthbuf_vertex>
3579	#include <worldpos_vertex>
3580	#include <shadowmap_vertex>
3581	#include <fog_vertex>
3582}
3582`,yz=`uniform vec3 color;
3583uniform float opacity;
3584#include <common>
3585#include <packing>
3586#include <fog_pars_fragment>
3587#include <bsdfs>
3588#include <lights_pars_begin>
3589#include <logdepthbuf_pars_fragment>
3590#include <shadowmap_pars_fragment>
3591#include <shadowmask_pars_fragment>
3592void main() {
3593	#include <logdepthbuf_fragment>
3594	gl_FragColor = vec4( color, opacity * ( 1.0 - getShadowMask() ) );
3595	#include <tonemapping_fragment>
3596	#include <colorspace_fragment>
3597	#include <fog_fragment>
3598}`,xz=`uniform float rotation;
3599uniform vec2 center;
3600#include <common>
3601#include <uv_pars_vertex>
3602#include <fog_pars_vertex>
3603#include <logdepthbuf_pars_vertex>
3604#include <clipping_planes_pars_vertex>
3605void main() {
3606	#include <uv_vertex>
3607	vec4 mvPosition = modelViewMatrix[ 3 ];
3608	vec2 scale = vec2( length( modelMatrix[ 0 ].xyz ), length( modelMatrix[ 1 ].xyz ) );
3609	#ifndef USE_SIZEATTENUATION
3610		bool isPerspective = isPerspectiveMatrix( projectionMatrix );
3611		if ( isPerspective ) scale *= - mvPosition.z;
3612	#endif
3613	vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale;
3614	vec2 rotatedPosition;
3615	rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
3616	rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
3617	mvPosition.xy += rotatedPosition;
3618	gl_Position = projectionMatrix * mvPosition;
3619	#include <logdepthbuf_vertex>
3620	#include <clipping_planes_vertex>
3621	#include <fog_vertex>
3622}`,_z=`uniform vec3 diffuse;
3623uniform float opacity;
3624#include <common>
3625#include <uv_pars_fragment>
3626#include <map_pars_fragment>
3627#include <alphamap_pars_fragment>
3628#include <alphatest_pars_fragment>
3629#include <alphahash_pars_fragment>
3630#include <fog_pars_fragment>
3631#include <logdepthbuf_pars_fragment>
3632#include <clipping_planes_pars_fragment>
3633void main() {
3634	vec4 diffuseColor = vec4( diffuse, opacity );
3635	#include <clipping_planes_fragment>
3636	vec3 outgoingLight = vec3( 0.0 );
3637	#include <logdepthbuf_fragment>
3638	#include <map_fragment>
3639	#include <alphamap_fragment>
3640	#include <alphatest_fragment>
3641	#include <alphahash_fragment>
3642	outgoingLight = diffuseColor.rgb;
3643	#include <opaque_fragment>
3644	#include <tonemapping_fragment>
3645	#include <colorspace_fragment>
3646	#include <fog_fragment>
3647}`,Nn={alphahash_fragment:GN,alphahash_pars_fragment:jN,alphamap_fragment:VN,alphamap_pars_fragment:WN,alphatest_fragment:XN,alphatest_pars_fragment:qN,aomap_fragment:YN,aomap_pars_fragment:JN,batching_pars_vertex:KN,batching_vertex:ZN,begin_vertex:QN,beginnormal_vertex:$N,bsdfs:eU,iridescence_fragment:tU,bumpmap_pars_fragment:nU,clipping_planes_fragment:iU,clipping_planes_pars_fragment:sU,clipping_planes_pars_vertex:rU,clipping_planes_vertex:aU,color_fragment:oU,color_pars_fragment:lU,color_pars_vertex:cU,color_vertex:uU,c
vendor: 6,877 bytes, line 3647
3647ommon:fU,cube_uv_reflection_fragment:dU,defaultnormal_vertex:hU,displacementmap_pars_vertex:pU,displacementmap_vertex:mU,emissivemap_fragment:gU,emissivemap_pars_fragment:vU,colorspace_fragment:yU,colorspace_pars_fragment:xU,envmap_fragment:_U,envmap_common_pars_fragment:bU,envmap_pars_fragment:SU,envmap_pars_vertex:AU,envmap_physical_pars_fragment:PU,envmap_vertex:MU,fog_vertex:EU,fog_pars_vertex:TU,fog_fragment:wU,fog_pars_fragment:CU,gradientmap_pars_fragment:RU,lightmap_pars_fragment:BU,lights_lambert_fragment:IU,lights_lambert_pars_fragment:DU,lights_pars_begin:LU,lights_toon_fragment:OU,lights_toon_pars_fragment:NU,lights_phong_fragment:UU,lights_phong_pars_fragment:zU,lights_physical_fragment:FU,lights_physical_pars_fragment:kU,lights_fragment_begin:HU,lights_fragment_maps:GU,lights_fragment_end:jU,logdepthbuf_fragment:VU,logdepthbuf_pars_fragment:WU,logdepthbuf_pars_vertex:XU,logdepthbuf_vertex:qU,map_fragment:YU,map_pars_fragment:JU,map_particle_fragment:KU,map_particle_pars_fragment:ZU,metalnessmap_fragment:QU,metalnessmap_pars_fragment:$U,morphinstance_vertex:e4,morphcolor_vertex:t4,morphnormal_vertex:n4,morphtarget_pars_vertex:i4,morphtarget_vertex:s4,normal_fragment_begin:r4,normal_fragment_maps:a4,normal_pars_fragment:o4,normal_pars_vertex:l4,normal_vertex:c4,normalmap_pars_fragment:u4,clearcoat_normal_fragment_begin:f4,clearcoat_normal_fragment_maps:d4,clearcoat_pars_fragment:h4,iridescence_pars_fragment:p4,opaque_fragment:m4,packing:g4,premultiplied_alpha_fragment:v4,project_vertex:y4,dithering_fragment:x4,dithering_pars_fragment:_4,roughnessmap_fragment:b4,roughnessmap_pars_fragment:S4,shadowmap_pars_fragment:A4,shadowmap_pars_vertex:M4,shadowmap_vertex:E4,shadowmask_pars_fragment:T4,skinbase_vertex:w4,skinning_pars_vertex:C4,skinning_vertex:R4,skinnormal_vertex:B4,specularmap_fragment:I4,specularmap_pars_fragment:D4,tonemapping_fragment:L4,tonemapping_pars_fragment:P4,transmission_fragment:O4,transmission_pars_fragment:N4,uv_pars_fragment:U4,uv_pars_vertex:z4,uv_vertex:F4,worldpos_vertex:k4,background_vert:H4,background_frag:G4,backgroundCube_vert:j4,backgroundCube_frag:V4,cube_vert:W4,cube_frag:X4,depth_vert:q4,depth_frag:Y4,distanceRGBA_vert:J4,distanceRGBA_frag:K4,equirect_vert:Z4,equirect_frag:Q4,linedashed_vert:$4,linedashed_frag:ez,meshbasic_vert:tz,meshbasic_frag:nz,meshlambert_vert:iz,meshlambert_frag:sz,meshmatcap_vert:rz,meshmatcap_frag:az,meshnormal_vert:oz,meshnormal_frag:lz,meshphong_vert:cz,meshphong_frag:uz,meshphysical_vert:fz,meshphysical_frag:dz,meshtoon_vert:hz,meshtoon_frag:pz,points_vert:mz,points_frag:gz,shadow_vert:vz,shadow_frag:yz,sprite_vert:xz,sprite_frag:_z},kt={common:{diffuse:{value:new Pt(16777215)},opacity:{value:1},map:{value:null},mapTransform:{value:new Cn},alphaMap:{value:null},alphaMapTransform:{value:new Cn},alphaTest:{value:0}},specularmap:{specularMap:{value:null},specularMapTransform:{value:new Cn}},envmap:{envMap:{value:null},envMapRotation:{value:new Cn},flipEnvMap:{value:-1},reflectivity:{value:1},ior:{value:1.5},refractionRatio:{value:.98}},aomap:{aoMap:{value:null},aoMapIntensity:{value:1},aoMapTransform:{value:new Cn}},lightmap:{lightMap:{value:null},lightMapIntensity:{value:1},lightMapTransform:{value:new Cn}},bumpmap:{bumpMap:{value:null},bumpMapTransform:{value:new Cn},bumpScale:{value:1}},normalmap:{normalMap:{value:null},normalMapTransform:{value:new Cn},normalScale:{value:new st(1,1)}},displacementmap:{displacementMap:{value:null},displacementMapTransform:{value:new Cn},displacementScale:{value:1},displacementBias:{value:0}},emissivemap:{emissiveMap:{value:null},emissiveMapTransform:{value:new Cn}},metalnessmap:{metalnessMap:{value:null},metalnessMapTransform:{value:new Cn}},roughnessmap:{roughnessMap:{value:null},roughnessMapTransform:{value:new Cn}},gradientmap:{gradientMap:{value:null}},fog:{fogDensity:{value:25e-5},fogNear:{value:1},fogFar:{value:2e3},fogColor:{value:new Pt(16777215)}},lights:{ambientLightColor:{value:[]},lightProbe:{value:[]},directionalLights:{value:[],properties:{direction:{},color:{}}},directionalLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},directionalShadowMap:{value:[]},directionalShadowMatrix:{value:[]},spotLights:{value:[],properties:{color:{},position:{},direction:{},distance:{},coneCos:{},penumbraCos:{},decay:{}}},spotLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{}}},spotLightMap:{value:[]},spotShadowMap:{value:[]},spotLightMatrix:{value:[]},pointLights:{value:[],properties:{color:{},position:{},decay:{},distance:{}}},pointLightShadows:{value:[],properties:{shadowIntensity:1,shadowBias:{},shadowNormalBias:{},shadowRadius:{},shadowMapSize:{},shadowCameraNear:{},shadowCameraFar:{}}},pointShadowMap:{value:[]},pointShadowMatrix:{value:[]},hemisphereLights:{value:[],properties:{direction:{},skyColor:{},groundColor:{}}},rectAreaLights:{value:[],properties:{color:{},position:{},width:{},height:{}}},ltc_1:{value:null},ltc_2:{value:null}},points:{diffuse:{value:new Pt(16777215)},opacity:{value:1},size:{value:1},scale:{value:1},map:{value:null},alphaMap:{value:null},alphaMapTransform:{value:new Cn},alphaTest:{value:0},uvTransform:{value:new Cn}},sprite:{diffuse:{value:new Pt(16777215)},opacity:{value:1},center:{value:new st(.5,.5)},rotation:{value:0},map:{value:null},mapTransform:{value:new Cn},alphaMap:{value:null},alphaMapTransform:{value:new Cn},alphaTest:{value:0}}},il={basic:{uniforms:ga([kt.common,kt.specularmap,kt.envmap,kt.aomap,kt.lightmap,kt.fog]),vertexShader:Nn.meshbasic_vert,fragmentShader:Nn.meshbasic_frag},lambert:{uniforms:ga([kt.common,kt.specularmap,kt.envmap,kt.aomap,kt.lightmap,kt.emissivemap,kt.bumpmap,kt.normalmap,kt.displacementmap,kt.fog,kt.lights,{emissive:{value:new Pt(0)}}]),vertexShader:Nn.meshlambert_vert,fragmentShader:Nn.meshlambert_frag},phong:{uniforms:ga([kt.common,kt.specularmap,kt.envmap,kt.aomap,kt.lightmap,kt.emissivemap,kt.bumpmap,kt.normalmap,kt.displacementmap,kt.fog,kt.lights,{emissive:{value:new Pt(0)},specular:{value:new Pt(1118481)},shininess:{value:30}}]),vertexShader:Nn.meshphong_vert,fragmentShader:Nn.meshphong_frag},standard:{uniforms:ga([kt.common,kt.envmap,kt.aomap,kt.lightmap,kt.emissivemap,kt.bumpmap,kt.normalmap,kt.displacementmap,kt.roughnessmap,kt.metalnessmap,kt.fog,kt.lights,{emissive:{value:new Pt(0)},roughness:{value:1},metalness:{value:0},envMapIntensity:{value:1}}]),vertexShader:Nn.meshphysical_vert,fragmentShader:Nn.meshphysical_frag},toon:{uniforms:ga([kt.common,kt.aomap,kt.lightmap,kt.emissivemap,kt.bumpmap,kt.normalmap,kt.displacementmap,kt.gradientmap,kt.fog,kt.lights,{emissive:{value:new Pt(0)}}]),vertexShader:Nn.meshtoon_vert,fragmentShader:Nn.meshtoon_frag},matcap:{uniforms:ga([kt.common,kt.bumpmap,kt.normalmap,kt.displacementmap,kt.fog,{matc
vendor: 5,267 bytes, line 3647
3647ap:{value:null}}]),vertexShader:Nn.meshmatcap_vert,fragmentShader:Nn.meshmatcap_frag},points:{uniforms:ga([kt.points,kt.fog]),vertexShader:Nn.points_vert,fragmentShader:Nn.points_frag},dashed:{uniforms:ga([kt.common,kt.fog,{scale:{value:1},dashSize:{value:1},totalSize:{value:2}}]),vertexShader:Nn.linedashed_vert,fragmentShader:Nn.linedashed_frag},depth:{uniforms:ga([kt.common,kt.displacementmap]),vertexShader:Nn.depth_vert,fragmentShader:Nn.depth_frag},normal:{uniforms:ga([kt.common,kt.bumpmap,kt.normalmap,kt.displacementmap,{opacity:{value:1}}]),vertexShader:Nn.meshnormal_vert,fragmentShader:Nn.meshnormal_frag},sprite:{uniforms:ga([kt.sprite,kt.fog]),vertexShader:Nn.sprite_vert,fragmentShader:Nn.sprite_frag},background:{uniforms:{uvTransform:{value:new Cn},t2D:{value:null},backgroundIntensity:{value:1}},vertexShader:Nn.background_vert,fragmentShader:Nn.background_frag},backgroundCube:{uniforms:{envMap:{value:null},flipEnvMap:{value:-1},backgroundBlurriness:{value:0},backgroundIntensity:{value:1},backgroundRotation:{value:new Cn}},vertexShader:Nn.backgroundCube_vert,fragmentShader:Nn.backgroundCube_frag},cube:{uniforms:{tCube:{value:null},tFlip:{value:-1},opacity:{value:1}},vertexShader:Nn.cube_vert,fragmentShader:Nn.cube_frag},equirect:{uniforms:{tEquirect:{value:null}},vertexShader:Nn.equirect_vert,fragmentShader:Nn.equirect_frag},distanceRGBA:{uniforms:ga([kt.common,kt.displacementmap,{referencePosition:{value:new se},nearDistance:{value:1},farDistance:{value:1e3}}]),vertexShader:Nn.distanceRGBA_vert,fragmentShader:Nn.distanceRGBA_frag},shadow:{uniforms:ga([kt.lights,kt.fog,{color:{value:new Pt(0)},opacity:{value:1}}]),vertexShader:Nn.shadow_vert,fragmentShader:Nn.shadow_frag}};il.physical={uniforms:ga([il.standard.uniforms,{clearcoat:{value:0},clearcoatMap:{value:null},clearcoatMapTransform:{value:new Cn},clearcoatNormalMap:{value:null},clearcoatNormalMapTransform:{value:new Cn},clearcoatNormalScale:{value:new st(1,1)},clearcoatRoughness:{value:0},clearcoatRoughnessMap:{value:null},clearcoatRoughnessMapTransform:{value:new Cn},dispersion:{value:0},iridescence:{value:0},iridescenceMap:{value:null},iridescenceMapTransform:{value:new Cn},iridescenceIOR:{value:1.3},iridescenceThicknessMinimum:{value:100},iridescenceThicknessMaximum:{value:400},iridescenceThicknessMap:{value:null},iridescenceThicknessMapTransform:{value:new Cn},sheen:{value:0},sheenColor:{value:new Pt(0)},sheenColorMap:{value:null},sheenColorMapTransform:{value:new Cn},sheenRoughness:{value:1},sheenRoughnessMap:{value:null},sheenRoughnessMapTransform:{value:new Cn},transmission:{value:0},transmissionMap:{value:null},transmissionMapTransform:{value:new Cn},transmissionSamplerSize:{value:new st},transmissionSamplerMap:{value:null},thickness:{value:0},thicknessMap:{value:null},thicknessMapTransform:{value:new Cn},attenuationDistance:{value:0},attenuationColor:{value:new Pt(0)},specularColor:{value:new Pt(1,1,1)},specularColorMap:{value:null},specularColorMapTransform:{value:new Cn},specularIntensity:{value:1},specularIntensityMap:{value:null},specularIntensityMapTransform:{value:new Cn},anisotropyVector:{value:new st},anisotropyMap:{value:null},anisotropyMapTransform:{value:new Cn}}]),vertexShader:Nn.meshphysical_vert,fragmentShader:Nn.meshphysical_frag};const nx={r:0,b:0,g:0},nd=new Qa,bz=new dn;function Sz(i,e,t,n,s,a,l){const u=new Pt(0);let h=a===!0?0:1,p,m,v=null,x=0,_=null;function A(L){let P=L.isScene===!0?L.background:null;return P&&P.isTexture&&(P=(L.backgroundBlurriness>0?t:e).get(P)),P}function R(L){let P=!1;const G=A(L);G===null?E(u,h):G&&G.isColor&&(E(G,1),P=!0);const H=i.xr.getEnvironmentBlendMode();H==="additive"?n.buffers.color.setClear(0,0,0,1,l):H==="alpha-blend"&&n.buffers.color.setClear(0,0,0,0,l),(i.autoClear||P)&&(n.buffers.depth.setTest(!0),n.buffers.depth.setMask(!0),n.buffers.color.setMask(!0),i.clear(i.autoClearColor,i.autoClearDepth,i.autoClearStencil))}function w(L,P){const G=A(P);G&&(G.isCubeTexture||G.mapping===Dp)?(m===void 0&&(m=new hs(new Od(1,1,1),new Zi({name:"BackgroundCubeMaterial",uniforms:Cp(il.backgroundCube.uniforms),vertexShader:il.backgroundCube.vertexShader,fragmentShader:il.backgroundCube.fragmentShader,side:$s,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),m.geometry.deleteAttribute("normal"),m.geometry.deleteAttribute("uv"),m.onBeforeRender=function(H,F,X){this.matrixWorld.copyPosition(X.matrixWorld)},Object.defineProperty(m.material,"envMap",{get:function(){return this.uniforms.envMap.value}}),s.update(m)),nd.copy(P.backgroundRotation),nd.x*=-1,nd.y*=-1,nd.z*=-1,G.isCubeTexture&&G.isRenderTargetTexture===!1&&(nd.y*=-1,nd.z*=-1),m.material.uniforms.envMap.value=G,m.material.uniforms.flipEnvMap.value=G.isCubeTexture&&G.isRenderTargetTexture===!1?-1:1,m.material.uniforms.backgroundBlurriness.value=P.backgroundBlurriness,m.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,m.material.uniforms.backgroundRotation.value.setFromMatrix4(bz.makeRotationFromEuler(nd)),m.material.toneMapped=si.getTransfer(G.colorSpace)!==Ri,(v!==G||x!==G.version||_!==i.toneMapping)&&(m.material.needsUpdate=!0,v=G,x=G.version,_=i.toneMapping),m.layers.enableAll(),L.unshift(m,m.geometry,m.material,0,0,null)):G&&G.isTexture&&(p===void 0&&(p=new hs(new Nd(2,2),new Zi({n
vendor: 5,670 bytes, line 3647
3647ame:"BackgroundMaterial",uniforms:Cp(il.background.uniforms),vertexShader:il.background.vertexShader,fragmentShader:il.background.fragmentShader,side:cl,depthTest:!1,depthWrite:!1,fog:!1,allowOverride:!1})),p.geometry.deleteAttribute("normal"),Object.defineProperty(p.material,"map",{get:function(){return this.uniforms.t2D.value}}),s.update(p)),p.material.uniforms.t2D.value=G,p.material.uniforms.backgroundIntensity.value=P.backgroundIntensity,p.material.toneMapped=si.getTransfer(G.colorSpace)!==Ri,G.matrixAutoUpdate===!0&&G.updateMatrix(),p.material.uniforms.uvTransform.value.copy(G.matrix),(v!==G||x!==G.version||_!==i.toneMapping)&&(p.material.needsUpdate=!0,v=G,x=G.version,_=i.toneMapping),p.layers.enableAll(),L.unshift(p,p.geometry,p.material,0,0,null))}function E(L,P){L.getRGB(nx,rI(i)),n.buffers.color.setClear(nx.r,nx.g,nx.b,P,l)}function D(){m!==void 0&&(m.geometry.dispose(),m.material.dispose(),m=void 0),p!==void 0&&(p.geometry.dispose(),p.material.dispose(),p=void 0)}return{getClearColor:function(){return u},setClearColor:function(L,P=1){u.set(L),h=P,E(u,h)},getClearAlpha:function(){return h},setClearAlpha:function(L){h=L,E(u,h)},render:R,addToRenderList:w,dispose:D}}function Az(i,e){const t=i.getParameter(i.MAX_VERTEX_ATTRIBS),n={},s=x(null);let a=s,l=!1;function u(k,ie,ve,J,le){let ae=!1;const W=v(J,ve,ie);a!==W&&(a=W,p(a.object)),ae=_(k,J,ve,le),ae&&A(k,J,ve,le),le!==null&&e.update(le,i.ELEMENT_ARRAY_BUFFER),(ae||l)&&(l=!1,P(k,ie,ve,J),le!==null&&i.bindBuffer(i.ELEMENT_ARRAY_BUFFER,e.get(le).buffer))}function h(){return i.createVertexArray()}function p(k){return i.bindVertexArray(k)}function m(k){return i.deleteVertexArray(k)}function v(k,ie,ve){const J=ve.wireframe===!0;let le=n[k.id];le===void 0&&(le={},n[k.id]=le);let ae=le[ie.id];ae===void 0&&(ae={},le[ie.id]=ae);let W=ae[J];return W===void 0&&(W=x(h()),ae[J]=W),W}function x(k){const ie=[],ve=[],J=[];for(let le=0;le<t;le++)ie[le]=0,ve[le]=0,J[le]=0;return{geometry:null,program:null,wireframe:!1,newAttributes:ie,enabledAttributes:ve,attributeDivisors:J,object:k,attributes:{},index:null}}function _(k,ie,ve,J){const le=a.attributes,ae=ie.attributes;let W=0;const ee=ve.getAttributes();for(const te in ee)if(ee[te].location>=0){const he=le[te];let K=ae[te];if(K===void 0&&(te==="instanceMatrix"&&k.instanceMatrix&&(K=k.instanceMatrix),te==="instanceColor"&&k.instanceColor&&(K=k.instanceColor)),he===void 0||he.attribute!==K||K&&he.data!==K.data)return!0;W++}return a.attributesNum!==W||a.index!==J}function A(k,ie,ve,J){const le={},ae=ie.attributes;let W=0;const ee=ve.getAttributes();for(const te in ee)if(ee[te].location>=0){let he=ae[te];he===void 0&&(te==="instanceMatrix"&&k.instanceMatrix&&(he=k.instanceMatrix),te==="instanceColor"&&k.instanceColor&&(he=k.instanceColor));const K={};K.attribute=he,he&&he.data&&(K.data=he.data),le[te]=K,W++}a.attributes=le,a.attributesNum=W,a.index=J}function R(){const k=a.newAttributes;for(let ie=0,ve=k.length;ie<ve;ie++)k[ie]=0}function w(k){E(k,0)}function E(k,ie){const ve=a.newAttributes,J=a.enabledAttributes,le=a.attributeDivisors;ve[k]=1,J[k]===0&&(i.enableVertexAttribArray(k),J[k]=1),le[k]!==ie&&(i.vertexAttribDivisor(k,ie),le[k]=ie)}function D(){const k=a.newAttributes,ie=a.enabledAttributes;for(let ve=0,J=ie.length;ve<J;ve++)ie[ve]!==k[ve]&&(i.disableVertexAttribArray(ve),ie[ve]=0)}function L(k,ie,ve,J,le,ae,W){W===!0?i.vertexAttribIPointer(k,ie,ve,le,ae):i.vertexAttribPointer(k,ie,ve,J,le,ae)}function P(k,ie,ve,J){R();const le=J.attributes,ae=ve.getAttributes(),W=ie.defaultAttributeValues;for(const ee in ae){const te=ae[ee];if(te.location>=0){let ue=le[ee];if(ue===void 0&&(ee==="instanceMatrix"&&k.instanceMatrix&&(ue=k.instanceMatrix),ee==="instanceColor"&&k.instanceColor&&(ue=k.instanceColor)),ue!==void 0){const he=ue.normalized,K=ue.itemSize,ce=e.get(ue);if(ce===void 0)continue;const re=ce.buffer,oe=ce.type,we=ce.bytesPerElement,Be=oe===i.INT||oe===i.UNSIGNED_INT||ue.gpuType===D_;if(ue.isInterleavedBufferAttribute){const pe=ue.data,Re=pe.stride,lt=ue.offset;if(pe.isInstancedInterleavedBuffer){for(let ct=0;ct<te.locationSize;ct++)E(te.location+ct,pe.meshPerAttribute);k.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=pe.meshPerAttribute*pe.count)}else for(let ct=0;ct<te.locationSize;ct++)w(te.location+ct);i.bindBuffer(i.ARRAY_BUFFER,re);for(let ct=0;ct<te.locationSize;ct++)L(te.location+ct,K/te.locationSize,oe,he,Re*we,(lt+K/te.locationSize*ct)*we,Be)}else{if(ue.isInstancedBufferAttribute){for(let pe=0;pe<te.locationSize;pe++)E(te.location+pe,ue.meshPerAttribute);k.isInstancedMesh!==!0&&J._maxInstanceCount===void 0&&(J._maxInstanceCount=ue.meshPerAttribute*ue.count)}else for(let pe=0;pe<te.locationSize;pe++)w(te.location+pe);i.bindBuffer(i.ARRAY_BUFFER,re);for(let pe=0;pe<te.locationSize;pe++)L(te.location+pe,K/te.locationSize,oe,he,K*we,K/te.locationSize*pe*we,Be)}}else if(W!==void 0){const he=W[ee];if(he!==void 0)switch(he.length){case 2:i.vertexAttrib2fv(te.location,he);break;case 3:i.vertexAttrib3fv(te.location,he);break;case 4:i.vertexAttrib4fv(te.location,he);break;default:i.vertexAttrib1fv(te.location,he)}}}}D()}function G(){X();for(const k in n){const ie=n[k];for(const ve in ie){const J=ie[ve];for(const le in J)m(J[le].object),delete J[le];delete ie[ve]}delete n[k]}}function H(k){if(n[k.id]===void 0)return;const ie=n[k.id];for(const ve in ie){const J=ie[ve];for(const le in J)m(J[le].object),delete J[le];delete ie[ve]}delete n[k.id]}function F(k){for(const ie in n){const ve=n[ie];if(ve[k.id]===void 0)continue;const J=ve[k.id];for(const le in J)m(J[le].object),delete J[le];delete ve[k.id]}}function X(){z(),l=!0,a!==s&&(a=s,p(a.object))}
vendor: 12,855 bytes, lines 3647-3707
3647function z(){s.geometry=null,s.program=null,s.wireframe=!1}return{setup:u,reset:X,resetDefaultState:z,dispose:G,releaseStatesOfGeometry:H,releaseStatesOfProgram:F,initAttributes:R,enableAttribute:w,disableUnusedAttributes:D}}function Mz(i,e,t){let n;function s(p){n=p}function a(p,m){i.drawArrays(n,p,m),t.update(m,n,1)}function l(p,m,v){v!==0&&(i.drawArraysInstanced(n,p,m,v),t.update(m,n,v))}function u(p,m,v){if(v===0)return;e.get("WEBGL_multi_draw").multiDrawArraysWEBGL(n,p,0,m,0,v);let _=0;for(let A=0;A<v;A++)_+=m[A];t.update(_,n,1)}function h(p,m,v,x){if(v===0)return;const _=e.get("WEBGL_multi_draw");if(_===null)for(let A=0;A<p.length;A++)l(p[A],m[A],x[A]);else{_.multiDrawArraysInstancedWEBGL(n,p,0,m,0,x,0,v);let A=0;for(let R=0;R<v;R++)A+=m[R]*x[R];t.update(A,n,1)}}this.setMode=s,this.render=a,this.renderInstances=l,this.renderMultiDraw=u,this.renderMultiDrawInstances=h}function Ez(i,e,t,n){let s;function a(){if(s!==void 0)return s;if(e.has("EXT_texture_filter_anisotropic")===!0){const F=e.get("EXT_texture_filter_anisotropic");s=i.getParameter(F.MAX_TEXTURE_MAX_ANISOTROPY_EXT)}else s=0;return s}function l(F){return!(F!==Jr&&n.convert(F)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_FORMAT))}function u(F){const X=F===Pd&&(e.has("EXT_color_buffer_half_float")||e.has("EXT_color_buffer_float"));return!(F!==vr&&n.convert(F)!==i.getParameter(i.IMPLEMENTATION_COLOR_READ_TYPE)&&F!==Yr&&!X)}function h(F){if(F==="highp"){if(i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.HIGH_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.HIGH_FLOAT).precision>0)return"highp";F="mediump"}return F==="mediump"&&i.getShaderPrecisionFormat(i.VERTEX_SHADER,i.MEDIUM_FLOAT).precision>0&&i.getShaderPrecisionFormat(i.FRAGMENT_SHADER,i.MEDIUM_FLOAT).precision>0?"mediump":"lowp"}let p=t.precision!==void 0?t.precision:"highp";const m=h(p);m!==p&&(console.warn("THREE.WebGLRenderer:",p,"not supported, using",m,"instead."),p=m);const v=t.logarithmicDepthBuffer===!0,x=t.reverseDepthBuffer===!0&&e.has("EXT_clip_control"),_=i.getParameter(i.MAX_TEXTURE_IMAGE_UNITS),A=i.getParameter(i.MAX_VERTEX_TEXTURE_IMAGE_UNITS),R=i.getParameter(i.MAX_TEXTURE_SIZE),w=i.getParameter(i.MAX_CUBE_MAP_TEXTURE_SIZE),E=i.getParameter(i.MAX_VERTEX_ATTRIBS),D=i.getParameter(i.MAX_VERTEX_UNIFORM_VECTORS),L=i.getParameter(i.MAX_VARYING_VECTORS),P=i.getParameter(i.MAX_FRAGMENT_UNIFORM_VECTORS),G=A>0,H=i.getParameter(i.MAX_SAMPLES);return{isWebGL2:!0,getMaxAnisotropy:a,getMaxPrecision:h,textureFormatReadable:l,textureTypeReadable:u,precision:p,logarithmicDepthBuffer:v,reverseDepthBuffer:x,maxTextures:_,maxVertexTextures:A,maxTextureSize:R,maxCubemapSize:w,maxAttributes:E,maxVertexUniforms:D,maxVaryings:L,maxFragmentUniforms:P,vertexTextures:G,maxSamples:H}}function Tz(i){const e=this;let t=null,n=0,s=!1,a=!1;const l=new Hu,u=new Cn,h={value:null,needsUpdate:!1};this.uniform=h,this.numPlanes=0,this.numIntersection=0,this.init=function(v,x){const _=v.length!==0||x||n!==0||s;return s=x,n=v.length,_},this.beginShadows=function(){a=!0,m(null)},this.endShadows=function(){a=!1},this.setGlobalState=function(v,x){t=m(v,x,0)},this.setState=function(v,x,_){const A=v.clippingPlanes,R=v.clipIntersection,w=v.clipShadows,E=i.get(v);if(!s||A===null||A.length===0||a&&!w)a?m(null):p();else{const D=a?0:n,L=D*4;let P=E.clippingState||null;h.value=P,P=m(A,x,L,_);for(let G=0;G!==L;++G)P[G]=t[G];E.clippingState=P,this.numIntersection=R?this.numPlanes:0,this.numPlanes+=D}};function p(){h.value!==t&&(h.value=t,h.needsUpdate=n>0),e.numPlanes=n,e.numIntersection=0}function m(v,x,_,A){const R=v!==null?v.length:0;let w=null;if(R!==0){if(w=h.value,A!==!0||w===null){const E=_+R*4,D=x.matrixWorldInverse;u.getNormalMatrix(D),(w===null||w.length<E)&&(w=new Float32Array(E));for(let L=0,P=_;L!==R;++L,P+=4)l.copy(v[L]).applyMatrix4(D,u),l.normal.toArray(w,P),w[P+3]=l.constant}h.value=w,h.needsUpdate=!0}return e.numPlanes=R,e.numIntersection=0,w}}function wz(i){let e=new WeakMap;function t(l,u){return u===j0?l.mapping=Fc:u===V0&&(l.mapping=Ku),l}function n(l){if(l&&l.isTexture){const u=l.mapping;if(u===j0||u===V0)if(e.has(l)){const h=e.get(l).texture;return t(h,l.mapping)}else{const h=l.image;if(h&&h.height>0){const p=new lI(h.height);return p.fromEquirectangularTexture(i,l),e.set(l,p),l.addEventListener("dispose",s),t(p.texture,l.mapping)}else return null}}return l}function s(l){const u=l.target;u.removeEventListener("dispose",s);const h=e.get(u);h!==void 0&&(e.delete(u),h.dispose())}function a(){e=new WeakMap}return{get:n,dispose:a}}const dp=4,hw=[.125,.215,.35,.446,.526,.582],od=20,t1=new Vc,pw=new Pt;let n1=null,i1=0,s1=0,r1=!1;const ad=(1+Math.sqrt(5))/2,ap=1/ad,mw=[new se(-ad,ap,0),new se(ad,ap,0),new se(-ap,0,ad),new se(ap,0,ad),new se(0,ad,-ap),new se(0,ad,ap),new se(-1,1,-1),new se(1,1,-1),new se(-1,1,1),new se(1,1,1)],Cz=new se;class eA{constructor(e){this._renderer=e,this._pingPongRenderTarget=null,this._lodMax=0,this._cubeSize=0,this._lodPlanes=[],this._sizeLods=[],this._sigmas=[],this._blurMaterial=null,this._cubemapMaterial=null,this._equirectMaterial=null,this._compileMaterial(this._blurMaterial)}fromScene(e,t=0,n=.1,s=100,a={}){const{size:l=256,position:u=Cz}=a;n1=this._renderer.getRenderTarget(),i1=this._renderer.getActiveCubeFace(),s1=this._renderer.getActiveMipmapLevel(),r1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1,this._setSize(l);const h=this._allocateTargets();return h.depthBuffer=!0,this._sceneToCubeUV(e,n,s,h,u),t>0&&this._blur(h,0,0,t),this._applyPMREM(h),this._cleanup(h),h}fromEquirectangular(e,t=null){return this._fromTexture(e,t)}fromCubemap(e,t=null){return this._fromTexture(e,t)}compileCubemapShader(){this._cubemapMaterial===null&&(this._cubemapMaterial=yw(),this._compileMaterial(this._cubemapMaterial))}compileEquirectangularShader(){this._equirectMaterial===null&&(this._equirectMaterial=vw(),this._compileMaterial(this._equirectMaterial))}dispose(){this._dispose(),this._cubemapMaterial!==null&&this._cubemapMaterial.dispose(),this._equirectMaterial!==null&&this._equirectMaterial.dispose()}_setSize(e){this._lodMax=Math.floor(Math.log2(e)),this._cubeSize=Math.pow(2,this._lodMax)}_dispose(){this._blurMaterial!==null&&this._blurMaterial.dispose(),this._pingPongRenderTarget!==null&&this._pingPongRenderTarget.dispose();for(let e=0;e<this._lodPlanes.length;e++)this._lodPlanes[e].dispose()}_cleanup(e){this._renderer.setRenderTarget(n1,i1,s1),this._renderer.xr.enabled=r1,e.scissorTest=!1,ix(e,0,0,e.width,e.height)}_fromTexture(e,t){e.mapping===Fc||e.mapping===Ku?this._setSize(e.image.length===0?16:e.image[0].width||e.image[0].image.width):this._setSize(e.image.width/4),n1=this._renderer.getRenderTarget(),i1=this._renderer.getActiveCubeFace(),s1=this._renderer.getActiveMipmapLevel(),r1=this._renderer.xr.enabled,this._renderer.xr.enabled=!1;const n=t||this._allocateTargets();return this._textureToCubeUV(e,n),this._applyPMREM(n),this._cleanup(n),n}_allocateTargets(){const e=3*Math.max(this._cubeSize,112),t=4*this._cubeSize,n={magFilter:as,minFilter:as,generateMipmaps:!1,type:Pd,format:Jr,colorSpace:Wl,depthBuffer:!1},s=gw(e,t,n);if(this._pingPongRenderTarget===null||this._pingPongRenderTarget.width!==e||this._pingPongRenderTarget.height!==t){this._pingPongRenderTarget!==null&&this._dispose(),this._pingPongRenderTarget=gw(e,t,n);const{_lodMax:a}=this;({sizeLods:this._sizeLods,lodPlanes:this._lodPlanes,sigmas:this._sigmas}=Rz(a)),this._blurMaterial=Bz(a,e,t)}return s}_compileMaterial(e){const t=new hs(this._lodPlanes[0],e);this._renderer.compile(t,t1)}_sceneToCubeUV(e,t,n,s,a){const h=new Ds(90,1,t,n),p=[1,-1,1,1,1,1],m=[1,1,1,-1,-1,-1],v=this._renderer,x=v.autoClear,_=v.toneMapping;v.getClearColor(pw),v.toneMapping=ol,v.autoClear=!1;const A=new Kr({name:"PMREM.Background",side:$s,depthWrite:!1,depthTest:!1}),R=new hs(new Od,A);let w=!1;const E=e.background;E?E.isColor&&(A.color.copy(E),e.background=null,w=!0):(A.color.copy(pw),w=!0);for(let D=0;D<6;D++){const L=D%3;L===0?(h.up.set(0,p[D],0),h.position.set(a.x,a.y,a.z),h.lookAt(a.x+m[D],a.y,a.z)):L===1?(h.up.set(0,0,p[D]),h.position.set(a.x,a.y,a.z),h.lookAt(a.x,a.y+m[D],a.z)):(h.up.set(0,p[D],0),h.position.set(a.x,a.y,a.z),h.lookAt(a.x,a.y,a.z+m[D]));const P=this._cubeSize;ix(s,L*P,D>2?P:0,P,P),v.setRenderTarget(s),w&&v.render(R,h),v.render(e,h)}R.geometry.dispose(),R.material.dispose(),v.toneMapping=_,v.autoClear=x,e.background=E}_textureToCubeUV(e,t){const n=this._renderer,s=e.mapping===Fc||e.mapping===Ku;s?(this._cubemapMaterial===null&&(this._cubemapMaterial=yw()),this._cubemapMaterial.uniforms.flipEnvMap.value=e.isRenderTargetTexture===!1?-1:1):this._equirectMaterial===null&&(this._equirectMaterial=vw());const a=s?this._cubemapMaterial:this._equirectMaterial,l=new hs(this._lodPlanes[0],a),u=a.uniforms;u.envMap.value=e;const h=this._cubeSize;ix(t,0,0,3*h,2*h),n.setRenderTarget(t),n.render(l,t1)}_applyPMREM(e){const t=this._renderer,n=t.autoClear;t.autoClear=!1;const s=this._lodPlanes.length;for(let a=1;a<s;a++){const l=Math.sqrt(this._sigmas[a]*this._sigmas[a]-this._sigmas[a-1]*this._sigmas[a-1]),u=mw[(s-a-1)%mw.length];this._blur(e,a-1,a,l,u)}t.autoClear=n}_blur(e,t,n,s,a){const l=this._pingPongRenderTarget;this._halfBlur(e,l,t,n,s,"latitudinal",a),this._halfBlur(l,e,n,n,s,"longitudinal",a)}_halfBlur(e,t,n,s,a,l,u){const h=this._renderer,p=this._blurMaterial;l!=="latitudinal"&&l!=="longitudinal"&&console.error("blur direction must be either latitudinal or longitudinal!");const m=3,v=new hs(this._lodPlanes[s],p),x=p.uniforms,_=this._sizeLods[n]-1,A=isFinite(a)?Math.PI/(2*_):2*Math.PI/(2*od-1),R=a/A,w=isFinite(a)?1+Math.floor(m*R):od;w>od&&console.warn(`sigmaRadians, ${a}, is too large and will clip, as it requested ${w} samples when the maximum is set to ${od}`);const E=[];let D=0;for(let F=0;F<od;++F){const X=F/R,z=Math.exp(-X*X/2);E.push(z),F===0?D+=z:F<w&&(D+=2*z)}for(let F=0;F<E.length;F++)E[F]=E[F]/D;x.envMap.value=e.texture,x.samples.value=w,x.weights.value=E,x.latitudinal.value=l==="latitudinal",u&&(x.poleAxis.value=u);const{_lodMax:L}=this;x.dTheta.value=A,x.mipInt.value=L-n;const P=this._sizeLods[s],G=3*P*(s>L-dp?s-L+dp:0),H=4*(this._cubeSize-P);ix(t,G,H,3*P,2*P),h.setRenderTarget(t),h.render(v,t1)}}function Rz(i){const e=[],t=[],n=[];let s=i;const a=i-dp+1+hw.length;for(let l=0;l<a;l++){const u=Math.pow(2,s);t.push(u);let h=1/u;l>i-dp?h=hw[l-i+dp-1]:l===0&&(h=0),n.push(h);const p=1/(u-2),m=-p,v=1+p,x=[m,m,v,m,v,v,m,m,v,v,m,v],_=6,A=6,R=3,w=2,E=1,D=new Float32Array(R*A*_),L=new Float32Array(w*A*_),P=new Float32Array(E*A*_);for(let H=0;H<_;H++){const F=H%3*2/3-1,X=H>2?0:-1,z=[F,X,0,F+2/3,X,0,F+2/3,X+1,0,F,X,0,F+2/3,X+1,0,F,X+1,0];D.set(z,R*A*H),L.set(x,w*A*H);const k=[H,H,H,H,H,H];P.set(k,E*A*H)}const G=new Mn;G.setAttribute("position",new ci(D,R)),G.setAttribute("uv",new ci(L,w)),G.setAttribute("faceIndex",new ci(P,E)),e.push(G),s>dp&&s--}return{lodPlanes:e,sizeLods:t,sigmas:n}}function gw(i,e,t){const n=new Ms(i,e,t);return n.texture.mapping=Dp,n.texture.name="PMREM.cubeUv",n.scissorTest=!0,n}function ix(i,e,t,n,s){i.viewport.set(e,t,n,s),i.scissor.set(e,t,n,s)}function Bz(i,e,t){const n=new Float32Array(od),s=new se(0,1,0);return new Zi({name:"SphericalGaussianBlur",defines:{n:od,CUBEUV_TEXEL_WIDTH:1/e,CUBEUV_TEXEL_HEIGHT:1/t,CUBEUV_MAX_MIP:`${i}.0`},uniforms:{envMap:{value:null},samples:{value:1},weights:{value:n},latitudinal:{value:!1},dTheta:{value:0},mipInt:{value:0},poleAxis:{value:s}},vertexShader:fM(),fragmentShader:`
3648
3649			precision mediump float;
3650			precision mediump int;
3651
3652			varying vec3 vOutputDirection;
3653
3654			uniform sampler2D envMap;
3655			uniform int samples;
3656			uniform float weights[ n ];
3657			uniform bool latitudinal;
3658			uniform float dTheta;
3659			uniform float mipInt;
3660			uniform vec3 poleAxis;
3661
3662			#define ENVMAP_TYPE_CUBE_UV
3663			#include <cube_uv_reflection_fragment>
3664
3665			vec3 getSample( float theta, vec3 axis ) {
3666
3667				float cosTheta = cos( theta );
3668				// Rodrigues' axis-angle rotation
3669				vec3 sampleDirection = vOutputDirection * cosTheta
3670					+ cross( axis, vOutputDirection ) * sin( theta )
3671					+ axis * dot( axis, vOutputDirection ) * ( 1.0 - cosTheta );
3672
3673				return bilinearCubeUV( envMap, sampleDirection, mipInt );
3674
3675			}
3676
3677			void main() {
3678
3679				vec3 axis = latitudinal ? poleAxis : cross( poleAxis, vOutputDirection );
3680
3681				if ( all( equal( axis, vec3( 0.0 ) ) ) ) {
3682
3683					axis = vec3( vOutputDirection.z, 0.0, - vOutputDirection.x );
3684
3685				}
3686
3687				axis = normalize( axis );
3688
3689				gl_FragColor = vec4( 0.0, 0.0, 0.0, 1.0 );
3690				gl_FragColor.rgb += weights[ 0 ] * getSample( 0.0, axis );
3691
3692				for ( int i = 1; i < n; i++ ) {
3693
3694					if ( i >= samples ) {
3695
3696						break;
3697
3698					}
3699
3700					float theta = dTheta * float( i );
3701					gl_FragColor.rgb += weights[ i ] * getSample( -1.0 * theta, axis );
3702					gl_FragColor.rgb += weights[ i ] * getSample( theta, axis );
3703
3704				}
3705
3706			}
3707		`,blending:Qr,depthTest:!1,depthWrite:!1})}
vendor: 23,265 bytes, lines 3707-3832
3707function vw(){return new Zi({name:"EquirectangularToCubeUV",uniforms:{envMap:{value:null}},vertexShader:fM(),fragmentShader:`
3708
3709			precision mediump float;
3710			precision mediump int;
3711
3712			varying vec3 vOutputDirection;
3713
3714			uniform sampler2D envMap;
3715
3716			#include <common>
3717
3718			void main() {
3719
3720				vec3 outputDirection = normalize( vOutputDirection );
3721				vec2 uv = equirectUv( outputDirection );
3722
3723				gl_FragColor = vec4( texture2D ( envMap, uv ).rgb, 1.0 );
3724
3725			}
3726		`,blending:Qr,depthTest:!1,depthWrite:!1})}function yw(){return new Zi({name:"CubemapToCubeUV",uniforms:{envMap:{value:null},flipEnvMap:{value:-1}},vertexShader:fM(),fragmentShader:`
3727
3728			precision mediump float;
3729			precision mediump int;
3730
3731			uniform float flipEnvMap;
3732
3733			varying vec3 vOutputDirection;
3734
3735			uniform samplerCube envMap;
3736
3737			void main() {
3738
3739				gl_FragColor = textureCube( envMap, vec3( flipEnvMap * vOutputDirection.x, vOutputDirection.yz ) );
3740
3741			}
3742		`,blending:Qr,depthTest:!1,depthWrite:!1})}function fM(){return`
3743
3744		precision mediump float;
3745		precision mediump int;
3746
3747		attribute float faceIndex;
3748
3749		varying vec3 vOutputDirection;
3750
3751		// RH coordinate system; PMREM face-indexing convention
3752		vec3 getDirection( vec2 uv, float face ) {
3753
3754			uv = 2.0 * uv - 1.0;
3755
3756			vec3 direction = vec3( uv, 1.0 );
3757
3758			if ( face == 0.0 ) {
3759
3760				direction = direction.zyx; // ( 1, v, u ) pos x
3761
3762			} else if ( face == 1.0 ) {
3763
3764				direction = direction.xzy;
3765				direction.xz *= -1.0; // ( -u, 1, -v ) pos y
3766
3767			} else if ( face == 2.0 ) {
3768
3769				direction.x *= -1.0; // ( -u, v, 1 ) pos z
3770
3771			} else if ( face == 3.0 ) {
3772
3773				direction = direction.zyx;
3774				direction.xz *= -1.0; // ( -1, v, -u ) neg x
3775
3776			} else if ( face == 4.0 ) {
3777
3778				direction = direction.xzy;
3779				direction.xy *= -1.0; // ( -u, -1, v ) neg y
3780
3781			} else if ( face == 5.0 ) {
3782
3783				direction.z *= -1.0; // ( u, v, -1 ) neg z
3784
3785			}
3786
3787			return direction;
3788
3789		}
3790
3791		void main() {
3792
3793			vOutputDirection = getDirection( uv, faceIndex );
3794			gl_Position = vec4( position, 1.0 );
3795
3796		}
3797	`}function Iz(i){let e=new WeakMap,t=null;function n(u){if(u&&u.isTexture){const h=u.mapping,p=h===j0||h===V0,m=h===Fc||h===Ku;if(p||m){let v=e.get(u);const x=v!==void 0?v.texture.pmremVersion:0;if(u.isRenderTargetTexture&&u.pmremVersion!==x)return t===null&&(t=new eA(i)),v=p?t.fromEquirectangular(u,v):t.fromCubemap(u,v),v.texture.pmremVersion=u.pmremVersion,e.set(u,v),v.texture;if(v!==void 0)return v.texture;{const _=u.image;return p&&_&&_.height>0||m&&_&&s(_)?(t===null&&(t=new eA(i)),v=p?t.fromEquirectangular(u):t.fromCubemap(u),v.texture.pmremVersion=u.pmremVersion,e.set(u,v),u.addEventListener("dispose",a),v.texture):null}}}return u}function s(u){let h=0;const p=6;for(let m=0;m<p;m++)u[m]!==void 0&&h++;return h===p}function a(u){const h=u.target;h.removeEventListener("dispose",a);const p=e.get(h);p!==void 0&&(e.delete(h),p.dispose())}function l(){e=new WeakMap,t!==null&&(t.dispose(),t=null)}return{get:n,dispose:l}}function Dz(i){const e={};function t(n){if(e[n]!==void 0)return e[n];let s;switch(n){case"WEBGL_depth_texture":s=i.getExtension("WEBGL_depth_texture")||i.getExtension("MOZ_WEBGL_depth_texture")||i.getExtension("WEBKIT_WEBGL_depth_texture");break;case"EXT_texture_filter_anisotropic":s=i.getExtension("EXT_texture_filter_anisotropic")||i.getExtension("MOZ_EXT_texture_filter_anisotropic")||i.getExtension("WEBKIT_EXT_texture_filter_anisotropic");break;case"WEBGL_compressed_texture_s3tc":s=i.getExtension("WEBGL_compressed_texture_s3tc")||i.getExtension("MOZ_WEBGL_compressed_texture_s3tc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_s3tc");break;case"WEBGL_compressed_texture_pvrtc":s=i.getExtension("WEBGL_compressed_texture_pvrtc")||i.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc");break;default:s=i.getExtension(n)}return e[n]=s,s}return{has:function(n){return t(n)!==null},init:function(){t("EXT_color_buffer_float"),t("WEBGL_clip_cull_distance"),t("OES_texture_float_linear"),t("EXT_color_buffer_half_float"),t("WEBGL_multisampled_render_to_texture"),t("WEBGL_render_shared_exponent")},get:function(n){const s=t(n);return s===null&&_x("THREE.WebGLRenderer: "+n+" extension not supported."),s}}}function Lz(i,e,t,n){const s={},a=new WeakMap;function l(v){const x=v.target;x.index!==null&&e.remove(x.index);for(const A in x.attributes)e.remove(x.attributes[A]);x.removeEventListener("dispose",l),delete s[x.id];const _=a.get(x);_&&(e.remove(_),a.delete(x)),n.releaseStatesOfGeometry(x),x.isInstancedBufferGeometry===!0&&delete x._maxInstanceCount,t.memory.geometries--}function u(v,x){return s[x.id]===!0||(x.addEventListener("dispose",l),s[x.id]=!0,t.memory.geometries++),x}function h(v){const x=v.attributes;for(const _ in x)e.update(x[_],i.ARRAY_BUFFER)}function p(v){const x=[],_=v.index,A=v.attributes.position;let R=0;if(_!==null){const D=_.array;R=_.version;for(let L=0,P=D.length;L<P;L+=3){const G=D[L+0],H=D[L+1],F=D[L+2];x.push(G,H,H,F,F,G)}}else if(A!==void 0){const D=A.array;R=A.version;for(let L=0,P=D.length/3-1;L<P;L+=3){const G=L+0,H=L+1,F=L+2;x.push(G,H,H,F,F,G)}}else return;const w=new(tI(x)?zA:UA)(x,1);w.version=R;const E=a.get(v);E&&e.remove(E),a.set(v,w)}function m(v){const x=a.get(v);if(x){const _=v.index;_!==null&&x.version<_.version&&p(v)}else p(v);return a.get(v)}return{get:u,update:h,getWireframeAttribute:m}}function Pz(i,e,t){let n;function s(x){n=x}let a,l;function u(x){a=x.type,l=x.bytesPerElement}function h(x,_){i.drawElements(n,_,a,x*l),t.update(_,n,1)}function p(x,_,A){A!==0&&(i.drawElementsInstanced(n,_,a,x*l,A),t.update(_,n,A))}function m(x,_,A){if(A===0)return;e.get("WEBGL_multi_draw").multiDrawElementsWEBGL(n,_,0,a,x,0,A);let w=0;for(let E=0;E<A;E++)w+=_[E];t.update(w,n,1)}function v(x,_,A,R){if(A===0)return;const w=e.get("WEBGL_multi_draw");if(w===null)for(let E=0;E<x.length;E++)p(x[E]/l,_[E],R[E]);else{w.multiDrawElementsInstancedWEBGL(n,_,0,a,x,0,R,0,A);let E=0;for(let D=0;D<A;D++)E+=_[D]*R[D];t.update(E,n,1)}}this.setMode=s,this.setIndex=u,this.render=h,this.renderInstances=p,this.renderMultiDraw=m,this.renderMultiDrawInstances=v}function Oz(i){const e={geometries:0,textures:0},t={frame:0,calls:0,triangles:0,points:0,lines:0};function n(a,l,u){switch(t.calls++,l){case i.TRIANGLES:t.triangles+=u*(a/3);break;case i.LINES:t.lines+=u*(a/2);break;case i.LINE_STRIP:t.lines+=u*(a-1);break;case i.LINE_LOOP:t.lines+=u*a;break;case i.POINTS:t.points+=u*a;break;default:console.error("THREE.WebGLInfo: Unknown draw mode:",l);break}}function s(){t.calls=0,t.triangles=0,t.points=0,t.lines=0}return{memory:e,render:t,programs:null,autoReset:!0,reset:s,update:n}}function Nz(i,e,t){const n=new WeakMap,s=new oi;function a(l,u,h){const p=l.morphTargetInfluences,m=u.morphAttributes.position||u.morphAttributes.normal||u.morphAttributes.color,v=m!==void 0?m.length:0;let x=n.get(u);if(x===void 0||x.count!==v){let k=function(){X.dispose(),n.delete(u),u.removeEventListener("dispose",k)};var _=k;x!==void 0&&x.texture.dispose();const A=u.morphAttributes.position!==void 0,R=u.morphAttributes.normal!==void 0,w=u.morphAttributes.color!==void 0,E=u.morphAttributes.position||[],D=u.morphAttributes.normal||[],L=u.morphAttributes.color||[];let P=0;A===!0&&(P=1),R===!0&&(P=2),w===!0&&(P=3);let G=u.attributes.position.count*P,H=1;G>e.maxTextureSize&&(H=Math.ceil(G/e.maxTextureSize),G=e.maxTextureSize);const F=new Float32Array(G*H*4*v),X=new cg(F,G,H,v);X.type=Yr,X.needsUpdate=!0;const z=P*4;for(let ie=0;ie<v;ie++){const ve=E[ie],J=D[ie],le=L[ie],ae=G*H*4*ie;for(let W=0;W<ve.count;W++){const ee=W*z;A===!0&&(s.fromBufferAttribute(ve,W),F[ae+ee+0]=s.x,F[ae+ee+1]=s.y,F[ae+ee+2]=s.z,F[ae+ee+3]=0),R===!0&&(s.fromBufferAttribute(J,W),F[ae+ee+4]=s.x,F[ae+ee+5]=s.y,F[ae+ee+6]=s.z,F[ae+ee+7]=0),w===!0&&(s.fromBufferAttribute(le,W),F[ae+ee+8]=s.x,F[ae+ee+9]=s.y,F[ae+ee+10]=s.z,F[ae+ee+11]=le.itemSize===4?s.w:1)}}x={count:v,texture:X,size:new st(G,H)},n.set(u,x),u.addEventListener("dispose",k)}if(l.isInstancedMesh===!0&&l.morphTexture!==null)h.getUniforms().setValue(i,"morphTexture",l.morphTexture,t);else{let A=0;for(let w=0;w<p.length;w++)A+=p[w];const R=u.morphTargetsRelative?1:1-A;h.getUniforms().setValue(i,"morphTargetBaseInfluence",R),h.getUniforms().setValue(i,"morphTargetInfluences",p)}h.getUniforms().setValue(i,"morphTargetsTexture",x.texture,t),h.getUniforms().setValue(i,"morphTargetsTextureSize",x.size)}return{update:a}}function Uz(i,e,t,n){let s=new WeakMap;function a(h){const p=n.render.frame,m=h.geometry,v=e.get(h,m);if(s.get(v)!==p&&(e.update(v),s.set(v,p)),h.isInstancedMesh&&(h.hasEventListener("dispose",u)===!1&&h.addEventListener("dispose",u),s.get(h)!==p&&(t.update(h.instanceMatrix,i.ARRAY_BUFFER),h.instanceColor!==null&&t.update(h.instanceColor,i.ARRAY_BUFFER),s.set(h,p))),h.isSkinnedMesh){const x=h.skeleton;s.get(x)!==p&&(x.update(),s.set(x,p))}return v}function l(){s=new WeakMap}function u(h){const p=h.target;p.removeEventListener("dispose",u),t.remove(p.instanceMatrix),p.instanceColor!==null&&t.remove(p.instanceColor)}return{update:a,dispose:l}}const t3=new Ki,xw=new q_(1,1),n3=new cg,i3=new k_,s3=new ug,_w=[],bw=[],Sw=new Float32Array(16),Aw=new Float32Array(9),Mw=new Float32Array(4);function Np(i,e,t){const n=i[0];if(n<=0||n>0)return i;const s=e*t;let a=_w[s];if(a===void 0&&(a=new Float32Array(s),_w[s]=a),e!==0){n.toArray(a,0);for(let l=1,u=0;l!==e;++l)u+=t,i[l].toArray(a,u)}return a}function or(i,e){if(i.length!==e.length)return!1;for(let t=0,n=i.length;t<n;t++)if(i[t]!==e[t])return!1;return!0}function lr(i,e){for(let t=0,n=e.length;t<n;t++)i[t]=e[t]}function cb(i,e){let t=bw[e];t===void 0&&(t=new Int32Array(e),bw[e]=t);for(let n=0;n!==e;++n)t[n]=i.allocateTextureUnit();return t}function zz(i,e){const t=this.cache;t[0]!==e&&(i.uniform1f(this.addr,e),t[0]=e)}function Fz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2f(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(or(t,e))return;i.uniform2fv(this.addr,e),lr(t,e)}}function kz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3f(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else if(e.r!==void 0)(t[0]!==e.r||t[1]!==e.g||t[2]!==e.b)&&(i.uniform3f(this.addr,e.r,e.g,e.b),t[0]=e.r,t[1]=e.g,t[2]=e.b);else{if(or(t,e))return;i.uniform3fv(this.addr,e),lr(t,e)}}function Hz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4f(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(or(t,e))return;i.uniform4fv(this.addr,e),lr(t,e)}}function Gz(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(or(t,e))return;i.uniformMatrix2fv(this.addr,!1,e),lr(t,e)}else{if(or(t,n))return;Mw.set(n),i.uniformMatrix2fv(this.addr,!1,Mw),lr(t,n)}}function jz(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(or(t,e))return;i.uniformMatrix3fv(this.addr,!1,e),lr(t,e)}else{if(or(t,n))return;Aw.set(n),i.uniformMatrix3fv(this.addr,!1,Aw),lr(t,n)}}function Vz(i,e){const t=this.cache,n=e.elements;if(n===void 0){if(or(t,e))return;i.uniformMatrix4fv(this.addr,!1,e),lr(t,e)}else{if(or(t,n))return;Sw.set(n),i.uniformMatrix4fv(this.addr,!1,Sw),lr(t,n)}}function Wz(i,e){const t=this.cache;t[0]!==e&&(i.uniform1i(this.addr,e),t[0]=e)}function Xz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2i(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(or(t,e))return;i.uniform2iv(this.addr,e),lr(t,e)}}function qz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3i(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(or(t,e))return;i.uniform3iv(this.addr,e),lr(t,e)}}function Yz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4i(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(or(t,e))return;i.uniform4iv(this.addr,e),lr(t,e)}}function Jz(i,e){const t=this.cache;t[0]!==e&&(i.uniform1ui(this.addr,e),t[0]=e)}function Kz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y)&&(i.uniform2ui(this.addr,e.x,e.y),t[0]=e.x,t[1]=e.y);else{if(or(t,e))return;i.uniform2uiv(this.addr,e),lr(t,e)}}function Zz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z)&&(i.uniform3ui(this.addr,e.x,e.y,e.z),t[0]=e.x,t[1]=e.y,t[2]=e.z);else{if(or(t,e))return;i.uniform3uiv(this.addr,e),lr(t,e)}}function Qz(i,e){const t=this.cache;if(e.x!==void 0)(t[0]!==e.x||t[1]!==e.y||t[2]!==e.z||t[3]!==e.w)&&(i.uniform4ui(this.addr,e.x,e.y,e.z,e.w),t[0]=e.x,t[1]=e.y,t[2]=e.z,t[3]=e.w);else{if(or(t,e))return;i.uniform4uiv(this.addr,e),lr(t,e)}}function $z(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s);let a;this.type===i.SAMPLER_2D_SHADOW?(xw.compareFunction=OA,a=xw):a=t3,t.setTexture2D(e||a,s)}function eF(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture3D(e||i3,s)}function tF(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTextureCube(e||s3,s)}function nF(i,e,t){const n=this.cache,s=t.allocateTextureUnit();n[0]!==s&&(i.uniform1i(this.addr,s),n[0]=s),t.setTexture2DArray(e||n3,s)}function iF(i){switch(i){case 5126:return zz;case 35664:return Fz;case 35665:return kz;case 35666:return Hz;case 35674:return Gz;case 35675:return jz;case 35676:return Vz;case 5124:case 35670:return Wz;case 35667:case 35671:return Xz;case 35668:case 35672:return qz;case 35669:case 35673:return Yz;case 5125:return Jz;case 36294:return Kz;case 36295:return Zz;case 36296:return Qz;case 35678:case 36198:case 36298:case 36306:case 35682:return $z;case 35679:case 36299:case 36307:return eF;case 35680:case 36300:case 36308:case 36293:return tF;case 36289:case 36303:case 36311:case 36292:return nF}}function sF(i,e){i.uniform1fv(this.addr,e)}function rF(i,e){const t=Np(e,this.size,2);i.uniform2fv(this.addr,t)}function aF(i,e){const t=Np(e,this.size,3);i.uniform3fv(this.addr,t)}function oF(i,e){const t=Np(e,this.size,4);i.uniform4fv(this.addr,t)}function lF(i,e){const t=Np(e,this.size,4);i.uniformMatrix2fv(this.addr,!1,t)}function cF(i,e){const t=Np(e,this.size,9);i.uniformMatrix3fv(this.addr,!1,t)}function uF(i,e){const t=Np(e,this.size,16);i.uniformMatrix4fv(this.addr,!1,t)}function fF(i,e){i.uniform1iv(this.addr,e)}function dF(i,e){i.uniform2iv(this.addr,e)}function hF(i,e){i.uniform3iv(this.addr,e)}function pF(i,e){i.uniform4iv(this.addr,e)}function mF(i,e){i.uniform1uiv(this.addr,e)}function gF(i,e){i.uniform2uiv(this.addr,e)}function vF(i,e){i.uniform3uiv(this.addr,e)}function yF(i,e){i.uniform4uiv(this.addr,e)}function xF(i,e,t){const n=this.cache,s=e.length,a=cb(t,s);or(n,a)||(i.uniform1iv(this.addr,a),lr(n,a));for(let l=0;l!==s;++l)t.setTexture2D(e[l]||t3,a[l])}function _F(i,e,t){const n=this.cache,s=e.length,a=cb(t,s);or(n,a)||(i.uniform1iv(this.addr,a),lr(n,a));for(let l=0;l!==s;++l)t.setTexture3D(e[l]||i3,a[l])}function bF(i,e,t){const n=this.cache,s=e.length,a=cb(t,s);or(n,a)||(i.uniform1iv(this.addr,a),lr(n,a));for(let l=0;l!==s;++l)t.setTextureCube(e[l]||s3,a[l])}function SF(i,e,t){const n=this.cache,s=e.length,a=cb(t,s);or(n,a)||(i.uniform1iv(this.addr,a),lr(n,a));for(let l=0;l!==s;++l)t.setTexture2DArray(e[l]||n3,a[l])}function AF(i){switch(i){case 5126:return sF;case 35664:return rF;case 35665:return aF;case 35666:return oF;case 35674:return lF;case 35675:return cF;case 35676:return uF;case 5124:case 35670:return fF;case 35667:case 35671:return dF;case 35668:case 35672:return hF;case 35669:case 35673:return pF;case 5125:return mF;case 36294:return gF;case 36295:return vF;case 36296:return yF;case 35678:case 36198:case 36298:case 36306:case 35682:return xF;case 35679:case 36299:case 36307:return _F;case 35680:case 36300:case 36308:case 36293:return bF;case 36289:case 36303:case 36311:case 36292:return SF}}class MF{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.setValue=iF(t.type)}}class EF{constructor(e,t,n){this.id=e,this.addr=n,this.cache=[],this.type=t.type,this.size=t.size,this.setValue=AF(t.type)}}class TF{constructor(e){this.id=e,this.seq=[],this.map={}}setValue(e,t,n){const s=this.seq;for(let a=0,l=s.length;a!==l;++a){const u=s[a];u.setValue(e,t[u.id],n)}}}const a1=/(\w+)(\])?(\[|\.)?/g;function Ew(i,e){i.seq.push(e),i.map[e.id]=e}function wF(i,e,t){const n=i.name,s=n.length;for(a1.lastIndex=0;;){const a=a1.exec(n),l=a1.lastIndex;let u=a[1];const h=a[2]==="]",p=a[3];if(h&&(u=u|0),p===void 0||p==="["&&l+2===s){Ew(t,p===void 0?new MF(u,i,e):new EF(u,i,e));break}else{let v=t.map[u];v===void 0&&(v=new TF(u),Ew(t,v)),t=v}}}class Sx{constructor(e,t){this.seq=[],this.map={};const n=e.getProgramParameter(t,e.ACTIVE_UNIFORMS);for(let s=0;s<n;++s){const a=e.getActiveUniform(t,s),l=e.getUniformLocation(t,a.name);wF(a,l,this)}}setValue(e,t,n,s){const a=this.map[t];a!==void 0&&a.setValue(e,n,s)}setOptional(e,t,n){const s=t[n];s!==void 0&&this.setValue(e,n,s)}static upload(e,t,n,s){for(let a=0,l=t.length;a!==l;++a){const u=t[a],h=n[u.id];h.needsUpdate!==!1&&u.setValue(e,h.value,s)}}static seqWithValue(e,t){const n=[];for(let s=0,a=e.length;s!==a;++s){const l=e[s];l.id in t&&n.push(l)}return n}}function Tw(i,e,t){const n=i.createShader(e);return i.shaderSource(n,t),i.compileShader(n),n}const CF=37297;let RF=0;function BF(i,e){const t=i.split(`
3798`),n=[],s=Math.max(e-6,0),a=Math.min(e+6,t.length);for(let l=s;l<a;l++){const u=l+1;n.push(`${u===e?">":" "} ${u}: ${t[l]}`)}return n.join(`
3799`)}const ww=new Cn;function IF(i){si._getMatrix(ww,si.workingColorSpace,i);const e=`mat3( ${ww.elements.map(t=>t.toFixed(4))} )`;switch(si.getTransfer(i)){case X0:return[e,"LinearTransferOETF"];case Ri:return[e,"sRGBTransferOETF"];default:return console.warn("THREE.WebGLProgram: Unsupported color space: ",i),[e,"LinearTransferOETF"]}}function Cw(i,e,t){const n=i.getShaderParameter(e,i.COMPILE_STATUS),s=i.getShaderInfoLog(e).trim();if(n&&s==="")return"";const a=/ERROR: 0:(\d+)/.exec(s);if(a){const l=parseInt(a[1]);return t.toUpperCase()+`
3800
3801`+s+`
3802
3803`+BF(i.getShaderSource(e),l)}else return s}function DF(i,e){const t=IF(e);return[`vec4 ${i}( vec4 value ) {`,`	return ${t[1]}( vec4( value.rgb * ${t[0]}, value.a ) );`,"}"].join(`
3804`)}function LF(i,e){let t;switch(e){case OB:t="Linear";break;case NB:t="Reinhard";break;case UB:t="Cineon";break;case R_:t="ACESFilmic";break;case FB:t="AgX";break;case kB:t="Neutral";break;case zB:t="Custom";break;default:console.warn("THREE.WebGLProgram: Unsupported toneMapping:",e),t="Linear"}return"vec3 "+i+"( vec3 color ) { return "+t+"ToneMapping( color ); }"}const sx=new se;function PF(){si.getLuminanceCoefficients(sx);const i=sx.x.toFixed(4),e=sx.y.toFixed(4),t=sx.z.toFixed(4);return["float luminance( const in vec3 rgb ) {",`	const vec3 weights = vec3( ${i}, ${e}, ${t} );`,"	return dot( weights, rgb );","}"].join(`
3805`)}function OF(i){return[i.extensionClipCullDistance?"#extension GL_ANGLE_clip_cull_distance : require":"",i.extensionMultiDraw?"#extension GL_ANGLE_multi_draw : require":""].filter(R0).join(`
3806`)}function NF(i){const e=[];for(const t in i){const n=i[t];n!==!1&&e.push("#define "+t+" "+n)}return e.join(`
3807`)}function UF(i,e){const t={},n=i.getProgramParameter(e,i.ACTIVE_ATTRIBUTES);for(let s=0;s<n;s++){const a=i.getActiveAttrib(e,s),l=a.name;let u=1;a.type===i.FLOAT_MAT2&&(u=2),a.type===i.FLOAT_MAT3&&(u=3),a.type===i.FLOAT_MAT4&&(u=4),t[l]={type:a.type,location:i.getAttribLocation(e,l),locationSize:u}}return t}function R0(i){return i!==""}function Rw(i,e){const t=e.numSpotLightShadows+e.numSpotLightMaps-e.numSpotLightShadowsWithMaps;return i.replace(/NUM_DIR_LIGHTS/g,e.numDirLights).replace(/NUM_SPOT_LIGHTS/g,e.numSpotLights).replace(/NUM_SPOT_LIGHT_MAPS/g,e.numSpotLightMaps).replace(/NUM_SPOT_LIGHT_COORDS/g,t).replace(/NUM_RECT_AREA_LIGHTS/g,e.numRectAreaLights).replace(/NUM_POINT_LIGHTS/g,e.numPointLights).replace(/NUM_HEMI_LIGHTS/g,e.numHemiLights).replace(/NUM_DIR_LIGHT_SHADOWS/g,e.numDirLightShadows).replace(/NUM_SPOT_LIGHT_SHADOWS_WITH_MAPS/g,e.numSpotLightShadowsWithMaps).replace(/NUM_SPOT_LIGHT_SHADOWS/g,e.numSpotLightShadows).replace(/NUM_POINT_LIGHT_SHADOWS/g,e.numPointLightShadows)}function Bw(i,e){return i.replace(/NUM_CLIPPING_PLANES/g,e.numClippingPlanes).replace(/UNION_CLIPPING_PLANES/g,e.numClippingPlanes-e.numClipIntersection)}const zF=/^[ \t]*#include +<([\w\d./]+)>/gm;function tA(i){return i.replace(zF,kF)}const FF=new Map;function kF(i,e){let t=Nn[e];if(t===void 0){const n=FF.get(e);if(n!==void 0)t=Nn[n],console.warn('THREE.WebGLRenderer: Shader chunk "%s" has been deprecated. Use "%s" instead.',e,n);else throw new Error("Can not resolve #include <"+e+">")}return tA(t)}const HF=/#pragma unroll_loop_start\s+for\s*\(\s*int\s+i\s*=\s*(\d+)\s*;\s*i\s*<\s*(\d+)\s*;\s*i\s*\+\+\s*\)\s*{([\s\S]+?)}\s+#pragma unroll_loop_end/g;function Iw(i){return i.replace(HF,GF)}function GF(i,e,t,n){let s="";for(let a=parseInt(e);a<parseInt(t);a++)s+=n.replace(/\[\s*i\s*\]/g,"[ "+a+" ]").replace(/UNROLLED_LOOP_INDEX/g,a);return s}function Dw(i){let e=`precision ${i.precision} float;
3808	precision ${i.precision} int;
3809	precision ${i.precision} sampler2D;
3810	precision ${i.precision} samplerCube;
3811	precision ${i.precision} sampler3D;
3812	precision ${i.precision} sampler2DArray;
3813	precision ${i.precision} sampler2DShadow;
3814	precision ${i.precision} samplerCubeShadow;
3815	precision ${i.precision} sampler2DArrayShadow;
3816	precision ${i.precision} isampler2D;
3817	precision ${i.precision} isampler3D;
3818	precision ${i.precision} isamplerCube;
3819	precision ${i.precision} isampler2DArray;
3820	precision ${i.precision} usampler2D;
3821	precision ${i.precision} usampler3D;
3822	precision ${i.precision} usamplerCube;
3823	precision ${i.precision} usampler2DArray;
3824	`;return i.precision==="highp"?e+=`
3825#define HIGH_PRECISION`:i.precision==="mediump"?e+=`
3826#define MEDIUM_PRECISION`:i.precision==="lowp"&&(e+=`
3827#define LOW_PRECISION`),e}function jF(i){let e="SHADOWMAP_TYPE_BASIC";return i.shadowMapType===C_?e="SHADOWMAP_TYPE_PCF":i.shadowMapType===mp?e="SHADOWMAP_TYPE_PCF_SOFT":i.shadowMapType===nl&&(e="SHADOWMAP_TYPE_VSM"),e}function VF(i){let e="ENVMAP_TYPE_CUBE";if(i.envMap)switch(i.envMapMode){case Fc:case Ku:e="ENVMAP_TYPE_CUBE";break;case Dp:e="ENVMAP_TYPE_CUBE_UV";break}return e}function WF(i){let e="ENVMAP_MODE_REFLECTION";if(i.envMap)switch(i.envMapMode){case Ku:e="ENVMAP_MODE_REFRACTION";break}return e}function XF(i){let e="ENVMAP_BLENDING_NONE";if(i.envMap)switch(i.combine){case og:e="ENVMAP_BLENDING_MULTIPLY";break;case LB:e="ENVMAP_BLENDING_MIX";break;case PB:e="ENVMAP_BLENDING_ADD";break}return e}function qF(i){const e=i.envMapCubeUVHeight;if(e===null)return null;const t=Math.log2(e)-2,n=1/e;return{texelWidth:1/(3*Math.max(Math.pow(2,t),112)),texelHeight:n,maxMip:t}}function YF(i,e,t,n){const s=i.getContext(),a=t.defines;let l=t.vertexShader,u=t.fragmentShader;const h=jF(t),p=VF(t),m=WF(t),v=XF(t),x=qF(t),_=OF(t),A=NF(a),R=s.createProgram();let w,E,D=t.glslVersion?"#version "+t.glslVersion+`
3828`:"";t.isRawShaderMaterial?(w=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A].filter(R0).join(`
3829`),w.length>0&&(w+=`
3830`),E=["#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A].filter(R0).join(`
3831`),E.length>0&&(E+=`
3832`)):(w=[Dw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,t.extensionCl
vendor: 6,454 bytes, lines 3832-3834
3832ipCullDistance?"#define USE_CLIP_DISTANCE":"",t.batching?"#define USE_BATCHING":"",t.batchingColor?"#define USE_BATCHING_COLOR":"",t.instancing?"#define USE_INSTANCING":"",t.instancingColor?"#define USE_INSTANCING_COLOR":"",t.instancingMorph?"#define USE_INSTANCING_MORPH":"",t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.map?"#define USE_MAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+m:"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.displacementMap?"#define USE_DISPLACEMENTMAP":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.mapUv?"#define MAP_UV "+t.mapUv:"",t.alphaMapUv?"#define ALPHAMAP_UV "+t.alphaMapUv:"",t.lightMapUv?"#define LIGHTMAP_UV "+t.lightMapUv:"",t.aoMapUv?"#define AOMAP_UV "+t.aoMapUv:"",t.emissiveMapUv?"#define EMISSIVEMAP_UV "+t.emissiveMapUv:"",t.bumpMapUv?"#define BUMPMAP_UV "+t.bumpMapUv:"",t.normalMapUv?"#define NORMALMAP_UV "+t.normalMapUv:"",t.displacementMapUv?"#define DISPLACEMENTMAP_UV "+t.displacementMapUv:"",t.metalnessMapUv?"#define METALNESSMAP_UV "+t.metalnessMapUv:"",t.roughnessMapUv?"#define ROUGHNESSMAP_UV "+t.roughnessMapUv:"",t.anisotropyMapUv?"#define ANISOTROPYMAP_UV "+t.anisotropyMapUv:"",t.clearcoatMapUv?"#define CLEARCOATMAP_UV "+t.clearcoatMapUv:"",t.clearcoatNormalMapUv?"#define CLEARCOAT_NORMALMAP_UV "+t.clearcoatNormalMapUv:"",t.clearcoatRoughnessMapUv?"#define CLEARCOAT_ROUGHNESSMAP_UV "+t.clearcoatRoughnessMapUv:"",t.iridescenceMapUv?"#define IRIDESCENCEMAP_UV "+t.iridescenceMapUv:"",t.iridescenceThicknessMapUv?"#define IRIDESCENCE_THICKNESSMAP_UV "+t.iridescenceThicknessMapUv:"",t.sheenColorMapUv?"#define SHEEN_COLORMAP_UV "+t.sheenColorMapUv:"",t.sheenRoughnessMapUv?"#define SHEEN_ROUGHNESSMAP_UV "+t.sheenRoughnessMapUv:"",t.specularMapUv?"#define SPECULARMAP_UV "+t.specularMapUv:"",t.specularColorMapUv?"#define SPECULAR_COLORMAP_UV "+t.specularColorMapUv:"",t.specularIntensityMapUv?"#define SPECULAR_INTENSITYMAP_UV "+t.specularIntensityMapUv:"",t.transmissionMapUv?"#define TRANSMISSIONMAP_UV "+t.transmissionMapUv:"",t.thicknessMapUv?"#define THICKNESSMAP_UV "+t.thicknessMapUv:"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.flatShading?"#define FLAT_SHADED":"",t.skinning?"#define USE_SKINNING":"",t.morphTargets?"#define USE_MORPHTARGETS":"",t.morphNormals&&t.flatShading===!1?"#define USE_MORPHNORMALS":"",t.morphColors?"#define USE_MORPHCOLORS":"",t.morphTargetsCount>0?"#define MORPHTARGETS_TEXTURE_STRIDE "+t.morphTextureStride:"",t.morphTargetsCount>0?"#define MORPHTARGETS_COUNT "+t.morphTargetsCount:"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.sizeAttenuation?"#define USE_SIZEATTENUATION":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 modelMatrix;","uniform mat4 modelViewMatrix;","uniform mat4 projectionMatrix;","uniform mat4 viewMatrix;","uniform mat3 normalMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;","#ifdef USE_INSTANCING","	attribute mat4 instanceMatrix;","#endif","#ifdef USE_INSTANCING_COLOR","	attribute vec3 instanceColor;","#endif","#ifdef USE_INSTANCING_MORPH","	uniform sampler2D morphTexture;","#endif","attribute vec3 position;","attribute vec3 normal;","attribute vec2 uv;","#ifdef USE_UV1","	attribute vec2 uv1;","#endif","#ifdef USE_UV2","	attribute vec2 uv2;","#endif","#ifdef USE_UV3","	attribute vec2 uv3;","#endif","#ifdef USE_TANGENT","	attribute vec4 tangent;","#endif","#if defined( USE_COLOR_ALPHA )","	attribute vec4 color;","#elif defined( USE_COLOR )","	attribute vec3 color;","#endif","#ifdef USE_SKINNING","	attribute vec4 skinIndex;","	attribute vec4 skinWeight;","#endif",`
3833`].filter(R0).join(`
3834`),E=[Dw(t),"#define SHADER_TYPE "+t.shaderType,"#define SHADER_NAME "+t.shaderName,A,t.useFog&&t.fog?"#define USE_FOG":"",t.useFog&&t.fogExp2?"#define FOG_EXP2":"",t.alphaToCoverage?"#define ALPHA_TO_COVERAGE":"",t.map?"#define USE_MAP":"",t.matcap?"#define USE_MATCAP":"",t.envMap?"#define USE_ENVMAP":"",t.envMap?"#define "+p:"",t.envMap?"#define "+m:"",t.envMap?"#define "+v:"",x?"#define CUBEUV_TEXEL_WIDTH "+x.texelWidth:"",x?"#define CUBEUV_TEXEL_HEIGHT "+x.texelHeight:"",x?"#define CUBEUV_MAX_MIP "+x.maxMip+".0":"",t.lightMap?"#define USE_LIGHTMAP":"",t.aoMap?"#define USE_AOMAP":"",t.bumpMap?"#define USE_BUMPMAP":"",t.normalMap?"#define USE_NORMALMAP":"",t.normalMapObjectSpace?"#define USE_NORMALMAP_OBJECTSPACE":"",t.normalMapTangentSpace?"#define USE_NORMALMAP_TANGENTSPACE":"",t.emissiveMap?"#define USE_EMISSIVEMAP":"",t.anisotropy?"#define USE_ANISOTROPY":"",t.anisotropyMap?"#define USE_ANISOTROPYMAP":"",t.clearcoat?"#define USE_CLEARCOAT":"",t.clearcoatMap?"#define USE_CLEARCOATMAP":"",t.clearcoatRoughnessMap?"#define USE_CLEARCOAT_ROUGHNESSMAP":"",t.clearcoatNormalMap?"#define USE_CLEARCOAT_NORMALMAP":"",t.dispersion?"#define USE_DISPERSION":"",t.iridescence?"#define USE_IR
3834IDESCENCE":"",t.iridescenceMap?"#define USE_IRIDESCENCEMAP":"",t.iridescenceThicknessMap?"#define USE_IRIDESCENCE_THICKNESSMAP":"",t.specularMap?"#define USE_SPECULARMAP":"",t.specularColorMap?"#define USE_SPECULAR_COLORMAP":"",t.specularIntensityMap?"#define USE_SPECULAR_INTENSITYMAP":"",t.roughnessMap?"#define USE_ROUGHNESSMAP":"",t.metalnessMap?"#define USE_METALNESSMAP":"",t.alphaMap?"#define USE_ALPHAMAP":"",t.alphaTest?"#define USE_ALPHATEST":"",t.alphaHash?"#define USE_ALPHAHASH":"",t.sheen?"#define USE_SHEEN":"",t.sheenColorMap?"#define USE_SHEEN_COLORMAP":"",t.sheenRoughnessMap?"#define USE_SHEEN_ROUGHNESSMAP":"",t.transmission?"#define USE_TRANSMISSION":"",t.transmissionMap?"#define USE_TRANSMISSIONMAP":"",t.thicknessMap?"#define USE_THICKNESSMAP":"",t.vertexTangents&&t.flatShading===!1?"#define USE_TANGENT":"",t.vertexColors||t.instancingColor||t.batchingColor?"#define USE_COLOR":"",t.vertexAlphas?"#define USE_COLOR_ALPHA":"",t.vertexUv1s?"#define USE_UV1":"",t.vertexUv2s?"#define USE_UV2":"",t.vertexUv3s?"#define USE_UV3":"",t.pointsUvs?"#define USE_POINTS_UV":"",t.gradientMap?"#define USE_GRADIENTMAP":"",t.flatShading?"#define FLAT_SHADED":"",t.doubleSided?"#define DOUBLE_SIDED":"",t.flipSided?"#define FLIP_SIDED":"",t.shadowMapEnabled?"#define USE_SHADOWMAP":"",t.shadowMapEnabled?"#define "+h:"",t.premultipliedAlpha?"#define PREMULTIPLIED_ALPHA":"",t.numLightProbes>0?"#define USE_LIGHT_PROBES":"",t.decodeVideoTexture?"#define DECODE_VIDEO_TEXTURE":"",t.decodeVideoTextureEmissive?"#define DECODE_VIDEO_TEXTURE_EMISSIVE":"",t.logarithmicDepthBuffer?"#define USE_LOGDEPTHBUF":"",t.reverseDepthBuffer?"#define USE_REVERSEDEPTHBUF":"","uniform mat4 viewMatrix;","uniform vec3 cameraPosition;","uniform bool isOrthographic;",t.toneMapping!==ol?"#define TONE_MAPPING":"",t.toneMapping!==ol?Nn.tonemapping_pars_fragment:"",t.toneMapping!==ol?LF("toneMapping",t.toneMapping):"",t.dithering?"#define DITHERING":"",t.opaque?"#define OPAQUE":"",Nn.colorspace_pars_fragment,DF("linearToOutputTexel",t.outputColorSpace),PF(),t.useDepthPacking?"#define DEPTH_PACKING "+t.depthPacking:"",`
3835`].filter(R0).join(`
3836`)),l=tA(l),l=Rw(l,t),l=Bw(l,t),u=tA(u),u=Rw(u,t),u=Bw(u,t),l=Iw(l),u=Iw(u),t.isRawShaderMaterial!==!0&&(D=`#version 300 es
3837`,w=[_,"#define attribute in","#define varying out","#define texture2D texture"].join(`
3838`)+`
3839`+w,E=["#define varying in",t.glslVersion===q1?"":"layout(location = 0) out highp vec4 pc_fragColor;",t.glslVersion===q1?"":"#define gl_FragColor pc_fragColor","#define gl_FragDepthEXT gl_FragDepth","#define texture2D texture","#define textureCube texture","#define texture2DProj textureProj","#define texture2DLodEXT textureLod","#define texture2DProjLodEXT textureProjLod","#define textureCubeLodEXT textureLod","#define texture2DGradEXT textureGrad","#define texture2DProjGradEXT textureProjGrad","#define textureCubeGradEXT textureGrad"].join(`
3840`)+`
3841`+E);const L=D+w+l,P=D+E+u,G=Tw(s,s.VERTEX_SHADER,L),H=Tw(s,s.FRAGMENT_SHADER,P);s.attachShader(R,G),s.attachShader(R,H),t.index0AttributeName!==void 0?s.bindAttribLocation(R,0,t.index0AttributeName):t.morphTargets===!0&&s.bindAttribLocation(R,0,"position"),s.linkProgram(R);function F(ie){if(i.debug.checkShaderErrors){const ve=s.getProgramInfoLog(R).trim(),J=s.getShaderInfoLog(G).trim(),le=s.getShaderInfoLog(H).trim();let ae=!0,W=!0;if(s.getProgramParameter(R,s.LINK_STATUS)===!1)if(ae=!1,typeof i.debug.onShaderError=="function")i.debug.onShaderError(s,R,G,H);else{const ee=Cw(s,G,"vertex"),te=Cw(s,H,"fragment");console.error("THREE.WebGLProgram: Shader Error "+s.getError()+" - VALIDATE_STATUS "+s.getProgramParameter(R,s.VALIDATE_STATUS)+`
3842
3843Material Name: `+ie.name+`
3844Material Type: `+ie.type+`
3845
3846Program Info Log: `+ve+`
3847`+ee+`
3848`+te)}else ve!==""?console.warn("THREE.WebGLProgram: Program Info Log:",ve):(J===""||le==="")&&(W=!1);W&&(ie.diagnostics={runnable:ae,programLog:ve,vertexShader:{log:J,prefix:w},fragmentShader:{log:le,prefix:E}})}s.deleteShader(G),s.deleteShader(H),X=new Sx(s,R),z=UF(s,R)}let X;this.getUniforms=function(){return X===void 0&&F(this),X};let z;this.getAttributes=function(){return z===void 0&&F(this),z};let k=t.rendererExtensionParallelShaderCompile===!1;return this.isReady=function(){return k===!1&&(k=s.getProgramParameter(R,CF)),k},this.destroy=function(){n.releaseStatesOfProgram(this),s.deleteProgram(R),this.program=void 0},this.type=t.shaderType,this.name=t.shaderName,this.id=RF++,this.cacheKey=e,this.usedTimes=1,this.program=R,this.vertexShader=G,this.fragmentShader=H,this}let JF=0;class KF{constructor(){this.shaderCache=new Map,this.materialCache=new Map}update(e){const t=e.vertexShader,n=e.fragmentShader,s=this._getShaderStage(t),a=this._getShaderStage(n),l=this._getShaderCacheForMaterial(e);return l.has(s)===!1&&(l.add(s),s.usedTimes++),l.has(a)===!1&&(l.add(a),a.usedTimes++),this}remove(e){const t=this.materialCache.get(e);for(const n of t)n.usedTimes--,n.usedTimes===0&&this.shaderCache.delete(n.code);return this.materialCache.delete(e),this}getVertexShaderID(e){return this._getShaderStage(e.vertexShader).id}getFragmentShaderID(e){return this._getShaderStage(e.fragmentShader).id}dispose(){this.shaderCache.clear(),this.materialCache.clear()}_getShaderCacheForMaterial(e){const t=this.materialCache;let n=t.get(e);return n===void 0&&(n=new Set,t.set(e,n)),n}_getShaderStage(e){const t=this.shaderCache;let n=t.get(e);return n===void 0&&(n=new ZF(e),t.set(e,n)),n}}class ZF{constructor(e){this.id=JF++,this.code=e,this.usedTimes=0}}function QF(i,e,t,n,s,a,l){const u=new wp,h=new KF,p=new Set,m=[],v=s.logarithmicDepthBuffer,x=s.vertexTextures;let _=s.precision;const A={MeshDepthMaterial:"depth",MeshDistanceMaterial:"distanceRGBA",MeshNormalMaterial:"normal",MeshBasicMaterial:"basic",MeshLambertMaterial:"lambert",MeshPhongMaterial:"phong",MeshToonMaterial:"toon",MeshStandardMaterial:"physical",MeshPhysicalMaterial:"physical",MeshMatcapMaterial:"matcap",LineBasicMaterial:"basic",LineDashedMaterial:"dashed",PointsMaterial:"points",ShadowMaterial:"shadow",SpriteMaterial:"sprite"};function R(z){return p.add(z),z===0?"uv":`uv${z}`}function w(z,k,ie,ve,J){const le=ve.fog,ae=J.geometry,W=z.isMeshStandardMaterial?ve.environment:null,ee=(z.isMeshStandardMaterial?t:e).get(z.envMap||W),te=ee&&ee.mapping===Dp?ee.image.height:null,ue=A[z.type];z.precision!==null&&(_=s.getMaxPrecision(z.precision),_!==z.precision&&console.warn("THREE.WebGLProgram.getParameters:",z.precision,"not supported, using",_,"instead."));const he=ae.morphAttributes.position||ae.morphAttributes.normal||ae.morphAttributes.color,K=he!==void 0?he.length:0;let ce=0;ae.morphAttributes.position!==void 0&&(ce=1),ae.morphAttributes.normal!==void 0&&(ce=2),ae.morphAttributes.color!==void 0&&(ce=3);let re,oe,we,Be;if(ue){const Tt=il[ue];re=Tt.vertexShader,oe=Tt.fragmentShader}else re=z.vertexShader,oe=z.fragmentShader,h.update(z),we=h.getVertexShaderID(z),Be=h.getFragmentShaderID(z);const pe=i.getRenderTarget(),Re=i.state.buffers.depth.getReversed(),lt=J.isInstancedMesh===!0,ct=J.isBatchedMesh===!0,vt=!!z.map,qt=!!z.matcap,Wt=!!ee,de=!!z.aoMap,an=!!z.lightMap,$e=!!z.bumpMap,Qe=!!z.normalMap,Ye=!!z.displacementMap,pt=!!z.emissiveMap,Ve=!!z.metalnessMap,ne=!!z.roughnessMap,V=z.anisotropy>0,Se=z.clearcoat>0,Ie=z.dispersion>0,et=z.iridescence>0,Fe=z.sheen>0,Rt=z.transmission>0,qe=V&&!!z.anisotropyMap,yt=Se&&!!z.clearcoatMap,At=Se&&!!z.clearcoatNormalMap,it=Se&&!!z.clearcoatRoughnessMap,Oe=et&&!!z.iridescenceMap,Ct=et&&!!z.iridescenceThicknessMap,Ft=Fe&&!!z.sheenColorMap,ft=Fe&&!!z.sheenRoughnessMap,Zt=!!z.specularMap,sn=!!z.specularColorMap,cn=!!z.specularIntensityMap,_e=Rt&&!!z.transmissionMap,Bt=Rt&&!!z.thicknessMap,Ue=!!z.gradientMap,nt=!!z.alphaMap,bt=z.alphaTest>0,mt=!!z.alphaHash,nn=!!z.extensions;let kn=ol;z.toneMapped&&(pe===null||pe.isXRRenderTarget===!0)&&(kn=i.toneMapping);const Dt={shaderID:ue,shaderType:z.type,shaderName:z.name,vertexShader:re,fragmentShader:oe,defines:z.defines,customVertexShaderID:we,customFragmentShaderID:Be,isRawShaderMaterial:z.isRawShaderMaterial===!0,glslVersion:z.glslVersion,precision:_,batching:ct,batchingColor:ct&&J._colorsTexture!==null,instancing:lt,instancingColor:lt&&J.instanceColor!==null,instancingMorph:lt&&J.morphTexture!==null,supportsVertexTextures:x,outputColorSpace:pe===null?i.outputColorSpace:pe.isXRRenderTarget===!0?pe.texture.colorSpace:Wl,alphaToCoverage:!!z.alphaToCoverage,map:vt,matcap:qt,envMap:Wt,envMapMode:Wt&&ee.mapping,envMapCubeUVHeight:te,aoMap:de,lightMap:an,bumpMap:$e,normalMap:Qe,displacementMap:x&&Ye,emissiveMap:pt,normalMapObjectSpace:Qe&&z.normalMapType===qB,normalMapTangentSpace:Qe&&z.normalMapType===tf,metalnessMap:Ve,roughnessMap:ne,anisotropy:V,anisotropyMap:qe,clearcoat:Se,clearcoatMap:yt,clearcoatNormalMap:At,clearcoatRoughnessMap:it,dispersion:Ie,iridescence:et,iridescenceMap:Oe,iridescenceThicknessMap:Ct,sheen:Fe,sheenColorMap:Ft,sheenRoughnessMap:ft,specularMap:Zt,specularColorMap:sn,specularIntensityMap:cn,transmission:Rt,transmissionMap:_e,thicknessMap:Bt,gradientMap:Ue,opaque:z.transparent===!1&&z.blending===gd&&z.alphaToCoverage===!1,alphaMap:nt,alphaTest:bt,alphaHash:mt,combine:z.combine,mapUv:vt&&R(z.map.channel),aoMapUv:
vendor: 15,458 bytes, lines 3848-3854
3848de&&R(z.aoMap.channel),lightMapUv:an&&R(z.lightMap.channel),bumpMapUv:$e&&R(z.bumpMap.channel),normalMapUv:Qe&&R(z.normalMap.channel),displacementMapUv:Ye&&R(z.displacementMap.channel),emissiveMapUv:pt&&R(z.emissiveMap.channel),metalnessMapUv:Ve&&R(z.metalnessMap.channel),roughnessMapUv:ne&&R(z.roughnessMap.channel),anisotropyMapUv:qe&&R(z.anisotropyMap.channel),clearcoatMapUv:yt&&R(z.clearcoatMap.channel),clearcoatNormalMapUv:At&&R(z.clearcoatNormalMap.channel),clearcoatRoughnessMapUv:it&&R(z.clearcoatRoughnessMap.channel),iridescenceMapUv:Oe&&R(z.iridescenceMap.channel),iridescenceThicknessMapUv:Ct&&R(z.iridescenceThicknessMap.channel),sheenColorMapUv:Ft&&R(z.sheenColorMap.channel),sheenRoughnessMapUv:ft&&R(z.sheenRoughnessMap.channel),specularMapUv:Zt&&R(z.specularMap.channel),specularColorMapUv:sn&&R(z.specularColorMap.channel),specularIntensityMapUv:cn&&R(z.specularIntensityMap.channel),transmissionMapUv:_e&&R(z.transmissionMap.channel),thicknessMapUv:Bt&&R(z.thicknessMap.channel),alphaMapUv:nt&&R(z.alphaMap.channel),vertexTangents:!!ae.attributes.tangent&&(Qe||V),vertexColors:z.vertexColors,vertexAlphas:z.vertexColors===!0&&!!ae.attributes.color&&ae.attributes.color.itemSize===4,pointsUvs:J.isPoints===!0&&!!ae.attributes.uv&&(vt||nt),fog:!!le,useFog:z.fog===!0,fogExp2:!!le&&le.isFogExp2,flatShading:z.flatShading===!0,sizeAttenuation:z.sizeAttenuation===!0,logarithmicDepthBuffer:v,reverseDepthBuffer:Re,skinning:J.isSkinnedMesh===!0,morphTargets:ae.morphAttributes.position!==void 0,morphNormals:ae.morphAttributes.normal!==void 0,morphColors:ae.morphAttributes.color!==void 0,morphTargetsCount:K,morphTextureStride:ce,numDirLights:k.directional.length,numPointLights:k.point.length,numSpotLights:k.spot.length,numSpotLightMaps:k.spotLightMap.length,numRectAreaLights:k.rectArea.length,numHemiLights:k.hemi.length,numDirLightShadows:k.directionalShadowMap.length,numPointLightShadows:k.pointShadowMap.length,numSpotLightShadows:k.spotShadowMap.length,numSpotLightShadowsWithMaps:k.numSpotLightShadowsWithMaps,numLightProbes:k.numLightProbes,numClippingPlanes:l.numPlanes,numClipIntersection:l.numIntersection,dithering:z.dithering,shadowMapEnabled:i.shadowMap.enabled&&ie.length>0,shadowMapType:i.shadowMap.type,toneMapping:kn,decodeVideoTexture:vt&&z.map.isVideoTexture===!0&&si.getTransfer(z.map.colorSpace)===Ri,decodeVideoTextureEmissive:pt&&z.emissiveMap.isVideoTexture===!0&&si.getTransfer(z.emissiveMap.colorSpace)===Ri,premultipliedAlpha:z.premultipliedAlpha,doubleSided:z.side===Gs,flipSided:z.side===$s,useDepthPacking:z.depthPacking>=0,depthPacking:z.depthPacking||0,index0AttributeName:z.index0AttributeName,extensionClipCullDistance:nn&&z.extensions.clipCullDistance===!0&&n.has("WEBGL_clip_cull_distance"),extensionMultiDraw:(nn&&z.extensions.multiDraw===!0||ct)&&n.has("WEBGL_multi_draw"),rendererExtensionParallelShaderCompile:n.has("KHR_parallel_shader_compile"),customProgramCacheKey:z.customProgramCacheKey()};return Dt.vertexUv1s=p.has(1),Dt.vertexUv2s=p.has(2),Dt.vertexUv3s=p.has(3),p.clear(),Dt}function E(z){const k=[];if(z.shaderID?k.push(z.shaderID):(k.push(z.customVertexShaderID),k.push(z.customFragmentShaderID)),z.defines!==void 0)for(const ie in z.defines)k.push(ie),k.push(z.defines[ie]);return z.isRawShaderMaterial===!1&&(D(k,z),L(k,z),k.push(i.outputColorSpace)),k.push(z.customProgramCacheKey),k.join()}function D(z,k){z.push(k.precision),z.push(k.outputColorSpace),z.push(k.envMapMode),z.push(k.envMapCubeUVHeight),z.push(k.mapUv),z.push(k.alphaMapUv),z.push(k.lightMapUv),z.push(k.aoMapUv),z.push(k.bumpMapUv),z.push(k.normalMapUv),z.push(k.displacementMapUv),z.push(k.emissiveMapUv),z.push(k.metalnessMapUv),z.push(k.roughnessMapUv),z.push(k.anisotropyMapUv),z.push(k.clearcoatMapUv),z.push(k.clearcoatNormalMapUv),z.push(k.clearcoatRoughnessMapUv),z.push(k.iridescenceMapUv),z.push(k.iridescenceThicknessMapUv),z.push(k.sheenColorMapUv),z.push(k.sheenRoughnessMapUv),z.push(k.specularMapUv),z.push(k.specularColorMapUv),z.push(k.specularIntensityMapUv),z.push(k.transmissionMapUv),z.push(k.thicknessMapUv),z.push(k.combine),z.push(k.fogExp2),z.push(k.sizeAttenuation),z.push(k.morphTargetsCount),z.push(k.morphAttributeCount),z.push(k.numDirLights),z.push(k.numPointLights),z.push(k.numSpotLights),z.push(k.numSpotLightMaps),z.push(k.numHemiLights),z.push(k.numRectAreaLights),z.push(k.numDirLightShadows),z.push(k.numPointLightShadows),z.push(k.numSpotLightShadows),z.push(k.numSpotLightShadowsWithMaps),z.push(k.numLightProbes),z.push(k.shadowMapType),z.push(k.toneMapping),z.push(k.numClippingPlanes),z.push(k.numClipIntersection),z.push(k.depthPacking)}function L(z,k){u.disableAll(),k.supportsVertexTextures&&u.enable(0),k.instancing&&u.enable(1),k.instancingColor&&u.enable(2),k.instancingMorph&&u.enable(3),k.matcap&&u.enable(4),k.envMap&&u.enable(5),k.normalMapObjectSpace&&u.enable(6),k.normalMapTangentSpace&&u.enable(7),k.clearcoat&&u.enable(8),k.iridescence&&u.enable(9),k.alphaTest&&u.enable(10),k.vertexColors&&u.enable(11),k.vertexAlphas&&u.enable(12),k.vertexUv1s&&u.enable(13),k.vertexUv2s&&u.enable(14),k.vertexUv3s&&u.enable(15),k.vertexTangents&&u.enable(16),k.anisotropy&&u.enable(17),k.alphaHash&&u.enable(18),k.batching&&u.enable(19),k.dispersion&&u.enable(20),k.batchingColor&&u.enable(21),z.push(u.mask),u.disableAll(),k.fog&&u.enable(0),k.useFog&&u.enable(1),k.flatShading&&u.enable(2),k.logarithmicDepthBuffer&&u.enable(3),k.reverseDepthBuffer&&u.enable(4),k.skinning&&u.enable(5),k.morphTargets&&u.enable(6),k.morphNormals&&u.enable(7),k.morphColors&&u.enable(8),k.premultipliedAlpha&&u.enable(9),k.shadowMapEnabled&&u.enable(10),k.doubleSided&&u.enable(11),k.flipSided&&u.enable(12),k.useDepthPacking&&u.enable(13),k.dithering&&u.enable(14),k.transmission&&u.enable(15),k.sheen&&u.enable(16),k.opaque&&u.enable(17),k.pointsUvs&&u.enable(18),k.decodeVideoTexture&&u.enable(19),k.decodeVideoTextureEmissive&&u.enable(20),k.alphaToCoverage&&u.enable(21),z.push(u.mask)}function P(z){const k=A[z.type];let ie;if(k){const ve=il[k];ie=aI.clone(ve.uniforms)}else ie=z.uniforms;return ie}function G(z,k){let ie;for(let ve=0,J=m.length;ve<J;ve++){const le=m[ve];if(le.cacheKey===k){ie=le,++ie.usedTimes;break}}return ie===void 0&&(ie=new YF(i,k,z,a),m.push(ie)),ie}function H(z){if(--z.usedTimes===0){const k=m.indexOf(z);m[k]=m[m.length-1],m.pop(),z.destroy()}}function F(z){h.remove(z)}function X(){h.dispose()}return{getParameters:w,getProgramCacheKey:E,getUniforms:P,acquireProgram:G,releaseProgram:H,releaseShaderCache:F,programs:m,dispose:X}}function $F(){let i=new WeakMap;function e(l){return i.has(l)}function t(l){let u=i.get(l);return u===void 0&&(u={},i.set(l,u)),u}function n(l){i.delete(l)}function s(l,u,h){i.get(l)[u]=h}function a(){i=new WeakMap}return{has:e,get:t,remove:n,update:s,dispose:a}}function e8(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.material.id!==e.material.id?i.material.id-e.material.id:i.z!==e.z?i.z-e.z:i.id-e.id}function Lw(i,e){return i.groupOrder!==e.groupOrder?i.groupOrder-e.groupOrder:i.renderOrder!==e.renderOrder?i.renderOrder-e.renderOrder:i.z!==e.z?e.z-i.z:i.id-e.id}function Pw(){const i=[];let e=0;const t=[],n=[],s=[];function a(){e=0,t.length=0,n.length=0,s.length=0}function l(v,x,_,A,R,w){let E=i[e];return E===void 0?(E={id:v.id,object:v,geometry:x,material:_,groupOrder:A,renderOrder:v.renderOrder,z:R,group:w},i[e]=E):(E.id=v.id,E.object=v,E.geometry=x,E.material=_,E.groupOrder=A,E.renderOrder=v.renderOrder,E.z=R,E.group=w),e++,E}function u(v,x,_,A,R,w){const E=l(v,x,_,A,R,w);_.transmission>0?n.push(E):_.transparent===!0?s.push(E):t.push(E)}function h(v,x,_,A,R,w){const E=l(v,x,_,A,R,w);_.transmission>0?n.unshift(E):_.transparent===!0?s.unshift(E):t.unshift(E)}function p(v,x){t.length>1&&t.sort(v||e8),n.length>1&&n.sort(x||Lw),s.length>1&&s.sort(x||Lw)}function m(){for(let v=e,x=i.length;v<x;v++){const _=i[v];if(_.id===null)break;_.id=null,_.object=null,_.geometry=null,_.material=null,_.group=null}}return{opaque:t,transmissive:n,transparent:s,init:a,push:u,unshift:h,finish:m,sort:p}}function t8(){let i=new WeakMap;function e(n,s){const a=i.get(n);let l;return a===void 0?(l=new Pw,i.set(n,[l])):s>=a.length?(l=new Pw,a.push(l)):l=a[s],l}function t(){i=new WeakMap}return{get:e,dispose:t}}function n8(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={direction:new se,color:new Pt};break;case"SpotLight":t={position:new se,direction:new se,color:new Pt,distance:0,coneCos:0,penumbraCos:0,decay:0};break;case"PointLight":t={position:new se,color:new Pt,distance:0,decay:0};break;case"HemisphereLight":t={direction:new se,skyColor:new Pt,groundColor:new Pt};break;case"RectAreaLight":t={color:new Pt,position:new se,halfWidth:new se,halfHeight:new se};break}return i[e.id]=t,t}}}function i8(){const i={};return{get:function(e){if(i[e.id]!==void 0)return i[e.id];let t;switch(e.type){case"DirectionalLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new st};break;case"SpotLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new st};break;case"PointLight":t={shadowIntensity:1,shadowBias:0,shadowNormalBias:0,shadowRadius:1,shadowMapSize:new st,shadowCameraNear:1,shadowCameraFar:1e3};break}return i[e.id]=t,t}}}let s8=0;function r8(i,e){return(e.castShadow?2:0)-(i.castShadow?2:0)+(e.map?1:0)-(i.map?1:0)}function a8(i){const e=new n8,t=i8(),n={version:0,hash:{directionalLength:-1,pointLength:-1,spotLength:-1,rectAreaLength:-1,hemiLength:-1,numDirectionalShadows:-1,numPointShadows:-1,numSpotShadows:-1,numSpotMaps:-1,numLightProbes:-1},ambient:[0,0,0],probe:[],directional:[],directionalShadow:[],directionalShadowMap:[],directionalShadowMatrix:[],spot:[],spotLightMap:[],spotShadow:[],spotShadowMap:[],spotLightMatrix:[],rectArea:[],rectAreaLTC1:null,rectAreaLTC2:null,point:[],pointShadow:[],pointShadowMap:[],pointShadowMatrix:[],hemi:[],numSpotLightShadowsWithMaps:0,numLightProbes:0};for(let p=0;p<9;p++)n.probe.push(new se);const s=new se,a=new dn,l=new dn;function u(p){let m=0,v=0,x=0;for(let z=0;z<9;z++)n.probe[z].set(0,0,0);let _=0,A=0,R=0,w=0,E=0,D=0,L=0,P=0,G=0,H=0,F=0;p.sort(r8);for(let z=0,k=p.length;z<k;z++){const ie=p[z],ve=ie.color,J=ie.intensity,le=ie.distance,ae=ie.shadow&&ie.shadow.map?ie.shadow.map.texture:null;if(ie.isAmbientLight)m+=ve.r*J,v+=ve.g*J,x+=ve.b*J;else if(ie.isLightProbe){for(let W=0;W<9;W++)n.probe[W].addScaledVector(ie.sh.coefficients[W],J);F++}else if(ie.isDirectionalLight){const W=e.get(ie);if(W.color.copy(ie.color).multiplyScalar(ie.intensity),ie.castShadow){const ee=ie.shadow,te=t.get(ie);te.shadowIntensity=ee.intensity,te.shadowBias=ee.bias,te.shadowNormalBias=ee.normalBias,te.shadowRadius=ee.radius,te.shadowMapSize=ee.mapSize,n.directionalShadow[_]=te,n.directionalShadowMap[_]=ae,n.directionalShadowMatrix[_]=ie.shadow.matrix,D++}n.directional[_]=W,_++}else if(ie.isSpotLight){const W=e.get(ie);W.position.setFromMatrixPosition(ie.matrixWorld),W.color.copy(ve).multiplyScalar(J),W.distance=le,W.coneCos=Math.cos(ie.angle),W.penumbraCos=Math.cos(ie.angle*(1-ie.penumbra)),W.decay=ie.decay,n.spot[R]=W;const ee=ie.shadow;if(ie.map&&(n.spotLightMap[G]=ie.map,G++,ee.updateMatrices(ie),ie.castShadow&&H++),n.spotLightMatrix[R]=ee.matrix,ie.castShadow){const te=t.get(ie);te.shadowIntensity=ee.intensity,te.shadowBias=ee.bias,te.shadowNormalBias=ee.normalBias,te.shadowRadius=ee.radius,te.shadowMapSize=ee.mapSize,n.spotShadow[R]=te,n.spotShadowMap[R]=ae,P++}R++}else if(ie.isRectAreaLight){const W=e.get(ie);W.color.copy(ve).multiplyScalar(J),W.halfWidth.set(ie.width*.5,0,0),W.halfHeight.set(0,ie.height*.5,0),n.rectArea[w]=W,w++}else if(ie.isPointLight){const W=e.get(ie);if(W.color.copy(ie.color).multiplyScalar(ie.intensity),W.distance=ie.distance,W.decay=ie.decay,ie.castShadow){const ee=ie.shadow,te=t.get(ie);te.shadowIntensity=ee.intensity,te.shadowBias=ee.bias,te.shadowNormalBias=ee.normalBias,te.shadowRadius=ee.radius,te.shadowMapSize=ee.mapSize,te.shadowCameraNear=ee.camera.near,te.shadowCameraFar=ee.camera.far,n.pointShadow[A]=te,n.pointShadowMap[A]=ae,n.pointShadowMatrix[A]=ie.shadow.matrix,L++}n.point[A]=W,A++}else if(ie.isHemisphereLight){const W=e.get(ie);W.skyColor.copy(ie.color).multiplyScalar(J),W.groundColor.copy(ie.groundColor).multiplyScalar(J),n.hemi[E]=W,E++}}w>0&&(i.has("OES_texture_float_linear")===!0?(n.rectAreaLTC1=kt.LTC_FLOAT_1,n.rectAreaLTC2=kt.LTC_FLOAT_2):(n.rectAreaLTC1=kt.LTC_HALF_1,n.rectAreaLTC2=kt.LTC_HALF_2)),n.ambient[0]=m,n.ambient[1]=v,n.ambient[2]=x;const X=n.hash;(X.directionalLength!==_||X.pointLength!==A||X.spotLength!==R||X.rectAreaLength!==w||X.hemiLength!==E||X.numDirectionalShadows!==D||X.numPointShadows!==L||X.numSpotShadows!==P||X.numSpotMaps!==G||X.numLightProbes!==F)&&(n.directional.length=_,n.spot.length=R,n.rectArea.length=w,n.point.length=A,n.hemi.length=E,n.directionalShadow.length=D,n.directionalShadowMap.length=D,n.pointShadow.length=L,n.pointShadowMap.length=L,n.spotShadow.length=P,n.spotShadowMap.length=P,n.directionalShadowMatrix.length=D,n.pointShadowMatrix.length=L,n.spotLightMatrix.length=P+G-H,n.spotLightMap.length=G,n.numSpotLightShadowsWithMaps=H,n.numLightProbes=F,X.directionalLength=_,X.pointLength=A,X.spotLength=R,X.rectAreaLength=w,X.hemiLength=E,X.numDirectionalShadows=D,X.numPointShadows=L,X.numSpotShadows=P,X.numSpotMaps=G,X.numLightProbes=F,n.version=s8++)}function h(p,m){let v=0,x=0,_=0,A=0,R=0;const w=m.matrixWorldInverse;for(let E=0,D=p.length;E<D;E++){const L=p[E];if(L.isDirectionalLight){const P=n.directional[v];P.direction.setFromMatrixPosition(L.matrixWorld),s.setFromMatrixPosition(L.target.matrixWorld),P.direction.sub(s),P.direction.transformDirection(w),v++}else if(L.isSpotLight){const P=n.spot[_];P.position.setFromMatrixPosition(L.matrixWorld),P.position.applyMatrix4(w),P.direction.setFromMatrixPosition(L.matrixWorld),s.setFromMatrixPosition(L.target.matrixWorld),P.direction.sub(s),P.direction.transformDirection(w),_++}else if(L.isRectAreaLight){const P=n.rectArea[A];P.position.setFromMatrixPosition(L.matrixWorld),P.position.applyMatrix4(w),l.identity(),a.copy(L.matrixWorld),a.premultiply(w),l.extractRotation(a),P.halfWidth.set(L.width*.5,0,0),P.halfHeight.set(0,L.height*.5,0),P.halfWidth.applyMatrix4(l),P.halfHeight.applyMatrix4(l),A++}else if(L.isPointLight){const P=n.point[x];P.position.setFromMatrixPosition(L.matrixWorld),P.position.applyMatrix4(w),x++}else if(L.isHemisphereLight){const P=n.hemi[R];P.direction.setFromMatrixPosition(L.matrixWorld),P.direction.transformDirection(w),R++}}}return{setup:u,setupView:h,state:n}}function Ow(i){const e=new a8(i),t=[],n=[];function s(m){p.camera=m,t.length=0,n.length=0}function a(m){t.push(m)}function l(m){n.push(m)}function u(){e.setup(t)}function h(m){e.setupView(t,m)}const p={lightsArray:t,shadowsArray:n,camera:null,lights:e,transmissionRenderTarget:{}};return{init:s,state:p,setupLights:u,setupLightsView:h,pushLight:a,pushShadow:l}}function o8(i){let e=new WeakMap;function t(s,a=0){const l=e.get(s);let u;return l===void 0?(u=new Ow(i),e.set(s,[u])):a>=l.length?(u=new Ow(i),l.push(u)):u=l[a],u}function n(){e=new WeakMap}return{get:t,dispose:n}}const l8=`void main() {
3849	gl_Position = vec4( position, 1.0 );
3850}`,c8=`uniform sampler2D shadow_pass;
3851uniform vec2 resolution;
3852uniform float radius;
3853#include <packing>
3854void main() {
3855	const float samples = float( VSM_SAMPLES );
3856	float mean = 0.0;
3857	float squared_mean = 0.0;
3858	float uvStride = samples <= 1.0 ? 0.0 : 2.0 / ( samples - 1.0 );
3859	float uvStart = samples <= 1.0 ? 0.0 : - 1.0;
3860	for ( float i = 0.0; i < samples; i ++ ) {
3861		float uvOffset = uvStart + i * uvStride;
3862		#ifdef HORIZONTAL_PASS
3863			vec2 distribution = unpackRGBATo2Half( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( uvOffset, 0.0 ) * radius ) / resolution ) );
3864			mean += distribution.x;
3865			squared_mean += distribution.y * distribution.y + distribution.x * distribution.x;
3866		#else
3867			float depth = unpackRGBAToDepth( texture2D( shadow_pass, ( gl_FragCoord.xy + vec2( 0.0, uvOffset ) * radius ) / resolution ) );
3868			mean += depth;
3869			squared_mean += depth * depth;
3870		#endif
3871	}
3872	mean = mean / samples;
3873	squared_mean = squared_mean / samples;
3874	float std_dev = sqrt( squared_mean - mean * mean );
3875	gl_FragColor = pack2HalfToRGBA( vec2( mean, std_dev ) );
3876}`;function u8(i,e,t){let n=new hg;const s=new st,a=new st,l=new oi,u=new ob({depthPacking:XB}),h=new ZA,p={},m=t.maxTextureSize,v={[cl]:$s,[$s]:cl,[Gs]:Gs},x=new Zi({defines:{VSM_SAMPLES:8},uniforms:{shadow_pass:{value:null},resolution:{value:new st},radius:{value:4}},vertexShader:l8,fragmentShader:c8}),_=x.clone();_.defines.HORIZONTAL_PASS=1;const A=new Mn;A.setAttribute("position",new ci(new Float32Array([-1,-1,.5,3,-1,.5,-1,3,.5]),3));const R=new hs(A,x),w=this;this.enabled=!1,this.autoUpdate=!0,this.needsUpdate=!1,this.type=C_;let E=this.type;this.render=function(H,F,X){if(w.enabled===!1||w.autoUpdate===!1&&w.needsUpdate===!1||H.length===0)return;const z=i.getRenderTarget(),k=i.getActiveCubeFace(),ie=i.getActiveMipmapLevel(),ve=i.state;ve.setBlending(Qr),ve.buffers.color.setClear(1,1,1,1),ve.buffers.depth.setTest(!0),ve.setScissorTest(!1);const J=E!==nl&&this.type===nl,le=E===nl&&this.type!==nl;for(let ae=0,W=H.length;ae<W;ae++){const ee=H[ae],te=ee.shadow;if(te===void 0){console.warn("THREE.WebGLShadowMap:",ee,"has no shadow.");continue}if(te.autoUpdate===!1&&te.needsUpdate===!1)continue;s.copy(te.mapSize);const ue=te.getFrameExtents();if(s.multiply(ue),a.copy(te.mapSize),(s.x>m||s.y>m)&&(s.x>m&&(a.x=Math.floor(m/ue.x),s.x=a.x*ue.x,te.mapSize.x=a.x),s.y>m&&(a.y=Math.floor(m/ue.y),s.y=a.y*ue.y,te.mapSize.y=a.y)),te.map===null||J===!0||le===!0){const K=this.type!==nl?{minFilter:Ls,magFilter:Ls}:{};te.map!==null&&te.map.dispose(),te.map=new Ms(s.x,s.y,K),te.map.texture.name=ee.name+".shadowMap",te.camera.updateProjectionMatrix()}i.setRenderTarget(te.map),i.clear();const he=te.getViewportCount();for(let K=0;K<he;K++){const ce=te.getViewport(K);l.set(a.x*ce.x,a.y*ce.y,a.x*ce.z,a.y*ce.w),ve.viewport(l),te.updateMatrices(ee,K),n=te.getFrustum(),P(F,X,te.camera,ee,this.type)}te.isPointLightShadow!==!0&&this.type===nl&&D(te,X),te.needsUpdate=!1}E=this.type,w.needsUpdate=!1,i.setRenderTarget(z,k,ie)};function D(H,F){const X=e.update(R);x.defines.VSM_SAMPLES!==H.blurSamples&&(x.defines.VSM_SAMPLES=H.blurSamples,_.defines.VSM_SAMPLES=H.blurSamples,x.needsUpdate=!0,_.needsUpdate=!0),H.mapPass===null&&(H.mapPass=new Ms(s.x,s.y)),x.uniforms.shadow_pass.value=H.map.texture,x.uniforms.resolution.value=H.mapSize,x.uniforms.radius.value=H.radius,i.setRenderTarget(H.mapPass),i.clear(),i.renderBufferDirect(F,null,X,x,R,null),_.uniforms.shadow_pass.value=H.mapPass.texture,_.uniforms.resolution.value=H.mapSize,_.uniforms.radius.value=H.radius,i.setRenderTarget(H.map),i.clear(),i.renderBufferDirect(F,null,X,_,R,null)}function L(H,F,X,z){let k=null;const ie=X.isPointLight===!0?H.customDistanceMaterial:H.customDepthMaterial;if(ie!==void 0)k=ie;else if(k=X.isPointLight===!0?h:u,i.localClippingEnabled&&F.clipShadows===!0&&Array.isArray(F.clippingPlanes)&&F.clippingPlanes.length!==0||F.displacementMap&&F.displacementScale!==0||F.alphaMap&&F.alphaTest>0||F.map&&F.alphaTest>0){const ve=k.uuid,J=F.uuid;let le=p[ve];le===void 0&&(le={},p[ve]=le);let ae=le[J];ae===void 0&&(ae=k.clone(),le[J]=ae,F.addEventListener("dispose",G)),k=ae}if(k.visible=F.visible,k.wireframe=F.wireframe,z===nl?k.side=F.shadowSide!==null?F.shadowSide:F.side:k.side=F.shadowSide!==null?F.shadowSide:v[F.side],k.alph
vendor: 4,775 bytes, line 3876
3876aMap=F.alphaMap,k.alphaTest=F.alphaTest,k.map=F.map,k.clipShadows=F.clipShadows,k.clippingPlanes=F.clippingPlanes,k.clipIntersection=F.clipIntersection,k.displacementMap=F.displacementMap,k.displacementScale=F.displacementScale,k.displacementBias=F.displacementBias,k.wireframeLinewidth=F.wireframeLinewidth,k.linewidth=F.linewidth,X.isPointLight===!0&&k.isMeshDistanceMaterial===!0){const ve=i.properties.get(k);ve.light=X}return k}function P(H,F,X,z,k){if(H.visible===!1)return;if(H.layers.test(F.layers)&&(H.isMesh||H.isLine||H.isPoints)&&(H.castShadow||H.receiveShadow&&k===nl)&&(!H.frustumCulled||n.intersectsObject(H))){H.modelViewMatrix.multiplyMatrices(X.matrixWorldInverse,H.matrixWorld);const J=e.update(H),le=H.material;if(Array.isArray(le)){const ae=J.groups;for(let W=0,ee=ae.length;W<ee;W++){const te=ae[W],ue=le[te.materialIndex];if(ue&&ue.visible){const he=L(H,ue,z,k);H.onBeforeShadow(i,H,F,X,J,he,te),i.renderBufferDirect(X,null,J,he,H,te),H.onAfterShadow(i,H,F,X,J,he,te)}}}else if(le.visible){const ae=L(H,le,z,k);H.onBeforeShadow(i,H,F,X,J,ae,null),i.renderBufferDirect(X,null,J,ae,H,null),H.onAfterShadow(i,H,F,X,J,ae,null)}}const ve=H.children;for(let J=0,le=ve.length;J<le;J++)P(ve[J],F,X,z,k)}function G(H){H.target.removeEventListener("dispose",G);for(const X in p){const z=p[X],k=H.target.uuid;k in z&&(z[k].dispose(),delete z[k])}}}const f8={[Bx]:G0,[Ix]:Px,[Dx]:Ox,[Md]:Lx,[G0]:Bx,[Px]:Ix,[Ox]:Dx,[Lx]:Md};function d8(i,e){function t(){let _e=!1;const Bt=new oi;let Ue=null;const nt=new oi(0,0,0,0);return{setMask:function(bt){Ue!==bt&&!_e&&(i.colorMask(bt,bt,bt,bt),Ue=bt)},setLocked:function(bt){_e=bt},setClear:function(bt,mt,nn,kn,Dt){Dt===!0&&(bt*=kn,mt*=kn,nn*=kn),Bt.set(bt,mt,nn,kn),nt.equals(Bt)===!1&&(i.clearColor(bt,mt,nn,kn),nt.copy(Bt))},reset:function(){_e=!1,Ue=null,nt.set(-1,0,0,0)}}}function n(){let _e=!1,Bt=!1,Ue=null,nt=null,bt=null;return{setReversed:function(mt){if(Bt!==mt){const nn=e.get("EXT_clip_control");mt?nn.clipControlEXT(nn.LOWER_LEFT_EXT,nn.ZERO_TO_ONE_EXT):nn.clipControlEXT(nn.LOWER_LEFT_EXT,nn.NEGATIVE_ONE_TO_ONE_EXT),Bt=mt;const kn=bt;bt=null,this.setClear(kn)}},getReversed:function(){return Bt},setTest:function(mt){mt?pe(i.DEPTH_TEST):Re(i.DEPTH_TEST)},setMask:function(mt){Ue!==mt&&!_e&&(i.depthMask(mt),Ue=mt)},setFunc:function(mt){if(Bt&&(mt=f8[mt]),nt!==mt){switch(mt){case Bx:i.depthFunc(i.NEVER);break;case G0:i.depthFunc(i.ALWAYS);break;case Ix:i.depthFunc(i.LESS);break;case Md:i.depthFunc(i.LEQUAL);break;case Dx:i.depthFunc(i.EQUAL);break;case Lx:i.depthFunc(i.GEQUAL);break;case Px:i.depthFunc(i.GREATER);break;case Ox:i.depthFunc(i.NOTEQUAL);break;default:i.depthFunc(i.LEQUAL)}nt=mt}},setLocked:function(mt){_e=mt},setClear:function(mt){bt!==mt&&(Bt&&(mt=1-mt),i.clearDepth(mt),bt=mt)},reset:function(){_e=!1,Ue=null,nt=null,bt=null,Bt=!1}}}function s(){let _e=!1,Bt=null,Ue=null,nt=null,bt=null,mt=null,nn=null,kn=null,Dt=null;return{setTest:function(Tt){_e||(Tt?pe(i.STENCIL_TEST):Re(i.STENCIL_TEST))},setMask:function(Tt){Bt!==Tt&&!_e&&(i.stencilMask(Tt),Bt=Tt)},setFunc:function(Tt,gn,En){(Ue!==Tt||nt!==gn||bt!==En)&&(i.stencilFunc(Tt,gn,En),Ue=Tt,nt=gn,bt=En)},setOp:function(Tt,gn,En){(mt!==Tt||nn!==gn||kn!==En)&&(i.stencilOp(Tt,gn,En),mt=Tt,nn=gn,kn=En)},setLocked:function(Tt){_e=Tt},setClear:function(Tt){Dt!==Tt&&(i.clearStencil(Tt),Dt=Tt)},reset:function(){_e=!1,Bt=null,Ue=null,nt=null,bt=null,mt=null,nn=null,kn=null,Dt=null}}}const a=new t,l=new n,u=new s,h=new WeakMap,p=new WeakMap;let m={},v={},x=new WeakMap,_=[],A=null,R=!1,w=null,E=null,D=null,L=null,P=null,G=null,H=null,F=new Pt(0,0,0),X=0,z=!1,k=null,ie=null,ve=null,J=null,le=null;const ae=i.getParameter(i.MAX_COMBINED_TEXTURE_IMAGE_UNITS);let W=!1,ee=0;const te=i.getParameter(i.VERSION);te.indexOf("WebGL")!==-1?(ee=parseFloat(/^WebGL (\d)/.exec(te)[1]),W=ee>=1):te.indexOf("OpenGL ES")!==-1&&(ee=parseFloat(/^OpenGL ES (\d)/.exec(te)[1]),W=ee>=2);let ue=null,he={};const K=i.getParameter(i.SCISSOR_BOX),ce=i.getParameter(i.VIEWPORT),re=new oi().fromArray(K),oe=new oi().fromArray(ce);function we(_e,Bt,Ue,nt){const bt=new Uint8Array(4),mt=i.createTexture();i.bindTexture(_e,mt),i.texParameteri(_e,i.TEXTURE_MIN_FILTER,i.NEAREST),i.texParameteri(_e,i.TEXTURE_MAG_FILTER,i.NEAREST);for(let nn=0;nn<Ue;nn++)_e===i.TEXTURE_3D||_e===i.TEXTURE_2D_ARRAY?i.texImage3D(Bt,0,i.RGBA,1,1,nt,0,i.RGBA,i.UNSIGNED_BYTE,bt):i.texImage2D(Bt+nn,0,i.RGBA,1,1,0,i.RGBA,i.UNSIGNED_BYTE,bt);return mt}const Be={};Be[i.TEXTURE_2D]=we(i.TEXTURE_2D,i.TEXTURE_2D,1),Be[i.TEXTURE_CUBE_MAP]=we(i.TEXTURE_CUBE_MAP,i.TEXTURE_CUBE_MAP_POSITIVE_X,6),Be[i.TEXTURE_2D_ARRAY]=we(i.TEXTURE_2D_ARRAY,i.TEXTURE_2D_ARRAY,1,1),Be[i.TEXTURE_3D]=we(i.TEXTURE_3D,i.TEXTURE_3D,1,1),a.setClear(0,0,0,1),l.setClear(1),u.setClear(0),pe(i.DEPTH_TEST),l.setFu
vendor: 5,904 bytes, line 3876
3876nc(Md),$e(!1),Qe(G1),pe(i.CULL_FACE),de(Qr);function pe(_e){m[_e]!==!0&&(i.enable(_e),m[_e]=!0)}function Re(_e){m[_e]!==!1&&(i.disable(_e),m[_e]=!1)}function lt(_e,Bt){return v[_e]!==Bt?(i.bindFramebuffer(_e,Bt),v[_e]=Bt,_e===i.DRAW_FRAMEBUFFER&&(v[i.FRAMEBUFFER]=Bt),_e===i.FRAMEBUFFER&&(v[i.DRAW_FRAMEBUFFER]=Bt),!0):!1}function ct(_e,Bt){let Ue=_,nt=!1;if(_e){Ue=x.get(Bt),Ue===void 0&&(Ue=[],x.set(Bt,Ue));const bt=_e.textures;if(Ue.length!==bt.length||Ue[0]!==i.COLOR_ATTACHMENT0){for(let mt=0,nn=bt.length;mt<nn;mt++)Ue[mt]=i.COLOR_ATTACHMENT0+mt;Ue.length=bt.length,nt=!0}}else Ue[0]!==i.BACK&&(Ue[0]=i.BACK,nt=!0);nt&&i.drawBuffers(Ue)}function vt(_e){return A!==_e?(i.useProgram(_e),A=_e,!0):!1}const qt={[Gu]:i.FUNC_ADD,[gB]:i.FUNC_SUBTRACT,[vB]:i.FUNC_REVERSE_SUBTRACT};qt[yB]=i.MIN,qt[xB]=i.MAX;const Wt={[_B]:i.ZERO,[bB]:i.ONE,[SB]:i.SRC_COLOR,[Cx]:i.SRC_ALPHA,[CB]:i.SRC_ALPHA_SATURATE,[TB]:i.DST_COLOR,[MB]:i.DST_ALPHA,[AB]:i.ONE_MINUS_SRC_COLOR,[Rx]:i.ONE_MINUS_SRC_ALPHA,[wB]:i.ONE_MINUS_DST_COLOR,[EB]:i.ONE_MINUS_DST_ALPHA,[RB]:i.CONSTANT_COLOR,[BB]:i.ONE_MINUS_CONSTANT_COLOR,[IB]:i.CONSTANT_ALPHA,[DB]:i.ONE_MINUS_CONSTANT_ALPHA};function de(_e,Bt,Ue,nt,bt,mt,nn,kn,Dt,Tt){if(_e===Qr){R===!0&&(Re(i.BLEND),R=!1);return}if(R===!1&&(pe(i.BLEND),R=!0),_e!==mB){if(_e!==w||Tt!==z){if((E!==Gu||P!==Gu)&&(i.blendEquation(i.FUNC_ADD),E=Gu,P=Gu),Tt)switch(_e){case gd:i.blendFuncSeparate(i.ONE,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case H0:i.blendFunc(i.ONE,i.ONE);break;case j1:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case V1:i.blendFuncSeparate(i.ZERO,i.SRC_COLOR,i.ZERO,i.SRC_ALPHA);break;default:console.error("THREE.WebGLState: Invalid blending: ",_e);break}else switch(_e){case gd:i.blendFuncSeparate(i.SRC_ALPHA,i.ONE_MINUS_SRC_ALPHA,i.ONE,i.ONE_MINUS_SRC_ALPHA);break;case H0:i.blendFunc(i.SRC_ALPHA,i.ONE);break;case j1:i.blendFuncSeparate(i.ZERO,i.ONE_MINUS_SRC_COLOR,i.ZERO,i.ONE);break;case V1:i.blendFunc(i.ZERO,i.SRC_COLOR);break;default:console.error("THREE.WebGLState: Invalid blending: ",_e);break}D=null,L=null,G=null,H=null,F.set(0,0,0),X=0,w=_e,z=Tt}return}bt=bt||Bt,mt=mt||Ue,nn=nn||nt,(Bt!==E||bt!==P)&&(i.blendEquationSeparate(qt[Bt],qt[bt]),E=Bt,P=bt),(Ue!==D||nt!==L||mt!==G||nn!==H)&&(i.blendFuncSeparate(Wt[Ue],Wt[nt],Wt[mt],Wt[nn]),D=Ue,L=nt,G=mt,H=nn),(kn.equals(F)===!1||Dt!==X)&&(i.blendColor(kn.r,kn.g,kn.b,Dt),F.copy(kn),X=Dt),w=_e,z=!1}function an(_e,Bt){_e.side===Gs?Re(i.CULL_FACE):pe(i.CULL_FACE);let Ue=_e.side===$s;Bt&&(Ue=!Ue),$e(Ue),_e.blending===gd&&_e.transparent===!1?de(Qr):de(_e.blending,_e.blendEquation,_e.blendSrc,_e.blendDst,_e.blendEquationAlpha,_e.blendSrcAlpha,_e.blendDstAlpha,_e.blendColor,_e.blendAlpha,_e.premultipliedAlpha),l.setFunc(_e.depthFunc),l.setTest(_e.depthTest),l.setMask(_e.depthWrite),a.setMask(_e.colorWrite);const nt=_e.stencilWrite;u.setTest(nt),nt&&(u.setMask(_e.stencilWriteMask),u.setFunc(_e.stencilFunc,_e.stencilRef,_e.stencilFuncMask),u.setOp(_e.stencilFail,_e.stencilZFail,_e.stencilZPass)),pt(_e.polygonOffset,_e.polygonOffsetFactor,_e.polygonOffsetUnits),_e.alphaToCoverage===!0?pe(i.SAMPLE_ALPHA_TO_COVERAGE):Re(i.SAMPLE_ALPHA_TO_COVERAGE)}function $e(_e){k!==_e&&(_e?i.frontFace(i.CW):i.frontFace(i.CCW),k=_e)}function Qe(_e){_e!==dB?(pe(i.CULL_FACE),_e!==ie&&(_e===G1?i.cullFace(i.BACK):_e===hB?i.cullFace(i.FRONT):i.cullFace(i.FRONT_AND_BACK))):Re(i.CULL_FACE),ie=_e}function Ye(_e){_e!==ve&&(W&&i.lineWidth(_e),ve=_e)}function pt(_e,Bt,Ue){_e?(pe(i.POLYGON_OFFSET_FILL),(J!==Bt||le!==Ue)&&(i.polygonOffset(Bt,Ue),J=Bt,le=Ue)):Re(i.POLYGON_OFFSET_FILL)}function Ve(_e){_e?pe(i.SCISSOR_TEST):Re(i.SCISSOR_TEST)}function ne(_e){_e===void 0&&(_e=i.TEXTURE0+ae-1),ue!==_e&&(i.activeTexture(_e),ue=_e)}function V(_e,Bt,Ue){Ue===void 0&&(ue===null?Ue=i.TEXTURE0+ae-1:Ue=ue);let nt=he[Ue];nt===void 0&&(nt={type:void 0,texture:void 0},he[Ue]=nt),(nt.type!==_e||nt.texture!==Bt)&&(ue!==Ue&&(i.activeTexture(Ue),ue=Ue),i.bindTexture(_e,Bt||Be[_e]),nt.type=_e,nt.texture=Bt)}function Se(){const _e=he[ue];_e!==void 0&&_e.type!==void 0&&(i.bindTexture(_e.type,null),_e.type=void 0,_e.texture=void 0)}function Ie(){try{i.compressedTexImage2D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function et(){try{i.compressedTexImage3D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function Fe(){try{i.texSubImage2D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function Rt(){try{i.texSubImage3D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function qe(){try{i.compressedTexSubImage2D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function yt(){try{i.compressedTexSubImage3D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function At(){try{i.texStorage2D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function it(){try{i.texStorage3D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function Oe(){try{i.texImage2D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function Ct(){try{i.texImage3D(...arguments)}catch(_e){console.error("THREE.WebGLState:",_e)}}function Ft(_e){re.equals(_e)===!1&&(i.scissor(_e.x,_e.y,_e.z,_e.w),re.copy(_e))}function ft(_e){oe.equals(_e)===!1&&(i.viewport(_e.x,_e.y,_e.z,_e.w),oe.copy(_e))}function Zt(_e,Bt){let Ue=p.get(Bt);Ue===void 0&&(Ue=new WeakMap,p.set(Bt,Ue));let nt=Ue.get(_e);nt===void 0&&(nt=i.getUniformBlockIndex(Bt,_e.name),Ue.set(_e,nt))}function sn(_e,Bt){const nt=p.get(Bt).get(_e);h.get(Bt)!==nt&&(i.uniformBlockBinding(Bt,nt,_e.__bindingPointIndex),h.set(Bt,nt))}function cn(){i.disable(i.BLEND),i.disable(i.CULL_FACE),i.disable(i.DEPTH_TEST),i.disable(i.POLYGON_OFFSET_FILL),i.disable(i.SCISSOR_TEST),i.disable(i.STENCIL_TEST),i.disable(i.SAMPLE_ALPHA_TO_COVERAGE),i.blendEquation(i.FUNC_ADD),i.blendFunc(i.ONE,i.ZERO),i.blendFuncSeparate(i.ONE,i.ZERO,i.ONE,i.ZERO),i.blendColor
vendor: 32,895 bytes, line 3876
3876(0,0,0,0),i.colorMask(!0,!0,!0,!0),i.clearColor(0,0,0,0),i.depthMask(!0),i.depthFunc(i.LESS),l.setReversed(!1),i.clearDepth(1),i.stencilMask(4294967295),i.stencilFunc(i.ALWAYS,0,4294967295),i.stencilOp(i.KEEP,i.KEEP,i.KEEP),i.clearStencil(0),i.cullFace(i.BACK),i.frontFace(i.CCW),i.polygonOffset(0,0),i.activeTexture(i.TEXTURE0),i.bindFramebuffer(i.FRAMEBUFFER,null),i.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),i.bindFramebuffer(i.READ_FRAMEBUFFER,null),i.useProgram(null),i.lineWidth(1),i.scissor(0,0,i.canvas.width,i.canvas.height),i.viewport(0,0,i.canvas.width,i.canvas.height),m={},ue=null,he={},v={},x=new WeakMap,_=[],A=null,R=!1,w=null,E=null,D=null,L=null,P=null,G=null,H=null,F=new Pt(0,0,0),X=0,z=!1,k=null,ie=null,ve=null,J=null,le=null,re.set(0,0,i.canvas.width,i.canvas.height),oe.set(0,0,i.canvas.width,i.canvas.height),a.reset(),l.reset(),u.reset()}return{buffers:{color:a,depth:l,stencil:u},enable:pe,disable:Re,bindFramebuffer:lt,drawBuffers:ct,useProgram:vt,setBlending:de,setMaterial:an,setFlipSided:$e,setCullFace:Qe,setLineWidth:Ye,setPolygonOffset:pt,setScissorTest:Ve,activeTexture:ne,bindTexture:V,unbindTexture:Se,compressedTexImage2D:Ie,compressedTexImage3D:et,texImage2D:Oe,texImage3D:Ct,updateUBOMapping:Zt,uniformBlockBinding:sn,texStorage2D:At,texStorage3D:it,texSubImage2D:Fe,texSubImage3D:Rt,compressedTexSubImage2D:qe,compressedTexSubImage3D:yt,scissor:Ft,viewport:ft,reset:cn}}function h8(i,e,t,n,s,a,l){const u=e.has("WEBGL_multisampled_render_to_texture")?e.get("WEBGL_multisampled_render_to_texture"):null,h=typeof navigator>"u"?!1:/OculusBrowser/g.test(navigator.userAgent),p=new st,m=new WeakMap;let v;const x=new WeakMap;let _=!1;try{_=typeof OffscreenCanvas<"u"&&new OffscreenCanvas(1,1).getContext("2d")!==null}catch{}function A(ne,V){return _?new OffscreenCanvas(ne,V):J0("canvas")}function R(ne,V,Se){let Ie=1;const et=Ve(ne);if((et.width>Se||et.height>Se)&&(Ie=Se/Math.max(et.width,et.height)),Ie<1)if(typeof HTMLImageElement<"u"&&ne instanceof HTMLImageElement||typeof HTMLCanvasElement<"u"&&ne instanceof HTMLCanvasElement||typeof ImageBitmap<"u"&&ne instanceof ImageBitmap||typeof VideoFrame<"u"&&ne instanceof VideoFrame){const Fe=Math.floor(Ie*et.width),Rt=Math.floor(Ie*et.height);v===void 0&&(v=A(Fe,Rt));const qe=V?A(Fe,Rt):v;return qe.width=Fe,qe.height=Rt,qe.getContext("2d").drawImage(ne,0,0,Fe,Rt),console.warn("THREE.WebGLRenderer: Texture has been resized from ("+et.width+"x"+et.height+") to ("+Fe+"x"+Rt+")."),qe}else return"data"in ne&&console.warn("THREE.WebGLRenderer: Image in DataTexture is too big ("+et.width+"x"+et.height+")."),ne;return ne}function w(ne){return ne.generateMipmaps}function E(ne){i.generateMipmap(ne)}function D(ne){return ne.isWebGLCubeRenderTarget?i.TEXTURE_CUBE_MAP:ne.isWebGL3DRenderTarget?i.TEXTURE_3D:ne.isWebGLArrayRenderTarget||ne.isCompressedArrayTexture?i.TEXTURE_2D_ARRAY:i.TEXTURE_2D}function L(ne,V,Se,Ie,et=!1){if(ne!==null){if(i[ne]!==void 0)return i[ne];console.warn("THREE.WebGLRenderer: Attempt to use non-existing WebGL internal format '"+ne+"'")}let Fe=V;if(V===i.RED&&(Se===i.FLOAT&&(Fe=i.R32F),Se===i.HALF_FLOAT&&(Fe=i.R16F),Se===i.UNSIGNED_BYTE&&(Fe=i.R8)),V===i.RED_INTEGER&&(Se===i.UNSIGNED_BYTE&&(Fe=i.R8UI),Se===i.UNSIGNED_SHORT&&(Fe=i.R16UI),Se===i.UNSIGNED_INT&&(Fe=i.R32UI),Se===i.BYTE&&(Fe=i.R8I),Se===i.SHORT&&(Fe=i.R16I),Se===i.INT&&(Fe=i.R32I)),V===i.RG&&(Se===i.FLOAT&&(Fe=i.RG32F),Se===i.HALF_FLOAT&&(Fe=i.RG16F),Se===i.UNSIGNED_BYTE&&(Fe=i.RG8)),V===i.RG_INTEGER&&(Se===i.UNSIGNED_BYTE&&(Fe=i.RG8UI),Se===i.UNSIGNED_SHORT&&(Fe=i.RG16UI),Se===i.UNSIGNED_INT&&(Fe=i.RG32UI),Se===i.BYTE&&(Fe=i.RG8I),Se===i.SHORT&&(Fe=i.RG16I),Se===i.INT&&(Fe=i.RG32I)),V===i.RGB_INTEGER&&(Se===i.UNSIGNED_BYTE&&(Fe=i.RGB8UI),Se===i.UNSIGNED_SHORT&&(Fe=i.RGB16UI),Se===i.UNSIGNED_INT&&(Fe=i.RGB32UI),Se===i.BYTE&&(Fe=i.RGB8I),Se===i.SHORT&&(Fe=i.RGB16I),Se===i.INT&&(Fe=i.RGB32I)),V===i.RGBA_INTEGER&&(Se===i.UNSIGNED_BYTE&&(Fe=i.RGBA8UI),Se===i.UNSIGNED_SHORT&&(Fe=i.RGBA16UI),Se===i.UNSIGNED_INT&&(Fe=i.RGBA32UI),Se===i.BYTE&&(Fe=i.RGBA8I),Se===i.SHORT&&(Fe=i.RGBA16I),Se===i.INT&&(Fe=i.RGBA32I)),V===i.RGB&&Se===i.UNSIGNED_INT_5_9_9_9_REV&&(Fe=i.RGB9_E5),V===i.RGBA){const Rt=et?X0:si.getTransfer(Ie);Se===i.FLOAT&&(Fe=i.RGBA32F),Se===i.HALF_FLOAT&&(Fe=i.RGBA16F),Se===i.UNSIGNED_BYTE&&(Fe=Rt===Ri?i.SRGB8_ALPHA8:i.RGBA8),Se===i.UNSIGNED_SHORT_4_4_4_4&&(Fe=i.RGBA4),Se===i.UNSIGNED_SHORT_5_5_5_1&&(Fe=i.RGB5_A1)}return(Fe===i.R16F||Fe===i.R32F||Fe===i.RG16F||Fe===i.RG32F||Fe===i.RGBA16F||Fe===i.RGBA32F)&&e.get("EXT_color_buffer_float"),Fe}function P(ne,V){let Se;return ne?V===null||V===kc||V===Ed?Se=i.DEPTH24_STENCIL8:V===Yr?Se=i.DEPTH32F_STENCIL8:V===Sp&&(Se=i.DEPTH24_STENCIL8,console.warn("DepthTexture: 16 bit depth attachment is not supported with stencil. Using 24-bit attachment.")):V===null||V===kc||V===Ed?Se=i.DEPTH_COMPONENT24:V===Yr?Se=i.DEPTH_COMPONENT32F:V===Sp&&(Se=i.DEPTH_COMPONENT16),Se}function G(ne,V){return w(ne)===!0||ne.isFramebufferTexture&&ne.minFilter!==Ls&&ne.minFilter!==as?Math.log2(Math.max(V.width,V.height))+1:ne.mipmaps!==void 0&&ne.mipmaps.length>0?ne.mipmaps.length:ne.isCompressedTexture&&Array.isArray(ne.image)?V.mipmaps.length:1}function H(ne){const V=ne.target;V.removeEventListener("dispose",H),X(V),V.isVideoTexture&&m.delete(V)}function F(ne){const V=ne.target;V.removeEventListener("dispose",F),k(V)}function X(ne){const V=n.get(ne);if(V.__webglInit===void 0)return;const Se=ne.source,Ie=x.get(Se);if(Ie){const et=Ie[V.__cacheKey];et.usedTimes--,et.usedTimes===0&&z(ne),Object.keys(Ie).length===0&&x.delete(Se)}n.remove(ne)}function z(ne){const V=n.get(ne);i.deleteTexture(V.__webglTexture);const Se=ne.source,Ie=x.get(Se);delete Ie[V.__cacheKey],l.memory.textures--}function k(ne){const V=n.get(ne);if(ne.depthTexture&&(ne.depthTexture.dispose(),n.remove(ne.depthTexture)),ne.isWebGLCubeRenderTarget)for(let Ie=0;Ie<6;Ie++){if(Array.isArray(V.__webglFramebuffer[Ie]))for(let et=0;et<V.__webglFramebuffer[Ie].length;et++)i.deleteFramebuffer(V.__webglFramebuffer[Ie][et]);else i.deleteFramebuffer(V.__webglFramebuffer[Ie]);V.__webglDepthbuffer&&i.deleteRenderbuffer(V.__webglDepthbuffer[Ie])}else{if(Array.isArray(V.__webglFramebuffer))for(let Ie=0;Ie<V.__webglFramebuffer.length;Ie++)i.deleteFramebuffer(V.__webglFramebuffer[Ie]);else i.deleteFramebuffer(V.__webglFramebuffer);if(V.__webglDepthbuffer&&i.deleteRenderbuffer(V.__webglDepthbuffer),V.__webglMultisampledFramebuffer&&i.deleteFramebuffer(V.__webglMultisampledFramebuffer),V.__webglColorRenderbuffer)for(let Ie=0;Ie<V.__webglColorRenderbuffer.length;Ie++)V.__webglColorRenderbuffer[Ie]&&i.deleteRenderbuffer(V.__webglColorRenderbuffer[Ie]);V.__webglDepthRenderbuffer&&i.deleteRenderbuffer(V.__webglDepthRenderbuffer)}const Se=ne.textures;for(let Ie=0,et=Se.length;Ie<et;Ie++){const Fe=n.get(Se[Ie]);Fe.__webglTexture&&(i.deleteTexture(Fe.__webglTexture),l.memory.textures--),n.remove(Se[Ie])}n.remove(ne)}let ie=0;function ve(){ie=0}function J(){const ne=ie;return ne>=s.maxTextures&&console.warn("THREE.WebGLTextures: Trying to use "+ne+" texture units while this GPU supports only "+s.maxTextures),ie+=1,ne}function le(ne){const V=[];return V.push(ne.wrapS),V.push(ne.wrapT),V.push(ne.wrapR||0),V.push(ne.magFilter),V.push(ne.minFilter),V.push(ne.anisotropy),V.push(ne.internalFormat),V.push(ne.format),V.push(ne.type),V.push(ne.generateMipmaps),V.push(ne.premultiplyAlpha),V.push(ne.flipY),V.push(ne.unpackAlignment),V.push(ne.colorSpace),V.join()}function ae(ne,V){const Se=n.get(ne);if(ne.isVideoTexture&&Ye(ne),ne.isRenderTargetTexture===!1&&ne.version>0&&Se.__version!==ne.version){const Ie=ne.image;if(Ie===null)console.warn("THREE.WebGLRenderer: Texture marked for update but no image data found.");else if(Ie.complete===!1)console.warn("THREE.WebGLRenderer: Texture marked for update but image is incomplete");else{oe(Se,ne,V);return}}t.bindTexture(i.TEXTURE_2D,Se.__webglTexture,i.TEXTURE0+V)}function W(ne,V){const Se=n.get(ne);if(ne.version>0&&Se.__version!==ne.version){oe(Se,ne,V);return}t.bindTexture(i.TEXTURE_2D_ARRAY,Se.__webglTexture,i.TEXTURE0+V)}function ee(ne,V){const Se=n.get(ne);if(ne.version>0&&Se.__version!==ne.version){oe(Se,ne,V);return}t.bindTexture(i.TEXTURE_3D,Se.__webglTexture,i.TEXTURE0+V)}function te(ne,V){const Se=n.get(ne);if(ne.version>0&&Se.__version!==ne.version){we(Se,ne,V);return}t.bindTexture(i.TEXTURE_CUBE_MAP,Se.__webglTexture,i.TEXTURE0+V)}const ue={[Zu]:i.REPEAT,[Ka]:i.CLAMP_TO_EDGE,[bp]:i.MIRRORED_REPEAT},he={[Ls]:i.NEAREST,[I_]:i.NEAREST_MIPMAP_NEAREST,[cd]:i.NEAREST_MIPMAP_LINEAR,[as]:i.LINEAR,[gp]:i.LINEAR_MIPMAP_NEAREST,[Do]:i.LINEAR_MIPMAP_LINEAR},K={[YB]:i.NEVER,[eI]:i.ALWAYS,[JB]:i.LESS,[OA]:i.LEQUAL,[KB]:i.EQUAL,[$B]:i.GEQUAL,[ZB]:i.GREATER,[QB]:i.NOTEQUAL};function ce(ne,V){if(V.type===Yr&&e.has("OES_texture_float_linear")===!1&&(V.magFilter===as||V.magFilter===gp||V.magFilter===cd||V.magFilter===Do||V.minFilter===as||V.minFilter===gp||V.minFilter===cd||V.minFilter===Do)&&console.warn("THREE.WebGLRenderer: Unable to use linear filtering with floating point textures. OES_texture_float_linear not supported on this device."),i.texParameteri(ne,i.TEXTURE_WRAP_S,ue[V.wrapS]),i.texParameteri(ne,i.TEXTURE_WRAP_T,ue[V.wrapT]),(ne===i.TEXTURE_3D||ne===i.TEXTURE_2D_ARRAY)&&i.texParameteri(ne,i.TEXTURE_WRAP_R,ue[V.wrapR]),i.texParameteri(ne,i.TEXTURE_MAG_FILTER,he[V.magFilter]),i.texParameteri(ne,i.TEXTURE_MIN_FILTER,he[V.minFilter]),V.compareFunction&&(i.texParameteri(ne,i.TEXTURE_COMPARE_MODE,i.COMPARE_REF_TO_TEXTURE),i.texParameteri(ne,i.TEXTURE_COMPARE_FUNC,K[V.compareFunction])),e.has("EXT_texture_filter_anisotropic")===!0){if(V.magFilter===Ls||V.minFilter!==cd&&V.minFilter!==Do||V.type===Yr&&e.has("OES_texture_float_linear")===!1)return;if(V.anisotropy>1||n.get(V).__currentAnisotropy){const Se=e.get("EXT_texture_filter_anisotropic");i.texParameterf(ne,Se.TEXTURE_MAX_ANISOTROPY_EXT,Math.min(V.anisotropy,s.getMaxAnisotropy())),n.get(V).__currentAnisotropy=V.anisotropy}}}function re(ne,V){let Se=!1;ne.__webglInit===void 0&&(ne.__webglInit=!0,V.addEventListener("dispose",H));const Ie=V.source;let et=x.get(Ie);et===void 0&&(et={},x.set(Ie,et));const Fe=le(V);if(Fe!==ne.__cacheKey){et[Fe]===void 0&&(et[Fe]={texture:i.createTexture(),usedTimes:0},l.memory.textures++,Se=!0),et[Fe].usedTimes++;const Rt=et[ne.__cacheKey];Rt!==void 0&&(et[ne.__cacheKey].usedTimes--,Rt.usedTimes===0&&z(V)),ne.__cacheKey=Fe,ne.__webglTexture=et[Fe].texture}return Se}function oe(ne,V,Se){let Ie=i.TEXTURE_2D;(V.isDataArrayTexture||V.isCompressedArrayTexture)&&(Ie=i.TEXTURE_2D_ARRAY),V.isData3DTexture&&(Ie=i.TEXTURE_3D);const et=re(ne,V),Fe=V.source;t.bindTexture(Ie,ne.__webglTexture,i.TEXTURE0+Se);const Rt=n.get(Fe);if(Fe.version!==Rt.__version||et===!0){t.activeTexture(i.TEXTURE0+Se);const qe=si.getPrimaries(si.workingColorSpace),yt=V.colorSpace===sl?null:si.getPrimaries(V.colorSpace),At=V.colorSpace===sl||qe===yt?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,V.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,V.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,At);let it=R(V.image,!1,s.maxTextureSize);it=pt(V,it);const Oe=a.convert(V.format,V.colorSpace),Ct=a.convert(V.type);let Ft=L(V.internalFormat,Oe,Ct,V.colorSpace,V.isVideoTexture);ce(Ie,V);let ft;const Zt=V.mipmaps,sn=V.isVideoTexture!==!0,cn=Rt.__version===void 0||et===!0,_e=Fe.dataReady,Bt=G(V,it);if(V.isDepthTexture)Ft=P(V.format===Td,V.type),cn&&(sn?t.texStorage2D(i.TEXTURE_2D,1,Ft,it.width,it.height):t.texImage2D(i.TEXTURE_2D,0,Ft,it.width,it.height,0,Oe,Ct,null));else if(V.isDataTexture)if(Zt.length>0){sn&&cn&&t.texStorage2D(i.TEXTURE_2D,Bt,Ft,Zt[0].width,Zt[0].height);for(let Ue=0,nt=Zt.length;Ue<nt;Ue++)ft=Zt[Ue],sn?_e&&t.texSubImage2D(i.TEXTURE_2D,Ue,0,0,ft.width,ft.height,Oe,Ct,ft.data):t.texImage2D(i.TEXTURE_2D,Ue,Ft,ft.width,ft.height,0,Oe,Ct,ft.data);V.generateMipmaps=!1}else sn?(cn&&t.texStorage2D(i.TEXTURE_2D,Bt,Ft,it.width,it.height),_e&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,it.width,it.height,Oe,Ct,it.data)):t.texImage2D(i.TEXTURE_2D,0,Ft,it.width,it.height,0,Oe,Ct,it.data);else if(V.isCompressedTexture)if(V.isCompressedArrayTexture){sn&&cn&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Bt,Ft,Zt[0].width,Zt[0].height,it.depth);for(let Ue=0,nt=Zt.length;Ue<nt;Ue++)if(ft=Zt[Ue],V.format!==Jr)if(Oe!==null)if(sn){if(_e)if(V.layerUpdates.size>0){const bt=$1(ft.width,ft.height,V.format,V.type);for(const mt of V.layerUpdates){const nn=ft.data.subarray(mt*bt/ft.data.BYTES_PER_ELEMENT,(mt+1)*bt/ft.data.BYTES_PER_ELEMENT);t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Ue,0,0,mt,ft.width,ft.height,1,Oe,nn)}V.clearLayerUpdates()}else t.compressedTexSubImage3D(i.TEXTURE_2D_ARRAY,Ue,0,0,0,ft.width,ft.height,it.depth,Oe,ft.data)}else t.compressedTexImage3D(i.TEXTURE_2D_ARRAY,Ue,Ft,ft.width,ft.height,it.depth,0,ft.data,0,0);else console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()");else sn?_e&&t.texSubImage3D(i.TEXTURE_2D_ARRAY,Ue,0,0,0,ft.width,ft.height,it.depth,Oe,Ct,ft.data):t.texImage3D(i.TEXTURE_2D_ARRAY,Ue,Ft,ft.width,ft.height,it.depth,0,Oe,Ct,ft.data)}else{sn&&cn&&t.texStorage2D(i.TEXTURE_2D,Bt,Ft,Zt[0].width,Zt[0].height);for(let Ue=0,nt=Zt.length;Ue<nt;Ue++)ft=Zt[Ue],V.format!==Jr?Oe!==null?sn?_e&&t.compressedTexSubImage2D(i.TEXTURE_2D,Ue,0,0,ft.width,ft.height,Oe,ft.data):t.compressedTexImage2D(i.TEXTURE_2D,Ue,Ft,ft.width,ft.height,0,ft.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .uploadTexture()"):sn?_e&&t.texSubImage2D(i.TEXTURE_2D,Ue,0,0,ft.width,ft.height,Oe,Ct,ft.data):t.texImage2D(i.TEXTURE_2D,Ue,Ft,ft.width,ft.height,0,Oe,Ct,ft.data)}else if(V.isDataArrayTexture)if(sn){if(cn&&t.texStorage3D(i.TEXTURE_2D_ARRAY,Bt,Ft,it.width,it.height,it.depth),_e)if(V.layerUpdates.size>0){const Ue=$1(it.width,it.height,V.format,V.type);for(const nt of V.layerUpdates){const bt=it.data.subarray(nt*Ue/it.data.BYTES_PER_ELEMENT,(nt+1)*Ue/it.data.BYTES_PER_ELEMENT);t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,nt,it.width,it.height,1,Oe,Ct,bt)}V.clearLayerUpdates()}else t.texSubImage3D(i.TEXTURE_2D_ARRAY,0,0,0,0,it.width,it.height,it.depth,Oe,Ct,it.data)}else t.texImage3D(i.TEXTURE_2D_ARRAY,0,Ft,it.width,it.height,it.depth,0,Oe,Ct,it.data);else if(V.isData3DTexture)sn?(cn&&t.texStorage3D(i.TEXTURE_3D,Bt,Ft,it.width,it.height,it.depth),_e&&t.texSubImage3D(i.TEXTURE_3D,0,0,0,0,it.width,it.height,it.depth,Oe,Ct,it.data)):t.texImage3D(i.TEXTURE_3D,0,Ft,it.width,it.height,it.depth,0,Oe,Ct,it.data);else if(V.isFramebufferTexture){if(cn)if(sn)t.texStorage2D(i.TEXTURE_2D,Bt,Ft,it.width,it.height);else{let Ue=it.width,nt=it.height;for(let bt=0;bt<Bt;bt++)t.texImage2D(i.TEXTURE_2D,bt,Ft,Ue,nt,0,Oe,Ct,null),Ue>>=1,nt>>=1}}else if(Zt.length>0){if(sn&&cn){const Ue=Ve(Zt[0]);t.texStorage2D(i.TEXTURE_2D,Bt,Ft,Ue.width,Ue.height)}for(let Ue=0,nt=Zt.length;Ue<nt;Ue++)ft=Zt[Ue],sn?_e&&t.texSubImage2D(i.TEXTURE_2D,Ue,0,0,Oe,Ct,ft):t.texImage2D(i.TEXTURE_2D,Ue,Ft,Oe,Ct,ft);V.generateMipmaps=!1}else if(sn){if(cn){const Ue=Ve(it);t.texStorage2D(i.TEXTURE_2D,Bt,Ft,Ue.width,Ue.height)}_e&&t.texSubImage2D(i.TEXTURE_2D,0,0,0,Oe,Ct,it)}else t.texImage2D(i.TEXTURE_2D,0,Ft,Oe,Ct,it);w(V)&&E(Ie),Rt.__version=Fe.version,V.onUpdate&&V.onUpdate(V)}ne.__version=V.version}function we(ne,V,Se){if(V.image.length!==6)return;const Ie=re(ne,V),et=V.source;t.bindTexture(i.TEXTURE_CUBE_MAP,ne.__webglTexture,i.TEXTURE0+Se);const Fe=n.get(et);if(et.version!==Fe.__version||Ie===!0){t.activeTexture(i.TEXTURE0+Se);const Rt=si.getPrimaries(si.workingColorSpace),qe=V.colorSpace===sl?null:si.getPrimaries(V.colorSpace),yt=V.colorSpace===sl||Rt===qe?i.NONE:i.BROWSER_DEFAULT_WEBGL;i.pixelStorei(i.UNPACK_FLIP_Y_WEBGL,V.flipY),i.pixelStorei(i.UNPACK_PREMULTIPLY_ALPHA_WEBGL,V.premultiplyAlpha),i.pixelStorei(i.UNPACK_ALIGNMENT,V.unpackAlignment),i.pixelStorei(i.UNPACK_COLORSPACE_CONVERSION_WEBGL,yt);const At=V.isCompressedTexture||V.image[0].isCompressedTexture,it=V.image[0]&&V.image[0].isDataTexture,Oe=[];for(let nt=0;nt<6;nt++)!At&&!it?Oe[nt]=R(V.image[nt],!0,s.maxCubemapSize):Oe[nt]=it?V.image[nt].image:V.image[nt],Oe[nt]=pt(V,Oe[nt]);const Ct=Oe[0],Ft=a.convert(V.format,V.colorSpace),ft=a.convert(V.type),Zt=L(V.internalFormat,Ft,ft,V.colorSpace),sn=V.isVideoTexture!==!0,cn=Fe.__version===void 0||Ie===!0,_e=et.dataReady;let Bt=G(V,Ct);ce(i.TEXTURE_CUBE_MAP,V);let Ue;if(At){sn&&cn&&t.texStorage2D(i.TEXTURE_CUBE_MAP,Bt,Zt,Ct.width,Ct.height);for(let nt=0;nt<6;nt++){Ue=Oe[nt].mipmaps;for(let bt=0;bt<Ue.length;bt++){const mt=Ue[bt];V.format!==Jr?Ft!==null?sn?_e&&t.compressedTexSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt,0,0,mt.width,mt.height,Ft,mt.data):t.compressedTexImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt,Zt,mt.width,mt.height,0,mt.data):console.warn("THREE.WebGLRenderer: Attempt to load unsupported compressed texture format in .setTextureCube()"):sn?_e&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt,0,0,mt.width,mt.height,Ft,ft,mt.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt,Zt,mt.width,mt.height,0,Ft,ft,mt.data)}}}else{if(Ue=V.mipmaps,sn&&cn){Ue.length>0&&Bt++;const nt=Ve(Oe[0]);t.texStorage2D(i.TEXTURE_CUBE_MAP,Bt,Zt,nt.width,nt.height)}for(let nt=0;nt<6;nt++)if(it){sn?_e&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,0,0,Oe[nt].width,Oe[nt].height,Ft,ft,Oe[nt].data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,Zt,Oe[nt].width,Oe[nt].height,0,Ft,ft,Oe[nt].data);for(let bt=0;bt<Ue.length;bt++){const nn=Ue[bt].image[nt].image;sn?_e&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt+1,0,0,nn.width,nn.height,Ft,ft,nn.data):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt+1,Zt,nn.width,nn.height,0,Ft,ft,nn.data)}}else{sn?_e&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,0,0,Ft,ft,Oe[nt]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,Zt,Ft,ft,Oe[nt]);for(let bt=0;bt<Ue.length;bt++){const mt=Ue[bt];sn?_e&&t.texSubImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt+1,0,0,Ft,ft,mt.image[nt]):t.texImage2D(i.TEXTURE_CUBE_MAP_POSITIVE_X+nt,bt+1,Zt,Ft,ft,mt.image[nt])}}}w(V)&&E(i.TEXTURE_CUBE_MAP),Fe.__version=et.version,V.onUpdate&&V.onUpdate(V)}ne.__version=V.version}function Be(ne,V,Se,Ie,et,Fe){const Rt=a.convert(Se.format,Se.colorSpace),qe=a.convert(Se.type),yt=L(Se.internalFormat,Rt,qe,Se.colorSpace),At=n.get(V),it=n.get(Se);if(it.__renderTarget=V,!At.__hasExternalTextures){const Oe=Math.max(1,V.width>>Fe),Ct=Math.max(1,V.height>>Fe);et===i.TEXTURE_3D||et===i.TEXTURE_2D_ARRAY?t.texImage3D(et,Fe,yt,Oe,Ct,V.depth,0,Rt,qe,null):t.texImage2D(et,Fe,yt,Oe,Ct,0,Rt,qe,null)}t.bindFramebuffer(i.FRAMEBUFFER,ne),Qe(V)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,Ie,et,it.__webglTexture,0,$e(V)):(et===i.TEXTURE_2D||et>=i.TEXTURE_CUBE_MAP_POSITIVE_X&&et<=i.TEXTURE_CUBE_MAP_NEGATIVE_Z)&&i.framebufferTexture2D(i.FRAMEBUFFER,Ie,et,it.__webglTexture,Fe),t.bindFramebuffer(i.FRAMEBUFFER,null)}function pe(ne,V,Se){if(i.bindRenderbuffer(i.RENDERBUFFER,ne),V.depthBuffer){const Ie=V.depthTexture,et=Ie&&Ie.isDepthTexture?Ie.type:null,Fe=P(V.stencilBuffer,et),Rt=V.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,qe=$e(V);Qe(V)?u.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,qe,Fe,V.width,V.height):Se?i.renderbufferStorageMultisample(i.RENDERBUFFER,qe,Fe,V.width,V.height):i.renderbufferStorage(i.RENDERBUFFER,Fe,V.width,V.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,Rt,i.RENDERBUFFER,ne)}else{const Ie=V.textures;for(let et=0;et<Ie.length;et++){const Fe=Ie[et],Rt=a.convert(Fe.format,Fe.colorSpace),qe=a.convert(Fe.type),yt=L(Fe.internalFormat,Rt,qe,Fe.colorSpace),At=$e(V);Se&&Qe(V)===!1?i.renderbufferStorageMultisample(i.RENDERBUFFER,At,yt,V.width,V.height):Qe(V)?u.renderbufferStorageMultisampleEXT(i.RENDERBUFFER,At,yt,V.width,V.height):i.renderbufferStorage(i.RENDERBUFFER,yt,V.width,V.height)}}i.bindRenderbuffer(i.RENDERBUFFER,null)}function Re(ne,V){if(V&&V.isWebGLCubeRenderTarget)throw new Error("Depth Texture with cube render targets is not supported");if(t.bindFramebuffer(i.FRAMEBUFFER,ne),!(V.depthTexture&&V.depthTexture.isDepthTexture))throw new Error("renderTarget.depthTexture must be an instance of THREE.DepthTexture");const Ie=n.get(V.depthTexture);Ie.__renderTarget=V,(!Ie.__webglTexture||V.depthTexture.image.width!==V.width||V.depthTexture.image.height!==V.height)&&(V.depthTexture.image.width=V.width,V.depthTexture.image.height=V.height,V.depthTexture.needsUpdate=!0),ae(V.depthTexture,0);const et=Ie.__webglTexture,Fe=$e(V);if(V.depthTexture.format===Ap)Qe(V)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,et,0,Fe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_ATTACHMENT,i.TEXTURE_2D,et,0);else if(V.depthTexture.format===Td)Qe(V)?u.framebufferTexture2DMultisampleEXT(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,et,0,Fe):i.framebufferTexture2D(i.FRAMEBUFFER,i.DEPTH_STENCIL_ATTACHMENT,i.TEXTURE_2D,et,0);else throw new Error("Unknown depthTexture format")}function lt(ne){const V=n.get(ne),Se=ne.isWebGLCubeRenderTarget===!0;if(V.__boundDepthTexture!==ne.depthTexture){const Ie=ne.depthTexture;if(V.__depthDisposeCallback&&V.__depthDisposeCallback(),Ie){const et=()=>{delete V.__boundDepthTexture,delete V.__depthDisposeCallback,Ie.removeEventListener("dispose",et)};Ie.addEventListener("dispose",et),V.__depthDisposeCallback=et}V.__boundDepthTexture=Ie}if(ne.depthTexture&&!V.__autoAllocateDepthBuffer){if(Se)throw new Error("target.depthTexture not supported in Cube render targets");Re(V.__webglFramebuffer,ne)}else if(Se){V.__webglDepthbuffer=[];for(let Ie=0;Ie<6;Ie++)if(t.bindFramebuffer(i.FRAMEBUFFER,V.__webglFramebuffer[Ie]),V.__webglDepthbuffer[Ie]===void 0)V.__webglDepthbuffer[Ie]=i.createRenderbuffer(),pe(V.__webglDepthbuffer[Ie],ne,!1);else{const et=ne.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Fe=V.__webglDepthbuffer[Ie];i.bindRenderbuffer(i.RENDERBUFFER,Fe),i.framebufferRenderbuffer(i.FRAMEBUFFER,et,i.RENDERBUFFER,Fe)}}else if(t.bindFramebuffer(i.FRAMEBUFFER,V.__webglFramebuffer),V.__webglDepthbuffer===void 0)V.__webglDepthbuffer=i.createRenderbuffer(),pe(V.__webglDepthbuffer,ne,!1);else{const Ie=ne.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,et=V.__webglDepthbuffer;i.bindRenderbuffer(i.RENDERBUFFER,et),i.framebufferRenderbuffer(i.FRAMEBUFFER,Ie,i.RENDERBUFFER,et)}t.bindFramebuffer(i.FRAMEBUFFER,null)}function ct(ne,V,Se){const Ie=n.get(ne);V!==void 0&&Be(Ie.__webglFramebuffer,ne,ne.texture,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,0),Se!==void 0&&lt(ne)}function vt(ne){const V=ne.texture,Se=n.get(ne),Ie=n.get(V);ne.addEventListener("dispose",F);const et=ne.textures,Fe=ne.isWebGLCubeRenderTarget===!0,Rt=et.length>1;if(Rt||(Ie.__webglTexture===void 0&&(Ie.__webglTexture=i.createTexture()),Ie.__version=V.version,l.memory.textures++),Fe){Se.__webglFramebuffer=[];for(let qe=0;qe<6;qe++)if(V.mipmaps&&V.mipmaps.length>0){Se.__webglFramebuffer[qe]=[];for(let yt=0;yt<V.mipmaps.length;yt++)Se.__webglFramebuffer[qe][yt]=i.createFramebuffer()}else Se.__webglFramebuffer[qe]=i.createFramebuffer()}else{if(V.mipmaps&&V.mipmaps.length>0){Se.__webglFramebuffer=[];for(let qe=0;qe<V.mipmaps.length;qe++)Se.__webglFramebuffer[qe]=i.createFramebuffer()}else Se.__webglFramebuffer=i.createFramebuffer();if(Rt)for(let qe=0,yt=et.length;qe<yt;qe++){const At=n.get(et[qe]);At.__webglTexture===void 0&&(At.__webglTexture=i.createTexture(),l.memory.textures++)}if(ne.samples>0&&Qe(ne)===!1){Se.__webglMultisampledFramebuffer=i.createFramebuffer(),Se.__webglColorRenderbuffer=[],t.bindFramebuffer(i.FRAMEBUFFER,Se.__webglMultisampledFramebuffer);for(let qe=0;qe<et.length;qe++){const yt=et[qe];Se.__webglColorRenderbuffer[qe]=i.createRenderbuffer(),i.bindRenderbuffer(i.RENDERBUFFER,Se.__webglColorRenderbuffer[qe]);const At=a.convert(yt.format,yt.colorSpace),it=a.convert(yt.type),Oe=L(yt.internalFormat,At,it,yt.colorSpace,ne.isXRRenderTarget===!0),Ct=$e(ne);i.renderbufferStorageMultisample(i.RENDERBUFFER,Ct,Oe,ne.width,ne.height),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+qe,i.RENDERBUFFER,Se.__webglColorRenderbuffer[qe])}i.bindRenderbuffer(i.RENDERBUFFER,null),ne.depthBuffer&&(Se.__webglDepthRenderbuffer=i.createRenderbuffer(),pe(Se.__webglDepthRenderbuffer,ne,!0)),t.bindFramebuffer(i.FRAMEBUFFER,null)}}if(Fe){t.bindTexture(i.TEXTURE_CUBE_MAP,Ie.__webglTexture),ce(i.TEXTURE_CUBE_MAP,V);for(let qe=0;qe<6;qe++)if(V.mipmaps&&V.mipmaps.length>0)for(let yt=0;yt<V.mipmaps.length;yt++)Be(Se.__webglFramebuffer[qe][yt],ne,V,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+qe,yt);else Be(Se.__webglFramebuffer[qe],ne,V,i.COLOR_ATTACHMENT0,i.TEXTURE_CUBE_MAP_POSITIVE_X+qe,0);w(V)&&E(i.TEXTURE_CUBE_MAP),t.unbindTexture()}else if(Rt){for(let qe=0,yt=et.length;qe<yt;qe++){const At=et[qe],it=n.get(At);t.bindTexture(i.TEXTURE_2D,it.__webglTexture),ce(i.TEXTURE_2D,At),Be(Se.__webglFramebuffer,ne,At,i.COLOR_ATTACHMENT0+qe,i.TEXTURE_2D,0),w(At)&&E(i.TEXTURE_2D)}t.unbindTexture()}else{let qe=i.TEXTURE_2D;if((ne.isWebGL3DRenderTarget||ne.isWebGLArrayRenderTarget)&&(qe=ne.isWebGL3DRenderTarget?i.TEXTURE_3D:i.TEXTURE_2D_ARRAY),t.bindTexture(qe,Ie.__webglTexture),ce(qe,V),V.mipmaps&&V.mipmaps.length>0)for(let yt=0;yt<V.mipmaps.length;yt++)Be(Se.__webglFramebuffer[yt],ne,V,i.COLOR_ATTACHMENT0,qe,yt);else Be(Se.__webglFramebuffer,ne,V,i.COLOR_ATTACHMENT0,qe,0);w(V)&&E(qe),t.unbindTexture()}ne.depthBuffer&&lt(ne)}function qt(ne){const V=ne.textures;for(let Se=0,Ie=V.length;Se<Ie;Se++){const et=V[Se];if(w(et)){const Fe=D(ne),Rt=n.get(et).__webglTexture;t.bindTexture(Fe,Rt),E(Fe),t.unbindTexture()}}}const Wt=[],de=[];function an(ne){if(ne.samples>0){if(Qe(ne)===!1){const V=ne.textures,Se=ne.width,Ie=ne.height;let et=i.COLOR_BUFFER_BIT;const Fe=ne.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT,Rt=n.get(ne),qe=V.length>1;if(qe)for(let yt=0;yt<V.length;yt++)t.bindFramebuffer(i.FRAMEBUFFER,Rt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+yt,i.RENDERBUFFER,null),t.bindFramebuffer(i.FRAMEBUFFER,Rt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+yt,i.TEXTURE_2D,null,0);t.bindFramebuffer(i.READ_FRAMEBUFFER,Rt.__webglMultisampledFramebuffer),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Rt.__webglFramebuffer);for(let yt=0;yt<V.length;yt++){if(ne.resolveDepthBuffer&&(ne.depthBuffer&&(et|=i.DEPTH_BUFFER_BIT),ne.stencilBuffer&&ne.resolveStencilBuffer&&(et|=i.STENCIL_BUFFER_BIT)),qe){i.framebufferRenderbuffer(i.READ_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.RENDERBUFFER,Rt.__webglColorRenderbuffer[yt]);const At=n.get(V[yt]).__webglTexture;i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0,i.TEXTURE_2D,At,0)}i.blitFramebuffer(0,0,Se,Ie,0,0,Se,Ie,et,i.NEAREST),h===!0&&(Wt.length=0,de.length=0,Wt.push(i.COLOR_ATTACHMENT0+yt),ne.depthBuffer&&ne.resolveDepthBuffer===!1&&(Wt.push(Fe),de.push(Fe),i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,de)),i.invalidateFramebuffer(i.READ_FRAMEBUFFER,Wt))}if(t.bindFramebuffer(i.READ_FRAMEBUFFER,null),t.bindFramebuffer(i.DRAW_FRAMEBUFFER,null),qe)for(let yt=0;yt<V.length;yt++){t.bindFramebuffer(i.FRAMEBUFFER,Rt.__webglMultisampledFramebuffer),i.framebufferRenderbuffer(i.FRAMEBUFFER,i.COLOR_ATTACHMENT0+yt,i.RENDERBUFFER,Rt.__webglColorRenderbuffer[yt]);const At=n.get(V[yt]).__webglTexture;t.bindFramebuffer(i.FRAMEBUFFER,Rt.__webglFramebuffer),i.framebufferTexture2D(i.DRAW_FRAMEBUFFER,i.COLOR_ATTACHMENT0+yt,i.TEXTURE_2D,At,0)}t.bindFramebuffer(i.DRAW_FRAMEBUFFER,Rt.__webglMultisampledFramebuffer)}else if(ne.depthBuffer&&ne.resolveDepthBuffer===!1&&h){const V=ne.stencilBuffer?i.DEPTH_STENCIL_ATTACHMENT:i.DEPTH_ATTACHMENT;i.invalidateFramebuffer(i.DRAW_FRAMEBUFFER,[V])}}}function $e(ne){return Math.min(s.maxSamples,ne.samples)}function Qe(ne){const V=n.get(ne);return ne.samples>0&&e.has("WEBGL_multisampled_render_to_texture")===!0&&V.__useRenderToTexture!==!1}function Ye(ne){const V=l.render.frame;m.get(ne)!==V&&(m.set(ne,V),ne.update())}function pt(ne,V){const Se=ne.colorSpace,Ie=ne.format,et=ne.type;return ne.isCompressedTexture===!0||ne.isVideoTexture===!0||Se!==Wl&&Se!==sl&&(si.getTransfer(Se)===Ri?(Ie!==Jr||et!==vr)&&console.warn("THREE.WebGLTextures: sRGB encoded textures have to use RGBAFormat and UnsignedByteType."):console.error("THREE.WebGLTextures: Unsupported texture color space:",Se)),V}function Ve(ne){return typeof HTMLImageElement<"u"&&ne instanceof HTMLImageElement?(p.width=ne.naturalWidth||ne.width,p.height=ne.naturalHeight||ne.height):typeof VideoFrame<"u"&&ne instanceof VideoFrame?(p.width=ne.displayWidth,p.height=ne.displayHeight):(p.width=ne.width,p.height=ne.height),p}this.allocateTextureUnit=J,this.resetTextureUnits=ve,this.setTexture2D=ae,this.setTexture2DArray=W,this.setTexture3D=ee,this.setTextureCube=te,this.rebindTextures=ct,this.setupRenderTarget=vt,this.updateRenderTargetMipmap=qt,this.updateMultisampleRenderTarget=an,this.setupDepthRenderbuffer=lt,this.setupFrameBufferTexture=Be,this.useMultisampledRTT=Qe}function r3(i,e){function t(n,s=sl){let a;const l=si.getTransfer(s);if(n===vr)return i.UNSIGNED_BYTE;if(n===L_)return i.UNSIGNED_SHORT_4_4_4_4;if(n===P_)return i.UNSIGNED_SHORT_5_5_5_1;if(n===TA)return i.UNSIGNED_INT_5_9_9_9_REV;if(n===MA)return i.BYTE;if(n===EA)return i.SHORT;if(n===Sp)return i.UNSIGNED_SHORT;if(n===D_)return i.INT;if(n===kc)return i.UNSIGNED_INT;if(n===Yr)return i.FLOAT;if(n===Pd)return i.HALF_FLOAT;if(n===wA)return i.ALPHA;if(n===CA)return i.RGB;if(n===Jr)return i.RGBA;if(n===RA)return i.LUMINANCE;if(n===BA)return i.LUMINANCE_ALPHA;if(n===Ap)return i.DEPTH_COMPONENT;if(n===Td)return i.DEPTH_STENCIL;if(n===O_)return i.RED;if(n===lg)return i.RED_INTEGER;if(n===IA)return i.RG;if(n===N_)return i.RG_INTEGER;if(n===U_)return i.RGBA_INTEGER;if(n===B0||n===I0||n===D0||n===L0)if(l===Ri)if(a=e.get("WEBGL_compressed_texture_s3tc_srgb"),a!==null){if(n===B0)return a.COMPRESSED_SRGB_S3TC_DXT1_EXT;if(n===I0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT;if(n===D0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT;if(n===L0)return a.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT}else return null;else if(a=e.get("WEBGL_compressed_texture_s3tc"),a!==null){if(n===B0)return a.COMPRESSED_RGB_S3TC_DXT1_EXT;if(n===I0)return a.COMPRESSED_RGBA_S3TC_DXT1_EXT;if(n===D0)return a.COMPRESSED_RGBA_S3TC_DXT3_EXT;if(n===L0)return a.COMPRESSED_RGBA_S3TC_DXT5_EXT}else return null;if(n===Nx||n===Ux||n===zx||n===Fx)if(a=e.get("WEBGL_compressed_texture_pvrtc"),a!==null){if(n===Nx)return a.COMPRESSED_RGB_PVRTC_4BPPV1_IMG;if(n===Ux)return a.COMPRESSED_RGB_PVRTC_2BPPV1_IMG;if(n===zx)return a.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG;if(n===Fx)return a.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG}else return null;if(n===kx||n===Hx||n===Gx)if(a=e.get("WEBGL_compressed_texture_etc"),a!==null){if(n===kx||n===Hx)return l===Ri?a.COMPRESSED_SRGB8_ETC2:a.COMPRESSED_RGB8_ETC2;if(n===Gx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC:a.COMPRESSED_RGBA8_ETC2_EAC}else return null;if(n===jx||n===Vx||n===Wx||n===Xx||n===qx||n===Yx||n===Jx||n===Kx||n===Zx||n===Qx||n===$x||n===e_||n===t_||n===n_)if(a=e.get("WEBGL_compressed_texture_astc"),a!==null){if(n===jx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR:a.COMPRESSED_RGBA_ASTC_4x4_KHR;if(n===Vx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR:a.COMPRESSED_RGBA_ASTC_5x4_KHR;if(n===Wx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR:a.COMPRESSED_RGBA_ASTC_5x5_KHR;if(n===Xx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR:a.COMPRESSED_RGBA_ASTC_6x5_KHR;if(n===qx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR:a.COMPRESSED_RGBA_ASTC_6x6_KHR;if(n===Yx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR:a.COMPRESSED_RGBA_ASTC_8x5_KHR;if(n===Jx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR:a.COMPRESSED_RGBA_ASTC_8x6_KHR;if(n===Kx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR:a.COMPRESSED_RGBA_ASTC_8x8_KHR;if(n===Zx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR:a.COMPRESSED_RGBA_ASTC_10x5_KHR;if(n===Qx)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR:a.COMPRESSED_RGBA_ASTC_10x6_KHR;if(n===$x)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR:a.COMPRESSED_RGBA_ASTC_10x8_KHR;if(n===e_)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR:a.COMPRESSED_RGBA_ASTC_10x10_KHR;if(n===t_)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR:a.COMPRESSED_RGBA_ASTC_12x10_KHR;if(n===n_)return l===Ri?a.COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR:a.COMPRESSED_RGBA_ASTC_12x12_KHR}else return null;if(n===P0||n===i_||n===s_)if(a=e.get("EXT_texture_compression_bptc"),a!==null){if(n===P0)return l===Ri?a.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT:a.COMPRESSED_RGBA_BPTC_UNORM_EXT;if(n===i_)return a.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT;if(n===s_)return a.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT}else return null;if(n===DA||n===r_||n===a_||n===o_)if(a=e.get("EXT_texture_compression_rgtc"),a!==null){if(n===P0)return a.COMPRESSED_RED_RGT
vendor: 4,250 bytes, lines 3876-3900
3876C1_EXT;if(n===r_)return a.COMPRESSED_SIGNED_RED_RGTC1_EXT;if(n===a_)return a.COMPRESSED_RED_GREEN_RGTC2_EXT;if(n===o_)return a.COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT}else return null;return n===Ed?i.UNSIGNED_INT_24_8:i[n]!==void 0?i[n]:null}return{convert:t}}const p8=`
3877void main() {
3878
3879	gl_Position = vec4( position, 1.0 );
3880
3881}`,m8=`
3882uniform sampler2DArray depthColor;
3883uniform float depthWidth;
3884uniform float depthHeight;
3885
3886void main() {
3887
3888	vec2 coord = vec2( gl_FragCoord.x / depthWidth, gl_FragCoord.y / depthHeight );
3889
3890	if ( coord.x >= 1.0 ) {
3891
3892		gl_FragDepth = texture( depthColor, vec3( coord.x - 1.0, coord.y, 1 ) ).r;
3893
3894	} else {
3895
3896		gl_FragDepth = texture( depthColor, vec3( coord.x, coord.y, 0 ) ).r;
3897
3898	}
3899
3900}`;class g8{constructor(){this.texture=null,this.mesh=null,this.depthNear=0,this.depthFar=0}init(e,t,n){if(this.texture===null){const s=new Ki,a=e.properties.get(s);a.__webglTexture=t.texture,(t.depthNear!==n.depthNear||t.depthFar!==n.depthFar)&&(this.depthNear=t.depthNear,this.depthFar=t.depthFar),this.texture=s}}getMesh(e){if(this.texture!==null&&this.mesh===null){const t=e.cameras[0].viewport,n=new Zi({vertexShader:p8,fragmentShader:m8,uniforms:{depthColor:{value:this.texture},depthWidth:{value:t.z},depthHeight:{value:t.w}}});this.mesh=new hs(new Nd(20,20),n)}return this.mesh}reset(){this.texture=null,this.mesh=null}getDepthTexture(){return this.texture}}class v8 extends eo{constructor(e,t){super();const n=this;let s=null,a=1,l=null,u="local-floor",h=1,p=null,m=null,v=null,x=null,_=null,A=null;const R=new g8,w=t.getContextAttributes();let E=null,D=null;const L=[],P=[],G=new st;let H=null;const F=new Ds;F.viewport=new oi;const X=new Ds;X.viewport=new oi;const z=[F,X],k=new qI;let ie=null,ve=null;this.cameraAutoUpdate=!0,this.enabled=!1,this.isPresenting=!1,this.getController=function(oe){let we=L[oe];return we===void 0&&(we=new bx,L[oe]=we),we.getTargetRaySpace()},this.getControllerGrip=function(oe){let we=L[oe];return we===void 0&&(we=new bx,L[oe]=we),we.getGripSpace()},this.getHand=function(oe){let we=L[oe];return we===void 0&&(we=new bx,L[oe]=we),we.getHandSpace()};function J(oe){const we=P.indexOf(oe.inputSource);if(we===-1)return;const Be=L[we];Be!==void 0&&(Be.update(oe.inputSource,oe.frame,p||l),Be.dispatchEvent({type:oe.type,data:oe.inputSource}))}function le(){s.removeEventListener("select",J),s.removeEventListener("selectstart",J),s.removeEventListener("selectend",J),s.removeEventListener("squeeze",J),s.removeEventListener("squeezestart",J),s.removeEventListener("squeezeend",J),s.removeEventListener("end",le),s.removeEventListener("inputsourceschange",ae);for(let oe=0;oe<L.length;oe++){const we=P[oe];we!==null&&(P[oe]=null,L[oe].disconnect(we))}ie=null,ve=null,R.reset(),e.setRenderTarget(E),_=null,x=null,v=null,s=null,D=null,re.stop(),n.isPresenting=!1,e.setPixelRatio(H),e.setSize(G.width,G.height,!1),n.dispatchEvent({type:"sessionend"})}this.setFramebufferScaleFactor=function(oe){a=oe,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change framebuffer scale while presenting.")},this.setReferenceSpaceType=function(oe){u=oe,n.isPresenting===!0&&console.warn("THREE.WebXRManager: Cannot change reference space type while presenting.")},this.getReferenceSpace=function(){return p||l},this.setReferenceSpace=function(oe){p=oe},this.getBaseLayer=function(){return x!==null?x:_},this.getBinding=function(){return v},this.getFrame=function(){return A},this.getSession=function(){return s},this.setSession=async function(oe){if(s=oe,s!==null){if(E=e.getRenderTarget(),s.addEventListener("select",J),s.addEventListener("selectstart",J),s.addEventListener("selectend",J),s.addEventListener("squeeze",J),s.addEventListener("squeezestart",J),s.addEventListener("squeezeend",J),s.addEventListener("end",le),s.addEventListener("inputsourceschange",ae),w.xrCompatible!==!0&&await t.makeXRCompatible(),H=e.getPixelRatio(),e.getSize(G),typeof XRWebGLBinding<"u"&&"createProjectionLayer"in XRWebGLBinding.prototype){let Be=null,pe=null,Re=null;w.depth&&(Re=w.stencil?t.DEPTH24_STENCIL8:t.DEPTH_COMPONENT24,Be=w.stencil?Td:Ap,pe=w.stencil?Ed:kc);const lt={colorFormat:t.RGBA8,depthFormat:Re,scaleFactor:a};v=new XRWebGLBinding(s,t),x=v.createProjectionLayer(lt),s.updateRenderState({layers:[x]}
vendor: 1,261 bytes, line 3900
3900),e.setPixelRatio(1),e.setSize(x.textureWidth,x.textureHeight,!1),D=new Ms(x.textureWidth,x.textureHeight,{format:Jr,type:vr,depthTexture:new q_(x.textureWidth,x.textureHeight,pe,void 0,void 0,void 0,void 0,void 0,void 0,Be),stencilBuffer:w.stencil,colorSpace:e.outputColorSpace,samples:w.antialias?4:0,resolveDepthBuffer:x.ignoreDepthValues===!1,resolveStencilBuffer:x.ignoreDepthValues===!1})}else{const Be={antialias:w.antialias,alpha:!0,depth:w.depth,stencil:w.stencil,framebufferScaleFactor:a};_=new XRWebGLLayer(s,t,Be),s.updateRenderState({baseLayer:_}),e.setPixelRatio(1),e.setSize(_.framebufferWidth,_.framebufferHeight,!1),D=new Ms(_.framebufferWidth,_.framebufferHeight,{format:Jr,type:vr,colorSpace:e.outputColorSpace,stencilBuffer:w.stencil,resolveDepthBuffer:_.ignoreDepthValues===!1,resolveStencilBuffer:_.ignoreDepthValues===!1})}D.isXRRenderTarget=!0,this.setFoveation(h),p=null,l=await s.requestReferenceSpace(u),re.setContext(s),re.start(),n.isPresenting=!0,n.dispatchEvent({type:"sessionstart"})}},this.getEnvironmentBlendMode=function(){if(s!==null)return s.environmentBlendMode},this.getDepthTexture=function(){return R.getDepthTexture()};function ae(oe){for(let we=0;we<oe.removed.length;we++){const Be=oe.removed[we],pe=P.indexOf(Be);pe>
vendor: 4,269 bytes, line 3900
3900=0&&(P[pe]=null,L[pe].disconnect(Be))}for(let we=0;we<oe.added.length;we++){const Be=oe.added[we];let pe=P.indexOf(Be);if(pe===-1){for(let lt=0;lt<L.length;lt++)if(lt>=P.length){P.push(Be),pe=lt;break}else if(P[lt]===null){P[lt]=Be,pe=lt;break}if(pe===-1)break}const Re=L[pe];Re&&Re.connect(Be)}}const W=new se,ee=new se;function te(oe,we,Be){W.setFromMatrixPosition(we.matrixWorld),ee.setFromMatrixPosition(Be.matrixWorld);const pe=W.distanceTo(ee),Re=we.projectionMatrix.elements,lt=Be.projectionMatrix.elements,ct=Re[14]/(Re[10]-1),vt=Re[14]/(Re[10]+1),qt=(Re[9]+1)/Re[5],Wt=(Re[9]-1)/Re[5],de=(Re[8]-1)/Re[0],an=(lt[8]+1)/lt[0],$e=ct*de,Qe=ct*an,Ye=pe/(-de+an),pt=Ye*-de;if(we.matrixWorld.decompose(oe.position,oe.quaternion,oe.scale),oe.translateX(pt),oe.translateZ(Ye),oe.matrixWorld.compose(oe.position,oe.quaternion,oe.scale),oe.matrixWorldInverse.copy(oe.matrixWorld).invert(),Re[10]===-1)oe.projectionMatrix.copy(we.projectionMatrix),oe.projectionMatrixInverse.copy(we.projectionMatrixInverse);else{const Ve=ct+Ye,ne=vt+Ye,V=$e-pt,Se=Qe+(pe-pt),Ie=qt*vt/ne*Ve,et=Wt*vt/ne*Ve;oe.projectionMatrix.makePerspective(V,Se,Ie,et,Ve,ne),oe.projectionMatrixInverse.copy(oe.projectionMatrix).invert()}}function ue(oe,we){we===null?oe.matrixWorld.copy(oe.matrix):oe.matrixWorld.multiplyMatrices(we.matrixWorld,oe.matrix),oe.matrixWorldInverse.copy(oe.matrixWorld).invert()}this.updateCamera=function(oe){if(s===null)return;let we=oe.near,Be=oe.far;R.texture!==null&&(R.depthNear>0&&(we=R.depthNear),R.depthFar>0&&(Be=R.depthFar)),k.near=X.near=F.near=we,k.far=X.far=F.far=Be,(ie!==k.near||ve!==k.far)&&(s.updateRenderState({depthNear:k.near,depthFar:k.far}),ie=k.near,ve=k.far),F.layers.mask=oe.layers.mask|2,X.layers.mask=oe.layers.mask|4,k.layers.mask=F.layers.mask|X.layers.mask;const pe=oe.parent,Re=k.cameras;ue(k,pe);for(let lt=0;lt<Re.length;lt++)ue(Re[lt],pe);Re.length===2?te(k,F,X):k.projectionMatrix.copy(F.projectionMatrix),he(oe,k,pe)};function he(oe,we,Be){Be===null?oe.matrix.copy(we.matrixWorld):(oe.matrix.copy(Be.matrixWorld),oe.matrix.invert(),oe.matrix.multiply(we.matrixWorld)),oe.matrix.decompose(oe.position,oe.quaternion,oe.scale),oe.updateMatrixWorld(!0),oe.projectionMatrix.copy(we.projectionMatrix),oe.projectionMatrixInverse.copy(we.projectionMatrixInverse),oe.isPerspectiveCamera&&(oe.fov=Tp*2*Math.atan(1/oe.projectionMatrix.elements[5]),oe.zoom=1)}this.getCamera=function(){return k},this.getFoveation=function(){if(!(x===null&&_===null))return h},this.setFoveation=function(oe){h=oe,x!==null&&(x.fixedFoveation=oe),_!==null&&_.fixedFoveation!==void 0&&(_.fixedFoveation=oe)},this.hasDepthSensing=function(){return R.texture!==null},this.getDepthSensingMesh=function(){return R.getMesh(k)};let K=null;function ce(oe,we){if(m=we.getViewerPose(p||l),A=we,m!==null){const Be=m.views;_!==null&&(e.setRenderTargetFramebuffer(D,_.framebuffer),e.setRenderTarget(D));let pe=!1;Be.length!==k.cameras.length&&(k.cameras.length=0,pe=!0);for(let ct=0;ct<Be.length;ct++){const vt=Be[ct];let qt=null;if(_!==null)qt=_.getViewport(vt);else{const de=v.getViewSubImage(x,vt);qt=de.viewport,ct===0&&(e.setRenderTargetTextures(D,de.colorTexture,de.depthStencilTexture),e.setRenderTarget(D))}let Wt=z[ct];Wt===void 0&&(Wt=new Ds,Wt.layers.enable(ct),Wt.viewport=new oi,z[ct]=Wt),Wt.matrix.fromArray(vt.transform.matrix),Wt.matrix.decompose(Wt.position,Wt.quaternion,Wt.scale),Wt.projectionMatrix.fromArray(vt.projectionMatrix),Wt.projectionMatrixInverse.copy(Wt.projectionMatrix).invert(),Wt.viewport.set(qt.x,qt.y,qt.width,qt.height),ct===0&&(k.matrix.copy(Wt.matrix),k.matrix.decompose(k.position,k.quaternion,k.scale)),pe===!0&&k.cameras.push(Wt)}const Re=s.enabledFeatures;if(Re&&Re.includes("depth-sensing")&&s.depthUsage=="gpu-optimized"&&v){const ct=v.getDepthInformation(Be[0]);ct&&ct.isValid&&ct.texture&&R.init(e,ct,s.renderState)}}for(let Be=0;Be<L.length;Be++){const pe=P[Be],Re=L[Be];pe!==null&&Re!==void 0&&Re.update(pe,we,p||l)}K&&K(oe,we),we.detectedPlanes&&n.dispatchEvent({type:"planesdetected",data:we}),A=null}const re=new e3;re.setAnimationLoop(ce),this.setAnimationLoop=function(oe){K=oe},this.dispose=function(){}}}const id=new Qa,y8=new dn;function x8(i,e){function t(w,E){w.matrixAutoUpdate===!0&&w.updateMatrix(),E.value.copy(w.matrix
vendor: 10,364 bytes, line 3900
3900)}function n(w,E){E.color.getRGB(w.fogColor.value,rI(i)),E.isFog?(w.fogNear.value=E.near,w.fogFar.value=E.far):E.isFogExp2&&(w.fogDensity.value=E.density)}function s(w,E,D,L,P){E.isMeshBasicMaterial||E.isMeshLambertMaterial?a(w,E):E.isMeshToonMaterial?(a(w,E),v(w,E)):E.isMeshPhongMaterial?(a(w,E),m(w,E)):E.isMeshStandardMaterial?(a(w,E),x(w,E),E.isMeshPhysicalMaterial&&_(w,E,P)):E.isMeshMatcapMaterial?(a(w,E),A(w,E)):E.isMeshDepthMaterial?a(w,E):E.isMeshDistanceMaterial?(a(w,E),R(w,E)):E.isMeshNormalMaterial?a(w,E):E.isLineBasicMaterial?(l(w,E),E.isLineDashedMaterial&&u(w,E)):E.isPointsMaterial?h(w,E,D,L):E.isSpriteMaterial?p(w,E):E.isShadowMaterial?(w.color.value.copy(E.color),w.opacity.value=E.opacity):E.isShaderMaterial&&(E.uniformsNeedUpdate=!1)}function a(w,E){w.opacity.value=E.opacity,E.color&&w.diffuse.value.copy(E.color),E.emissive&&w.emissive.value.copy(E.emissive).multiplyScalar(E.emissiveIntensity),E.map&&(w.map.value=E.map,t(E.map,w.mapTransform)),E.alphaMap&&(w.alphaMap.value=E.alphaMap,t(E.alphaMap,w.alphaMapTransform)),E.bumpMap&&(w.bumpMap.value=E.bumpMap,t(E.bumpMap,w.bumpMapTransform),w.bumpScale.value=E.bumpScale,E.side===$s&&(w.bumpScale.value*=-1)),E.normalMap&&(w.normalMap.value=E.normalMap,t(E.normalMap,w.normalMapTransform),w.normalScale.value.copy(E.normalScale),E.side===$s&&w.normalScale.value.negate()),E.displacementMap&&(w.displacementMap.value=E.displacementMap,t(E.displacementMap,w.displacementMapTransform),w.displacementScale.value=E.displacementScale,w.displacementBias.value=E.displacementBias),E.emissiveMap&&(w.emissiveMap.value=E.emissiveMap,t(E.emissiveMap,w.emissiveMapTransform)),E.specularMap&&(w.specularMap.value=E.specularMap,t(E.specularMap,w.specularMapTransform)),E.alphaTest>0&&(w.alphaTest.value=E.alphaTest);const D=e.get(E),L=D.envMap,P=D.envMapRotation;L&&(w.envMap.value=L,id.copy(P),id.x*=-1,id.y*=-1,id.z*=-1,L.isCubeTexture&&L.isRenderTargetTexture===!1&&(id.y*=-1,id.z*=-1),w.envMapRotation.value.setFromMatrix4(y8.makeRotationFromEuler(id)),w.flipEnvMap.value=L.isCubeTexture&&L.isRenderTargetTexture===!1?-1:1,w.reflectivity.value=E.reflectivity,w.ior.value=E.ior,w.refractionRatio.value=E.refractionRatio),E.lightMap&&(w.lightMap.value=E.lightMap,w.lightMapIntensity.value=E.lightMapIntensity,t(E.lightMap,w.lightMapTransform)),E.aoMap&&(w.aoMap.value=E.aoMap,w.aoMapIntensity.value=E.aoMapIntensity,t(E.aoMap,w.aoMapTransform))}function l(w,E){w.diffuse.value.copy(E.color),w.opacity.value=E.opacity,E.map&&(w.map.value=E.map,t(E.map,w.mapTransform))}function u(w,E){w.dashSize.value=E.dashSize,w.totalSize.value=E.dashSize+E.gapSize,w.scale.value=E.scale}function h(w,E,D,L){w.diffuse.value.copy(E.color),w.opacity.value=E.opacity,w.size.value=E.size*D,w.scale.value=L*.5,E.map&&(w.map.value=E.map,t(E.map,w.uvTransform)),E.alphaMap&&(w.alphaMap.value=E.alphaMap,t(E.alphaMap,w.alphaMapTransform)),E.alphaTest>0&&(w.alphaTest.value=E.alphaTest)}function p(w,E){w.diffuse.value.copy(E.color),w.opacity.value=E.opacity,w.rotation.value=E.rotation,E.map&&(w.map.value=E.map,t(E.map,w.mapTransform)),E.alphaMap&&(w.alphaMap.value=E.alphaMap,t(E.alphaMap,w.alphaMapTransform)),E.alphaTest>0&&(w.alphaTest.value=E.alphaTest)}function m(w,E){w.specular.value.copy(E.specular),w.shininess.value=Math.max(E.shininess,1e-4)}function v(w,E){E.gradientMap&&(w.gradientMap.value=E.gradientMap)}function x(w,E){w.metalness.value=E.metalness,E.metalnessMap&&(w.metalnessMap.value=E.metalnessMap,t(E.metalnessMap,w.metalnessMapTransform)),w.roughness.value=E.roughness,E.roughnessMap&&(w.roughnessMap.value=E.roughnessMap,t(E.roughnessMap,w.roughnessMapTransform)),E.envMap&&(w.envMapIntensity.value=E.envMapIntensity)}function _(w,E,D){w.ior.value=E.ior,E.sheen>0&&(w.sheenColor.value.copy(E.sheenColor).multiplyScalar(E.sheen),w.sheenRoughness.value=E.sheenRoughness,E.sheenColorMap&&(w.sheenColorMap.value=E.sheenColorMap,t(E.sheenColorMap,w.sheenColorMapTransform)),E.sheenRoughnessMap&&(w.sheenRoughnessMap.value=E.sheenRoughnessMap,t(E.sheenRoughnessMap,w.sheenRoughnessMapTransform))),E.clearcoat>0&&(w.clearcoat.value=E.clearcoat,w.clearcoatRoughness.value=E.clearcoatRoughness,E.clearcoatMap&&(w.clearcoatMap.value=E.clearcoatMap,t(E.clearcoatMap,w.clearcoatMapTransform)),E.clearcoatRoughnessMap&&(w.clearcoatRoughnessMap.value=E.clearcoatRoughnessMap,t(E.clearcoatRoughnessMap,w.clearcoatRoughnessMapTransform)),E.clearcoatNormalMap&&(w.clearcoatNormalMap.value=E.clearcoatNormalMap,t(E.clearcoatNormalMap,w.clearcoatNormalMapTransform),w.clearcoatNormalScale.value.copy(E.clearcoatNormalScale),E.side===$s&&w.clearcoatNormalScale.value.negate())),E.dispersion>0&&(w.dispersion.value=E.dispersion),E.iridescence>0&&(w.iridescence.value=E.iridescence,w.iridescenceIOR.value=E.iridescenceIOR,w.iridescenceThicknessMinimum.value=E.iridescenceThicknessRange[0],w.iridescenceThicknessMaximum.value=E.iridescenceThicknessRange[1],E.iridescenceMap&&(w.iridescenceMap.value=E.iridescenceMap,t(E.iridescenceMap,w.iridescenceMapTransform)),E.iridescenceThicknessMap&&(w.iridescenceThicknessMap.value=E.iridescenceThicknessMap,t(E.iridescenceThicknessMap,w.iridescenceThicknessMapTransform))),E.transmission>0&&(w.transmission.value=E.transmission,w.transmissionSamplerMap.value=D.texture,w.transmissionSamplerSize.value.set(D.width,D.height),E.transmissionMap&&(w.transmissionMap.value=E.transmissionMap,t(E.transmissionMap,w.transmissionMapTransform)),w.thickness.value=E.thickness,E.thicknessMap&&(w.thicknessMap.value=E.thicknessMap,t(E.thicknessMap,w.thicknessMapTransform)),w.attenuationDistance.value=E.attenuationDistance,w.attenuationColor.value.copy(E.attenuationColor)),E.anisotropy>0&&(w.anisotropyVector.value.set(E.anisotropy*Math.cos(E.anisotropyRotation),E.anisotropy*Math.sin(E.anisotropyRotation)),E.anisotropyMap&&(w.anisotropyMap.value=E.anisotropyMap,t(E.anisotropyMap,w.anisotropyMapTransform))),w.specularIntensity.value=E.specularIntensity,w.specularColor.value.copy(E.specularColor),E.specularColorMap&&(w.specularColorMap.value=E.specularColorMap,t(E.specularColorMap,w.specularColorMapTransform)),E.specularIntensityMap&&(w.specularIntensityMap.value=E.specularIntensityMap,t(E.specularIntensityMap,w.specularIntensityMapTransform))}function A(w,E){E.matcap&&(w.matcap.value=E.matcap)}function R(w,E){const D=e.get(E).light;w.referencePosition.value.setFromMatrixPosition(D.matrixWorld),w.nearDistance.value=D.shadow.camera.near,w.farDistance.value=D.shadow.camera.far}return{refreshFogUniforms:n,refreshMaterialUniforms:s}}function _8(i,e,t,n){let s={},a={},l=[];const u=i.getParameter(i.MAX_UNIFORM_BUFFER_BINDINGS);function h(D,L){const P=L.program;n.uniformBlockBinding(D,P)}function p(D,L){let P=s[D.id];P===void 0&&(A(D),P=m(D),s[D.id]=P,D.addEventListener("dispose",w));const G=L.program;n.updateUBOMapping(D,G);const H=e.render.frame;a[D.id]!==H&&(x(D),a[D.id]=H)}function m(D){const L=v();D.__bindingPointIndex=L;const P=i.createBuffer(),G=D.__size,H=D.usage;return i.bindBuffer(i.UNIFORM_BUFFER,P),i.bufferData(i.UNIFORM_BUFFER,G,H),i.bindBuffer(i.UNIFORM_BUFFER,null),i.bindBufferBase(i.UNIFORM_BUFFER,L,P),P}function v(){for(let D=0;D<u;D++)if(l.indexOf(D)===-1)return l.push(D),D;return console.error("THREE.WebGLRenderer: Maximum number of simultaneously usable uniforms groups reached."),0}function x(D){const L=s[D.id],P=D.uniforms,G=D.__cache;i.bindBuffer(i.UNIFORM_BUFFER,L);for(let H=0,F=P.length;H<F;H++){const X=Array.isArray(P[H])?P[H]:[P[H]];for(let z=0,k=X.length;z<k;z++){const ie=X[z];if(_(ie,H,z,G)===!0){const ve=ie.__offset,J=Array.isArray(ie.value)?ie.value:[ie.value];let le=0;for(let ae=0;ae<J.length;ae++){const W=J[ae],ee=R(W);typeof W=="number"||typeof W=="boolean"?(ie.__data[0]=W,i.bufferSubData(i.UNIFORM_BUFFER,ve+le,ie.__data)):W.isMatrix3?(ie.__data[0]=W.elements[0],ie.__data[1]=W.elements[1],ie.__data[2]=W.elements[2],ie.__data[3]=0,ie.__data[4]=W.elements[3],ie.__data[5]=W.elements[4],ie.__data[6]=W.elements[5],ie.__data[7]=0,ie.__data[8]=W.elements[6],ie.__data[9]=W.elements[7],ie.__data[10]=W.elements[8],ie.__data[11]=0):(W.toArray(ie.__data,le),le+=ee.storage/Float32Array.BYTES_PER_ELEMENT)}i.bufferSubData(i.UNIFORM_BUFFER,ve,ie.__data)}}}i.bindBuffer(i.UNIFORM_BUFFER,null)}function _(D,L,P,G){const H=D.value,F=L+"_"+P;if(G[F]===void 0)return typeof H=="number"||typeof H=="boolean"?G[F]=H:G[F]=H.clone(),!0;{const X=G[F];if(typeof H=="number"||typeof H=="boolean"){if(X!==H)return G[F]=H,!0}else if(X.equals(H)===!1)return X.copy(H),!0}return!1}function A(D){const L=D.uniforms;let P=0;const G=16;for(let F=0,X=L.length;F<X;F++){const z=Array.isArray(L[F])?L[F]:[L[F]];for(let k=0,ie=z.length;k<ie;k++){const ve=z[k],J=Array.isArray(ve.value)?ve.value:[ve.value];for(let le=0,ae=J.length;le<ae;le++){const W=J[le],ee=R(W),te=P%G,ue=te%ee.boundary,he=te+ue;P+=ue,he!==0&&G-he<ee.storage&&(P+=G-he),ve.__data=new Float32Array(ee.storage/Float32Array.BYTES_PER_ELEMENT),ve.__offset=P,P+=ee.storage}}}const H=P%G;return H>0&&(P+=G-H),D.__size=P,D.__cache={},this}function R(D){const L={boundary:0,storage:0};return typeof D=="number"||typeof D=="boolean"?(L.boundary=4,L.storage=4):D.isVector2?(L.boundary=8,L.storage=8):D.isVector3||D.isColor?(L.boundary=16,L.storage=12):D.isVector4?(L.boundary=16,L.storage=16):D.isMatrix3?(L.boundary=48,L.storage=48):D.isMatrix4?(L.boundary=64,L.storage=64):D.isTexture?console.warn("THREE.WebGLRenderer: Texture samplers can not be part of an uniforms group."):console.warn("THREE.WebGLRenderer: Unsupported uniform value type.",D),L}function w(D){const L=D.target;L.removeEventListener("dispose",w);const P=l.indexOf(L.__bindingPointIndex);l.splice(P,1),i.deleteBuffer(s[L.id]),delete s[L.id],delete a[L.id]}function E(){for(const D in s)i.deleteBuffer(s[D]);l=[],s={},a={}}return{bind:h,update:p,dispose:E}}class a3{constructor(e={}){const{canvas:t=nI(),context:n=null,depth:s=!0,stencil:a=!1,alpha:l=!1,antialias:u=!1,premultipliedAlpha:h=!0,preserveDrawingBuffer:p=!1,powerPreference:m="default",failIfMajorPerformanceCaveat:v=!1,reverseDepthBuffer:x=!1}=e;this.isWebGLRenderer=!0;let _;if(n!==null){if(typeof WebGLRenderingContext<"u"&&n instanceof WebGLRenderingContext)throw new Error("THREE.WebGLRenderer: WebGL 1 is not supported since r163.");_=n.getContextAttributes().alpha}else _=l;const A=new Uint32Array(4),R=new Int32Array(4);let w=null,E=null;const D=[],L=[];
vendor: 9,905 bytes, line 3900
3900this.domElement=t,this.debug={checkShaderErrors:!0,onShaderError:null},this.autoClear=!0,this.autoClearColor=!0,this.autoClearDepth=!0,this.autoClearStencil=!0,this.sortObjects=!0,this.clippingPlanes=[],this.localClippingEnabled=!1,this.toneMapping=ol,this.toneMappingExposure=1,this.transmissionResolutionScale=1;const P=this;let G=!1;this._outputColorSpace=xi;let H=0,F=0,X=null,z=-1,k=null;const ie=new oi,ve=new oi;let J=null;const le=new Pt(0);let ae=0,W=t.width,ee=t.height,te=1,ue=null,he=null;const K=new oi(0,0,W,ee),ce=new oi(0,0,W,ee);let re=!1;const oe=new hg;let we=!1,Be=!1;const pe=new dn,Re=new dn,lt=new se,ct=new oi,vt={background:null,fog:null,environment:null,overrideMaterial:null,isScene:!0};let qt=!1;function Wt(){return X===null?te:1}let de=n;function an(Q,ye){return t.getContext(Q,ye)}try{const Q={alpha:!0,depth:s,stencil:a,antialias:u,premultipliedAlpha:h,preserveDrawingBuffer:p,powerPreference:m,failIfMajorPerformanceCaveat:v};if("setAttribute"in t&&t.setAttribute("data-engine",`three.js r${$u}`),t.addEventListener("webglcontextlost",nt,!1),t.addEventListener("webglcontextrestored",bt,!1),t.addEventListener("webglcontextcreationerror",mt,!1),de===null){const ye="webgl2";if(de=an(ye,Q),de===null)throw an(ye)?new Error("Error creating WebGL context with your selected attributes."):new Error("Error creating WebGL context.")}}catch(Q){throw console.error("THREE.WebGLRenderer: "+Q.message),Q}let $e,Qe,Ye,pt,Ve,ne,V,Se,Ie,et,Fe,Rt,qe,yt,At,it,Oe,Ct,Ft,ft,Zt,sn,cn,_e;function Bt(){$e=new Dz(de),$e.init(),sn=new r3(de,$e),Qe=new Ez(de,$e,e,sn),Ye=new d8(de,$e),Qe.reverseDepthBuffer&&x&&Ye.buffers.depth.setReversed(!0),pt=new Oz(de),Ve=new $F,ne=new h8(de,$e,Ye,Ve,Qe,sn,pt),V=new wz(P),Se=new Iz(P),Ie=new HN(de),cn=new Az(de,Ie),et=new Lz(de,Ie,pt,cn),Fe=new Uz(de,et,Ie,pt),Ft=new Nz(de,Qe,ne),it=new Tz(Ve),Rt=new QF(P,V,Se,$e,Qe,cn,it),qe=new x8(P,Ve),yt=new t8,At=new o8($e),Ct=new Sz(P,V,Se,Ye,Fe,_,h),Oe=new u8(P,Fe,Qe),_e=new _8(de,pt,Qe,Ye),ft=new Mz(de,$e,pt),Zt=new Pz(de,$e,pt),pt.programs=Rt.programs,P.capabilities=Qe,P.extensions=$e,P.properties=Ve,P.renderLists=yt,P.shadowMap=Oe,P.state=Ye,P.info=pt}Bt();const Ue=new v8(P,de);this.xr=Ue,this.getContext=function(){return de},this.getContextAttributes=function(){return de.getContextAttributes()},this.forceContextLoss=function(){const Q=$e.get("WEBGL_lose_context");Q&&Q.loseContext()},this.forceContextRestore=function(){const Q=$e.get("WEBGL_lose_context");Q&&Q.restoreContext()},this.getPixelRatio=function(){return te},this.setPixelRatio=function(Q){Q!==void 0&&(te=Q,this.setSize(W,ee,!1))},this.getSize=function(Q){return Q.set(W,ee)},this.setSize=function(Q,ye,De=!0){if(Ue.isPresenting){console.warn("THREE.WebGLRenderer: Can't change size while VR device is presenting.");return}W=Q,ee=ye,t.width=Math.floor(Q*te),t.height=Math.floor(ye*te),De===!0&&(t.style.width=Q+"px",t.style.height=ye+"px"),this.setViewport(0,0,Q,ye)},this.getDrawingBufferSize=function(Q){return Q.set(W*te,ee*te).floor()},this.setDrawingBufferSize=function(Q,ye,De){W=Q,ee=ye,te=De,t.width=Math.floor(Q*De),t.height=Math.floor(ye*De),this.setViewport(0,0,Q,ye)},this.getCurrentViewport=function(Q){return Q.copy(ie)},this.getViewport=function(Q){return Q.copy(K)},this.setViewport=function(Q,ye,De,Le){Q.isVector4?K.set(Q.x,Q.y,Q.z,Q.w):K.set(Q,ye,De,Le),Ye.viewport(ie.copy(K).multiplyScalar(te).round())},this.getScissor=function(Q){return Q.copy(ce)},this.setScissor=function(Q,ye,De,Le){Q.isVector4?ce.set(Q.x,Q.y,Q.z,Q.w):ce.set(Q,ye,De,Le),Ye.scissor(ve.copy(ce).multiplyScalar(te).round())},this.getScissorTest=function(){return re},this.setScissorTest=function(Q){Ye.setScissorTest(re=Q)},this.setOpaqueSort=function(Q){ue=Q},this.setTransparentSort=function(Q){he=Q},this.getClearColor=function(Q){return Q.copy(Ct.getClearColor())},this.setClearColor=function(){Ct.setClearColor(...arguments)},this.getClearAlpha=function(){return Ct.getClearAlpha()},this.setClearAlpha=function(){Ct.setClearAlpha(...arguments)},this.clear=function(Q=!0,ye=!0,De=!0){let Le=0;if(Q){let xe=!1;if(X!==null){const dt=X.texture.format;xe=dt===U_||dt===N_||dt===lg}if(xe){const dt=X.texture.type,xt=dt===vr||dt===kc||dt===Sp||dt===Ed||dt===L_||dt===P_,Et=Ct.getClearColor(),Nt=Ct.getClearAlpha(),Kt=Et.r,rn=Et.g,zt=Et.b;xt?(A[0]=Kt,A[1]=rn,A[2]=zt,A[3]=Nt,de.clearBufferuiv(de.COLOR,0,A)):(R[0]=Kt,R[1]=rn,R[2]=zt,R[3]=Nt,de.clearBufferiv(de.COLOR,0,R))}else Le|=de.COLOR_BUFFER_BIT}ye&&(Le|=de.DEPTH_BUFFER_BIT),De&&(Le|=de.STENCIL_BUFFER_BIT,this.state.buffers.stencil.setMask(4294967295)),de.clear(Le)},this.clearColor=function(){this.clear(!0,!1,!1)},this.clearDepth=function(){this.clear(!1,!0,!1)},this.clearStencil=function(){this.clear(!1,!1,!0)},this.dispose=function(){t.removeEventListener("webglcontextlost",nt,!1),t.removeEventListener("webglcontextrestored",bt,!1),t.removeEventListener("webglcontextcreationerror",mt,!1),Ct.dispose(),yt.dispose(),At.dispose(),Ve.dispose(),V.dispose(),Se.dispose(),Fe.dispose(),cn.dispose(),_e.dispose(),Rt.dispose(),Ue.dispose(),Ue.removeEventListener("sessionstart",Lr),Ue.removeEventListener("sessionend",yr),er.stop()};function nt(Q){Q.preventDefault(),console.log("THREE.WebGLRenderer: Context Lost."),G=!0}function bt(){console.log("THREE.WebGLRenderer: Context Restored."),G=!1;const Q=pt.autoReset,ye=Oe.enabled,De=Oe.autoUpdate,Le=Oe.needsUpdate,xe=Oe.type;Bt(),pt.autoReset=Q,Oe.enabled=ye,Oe.autoUpdate=De,Oe.needsUpdate=Le,Oe.type=xe}function mt(Q){console.error("THREE.WebGLRenderer: A WebGL context could not be created. Reason: ",Q.statusMessage)}function nn(Q){const ye=Q.target;ye.removeEventListener("dispose",nn),kn(ye)}function kn(Q){Dt(Q),Ve.remove(Q)}function Dt(Q){const ye=Ve.get(Q).programs;ye!==void 0&&(ye.forEach(function(De){Rt.releaseProgram(De)}),Q.isShaderMaterial&&Rt.releaseShaderCache(Q))}this.renderBufferDirect=function(Q,ye,De,Le,xe,dt){ye===null&&(ye=vt);const xt=xe.isMesh&&xe.matrixWorld.determinant()<0,Et=ui(Q,ye,De,Le,xe);Ye.setMaterial(Le,xt);let Nt=De.index,Kt=1;if(Le.wireframe===!0){if(Nt=et.getWireframeAttribute(De),Nt===void 0)return;Kt=2}const rn=De.drawRange,zt=De.attributes.position;let xn=rn.start*Kt,Pn=(rn.start+rn.count)*Kt;dt!==null&&(xn=Math.max(xn,dt.start*Kt),Pn=Math.min(Pn,(dt.start+dt.count)*Kt)),Nt!==null?(xn=Math.max(xn,0),Pn=Math.min(Pn,Nt.count)):zt!=null&&(xn=Math.max(xn,0),Pn=Math.min(Pn,zt.count));const _i=Pn-xn;if(_i<0||_i===1/0)return;cn.setup(xe,Le,Et,De,Nt);let Vn,Xt=ft;if(Nt!==null&&(Vn=Ie.get(Nt),Xt=Zt,Xt.setIndex(Vn)),xe.isMesh)Le.wireframe===!0?(Ye.setLineWidth(Le.wireframeLinewidth*Wt()),Xt.setMode(de.LINES)):Xt.setMode(de.TRIANGLES);else if(xe.isLine){let Yt=Le.linewidth;Yt===void 0&&(Yt=1),Ye.setLineWidth(Yt*Wt()),xe.isLineSegments?Xt.setMode(de.LINES):xe.isLineLoop?Xt.setMode(de.LINE_LOOP):Xt.setMode(de.LINE_STRIP)}else xe.isPoints?Xt.setMode(de.POINTS):xe.isSprite&&Xt.setMode(de.TRIANGLES);if(xe.isBatchedMesh)if(xe._multiDrawInstances!==null)_x("THREE.WebGLRenderer: renderMultiDrawInstances has been deprecated and will be removed in r184. Append to renderMultiDraw arguments and use indirection."),Xt.renderMultiDrawInstances(xe._multiDrawStarts,xe._multiDrawCounts,xe._multiDrawCount,xe._multiDrawInstances);else if($e.get("WEBGL_multi_draw"))Xt.renderMultiDraw(xe._multiDrawStarts,xe._multiDrawCounts,xe._multiDrawCount);else{const Yt=xe._multiDrawStarts,Qi=xe._multiDrawCounts,Tn=xe._multiDrawCount,pi=Nt?Ie.get(Nt).bytesPerElement:1,Kn=Ve.get(Le).currentProgram.getUniforms();for(let Es=0;Es<Tn;Es++)Kn.setValue(de,"_gl_DrawID",Es),Xt.render(Yt[Es]/pi,Qi[Es])}else if(xe.isInstancedMesh)Xt.renderInstances(xn,_i,xe.count);else if(De.isInstancedBufferGeometry){const Yt=De._maxInstanceCount!==void 0?De._maxInstanceCount:1/0,Qi=Math.min(De.instanceCount,Yt);Xt.renderInstances(xn,_i,Qi)}else Xt.render(xn,_i)};function Tt(Q,ye,De){Q.transparent===!0&&Q.side===Gs&&Q.forceSinglePass===!1?(Q.side=$s,Q.needsUpdate=!0,hi(Q,ye,De),Q.side=cl,Q.needsUpdate=!0,hi(Q,ye,De),Q.side=Gs):hi(Q,ye,De)}this.compile=function(Q,ye,De=null){De===null&&(De=Q),E=At.get(De),E.init(ye),L.push(E),De.traverseVisible(function(xe){xe.isLight&&xe.layers.test(ye.layers)&&(E.pushLight(xe),xe.castShadow&&E.pushShadow(xe))}),Q!==De&&Q.traverseVisible(function(xe){xe.isLight&&xe.layers.test(ye.layers)&&(E.pushLight(xe),xe.castShadow&&E.pushShadow(xe))}),E.setupLights();const Le=new Set;return Q.traverse(function(xe){if(!(xe.isMesh||xe.isPoints||xe.isLine||xe.isSprite))return;const dt=xe.material;if(dt)if(Array.isArray(dt))for(let xt=0;xt<dt.length;xt++){const Et=dt[xt];Tt(Et,De,xe),Le.add(Et)}else Tt(dt,De,xe),Le.add(dt)}),E=L.pop(),Le},this.compileAsync=function(Q,ye,De=null){const Le=this.compile(Q,ye,De);return new Promise(xe=>{function dt(){if(Le.forEach(function(xt){Ve.get(xt).currentProgram.isReady()&&Le.delete(xt)}),Le.size===0){xe(Q);return}setTimeout(dt,10)}$e.get("KHR_parallel_shader_compile")!==null?dt():setTimeout(dt,10)})};let gn=null;function En(Q){gn&&gn(Q)}function Lr(){er.stop()}function yr(){er.start()}const er=new e3;er.setAnimationLoop(En),typeof self<"u"&&er.setContext(self),this.setAnimationLoop=function(Q){gn=Q,Ue.setAnimationLoop(Q),Q===null?er.stop():er.start()},Ue.addEventListener("sessionstart",Lr),Ue.addEventListener("sessionend",yr),this.render=function(Q,ye){if(ye!==void 0&&ye.isCamera!==!0){console.error("THREE.WebGLRenderer.render: camera is not an instance of THREE.Camera.");return}if(G===!0)return;if(Q.matrixWorldAutoUpdate===!0&&Q.updateMatrixWorld(),ye.parent===null&&ye.matrixWorldAutoUpdate===!0&&ye.updateMatrixWorld(),Ue.enabled===!0&&Ue.isPresenting===!0&&(Ue.cameraAutoUpdate===!0&&Ue.updateCamera(ye),ye=Ue.getCamera()),Q.isScene===!0&&Q.onBeforeRender(P,Q,ye,X),E=At.get(Q,L.length),E.init(ye),L.push(E),Re.multiplyMatrices(ye.projectionMatrix,ye.matrixWorldInverse),oe.setFromProjectionMatrix(Re),Be=this.localClippingEnabled,we=it.
vendor: 15,901 bytes, line 3900
3900init(this.clippingPlanes,Be),w=yt.get(Q,D.length),w.init(),D.push(w),Ue.enabled===!0&&Ue.isPresenting===!0){const dt=P.xr.getDepthSensingMesh();dt!==null&&Vs(dt,ye,-1/0,P.sortObjects)}Vs(Q,ye,0,P.sortObjects),w.finish(),P.sortObjects===!0&&w.sort(ue,he),qt=Ue.enabled===!1||Ue.isPresenting===!1||Ue.hasDepthSensing()===!1,qt&&Ct.addToRenderList(w,Q),this.info.render.frame++,we===!0&&it.beginShadows();const De=E.state.shadowsArray;Oe.render(De,Q,ye),we===!0&&it.endShadows(),this.info.autoReset===!0&&this.info.reset();const Le=w.opaque,xe=w.transmissive;if(E.setupLights(),ye.isArrayCamera){const dt=ye.cameras;if(xe.length>0)for(let xt=0,Et=dt.length;xt<Et;xt++){const Nt=dt[xt];ia(Le,xe,Q,Nt)}qt&&Ct.render(Q);for(let xt=0,Et=dt.length;xt<Et;xt++){const Nt=dt[xt];xr(w,Q,Nt,Nt.viewport)}}else xe.length>0&&ia(Le,xe,Q,ye),qt&&Ct.render(Q),xr(w,Q,ye);X!==null&&F===0&&(ne.updateMultisampleRenderTarget(X),ne.updateRenderTargetMipmap(X)),Q.isScene===!0&&Q.onAfterRender(P,Q,ye),cn.resetDefaultState(),z=-1,k=null,L.pop(),L.length>0?(E=L[L.length-1],we===!0&&it.setGlobalState(P.clippingPlanes,E.state.camera)):E=null,D.pop(),D.length>0?w=D[D.length-1]:w=null};function Vs(Q,ye,De,Le){if(Q.visible===!1)return;if(Q.layers.test(ye.layers)){if(Q.isGroup)De=Q.renderOrder;else if(Q.isLOD)Q.autoUpdate===!0&&Q.update(ye);else if(Q.isLight)E.pushLight(Q),Q.castShadow&&E.pushShadow(Q);else if(Q.isSprite){if(!Q.frustumCulled||oe.intersectsSprite(Q)){Le&&ct.setFromMatrixPosition(Q.matrixWorld).applyMatrix4(Re);const xt=Fe.update(Q),Et=Q.material;Et.visible&&w.push(Q,xt,Et,De,ct.z,null)}}else if((Q.isMesh||Q.isLine||Q.isPoints)&&(!Q.frustumCulled||oe.intersectsObject(Q))){const xt=Fe.update(Q),Et=Q.material;if(Le&&(Q.boundingSphere!==void 0?(Q.boundingSphere===null&&Q.computeBoundingSphere(),ct.copy(Q.boundingSphere.center)):(xt.boundingSphere===null&&xt.computeBoundingSphere(),ct.copy(xt.boundingSphere.center)),ct.applyMatrix4(Q.matrixWorld).applyMatrix4(Re)),Array.isArray(Et)){const Nt=xt.groups;for(let Kt=0,rn=Nt.length;Kt<rn;Kt++){const zt=Nt[Kt],xn=Et[zt.materialIndex];xn&&xn.visible&&w.push(Q,xt,xn,De,ct.z,zt)}}else Et.visible&&w.push(Q,xt,Et,De,ct.z,null)}}const dt=Q.children;for(let xt=0,Et=dt.length;xt<Et;xt++)Vs(dt[xt],ye,De,Le)}function xr(Q,ye,De,Le){const xe=Q.opaque,dt=Q.transmissive,xt=Q.transparent;E.setupLightsView(De),we===!0&&it.setGlobalState(P.clippingPlanes,De),Le&&Ye.viewport(ie.copy(Le)),xe.length>0&&Ws(xe,ye,De),dt.length>0&&Ws(dt,ye,De),xt.length>0&&Ws(xt,ye,De),Ye.buffers.depth.setTest(!0),Ye.buffers.depth.setMask(!0),Ye.buffers.color.setMask(!0),Ye.setPolygonOffset(!1)}function ia(Q,ye,De,Le){if((De.isScene===!0?De.overrideMaterial:null)!==null)return;E.state.transmissionRenderTarget[Le.id]===void 0&&(E.state.transmissionRenderTarget[Le.id]=new Ms(1,1,{generateMipmaps:!0,type:$e.has("EXT_color_buffer_half_float")||$e.has("EXT_color_buffer_float")?Pd:vr,minFilter:Do,samples:4,stencilBuffer:a,resolveDepthBuffer:!1,resolveStencilBuffer:!1,colorSpace:si.workingColorSpace}));const dt=E.state.transmissionRenderTarget[Le.id],xt=Le.viewport||ie;dt.setSize(xt.z*P.transmissionResolutionScale,xt.w*P.transmissionResolutionScale);const Et=P.getRenderTarget();P.setRenderTarget(dt),P.getClearColor(le),ae=P.getClearAlpha(),ae<1&&P.setClearColor(16777215,.5),P.clear(),qt&&Ct.render(De);const Nt=P.toneMapping;P.toneMapping=ol;const Kt=Le.viewport;if(Le.viewport!==void 0&&(Le.viewport=void 0),E.setupLightsView(Le),we===!0&&it.setGlobalState(P.clippingPlanes,Le),Ws(Q,De,Le),ne.updateMultisampleRenderTarget(dt),ne.updateRenderTargetMipmap(dt),$e.has("WEBGL_multisampled_render_to_texture")===!1){let rn=!1;for(let zt=0,xn=ye.length;zt<xn;zt++){const Pn=ye[zt],_i=Pn.object,Vn=Pn.geometry,Xt=Pn.material,Yt=Pn.group;if(Xt.side===Gs&&_i.layers.test(Le.layers)){const Qi=Xt.side;Xt.side=$s,Xt.needsUpdate=!0,Ps(_i,De,Le,Vn,Xt,Yt),Xt.side=Qi,Xt.needsUpdate=!0,rn=!0}}rn===!0&&(ne.updateMultisampleRenderTarget(dt),ne.updateRenderTargetMipmap(dt))}P.setRenderTarget(Et),P.setClearColor(le,ae),Kt!==void 0&&(Le.viewport=Kt),P.toneMapping=Nt}function Ws(Q,ye,De){const Le=ye.isScene===!0?ye.overrideMaterial:null;for(let xe=0,dt=Q.length;xe<dt;xe++){const xt=Q[xe],Et=xt.object,Nt=xt.geometry,Kt=xt.group;let rn=xt.material;rn.allowOverride===!0&&Le!==null&&(rn=Le),Et.layers.test(De.layers)&&Ps(Et,ye,De,Nt,rn,Kt)}}function Ps(Q,ye,De,Le,xe,dt){Q.onBeforeRender(P,ye,De,Le,xe,dt),Q.modelViewMatrix.multiplyMatrices(De.matrixWorldInverse,Q.matrixWorld),Q.normalMatrix.getNormalMatrix(Q.modelViewMatrix),xe.onBeforeRender(P,ye,De,Le,Q,dt),xe.transparent===!0&&xe.side===Gs&&xe.forceSinglePass===!1?(xe.side=$s,xe.needsUpdate=!0,P.renderBufferDirect(De,ye,Le,xe,Q,dt),xe.side=cl,xe.needsUpdate=!0,P.renderBufferDirect(De,ye,Le,xe,Q,dt),xe.side=Gs):P.renderBufferDirect(De,ye,Le,xe,Q,dt),Q.onAfterRender(P,ye,De,Le,xe,dt)}function hi(Q,ye,De){ye.isScene!==!0&&(ye=vt);const Le=Ve.get(Q),xe=E.state.lights,dt=E.state.shadowsArray,xt=xe.state.version,Et=Rt.getParameters(Q,xe.state,dt,ye,De),Nt=Rt.getProgramCacheKey(Et);let Kt=Le.programs;Le.environment=Q.isMeshStandardMaterial?ye.environment:null,Le.fog=ye.fog,Le.envMap=(Q.isMeshStandardMaterial?Se:V).get(Q.envMap||Le.environment),Le.envMapRotation=Le.environment!==null&&Q.envMap===null?ye.environmentRotation:Q.envMapRotation,Kt===void 0&&(Q.addEventListener("dispose",nn),Kt=new Map,Le.programs=Kt);let rn=Kt.get(Nt);if(rn!==void 0){if(Le.currentProgram===rn&&Le.lightsStateVersion===xt)return _r(Q,Et),rn}else Et.uniforms=Rt.getUniforms(Q),Q.onBeforeCompile(Et,P),rn=Rt.acquireProgram(Et,Nt),Kt.set(Nt,rn),Le.uniforms=Et.uniforms;const zt=Le.uniforms;return(!Q.isShaderMaterial&&!Q.isRawShaderMaterial||Q.clipping===!0)&&(zt.clippingPlanes=it.uniform),_r(Q,Et),Le.needsLights=xa(Q),Le.lightsStateVersion=xt,Le.needsLights&&(zt.ambientLightColor.value=xe.state.ambient,zt.lightProbe.value=xe.state.probe,zt.directionalLights.value=xe.state.directional,zt.directionalLightShadows.value=xe.state.directionalShadow,zt.spotLights.value=xe.state.spot,zt.spotLightShadows.value=xe.state.spotShadow,zt.rectAreaLights.value=xe.state.rectArea,zt.ltc_1.value=xe.state.rectAreaLTC1,zt.ltc_2.value=xe.state.rectAreaLTC2,zt.pointLights.value=xe.state.point,zt.pointLightShadows.value=xe.state.pointShadow,zt.hemisphereLights.value=xe.state.hemi,zt.directionalShadowMap.value=xe.state.directionalShadowMap,zt.directionalShadowMatrix.value=xe.state.directionalShadowMatrix,zt.spotShadowMap.value=xe.state.spotShadowMap,zt.spotLightMatrix.value=xe.state.spotLightMatrix,zt.spotLightMap.value=xe.state.spotLightMap,zt.pointShadowMap.value=xe.state.pointShadowMap,zt.pointShadowMatrix.value=xe.state.pointShadowMatrix),Le.currentProgram=rn,Le.uniformsList=null,rn}function Fi(Q){if(Q.uniformsList===null){const ye=Q.currentProgram.getUniforms();Q.uniformsList=Sx.seqWithValue(ye.seq,Q.uniforms)}return Q.uniformsList}function _r(Q,ye){const De=Ve.get(Q);De.outputColorSpace=ye.outputColorSpace,De.batching=ye.batching,De.batchingColor=ye.batchingColor,De.instancing=ye.instancing,De.instancingColor=ye.instancingColor,De.instancingMorph=ye.instancingMorph,De.skinning=ye.skinning,De.morphTargets=ye.morphTargets,De.morphNormals=ye.morphNormals,De.morphColors=ye.morphColors,De.morphTargetsCount=ye.morphTargetsCount,De.numClippingPlanes=ye.numClippingPlanes,De.numIntersection=ye.numClipIntersection,De.vertexAlphas=ye.vertexAlphas,De.vertexTangents=ye.vertexTangents,De.toneMapping=ye.toneMapping}function ui(Q,ye,De,Le,xe){ye.isScene!==!0&&(ye=vt),ne.resetTextureUnits();const dt=ye.fog,xt=Le.isMeshStandardMaterial?ye.environment:null,Et=X===null?P.outputColorSpace:X.isXRRenderTarget===!0?X.texture.colorSpace:Wl,Nt=(Le.isMeshStandardMaterial?Se:V).get(Le.envMap||xt),Kt=Le.vertexColors===!0&&!!De.attributes.color&&De.attributes.color.itemSize===4,rn=!!De.attributes.tangent&&(!!Le.normalMap||Le.anisotropy>0),zt=!!De.morphAttributes.position,xn=!!De.morphAttributes.normal,Pn=!!De.morphAttributes.color;let _i=ol;Le.toneMapped&&(X===null||X.isXRRenderTarget===!0)&&(_i=P.toneMapping);const Vn=De.morphAttributes.position||De.morphAttributes.normal||De.morphAttributes.color,Xt=Vn!==void 0?Vn.length:0,Yt=Ve.get(Le),Qi=E.state.lights;if(we===!0&&(Be===!0||Q!==k)){const wi=Q===k&&Le.id===z;it.setState(Le,Q,wi)}let Tn=!1;Le.version===Yt.__version?(Yt.needsLights&&Yt.lightsStateVersion!==Qi.state.version||Yt.outputColorSpace!==Et||xe.isBatchedMesh&&Yt.batching===!1||!xe.isBatchedMesh&&Yt.batching===!0||xe.isBatchedMesh&&Yt.batchingColor===!0&&xe.colorTexture===null||xe.isBatchedMesh&&Yt.batchingColor===!1&&xe.colorTexture!==null||xe.isInstancedMesh&&Yt.instancing===!1||!xe.isInstancedMesh&&Yt.instancing===!0||xe.isSkinnedMesh&&Yt.skinning===!1||!xe.isSkinnedMesh&&Yt.skinning===!0||xe.isInstancedMesh&&Yt.instancingColor===!0&&xe.instanceColor===null||xe.isInstancedMesh&&Yt.instancingColor===!1&&xe.instanceColor!==null||xe.isInstancedMesh&&Yt.instancingMorph===!0&&xe.morphTexture===null||xe.isInstancedMesh&&Yt.instancingMorph===!1&&xe.morphTexture!==null||Yt.envMap!==Nt||Le.fog===!0&&Yt.fog!==dt||Yt.numClippingPlanes!==void 0&&(Yt.numClippingPlanes!==it.numPlanes||Yt.numIntersection!==it.numIntersection)||Yt.vertexAlphas!==Kt||Yt.vertexTangents!==rn||Yt.morphTargets!==zt||Yt.morphNormals!==xn||Yt.morphColors!==Pn||Yt.toneMapping!==_i||Yt.morphTargetsCount!==Xt)&&(Tn=!0):(Tn=!0,Yt.__version=Le.version);let pi=Yt.currentProgram;Tn===!0&&(pi=hi(Le,ye,xe));let Kn=!1,Es=!1,Bi=!1;const Un=pi.getUniforms(),Gi=Yt.uniforms;if(Ye.useProgram(pi.program)&&(Kn=!0,Es=!0,Bi=!0),Le.id!==z&&(z=Le.id,Es=!0),Kn||k!==Q){Ye.buffers.depth.getReversed()?(pe.copy(Q.projectionMatrix),dO(pe),hO(pe),Un.setValue(de,"projectionMatrix",pe)):Un.setValue(de,"projectionMatrix",Q.projectionMatrix),Un.setValue(de,"viewMatrix",Q.matrixWorldInverse);const ms=Un.map.cameraPosition;ms!==void 0&&ms.setValue(de,lt.setFromMatrixPosition(Q.matrixWorld)),Qe.logarithmicDepthBuffer&&Un.setValue(de,"logDepthBufFC",2/(Math.log(Q.far+1)/Math.LN2)),(Le.isMeshPhongMaterial||Le.isMeshToonMaterial||Le.isMeshLambertMaterial||Le.isMeshBasicMaterial||Le.isMeshStandardMaterial||Le.isShaderMaterial)&&Un.setValue(de,"isOrthographic",Q.isOrthographicCamera===!0),k!==Q&&(k=Q,Es=!0,Bi=!0)}if(xe.isSkinnedMesh){Un.setOptional(de,xe,"bindMatrix"),Un.setOptional(de,xe,"bindMatrixInverse");const wi=xe.skeleton;wi&&(wi.boneTexture===null&&wi.computeBoneTexture(),Un.setValue(de,"boneTexture",wi.boneTexture,ne))}xe.isBatchedMesh&&(Un.setOptional(de,xe,"batchingTexture"),Un.setValue(de,"batchingTexture",xe._matricesTexture,ne),Un.setOptional(de,xe,"batchingIdTexture"),Un.setValue(de,"batchingIdTexture",xe._indirectTexture,ne),Un.setOptional(de,xe,"batchingColorTexture"),xe._colorsTexture!==null&&Un.setValue(de,"batchingColorTexture",xe._colorsTexture,ne));const mi=De.morphAttributes;if((mi.position!==void 0||mi.normal!==void 0||mi.color!==void 0)&&Ft.update(xe,De,pi),(Es||Yt.receiveShadow!==xe.receiveShadow)&&(Yt.receiveShadow=xe.receiveShadow,Un.setValue(de,"receiveShadow",xe.receiveShadow)),Le.isMeshGouraudMaterial&&Le.envMap!==null&&(Gi.envMap.value=Nt,Gi.flipEnvMap.value=Nt.isCubeTexture&&Nt.isRenderTargetTexture===!1?-1:1),Le.isMeshStandardMaterial&&Le.envMap===null&&ye.environment!==null&&(Gi.envMapIntensity.value=ye.environmentIntensity),Es&&(Un.setValue(de,"toneMappingExposure",P.toneMappingExposure),Yt.needsLights&&tr(Gi,Bi),dt&&Le.fog===!0&&qe.refreshFogUniforms(Gi,dt),qe.refreshMaterialUniforms(Gi,Le,te,ee,E.state.transmissionRenderTarget[Q.id]),Sx.upload(de,Fi(Yt),Gi,ne)),Le.isShaderMaterial&&Le.uniformsNeedUpdate===!0&&(Sx.upload(de,Fi(Yt),Gi,ne),Le.uniformsNeedUpdate=!1),Le.isSpriteMaterial&&Un.setValue(de,"center",xe.center),Un.setValue(de,"modelViewMatrix",xe.modelViewMatrix),Un.setValue(de,"normalMatrix",xe.normalMatrix),Un.setValue(de,"modelMatrix",xe.matrixWorld),Le.isShaderMaterial||Le.isRawShaderMaterial){const wi=Le.uniformsGroups;for(let ms=0,no=wi.length;ms<no;ms++){const Y=wi[ms];_e.update(Y,pi),_e.bind(Y,pi)}}return pi}function tr(Q,ye){Q.ambientLightColor.needsUpdate=ye,Q.lightProbe.needsUpdate=ye,Q.directionalLights.needsUpdate=ye,Q.directionalLightShadows.needsUpdate=ye,Q.pointLights.needsUpdate=ye,Q.pointLightShadows.needsUpdate=ye,Q.spotLights.needsUpdate=ye,Q.spotLightShadows.needsUpdate=ye,Q.rectAreaLights.needsUpdate=ye,Q.hemisphereLights.needsUpdate=ye}function xa(Q){return Q.isMeshLambertMaterial||Q.isMeshToonMaterial||Q.isMeshPhongMaterial||Q.isMeshStandardMaterial||Q.isShadowMaterial||Q.isShaderMaterial&&Q.lights===!0}this.getActiveCubeFace=function(){return H},this.getActiveMipmapLevel=function(){return F},this.getRenderTarget=function(){return X},this.setRenderTargetTextures=function(Q,ye,De){const Le=Ve.get(Q);Le.__autoAllocateDepthBuffer=Q.resolveDepthBuffer===!1,Le.__autoAllocateDepthBuffer===!1&&(Le.__useRenderToTexture=!1),Ve.get(Q.texture).__webglTexture=ye,Ve.get(Q.depthTexture).__webglTexture=Le.__autoAllocateDepthBuffer?void 0:De,Le.__hasExternalTextures=!0},this.setRenderTargetFramebuffer=function(Q,ye){const De=Ve.get(Q);De.__webglFramebuffer=ye,De.__useDefaultFramebuffer=ye===void 0};const It=de.createFramebuffer();this.setRenderTarget=function(Q,ye=0,De=0){X=Q,H=ye,F=De;let Le=!0,xe=null,dt=!1,xt=!1;if(Q){const Nt=Ve.get(Q);if(Nt.__useDefaultFramebuffer!==void 0)Ye.bindFramebuffer(de.FRAMEBUFFER,null),Le=!1;else if(Nt.__webglFramebuffer===void 0)ne.setupRenderTarget(Q);else if(Nt.__hasExternalTextures)ne.rebindTextures(Q,Ve.get(Q.texture).__webglTexture,Ve.get(Q.depthTexture).__webglTexture);else if(Q.depthBuffer){const zt=Q.depthTexture;if(Nt.__boundDepthTexture!==zt){if(zt!==null&&Ve.has(zt)&&(Q.width!==zt.image.width||Q.height!==zt.image.height))throw new Error("WebGLRenderTarget: Attached DepthTexture is initialized to the incorrect size.");ne.setupDepthRenderbuffer(Q)}}const Kt=Q.texture;(Kt.isData3DTexture||Kt.isDataArrayTexture||Kt.isCompressedArrayTexture)&&(xt=!0);const rn=Ve.get(Q).__webglFramebuffer;Q.isWebGLCubeRenderTarget?(Array.isArray(rn[ye])?xe=rn[ye][De]:xe=rn[ye],dt=!0):Q.samples>0&&ne.useMultisampledRTT(Q)===!1?xe=Ve.get(Q).__webglMultisampledFramebuffer:Array.isArray(rn)?xe=rn[De]:xe=rn,ie.copy(Q.viewport),ve.copy(Q.scissor),J=Q.scissorTest}else ie.copy(K).multiplyScalar(te).floor(),ve.copy(ce).multiplyScalar(te).floor(),J=re;if(De!==0&&(xe=It),Ye.bindFramebuffer(de.FRAMEBUFFER,xe)&&Le&&Ye.drawBuffers(Q,xe),Ye.viewport(ie),Ye.scissor(ve),Ye.setScissorTest(J),dt){const Nt=Ve.get(Q.texture);de.framebufferTexture2D(de.FRAMEBUFFER,de.COLOR_ATTACHMENT0,de.TEXTURE_CUBE_MAP_POSITIVE_X+ye,Nt.__webglTexture,De)}else if(xt){const Nt=Ve.get(Q.texture),Kt=ye;de.framebufferTextureLayer(de.FRAMEBUFFER,de.COLOR_ATTACHMENT0,Nt.__webglTexture,De,Kt)}else if(Q!==null&&De!==0){const Nt=Ve.get(Q.texture);de.framebufferTexture2D(de.FRAMEBUFFER,de.COLOR_ATTACHMENT0,de.TEXTURE_2D,Nt.__webglTexture,De)}z=-1},this.readRenderTargetPixels=function(Q,ye,De,Le,xe,dt,xt){if(!(Q&&Q.isWebGLRenderTarget)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");return}let Et=Ve.get(Q).__webglFramebuffer;if(Q.isWebGLCubeRenderTarget&&xt!==void 0&&(Et=Et[xt]),Et){Ye.bindFramebuffer(de.FRAMEBUFFER,Et);try{const Nt=Q.texture,Kt=Nt.format,rn=Nt.type;if(!Qe.textureFormatReadable(Kt)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in RGBA or implementation defined format.");return}if(!Qe.textureTypeReadable(rn)){console.error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not in UnsignedByteType or implementation defined type.");return}ye>=0&&ye<=Q.width-Le&&De>=0&&De<=Q.height-xe&&de.readPixels(ye,De,Le,xe,sn.convert(Kt),sn.convert(rn),dt)}finally{const Nt=X!==null?Ve.get(X).__webglFramebuffer:null;Ye.bindFramebuffer(de.FRAMEBUFFER,Nt)}}},this.readRenderTargetPixelsAsync=async function(Q,ye,De,Le,xe,dt,xt){if(!(Q&&Q.isWebG
vendor: 6,322 bytes, line 3900
3900LRenderTarget))throw new Error("THREE.WebGLRenderer.readRenderTargetPixels: renderTarget is not THREE.WebGLRenderTarget.");let Et=Ve.get(Q).__webglFramebuffer;if(Q.isWebGLCubeRenderTarget&&xt!==void 0&&(Et=Et[xt]),Et)if(ye>=0&&ye<=Q.width-Le&&De>=0&&De<=Q.height-xe){Ye.bindFramebuffer(de.FRAMEBUFFER,Et);const Nt=Q.texture,Kt=Nt.format,rn=Nt.type;if(!Qe.textureFormatReadable(Kt))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in RGBA or implementation defined format.");if(!Qe.textureTypeReadable(rn))throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: renderTarget is not in UnsignedByteType or implementation defined type.");const zt=de.createBuffer();de.bindBuffer(de.PIXEL_PACK_BUFFER,zt),de.bufferData(de.PIXEL_PACK_BUFFER,dt.byteLength,de.STREAM_READ),de.readPixels(ye,De,Le,xe,sn.convert(Kt),sn.convert(rn),0);const xn=X!==null?Ve.get(X).__webglFramebuffer:null;Ye.bindFramebuffer(de.FRAMEBUFFER,xn);const Pn=de.fenceSync(de.SYNC_GPU_COMMANDS_COMPLETE,0);return de.flush(),await fO(de,Pn,4),de.bindBuffer(de.PIXEL_PACK_BUFFER,zt),de.getBufferSubData(de.PIXEL_PACK_BUFFER,0,dt),de.deleteBuffer(zt),de.deleteSync(Pn),dt}else throw new Error("THREE.WebGLRenderer.readRenderTargetPixelsAsync: requested read bounds are out of range.")},this.copyFramebufferToTexture=function(Q,ye=null,De=0){const Le=Math.pow(2,-De),xe=Math.floor(Q.image.width*Le),dt=Math.floor(Q.image.height*Le),xt=ye!==null?ye.x:0,Et=ye!==null?ye.y:0;ne.setTexture2D(Q,0),de.copyTexSubImage2D(de.TEXTURE_2D,De,0,0,xt,Et,xe,dt),Ye.unbindTexture()};const Ot=de.createFramebuffer(),Ln=de.createFramebuffer();this.copyTextureToTexture=function(Q,ye,De=null,Le=null,xe=0,dt=null){dt===null&&(xe!==0?(_x("WebGLRenderer: copyTextureToTexture function signature has changed to support src and dst mipmap levels."),dt=xe,xe=0):dt=0);let xt,Et,Nt,Kt,rn,zt,xn,Pn,_i;const Vn=Q.isCompressedTexture?Q.mipmaps[dt]:Q.image;if(De!==null)xt=De.max.x-De.min.x,Et=De.max.y-De.min.y,Nt=De.isBox3?De.max.z-De.min.z:1,Kt=De.min.x,rn=De.min.y,zt=De.isBox3?De.min.z:0;else{const mi=Math.pow(2,-xe);xt=Math.floor(Vn.width*mi),Et=Math.floor(Vn.height*mi),Q.isDataArrayTexture?Nt=Vn.depth:Q.isData3DTexture?Nt=Math.floor(Vn.depth*mi):Nt=1,Kt=0,rn=0,zt=0}Le!==null?(xn=Le.x,Pn=Le.y,_i=Le.z):(xn=0,Pn=0,_i=0);const Xt=sn.convert(ye.format),Yt=sn.convert(ye.type);let Qi;ye.isData3DTexture?(ne.setTexture3D(ye,0),Qi=de.TEXTURE_3D):ye.isDataArrayTexture||ye.isCompressedArrayTexture?(ne.setTexture2DArray(ye,0),Qi=de.TEXTURE_2D_ARRAY):(ne.setTexture2D(ye,0),Qi=de.TEXTURE_2D),de.pixelStorei(de.UNPACK_FLIP_Y_WEBGL,ye.flipY),de.pixelStorei(de.UNPACK_PREMULTIPLY_ALPHA_WEBGL,ye.premultiplyAlpha),de.pixelStorei(de.UNPACK_ALIGNMENT,ye.unpackAlignment);const Tn=de.getParameter(de.UNPACK_ROW_LENGTH),pi=de.getParameter(de.UNPACK_IMAGE_HEIGHT),Kn=de.getParameter(de.UNPACK_SKIP_PIXELS),Es=de.getParameter(de.UNPACK_SKIP_ROWS),Bi=de.getParameter(de.UNPACK_SKIP_IMAGES);de.pixelStorei(de.UNPACK_ROW_LENGTH,Vn.width),de.pixelStorei(de.UNPACK_IMAGE_HEIGHT,Vn.height),de.pixelStorei(de.UNPACK_SKIP_PIXELS,Kt),de.pixelStorei(de.UNPACK_SKIP_ROWS,rn),de.pixelStorei(de.UNPACK_SKIP_IMAGES,zt);const Un=Q.isDataArrayTexture||Q.isData3DTexture,Gi=ye.isDataArrayTexture||ye.isData3DTexture;if(Q.isDepthTexture){const mi=Ve.get(Q),wi=Ve.get(ye),ms=Ve.get(mi.__renderTarget),no=Ve.get(wi.__renderTarget);Ye.bindFramebuffer(de.READ_FRAMEBUFFER,ms.__webglFramebuffer),Ye.bindFramebuffer(de.DRAW_FRAMEBUFFER,no.__webglFramebuffer);for(let Y=0;Y<Nt;Y++)Un&&(de.framebufferTextureLayer(de.READ_FRAMEBUFFER,de.COLOR_ATTACHMENT0,Ve.get(Q).__webglTexture,xe,zt+Y),de.framebufferTextureLayer(de.DRAW_FRAMEBUFFER,de.COLOR_ATTACHMENT0,Ve.get(ye).__webglTexture,dt,_i+Y)),de.blitFramebuffer(Kt,rn,xt,Et,xn,Pn,xt,Et,de.DEPTH_BUFFER_BIT,de.NEAREST);Ye.bindFramebuffer(de.READ_FRAMEBUFFER,null),Ye.bindFramebuffer(de.DRAW_FRAMEBUFFER,null)}else if(xe!==0||Q.isRenderTargetTexture||Ve.has(Q)){const mi=Ve.get(Q),wi=Ve.get(ye);Ye.bindFramebuffer(de.READ_FRAMEBUFFER,Ot),Ye.bindFramebuffer(de.DRAW_FRAMEBUFFER,Ln);for(let ms=0;ms<Nt;ms++)Un?de.framebufferTextureLayer(de.READ_FRAMEBUFFER,de.COLOR_ATTACHMENT0,mi.__webglTexture,xe,zt+ms):de.framebufferTexture2D(de.READ_FRAMEBUFFER,de.COLOR_ATTACHMENT0,de.TEXTURE_2D,mi.__webglTexture,xe),Gi?de.framebufferTextureLayer(de.DRAW_FRAMEBUFFER,de.COLOR_ATTACHMENT0,wi.__webglTexture,dt,_i+ms):de.framebufferTexture2D(de.DRAW_FRAMEBUFFER,de.COLOR_ATTACHMENT0,de.TEXTURE_2D,wi.__webglTexture,dt),xe!==0?de.blitFramebuffer(Kt,rn,xt,Et,xn,Pn,xt,Et,de.COLOR_BUFFER_BIT,de.NEAREST):Gi?de.copyTexSubImage3D(Qi,dt,xn,Pn,_i+ms,Kt,rn,xt,Et):de.copyTexSubImage2D(Qi,dt,xn,Pn,Kt,rn,xt,Et);Ye.bindFramebuffer(de.READ_FRAMEBUFFER,null),Ye.bindFramebuffer(de.DRAW_FRAMEBUFFER,null)}else Gi?Q.isDataTexture||Q.isData3DTexture?de.texSubImage3D(Qi,dt,xn,Pn,_i,xt,Et,Nt,Xt,Yt,Vn.data):ye.isCompressedArrayTexture?de.compressedTexSubImage3D(Qi,dt,xn,Pn,_i,xt,Et,Nt,Xt,Vn.data):de.texSubImage3D(Qi,dt,xn,Pn,_i,xt,Et,Nt,Xt,Yt,Vn):Q.isDataTexture?de.texSubImage2D(de.TEXTURE_2D,dt,xn,Pn,xt,Et,Xt,Yt,Vn.data):Q.isCompressedTexture?de.compressedTexSubImage2D(de.TEXTURE_2D,dt,xn,Pn,Vn.width,Vn.height,Xt,Vn.data):de.texSubImage2D(de.TEXTURE_2D,dt,xn,Pn,xt,Et,Xt,Yt,Vn);de.pixelStorei(de.UNPACK_ROW_LENGTH,Tn),de.pixelStorei(de.UNPACK_IMAGE_HEIGHT,pi),de.pixelStorei(de.UNPACK_SKIP_PIXELS,Kn),de.pixelStorei(de.UNPACK_SKIP_ROWS,Es),de.pixelStorei(de.UNPACK_SKIP_IMAGES,Bi),dt===0&&ye.generateMipmaps&&de.generateMipmap(Qi),Ye.unbindTexture()},this.copyTextureToTexture3D=function(Q,ye,De=null,Le=null,xe=0){return _x('WebGLRenderer: copyTextureToTexture3D function has been deprecated. Use "copyTextureToTexture" instead.'),this.copyTextureToTexture(Q,ye,De,Le,xe)},this.initRenderTarget=function(Q){Ve.get(Q).__webglFramebuffer===void 0&&ne.setupRenderTarget(Q)},this.initTexture=function(Q){Q.isCubeTexture?ne.setTextureCube(Q,0):Q.isData3DTexture?ne.setTexture3D(Q,0):Q.isDataArrayTexture||Q.isCompressedArrayTexture?ne.setTexture2DArray(Q,0):ne.setTexture2D(Q,0),Ye.unbindTexture()},this.resetState=function(){H=0,F=0,X=null,Ye.reset(),cn.reset()},typeof __THREE_DEVTOOLS__<"u"&&__THREE_DEVTOOLS__.dispatchEvent(new CustomEvent("observe",{detail:this}))}get coordinateSystem(){return al}get outputColorSpace(){return this._outputColorSpace}
3900set outputColorSpace(e){this._outputColorSpace=e;const t=this.getContext();t.drawingBufferColorSpace=si._getDrawingBufferColorSpace(e),t.unpackColorSpace=si._getUnpackColorSpace()}}const b8=Object.freeze(Object.defineProperty({__proto__:null,ACESFilmicToneMapping:R_,AddEquation:Gu,AddOperation:PB,AdditiveAnimationBlendMode:LA,AdditiveBlending:H0,AgXToneMapping:FB,AlphaFormat:wA,AlwaysCompare:eI,AlwaysDepth:G0,AlwaysStencilFunc:X1,AmbientLight:kI,AnimationAction:KI,AnimationClip:Bp,AnimationLoader:U2,AnimationMixer:uN,AnimationObjectGroup:lN,AnimationUtils:L2,ArcCurve:pI,ArrayCamera:qI,ArrowHelper:DN,AttachedBindMode:W1,Audio:YI,AudioAnalyser:Q2,AudioContext:aM,AudioListener:J2,AudioLoader:X2,AxesHelper:LN,BackSide:$s,BasicDepthPacking:ef,BasicShadowMap:pB,BatchedMesh:dI,Bone:V_,BooleanKeyframeTrack:Ud,Box2:yN,Box3:$r,Box3Helper:BN,BoxGeometry:Od,BoxHelper:RN,BufferAttribute:ci,BufferGeometry:Mn,BufferGeometryLoader:WI,ByteType:MA,Cache:Pc,Camera:H_,CameraHelper:CN,CanvasTexture:pg,CapsuleGeometry:J_,CatmullRomCurve3:mI,CineonToneMapping:UB,CircleGeometry:K_,ClampToEdgeWrapping:Ka,Clock:oM,Color:Pt,ColorKeyframeTrack:eM,ColorManagement:si,CompressedArrayTexture:t2,CompressedCubeTexture:n2,CompressedTexture:X_,CompressedTextureLoader:z2,ConeGeometry:Z_,ConstantAlphaFactor:IB,ConstantColorFactor:RB,Controls:ON,CubeCamera:oI,CubeReflectionMapping:Fc,CubeRefractionMapping:Ku,CubeTexture:ug,CubeTextureLoader:F2,CubeUVReflectionMapping:Dp,CubicBezierCurve:WA,CubicBezierCurve3:gI,CubicInterpolant:PI,CullFaceBack:G1,CullFaceFront:hB,CullFaceFrontBack:gP,CullFaceNone:dB,Curve:fl,CurvePath:yI,CustomBlending:mB,CustomToneMapping:zB,CylinderGeometry:Pp,Cylindrical:vN,Data3DTexture:k_,DataArrayTexture:cg,DataTexture:jl,DataTextureLoader:k2,DataUtils:CO,DecrementStencilOp:wP,DecrementWrapStencilOp:RP,DefaultLoadingManager:UI,DepthFormat:Ap,DepthStencilFormat:Td,DepthTexture:q_,DetachedBindMode:HB,DirectionalLight:rM,DirectionalLightHelper:wN,DiscreteInterpolant:OI,DodecahedronGeometry:Q_,DoubleSide:Gs,DstAlphaFactor:MB,DstColorFactor:TB,DynamicCopyUsage:VP,DynamicDrawUsage:zP,DynamicReadUsage:HP,EdgesGeometry:xI,EllipseCurve:Y_,EqualCompare:KB,EqualDepth:Dx,EqualStencilFunc:LP,EquirectangularReflectionMapping:j0,EquirectangularRefractionMapping:V0,Euler:Qa,EventDispatcher:eo,ExtrudeGeometry:$_,FileLoader:$a,Float16BufferAttribute:OO,Float32BufferAttribute:$t,FloatType:Yr,Fog:j_,FogExp2:G_,FramebufferTexture:e2,FrontSide:cl,Frustum:hg,GLBufferAttribute:gN,GLSL1:XP,GLSL3:q1,GreaterCompare:ZB,GreaterDepth:Px,GreaterEqualCompare:$B,GreaterEqualDepth:Lx,GreaterEqualStencilFunc:UP,GreaterStencilFunc:OP,GridHelper:EN,Group:Lc,HalfFloatType:Pd,HemisphereLight:FI,HemisphereLightHelper:MN,IcosahedronGeometry:eb,ImageBitmapLoader:XI,ImageLoader:tg,ImageUtils:iI,IncrementStencilOp:TP,IncrementWrapStencilOp:CP,InstancedBufferAttribute:wd,InstancedBufferGeometry:VI,InstancedInterleavedBuffer:mN,InstancedMesh:HA,Int16BufferAttribute:LO,Int32BufferAttribute:PO,Int8BufferAttribute:BO,IntType:D_,InterleavedBuffer:fg,InterleavedBufferAttribute:Qu,Interpolant:Op,InterpolateDiscrete:Mp,InterpolateLinear:Ep,InterpolateSmooth:xx,InvertStencilOp:BP,KeepStencilOp:rd,KeyframeTrack:Po,LOD:fI,LatheGeometry:mg,Layers:wp,LessCompare:JB,LessDepth:Ix,LessEqualCompare:OA,LessEqualDepth:Md,LessEqualStencilFunc:PP,LessStencilFunc:DP,Light:sf,LightProbe:jI,Line:Hc,Line3:xN,LineBasicMaterial:ta,LineCurve:XA,LineCurve3:vI,LineDashedMaterial:II,LineLoop:GA,LineSegments:ul,LinearFilter:as,LinearInterpolant:$A,LinearMipMapLinearFilter:_P,LinearMipMapNearestFilter:xP,LinearMipmapLinearFilter:Do,LinearMipmapNearestFilter:gp,LinearSRGBColorSpace:Wl,LinearToneMapping:OB,LinearTransfer:X0,Loader:na,LoaderUtils:Yu,LoadingManager:tM,LoopOnce:GB,LoopPingPong:VB,LoopRepeat:jB,LuminanceAlphaFormat:BA,LuminanceFormat:RA,MOUSE:pP,Material:js,MaterialLoader:lb,MathUtils:vn,Matrix2:uM,Matrix3:Cn,Matrix4:dn,MaxEquation:xB,Mesh:hs,MeshBasicMaterial:Kr,MeshDepthMaterial:ob,MeshDistanceMaterial:ZA,MeshLambertMaterial:RI,MeshMatcapMaterial:BI,MeshNormalMaterial:KA,MeshPhongMaterial:wI,MeshPhysicalMaterial:to,MeshStandardMaterial:rl,MeshToonMaterial:CI,MinEquation:yB,MirroredRepeatWrapping:bp,MixOperation:LB,MultiplyBlending:V1,MultiplyOperation:og,NearestFilter:Ls,NearestMipMapLinearFilter:yP,NearestMipMapNearestFilter:vP,NearestMipmapLinearFilter:cd,NearestMipmapNearestFilter:I_,NeutralToneMapping:kB,NeverCompare:YB,NeverDepth:Bx,NeverStencilFunc:IP,NoBlending:Qr,NoColorSpace:sl,NoToneMapping:ol,NormalAnimationBlendMode:z_,NormalBlending:gd,NotEqualCompare:QB,NotEqualDepth:Ox,NotEqualStencilFunc:NP,NumberKeyframeTrack:Rd,Object3D:li,ObjectLoader:V2,ObjectSpaceNormalMap:qB,OctahedronGeometry:gg,OneFactor:bB,OneMinusConstantAlphaFactor:DB,OneMinusConstantColorFactor:BB,OneMinusDstAlphaFactor:EB,OneMinusDstColorFactor:wB,OneMinusSrcAlphaFactor:Rx,OneMinusSrcColorFactor:AB,Orthogra
vendor: 5,145 bytes, lines 3900-3916
3900phicCamera:Vc,PCFShadowMap:C_,PCFSoftShadowMap:mp,PMREMGenerator:eA,Path:Z0,PerspectiveCamera:Ds,Plane:Hu,PlaneGeometry:Nd,PlaneHelper:IN,PointLight:sM,PointLightHelper:SN,Points:jA,PointsMaterial:W_,PolarGridHelper:TN,PolyhedronGeometry:nf,PositionalAudio:Z2,PropertyBinding:di,PropertyMixer:JI,QuadraticBezierCurve:qA,QuadraticBezierCurve3:YA,Quaternion:gr,QuaternionKeyframeTrack:Bd,QuaternionLinearInterpolant:NI,RED_GREEN_RGTC2_Format:a_,RED_RGTC1_Format:DA,REVISION:$u,RGBADepthPacking:XB,RGBAFormat:Jr,RGBAIntegerFormat:U_,RGBA_ASTC_10x10_Format:e_,RGBA_ASTC_10x5_Format:Zx,RGBA_ASTC_10x6_Format:Qx,RGBA_ASTC_10x8_Format:$x,RGBA_ASTC_12x10_Format:t_,RGBA_ASTC_12x12_Format:n_,RGBA_ASTC_4x4_Format:jx,RGBA_ASTC_5x4_Format:Vx,RGBA_ASTC_5x5_Format:Wx,RGBA_ASTC_6x5_Format:Xx,RGBA_ASTC_6x6_Format:qx,RGBA_ASTC_8x5_Format:Yx,RGBA_ASTC_8x6_Format:Jx,RGBA_ASTC_8x8_Format:Kx,RGBA_BPTC_Format:P0,RGBA_ETC2_EAC_Format:Gx,RGBA_PVRTC_2BPPV1_Format:Fx,RGBA_PVRTC_4BPPV1_Format:zx,RGBA_S3TC_DXT1_Format:I0,RGBA_S3TC_DXT3_Format:D0,RGBA_S3TC_DXT5_Format:L0,RGBDepthPacking:SP,RGBFormat:CA,RGBIntegerFormat:bP,RGB_BPTC_SIGNED_Format:i_,RGB_BPTC_UNSIGNED_Format:s_,RGB_ETC1_Format:kx,RGB_ETC2_Format:Hx,RGB_PVRTC_2BPPV1_Format:Ux,RGB_PVRTC_4BPPV1_Format:Nx,RGB_S3TC_DXT1_Format:B0,RGDepthPacking:AP,RGFormat:IA,RGIntegerFormat:N_,RawShaderMaterial:TI,Ray:Lp,Raycaster:ZI,RectAreaLight:HI,RedFormat:O_,RedIntegerFormat:lg,ReinhardToneMapping:NB,RenderTarget:F_,RenderTarget3D:fN,RenderTargetArray:dN,RepeatWrapping:Zu,ReplaceStencilOp:EP,ReverseSubtractEquation:vB,RingGeometry:tb,SIGNED_RED_GREEN_RGTC2_Format:o_,SIGNED_RED_RGTC1_Format:r_,SRGBColorSpace:xi,SRGBTransfer:Ri,Scene:K0,ShaderChunk:Nn,ShaderLib:il,ShaderMaterial:Zi,ShadowMaterial:EI,Shape:yd,ShapeGeometry:nb,ShapePath:PN,ShapeUtils:Vl,ShortType:EA,Skeleton:dg,SkeletonHelper:bN,SkinnedMesh:kA,Source:Wu,Sphere:Dr,SphereGeometry:vg,Spherical:QI,SphericalHarmonics3:GI,SplineCurve:JA,SpotLight:iM,SpotLightHelper:_N,Sprite:uI,SpriteMaterial:FA,SrcAlphaFactor:Cx,SrcAlphaSaturateFactor:CB,SrcColorFactor:SB,StaticCopyUsage:jP,StaticDrawUsage:q0,StaticReadUsage:kP,StereoCamera:q2,StreamCopyUsage:WP,StreamDrawUsage:FP,StreamReadUsage:GP,StringKeyframeTrack:zd,SubtractEquation:gB,SubtractiveBlending:j1,TOUCH:mP,TangentSpaceNormalMap:tf,TetrahedronGeometry:ib,Texture:Ki,TextureLoader:zI,TextureUtils:kN,TimestampQuery:qP,TorusGeometry:sb,TorusKnotGeometry:rb,Triangle:Ha,TriangleFanDrawMode:l_,TriangleStripDrawMode:PA,TrianglesDrawMode:WB,TubeGeometry:ab,UVMapping:B_,Uint16BufferAttribute:UA,Uint32BufferAttribute:zA,Uint8BufferAttribute:IO,Uint8ClampedBufferAttribute:DO,Uniform:ai,UniformsGroup:pN,UniformsLib:kt,UniformsUtils:aI,UnsignedByteType:vr,UnsignedInt248Type:Ed,UnsignedInt5999Type:TA,UnsignedIntType:kc,UnsignedShort4444Type:L_,UnsignedShort5551Type:P_,UnsignedShortType:Sp,VSMShadowMap:nl,Vector2:st,Vector3:se,Vector4:oi,VectorKeyframeTrack:Id,VideoFrameTexture:$O,VideoTexture:hI,WebGL3DRenderTarget:yO,WebGLArrayRenderTarget:vO,WebGLCoordinateSystem:al,WebGLCubeRenderTarget:lI,WebGLRenderTarget:Ms,WebGLRenderer:a3,WebGLUtils:r3,WebGPUCoordinateSystem:Y0,WebXRController:bx,WireframeGeometry:MI,WrapAroundEnding:W0,ZeroCurvatureEnding:ud,ZeroFactor:_B,ZeroSlopeEnding:fd,ZeroStencilOp:MP,createCanvasElement:nI},Symbol.toStringTag,{value:"Module"}));var o1={exports:{}},l1={},c1={exports:{}},u1={};/**
3901 * @license React
3902 * use-sync-external-store-shim.production.js
3903 *
3904 * Copyright (c) Meta Platforms, Inc. and affiliates.
3905 *
3906 * This source code is licensed under the MIT license found in the
3907 * LICENSE file in the root directory of this source tree.
3908 */var Nw;function S8(){if(Nw)return u1;Nw=1;var i=ig();function e(v,x){return v===x&&(v!==0||1/v===1/x)||v!==v&&x!==x}var t=typeof Object.is=="function"?Object.is:e,n=i.useState,s=i.useEffect,a=i.useLayoutEffect,l=i.useDebugValue;function u(v,x){var _=x(),A=n({inst:{value:_,getSnapshot:x}}),R=A[0].inst,w=A[1];return a(function(){R.value=_,R.getSnapshot=x,h(R)&&w({inst:R})},[v,_,x]),s(function(){return h(R)&&w({inst:R}),v(function(){h(R)&&w({inst:R})})},[v]),l(_),_}function h(v){var x=v.getSnapshot;v=v.value;try{var _=x();return!t(v,_)}catch{return!0}}function p(v,x){return x()}var m=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:u;return u1.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:m,u1}var Uw;function A8(){return Uw||(Uw=1,c1.exports=S8()),c1.exports}/**
3909 * @license React
3910 * use-sync-external-store-shim/with-selector.production.js
3911 *
3912 * Copyright (c) Meta Platforms, Inc. and affiliates.
3913 *
3914 * This source code is licensed under the MIT license found in the
3915 * LICENSE file in the root directory of this source tree.
3916 */var zw;function M8(){if(zw)return l1;zw=1;var i=ig(),e=A8();function t(p,m){return p===m&&(p!==0||1/p===1/m)||p!==p&&m!==m}var n=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,a=i.useRef,l=i.useEffect,u=i.useMemo,h=i.useDebugValue;return l1.useSyncExternalStoreWithSelector=function(p,m,v,x,_){var A=a(null);if(A.current===null){var R={hasValue:!1,value:null};A.current=R}else R=A.current;
3916A=u(function(){function E(H){if(!D){if(D=!0,L=H,H=x(H),_!==void 0&&R.hasValue){var F=R.value;if(_(F,H))return P=F}return P=H}if(F=P,n(L,H))return F;var X=x(H);return _!==void 0&&_(F,X)?(L=H,F):(L=H,P=X)}var D=!1,L,P,G=v===void 0?null:v;return[function(){return E(m())},G===null?void 0:function(){return E(G())}]},[m,v,x,_]);var w=s(p,A[0],A[1]);return l(function(){R.hasValue=!0,R.value=w},[w]),h(w),w},l1}var Fw;function E8(){return Fw||(Fw=1,o1.exports=M8()),o1.exports}var T8=E8();const w8=mA(T8),{useSyncExternalStoreWithSelector:C8}=w8,R8=i=>i;function B8(i,e=R8,t){const n=C8(i.subscribe,i.getState,i.getInitialState,e,t);return ld.useDebugValue(n),n}const kw=(i,e)=>{const t=rR(i),n=(s,a=e)=>B8(t,s,a);return Object.assign(n,t),n},I8=((i,e)=>i?kw(i,e):kw),D8=i=>typeof i=="object"&&typeof i.then=="function",hd=[];function o3(i,e,t=(n,s)=>n===s){if(i===e)return!0;if(!i||!e)return!1;const n=i.length;if(e.length!==n)return!1;for(let s=0;s<n;s++)if(!t(i[s],e[s]))return!1;return!0}function l3(i,e=null,t=!1,n={}){e===null&&(e=[i]);for(const a of hd)if(o3(e,a.keys,a.equal)){if(t)return;if(Object.prototype.hasOwnProperty.call(a,"error"))throw a.error;if(Object.prototype.hasOwnProperty.call(a,"response"))return n.lifespan&&n.lifespan>0&&(a.timeout&&clearTimeout(a.timeout),a.timeout=setTimeout(a.remove,n.lifespan)),a.response;if(!t)throw a.promise}const s={keys:e,equal:n.equal,remove:()=>{const a=hd.indexOf(s);a!==-1&&hd.splice(a,1)},promise:(D8(i)?i:i(...e)).then(a=>{s.response=a,n.lifespan&&n.lifespan>0&&(s.timeout=setTimeout(s.remove,n.lifespan))}).catch(a=>s.error=a)};if(hd.push(s),!t)throw s.promise}const L8=(i,e,t)=>l3(i,e,!1,t),P8=(i,e,t)=>void l3(i,e,!0,t),O8=i=>{if(i===void 0||i.length===0)hd.splice(0,hd.length);else{const e=hd.find(t=>o3(i,t.keys,t.equal));e&&e.remove()}};var nA=nR();const N8=mA(nA);function dM(i,e,t){if(!i)return;if(t(i)===!0)return i;let n=e?i.return:i.child;for(;n;){const s=dM(n,e,t);if(s)return s;n=e?null:n.sibling}}function c3(i){try{return Object.defineProperties(i,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return i}}const hM=c3(q.createContext(null));class u3 extends q.Component{render(){return q.createElement(hM.Provider,{value:this._reactInternals},this.props.children)}}function f3(){const i=q.useContext(hM);if(i===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=q.useId();return q.useMemo(()=>{for(const t of[i,i?.alternate]){if(!t)continue;const n=dM(t,!1,s=>{let a=s.memoizedState;for(;a;){if(a.memoizedState===e)return!0;a=a.next}});if(n)return n}},[i,e])}const U8=Symbol.for("react.context"),z8=i=>i!==null&&typeof i=="object"&&"$$typeof"in i&&i.$$typeof===U8;function F8(){const i=f3(),[e]=q.useState(()=>new Map);e.clear();let t=i;for(;t;){const n=t.type;z8(n)&&n!==hM&&!e.has(n)&&e.set(n,q.use(c3(n))),t=t.return}return e}function k8(){const i=F8();return q.useMemo(()=>Array.from(i.keys()).reduce((e,t)=>n=>q.createElement(e,null,q.createElement(t.Provider,{...n,value:i.get(t)})),e=>q.createElement(u3,{...e})),[i])}function d3(i){let e=i.root;for(;e.getState().previousRoot;)e=e.getState().previousRoot;return e}const h3=i=>i&&i.isOrthographicCamera,H8=i=>i&&i.hasOwnProperty("current"),G8=i=>i!=null&&(typeof i=="string"||typeof i=="number"||i.isColor),yg=((i,e)=>typeof window<"u"&&(((i=window.document)==null?void 0:i.createElement)||((e=window.navigator)==null?void 0:e.product)==="ReactNative"))()?q.useLayoutEffect:q.useEffect;function p3(i){const e=q.useRef(i);return yg(()=>void(e.current=i),[i]),e}function j8(){const i=f3(),e=k8();return q.useMemo(()=>({children:t})=>{const s=!!dM(i,!0,a=>a.type===q.StrictMode)?q.StrictMode:q.Fragment;return b.jsx(s,{children:b.jsx(e,{children:t})})},[i,e])}function V8({set:i}){return yg(()=>(i(new Promise(()=>null)),()=>i(!1)),[i]),null}const W8=(i=>(i=class extends q.Component{constructor(...t){super(...t),this.state={error:!1}}componentDidCatch(t){this.props.set(t)}render(){return this.state.error?null:this.props.children}},i.getDerivedStateFromError=()=>({error:!0}),i))();function m3(i){var e;const t=typeof window<"u"?(e=window.devicePixelRatio)!=null?e:2:1;return Array.isArray(i)?Math.min(Math.max(i[0],t),i[1]):i}function op(i){var e;return(e=i.__r3f)==null?void 0:e.root.getState()}const Ji={obj:i=>i===Object(i)&&!Ji.arr(i)&&typeof i!="function",fun:i=>typeof i=="function",str:i=>typeof i=="string",num:i=>typeof i=="number",boo:i=>typeof i=="boolean",und:i=>i===void 0,nul:i=>i===null,arr:i=>Array.isArray(i),equ(i,e,{arrays:t="shallow",objects:n="reference",strict:s=!0}={}){if(typeof i!=typeof e||!!i!=!!e)return!1;if(Ji.str(i)||Ji.num(i)||Ji.boo(i))return i===e;const a=Ji.obj(i);if(a&&n==="reference")return i===e;const l=Ji.arr(i);if(l&&t==="reference")return i===e;if((l||a)&&i===e)return!0;let u;for(u in i)if(!(u in e))return!1;if(a&&t==="shallow"&&n==="shallow"){for(u in s?e:i)if(!Ji.equ(i[u],e[u],{strict:s,objects:"reference"}))return!1}else for(u in s?e:i)if(i[u]!==e[u])return!1;if(Ji.und(u)){if(l&&i.length===0&&e.length===0||a&&Object.keys(i).length===0&&Object.keys(e).length===0)return!0;
3916if(i!==e)return!1}return!0}};function X8(i){const e={nodes:{},materials:{},meshes:{}};return i&&i.traverse(t=>{t.name&&(e.nodes[t.name]=t),t.material&&!e.materials[t.material.name]&&(e.materials[t.material.name]=t.material),t.isMesh&&!e.meshes[t.name]&&(e.meshes[t.name]=t)}),e}function q8(i){i.type!=="Scene"&&(i.dispose==null||i.dispose());for(const e in i){const t=i[e];t?.type!=="Scene"&&(t==null||t.dispose==null||t.dispose())}}const g3=["children","key","ref"];function Y8(i){const e={};for(const t in i)g3.includes(t)||(e[t]=i[t]);return e}function d_(i,e,t,n){const s=i;let a=s?.__r3f;return a||(a={root:e,type:t,parent:null,children:[],props:Y8(n),object:s,eventCount:0,handlers:{},isHidden:!1},s&&(s.__r3f=a)),a}function ng(i,e){if(!e.includes("-"))return{root:i,key:e,target:i[e]};if(e in i)return{root:i,key:e,target:i[e]};let t=i;const n=e.split("-");for(const s of n){if(typeof t!="object"||t===null){if(t!==void 0){const a=n.slice(n.indexOf(s)).join("-");return{root:t,key:a,target:void 0}}return{root:i,key:e,target:void 0}}e=s,i=t,t=t[e]}return{root:i,key:e,target:t}}const Hw=/-\d+$/;function h_(i,e){if(Ji.str(e.props.attach)){if(Hw.test(e.props.attach)){const s=e.props.attach.replace(Hw,""),{root:a,key:l}=ng(i.object,s);Array.isArray(a[l])||(a[l]=[])}const{root:t,key:n}=ng(i.object,e.props.attach);e.previousAttach=t[n],t[n]=e.object}else Ji.fun(e.props.attach)&&(e.previousAttach=e.props.attach(i.object,e.object))}function p_(i,e){if(Ji.str(e.props.attach)){const{root:t,key:n}=ng(i.object,e.props.attach),s=e.previousAttach;s===void 0?delete t[n]:t[n]=s}else e.previousAttach==null||e.previousAttach(i.object,e.object);delete e.previousAttach}const iA=[...g3,"args","dispose","attach","object","onUpdate","dispose"],Gw=new Map;function J8(i){let e=Gw.get(i.constructor);try{e||(e=new i.constructor,Gw.set(i.constructor,e))}catch{}return e}function K8(i,e){const t={};for(const n in e)if(!iA.includes(n)&&!Ji.equ(e[n],i.props[n])){t[n]=e[n];for(const s in e)s.startsWith(`${n}-`)&&(t[s]=e[s])}for(const n in i.props){if(iA.includes(n)||e.hasOwnProperty(n))continue;const{root:s,key:a}=ng(i.object,n);if(s.constructor&&s.constructor.length===0){const l=J8(s);Ji.und(l)||(t[a]=l[a])}else t[a]=0}return t}const Z8=["map","emissiveMap","sheenColorMap","specularColorMap","envMap"],Q8=/^on(Pointer|Click|DoubleClick|ContextMenu|Wheel)/;function ju(i,e){var t;const n=i.__r3f,s=n&&d3(n).getState(),a=n?.eventCount;for(const u in e){let h=e[u];if(iA.includes(u))continue;if(n&&Q8.test(u)){typeof h=="function"?n.handlers[u]=h:delete n.handlers[u],n.eventCount=Object.keys(n.handlers).length;continue}if(h===void 0)continue;let{root:p,key:m,target:v}=ng(i,u);if(v===void 0&&(typeof p!="object"||p===null))throw Error(`R3F: Cannot set "${u}". Ensure it is an object before setting "${m}".`);if(v instanceof wp&&h instanceof wp)v.mask=h.mask;else if(v instanceof Pt&&G8(h))v.set(h);else if(v!==null&&typeof v=="object"&&typeof v.set=="function"&&typeof v.copy=="function"&&h!=null&&h.constructor&&v.constructor===h.constructor)v.copy(h);else if(v!==null&&typeof v=="object"&&typeof v.set=="function"&&Array.isArray(h))typeof v.fromArray=="function"?v.fromArray(h):v.set(...h);else if(v!==null&&typeof v=="object"&&typeof v.set=="function"&&typeof h=="number")typeof v.setScalar=="function"?v.setScalar(h):v.set(h);else if(p instanceof Zi&&m==="uniforms"&&Ji.obj(h)){Ji.obj(p.uniforms)||(p.uniforms={});const x=p.uniforms,_=h;for(const A in _){const R=_[A],w=x[A];w?Object.assign(w,R):x[A]={...R}}}else{var l;p[m]=h,s&&!s.linear&&Z8.includes(m)&&(l=p[m])!=null&&l.isTexture&&p[m].format===Jr&&p[m].type===vr&&(p[m].colorSpace=xi)}}if(n!=null&&n.parent&&s!=null&&s.internal&&(t=n.object)!=null&&t.isObject3D&&a!==n.eventCount){const u=n.object,h=s.internal.interaction.indexOf(u);h>-1&&s.internal.interaction.splice(h,1),n.eventCount&&u.raycast!==null&&s.internal.interaction.push(u)}return n&&n.props.attach===void 0&&(n.object.isBufferGeometry?n.props.attach="geometry":n.object.isMaterial&&(n.props.attach="material")),n&&Up(n),i}function Up(i){var e;if(!i.parent)return;i.props.onUpdate==null||i.props.onUpdate(i.object);const t=(e=i.root)==null||e.getState==null?void 0:e.getState();t&&t.internal.frames===0&&t.invalidate()}function $8(i,e){i.manual||(h3(i)?(i.left=e.width/-2,i.right=e.width/2,i.top=e.height/2,i.bottom=e.height/-2):i.aspect=e.width/e.height,i.updateProjectionMatrix())}const va=i=>i?.isObject3D;function rx(i){return(i.eventObject||i.object).uuid+"/"+i.index+i.instanceId}function v3(i,e,t,n){const s=t.get(e);s&&(t.delete(e),t.size===0&&(i.delete(n),s.target.releasePointerCapture(n)))}function ek(i,e){const{internal:t}
vendor: 12,057 bytes, lines 3916-3924
3916=i.getState();t.interaction=t.interaction.filter(n=>n!==e),t.initialHits=t.initialHits.filter(n=>n!==e),t.hovered.forEach((n,s)=>{(n.eventObject===e||n.object===e)&&t.hovered.delete(s)}),t.capturedMap.forEach((n,s)=>{v3(t.capturedMap,e,n,s)})}function tk(i){function e(h){const{internal:p}=i.getState(),m=h.offsetX-p.initialClick[0],v=h.offsetY-p.initialClick[1];return Math.round(Math.sqrt(m*m+v*v))}function t(h){return h.filter(p=>["Move","Over","Enter","Out","Leave"].some(m=>{var v;return(v=p.__r3f)==null?void 0:v.handlers["onPointer"+m]}))}function n(h,p){const m=i.getState(),v=new Set,x=[],_=p?p(m.internal.interaction):m.internal.interaction;for(let E=0;E<_.length;E++){const D=op(_[E]);D&&(D.raycaster.camera=void 0)}m.previousRoot||m.events.compute==null||m.events.compute(h,m);function A(E){const D=op(E);if(!D||!D.events.enabled||D.raycaster.camera===null)return[];if(D.raycaster.camera===void 0){var L;D.events.compute==null||D.events.compute(h,D,(L=D.previousRoot)==null?void 0:L.getState()),D.raycaster.camera===void 0&&(D.raycaster.camera=null)}return D.raycaster.camera?D.raycaster.intersectObject(E,!0):[]}let R=_.flatMap(A).sort((E,D)=>{const L=op(E.object),P=op(D.object);return!L||!P?E.distance-D.distance:P.events.priority-L.events.priority||E.distance-D.distance}).filter(E=>{const D=rx(E);return v.has(D)?!1:(v.add(D),!0)});m.events.filter&&(R=m.events.filter(R,m));for(const E of R){let D=E.object;for(;D;){var w;(w=D.__r3f)!=null&&w.eventCount&&x.push({...E,eventObject:D}),D=D.parent}}if("pointerId"in h&&m.internal.capturedMap.has(h.pointerId))for(let E of m.internal.capturedMap.get(h.pointerId).values())v.has(rx(E.intersection))||x.push(E.intersection);return x}function s(h,p,m,v){if(h.length){const x={stopped:!1};for(const _ of h){let A=op(_.object);if(A||_.object.traverseAncestors(R=>{const w=op(R);if(w)return A=w,!1}),A){const{raycaster:R,pointer:w,camera:E,internal:D}=A,L=new se(w.x,w.y,0).unproject(E),P=z=>{var k,ie;return(k=(ie=D.capturedMap.get(z))==null?void 0:ie.has(_.eventObject))!=null?k:!1},G=z=>{const k={intersection:_,target:p.target};D.capturedMap.has(z)?D.capturedMap.get(z).set(_.eventObject,k):D.capturedMap.set(z,new Map([[_.eventObject,k]])),p.target.setPointerCapture(z)},H=z=>{const k=D.capturedMap.get(z);k&&v3(D.capturedMap,_.eventObject,k,z)};let F={};for(let z in p){let k=p[z];typeof k!="function"&&(F[z]=k)}let X={..._,...F,pointer:w,intersections:h,stopped:x.stopped,delta:m,unprojectedPoint:L,ray:R.ray,camera:E,stopPropagation(){const z="pointerId"in p&&D.capturedMap.get(p.pointerId);if((!z||z.has(_.eventObject))&&(X.stopped=x.stopped=!0,D.hovered.size&&Array.from(D.hovered.values()).find(k=>k.eventObject===_.eventObject))){const k=h.slice(0,h.indexOf(_));a([...k,_])}},target:{hasPointerCapture:P,setPointerCapture:G,releasePointerCapture:H},currentTarget:{hasPointerCapture:P,setPointerCapture:G,releasePointerCapture:H},nativeEvent:p};if(v(X),x.stopped===!0)break}}}return h}function a(h){const{internal:p}=i.getState();for(const m of p.hovered.values())if(!h.length||!h.find(v=>v.object===m.object&&v.index===m.index&&v.instanceId===m.instanceId)){const x=m.eventObject.__r3f;if(p.hovered.delete(rx(m)),x!=null&&x.eventCount){const _=x.handlers,A={...m,intersections:h};_.onPointerOut==null||_.onPointerOut(A),_.onPointerLeave==null||_.onPointerLeave(A)}}}function l(h,p){for(let m=0;m<p.length;m++){const v=p[m].__r3f;v==null||v.handlers.onPointerMissed==null||v.handlers.onPointerMissed(h)}}function u(h){switch(h){case"onPointerLeave":case"onPointerCancel":return()=>a([]);case"onLostPointerCapture":return p=>{const{internal:m}=i.getState();"pointerId"in p&&m.capturedMap.has(p.pointerId)&&requestAnimationFrame(()=>{m.capturedMap.has(p.pointerId)&&(m.capturedMap.delete(p.pointerId),a([]))})}}return function(m){const{onPointerMissed:v,internal:x}=i.getState();x.lastEvent.current=m;const _=h==="onPointerMove",A=h==="onClick"||h==="onContextMenu"||h==="onDoubleClick",w=n(m,_?t:void 0),E=A?e(m):0;h==="onPointerDown"&&(x.initialClick=[m.offsetX,m.offsetY],x.initialHits=w.map(L=>L.eventObject)),A&&!w.length&&E<=2&&(l(m,x.interaction),v&&v(m)),_&&a(w);function D(L){const P=L.eventObject,G=P.__r3f;if(!(G!=null&&G.eventCount))return;const H=G.handlers;if(_){if(H.onPointerOver||H.onPointerEnter||H.onPointerOut||H.onPointerLeave){const F=rx(L),X=x.hovered.get(F);X?X.stopped&&L.stopPropagation():(x.hovered.set(F,L),H.onPointerOver==null||H.onPointerOver(L),H.onPointerEnter==null||H.onPointerEnter(L))}H.onPointerMove==null||H.onPointerMove(L)}else{const F=H[h];F?(!A||x.initialHits.includes(P))&&(l(m,x.interaction.filter(X=>!x.initialHits.includes(X))),F(L)):A&&x.initialHits.includes(P)&&l(m,x.interaction.filter(X=>!x.initialHits.includes(X)))}}s(w,m,E,D)}}return{handlePointer:u}}const jw=i=>!!(i!=null&&i.render),y3=q.createContext(null),nk=(i,e)=>{const t=I8((u,h)=>{const p=new se,m=new se,v=new se;function x(E=h().camera,D=m,L=h().size){const{width:P,height:G,top:H,left:F}=L,X=P/G;D.isVector3?v.copy(D):v.set(...D);const z=E.getWorldPosition(p).distanceTo(v);if(h3(E))return{width:P/E.zoom,height:G/E.zoom,top:H,left:F,factor:1,distance:z,aspect:X};{const k=E.fov*Math.PI/180,ie=2*Math.tan(k/2)*z,ve=ie*(P/G);return{width:ve,height:ie,top:H,left:F,factor:P/ve,distance:z,aspect:X}}}let _;const A=E=>u(D=>({performance:{...D.performance,current:E}})),R=new st;return{set:u,get:h,gl:null,camera:null,raycaster:null,events:{priority:1,enabled:!0,connected:!1},scene:null,xr:null,invalidate:(E=1)=>i(h(),E),advance:(E,D)=>e(E,D,h()),legacy:!1,linear:!1,flat:!1,controls:null,clock:new oM,pointer:R,mouse:R,frameloop:"always",onPointerMissed:void 0,performance:{current:1,min:.5,max:1,debounce:200,regress:()=>{const E=h();_&&clearTimeout(_),E.performance.current!==E.performance.min&&A(E.performance.min),_=setTimeout(()=>A(h().performance.max),E.performance.debounce)}},size:{width:0,height:0,top:0,left:0},viewport:{initialDpr:0,dpr:0,width:0,height:0,top:0,left:0,aspect:0,distance:0,factor:0,getCurrentViewport:x},setEvents:E=>u(D=>({...D,events:{...D.events,...E}})),setSize:(E,D,L=0,P=0)=>{const G=h().camera,H={width:E,height:D,top:L,left:P};u(F=>({size:H,viewport:{...F.viewport,...x(G,m,H)}}))},setDpr:E=>u(D=>{const L=m3(E);return{viewport:{...D.viewport,dpr:L,initialDpr:D.viewport.initialDpr||L}}}),setFrameloop:(E="always")=>{const D=h().clock;D.stop(),D.elapsedTime=0,E!=="never"&&(D.start(),D.elapsedTime=0),u(()=>({frameloop:E}))},previousRoot:void 0,internal:{interaction:[],hovered:new Map,subscribers:[],initialClick:[0,0],initialHits:[],capturedMap:new Map,lastEvent:q.createRef(),active:!1,frames:0,priority:0,subscribe:(E,D,L)=>{const P=h().internal;return P.priority=P.priority+(D>0?1:0),P.subscribers.push({ref:E,priority:D,store:L}),P.subscribers=P.subscribers.sort((G,H)=>G.priority-H.priority),()=>{const G=h().internal;G!=null&&G.subscribers&&(G.priority=G.priority-(D>0?1:0),G.subscribers=G.subscribers.filter(H=>H.ref!==E))}}}}}),n=t.getState();let s=n.size,a=n.viewport.dpr,l=n.camera;return t.subscribe(()=>{const{camera:u,size:h,viewport:p,gl:m,set:v}=t.getState();if(h.width!==s.width||h.height!==s.height||p.dpr!==a){s=h,a=p.dpr,$8(u,h),p.dpr>0&&m.setPixelRatio(p.dpr);const x=typeof HTMLCanvasElement<"u"&&m.domElement instanceof HTMLCanvasElement;m.setSize(h.width,h.height,x)}u!==l&&(l=u,v(x=>({viewport:{...x.viewport,...x.viewport.getCurrentViewport(u)}})))}),t.subscribe(u=>i(u)),t};function x3(){const i=q.useContext(y3);if(!i)throw new Error("R3F: Hooks can only be used within the Canvas component!");return i}function Gc(i=t=>t,e){return x3()(i,e)}function ps(i,e=0){const t=x3(),n=t.getState().internal.subscribe,s=p3(i);return yg(()=>n(s,e,t),[e,n,t]),null}const Vw=new WeakMap,ik=i=>{var e;return typeof i=="function"&&(i==null||(e=i.prototype)==null?void 0:e.constructor)===i};function _3(i,e){return function(t,...n){let s;return ik(t)?(s=Vw.get(t),s||(s=new t,Vw.set(t,s))):s=t,i&&i(s),Promise.all(n.map(a=>new Promise((l,u)=>s.load(a,h=>{va(h?.scene)&&Object.assign(h,X8(h.scene)),l(h)},e,h=>u(new Error(`Could not load ${a}: ${h?.message}`))))))}}function xg(i,e,t,n){const s=Array.isArray(e)?e:[e],a=L8(_3(t,n),[i,...s],{equal:Ji.equ});return Array.isArray(e)?a:a[0]}xg.preload=function(i,e,t){const n=Array.isArray(e)?e:[e];return P8(_3(t),[i,...n])};xg.clear=function(i,e){const t=Array.isArray(e)?e:[e];return O8([i,...t])};/**
3917 * @license React
3918 * react-reconciler-constants.production.js
3919 *
3920 * Copyright (c) Meta Platforms, Inc. and affiliates.
3921 *
3922 * This source code is licensed under the MIT license found in the
3923 * LICENSE file in the root directory of this source tree.
3924 */const sk=1,rk=8,ak=32,ok=2;var lk={version:"9.6.0"};function ck(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ww={exports:{}},Xw={exports:{}},qw;function uk(){return qw||(qw=1,(function(i){i.exports=function(e){function t(c,f,y,S){return new sm(c,f,y,S)}function n(){}function s(c){var f="https://react.dev/errors/"+c;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+c+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(c){var f=c,y=c;if(c.alternate)for(;f.return;)f=f.return;else{c=f;do f=c,(f.flags&4098)!==0&&(y=f.return),c=f.return;while(c)}return f.tag===3?y:null}function l(c){if(a(c)!==c)throw Error(s(188))}function u(c){var f=c.alternate;if(!f){if(f=a(c),f===null)throw Error(s(188));return f!==c?null:c}for(var y=c,S=f;;){var B=y.return;if(B===null)break;var O=B.alternate;if(O===null){if(S=B.return,S!==null){y=S;continue}break}if(B.child===O.child){for(O=B.child;O;){if(O===y)return l(B),c;if(O===S)return l(B),f;O=O.sibling}throw Error(s(188))}if(y.return!==S.return)y=B,S=O;else{for(var Z=!1,ge=B.child;ge;){if(ge===y){Z=!0,y=B,S=O;break}if(ge===S){Z=!0,S=B,y=O;break}ge=ge.sibling}if(!Z){for(ge=O.child;ge;){if(ge===y){Z=!0,y=O,S=B;break}if(ge===S){Z=!0,S=O,y=B;break}ge=ge.sibling}if(!Z)throw Error(s(189))}}if(y.alternate!==S)throw Error(s(190))}if(y.tag!==3)throw Error(s(188));return y.stateNode.current===y?c:f}function h(c){var f=c.tag;if(f===5||f===26||f===27||f===6)return c;for(c=c.child;c!==null;){if(f=h(c),f!==null)return f;c=c.sibling}return null}function p(c){var f=c.tag;if(f===5||f===26||f===27||f===6)return c;for(c=c.child;c!==null;){if(c.tag!==4&&(f=p(c),f!==null))return f;c=c.sibling}return null}function m(c){return c===null||typeof c!="object"?null:(c=Go&&c[Go]||c["@@iterator"],typeof c=="function"?c:null)}function v(c){if(c==null)return null;if(typeof c=="function")return c.$$typeof===Al?null:c.displayName||c.name||null;if(typeof c=="string")return c;switch(c){case tc:return"Fragment";case ic:return"Profiler";case nc:return"StrictMode";case ch:return"Suspense";case Ho:return"SuspenseList";case Mf:return"Activity"}if(typeof c=="object")switch(c.$$typeof){case ec:return"Portal";case wa:return c.displayName||"Context";case Af:return(c._context.displayName||"Context")+".Consumer";case cu:var f=c.render;return c=c.displayName,c||(c=f.displayName||f.name||"",c=c!==""?"ForwardRef("+c+")":"ForwardRef"),c;case uh:return f=c.displayName||null,f!==null?f:v(c.type)||"Memo";case Mr:f=c._payload,c=c._init;try{return v(c(f))}catch{}}return null}function x(c){return{current:c}}function _(c){0>lc||(c.current=Ah[lc],Ah[lc]=null,lc--)}function A(c,f){lc++,Ah[lc]=c.current,c.current=f}function R(c){return c>>>=0,c===0?32:31-(Mh(c)/Nv|0)|0}function w(c){var f=c&42;if(f!==0)return f;switch(c&-c){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return c&261888;case 262144:case 524288:case 1048576:case 2097152:return c&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return c&62914560;case 67108864:return 67108864;
vendor: 15,631 bytes, lines 3924-3931
3924case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return c}}function E(c,f,y){var S=c.pendingLanes;if(S===0)return 0;var B=0,O=c.suspendedLanes,Z=c.pingedLanes;c=c.warmLanes;var ge=S&134217727;return ge!==0?(S=ge&~O,S!==0?B=w(S):(Z&=ge,Z!==0?B=w(Z):y||(y=ge&~c,y!==0&&(B=w(y))))):(ge=S&~O,ge!==0?B=w(ge):Z!==0?B=w(Z):y||(y=S&~c,y!==0&&(B=w(y)))),B===0?0:f!==0&&f!==B&&(f&O)===0&&(O=B&-B,y=f&-f,O>=y||O===32&&(y&4194048)!==0)?f:B}function D(c,f){return(c.pendingLanes&~(c.suspendedLanes&~c.pingedLanes)&f)===0}function L(c,f){switch(c){case 1:case 2:case 4:case 8:case 64:return f+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return f+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function P(){var c=gu;return gu<<=1,(gu&62914560)===0&&(gu=4194304),c}function G(c){for(var f=[],y=0;31>y;y++)f.push(c);return f}function H(c,f){c.pendingLanes|=f,f!==268435456&&(c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0)}function F(c,f,y,S,B,O){var Z=c.pendingLanes;c.pendingLanes=y,c.suspendedLanes=0,c.pingedLanes=0,c.warmLanes=0,c.expiredLanes&=y,c.entangledLanes&=y,c.errorRecoveryDisabledLanes&=y,c.shellSuspendCounter=0;var ge=c.entanglements,Je=c.expirationTimes,ht=c.hiddenUpdates;for(y=Z&~y;0<y;){var wt=31-Fr(y),gt=1<<wt;ge[wt]=0,Je[wt]=-1;var jt=ht[wt];if(jt!==null)for(ht[wt]=null,wt=0;wt<jt.length;wt++){var yn=jt[wt];yn!==null&&(yn.lane&=-536870913)}y&=~gt}S!==0&&X(c,S,0),O!==0&&B===0&&c.tag!==0&&(c.suspendedLanes|=O&~(Z&~f))}function X(c,f,y){c.pendingLanes|=f,c.suspendedLanes&=~f;var S=31-Fr(f);c.entangledLanes|=f,c.entanglements[S]=c.entanglements[S]|1073741824|y&261930}function z(c,f){var y=c.entangledLanes|=f;for(c=c.entanglements;y;){var S=31-Fr(y),B=1<<S;B&f|c[S]&f&&(c[S]|=f),y&=~B}}function k(c,f){var y=f&-f;return y=(y&42)!==0?1:ie(y),(y&(c.suspendedLanes|f))!==0?0:y}function ie(c){switch(c){case 2:c=1;break;case 8:c=4;break;case 32:c=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:c=128;break;case 268435456:c=134217728;break;default:c=0}return c}function ve(c){return c&=-c,2<c?8<c?(c&134217727)!==0?32:268435456:8:2}function J(c){if(typeof jm=="function"&&Fv(c),kr&&typeof kr.setStrictMode=="function")try{kr.setStrictMode(fc,c)}catch{}}function le(c,f){return c===f&&(c!==0||1/c===1/f)||c!==c&&f!==f}function ae(c){if(Bh===void 0)try{throw Error()}catch(y){var f=y.stack.trim().match(/\n( *(at )?)/);Bh=f&&f[1]||"",vo=-1<y.stack.indexOf(`
3925    at`)?" (<anonymous>)":-1<y.stack.indexOf("@")?"@unknown:0:0":""}return`
3926`+Bh+c+vo}function W(c,f){if(!c||Lf)return"";Lf=!0;var y=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var S={DetermineComponentFrameRoot:function(){try{if(f){var gt=function(){throw Error()};if(Object.defineProperty(gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(gt,[])}catch(yn){var jt=yn}Reflect.construct(c,[],gt)}else{try{gt.call()}catch(yn){jt=yn}c.call(gt.prototype)}}else{try{throw Error()}catch(yn){jt=yn}(gt=c())&&typeof gt.catch=="function"&&gt.catch(function(){})}}catch(yn){if(yn&&jt&&typeof yn.stack=="string")return[yn.stack,jt.stack]}return[null,null]}};S.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var B=Object.getOwnPropertyDescriptor(S.DetermineComponentFrameRoot,"name");B&&B.configurable&&Object.defineProperty(S.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var O=S.DetermineComponentFrameRoot(),Z=O[0],ge=O[1];if(Z&&ge){var Je=Z.split(`
3927`),ht=ge.split(`
3928`);for(B=S=0;S<Je.length&&!Je[S].includes("DetermineComponentFrameRoot");)S++;for(;B<ht.length&&!ht[B].includes("DetermineComponentFrameRoot");)B++;if(S===Je.length||B===ht.length)for(S=Je.length-1,B=ht.length-1;1<=S&&0<=B&&Je[S]!==ht[B];)B--;for(;1<=S&&0<=B;S--,B--)if(Je[S]!==ht[B]){if(S!==1||B!==1)do if(S--,B--,0>B||Je[S]!==ht[B]){var wt=`
3929`+Je[S].replace(" at new "," at ");return c.displayName&&wt.includes("<anonymous>")&&(wt=wt.replace("<anonymous>",c.displayName)),wt}while(1<=S&&0<=B);break}}}finally{Lf=!1,Error.prepareStackTrace=y}return(y=c?c.displayName||c.name:"")?ae(y):""}function ee(c,f){switch(c.tag){case 26:case 27:case 5:return ae(c.type);case 16:return ae("Lazy");case 13:return c.child!==f&&f!==null?ae("Suspense Fallback"):ae("Suspense");case 19:return ae("SuspenseList");case 0:case 15:return W(c.type,!1);case 11:return W(c.type.render,!1);case 1:return W(c.type,!0);case 31:return ae("Activity");default:return""}}function te(c){try{var f="",y=null;do f+=ee(c,y),y=c,c=c.return;while(c);return f}catch(S){return`
3930Error generating stack: `+S.message+`
3931`+S.stack}}function ue(c,f){if(typeof c=="object"&&c!==null){var y=Vm.get(c);return y!==void 0?y:(f={value:c,source:f,stack:te(f)},Vm.set(c,f),f)}return{value:c,source:f,stack:te(f)}}function he(c,f){Wo[yo++]=Pf,Wo[yo++]=Ti,Ti=c,Pf=f}function K(c,f,y){Ba[ca++]=ir,Ba[ca++]=Va,Ba[ca++]=Ia,Ia=c;var S=ir;c=Va;var B=32-Fr(S)-1;S&=~(1<<B),y+=1;var O=32-Fr(f)+B;if(30<O){var Z=B-B%5;O=(S&(1<<Z)-1).toString(32),S>>=Z,B-=Z,ir=1<<32-Fr(f)+B|y<<B|S,Va=O+c}else ir=1<<O|y<<B|S,Va=c}function ce(c){c.return!==null&&(he(c,1),K(c,1,0))}function re(c){for(;c===Ti;)Ti=Wo[--yo],Wo[yo]=null,Pf=Wo[--yo],Wo[yo]=null;for(;c===Ia;)Ia=Ba[--ca],Ba[ca]=null,Va=Ba[--ca],Ba[ca]=null,ir=Ba[--ca],Ba[ca]=null}function oe(c,f){Ba[ca++]=ir,Ba[ca++]=Va,Ba[ca++]=Ia,ir=f.id,Va=f.overflow,Ia=c}function we(c,f){A(sr,f),A(Xo,c),A(Js,null),c=Qg(f),_(Js),A(Js,c)}function Be(){_(Js),_(Xo),_(sr)}function pe(c){c.memoizedState!==null&&A(Of,c);var f=Js.current,y=du(f,c.type);f!==y&&(A(Xo,c),A(Js,y))}function Re(c){Xo.current===c&&(_(Js),_(Xo)),Of.current===c&&(_(Of),gs?ac._currentValue=rc:ac._currentValue2=rc)}function lt(c){var f=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw an(ue(f,c)),Ih}function ct(c,f){if(!Vi)throw Error(s(175));Mv(c.stateNode,c.type,c.memoizedProps,f,c)||lt(c,!0)}function vt(c){for(Us=c.return;Us;)switch(Us.tag){case 5:case 31:case 13:Tr=!1;return;case 27:case 3:Tr=!0;return;default:Us=Us.return}}function qt(c){if(!Vi||c!==Us)return!1;if(!Gn)return vt(c),Gn=!0,!1;var f=c.tag;if(Ns?f!==3&&f!==27&&(f!==5||mu(c.type)&&!Er(c.type,c.memoizedProps))&&Wi&&lt(c):f!==3&&(f!==5||mu(c.type)&&!Er(c.type,c.memoizedProps))&&Wi&&lt(c),vt(c),f===13){if(!Vi)throw Error(s(316));if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));Wi=Dm(c)}else if(f===31){if(c=c.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(317));Wi=Tv(c)}else Wi=Ns&&f===27?gv(c.type,Wi):Us?mv(c.stateNode):null;return!0}function Wt(){Vi&&(Wi=Us=null,Gn=!1)}function de(){var c=xo;return c!==null&&(jr===null?jr=c:jr.push.apply(jr,c),xo=null),c}function an(c){xo===null?xo=[c]:xo.push(c)}function $e(c,f,y){gs?(A(Da,f._currentValue),f._currentValue=y):(A(Da,f._currentValue2),f._currentValue2=y)}function Qe(c){var f=Da.current;gs?c._currentValue=f:c._currentValue2=f,_(Da)}function Ye(c,f,y){for(;c!==null;){var S=c.alternate;if((c.childLanes&f)!==f?(c.childLanes|=f,S!==null&&(S.childLanes|=f)):S!==null&&(S.childLanes&f)!==f&&(S.childLanes|=f),c===y)break;c=c.return}}function pt(c,f,y,S){var B=c.child;for(B!==null&&(B.return=c);B!==null;){var O=B.dependencies;if(O!==null){var Z=B.child;O=O.firstContext;e:for(;O!==null;){var ge=O;O=B;for(var Je=0;Je<f.length;Je++)if(ge.context===f[Je]){O.lanes|=y,ge=O.alternate,ge!==null&&(ge.lanes|=y),Ye(O.return,y,c),S||(Z=null);break e}O=ge.next}}else if(B.tag===18){if(Z=B.return,Z===null)throw Error(s(341));Z.lanes|=y,O=Z.alternate,O!==null&&(O.lanes|=y),Ye(Z,y,c),Z=null}else Z=B.child;if(Z!==null)Z.return=B;else for(Z=B;Z!==null;){if(Z===c){Z=null;break}if(B=Z.sibling,B!==null){B.return=Z.return,Z=B;break}Z=Z.return}B=Z}}function Ve(c,f,y,S){c=null;for(var B=f,O=!1;B!==null;){if(!O){if((B.flags&524288)!==0)O=!0;else if((B.flags&262144)!==0)break}if(B.tag===10){var Z=B.alternate;if(Z===null)throw Error(s(387));if(Z=Z.memoizedProps,Z!==null){var ge=B.type;ys(B.pendingProps.value,Z.value)||(c!==null?c.push(ge):c=[ge])}}else if(B===Of.current){if(Z=B.alternate,Z===null)throw Error(s(387));Z.memoizedState.memoizedState!==B.memoizedState.memoizedState&&(c!==null?c.push(ac):c=[ac])}B=B.return}c!==null&&pt(f,c,y,S),f.flags|=262144}function ne(c){for(c=c.firstContext;c!==null;){var f=c.context;if(!ys(gs?f._currentValue:f._currentValue2,c.memoizedValue))return!0;c=c.next}return!1}function V(c){Oi=c,Wa=null,c=c.dependencies,c!==null&&(c.firstContext=null)}function Se(c){return et(Oi,c)}function Ie(c,f){return Oi===null&&V(c),et(c,f)}function et(c,f){var y=gs?f._currentValue:f._currentValue2;if(f={context:f,memoizedValue:y,next:null},Wa===null){if(c===null)throw Error(s(308));Wa=f,c.dependencies={lanes:0,firstContext:f},c.flags|=524288}else Wa=Wa.next=f;return y}function Fe(){return{controller:new kv,data:new Map,refCount:0}}function Rt(c){c.refCount--,c.refCount===0&&Ks(Mb,function(){c.controller.abort()})}function qe(){}function yt(c){c!==bi&&c.next===null&&(bi===null?Nf=bi=c:bi=bi.next=c),La=!0,fr||(fr=!0,Zt())}function At(c,f){if(!Dh&&La){Dh=!0;do for(var y=!1,S=Nf;S!==null;){if(c!==0){var B=S.pendingLanes;if(B===0)var O=0;else{var Z=S.suspendedLanes,ge=S.pingedLanes;O=(1<<31-Fr(42|c)+1)-1,O&=B&~(Z&~ge),O=O&201326741?O&201326741|1:O?O|2:0}O!==0&&(y=!0,ft(S,O))}else O=jn,O=E(S,S===In?O:0,S.cancelPendingCommit!==null||S.timeoutHandle!==zr),(O&3)===0||D(S,O)||(y=!0,ft(S,O));S=S.next}while(y);Dh=!1}}function it(){Oe()}function Oe(){La=fr=!1;var c=0;Cl!==0&&sc()&&(c=Cl);for(var f=ur(),y=null,S=Nf;S!==null;){var B=S.next,O=Ct(S,f);O===0?(S.next=null,y===null?Nf=B:y.next=B,B===null&&(bi=y)):(y=S,(c!==0||(O&3)!==0)&&(La=!0)),S=B}Bs!==0&&Bs!==5||At(c),Cl!==0&&(Cl=0)}function Ct(c,f){for(var y=c.suspendedLanes,S=c.pingedLanes,B=c.expirationTimes,O=c.pendingLanes&-62914561;0<O;){var Z=31-Fr(O),ge=1<<Z,Je=B[Z];Je===-1?((ge&y)===0||(ge&S)!==0)&&(B[Z]=L(ge,f)):Je<=f&&(c.expiredLanes|=ge),O&=~ge}if(f=In,y=jn,y=E(c,c===f?y:0,c.cancelPendingCommit!==null||c.timeoutHandle!==zr),S=c.callbackNode,y===0||c===f&&(Ai===2||Ai===9)||c.cancelPendingCommit!==null)return S!==null&&S!==null&&Th(S),c.callbackNode=null,c.callbackPriority=0;if((y&3)===0||D(c,y)){if(f=y&-y,f===c.callbackPriority)return f;switch(S!==null&&Th(S),ve(y)){case 2:case 8:y=zv;break;case 32:y=Df;break;case 268435456:y=Ch;break;default:y=Df}return S=Ft.bind(null,c),y=If(y,S),c.callbackPriority=f,c.callbackNode=y,f}return S!==null&&S!==null&&Th(S),c.callbackPriority=2,c.callbackNode=null,2}function Ft(c,f){if(Bs!==0&&Bs!==5)return c.callbackNode=null,c.callbackPriority=0,null;var y=c.callbackNode;if(po()&&c.callbackNode!==y)return null;var S=jn;return S=E(c,c===In?S:0,c.cancelPendingCommit!==null||c.timeoutHandle!==zr),S===0?null:(ja(c,S,f),Ct(c,ur()),c.callbackNode!=null&&c.callbackNode===y?Ft.bind(null,c):null)}function ft(c,f){if(po())return null;ja(c,f,!0)}function Zt(){gm?vm(function(){(zn&6)!==0?If(wh,it):Oe()}):If(wh,it)}function sn(){if(Cl===0){var c=qo;c===0&&(c=Eh,Eh<<=1,(Eh&261888)===0&&(Eh=256)),Cl=c}return Cl}function cn(c,f){if(vu===null){var y=vu=[];Wm=0,qo=sn(),zs={status:"pending",value:void 0,then:function(S){y.push(S)}}}return Wm++,f.then(_e,_e),f}function _e(){if(--Wm===0&&vu!==null){zs!==null&&(zs.status="fulfilled");var c=vu;vu=null,qo=0,zs=null;for(var f=0;f<c.length;f++)(0,c[f])()}}function Bt(c,f){var y=[],S={status:"pending",value:null,reason:null,then:function(B){y.push(B)}};return c.then(function(){S.status="fulfilled",S.value=f;for(var B=0;B<y.length;B++)(0,y[B])(f)},function(B){for(S.status="rejected",S.reason=B,B=0;B<y.length;B++)(0,y[B])(void 0)}),S}function Ue(){var c=Rl.current;return c!==null?c:In.pooledCache}function nt(c,f){f===null?A(Rl,Rl.current):A(Rl,f.pool)}function bt(){var c=Ue();return c===null?null:{parent:gs?Xi._currentValue:Xi._currentValue2,pool:c}}function mt(c,f){if(ys(c,f))return!0;if(typeof c!="object"||c===null||typeof f!="object"||f===null)return!1;var y=Object.keys(c),S=Object.keys(f);if(y.length!==S.length)return!1;for(S=0;S<y.length;S++){var B=y[S];if(!Ab.call(f,B)||!ys(c[B],f[B]))return!1}return!0}function nn(c){return c=c.status,c==="fulfilled"||c==="rejected"}function kn(c,f,y){switch(y=c[y],y===void 0?c.push(f):y!==f&&(f.then(qe,qe),f=y),f.status){case"fulfilled":return f.value;case"rejected":throw c=f.reason,gn(c),c;default:if(typeof f.status=="string")f.then(qe,qe);else{if(c=In,c!==null&&100<c.shellSuspendCounter)throw Error(s(482));c=f,c.status="pending",c.then(function(S){if(f.status==="pending"){var B=f;B.status="fulfilled",B.value=S}},function(S){if(f.status==="pending"){var B=f;B.status="rejected",B.reason=S}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw c=f.reason,gn(c),c}throw wr=f,Fs}}function Dt(c){try{var f=c._init;return f(c._payload)}catch(y){throw y!==null&&typeof y=="object"&&typeof y.then=="function"?(wr=y,Fs):y}}function Tt(){if(wr===null)throw Error(s(459));var c=wr;return wr=null,c}function gn(c){if(c===Fs||c===Oa)throw Error(s(483))}function En(c){var f=dc;return dc+=1,Bl===null&&(Bl=[]),kn(Bl,c,f)}function Lr(c,f){f=f.props.ref,c.ref=f!==void 0?f:null}function yr(c,f){throw f.$$typeof===$l?Error(s(525)):(c=Object.prototype.toString.call(f),Error(s(31,c==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":c)))}function er(c){function f(He,Ce){if(c){var Xe=He.deletions;Xe===null?(He.deletions=[Ce],He.flags|=16):Xe.push(Ce)}}function y(He,Ce){if(!c)return null;for(;Ce!==null;)f(He,Ce),Ce=Ce.sibling;return null}function S(He){for(var Ce=new Map;He!==null;)He.key!==null?Ce.set(He.key,He):Ce.set(He.index,He),He=He.sibling;return Ce}function B(He,Ce){return He=oa(He,Ce),He.index=0,He.sibling=null,He}function O(He,Ce,Xe){return He.index=Xe,c?(Xe=He.alternate,Xe!==null?(Xe=Xe.index,Xe<Ce?(He.flags|=67108866,Ce):Xe):(He.flags|=67108866,Ce)):(He.flags|=1048576,Ce)}function Z(He){return c&&He.alternate===null&&(He.flags|=67108866),He}function ge(He,Ce,Xe,St){return Ce===null||Ce.tag!==6?(Ce=rm(Xe,He.mode,St),Ce.return=He,Ce):(Ce=B(Ce,Xe),Ce.return=He,Ce)}function Je(He,Ce,Xe,St){var un=Xe.type;return un===tc?wt(He,Ce,Xe.props.children,St,Xe.key):Ce!==null&&(Ce.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===Mr&&Dt(un)===Ce.type)?(Ce=B(Ce,Xe.props),Lr(Ce,Xe),Ce.return=He,Ce):(Ce=ko(Xe.type,Xe.key,Xe.props,null,He.mode,St),Lr(Ce,Xe),Ce.return=He,Ce)}function ht(He,Ce,Xe,St){return Ce===null||Ce.tag!==4||Ce.stateNode.containerInfo!==Xe.containerInfo||Ce.stateNode.implementation!==Xe.implementation?(Ce=om(Xe,He.mode,St),Ce.return=He,Ce):(Ce=B(Ce,Xe.children||[]),Ce.return=He,Ce)}function wt(He,Ce,Xe,St,un){return Ce===null||Ce.tag!==7?(Ce=Ta(Xe,He.mode,St,un),Ce.return=He,Ce):(Ce=B(Ce,Xe),Ce.return=He,Ce)}function gt(He,Ce,Xe){if(typeof Ce=="string"&&Ce!==""||typeof Ce=="number"||typeof Ce=="bigint")return Ce=rm(""+Ce,He.mode,Xe),Ce.return=He,Ce;if(typeof Ce=="object"&&Ce!==null){switch(Ce.$$typeof){case mo:return Xe=ko(Ce.type,Ce.key,Ce.props,null,He.mode,Xe),Lr(Xe,Ce),Xe.return=He,Xe;case ec:return Ce=om(Ce,He.mode,Xe),Ce.return=He,Ce;case Mr:return Ce=Dt(Ce),gt(He,Ce,Xe)}if(Ml(Ce)||m(Ce))return Ce=Ta(Ce,He.mode,Xe,null),Ce.return=He,Ce;if(typeof Ce.then=="function")return gt(He,En(Ce),Xe);
vendor: 8,377 bytes, line 3931
3931if(Ce.$$typeof===wa)return gt(He,Ie(He,Ce),Xe);yr(He,Ce)}return null}function jt(He,Ce,Xe,St){var un=Ce!==null?Ce.key:null;if(typeof Xe=="string"&&Xe!==""||typeof Xe=="number"||typeof Xe=="bigint")return un!==null?null:ge(He,Ce,""+Xe,St);if(typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case mo:return Xe.key===un?Je(He,Ce,Xe,St):null;case ec:return Xe.key===un?ht(He,Ce,Xe,St):null;case Mr:return Xe=Dt(Xe),jt(He,Ce,Xe,St)}if(Ml(Xe)||m(Xe))return un!==null?null:wt(He,Ce,Xe,St,null);if(typeof Xe.then=="function")return jt(He,Ce,En(Xe),St);if(Xe.$$typeof===wa)return jt(He,Ce,Ie(He,Xe),St);yr(He,Xe)}return null}function yn(He,Ce,Xe,St,un){if(typeof St=="string"&&St!==""||typeof St=="number"||typeof St=="bigint")return He=He.get(Xe)||null,ge(Ce,He,""+St,un);if(typeof St=="object"&&St!==null){switch(St.$$typeof){case mo:return He=He.get(St.key===null?Xe:St.key)||null,Je(Ce,He,St,un);case ec:return He=He.get(St.key===null?Xe:St.key)||null,ht(Ce,He,St,un);case Mr:return St=Dt(St),yn(He,Ce,Xe,St,un)}if(Ml(St)||m(St))return He=He.get(Xe)||null,wt(Ce,He,St,un,null);if(typeof St.then=="function")return yn(He,Ce,Xe,En(St),un);if(St.$$typeof===wa)return yn(He,Ce,Xe,Ie(Ce,St),un);yr(Ce,St)}return null}function bs(He,Ce,Xe,St){for(var un=null,rs=null,fn=Ce,Zn=Ce=0,Zs=null;fn!==null&&Zn<Xe.length;Zn++){fn.index>Zn?(Zs=fn,fn=null):Zs=fn.sibling;var fi=jt(He,fn,Xe[Zn],St);if(fi===null){fn===null&&(fn=Zs);break}c&&fn&&fi.alternate===null&&f(He,fn),Ce=O(fi,Ce,Zn),rs===null?un=fi:rs.sibling=fi,rs=fi,fn=Zs}if(Zn===Xe.length)return y(He,fn),Gn&&he(He,Zn),un;if(fn===null){for(;Zn<Xe.length;Zn++)fn=gt(He,Xe[Zn],St),fn!==null&&(Ce=O(fn,Ce,Zn),rs===null?un=fn:rs.sibling=fn,rs=fn);return Gn&&he(He,Zn),un}for(fn=S(fn);Zn<Xe.length;Zn++)Zs=yn(fn,He,Zn,Xe[Zn],St),Zs!==null&&(c&&Zs.alternate!==null&&fn.delete(Zs.key===null?Zn:Zs.key),Ce=O(Zs,Ce,Zn),rs===null?un=Zs:rs.sibling=Zs,rs=Zs);return c&&fn.forEach(function(za){return f(He,za)}),Gn&&he(He,Zn),un}function Eu(He,Ce,Xe,St){if(Xe==null)throw Error(s(151));for(var un=null,rs=null,fn=Ce,Zn=Ce=0,Zs=null,fi=Xe.next();fn!==null&&!fi.done;Zn++,fi=Xe.next()){fn.index>Zn?(Zs=fn,fn=null):Zs=fn.sibling;var za=jt(He,fn,fi.value,St);if(za===null){fn===null&&(fn=Zs);break}c&&fn&&za.alternate===null&&f(He,fn),Ce=O(za,Ce,Zn),rs===null?un=za:rs.sibling=za,rs=za,fn=Zs}if(fi.done)return y(He,fn),Gn&&he(He,Zn),un;if(fn===null){for(;!fi.done;Zn++,fi=Xe.next())fi=gt(He,fi.value,St),fi!==null&&(Ce=O(fi,Ce,Zn),rs===null?un=fi:rs.sibling=fi,rs=fi);return Gn&&he(He,Zn),un}for(fn=S(fn);!fi.done;Zn++,fi=Xe.next())fi=yn(fn,He,Zn,fi.value,St),fi!==null&&(c&&fi.alternate!==null&&fn.delete(fi.key===null?Zn:fi.key),Ce=O(fi,Ce,Zn),rs===null?un=fi:rs.sibling=fi,rs=fi);return c&&fn.forEach(function(Eb){return f(He,Eb)}),Gn&&he(He,Zn),un}function zl(He,Ce,Xe,St){if(typeof Xe=="object"&&Xe!==null&&Xe.type===tc&&Xe.key===null&&(Xe=Xe.props.children),typeof Xe=="object"&&Xe!==null){switch(Xe.$$typeof){case mo:e:{for(var un=Xe.key;Ce!==null;){if(Ce.key===un){if(un=Xe.type,un===tc){if(Ce.tag===7){y(He,Ce.sibling),St=B(Ce,Xe.props.children),St.return=He,He=St;break e}}else if(Ce.elementType===un||typeof un=="object"&&un!==null&&un.$$typeof===Mr&&Dt(un)===Ce.type){y(He,Ce.sibling),St=B(Ce,Xe.props),Lr(St,Xe),St.return=He,He=St;break e}y(He,Ce);break}else f(He,Ce);Ce=Ce.sibling}Xe.type===tc?(St=Ta(Xe.props.children,He.mode,St,Xe.key),St.return=He,He=St):(St=ko(Xe.type,Xe.key,Xe.props,null,He.mode,St),Lr(St,Xe),St.return=He,He=St)}return Z(He);case ec:e:{for(un=Xe.key;Ce!==null;){if(Ce.key===un)if(Ce.tag===4&&Ce.stateNode.containerInfo===Xe.containerInfo&&Ce.stateNode.implementation===Xe.implementation){y(He,Ce.sibling),St=B(Ce,Xe.children||[]),St.return=He,He=St;break e}else{y(He,Ce);break}else f(He,Ce);Ce=Ce.sibling}St=om(Xe,He.mode,St),St.return=He,He=St}return Z(He);case Mr:return Xe=Dt(Xe),zl(He,Ce,Xe,St)}if(Ml(Xe))return bs(He,Ce,Xe,St);if(m(Xe)){if(un=m(Xe),typeof un!="function")throw Error(s(150));return Xe=un.call(Xe),Eu(He,Ce,Xe,St)}if(typeof Xe.then=="function")return zl(He,Ce,En(Xe),St);if(Xe.$$typeof===wa)return zl(He,Ce,Ie(He,Xe),St);yr(He,Xe)}return typeof Xe=="string"&&Xe!==""||typeof Xe=="number"||typeof Xe=="bigint"?(Xe=""+Xe,Ce!==null&&Ce.tag===6?(y(He,Ce.sibling),St=B(Ce,Xe),St.return=He,He=St):(y(He,Ce),St=rm(Xe,He.mode,St),St.return=He,He=St),Z(He)):y(He,Ce)}return function(He,Ce,Xe,St){try{dc=0;var un=zl(He,Ce,Xe,St);return Bl=null,un}catch(fn){if(fn===Fs||fn===Oa)throw fn;var rs=t(29,fn,null,He.mode);return rs.lanes=St,rs.return=He,rs}finally{}}}function Vs(){for(var c=bo,f=hc=bo=0;f<c;){var y=ar[f];ar[f++]=null;var S=ar[f];ar[f++]=null;var B=ar[f];ar[f++]=null;var O=ar[f];if(ar[f++]=null,S!==null&&B!==null){var Z=S.pending;Z===null?B.next=B:(B.next=Z.next,Z.next=B),S.pending=B}O!==0&&Ps(y,B,O)}}function xr(c,f,y,S){ar[bo++]=c,ar[bo++]=f,ar[bo++]=y,ar[bo++]=S,hc|=S,c.lanes|=S,c=c.alternate,c!==null&&(c.lanes|=S)}function ia(c,f,y,S){return xr(c,f,y,S),hi(c)}function Ws(c,f){return xr(c,null,null,f),hi(c)}function Ps(c,f,y){c.lanes|=y;var S=c.alternate;S!==null&&(S.lanes|=y);for(var B=!1,O=c.return;O!==null;)O.childLanes|=y,S=O.alternate,S!==null&&(S.childLanes|=y),O.tag===22&&(c=O.stateNode,c===null||c._visibility&1||(B=!0)),c=O,O=O.return;return c.tag===3?(O=c.stateNode,B&&f!==null&&(B=31-Fr(y),c=O.hiddenUpdates,S=c[B],S===null?c[B]=[f]:S.push(f),f.lane=y|536870912),O):null}function hi(c){if(50<ii)throw ii=0,Gf=null,Error(s(185));for(var f=c.return;f!==null;)c=f,f=c.return;return c.tag===3?c.stateNode:null}function Fi(c){c.updateQueue={baseState:c.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function _r(c,f){c=c.updateQueue,f.updateQueue===c&&(f.updateQueue={baseState:c.baseState,firstBaseUpdate:c.firstBaseUpdate,lastBaseUpdate:c.lastBaseUpdate,shared:c.shared,callbacks:null})}function ui(c){return{lane:c,tag:0,payload:null,callback:null,next:null}}function tr(c,f,y){var S=c.updateQueue;if(S===null)return null;if(S=S.shared,(zn&2)!==0){var B=S.pending;return B===null?f.next=f:(f.next=B.next,B.next=f),S.pending=f,f=hi(c),Ps(c,null,y),f}return xr(c,S,f,y),hi(c)}function xa(c,f,y){if(f=f.updateQueue,f!==null&&(f=f.shared,(y&4194048)!==0)){var S=f.lanes;S&=c.pendingLanes,y|=S,f.lanes=y,z(c,y)}}function It(c,f){var y=c.updateQueue,S=c.alternate;if(S!==null&&(S=S.updateQueue,y===S)){var B=null,O=null;if(y=y.firstBaseUpdate,y!==null){do{var Z={lane:y.lane,tag:y.tag,payload:y.payload,callback:null,next:null};O===null?B=O=Z:O=O.next=Z,y=y.next}while(y!==null);O===null?B=O=f:O=O.next=f}else B=O=f;y={baseState:S.baseState,firstBaseUpdate:B,lastBaseUpdate:O,shared:S.shared,callbacks:S.callbacks},c.updateQueue=y;return}c=y.lastBaseUpdate,c===null?y.firstBaseUpdate=f:c.next=f,y.lastBaseUpdate=f}function Ot(){if(Ph){var c=zs;if(c!==null)throw c}}function Ln(c,f,y,S){Ph=!1;var B=c.updateQueue;ua=!1;var O=B.firstBaseUpdate,Z=B.lastBaseUpdate,ge=B.shared.pending;if(ge!==null){B.shared.pending=null;var Je=ge,ht=Je.next;Je.next=null,Z===null?O=ht:Z.next=ht,Z=Je;var wt=c.alternate;wt!==null&&(wt=wt.updateQueue,ge=wt.lastBaseUpdate,ge!==Z&&(ge===null?wt.firstBaseUpdate=ht:ge.next=ht,wt.lastBaseUpdate=Je))}if(O!==null){var gt=B.baseState;Z=0,wt=ht=Je=null,ge=O;do{var jt=ge.lane&-536870913,yn=jt!==ge.lane;if(yn?(jn&jt)===jt:(S&jt)===jt){jt!==0&&jt===qo&&(Ph=!0),wt!==null&&(wt=wt.next={lane:0,tag:ge.tag,payload:ge.payload,callback:null,next:null});e:{var bs=c,Eu=ge;jt=f;var zl=y;switch(Eu.tag){case 1:if(bs=Eu.payload,typeof bs=="function"){gt=bs.call(zl,gt,jt);break e}gt=bs;break e;case 3:bs.flags=bs.flags&-65537|128;case 0:if(bs=Eu.payload,jt=typeof bs=="function"?bs.call(zl,gt,jt):bs,jt==null)break e;gt=lh({},gt,jt);break e;case 2:ua=!0}}jt=ge.callback,jt!==null&&(c.flags|=64,yn&&(c.flags|=8192),yn=B.callbacks,yn===null?B.callbacks=[jt]:yn.push(jt))}else yn={lane:jt,tag:ge.tag,payload:ge.payload,callback:ge.callback,next:null},wt===null?(ht=wt=yn,Je=gt):wt=wt.next=yn,Z|=jt;if(ge=ge.next,ge===null){if(ge=B.shared.pending,ge===null)break;yn=ge,ge=yn.next,yn.next=null,B.lastBaseUpdate=yn,B.shared.pending=null}}while(!0);wt===null&&(Je=gt),B.baseState=Je,B.firstBaseUpdate=ht,B.lastBaseUpdate=wt,O===null&&(B.shared.lanes=0),Jo|=Z,c.lanes=Z,c.memoizedState=gt}}function Q(c,f){if(typeof c!="function")throw Error(s(191,c));c.call(f)}function ye(c,f){var y=c.callbacks;
vendor: 4,903 bytes, line 3931
3931if(y!==null)for(c.callbacks=null,c=0;c<y.length;c++)Q(y[c],f)}function De(c,f){c=Ao,A(Il,c),A(pc,f),Ao=c|f.baseLanes}function Le(){A(Il,Ao),A(pc,pc.current)}function xe(){Ao=Il.current,_(pc),_(Il)}function dt(c){var f=c.alternate;A(ls,ls.current&1),A(Hr,c),Gr===null&&(f===null||pc.current!==null||f.memoizedState!==null)&&(Gr=c)}function xt(c){A(ls,ls.current),A(Hr,c),Gr===null&&(Gr=c)}function Et(c){c.tag===22?(A(ls,ls.current),A(Hr,c),Gr===null&&(Gr=c)):Nt()}function Nt(){A(ls,ls.current),A(Hr,Hr.current)}function Kt(c){_(Hr),Gr===c&&(Gr=null),_(ls)}function rn(c){for(var f=c;f!==null;){if(f.tag===13){var y=f.memoizedState;if(y!==null&&(y=y.dehydrated,y===null||Tl(y)||gh(y)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}function zt(){throw Error(s(321))}function xn(c,f){if(f===null)return!1;for(var y=0;y<f.length&&y<c.length;y++)if(!ys(c[y],f[y]))return!1;return!0}function Pn(c,f,y,S,B,O){return Yo=O,bn=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,on.H=c===null||c.memoizedState===null?ns:So,qn=!1,O=y(S,B),qn=!1,wn&&(O=Vn(f,y,S,B)),_i(c),O}function _i(c){on.H=fa;var f=en!==null&&en.next!==null;if(Yo=0,mn=en=bn=null,Bn=!1,Na=0,Xa=null,f)throw Error(s(300));c===null||ki||(c=c.dependencies,c!==null&&ne(c)&&(ki=!0))}function Vn(c,f,y,S){bn=c;var B=0;do{if(wn&&(Xa=null),Na=0,wn=!1,25<=B)throw Error(s(301));if(B+=1,mn=en=null,c.updateQueue!=null){var O=c.updateQueue;O.lastEffect=null,O.events=null,O.stores=null,O.memoCache!=null&&(O.memoCache.index=0)}on.H=Dl,O=f(y,S)}while(wn);return O}function Xt(){var c=on.H,f=c.useState()[0];return f=typeof f.then=="function"?Bi(f):f,c=c.useState()[0],(en!==null?en.memoizedState:null)!==c&&(bn.flags|=1024),f}function Yt(){var c=dr!==0;return dr=0,c}function Qi(c,f,y){f.updateQueue=c.updateQueue,f.flags&=-2053,c.lanes&=~y}function Tn(c){if(Bn){for(c=c.memoizedState;c!==null;){var f=c.queue;f!==null&&(f.pending=null),c=c.next}Bn=!1}Yo=0,mn=en=bn=null,wn=!1,Na=dr=0,Xa=null}function pi(){var c={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return mn===null?bn.memoizedState=mn=c:mn=mn.next=c,mn}function Kn(){if(en===null){var c=bn.alternate;c=c!==null?c.memoizedState:null}else c=en.next;var f=mn===null?bn.memoizedState:mn.next;if(f!==null)mn=f,en=c;else{if(c===null)throw bn.alternate===null?Error(s(467)):Error(s(310));en=c,c={memoizedState:en.memoizedState,baseState:en.baseState,baseQueue:en.baseQueue,queue:en.queue,next:null},mn===null?bn.memoizedState=mn=c:mn=mn.next=c}return mn}function Es(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bi(c){var f=Na;return Na+=1,Xa===null&&(Xa=[]),c=kn(Xa,c,f),f=bn,(mn===null?f.memoizedState:mn.next)===null&&(f=f.alternate,on.H=f===null||f.memoizedState===null?ns:So),c}function Un(c){if(c!==null&&typeof c=="object"){if(typeof c.then=="function")return Bi(c);if(c.$$typeof===wa)return Se(c)}throw Error(s(438,String(c)))}function Gi(c){var f=null,y=bn.updateQueue;if(y!==null&&(f=y.memoCache),f==null){var S=bn.alternate;S!==null&&(S=S.updateQueue,S!==null&&(S=S.memoCache,S!=null&&(f={data:S.data.map(function(B){return B.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),y===null&&(y=Es(),bn.updateQueue=y),y.memoCache=f,y=f.data[f.index],y===void 0)for(y=f.data[f.index]=Array(c),S=0;S<c;S++)y[S]=cm;return f.index++,y}function mi(c,f){return typeof f=="function"?f(c):f}function wi(c){var f=Kn();return ms(f,en,c)}function ms(c,f,y){var S=c.queue;if(S===null)throw Error(s(311));S.lastRenderedReducer=y;var B=c.baseQueue,O=S.pending;if(O!==null){if(B!==null){var Z=B.next;B.next=O.next,O.next=Z}f.baseQueue=B=O,S.pending=null}if(O=c.baseState,B===null)c.memoizedState=O;else{f=B.next;var ge=Z=null,Je=null,ht=f,wt=!1;do{var gt=ht.lane&-536870913;if(gt!==ht.lane?(jn&gt)===gt:(Yo&gt)===gt){var jt=ht.revertLane;if(jt===0)Je!==null&&(Je=Je.next={lane:0,revertLane:0,gesture:null,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null}),gt===qo&&(wt=!0);else if((Yo&jt)===jt){ht=ht.next,jt===qo&&(wt=!0);continue}else gt={lane:0,revertLane:ht.revertLane,gesture:null,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null},Je===null?(ge=Je=gt,Z=O):Je=Je.next=gt,bn.lanes|=jt,Jo|=jt;gt=ht.action,qn&&y(O,gt),O=ht.hasEagerState?ht.eagerState:y(O,gt)}else jt={lane:gt,revertLane:ht.revertLane,gesture:ht.gesture,action:ht.action,hasEagerState:ht.hasEagerState,eagerState:ht.eagerState,next:null},Je===null?(ge=Je=jt,Z=O):Je=Je.next=jt,bn.lanes|=gt,Jo|=gt;ht=ht.next}
vendor: 4,227 bytes, line 3931
3931while(ht!==null&&ht!==f);if(Je===null?Z=O:Je.next=ge,!ys(O,c.memoizedState)&&(ki=!0,wt&&(y=zs,y!==null)))throw y;c.memoizedState=O,c.baseState=Z,c.baseQueue=Je,S.lastRenderedState=O}return B===null&&(S.lanes=0),[c.memoizedState,S.dispatch]}function no(c){var f=Kn(),y=f.queue;if(y===null)throw Error(s(311));y.lastRenderedReducer=c;var S=y.dispatch,B=y.pending,O=f.memoizedState;if(B!==null){y.pending=null;var Z=B=B.next;do O=c(O,Z.action),Z=Z.next;while(Z!==B);ys(O,f.memoizedState)||(ki=!0),f.memoizedState=O,f.baseQueue===null&&(f.baseState=O),y.lastRenderedState=O}return[O,S]}function Y(c,f,y){var S=bn,B=Kn(),O=Gn;if(O){if(y===void 0)throw Error(s(407));y=y()}else y=f();var Z=!ys((en||B).memoizedState,y);if(Z&&(B.memoizedState=y,ki=!0),B=B.queue,Wc(N.bind(null,S,B,c),[c]),B.getSnapshot!==f||Z||mn!==null&&mn.memoizedState.tag&1){if(S.flags|=2048,Di(9,{destroy:void 0},I.bind(null,S,B,y,f),null),In===null)throw Error(s(349));O||(Yo&127)!==0||T(S,f,y)}return y}function T(c,f,y){c.flags|=16384,c={getSnapshot:f,value:y},f=bn.updateQueue,f===null?(f=Es(),bn.updateQueue=f,f.stores=[c]):(y=f.stores,y===null?f.stores=[c]:y.push(c))}function I(c,f,y,S){f.value=y,f.getSnapshot=S,j(f)&&fe(c)}function N(c,f,y){return y(function(){j(f)&&fe(c)})}function j(c){var f=c.getSnapshot;c=c.value;try{var y=f();return!ys(c,y)}catch{return!0}}function fe(c){var f=Ws(c,2);f!==null&&es(f,c,2)}function Ae(c){var f=pi();if(typeof c=="function"){var y=c;if(c=y(),qn){J(!0);try{y()}finally{J(!1)}}}return f.memoizedState=f.baseState=c,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:c},f}function tt(c,f,y,S){return c.baseState=y,ms(c,en,typeof S=="function"?S:mi)}function Pe(c,f,y,S,B){if(Gd(c))throw Error(s(485));if(c=f.action,c!==null){var O={payload:B,action:c,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(Z){O.listeners.push(Z)}};on.T!==null?y(!0):O.isTransition=!1,S(O),y=f.pending,y===null?(O.next=f.pending=O,We(f,O)):(O.next=y.next,f.pending=y.next=O)}}function We(c,f){var y=f.action,S=f.payload,B=c.state;if(f.isTransition){var O=on.T,Z={};on.T=Z;try{var ge=y(B,S),Je=on.S;Je!==null&&Je(Z,ge),Ze(c,f,ge)}catch(ht){Lt(c,f,ht)}finally{O!==null&&Z.types!==null&&(O.types=Z.types),on.T=O}}else try{O=y(B,S),Ze(c,f,O)}catch(ht){Lt(c,f,ht)}}function Ze(c,f,y){y!==null&&typeof y=="object"&&typeof y.then=="function"?y.then(function(S){je(c,f,S)},function(S){return Lt(c,f,S)}):je(c,f,y)}function je(c,f,y){f.status="fulfilled",f.value=y,Ut(f),c.state=y,f=c.pending,f!==null&&(y=f.next,y===f?c.pending=null:(y=y.next,f.next=y,We(c,y)))}function Lt(c,f,y){var S=c.pending;if(c.pending=null,S!==null){S=S.next;do f.status="rejected",f.reason=y,Ut(f),f=f.next;while(f!==S)}c.action=null}function Ut(c){c=c.listeners;for(var f=0;f<c.length;f++)(0,c[f])()}function Mt(c,f){return f}function _t(c,f){if(Gn){var y=In.formState;if(y!==null){e:{var S=bn;if(Gn){if(Wi){var B=pv(Wi,Tr);if(B){Wi=mv(B),S=Cm(B);break e}}lt(S)}S=!1}S&&(f=y[0])}}y=pi(),y.memoizedState=y.baseState=f,S={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Mt,lastRenderedState:f},y.queue=S,y=Tg.bind(null,bn,S),S.dispatch=y,S=Ae(!1);var O=Hd.bind(null,bn,!1,S.queue);return S=pi(),B={state:f,dispatch:null,action:c,pending:null},S.queue=B,y=Pe.bind(null,bn,B,O,y),B.dispatch=y,S.memoizedState=c,[f,y,!1]}function Ht(c){var f=Kn();return ni(f,en,c)}function ni(c,f,y){if(f=ms(c,f,Mt)[0],c=wi(mi)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var S=Bi(f)}catch(Z){throw Z===Fs?Oa:Z}else S=f;f=Kn();var B=f.queue,O=B.dispatch;return y!==f.memoizedState&&(bn.flags|=2048,Di(9,{destroy:void 0},Ii.bind(null,B,y),null)),[S,O,c]}function Ii(c,f){c.action=f}function Ts(c){var f=Kn(),y=en;if(y!==null)return ni(f,y,c);Kn(),f=f.memoizedState,y=Kn();var S=y.queue.dispatch;return y.memoizedState=c,[f,S,!1]}function Di(c,f,y,S){return c={tag:c,create:y,deps:S,inst:f,next:null},f=bn.updateQueue,f===null&&(f=Es(),bn.updateQueue=f),y=f.lastEffect,y===null?f.lastEffect=c.next=c:(S=y.next,y.next=c,c.next=S,f.lastEffect=c),c}function sa(){return Kn().memoizedState}function _a(c,f,y,S){var B=pi();bn.flags|=c,B.memoizedState=Di(1|f,{destroy:void 0},y,S===void 0?null:S)}
vendor: 14,687 bytes, line 3931
3931function rf(c,f,y,S){var B=Kn();S=S===void 0?null:S;var O=B.memoizedState.inst;en!==null&&S!==null&&xn(S,en.memoizedState.deps)?B.memoizedState=Di(f,O,y,S):(bn.flags|=c,B.memoizedState=Di(1|f,O,y,S))}function af(c,f){_a(8390656,8,c,f)}function Wc(c,f){rf(2048,8,c,f)}function bg(c){bn.flags|=4;var f=bn.updateQueue;if(f===null)f=Es(),bn.updateQueue=f,f.events=[c];else{var y=f.events;y===null?f.events=[c]:y.push(c)}}function br(c){var f=Kn().memoizedState;return bg({ref:f,nextImpl:c}),function(){if((zn&2)!==0)throw Error(s(440));return f.impl.apply(void 0,arguments)}}function dl(c,f){return rf(4,2,c,f)}function of(c,f){return rf(4,4,c,f)}function Xc(c,f){if(typeof f=="function"){c=c();var y=f(c);return function(){typeof y=="function"?y():f(null)}}if(f!=null)return c=c(),f.current=c,function(){f.current=null}}function Sg(c,f,y){y=y!=null?y.concat([c]):null,rf(4,4,Xc.bind(null,f,c),y)}function lf(){}function Fd(c,f){var y=Kn();f=f===void 0?null:f;var S=y.memoizedState;return f!==null&&xn(f,S[1])?S[0]:(y.memoizedState=[c,f],c)}function qc(c,f){var y=Kn();f=f===void 0?null:f;var S=y.memoizedState;if(f!==null&&xn(f,S[1]))return S[0];if(S=c(),qn){J(!0);try{c()}finally{J(!1)}}return y.memoizedState=[S,f],S}function Yc(c,f,y){return y===void 0||(Yo&1073741824)!==0&&(jn&261930)===0?c.memoizedState=f:(c.memoizedState=y,c=Uo(),bn.lanes|=c,Jo|=c,y)}function zp(c,f,y,S){return ys(y,f)?y:pc.current!==null?(c=Yc(c,y,S),ys(c,f)||(ki=!0),c):(Yo&42)===0||(Yo&1073741824)!==0&&(jn&261930)===0?(ki=!0,c.memoizedState=y):(c=Uo(),bn.lanes|=c,Jo|=c,f)}function Ag(c,f,y,S,B){var O=Ca();Hn(O!==0&&8>O?O:8);var Z=on.T,ge={};on.T=ge,Hd(c,!1,f,y);try{var Je=B(),ht=on.S;if(ht!==null&&ht(ge,Je),Je!==null&&typeof Je=="object"&&typeof Je.then=="function"){var wt=Bt(Je,S);cf(c,f,wt,ji(c))}else cf(c,f,S,ji(c))}catch(gt){cf(c,f,{then:function(){},status:"rejected",reason:gt},ji())}finally{Hn(O),Z!==null&&ge.types!==null&&(Z.types=ge.types),on.T=Z}}function Mg(c){var f=c.memoizedState;if(f!==null)return f;f={memoizedState:rc,baseState:rc,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:rc},next:null};var y={};return f.next={memoizedState:y,baseState:y,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:mi,lastRenderedState:y},next:null},c.memoizedState=f,c=c.alternate,c!==null&&(c.memoizedState=f),f}function Fp(){return Se(ac)}function kd(){return Kn().memoizedState}function Eg(){return Kn().memoizedState}function hb(c){for(var f=c.return;f!==null;){switch(f.tag){case 24:case 3:var y=ji();c=ui(y);var S=tr(f,c,y);S!==null&&(es(S,f,y),xa(S,f,y)),f={cache:Fe()},c.payload=f;return}f=f.return}}function pb(c,f,y){var S=ji();y={lane:S,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null},Gd(c)?wg(f,y):(y=ia(c,f,y,S),y!==null&&(es(y,c,S),Cg(y,f,S)))}function Tg(c,f,y){var S=ji();cf(c,f,y,S)}function cf(c,f,y,S){var B={lane:S,revertLane:0,gesture:null,action:y,hasEagerState:!1,eagerState:null,next:null};if(Gd(c))wg(f,B);else{var O=c.alternate;if(c.lanes===0&&(O===null||O.lanes===0)&&(O=f.lastRenderedReducer,O!==null))try{var Z=f.lastRenderedState,ge=O(Z,y);if(B.hasEagerState=!0,B.eagerState=ge,ys(ge,Z))return xr(c,f,B,0),In===null&&Vs(),!1}catch{}finally{}if(y=ia(c,f,B,S),y!==null)return es(y,c,S),Cg(y,f,S),!0}return!1}function Hd(c,f,y,S){if(S={lane:2,revertLane:sn(),gesture:null,action:S,hasEagerState:!1,eagerState:null,next:null},Gd(c)){if(f)throw Error(s(479))}else f=ia(c,y,S,2),f!==null&&es(f,c,2)}function Gd(c){var f=c.alternate;return c===bn||f!==null&&f===bn}function wg(c,f){wn=Bn=!0;var y=c.pending;y===null?f.next=f:(f.next=y.next,y.next=f),c.pending=f}function Cg(c,f,y){if((y&4194048)!==0){var S=f.lanes;S&=c.pendingLanes,y|=S,f.lanes=y,z(c,y)}}function kp(c,f,y,S){f=c.memoizedState,y=y(S,f),y=y==null?f:lh({},f,y),c.memoizedState=y,c.lanes===0&&(c.updateQueue.baseState=y)}function jd(c,f,y,S,B,O,Z){return c=c.stateNode,typeof c.shouldComponentUpdate=="function"?c.shouldComponentUpdate(S,O,Z):f.prototype&&f.prototype.isPureReactComponent?!mt(y,S)||!mt(B,O):!0}function Rg(c,f,y,S){c=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(y,S),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(y,S),f.state!==c&&Uf.enqueueReplaceState(f,f.state,null)}function Xl(c,f){var y=f;if("ref"in f){y={};for(var S in f)S!=="ref"&&(y[S]=f[S])}if(c=c.defaultProps){y===f&&(y=lh({},y));for(var B in c)y[B]===void 0&&(y[B]=c[B])}return y}function Vd(c,f){try{var y=c.onUncaughtError;y(f.value,{componentStack:f.stack})}catch(S){setTimeout(function(){throw S})}}function Hp(c,f,y){try{var S=c.onCaughtError;S(y.value,{componentStack:y.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(B){setTimeout(function(){throw B})}}function Gp(c,f,y){return y=ui(y),y.tag=3,y.payload={element:null},y.callback=function(){Vd(c,f)},y}function Bg(c){return c=ui(c),c.tag=3,c}function Ig(c,f,y,S){var B=y.type.getDerivedStateFromError;if(typeof B=="function"){var O=S.value;c.payload=function(){return B(O)},c.callback=function(){Hp(f,y,S)}}var Z=y.stateNode;Z!==null&&typeof Z.componentDidCatch=="function"&&(c.callback=function(){Hp(f,y,S),typeof B!="function"&&(Ko===null?Ko=new Set([this]):Ko.add(this));var ge=S.stack;this.componentDidCatch(S.value,{componentStack:ge!==null?ge:""})})}function mb(c,f,y,S,B){if(y.flags|=32768,S!==null&&typeof S=="object"&&typeof S.then=="function"){if(f=y.alternate,f!==null&&Ve(f,y,B,!0),y=Hr.current,y!==null){switch(y.tag){case 31:case 13:return Gr===null?ru():y.alternate===null&&ss===0&&(ss=3),y.flags&=-257,y.flags|=65536,y.lanes=B,S===_o?y.flags|=16384:(f=y.updateQueue,f===null?y.updateQueue=new Set([S]):f.add(S),lu(c,S,B)),!1;case 22:return y.flags|=65536,S===_o?y.flags|=16384:(f=y.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([S])},y.updateQueue=f):(y=f.retryQueue,y===null?f.retryQueue=new Set([S]):y.add(S)),lu(c,S,B)),!1}throw Error(s(435,y.tag))}return lu(c,S,B),ru(),!1}if(Gn)return f=Hr.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=B,S!==Ih&&(c=Error(s(422),{cause:S}),an(ue(c,y)))):(S!==Ih&&(f=Error(s(423),{cause:S}),an(ue(f,y))),c=c.current.alternate,c.flags|=65536,B&=-B,c.lanes|=B,S=ue(S,y),B=Gp(c.stateNode,S,B),It(c,B),ss!==4&&(ss=2)),!1;var O=Error(s(520),{cause:S});if(O=ue(O,y),Ff===null?Ff=[O]:Ff.push(O),ss!==4&&(ss=2),f===null)return!0;S=ue(S,y),y=f;do{switch(y.tag){case 3:return y.flags|=65536,c=B&-B,y.lanes|=c,c=Gp(y.stateNode,S,c),It(y,c),!1;case 1:if(f=y.type,O=y.stateNode,(y.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||O!==null&&typeof O.componentDidCatch=="function"&&(Ko===null||!Ko.has(O))))return y.flags|=65536,B&=-B,y.lanes|=B,B=Bg(B),Ig(B,c,y,S),It(y,B),!1}y=y.return}while(y!==null);return!1}function nr(c,f,y,S){f.child=c===null?Xm(f,null,y,S):rr(f,c.child,y,S)}function Dg(c,f,y,S,B){y=y.render;var O=f.ref;if("ref"in S){var Z={};for(var ge in S)ge!=="ref"&&(Z[ge]=S[ge])}else Z=S;return V(f),S=Pn(c,f,y,Z,O,B),ge=Yt(),c!==null&&!ki?(Qi(c,f,B),io(c,f,B)):(Gn&&ge&&ce(f),f.flags|=1,nr(c,f,S,B),f.child)}function Lg(c,f,y,S,B){if(c===null){var O=y.type;return typeof O=="function"&&!Zl(O)&&O.defaultProps===void 0&&y.compare===null?(f.tag=15,f.type=O,Pg(c,f,O,S,B)):(c=ko(y.type,null,S,f,f.mode,B),c.ref=f.ref,c.return=f,f.child=c)}if(O=c.child,!ff(c,B)){var Z=O.memoizedProps;if(y=y.compare,y=y!==null?y:mt,y(Z,S)&&c.ref===f.ref)return io(c,f,B)}return f.flags|=1,c=oa(O,S),c.ref=f.ref,c.return=f,f.child=c}function Pg(c,f,y,S,B){if(c!==null){var O=c.memoizedProps;if(mt(O,S)&&c.ref===f.ref)if(ki=!1,f.pendingProps=S=O,ff(c,B))(c.flags&131072)!==0&&(ki=!0);else return f.lanes=c.lanes,io(c,f,B)}return Xd(c,f,y,S,B)}function Og(c,f,y,S){var B=S.children,O=c!==null?c.memoizedState:null;if(c===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),S.mode==="hidden"){if((f.flags&128)!==0){if(O=O!==null?O.baseLanes|y:y,c!==null){for(S=f.child=c.child,B=0;S!==null;)B=B|S.lanes|S.childLanes,S=S.sibling;S=B&~O}else S=0,f.child=null;return Jc(c,f,O,y,S)}if((y&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},c!==null&&nt(f,O!==null?O.cachePool:null),O!==null?De(f,O):Le(),Et(f);else return S=f.lanes=536870912,Jc(c,f,O!==null?O.baseLanes|y:y,y,S)}else O!==null?(nt(f,O.cachePool),De(f,O),Nt(),f.memoizedState=null):(c!==null&&nt(f,null),Le(),Nt());return nr(c,f,B,y),f.child}function ql(c,f){return c!==null&&c.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function Jc(c,f,y,S,B){var O=Ue();return O=O===null?null:{parent:gs?Xi._currentValue:Xi._currentValue2,pool:O},f.memoizedState={baseLanes:y,cachePool:O},c!==null&&nt(f,null),Le(),Et(f),c!==null&&Ve(c,f,S,!0),f.childLanes=B,null}function Wd(c,f){return f=hl({mode:f.mode,children:f.children},c.mode),f.ref=c.ref,c.child=f,f.return=c,f}function jp(c,f,y){return rr(f,c.child,null,y),c=Wd(f,f.pendingProps),c.flags|=2,Kt(f),f.memoizedState=null,c}function Ng(c,f,y){var S=f.pendingProps,B=(f.flags&128)!==0;if(f.flags&=-129,c===null){if(Gn){if(S.mode==="hidden")return c=Wd(f,S),f.lanes=536870912,ql(null,c);if(xt(f),(c=Wi)?(c=Bm(c,Tr),c!==null&&(f.memoizedState={dehydrated:c,treeContext:Ia!==null?{id:ir,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},y=am(c),y.return=f,f.child=y,Us=f,Wi=null)):c=null,c===null)throw lt(f);return f.lanes=536870912,null}return Wd(f,S)}var O=c.memoizedState;if(O!==null){var Z=O.dehydrated;if(xt(f),B)if(f.flags&256)f.flags&=-257,f=jp(c,f,y);else if(f.memoizedState!==null)f.child=c.child,f.flags|=128,f=null;else throw Error(s(558));else if(ki||Ve(c,f,y,!1),B=(y&c.childLanes)!==0,ki||B){if(S=In,S!==null&&(Z=k(S,y),Z!==0&&Z!==O.retryLane))throw O.retryLane=Z,Ws(c,Z),es(S,c,Z),Cr;ru(),f=jp(c,f,y)}else c=O.treeContext,Vi&&(Wi=xv(Z),Us=f,Gn=!0,xo=null,Tr=!1,c!==null&&oe(f,c)),f=Wd(f,S),f.flags|=4096;return f}return c=oa(c.child,{mode:S.mode,children:S.children}),c.ref=f.ref,f.child=c,c.return=f,c}function uf(c,f){var y=f.ref;if(y===null)c!==null&&c.ref!==null&&(f.flags|=4194816);else{if(typeof y!="function"&&typeof y!="object")throw Error(s(284));(c===null||c.ref!==y)&&(f.flags|=4194816)}}function Xd(c,f,y,S,B){return V(f),y=Pn(c,f,y,S,void 0,B),S=Yt(),c!==null&&!ki?(Qi(c,f,B),io(c,f,B)):(Gn&&S&&ce(f),f.flags|=1,nr(c,f,y,B),f.child)}function Vp(c,f,y,S,B,O){return V(f),f.updateQueue=null,y=Vn(f,S,y,B),_i(c),S=Yt(),c!==null&&!ki?(Qi(c,f,O),io(c,f,O)):(Gn&&S&&ce(f),f.flags|=1,nr(c,f,y,O),f.child)}function Yl(c,f,y,S,B){if(V(f),f.stateNode===null){var O=go,Z=y.contextType;typeof Z=="object"&&Z!==null&&(O=Se(Z)),O=new y(S,O),f.memoizedState=O.state!==null&&O.state!==void 0?O.state:null,O.updater=Uf,f.stateNode=O,O._reactInternals=f,O=f.stateNode,O.props=S,O.state=f.memoizedState,O.refs={},Fi(f),Z=y.contextType,O.context=typeof Z=="object"&&Z!==null?Se(Z):go,O.state=f.memoizedState,Z=y.getDerivedStateFromProps,typeof Z=="function"&&(kp(f,y,Z,S),O.state=f.memoizedState),typeof y.getDerivedStateFromProps=="function"||typeof O.getSnapshotBeforeUpdate=="function"||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(Z=O.state,typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount(),Z!==O.state&&Uf.enqueueReplaceState(O,O.state,null),Ln(f,S,O,B),Ot(),O.state=f.memoizedState),typeof O.componentDidMount=="function"&&(f.flags|=4194308),S=!0}else if(c===null){O=f.stateNode;var ge=f.memoizedProps,Je=Xl(y,ge);O.props=Je;var ht=O.context,wt=y.contextType;Z=go,typeof wt=="object"&&wt!==null&&(Z=Se(wt));var gt=y.getDerivedStateFromProps;wt=typeof gt=="function"||typeof O.getSnapshotBeforeUpdate=="function",ge=f.pendingProps!==ge,wt||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(ge||ht!==Z)&&Rg(f,O,S,Z),ua=!1;var jt=f.memoizedState;O.state=jt,Ln(f,S,O,B),Ot(),ht=f.memoizedState,ge||jt!==ht||ua?(typeof gt=="function"&&(kp(f,y,gt,S),ht=f.memoizedState),(Je=ua||jd(f,y,Je,S,jt,ht,Z))?(wt||typeof O.UNSAFE_componentWillMount!="function"&&typeof O.componentWillMount!="function"||(typeof O.componentWillMount=="function"&&O.componentWillMount(),typeof O.UNSAFE_componentWillMount=="function"&&O.UNSAFE_componentWillMount()),typeof O.componentDidMount=="function"&&(f.flags|=4194308)):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=S,f.memoizedState=ht),O.props=S,O.state=ht,O.context=Z,S=Je):(typeof O.componentDidMount=="function"&&(f.flags|=4194308),S=!1)}else{O=f.stateNode,_r(c,f),Z=f.memoizedProps,wt=Xl(y,Z),O.props=wt,gt=f.pendingProps,jt=O.context,ht=y.contextType,Je=go,typeof ht=="object"&&ht!==null&&(Je=Se(ht)),ge=y.getDerivedStateFromProps,(ht=typeof ge=="function"||typeof O.getSnapshotBeforeUpdate=="function")||typeof O.UNSAFE_componentWillReceiveProps!="function"&&typeof O.componentWillReceiveProps!="function"||(Z!==gt||jt!==Je)&&Rg(f,O,S,Je),ua=!1,jt=f.memoizedState,O.state=jt,Ln(f,S,O,B),Ot();var yn=f.memoizedState;Z!==gt||jt!==yn||ua||c!==null&&c.dependencies!==null&&ne(c.dependencies)?(typeof ge=="function"&&(kp(f,y,ge,S),yn=f.memoizedState),(wt=ua||jd(f,y,wt,S,jt,yn,Je)||c!==null&&c.dependencies!==null&&ne(c.dependencies))?(ht||typeof O.UNSAFE_componentWillUpdate!="function"&&typeof O.componentWillUpdate!="function"||(typeof O.componentWillUpdate=="function"&&O.componentWillUpdate(S,yn,Je),typeof O.UNSAFE_componentWillUpdate=="function"&&O.UNSAFE_componentWillUpdate(S,yn,Je)),typeof O.componentDidUpdate=="function"&&(f.flags|=4),typeof O.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof O.componentDidUpdate!="function"||Z===c.memoizedProps&&jt===c.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&jt===c.memoizedState||(f.flags|=1024),f.memoizedProps=S,f.memoizedState=yn),O.props=S,O.state=yn,O.context=Je,S=wt):(typeof O.componentDidUpdate!="function"||Z===c.memoizedProps&&jt===c.memoizedState||(f.flags|=4),typeof O.getSnapshotBeforeUpdate!="function"||Z===c.memoizedProps&&jt===c.memoizedState||(f.flags|=1024),S=!1)}return O=S,uf(c,f),S=(f.flags&128)!==0,O||S?(O=f.stateNode,y=S&&typeof y.getDerivedStateFromError!="function"?null:O.render(),f.flags|=1,c!==null&&S?(f.child=rr(f,c.child,null,B),f.child=rr(f,null,y,B)):nr(c,f,y,B),f.memoizedState=O.state,c=f.child):c=io(c,f,B),c}function Ug(c,f,y,S){return Wt(),f.flags|=256,nr(c,f,y,S),f.child}function Wp(c){return{baseLanes:c,cachePool:bt()}}function Xp(c,f,y){return c=c!==null?c.childLanes&~y:0,f&&(c|=Rr),
vendor: 5,905 bytes, line 3931
3931c}function qp(c,f,y){var S=f.pendingProps,B=!1,O=(f.flags&128)!==0,Z;if((Z=O)||(Z=c!==null&&c.memoizedState===null?!1:(ls.current&2)!==0),Z&&(B=!0,f.flags&=-129),Z=(f.flags&32)!==0,f.flags&=-33,c===null){if(Gn){if(B?dt(f):Nt(),(c=Wi)?(c=Av(c,Tr),c!==null&&(f.memoizedState={dehydrated:c,treeContext:Ia!==null?{id:ir,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},y=am(c),y.return=f,f.child=y,Us=f,Wi=null)):c=null,c===null)throw lt(f);return gh(c)?f.lanes=32:f.lanes=536870912,null}var ge=S.children;return S=S.fallback,B?(Nt(),B=f.mode,ge=hl({mode:"hidden",children:ge},B),S=Ta(S,B,y,null),ge.return=f,S.return=f,ge.sibling=S,f.child=ge,S=f.child,S.memoizedState=Wp(y),S.childLanes=Xp(c,Z,y),f.memoizedState=mc,ql(null,S)):(dt(f),qd(f,ge))}var Je=c.memoizedState;if(Je!==null&&(ge=Je.dehydrated,ge!==null)){if(O)f.flags&256?(dt(f),f.flags&=-257,f=Jl(c,f,y)):f.memoizedState!==null?(Nt(),f.child=c.child,f.flags|=128,f=null):(Nt(),ge=S.fallback,B=f.mode,S=hl({mode:"visible",children:S.children},B),ge=Ta(ge,B,y,null),ge.flags|=2,S.return=f,ge.return=f,S.sibling=ge,f.child=S,rr(f,c.child,null,y),S=f.child,S.memoizedState=Wp(y),S.childLanes=Xp(c,Z,y),f.memoizedState=mc,f=ql(null,S));else if(dt(f),gh(ge))Z=vh(ge).digest,S=Error(s(419)),S.stack="",S.digest=Z,an({value:S,source:null,stack:null}),f=Jl(c,f,y);else if(ki||Ve(c,f,y,!1),Z=(y&c.childLanes)!==0,ki||Z){if(Z=In,Z!==null&&(S=k(Z,y),S!==0&&S!==Je.retryLane))throw Je.retryLane=S,Ws(c,S),es(Z,c,S),Cr;Tl(ge)||ru(),f=Jl(c,f,y)}else Tl(ge)?(f.flags|=192,f.child=c.child,f=null):(c=Je.treeContext,Vi&&(Wi=_v(ge),Us=f,Gn=!0,xo=null,Tr=!1,c!==null&&oe(f,c)),f=qd(f,S.children),f.flags|=4096);return f}return B?(Nt(),ge=S.fallback,B=f.mode,Je=c.child,O=Je.sibling,S=oa(Je,{mode:"hidden",children:S.children}),S.subtreeFlags=Je.subtreeFlags&65011712,O!==null?ge=oa(O,ge):(ge=Ta(ge,B,y,null),ge.flags|=2),ge.return=f,S.return=f,S.sibling=ge,f.child=S,ql(null,S),S=f.child,ge=c.child.memoizedState,ge===null?ge=Wp(y):(B=ge.cachePool,B!==null?(Je=gs?Xi._currentValue:Xi._currentValue2,B=B.parent!==Je?{parent:Je,pool:Je}:B):B=bt(),ge={baseLanes:ge.baseLanes|y,cachePool:B}),S.memoizedState=ge,S.childLanes=Xp(c,Z,y),f.memoizedState=mc,ql(c.child,S)):(dt(f),y=c.child,c=y.sibling,y=oa(y,{mode:"visible",children:S.children}),y.return=f,y.sibling=null,c!==null&&(Z=f.deletions,Z===null?(f.deletions=[c],f.flags|=16):Z.push(c)),f.child=y,f.memoizedState=null,y)}function qd(c,f){return f=hl({mode:"visible",children:f},c.mode),f.return=c,c.child=f}function hl(c,f){return c=t(22,c,null,f),c.lanes=0,c}function Jl(c,f,y){return rr(f,c.child,null,y),c=qd(f,f.pendingProps.children),c.flags|=2,f.memoizedState=null,c}function zg(c,f,y){c.lanes|=f;var S=c.alternate;S!==null&&(S.lanes|=f),Ye(c.return,f,y)}function Kc(c,f,y,S,B,O){var Z=c.memoizedState;Z===null?c.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:S,tail:y,tailMode:B,treeForkCount:O}:(Z.isBackwards=f,Z.rendering=null,Z.renderingStartTime=0,Z.last=S,Z.tail=y,Z.tailMode=B,Z.treeForkCount=O)}function Yp(c,f,y){var S=f.pendingProps,B=S.revealOrder,O=S.tail;S=S.children;var Z=ls.current,ge=(Z&2)!==0;if(ge?(Z=Z&1|2,f.flags|=128):Z&=1,A(ls,Z),nr(c,f,S,y),S=Gn?Pf:0,!ge&&c!==null&&(c.flags&128)!==0)e:for(c=f.child;c!==null;){if(c.tag===13)c.memoizedState!==null&&zg(c,y,f);else if(c.tag===19)zg(c,y,f);else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===f)break e;for(;c.sibling===null;){if(c.return===null||c.return===f)break e;c=c.return}c.sibling.return=c.return,c=c.sibling}switch(B){case"forwards":for(y=f.child,B=null;y!==null;)c=y.alternate,c!==null&&rn(c)===null&&(B=y),y=y.sibling;y=B,y===null?(B=f.child,f.child=null):(B=y.sibling,y.sibling=null),Kc(f,!1,B,y,O,S);break;case"backwards":case"unstable_legacy-backwards":for(y=null,B=f.child,f.child=null;B!==null;){if(c=B.alternate,c!==null&&rn(c)===null){f.child=B;break}c=B.sibling,B.sibling=y,y=B,B=c}Kc(f,!0,y,null,O,S);break;case"together":Kc(f,!1,null,null,void 0,S);break;default:f.memoizedState=null}return f.child}function io(c,f,y){if(c!==null&&(f.dependencies=c.dependencies),Jo|=f.lanes,(y&f.childLanes)===0)if(c!==null){if(Ve(c,f,y,!1),(y&f.childLanes)===0)return null}else return null;if(c!==null&&f.child!==c.child)throw Error(s(153));if(f.child!==null){for(c=f.child,y=oa(c,c.pendingProps),f.child=y,y.return=f;c.sibling!==null;)c=c.sibling,y=y.sibling=oa(c,c.pendingProps),y.return=f;y.sibling=null}return f.child}function ff(c,f){return(c.lanes&f)!==0?!0:(c=c.dependencies,!!(c!==null&&ne(c)))}function Jp(c,f,y){switch(f.tag){case 3:we(f,f.stateNode.containerInfo),$e(f,Xi,c.memoizedState.cache),Wt();break;case 27:case 5:pe(f);break;case 4:we(f,f.stateNode.containerInfo);break;case 10:$e(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,xt(f),null;break;case 13:var S=f.memoizedState;if(S!==null)return S.dehydrated!==null?(dt(f),f.flags|=128,null):(y&f.child.childLanes)!==0?qp(c,f,y):(dt(f),c=io(c,f,y),c!==null?c.sibling:null);dt(f);break;case 19:var B=(c.flags&128)!==0;if(S=(y&f.childLanes)!==0,S||(Ve(c,f,y,!1),S=(y&f.childLanes)!==0),B){if(S)return Yp(c,f,y);f.flags|=128}if(B=f.memoizedState,B!==null&&(B.rendering=null,B.tail=null,B.lastEffect=null),A(ls,ls.current),S)break;return null;case 22:return f.lanes=0,Og(c,f,y,f.pendingProps);case 24:$e(f,Xi,c.memoizedState.cache)}return io(c,f,y)}function Kp(c,f,y){if(c!==null)if(c.memoizedProps!==f.pendingProps)ki=!0;else{if(!ff(c,y)&&(f.flags&128)===0)return ki=!1,Jp(c,f,y);ki=(c.flags&131072)!==0}else ki=!1,Gn&&(f.flags&1048576)!==0&&K(f,Pf,f.index);switch(f.lanes=0,f.tag){case 16:e:{var S=f.pendingProps;if(c=Dt(f.elementType),f.type=c,typeof c=="function")Zl(c)?(S=Xl(c,S),f.tag=1,f=Yl(null,f,c,S,y)):(f.tag=0,f=Xd(null,f,c,S,y));else{if(c!=null){var B=c.$$typeof;if(B===cu){f.tag=11,f=Dg(null,f,c,S,y);break e}else if(B===uh){f.tag=14,f=Lg(null,f,c,S,y);break e}}
vendor: 7,489 bytes, line 3931
3931throw f=v(c)||c,Error(s(306,f,""))}}return f;case 0:return Xd(c,f,f.type,f.pendingProps,y);case 1:return S=f.type,B=Xl(S,f.pendingProps),Yl(c,f,S,B,y);case 3:e:{if(we(f,f.stateNode.containerInfo),c===null)throw Error(s(387));var O=f.pendingProps;B=f.memoizedState,S=B.element,_r(c,f),Ln(f,O,null,y);var Z=f.memoizedState;if(O=Z.cache,$e(f,Xi,O),O!==B.cache&&pt(f,[Xi],y,!0),Ot(),O=Z.element,Vi&&B.isDehydrated)if(B={element:O,isDehydrated:!1,cache:Z.cache},f.updateQueue.baseState=B,f.memoizedState=B,f.flags&256){f=Ug(c,f,O,y);break e}else if(O!==S){S=ue(Error(s(424)),f),an(S),f=Ug(c,f,O,y);break e}else for(Vi&&(Wi=yv(f.stateNode.containerInfo),Us=f,Gn=!0,xo=null,Tr=!0),y=Xm(f,null,O,y),f.child=y;y;)y.flags=y.flags&-3|4096,y=y.sibling;else{if(Wt(),O===S){f=io(c,f,y);break e}nr(c,f,O,y)}f=f.child}return f;case 26:if(Ra)return uf(c,f),c===null?(y=Om(f.type,null,f.pendingProps,null))?f.memoizedState=y:Gn||(f.stateNode=bh(f.type,f.pendingProps,sr.current,f)):f.memoizedState=Om(f.type,c.memoizedProps,f.pendingProps,c.memoizedState),null;case 27:if(Ns)return pe(f),c===null&&Ns&&Gn&&(S=f.stateNode=Sh(f.type,f.pendingProps,sr.current,Js.current,!1),Us=f,Tr=!0,Wi=Rm(f.type,S,Wi)),nr(c,f,f.pendingProps.children,y),uf(c,f),c===null&&(f.flags|=4194304),f.child;case 5:return c===null&&Gn&&(Dv(f.type,f.pendingProps,Js.current),(B=S=Wi)&&(S=bv(S,f.type,f.pendingProps,Tr),S!==null?(f.stateNode=S,Us=f,Wi=vv(S),Tr=!1,B=!0):B=!1),B||lt(f)),pe(f),B=f.type,O=f.pendingProps,Z=c!==null?c.memoizedProps:null,S=O.children,Er(B,O)?S=null:Z!==null&&Er(B,Z)&&(f.flags|=32),f.memoizedState!==null&&(B=Pn(c,f,Xt,null,null,y),gs?ac._currentValue=B:ac._currentValue2=B),uf(c,f),nr(c,f,S,y),f.child;case 6:return c===null&&Gn&&(Pm(f.pendingProps,Js.current),(c=y=Wi)&&(y=Sv(y,f.pendingProps,Tr),y!==null?(f.stateNode=y,Us=f,Wi=null,c=!0):c=!1),c||lt(f)),null;case 13:return qp(c,f,y);case 4:return we(f,f.stateNode.containerInfo),S=f.pendingProps,c===null?f.child=rr(f,null,S,y):nr(c,f,S,y),f.child;case 11:return Dg(c,f,f.type,f.pendingProps,y);case 7:return nr(c,f,f.pendingProps,y),f.child;case 8:return nr(c,f,f.pendingProps.children,y),f.child;case 12:return nr(c,f,f.pendingProps.children,y),f.child;case 10:return S=f.pendingProps,$e(f,f.type,S.value),nr(c,f,S.children,y),f.child;case 9:return B=f.type._context,S=f.pendingProps.children,V(f),B=Se(B),S=S(B),f.flags|=1,nr(c,f,S,y),f.child;case 14:return Lg(c,f,f.type,f.pendingProps,y);case 15:return Pg(c,f,f.type,f.pendingProps,y);case 19:return Yp(c,f,y);case 31:return Ng(c,f,y);case 22:return Og(c,f,y,f.pendingProps);case 24:return V(f),S=Se(Xi),c===null?(B=Ue(),B===null&&(B=In,O=Fe(),B.pooledCache=O,O.refCount++,O!==null&&(B.pooledCacheLanes|=y),B=O),f.memoizedState={parent:S,cache:B},Fi(f),$e(f,Xi,B)):((c.lanes&y)!==0&&(_r(c,f),Ln(f,null,null,y),Ot()),B=c.memoizedState,O=f.memoizedState,B.parent!==S?(B={parent:S,cache:S},f.memoizedState=B,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=B),$e(f,Xi,S)):(S=O.cache,$e(f,Xi,S),S!==B.cache&&pt(f,[Xi],y,!0))),nr(c,f,f.pendingProps.children,y),f.child;case 29:throw f.pendingProps}throw Error(s(156,f.tag))}function ba(c){c.flags|=4}function df(c){la&&(c.flags|=8)}function Fg(c,f){if(c!==null&&c.child===f.child)return!1;if((f.flags&16)!==0)return!0;for(c=f.child;c!==null;){if((c.flags&8218)!==0||(c.subtreeFlags&8218)!==0)return!0;c=c.sibling}return!1}function Zp(c,f,y,S){if(Xn)for(y=f.child;y!==null;){if(y.tag===5||y.tag===6)Tf(c,y.stateNode);else if(!(y.tag===4||Ns&&y.tag===27)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===f)break;for(;y.sibling===null;){if(y.return===null||y.return===f)return;y=y.return}y.sibling.return=y.return,y=y.sibling}else if(la)for(var B=f.child;B!==null;){if(B.tag===5){var O=B.stateNode;y&&S&&(O=hv(O,B.type,B.memoizedProps)),Tf(c,O)}else if(B.tag===6)O=B.stateNode,y&&S&&(O=wm(O,B.memoizedProps)),Tf(c,O);else if(B.tag!==4){if(B.tag===22&&B.memoizedState!==null)O=B.child,O!==null&&(O.return=B),Zp(c,B,!0,!0);else if(B.child!==null){B.child.return=B,B=B.child;continue}}if(B===f)break;for(;B.sibling===null;){if(B.return===null||B.return===f)return;B=B.return}B.sibling.return=B.return,B=B.sibling}}function kg(c,f,y,S){var B=!1;if(la)for(var O=f.child;O!==null;){if(O.tag===5){var Z=O.stateNode;y&&S&&(Z=hv(Z,O.type,O.memoizedProps)),Em(c,Z)}else if(O.tag===6)Z=O.stateNode,y&&S&&(Z=wm(Z,O.memoizedProps)),Em(c,Z);else if(O.tag!==4){if(O.tag===22&&O.memoizedState!==null)B=O.child,B!==null&&(B.return=O),kg(c,O,!0,!0),B=!0;else if(O.child!==null){O.child.return=O,O=O.child;continue}}if(O===f)break;for(;O.sibling===null;){if(O.return===null||O.return===f)return B;O=O.return}O.sibling.return=O.return,O=O.sibling}return B}function Hg(c,f){if(la&&Fg(c,f)){c=f.stateNode;var y=c.containerInfo,S=Mm();kg(S,f,!1,!1),c.pendingChildren=S,ba(f),dv(y,S)}}function Qp(c,f,y,S){if(Xn)c.memoizedProps!==S&&ba(f);else if(la){var B=c.stateNode,O=c.memoizedProps;if((c=Fg(c,f))||O!==S){var Z=Js.current;O=fv(B,y,O,S,!c,null),O===B?f.stateNode=B:(df(f),Ur(O,y,S,Z)&&ba(f),f.stateNode=O,c&&Zp(O,f,!1,!1))}else f.stateNode=B}}function Sr(c,f,y,S,B){if((c.mode&32)!==0&&(y===null?wf(f,S):pu(f,y,S))){if(c.flags|=16777216,(B&335544128)===B||hm(f,S))if(ts(c.stateNode,f,S))c.flags|=8192;else if(Wn())c.flags|=8192;else throw wr=_o,Lh}else c.flags&=-16777217}function Zc(c,f){if(Fm(f)){if(c.flags|=16777216,!km(f))if(Wn())c.flags|=8192;else throw wr=_o,Lh}else c.flags&=-16777217}function hf(c,f){f!==null&&(c.flags|=4),c.flags&16384&&(f=c.tag!==22?P():536870912,c.lanes|=f,Au|=f)}function Qc(c,f){if(!Gn)switch(c.tailMode){case"hidden":f=c.tail;for(var y=null;f!==null;)f.alternate!==null&&(y=f),f=f.sibling;y===null?c.tail=null:y.sibling=null;break;case"collapsed":y=c.tail;for(var S=null;y!==null;)y.alternate!==null&&(S=y),y=y.sibling;S===null?f||c.tail===null?c.tail=null:c.tail.sibling=null:S.sibling=null}}function Li(c){var f=c.alternate!==null&&c.alternate.child===c.child,y=0,S=0;if(f)for(var B=c.child;B!==null;)y|=B.lanes|B.childLanes,S|=B.subtreeFlags&65011712,S|=B.flags&65011712,B.return=c,B=B.sibling;else for(B=c.child;B!==null;)y|=B.lanes|B.childLanes,S|=B.subtreeFlags,S|=B.flags,B.return=c,B=B.sibling;return c.subtreeFlags|=S,c.childLanes=y,f}function Gg(c,f,y){var S=f.pendingProps;switch(re(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Li(f),null;case 1:return Li(f),null;case 3:return y=f.stateNode,S=null,c!==null&&(S=c.memoizedState.cache),f.memoizedState.cache!==S&&(f.flags|=2048),Qe(Xi),Be(),y.pendingContext&&(y.context=y.pendingContext,y.pendingContext=null),(c===null||c.child===null)&&(qt(f)?ba(f):c===null||c.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,de())),Hg(c,f),Li(f),null;case 26:if(Ra){var B=f.type,O=f.memoizedState;return c===null?(ba(f),O!==null?(Li(f),Zc(f,O)):(Li(f),Sr(f,B,null,S,y))):O?O!==c.memoizedState?(ba(f),Li(f),Zc(f,O)):(Li(f),f.flags&=-16777217):(O=c.memoizedProps,Xn?O!==S&&ba(f):Qp(c,f,B,S),Li(f),Sr(f,B,O,S,y)),null}case 27:if(Ns){if(Re(f),y=sr.current,B=f.type,c!==null&&f.stateNode!=null)Xn?c.memoizedProps!==S&&ba(f):Qp(c,f,B,S);else{if(!S){if(f.stateNode===null)throw Error(s(166));return Li(f),null}c=Js.current,qt(f)?ct(f,c):(c=Sh(B,S,y,c,!0),f.stateNode=c,ba(f))}return Li(f),null}case 5:if(Re(f),B=f.type,c!==null&&f.stateNode!=null)Qp(c,f,B,S);else{if(!S){if(f.stateNode===null)throw Error(s(166));return Li(f),null}if(O=Js.current,qt(f))ct(f,O),Rv(f.stateNode,B,S,O)&&(f.flags|=64);else{var Z=fm(B,S,sr.current,O,f);
vendor: 9,680 bytes, line 3931
3931df(f),Zp(Z,f,!1,!1),f.stateNode=Z,Ur(Z,B,S,O)&&ba(f)}}return Li(f),Sr(f,f.type,c===null?null:c.memoizedProps,f.pendingProps,y),null;case 6:if(c&&f.stateNode!=null)y=c.memoizedProps,Xn?y!==S&&ba(f):la&&(y!==S?(c=sr.current,y=Js.current,df(f),f.stateNode=jo(S,c,y,f)):f.stateNode=c.stateNode);else{if(typeof S!="string"&&f.stateNode===null)throw Error(s(166));if(c=sr.current,y=Js.current,qt(f)){if(!Vi)throw Error(s(176));if(c=f.stateNode,y=f.memoizedProps,S=null,B=Us,B!==null)switch(B.tag){case 27:case 5:S=B.memoizedProps}_b(c,y,f,S)||lt(f,!0)}else df(f),f.stateNode=jo(S,c,y,f)}return Li(f),null;case 31:if(y=f.memoizedState,c===null||c.memoizedState!==null){if(S=qt(f),y!==null){if(c===null){if(!S)throw Error(s(318));if(!Vi)throw Error(s(556));if(c=f.memoizedState,c=c!==null?c.dehydrated:null,!c)throw Error(s(557));Im(c,f)}else Wt(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Li(f),c=!1}else y=de(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=y),c=!0;if(!c)return f.flags&256?(Kt(f),f):(Kt(f),null);if((f.flags&128)!==0)throw Error(s(558))}return Li(f),null;case 13:if(S=f.memoizedState,c===null||c.memoizedState!==null&&c.memoizedState.dehydrated!==null){if(B=qt(f),S!==null&&S.dehydrated!==null){if(c===null){if(!B)throw Error(s(318));if(!Vi)throw Error(s(344));if(B=f.memoizedState,B=B!==null?B.dehydrated:null,!B)throw Error(s(317));Ev(B,f)}else Wt(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;Li(f),B=!1}else B=de(),c!==null&&c.memoizedState!==null&&(c.memoizedState.hydrationErrors=B),B=!0;if(!B)return f.flags&256?(Kt(f),f):(Kt(f),null)}return Kt(f),(f.flags&128)!==0?(f.lanes=y,f):(y=S!==null,c=c!==null&&c.memoizedState!==null,y&&(S=f.child,B=null,S.alternate!==null&&S.alternate.memoizedState!==null&&S.alternate.memoizedState.cachePool!==null&&(B=S.alternate.memoizedState.cachePool.pool),O=null,S.memoizedState!==null&&S.memoizedState.cachePool!==null&&(O=S.memoizedState.cachePool.pool),O!==B&&(S.flags|=2048)),y!==c&&y&&(f.child.flags|=8192),hf(f,f.updateQueue),Li(f),null);case 4:return Be(),Hg(c,f),c===null&&Ei(f.stateNode.containerInfo),Li(f),null;case 10:return Qe(f.type),Li(f),null;case 19:if(_(ls),S=f.memoizedState,S===null)return Li(f),null;if(B=(f.flags&128)!==0,O=S.rendering,O===null)if(B)Qc(S,!1);else{if(ss!==0||c!==null&&(c.flags&128)!==0)for(c=f.child;c!==null;){if(O=rn(c),O!==null){for(f.flags|=128,Qc(S,!1),c=O.updateQueue,f.updateQueue=c,hf(f,c),f.subtreeFlags=0,c=y,y=f.child;y!==null;)rh(y,c),y=y.sibling;return A(ls,ls.current&1|2),Gn&&he(f,S.treeForkCount),f.child}c=c.sibling}S.tail!==null&&ur()>Ul&&(f.flags|=128,B=!0,Qc(S,!1),f.lanes=4194304)}else{if(!B)if(c=rn(O),c!==null){if(f.flags|=128,B=!0,c=c.updateQueue,f.updateQueue=c,hf(f,c),Qc(S,!0),S.tail===null&&S.tailMode==="hidden"&&!O.alternate&&!Gn)return Li(f),null}else 2*ur()-S.renderingStartTime>Ul&&y!==536870912&&(f.flags|=128,B=!0,Qc(S,!1),f.lanes=4194304);S.isBackwards?(O.sibling=f.child,f.child=O):(c=S.last,c!==null?c.sibling=O:f.child=O,S.last=O)}return S.tail!==null?(c=S.tail,S.rendering=c,S.tail=c.sibling,S.renderingStartTime=ur(),c.sibling=null,y=ls.current,A(ls,B?y&1|2:y&1),Gn&&he(f,S.treeForkCount),c):(Li(f),null);case 22:case 23:return Kt(f),xe(),S=f.memoizedState!==null,c!==null?c.memoizedState!==null!==S&&(f.flags|=8192):S&&(f.flags|=8192),S?(y&536870912)!==0&&(f.flags&128)===0&&(Li(f),f.subtreeFlags&6&&(f.flags|=8192)):Li(f),y=f.updateQueue,y!==null&&hf(f,y.retryQueue),y=null,c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),S=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(S=f.memoizedState.cachePool.pool),S!==y&&(f.flags|=2048),c!==null&&_(Rl),null;case 24:return y=null,c!==null&&(y=c.memoizedState.cache),f.memoizedState.cache!==y&&(f.flags|=2048),Qe(Xi),Li(f),null;case 25:return null;case 30:return null}throw Error(s(156,f.tag))}function $p(c,f){switch(re(f),f.tag){case 1:return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 3:return Qe(Xi),Be(),c=f.flags,(c&65536)!==0&&(c&128)===0?(f.flags=c&-65537|128,f):null;case 26:case 27:case 5:return Re(f),null;case 31:if(f.memoizedState!==null){if(Kt(f),f.alternate===null)throw Error(s(340));Wt()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 13:if(Kt(f),c=f.memoizedState,c!==null&&c.dehydrated!==null){if(f.alternate===null)throw Error(s(340));Wt()}return c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 19:return _(ls),null;case 4:return Be(),null;case 10:return Qe(f.type),null;case 22:case 23:return Kt(f),xe(),c!==null&&_(Rl),c=f.flags,c&65536?(f.flags=c&-65537|128,f):null;case 24:return Qe(Xi),null;case 25:return null;default:return null}}function jg(c,f){switch(re(f),f.tag){case 3:Qe(Xi),Be();break;case 26:case 27:case 5:Re(f);break;case 4:Be();break;case 31:f.memoizedState!==null&&Kt(f);break;case 13:Kt(f);break;case 19:_(ls);break;case 10:Qe(f.type);break;case 22:case 23:Kt(f),xe(),c!==null&&_(Rl);break;case 24:Qe(Xi)}}function so(c,f){try{var y=f.updateQueue,S=y!==null?y.lastEffect:null;if(S!==null){var B=S.next;y=B;do{if((y.tag&c)===c){S=void 0;var O=y.create,Z=y.inst;S=O(),Z.destroy=S}y=y.next}while(y!==B)}}catch(ge){pn(f,f.return,ge)}}function ro(c,f,y){try{var S=f.updateQueue,B=S!==null?S.lastEffect:null;if(B!==null){var O=B.next;S=O;do{if((S.tag&c)===c){var Z=S.inst,ge=Z.destroy;if(ge!==void 0){Z.destroy=void 0,B=f;var Je=y,ht=ge;try{ht()}catch(wt){pn(B,Je,wt)}}}S=S.next}while(S!==O)}}catch(wt){pn(f,f.return,wt)}}function $c(c){var f=c.updateQueue;if(f!==null){var y=c.stateNode;try{ye(f,y)}catch(S){pn(c,c.return,S)}}}function Yd(c,f,y){y.props=Xl(c.type,c.memoizedProps),y.state=c.memoizedState;try{y.componentWillUnmount()}catch(S){pn(c,f,S)}}function eu(c,f){try{var y=c.ref;if(y!==null){switch(c.tag){case 26:case 27:case 5:var S=fu(c.stateNode);break;case 30:S=c.stateNode;break;default:S=c.stateNode}typeof y=="function"?c.refCleanup=y(S):y.current=S}}catch(B){pn(c,f,B)}}function cr(c,f){var y=c.ref,S=c.refCleanup;if(y!==null)if(typeof S=="function")try{S()}catch(B){pn(c,f,B)}finally{c.refCleanup=null,c=c.alternate,c!=null&&(c.refCleanup=null)}else if(typeof y=="function")try{y(null)}catch(B){pn(c,f,B)}else y.current=null}function Kl(c){var f=c.type,y=c.memoizedProps,S=c.stateNode;try{iv(S,f,y,c)}catch(B){pn(c,c.return,B)}}function pf(c,f,y){try{sv(c.stateNode,c.type,y,f,c)}catch(S){pn(c,c.return,S)}}function em(c){return c.tag===5||c.tag===3||(Ra?c.tag===26:!1)||(Ns?c.tag===27&&oc(c.type):!1)||c.tag===4}function Oo(c){e:for(;;){for(;c.sibling===null;){if(c.return===null||em(c.return))return null;c=c.return}for(c.sibling.return=c.return,c=c.sibling;c.tag!==5&&c.tag!==6&&c.tag!==18;){if(Ns&&c.tag===27&&oc(c.type)||c.flags&2||c.child===null||c.tag===4)continue e;c.child.return=c,c=c.child}if(!(c.flags&2))return c.stateNode}}function Jd(c,f,y){var S=c.tag;if(S===5||S===6)c=c.stateNode,f?av(y,c,f):_m(y,c);else if(S!==4&&(Ns&&S===27&&oc(c.type)&&(y=c.stateNode,f=null),c=c.child,c!==null))for(Jd(c,f,y),c=c.sibling;c!==null;)Jd(c,f,y),c=c.sibling}function mf(c,f,y){var S=c.tag;if(S===5||S===6)c=c.stateNode,f?rv(y,c,f):xm(y,c);else if(S!==4&&(Ns&&S===27&&oc(c.type)&&(y=c.stateNode),c=c.child,c!==null))for(mf(c,f,y),c=c.sibling;c!==null;)mf(c,f,y),c=c.sibling}function tm(c,f,y){c=c.containerInfo;try{Tm(c,y)}catch(S){pn(f,f.return,S)}}function Vg(c){var f=c.stateNode,y=c.memoizedProps;try{Cs(c.type,y,f,c)}catch(S){pn(c,c.return,S)}}function gb(c,f){for(fh(c.containerInfo),xs=f;xs!==null;)if(c=xs,f=c.child,(c.subtreeFlags&1028)!==0&&f!==null)f.return=c,xs=f;else for(;xs!==null;){c=xs;var y=c.alternate;switch(f=c.flags,c.tag){case 0:if((f&4)!==0&&(f=c.updateQueue,f=f!==null?f.events:null,f!==null))for(var S=0;S<f.length;S++){var B=f[S];B.ref.impl=B.nextImpl}break;case 11:case 15:break;case 1:if((f&1024)!==0&&y!==null){f=void 0,S=c,B=y.memoizedProps,y=y.memoizedState;var O=S.stateNode;try{var Z=Xl(S.type,B);f=O.getSnapshotBeforeUpdate(Z,y),O.__reactInternalSnapshotBeforeUpdate=f}catch(ge){pn(S,S.return,ge)}}break;case 3:(f&1024)!==0&&Xn&&Am(c.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((f&1024)!==0)throw Error(s(163))}if(f=c.sibling,f!==null){f.return=c.return,xs=f;break}xs=c.return}}function Wg(c,f,y){var S=y.flags;switch(y.tag){case 0:case 11:case 15:Ar(c,y),S&4&&so(5,y);break;case 1:if(Ar(c,y),S&4)if(c=y.stateNode,f===null)try{c.componentDidMount()}catch(Z){pn(y,y.return,Z)}else{var B=Xl(y.type,f.memoizedProps);f=f.memoizedState;try{c.componentDidUpdate(B,f,c.__reactInternalSnapshotBeforeUpdate)}catch(Z){pn(y,y.return,Z)}}S&64&&$c(y),S&512&&eu(y,y.return);break;case 3:if(Ar(c,y),S&64&&(S=y.updateQueue,S!==null)){if(c=null,y.child!==null)switch(y.child.tag){case 27:case 5:c=fu(y.child.stateNode);break;case 1:c=y.child.stateNode}try{ye(S,c)}catch(Z){pn(y,y.return,Z)}}break;case 27:Ns&&f===null&&S&4&&Vg(y);case 26:case 5:if(Ar(c,y),f===null){if(S&4)Kl(y);else if(S&64){c=y.type,f=y.memoizedProps,B=y.stateNode;try{wv(B,c,f,y)}catch(Z){pn(y,y.return,Z)}}}S&512&&eu(y,y.return);break;case 12:Ar(c,y);break;case 31:Ar(c,y),S&4&&Aa(c,y);break;case 13:Ar(c,y),S&4&&vf(c,y),S&64&&(S=y.memoizedState,S!==null&&(S=S.dehydrated,S!==null&&(y=vb.bind(null,y),yh(S,y))));break;case 22:if(S=y.memoizedState!==null||cs,!S){f=f!==null&&f.memoizedState!==null||us,B=cs;var O=us;cs=S,(us=f)&&!O?Ea(c,y,(y.subtreeFlags&8772)!==0):Ar(c,y),cs=B,us=O}break;case 30:break;default:Ar(c,y)}}function nm(c){var f=c.alternate;f!==null&&(c.alternate=null,nm(f)),c.child=null,c.deletions=null,c.sibling=null,c.tag===5&&(f=c.stateNode,f!==null&&dh(f)),c.stateNode=null,c.return=null,c.dependencies=null,c.memoizedProps=null,c.memoizedState=null,c.pe
3931ndingProps=null,c.stateNode=null,c.updateQueue=null}function Sa(c,f,y){for(y=y.child;y!==null;)gf(c,f,y),y=y.sibling}function gf(c,f,y){if(kr&&typeof kr.onCommitFiberUnmount=="function")try{kr.onCommitFiberUnmount(fc,y)}catch{}switch(y.tag){case 26:if(Ra){us||cr(y,f),Sa(c,f,y),y.memoizedState?wl(y.memoizedState):y.stateNode&&zm(y.stateNode);break}case 27:if(Ns){us||cr(y,f);var S=is,B=_s;oc(y.type)&&(is=y.stateNode,_s=!1),Sa(c,f,y),Ys(y.stateNode),is=S,_s=B;break}case 5:us||cr(y,f);case 6:if(Xn){if(S=is,B=_s,is=null,Sa(c,f,y),is=S,_s=B,is!==null)if(_s)try{bm(is,y.stateNode)}catch(O){pn(y,f,O)}else try{ov(is,y.stateNode)}catch(O){pn(y,f,O)}}else Sa(c,f,y);break;case 18:Xn&&is!==null&&(_s?xh(is,y.stateNode):Lm(is,y.stateNode));break;case 4:Xn?(S=is,B=_s,is=y.stateNode.containerInfo,_s=!0,Sa(c,f,y),is=S,_s=B):(la&&tm(y.stateNode,y,Mm()),Sa(c,f,y));break;case 0:case 11:case 14:case 15:ro(2,y,f),us||ro(4,y,f),Sa(c,f,y);break;case 1:us||(cr(y,f),S=y.stateNode,typeof S.componentWillUnmount=="function"&&Yd(y,f,S)),Sa(c,f,y);break;case 21:Sa(c,f,y);break;case 22:us=(S=us)||y.memoizedState!==null,Sa(c,f,y),us=S;break;default:Sa(c,f,y)}}function Aa(c,f){if(Vi&&f.memoizedState===null&&(c=f.alternate,c!==null&&(c=c.memoizedState,c!==null))){c=c.dehydrated;try{bb(c)}catch(y){pn(f,f.return,y)}}}function vf(c,f){if(Vi&&f.memoizedState===null&&(c=f.alternate,c!==null&&(c=c.memoizedState,c!==null&&(c=c.dehydrated,c!==null))))try{Sb(c)}catch(y){pn(f,f.return,y)}}function Ma(c){switch(c.tag){case 31:case 13:case 19:var f=c.stateNode;return f===null&&(f=c.stateNode=new Ym),f;case 22:return c=c.stateNode,f=c._retryCache,f===null&&(f=c._retryCache=new Ym),f;default:throw Error(s(435,c.tag))}}function No(c,f){var y=Ma(c);f.forEach(function(S){if(!y.has(S)){y.add(S);var B=yb.bind(null,c,S);S.then(B,B)}})}function Xs(c,f){var y=f.deletions;if(y!==null)for(var S=0;S<y.length;S++){var B=y[S],O=c,Z=f;if(Xn){var ge=Z;e:for(;ge!==null;){switch(ge.tag){case 27:if(Ns){if(oc(ge.type)){is=ge.stateNode,_s=!1;break e}break}case 5:is=ge.stateNode,_s=!1;break e;case 3:case 4:is=ge.stateNode.containerInfo,_s=!0;break e}ge=ge.return}if(is===null)throw Error(s(160));gf(O,Z,B),is=null,_s=!1}else gf(O,Z,B);O=B.alternate,O!==null&&(O.return=null),B.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)yf(f,c),f=f.sibling}function yf(c,f){var y=c.alternate,S=c.flags;switch(c.tag){case 0:case 11:case 14:case 15:Xs(f,c),qs(c),S&4&&(ro(3,c,c.return),so(3,c),ro(5,c,c.return));break;case 1:Xs(f,c),qs(c),S&512&&(us||y===null||cr(y,y.return)),S&64&&cs&&(c=c.updateQueue,c!==null&&(S=c.callbacks,S!==null&&(y=c.shared.hiddenCallbacks,c.shared.hiddenCallbacks=y===null?S:y.concat(S))));break;case 26:if(Ra){var B=Si;if(Xs(f,c),qs(c),S&512&&(us||y===null||cr(y,y.return)),S&4){S=y!==null?y.memoizedState:null;var O=c.memoizedState;y===null?O===null?c.stateNode===null?c.stateNode=Lv(B,c.type,c.memoizedProps,c):Um(B,c.type,c.stateNode):c.stateNode=Nm(B,O,c.memoizedProps):S!==O?(S===null?y.stateNode!==null&&zm(y.stateNode):wl(S),O===null?Um(B,c.type,c.stateNode):Nm(B,O,c.memoizedProps)):O===null&&c.stateNode!==null&&pf(c,c.memoizedProps,y.memoizedProps)}break}case 27:if(Ns){Xs(f,c),qs(c),S&512&&(us||y===null||cr(y,y.return)),y!==null&&S&4&&pf(c,c.memoizedProps,y.memoizedProps);break}case 5:if(Xs(f,c),qs(c),S&512&&(us||y===null||cr(y,y.return)),Xn){if(c.flags&32){B=c.stateNode;try{Sm(B)}catch(gt){pn(c,c.return,gt)}}S&4&&c.stateNode!=null&&(B=c.memoizedProps,pf(c,B,y!==null?y.memoizedProps:B)),S&1024&&(yu=!0)}else la&&c.alternate!==null&&(c.alternate.stateNode=c.stateNode);break;case 6:if(Xs(f,c),qs(c),S&4&&Xn){if(c.stateNode===null)throw Error(s(162));S=c.memoizedProps,y=y!==null?y.memoizedProps:S,B=c.stateNode;try{nv(B,y,S)}catch(gt){pn(c,c.return,gt)}}break;case 3:if(Ra?(Pv(),B=Si,Si=Bf(f.containerInfo),Xs(f,c),Si=B):Xs(f,c),qs(c),S&4){if(Xn&&Vi&&y!==null&&y.memoizedState.isDehydrated)try{Cv(f.containerInfo)}catch(gt){pn(c,c.return,gt)}if(la){S=f.containerInfo,y=f.pendingChildren;try{Tm(S,y)}catch(gt){pn(c,c.return,gt)}}}yu&&(yu=!1,Kd(c));break;case 4:Ra?(y=Si,Si=Bf(c.stateNode.containerInfo),Xs(f,c),qs(c),Si=y):(Xs(f,c),qs(c)),S&4&&la&&tm(c.stateNode,c,c.stateNode.pendingChildren);break;case 12:Xs(f,c),qs(c);break;case 31:Xs(f,c),qs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,No(c,S)
vendor: 5,595 bytes, line 3931
3931));break;case 13:Xs(f,c),qs(c),c.child.flags&8192&&c.memoizedState!==null!=(y!==null&&y.memoizedState!==null)&&(kf=ur()),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,No(c,S)));break;case 22:B=c.memoizedState!==null;var Z=y!==null&&y.memoizedState!==null,ge=cs,Je=us;if(cs=ge||B,us=Je||Z,Xs(f,c),us=Je,cs=ge,qs(c),S&8192&&(f=c.stateNode,f._visibility=B?f._visibility&-2:f._visibility|1,B&&(y===null||Z||cs||us||pl(c)),Xn)){e:if(y=null,Xn)for(f=c;;){if(f.tag===5||Ra&&f.tag===26){if(y===null){Z=y=f;try{O=Z.stateNode,B?xb(O):cv(Z.stateNode,Z.memoizedProps)}catch(gt){pn(Z,Z.return,gt)}}}else if(f.tag===6){if(y===null){Z=f;try{var ht=Z.stateNode;B?lv(ht):uv(ht,Z.memoizedProps)}catch(gt){pn(Z,Z.return,gt)}}}else if(f.tag===18){if(y===null){Z=f;try{var wt=Z.stateNode;B?Bv(wt):Iv(Z.stateNode)}catch(gt){pn(Z,Z.return,gt)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===c)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===c)break e;for(;f.sibling===null;){if(f.return===null||f.return===c)break e;y===f&&(y=null),f=f.return}y===f&&(y=null),f.sibling.return=f.return,f=f.sibling}}S&4&&(S=c.updateQueue,S!==null&&(y=S.retryQueue,y!==null&&(S.retryQueue=null,No(c,y))));break;case 19:Xs(f,c),qs(c),S&4&&(S=c.updateQueue,S!==null&&(c.updateQueue=null,No(c,S)));break;case 30:break;case 21:break;default:Xs(f,c),qs(c)}}function qs(c){var f=c.flags;if(f&2){try{for(var y,S=c.return;S!==null;){if(em(S)){y=S;break}S=S.return}if(Xn){if(y==null)throw Error(s(160));switch(y.tag){case 27:if(Ns){var B=y.stateNode,O=Oo(c);mf(c,O,B);break}case 5:var Z=y.stateNode;y.flags&32&&(Sm(Z),y.flags&=-33);var ge=Oo(c);mf(c,ge,Z);break;case 3:case 4:var Je=y.stateNode.containerInfo,ht=Oo(c);Jd(c,ht,Je);break;default:throw Error(s(161))}}}catch(wt){pn(c,c.return,wt)}c.flags&=-3}f&4096&&(c.flags&=-4097)}function Kd(c){if(c.subtreeFlags&1024)for(c=c.child;c!==null;){var f=c;Kd(f),f.tag===5&&f.flags&1024&&mm(f.stateNode),c=c.sibling}}function Ar(c,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)Wg(c,f.alternate,f),f=f.sibling}function pl(c){for(c=c.child;c!==null;){var f=c;switch(f.tag){case 0:case 11:case 14:case 15:ro(4,f,f.return),pl(f);break;case 1:cr(f,f.return);var y=f.stateNode;typeof y.componentWillUnmount=="function"&&Yd(f,f.return,y),pl(f);break;case 27:Ns&&Ys(f.stateNode);case 26:case 5:cr(f,f.return),pl(f);break;case 22:f.memoizedState===null&&pl(f);break;case 30:pl(f);break;default:pl(f)}c=c.sibling}}function Ea(c,f,y){for(y=y&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var S=f.alternate,B=c,O=f,Z=O.flags;switch(O.tag){case 0:case 11:case 15:Ea(B,O,y),so(4,O);break;case 1:if(Ea(B,O,y),S=O,B=S.stateNode,typeof B.componentDidMount=="function")try{B.componentDidMount()}catch(ht){pn(S,S.return,ht)}if(S=O,B=S.updateQueue,B!==null){var ge=S.stateNode;try{var Je=B.shared.hiddenCallbacks;if(Je!==null)for(B.shared.hiddenCallbacks=null,B=0;B<Je.length;B++)Q(Je[B],ge)}catch(ht){pn(S,S.return,ht)}}y&&Z&64&&$c(O),eu(O,O.return);break;case 27:Ns&&Vg(O);case 26:case 5:Ea(B,O,y),y&&S===null&&Z&4&&Kl(O),eu(O,O.return);break;case 12:Ea(B,O,y);break;case 31:Ea(B,O,y),y&&Z&4&&Aa(B,O);break;case 13:Ea(B,O,y),y&&Z&4&&vf(B,O);break;case 22:O.memoizedState===null&&Ea(B,O,y),eu(O,O.return);break;case 30:break;default:Ea(B,O,y)}f=f.sibling}}function ml(c,f){var y=null;c!==null&&c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(y=c.memoizedState.cachePool.pool),c=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(c=f.memoizedState.cachePool.pool),c!==y&&(c!=null&&c.refCount++,y!=null&&Rt(y))}function im(c,f){c=null,f.alternate!==null&&(c=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==c&&(f.refCount++,c!=null&&Rt(c))}function $i(c,f,y,S){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)Zd(c,f,y,S),f=f.sibling}function Zd(c,f,y,S){var B=f.flags;switch(f.tag){case 0:case 11:case 15:$i(c,f,y,S),B&2048&&so(9,f);break;case 1:$i(c,f,y,S);break;case 3:$i(c,f,y,S),B&2048&&(c=null,f.alternate!==null&&(c=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==c&&(f.refCount++,c!=null&&Rt(c)));break;case 12:if(B&2048){$i(c,f,y,S),c=f.stateNode;try{var O=f.memoizedProps,Z=O.id,ge=O.onPostCommit;typeof ge=="function"&&ge(Z,f.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(Je){pn(f,f.return,Je)}}else $i(c,f,y,S);break;case 31:$i(c,f,y,S);break;case 13:$i(c,f,y,S);break;case 23:break;case 22:O=f.stateNode,Z=f.alternate,f.memoizedState!==null?O._visibility&2?$i(c,f,y,S):tu(c,f):O._visibility&2?$i(c,f,y,S):(O._visibility|=2,Pr(c,f,y,S,(f.subtreeFlags&10256)!==0||!1)),B&2048&&ml(Z,f);break;case 24:$i(c,f,y,S),B&2048&&im(f.alternate,f);break;default:$i(c,f,y,S)}}function Pr(c,f,y,S,B){for(B=B&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var O=c,Z=f,ge=y,Je=S,ht=Z.flags;switch(Z.tag){case 0:case 11:case 15:Pr(O,Z,ge,Je,B),so(8,Z);break;case 23:break;case 22:var wt=Z.stateNode;Z.memoizedState!==null?wt._visibility&2?Pr(O,Z,ge,Je,B):tu(O,Z):(wt._visibility|=2,Pr(O,Z,ge,Je,B)),B&&ht&2048&&ml(Z.alternate,Z);break;case 24:Pr(O,Z,ge,Je,B),B&&ht&2048&&im(Z.alternate,Z);break;default:Pr(O,Z,ge,Je,B)}f=f.sibling}}function tu(c,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var y=c,S=f,B=S.flags;switch(S.tag){case 22:tu(y,S),B&2048&&ml(S.alternate,S);break;case 24:tu(y,S),B&2048&&im(S.alternate,S);break;default:tu(y,S)}f=f.sibling}}function ao(c,f,y){if(c.subtreeFlags&da)for(c=c.child;c!==null;)gl(c,f,y),c=c.sibling}function gl(c,f,y){switch(c.tag){case 26:if(ao(c,f,y),c.flags&da)if(c.memoizedState!==null)Ov(y,Si,c.memoizedState,c.memoizedProps);else{var S=c.stateNode,B=c.type;
3931c=c.memoizedProps,((f&335544128)===f||hm(B,c))&&hh(y,S,B,c)}break;case 5:ao(c,f,y),c.flags&da&&(S=c.stateNode,B=c.type,c=c.memoizedProps,((f&335544128)===f||hm(B,c))&&hh(y,S,B,c));break;case 3:case 4:Ra?(S=Si,Si=Bf(c.stateNode.containerInfo),ao(c,f,y),Si=S):ao(c,f,y);break;case 22:c.memoizedState===null&&(S=c.alternate,S!==null&&S.memoizedState!==null?(S=da,da=16777216,ao(c,f,y),da=S):ao(c,f,y));break;default:ao(c,f,y)}}function Qd(c){var f=c.alternate;if(f!==null&&(c=f.child,c!==null)){f.child=null;do f=c.sibling,c.sibling=null,c=f;while(c!==null)}}function nu(c){var f=c.deletions;if((c.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var S=f[y];xs=S,ra(S,c)}Qd(c)}if(c.subtreeFlags&10256)for(c=c.child;c!==null;)$d(c),c=c.sibling}function $d(c){switch(c.tag){case 0:case 11:case 15:nu(c),c.flags&2048&&ro(9,c,c.return);break;case 3:nu(c);break;case 12:nu(c);break;case 22:var f=c.stateNode;c.memoizedState!==null&&f._visibility&2&&(c.return===null||c.return.tag!==13)?(f._visibility&=-3,xf(c)):nu(c);break;default:nu(c)}}function xf(c){var f=c.deletions;if((c.flags&16)!==0){if(f!==null)for(var y=0;y<f.length;y++){var S=f[y];xs=S,ra(S,c)}Qd(c)}for(c=c.child;c!==null;){switch(f=c,f.tag){case 0:case 11:case 15:ro(8,f,f.return),xf(f);break;case 22:y=f.stateNode,y._visibility&2&&(y._visibility&=-3,xf(f));break;default:xf(f)}c=c.sibling}}function ra(c,f){for(;xs!==null;){var y=xs;switch(y.tag){case 0:case 11:case 15:ro(8,y,f);break;case 23:case 22:if(y.memoizedState!==null&&y.memoizedState.cachePool!==null){var S=y.memoizedState.cachePool.pool;S!=null&&S.refCount++}break;case 24:Rt(y.memoizedState.cache)}if(S=y.child,S!==null)S.return=y,xs=S;else e:for(y=c;xs!==null;){S=xs;var B=S.sibling,O=S.return;if(nm(S),S===y){xs=null;break e}if(B!==null){B.return=O,xs=B;break e}xs=O}}}function vl(c){var f=_n(c);if(f!=null){if(typeof f.memoizedProps["data-testname"]!="string")throw Error(s(364));return f}if(c=vs(c),c===null)throw Error(s(362));return c.stateNode.current}function yl(c,f){var y=c.tag;switch(f.$$typeof){case Ua:if(c.type===f.value)return!0;break;case _u:e:{for(f=f.value,c=[c,0],y=0;y<c.length;){var S=c[y++],B=S.tag,O=c[y++],Z=f[O];if(B!==5&&B!==26&&B!==27||!El(S)){for(;Z!=null&&yl(S,Z);)O++,Z=f[O];if(O===f.length){f=!0;break e}else for(S=S.child;S!==null;)c.push(S,O),S=S.sibling}}f=!1}return f;case bu:if((y===5||y===26||y===27)&&ym(c.stateNode,f.value))return!0;break;case Ll:if((y===5||y===6||y===26||y===27)&&(c=Cf(c),c!==null&&0<=c.indexOf(f.value)))return!0;break;case zf:if((y===5||y===26||y===27)&&(c=c.memoizedProps["data-testname"],typeof c=="string"&&c.toLowerCase()===f.value.toLowerCase()))return!0;break;default:throw Error(s(365))}return!1}function iu(c){switch(c.$$typeof){case Ua:return"<"+(v(c.value)||"Unknown")+">";case _u:return":has("+(iu(c)||"")+")";case bu:return'[role="'+c.value+'"]';case Ll:return'"'+c.value+'"';case zf:return'[data-testname="'+c.value+'"]';default:throw Error(s(365))}}function su(c,f){var y=[];c=[c,0];for(var S=0;S<c.length;){var B=c[S++],O=B.tag,Z=c[S++],ge=f[Z];if(O!==5&&O!==26&&O!==27||!El(B)){for(;ge!=null&&yl(B,ge);)Z++,ge=f[Z];if(Z===f.length)y.push(B);else for(B=B.child;B!==null;)c.push(B,Z),B=B.sibling}}return y}function Or(c,f){if(!Os)throw Error(s(363));c=vl(c),c=su(c,f),f=[],c=Array.from(c);for(var y=0;y<c.length;){var S=c[y++],B=S.tag;if(B===5||B===26||B===27)El(S)||f.push(S.stateNode);else for(S=S.child;S!==null;)c.push(S),S=S.sibling}return f}function ji(){return(zn&2)!==0&&jn!==0?jn&-jn:on.T!==null?sn():hu()}function Uo(){if(Rr===0)if((jn&536870912)===0||Gn){var c=uc;uc<<=1,(uc&3932160)===0&&(uc=262144),Rr=c}else Rr=536870912;return c=Hr.current,c!==null&&(c.flags|=32),Rr}function es(c,f,y){(c===In&&(Ai===2||Ai===9)||c.cancelPendingCommit!==null)&&(os(c,0),lo(c,jn,Rr,!1)),H(c,y),((zn&2)===0||c!==In)&&(c===In&&((zn&2)===0&&(Nl|=y),ss===4&&lo(c,jn,Rr,!1)),yt(c))}function ja(c,f,y){if((zn&6)!==0)throw Error(s(327));var S=!y&&(f&127)===0&&(f&c.expiredLanes)===0||D(c,f),B=S?Yg(c,f):co(c,f,!0),O=S;do{if(B===0){Pl&&!S&&lo(c,f,0,!1);break}else{if(y=c.current.alternate,O&&!Xg(y)){B=co(c,f,!1),O=!1;continue}if(B===2){if(O=f,c.errorRecoveryDisabledLanes&O)var Z=0;else Z=c.pendingLanes&-536870913,Z=Z!==0?Z:Z&536870912?536870912:0;if(Z!==0){f=Z;e:{var ge=c;B=Ff;var Je=Vi&&ge.current.memoizedState.isDehydrated;if(Je&&(os(ge,Z).flags|=256),Z=co(ge,Z,!1),Z!==2){if(Ol&&!Je){ge.errorRecoveryDisabledLanes|=O,Nl|=O,B=4;break e}O=jr,jr=B,O!==null&&(jr===null?jr=O:jr.push.apply(jr,O))}B=Z}if(O=!1,B!==2)continue}}if(B===1){os(c,0),lo(c,f,0,!0);break}e:{switch(S=c,O=B,O){case 0:case 1:throw Error(s(345));case 4:if((f&4194048)!==f)break;case 6:lo(S,f,Rr,!qa);break e;case 2:jr=null;break;case 3:case 5:break;default:throw Error(s(329))}if((f&62914560)===f&&(B=kf+300-ur(),10<B)){if(lo(S,f,Rr,!qa),E(S,0,!0)!==0)break e;
vendor: 4,540 bytes, line 3931
3931Mo=f,S.timeoutHandle=dm(oo.bind(null,S,y,jr,Hf,Oh,f,Rr,Nl,Au,qa,O,"Throttled",-0,0),B);break e}oo(S,y,jr,Hf,Oh,f,Rr,Nl,Au,qa,O,null,-0,0)}}break}while(!0);yt(c)}function oo(c,f,y,S,B,O,Z,ge,Je,ht,wt,gt,jt,yn){if(c.timeoutHandle=zr,gt=f.subtreeFlags,gt&8192||(gt&16785408)===16785408){gt=pm(),gl(f,O,gt);var bs=(O&62914560)===O?kf-ur():(O&4194048)===O?vc-ur():0;if(bs=tv(gt,bs),bs!==null){Mo=O,c.cancelPendingCommit=bs(fo.bind(null,c,f,O,y,S,B,Z,ge,Je,wt,gt,null,jt,yn)),lo(c,O,Z,!ht);return}}fo(c,f,O,y,S,B,Z,ge,Je)}function Xg(c){for(var f=c;;){var y=f.tag;if((y===0||y===11||y===15)&&f.flags&16384&&(y=f.updateQueue,y!==null&&(y=y.stores,y!==null)))for(var S=0;S<y.length;S++){var B=y[S],O=B.getSnapshot;B=B.value;try{if(!ys(O(),B))return!1}catch{return!1}}if(y=f.child,f.subtreeFlags&16384&&y!==null)y.return=f,f=y;else{if(f===c)break;for(;f.sibling===null;){if(f.return===null||f.return===c)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function lo(c,f,y,S){f&=~Su,f&=~Nl,c.suspendedLanes|=f,c.pingedLanes&=~f,S&&(c.warmLanes|=f),S=c.expirationTimes;for(var B=f;0<B;){var O=31-Fr(B),Z=1<<O;S[O]=-1,B&=~Z}y!==0&&X(c,y,f)}function eh(){return(zn&6)===0?(At(0),!1):!0}function th(){if(Fn!==null){if(Ai===0)var c=Fn.return;else c=Fn,Wa=Oi=null,Tn(c),Bl=null,dc=0,c=Fn;for(;c!==null;)jg(c.alternate,c),c=c.return;Fn=null}}function os(c,f){var y=c.timeoutHandle;y!==zr&&(c.timeoutHandle=zr,ev(y)),y=c.cancelPendingCommit,y!==null&&(c.cancelPendingCommit=null,y()),Mo=0,th(),In=c,Fn=y=oa(c.current,null),jn=f,Ai=0,Rs=null,qa=!1,Pl=D(c,f),Ol=!1,Au=Rr=Su=Nl=Jo=ss=0,jr=Ff=null,Oh=!1,(f&8)!==0&&(f|=f&32);var S=c.entangledLanes;if(S!==0)for(c=c.entanglements,S&=f;0<S;){var B=31-Fr(S),O=1<<B;f|=c[B],S&=~O}return Ao=f,Vs(),y}function Pi(c,f){bn=null,on.H=fa,f===Fs||f===Oa?(f=Tt(),Ai=3):f===Lh?(f=Tt(),Ai=4):Ai=f===Cr?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,Rs=f,Fn===null&&(ss=1,Vd(c,ue(f,c.current)))}function Wn(){var c=Hr.current;return c===null?!0:(jn&4194048)===jn?Gr===null:(jn&62914560)===jn||(jn&536870912)!==0?c===Gr:!1}function zo(){var c=on.H;return on.H=fa,c===null?fa:c}function aa(){var c=on.A;return on.A=xu,c}function ru(){ss=4,qa||(jn&4194048)!==jn&&Hr.current!==null||(Pl=!0),(Jo&134217727)===0&&(Nl&134217727)===0||In===null||lo(In,jn,Rr,!1)}function co(c,f,y){var S=zn;zn|=2;var B=zo(),O=aa();(In!==c||jn!==f)&&(Hf=null,os(c,f)),f=!1;var Z=ss;e:do try{if(Ai!==0&&Fn!==null){var ge=Fn,Je=Rs;switch(Ai){case 8:th(),Z=6;break e;case 3:case 2:case 9:case 6:Hr.current===null&&(f=!0);var ht=Ai;if(Ai=0,Rs=null,uo(c,ge,Je,ht),y&&Pl){Z=0;break e}break;default:ht=Ai,Ai=0,Rs=null,uo(c,ge,Je,ht)}}qg(),Z=ss;break}catch(wt){Pi(c,wt)}while(!0);return f&&c.shellSuspendCounter++,Wa=Oi=null,zn=S,on.H=B,on.A=O,Fn===null&&(In=null,jn=0,Vs()),Z}function qg(){for(;Fn!==null;)xl(Fn)}function Yg(c,f){var y=zn;zn|=2;var S=zo(),B=aa();In!==c||jn!==f?(Hf=null,Ul=ur()+500,os(c,f)):Pl=D(c,f);e:do try{if(Ai!==0&&Fn!==null){f=Fn;var O=Rs;t:switch(Ai){case 1:Ai=0,Rs=null,uo(c,f,O,1);break;case 2:case 9:if(nn(O)){Ai=0,Rs=null,nh(f);break}f=function(){Ai!==2&&Ai!==9||In!==c||(Ai=7),yt(c)},O.then(f,f);break e;case 3:Ai=7;break e;case 4:Ai=5;break e;case 7:nn(O)?(Ai=0,Rs=null,nh(f)):(Ai=0,Rs=null,uo(c,f,O,7));break;case 5:var Z=null;switch(Fn.tag){case 26:Z=Fn.memoizedState;case 5:case 27:var ge=Fn,Je=ge.type,ht=ge.pendingProps;if(Z?km(Z):ts(ge.stateNode,Je,ht)){Ai=0,Rs=null;var wt=ge.sibling;if(wt!==null)Fn=wt;else{var gt=ge.return;gt!==null?(Fn=gt,ou(gt)):Fn=null}break t}}Ai=0,Rs=null,uo(c,f,O,5);break;case 6:Ai=0,Rs=null,uo(c,f,O,6);break;case 8:th(),ss=6;break e;default:throw Error(s(462))}}au();break}catch(jt){Pi(c,jt)}while(!0);return Wa=Oi=null,on.H=S,on.A=B,zn=y,Fn!==null?0:(In=null,jn=0,Vs(),ss)}function au(){for(;Fn!==null&&!Uv();)xl(Fn)}function xl(c){var f=Kp(c.alternate,c,Ao);c.memoizedProps=c.pendingProps,f===null?ou(c):Fn=f}function nh(c){var f=c,y=f.alternate;switch(f.tag){case 15:case 0:f=Vp(y,f,f.pendingProps,f.type,void 0,jn);break;case 11:f=Vp(y,f,f.pendingProps,f.type.render,f.ref,jn);break;case 5:Tn(f);default:jg(y,f),f=Fn=rh(f,Ao),f=Kp(y,f,Ao)}c.memoizedProps=c.pendingProps,f===null?ou(c):Fn=f}function uo(c,f,y,S){Wa=Oi=null,Tn(f),Bl=null,dc=0;var B=f.return;try{if(mb(c,B,f,y,jn)){ss=1,Vd(c,ue(y,c.current)),Fn=null;return}}catch(O){if(B!==null)throw Fn=B,O;ss=1,Vd(c,ue(y,c.current)),Fn=null;return}f.flags&32768?(Gn||S===1?c=!0:Pl||(jn&536870912)!==0?c=!1:(qa=c=!0,(S===2||S===9||S===3||S===6)&&(S=Hr.current,S!==null&&S.tag===13&&(S.flags|=16384))),_l(f,c)
vendor: 4,593 bytes, line 3931
3931):ou(f)}function ou(c){var f=c;do{if((f.flags&32768)!==0){_l(f,qa);return}c=f.return;var y=Gg(f.alternate,f,Ao);if(y!==null){Fn=y;return}if(f=f.sibling,f!==null){Fn=f;return}Fn=f=c}while(f!==null);ss===0&&(ss=5)}function _l(c,f){do{var y=$p(c.alternate,c);if(y!==null){y.flags&=32767,Fn=y;return}if(y=c.return,y!==null&&(y.flags|=32768,y.subtreeFlags=0,y.deletions=null),!f&&(c=c.sibling,c!==null)){Fn=c;return}Fn=c=y}while(c!==null);ss=6,Fn=null}function fo(c,f,y,S,B,O,Z,ge,Je){c.cancelPendingCommit=null;do po();while(Bs!==0);if((zn&6)!==0)throw Error(s(327));if(f!==null){if(f===c.current)throw Error(s(177));if(O=f.lanes|f.childLanes,O|=hc,F(c,y,O,Z,ge,Je),c===In&&(Fn=In=null,jn=0),yc=f,Zo=c,Mo=y,Mu=O,Nh=B,Jm=S,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(c.callbackNode=null,c.callbackPriority=0,ws(Df,function(){return _f(),null})):(c.callbackNode=null,c.callbackPriority=0),S=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||S){S=on.T,on.T=null,B=Ca(),Hn(2),Z=zn,zn|=4;try{gb(c,f,y)}finally{zn=Z,Hn(B),on.T=S}}Bs=1,Fo(),ho(),ih()}}function Fo(){if(Bs===1){Bs=0;var c=Zo,f=yc,y=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||y){y=on.T,on.T=null;var S=Ca();Hn(2);var B=zn;zn|=4;try{yf(f,c),$g(c.containerInfo)}finally{zn=B,Hn(S),on.T=y}}c.current=f,Bs=2}}function ho(){if(Bs===2){Bs=0;var c=Zo,f=yc,y=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||y){y=on.T,on.T=null;var S=Ca();Hn(2);var B=zn;zn|=4;try{Wg(c,f.alternate,f)}finally{zn=B,Hn(S),on.T=y}}Bs=3}}function ih(){if(Bs===4||Bs===3){Bs=0,Gm();var c=Zo,f=yc,y=Mo,S=Jm;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?Bs=5:(Bs=0,yc=Zo=null,sh(c,c.pendingLanes));var B=c.pendingLanes;if(B===0&&(Ko=null),ve(y),f=f.stateNode,kr&&typeof kr.onCommitFiberRoot=="function")try{kr.onCommitFiberRoot(fc,f,void 0,(f.current.flags&128)===128)}catch{}if(S!==null){f=on.T,B=Ca(),Hn(2),on.T=null;try{for(var O=c.onRecoverableError,Z=0;Z<S.length;Z++){var ge=S[Z];O(ge.value,{componentStack:ge.stack})}}finally{on.T=f,Hn(B)}}(Mo&3)!==0&&po(),yt(c),B=c.pendingLanes,(y&261930)!==0&&(B&42)!==0?c===Gf?ii++:(ii=0,Gf=c):ii=0,Vi&&Rf(),At(0)}}function sh(c,f){(c.pooledCacheLanes&=f)===0&&(f=c.pooledCache,f!=null&&(c.pooledCache=null,Rt(f)))}function po(){return Fo(),ho(),ih(),_f()}function _f(){if(Bs!==5)return!1;var c=Zo,f=Mu;Mu=0;var y=ve(Mo),S=32>y?32:y;y=on.T;var B=Ca();try{Hn(S),on.T=null,S=Nh,Nh=null;var O=Zo,Z=Mo;if(Bs=0,yc=Zo=null,Mo=0,(zn&6)!==0)throw Error(s(331));var ge=zn;if(zn|=4,$d(O.current),Zd(O,O.current,Z,S),zn=ge,At(0,!1),kr&&typeof kr.onPostCommitFiberRoot=="function")try{kr.onPostCommitFiberRoot(fc,O)}catch{}return!0}finally{Hn(B),on.T=y,sh(c,f)}}function bl(c,f,y){f=ue(y,f),f=Gp(c.stateNode,f,2),c=tr(c,f,2),c!==null&&(H(c,2),yt(c))}function pn(c,f,y){if(c.tag===3)bl(c,c,y);else for(;f!==null;){if(f.tag===3){bl(f,c,y);break}else if(f.tag===1){var S=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof S.componentDidCatch=="function"&&(Ko===null||!Ko.has(S))){c=ue(y,c),y=Bg(2),S=tr(f,y,2),S!==null&&(Ig(y,S,f,c),H(S,2),yt(S));break}}f=f.return}}function lu(c,f,y){var S=c.pingCache;if(S===null){S=c.pingCache=new ha;var B=new Set;S.set(f,B)}else B=S.get(f),B===void 0&&(B=new Set,S.set(f,B));B.has(y)||(Ol=!0,B.add(y),c=Jg.bind(null,c,f,y),f.then(c,c))}function Jg(c,f,y){var S=c.pingCache;S!==null&&S.delete(f),c.pingedLanes|=c.suspendedLanes&y,c.warmLanes&=~y,In===c&&(jn&y)===y&&(ss===4||ss===3&&(jn&62914560)===jn&&300>ur()-kf?(zn&2)===0&&os(c,0):Su|=y,Au===jn&&(Au=0)),yt(c)}function Kg(c,f){f===0&&(f=P()),c=Ws(c,f),c!==null&&(H(c,f),yt(c))}function vb(c){var f=c.memoizedState,y=0;f!==null&&(y=f.retryLane),Kg(c,y)}function yb(c,f){var y=0;switch(c.tag){case 31:case 13:var S=c.stateNode,B=c.memoizedState;B!==null&&(y=B.retryLane);break;case 19:S=c.stateNode;break;case 22:S=c.stateNode._retryCache;break;default:throw Error(s(314))}S!==null&&S.delete(f),Kg(c,y)}function ws(c,f){return If(c,f)}function sm(c,f,y,S){this.tag=c,this.key=y,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=S,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Zl(c){return c=c.prototype,!(!c||!c.isReactComponent)}function oa(c,f){var y=c.alternate;return y===null?(y=t(c.tag,f,c.key,c.mode),y.elementType=c.elementType,y.type=c.type,y.stateNode=c.stateNode,y.alternate=c,c.alternate=y):(y.pendingProps=f,y.type=c.type,y.flags=0,y.subtreeFlags=0,y.deleti
vendor: 4,864 bytes, line 3931
3931ons=null),y.flags=c.flags&65011712,y.childLanes=c.childLanes,y.lanes=c.lanes,y.child=c.child,y.memoizedProps=c.memoizedProps,y.memoizedState=c.memoizedState,y.updateQueue=c.updateQueue,f=c.dependencies,y.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},y.sibling=c.sibling,y.index=c.index,y.ref=c.ref,y.refCleanup=c.refCleanup,y}function rh(c,f){c.flags&=65011714;var y=c.alternate;return y===null?(c.childLanes=0,c.lanes=f,c.child=null,c.subtreeFlags=0,c.memoizedProps=null,c.memoizedState=null,c.updateQueue=null,c.dependencies=null,c.stateNode=null):(c.childLanes=y.childLanes,c.lanes=y.lanes,c.child=y.child,c.subtreeFlags=0,c.deletions=null,c.memoizedProps=y.memoizedProps,c.memoizedState=y.memoizedState,c.updateQueue=y.updateQueue,c.type=y.type,f=y.dependencies,c.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),c}function ko(c,f,y,S,B,O){var Z=0;if(S=c,typeof c=="function")Zl(c)&&(Z=1);else if(typeof c=="string")Z=Ra&&Ns?_h(c,y,Js.current)?26:Hm(c)?27:5:Ra?_h(c,y,Js.current)?26:5:Ns&&Hm(c)?27:5;else e:switch(c){case Mf:return c=t(31,y,f,B),c.elementType=Mf,c.lanes=O,c;case tc:return Ta(y.children,B,O,f);case nc:Z=8,B|=24;break;case ic:return c=t(12,y,f,B|2),c.elementType=ic,c.lanes=O,c;case ch:return c=t(13,y,f,B),c.elementType=ch,c.lanes=O,c;case Ho:return c=t(19,y,f,B),c.elementType=Ho,c.lanes=O,c;default:if(typeof c=="object"&&c!==null)switch(c.$$typeof){case wa:Z=10;break e;case Af:Z=9;break e;case cu:Z=11;break e;case uh:Z=14;break e;case Mr:Z=16,S=null;break e}Z=29,y=Error(s(130,c===null?"null":typeof c,"")),S=null}return f=t(Z,y,f,B),f.elementType=c,f.type=S,f.lanes=O,f}function Ta(c,f,y,S){return c=t(7,c,S,f),c.lanes=y,c}function rm(c,f,y){return c=t(6,c,null,f),c.lanes=y,c}function am(c){var f=t(18,null,null,0);return f.stateNode=c,f}function om(c,f,y){return f=t(4,c.children!==null?c.children:[],c.key,f),f.lanes=y,f.stateNode={containerInfo:c.containerInfo,pendingChildren:null,implementation:c.implementation},f}function Zg(c,f,y,S,B,O,Z,ge,Je){this.tag=1,this.containerInfo=c,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=zr,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=G(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=G(0),this.hiddenUpdates=G(null),this.identifierPrefix=S,this.onUncaughtError=B,this.onCaughtError=O,this.onRecoverableError=Z,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Je,this.incompleteTransitions=new Map}function Sl(c,f,y,S,B,O,Z,ge,Je,ht,wt,gt){return c=new Zg(c,f,y,Z,Je,ht,wt,gt,ge),f=1,O===!0&&(f|=24),O=t(3,null,null,f),c.current=O,O.stateNode=c,f=Fe(),f.refCount++,c.pooledCache=f,f.refCount++,O.memoizedState={element:S,isDehydrated:y,cache:f},Fi(O),c}function ah(c){return c?(c=go,c):go}function bf(c){var f=c._reactInternals;if(f===void 0)throw typeof c.render=="function"?Error(s(188)):(c=Object.keys(c).join(","),Error(s(268,c)));return c=u(f),c=c!==null?h(c):null,c===null?null:fu(c.stateNode)}function lm(c,f,y,S,B,O){B=ah(B),S.context===null?S.context=B:S.pendingContext=B,S=ui(f),S.payload={element:y},O=O===void 0?null:O,O!==null&&(S.callback=O),y=tr(c,S,f),y!==null&&(es(y,c,f),xa(y,c,f))}function Ql(c,f){if(c=c.memoizedState,c!==null&&c.dehydrated!==null){var y=c.retryLane;c.retryLane=y!==0&&y<f?y:f}}function Sf(c,f){Ql(c,f),(c=c.alternate)&&Ql(c,f)}var Rn={},oh=ld,Nr=N8,lh=Object.assign,$l=Symbol.for("react.element"),mo=Symbol.for("react.transitional.element"),ec=Symbol.for("react.portal"),tc=Symbol.for("react.fragment"),nc=Symbol.for("react.strict_mode"),ic=Symbol.for("react.profiler"),Af=Symbol.for("react.consumer"),wa=Symbol.for("react.context"),cu=Symbol.for("react.forward_ref"),ch=Symbol.for("react.suspense"),Ho=Symbol.for("react.suspense_list"),uh=Symbol.for("react.memo"),Mr=Symbol.for("react.lazy"),Mf=Symbol.for("react.activity"),cm=Symbol.for("react.memo_cache_sentinel"),Go=Symbol.iterator,Al=Symbol.for("react.client.reference"),Ml=Array.isArray,on=oh.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,um=e.rendererVersion,Ef=e.rendererPackageName,uu=e.extraDevToolsConfig,fu=e.getPublicInstance,Qg=e.getRootHostContext,du=e.getChildHostContext,fh=e.prepareForCommit,$g=e.resetAfterCommit,fm=e.createInstance;e.cloneMutableInstance;var Tf=e.appendInitialChild,Ur=e.finalizeInitialChildren,Er=e.shouldSetTextContent,jo=e.createTextInstance;e.cloneMutableTextInstance;var dm=e.scheduleTimeout,ev=e.cancelTimeout,zr=e.noTimeout,gs=e.isPrimaryRenderer;e.warnsIfNotActing;var Xn=e.supportsMutation,la=e.supportsPersistence,Vi=e.supportsHydration,_n=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var Ei=e.preparePortalMount;
vendor: 5,093 bytes, line 3931
3931e.prepareScopeUpdate,e.getInstanceFromScope;var Hn=e.setCurrentUpdatePriority,Ca=e.getCurrentUpdatePriority,hu=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var sc=e.shouldAttemptEagerTransition,dh=e.detachDeletedInstance;e.requestPostPaintCallback;var wf=e.maySuspendCommit,pu=e.maySuspendCommitOnUpdate,hm=e.maySuspendCommitInSyncRender,ts=e.preloadInstance,pm=e.startSuspendingCommit,hh=e.suspendInstance;e.suspendOnActiveViewTransition;var tv=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var rc=e.NotPendingTransition,ac=e.HostTransitionContext,mm=e.resetFormInstance;e.bindToConsole;var gm=e.supportsMicrotasks,vm=e.scheduleMicrotask,Os=e.supportsTestSelectors,vs=e.findFiberRoot,ph=e.getBoundingRect,Cf=e.getTextContent,El=e.isHiddenSubtree,ym=e.matchAccessibilityRole,Vo=e.setFocusIfFocusable,mh=e.setupIntersectionObserver,xm=e.appendChild,_m=e.appendChildToContainer,nv=e.commitTextUpdate,iv=e.commitMount,sv=e.commitUpdate,rv=e.insertBefore,av=e.insertInContainerBefore,ov=e.removeChild,bm=e.removeChildFromContainer,Sm=e.resetTextContent,xb=e.hideInstance,lv=e.hideTextInstance,cv=e.unhideInstance,uv=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var Am=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var fv=e.cloneInstance,Mm=e.createContainerChildSet,Em=e.appendChildToContainerChildSet,dv=e.finalizeContainerChildren,Tm=e.replaceContainerChildren,hv=e.cloneHiddenInstance,wm=e.cloneHiddenTextInstance,Tl=e.isSuspenseInstancePending,gh=e.isSuspenseInstanceFallback,vh=e.getSuspenseInstanceFallbackErrorDetails,yh=e.registerSuspenseInstanceRetry,pv=e.canHydrateFormStateMarker,Cm=e.isFormStateMarkerMatching,mv=e.getNextHydratableSibling,gv=e.getNextHydratableSiblingAfterSingleton,vv=e.getFirstHydratableChild,yv=e.getFirstHydratableChildWithinContainer,xv=e.getFirstHydratableChildWithinActivityInstance,_v=e.getFirstHydratableChildWithinSuspenseInstance,Rm=e.getFirstHydratableChildWithinSingleton,bv=e.canHydrateInstance,Sv=e.canHydrateTextInstance,Bm=e.canHydrateActivityInstance,Av=e.canHydrateSuspenseInstance,Mv=e.hydrateInstance,_b=e.hydrateTextInstance,Im=e.hydrateActivityInstance,Ev=e.hydrateSuspenseInstance,Tv=e.getNextHydratableInstanceAfterActivityInstance,Dm=e.getNextHydratableInstanceAfterSuspenseInstance,wv=e.commitHydratedInstance,Cv=e.commitHydratedContainer,bb=e.commitHydratedActivityInstance,Sb=e.commitHydratedSuspenseInstance,Rv=e.finalizeHydratedChildren,Rf=e.flushHydrationEvents;e.clearActivityBoundary;var Lm=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var xh=e.clearSuspenseBoundaryFromContainer,Bv=e.hideDehydratedBoundary,Iv=e.unhideDehydratedBoundary,mu=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var Dv=e.validateHydratableInstance,Pm=e.validateHydratableTextInstance,Ra=e.supportsResources,_h=e.isHostHoistableType,Bf=e.getHoistableRoot,Om=e.getResource,Nm=e.acquireResource,wl=e.releaseResource,Lv=e.hydrateHoistable,Um=e.mountHoistable,zm=e.unmountHoistable,bh=e.createHoistableInstance,Pv=e.prepareToCommitHoistables,Fm=e.mayResourceSuspendCommit,km=e.preloadResource,Ov=e.suspendResource,Ns=e.supportsSingletons,Sh=e.resolveSingletonInstance,Cs=e.acquireSingletonInstance,Ys=e.releaseSingletonInstance,Hm=e.isHostSingletonType,oc=e.isSingletonScope,Ah=[],lc=-1,go={},Fr=Math.clz32?Math.clz32:R,Mh=Math.log,Nv=Math.LN2,Eh=256,uc=262144,gu=4194304,If=Nr.unstable_scheduleCallback,Th=Nr.unstable_cancelCallback,Uv=Nr.unstable_shouldYield,Gm=Nr.unstable_requestPaint,ur=Nr.unstable_now,wh=Nr.unstable_ImmediatePriority,zv=Nr.unstable_UserBlockingPriority,Df=Nr.unstable_NormalPriority,Ch=Nr.unstable_IdlePriority,jm=Nr.log,Fv=Nr.unstable_setDisableYieldValue,fc=null,kr=null,ys=typeof Object.is=="function"?Object.is:le,Rh=typeof reportError=="function"?reportError:function(c){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof c=="object"&&c!==null&&typeof c.message=="string"?String(c.message):String(c),error:c});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",c);return}console.error(c)},Ab=Object.prototype.hasOwnProperty,Bh,vo,Lf=!1,Vm=new WeakMap,Wo=[],yo=0,Ti=null,Pf=0,Ba=[],ca=0,Ia=null,ir=1,Va="",Js=x(null),Xo=x(null),sr=x(null),Of=x(null),Us=null,Wi=null,Gn=!1,xo=null,Tr=!1,Ih=Error(s(519)),Da=x(null),Oi=null,Wa=null,kv=typeof AbortController<"u"?AbortController:function(){var c=[],f=this.signal={aborted:!1,addEventListener:function(y,S){c.push(S)}};
vendor: 5,357 bytes, line 3931
3931this.abort=function(){f.aborted=!0,c.forEach(function(y){return y()})}},Ks=Nr.unstable_scheduleCallback,Mb=Nr.unstable_NormalPriority,Xi={$$typeof:wa,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Nf=null,bi=null,fr=!1,La=!1,Dh=!1,Cl=0,vu=null,Wm=0,qo=0,zs=null,Pa=on.S;on.S=function(c,f){vc=ur(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&cn(c,f),Pa!==null&&Pa(c,f)};var Rl=x(null),Fs=Error(s(460)),Lh=Error(s(474)),Oa=Error(s(542)),_o={then:function(){}},wr=null,Bl=null,dc=0,rr=er(!0),Xm=er(!1),ar=[],bo=0,hc=0,ua=!1,Ph=!1,pc=x(null),Il=x(0),Hr=x(null),Gr=null,ls=x(0),Yo=0,bn=null,en=null,mn=null,Bn=!1,wn=!1,qn=!1,dr=0,Na=0,Xa=null,qm=0,fa={readContext:Se,use:Un,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useLayoutEffect:zt,useInsertionEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useSyncExternalStore:zt,useId:zt,useHostTransitionStatus:zt,useFormState:zt,useActionState:zt,useOptimistic:zt,useMemoCache:zt,useCacheRefresh:zt};fa.useEffectEvent=zt;var ns={readContext:Se,use:Un,useCallback:function(c,f){return pi().memoizedState=[c,f===void 0?null:f],c},useContext:Se,useEffect:af,useImperativeHandle:function(c,f,y){y=y!=null?y.concat([c]):null,_a(4194308,4,Xc.bind(null,f,c),y)},useLayoutEffect:function(c,f){return _a(4194308,4,c,f)},useInsertionEffect:function(c,f){_a(4,2,c,f)},useMemo:function(c,f){var y=pi();f=f===void 0?null:f;var S=c();if(qn){J(!0);try{c()}finally{J(!1)}}return y.memoizedState=[S,f],S},useReducer:function(c,f,y){var S=pi();if(y!==void 0){var B=y(f);if(qn){J(!0);try{y(f)}finally{J(!1)}}}else B=f;return S.memoizedState=S.baseState=B,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:c,lastRenderedState:B},S.queue=c,c=c.dispatch=pb.bind(null,bn,c),[S.memoizedState,c]},useRef:function(c){var f=pi();return c={current:c},f.memoizedState=c},useState:function(c){c=Ae(c);var f=c.queue,y=Tg.bind(null,bn,f);return f.dispatch=y,[c.memoizedState,y]},useDebugValue:lf,useDeferredValue:function(c,f){var y=pi();return Yc(y,c,f)},useTransition:function(){var c=Ae(!1);return c=Ag.bind(null,bn,c.queue,!0,!1),pi().memoizedState=c,[!1,c]},useSyncExternalStore:function(c,f,y){var S=bn,B=pi();if(Gn){if(y===void 0)throw Error(s(407));y=y()}else{if(y=f(),In===null)throw Error(s(349));(jn&127)!==0||T(S,f,y)}B.memoizedState=y;var O={value:y,getSnapshot:f};return B.queue=O,af(N.bind(null,S,O,c),[c]),S.flags|=2048,Di(9,{destroy:void 0},I.bind(null,S,O,y,f),null),y},useId:function(){var c=pi(),f=In.identifierPrefix;if(Gn){var y=Va,S=ir;y=(S&~(1<<32-Fr(S)-1)).toString(32)+y,f="_"+f+"R_"+y,y=dr++,0<y&&(f+="H"+y.toString(32)),f+="_"}else y=qm++,f="_"+f+"r_"+y.toString(32)+"_";return c.memoizedState=f},useHostTransitionStatus:Fp,useFormState:_t,useActionState:_t,useOptimistic:function(c){var f=pi();f.memoizedState=f.baseState=c;var y={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=y,f=Hd.bind(null,bn,!0,y),y.dispatch=f,[c,f]},useMemoCache:Gi,useCacheRefresh:function(){return pi().memoizedState=hb.bind(null,bn)},useEffectEvent:function(c){var f=pi(),y={impl:c};return f.memoizedState=y,function(){if((zn&2)!==0)throw Error(s(440));return y.impl.apply(void 0,arguments)}}},So={readContext:Se,use:Un,useCallback:Fd,useContext:Se,useEffect:Wc,useImperativeHandle:Sg,useInsertionEffect:dl,useLayoutEffect:of,useMemo:qc,useReducer:wi,useRef:sa,useState:function(){return wi(mi)},useDebugValue:lf,useDeferredValue:function(c,f){var y=Kn();return zp(y,en.memoizedState,c,f)},useTransition:function(){var c=wi(mi)[0],f=Kn().memoizedState;return[typeof c=="boolean"?c:Bi(c),f]},useSyncExternalStore:Y,useId:kd,useHostTransitionStatus:Fp,useFormState:Ht,useActionState:Ht,useOptimistic:function(c,f){var y=Kn();return tt(y,en,c,f)},useMemoCache:Gi,useCacheRefresh:Eg};So.useEffectEvent=br;var Dl={readContext:Se,use:Un,useCallback:Fd,useContext:Se,useEffect:Wc,useImperativeHandle:Sg,useInsertionEffect:dl,useLayoutEffect:of,useMemo:qc,useReducer:no,useRef:sa,useState:function(){return no(mi)},useDebugValue:lf,useDeferredValue:function(c,f){var y=Kn();return en===null?Yc(y,c,f):zp(y,en.memoizedState,c,f)},useTransition:function(){var c=no(mi)[0],f=Kn().memoizedState;return[typeof c=="boolean"?c:Bi(c),f]},useSyncExternalStore:Y,useId:kd,useHostTransitionStatus:Fp,useFormState:Ts,useActionState:Ts,useOptimistic:function(c,f){var y=Kn();return en!==null?tt(y,en,c,f):(y.baseState=c,[c,y.queue.dispatch])},useMemoCache:Gi,useCacheRefresh:Eg};Dl.useEffectEvent=br;var Uf={enqueueSetState:function(c,f,y){c=c._reactInternals;var S=ji(),B=ui(S);B.payload=f,y!=null&&(B.callback=y),f=tr(c,B,S),f!==null&&(es(f,c,S),xa(f,c,S))},enqueueReplaceState:function(c,f,y){c=c._reactInternals;var S=ji(),B=ui(S);B.tag=1,B.payload=f,y!=null&&(B.callback=y),f=tr(c,B,S),f!==null&&(es(f,c,S),xa(f,c,S))},enqueueForceUpdate:function(c,f){c=c._reactInternals;var y=ji(),S=ui(y);S.tag=2,f!=null&&(S.callback=f),f=tr(c,S,y),f!==null&&(es(f,c,y),xa(f,c,y))}},Cr=Error(s(461)),ki=!1,mc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},cs=!1,us=!1,yu=!1,Ym=typeof WeakSet=="function"?WeakSet:Set,xs=null,is=null,_s=!1,Si=null,da=8192,xu={getCacheForType:function(c){var f=Se(Xi),y=f.data.get(c);return y===void 0&&(y=c(),f.data.set(c,y)),y}
3931,cacheSignal:function(){return Se(Xi).controller.signal}},Ua=0,_u=1,bu=2,zf=3,Ll=4;if(typeof Symbol=="function"&&Symbol.for){var gc=Symbol.for;Ua=gc("selector.component"),_u=gc("selector.has_pseudo_class"),bu=gc("selector.role"),zf=gc("selector.test_id"),Ll=gc("selector.text")}var ha=typeof WeakMap=="function"?WeakMap:Map,zn=0,In=null,Fn=null,jn=0,Ai=0,Rs=null,qa=!1,Pl=!1,Ol=!1,Ao=0,ss=0,Jo=0,Nl=0,Su=0,Rr=0,Au=0,Ff=null,jr=null,Oh=!1,kf=0,vc=0,Ul=1/0,Hf=null,Ko=null,Bs=0,Zo=null,yc=null,Mo=0,Mu=0,Nh=null,Jm=null,ii=0,Gf=null;return Rn.attemptContinuousHydration=function(c){if(c.tag===13||c.tag===31){var f=Ws(c,67108864);f!==null&&es(f,c,67108864),Sf(c,67108864)}},Rn.attemptHydrationAtCurrentPriority=function(c){if(c.tag===13||c.tag===31){var f=ji();f=ie(f);var y=Ws(c,f);y!==null&&es(y,c,f),Sf(c,f)}},Rn.attemptSynchronousHydration=function(c){switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=w(c.pendingLanes);if(f!==0){for(c.pendingLanes|=2,c.entangledLanes|=2;f;){var y=1<<31-Fr(f);c.entanglements[1]|=y,f&=~y}yt(c),(zn&6)===0&&(Ul=ur()+500,At(0))}}break;case 31:case 13:f=Ws(c,2),f!==null&&es(f,c,2),eh(),Sf(c,2)}},Rn.batchedUpdates=function(c,f){return c(f)},Rn.createComponentSelector=function(c){return{$$typeof:Ua,value:c}},Rn.createContainer=function(c,f,y,S,B,O,Z,ge,Je,ht){return Sl(c,f,!1,null,y,S,O,null,Z,ge,Je,ht)},Rn.createHasPseudoClassSelector=function(c){return{$$typeof:_u,value:c}},Rn.createHydrationContainer=function(c,f,y,S,B,O,Z,ge,Je,ht,wt,gt,jt,yn){var bs;return c=Sl(y,S,!0,c,B,O,ge,yn,Je,ht,wt,gt),c.context=ah(null),y=c.current,S=ji(),S=ie(S),B=ui(S),B.callback=(bs=f)!=null?bs:null,tr(y,B,S),f=S,c.current.lanes=f,H(c,f),yt(c),c},Rn.createPortal=function(c,f,y){var S=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ec,key:S==null?null:""+S,children:c,containerInfo:f,implementation:y}},Rn.createRoleSelector=function(c){return{$$typeof:bu,value:c}},Rn.createTestNameSelector=function(c){return{$$typeof:zf,value:c}},Rn.createTextSelector=function(c){return{$$typeof:Ll,value:c}},Rn.defaultOnCaughtError=function(c){console.error(c)},Rn.defaultOnRecoverableError=function(c){Rh(c)},Rn.defaultOnUncaughtError=function(c){Rh(c)},Rn.deferredUpdates=function(c){var f=on.T,y=Ca();try{return Hn(32),on.T=null,c()}finally{Hn(y),on.T=f}},Rn.discreteUpdates=function(c,f,y,S,B){var O=on.T,Z=Ca();try{return Hn(2),on.T=null,c(f,y,S,B)}finally{Hn(Z),on.T=O,zn===0&&(Ul=ur()+500)}},Rn.findAllNodes=Or,Rn.findBoundingRects=function(c,f){if(!Os)throw Error(s(363));f=Or(c,f),c=[];for(var y=0;y<f.length;y++)c.push(ph(f[y]));for(f=c.length-1;0<f;f--){y=c[f];for(var S=y.x,B=S+y.width,O=y.y,Z=O+y.height,ge=f-1;0<=ge;ge--)if(f!==ge){var Je=c[ge],ht=Je.x,wt=ht+Je.width,gt=Je.y,jt=gt+Je.height;if(S>=ht&&O>=gt&&B<=wt&&Z<=jt){c.splice(f,1);break}else if(S!==ht||y.width!==Je.width||jt<O||gt>Z){if(!(O!==gt||y.height!==Je.height||wt<S||ht>B)){ht>S&&(Je.width+=ht-S,Je.x=S),wt<B&&(Je.width=B-ht),c.splice(f,1);break}}else{gt>O&&(Je.height+=gt-O,Je.y=O),jt<Z&&(Je.height=Z-gt),c.splice(f,1);break}}}return c},Rn.findHostInstance=bf,Rn.findHostInstanceWithNoPortals=function(c){return c=u(c),c=c!==null?p(c):null,c===null?null:fu(c.stateNode)},Rn.findHostInstanceWithWarning=function(c){return bf(c)},Rn.flushPassiveEffects=po,Rn.flushSyncFromReconciler=function(c){var f=zn;zn|=1;var y=on.T,S=Ca();try{if(Hn(2),on.T=null,c)return c()}finally{Hn(S),on.T=y,zn=f,(zn&6)===0&&At(0)}},Rn.flushSyncWork=eh,Rn.focusWithin=function(c,f){if(!Os)throw Error(s(363));for(c=vl(c),f=su(c,f),f=Array.from(f),c=0;c<f.length;){var y=f[c++],S=y.tag;if(!El(y)){if((S===5||S===26||S===27)&&Vo(y.stateNode))return!0;for(y=y.child;y!==null;)f.push(y),y=y.sibling}}return!1},Rn.getFindAllNodesFailureDescription=function(c,f){if(!Os)throw Error(s(363));var y=0,S=[];c=[vl(c),0];for(var B=0;B<c.length;){var O=c[B++],Z=O.tag,ge=c[B++],Je=f[ge];if((Z!==5&&Z!==26&&Z!==27||!El(O))&&(yl(O,Je)&&(S.push(iu(Je)),ge++,ge>y&&(y=ge)),ge<f.length))for(O=O.child;O!==null;)c.push(O,ge),O=O.sibling}if(y<f.length){for(c=[];y<f.length;y++)c.push(iu(f[y]));return`findAllNodes was able to match part of the selector:
3932  `+(S.join(" > ")+`
3933
3934No matching component was found for:
3935  `)+c.join(" > ")}return null},Rn.getPublicRootInstance=function(c){if(c=c.current,!c.child)return null;switch(c.child.tag){case 27:case 5:return fu(c.child.stateNode);default:return c.child.stateNode}},Rn.injectIntoDevTools=function(){var c={bundleType:0,version:um,rendererPackageName:Ef,currentDispatcherRef:on,reconcilerVersion:"19.2.0"};if(uu!==null&&(c.rendererConfig=uu),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")c=!1;else{var f=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(f.isDisabled||!f.supportsFiber)c=!0;else{try{fc=f.inject(c),kr=f}catch{}c=!!f.checkDCE}}return c},Rn.isAlreadyRendering=function(){return(zn&6)!==0}
3935,Rn.observeVisibleRects=function(c,f,y,S){if(!Os)throw Error(s(363));c=Or(c,f);var B=mh(c,y,S).disconnect;return{disconnect:function(){B()}}},Rn.shouldError=function(){return null},Rn.shouldSuspend=function(){return!1},Rn.startHostTransition=function(c,f,y,S){if(c.tag!==5)throw Error(s(476));var B=Mg(c).queue;Ag(c,B,f,rc,y===null?n:function(){var O=Mg(c);return O.next===null&&(O=c.alternate.memoizedState),cf(c,O.next.queue,{},ji()),y(S)})},Rn.updateContainer=function(c,f,y,S){var B=f.current,O=ji();return lm(B,O,c,f,y,S),O},Rn.updateContainerSync=function(c,f,y,S){return lm(f.current,2,c,f,y,S),2},Rn},i.exports.default=i.exports,Object.defineProperty(i.exports,"__esModule",{value:!0})})(Xw)),Xw.exports}var Yw;function fk(){return Yw||(Yw=1,Ww.exports=uk()),Ww.exports}var dk=fk();const hk=ck(dk);function pk(i){const e=hk(i);return e.injectIntoDevTools(),e}const b3=0,Ip={},mk=/^three(?=[A-Z])/,ub=i=>`${i[0].toUpperCase()}${i.slice(1)}`;let gk=0;const vk=i=>typeof i=="function";function S3(i){if(vk(i)){const e=`${gk++}`;return Ip[e]=i,e}else Object.assign(Ip,i)}function A3(i,e){const t=ub(i),n=Ip[t];if(i!=="primitive"&&!n)throw new Error(`R3F: ${t} is not part of the THREE namespace! Did you forget to extend? See: https://docs.pmnd.rs/react-three-fiber/api/objects#using-3rd-party-objects-declaratively`);if(i==="primitive"&&!e.object)throw new Error("R3F: Primitives without 'object' are invalid!");if(e.args!==void 0&&!Array.isArray(e.args))throw new Error("R3F: The args prop must be an array!")}function yk(i,e,t){var n;return i=ub(i)in Ip?i:i.replace(mk,""),A3(i,e),i==="primitive"&&(n=e.object)!=null&&n.__r3f&&delete e.object.__r3f,d_(e.object,t,i,e)}function xk(i){if(!i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?p_(i.parent,i):va(i.object)&&(i.object.visible=!1),i.isHidden=!0,Up(i)}}function M3(i){if(i.isHidden){var e;i.props.attach&&(e=i.parent)!=null&&e.object?h_(i.parent,i):va(i.object)&&i.props.visible!==!1&&(i.object.visible=!0),i.isHidden=!1,Up(i)}}function pM(i,e,t){const n=e.root.getState();if(!(!i.parent&&i.object!==n.scene)){if(!e.object){var s,a;const l=Ip[ub(e.type)];e.object=(s=e.props.object)!=null?s:new l(...(a=e.props.args)!=null?a:[]),e.object.__r3f=e}if(ju(e.object,e.props),e.props.attach)h_(i,e);else if(va(e.object)&&va(i.object)){const l=i.object.children.indexOf(t?.object);if(t&&l!==-1){const u=i.object.children.indexOf(e.object);if(u!==-1){i.object.children.splice(u,1);const h=u<l?l-1:l;i.object.children.splice(h,0,e.object)}else e.object.parent=i.object,i.object.children.splice(l,0,e.object),e.object.dispatchEvent({type:"added"}),i.object.dispatchEvent({type:"childadded",child:e.object})}else i.object.add(e.object)}for(const l of e.children)pM(e,l);Up(e)}}function f1(i,e){e&&(e.parent=i,i.children.push(e),pM(i,e))}function Jw(i,e,t){if(!e||!t)return;e.parent=i;const n=i.children.indexOf(t);n!==-1?i.children.splice(n,0,e):i.children.push(e),pM(i,e,t)}function E3(i){if(typeof i.dispose=="function"){const e=()=>{try{i.dispose()}catch{}};typeof IS_REACT_ACT_ENVIRONMENT<"u"?e():nA.unstable_scheduleCallback(nA.unstable_IdlePriority,e)}}function sA(i,e,t){if(!e)return;e.parent=null;const n=i.children.indexOf(e);n!==-1&&i.children.splice(n,1),e.props.attach?p_(i,e):va(e.object)&&va(i.object)&&(i.object.remove(e.object),ek(d3(e),e.object));const s=e.props.dispose!==null&&t!==!1;for(let a=e.children.length-1;a>=0;a--){const l=e.children[a];sA(e,l,s)}e.children.length=0,delete e.object.__r3f,s&&e.type!=="primitive"&&e.object.type!=="Scene"&&E3(e.object),t===void 0&&Up(e)}function _k(i,e){for(const t of[i,i.alternate])if(t!==null)if(typeof t.ref=="function"){t.refCleanup==null||t.refCleanup();const n=t.ref(e);typeof n=="function"&&(t.refCleanup=n)}else t.ref&&(t.ref.current=e)}const Ax=[];function bk(){for(const[t]of Ax){const n=t.parent;if(n){t.props.attach?p_(n,t):va(t.object)&&va(n.object)&&n.object.remove(t.object);for(const s of t.children)s.props.attach?p_(t,s):va(s.object)&&va(t.object)&&t.object.remove(s.object)}t.isHidden&&M3(t),t.object.__r3f&&delete t.object.__r3f,t.type!=="primitive"&&E3(t.object)}for(const[t,n,s]of Ax){t.props=n;const a=t.parent;if(a){var i,e;const l=Ip[ub(t.type)];
3935t.object=(i=t.props.object)!=null?i:new l(...(e=t.props.args)!=null?e:[]),t.object.__r3f=t,_k(s,t.object),ju(t.object,t.props),t.props.attach?h_(a,t):va(t.object)&&va(a.object)&&a.object.add(t.object);for(const u of t.children)u.props.attach?h_(t,u):va(u.object)&&va(t.object)&&t.object.add(u.object);Up(t)}}Ax.length=0}const d1=()=>{},Kw={};let ax=b3;const Sk=0,Ak=4,rA=pk({isPrimaryRenderer:!1,warnsIfNotActing:!1,supportsMutation:!0,supportsPersistence:!1,supportsHydration:!1,createInstance:yk,removeChild:sA,appendChild:f1,appendInitialChild:f1,insertBefore:Jw,appendChildToContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||f1(t,e)},removeChildFromContainer(i,e){const t=i.getState().scene.__r3f;!e||!t||sA(t,e)},insertInContainerBefore(i,e,t){const n=i.getState().scene.__r3f;!e||!t||!n||Jw(n,e,t)},getRootHostContext:()=>Kw,getChildHostContext:()=>Kw,commitUpdate(i,e,t,n,s){var a,l,u;A3(e,n);let h=!1;if((i.type==="primitive"&&t.object!==n.object||((a=n.args)==null?void 0:a.length)!==((l=t.args)==null?void 0:l.length)||(u=n.args)!=null&&u.some((m,v)=>{var x;return m!==((x=t.args)==null?void 0:x[v])}))&&(h=!0),h)Ax.push([i,{...n},s]);else{const m=K8(i,n);Object.keys(m).length&&(Object.assign(i.props,m),ju(i.object,m))}(s.sibling===null||(s.flags&Ak)===Sk)&&bk()},finalizeInitialChildren:()=>!1,commitMount(){},getPublicInstance:i=>i?.object,prepareForCommit:()=>null,preparePortalMount:i=>d_(i.getState().scene,i,"",{}),resetAfterCommit:()=>{},shouldSetTextContent:()=>!1,clearContainer:()=>!1,hideInstance:xk,unhideInstance:M3,createTextInstance:d1,hideTextInstance:d1,unhideTextInstance:d1,scheduleTimeout:typeof setTimeout=="function"?setTimeout:void 0,cancelTimeout:typeof clearTimeout=="function"?clearTimeout:void 0,noTimeout:-1,getInstanceFromNode:()=>null,beforeActiveInstanceBlur(){},afterActiveInstanceBlur(){},detachDeletedInstance(){},prepareScopeUpdate(){},getInstanceFromScope:()=>null,shouldAttemptEagerTransition:()=>!1,trackSchedulerEvent:()=>{},resolveEventType:()=>null,resolveEventTimeStamp:()=>-1.1,requestPostPaintCallback(){},maySuspendCommit:()=>!1,preloadInstance:()=>!0,suspendInstance(){},waitForCommitToBeReady:()=>null,NotPendingTransition:null,HostTransitionContext:q.createContext(null),setCurrentUpdatePriority(i){ax=i},getCurrentUpdatePriority(){return ax},resolveUpdatePriority(){var i;if(ax!==b3)return ax;switch(typeof window<"u"&&((i=window.event)==null?void 0:i.type)){case"click":case"contextmenu":case"dblclick":case"pointercancel":case"pointerdown":case"pointerup":return ok;case"pointermove":case"pointerout":case"pointerover":case"pointerenter":case"pointerleave":case"wheel":return rk;default:return ak}},resetFormInstance(){},rendererPackageName:"@react-three/fiber",rendererVersion:lk.version,applyViewTransitionName(i,e,t){},restoreViewTransitionName(i,e){},cancelViewTransitionName(i,e,t){},cancelRootViewTransitionName(i){},restoreRootViewTransitionName(i){},InstanceMeasurement:null,measureInstance:i=>null,wasInstanceInViewport:i=>!0,hasInstanceChanged:(i,e)=>!1,hasInstanceAffectedParent:(i,e)=>!1,suspendOnActiveViewTransition(i,e){},startGestureTransition:()=>null,startViewTransition:()=>null,stopViewTransition(i){},createViewTransitionInstance:i=>null,getCurrentGestureOffset(i){throw new Error("startGestureTransition is not yet supported in react-three-fiber.")},cloneMutableInstance(i,e){return i},cloneMutableTextInstance(i){return i},cloneRootViewTransitionContainer(i){throw new Error("Not implemented.")},removeRootViewTransitionClone(i,e){throw new Error("Not implemented.")},createFragmentInstance:i=>null,updateFragmentInstanceFiber(i,e){},commitNewChildToFragmentInstance(i,e){},deleteChildFromFragmentInstance(i,e){},measureClonedInstance:i=>null,maySuspendCommitOnUpdate:(i,e,t)=>!1,maySuspendCommitInSyncRender:(i,e)=>!1,startSuspendingCommit:()=>null,getSuspendedCommitReason:(i,e)=>null}),Dd=new Map,lp={objects:"shallow",strict:!1};function Mk(i,e){if(!e&&typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&i.parentElement){const{width:t,height:n,top:s,left:a}=i.parentElement.getBoundingClientRect();return{width:t,height:n,top:s,left:a}}else if(!e&&typeof OffscreenCanvas<"u"&&i instanceof OffscreenCanvas)return{width:i.width,height:i.height,top:0,left:0};return{width:0,height:0,top:0,left:0,...e}}
3935function Ek(i){const e=Dd.get(i),t=e?.fiber,n=e?.store;e&&console.warn("R3F.createRoot should only be called once!");const s=typeof reportError=="function"?reportError:console.error,a=n||nk(lA,Qw),l=t||rA.createContainer(a,sk,null,!1,null,"",s,s,s,null);e||Dd.set(i,{fiber:l,store:a});let u,h,p=!1,m=null;return{async configure(v={}){let x;m=new Promise(K=>x=K);let{gl:_,size:A,scene:R,events:w,onCreated:E,shadows:D=!1,linear:L=!1,flat:P=!1,legacy:G=!1,orthographic:H=!1,frameloop:F="always",dpr:X=[1,2],performance:z,raycaster:k,camera:ie,onPointerMissed:ve}=v,J=a.getState(),le=J.gl;if(!J.gl){const K={canvas:i,powerPreference:"high-performance",antialias:!0,alpha:!0},ce=typeof _=="function"?await _(K):_;jw(ce)?le=ce:le=new a3({...K,..._}),J.set({gl:le})}let ae=J.raycaster;ae||J.set({raycaster:ae=new ZI});const{params:W,...ee}=k||{};if(Ji.equ(ee,ae,lp)||ju(ae,{...ee}),Ji.equ(W,ae.params,lp)||ju(ae,{params:{...ae.params,...W}}),!J.camera||J.camera===h&&!Ji.equ(h,ie,lp)){h=ie;const K=ie?.isCamera,ce=K?ie:H?new Vc(0,0,0,0,.1,1e3):new Ds(75,0,.1,1e3);K||(ce.position.z=5,ie&&(ju(ce,ie),ce.manual||("aspect"in ie||"left"in ie||"right"in ie||"bottom"in ie||"top"in ie)&&(ce.manual=!0,ce.updateProjectionMatrix())),!J.camera&&!(ie!=null&&ie.rotation)&&ce.lookAt(0,0,0)),J.set({camera:ce}),ae.camera=ce}if(!J.scene){let K;R!=null&&R.isScene?(K=R,d_(K,a,"",{})):(K=new K0,d_(K,a,"",{}),R&&ju(K,R)),J.set({scene:K})}w&&!J.events.handlers&&J.set({events:w(a)});const te=Mk(i,A);if(Ji.equ(te,J.size,lp)||J.setSize(te.width,te.height,te.top,te.left),X&&J.viewport.dpr!==m3(X)&&J.setDpr(X),J.frameloop!==F&&J.setFrameloop(F),J.onPointerMissed||J.set({onPointerMissed:ve}),z&&!Ji.equ(z,J.performance,lp)&&J.set(K=>({performance:{...K.performance,...z}})),!J.xr){var ue;const K=(oe,we)=>{const Be=a.getState();Be.frameloop!=="never"&&Qw(oe,!0,Be,we)},ce=()=>{const oe=a.getState();oe.gl.xr.enabled=oe.gl.xr.isPresenting,oe.gl.xr.setAnimationLoop(oe.gl.xr.isPresenting?K:null),oe.gl.xr.isPresenting||lA(oe)},re={connect(){const oe=a.getState().gl;oe.xr.addEventListener("sessionstart",ce),oe.xr.addEventListener("sessionend",ce)},disconnect(){const oe=a.getState().gl;oe.xr.removeEventListener("sessionstart",ce),oe.xr.removeEventListener("sessionend",ce)}};typeof((ue=le.xr)==null?void 0:ue.addEventListener)=="function"&&re.connect(),J.set({xr:re})}if(le.shadowMap){const K=le.shadowMap.enabled,ce=le.shadowMap.type;if(le.shadowMap.enabled=!!D,Ji.boo(D))le.shadowMap.type=mp;else if(Ji.str(D)){var he;const re={basic:pB,percentage:C_,soft:mp,variance:nl};le.shadowMap.type=(he=re[D])!=null?he:mp}else Ji.obj(D)&&Object.assign(le.shadowMap,D);(K!==le.shadowMap.enabled||ce!==le.shadowMap.type)&&(le.shadowMap.needsUpdate=!0)}return si.enabled=!G,p||(le.outputColorSpace=L?Wl:xi,le.toneMapping=P?ol:R_),J.legacy!==G&&J.set(()=>({legacy:G})),J.linear!==L&&J.set(()=>({linear:L})),J.flat!==P&&J.set(()=>({flat:P})),_&&!Ji.fun(_)&&!jw(_)&&!Ji.equ(_,le,lp)&&ju(le,_),u=E,p=!0,x(),this},render(v){return!p&&!m&&this.configure(),m.then(()=>{rA.updateContainer(b.jsx(Tk,{store:a,children:v,onCreated:u,rootElement:i}),l,null,()=>{})}),a},unmount(){T3(i)}}}function Tk({store:i,children:e,onCreated:t,rootElement:n}){return yg(()=>{const s=i.getState();s.set(a=>({internal:{...a.internal,active:!0}})),t&&t(s),i.getState().events.connected||s.events.connect==null||s.events.connect(n)},[]),b.jsx(y3.Provider,{value:i,children:e})}function T3(i,e){const t=Dd.get(i),n=t?.fiber;if(n){const s=t?.store.getState();s&&(s.internal.active=!1),rA.updateContainer(null,n,null,()=>{s&&setTimeout(()=>{try{var a,l,u,h;s.events.disconnect==null||s.events.disconnect(),(a=s.gl)==null||(l=a.renderLists)==null||l.dispose==null||l.dispose(),(u=s.gl)==null||u.forceContextLoss==null||u.forceContextLoss(),(h=s.gl)!=null&&h.xr&&s.xr.disconnect(),q8(s.scene),Dd.delete(i)}catch{}},500)})}}const wk=new Set,Ck=new Set,Rk=new Set;function h1(i,e){if(i.size)for(const{callback:t}of i.values())t(e)}function z0(i,e){switch(i){case"before":return h1(wk,e);case"after":return h1(Ck,e);case"tail":return h1(Rk,e)}}let p1,m1;function aA(i,e,t){let n=e.clock.getDelta();e.frameloop==="never"&&typeof i=="number"&&(n=i-e.clock.elapsedTime,e.clock.oldTime=e.clock.elapsedTime,e.clock.elapsedTime=i),p1=e.internal.subscribers;for(let s=0;s<p1.length;s++)m1=p1[s],m1.ref.current(m1.store.getState(),n,t);return!e.internal.priority&&e.gl.render&&e.gl.render(e.scene,e.camera),e.internal.frames=Math.max(0,e.internal.frames-1),e.frameloop==="always"?1:e.internal.frames}let m_=!1,oA=!1,g1,Zw,cp;function w3(i){Zw=requestAnimationFrame(w3),m_=!0,g1=0,z0("before",i),oA=!0;for(const t of Dd.values()){var e;cp=t.store.getState(),cp.internal.active&&(cp.frameloop==="always"||cp.internal.frames>
39350)&&!((e=cp.gl.xr)!=null&&e.isPresenting)&&(g1+=aA(i,cp))}if(oA=!1,z0("after",i),g1===0)return z0("tail",i),m_=!1,cancelAnimationFrame(Zw)}function lA(i,e=1){var t;if(!i)return Dd.forEach(n=>lA(n.store.getState(),e));(t=i.gl.xr)!=null&&t.isPresenting||!i.internal.active||i.frameloop==="never"||(e>1?i.internal.frames=Math.min(60,i.internal.frames+e):oA?i.internal.frames=2:i.internal.frames=1,m_||(m_=!0,requestAnimationFrame(w3)))}function Qw(i,e=!0,t,n){if(e&&z0("before",i),t)aA(i,t,n);else for(const s of Dd.values())aA(i,s.store.getState());e&&z0("after",i)}const v1={onClick:["click",!1],onContextMenu:["contextmenu",!1],onDoubleClick:["dblclick",!1],onWheel:["wheel",!0],onPointerDown:["pointerdown",!0],onPointerUp:["pointerup",!0],onPointerLeave:["pointerleave",!0],onPointerMove:["pointermove",!0],onPointerCancel:["pointercancel",!0],onLostPointerCapture:["lostpointercapture",!0]};function Bk(i){const{handlePointer:e}=tk(i);return{priority:1,enabled:!0,compute(t,n,s){n.pointer.set(t.offsetX/n.size.width*2-1,-(t.offsetY/n.size.height)*2+1),n.raycaster.setFromCamera(n.pointer,n.camera)},connected:void 0,handlers:Object.keys(v1).reduce((t,n)=>({...t,[n]:e(n)}),{}),update:()=>{var t;const{events:n,internal:s}=i.getState();(t=s.lastEvent)!=null&&t.current&&n.handlers&&n.handlers.onPointerMove(s.lastEvent.current)},connect:t=>{const{set:n,events:s}=i.getState();if(s.disconnect==null||s.disconnect(),n(a=>({events:{...a.events,connected:t}})),s.handlers)for(const a in s.handlers){const l=s.handlers[a],[u,h]=v1[a];t.addEventListener(u,l,{passive:h})}},disconnect:()=>{const{set:t,events:n}=i.getState();if(n.connected){if(n.handlers)for(const s in n.handlers){const a=n.handlers[s],[l]=v1[s];n.connected.removeEventListener(l,a)}t(s=>({events:{...s.events,connected:void 0}}))}}}}function $w(i,e){let t;return(...n)=>{window.clearTimeout(t),t=window.setTimeout(()=>i(...n),e)}}function Ik({debounce:i,scroll:e,polyfill:t,offsetSize:n}={debounce:0,scroll:!1,offsetSize:!1}){const s=t||(typeof window>"u"?class{}:window.ResizeObserver);if(!s)throw new Error("This browser does not support ResizeObserver out of the box. See: https://github.com/react-spring/react-use-measure/#resize-observer-polyfills");const[a,l]=q.useState({left:0,top:0,width:0,height:0,bottom:0,right:0,x:0,y:0}),u=q.useRef({element:null,scrollContainers:null,resizeObserver:null,lastBounds:a,orientationHandler:null}),h=i?typeof i=="number"?i:i.scroll:null,p=i?typeof i=="number"?i:i.resize:null,m=q.useRef(!1);q.useEffect(()=>(m.current=!0,()=>void(m.current=!1)));const[v,x,_]=q.useMemo(()=>{const E=()=>{if(!u.current.element)return;const{left:D,top:L,width:P,height:G,bottom:H,right:F,x:X,y:z}=u.current.element.getBoundingClientRect(),k={left:D,top:L,width:P,height:G,bottom:H,right:F,x:X,y:z};u.current.element instanceof HTMLElement&&n&&(k.height=u.current.element.offsetHeight,k.width=u.current.element.offsetWidth),Object.freeze(k),m.current&&!Ok(u.current.lastBounds,k)&&l(u.current.lastBounds=k)};return[E,p?$w(E,p):E,h?$w(E,h):E]},[l,n,h,p]);function A(){u.current.scrollContainers&&(u.current.scrollContainers.forEach(E=>E.removeEventListener("scroll",_,!0)),u.current.scrollContainers=null),u.current.resizeObserver&&(u.current.resizeObserver.disconnect(),u.current.resizeObserver=null),u.current.orientationHandler&&("orientation"in screen&&"removeEventListener"in screen.orientation?screen.orientation.removeEventListener("change",u.current.orientationHandler):"onorientationchange"in window&&window.removeEventListener("orientationchange",u.current.orientationHandler))}function R(){u.current.element&&(u.current.resizeObserver=new s(_),u.current.resizeObserver.observe(u.current.element),e&&u.current.scrollContainers&&u.current.scrollContainers.forEach(E=>E.addEventListener("scroll",_,{capture:!0,passive:!0})),u.current.orientationHandler=()=>{_()},"orientation"in screen&&"addEventListener"in screen.orientation?screen.orientation.addEventListener("change",u.current.orientationHandler):"onorientationchange"in window&&window.addEventListener("orientationchange",u.current.orientationHandler))}const w=E=>{!E||E===u.current.element||(A(),u.current.element=E,u.current.scrollC
vendor: 11,937 bytes, lines 3935-3984
3935ontainers=C3(E),R())};return Lk(_,!!e),Dk(x),q.useEffect(()=>{A(),R()},[e,_,x]),q.useEffect(()=>A,[]),[w,a,v]}function Dk(i){q.useEffect(()=>{const e=i;return window.addEventListener("resize",e),()=>void window.removeEventListener("resize",e)},[i])}function Lk(i,e){q.useEffect(()=>{if(e){const t=i;return window.addEventListener("scroll",t,{capture:!0,passive:!0}),()=>void window.removeEventListener("scroll",t,!0)}},[i,e])}function C3(i){const e=[];if(!i||i===document.body)return e;const{overflow:t,overflowX:n,overflowY:s}=window.getComputedStyle(i);return[t,n,s].some(a=>a==="auto"||a==="scroll")&&e.push(i),[...e,...C3(i.parentElement)]}const Pk=["x","y","top","bottom","left","right","width","height"],Ok=(i,e)=>Pk.every(t=>i[t]===e[t]);function Nk({ref:i,children:e,fallback:t,resize:n,style:s,gl:a,events:l=Bk,eventSource:u,eventPrefix:h,shadows:p,linear:m,flat:v,legacy:x,orthographic:_,frameloop:A,dpr:R,performance:w,raycaster:E,camera:D,scene:L,onPointerMissed:P,onCreated:G,...H}){q.useMemo(()=>S3(b8),[]);const F=j8(),[X,z]=Ik({scroll:!0,debounce:{scroll:50,resize:0},...n}),k=q.useRef(null),ie=q.useRef(null);q.useImperativeHandle(i,()=>k.current);const ve=p3(P),[J,le]=q.useState(!1),[ae,W]=q.useState(!1);if(J)throw J;if(ae)throw ae;const ee=q.useRef(null);yg(()=>{const ue=k.current;if(z.width>0&&z.height>0&&ue){ee.current||(ee.current=Ek(ue));async function he(){await ee.current.configure({gl:a,scene:L,events:l,shadows:p,linear:m,flat:v,legacy:x,orthographic:_,frameloop:A,dpr:R,performance:w,raycaster:E,camera:D,size:z,onPointerMissed:(...K)=>ve.current==null?void 0:ve.current(...K),onCreated:K=>{K.events.connect==null||K.events.connect(u?H8(u)?u.current:u:ie.current),h&&K.setEvents({compute:(ce,re)=>{const oe=ce[h+"X"],we=ce[h+"Y"];re.pointer.set(oe/re.size.width*2-1,-(we/re.size.height)*2+1),re.raycaster.setFromCamera(re.pointer,re.camera)}}),G?.(K)}}),ee.current.render(b.jsx(F,{children:b.jsx(W8,{set:W,children:b.jsx(q.Suspense,{fallback:b.jsx(V8,{set:le}),children:e??null})})}))}he()}}),q.useEffect(()=>{const ue=k.current;if(ue)return()=>T3(ue)},[]);const te=u?"none":"auto";return b.jsx("div",{ref:ie,style:{position:"relative",width:"100%",height:"100%",overflow:"hidden",pointerEvents:te,...s},...H,children:b.jsx("div",{ref:X,style:{width:"100%",height:"100%"},children:b.jsx("canvas",{ref:k,style:{display:"block"},children:t})})})}function mM(i){return b.jsx(u3,{children:b.jsx(Nk,{...i})})}/**
3936 * postprocessing v6.39.0 build Fri Mar 20 2026
3937 * https://github.com/pmndrs/postprocessing
3938 * Copyright 2015-2026 Raoul van Rüschen
3939 * @license Zlib
3940 */var Uk=(()=>{const i=new Float32Array([-1,-1,0,3,-1,0,-1,3,0]),e=new Float32Array([0,0,2,0,0,2]),t=new Mn;return t.setAttribute("position",new ci(i,3)),t.setAttribute("uv",new ci(e,2)),t})(),Ga=class cA{static get fullscreenGeometry(){return Uk}constructor(e="Pass",t=new K0,n=new Vc){this.name=e,this.renderer=null,this.scene=t,this.camera=n,this.screen=null,this.rtt=!0,this.needsSwap=!0,this.needsDepthBlit=!1,this.needsDepthTexture=!1,this.enabled=!0}get renderToScreen(){return!this.rtt}set renderToScreen(e){if(this.rtt===e){const t=this.fullscreenMaterial;t!==null&&(t.needsUpdate=!0),this.rtt=!e}}set mainScene(e){}set mainCamera(e){}setRenderer(e){this.renderer=e}isEnabled(){return this.enabled}setEnabled(e){this.enabled=e}get fullscreenMaterial(){return this.screen!==null?this.screen.material:null}set fullscreenMaterial(e){let t=this.screen;t!==null?t.material=e:(t=new hs(cA.fullscreenGeometry,e),t.frustumCulled=!1,this.scene===null&&(this.scene=new K0),this.scene.add(t),this.screen=t)}getFullscreenMaterial(){return this.fullscreenMaterial}setFullscreenMaterial(e){this.fullscreenMaterial=e}getDepthTexture(){return null}setDepthTexture(e,t=ef){}render(e,t,n,s,a){throw new Error("Render method not implemented!")}setSize(e,t){}initialize(e,t,n){}dispose(){for(const e of Object.keys(this)){const t=this[e];(t instanceof Ms||t instanceof js||t instanceof Ki||t instanceof cA)&&this[e].dispose()}this.fullscreenMaterial!==null&&this.fullscreenMaterial.dispose()}},zk=class extends Ga{constructor(){super("ClearMaskPass",null,null),this.needsSwap=!1}render(i,e,t,n,s){const a=i.state.buffers.stencil;a.setLocked(!1),a.setTest(!1)}},Fk=`#ifdef COLOR_WRITE
3941#include <common>
3942#include <dithering_pars_fragment>
3943#ifdef FRAMEBUFFER_PRECISION_HIGH
3944uniform mediump sampler2D inputBuffer;
3945#else
3946uniform lowp sampler2D inputBuffer;
3947#endif
3948#endif
3949#ifdef DEPTH_WRITE
3950#include <packing>
3951#ifdef GL_FRAGMENT_PRECISION_HIGH
3952uniform highp sampler2D depthBuffer;
3953#else
3954uniform mediump sampler2D depthBuffer;
3955#endif
3956float readDepth(const in vec2 uv){
3957#if DEPTH_PACKING == 3201
3958return unpackRGBAToDepth(texture2D(depthBuffer,uv));
3959#else
3960return texture2D(depthBuffer,uv).r;
3961#endif
3962}
3963#endif
3964#ifdef USE_WEIGHTS
3965uniform vec4 channelWeights;
3966#endif
3967uniform float opacity;varying vec2 vUv;void main(){
3968#ifdef COLOR_WRITE
3969vec4 texel=texture2D(inputBuffer,vUv);
3970#ifdef USE_WEIGHTS
3971texel*=channelWeights;
3972#endif
3973gl_FragColor=opacity*texel;
3974#ifdef COLOR_SPACE_CONVERSION
3975#include <colorspace_fragment>
3976#endif
3977#include <dithering_fragment>
3978#else
3979gl_FragColor=vec4(0.0);
3980#endif
3981#ifdef DEPTH_WRITE
3982gl_FragDepth=readDepth(vUv);
3983#endif
3984}`,R3="varying vec2 vUv;void main(){vUv=position.xy*0.5+0.5;gl_Position=vec4(position.xy,1.0,1.0);}",B3=class extends Zi{constructor(){super({name:"CopyMaterial",defines:{COLOR_SPACE_CONVERSION:"1",DEPTH_PACKING:"0",COLOR_WRITE:"1"},uniforms:{inputBuffer:new ai(null),depthBuffer:new ai(null),channelWeights:new ai(null),opacity:new ai(1)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:Fk,vertexShader:R3}),this.depthFunc=G0}get inputBuffer(){return this.uniforms.inputBuffer.value}set inputBuffer(i){const e=i!==null;this.colorWrite!==e&&(e?this.defines.COLOR_WRITE=!0:delete this.defines.COLOR_WRITE,this.colorWrite=e,this.needsUpdate=!0),this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){const e=i!==null;this.depthWrite!==e&&(e?this.defines.DEPTH_WRITE=!0:delete this.defines.DEPTH_WRITE,this.depthTest=e,this.depthWrite=e,this.needsUpdate=!0),this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}get colorSpaceConversion(){return this.defines.COLOR_SPACE_CONVERSION!==void 0}set colorSpaceConversion(i){this.colorSpaceConversion!==i&&(i?this.defines.COLOR_SPACE_CONVERSION=!0:delete this.defines.COLOR_SPACE_CONVERSION,this.needsUpdate=!0)}get channelWeights(){return this.uniforms.channelWeights.value}set channelWeights(i){i!==null?(this.defines.USE_WEIGHTS="1",this.uniforms.channelWeights.value=i):delete this.defines.USE_WEIGHTS,this.needsUpdate=!0}setInputBuffer(i){this.uniforms.inputBuffer.value=i}getOpacity(i){return this.uniforms.opacity.value}setOpacity(i){this.uniforms.opacity.value=i}},kk=class extends Ga{constructor(i,e=!0){super("CopyPass"),this.fullscreenMaterial=new B3,this.needsSwap=!1,this.renderTarget=i,i===void 0&&(this.renderTarget=new Ms(1,1,{minFilter:as,magFilter:as,stencilBuffer:!1,depthBuffer:!1}),this.renderTarget.texture.name="CopyPass.Target"),this.autoResize=e}get resize(){return this.autoResize}set resize(i){this.autoResize=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}setAutoResizeEnabled(i){this.autoResize=i}render(i,e,t,n,s){this.fullscreenMaterial.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){this.autoResize&&this.renderTarget.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTarget.texture.type=t,t!==vr?this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1":i!==null&&i.outputColorSpace===xi&&(this.renderTarget.texture.colorSpace=xi))}},eC=new Pt,I3=class extends Ga{constructor(i=!0,e=!0,t=!1){super("ClearPass",null,null),this.needsSwap=!1,this.color=i,this.depth=e,this.stencil=t,this.overrideClearColor=null,this.overrideClearAlpha=-1}setClearFlags(i,e,t){this.color=i,this.depth=e,this.stencil=t}getOverrideClearColor(){return this.overrideClearColor}setOverrideClearColor(i){this.overrideClearColor=i}getOverrideClearAlpha(){return this.overrideClearAlpha}setOverrideClearAlpha(i){this.overrideClearAlpha=i}render(i,e,t,n,s){const a=this.overrideClearColor,l=this.overrideClearAlpha,u=i.getClearAlpha(),h=a!==null,p=l>=0;h?(i.getClearColor(eC),i.setClearColor(a,p?l:u)):p&&i.setClearAlpha(l),i.setRenderTarget(this.renderToScreen?null:e),i.clear(this.color,this.depth,this.stencil),h?i.setClearColor(eC,u):p&&i.setClearAlpha(u)}},Hk=class extends Ga{constructor(i,e){super("MaskPass",i,e),this.needsSwap=!1,this.clearPass=new I3(!1,!1,!0),this.inverse=!1}set mainScene(i){this.scene=i}set mainCamera(i){this.camera=i}get inverted(){return this.inverse}set inverted(i){this.inverse=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getClearPass(){return this.clearPass}isInverted(){return this.inverted}setInverted(i){this.inverted=i}render(i,e,t,n,s){const a=i.getContext(),l=i.state.buffers,u=this.scene,h=this.camera,p=this.clearPass,m=this.inverted?0:1,v=1-m;l.color.setMask(!1),l.depth.setMask(!1),l.color.setLocked(!0),l.depth.setLocked(!0),l.stencil.setTest(!0),l.stencil.setOp(a.REPLACE,a.REPLACE,a.REPLACE),l.stencil.setFunc(a.ALWAYS,m,4294967295),l.stencil.setClear(v),l.stencil.setLocked(!0),this.clearPass.enabled&&(this.renderToScreen?p.render(i,null):(p.render(i,e),p.render(i,t))),this.renderToScreen?(i.setRenderTarget(null),i.render(u,h)):(i.setRenderTarget(e),i.render(u,h),i.setRenderTarget(t),i.render(u,h)),l.color.setLocked(!1),l.depth.setLocked(!1),l.stencil.setLocked(!1),l.stencil.setFunc(a.EQUAL,1,4294967295),l.stencil.setOp(a.KEEP,a.KEEP,a.KEEP),l.stencil.setLocked(!0)}},y1=1/1e3,Gk=1e3,jk=class{constructor(){this.startTime=performance.now(),this.previousTime=0,this.currentTime=0,this._delta=0,this._elapsed=0,this._fixedDelta=1e3/60,this.timescale=1,this.useFixedDelta=!1,this._autoReset=!1}get autoReset(){return this._autoReset}set autoReset(i){typeof document<"u"&&document.hidden!==void 0&&(i?document.addEventListener("visibilitychange",this):document.removeEventListener("visibilitychange",this),this._autoReset=i)}get delta(){return this._delta*y1}get fixedDelta(){return this._fixedDelta*y1}set fixedDelta(i){this._fixedDelta=i*Gk}get elapsed(){return this._elapsed*y1}update(i){this.useFixedDelta?this._delta=this.fixedDelta:(this.previousTime=this.currentTime,this.currentTime=(i!==void 0?i:performance.now())-this.startTime,this._delta=this.currentTime-this.previousTime),this._delta*=this.timescale,this._elapsed+=this._delta}reset(){this._delta=0,this._elapsed=0,this.currentTime=performance.now()-this.startTime}getDelta(){return this.delta}getElapsed(){return this.elapsed}handleEvent(i){document.hidden||(this.currentTime=performance.now()-this.startTime)}dispose(){this.autoReset=!1}},Vk=class{constructor(i=null,{depthBuffer:e=!0,stencilBuffer:t=!1,multisampling:n=0,frameBufferType:s}={}){this.renderer=null,this.inputBuffer=this.createBuffer(e,t,s,n),this.outputBuffer=this.inputBuffer.clone(),this.copyPass=new kk,this.depthTexture=null,this.depthRenderTarget=null,this.passes=[],this.timer=new jk,this.autoRenderToScreen=!0,this.setRenderer(i)}get multisampling(){return this.inputBuffer.samples}set multisampling(i){const e=this.inputBuffer,t=this.multisampling;t>0&&i>0?(this.inputBuffer.samples=i,this.outputBuffer.samples=i,this.inputBuffer.dispose(),this.outputBuffer.dispose()):t!==i&&(this.inputBuffer.dispose(),this.outputBuffer.dispose(),this.inputBuffer=this.createBuffer(e.depthBuffer,e.stencilBuffer,e.texture.type,i),this.outputBuffer=this.inputBuffer.clone())}getTimer(){return this.timer}getRenderer(){return this.renderer}setRenderer(i){if(this.renderer=i,i!==null){const e=i.getSize(new st),t=i.getContext().getContextAttributes().alpha,n=this.inputBuffer.texture.type;
3984n===vr&&i.outputColorSpace===xi&&(this.inputBuffer.texture.colorSpace=xi,this.outputBuffer.texture.colorSpace=xi,this.inputBuffer.dispose(),this.outputBuffer.dispose()),i.autoClear=!1,this.setSize(e.width,e.height);for(const s of this.passes)s.initialize(i,t,n)}}replaceRenderer(i,e=!0){const t=this.renderer,n=t.domElement.parentNode;return this.setRenderer(i),e&&n!==null&&(n.removeChild(t.domElement),n.appendChild(i.domElement)),t}createDepthTexture(){const i=this.inputBuffer,e=new q_;this.depthTexture=e,i.stencilBuffer?(e.format=Td,e.type=Ed):e.type=Yr;const t=e.clone();return t.name="EffectComposer.StableDepth",this.depthRenderTarget=new Ms(i.width,i.height,{depthBuffer:!0,stencilBuffer:i.stencilBuffer,depthTexture:t}),t}blitDepthBuffer(i){const e=this.renderer,t=this.depthRenderTarget,n=e.properties,s=e.getContext();e.setRenderTarget(t);const a=n.get(i).__webglFramebuffer,l=n.get(t).__webglFramebuffer,u=i.stencilBuffer?s.DEPTH_BUFFER_BIT|s.STENCIL_BUFFER_BIT:s.DEPTH_BUFFER_BIT;s.bindFramebuffer(s.READ_FRAMEBUFFER,a),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,l),s.blitFramebuffer(0,0,i.width,i.height,0,0,t.width,t.height,u,s.NEAREST),s.bindFramebuffer(s.READ_FRAMEBUFFER,null),s.bindFramebuffer(s.DRAW_FRAMEBUFFER,null),e.setRenderTarget(null)}deleteDepthTexture(){if(this.depthTexture!==null){this.depthTexture.dispose(),this.depthTexture=null,this.depthRenderTarget.dispose(),this.depthRenderTarget=null,this.inputBuffer.depthTexture=null,this.outputBuffer.depthTexture=null;for(const i of this.passes)i.setDepthTexture(null)}}createBuffer(i,e,t,n){const s=this.renderer,a=s===null?new st:s.getDrawingBufferSize(new st),l={minFilter:as,magFilter:as,stencilBuffer:e,depthBuffer:i,type:t},u=new Ms(a.width,a.height,l);return n>0&&(u.samples=n),t===vr&&s!==null&&s.outputColorSpace===xi&&(u.texture.colorSpace=xi),u.texture.name="EffectComposer.Buffer",u.texture.generateMipmaps=!1,u}setMainScene(i){for(const e of this.passes)e.mainScene=i}setMainCamera(i){for(const e of this.passes)e.mainCamera=i}addPass(i,e){const t=this.passes,n=this.renderer,s=n.getDrawingBufferSize(new st),a=n.getContext().getContextAttributes().alpha,l=this.inputBuffer.texture.type;if(i.renderer=n,i.setSize(s.width,s.height),i.initialize(n,a,l),this.autoRenderToScreen&&(t.length>0&&(t[t.length-1].renderToScreen=!1),i.renderToScreen&&(this.autoRenderToScreen=!1)),e!==void 0?t.splice(e,0,i):t.push(i),this.autoRenderToScreen&&(t[t.length-1].renderToScreen=!0),i.needsDepthTexture||this.depthTexture!==null)if(this.depthTexture===null){const u=this.createDepthTexture();for(i of t)i.setDepthTexture(u)}else{const u=this.depthRenderTarget.depthTexture;i.setDepthTexture(u)}}removePass(i){const e=this.passes,t=e.indexOf(i);if(t!==-1&&e.splice(t,1).length>0){if(this.depthTexture!==null){const a=(u,h)=>u||h.needsDepthTexture;if(!e.reduce(a,!1)){const u=this.depthRenderTarget.depthTexture;i.getDepthTexture()===u&&i.setDepthTexture(null),this.deleteDepthTexture()}}this.autoRenderToScreen&&t===e.length&&(i.renderToScreen=!1,e.length>0&&(e[e.length-1].renderToScreen=!0))}}removeAllPasses(){const i=this.passes;this.deleteDepthTexture(),i.length>0&&(this.autoRenderToScreen&&(i[i.length-1].renderToScreen=!1),this.passes=[])}render(i){const e=this.renderer,t=this.copyPass;let n=this.inputBuffer,s=this.outputBuffer,a,l=!1;
vendor: 13,973 bytes, line 3984
3984i===void 0&&(this.timer.update(),i=this.timer.getDelta());for(const u of this.passes)if(u.enabled){if(n.depthTexture=this.depthTexture,s.depthTexture=null,u.render(e,n,s,i,l),u.needsDepthBlit&&this.depthRenderTarget!==null&&this.blitDepthBuffer(n),u.needsSwap){if(l){t.renderToScreen=u.renderToScreen;const h=e.getContext(),p=e.state.buffers.stencil;p.setFunc(h.NOTEQUAL,1,4294967295),t.render(e,n,s,i,l),p.setFunc(h.EQUAL,1,4294967295)}a=n,n=s,s=a}u instanceof Hk?l=!0:u instanceof zk&&(l=!1)}}setSize(i,e,t){const n=this.renderer,s=n.getSize(new st);(i===void 0||e===void 0)&&(i=s.width,e=s.height),(s.width!==i||s.height!==e)&&n.setSize(i,e,t);const a=n.getDrawingBufferSize(new st);this.inputBuffer.setSize(a.width,a.height),this.outputBuffer.setSize(a.width,a.height),this.depthRenderTarget!==null&&this.depthRenderTarget.setSize(a.width,a.height);for(const l of this.passes)l.setSize(a.width,a.height)}reset(){this.dispose(),this.autoRenderToScreen=!0}dispose(){for(const i of this.passes)i.dispose();this.passes=[],this.inputBuffer!==null&&this.inputBuffer.dispose(),this.outputBuffer!==null&&this.outputBuffer.dispose(),this.deleteDepthTexture(),this.copyPass.dispose(),this.timer.dispose(),Ga.fullscreenGeometry.dispose()}},xd={NONE:0,DEPTH:1,CONVOLUTION:2},yi={FRAGMENT_HEAD:"FRAGMENT_HEAD",FRAGMENT_MAIN_UV:"FRAGMENT_MAIN_UV",FRAGMENT_MAIN_IMAGE:"FRAGMENT_MAIN_IMAGE",VERTEX_HEAD:"VERTEX_HEAD",VERTEX_MAIN_SUPPORT:"VERTEX_MAIN_SUPPORT"},Wk=class{constructor(){this.shaderParts=new Map([[yi.FRAGMENT_HEAD,null],[yi.FRAGMENT_MAIN_UV,null],[yi.FRAGMENT_MAIN_IMAGE,null],[yi.VERTEX_HEAD,null],[yi.VERTEX_MAIN_SUPPORT,null]]),this.defines=new Map,this.uniforms=new Map,this.blendModes=new Map,this.extensions=new Set,this.attributes=xd.NONE,this.varyings=new Set,this.uvTransformation=!1,this.readDepth=!1,this.colorSpace=Wl}},x1=!1,tC=class{constructor(i=null){this.originalMaterials=new Map,this.material=null,this.materials=null,this.materialsBackSide=null,this.materialsDoubleSide=null,this.materialsFlatShaded=null,this.materialsFlatShadedBackSide=null,this.materialsFlatShadedDoubleSide=null,this.setMaterial(i),this.meshCount=0,this.replaceMaterial=e=>{if(e.isMesh){let t;if(e.material.flatShading)switch(e.material.side){case Gs:t=this.materialsFlatShadedDoubleSide;break;case $s:t=this.materialsFlatShadedBackSide;break;default:t=this.materialsFlatShaded;break}else switch(e.material.side){case Gs:t=this.materialsDoubleSide;break;case $s:t=this.materialsBackSide;break;default:t=this.materials;break}this.originalMaterials.set(e,e.material),e.isSkinnedMesh?e.material=t[2]:e.isInstancedMesh?e.material=t[1]:e.material=t[0],++this.meshCount}}}cloneMaterial(i){if(!(i instanceof Zi))return i.clone();const e=i.uniforms,t=new Map;for(const s in e){const a=e[s].value;a.isRenderTargetTexture&&(e[s].value=null,t.set(s,a))}const n=i.clone();for(const s of t)e[s[0]].value=s[1],n.uniforms[s[0]].value=s[1];return n}setMaterial(i){if(this.disposeMaterials(),this.material=i,i!==null){const e=this.materials=[this.cloneMaterial(i),this.cloneMaterial(i),this.cloneMaterial(i)];for(const t of e)t.uniforms=Object.assign({},i.uniforms),t.side=cl;e[2].skinning=!0,this.materialsBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=$s,n}),this.materialsDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.side=Gs,n}),this.materialsFlatShaded=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n}),this.materialsFlatShadedBackSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=$s,n}),this.materialsFlatShadedDoubleSide=e.map(t=>{const n=this.cloneMaterial(t);return n.uniforms=Object.assign({},i.uniforms),n.flatShading=!0,n.side=Gs,n})}}render(i,e,t){const n=i.shadowMap.enabled;if(i.shadowMap.enabled=!1,x1){const s=this.originalMaterials;this.meshCount=0,e.traverse(this.replaceMaterial),i.render(e,t);for(const a of s)a[0].material=a[1];this.meshCount!==s.size&&s.clear()}else{const s=e.overrideMaterial;e.overrideMaterial=this.material,i.render(e,t),e.overrideMaterial=s}i.shadowMap.enabled=n}disposeMaterials(){if(this.material!==null){const i=this.materials.concat(this.materialsBackSide).concat(this.materialsDoubleSide).concat(this.materialsFlatShaded).concat(this.materialsFlatShadedBackSide).concat(this.materialsFlatShadedDoubleSide);for(const e of i)e.dispose()}}dispose(){this.originalMaterials.clear(),this.disposeMaterials()}static get workaroundEnabled(){return x1}static set workaroundEnabled(i){x1=i}},Fu=-1,Zr=class extends eo{constructor(i,e=Fu,t=Fu,n=1){super(),this.resizable=i,this.baseSize=new st(1,1),this.preferredSize=new st(e,t),this.target=this.preferredSize,this.s=n,this.effectiveSize=new st,this.addEventListener("change",()=>this.updateEffectiveSize()),this.updateEffectiveSize()}updateEffectiveSize(){const i=this.baseSize,e=this.preferredSize,t=this.effectiveSize,n=this.scale;e.width!==Fu?t.width=e.width:e.height!==Fu?t.width=Math.round(e.height*(i.width/Math.max(i.height,1))):t.width=Math.round(i.width*n),e.height!==Fu?t.height=e.height:e.width!==Fu?t.height=Math.round(e.width/Math.max(i.width/Math.max(i.height,1),1)):t.height=Math.round(i.height*n)}get width(){return this.effectiveSize.width}set width(i){this.preferredWidth=i}get height(){return this.effectiveSize.height}set height(i){this.preferredHeight=i}getWidth(){return this.width}getHeight(){return this.height}get scale(){return this.s}set scale(i){this.s!==i&&(this.s=i,this.preferredSize.setScalar(Fu),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getScale(){return this.scale}setScale(i){this.scale=i}get baseWidth(){return this.baseSize.width}set baseWidth(i){this.baseSize.width!==i&&(this.baseSize.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseWidth(){return this.baseWidth}setBaseWidth(i){this.baseWidth=i}get baseHeight(){return this.baseSize.height}set baseHeight(i){this.baseSize.height!==i&&(this.baseSize.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getBaseHeight(){return this.baseHeight}setBaseHeight(i){this.baseHeight=i}setBaseSize(i,e){(this.baseSize.width!==i||this.baseSize.height!==e)&&(this.baseSize.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}get preferredWidth(){return this.preferredSize.width}set preferredWidth(i){this.preferredSize.width!==i&&(this.preferredSize.width=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredWidth(){return this.preferredWidth}setPreferredWidth(i){this.preferredWidth=i}get preferredHeight(){return this.preferredSize.height}set preferredHeight(i){this.preferredSize.height!==i&&(this.preferredSize.height=i,this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}getPreferredHeight(){return this.preferredHeight}setPreferredHeight(i){this.preferredHeight=i}setPreferredSize(i,e){(this.preferredSize.width!==i||this.preferredSize.height!==e)&&(this.preferredSize.set(i,e),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height))}copy(i){this.s=i.scale,this.baseSize.set(i.baseWidth,i.baseHeight),this.preferredSize.set(i.preferredWidth,i.preferredHeight),this.dispatchEvent({type:"change"}),this.resizable.setSize(this.baseSize.width,this.baseSize.height)}static get AUTO_SIZE(){return Fu}},$n={ADD:0,ALPHA:1,AVERAGE:2,COLOR:3,COLOR_BURN:4,COLOR_DODGE:5,DARKEN:6,DIFFERENCE:7,DIVIDE:8,DST:9,EXCLUSION:10,HARD_LIGHT:11,HARD_MIX:12,HUE:13,INVERT:14,INVERT_RGB:15,LIGHTEN:16,LINEAR_BURN:17,LINEAR_DODGE:18,LINEAR_LIGHT:19,LUMINOSITY:20,MULTIPLY:21,NEGATION:22,NORMAL:23,OVERLAY:24,PIN_LIGHT:25,REFLECT:26,SATURATION:27,SCREEN:28,SOFT_LIGHT:29,SRC:30,SUBTRACT:31,VIVID_LIGHT:32},Xk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",qk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,src.a*opacity);}",Yk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=(dst.rgb+src.rgb)*0.5;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Jk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.xy,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Kk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=mix(step(0.0,b)*(1.0-min(vec3(1.0),(1.0-a)/max(b,1e-9))),vec3(1.0),step(1.0,a));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Zk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=dst.rgb,b=src.rgb;vec3 c=step(0.0,a)*mix(min(vec3(1.0),a/max(1.0-b,1e-9)),vec3(1.0),step(1.0,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",Qk="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",$k="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=abs(dst.rgb-src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",eH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb/max(src.rgb,1e-9);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",tH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-2.0*dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",nH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb,1.0);vec3 b=min(src.rgb,1.0);vec3 c=mix(2.0*a*b,1.0-2.0*(1.0-a)*(1.0-b),step(0.5,b));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",iH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=step(1.0,dst.rgb+src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",sH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(b.x,a.yz));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",rH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",aH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=src.rgb*max(1.0-dst.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",oH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb,src.rgb);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",lH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",cH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=min(dst.rgb+src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",uH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=clamp(2.0*src.rgb+dst.rgb-1.0,0.0,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",fH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.xy,b.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",dH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb*src.rgb;return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",hH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(1.0-abs(1.0-dst.rgb-src.rgb),0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",pH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return mix(dst,src,opacity);}",mH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=2.0*src.rgb*dst.rgb;vec3 b=1.0-2.0*(1.0-src.rgb)*(1.0-dst.rgb);vec3 c=mix(a,b,step(0.5,dst.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",gH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 c=mix(mix(src2,dst.rgb,step(0.5*dst.rgb,src.rgb)),max(src2-1.0,vec3(0.0)),step(dst.rgb,src2-1.0));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",vH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=min(dst.rgb*dst.rgb/max(1.0-src.rgb,1e-9),1.0);vec3 c=mix(a,src.rgb,step(1.0,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",yH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 a=RGBToHSL(dst.rgb);vec3 b=RGBToHSL(src.rgb);vec3 c=HSLToRGB(vec3(a.x,b.y,a.z));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",xH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=dst.rgb+src.rgb-min(dst.rgb*src.rgb,1.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",_H="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 src2=2.0*src.rgb;vec3 d=dst.rgb+(src2-1.0);vec3 w=step(0.5,src.rgb);vec3 a=dst.rgb-(1.0-src2)*dst.rgb*(1.0-dst.rgb);vec3 b=mix(d*(sqrt(dst.rgb)-dst.rgb),d*dst.rgb*((16.0*dst.rgb-12.0)*dst.rgb+3.0),w*(1.0-step(0.25,dst.rgb)));vec3 c=mix(a,b,w);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",bH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){return src;}",SH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=max(dst.rgb-src.rgb,0.0);return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}",AH="vec4 blend(const in vec4 dst,const in vec4 src,const in float opacity){vec3 c=mix(max(1.0-min((1.0-dst.rgb)/(2.0*src.rgb),1.0),0.0),min(dst.rgb/(2.0*(1.0-src.rgb)),1.0),step(0.5,src.rgb));return mix(dst,vec4(c,max(dst.a,src.a)),opacity);}
3984",MH=new Map([[$n.ADD,Xk],[$n.ALPHA,qk],[$n.AVERAGE,Yk],[$n.COLOR,Jk],[$n.COLOR_BURN,Kk],[$n.COLOR_DODGE,Zk],[$n.DARKEN,Qk],[$n.DIFFERENCE,$k],[$n.DIVIDE,eH],[$n.DST,null],[$n.EXCLUSION,tH],[$n.HARD_LIGHT,nH],[$n.HARD_MIX,iH],[$n.HUE,sH],[$n.INVERT,rH],[$n.INVERT_RGB,aH],[$n.LIGHTEN,oH],[$n.LINEAR_BURN,lH],[$n.LINEAR_DODGE,cH],[$n.LINEAR_LIGHT,uH],[$n.LUMINOSITY,fH],[$n.MULTIPLY,dH],[$n.NEGATION,hH],[$n.NORMAL,pH],[$n.OVERLAY,mH],[$n.PIN_LIGHT,gH],[$n.REFLECT,vH],[$n.SATURATION,yH],[$n.SCREEN,xH],[$n.SOFT_LIGHT,_H],[$n.SRC,bH],[$n.SUBTRACT,SH],[$n.VIVID_LIGHT,AH]]),EH=class extends eo{constructor(i,e=1){super(),this._blendFunction=i,this.opacity=new ai(e)}getOpacity(){return this.opacity.value}setOpacity(i){this.opacity.value=i}get blendFunction(){return this._blendFunction}set blendFunction(i){this._blendFunction=i,this.dispatchEvent({type:"change"})}getBlendFunction(){return this.blendFunction}setBlendFunction(i){this.blendFunction=i}getShaderCode(){return MH.get(this.blendFunction)}},uA=class extends eo{constructor(i,e,{attributes:t=xd.NONE,blendFunction:n=$n.NORMAL,defines:s=new Map,uniforms:a=new Map,extensions:l=null,vertexShader:u=null}={}){super(),this.name=i,this.renderer=null,this.attributes=t,this.fragmentShader=e,this.vertexShader=u,this.defines=s,this.uniforms=a,this.extensions=l,this.blendMode=new EH(n),this.blendMode.addEventListener("change",h=>this.setChanged()),this._inputColorSpace=Wl,this._outputColorSpace=sl}get inputColorSpace(){return this._inputColorSpace}set inputColorSpace(i){this._inputColorSpace=i,this.setChanged()}get outputColorSpace(){return this._outputColorSpace}set outputColorSpace(i){this._outputColorSpace=i,this.setChanged()}set mainScene(i){}set mainCamera(i){}getName(){return this.name}setRenderer(i){this.renderer=i}getDefines(){return this.defines}getUniforms(){return this.uniforms}getExtensions(){return this.extensions}getBlendMode(){return this.blendMode}getAttributes(){return this.attributes}setAttributes(i){this.attributes=i,this.setChanged()}getFragmentShader(){return this.fragmentShader}setFragmentShader(i){this.fragmentShader=i,this.setChanged()}getVertexShader(){return this.vertexShader}setVertexShader(i){this.vertexShader=i,this.setChanged()}setChanged(){this.dispatchEvent({type:"change"})}setDepthTexture(i,e=ef){}update(i,e,t){}setSize(i,e){}initialize(i,e,t){}dispose(){for(const i of Object.keys(this)){const e=this[i];(e instanceof Ms||e instanceof js||e instanceof Ki||e instanceof Ga)&&this[i].dispose()}}},gM={MEDIUM:2,LARGE:3},TH=`#ifdef FRAMEBUFFER_PRECISION_HIGH
3985uniform mediump sampler2D inputBuffer;
3986#else
3987uniform lowp sampler2D inputBuffer;
3988#endif
3989varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec4 sum=texture2D(inputBuffer,vUv0);sum+=texture2D(inputBuffer,vUv1);sum+=texture2D(inputBuffer,vUv2);sum+=texture2D(inputBuffer,vUv3);gl_FragColor=sum*0.25;
3990#include <colorspace_fragment>
3991}`,wH="uniform vec4 texelSize;uniform float kernel;uniform float scale;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vec2 dUv=(texelSize.xy*vec2(kernel)+texelSize.zw)*scale;vUv0=vec2(uv.x-dUv.x,uv.y+dUv.y);vUv1=vec2(uv.x+dUv.x,uv.y+dUv.y);vUv2=vec2(uv.x+dUv.x,uv.y-dUv.y);vUv3=vec2(uv.x-dUv.x,uv.y-dUv.y);gl_Position=vec4(position.xy,1.0,1.0);}",CH=[new Float32Array([0,0]),new Float32Array([0,1,1]),new Float32Array([0,1,1,2]),new Float32Array([0,1,2,2,3]),new Float32Array([0,1,2,3,4,4,5]),new Float32Array([0,1,2,3,4,5,7,8,9,10])],RH=class extends Zi{constructor(i=new oi){super({name:"KawaseBlurMaterial",uniforms:{inputBuffer:new ai(null),texelSize:new ai(new oi),scale:new ai(1),kernel:new ai(0)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:TH,vertexShader:wH}),this.setTexelSize(i.x,i.y),this.kernelSize=gM.MEDIUM}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.inputBuffer=i}get kernelSequence(){return CH[this.kernelSize]}get scale(){return this.uniforms.scale.value}set scale(i){this.uniforms.scale.value=i}getScale(){return this.uniforms.scale.value}setScale(i){this.uniforms.scale.value=i}getKernel(){return null}get kernel(){return this.uniforms.kernel.value}set kernel(i){this.uniforms.kernel.value=i}setKernel(i){this.kernel=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e,i*.5,e*.5)}setSize(i,e){const t=1/i,n=1/e;this.uniforms.texelSize.value.set(t,n,t*.5,n*.5)}},BH=class extends Ga{constructor({kernelSize:i=gM.MEDIUM,resolutionScale:e=.5,width:t=Zr.AUTO_SIZE,height:n=Zr.AUTO_SIZE,resolutionX:s=t,resolutionY:a=n}={}){super("KawaseBlurPass"),this.renderTargetA=new Ms(1,1,{depthBuffer:!1}),this.renderTargetA.texture.name="Blur.Target.A",this.renderTargetB=this.renderTargetA.clone(),this.renderTargetB.texture.name="Blur.Target.B";const l=this.resolution=new Zr(this,s,a,e);l.addEventListener("change",u=>this.setSize(l.baseWidth,l.baseHeight)),this._blurMaterial=new RH,this._blurMaterial.kernelSize=i,this.copyMaterial=new B3}getResolution(){return this.resolution}get blurMaterial(){return this._blurMaterial}set blurMaterial(i){this._blurMaterial=i}get dithering(){return this.copyMaterial.dithering}set dithering(i){this.copyMaterial.dithering=i}get kernelSize(){return this.blurMaterial.kernelSize}set kernelSize(i){this.blurMaterial.kernelSize=i}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get scale(){return this.blurMaterial.scale}set scale(i){this.blurMaterial.scale=i}getScale(){return this.blurMaterial.scale}setScale(i){this.blurMaterial.scale=i}getKernelSize(){return this.kernelSize}setKernelSize(i){this.kernelSize=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const a=this.scene,l=this.camera,u=this.renderTargetA,h=this.renderTargetB,p=this.blurMaterial,m=p.kernelSequence;let v=e;this.fullscreenMaterial=p;for(let x=0,_=m.length;x<_;++x){const A=(x&1)===0?u:h;p.kernel=m[x],p.inputBuffer=v.texture,i.setRenderTarget(A),i.render(a,l),v=A}this.fullscreenMaterial=this.copyMaterial,this.copyMaterial.inputBuffer=v.texture,i.setRenderTarget(this.renderToScreen?null:t),i.render(a,l)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e);const n=t.width,s=t.height;this.renderTargetA.setSize(n,s),this.renderTargetB.setSize(n,s),this.blurMaterial.setSize(i,e)}initialize(i,e,t){t!==void 0&&(this.renderTargetA.texture.type=t,this.renderTargetB.texture.type=t,t!==vr?(this.blurMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.copyMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1"):i!==null&&i.outputColorSpace
vendor: 5,165 bytes, lines 3991-4022
3991===xi&&(this.renderTargetA.texture.colorSpace=xi,this.renderTargetB.texture.colorSpace=xi))}static get AUTO_SIZE(){return Zr.AUTO_SIZE}},IH=`#include <common>
3992#ifdef FRAMEBUFFER_PRECISION_HIGH
3993uniform mediump sampler2D inputBuffer;
3994#else
3995uniform lowp sampler2D inputBuffer;
3996#endif
3997#ifdef RANGE
3998uniform vec2 range;
3999#elif defined(THRESHOLD)
4000uniform float threshold;uniform float smoothing;
4001#endif
4002varying vec2 vUv;void main(){vec4 texel=texture2D(inputBuffer,vUv);float l=luminance(texel.rgb);float mask=1.0;
4003#ifdef RANGE
4004float low=step(range.x,l);float high=step(l,range.y);mask=low*high;
4005#elif defined(THRESHOLD)
4006mask=smoothstep(threshold,threshold+smoothing,l);
4007#endif
4008#ifdef COLOR
4009gl_FragColor=texel*mask;
4010#else
4011gl_FragColor=vec4(l*mask);
4012#endif
4013}`,DH=class extends Zi{constructor(i=!1,e=null){super({name:"LuminanceMaterial",defines:{THREE_REVISION:$u.replace(/\D+/g,"")},uniforms:{inputBuffer:new ai(null),threshold:new ai(0),smoothing:new ai(1),range:new ai(null)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:IH,vertexShader:R3}),this.colorOutput=i,this.luminanceRange=e}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get threshold(){return this.uniforms.threshold.value}set threshold(i){this.smoothing>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.threshold.value=i}getThreshold(){return this.threshold}setThreshold(i){this.threshold=i}get smoothing(){return this.uniforms.smoothing.value}set smoothing(i){this.threshold>0||i>0?this.defines.THRESHOLD="1":delete this.defines.THRESHOLD,this.uniforms.smoothing.value=i}getSmoothingFactor(){return this.smoothing}setSmoothingFactor(i){this.smoothing=i}get useThreshold(){return this.threshold>0||this.smoothing>0}set useThreshold(i){}get colorOutput(){return this.defines.COLOR!==void 0}set colorOutput(i){i?this.defines.COLOR="1":delete this.defines.COLOR,this.needsUpdate=!0}isColorOutputEnabled(i){return this.colorOutput}setColorOutputEnabled(i){this.colorOutput=i}get useRange(){return this.luminanceRange!==null}set useRange(i){this.luminanceRange=null}get luminanceRange(){return this.uniforms.range.value}set luminanceRange(i){i!==null?this.defines.RANGE="1":delete this.defines.RANGE,this.uniforms.range.value=i,this.needsUpdate=!0}getLuminanceRange(){return this.luminanceRange}setLuminanceRange(i){this.luminanceRange=i}},LH=class extends Ga{constructor({renderTarget:i,luminanceRange:e,colorOutput:t,resolutionScale:n=1,width:s=Zr.AUTO_SIZE,height:a=Zr.AUTO_SIZE,resolutionX:l=s,resolutionY:u=a}={}){super("LuminancePass"),this.fullscreenMaterial=new DH(t,e),this.needsSwap=!1,this.renderTarget=i,this.renderTarget===void 0&&(this.renderTarget=new Ms(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="LuminancePass.Target");const h=this.resolution=new Zr(this,l,u,n);h.addEventListener("change",p=>this.setSize(h.baseWidth,h.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}render(i,e,t,n,s){const a=this.fullscreenMaterial;a.inputBuffer=e.texture,i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}initialize(i,e,t){t!==void 0&&t!==vr&&(this.renderTarget.texture.type=t,this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}},PH=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4014uniform mediump sampler2D inputBuffer;
4015#else
4016uniform lowp sampler2D inputBuffer;
4017#endif
4018#define WEIGHT_INNER 0.125
4019#define WEIGHT_OUTER 0.05556
4020varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;float clampToBorder(const in vec2 uv){return float(uv.s>=0.0&&uv.s<=1.0&&uv.t>=0.0&&uv.t<=1.0);}void main(){vec4 c=vec4(0.0);vec4 w=WEIGHT_INNER*vec4(clampToBorder(vUv00),clampToBorder(vUv01),clampToBorder(vUv02),clampToBorder(vUv03));c+=w.x*texture2D(inputBuffer,vUv00);c+=w.y*texture2D(inputBuffer,vUv01);c+=w.z*texture2D(inputBuffer,vUv02);c+=w.w*texture2D(inputBuffer,vUv03);w=WEIGHT_OUTER*vec4(clampToBorder(vUv04),clampToBorder(vUv05),clampToBorder(vUv06),clampToBorder(vUv07));c+=w.x*texture2D(inputBuffer,vUv04);c+=w.y*texture2D(inputBuffer,vUv05);c+=w.z*texture2D(inputBuffer,vUv06);c+=w.w*texture2D(inputBuffer,vUv07);w=WEIGHT_OUTER*vec4(clampToBorder(vUv08),clampToBorder(vUv09),clampToBorder(vUv10),clampToBorder(vUv11));c+=w.x*texture2D(inputBuffer,vUv08);c+=w.y*texture2D(inputBuffer,vUv09);c+=w.z*texture2D(inputBuffer,vUv10);c+=w.w*texture2D(inputBuffer,vUv11);c+=WEIGHT_OUTER*texture2D(inputBuffer,vUv);gl_FragColor=c;
4021#include <colorspace_fragment>
4022}`,OH="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv00;varying vec2 vUv01;varying vec2 vUv02;varying vec2 vUv03;varying vec2 vUv04;varying vec2 vUv05;varying vec2 vUv06;varying vec2 vUv07;varying vec2 vUv08;varying vec2 vUv09;varying vec2 vUv10;varying vec2 vUv11;void main(){vUv=position.xy*0.5+0.5;
4022vUv00=vUv+texelSize*vec2(-1.0,1.0);vUv01=vUv+texelSize*vec2(1.0,1.0);vUv02=vUv+texelSize*vec2(-1.0,-1.0);vUv03=vUv+texelSize*vec2(1.0,-1.0);vUv04=vUv+texelSize*vec2(-2.0,2.0);vUv05=vUv+texelSize*vec2(0.0,2.0);vUv06=vUv+texelSize*vec2(2.0,2.0);vUv07=vUv+texelSize*vec2(-2.0,0.0);vUv08=vUv+texelSize*vec2(2.0,0.0);vUv09=vUv+texelSize*vec2(-2.0,-2.0);vUv10=vUv+texelSize*vec2(0.0,-2.0);vUv11=vUv+texelSize*vec2(2.0,-2.0);gl_Position=vec4(position.xy,1.0,1.0);}",NH=class extends Zi{constructor(){super({name:"DownsamplingMaterial",uniforms:{inputBuffer:new ai(null),texelSize:new ai(new st)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:PH,vertexShader:OH})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},UH=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4023uniform mediump sampler2D inputBuffer;uniform mediump sampler2D supportBuffer;
4024#else
4025uniform lowp sampler2D inputBuffer;uniform lowp sampler2D supportBuffer;
4026#endif
4027uniform float radius;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vec4 c=vec4(0.0);c+=texture2D(inputBuffer,vUv0)*0.0625;c+=texture2D(inputBuffer,vUv1)*0.125;c+=texture2D(inputBuffer,vUv2)*0.0625;c+=texture2D(inputBuffer,vUv3)*0.125;c+=texture2D(inputBuffer,vUv)*0.25;c+=texture2D(inputBuffer,vUv4)*0.125;c+=texture2D(inputBuffer,vUv5)*0.0625;c+=texture2D(inputBuffer,vUv6)*0.125;c+=texture2D(inputBuffer,vUv7)*0.0625;vec4 baseColor=texture2D(supportBuffer,vUv);gl_FragColor=mix(baseColor,c,radius);
4028#include <colorspace_fragment>
4029}`,zH="uniform vec2 texelSize;varying vec2 vUv;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;varying vec2 vUv4;varying vec2 vUv5;varying vec2 vUv6;varying vec2 vUv7;void main(){vUv=position.xy*0.5+0.5;vUv0=vUv+texelSize*vec2(-1.0,1.0);vUv1=vUv+texelSize*vec2(0.0,1.0);vUv2=vUv+texelSize*vec2(1.0,1.0);vUv3=vUv+texelSize*vec2(-1.0,0.0);vUv4=vUv+texelSize*vec2(1.0,0.0);vUv5=vUv+texelSize*vec2(-1.0,-1.0);vUv6=vUv+texelSize*vec2(0.0,-1.0);vUv7=vUv+texelSize*vec2(1.0,-1.0);gl_Position=vec4(position.xy,1.0,1.0);}",FH=class extends Zi{constructor(){super({name:"UpsamplingMaterial",uniforms:{inputBuffer:new ai(null),supportBuffer:new ai(null),texelSize:new ai(new st),radius:new ai(.85)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:UH,vertexShader:zH})}set inputBuffer(i){this.uniforms.inputBuffer.value=i}set supportBuffer(i){this.uniforms.supportBuffer.value=i}get radius(){return this.uniforms.radius.value}set radius(i){this.uniforms.radius.value=i}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},kH=class extends Ga{constructor(){super("MipmapBlurPass"),this.needsSwap=!1,this.renderTarget=new Ms(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Upsampling.Mipmap0",this.downsamplingMipmaps=[],this.upsamplingMipmaps=[],this.downsamplingMaterial=new NH,this.upsamplingMaterial=new FH,this.resolution=new st}get texture(){return this.renderTarget.texture}get levels(){return this.downsamplingMipmaps.length}set levels(i){if(this.levels!==i){const e=this.renderTarget;this.dispose(),this.downsamplingMipmaps=[],this.upsamplingMipmaps=[];for(let t=0;t<i;++t){const n=e.clone();n.texture.name="Downsampling.Mipmap"+t,this.downsamplingMipmaps.push(n)}this.upsamplingMipmaps.push(e);for(let t=1,n=i-1;t<n;++t){const s=e.clone();s.texture.name="Upsampling.Mipmap"+t,this.upsamplingMipmaps.push(s)}this.setSize(this.resolution.x,this.resolution.y)}}get radius(){return this.upsamplingMaterial.radius}set radius(i){this.upsamplingMaterial.radius=i}render(i,e,t,n,s){const{scene:a,camera:l}=this,{downsamplingMaterial:u,upsamplingMaterial:h}=this,{downsamplingMipmaps:p,upsamplingMipmaps:m}=this;let v=e;this.fullscreenMaterial=u;for(let x=0,_=p.length;x<_;++x){const A=p[x];u.setSize(v.width,v.height),u.inputBuffer=v.texture,i.setRenderTarget(A),i.render(a,l),v=A}this.fullscreenMaterial=h;for(let x=m.length-1;x>=0;--x){const _=m[x];h.setSize(v.width,v.height),h.inputBuffer=v.texture,h.supportBuffer=p[x].texture,i.setRenderTarget(_),i.render(a,l),v=_}}setSize(i,e){const t=this.resolution;t.set(i,e);let n=t.width,s=t.height;for(let a=0,l=this.downsamplingMipmaps.length;a<l;++a)n=Math.round(n*.5),s=Math.round(s*.5),this.downsamplingMipmaps[a].setSize(n,s),a<this.upsamplingMipmaps.length&&this.upsamplingMipmaps[a].setSize(n,s)}initialize(i,e,t){if(t!==void 0){const n=this.downsamplingMipmaps.concat(this.upsamplingMipmaps);for(const s of n)s.texture.type=t;if(t!==vr)this.downsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1",this.upsamplingMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1";
vendor: 4,300 bytes, lines 4029-4034
4029else if(i!==null&&i.outputColorSpace===xi)for(const s of n)s.texture.colorSpace=xi}}dispose(){super.dispose();for(const i of this.downsamplingMipmaps.concat(this.upsamplingMipmaps))i.dispose()}},HH=`#ifdef FRAMEBUFFER_PRECISION_HIGH
4030uniform mediump sampler2D map;
4031#else
4032uniform lowp sampler2D map;
4033#endif
4034uniform float intensity;void mainImage(const in vec4 inputColor,const in vec2 uv,out vec4 outputColor){outputColor=texture2D(map,uv)*intensity;}`,GH=class extends uA{constructor({blendFunction:i=$n.SCREEN,luminanceThreshold:e=1,luminanceSmoothing:t=.03,mipmapBlur:n=!0,intensity:s=1,radius:a=.85,levels:l=8,kernelSize:u=gM.LARGE,resolutionScale:h=.5,width:p=Zr.AUTO_SIZE,height:m=Zr.AUTO_SIZE,resolutionX:v=p,resolutionY:x=m}={}){super("BloomEffect",HH,{blendFunction:i,uniforms:new Map([["map",new ai(null)],["intensity",new ai(s)]])}),this.renderTarget=new Ms(1,1,{depthBuffer:!1}),this.renderTarget.texture.name="Bloom.Target",this.blurPass=new BH({kernelSize:u}),this.luminancePass=new LH({colorOutput:!0}),this.luminanceMaterial.threshold=e,this.luminanceMaterial.smoothing=t,this.mipmapBlurPass=new kH,this.mipmapBlurPass.enabled=n,this.mipmapBlurPass.radius=a,this.mipmapBlurPass.levels=l,this.uniforms.get("map").value=n?this.mipmapBlurPass.texture:this.renderTarget.texture;const _=this.resolution=new Zr(this,v,x,h);_.addEventListener("change",A=>this.setSize(_.baseWidth,_.baseHeight))}get texture(){return this.mipmapBlurPass.enabled?this.mipmapBlurPass.texture:this.renderTarget.texture}getTexture(){return this.texture}getResolution(){return this.resolution}getBlurPass(){return this.blurPass}getLuminancePass(){return this.luminancePass}get luminanceMaterial(){return this.luminancePass.fullscreenMaterial}getLuminanceMaterial(){return this.luminancePass.fullscreenMaterial}get width(){return this.resolution.width}set width(i){this.resolution.preferredWidth=i}get height(){return this.resolution.height}set height(i){this.resolution.preferredHeight=i}get dithering(){return this.blurPass.dithering}set dithering(i){this.blurPass.dithering=i}get kernelSize(){return this.blurPass.kernelSize}set kernelSize(i){this.blurPass.kernelSize=i}get distinction(){return console.warn(this.name,"distinction was removed"),1}set distinction(i){console.warn(this.name,"distinction was removed")}get intensity(){return this.uniforms.get("intensity").value}set intensity(i){this.uniforms.get("intensity").value=i}getIntensity(){return this.intensity}setIntensity(i){this.intensity=i}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}update(i,e,t){const n=this.renderTarget,s=this.luminancePass;s.enabled?(s.render(i,e),this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,s.renderTarget):this.blurPass.render(i,s.renderTarget,n)):this.mipmapBlurPass.enabled?this.mipmapBlurPass.render(i,e):this.blurPass.render(i,e,n)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.blurPass.resolution.copy(t),this.luminancePass.setSize(i,e),this.mipmapBlurPass.setSize(i,e)}initialize(i,e,t){this.blurPass.initialize(i,e,t),this.luminancePass.initialize(i,e,t),this.mipmapBlurPass.initialize(i,e,t),t!==void 0&&(this.renderTarget.texture.type=t,i!==null&&i.outputColorSpace===xi&&(this.renderTarget.texture.colorSpace=xi))}},D3=class extends Ga{constructor(i,e,t=null){super("RenderPass",i,e),this.needsSwap=!1,this.needsDepthBlit=!0,this.clearPass=new I3,this.overrideMaterialManager=t===null?null:new tC(t),this.ignoreBackground=!1,this.skipShadowMapUpdate=!1,this.selection=null}set mainScene(i){this.scene=i}set mainCamera(i){this.camera=i}get renderToScreen(){return super.renderToScreen}set renderToScreen(i){super.renderToScreen=i,this.clearPass.renderToScreen=i}get overrideMaterial(){const i=this.overrideMaterialManager;return i!==null?i.material:null}set overrideMaterial(i){const e=this.overrideMaterialManager;i!==null?e!==null?e.setMaterial(i):this.overrideMaterialManager=new tC(i):e!==null&&(e.dispose(),this.overrideMaterialManager=null)}getOverrideMaterial(){return this.overrideMaterial}setOverrideMaterial(i){this.overrideMaterial=i}get clear(){return this.clearPass.enabled}set clear(i){this.clearPass.enabled=i}getSelection(){return this.selection}setSelection(i){this.selection=i}
vendor: 14,399 bytes, lines 4034-4109
4034isBackgroundDisabled(){return this.ignoreBackground}setBackgroundDisabled(i){this.ignoreBackground=i}isShadowMapDisabled(){return this.skipShadowMapUpdate}setShadowMapDisabled(i){this.skipShadowMapUpdate=i}getClearPass(){return this.clearPass}render(i,e,t,n,s){const a=this.scene,l=this.camera,u=this.selection,h=l.layers.mask,p=a.background,m=i.shadowMap.autoUpdate,v=this.renderToScreen?null:e;u!==null&&l.layers.set(u.getLayer()),this.skipShadowMapUpdate&&(i.shadowMap.autoUpdate=!1),(this.ignoreBackground||this.clearPass.overrideClearColor!==null)&&(a.background=null),this.clearPass.enabled&&this.clearPass.render(i,e),i.setRenderTarget(v),this.overrideMaterialManager!==null?this.overrideMaterialManager.render(i,a,l):i.render(a,l),l.layers.mask=h,a.background=p,i.shadowMap.autoUpdate=m}},jH=`#include <packing>
4035#ifdef GL_FRAGMENT_PRECISION_HIGH
4036uniform highp sampler2D depthBuffer;
4037#else
4038uniform mediump sampler2D depthBuffer;
4039#endif
4040#ifdef DOWNSAMPLE_NORMALS
4041uniform lowp sampler2D normalBuffer;
4042#endif
4043varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;float readDepth(const in vec2 uv){
4044#if DEPTH_PACKING == 3201
4045return unpackRGBAToDepth(texture2D(depthBuffer,uv));
4046#else
4047return texture2D(depthBuffer,uv).r;
4048#endif
4049}int findBestDepth(const in float samples[4]){float c=(samples[0]+samples[1]+samples[2]+samples[3])*0.25;float distances[4];distances[0]=abs(c-samples[0]);distances[1]=abs(c-samples[1]);distances[2]=abs(c-samples[2]);distances[3]=abs(c-samples[3]);float maxDistance=max(max(distances[0],distances[1]),max(distances[2],distances[3]));int remaining[3];int rejected[3];int i,j,k;for(i=0,j=0,k=0;i<4;++i){if(distances[i]<maxDistance){remaining[j++]=i;}else{rejected[k++]=i;}}for(;j<3;++j){remaining[j]=rejected[--k];}vec3 s=vec3(samples[remaining[0]],samples[remaining[1]],samples[remaining[2]]);c=(s.x+s.y+s.z)/3.0;distances[0]=abs(c-s.x);distances[1]=abs(c-s.y);distances[2]=abs(c-s.z);float minDistance=min(distances[0],min(distances[1],distances[2]));for(i=0;i<3;++i){if(distances[i]==minDistance){break;}}return remaining[i];}void main(){float d[4];d[0]=readDepth(vUv0);d[1]=readDepth(vUv1);d[2]=readDepth(vUv2);d[3]=readDepth(vUv3);int index=findBestDepth(d);
4050#ifdef DOWNSAMPLE_NORMALS
4051vec3 n[4];n[0]=texture2D(normalBuffer,vUv0).rgb;n[1]=texture2D(normalBuffer,vUv1).rgb;n[2]=texture2D(normalBuffer,vUv2).rgb;n[3]=texture2D(normalBuffer,vUv3).rgb;
4052#else
4053vec3 n[4];n[0]=vec3(0.0);n[1]=vec3(0.0);n[2]=vec3(0.0);n[3]=vec3(0.0);
4054#endif
4055gl_FragColor=vec4(n[index],d[index]);}`,VH="uniform vec2 texelSize;varying vec2 vUv0;varying vec2 vUv1;varying vec2 vUv2;varying vec2 vUv3;void main(){vec2 uv=position.xy*0.5+0.5;vUv0=uv;vUv1=vec2(uv.x,uv.y+texelSize.y);vUv2=vec2(uv.x+texelSize.x,uv.y);vUv3=uv+texelSize;gl_Position=vec4(position.xy,1.0,1.0);}",WH=class extends Zi{constructor(){super({name:"DepthDownsamplingMaterial",defines:{DEPTH_PACKING:"0"},uniforms:{depthBuffer:new ai(null),normalBuffer:new ai(null),texelSize:new ai(new st)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,fragmentShader:jH,vertexShader:VH})}set depthBuffer(i){this.uniforms.depthBuffer.value=i}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=ef){this.depthBuffer=i,this.depthPacking=e}set normalBuffer(i){this.uniforms.normalBuffer.value=i,i!==null?this.defines.DOWNSAMPLE_NORMALS="1":delete this.defines.DOWNSAMPLE_NORMALS,this.needsUpdate=!0}setNormalBuffer(i){this.normalBuffer=i}setTexelSize(i,e){this.uniforms.texelSize.value.set(i,e)}setSize(i,e){this.uniforms.texelSize.value.set(1/i,1/e)}},XH=class extends Ga{constructor({normalBuffer:i=null,resolutionScale:e=.5,width:t=Zr.AUTO_SIZE,height:n=Zr.AUTO_SIZE,resolutionX:s=t,resolutionY:a=n}={}){super("DepthDownsamplingPass");const l=new WH;l.normalBuffer=i,this.fullscreenMaterial=l,this.needsDepthTexture=!0,this.needsSwap=!1,this.renderTarget=new Ms(1,1,{minFilter:Ls,magFilter:Ls,depthBuffer:!1,type:Yr}),this.renderTarget.texture.name="DepthDownsamplingPass.Target",this.renderTarget.texture.generateMipmaps=!1;const u=this.resolution=new Zr(this,s,a,e);u.addEventListener("change",h=>this.setSize(u.baseWidth,u.baseHeight))}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}setDepthTexture(i,e=ef){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e}render(i,e,t,n,s){i.setRenderTarget(this.renderToScreen?null:this.renderTarget),i.render(this.scene,this.camera)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height),this.fullscreenMaterial.setSize(i,e)}initialize(i,e,t){const n=i.getContext();if(!(n.getExtension("EXT_color_buffer_float")||n.getExtension("EXT_color_buffer_half_float")))throw new Error("Rendering to float texture is not supported.")}},qH=`#include <common>
4056#include <packing>
4057#include <dithering_pars_fragment>
4058#define packFloatToRGBA(v) packDepthToRGBA(v)
4059#define unpackRGBAToFloat(v) unpackRGBAToDepth(v)
4060#ifdef FRAMEBUFFER_PRECISION_HIGH
4061uniform mediump sampler2D inputBuffer;
4062#else
4063uniform lowp sampler2D inputBuffer;
4064#endif
4065#if DEPTH_PACKING == 3201
4066uniform lowp sampler2D depthBuffer;
4067#elif defined(GL_FRAGMENT_PRECISION_HIGH)
4068uniform highp sampler2D depthBuffer;
4069#else
4070uniform mediump sampler2D depthBuffer;
4071#endif
4072uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;vec4 sRGBToLinear(const in vec4 value){return vec4(mix(pow(value.rgb*0.9478672986+vec3(0.0521327014),vec3(2.4)),value.rgb*0.0773993808,vec3(lessThanEqual(value.rgb,vec3(0.04045)))),value.a);}float readDepth(const in vec2 uv){
4073#if DEPTH_PACKING == 3201
4074float depth=unpackRGBAToDepth(texture2D(depthBuffer,uv));
4075#else
4076float depth=texture2D(depthBuffer,uv).r;
4077#endif
4078#if defined(USE_LOGARITHMIC_DEPTH_BUFFER) || defined(LOG_DEPTH)
4079float d=pow(2.0,depth*log2(cameraFar+1.0))-1.0;float a=cameraFar/(cameraFar-cameraNear);float b=cameraFar*cameraNear/(cameraNear-cameraFar);depth=a+b/d;
4080#elif defined(USE_REVERSED_DEPTH_BUFFER)
4081depth=1.0-depth;
4082#endif
4083return depth;}float getViewZ(const in float depth){
4084#ifdef PERSPECTIVE_CAMERA
4085return perspectiveDepthToViewZ(depth,cameraNear,cameraFar);
4086#else
4087return orthographicDepthToViewZ(depth,cameraNear,cameraFar);
4088#endif
4089}vec3 RGBToHCV(const in vec3 RGB){vec4 P=mix(vec4(RGB.bg,-1.0,2.0/3.0),vec4(RGB.gb,0.0,-1.0/3.0),step(RGB.b,RGB.g));vec4 Q=mix(vec4(P.xyw,RGB.r),vec4(RGB.r,P.yzx),step(P.x,RGB.r));float C=Q.x-min(Q.w,Q.y);float H=abs((Q.w-Q.y)/(6.0*C+EPSILON)+Q.z);return vec3(H,C,Q.x);}vec3 RGBToHSL(const in vec3 RGB){vec3 HCV=RGBToHCV(RGB);float L=HCV.z-HCV.y*0.5;float S=HCV.y/(1.0-abs(L*2.0-1.0)+EPSILON);return vec3(HCV.x,S,L);}vec3 HueToRGB(const in float H){float R=abs(H*6.0-3.0)-1.0;float G=2.0-abs(H*6.0-2.0);float B=2.0-abs(H*6.0-4.0);return clamp(vec3(R,G,B),0.0,1.0);}vec3 HSLToRGB(const in vec3 HSL){vec3 RGB=HueToRGB(HSL.x);float C=(1.0-abs(2.0*HSL.z-1.0))*HSL.y;return(RGB-0.5)*C+HSL.z;}FRAGMENT_HEAD void main(){FRAGMENT_MAIN_UV vec4 color0=texture2D(inputBuffer,UV);vec4 color1=vec4(0.0);FRAGMENT_MAIN_IMAGE color0.a=clamp(color0.a,0.0,1.0);gl_FragColor=color0;
4090#ifdef ENCODE_OUTPUT
4091#include <colorspace_fragment>
4092#endif
4093#include <dithering_fragment>
4094}`,YH="uniform vec2 resolution;uniform vec2 texelSize;uniform float cameraNear;uniform float cameraFar;uniform float aspect;uniform float time;varying vec2 vUv;VERTEX_HEAD void main(){vUv=position.xy*0.5+0.5;VERTEX_MAIN_SUPPORT gl_Position=vec4(position.xy,1.0,1.0);}",JH=class extends Zi{constructor(i,e,t,n,s=!1){super({name:"EffectMaterial",defines:{THREE_REVISION:$u.replace(/\D+/g,""),DEPTH_PACKING:"0",ENCODE_OUTPUT:"1"},uniforms:{inputBuffer:new ai(null),depthBuffer:new ai(null),resolution:new ai(new st),texelSize:new ai(new st),cameraNear:new ai(.3),cameraFar:new ai(1e3),aspect:new ai(1),time:new ai(0)},blending:Qr,toneMapped:!1,depthWrite:!1,depthTest:!1,dithering:s}),i&&this.setShaderParts(i),e&&this.setDefines(e),t&&this.setUniforms(t),this.copyCameraSettings(n)}set inputBuffer(i){this.uniforms.inputBuffer.value=i}setInputBuffer(i){this.uniforms.inputBuffer.value=i}get depthBuffer(){return this.uniforms.depthBuffer.value}set depthBuffer(i){this.uniforms.depthBuffer.value=i}get depthPacking(){return Number(this.defines.DEPTH_PACKING)}set depthPacking(i){this.defines.DEPTH_PACKING=i.toFixed(0),this.needsUpdate=!0}setDepthBuffer(i,e=ef){this.depthBuffer=i,this.depthPacking=e}setShaderData(i){this.setShaderParts(i.shaderParts),this.setDefines(i.defines),this.setUniforms(i.uniforms),this.setExtensions(i.extensions)}setShaderParts(i){return this.fragmentShader=qH.replace(yi.FRAGMENT_HEAD,i.get(yi.FRAGMENT_HEAD)||"").replace(yi.FRAGMENT_MAIN_UV,i.get(yi.FRAGMENT_MAIN_UV)||"").replace(yi.FRAGMENT_MAIN_IMAGE,i.get(yi.FRAGMENT_MAIN_IMAGE)||""),this.vertexShader=YH.replace(yi.VERTEX_HEAD,i.get(yi.VERTEX_HEAD)||"").replace(yi.VERTEX_MAIN_SUPPORT,i.get(yi.VERTEX_MAIN_SUPPORT)||""),this.needsUpdate=!0,this}setDefines(i){for(const e of i.entries())this.defines[e[0]]=e[1];return this.needsUpdate=!0,this}setUniforms(i){for(const e of i.entries())this.uniforms[e[0]]=e[1];return this}setExtensions(i){this.extensions={};for(const e of i)this.extensions[e]=!0;return this}get encodeOutput(){return this.defines.ENCODE_OUTPUT!==void 0}set encodeOutput(i){this.encodeOutput!==i&&(i?this.defines.ENCODE_OUTPUT="1":delete this.defines.ENCODE_OUTPUT,this.needsUpdate=!0)}isOutputEncodingEnabled(i){return this.encodeOutput}setOutputEncodingEnabled(i){this.encodeOutput=i}get time(){return this.uniforms.time.value}set time(i){this.uniforms.time.value=i}setDeltaTime(i){this.uniforms.time.value+=i}adoptCameraSettings(i){this.copyCameraSettings(i)}copyCameraSettings(i){i&&(this.uniforms.cameraNear.value=i.near,this.uniforms.cameraFar.value=i.far,i instanceof Ds?this.defines.PERSPECTIVE_CAMERA="1":delete this.defines.PERSPECTIVE_CAMERA,this.needsUpdate=!0)}setSize(i,e){const t=this.uniforms;t.resolution.value.set(i,e),t.texelSize.value.set(1/i,1/e),t.aspect.value=i/e}static get Section(){return yi}};function nC(i,e,t){for(const n of e){const s="$1"+i+n.charAt(0).toUpperCase()+n.slice(1),a=new RegExp("([^\\.])(\\b"+n+"\\b)","g");for(const l of t.entries())l[1]!==null&&t.set(l[0],l[1].replace(a,s))}}function KH(i,e,t){let n=e.getFragmentShader(),s=e.getVertexShader();const a=n!==void 0&&/mainImage/.test(n),l=n!==void 0&&/mainUv/.test(n);if(t.attributes|=e.getAttributes(),n===void 0)throw new Error(`Missing fragment shader (${e.name})`);if(l&&(t.attributes&xd.CONVOLUTION)!==0)throw new Error(`Effects that transform UVs are incompatible with convolution effects (${e.name})`);if(!a&&!l)throw new Error(`Could not find mainImage or mainUv function (${e.name})`);{const u=/\w+\s+(\w+)\([\w\s,]*\)\s*{/g,h=t.shaderParts;let p=h.get(yi.FRAGMENT_HEAD)||"",m=h.get(yi.FRAGMENT_MAIN_UV)||"",v=h.get(yi.FRAGMENT_MAIN_IMAGE)||"",x=h.get(yi.VERTEX_HEAD)||"",_=h.get(yi.VERTEX_MAIN_SUPPORT)||"";const A=new Set,R=new Set;if(l&&(m+=`	${i}MainUv(UV);
4095`,t.uvTransformation=!0),s!==null&&/mainSupport/.test(s)){const D=/mainSupport *\([\w\s]*?uv\s*?\)/.test(s);_+=`	${i}MainSupport(`,_+=D?`vUv);
4096`:`);
4097`;for(const L of s.matchAll(/(?:varying\s+\w+\s+([\S\s]*?);)/g))for(const P of L[1].split(/\s*,\s*/))t.varyings.add(P),A.add(P),R.add(P);for(const L of s.matchAll(u))R.add(L[1])}for(const D of n.matchAll(u))R.add(D[1]);for(const D of e.defines.keys())R.add(D.replace(/\([\w\s,]*\)/g,""));for(const D of e.uniforms.keys())R.add(D);R.delete("while"),R.delete("for"),R.delete("if"),e.uniforms.forEach((D,L)=>t.uniforms.set(i+L.charAt(0).toUpperCase()+L.slice(1),D)),e.defines.forEach((D,L)=>t.defines.set(i+L.charAt(0).toUpperCase()+L.slice(1),D));const w=new Map([["fragment",n],["vertex",s]]);nC(i,R,t.defines),nC(i,R,w),n=w.get("fragment"),s=w.get("vertex");const E=e.blendMode;if(t.blendModes.set(E.blendFunction,E),a){e.inputColorSpace!==null&&e.inputColorSpace!==t.colorSpace&&(v+=e.inputColorSpace===xi?`color0 = sRGBTransferOETF(color0);
4098	`:`color0 = sRGBToLinear(color0);
4099	`),e.outputColorSpace!==sl?t.colorSpace=e.outputColorSpace:e.inputColorSpace!==null&&(t.colorSpace=e.inputColorSpace);const D=/MainImage *\([\w\s,]*?depth[\w\s,]*?\)/;v+=`${i}MainImage(color0, UV, `,(t.attributes&xd.DEPTH)!==0&&D.test(n)&&(v+="depth, ",t.readDepth=!0),v+=`color1);
4100	`;const L=i+"BlendOpacity";t.uniforms.set(L,E.opacity),v+=`color0 = blend${E.blendFunction}(color0, color1, ${L});
4101
4102	`,p+=`uniform float ${L};
4103
4104`}if(p+=n+`
4105`,s!==null&&(x+=s+`
4106`),h.set(yi.FRAGMENT_HEAD,p),h.set(yi.FRAGMENT_MAIN_UV,m),h.set(yi.FRAGMENT_MAIN_IMAGE,v),h.set(yi.VERTEX_HEAD,x),h.set(yi.VERTEX_MAIN_SUPPORT,_),e.extensions!==null)for(const D of e.extensions)t.extensions.add(D)}}var ZH=class extends Ga{constructor(i,...e){super("EffectPass"),this.fullscreenMaterial=new JH(null,null,null,i),this.listener=t=>this.handleEvent(t),this.effects=[],this.setEffects(e),this.skipRendering=!1,this.minTime=1,this.maxTime=Number.POSITIVE_INFINITY,this.timeScale=1}set mainScene(i){for(const e of this.effects)e.mainScene=i}set mainCamera(i){this.fullscreenMaterial.copyCameraSettings(i);for(const e of this.effects)e.mainCamera=i}get encodeOutput(){return this.fullscreenMaterial.encodeOutput}set encodeOutput(i){this.fullscreenMaterial.encodeOutput=i}get dithering(){return this.fullscreenMaterial.dithering}set dithering(i){const e=this.fullscreenMaterial;e.dithering=i,e.needsUpdate=!0}setEffects(i){for(const e of this.effects)e.removeEventListener("change",this.listener);this.effects=i.sort((e,t)=>t.attributes-e.attributes);for(const e of this.effects)e.addEventListener("change",this.listener)}updateMaterial(){const i=new Wk;let e=0;for(const l of this.effects)if(l.blendMode.blendFunction===$n.DST)i.attributes|=l.getAttributes()&xd.DEPTH;else{if((i.attributes&l.getAttributes()&xd.CONVOLUTION)!==0)throw new Error(`Convolution effects cannot be merged (${l.name})`);KH("e"+e++,l,i)}let t=i.shaderParts.get(yi.FRAGMENT_HEAD),n=i.shaderParts.get(yi.FRAGMENT_MAIN_IMAGE),s=i.shaderParts.get(yi.FRAGMENT_MAIN_UV);const a=/\bblend\b/g;for(const l of i.blendModes.values())t+=l.getShaderCode().replace(a,`blend${l.blendFunction}`)+`
4107`;(i.attributes&xd.DEPTH)!==0?(i.readDepth&&(n=`float depth = readDepth(UV);
4108
4109	`+n),this.needsDepthTexture=this.getDepthTexture()===null):this.needsDepthTexture=!1,i.colorSpace
4109===xi&&(n+=`color0 = sRGBToLinear(color0);
4110	`),i.uvTransformation?(s=`vec2 transformedUv = vUv;
4111`+s,i.defines.set("UV","transformedUv")):i.defines.set("UV","vUv"),i.shaderParts.set(yi.FRAGMENT_HEAD,t),i.shaderParts.set(yi.FRAGMENT_MAIN_IMAGE,n),i.shaderParts.set(yi.FRAGMENT_MAIN_UV,s);for(const[l,u]of i.shaderParts)u!==null&&i.shaderParts.set(l,u.trim().replace(/^#/,`
4112#`));this.skipRendering=e===0,this.needsSwap=!this.skipRendering,this.fullscreenMaterial.setShaderData(i)}recompile(){this.updateMaterial()}getDepthTexture(){return this.fullscreenMaterial.depthBuffer}setDepthTexture(i,e=ef){this.fullscreenMaterial.depthBuffer=i,this.fullscreenMaterial.depthPacking=e;for(const t of this.effects)t.setDepthTexture(i,e)}render(i,e,t,n,s){for(const a of this.effects)a.update(i,e,n);if(!this.skipRendering||this.renderToScreen){const a=this.fullscreenMaterial;a.inputBuffer=e.texture,a.time+=n*this.timeScale,i.setRenderTarget(this.renderToScreen?null:t),i.render(this.scene,this.camera)}}setSize(i,e){this.fullscreenMaterial.setSize(i,e);for(const t of this.effects)t.setSize(i,e)}initialize(i,e,t){this.renderer=i;for(const n of this.effects)n.initialize(i,e,t);this.updateMaterial(),t!==void 0&&t!==vr&&(this.fullscreenMaterial.defines.FRAMEBUFFER_PRECISION_HIGH="1")}dispose(){super.dispose();for(const i of this.effects)i.removeEventListener("change",this.listener),i.dispose()}handleEvent(i){switch(i.type){case"change":this.recompile();break}}},QH=class extends Ga{constructor(i,e,{renderTarget:t,resolutionScale:n=1,width:s=Zr.AUTO_SIZE,height:a=Zr.AUTO_SIZE,resolutionX:l=s,resolutionY:u=a}={}){super("NormalPass"),this.needsSwap=!1,this.renderPass=new D3(i,e,new KA);const h=this.renderPass;h.ignoreBackground=!0,h.skipShadowMapUpdate=!0;const p=h.getClearPass();p.overrideClearColor=new Pt(7829503),p.overrideClearAlpha=1,this.renderTarget=t,this.renderTarget===void 0&&(this.renderTarget=new Ms(1,1,{minFilter:Ls,magFilter:Ls}),this.renderTarget.texture.name="NormalPass.Target");const m=this.resolution=new Zr(this,l,u,n);m.addEventListener("change",v=>this.setSize(m.baseWidth,m.baseHeight))}set mainScene(i){this.renderPass.mainScene=i}set mainCamera(i){this.renderPass.mainCamera=i}get texture(){return this.renderTarget.texture}getTexture(){return this.renderTarget.texture}getResolution(){return this.resolution}getResolutionScale(){return this.resolution.scale}setResolutionScale(i){this.resolution.scale=i}render(i,e,t,n,s){const a=this.renderToScreen?null:this.renderTarget;this.renderPass.render(i,a,a)}setSize(i,e){const t=this.resolution;t.setBaseSize(i,e),this.renderTarget.setSize(t.width,t.height)}};function F0(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}new st;new st;function L3(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}var Co=function i(e,t,n){var s=this;L3(this,i),F0(this,"dot2",function(a,l){return s.x*a+s.y*l}),F0(this,"dot3",function(a,l,u){return s.x*a+s.y*l+s.z*u}),this.x=e,this.y=t,this.z=n},$H=[new Co(1,1,0),new Co(-1,1,0),new Co(1,-1,0),new Co(-1,-1,0),new Co(1,0,1),new Co(-1,0,1),new Co(1,0,-1),new Co(-1,0,-1),new Co(0,1,1),new Co(0,-1,1),new Co(0,1,-1),new Co(0,-1,-1)],iC=[151,160,137,91,90,15,131,13,201,95,96,53,194,233,7,225,140,36,103,30,69,142,8,99,37,240,21,10,23,190,6,148,247,120,234,75,0,26,197,62,94,252,219,203,117,35,11,32,57,177,33,88,237,149,56,87,174,20,125,136,171,168,68,175,74,165,71,134,139,48,27,166,77,146,158,231,83,111,229,122,60,211,133,230,220,105,92,41,55,46,245,40,244,102,143,54,65,25,63,161,1,216,80,73,209,76,132,187,208,89,18,169,200,196,135,130,116,188,159,86,164,100,109,198,173,186,3,64,52,217,226,250,124,123,5,202,38,147,118,126,255,82,85,212,207,206,59,227,47,16,58,17,182,189,28,42,223,183,170,213,119,248,152,2,44,154,163,70,221,153,101,155,167,43,172,9,129,22,39,253,19,98,108,110,79,113,224,232,178,185,112,104,218,246,97,228,251,34,242,193,238,210,144,12,191,179,162,241,81,51,145,235,249,14,239,107,49,192,214,31,181,199,106,157,184,84,204,176,115,121,50,45,127,4,150,254,138,236,205,93,222,114,67,29,24,72,243,141,128,195,78,66,215,61,156,180],sC=new Array(512),rC=new Array(512),e6=function(e){e>0&&e<1&&(e*=65536),e=Math.floor(e),e<256&&(e|=e<<8);for(var t=0;t<256;t++){var n;t&1?n=iC[t]^e&255:n=iC[t]^e>>8&255,sC[t]=sC[t+256]=n,rC[t]=rC[t+256]=$H[n%12]}};e6(0);function t6(i){if(typeof i=="number")i=Math.abs(i);else if(typeof i=="string"){var e=i;i=0;for(var t=0;t<e.length;t++)i=(i+(t+1)*(e.charCodeAt(t)%96))%2147483647}return i===0&&(i=311),i}function aC(i){var e=t6(i);return function(){var t=e*48271%2147483647;return e=t,t/2147483647}}var n6=function i(e){var t=this;L3(this,i),F0(this,"seed",0),F0(this,"init",function(n){t.seed=n,t.value=aC(n)}),F0(this,"value",aC(this.seed)),this.init(e)};new n6(Math.random());const i6=q.createContext(null),oC=i=>(i.getAttributes()&2)===2,P3=q.memo(q.forwardRef(({children:i,camera:e,scene:t,resolutionScale:n,enabled:s=!0,renderPri
4112ority:a=1,autoClear:l=!0,depthBuffer:u,enableNormalPass:h,stencilBuffer:p,multisampling:m=8,frameBufferType:v=Pd},x)=>{const{gl:_,scene:A,camera:R,size:w}=Gc(),E=t||A,D=e||R,[L,P,G]=q.useMemo(()=>{const X=new Vk(_,{depthBuffer:u,stencilBuffer:p,multisampling:m,frameBufferType:v});X.addPass(new D3(E,D));let z=null,k=null;return h&&(k=new QH(E,D),k.enabled=!1,X.addPass(k),n!==void 0&&(z=new XH({normalBuffer:k.texture,resolutionScale:n}),z.enabled=!1,X.addPass(z))),[X,k,z]},[D,_,u,p,m,v,E,h,n]);q.useEffect(()=>L?.setSize(w.width,w.height),[L,w]),ps((X,z)=>{if(s){const k=_.autoClear;_.autoClear=l,p&&!l&&_.clearStencil(),L.render(z),_.autoClear=k}},s?a:0);const H=q.useRef(null);q.useLayoutEffect(()=>{const X=[],z=H.current.__r3f;if(z&&L){const k=z.children;for(let ie=0;ie<k.length;ie++){const ve=k[ie].object;if(ve instanceof uA){const J=[ve];if(!oC(ve)){let ae=null;for(;(ae=k[ie+1]?.object)instanceof uA&&!oC(ae);)J.push(ae),ie++}const le=new ZH(D,...J);X.push(le)}else ve instanceof Ga&&X.push(ve)}for(const ie of X)L?.addPass(ie);P&&(P.enabled=!0),G&&(G.enabled=!0)}return()=>{for(const k of X)L?.removePass(k);P&&(P.enabled=!1),G&&(G.enabled=!1)}},[L,i,D,P,G]),q.useEffect(()=>{const X=_.toneMapping;return _.toneMapping=ol,()=>{_.toneMapping=X}},[_]);const F=q.useMemo(()=>({composer:L,normalPass:P,downSamplingPass:G,resolutionScale:n,camera:D,scene:E}),[L,P,G,n,D,E]);return q.useImperativeHandle(x,()=>L,[L]),b.jsx(i6.Provider,{value:F,children:b.jsx("group",{ref:H,children:i})})}));let s6=0;const lC=new WeakMap,r6=(i,e)=>function({blendFunction:t=e?.blendFunction,opacity:n=e?.opacity,...s}){let a=lC.get(i);if(!a){const h=`@react-three/postprocessing/${i.name}-${s6++}`;S3({[h]:i}),lC.set(i,a=h)}const l=Gc(h=>h.camera),u=ld.useMemo(()=>[...e?.args??[],...s.args??[{...e,...s}]],[JSON.stringify(s)]);return b.jsx(a,{camera:l,"blendMode-blendFunction":t,"blendMode-opacity-value":n,...s,args:u})},O3=r6(GH,{blendFunction:0});function g_(){return g_=Object.assign?Object.assign.bind():function(i){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var n in t)({}).hasOwnProperty.call(t,n)&&(i[n]=t[n])}return i},g_.apply(null,arguments)}const _g=new se,vM=new se,a6=new se,cC=new st;function o6(i,e,t){const n=_g.setFromMatrixPosition(i.matrixWorld);n.project(e);const s=t.width/2,a=t.height/2;return[n.x*s+s,-(n.y*a)+a]}function l6(i,e){const t=_g.setFromMatrixPosition(i.matrixWorld),n=vM.setFromMatrixPosition(e.matrixWorld),s=t.sub(n),a=e.getWorldDirection(a6);return s.angleTo(a)>Math.PI/2}function c6(i,e,t,n){const s=_g.setFromMatrixPosition(i.matrixWorld),a=s.clone();a.project(e),cC.set(a.x,a.y),t.setFromCamera(cC,e);const l=t.intersectObjects(n,!0);if(l.length){const u=l[0].distance;return s.distanceTo(t.ray.origin)<u}return!0}function u6(i,e){if(e instanceof Vc)return e.zoom;if(e instanceof Ds){const t=_g.setFromMatrixPosition(i.matrixWorld),n=vM.setFromMatrixPosition(e.matrixWorld),s=e.fov*Math.PI/180,a=t.distanceTo(n);return 1/(2*Math.tan(s/2)*a)}else return 1}function f6(i,e,t){if(e instanceof Ds||e instanceof Vc){const n=_g.setFromMatrixPosition(i.matrixWorld),s=vM.setFromMatrixPosition(e.matrixWorld),a=n.distanceTo(s),l=(t[1]-t[0])/(e.far-e.near),u=t[1]-l*e.far;return Math.round(l*a+u)}}const fA=i=>Math.abs(i)<1e-10?0:i;function N3(i,e,t=""){let n="matrix3d(";for(let s=0;s!==16;s++)n+=fA(e[s]*i.elements[s])+(s!==15?",":")");return t+n}const d6=(i=>e=>N3(e,i))([1,-1,1,1,1,-1,1,1,1,-1,1,1,1,-1,1,1]),h6=(i=>(e,t)=>N3(e,i(t),"translate(-50%,-50%)"))(i=>[1/i,1/i,1/i,1,-1/i,-1/i,-1/i,-1,1/i,1/i,1/i,1,1,1,1,1]);function p6(i){return i&&typeof i=="object"&&"current"in i}const yM=q.forwardRef(({children:i,eps:e=.001,style:t,className:n,prepend:s,center:a,fullscreen:l,portal:u,distanceFactor:h,sprite:p=!1,transform:m=!1,occlude:v,onOcclude:x,castShadow:_,receiveShadow:A,material:R,geometry:w,zIndexRange:E=[16777271,0],calculatePosition:D=o6,as:L="div",wrapperClass:P,pointerEvents:G="auto",...H},F)=>{const{gl:X,camera:z,scene:k,size:ie,raycaster:ve,events:J,viewport:le}=Gc(),[ae]=q.useState(()=>document.createElement(L)),W=q.useRef(null),ee=q.useRef(null),te=q.useRef(0),ue=q.useRef([0,0]),he=q.useRef(null),K=q.useRef(null),ce=u?.current||J.connected||X.domElement.parentNode,re=q.useRef(null),oe=q.useRef(!1),we=q.useMemo(()=>v&&v!=="blending"||Array.isArray(v)&&v.length&&p6(v[0]),[v]);q.useLayoutEffect(()=>{const ct=X.domElement;v&&v==="blending"?(ct.style.zIndex=`${Math.floor(E[0]/2)}`,ct.style.position="absolute",ct.style.pointerEvents="none"):(ct.style.zIndex=null,ct.style.position=null,ct.style.pointerEvents=null)},[v]),q.useLayoutEffect(()=>{if(ee.current){const ct=W.current=sR.createRoot(ae);
vendor: 2,246 bytes, line 4112
4112if(k.updateMatrixWorld(),m)ae.style.cssText="position:absolute;top:0;left:0;pointer-events:none;overflow:hidden;";else{const vt=D(ee.current,z,ie);ae.style.cssText=`position:absolute;top:0;left:0;transform:translate3d(${vt[0]}px,${vt[1]}px,0);transform-origin:0 0;`}return ce&&(s?ce.prepend(ae):ce.appendChild(ae)),()=>{ce&&ce.removeChild(ae),ct.unmount()}}},[ce,m]),q.useLayoutEffect(()=>{P&&(ae.className=P)},[P]);const Be=q.useMemo(()=>m?{position:"absolute",top:0,left:0,width:ie.width,height:ie.height,transformStyle:"preserve-3d",pointerEvents:"none"}:{position:"absolute",transform:a?"translate3d(-50%,-50%,0)":"none",...l&&{top:-ie.height/2,left:-ie.width/2,width:ie.width,height:ie.height},...t},[t,a,l,ie,m]),pe=q.useMemo(()=>({position:"absolute",pointerEvents:G}),[G]);q.useLayoutEffect(()=>{if(oe.current=!1,m){var ct;(ct=W.current)==null||ct.render(q.createElement("div",{ref:he,style:Be},q.createElement("div",{ref:K,style:pe},q.createElement("div",{ref:F,className:n,style:t,children:i}))))}else{var vt;(vt=W.current)==null||vt.render(q.createElement("div",{ref:F,style:Be,className:n,children:i}))}});const Re=q.useRef(!0);ps(ct=>{if(ee.current){z.updateMatrixWorld(),ee.current.updateWorldMatrix(!0,!1);const vt=m?ue.current:D(ee.current,z,ie);if(m||Math.abs(te.current-z.zoom)>e||Math.abs(ue.current[0]-vt[0])>e||Math.abs(ue.current[1]-vt[1])>e){const qt=l6(ee.current,z);let Wt=!1;we&&(Array.isArray(v)?Wt=v.map(Qe=>Qe.current):v!=="blending"&&(Wt=[k]));const de=Re.current;if(Wt){const Qe=c6(ee.current,z,ve,Wt);Re.current=Qe&&!qt}else Re.current=!qt;de!==Re.current&&(x?x(!Re.current):ae.style.display=Re.current?"block":"none");const an=Math.floor(E[0]/2),$e=v?we?[E[0],an]:[an-1,0]:E;if(ae.style.zIndex=`${f6(ee.current,z,$e)}`,m){const[Qe,Ye]=[ie.width/2,ie.height/2],pt=z.projectionMatrix.elements[5]*Ye,{isOrthographicCamera:Ve,top:ne,left:V,bottom:Se,right:Ie}=z,et=d6(z.matrixWorldInverse),Fe=Ve?`scale(${pt})translate(${fA(-(Ie+V)/2)}px,${fA((ne+Se)/2)}px)`:`translateZ(${pt}px)`;let Rt=ee.current.matrixWorld;p&&(Rt=z.matrixWorldInverse.clone().transpose().copyPosition(Rt).scale(ee.current.scale),Rt.elements[3]=Rt.elements[7]=Rt.elements[11]=0,Rt.elements[15]=1),ae.style.width=ie.width+"px",ae.style.height=ie.he
4112ight+"px",ae.style.perspective=Ve?"":`${pt}px`,he.current&&K.current&&(he.current.style.transform=`${Fe}${et}translate(${Qe}px,${Ye}px)`,K.current.style.transform=h6(Rt,1/((h||10)/400)))}else{const Qe=h===void 0?1:u6(ee.current,z)*h;ae.style.transform=`translate3d(${vt[0]}px,${vt[1]}px,0) scale(${Qe})`}ue.current=vt,te.current=z.zoom}}if(!we&&re.current&&!oe.current)if(m){if(he.current){const vt=he.current.children[0];if(vt!=null&&vt.clientWidth&&vt!=null&&vt.clientHeight){const{isOrthographicCamera:qt}=z;if(qt||w)H.scale&&(Array.isArray(H.scale)?H.scale instanceof se?re.current.scale.copy(H.scale.clone().divideScalar(1)):re.current.scale.set(1/H.scale[0],1/H.scale[1],1/H.scale[2]):re.current.scale.setScalar(1/H.scale));else{const Wt=(h||10)/400,de=vt.clientWidth*Wt,an=vt.clientHeight*Wt;re.current.scale.set(de,an,1)}oe.current=!0}}}else{const vt=ae.children[0];if(vt!=null&&vt.clientWidth&&vt!=null&&vt.clientHeight){const qt=1/le.factor,Wt=vt.clientWidth*qt,de=vt.clientHeight*qt;re.current.scale.set(Wt,de,1),oe.current=!0}re.current.lookAt(ct.camera.position)}});const lt=q.useMemo(()=>({vertexShader:m?void 0:`
4113          /*
4114            This shader is from the THREE's SpriteMaterial.
4115            We need to turn the backing plane into a Sprite
4116            (make it always face the camera) if "transfrom"
4117            is false.
4118          */
4119          #include <common>
4120
4121          void main() {
4122            vec2 center = vec2(0., 1.);
4123            float rotation = 0.0;
4124
4125            // This is somewhat arbitrary, but it seems to work well
4126            // Need to figure out how to derive this dynamically if it even matters
4127            float size = 0.03;
4128
4129            vec4 mvPosition = modelViewMatrix * vec4( 0.0, 0.0, 0.0, 1.0 );
4130            vec2 scale;
4131            scale.x = length( vec3( modelMatrix[ 0 ].x, modelMatrix[ 0 ].y, modelMatrix[ 0 ].z ) );
4132            scale.y = length( vec3( modelMatrix[ 1 ].x, modelMatrix[ 1 ].y, modelMatrix[ 1 ].z ) );
4133
4134            bool isPerspective = isPerspectiveMatrix( projectionMatrix );
4135            if ( isPerspective ) scale *= - mvPosition.z;
4136
4137            vec2 alignedPosition = ( position.xy - ( center - vec2( 0.5 ) ) ) * scale * size;
4138            vec2 rotatedPosition;
4139            rotatedPosition.x = cos( rotation ) * alignedPosition.x - sin( rotation ) * alignedPosition.y;
4140            rotatedPosition.y = sin( rotation ) * alignedPosition.x + cos( rotation ) * alignedPosition.y;
4141            mvPosition.xy += rotatedPosition;
4142
4143            gl_Position = projectionMatrix * mvPosition;
4144          }
4145      `,fragmentShader:`
4146        void main() {
4147          gl_FragColor = vec4(0.0, 0.0, 0.0, 0.0);
4148        }
4149      `}),[m]);return q.createElement("group",g_({},H,{ref:ee}),v&&!we&&q.createElement("mesh",{castShadow:_,receiveShadow:A,ref:re},w||q.createElement("planeGeometry",null),R||q.createElement("shaderMaterial",{side:Gs,vertexShader:lt.vertexShader,fragmentShader:lt.fragmentShader})))}),U3=q.createContext(null);function m6({map:i,children:e,onChange:t,domElement:n}){const s=i.map(h=>h.name+h.keys).join("-"),a=q.useMemo(()=>jc(NL(()=>i.reduce((h,p)=>({...h,[p.name]:!1}),{}))),[s]),l=q.useMemo(()=>[a.subscribe,a.getState,a],[s]),u=a.setState;return q.useEffect(()=>{const p=i.map(({name:_,keys:A,up:R})=>({keys:A,up:R,fn:w=>{u({[_]:w}),t&&t(_,w,l[1]())}})).reduce((_,{keys:A,fn:R,up:w=!0})=>(A.forEach(E=>_[E]={fn:R,pressed:!1,up:w}),_),{}),m=({key:_,code:A})=>{const R=p[_]||p[A];if(!R)return;const{fn:w,pressed:E,up:D}=R;R.pressed=!0,(D||!E)&&w(!0)},v=({key:_,code:A})=>{const R=p[_]||p[A];if(!R)return;const{fn:w,up:E}=R;R.pressed=!1,E&&w(!1)},x=n||window;return x.addEventListener("keydown",m,{passive:!0}),x.addEventListener("keyup",v,{passive:!0}),()=>{x.removeEventListener("keydown",m),x.removeEventListener("keyup",v)}},[n,s]),q.createElement(U3.Provider,{value:l,children:e})}function g6(i){const[e,t,n]=q.useContext(U3);return[e,t]}const v6=parseInt($u.replace(/\D+/g,""));function uC(i,e){if(e===WB)return console.warn("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Geometry already defined as triangles."),i;if(e===l_||e===PA){let t=i.getIndex();if(t===null){const l=[],u=i.getAttribute("position");if(u!==void 0){for(let h=0;h<u.count;h++)l.push(h);i.setIndex(l),t=i.getIndex()}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Undefined position attribute. Processing not possible."),i}const n=t.count-2,s=[];if(t)if(e===l_)for(let l=1;l<=n;l++)s.push(t.getX(0)),s.push(t.getX(l)),s.push(t.getX(l+1));else for(let l=0;l<n;l++)l%2===0?(s.push(t.getX(l)),s.push(t.getX(l+1)),s.push(t.getX(l+2))):(s.push(t.getX(l+2)),s.push(t.getX(l+1)),s.push(t.getX(l)));s.length/3!==n&&console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unable to generate correct amount of triangles.");const a=i.clone();return a.setIndex(s),a.clearGroups(),a}else return console.error("THREE.BufferGeometryUtils.toTrianglesDrawMode(): Unknown draw mode:",e),i}function v_(i){if(typeof TextDecoder<"u")return new TextDecoder().decode(i);let e="";for(let t=0,n=i.length;t<n;t++)e+=String.fromCharCode(i[t]);try{return decodeURIComponent(escape(e))}catch{return e}}const pd="srgb",zc="srgb-linear",fC=3001,y6=3e3;class xM extends na{constructor(e){super(e),this.dracoLoader=null,this.ktx2Loader=null,this.meshoptDecoder=null,this.pluginCallbacks=[],this.register(function(t){return new A6(t)}),this.register(function(t){return new M6(t)}),this.register(function(t){return new L6(t)}),this.register(function(t){return new P6(t)}),this.register(function(t){return new O6(t)}
vendor: 9,803 bytes, line 4149
4149),this.register(function(t){return new T6(t)}),this.register(function(t){return new w6(t)}),this.register(function(t){return new C6(t)}),this.register(function(t){return new R6(t)}),this.register(function(t){return new S6(t)}),this.register(function(t){return new B6(t)}),this.register(function(t){return new E6(t)}),this.register(function(t){return new D6(t)}),this.register(function(t){return new I6(t)}),this.register(function(t){return new _6(t)}),this.register(function(t){return new N6(t)}),this.register(function(t){return new U6(t)})}load(e,t,n,s){const a=this;let l;if(this.resourcePath!=="")l=this.resourcePath;else if(this.path!==""){const p=Yu.extractUrlBase(e);l=Yu.resolveURL(p,this.path)}else l=Yu.extractUrlBase(e);this.manager.itemStart(e);const u=function(p){s?s(p):console.error(p),a.manager.itemError(e),a.manager.itemEnd(e)},h=new $a(this.manager);h.setPath(this.path),h.setResponseType("arraybuffer"),h.setRequestHeader(this.requestHeader),h.setWithCredentials(this.withCredentials),h.load(e,function(p){try{a.parse(p,l,function(m){t(m),a.manager.itemEnd(e)},u)}catch(m){u(m)}},n,u)}setDRACOLoader(e){return this.dracoLoader=e,this}setDDSLoader(){throw new Error('THREE.GLTFLoader: "MSFT_texture_dds" no longer supported. Please update to "KHR_texture_basisu".')}setKTX2Loader(e){return this.ktx2Loader=e,this}setMeshoptDecoder(e){return this.meshoptDecoder=e,this}register(e){return this.pluginCallbacks.indexOf(e)===-1&&this.pluginCallbacks.push(e),this}unregister(e){return this.pluginCallbacks.indexOf(e)!==-1&&this.pluginCallbacks.splice(this.pluginCallbacks.indexOf(e),1),this}parse(e,t,n,s){let a;const l={},u={};if(typeof e=="string")a=JSON.parse(e);else if(e instanceof ArrayBuffer)if(v_(new Uint8Array(e.slice(0,4)))===z3){try{l[Jn.KHR_BINARY_GLTF]=new z6(e)}catch(m){s&&s(m);return}a=JSON.parse(l[Jn.KHR_BINARY_GLTF].content)}else a=JSON.parse(v_(new Uint8Array(e)));else a=e;if(a.asset===void 0||a.asset.version[0]<2){s&&s(new Error("THREE.GLTFLoader: Unsupported asset. glTF versions >=2.0 are supported."));return}const h=new Z6(a,{path:t||this.resourcePath||"",crossOrigin:this.crossOrigin,requestHeader:this.requestHeader,manager:this.manager,ktx2Loader:this.ktx2Loader,meshoptDecoder:this.meshoptDecoder});h.fileLoader.setRequestHeader(this.requestHeader);for(let p=0;p<this.pluginCallbacks.length;p++){const m=this.pluginCallbacks[p](h);m.name||console.error("THREE.GLTFLoader: Invalid plugin found: missing name"),u[m.name]=m,l[m.name]=!0}if(a.extensionsUsed)for(let p=0;p<a.extensionsUsed.length;++p){const m=a.extensionsUsed[p],v=a.extensionsRequired||[];switch(m){case Jn.KHR_MATERIALS_UNLIT:l[m]=new b6;break;case Jn.KHR_DRACO_MESH_COMPRESSION:l[m]=new F6(a,this.dracoLoader);break;case Jn.KHR_TEXTURE_TRANSFORM:l[m]=new k6;break;case Jn.KHR_MESH_QUANTIZATION:l[m]=new H6;break;default:v.indexOf(m)>=0&&u[m]===void 0&&console.warn('THREE.GLTFLoader: Unknown extension "'+m+'".')}}h.setExtensions(l),h.setPlugins(u),h.parse(n,s)}parseAsync(e,t){const n=this;return new Promise(function(s,a){n.parse(e,t,s,a)})}}function x6(){let i={};return{get:function(e){return i[e]},add:function(e,t){i[e]=t},remove:function(e){delete i[e]},removeAll:function(){i={}}}}const Jn={KHR_BINARY_GLTF:"KHR_binary_glTF",KHR_DRACO_MESH_COMPRESSION:"KHR_draco_mesh_compression",KHR_LIGHTS_PUNCTUAL:"KHR_lights_punctual",KHR_MATERIALS_CLEARCOAT:"KHR_materials_clearcoat",KHR_MATERIALS_DISPERSION:"KHR_materials_dispersion",KHR_MATERIALS_IOR:"KHR_materials_ior",KHR_MATERIALS_SHEEN:"KHR_materials_sheen",KHR_MATERIALS_SPECULAR:"KHR_materials_specular",KHR_MATERIALS_TRANSMISSION:"KHR_materials_transmission",KHR_MATERIALS_IRIDESCENCE:"KHR_materials_iridescence",KHR_MATERIALS_ANISOTROPY:"KHR_materials_anisotropy",KHR_MATERIALS_UNLIT:"KHR_materials_unlit",KHR_MATERIALS_VOLUME:"KHR_materials_volume",KHR_TEXTURE_BASISU:"KHR_texture_basisu",KHR_TEXTURE_TRANSFORM:"KHR_texture_transform",KHR_MESH_QUANTIZATION:"KHR_mesh_quantization",KHR_MATERIALS_EMISSIVE_STRENGTH:"KHR_materials_emissive_strength",EXT_MATERIALS_BUMP:"EXT_materials_bump",EXT_TEXTURE_WEBP:"EXT_texture_webp",EXT_TEXTURE_AVIF:"EXT_texture_avif",EXT_MESHOPT_COMPRESSION:"EXT_meshopt_compression",EXT_MESH_GPU_INSTANCING:"EXT_mesh_gpu_instancing"};class _6{constructor(e){this.parser=e,this.name=Jn.KHR_LIGHTS_PUNCTUAL,this.cache={refs:{},uses:{}}}_markDefs(){const e=this.parser,t=this.parser.json.nodes||[];for(let n=0,s=t.length;n<s;n++){const a=t[n];a.extensions&&a.extensions[this.name]&&a.extensions[this.name].light!==void 0&&e._addNodeRef(this.cache,a.extensions[this.name].light)}}_loadLight(e){const t=this.parser,n="light:"+e;let s=t.cache.get(n);if(s)return s;const a=t.json,h=((a.extensions&&a.extensions[this.name]||{}).lights||[])[e];let p;const m=new Pt(16777215);h.color!==void 0&&m.setRGB(h.color[0],h.color[1],h.color[2],zc);const v=h.range!==void 0?h.range:0;switch(h.type){case"directional":p=new rM(m),p.target.position.set(0,0,-1),p.add(p.target);break;case"point":p=new sM(m),p.distance=v;break;case"spot":p=new iM(m),p.distance=v,h.spot=h.spot||{},h.spot.innerConeAngle=h.spot.innerConeAngle!==void 0?h.spot.innerConeAngle:0,h.spot.outerConeAngle=h.spot.outerConeAngle!==void 0?h.spot.outerConeAngle:Math.PI/4,p.angle=h.spot.outerConeAngle,p.penumbra=1-h.spot.innerConeAngle/h.spot.outerConeAngle,p.target.position.set(0,0,-1),p.add(p.target);break;default:throw new Error("THREE.GLTFLoader: Unexpected light type: "+h.type)}return p.position.set(0,0,0),p.decay=2,Bc(p,h),h.intensity!==void 0&&(p.intensity=h.intensity),p.name=t.createUniqueName(h.name||"light_"+e),s=Promise.resolve(p),t.cache.add(n,s),s}getDependency(e,t){if(e==="light")return this._loadLight(t)}createNodeAttachment(e){const t=this,n=this.parser,a=n.json.nodes[e],u=(a.extensions&&a.extensions[this.name]||{}).light;return u===void 0?null:this._loadLight(u).then(function(h){return n._getNodeRef(t.cache,u,h)})}}class b6{constructor(){this.name=Jn.KHR_MATERIALS_UNLIT}getMaterialType(){return Kr}extendParams(e,t,n){const s=[];e.color=new Pt(1,1,1),e.opacity=1;const a=t.pbrMetallicRoughness;if(a){if(Array.isArray(a.baseColorFactor)){const l=a.baseColorFactor;e.color.setRGB(l[0],l[1],l[2],zc),e.opacity=l[3]}a.baseColorTexture!==void 0&&s.push(n.assignTexture(e,"map",a.baseColorTexture,pd))}return Promise.all(s)}}class S6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_EMISSIVE_STRENGTH}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=s.extensions[this.name].emissiveStrength;return a!==void 0&&(t.emissiveIntensity=a),Promise.resolve()}}class A6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_CLEARCOAT}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];if(l.clearcoatFactor!==void 0&&(t.clearcoat=l.clearcoatFactor),l.clearcoatTexture!==void 0&&a.push(n.assignTexture(t,"clearcoatMap",l.clearcoatTexture)),l.clearcoatRoughnessFactor!==void 0&&(t.clearcoatRoughness=l.clearcoatRoughnessFactor),l.clearcoatRoughnessTexture!==void 0&&a.push(n.assignTexture(t,"clearcoatRoughnessMap",l.clearcoatRoughnessTexture)),l.clearcoatNormalTexture!==void 0&&(a.push(n.assignTexture(t,"clearcoatNormalMap",l.clearcoatNormalTexture)),l.clearcoatNormalTexture.scale!==void 0)){const u=l.clearcoatNormalTexture.scale;t.clearcoatNormalScale=new st(u,u)}return Promise.all(a)}}class M6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_DISPERSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=s.extensions[this.name];return t.dispersion=a.dispersion!==void 0?a.dispersion:0,Promise.resolve()}}class E6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_IRIDESCENCE}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];return l.iridescenceFactor!==void 0&&(t.iridescence=l.iridescenceFactor),l.iridescenceTexture!==void 0&&a.push(n.assignTexture(t,"iridescenceMap",l.iridescenceTexture)),l.iridescenceIor!==void 0&&(t.iridescenceIOR=l.iridescenceIor),t.iridescenceThicknessRange===void 0&&(t.iridescenceThicknessRange=[100,400]),l.iridescenceThicknessMinimum!==void 0&&(t.iridescenceThicknessRange[0]=l.iridescenceThicknessMinimum),l.iridescenceThicknessMaximum!==void 0&&(t.iridescenceThicknessRange[1]=l.iridescenceThicknessMaximum),l.iridescenceThicknessTexture!==void 0&&a.push(n.assignTexture(t,"iridescenceThicknessMap",l.iridescenceThicknessTexture)),Promise.all(a)}}class T6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_SHEEN}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[];t.sheenColor=new Pt(0,0,0),t.sheenRoughness=0,t.sheen=1;const l=s.extensions[this.name];if(l.sheenColorFactor!==void 0){const u=l.sheenColorFactor;t.sheenColor.setRGB(u[0],u[1],u[2],zc)}return l.sheenRoughnessFactor!==void 0&&(t.sheenRoughness=l.sheenRoughnessFactor),l.sheenColorTexture!==void 0&&a.push(n.assignTexture(t,"sheenColorMap",l.sheenColorTexture,pd)),l.sheenRoughnessTexture!==void 0&&a.push(n.assignTexture(t,"sheenRoughnessMap",l.
vendor: 5,868 bytes, line 4149
4149sheenRoughnessTexture)),Promise.all(a)}}class w6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_TRANSMISSION}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];return l.transmissionFactor!==void 0&&(t.transmission=l.transmissionFactor),l.transmissionTexture!==void 0&&a.push(n.assignTexture(t,"transmissionMap",l.transmissionTexture)),Promise.all(a)}}class C6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_VOLUME}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];t.thickness=l.thicknessFactor!==void 0?l.thicknessFactor:0,l.thicknessTexture!==void 0&&a.push(n.assignTexture(t,"thicknessMap",l.thicknessTexture)),t.attenuationDistance=l.attenuationDistance||1/0;const u=l.attenuationColor||[1,1,1];return t.attenuationColor=new Pt().setRGB(u[0],u[1],u[2],zc),Promise.all(a)}}class R6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_IOR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const s=this.parser.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=s.extensions[this.name];return t.ior=a.ior!==void 0?a.ior:1.5,Promise.resolve()}}class B6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_SPECULAR}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];t.specularIntensity=l.specularFactor!==void 0?l.specularFactor:1,l.specularTexture!==void 0&&a.push(n.assignTexture(t,"specularIntensityMap",l.specularTexture));const u=l.specularColorFactor||[1,1,1];return t.specularColor=new Pt().setRGB(u[0],u[1],u[2],zc),l.specularColorTexture!==void 0&&a.push(n.assignTexture(t,"specularColorMap",l.specularColorTexture,pd)),Promise.all(a)}}class I6{constructor(e){this.parser=e,this.name=Jn.EXT_MATERIALS_BUMP}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];return t.bumpScale=l.bumpFactor!==void 0?l.bumpFactor:1,l.bumpTexture!==void 0&&a.push(n.assignTexture(t,"bumpMap",l.bumpTexture)),Promise.all(a)}}class D6{constructor(e){this.parser=e,this.name=Jn.KHR_MATERIALS_ANISOTROPY}getMaterialType(e){const n=this.parser.json.materials[e];return!n.extensions||!n.extensions[this.name]?null:to}extendMaterialParams(e,t){const n=this.parser,s=n.json.materials[e];if(!s.extensions||!s.extensions[this.name])return Promise.resolve();const a=[],l=s.extensions[this.name];return l.anisotropyStrength!==void 0&&(t.anisotropy=l.anisotropyStrength),l.anisotropyRotation!==void 0&&(t.anisotropyRotation=l.anisotropyRotation),l.anisotropyTexture!==void 0&&a.push(n.assignTexture(t,"anisotropyMap",l.anisotropyTexture)),Promise.all(a)}}class L6{constructor(e){this.parser=e,this.name=Jn.KHR_TEXTURE_BASISU}loadTexture(e){const t=this.parser,n=t.json,s=n.textures[e];if(!s.extensions||!s.extensions[this.name])return null;const a=s.extensions[this.name],l=t.options.ktx2Loader;if(!l){if(n.extensionsRequired&&n.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setKTX2Loader must be called before loading KTX2 textures");return null}return t.loadTextureImage(e,a.source,l)}}class P6{constructor(e){this.parser=e,this.name=Jn.EXT_TEXTURE_WEBP,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,s=n.json,a=s.textures[e];if(!a.extensions||!a.extensions[t])return null;const l=a.extensions[t],u=s.images[l.source];let h=n.textureLoader;if(u.uri){const p=n.options.manager.getHandler(u.uri);p!==null&&(h=p)}return this.detectSupport().then(function(p){if(p)return n.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: WebP required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/webp;base64,UklGRiIAAABXRUJQVlA4IBYAAAAwAQCdASoBAAEADsD+JaQAA3AAAAAA",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class O6{constructor(e){this.parser=e,this.name=Jn.EXT_TEXTURE_AVIF,this.isSupported=null}loadTexture(e){const t=this.name,n=this.parser,s=n.json,a=s.textures[e];if(!a.extensions||!a.extensions[t])return null;const l=a.extensions[t],u=s.images[l.source];let h=n.textureLoader;if(u.uri){const p=n.options.manager.getHandler(u.uri);p!==null&&(h=p)}return this.detectSupport().then(function(p){if(p)return n.loadTextureImage(e,l.source,h);if(s.extensionsRequired&&s.extensionsRequired.indexOf(t)>=0)throw new Error("THREE.GLTFLoader: AVIF required by asset but unsupported.");return n.loadTexture(e)})}detectSupport(){return this.isSupported||(this.isSupported=new Promise(function(e){const t=new Image;t.src="data:image/avif;base64,AAAAIGZ0eXBhdmlmAAAAAGF2aWZtaWYxbWlhZk1BMUIAAADybWV0YQAAAAAAAAAoaGRscgAAAAAAAAAAcGljdAAAAAAAAAAAAAAAAGxpYmF2aWYAAAAADnBpdG0AAAAAAAEAAAAeaWxvYwAAAABEAAABAAEAAAABAAABGgAAABcAAAAoaWluZgAAAAAAAQAAABppbmZlAgAAAAABAABhdjAxQ29sb3IAAAAAamlwcnAAAABLaXBjbwAAABRpc3BlAAAAAAAAAAEAAAABAAAAEHBpeGkAAAAAAwgICAAAAAxhdj
4149FDgQAMAAAAABNjb2xybmNseAACAAIABoAAAAAXaXBtYQAAAAAAAAABAAEEAQKDBAAAAB9tZGF0EgAKCBgABogQEDQgMgkQAAAAB8dSLfI=",t.onload=t.onerror=function(){e(t.height===1)}})),this.isSupported}}class N6{constructor(e){this.name=Jn.EXT_MESHOPT_COMPRESSION,this.parser=e}loadBufferView(e){const t=this.parser.json,n=t.bufferViews[e];if(n.extensions&&n.extensions[this.name]){const s=n.extensions[this.name],a=this.parser.getDependency("buffer",s.buffer),l=this.parser.options.meshoptDecoder;if(!l||!l.supported){if(t.extensionsRequired&&t.extensionsRequired.indexOf(this.name)>=0)throw new Error("THREE.GLTFLoader: setMeshoptDecoder must be called before loading compressed files");return null}return a.then(function(u){const h=s.byteOffset||0,p=s.byteLength||0,m=s.count,v=s.byteStride,x=new Uint8Array(u,h,p);return l.decodeGltfBufferAsync?l.decodeGltfBufferAsync(m,v,x,s.mode,s.filter).then(function(_){return _.buffer}):l.ready.then(function(){const _=new ArrayBuffer(m*v);return l.decodeGltfBuffer(new Uint8Array(_),m,v,x,s.mode,s.filter),_})})}else return null}}class U6{constructor(e){this.name=Jn.EXT_MESH_GPU_INSTANCING,this.parser=e}createNodeMesh(e){const t=this.parser.json,n=t.nodes[e];if(!n.extensions||!n.extensions[this.name]||n.mesh===void 0)return null;const s=t.meshes[n.mesh];for(const p of s.primitives)if(p.mode!==Bo.TRIANGLES&&p.mode!==Bo.TRIANGLE_STRIP&&p.mode!==Bo.TRIANGLE_FAN&&p.mode!==void 0)return null;const l=n.extensions[this.name].attributes,u=[],h={};for(const p in l)u.push(this.parser.getDependency("accessor",l[p]).then(m=>(h[p]=m,h[p])));return u.length<1?null:(u.push(this.parser.createNodeMesh(e)),Promise.all(u).then(p=>{const m=p.pop(),v=m.isGroup?m.children:[m],x=p[0].count,_=[];for(const A of v){const R=new dn,w=new se,E=new gr,D=new se(1,1,1),L=new HA(A.geometry,A.material,x);for(let P=0;P<x;P++)h.TRANSLATION&&w.fromBufferAttribute(h.TRANSLATION,P),h.ROTATION&&E.fromBufferAttribute(h.ROTATION,P),h.SCALE&&D.fromBufferAttribute(h.SCALE,P),L.setMatrixAt(P,R.compose(w,E,D));for(const P in h)if(P==="_COLOR_0"){const G=h[P];L.instanceColor=new wd(G.array,G.itemSize,G.normalized)}else P!=="TRANSLATION"&&P!=="ROTATION"&&P!=="SCALE"&&A.geometry.setAttribute(P,h[P]);li.prototype.copy.call(L,A),this.parser.assignFinalMaterial(L),_.push(L)}return m.isGroup?(m.clear(),m.add(..._),m):_[0]}))}}const z3="glTF",b0=12,dC={JSON:1313821514,BIN:5130562};class z6{constructor(e){this.name=Jn.KHR_BINARY_GLTF,this.content=null,this.body=null;const t=new DataView(e,0,b0);if(this.header={magic:v_(new Uint8Array(e.slice(0,4))),version:t.getUint32(4,!0),length:t.getUint32(8,!0)},this.header.magic!==z3)throw new Error("THREE.GLTFLoader: Unsupported glTF-Binary header.");if(this.header.version<2)throw new Error("THREE.GLTFLoader: Legacy binary file detected.");const n=this.header.length-b0,s=new DataView(e,b0);let a=0;for(;a<n;){const l=s.getUint32(a,!0);a+=4;const u=s.getUint32(a,!0);if(a+=4,u===dC.JSON){const h=new Uint8Array(e,b0+a,l);this.content=v_(h)}else if(u===dC.BIN){const h=b0+a;this.body=e.slice(h,h+l)}a+=l}if(this.content===null)throw new Error("THREE.GLTFLoader: JSON content not found.")}}class F6{constructor(e,t){if(!t)throw new Error("THREE.GLTFLoader: No DRACOLoader instance provided.");this.name=Jn.KHR_DRACO_MESH_COMPRESSION,this.json=e,this.dracoLoader=t,this.dracoLoader.preload()}decodePrimitive(e,t){const n=this.json,s=this.dracoLoader,a=e.extensions[this.name].bufferView,l=e.extensions[this.name].attributes,u={},h={},p={};for(const m in l){const v=dA[m]||m.toLowerCase();u[v]=l[m]}for(const m in e.attributes){const v=dA[m]||m.toLowerCase();if(l[m]!==void 0){const x=n.accessors[e.attributes[m]],_=yp[x.componentType];p[v]=_.name,h[v]=x.normalized===!0}}return t.getDependency("bufferView",a).then(function(m){return new Promise(function(v,x){s.decodeDracoFile(m,function(_){for(const A in _.attributes){const R=_.attributes[A],w=h[A];w!==void 0&&(R.normalized=w)}v(_)},u,p,zc,x)})})}}class k6{constructor(){this.name=Jn.KHR_TEXTURE_TRANSFORM}extendTexture(e,t){return(t.texCoord===void 0||t.texCoord===e.channel)&&t.offset===void 0&&t.rotation===void 0&&t.scale===void 0||(e=e.clone(),t.texCoord!==void 0&&(e.channel=t.texCoord),t.offset!==void 0&&e.offset.fromArray(t.offset),t.rotation!==void 0&&(e.rotation=t.rotation),t.scale!==void 0&&e.repeat.fromArray(t.scale),e.needsUpdate=!0),e}}
vendor: 32,226 bytes, lines 4149-4215
4149class H6{constructor(){this.name=Jn.KHR_MESH_QUANTIZATION}}class F3 extends Op{constructor(e,t,n,s){super(e,t,n,s)}copySampleValue_(e){const t=this.resultBuffer,n=this.sampleValues,s=this.valueSize,a=e*s*3+s;for(let l=0;l!==s;l++)t[l]=n[a+l];return t}interpolate_(e,t,n,s){const a=this.resultBuffer,l=this.sampleValues,u=this.valueSize,h=u*2,p=u*3,m=s-t,v=(n-t)/m,x=v*v,_=x*v,A=e*p,R=A-p,w=-2*_+3*x,E=_-x,D=1-w,L=E-x+v;for(let P=0;P!==u;P++){const G=l[R+P+u],H=l[R+P+h]*m,F=l[A+P+u],X=l[A+P]*m;a[P]=D*G+L*H+w*F+E*X}return a}}const G6=new gr;class j6 extends F3{interpolate_(e,t,n,s){const a=super.interpolate_(e,t,n,s);return G6.fromArray(a).normalize().toArray(a),a}}const Bo={POINTS:0,LINES:1,LINE_LOOP:2,LINE_STRIP:3,TRIANGLES:4,TRIANGLE_STRIP:5,TRIANGLE_FAN:6},yp={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array},hC={9728:Ls,9729:as,9984:I_,9985:gp,9986:cd,9987:Do},pC={33071:Ka,33648:bp,10497:Zu},_1={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},dA={POSITION:"position",NORMAL:"normal",TANGENT:"tangent",...v6>=152?{TEXCOORD_0:"uv",TEXCOORD_1:"uv1",TEXCOORD_2:"uv2",TEXCOORD_3:"uv3"}:{TEXCOORD_0:"uv",TEXCOORD_1:"uv2"},COLOR_0:"color",WEIGHTS_0:"skinWeight",JOINTS_0:"skinIndex"},ku={scale:"scale",translation:"position",rotation:"quaternion",weights:"morphTargetInfluences"},V6={CUBICSPLINE:void 0,LINEAR:Ep,STEP:Mp},b1={OPAQUE:"OPAQUE",MASK:"MASK",BLEND:"BLEND"};function W6(i){return i.DefaultMaterial===void 0&&(i.DefaultMaterial=new rl({color:16777215,emissive:0,metalness:1,roughness:1,transparent:!1,depthTest:!0,side:cl})),i.DefaultMaterial}function sd(i,e,t){for(const n in t.extensions)i[n]===void 0&&(e.userData.gltfExtensions=e.userData.gltfExtensions||{},e.userData.gltfExtensions[n]=t.extensions[n])}function Bc(i,e){e.extras!==void 0&&(typeof e.extras=="object"?Object.assign(i.userData,e.extras):console.warn("THREE.GLTFLoader: Ignoring primitive type .extras, "+e.extras))}function X6(i,e,t){let n=!1,s=!1,a=!1;for(let p=0,m=e.length;p<m;p++){const v=e[p];if(v.POSITION!==void 0&&(n=!0),v.NORMAL!==void 0&&(s=!0),v.COLOR_0!==void 0&&(a=!0),n&&s&&a)break}if(!n&&!s&&!a)return Promise.resolve(i);const l=[],u=[],h=[];for(let p=0,m=e.length;p<m;p++){const v=e[p];if(n){const x=v.POSITION!==void 0?t.getDependency("accessor",v.POSITION):i.attributes.position;l.push(x)}if(s){const x=v.NORMAL!==void 0?t.getDependency("accessor",v.NORMAL):i.attributes.normal;u.push(x)}if(a){const x=v.COLOR_0!==void 0?t.getDependency("accessor",v.COLOR_0):i.attributes.color;h.push(x)}}return Promise.all([Promise.all(l),Promise.all(u),Promise.all(h)]).then(function(p){const m=p[0],v=p[1],x=p[2];return n&&(i.morphAttributes.position=m),s&&(i.morphAttributes.normal=v),a&&(i.morphAttributes.color=x),i.morphTargetsRelative=!0,i})}function q6(i,e){if(i.updateMorphTargets(),e.weights!==void 0)for(let t=0,n=e.weights.length;t<n;t++)i.morphTargetInfluences[t]=e.weights[t];if(e.extras&&Array.isArray(e.extras.targetNames)){const t=e.extras.targetNames;if(i.morphTargetInfluences.length===t.length){i.morphTargetDictionary={};for(let n=0,s=t.length;n<s;n++)i.morphTargetDictionary[t[n]]=n}else console.warn("THREE.GLTFLoader: Invalid extras.targetNames length. Ignoring names.")}}function Y6(i){let e;const t=i.extensions&&i.extensions[Jn.KHR_DRACO_MESH_COMPRESSION];if(t?e="draco:"+t.bufferView+":"+t.indices+":"+S1(t.attributes):e=i.indices+":"+S1(i.attributes)+":"+i.mode,i.targets!==void 0)for(let n=0,s=i.targets.length;n<s;n++)e+=":"+S1(i.targets[n]);return e}function S1(i){let e="";const t=Object.keys(i).sort();for(let n=0,s=t.length;n<s;n++)e+=t[n]+":"+i[t[n]]+";";return e}function hA(i){switch(i){case Int8Array:return 1/127;case Uint8Array:return 1/255;case Int16Array:return 1/32767;case Uint16Array:return 1/65535;default:throw new Error("THREE.GLTFLoader: Unsupported normalized accessor component type.")}}function J6(i){return i.search(/\.jpe?g($|\?)/i)>0||i.search(/^data\:image\/jpeg/)===0?"image/jpeg":i.search(/\.webp($|\?)/i)>0||i.search(/^data\:image\/webp/)===0?"image/webp":"image/png"}const K6=new dn;class Z6{constructor(e={},t={}){this.json=e,this.extensions={},this.plugins={},this.options=t,this.cache=new x6,this.associations=new Map,this.primitiveCache={},this.nodeCache={},this.meshCache={refs:{},uses:{}},this.cameraCache={refs:{},uses:{}},this.lightCache={refs:{},uses:{}},this.sourceCache={},this.textureCache={},this.nodeNamesUsed={};let n=!1,s=!1,a=-1;typeof navigator<"u"&&typeof navigator.userAgent<"u"&&(n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)===!0,s=navigator.userAgent.indexOf("Firefox")>-1,a=s?navigator.userAgent.match(/Firefox\/([0-9]+)\./)[1]:-1),typeof createImageBitmap>"u"||n||s&&a<98?this.textureLoader=new zI(this.options.manager):this.textureLoader=new XI(this.options.manager),this.textureLoader.setCrossOrigin(this.options.crossOrigin),this.textureLoader.setRequestHeader(this.options.requestHeader),this.fileLoader=new $a(this.options.manager),this.fileLoader.setResponseType("arraybuffer"),this.options.crossOrigin==="use-credentials"&&this.fileLoader.setWithCredentials(!0)}setExtensions(e){this.extensions=e}setPlugins(e){this.plugins=e}parse(e,t){const n=this,s=this.json,a=this.extensions;this.cache.removeAll(),this.nodeCache={},this._invokeAll(function(l){return l._markDefs&&l._markDefs()}),Promise.all(this._invokeAll(function(l){return l.beforeRoot&&l.beforeRoot()})).then(function(){return Promise.all([n.getDependencies("scene"),n.getDependencies("animation"),n.getDependencies("camera")])}).then(function(l){const u={scene:l[0][s.scene||0],scenes:l[0],animations:l[1],cameras:l[2],asset:s.asset,parser:n,userData:{}};return sd(a,u,s),Bc(u,s),Promise.all(n._invokeAll(function(h){return h.afterRoot&&h.afterRoot(u)})).then(function(){for(const h of u.scenes)h.updateMatrixWorld();e(u)})}).catch(t)}_markDefs(){const e=this.json.nodes||[],t=this.json.skins||[],n=this.json.meshes||[];for(let s=0,a=t.length;s<a;s++){const l=t[s].joints;for(let u=0,h=l.length;u<h;u++)e[l[u]].isBone=!0}for(let s=0,a=e.length;s<a;s++){const l=e[s];l.mesh!==void 0&&(this._addNodeRef(this.meshCache,l.mesh),l.skin!==void 0&&(n[l.mesh].isSkinnedMesh=!0)),l.camera!==void 0&&this._addNodeRef(this.cameraCache,l.camera)}}_addNodeRef(e,t){t!==void 0&&(e.refs[t]===void 0&&(e.refs[t]=e.uses[t]=0),e.refs[t]++)}_getNodeRef(e,t,n){if(e.refs[t]<=1)return n;const s=n.clone(),a=(l,u)=>{const h=this.associations.get(l);h!=null&&this.associations.set(u,h);for(const[p,m]of l.children.entries())a(m,u.children[p])};return a(n,s),s.name+="_instance_"+e.uses[t]++,s}_invokeOne(e){const t=Object.values(this.plugins);t.push(this);for(let n=0;n<t.length;n++){const s=e(t[n]);if(s)return s}return null}_invokeAll(e){const t=Object.values(this.plugins);t.unshift(this);const n=[];for(let s=0;s<t.length;s++){const a=e(t[s]);a&&n.push(a)}return n}getDependency(e,t){const n=e+":"+t;let s=this.cache.get(n);if(!s){switch(e){case"scene":s=this.loadScene(t);break;case"node":s=this._invokeOne(function(a){return a.loadNode&&a.loadNode(t)});break;case"mesh":s=this._invokeOne(function(a){return a.loadMesh&&a.loadMesh(t)});break;case"accessor":s=this.loadAccessor(t);break;case"bufferView":s=this._invokeOne(function(a){return a.loadBufferView&&a.loadBufferView(t)});break;case"buffer":s=this.loadBuffer(t);break;case"material":s=this._invokeOne(function(a){return a.loadMaterial&&a.loadMaterial(t)});break;case"texture":s=this._invokeOne(function(a){return a.loadTexture&&a.loadTexture(t)});break;case"skin":s=this.loadSkin(t);break;case"animation":s=this._invokeOne(function(a){return a.loadAnimation&&a.loadAnimation(t)});break;case"camera":s=this.loadCamera(t);break;default:if(s=this._invokeOne(function(a){return a!=this&&a.getDependency&&a.getDependency(e,t)}),!s)throw new Error("Unknown type: "+e);break}this.cache.add(n,s)}return s}getDependencies(e){let t=this.cache.get(e);if(!t){const n=this,s=this.json[e+(e==="mesh"?"es":"s")]||[];t=Promise.all(s.map(function(a,l){return n.getDependency(e,l)})),this.cache.add(e,t)}return t}loadBuffer(e){const t=this.json.buffers[e],n=this.fileLoader;if(t.type&&t.type!=="arraybuffer")throw new Error("THREE.GLTFLoader: "+t.type+" buffer type is not supported.");if(t.uri===void 0&&e===0)return Promise.resolve(this.extensions[Jn.KHR_BINARY_GLTF].body);const s=this.options;return new Promise(function(a,l){n.load(Yu.resolveURL(t.uri,s.path),a,void 0,function(){l(new Error('THREE.GLTFLoader: Failed to load buffer "'+t.uri+'".'))})})}loadBufferView(e){const t=this.json.bufferViews[e];return this.getDependency("buffer",t.buffer).then(function(n){const s=t.byteLength||0,a=t.byteOffset||0;return n.slice(a,a+s)})}loadAccessor(e){const t=this,n=this.json,s=this.json.accessors[e];if(s.bufferView===void 0&&s.sparse===void 0){const l=_1[s.type],u=yp[s.componentType],h=s.normalized===!0,p=new u(s.count*l);return Promise.resolve(new ci(p,l,h))}const a=[];return s.bufferView!==void 0?a.push(this.getDependency("bufferView",s.bufferView)):a.push(null),s.sparse!==void 0&&(a.push(this.getDependency("bufferView",s.sparse.indices.bufferView)),a.push(this.getDependency("bufferView",s.sparse.values.bufferView))),Promise.all(a).then(function(l){const u=l[0],h=_1[s.type],p=yp[s.componentType],m=p.BYTES_PER_ELEMENT,v=m*h,x=s.byteOffset||0,_=s.bufferView!==void 0?n.bufferViews[s.bufferView].byteStride:void 0,A=s.normalized===!0;let R,w;if(_&&_!==v){const E=Math.floor(x/_),D="InterleavedBuffer:"+s.bufferView+":"+s.componentType+":"+E+":"+s.count;let L=t.cache.get(D);L||(R=new p(u,E*_,s.count*_/m),L=new fg(R,_/m),t.cache.add(D,L)),w=new Qu(L,h,x%_/m,A)}else u===null?R=new p(s.count*h):R=new p(u,x,s.count*h),w=new ci(R,h,A);if(s.sparse!==void 0){const E=_1.SCALAR,D=yp[s.sparse.indices.componentType],L=s.sparse.indices.byteOffset||0,P=s.sparse.values.byteOffset||0,G=new D(l[1],L,s.sparse.count*E),H=new p(l[2],P,s.sparse.count*h);u!==null&&(w=new ci(w.array.slice(),w.itemSize,w.normalized));for(let F=0,X=G.length;F<X;F++){const z=G[F];if(w.setX(z,H[F*h]),h>=2&&w.setY(z,H[F*h+1]),h>=3&&w.setZ(z,H[F*h+2]),h>=4&&w.setW(z,H[F*h+3]),h>=5)throw new Error("THREE.GLTFLoader: Unsupported itemSize in sparse BufferAttribute.")}}return w})}loadTexture(e){const t=this.json,n=this.options,a=t.textures[e].source,l=t.images[a];let u=this.textureLoader;if(l.uri){const h=n.manager.getHandler(l.uri);h!==null&&(u=h)}return this.loadTextureImage(e,a,u)}loadTextureImage(e,t,n){const s=this,a=this.json,l=a.textures[e],u=a.images[t],h=(u.uri||u.bufferView)+":"+l.sampler;if(this.textureCache[h])return this.textureCache[h];const p=this.loadImageSource(t,n).then(function(m){m.flipY=!1,m.name=l.name||u.name||"",m.name===""&&typeof u.uri=="string"&&u.uri.startsWith("data:image/")===!1&&(m.name=u.uri);const x=(a.samplers||{})[l.sampler]||{};return m.magFilter=hC[x.magFilter]||as,m.minFilter=hC[x.minFilter]||Do,m.wrapS=pC[x.wrapS]||Zu,m.wrapT=pC[x.wrapT]||Zu,s.associations.set(m,{textures:e}),m}).catch(function(){return null});return this.textureCache[h]=p,p}loadImageSource(e,t){const n=this,s=this.json,a=this.options;if(this.sourceCache[e]!==void 0)return this.sourceCache[e].then(v=>v.clone());const l=s.images[e],u=self.URL||self.webkitURL;let h=l.uri||"",p=!1;if(l.bufferView!==void 0)h=n.getDependency("bufferView",l.bufferView).then(function(v){p=!0;const x=new Blob([v],{type:l.mimeType});return h=u.createObjectURL(x),h});else if(l.uri===void 0)throw new Error("THREE.GLTFLoader: Image "+e+" is missing URI and bufferView");const m=Promise.resolve(h).then(function(v){return new Promise(function(x,_){let A=x;t.isImageBitmapLoader===!0&&(A=function(R){const w=new Ki(R);w.needsUpdate=!0,x(w)}),t.load(Yu.resolveURL(v,a.path),A,void 0,_)})}).then(function(v){return p===!0&&u.revokeObjectURL(h),Bc(v,l),v.userData.mimeType=l.mimeType||J6(l.uri),v}).catch(function(v){throw console.error("THREE.GLTFLoader: Couldn't load texture",h),v});return this.sourceCache[e]=m,m}assignTexture(e,t,n,s){const a=this;return this.getDependency("texture",n.index).then(function(l){if(!l)return null;if(n.texCoord!==void 0&&n.texCoord>0&&(l=l.clone(),l.channel=n.texCoord),a.extensions[Jn.KHR_TEXTURE_TRANSFORM]){const u=n.extensions!==void 0?n.extensions[Jn.KHR_TEXTURE_TRANSFORM]:void 0;if(u){const h=a.associations.get(l);l=a.extensions[Jn.KHR_TEXTURE_TRANSFORM].extendTexture(l,u),a.associations.set(l,h)}}return s!==void 0&&(typeof s=="number"&&(s=s===fC?pd:zc),"colorSpace"in l?l.colorSpace=s:l.encoding=s===pd?fC:y6),e[t]=l,l})}assignFinalMaterial(e){const t=e.geometry;let n=e.material;const s=t.attributes.tangent===void 0,a=t.attributes.color!==void 0,l=t.attributes.normal===void 0;if(e.isPoints){const u="PointsMaterial:"+n.uuid;let h=this.cache.get(u);h||(h=new W_,js.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,h.sizeAttenuation=!1,this.cache.add(u,h)),n=h}else if(e.isLine){const u="LineBasicMaterial:"+n.uuid;let h=this.cache.get(u);h||(h=new ta,js.prototype.copy.call(h,n),h.color.copy(n.color),h.map=n.map,this.cache.add(u,h)),n=h}if(s||a||l){let u="ClonedMaterial:"+n.uuid+":";s&&(u+="derivative-tangents:"),a&&(u+="vertex-colors:"),l&&(u+="flat-shading:");let h=this.cache.get(u);h||(h=n.clone(),a&&(h.vertexColors=!0),l&&(h.flatShading=!0),s&&(h.normalScale&&(h.normalScale.y*=-1),h.clearcoatNormalScale&&(h.clearcoatNormalScale.y*=-1)),this.cache.add(u,h),this.associations.set(h,this.associations.get(n))),n=h}e.material=n}getMaterialType(){return rl}loadMaterial(e){const t=this,n=this.json,s=this.extensions,a=n.materials[e];let l;const u={},h=a.extensions||{},p=[];if(h[Jn.KHR_MATERIALS_UNLIT]){const v=s[Jn.KHR_MATERIALS_UNLIT];l=v.getMaterialType(),p.push(v.extendParams(u,a,t))}else{const v=a.pbrMetallicRoughness||{};if(u.color=new Pt(1,1,1),u.opacity=1,Array.isArray(v.baseColorFactor)){const x=v.baseColorFactor;u.color.setRGB(x[0],x[1],x[2],zc),u.opacity=x[3]}v.baseColorTexture!==void 0&&p.push(t.assignTexture(u,"map",v.baseColorTexture,pd)),u.metalness=v.metallicFactor!==void 0?v.metallicFactor:1,u.roughness=v.roughnessFactor!==void 0?v.roughnessFactor:1,v.metallicRoughnessTexture!==void 0&&(p.push(t.assignTexture(u,"metalnessMap",v.metallicRoughnessTexture)),p.push(t.assignTexture(u,"roughnessMap",v.metallicRoughnessTexture))),l=this._invokeOne(function(x){return x.getMaterialType&&x.getMaterialType(e)}),p.push(Promise.all(this._invokeAll(function(x){return x.extendMaterialParams&&x.extendMaterialParams(e,u)})))}a.doubleSided===!0&&(u.side=Gs);const m=a.alphaMode||b1.OPAQUE;if(m===b1.BLEND?(u.transparent=!0,u.depthWrite=!1):(u.transparent=!1,m===b1.MASK&&(u.alphaTest=a.alphaCutoff!==void 0?a.alphaCutoff:.5)),a.normalTexture!==void 0&&l!==Kr&&(p.push(t.assignTexture(u,"normalMap",a.normalTexture)),u.normalScale=new st(1,1),a.normalTexture.scale!==void 0)){const v=a.normalTexture.scale;u.normalScale.set(v,v)}if(a.occlusionTexture!==void 0&&l!==Kr&&(p.push(t.assignTexture(u,"aoMap",a.occlusionTexture)),a.occlusionTexture.strength!==void 0&&(u.aoMapIntensity=a.occlusionTexture.strength)),a.emissiveFactor!==void 0&&l!==Kr){const v=a.emissiveFactor;u.emissive=new Pt().setRGB(v[0],v[1],v[2],zc)}return a.emissiveTexture!==void 0&&l!==Kr&&p.push(t.assignTexture(u,"emissiveMap",a.emissiveTexture,pd)),Promise.all(p).then(function(){const v=new l(u);return a.name&&(v.name=a.name),Bc(v,a),t.associations.set(v,{materials:e}),a.extensions&&sd(s,v,a),v})}createUniqueName(e){const t=di.sanitizeNodeName(e||"");return t in this.nodeNamesUsed?t+"_"+ ++this.nodeNamesUsed[t]:(this.nodeNamesUsed[t]=0,t)}loadGeometries(e){const t=this,n=this.extensions,s=this.primitiveCache;function a(u){return n[Jn.KHR_DRACO_MESH_COMPRESSION].decodePrimitive(u,t).then(function(h){return mC(h,u,t)})}const l=[];for(let u=0,h=e.length;u<h;u++){const p=e[u],m=Y6(p),v=s[m];if(v)l.push(v.promise);else{let x;p.extensions&&p.extensions[Jn.KHR_DRACO_MESH_COMPRESSION]?x=a(p):x=mC(new Mn,p,t),s[m]={primitive:p,promise:x},l.push(x)}}return Promise.all(l)}loadMesh(e){const t=this,n=this.json,s=this.extensions,a=n.meshes[e],l=a.primitives,u=[];for(let h=0,p=l.length;h<p;h++){const m=l[h].material===void 0?W6(this.cache):this.getDependency("material",l[h].material);u.push(m)}return u.push(t.loadGeometries(l)),Promise.all(u).then(function(h){const p=h.slice(0,h.length-1),m=h[h.length-1],v=[];for(let _=0,A=m.length;_<A;_++){const R=m[_],w=l[_];let E;const D=p[_];if(w.mode===Bo.TRIANGLES||w.mode===Bo.TRIANGLE_STRIP||w.mode===Bo.TRIANGLE_FAN||w.mode===void 0)E=a.isSkinnedMesh===!0?new kA(R,D):new hs(R,D),E.isSkinnedMesh===!0&&E.normalizeSkinWeights(),w.mode===Bo.TRIANGLE_STRIP?E.geometry=uC(E.geometry,PA):w.mode===Bo.TRIANGLE_FAN&&(E.geometry=uC(E.geometry,l_));else if(w.mode===Bo.LINES)E=new ul(R,D);else if(w.mode===Bo.LINE_STRIP)E=new Hc(R,D);else if(w.mode===Bo.LINE_LOOP)E=new GA(R,D);else if(w.mode===Bo.POINTS)E=new jA(R,D);else throw new Error("THREE.GLTFLoader: Primitive mode unsupported: "+w.mode);Object.keys(E.geometry.morphAttributes).length>0&&q6(E,a),E.name=t.createUniqueName(a.name||"mesh_"+e),Bc(E,a),w.extensions&&sd(s,E,w),t.assignFinalMaterial(E),v.push(E)}for(let _=0,A=v.length;_<A;_++)t.associations.set(v[_],{meshes:e,primitives:_});if(v.length===1)return a.extensions&&sd(s,v[0],a),v[0];const x=new Lc;a.extensions&&sd(s,x,a),t.associations.set(x,{meshes:e});for(let _=0,A=v.length;_<A;_++)x.add(v[_]);return x})}loadCamera(e){let t;const n=this.json.cameras[e],s=n[n.type];if(!s){console.warn("THREE.GLTFLoader: Missing camera parameters.");return}return n.type==="perspective"?t=new Ds(vn.radToDeg(s.yfov),s.aspectRatio||1,s.znear||1,s.zfar||2e6):n.type==="orthographic"&&(t=new Vc(-s.xmag,s.xmag,s.ymag,-s.ymag,s.znear,s.zfar)),n.name&&(t.name=this.createUniqueName(n.name)),Bc(t,n),Promise.resolve(t)}loadSkin(e){const t=this.json.skins[e],n=[];for(let s=0,a=t.joints.length;s<a;s++)n.push(this._loadNodeShallow(t.joints[s]));return t.inverseBindMatrices!==void 0?n.push(this.getDependency("accessor",t.inverseBindMatrices)):n.push(null),Promise.all(n).then(function(s){const a=s.pop(),l=s,u=[],h=[];for(let p=0,m=l.length;p<m;p++){const v=l[p];if(v){u.push(v);const x=new dn;a!==null&&x.fromArray(a.array,p*16),h.push(x)}else console.warn('THREE.GLTFLoader: Joint "%s" could not be found.',t.joints[p])}return new dg(u,h)})}loadAnimation(e){const t=this.json,n=this,s=t.animations[e],a=s.name?s.name:"animation_"+e,l=[],u=[],h=[],p=[],m=[];for(let v=0,x=s.channels.length;v<x;v++){const _=s.channels[v],A=s.samplers[_.sampler],R=_.target,w=R.node,E=s.parameters!==void 0?s.parameters[A.input]:A.input,D=s.parameters!==void 0?s.parameters[A.output]:A.output;R.node!==void 0&&(l.push(this.getDependency("node",w)),u.push(this.getDependency("accessor",E)),h.push(this.getDependency("accessor",D)),p.push(A),m.push(R))}return Promise.all([Promise.all(l),Promise.all(u),Promise.all(h),Promise.all(p),Promise.all(m)]).then(function(v){const x=v[0],_=v[1],A=v[2],R=v[3],w=v[4],E=[];for(let D=0,L=x.length;D<L;D++){const P=x[D],G=_[D],H=A[D],F=R[D],X=w[D];if(P===void 0)continue;P.updateMatrix&&P.updateMatrix();const z=n._createAnimationTracks(P,G,H,F,X);if(z)for(let k=0;k<z.length;k++)E.push(z[k])}return new Bp(a,void 0,E)})}createNodeMesh(e){const t=this.json,n=this,s=t.nodes[e];return s.mesh===void 0?null:n.getDependency("mesh",s.mesh).then(function(a){const l=n._getNodeRef(n.meshCache,s.mesh,a);return s.weights!==void 0&&l.traverse(function(u){if(u.isMesh)for(let h=0,p=s.weights.length;h<p;h++)u.morphTargetInfluences[h]=s.weights[h]}),l})}loadNode(e){const t=this.json,n=this,s=t.nodes[e],a=n._loadNodeShallow(e),l=[],u=s.children||[];for(let p=0,m=u.length;p<m;p++)l.push(n.getDependency("node",u[p]));const h=s.skin===void 0?Promise.resolve(null):n.getDependency("skin",s.skin);return Promise.all([a,Promise.all(l),h]).then(function(p){const m=p[0],v=p[1],x=p[2];x!==null&&m.traverse(function(_){_.isSkinnedMesh&&_.bind(x,K6)});for(let _=0,A=v.length;_<A;_++)m.add(v[_]);return m})}_loadNodeShallow(e){const t=this.json,n=this.extensions,s=this;if(this.nodeCache[e]!==void 0)return this.nodeCache[e];const a=t.nodes[e],l=a.name?s.createUniqueName(a.name):"",u=[],h=s._invokeOne(function(p){return p.createNodeMesh&&p.createNodeMesh(e)});return h&&u.push(h),a.camera!==void 0&&u.push(s.getDependency("camera",a.camera).then(function(p){return s._getNodeRef(s.cameraCache,a.camera,p)})),s._invokeAll(function(p){return p.createNodeAttachment&&p.createNodeAttachment(e)}).forEach(function(p){u.push(p)}),this.nodeCache[e]=Promise.all(u).then(function(p){let m;if(a.isBone===!0?m=new V_:p.length>1?m=new Lc:p.length===1?m=p[0]:m=new li,m!==p[0])for(let v=0,x=p.length;v<x;v++)m.add(p[v]);if(a.name&&(m.userData.name=a.name,m.name=l),Bc(m,a),a.extensions&&sd(n,m,a),a.matrix!==void 0){const v=new dn;v.fromArray(a.matrix),m.applyMatrix4(v)}else a.translation!==void 0&&m.position.fromArray(a.translation),a.rotation!==void 0&&m.quaternion.fromArray(a.rotation),a.scale!==void 0&&m.scale.fromArray(a.scale);return s.associations.has(m)||s.associations.set(m,{}),s.associations.get(m).nodes=e,m}),this.nodeCache[e]}loadScene(e){const t=this.extensions,n=this.json.scenes[e],s=this,a=new Lc;n.name&&(a.name=s.createUniqueName(n.name)),Bc(a,n),n.extensions&&sd(t,a,n);const l=n.nodes||[],u=[];for(let h=0,p=l.length;h<p;h++)u.push(s.getDependency("node",l[h]));return Promise.all(u).then(function(h){for(let m=0,v=h.length;m<v;m++)a.add(h[m]);const p=m=>{const v=new Map;for(const[x,_]of s.associations)(x instanceof js||x instanceof Ki)&&v.set(x,_);return m.traverse(x=>{const _=s.associations.get(x);_!=null&&v.set(x,_)}),v};return s.associations=p(a),a})}_createAnimationTracks(e,t,n,s,a){const l=[],u=e.name?e.name:e.uuid,h=[];ku[a.path]===ku.weights?e.traverse(function(x){x.morphTargetInfluences&&h.push(x.name?x.name:x.uuid)}):h.push(u);let p;switch(ku[a.path]){case ku.weights:p=Rd;break;case ku.rotation:p=Bd;break;case ku.position:case ku.scale:p=Id;break;default:switch(n.itemSize){case 1:p=Rd;break;case 2:case 3:default:p=Id;break}break}const m=s.interpolation!==void 0?V6[s.interpolation]:Ep,v=this._getArrayFromAccessor(n);for(let x=0,_=h.length;x<_;x++){const A=new p(h[x]+"."+ku[a.path],t.array,v,m);s.interpolation==="CUBICSPLINE"&&this._createCubicSplineTrackInterpolant(A),l.push(A)}return l}_getArrayFromAccessor(e){let t=e.array;if(e.normalized){const n=hA(t.constructor),s=new Float32Array(t.length);for(let a=0,l=t.length;a<l;a++)s[a]=t[a]*n;t=s}return t}_createCubicSplineTrackInterpolant(e){e.createInterpolant=function(n){const s=this instanceof Bd?j6:F3;return new s(this.times,this.values,this.getValueSize()/3,n)},e.createInterpolant.isInterpolantFactoryMethodGLTFCubicSpline=!0}}function Q6(i,e,t){const n=e.attributes,s=new $r;if(n.POSITION!==void 0){const u=t.json.accessors[n.POSITION],h=u.min,p=u.max;if(h!==void 0&&p!==void 0){if(s.set(new se(h[0],h[1],h[2]),new se(p[0],p[1],p[2])),u.normalized){const m=hA(yp[u.componentType]);s.min.multiplyScalar(m),s.max.multiplyScalar(m)}}else{console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.");return}}else return;const a=e.targets;if(a!==void 0){const u=new se,h=new se;for(let p=0,m=a.length;p<m;p++){const v=a[p];if(v.POSITION!==void 0){const x=t.json.accessors[v.POSITION],_=x.min,A=x.max;if(_!==void 0&&A!==void 0){if(h.setX(Math.max(Math.abs(_[0]),Math.abs(A[0]))),h.setY(Math.max(Math.abs(_[1]),Math.abs(A[1]))),h.setZ(Math.max(Math.abs(_[2]),Math.abs(A[2]))),x.normalized){const R=hA(yp[x.componentType]);h.multiplyScalar(R)}u.max(h)}else console.warn("THREE.GLTFLoader: Missing min/max properties for accessor POSITION.")}}s.expandByVector(u)}i.boundingBox=s;const l=new Dr;s.getCenter(l.center),l.radius=s.min.distanceTo(s.max)/2,i.boundingSphere=l}function mC(i,e,t){const n=e.attributes,s=[];function a(l,u){return t.getDependency("accessor",l).then(function(h){i.setAttribute(u,h)})}for(const l in n){const u=dA[l]||l.toLowerCase();u in i.attributes||s.push(a(n[l],u))}if(e.indices!==void 0&&!i.index){const l=t.getDependency("accessor",e.indices).then(function(u){i.setIndex(u)});s.push(l)}return Bc(i,e),Q6(i,e,t),Promise.all(s).then(function(){return e.targets!==void 0?X6(i,e.targets,t):i})}const $6={uniforms:{tDiffuse:{value:null},h:{value:1/512}},vertexShader:`
4150      varying vec2 vUv;
4151
4152      void main() {
4153
4154        vUv = uv;
4155        gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4156
4157      }
4158  `,fragmentShader:`
4159    uniform sampler2D tDiffuse;
4160    uniform float h;
4161
4162    varying vec2 vUv;
4163
4164    void main() {
4165
4166    	vec4 sum = vec4( 0.0 );
4167
4168    	sum += texture2D( tDiffuse, vec2( vUv.x - 4.0 * h, vUv.y ) ) * 0.051;
4169    	sum += texture2D( tDiffuse, vec2( vUv.x - 3.0 * h, vUv.y ) ) * 0.0918;
4170    	sum += texture2D( tDiffuse, vec2( vUv.x - 2.0 * h, vUv.y ) ) * 0.12245;
4171    	sum += texture2D( tDiffuse, vec2( vUv.x - 1.0 * h, vUv.y ) ) * 0.1531;
4172    	sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
4173    	sum += texture2D( tDiffuse, vec2( vUv.x + 1.0 * h, vUv.y ) ) * 0.1531;
4174    	sum += texture2D( tDiffuse, vec2( vUv.x + 2.0 * h, vUv.y ) ) * 0.12245;
4175    	sum += texture2D( tDiffuse, vec2( vUv.x + 3.0 * h, vUv.y ) ) * 0.0918;
4176    	sum += texture2D( tDiffuse, vec2( vUv.x + 4.0 * h, vUv.y ) ) * 0.051;
4177
4178    	gl_FragColor = sum;
4179
4180    }
4181  `},eG={uniforms:{tDiffuse:{value:null},v:{value:1/512}},vertexShader:`
4182    varying vec2 vUv;
4183
4184    void main() {
4185
4186      vUv = uv;
4187      gl_Position = projectionMatrix * modelViewMatrix * vec4( position, 1.0 );
4188
4189    }
4190  `,fragmentShader:`
4191
4192  uniform sampler2D tDiffuse;
4193  uniform float v;
4194
4195  varying vec2 vUv;
4196
4197  void main() {
4198
4199    vec4 sum = vec4( 0.0 );
4200
4201    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 4.0 * v ) ) * 0.051;
4202    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 3.0 * v ) ) * 0.0918;
4203    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 2.0 * v ) ) * 0.12245;
4204    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y - 1.0 * v ) ) * 0.1531;
4205    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y ) ) * 0.1633;
4206    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 1.0 * v ) ) * 0.1531;
4207    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 2.0 * v ) ) * 0.12245;
4208    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 3.0 * v ) ) * 0.0918;
4209    sum += texture2D( tDiffuse, vec2( vUv.x, vUv.y + 4.0 * v ) ) * 0.051;
4210
4211    gl_FragColor = sum;
4212
4213  }
4214  `},A1=new WeakMap;class tG extends na{constructor(e){super(e),this.decoderPath="",this.decoderConfig={},this.decoderBinary=null,this.decoderPending=null,this.workerLimit=4,this.workerPool=[],this.workerNextTaskID=1,this.workerSourceURL="",this.defaultAttributeIDs={position:"POSITION",normal:"NORMAL",color:"COLOR",uv:"TEX_COORD"},this.defaultAttributeTypes={position:"Float32Array",normal:"Float32Array",color:"Float32Array",uv:"Float32Array"}}setDecoderPath(e){return this.decoderPath=e,this}setDecoderConfig(e){return this.decoderConfig=e,this}setWorkerLimit(e){return this.workerLimit=e,this}load(e,t,n,s){const a=new $a(this.manager);a.setPath(this.path),a.setResponseType("arraybuffer"),a.setRequestHeader(this.requestHeader),a.setWithCredentials(this.withCredentials),a.load(e,l=>{const u={attributeIDs:this.defaultAttributeIDs,attributeTypes:this.defaultAttributeTypes,useUniqueIDs:!1};this.decodeGeometry(l,u).then(t).catch(s)},n,s)}decodeDracoFile(e,t,n,s){const a={attributeIDs:n||this.defaultAttributeIDs,attributeTypes:s||this.defaultAttributeTypes,useUniqueIDs:!!n};this.decodeGeometry(e,a).then(t)}decodeGeometry(e,t){for(const h in t.attributeTypes){const p=t.attributeTypes[h];p.BYTES_PER_ELEMENT!==void 0&&(t.attributeTypes[h]=p.name)}const n=JSON.stringify(t);if(A1.has(e)){const h=A1.get(e);if(h.key===n)return h.promise;if(e.byteLength===0)throw new Error("THREE.DRACOLoader: Unable to re-decode a buffer with different settings. Buffer has already been transferred.")}let s;const a=this.workerNextTaskID++,l=e.byteLength,u=this._getWorker(a,l).then(h=>(s=h,new Promise((p,m)=>{s._callbacks[a]={resolve:p,reject:m},s.postMessage({type:"decode",id:a,taskConfig:t,buffer:e},[e])}))).then(h=>this._createGeometry(h.geometry));return u.catch(()=>!0).then(()=>{s&&a&&this._releaseTask(s,a)}),A1.set(e,{key:n,promise:u}),u}_createGeometry(e){const t=new Mn;e.index&&t.setIndex(new ci(e.index.array,1));for(let n=0;n<e.attributes.length;n++){const s=e.attributes[n],a=s.name,l=s.array,u=s.itemSize;t.setAttribute(a,new ci(l,u))}return t}_loadLibrary(e,t){const n=new $a(this.manager);return n.setPath(this.decoderPath),n.setResponseType(t),n.setWithCredentials(this.withCredentials),new Promise((s,a)=>{n.load(e,s,void 0,a)})}preload(){return this._initDecoder(),this}_initDecoder(){if(this.decoderPending)return this.decoderPending;const e=typeof WebAssembly!="object"||this.decoderConfig.type==="js",t=[];return e?t.push(this._loadLibrary("draco_decoder.js","text")):(t.push(this._loadLibrary("draco_wasm_wrapper.js","text")),t.push(this._loadLibrary("draco_decoder.wasm","arraybuffer"))),this.decoderPending=Promise.all(t).then(n=>{const s=n[0];e||(this.decoderConfig.wasmBinary=n[1]);const a=nG.toString(),l=["/* draco decoder */",s,"","/* worker */",a.substring(a.indexOf("{")+1,a.lastIndexOf("}"))].join(`
4215`);this.workerSourceURL=URL.createObjectURL(new Blob([l]))}),this.decoderPending}_getWorker(e,t){return this._initDecoder().then(()=>{if(this.workerPool.length<this.workerLimit){const s=new Worker(this.workerSourceURL);s._callbacks={},s._taskCosts={},s._taskLoad=0,s.postMessage({type:"init",decoderConfig:this.decoderConfig}),s.onmessage=function(a){const l=a.data;switch(l.type){case"decode":s._callbacks[l.id].resolve(l);break;case"error":s._callbacks[l.id].reject(l);break;default:console.error('THREE.DRACOLoader: Unexpected message, "'+l.type+'"')}},this.workerPool.push(s)}else this.workerPool.sort(function(s,a){return s._taskLoad>a._taskLoad?-1:1});const n=this.workerPool[this.workerPool.length-1];return n._taskCosts[e]=t,n._taskLoad+=t,n})}_releaseTask(e,t){e._taskLoad-=e._taskCosts[t],delete e._callbacks[t],delete e._taskCosts[t]}debug(){console.log("Task load: ",this.workerPool.map(e=>e._taskLoad))}dispose(){for(let e=0;e<this.workerPool.length;++e)this.workerPool[e].terminate();return this.workerPool.length=0,this}}function nG(){let i,e;onmessage=function(l){const u=l.data;switch(u.type){case"init":i=u.decoderConfig,e=new Promise(function(m){i.onModuleLoaded=function(v){m({draco:v})},DracoDecoderModule(i)});break;case"decode":const h=u.buffer,p=u.taskConfig;e.then(m=>{const v=m.draco,x=new v.Decoder,_=new v.DecoderBuffer;_.Init(new Int8Array(h),h.byteLength);try{const A=t(v,x,_,p),R=A.attributes.map(w=>w.array.buffer);A.index&&R.push(A.index.array.buffer),self.postMessage({type:"decode",id:u.id,geometry:A},R)}catch(A){console.error(A),self.postMessage({type:"error",id:u.id,error:A.message})}finally{v.destroy(_),v.destroy(x)}});break}};function t(l,u,h,p){const m=p.attributeIDs,v=p.attributeTypes;let x,_;const A=u.GetEncodedGeometryType(h);if(A===l.TRIANGULAR_MESH)x=new l.Mesh,_=u.DecodeBufferToMesh(h,x);else if(A===l.POINT_CLOUD)x=new l.PointCloud,_=u.DecodeBufferToPointCloud(h,x);else throw new Error("THREE.DRACOLoader: Unexpected geometry type.");if(!_.ok()||x.ptr===0)throw new Error("THREE.DRACOLoader: Decoding failed: "+_.error_msg());const R={index:null,attributes:[]};for(const w in m){const E=self[v[w]];let D,L;if(p.useUniqueIDs)L=m[w],D=u.GetAttributeByUniqueId(x,L);else{if(L=u.GetAttributeId(x,l[m[w]]),L===-1)continue;D=u.GetAttribute(x,L)}R.attributes.push(s(l,u,x,w,E,D))}return A===l.TRIANGULAR_MESH&&(R.index=n(l,u,x)),l.destroy(x),R}function n(l,u,h){const m=h.num_faces()*3,v=m*4,x=l._malloc(v);u.GetTrianglesUInt32Array(h,v,x);const _=new Uint32Array(l.HEAPF32.buffer,x,m).slice();return l._free(x),{array:_,itemSize:1}}function s(l,u,h,p,m,v){const x=v.num_components(),A=h.num_points()*x,R=A*m.BYTES_PER_ELEMENT,w=a(l,m),E=l._malloc(R);u.GetAttributeDataArrayForAllPoints(h,v,w,R,E);const D=new m(l.HEAPF32.buffer,E,A).slice();return l._free(E),{name:p,array:D,itemSize:x}}function a(l,u){switch(u){case Float32Array:return l.DT_FLOAT32;case Int8Array:return l.DT_INT8;case Int16Array:return l.DT_INT16;case Int32Array:return l.DT_INT32;case Uint8Array:return l.DT_UINT8;case Uint16Array:return l.DT_UINT16;case Uint32Array:return l.DT_UINT32}}}let ox;const M1=()=>
4215{if(ox)return ox;const i="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIA
4215LAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",e="B9h9z9tFBBBFiI9gBB9gLaaaaaFa9gEaaaB9gFaFaEMcBBFBFFGGGEILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBOn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBNI9z9iqlBVc+N9IcIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMk8lLbaE97F9+FaL978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAeDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAeDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAeDeBJAiCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPAPDQBFGENVcMILKOSQfbHeD8dBh+BsxoxoUwN0AeD8dFhxoUwkwk+gUa0sHnhTkAnsHnhNkAnsHn7CgFZHiCEWCxkUUBJDBEBAiCx+YUUBJDBBBHeAeDQBBBBBBBBBBBBBBBBAnhAk7CgFZHiCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAeDeBJAiCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMG
4215XAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBReCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBH8ZCFD9tA8ZAPD9OD9hD9RH8ZDQBTFtGmEYIPLdKeOnHpAIAQJDBIBHyCFD9tAyAPD9OD9hD9RHyAIASJDBIBH8cCFD9tA8cAPD9OD9hD9RH8cDQBTFtGmEYIPLdKeOnH8dDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAeD9uHeDyBjGBAEAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeApA8dDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNiV8ZcpMyS8cQ8df8eb8fHdAyA8cDQNiV8ZcpMyS8cQ8df8eb8fH8ZDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJHIAeAdA8ZDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHeDyBjGBAIAGJHIAeAPAPDQILKOILKOILKOILKOD9uHeDyBjGBAIAGJHIAeAPAPDQNVcMNVcMNVcMNVcMD9uHeDyBjGBAIAGJHIAeAPAPDQSQfbSQfbSQfbSQfbD9uHeDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/dLEK97FaF97GXGXAGCI9HQBAF9FQFCBRGEXABABDBBBHECiD+rFCiD+sFD/6FHIAECND+rFCiD+sFD/6FAID/gFAECTD+rFCiD+sFD/6FHLD/gFD/kFD/lFHKCBDtD+2FHOAICUUUU94DtHND9OD9RD/kFHI9DBB/+hDYAIAID/mFAKAKD/mFALAOALAND9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHLD/mF9DBBX9LDYHOD/kFCgFDtD9OAECUUU94DtD9OD9QAIALD/mFAOD/kFCND+rFCU/+EDtD9OD9QAKALD/mFAOD/kFCTD+rFCUU/8ODtD9OD9QDMBBABCTJRBAGCIJHGAF9JQBSGMMAF9FQBCBRGEXABCTJHVAVDBBBHECBDtHOCUU98D8cFCUU98D8cEHND9OABDBBBHKAEDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAKAEDQBFGENVcMTtmYi8ZpyHECTD+sFD/6FHID/gFAECTD+rFCTD+sFD/6FHLD/gFD/kFD/lFHE9DB/+g6DYALAEAOD+2FHOALCUUUU94DtHcD9OD9RD/kFHLALD/mFAEAED/mFAIAOAIAcD9OD9RD/kFHEAED/mFD/kFD/kFD/jFD/nFHID/mF9DBBX9LDYHOD/kFCTD+rFALAID/mFAOD/kFCggEDtD9OD9QHLAEAID/mFAOD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHEDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAKAND9OALAEDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM/hEIGaF97FaL978jUUUUBCTlREGXAF9FQBCBRIEXAEABDBBBHLABCTJHKDBBBHODQILKOSQfbPden8c8d8e8fHNCTD+sFHVCID+rFDMIBAB9DBBU8/DY9D/zI818/DYAVCEDtD9QD/6FD/nFHVALAODQBFGENVcMTtmYi8ZpyHLCTD+rFCTD+sFD/6FD/mFHOAOD/mFAVALCTD+sFD/6FD/mFHcAcD/mFAVANCTD+rFCTD+sFD/6FD/mFHNAND/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHVD/mF9DBBX9LDYHLD/kFCggEDtHMD9OAcAVD/mFALD/kFCTD+rFD9QHcANAVD/mFALD/kFCTD+rFAOAVD/mFALD/kFAMD9OD9QHVDQBFTtGEmYILPdKOenHLD8dBAEDBIBDyB+t+J83EBABCNJALD8dFAEDBIBDyF+t+J83EBAKAcAVDQNVi8ZcMpySQ8c8dfb8e8fHVD8dBAEDBIBDyG+t+J83EBABCiJAVD8dFAEDBIBDyE+t+J83EBABCAJRBAICIJHIAF9JQBMMM9jFF97GXAGCGrAF9sHG9FQBCBRFEXABABDBBBHECND+rFCND+sFD/6FAECiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBABCTJRBAFCIJHFAG9JQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",t=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),n=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]);if(typeof WebAssembly!="object")return{supported:!1};let s=i;WebAssembly.validate(t)&&(s=e);let a;const l=WebAssembly.instantiate(u(s),{}).then(v=>{a=v.instance,a.exports.__wasm_call_ctors()});function u(v){const x=new Uint8Array(v.length);for(let A=0;A<v.length;++A){const R=v.charCodeAt(A);x[A]=R>96?R-71:R>64?R-65:R>47?R+4:R>46?63:62}let _=0;for(let A=0;A<v.length;
4215++A)x[_++]=x[A]<60?n[x[A]]:(x[A]-60)*64+x[++A];return x.buffer.slice(0,_)}function h(v,x,_,A,R,w){const E=a.exports.sbrk,D=_+3&-4,L=E(D*A),P=E(R.length),G=new Uint8Array(a.exports.memory.buffer);G.set(R,P);const H=v(L,_,A,P,R.length);if(H===0&&w&&w(L,D,A),x.set(G.subarray(L,L+_*A)),E(L-E(0)),H!==0)throw new Error(`Malformed buffer data: ${H}`)}const p={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},m={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};return ox={ready:l,supported:!0,decodeVertexBuffer(v,x,_,A,R){h(a.exports.meshopt_decodeVertexBuffer,v,x,_,A,a.exports[p[R]])},decodeIndexBuffer(v,x,_,A){h(a.exports.meshopt_decodeIndexBuffer,v,x,_,A)},decodeIndexSequence(v,x,_,A){h(a.exports.meshopt_decodeIndexSequence,v,x,_,A)},decodeGltfBuffer(v,x,_,A,R,w){h(a.exports[m[R]],v,x,_,A,a.exports[p[w]])}},ox},iG=()=>parseInt($u.replace(/\D+/g,"")),sG=iG();let lx=null,k3="https://www.gstatic.com/draco/versioned/decoders/1.5.5/";function H3(i=!0,e=!0,t){return n=>{t&&t(n),i&&(lx||(lx=new tG),lx.setDecoderPath(typeof i=="string"?i:k3),n.setDRACOLoader(lx)),e&&n.setMeshoptDecoder(typeof M1=="function"?M1():M1)}}const fb=(i,e,t,n)=>xg(xM,i,H3(e,t,n));fb.preload=(i,e,t,n)=>xg.preload(xM,i,H3(e,t,n));fb.clear=i=>xg.clear(xM,i);fb.setDecoderPath=i=>{k3=i};const rG=q.forwardRef(({scale:i=10,frames:e=1/0,opacity:t=1,width:n=1,height:s=1,blur:a=1,near:l=0,far:u=10,resolution:h=512,smooth:p=!0,color:m="#000000",depthWrite:v=!1,renderOrder:x,..._},A)=>{const R=q.useRef(null),w=Gc(le=>le.scene),E=Gc(le=>le.gl),D=q.useRef(null);n=n*(Array.isArray(i)?i[0]:i||1),s=s*(Array.isArray(i)?i[1]:i||1);const[L,P,G,H,F,X,z]=q.useMemo(()=>{const le=new Ms(h,h),ae=new Ms(h,h);ae.texture.generateMipmaps=le.texture.generateMipmaps=!1;const W=new Nd(n,s).rotateX(Math.PI/2),ee=new hs(W),te=new ob;te.depthTest=te.depthWrite=!1,te.onBeforeCompile=K=>{K.uniforms={...K.uniforms,ucolor:{value:new Pt(m)}},K.fragmentShader=K.fragmentShader.replace("void main() {",`uniform vec3 ucolor;
4216           void main() {
4217          `),K.fragmentShader=K.fragmentShader.replace("vec4( vec3( 1.0 - fragCoordZ ), opacity );","vec4( ucolor * fragCoordZ * 2.0, ( 1.0 - fragCoordZ ) * 1.0 );")};const ue=new Zi($6),he=new Zi(eG);return he.depthTest=ue.depthTest=!1,[le,W,te,ee,ue,he,ae]},[h,n,s,i,m]),k=le=>{H.visible=!0,H.material=F,F.uniforms.tDiffuse.value=L.texture,F.uniforms.h.value=le*1/256,E.setRenderTarget(z),E.render(H,D.current),H.material=X,X.uniforms.tDiffuse.value=z.texture,X.uniforms.v.value=le*1/256,E.setRenderTarget(L),E.render(H,D.current),H.visible=!1};let ie=0,ve,J;return ps(()=>{D.current&&(e===1/0||ie<e)&&(ie++,ve=w.background,J=w.overrideMaterial,R.current.visible=!1,w.background=null,w.overrideMaterial=G,E.setRenderTarget(L),E.render(w,D.current),k(a),p&&k(a*.4),E.setRenderTarget(null),R.current.visible=!0,w.overrideMaterial=J,w.background=ve)}),q.useImperativeHandle(A,()=>R.current,[]),q.createElement("group",g_({"rotation-x":Math.PI/2},_,{ref:R}),q.createElement("mesh",{renderOrder:x,geometry:P,scale:[1,-1,1],rotation:[-Math.PI/2,0,0]},q.createElement("meshBasicMaterial",{transparent:!0,map:L.texture,opacity:t,depthWrite:v})),q.createElement("orthographicCamera",{ref:D,args:[-n/2,n/2,s/2,-s/2,l,u]}))});class aG extends Zi{constructor(){super({uniforms:{time:{value:0},fade:{value:1}},vertexShader:`
4218      uniform float time;
4219      attribute float size;
4220      varying vec3 vColor;
4221      void main() {
4222        vColor = color;
4223        vec4 mvPosition = modelViewMatrix * vec4(position, 0.5);
4224        gl_PointSize = size * (30.0 / -mvPosition.z) * (3.0 + sin(time + 100.0));
4225        gl_Position = projectionMatrix * mvPosition;
4226      }`,fragmentShader:`
4227      uniform sampler2D pointTexture;
4228      uniform float fade;
4229      varying vec3 vColor;
4230      void main() {
4231        float opacity = 1.0;
4232        if (fade == 1.0) {
4233          float d = distance(gl_PointCoord, vec2(0.5, 0.5));
4234          opacity = 1.0 / (1.0 + exp(16.0 * (d - 0.25)));
4235        }
4236        gl_FragColor = vec4(vColor, opacity);
4237
4238        #include <tonemapping_fragment>
4239	      #include <${sG>=154?"colorspace_fragment":"encodings_fragment"}>
4240      }`})}}const oG=i=>new se().setFromSpherical(new QI(i,Math.acos(1-Math.random()*2),Math.random()*2*Math.PI)),lG=q.forwardRef(({radius:i=100,depth:e=50,count:t=5e3,saturation:n=0,factor:s=4,fade:a=!1,speed:l=1},u)=>{const h=q.useRef(null),[p,m,v]=q.useMemo(()=>{const _=[],A=[],R=Array.from({length:t},()=>(.5+.5*Math.random())*s),w=new Pt;let E=i+e;const D=e/t;for(let L=0;L<t;L++)E-=D*Math.random(),_.push(...oG(E).toArray()),w.setHSL(L/t,n,.9),A.push(w.r,w.g,w.b);return[new Float32Array(_),new Float32Array(A),new Float32Array(R)]},[t,e,s,i,n]);ps(_=>h.current&&(h.current.uniforms.time.value=_.clock.elapsedTime*l));const[x]=q.useState(()=>new aG);return q.createElement("points",{ref:u},q.createElement("bufferGeometry",null,q.createElement("bufferAttribute",{attach:"attributes-position",args:[p,3]}),q.createElement("bufferAttribute",{attach:"attributes-color",args:[m,3]}),q.createElement("bufferAttribute",{attach:"attributes-size",args:[v,1]})),q.createElement("primitive",{ref:h,object:x,attach:"material",blending:H0,"uniforms-fade-value":a,depthWrite:!1,transparent:!0,vertexColors:!0}))}),cG=(()=>{const e=[];for(let t=0;t<11;t++){const n=t/11*Math.PI*2+.17,s=3+t*2.1%5;e.push({a:n,r:122+s*.3,tilt:[.04+t%3*.02,0,.12+t%2*.04],blocks:[{dx:0,dy:1.1,dz:0,w:3.2+t%2,h:2,d:9+t%3*1.2,c:"#1a1815"},{dx:.5,dy:.35,dz:3.2,w:2,h:.6,d:2.2,c:"#2a2018"},{dx:-.8,dy:.25,dz:-2.2,w:1.4,h:.5,d:3,c:"#232019"}]})}return e})(),G3={value:0},uG=`
4241  varying vec2 vUv;
4242  void main() {
4243    vUv = uv;
4244    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0
4244);
4245  }
4246`,fG=`
4247  uniform float uTime;
4248  uniform float uPhase;
4249  uniform float uStretch;
4250  varying vec2 vUv;
4251
4252  float hash12(vec2 p) {
4253    return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
4254  }
4255  float noise2(vec2 p) {
4256    vec2 i = floor(p);
4257    vec2 f = fract(p);
4258    f = f * f * (3.0 - 2.0 * f);
4259    return mix(
4260      mix(hash12(i), hash12(i + vec2(1.0, 0.0)), f.x),
4261      mix(hash12(i + vec2(0.0, 1.0)), hash12(i + vec2(1.0, 1.0)), f.x), f.y
4262    );
4263  }
4264  float fbm(vec2 p) {
4265    float v = 0.0;
4266    float a = 0.5;
4267    for (int k = 0; k < 4; k++) {
4268      v += a * noise2(p);
4269      p *= 2.1;
4270      a *= 0.52;
4271    }
4272    return v;
4273  }
4274
4275  void main() {
4276    float t = uTime * (2.0 + 0.3 * uPhase) + uPhase;
4277    vec2 u = vUv;
4278    u.x = (u.x - 0.5) * (1.0 - u.y * 0.25) + 0.5;
4279    float scroll = t * 0.55;
4280    float n = fbm(u * vec2(4.5 * uStretch, 6.0 * uStretch) + vec2(0.0, scroll));
4281    float n2 = fbm(u * vec2(9.0, 11.0) + vec2(2.0, scroll * 1.3));
4282    float f = n * 0.55 + n2 * 0.45;
4283    float waist = 0.5 + 0.5 * sin(u.x * 6.2831 + t * 3.0);
4284    float h = 1.0 - u.y;
4285    float body = f * h * (0.5 + 0.5 * waist) + 0.12 * sin(t * 6.0 + u.x * 14.0) * h;
4286    float a = smoothstep(0.02, 0.28, body);
4287    a *= 1.0 - smoothstep(0.4, 0.99, u.y);
4288    a = clamp(a * 1.1, 0.0, 0.95);
4289    a *= 0.35 + 0.65 * f;
4290
4291    vec3 c0 = vec3(0.08, 0.0, 0.0);
4292    vec3 c1 = vec3(1.0, 0.2, 0.0);
4293    vec3 c2 = vec3(1.0, 0.55, 0.1);
4294    vec3 c3 = vec3(1.0, 0.88, 0.45);
4295    float uu = f * 0.5 + h * 0.5;
4296    vec3 col = mix(c0, c1, smoothstep(0.0, 0.4, uu));
4297    col = mix(col, c2, smoothstep(0.2, 0.65, u.y) * f);
4298    col = mix(col, c3, smoothstep(0.55, 0.95, u.y) * n2);
4299    col += 0.15 * c3 * pow(1.0 - u.y, 2.0) * f;
4300
4301    gl_FragColor = vec4(col, a);
4302  }
4303`;function dG(i,e){return new Zi({vertexShader:uG,fragmentShader:fG,transparent:!0,depthWrite:!1,blending:H0,side:Gs,uniforms:{uTime:G3,uPhase:{value:i},uStretch:{value:e}}})}function hG(){return ps(({clock:i})=>{G3.value=i.elapsedTime}),null}const gC=[0,Math.PI*2/3,Math.PI*4/3];function j3({y:i,width:e,height:t,lowFx:n,scale:s=1}){const a=.78+.22*(.5+.5*Math.sin(s*12.3+i*.2)),l=q.useMemo(()=>gC.map((x,_)=>dG(_*2.1+i*.01,a)),[i,a]),u=q.useRef(null),h=n?2:3,p=t*s,m=e*s,v=i+p*.5;return ps(({clock:x})=>{u.current&&(u.current.intensity=n?.55:.75+.35*Math.sin(x.elapsedTime*5.5+i))}),b.jsxs("group",{position:[0,v,0],children:[gC.slice(0,h).map((x,_)=>b.jsxs("mesh",{rotation:[0,x,0],renderOrder:1,children:[b.jsx("planeGeometry",{args:[m,p]}),b.jsx("primitive",{object:l[_],attach:"material"})]},_)),b.jsx("pointLight",{ref:u,position:[0,0,0],color:"#ff4a1a",distance:8+e*3,decay:2,intensity:n?.45:.85})]})}function V3({x:i,z:e,radius:t,lowFx:n}){const s=2.4+t*.2,a=t*1.35;return b.jsxs("group",{position:[i,0,e],children:[b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.01,0],children:[b.jsx("ringGeometry",{args:[t*.25,t*1,32,1,0,Math.PI*2]}),b.jsx("meshStandardMaterial",{color:"#1a0a04",emissive:"#5c1206",emissiveIntensity:n?.55:.9,roughness:.9})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.011,0],children:[b.jsx("circleGeometry",{args:[t*.85,24]}),b.jsx("meshStandardMaterial",{color:"#0a0200",emissive:"#c02808",emissiveIntensity:.4,transparent:!0,opacity:.5})]}),b.jsx(j3,{y:.02,width:a,height:s,lowFx:n,scale:1}),!n&&b.jsxs("mesh",{position:[.1,1.2,.05],scale:[.8,1,.7],children:[b.jsx("cylinderGeometry",{args:[t*.15,.38,3.2,6,1,!0]}),b.jsx("meshStandardMaterial",{color:"#0a0a0c",transparent:!0,opacity:.11,depthWrite:!1,roughness:1})]})]})}const pG=[{x:39.1,y:3,z:28,w:1.8,h:3,s:.9},{x:28,y:2.4,z:39.1,w:1.5,h:2.6,s:.75},{x:39.05,y:5,z:28,w:1.2,h:2.2,s:.65},{x:54.1,y:16,z:52,w:2,h:4.5,s:1},{x:54.05,y:28,z:52,w:1.3,h:3.2,s:.75},{x:63.1,y:10,z:61,w:1.6,h:3.8,s:.95},{x:63.05,y:28,z:61,w:1.1,h:2.8,s:.65},{x:83.1,y:18,z:28,w:1.4,h:3.4,s:.85},{x:83.05,y:7,z:28,w:1.2,h:2.4,s:.7},{x:28,y:14,z:83.1,w:1.5,h:3.6,s:.9},{x:18.55,y:3.2,z:37,w:1,h:2,s:.6},{x:37,y:3.2,z:18.55,w:1,h:2,s:.6}];function mG({lowFx:i}){const e=q.useMemo(()=>{const n=[[1,1],[-1,1],[1,-1],[-1,-1]];return pG.flatMap(s=>n.map(([a,l])=>({...s,x:s.x*a,z:s.z*l,key:`${s.x},${s.z},${a},${l}`})))},[]),t=i?e.filter((n,s)=>s%2===0):e;return b.jsx("group",{children:t.map(n=>b.jsx("group",{position:[n.x,0,n.z],children:b.jsx(j3,{y:n.y,width:n.w,height:n.h,lowFx:i,scale:n.s})},n.key))})}function gG(){return b.jsx("group",{children:cG.map((i,e)=>{const t=Math.cos(i.a)*i.r,n=Math.sin(i.a)*i.r;return b.jsxs("group",{position:[t,0,n],rotation:i.tilt,children:[i.blocks.map((s,a)=>b.jsxs("mesh",{position:[s.dx,s.dy,s.dz],castShadow:!0,receiveShadow:!0,children:[b.jsx("boxGeometry",{args:[s.w,s.h,s.d]}),b.jsx("meshStandardMaterial",{color:s.c,roughness:.95,metalness:.04})]},a)),b.jsxs("mesh",{position:[.6,.15,1.2],castShadow:!0,children:[b.jsx("boxGeometry",{args:[1.2,.28,1.4]}),b.jsx("meshStandardMaterial",{color:"#2c2520",roughness:.98,metalness:.02})]}),b.jsxs("mesh",{position:[-.9,.1,-.4],castShadow:!0,children:[b.jsx("boxGeometry",{args:[.8,.2,.6]}),b.jsx("meshStandardMaterial",{color:"#1f1c19",roughness:.98,metalness:.02})]})]},`ruin-${e}`)})})}function vG(){const i=[{x:0,z:82,ry:.4,tilt:.11},{x:81,z:0,ry:-1.2,tilt:.09},{x:0,z:-79,ry:2.1,tilt:.13},{x:-80,z:0,ry:-.7,tilt:.1}];return b.jsx("group",{children:i.map((e,t)=>
4303b.jsxs("group",{position:[e.x,0,e.z],rotation:[e.tilt,e.ry,e.tilt*.6],children:[b.jsxs("mesh",{position:[0,.35,0],castShadow:!0,receiveShadow:!0,children:[b.jsx("boxGeometry",{args:[4.2,.55,7.5]}),b.jsx("meshStandardMaterial",{color:"#26211c",roughness:.96,metalness:.05})]}),b.jsxs("mesh",{position:[-.8,.25,2.8],castShadow:!0,children:[b.jsx("boxGeometry",{args:[1.1,.4,2.2]}),b.jsx("meshStandardMaterial",{color:"#1a1614",roughness:.98,metalness:.02})]})]},`hw-wreck-${t}`))})}function yG(){const i=ot(t=>t.graphicsQuality==="performance"),e=q.useMemo(()=>[{x:108,z:38,r:2.1},{x:-38,z:105,r:2},{x:-102,z:-44,r:2.2}],[]);return i?null:b.jsx("group",{children:e.map((t,n)=>b.jsx(V3,{x:t.x,z:t.z,radius:t.r,lowFx:!1},`edge-fire-${n}`))})}function xG(){const i=ot(e=>e.graphicsQuality==="performance");return b.jsxs("group",{children:[b.jsx(hG,{}),b.jsx(gG,{}),b.jsx(vG,{}),b.jsx("group",{children:o5.map(e=>b.jsx(V3,{x:e.x,z:e.z,radius:e.radius,lowFx:i},e.id))}),b.jsx(yG,{}),b.jsx(mG,{lowFx:i})]})}function _G(){const i=ot(e=>e.graphicsQuality==="performance");return b.jsx(rG,{position:[0,0,0],opacity:.22,scale:300,blur:1.1,far:1.2,resolution:i?256:512,color:"#0a0a0e",frames:1/0})}function W3(){return b.jsxs("group",{children:[b.jsx(EG,{}),b.jsx(wG,{}),b.jsx(CG,{}),b.jsx(LG,{}),b.jsx(_G,{}),b.jsx("fog",{attach:"fog",args:["#030108",28,198]}),b.jsx(xG,{}),b.jsx(HG,{}),b.jsx($G,{}),b.jsx(SG,{})]})}const bG=["#00f5ff","#ff2d7a","#ffe600","#00ff88","#ff8800","#cc44ff","#ff6b9d","#7af3c1","#a78bfa","#fbbf24","#38bdf8","#f472b6"];function SG(){return b.jsx("group",{children:y_.map((i,e)=>b.jsx(OG,{position:[i.x,0,i.z],flagId:i.id,color:bG[e]??"#ffffff"},i.id))})}const AG=`
4304  varying vec3 vWorldNormal;
4305  varying vec2 vUV;
4306  void main() {
4307    vWorldNormal = normalize((modelMatrix * vec4(position, 0.0)).xyz);
4308    vUV = uv;
4309    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4310  }
4311`,MG=`
4312  varying vec3 vWorldNormal;
4313  varying vec2 vUV;
4314  uniform float uTime;
4315
4316  // Hash e noise simples para nuvens
4317  float hash(vec2 p) {
4318    return fract(sin(dot(p, vec2(127.1, 311.7))) * 43758.5453);
4319  }
4320  float noise(vec2 p) {
4321    vec2 i = floor(p);
4322    vec2 f = fract(p);
4323    f = f * f * (3.0 - 2.0 * f);
4324    return mix(
4325      mix(hash(i), hash(i + vec2(1,0)), f.x),
4326      mix(hash(i + vec2(0,1)), hash(i + vec2(1,1)), f.x),
4327      f.y
4328    );
4329  }
4330  float fbm(vec2 p) {
4331    float v = 0.0;
4332    float a = 0.5;
4333    for (int i = 0; i < 3; i++) {
4334      v += a * noise(p);
4335      p *= 2.1;
4336      a *= 0.48;
4337    }
4338    return v;
4339  }
4340
4341  void main() {
4342    float t = clamp(vWorldNormal.y * 0.5 + 0.5, 0.0, 1.0);
4343
4344    // Céu: fim de mundo — fumo, cinzas e fogo distante; zênite vazio e frio
4345    vec3 horizon = vec3(0.55, 0.08, 0.04);
4346    vec3 lowSky  = vec3(0.18, 0.04, 0.12);
4347    vec3 midSky  = vec3(0.05, 0.02, 0.10);
4348    vec3 zenith  = vec3(0.015, 0.008, 0.04);
4349    vec3 col = horizon;
4350    col = mix(col, lowSky, smoothstep(0.0, 0.28, t));
4351    col = mix(col, midSky, smoothstep(0.22, 0.55, t));
4352    col = mix(col, zenith, smoothstep(0.48, 1.0, t));
4353
4354    // Resíduo tóxico / incêndios além do limite da cidade
4355    float fireGlow = pow(max(0.0, 0.2 - t), 1.4) * 7.2;
4356    col += vec3(0.55, 0.12, 0.04) * fireGlow;
4357
4358    // ── Nuvens de tempestade/fumo ──────────────────────────────────────
4359    // Só acima do horizonte (t > 0.05)
4360    if (t > 0.05) {
4361      // Coordenadas esféricas para projecção planar das nuvens
4362      vec2 cloudUV = vec2(
4363        atan(vWorldNormal.x, vWorldNormal.z) / (2.0 * 3.14159) + 0.5,
4364        clamp(vWorldNormal.y * 1.8, 0.0, 1.0)
4365      );
4366      // Duas camadas de nuvens com velocidades diferentes (simulação vento)
4367      float slow = uTime * 0.006;
4368      float fast = uTime * 0.011;
4369      float cloud1 = fbm(cloudUV * vec2(3.5, 5.0) + vec2(slow, 0.0));
4370      float cloud2 = fbm(cloudUV * vec2(2.2, 4.0) + vec2(-fast * 0.7, fast * 0.3));
4371      float cloud  = clamp((cloud1 + cloud2 * 0.55 - 0.52) * 2.8, 0.0, 1.0);
4372
4373      // Cor das nuvens: fumo escuro-violeta com borda laranja dos incêndios
4374      float lowFrac = smoothstep(0.3, 0.0, t); // mais laranja perto do horizonte
4375      vec3 cloudColor = mix(
4376        vec3(0.07, 0.04, 0.10),  // núcleo: nuvem escura de fumo
4377        vec3(0.38, 0.10, 0.04),  // borda: iluminada por incêndios
4378        lowFrac * 0.65
4379      );
4380      // Opacidade maior perto do horizonte
4381      float cloudAlpha = cloud * (0.62 + lowFrac * 0.4) * smoothstep(0.04, 0.2, t);
4382      col = mix(col, cloudColor, cloudAlpha);
4383    }
4384
4385    gl_FragColor = vec4(col, 1.0);
4386  }
4387`;function EG(){q.useRef(null);const i=q.useMemo(()=>new Zi({vertexShader:AG,fragmentShader:MG,side:$s,depthWrite:!1,uniforms:{uTime:{value:0}}}),[]);return ps(({clock:e})=>{i.uniforms.uTime.value=e.elapsedTime}),b.jsxs(b.Fragment,{children:[b.jsxs("mesh",{renderOrder:-2,children:[b.jsx("sphereGeometry",{args:[290,32,16]}),b.jsx("primitive",{object:i,attach:"material"})]}),b.jsx(lG,{radius:260,depth:55,count:160,factor:1.9,saturation:.08,fade:!0,speed:.04})]})}const TG=[0,80,-190],E1="#ff3800",vC="#ff6020";function wG(){const i=q.useRef(null),e=q.useRef(null),t=q.useRef(null),n=q.useRef(null);ps(({clock:a})=>{const l=a.elapsedTime,u=2.8+.85*Math.sin(l*.36);i.current&&(i.current.material.emissiveIntensity=u),e.current&&(e.current.rotation.z+=4e-4),t.current&&(t.current.rotation.z-=3e-4),n.current&&(n.current.rotation.z+=15e-5)});const s=q.useMemo(()=>Array.from({length:16},(a,l)=>({angle:l/16*Math.PI*2,length:16+Math.abs(Math.sin(l*2.3))*14,width:1+Math.abs(Math.sin(l*5.7))*.8})),[]);return b.jsxs("group",{position:TG,children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[22,48,48]}),b.jsx("meshStandardMaterial",{color:"#020005",roughness:1})]}),b.jsxs("mesh",{ref:i,rotation:[Math.PI/2,0,0],children:[b.jsx("torusGeometry",{args:[22,2.8,20,128]}),b.jsx("meshStandardMaterial",{color:E1,emissive:E1,emissiveIntensity:4.2,roughness:1})]}),b.jsxs("mesh",{ref:e,rotation:[Math.PI/2,0,0],children:[b.jsx("ringGeometry",{args:[25,38,64]}),b.jsx("meshBasicMaterial",{color:vC,transparent:!0,opacity:.13,side:Gs,depthWrite:!1})]}),b.jsxs("mesh",{ref:t,rotation:[Math.PI/2,0,0],children:[b.jsx("ringGeometry",{args:[38,72,64]}),b.jsx("meshBasicMaterial",{color:vC,transparent:!0,opacity:.045,side:Gs,depthWrite:!1})]}),b.jsx("group",{ref:n,rotation:[Math.PI/2,0,0],children:s.map((a,l)=>b.jsxs("mesh",{position:[Math.cos(a.angle)*(22+a.length/2),Math.sin(a.angle)*(22+a.length/2),
43870],rotation:[0,0,a.angle+Math.PI/2],children:[b.jsx("planeGeometry",{args:[a.width,a.length]}),b.jsx("meshBasicMaterial",{color:E1,transparent:!0,opacity:.2,side:Gs,depthWrite:!1})]},l))}),b.jsx("pointLight",{color:"#ff4a10",intensity:3.2,distance:520,decay:.72})]})}function CG(){const i=q.useMemo(()=>Array.from({length:12},(e,t)=>{const n=t/12*Math.PI*2+t*.58,s=3+t*4.3%34;return{x:Math.cos(n)*s,z:Math.sin(n)*s,sx:.8+t*.19%1.5,sz:.45+t*.13%1,rot:t*43%(Math.PI*2)}}),[]);return b.jsxs("group",{children:[b.jsxs("mesh",{receiveShadow:!0,rotation:[-Math.PI/2,0,0],position:[0,0,0],children:[b.jsx("planeGeometry",{args:[420,420]}),b.jsx("meshStandardMaterial",{color:"#1e1a14",roughness:.85,metalness:.04})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.006,0],children:[b.jsx("ringGeometry",{args:[148,149.4,120]}),b.jsx("meshStandardMaterial",{color:"#ff2d7a",emissive:"#ff2d7a",emissiveIntensity:1.4,transparent:!0,opacity:.55,depthWrite:!1})]}),i.map((e,t)=>b.jsxs("mesh",{rotation:[-Math.PI/2,e.rot,0],position:[e.x,.004,e.z],scale:[e.sx,e.sz,1],receiveShadow:!0,children:[b.jsx("circleGeometry",{args:[1,14]}),b.jsx("meshStandardMaterial",{color:"#1a2c3a",roughness:.12,metalness:.25,transparent:!0,opacity:.55,depthWrite:!1})]},t))]})}const RG=.004,BG=.005,IG=.006;function Tc(i){const e=21904-i*i;return e>0?Math.sqrt(e)+1:0}const cx=18,ux=10,fx=6,yC=3,T1=[-45,45,-90,90],xC=[-22,22,-67,67,-112,112],DG=[-11,11,-33,33,-56,56,-78,78,-101,101,-123,123];function LG(){const i=q.useMemo(()=>{const n=[],s="#050308",a="#08060b",l="#0b090d",u="#100f0f",h="#1c1917",v=(_,A,R,w=!0)=>{const E=Tc(_)*2;if(E&&(n.push({x:_,z:0,pw:A,ph:E,col:R}),!!w))for(const D of[-1,1]){const L=_+D*(A/2+.9),P=Tc(L)*2;P&&n.push({x:L,z:0,pw:1.8,ph:P,col:h,y:.011})}},x=(_,A,R,w=!0)=>{const E=Tc(_)*2;if(E&&(n.push({x:0,z:_,pw:E,ph:A,col:R}),!!w))for(const D of[-1,1]){const L=_+D*(A/2+.9),P=Tc(L)*2;P&&n.push({x:0,z:L,pw:P,ph:1.8,col:h,y:.011})}};v(0,cx,s),x(0,cx,s);for(const _ of T1)v(_,ux,a),x(_,ux,a);for(const _ of xC)v(_,fx,l),x(_,fx,l);for(const _ of DG)v(_,yC,u,!1),x(_,yC,u,!1);return n},[]),e=q.useMemo(()=>{const n=[],s=(v,x,_,A,R,w)=>n.push({x:v,z:x,pw:_,ph:A,col:R,op:w});{const v=Tc(0)*2;s(0,0,1.8,v,"#2a2824",.9);for(const x of[-1,1])s(x*1.05,0,.14,v,"#c8aa00",.6);for(const x of[-1,1])s(x*4.5,0,.12,v,"#cccccc",.35);for(const x of[-1,1])s(x*8.6,0,.14,v,"#dddddd",.4)}{const v=Tc(0)*2;s(0,0,v,1.8,"#2a2824",.9);for(const x of[-1,1])s(0,x*1.05,v,.14,"#c8aa00",.6);for(const x of[-1,1])s(0,x*4.5,v,.12,"#cccccc",.35);for(const x of[-1,1])s(0,x*8.6,v,.14,"#dddddd",.4)}const a=4,l=10;for(const v of T1){const x=Tc(v)*2;if(!x)continue;const _=Math.floor(x/l),A=-(_*l)/2;for(let R=0;R<_;R++)s(v,A+a/2+R*l,.12,a,"#bbbbbb",.3),s(A+a/2+R*l,v,a,.12,"#bbbbbb",.3);for(const R of[-1,1])s(v+R*4.6,0,.12,x,"#dddddd",.32),s(0,v+R*4.6,x,.12,"#dddddd",.32)}const u="#333028",h=.7,p=(v,x)=>{const _=Tc(v)*2;if(_)for(const A of[-1,1])s(v+A*x/2,0,.18,_,u,h)},m=(v,x)=>{const _=Tc(v)*2;if(_)for(const A of[-1,1])s(0,v+A*x/2,_,.18,u,h)};p(0,cx),m(0,cx);for(const v of T1)p(v,ux),m(v,ux);for(const v of xC)p(v,fx),m(v,fx);return n},[]),t=q.useMemo(()=>[{x:0,z:0,or:16,ir:7},{x:0,z:45,or:10.5,ir:4.5},{x:0,z:-45,or:10.5,ir:4.5},{x:45,z:0,or:10.5,ir:4.5},{x:-45,z:0,or:10.5,ir:4.5},{x:0,z:90,or:9,ir:4},{x:0,z:-90,or:9,ir:4},{x:90,z:0,or:9,ir:4},{x:-90,z:0,or:9,ir:4},{x:45,z:45,or:8.5,ir:3.5},{x:-45,z:45,or:8.5,ir:3.5},{x:45,z:-45,or:8.5,ir:3.5},{x:-45,z:-45,or:8.5,ir:3.5},{x:90,z:45,or:7.5,ir:3},{x:-90,z:45,or:7.5,ir:3},{x:90,z:-45,or:7.5,ir:3},{x:-90,z:-45,or:7.5,ir:3},{x:45,z:90,or:7.5,ir:3},{x:-45,z:90,or:7.5,ir:3},{x:45,z:-90,or:7.5,ir:3},{x:-45,z:-90,or:7.5,ir:3},{x:90,z:90,or:6.5,ir:2.5},{x:-90,z:90,or:6.5,ir:2.5},{x:90,z:-90,or:6.5,ir:2.5},{x:-90,z:-90,or:6.5,ir:2.5}],[]);return b.jsxs("group",{children:[i.map((n,s)=>b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[n.x,n.y??RG,n.z],receiveShadow:!0,children:[b.jsx("planeGeometry",{args:[n.pw,n.ph]}),b.jsx("meshStandardMaterial",{color:n.col,roughness:.93,metalness:.02})]},`rs${s}`)),e.map((n,s)=>b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[n.x,BG,n.z],children:[b.jsx("planeGeometry",{args:[n.pw,n.ph]}),b.jsx("meshBasicMaterial",{color:n.col,transparent:!0,opacity:n.op,depthWrite:!1})]},`mk${s}`)),t.map((n,s)=>b.jsx(PG,{x:n.x,z:n.z,outerR:n.or,innerR:n.ir},`rb${s}`))]})}function PG({x:i,z:e,outerR:t,innerR:n}){return b.jsxs("group",{position:[i,IG,e],children:[b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],receiveShadow:!0,children:[b.jsx("ringGeometry",{args:[n,t,64]}),b.jsx("meshStandardMaterial",{color:"#060409",roughness:.9,metalness:.02})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.001,0],children:[b.jsx("ringGeometry",{args:[(n+t)/2-.12,(n+t)/2+.12,64]}),b.jsx("meshBasicMaterial",{color:"#888880",transparent:!0,opacity:.3,depthWrite:!1})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.001,0],receiveShadow:!0,children:[b.jsx("circleGeometry",{args:[n,56]}),b.jsx("meshStandardMaterial",{color:"#181614",roughness:.88,metalness:.04})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.002,0],children:[b.jsx("ringGeometry",{args:[n-.45,n,56]}),b.jsx("meshBasicMaterial",{color:"#aaaaaa",transparent:!0,opacity:.55,depthWrite:!1})]}),b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],position:[0,.003,0],children:[b.jsx("circleGeometry",{args:[Math.max(.5,n*.18),32]}),b.jsx("meshBasicMaterial",{color:"#cccccc",transparent:!0,opacity:.2,depthWrite:!1})]})]})}function OG({position:i,flagId:e,color:t}){const n=q.useRef(null),s=q.useRef(null);tn(x=>x.syncRevision);const a=tn.getState().flags.get(e);ps((x,_)=>{const A=tn.getState().flags.get(e);if(n.current.rotation.y+=_*2,s.current){const R=s.current.material;
4387R.emissiveIntensity=A?.isBeingCaptured?2+Math.sin(Date.now()*.006)*1.2:.5}});const l=a?.ownerId?"#ffe600":t,u=a?.isBeingCaptured?"#ffffff":l,h=(a?.captureProgress??0)*Math.PI*2,p=a?.ownerId?tn.getState().allPlayers.get(a.ownerId):void 0,m=p?.displayName??(a?.ownerId?a.ownerId.slice(0,5):""),v=p?sg(p.countryCode):"";return b.jsxs("group",{position:i,children:[b.jsxs("mesh",{position:[0,1.5,0],castShadow:!0,receiveShadow:!0,children:[b.jsx("cylinderGeometry",{args:[.05,.05,3]}),b.jsx("meshStandardMaterial",{color:"#aaa",metalness:.8,roughness:.2})]}),b.jsxs("mesh",{ref:n,position:[0,2.8,0],castShadow:!0,children:[b.jsx("boxGeometry",{args:[.6,.4,.05]}),b.jsx("meshStandardMaterial",{color:l,emissive:l,emissiveIntensity:1})]}),b.jsxs("mesh",{ref:s,rotation:[-Math.PI/2,0,0],receiveShadow:!0,children:[b.jsx("ringGeometry",{args:[1.4,1.6,32]}),b.jsx("meshStandardMaterial",{color:u,emissive:u,emissiveIntensity:.5,transparent:!0,opacity:.6})]}),a?.isBeingCaptured&&h>0&&b.jsxs("mesh",{rotation:[-Math.PI/2,0,0],receiveShadow:!0,children:[b.jsx("ringGeometry",{args:[1.8,2.1,48,1,0,h]}),b.jsx("meshStandardMaterial",{color:"#ffffff",emissive:"#ffffff",emissiveIntensity:3,transparent:!0,opacity:.9})]}),m?b.jsx(yM,{position:[0,3.3,0],center:!0,style:{pointerEvents:"none"},children:b.jsxs("div",{style:{background:"rgba(4,6,10,0.7)",border:"1px solid rgba(0,245,255,0.45)",borderRadius:4,padding:"2px 8px",fontSize:11,fontWeight:700,color:"#dff9ff",whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[v?b.jsx("span",{style:{lineHeight:1},children:v}):null,b.jsx("span",{children:m})]})}):null]})}const NG=`
4388  varying vec2 vUv;
4389  varying vec3 vWorldNormal;
4390  void main() {
4391    vUv = uv;
4392    vWorldNormal = normalize((modelMatrix * vec4(normal, 0.0)).xyz);
4393    gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
4394  }
4395`,UG=`
4396  uniform vec3 uNeon;
4397  uniform vec3 uBase;
4398  uniform float uFloors;
4399  uniform float uWins;
4400  uniform float uSeed;
4401  uniform float uGrime;
4402  varying vec2 vUv;
4403  varying vec3 vWorldNormal;
4404
4405  float hash(float n) { return fract(sin(n * 127.1 + 48.9) * 43758.5); }
4406  float h2(float n) { return hash(n + 19.0); }
4407
4408  void main() {
4409    if (abs(vWorldNormal.y) > 0.6) {
4410      gl_FragColor = vec4(uBase * (0.38 + 0.2 * uGrime), 1.0);
4411      return;
4412    }
4413    float fi = vUv.y * uFloors;
4414    float wi = vUv.x * uWins;
4415    float fy = fract(fi);
4416    float wx = fract(wi);
4417    float inFrame = step(0.18, fy) * (1.0 - step(0.82, fy))
4418      * step(0.10, wx) * (1.0 - step(0.90, wx));
4419
4420    float wId = floor(fi) * 64.0 + floor(wi) + uSeed;
4421    float lit = hash(wId);
4422    float brk = h2(wId * 0.7);
4423
4424    float rowSt = hash(floor(fi) * 1.1 + uSeed);
4425    float colSt = hash(floor(wi) * 0.8 + uSeed);
4426    float stain = 0.75 + 0.25 * rowSt;
4427    float drip = 0.82 + 0.18 * colSt * (1.0 - fy) * 0.6;
4428    vec3 wall = uBase * stain * (0.85 + 0.15 * uGrime) * drip;
4429
4430    if (inFrame < 0.5) {
4431      float streak = 0.88 + 0.12 * sin(floor(fi) * 1.1 + uSeed) * 0.5;
4432      gl_FragColor = vec4(wall * streak, 1.0);
4433      return;
4434    }
4435    if (brk > 0.94) {
4436      gl_FragColor = vec4(mix(wall, vec3(0.02,0.02,0.04), 0.78), 1.0);
4437      return;
4438    }
4439    if (lit < 0.56) {
4440      vec3 darkWin = wall * 0.28 + vec3(0.01,0.01,0.02);
4441      gl_FragColor = vec4(mix(wall, darkWin, 0.8), 1.0);
4442      return;
4443    }
4444    if (lit < 0.86) {
4445      float d = 0.05 + 0.1 * h2(wId);
4446      vec3 nlow = uNeon * d * 0.5;
4447      gl_FragColor = vec4(mix(wall, nlow + wall * 0.25, 0.5), 1.0);
4448      return;
4449    }
4450    float d2 = 0.18 + 0.12 * h2(wId);
4451    vec3 nmid = uNeon * d2 * 0.5;
4452    gl_FragColor = vec4(mix(wall, nmid + wall * 0.2, 0.42), 1.0);
4453  }
4454`,zG={skyscraper:"#00f5ff",tower:"#ff2d7a",apartment:"#ffe600",warehouse:"#ff8800",shop:"#88ff22"},FG=new Pt("#05060a"),kG=[{x:16,z:16,w:5,d:5,h:20,type:"tower"},{x:16,z:28,w:5,d:5,h:8,type:"apartment"},{x:28,z:16,w:5,d:5,h:10,type:"apartment"},{x:16,z:37,w:5,d:4,h:5,type:"shop"},{x:37,z:16,w:4,d:5,h:5,type:"shop"},{x:37,z:28,w:4,d:5,h:7,type:"warehouse"},{x:28,z:37,w:5,d:4,h:7,type:"warehouse"},{x:37,z:37,w:4,d:4,h:28,type:"skyscraper"},{x:52,z:16,w:4,d:4,h:20,type:"tower"},{x:52,z:28,w:4,d:5,h:24,type:"tower"},{x:52,z:37,w:4,d:4,h:16,type:"apartment"},{x:52,z:52,w:5,d:5,h:44,type:"skyscraper"},{x:16,z:52,w:4,d:5,h:18,type:"tower"},{x:28,z:52,w:5,d:4,h:22,type:"tower"},{x:37,z:52,w:4,d:4,h:14,type:"apartment"},{x:61,z:16,w:5,d:5,h:26,type:"tower"},{x:61,z:37,w:5,d:5,h:20,type:"apartment"},{x:61,z:61,w:5,d:5,h:52,type:"skyscraper"},{x:37,z:61,w:5,d:5,h:22,type:"tower"},{x:16,z:61,w:5,d:4,h:16,type:"apartment"},{x:80,z:28,w:6,d:6,h:38,type:"skyscraper"},{x:28,z:80,w:6,d:6,h:34,type:"skyscraper"},{x:80,z:80,w:7,d:7,h:62,type:"skyscraper"},{x:80,z:52,w:5,d:6,h:30,type:"tower"},{x:52,z:80,w:6,d:5,h:28,type:"tower"},{x:61,z:80,w:5,d:6,h:22,type:"apartment"},{x:80,z:61,w:6,d:5,h:26,type:"apartment"}];function HG(){const i=q.useMemo(()=>{const e=[[1,1],[-1,1],[1,-1],[-1,-1]];return kG.flatMap(t=>e.map(([n,s])=>({...t,x:t.x*n,z:t.z*s})))},[]);return b.jsx("group",{children:i.map((e,t)=>
4454b.jsx(GG,{...e},t))})}function GG({x:i,z:e,w:t,d:n,h:s,type:a}){const l=zG[a],u=Math.max(2,Math.floor(s/2.4)),h=Math.max(2,Math.floor(t/1.5)),p=(Math.abs(i)*17+Math.abs(e)*31)%128,m=.52+p%41*.012,v=q.useMemo(()=>new Zi({vertexShader:NG,fragmentShader:UG,uniforms:{uNeon:{value:new Pt(l)},uBase:{value:FG.clone()},uFloors:{value:u},uWins:{value:h},uSeed:{value:p},uGrime:{value:m}}}),[l,u,h,p,m]),x=p%7*.012-.036,_=p*2%9*.01-.04,A=p%3===0;return b.jsx("group",{position:[i,0,e],children:b.jsxs("group",{rotation:[x,0,_],children:[b.jsx("mesh",{position:[0,s/2,0],material:v,castShadow:!0,children:b.jsx("boxGeometry",{args:[t,s,n]})}),b.jsxs("mesh",{position:[0,s+.15,0],castShadow:!0,children:[b.jsx("boxGeometry",{args:[t+.15,.28,n+.15]}),b.jsx("meshBasicMaterial",{color:l,transparent:!0,opacity:.14,depthWrite:!1})]}),s>=6&&b.jsxs("mesh",{position:[0,1.2,n/2+.02],children:[b.jsx("planeGeometry",{args:[t*.72,2]}),b.jsx("meshBasicMaterial",{color:l,transparent:!0,opacity:.08,depthWrite:!1})]}),s>=22&&b.jsxs("mesh",{position:[0,s*.62,n/2+.04],children:[b.jsx("planeGeometry",{args:[t*.5,s*.045]}),b.jsx("meshBasicMaterial",{color:l,transparent:!0,opacity:.18,depthWrite:!1})]}),b.jsx(jG,{w:t,d:n,h:s,neon:l,seed:p}),A&&b.jsxs("group",{children:[b.jsxs("mesh",{position:[t*.22,.2,n*.25],castShadow:!0,receiveShadow:!0,children:[b.jsx("boxGeometry",{args:[t*.45,.35,n*.35]}),b.jsx("meshStandardMaterial",{color:"#1c1916",roughness:.97,metalness:.03})]}),b.jsxs("mesh",{position:[-t*.2,.12,-n*.22],castShadow:!0,children:[b.jsx("boxGeometry",{args:[.5,.22,.6]}),b.jsx("meshStandardMaterial",{color:"#151311",roughness:.98,metalness:.02})]})]})]})})}
4454function jG({w:i,d:e,h:t,neon:n,seed:s}){const a=1.8+s%5*.6,l=(s%2===0?1:-1)*i*.28,u=(s%3===0?1:-1)*e*.28,h=s%3===1,p=s%4!==0;return b.jsxs("group",{position:[0,t,0],children:[b.jsxs("mesh",{position:[l,a/2,u],castShadow:!0,children:[b.jsx("cylinderGeometry",{args:[.04,.05,a,5]}),b.jsx("meshStandardMaterial",{color:"#2a2024",emissive:n,emissiveIntensity:.12,roughness:.9})]}),b.jsxs("mesh",{position:[l,a+.08,u],children:[b.jsx("sphereGeometry",{args:[.06,5,5]}),b.jsx("meshBasicMaterial",{color:"#4a2a1a",transparent:!0,opacity:.7})]}),h&&b.jsxs("group",{position:[-i*.22,0,e*.2],children:[b.jsxs("mesh",{position:[0,.7,0],castShadow:!0,receiveShadow:!0,children:[b.jsx("cylinderGeometry",{args:[.45,.52,1.4,8]}),b.jsx("meshStandardMaterial",{color:"#1e1c28",roughness:.85,metalness:.2})]}),b.jsxs("mesh",{position:[0,1.55,0],castShadow:!0,children:[b.jsx("coneGeometry",{args:[.52,.5,8]}),b.jsx("meshStandardMaterial",{color:"#151420",roughness:.9})]})]}),p&&b.jsxs("mesh",{position:[i*.18,.2,-e*.18],castShadow:!0,receiveShadow:!0,children:[b.jsx("boxGeometry",{args:[.7,.4,.5]}),b.jsx("meshStandardMaterial",{color:"#1a1a22",roughness:.9,metalness:.3})]})]})}const dx=[["電 脳 都 市","CYBER DISTRICT"],["æ ¼ 闘 技 術","COMBAT SYSTEMS"],["量 子 兵 器","QUANTUM ARMS"],["暗 黒 市 å ´","BLACK MARKET"],["ä»® 想 現 実","VIRTUAL REALITY"],["改 造 å·¥ å ´","MOD FACTORY"],["ネ オ ン å
4454¤œ","NEON NIGHT"],["危 険 区 域","DANGER ZONE"],["戦 争 機 械","WAR MACHINE"],["æ­» の 都 市","CITY OF DEATH"],["超 電 導 体","SUPERCONDUCTOR"],["記 憶 売 è²·","MEMORY TRADE"],["逃 亡 者 達","THE FUGITIVES"],["å¹½ 霊 部 隊","GHOST SQUAD"],["æ ¸ 爆 発 点","GROUND ZERO"]];function VG(i,e,t,n=512,s=256){const a=document.createElement("canvas");a.width=n,a.height=s;const l=a.getContext("2d");l.fillStyle="#05030a",l.fillRect(0,0,n,s),l.strokeStyle=t,l.lineWidth=6,l.strokeRect(4,4,n-8,s-8),l.lineWidth=2,l.globalAlpha=.4,l.strokeRect(12,12,n-24,s-24),l.globalAlpha=1,l.font="bold 88px serif",l.textAlign="center",l.fillStyle=t,l.shadowColor=t,l.shadowBlur=22,l.fillText(i,n/2,s*.52),l.font="bold 28px monospace",l.fillStyle="#ffffff",l.shadowBlur=8,l.fillText(e,n/2,s*.82),l.globalAlpha=.06,l.fillStyle="#000000";for(let u=0;u<s;u+=4)l.fillRect(0,u,n,2);return l.globalAlpha=1,new pg(a)}function WG({position:i,rotY:e=0,textIdx:t,neon:n,pw:s=8,ph:a=4,postH:l=5}){const u=q.useMemo(()=>VG(dx[t%dx.length][0],dx[t%dx.length][1],n),[t,n]),h=q.useRef(null),p=q.useRef(null);ps(({clock:_})=>{const A=_.elapsedTime,R=.88+.12*Math.abs(Math.sin(A*2.1+i[0])*Math.sin(A*1.4+i[2]));h.current&&(h.current.material.opacity=.72*R),p.current&&(p.current.material.opacity=.42*R)});const m=n,v=l/2,x=l+a/2;return b.jsxs("group",{position:i,rotation:[0,e,0],children:[b.jsxs("mesh",{position:[0,v,0],castShadow:!0,receiveShadow:!0,children:[b.jsx("boxGeometry",{args:[.22,l,.22]}),b.jsx("meshStandardMaterial",{color:"#1a1820",roughness:.7,metalness:.6})]}),b.jsxs("mesh",{position:[0,l-.15,0],castShadow:!0,children:[b.jsx("boxGeometry",{args:[s*.82,.18,.18]}),b.jsx("meshStandardMaterial",{color:"#201e28",roughness:.7,metalness:.5})]}),b.jsxs("mesh",{ref:p,position:[0,x,.06],castShadow:!0,children:[b.jsx("boxGeometry",{args:[s+.3,a+.3,.08]}),b.jsx("meshBasicMaterial",{color:m,transparent:!0,opacity:.65})]}),b.jsxs("mesh",{ref:h,position:[0,x,.12],children:[b.jsx("planeGeometry",{args:[s,a]}),b.jsx("meshBasicMaterial",{map:u,transparent:!0,opacity:.72,depthWrite:!1})]})]})}const XG=[{position:[-42,0,0],rotY:Math.PI/2,textIdx:0,neon:"#00f5ff",pw:5.5,ph:2.8,postH:4},{position:[42,0,0],rotY:-Math.PI/2,textIdx:1,neon:"#ff2d7a",pw:5.5,ph:2.8,postH:4},{position:[0,0,-42],rotY:0,textIdx:2,neon:"#ffe600",pw:5.5,ph:2.8,postH:4},{position:[0,0,42],rotY:Math.PI,textIdx:3,neon:"#8040c8",pw:5.5,ph:2.8,postH:4}];function w1(i,e,t,n,s,a){const l=s==="heavy"?1.3:s==="slim"?.78:1,u=30*l,h=80*l,p=18*l,m=s==="heavy"?u*2:u*1.35;i.fillStyle=n,i.shadowColor=n,i.shadowBlur=24,i.fillRect(e-u*.45,t-h*.52,u*.38,h*.52),i.fillRect(e+u*.07,t-h*.52,u*.38,h*.52),i.fillRect(e-u/2,t-h,u,h*.54),i.fillRect(e-m/2,t-h,m,h*.14),i.beginPath(),i.arc(e,t-h-p*.55,p,0,Math.PI*2),i.fill(),i.fillStyle="rgba(0,0,0,0.55)",i.fillRect(e-p*.72,t-h-p*.82,p*1.44,p*.38),i.fillStyle=n,a==="pistol"?(i.fillRect(e+u*.5,t-h*.72,u*.65,h*.08),i.fillRect(e+u*.65,t-h*.72,u*.1,h*.12)):a==="machinegun"?(i.fillRect(e+u*.5,t-h*.74,u*1.5,h*.11),i.fillRect(e+u*.5,t-h*.85,u*.45,h*.09),i.fillRect(e+u*.82,t-h*.74+h*.11,u*.38,h*.18)):(i.save(),i.translate(e+u*.5,t-h*.78),i.rotate(-Math.PI/4.5),i.fillRect(-h*.055,-h*.88,h*.055,h*.95),i.fillRect(-h*.13,-h*.1,h*.26,h*.055),i.restore())}function qG(i,e,t,n){i.fillStyle="#ffd700",i.shadowColor="#ffaa00",i.shadowBlur=38,i.beginPath(),i.moveTo(e-n/2,t+n*.06),i.lineTo(e+n/2,t+n*.06),i.lineTo(e+n/2,t-n*.28),i.lineTo(e+n*.44,t-n*.78),i.lineTo(e+n*.24,t-n*.42),i.lineTo(e,t-n),i.lineTo(e-n*.24,t-n*.42),i.lineTo(e-n*.44,t-n*.78),i.lineTo(e-n/2,t-n*.28),i.closePath(),i.fill(),[[e-n*.28,t-n*.44,"#ff4444"],[e,t-n*.5,"#00ccff"],[e+n*.28,t-n*.44,"#ff4444"]].forEach(([a,l,u])=>{i.fillStyle=u,i.shadowColor=u,i.shadowBlur=18,i.beginPath(),i.arc(a,l,n*.065,0,Math.PI*2),i.fill()})}function YG(i,e,t,n){i.beginPath();for(let s=0;s<5;s++){const a=s*Math.PI*2/5-Math.PI/2,l=a+Math.PI/5;i.lineTo(e+n*Math.cos(a),t+n*Math.sin(a)),i.lineTo(e+n*.4*Math.cos(l),t+n*.4*Math.sin(l))}i.closePath(),i.fill()}function JG(){const t=document.createElement("canvas");t.width=1024,t.height=512;const n=t.getContext("2d"),s=n.createLinearGradient(0,512,1024,0);s.addColorStop(0,"#010a08"),s.addColorStop(1,"#010c14"),n.fillStyle=s,n.fillRect(0,0,1024,512),n.strokeStyle="rgba(34,255,68,0.055)",n.lineWidth=1;for(let a=0;a<1024;a+=40)n.beginPath(),n.moveTo(a,0),n.lineTo(a,512),n.stroke();for(let a=0;a<512;a+=40)n.beginPath(),n.moveTo(0,a),n.lineTo(1024,a),n.stroke();n.strokeStyle="#22ff44",n.lineWidth=9,n.shadowColor="#22ff44",n.shadowBlur=22,n.strokeRect(5,5,1014,502),n.lineWidth=2,n.globalAlpha=.32,n.strokeRect(18,18,988,476),n.globalAlpha=1,n.shadowBlur=0,n.font="bold 100px monospace",n.textAlign="center",n.fillStyle="#22ff44",n.shadowColor="#22ff44",n.shadowBlur=38,n.fillText("CURSOR",1024/2,118),n.font="bold 76px monospace",n.fillStyle="#00ccff",n.shadowColor="#00ccff",n.shadowBlur=28,n.fillText("VIBE  JAM",1024/2,208),n.font="bold 188px monospace",n.fillStyle="#ffffff",n.shadowColor="#22ff44",n.shadowBlur=65,n.fillText("2026",1024/2,418),n.shadowBlur=0,n.strokeStyle="#22ff44",n.lineWidth=2,n.globalAlpha=.45,n.beginPath(),n.moveTo(80,140),n.lineTo(944,140),n.stroke(),n.beginPath(),n.moveTo(80,232),n.lineTo(944,232),n.stroke(),n.globalAlpha=1,n.font="21px monospace",n.fillStyle="#88ffaa",n.shadowBlur=0,n.fillText("◆  POWERED BY CURSOR AI  ·  GAME JAM COMPETITION  ◆",1024/2,478),n.globalAlpha=.045,n.fillStyle="#000";for(let a=0;a<512;a+=3)n.fillRect(0,a,1024,1);return n.globalAlpha=1,new pg(t)}function KG(){const t=document.createElement("canvas");t.width=1024,t.height=512;const n=t.getContext("2d"),s=n.createLinearGradient(0,0,0,512);s.addColorStop(0,"#050010"),s.addColorStop(.6,"#0a001c"),s.addColorStop(1,"#020008"),n.fillStyle=s,n.fillRect(0,0,1024,512);for(let u=0;u<65;u++){const h=(Math.sin(u*137.5)*.5+.5)*1024|0,p=(Math.sin(u*89.3+1.1)*.5+.5)*512|0;n.fillStyle=`rgba(255,255,255,${.1+u%5*.09})`,n.beginPath(),n.arc(h,p,u%3===0?2:1,0,Math.PI*2),n.fill()}const a=n.createRadialGradient(1024/2,80,0,1024/2,80,280);a.addColorStop(0,"rgba(128,0,255,0.26)"),a.addColorStop(1,"rgba(128,0,255,0)"),n.fillStyle=a,n.fillRect(0,0,1024,200),n.font="bold 86px serif",n.textAlign="center",n.fillStyle="#ffffff",n.shadowColor="#8800ff",n.shadowBlur=48,n.fillText("ECLIPSE PROTOCOL",1024/2,96),n.font="bold 24px monospace",n.fillStyle="#bb88ff",n.shadowBlur=14,n.fillText("◆  CYBERPUNK ARENA SHOOTER  ◆",1024/2,138),n.strokeStyle="#8800ff",n.lineWidth=1,n.globalAlpha=.38,n.beginPath(),n.moveTo(1024/3,160),n.lineTo(1024/3,500),n.stroke(),n.beginPath(),n.moveTo(2*1024/3,160),n.lineTo(2*1024/3,500),n.stroke(),n.globalAlpha=1,n.shadowBlur=0;const l=400;return w1(n,182,l,"#00ccff","slim","pistol"),w1(n,1024/2,l,"#ff3333","heavy","machinegun"),w1(n,842,l,"#ffe600","medium","sword"),n.font="bold 22px monospace",n.shadowBlur=12,n.fillStyle="#00ccff",n.fillText("SHADOW RUNNER",182,l+30),n.fillStyle="#ff3333",n.fillText("PULSE TANK",1024/2,l+30),n.fillStyle="#ffe600",n.fillText("NEON STRIKER",842,l+30),n.font="15px monospace",n.shadowBlur=5,n.fillStyle="#6699ff",n.fillText("SPD:████████░░  HP:████░░░░░░",182,l+50),n.fillStyle="#ff7777",n.fillText("SPD:████░░░░░░  HP:██████████",1024/2,l+50),n.fillStyle="#ffdd44",n.fillText("SPD:██████░░░░  HP:██████░░░░",842,l+50),n.strokeStyle="#8800ff",n.lineWidth=8,n.shadowColor="#8800ff",n.shadowBlur=28,n.strokeRect(5,5,1014,502),n.lineWidth=2,n.strokeStyle="#aa55ff",n.shadowBlur=0,[[22,22],[1002,22],[22,490],[1002,490]].forEac
4454h(([u,h])=>{n.beginPath(),n.moveTo(u-18,h),n.lineTo(u+18,h),n.moveTo(u,h-18),n.lineTo(u,h+18),n.stroke()}),new pg(t)}function ZG(){const t=document.createElement("canvas");t.width=1024,t.height=512;const n=t.getContext("2d"),s=n.createLinearGradient(0,0,1024,512);s.addColorStop(0,"#130800"),s.addColorStop(.5,"#1e0e00"),s.addColorStop(1,"#090400"),n.fillStyle=s,n.fillRect(0,0,1024,512);const a=n.createRadialGradient(1024/2,512/2,0,1024/2,512/2,320);a.addColorStop(0,"rgba(255,200,0,0.23)"),a.addColorStop(.5,"rgba(255,130,0,0.08)"),a.addColorStop(1,"rgba(255,80,0,0)"),n.fillStyle=a,n.fillRect(0,0,1024,512),qG(n,1024/2,158,110),n.font="bold 90px serif",n.textAlign="center",n.fillStyle="#ffd700",n.shadowColor="#ff8800",n.shadowBlur=55,n.fillText("★  WINNER  ★",1024/2,260),n.font="bold 62px serif",n.fillStyle="#ffffff",n.shadowColor="#ffd700",n.shadowBlur=32,n.fillText("ECLIPSE PROTOCOL",1024/2,338),n.font="bold 40px monospace",n.fillStyle="#ffaa00",n.shadowColor="#ff6600",n.shadowBlur=20,n.fillText("CURSOR VIBE JAM 2026",1024/2,400),n.shadowBlur=8,n.strokeStyle="#ffd700",n.lineWidth=2,n.globalAlpha=.42,n.beginPath(),n.moveTo(60,278),n.lineTo(964,278),n.stroke(),n.globalAlpha=1,n.strokeStyle="#ffd700",n.lineWidth=9,n.shadowColor="#ffd700",n.shadowBlur=38,n.strokeRect(5,5,1014,502),n.lineWidth=3,n.globalAlpha=.38,n.strokeRect(20,20,984,472),n.globalAlpha=1,n.fillStyle="#ffd700",n.shadowColor="#ff8800",n.shadowBlur=16;for(let l=0;l<9;l++)YG(n,80+l*864/8,464,14);n.globalAlpha=.045,n.fillStyle="#000";for(let l=0;l<512;l+=3)n.fillRect(0,l,1024,1);return n.globalAlpha=1,new pg(t)}function C1({position:i,rotY:e=0,tex:t,neon:n,pw:s=14,ph:a=7,postH:l=3}){const u=q.useRef(null);ps(({clock:m})=>{u.current&&(u.current.intensity=1.8+.35*Math.sin(m.elapsedTime*1.1))});const h=l+a/2,p=l/2;return b.jsxs("group",{position:i,rotation:[0,e,0],children:[l>0&&b.jsxs(b.Fragment,{children:[b.jsxs("mesh",{position:[0,p,0],children:[b.jsx("boxGeometry",{args:[.24,l,.24]}),b.jsx("meshStandardMaterial",{color:"#1c1828",roughness:.65,metalness:.7})]}),b.jsxs("mesh",{position:[0,l-.12,0],children:[b.jsx("boxGeometry",{args:[s*.84,.2,.2]}),b.jsx("meshStandardMaterial",{color:"#231f30",roughness:.65,metalness:.55})]})]}),b.jsxs("mesh",{position:[0,h,.07],children:[b.jsx("boxGeometry",{args:[s+.5,a+.5,.1]}),b.jsx("meshBasicMaterial",{color:n,transparent:!0,opacity:.32})]}),b.jsxs("mesh",{position:[0,h,.16],children:[b.jsx("planeGeometry",{args:[s,a]}),b.jsx("meshBasicMaterial",{map:t})]}),b.jsx("pointLight",{ref:u,position:[0,h,1.2],color:n,intensity:1.8,distance:14,decay:2.2})]})}function QG(){const i=q.useMemo(()=>JG(),[]),e=q.useMemo(()=>KG(),[]),t=q.useMemo(()=>ZG(),[]);return b.jsxs("group",{children:[b.jsx(C1,{position:[-35,0,3],rotY:Math.PI/2,tex:i,neon:"#22ff44",pw:11,ph:5.5,postH:3.5}),b.jsx(C1,{position:[-3,0,-35],rotY:0,tex:e,neon:"#8800ff",pw:11,ph:5.5,postH:3.5}),b.jsx(C1,{position:[0,0,-14],rotY:0,tex:t,neon:"#c9a227",pw:10,ph:5,postH:5})]})}function $G(){return b.jsxs("group",{children:[XG.map((i,e)=>b.jsx(WG,{...i},`bb${e}`)),b.jsx(QG,{})]})}function ej(){const i=q.useRef(0);return ps((e,t)=>{i.current+=t*.04;const n=80,s=28,a=Math.sin(i.current)*n,l=Math.cos(i.current)*n;e.camera.position.set(a,s,l),e.camera.lookAt(0,4,0)}),null}function tj(){return b.jsxs(mM,{gl:{antialias:!0,toneMappingExposure:2.8},camera:{fov:60,near:.1,far:500,position:[80,28,0]},style:{position:"absolute",inset:0,zIndex:0},children:[b.jsx("ambientLight",{intensity:1.1,color:"#4a1e3a"}),b.jsx("hemisphereLight",{color:"#c04820",groundColor:"#2a0c1e",intensity:1.4}),b.jsx("directionalLight",{position:[0,80,-190],intensity:1.8,color:"#ff7a40"}),b.jsx(W3,{}),b.jsx(ej,{}),b.jsx(P3,{children:b.jsx(O3,{intensity:1.2,luminanceThreshold:.12,luminanceSmoothing:.85,mipmapBlur:!0})})]})}function zi({position:i,size:e,color:t,intensity:n=1.4}){return b.jsxs("mesh",{position:i,renderOrder:1,children:[b.jsx("boxGeometry",{args:e}),b.jsx("meshStandardMaterial",{color:t,emissive:t,emissiveIntensity:n,roughness:.2,metalness:.8,toneMapped:!1})]})}function nj({color:i,anim:e,proceduralScale:t=1}){const n=q.useRef(null),s=q.useRef(null),a=q.useRef(null),l=q.useRef(null),u=q.useRef(null),h=q.useRef(null),p=q.useRef(null),m=q.useRef(null),v=q.useRef(null),x=q.useRef(null),_=q.useRef(null),A=q.useRef(null),R=q.useRef(null),w=q.useRef(null),E=q.useRef(null),D=q.useRef(0);ps((J,le)=>{const ae=Math.min(le,.05),W=e.isMoving.current,ee=e.isRunning.current,te=e.isCrouching.current,ue=e.isJumping?.current??!1,he=e.equippedWeapon?.current??"none";W&&!ue&&(D.current+=ae*(ee?10.8:6.5));const K=W&&!ue?Math.sin(D.current):0,re=K*(ee?.8:.5),oe=1-Math.exp(-14*ae),we=1-Math.exp(-9*ae),Be=.13,pe=ee?.6:.28,Re=Be+pe*Math.abs(K);let lt=re,ct=-re,vt=Math.max(0,re*.5+Re),qt=Math.max(0,-re*.5+Re);const Wt=Be+pe*.42*Math.abs(K);let de=-re*.65,an=re*.65,$e=Wt,Qe=Wt;const Ye=ee&&W?-.14:0,pt=W?re*(ee?.045:.022):0;let Ve=0,ne=0;const V=e.shootPhase?.current??0,Ie=1-(e.aimPhase?.current??0),et=Ie<.35?Ie/.35:1,Fe=V*.32;if(!ue&&!te)if(he==="laser_rifle"){const gn=-.52+et*-.76,En=-.84+et*(-1.05- -.84);
4454an+=gn+Fe*.2,Qe+=.42-et*.1,de+=En,$e+=.58+et*.08,Ve=-et*.1+Fe*.06,ne=-et*.08}else he==="light_saber"&&(an+=-.6,Qe+=.25,de+=-.2);u.current.rotation.z=vn.lerp(u.current.rotation.z,he==="laser_rifle"?.44:0,oe),p.current.rotation.z=vn.lerp(p.current.rotation.z,he==="laser_rifle"?-.16:0,oe*.8);const Rt=ee?.042:.017;s.current.position.y=W&&!ue?Math.sin(D.current*2)*Rt:vn.lerp(s.current.position.y,0,oe),s.current.rotation.x=vn.lerp(s.current.rotation.x,Ye+Ve,we),s.current.rotation.z=vn.lerp(s.current.rotation.z,pt,we),l.current.rotation.x=vn.lerp(l.current.rotation.x,W?Math.sin(D.current*2)*(ee?.068:.034):0,we),a.current.rotation.x=vn.lerp(a.current.rotation.x,(ee&&W?.09:0)+ne,1-Math.exp(-8*ae)),a.current.rotation.z=vn.lerp(a.current.rotation.z,-pt*.45,1-Math.exp(-6*ae)),ue&&(lt=vn.lerp(lt,-.24,oe),ct=vn.lerp(ct,-.24,oe),vt=vn.lerp(vt,.65,oe),qt=vn.lerp(qt,.65,oe));const qe=e.punchPhase?.current??0,yt=e.punchPhase2?.current??0,At=e.punchPhase3?.current??0;let it=0,Oe=0,Ct=0,Ft=0,ft=0;if(qe>0){const Dt=1-qe,Tt=Dt<.42?Dt/.42:1-(Dt-.42)/.58;Ct+=-Tt*1.7,ft-=Tt*.6,it+=Tt*.2}if(yt>0){const Dt=1-yt,Tt=Dt<.38?Dt/.38:1-(Dt-.38)/.62;Oe+=-Tt*1.75,Ft-=Tt*.55,it-=Tt*.32,Ct+=Tt*.3}if(At>0){const Dt=1-At;let Tt;Dt<.3?Tt=Dt/.3:Dt<.62?Tt=1:Tt=1-(Dt-.62)/.38;const gn=Dt<.18?Dt/.18:0;Ct+=Tt*-2.1+gn*.55,ft-=Tt*.35,Oe+=Tt*.4,it+=Tt*.4,s.current.rotation.x=vn.lerp(s.current.rotation.x,Ye+Tt*-.22,.55)}const Zt=e.saberPhase1?.current??0,sn=e.saberPhase2?.current??0,cn=e.saberPhase3?.current??0,_e=e.saberPhase4?.current??0,Bt=Zt>0||sn>0||cn>0||_e>0;if(Zt>0){const Dt=1-Zt,Tt=Dt<.22?Dt/.22:0,gn=Dt<.22?0:Dt<.62?(Dt-.22)/.4:1-(Dt-.62)/.38;Ct+=Tt*.55-gn*2.3,ft-=gn*.55,h.current.rotation.z=vn.lerp(h.current.rotation.z,-Tt*.1-gn*.18,.6),s.current.rotation.x=vn.lerp(s.current.rotation.x,Ye-gn*.3,.55),it+=gn*.22}if(sn>0){const Dt=1-sn,Tt=Dt<.3?Dt/.3:1-(Dt-.3)/.7;Ct+=-Tt*1.15,h.current.rotation.z=vn.lerp(h.current.rotation.z,Tt*-.95,.65),it+=Tt*.62,Oe-=Tt*.4}if(cn>0){const Dt=1-cn,Tt=Dt<.32?Dt/.32:1-(Dt-.32)/.68;Ct+=-Tt*2.1,h.current.rotation.z=vn.lerp(h.current.rotation.z,Tt*.72,.65),it-=Tt*.52,Oe-=Tt*.38}if(_e>0){const Dt=1-_e,Tt=Dt<.28?Dt/.28:Dt<.55?1:1-(Dt-.55)/.45;Ct+=-Tt*1.65,Oe+=-Tt*.95,ft-=Tt*.72,Ft-=Tt*.42,s.current.rotation.x=vn.lerp(s.current.rotation.x,Ye-Tt*.35,.58)}Bt||(h.current.rotation.z=vn.lerp(h.current.rotation.z,0,.12));const Ue=qe>0||yt>0||At>0||Bt;s.current.rotation.y=vn.lerp(s.current.rotation.y,Ue?it:0,Ue?.65:.14);const nt=e.kickPhase?.current??0,bt=e.kickPhase2?.current??0;if(nt>0){const Dt=1-nt;let Tt=0,gn=0;if(Dt<.34){const En=Dt/.34;Tt=En*1.42,gn=En*.44}else if(Dt<.58){const En=(Dt-.34)/.24;Tt=vn.lerp(1.42,1.1,En),gn=vn.lerp(.44,-.62,En)}else{const En=(Dt-.58)/.42;Tt=vn.lerp(1.1,0,En),gn=vn.lerp(-.62,0,En)}ct+=Tt,qt+=gn,s.current.rotation.x=vn.lerp(s.current.rotation.x,Dt<.58?.14:Ye,.45),de-=Dt*.35}if(bt>0){const Dt=1-bt;let Tt=0,gn=0;if(Dt<.32){const En=Dt/.32;Tt=En*1.26,gn=En*.38}else if(Dt<.56){const En=(Dt-.32)/.24;Tt=vn.lerp(1.26,.9,En),gn=vn.lerp(.38,-.58,En)}else{const En=(Dt-.56)/.44;Tt=vn.lerp(.9,0,En),gn=vn.lerp(-.58,0,En)}lt+=Tt,vt+=gn,s.current.rotation.z=vn.lerp(s.current.rotation.z,pt+Dt*.09,.45),an-=Dt*.28}u.current.rotation.x=vn.lerp(u.current.rotation.x,de+Oe,oe),h.current.rotation.x=vn.lerp(h.current.rotation.x,an+Ct,oe),p.current.rotation.x=vn.lerp(p.current.rotation.x,$e+Ft,oe),m.current.rotation.x=vn.lerp(m.current.rotation.x,Qe+ft,oe),v.current.rotation.x=vn.lerp(v.current.rotation.x,lt,oe),x.current.rotation.x=vn.lerp(x.current.rotation.x,ct,oe),_.current.rotation.x=vn.lerp(_.current.rotation.x,vt,oe),A.current.rotation.x=vn.lerp(A.current.rotation.x,qt,oe);const mt=te?.62:1,nn=.91*(mt-1),kn=1-Math.exp(-15*ae);n.current.scale.y=vn.lerp(n.current.scale.y,mt,kn),n.current.position.y=vn.lerp(n.current.position.y,nn,kn),R.current&&(R.current.visible=he==="laser_rifle"),w.current&&(w.current.visible=he==="light_saber"),E.current&&(E.current.visible=V>.72)});const L=b.jsx("meshStandardMaterial",{color:"#141820",emissive:"#080c18",emissiveIntensity:.2,roughness:.55,metalness:.65}),P=b.jsx("meshStandardMaterial",{color:"#1e2535",roughness:.65,metalness:.5}),G=b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:1.8,roughness:.25,metalness:.4,toneMapped:!1}),H=b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:5,roughness:.1,metalness:0,toneMapped:!1}),F=b.jsx("meshStandardMaterial",{color:"#0a0a14",roughness:.88,metalness:.05}),X=b.jsx("meshStandardMaterial",{color:"#0d1f2d",emissive:"#061215",emissiveIntensity:.3,roughness:.3,metalness:.9}),z=b.jsx("meshStandardMaterial",{color:"#0e1520",emissive:"#050a10",emissiveIntensity:.3,roughness:.4,metalness:.85}),k=b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:4,roughness:.15,metalness:0,toneMapped:!1}),ie=b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:8,roughness:0,metalness:0,toneMapped:!1}),ve=b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:2.5,transparent:!0,opacity:.3,roughness:0,metalness:0,toneMapped:!1});return b.jsx("group",{scale:[t,t,t],children:b.jsxs("group",{ref:n,children:[b.jsxs("group",{ref:s,children:[b.jsxs("group",{ref:l,position:[0,-.02,0],children:[b.jsxs("mesh",{position:[0,0,0],children:[b.jsx("boxGeometry",{args:[.36,.14,.2]}),L]}),b.jsx(zi,{position:[0,0,.101],size:[.28,.025,.01],color:i,intensity:1.2}),b.jsxs("mesh",{position:[0,0,.102],children:[b.jsx("boxGeometry",{args:[.07,.07,.01]}),G]})]}),b.jsxs("mesh",{castShadow:!0,position:[0,.21,0],children:[b.jsx("boxGeometry",{args:[.46,.28,.22]}),L]}),b.jsxs("mesh",{position:[0,.33,.02],children:[b.jsx("boxGeometry",{args:[.42,.08,.2]}),P]}),b.jsxs("mesh",{position:[0,.22,.115],children:[b.jsx("boxGeometry",{args:[.09,.09,.01]}),G]}),b.jsxs("mesh",{position:[0,.22,.114],children:[b.jsx("boxGeometry",{args:[.13,.13,.005]}),b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:.8,roughness:.3,metalness:.5,toneMapped:!1})]}),b.jsx(zi,{position:[-.14,.24,.112],size:[.08,.18,.008],color:i,intensity:.9}),b.jsx(zi,{position:[.14,.24,.112],size:[.08,.18,.008],color:i,intensity:.9}),b.jsxs("mesh",{position:[0,.38,0],children:[b.jsx("boxGeometry",{args:[.5,.06,.19]}),P]}),b.jsx(zi,{position:[0,.413,.098],size:[.44,.01,.005],color:i,intensity:1}),b.jsxs("mesh",{position:[0,.21,-.01],children:[b.jsx("boxGeometry",{args:[.44,.32,.19]}),L]}),b.jsx(zi,{position:[0,.18,-.107],size:[.04,.28,.005],color:i,intensity:.7}),b.jsxs("mesh",{position:[0,.465,0],children:[b.jsx("boxGeometry",{args:[.13,.09,.13]}),L]}),b.jsxs("mesh",{position:[0,.502,0],children:[b.jsx("boxGeometry",{args:[.17,.025,.17]}),P]}),b.jsxs("group",{ref:a,position:[0,.62,0],children:[b.jsxs("mesh",{castShadow:!0,children:[b.jsx("boxGeometry",{args:[.3,.28,.28]}),L]}),b.jsxs("mesh",{position:[0,-.01,.03],children:[b.jsx("boxGeometry",{args:[.26,.22,.24]}),P]}),b.jsxs("mesh",{position:[0,.03,.148],children:[b.jsx("boxGeometry",{args:[.24,.052,.01
4454]}),H]}),b.jsxs("mesh",{position:[0,.03,.135],children:[b.jsx("boxGeometry",{args:[.22,.038,.01]}),b.jsx("meshStandardMaterial",{color:"#000010",roughness:1,metalness:0})]}),b.jsxs("mesh",{position:[-.13,.03,.142],children:[b.jsx("boxGeometry",{args:[.02,.044,.01]}),H]}),b.jsxs("mesh",{position:[.13,.03,.142],children:[b.jsx("boxGeometry",{args:[.02,.044,.01]}),H]}),b.jsxs("mesh",{position:[0,.156,0],children:[b.jsx("boxGeometry",{args:[.1,.04,.26]}),G]}),b.jsxs("mesh",{position:[0,.17,0],children:[b.jsx("boxGeometry",{args:[.28,.02,.26]}),P]}),b.jsxs("mesh",{position:[-.165,.02,0],children:[b.jsx("boxGeometry",{args:[.03,.16,.14]}),L]}),b.jsx(zi,{position:[-.182,.02,0],size:[.005,.1,.06],color:i,intensity:1.5}),b.jsxs("mesh",{position:[.165,.02,0],children:[b.jsx("boxGeometry",{args:[.03,.16,.14]}),L]}),b.jsx(zi,{position:[.182,.02,0],size:[.005,.1,.06],color:i,intensity:1.5}),b.jsxs("mesh",{position:[0,-.135,.08],children:[b.jsx("boxGeometry",{args:[.2,.04,.14]}),L]})]}),b.jsxs("group",{position:[-.315,.37,0],children:[b.jsxs("mesh",{position:[-.04,.06,0],children:[b.jsx("boxGeometry",{args:[.12,.09,.22]}),X]}),b.jsx(zi,{position:[-.105,.06,0],size:[.005,.07,.18],color:i,intensity:1}),b.jsxs("group",{ref:u,children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.175,0],children:[b.jsx("boxGeometry",{args:[.14,.34,.14]}),L]}),b.jsxs("mesh",{position:[-.075,-.17,0],children:[b.jsx("boxGeometry",{args:[.005,.22,.1]}),P]}),b.jsxs("group",{ref:p,position:[0,-.36,0],children:[b.jsxs("mesh",{position:[0,.01,.08],children:[b.jsx("boxGeometry",{args:[.12,.07,.04]}),G]}),b.jsxs("mesh",{castShadow:!0,position:[0,-.145,0],children:[b.jsx("boxGeometry",{args:[.12,.29,.12]}),L]}),b.jsx(zi,{position:[0,-.1,.063],size:[.08,.16,.005],color:i,intensity:.8}),b.jsxs("mesh",{position:[0,-.305,.01],children:[b.jsx("boxGeometry",{args:[.13,.1,.11]}),L]}),b.jsx(zi,{position:[0,-.29,.062],size:[.11,.03,.005],color:i,intensity:1.3})]})]})]}),b.jsxs("group",{position:[.315,.37,0],children:[b.jsxs("mesh",{position:[.04,.06,0],children:[b.jsx("boxGeometry",{args:[.12,.09,.22]}),X]}),b.jsx(zi,{position:[.105,.06,0],size:[.005,.07,.18],color:i,intensity:1}),b.jsxs("group",{ref:h,children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.175,0],children:[b.jsx("boxGeometry",{args:[.14,.34,.14]}),L]}),b.jsxs("mesh",{position:[.075,-.17,0],children:[b.jsx("boxGeometry",{args:[.005,.22,.1]}),P]}),b.jsxs("group",{ref:m,position:[0,-.36,0],children:[b.jsxs("mesh",{position:[0,.01,.08],children:[b.jsx("boxGeometry",{args:[.12,.07,.04]}),G]}),b.jsxs("mesh",{castShadow:!0,position:[0,-.145,0],children:[b.jsx("boxGeometry",{args:[.12,.29,.12]}),L]}),b.jsx(zi,{position:[0,-.1,.063],size:[.08,.16,.005],color:i,intensity:.8}),b.jsxs("mesh",{position:[0,-.305,.01],children:[b.jsx("boxGeometry",{args:[.13,.1,.11]}),L]}),b.jsx(zi,{position:[0,-.29,.062],size:[.11,.03,.005],color:i,intensity:1.3}),b.jsxs("group",{ref:R,position:[.05,-.3,.02],children:[b.jsxs("mesh",{position:[0,.018,-.12],children:[b.jsx("boxGeometry",{args:[.054,.054,.18]}),z]}),b.jsxs("mesh",{position:[0,.004,-.26],children:[b.jsx("boxGeometry",{args:[.085,.11,.16]}),z]}),b.jsxs("mesh",{position:[0,.07,-.22],children:[b.jsx("boxGeometry",{args:[.06,.03,.12]}),P]}),b.jsxs("mesh",{position:[0,-.004,.07],children:[b.jsx("boxGeometry",{args:[.1,.095,.24]}),z]}),b.jsxs("mesh",{position:[0,-.104,.01],children:[b.jsx("boxGeometry",{args:[.062,.16,.072]}),z]}),b.jsx(zi,{position:[.032,-.104,.01],size:[.005,.135,.062],color:i,intensity:.7}),b.jsxs("mesh",{position:[0,-.062,.055],children:[b.jsx("boxGeometry",{args:[.038,.032,.06]}),P]}),b.jsxs("mesh",{position:[0,-.154,.082],children:[b.jsx("boxGeometry",{args:[.08,.224,.11]}),k]}),b.jsx(zi,{position:[.043,-.154,.082],size:[.006,.2,.094],color:i,intensity:4.5}),b.jsx(zi,{position:[-.043,-.154,.082],size:[.006,.2,.094],color:i,intensity:4.5}),b.jsxs("mesh",{position:[0,.055,.07],children:[b.jsx("boxGeometry",{args:[.1,.088,.26]}),z]}),b.jsxs("mesh",{position:[0,.1,0],children:[b.jsx("boxGeometry",{args:[.036,.032,.072]}),P]}),b.jsxs("mesh",{position:[.052,.038,.08],children:[b.jsx("boxGeometry",{args:[.005,.034,.048]}),b.jsx("meshStandardMaterial",{color:"#030306",roughness:1})]}),b.jsxs("mesh",{position:[0,.1,.18],children:[b.jsx("boxGeometry",{args:[.042,.024,.4]}),P]}),b.jsx(zi,{position:[0,.113,.16],size:[.04,.006,.38],color:i,intensity:1.5}),b.jsxs("mesh",{position:[0,.132,.06],children:[b.jsx("boxGeometry",{args:[.04,.052,.1]}),P]}),b.jsxs("mesh",{position:[0,.145,.06],children:[b.jsx("boxGeometry",{args:[.034,.014,.096]}),b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:2.5,roughness:.2,metalness:0,toneMapped:!1})]}),b.jsxs("mesh",{position:[0,.022,.36],children:[b.jsx("boxGeometry",{args:[.096,.094,.32]}),z]}),b.jsx(zi,{position:[0,.07,.36],size:[.078,.007,.28],color:i,intensity:1}),b.jsx(zi,{position:[.05,.022,.36],size:[.007,.072,.28],color:i,intensity:.7}),b.jsx(zi,{position:[-.05,.022,.36],size:[.007,.072,.28],color:i,intensity:.7}),b.jsxs("mesh",{position:[0,-.03,.36],children:[b.jsx("boxGeometry",{args:[.042,.02,.28]}),P]}),b.jsxs("mesh",{position:[0,.044,.22],children:[b.jsx("boxGeometry",{args:[.064,.064,.03]}),P]}),b.jsxs("mesh",{position:[0,.06,.42],children:[b.jsx("boxGeometry",{args:[.058,.046,.046]}),P]}),b.jsxs("mesh",{position:[0,.086,.28],children:[b.jsx("boxGeometry",{args:[.013,.013,.28]}),b.jsx("meshStandardMaterial",{color:"#090915",roughness:.6,metalness:.9})]}),b.jsxs("mesh",{position:[0,.044,.62],children:[b.jsx("boxGeometry",{args:[.044,.044,.52]}),z]}),b.jsxs("mesh",{position:[0,.092,.6],children:[b.jsx("boxGeometry",{args:[.016,.042,.016]}),P]}),b.jsxs("mesh",{position:[0,.044,.895],children:[b.jsx("boxGeometry",{args:[.058,.058,.07]}),P]}),b.jsxs("mesh",{position:[0,.044,.934],children:[b.jsx("boxGeometry",{args:[.038,.038,.032]}),k]}
4454),b.jsxs("mesh",{ref:E,position:[0,.044,.975],visible:!1,children:[b.jsx("boxGeometry",{args:[.2,.2,.1]}),b.jsx("meshStandardMaterial",{color:i,emissive:i,emissiveIntensity:18,transparent:!0,opacity:.92,toneMapped:!1})]})]}),b.jsxs("group",{ref:w,position:[.04,-.31,.06],children:[b.jsxs("mesh",{position:[0,0,-.08],children:[b.jsx("boxGeometry",{args:[.064,.064,.2]}),z]}),b.jsx(zi,{position:[.035,0,-.08],size:[.006,.042,.17],color:i,intensity:2.2}),b.jsx(zi,{position:[-.035,0,-.08],size:[.006,.042,.17],color:i,intensity:2.2}),b.jsxs("mesh",{position:[0,0,.024],children:[b.jsx("boxGeometry",{args:[.13,.06,.04]}),P]}),b.jsx(zi,{position:[0,.033,.024],size:[.12,.007,.036],color:i,intensity:2.8}),b.jsxs("mesh",{position:[0,0,.51],children:[b.jsx("boxGeometry",{args:[.032,.032,.86]}),ie]}),b.jsxs("mesh",{position:[0,0,.51],children:[b.jsx("boxGeometry",{args:[.075,.075,.84]}),ve]}),b.jsxs("mesh",{position:[0,0,.96],children:[b.jsx("boxGeometry",{args:[.018,.018,.1]}),ie]})]})]})]})]})]}),b.jsxs("mesh",{position:[0,-.085,0],children:[b.jsx("boxGeometry",{args:[.4,.12,.21]}),L]}),b.jsx(zi,{position:[0,-.072,.108],size:[.32,.025,.005],color:i,intensity:.9}),b.jsxs("mesh",{position:[-.22,-.09,0],children:[b.jsx("boxGeometry",{args:[.04,.1,.14]}),P]}),b.jsxs("mesh",{position:[.22,-.09,0],children:[b.jsx("boxGeometry",{args:[.04,.1,.14]}),P]}),b.jsx("group",{position:[-.125,-.15,0],children:b.jsxs("group",{ref:v,children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.215,0],children:[b.jsx("boxGeometry",{args:[.18,.43,.18]}),L]}),b.jsxs("mesh",{position:[-.095,-.21,0],children:[b.jsx("boxGeometry",{args:[.005,.3,.14]}),P]}),b.jsx(zi,{position:[0,-.15,.093],size:[.1,.08,.005],color:i,intensity:.7}),b.jsxs("mesh",{position:[0,-.425,.1],children:[b.jsx("boxGeometry",{args:[.16,.085,.045]}),G]}),b.jsxs("mesh",{position:[0,-.425,.088],children:[b.jsx("boxGeometry",{args:[.08,.04,.01]}),b.jsx("meshStandardMaterial",{color:"#000",roughness:1})]}),b.jsxs("group",{ref:_,position:[0,-.44,0],children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.19,0],children:[b.jsx("boxGeometry",{args:[.16,.38,.16]}),L]}),b.jsxs("mesh",{position:[0,-.17,.085],children:[b.jsx("boxGeometry",{args:[.13,.26,.01]}),P]}),b.jsx(zi,{position:[0,-.12,.093],size:[.06,.06,.005],color:i,intensity:1}),b.jsxs("mesh",{castShadow:!0,position:[0,-.39,.04],children:[b.jsx("boxGeometry",{args:[.2,.09,.3]}),F]}),b.jsxs("mesh",{position:[0,-.395,.15],children:[b.jsx("boxGeometry",{args:[.16,.06,.04]}),P]}),b.jsxs("mesh",{position:[0,-.437,.04],children:[b.jsx("boxGeometry",{args:[.21,.01,.31]}),b.jsx("meshStandardMaterial",{color:"#050508",roughness:1,metalness:0})]})]})]})}),b.jsx("group",{position:[.125,-.15,0],children:b.jsxs("group",{ref:x,children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.215,0],children:[b.jsx("boxGeometry",{args:[.18,.43,.18]}),L]}),b.jsxs("mesh",{position:[.095,-.21,0],children:[b.jsx("boxGeometry",{args:[.005,.3,.14]}),P]}),b.jsx(zi,{position:[0,-.15,.093],size:[.1,.08,.005],color:i,intensity:.7}),b.jsxs("mesh",{position:[0,-.425,.1],children:[b.jsx("boxGeometry",{args:[.16,.085,.045]}),G]}),b.jsxs("mesh",{position:[0,-.425,.088],children:[b.jsx("boxGeometry",{args:[.08,.04,.01]}),b.jsx("meshStandardMaterial",{color:"#000",roughness:1})]}),b.jsxs("group",{ref:A,position:[0,-.44,0],children:[b.jsxs("mesh",{castShadow:!0,position:[0,-.19,0],children:[b.jsx("boxGeometry",{args:[.16,.38,.16]}),L]}),b.jsxs("mesh",{position:[0,-.17,.085],children:[b.jsx("boxGeometry",{args:[.13,.26,.01]}),P]}),b.jsx(zi,{position:[0,-.12,.093],size:[.06,.06,.005],color:i,intensity:1}),b.jsxs("mesh",{castShadow:!0,position:[0,-.39,.04],children:[b.jsx("boxGeometry",{args:[.2,.09,.3]}),F]}),b.jsxs("mesh",{position:[0,-.395,.15],children:[b.jsx("boxGeometry",{args:[.16,.06,.04]}),P]}),b.jsxs("mesh",{position:[0,-.437,.04],children:[b.jsx("boxGeometry",{args:[.21,.01,.31]}),b.jsx("meshStandardMaterial",{color:"#050508",roughness:1,metalness:0})]})]})]})})]})})}const R1=i=>({modelPath:null,scale:1,position:[0,0,0],rotation:[0,0,0],proceduralScale:1,glb:{castShadow:!0,receiveShadow:!0},...i}),_C={shadow_runner:R1({proceduralScale:.96}),pulse_tank:R1({proceduralScale:1.08}),neon_striker:R1({proceduralScale:1})};function X3(i){return _C[i]??_C.neon_striker}const ij={castShadow:!0,receiveShadow:!0,envMapIntensity:0};function sj(i,e={}){const t={...ij,...e};i.traverse(n=>{if(n instanceof hs){n.castShadow=t.castShadow,n.receiveShadow=t.receiveShadow;const s=n.material,a=l=>{l.depthWrite=!0,t.envMapIntensity>0&&(l instanceof rl||l instanceof to)&&(l.envMapIntensity=Math.max(l.envMapIntensity,t.envMapIntensity))};
4454Array.isArray(s)?s.forEach(a):s&&a(s)}})}function rj({definition:i,modelPath:e}){const t=fb(e),n=q.useMemo(()=>t.scene.clone(!0),[t.scene,e]);return q.useLayoutEffect(()=>{sj(n,i.glb)},[n,i.glb]),b.jsx("group",{scale:[i.scale,i.scale,i.scale],position:i.position,rotation:i.rotation,children:b.jsx("primitive",{object:n})})}function _M({playerClass:i,color:e,anim:t}){const n=X3(i),s=e??k0[i];return n.modelPath?b.jsx(q.Suspense,{fallback:null,children:b.jsx(rj,{definition:n,modelPath:n.modelPath})}):b.jsx(nj,{color:s,anim:t,proceduralScale:n.proceduralScale})}function aj(){const i=q.useRef(!1),e=q.useRef(!1),t=q.useRef(!1),n=q.useRef(!1),s=q.useRef(0),a=q.useRef(0),l=q.useRef(0),u=q.useRef(0),h=q.useRef(0),p=q.useRef("laser_rifle"),m=q.useRef(0),v=q.useRef(0),x=q.useRef(0),_=q.useRef(0),A=q.useRef(0),R=q.useRef(0);return q.useMemo(()=>({isMoving:i,isRunning:e,isCrouching:t,isJumping:n,punchPhase:s,punchPhase2:a,punchPhase3:l,kickPhase:u,kickPhase2:h,equippedWeapon:p,saberPhase1:m,saberPhase2:v,saberPhase3:x,saberPhase4:_,shootPhase:A,aimPhase:R}),[])}function oj(){return b.jsxs(b.Fragment,{children:[b.jsx("ambientLight",{intensity:.38,color:"#3a3a4a"}),b.jsx("hemisphereLight",{color:"#b8c4e0",groundColor:"#1a1020",intensity:.55}),b.jsx("directionalLight",{position:[2,3.2,2.2],intensity:.95,color:"#fff0ec"}),b.jsx("directionalLight",{position:[-1.8,1.2,1.2],intensity:.28,color:"#6088d0"})]})}function lj({playerClass:i,color:e}){const t=aj(),s=.46/(X3(i).proceduralScale||1);return b.jsx("group",{scale:[s,s,s],children:b.jsx("group",{position:[0,0,0],children:b.jsx(_M,{playerClass:i,color:e,anim:t})})})}function cj(){const{camera:i,gl:e}=Gc();return q.useLayoutEffect(()=>{const t=i;t.position.set(0,.78,2.45),t.near=.1,t.far=32,t.fov=32,t.updateProjectionMatrix(),t.lookAt(0,.52,0),e.toneMapping=R_},[i,e]),null}function uj({selected:i}){const{gl:e,invalidate:t}=Gc();return q.useEffect(()=>{e.toneMappingExposure=i?1.22:.9,t()},[e,t,i]),null}function fj({playerClass:i,color:e,selected:t}){return b.jsxs(mM,{frameloop:"always",dpr:[1,1.5],gl:{antialias:!0,alpha:!0,powerPreference:"high-performance"},camera:{fov:32,near:.1,far:32},onCreated:({gl:n})=>{n.setClearColor(657938,0)},style:{width:"100%",height:"100%",display:"block",pointerEvents:"none",touchAction:"none"},children:[b.jsx(cj,{}),b.jsx(uj,{selected:t}),b.jsx(oj,{}),b.jsx(lj,{playerClass:i,color:e})]})}function Ld({countryCode:i,name:e,flagSize:t="1.05em",gap:n=6}){const s=sg(i??"");return b.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:n,minWidth:0},children:[b.jsx("span",{style:{fontSize:t,lineHeight:1,flexShrink:0},"aria-hidden":!0,children:s}),b.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e})]})}function q3(){return typeof window>"u"?null:window.location.pathname.match(/^\/play\/([a-z0-9]+)\/?$/i)?.[1]?.toLowerCase()??null}const dj="eclipse_match_ranking",S0="arena",hj=[{id:"shadow_runner",label:"Shadow Runner",color:"#00f5ff"},{id:"pulse_tank",label:"Pulse Tank",color:"#ff2d2d"},{id:"neon_striker",label:"Neon Striker",color:"#ffe600"}];function B1(){try{return{name:localStorage.getItem("eclipse_display_name")??"",country:localStorage.getItem("eclipse_country_code")??""}}catch{return{name:"",country:""}}}function pj({selected:i,onSelect:e,disabled:t}){return b.jsx("div",{style:Vt.classGrid,children:hj.map(n=>{const s=vA[n.id],a=i===n.id;return b.jsxs("button",{type:"button",disabled:t,style:{...Vt.classCard,borderColor:a?n.color:"#2a2a3a",boxShadow:a?`0 0 18px ${n.color}55, inset 0 0 12px ${n.color}11`:"none",opacity:t?.55:1},onClick:()=>e(n.id),children:[b.jsx("div",{style:{...Vt.classAvatarWrap,borderColor:a?`${n.color}55`:"rgba(80,80,100,0.35)",background:a?`linear-gradient(180deg, ${n.color}12 0%, transparent 65%)`:"rgba(0,0,0,0.2)"},children:b.jsx(fj,{playerClass:n.id,color:n.color,selected:a})}),b.jsx("span",{style:{...Vt.className,color:n.color},children:n.label}),b.jsxs("div",{style:Vt.classStats,children:[b.jsxs("span",{style:Vt.stat,children:["HP ",s.hp]}),b.jsxs("span",{style:Vt.stat,children:["SPD ",s.speed]}),b.jsxs("span",{style:Vt.stat,children:["STM ",s.stamina]})]})]},n.id)})})}function bC({arena:i,canJoin:e,onJoin:t,onWatch:n,t:s}){const a=i.phase==="lobby",l=a?i.lobbyTimeLeft:i.matchTimeLeft,u=Math.floor(Math.max(0,l)/60),h=Math.floor(Math.max(0,l)%60);return b.jsxs("div",{style:{...Vt.arenaCard,borderColor:a?"rgba(0,220,255,0.3)":"rgba(255,100,0,0.3)"},children:[b.jsxs("div",{style:Vt.arenaCardLeft,children:[b.jsx("span",{style:{...Vt.arenaCardName,color:a?"#aef0ff":"#ffcc88"},children:i.arenaName}),b.jsxs("div",{style:Vt.arenaCardMeta,children:[b.jsx("span",{style:{color:a?"#00ccff":"#ff8833"},children:s("hub_players_count",{n:i.playerCount,max:i.maxPlayers})}),b.jsx("span",{style:{color:"#555"},children:"·"}),b.jsx("span",{style:{color:"#667"},children:a?s("hub_lobby_time",{m:u,s:String(h).padStart(2,"0")}):s("hub_time_left",{m:u,s:String(h).padStart(2,"0")})})]})]}),b.jsx("div",{style:Vt.arenaCardActions,children:a?b.jsx("button",{type:"button",style:{...Vt.arenaActionBtn,borderColor:"rgba(0,245,255,0.45)",color:"#9ff",opacity:e?1:.4},disabled:!e,onClick:()=>t(i.roomId),children:s("hub_join")}):b.jsx("button",{type:"button",style:{...Vt.arenaActionBtn,borderColor:"rgba(255,150,0,0.4)",color:"#ffc"},onClick:()=>n(i.roomId),children:s("hub_watch")})})]})}function mj(){const i=Lo(pe=>pe.t),e=Lo(pe=>pe.lang),t=Lo(pe=>pe.setLang),n=ot(pe=>pe.setClass),s=ot(pe=>pe.selectedClass),a=tn(pe=>pe.connecting),l=tn(pe=>pe.connected),u=tn(pe=>pe.error),[h,p]=q.useState(()=>B1().name),[m,v]=q.useState(()=>B1().country),{connect:x}=sP(),[_,A]=q.useState("arenas"),[R,w]=q.useState([]),[E,D]=q.useState([]),[L,P]=q.useState([]),G=q3(),[H,F]=q.useState(null),[X,z]=q.useState(null),[k,ie]=q.useState(""),[ve,J]=q.useState(md),[le,ae]=q.useState(!1),[W,ee]=q.useState(null),[te,ue]=q.useState(()=>typeof window<"u"&&window.innerWidth<800);q.useEffect(()=>{const pe=()=>ue(window.innerWidth<800);return pe(),window.addEventListener("resize",pe),()=>window.removeEventListener("resize",pe)},[]),q.useEffect(()=>{try{localStorage.setItem("eclipse_display_name",h),localStorage.setItem("eclipse_country_code",m)}catch{}},[h,m]),q.useEffect(()=>{const pe=async()=>{try{const lt=await fetch(`${T0()}
4454/api/arenas`,{cache:"no-store"});if(!lt.ok)return;const ct=await lt.json();w(ct.lobbies??[]),D(ct.playing??[])}catch{}};pe();const Re=window.setInterval(pe,4e3);return()=>window.clearInterval(Re)},[]),q.useEffect(()=>{const pe=async()=>{try{const lt=await fetch(`${T0()}/api/match-ranking`,{cache:"no-store"});if(lt.ok){const ct=await lt.json();if(ct.entries&&ct.entries.length>0){P(ct.entries);return}}}catch{}try{const lt=localStorage.getItem(dj);lt&&P(JSON.parse(lt))}catch{}};pe();const Re=window.setInterval(pe,12e3);return()=>window.clearInterval(Re)},[]),q.useEffect(()=>{if(!G){F(null),z(null);return}let pe=!1;return(async()=>{z(null);try{const Re=await fetch(`${T0()}/api/private-room/slug/${encodeURIComponent(G)}`,{cache:"no-store"}),lt=await Re.json();if(pe)return;if(!Re.ok||!lt.roomId){F(null),z(typeof lt.error=="string"?lt.error:i("menu_private_error_resolve"));return}F({roomId:lt.roomId,slug:lt.slug??G})}catch{pe||(F(null),z(i("menu_private_error_resolve")))}})(),()=>{pe=!0}},[i,e,G]);const he=q.useMemo(()=>new Intl.DisplayNames([e==="pt"?"pt-PT":"en-GB"],{type:"region"}),[e]),K=q.useMemo(()=>{const pe=i("menu_country_intl");return[...JD].map(Re=>{if(!Re)return{value:"",label:`🌍 ${pe}`,searchText:["international","global","internacional","mundial"].join(" ").toLowerCase()};const lt=he.of(Re)??Re;return{value:Re,label:`${sg(Re)} ${lt}`,searchText:[Re,lt].join(" ").toLowerCase()}})},[he,i]);q.useEffect(()=>{const pe=new URLSearchParams(window.location.search);if(pe.get("portal")!=="true")return;const Re=pe.get("username"),lt=s??"neon_striker";Re&&!h.trim()&&p(Re.slice(0,24)),s||n(lt);const ct=window.setTimeout(()=>{const vt=tn.getState();if(vt.room||vt.connecting)return;const qt=ot.getState().selectedClass??"neon_striker",Wt=Re?.slice(0,24).trim()||B1().name.trim()||void 0;x(qt,Wt,S0,{countryCode:m.trim()||void 0})},120);return()=>window.clearTimeout(ct)},[]);const ce=!a&&!l,re=q.useCallback(async pe=>{if(!(!s||!ce)){ee(null);try{await x(s,h.trim()||void 0,S0,{roomId:pe,countryCode:m.trim()||void 0})}catch{ee(i("hub_error_join"))}}},[s,ce,x,h,m,i]),oe=q.useCallback(async pe=>{if(ce)try{await x("neon_striker",h.trim()||void 0,S0,{roomId:pe,spectate:!0})}catch{}},[ce,x,h]),we=q.useCallback(async()=>{if(!(!s||!H||!ce))try{await x(s,h.trim()||void 0,S0,{roomId:H.roomId,countryCode:m.trim()||void 0})}catch{}},[s,H,ce,x,h,m]),Be=q.useCallback(async()=>{if(!(le||!s||!ce)){ee(null),ae(!0);try{const pe=await fetch(`${T0()}/api/public-arena`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({arenaName:k.trim()||void 0,maxPlayers:ve})}),Re=await pe.json();if(!pe.ok||!Re.roomId){ee((Re.error??i("hub_error_create"))+(Re.detail?` (${Re.detail})`:""));return}await x(s,h.trim()||void 0,S0,{roomId:Re.roomId,countryCode:m.trim()||void 0})}catch{ee(i("hub_error_create"))}finally{ae(!1)}}},[le,s,ce,k,ve,x,h,m,i]);return b.jsxs("div",{style:Vt.root,children:[b.jsx(tj,{}),b.jsx("div",{style:Vt.vignette}),u&&b.jsx("div",{style:Vt.errorBanner,children:u}),b.jsxs("div",{style:Vt.topBar,children:[G&&b.jsx("a",{href:"/",style:Vt.homeLink,children:i("menu_nav_home")}),b.jsx("span",{style:Vt.langLabel,children:i("menu_lang_label")}),b.jsx("button",{type:"button",style:{...Vt.langBtn,boxShadow:e==="en"?"0 0 0 2px #00f5ff":"none"},onClick:()=>t("en"),children:"GB EN"}),b.jsx("button",{type:"button",style:{...Vt.langBtn,boxShadow:e==="pt"?"0 0 0 2px #00f5ff":"none"},onClick:()=>t("pt"),children:"PT PT"})]}),b.jsxs("div",{style:{...Vt.layout,flexDirection:te?"column":"row",overflowY:te?"auto":"hidden"},children:[b.jsxs("aside",{style:{...Vt.leftPanel,width:te?"100%":300,flexShrink:0,overflowY:te?"visible":"auto"},children:[b.jsxs("div",{style:Vt.logoWrap,children:[b.jsxs("h1",{style:Vt.logoTitle,children:["ECLIPSE",b.jsx("br",{}),"PROTOCOL"]}),b.jsx("p",{style:Vt.logoSub,children:i("menu_subtitle")})]}),G&&b.jsxs("div",{style:Vt.inviteCard,children:[b.jsx("span",{style:Vt.inviteCardTitle,children:i("hub_invite_banner")}),X?b.jsx("p",{style:Vt.inviteErr,children:X}):H?b.jsx("button",{type:"button",style:{...Vt.inviteJoinBtn,opacity:s&&ce?1:.4},disabled:!s||!ce,onClick:()=>void we(),children:i(a?"menu_connecting":l?"menu_in_lobby":"hub_invite_join")}):b.jsx("span",{style:{color:"#667",fontSize:"0.75rem"},children:"..."})]}),b.jsx(pj,{selected:s,onSelect:n,disabled:!ce}),b.jsxs("div",{style:Vt.identityPanel,children:[b.jsxs("span",{style:Vt.identityLabel,children:[i("menu_country_label")," / ",i("menu_display_placeholder")]}),b.jsx(aP,{options:K,value:m,onChange:v,searchPlaceholder:i("menu_country_search"),"aria-label":i("menu_country_label"),disabled:!ce}),b.jsx("input",{style:Vt.nameInput,placeholder:i("menu_display_placeholder"),maxLength:16,value:h,onChange:pe=>p(pe.target.value),disabled:!ce})]}),a&&b.jsx("div",{style:Vt.connectingBadge,children:i("menu_connecting")}),l&&!a&&b.jsx("div",{style:{...Vt.connectingBadge,background:"rgba(0,120,80,0.25)",borderColor:"rgba(0,255,160,0.3)",color:"#0fa"},children:i("menu_in_lobby")})]}),b.jsxs("main",{style:{...Vt.rightPanel,flex:te?"none":1,minHeight:te?"auto":0},children:[b.jsx("div",{style:Vt.tabBar,children:["arenas","create","ranking"].map(pe=>b.jsx("button",{type:"button",style:{...Vt.tabBtn,borderBottomColor:_===pe?"#00f5ff":"transparent",color:_===pe?"#00f5ff":"#6a8a9a"},onClick:()=>A(pe),children:i(pe==="arenas"?"hub_tab_arenas":pe==="create"?"hub_tab_create":"hub_tab_ranking")},pe))}),b.jsxs("div",{style:Vt.tabContent,children:[_==="arenas"&&b.jsxs("div",{style:Vt.tabPane,children:[b.jsx("div",{style:Vt.sectionTitle,children:i("hub_lobbies_title")}),R.length===0?b.jsx("p",{style:Vt.emptyMsg,children:i("hub_empty_lobbies")}):b.jsx("div",{style:Vt.arenaList,children:R.map(pe=>b.jsx(bC,{arena:pe,canJoin:!!s&&ce,onJoin:re,onWatch:oe,t:i},pe.roomId))}),b.jsx("div",{style:{...Vt.sectionTitle,marginTop:20},children:i("hub_playing_title")}),E.length===0?b.jsx("p",{style:Vt.emptyMsg,children:i("hub_empty_playing")}):b.jsx("div",{style:Vt.arenaList,children:E.map(pe=>b.jsx(bC,{arena:pe,canJoin:!1,onJoin:re,onWatch:oe,t:i},pe.roomId))}),!s&&b.jsx("p",{style:{...Vt.emptyMsg,color:"#ffe60088",marginTop:14},children:"Select a class on the left to join a match"})]}),_==="create"&&b.jsx("div",{style:Vt.tabPane,children:b.jsxs("div",{style:{display:"flex",gap:16,flexWrap:"wrap"},children:[b.jsxs("div",{style:Vt.createBlock,children:[b.jsx("div",{style:Vt.createBlockTitle,children:i("hub_create_public_title")}),b.jsx("p",{style:Vt.createBlockDesc,children:i("hub_create_public_desc")}),b.jsx("label",{style:Vt.createLabel,children:i("hub_arena_name_label")}),b.jsx("input",{style:Vt.createInput,placeholder:i("hub_arena_name_placeholder"),maxLength:32,value:k,onChange:pe=>ie(pe.target.value),disabled:le||!ce}),b.jsxs("label",{style:Vt.createLabel,children:[i("hub_max_players_label"),": ",ve]}),b.jsx("div",{style:Vt.playerBtns,children:[2,4,6,8].map(pe=>b.jsx("button",{type:"button",style:{...Vt.playerBtn,borderColor:ve===pe?"#00f5ff":"#333",color:ve===pe?"#00f5ff":"#778"},onClick:()=>J(pe),disabled:le||!ce,children:pe},pe))}),W&&b.jsx("p",{style:Vt.createErr,children:W}),b.jsx("button",{type:"button",style:{...Vt.createBtn,opacity:s&&ce&&!le?1:.4},disabled:!s||!ce||le,onClick:()=>void Be(),children:i(le?"hub_creating":"hub_create_public_btn")})]}),b.jsxs("div",{style:{...Vt.createBlock,borderColor:"rgba(180,120,255,0.3)"},children:[b.jsx("div",{style:{...Vt.createBlockTitle,color:"#d4b8ff"},children:i("hub_create_private_title")}),b.jsx("p",{style:Vt.createBlockDesc,children:i("hub_create_private_desc")}),b.jsx("div",{style:{flex:1}}),b.jsx("a",{href:"/room/new",style:{...Vt.createBtn,textDecoration:"none",display:"block",textAlign:"center",background:"rgba(80,30,140,0.35)",borderColor:"rgba(180,120,255,0.45)",color:"#d4b8ff"},children:i("hub_create_private_btn")})]})]})}),_==="ranking"&&b.jsxs("div",{style:Vt.tabPane,children:[b.jsx("div",{style:Vt.sectionTitle,children:i("menu_top_matches")}),b.jsx("p",{style:Vt.rankingScope,children:i("hub_ranking_scope")}),L.length===0?b.jsx("p",{style:Vt.emptyMsg,children:i("hub_ranking_empty")}):b.jsx("div",{style:Vt.rankList,children:L.slice(0,20).map((pe,Re)=>
4454{const lt=pe.kills!==void 0&&pe.deaths!==void 0?pe.deaths===0?pe.kills.toFixed(0):(pe.kills/pe.deaths).toFixed(2):null;return b.jsxs("div",{style:Vt.rankRow,children:[b.jsxs("span",{style:Vt.rankPos,children:["#",Re+1]}),b.jsx("span",{style:Vt.rankName,children:b.jsx(Ld,{countryCode:pe.countryCode,name:pe.name})}),b.jsxs("span",{style:{...Vt.rankScore,minWidth:80},children:[pe.score," ",i("menu_pts")]}),lt!==null&&b.jsxs("span",{style:{color:"#445566",fontSize:"0.72rem",marginLeft:8},children:["K:",pe.kills," D:",pe.deaths," (",lt,")"]})]},Re)})})]})]})]})]})]})}const Vt={root:{position:"relative",width:"100vw",height:"100vh",overflow:"hidden",color:"#dff7ff",fontFamily:"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif"},vignette:{position:"absolute",inset:0,zIndex:1,background:"radial-gradient(ellipse at center, transparent 20%, #02020dee 100%)",pointerEvents:"none"},errorBanner:{position:"absolute",top:0,left:0,right:0,zIndex:30,background:"rgba(180,30,30,0.92)",color:"#ffd0d0",padding:"8px 16px",fontSize:"0.8rem",textAlign:"center",letterSpacing:"0.05em"},topBar:{position:"absolute",top:"max(10px, env(safe-area-inset-top, 0px))",right:"max(14px, env(safe-area-inset-right, 0px))",display:"flex",alignItems:"center",gap:8,zIndex:10},homeLink:{marginRight:4,fontSize:"0.72rem",color:"#7dd4ff",textDecoration:"none",letterSpacing:"0.08em"},langLabel:{fontSize:"0.6rem",color:"#5a6a7a",letterSpacing:"0.12em",textTransform:"uppercase"},langBtn:{padding:"5px 9px",fontSize:"0.7rem",cursor:"pointer",background:"rgba(0,20,35,0.7)",border:"1px solid rgba(0,245,255,0.3)",borderRadius:6,color:"#9ec"},layout:{position:"relative",zIndex:2,display:"flex",width:"100%",height:"100%",boxSizing:"border-box",padding:"48px 0 0 0"},leftPanel:{display:"flex",flexDirection:"column",gap:12,padding:"12px 16px 24px",boxSizing:"border-box",background:"linear-gradient(180deg, rgba(8,18,32,0.96) 0%, rgba(3,8,18,0.92) 100%)",borderRight:"1px solid rgba(0,200,255,0.12)",WebkitOverflowScrolling:"touch"},logoWrap:{flexShrink:0,paddingBottom:4},logoTitle:{fontSize:"1.4rem",fontWeight:900,letterSpacing:"0.25em",color:"#00f5ff",textShadow:"0 0 24px #00f5ffaa",margin:0,lineHeight:1.15},logoSub:{fontSize:"0.68rem",color:"#6a8a9a",letterSpacing:"0.05em",margin:"6px 0 0 0",lineHeight:1.4},inviteCard:{flexShrink:0,padding:"12px 14px",background:"rgba(30,15,55,0.85)",border:"1px solid rgba(200,150,255,0.35)",borderRadius:10,display:"flex",flexDirection:"column",gap:8},inviteCardTitle:{fontSize:"0.62rem",letterSpacing:"0.18em",color:"#c4a4ff",textTransform:"uppercase"},inviteErr:{color:"#ff9a9a",fontSize:"0.72rem",margin:0,lineHeight:1.4},inviteJoinBtn:{padding:"9px 14px",fontSize:"0.78rem",fontWeight:700,letterSpacing:"0.1em",cursor:"pointer",background:"rgba(120,60,220,0.3)",border:"1px solid rgba(180,120,255,0.6)",borderRadius:8,color:"#e4d0ff"},classGrid:{display:"flex",flexDirection:"row",gap:8,overflowX:"auto",WebkitOverflowScrolling:"touch",padding:"2px 0 6px",flexShrink:0},classCard:{display:"flex",flexDirection:"column",alignItems:"center",flex:"1 1 0",minWidth:76,gap:4,padding:"8px 6px 10px",border:"2px solid #2a2a3a",background:"#0a0a14cc",backdropFilter:"blur(8px)",cursor:"pointer",transition:"border-color 0.2s, box-shadow 0.2s",boxSizing:"border-box"},classAvatarWrap:{width:"100%",height:80,borderRadius:6,border:"1px solid rgba(100,100,120,0.3)",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box"},className:{fontSize:"0.62rem",fontWeight:700,letterSpacing:"0.03em",textAlign:"center",lineHeight:1.2,width:"100%"},classStats:{display:"flex",flexDirection:"column",alignItems:"center",gap:1},stat:{fontSize:"0.6rem",color:"#7a8a9a"},identityPanel:{flexShrink:0,display:"flex",flexDirection:"column",gap:8,padding:"12px 14px",background:"rgba(8,16,28,0.88)",border:"1px solid rgba(0,200,255,0.16)",borderRadius:10},identityLabel:{fontSize:"0.58rem",letterSpacing:"0.16em",color:"#5a8a9a",textTransform:"uppercase"},nameInput:{width:"100%",background:"rgba(8,10,20,0.85)",border:"1px solid rgba(0,245,255,0.2)",color:"#fff",padding:"9px 12px",fontSize:"0.85rem",fontFamily:"ui-monospace, 'Cascadia Code', monospace",letterSpacing:"0.06em",outline:"none",borderRadius:7,boxSizing:"border-box"},connectingBadge:{flexShrink:0,padding:"10px 14px",background:"rgba(0,60,100,0.3)",border:"1px solid rgba(0,200,255,0.3)",borderRadius:8,color:"#9ce",fontSize:"0.78rem",letterSpacing:"0.1em",textAlign:"center"},rightPanel:{display:"flex",flexDirection:"column",minWidth:0,overflowY:"hidden"},tabBar:{display:"flex",flexShrink:0,borderBottom:"1px solid rgba(0,200,255,0.12)",background:"rgba(4,10,20,0.92)"},tabBtn:{padding:"12px 22px",fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.16em",textTransform:"uppercase",cursor:"pointer",background:"none",border:"none",borderBottom:"2px s
4454olid transparent",color:"#6a8a9a",transition:"color 0.15s, border-color 0.15s"},tabContent:{flex:1,minHeight:0,overflowY:"auto",overflowX:"hidden",WebkitOverflowScrolling:"touch",background:"rgba(3,8,16,0.82)"},tabPane:{padding:"20px 24px 32px",maxWidth:900,boxSizing:"border-box"},sectionTitle:{fontSize:"0.58rem",letterSpacing:"0.22em",color:"#5a8a9a",textTransform:"uppercase",marginBottom:10,paddingBottom:4,borderBottom:"1px solid rgba(0,200,255,0.1)"},emptyMsg:{color:"#4a6a7a",fontSize:"0.8rem",padding:"10px 0",margin:0,lineHeight:1.5},arenaList:{display:"flex",flexDirection:"column",gap:8},arenaCard:{display:"flex",alignItems:"center",gap:12,padding:"12px 16px",background:"rgba(6,16,28,0.88)",border:"1px solid rgba(0,200,255,0.2)",borderRadius:10,boxSizing:"border-box"},arenaCardLeft:{flex:1,minWidth:0,display:"flex",flexDirection:"column",gap:4},arenaCardName:{fontSize:"0.9rem",fontWeight:700,letterSpacing:"0.04em",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},arenaCardMeta:{display:"flex",gap:8,fontSize:"0.72rem",alignItems:"center"},arenaCardActions:{flexShrink:0},arenaActionBtn:{padding:"7px 14px",fontSize:"0.72rem",fontWeight:700,letterSpacing:"0.1em",cursor:"pointer",background:"rgba(0,30,50,0.6)",border:"1px solid",borderRadius:7,transition:"opacity 0.15s"},createBlock:{flex:"1 1 240px",minWidth:240,display:"flex",flexDirection:"column",gap:10,padding:"18px 20px 20px",background:"rgba(6,16,28,0.9)",border:"1px solid rgba(0,200,255,0.25)",borderRadius:12,boxSizing:"border-box"},createBlockTitle:{fontSize:"0.62rem",letterSpacing:"0.22em",color:"#8ef0ff",textTransform:"uppercase"},createBlockDesc:{fontSize:"0.74rem",color:"#6a8a9a",lineHeight:1.5,margin:0},createLabel:{fontSize:"0.62rem",letterSpacing:"0.12em",color:"#5a8a9a",textTransform:"uppercase",display:"block"},createInput:{width:"100%",background:"rgba(8,10,20,0.85)",border:"1px solid rgba(0,245,255,0.2)",color:"#fff",padding:"9px 12px",fontSize:"0.85rem",fontFamily:"ui-monospace, 'Cascadia Code', monospace",outline:"none",borderRadius:7,boxSizing:"border-box",letterSpacing:"0.05em"},playerBtns:{display:"flex",gap:8},playerBtn:{flex:1,padding:"7px 4px",fontSize:"0.82rem",fontWeight:700,cursor:"pointer",background:"rgba(0,10,20,0.7)",border:"1px solid",borderRadius:6,color:"#778",transition:"border-color 0.15s, color 0.15s"},createErr:{color:"#ff9a9a",fontSize:"0.74rem",margin:0,lineHeight:1.4},createBtn:{width:"100%",padding:"11px 14px",fontSize:"0.78rem",fontWeight:700,letterSpacing:"0.12em",cursor:"pointer",background:"rgba(0,80,120,0.35)",border:"1px solid rgba(0,220,255,0.45)",borderRadius:8,color:"#aef0ff",transition:"opacity 0.15s",boxSizing:"border-box"},rankingScope:{fontSize:"0.72rem",color:"#5a7a8a",margin:"0 0 14px 0",lineHeight:1.45},rankList:{display:"flex",flexDirection:"column",gap:2},rankRow:{display:"flex",alignItems:"center",gap:10,padding:"7px 10px",background:"rgba(6,14,24,0.7)",borderRadius:7,fontSize:"0.78rem"},rankPos:{color:"#4a6a7a",width:28,flexShrink:0,fontSize:"0.7rem"},rankName:{flex:1,minWidth:0,color:"#dff7ff",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},rankScore:{color:"#00d4ff",flexShrink:0,fontWeight:700,fontSize:"0.8rem"}},SC=70,AC=-72,gj=2.4,MC=12,EC=14,vj=2.4,TC=2.8,yj=TC*TC,xj="https://vibej.am/portal/2026";function wC(){const i=ot.getState(),e=tn.getState(),t=e.sessionId??"",n=e.allPlayers.get(t),s=i.selectedClass??"neon_striker",a=k0[s].replace("#",""),l=vA[s].speed/5,u=Math.round(lR*l*10)/10,h=Math.max(0,Math.round(i.hp)),p=n?.displayName??"Player";return new URLSearchParams({username:p,color:a,speed:String(u),hp:String(h),ref:window.location.origin})}function _j(i){if(!i)return null;try{const e=new URL(i);return e.protocol!=="https:"&&e.protocol!=="http:"?null:i}catch{return null}}function CC({position:i,color:e,label:t,subLabel:n,xPos:s,zPos:a,onEnter:l,direction:u}){const h=q.useRef(null),p=q.useRef(null),m=q.useRef(null),v=q.useRef(!1),x=q.useRef(0);return ps((_,A)=>{x.current+=A;const R=x.current;h.current.rotation.y+=A*.7*u,p.current.rotation.z+=A*1.4*-u,m.current.rotation.z+=A*.5*u;const w=p.current.material;if(w.opacity=.45+Math.sin(R*3.2)*.25,v.current)return;const E=ot.getState().localPos,D=E.x-s,L=E.z-a;D*D+L*L<yj&&(v.current=!0,l())}),b.jsxs("group",{position:i,children:[b.jsxs("mesh",{ref:h,children:[b.jsx("torusGeometry",{args:[2.2,.14,16,96]}),b.jsx("meshStandardMaterial",{color:e,emissive:e,emissiveIntensity:4,toneMapped:!1})]}),b.jsxs("mesh",{rotation:[0,0,Math.PI/4],children:[b.jsx("torusGeometry",{args:[2,.07,12,64]}),b.jsx("meshStandardMaterial",{color:e,emissive:e,emissiveIntensity:2.5,transparent:!0,opacity:.6,toneMapped:!1})]}),b.jsxs("mesh",{ref:p,rotation:[0,0,0],children:[b.jsx("circleGeometry",{args:[1.85,64]}),b.jsx("meshStandardMaterial",{color:e,emissive:e,emissiveIntensity:1.8,transparent:!0,opacity:.5,side:Gs,toneMapped:!1})]}),b.jsxs("mesh",{ref:m,children:[b.jsx("torusGeometry",{args:[2.55,.32,8,64]}),b.jsx("meshStandardMaterial",{color:e,emissive:e,emissiveIntensity:.6,transparent:!0,opacity:.18,toneMapped:!1})]}),b.jsx("pointLight",{color:e,intensity:10,distance:14,decay:2}),b.jsx(yM,{center:!0,position:[0,3,0],style:{pointerEvents:"none",userSelect:"none"},children:b.jsxs("div",{style:{color:"#ffffff",fontFamily:"'Courier New', monospace",fontWeight:"bold",fontSize:12,textShadow:`0 0 6px ${e}, 0 0 14px ${e}`,textAlign:"center",whiteSpace:"nowrap",letterSpacing:1.5,lineHeight:1.6},children:[t,b.jsx("br",{}),b.jsx("span",{style:{fontSize:10,fontWeight:"normal",opacity:.8,letterSpacing:.5},children:n})]})})]})}function bj(){const i=new URLSearchParams(window.location.search),e=i.get("portal")==="true",t=i.get("ref")??"",n=_j(t);function s(){const l=wC();window.location.href=`${xj}?${l.toString()}`}function a(){if(!n)return;const l=wC();l.set("portal","true");const u=new URL(n);l.forEach((h,p)=>u.searchParams.set(p,h)),window.location.href=u.toString()}return b.jsxs(b.Fragment,{children:[b.jsx(CC,{position:[SC,gj,AC],color:"#9933ff",label:"✦ VIBE JAM PORTAL ✦",subLabel:"Walk in → next game",xPos:SC,zPos:AC,onEnter:s,direction:1}),e&&n&&b.jsx(CC,{position:[MC,vj,EC],color:"#00ffcc",label:"✦ PORTAL DE REGRESSO ✦",subLabel:"Walk in → previous game",xPos:MC,zPos:EC,onEnter:a,direction:-1})]})}let Sj=0;const db=jc(i=>({slashes:[],addSlash:(e,t,n,s,a,l)=>i(u=>({slashes:[...u.slashes,{id:Sj++,px:e,py:t,pz:n,rotY:s,step:a,color:l}]})),removeSlash:e=>i(t=>({slashes:t.slashes.filter(n=>n.id!==e)}))})),Aj=3.2,Mj=3,Ej=1/30,RC=8,Tj=Math.PI,wj=.38,Cj=7,Rj=.08,Bj=1.25,Ij=[4,7,13],hx=.42,Dj=70,Lj=82,BC=new se,IC=new se,px=new se,mx=new se,tl=new se,I1=new se,D1=new se,wc=new se;function Pj(){const i=q.useRef(null),e=q.useRef(new se),t=q.useRef(0),n=q.useRef(0),s=q.useRef(!1),a=q.useRef(Tj),l=q.useRef(wj),u=q.useRef(Cj),h=q.useRef(1),p=q.useRef(0),m=q.useRef(new se(0,RC,11)),v=q.useRef(new se(0,1,0)),x=q.useRef(!1),_=q.useRef(!1),A=q.useRef(!1),R=q.useRef(!1),w=q.useRef(0),E=q.useRef(0),D=q.useRef(0),L=q.useRef(0),P=q.useRef(0),G=q.useRef(0),H=q.useRef(0),F=q.useRef(0),X=q.useRef(0),z=q.useRef("laser_rifle"),k=q.useRef(0),ie=q.useRef(0),ve=q.useRef(0),J=q.useRef(0),le=q.useRef(0),ae=q.useRef(0),W=q.useRef(0),ee=q.useRef(0),te=q.useRef(0),ue=q.useRef(0),he=q.useRef(!1),K=q.useRef(!1),ce=q.useRef(!1),re=q.useRef(!1),oe=q.useRef(!1),we=q.useRef(!1),Be=q.useRef(!1),{camera:pe,gl:Re}=Gc(),lt=ot(qe=>qe.selectedClass)??"neon_striker",ct=k0[lt],vt=ot(qe=>qe.setLocalPos),qt=ot(qe=>qe.triggerHitFlash),Wt=ot(qe=>qe.forcePosition),de=ot(qe=>qe.clearForcePosition),an=ot(qe=>qe.pendingKnockback),$e=ot(qe=>qe.clearKnockback),Qe=ot(qe=>qe.setWeapon),Ye=ot(qe=>qe.consumeAmmo);ot(qe=>qe.startReload);const pt=ot(qe=>qe.setZoomLevel),Ve=ot(qe=>qe.setAiming),ne=q.useRef(new se),V=Nc(qe=>qe.addProjectile),Se=db(qe=>qe.addSlash),Ie=ti(qe=>qe.localVehicleId),et=vA[lt],Fe=tn(qe=>qe.room),[,Rt]=g6();return q.useEffect(()=>{const qe=Re.domElement,yt=()=>{document.pointerLockElement!==qe&&qe.requestPointerLock()},At=ft=>{if(document.pointerLockElement!==qe)return;const Zt=Be.current?.0012:.003,sn=Be.current?8e-4:.002;a.current-=ft.movementX*Zt,l.current=Math.max(Rj,Math.min(Bj,l.current-ft.movementY*sn))},it=ft=>{document.pointerLockElement===qe&&(ft.button===0&&(oe.current=!0),ft.button===2&&(Be.current=!Be.current,Ve(Be.current)))},Oe=ft=>{ft.button===0&&(oe.current=!1)},Ct=ft=>{ft.preventDefault(),ft.deltaY>0?h.current=Math.min(2,h.current+1):h.current=Math.max(0,h.current-1),u.current=Ij[h.current],pt(h.current)},Ft=ft=>ft.preventDefault();return qe.addEventListener("click",yt),document.addEventListener("mousemove",At),document.addEventListener("mousedown",it),document.addEventListener("mouseup",Oe),qe.addEventListener("wheel",Ct,{passive:!1}),qe.addEventListener("contextmenu",Ft),()=>{qe.removeEventListener("click",yt),document.removeEventListener("mousemove",At),document.removeEventListener("mousedown",it),document.removeEventListener("mouseup",Oe),qe.removeEventListener("wheel",Ct),qe.removeEventListener("contextmenu",Ft)}},[Re,Ve]),q.useEffect(()=>{const qe=yt=>{if(yt.repeat||yt.ctrlKey||yt.metaKey||yt.altKey)return;const At=yt.target;if(At instanceof HTMLInputElement||At instanceof HTMLTextAreaElement||At instanceof HTMLElement&&At.isContentEditable)return;const it=tn.getState().room;if(!it)return;const Oe=ot.getState();yt.code==="KeyH"&&Oe.healthCapsules>0&&Oe.hp<Oe.maxHp&&it.send("use_item",{type:"health"}),yt.code==="KeyB"&&Oe.ammoBoxes>0&&it.send("use_item",{type:"ammo"})};return window.addEventListener("keydown",qe,{capture:!0}),()=>window.removeEventListener("keydown",qe,{capture:!0})},[]),ps((qe,yt)=>{const At=Math.min(yt,.05),it=Rt(),Oe=i.current.position;if(window.__eclipseLocalPos={x:Oe.x,z:Oe.z},Ie!==-1){const It=ti.getState().vehicles.find(Q=>Q.id===Ie);It&&(Oe.set(It.x,It.y+.95,It.z),i.current.rotation.y=It.rotY,vt(It.x,It.z,It.rotY));const Ot=Rt(),Ln=Ot.fire&&!ce.current;ce.current=Ot.fire,Ln&&(ti.getState().setDriver(Ie,""),ti.getState().setLocalVehicle(-1),It&&Oe.set(It.x+Math.cos(It.rotY)*2.2,It.y+1,It.z-Math.sin(It.rotY)*2.2),Fe?.send("vehicle_exit",{vehicleId:Ie}),ce.current=!0);return}if(an&&(ne.current.set(an.kbX,an.kbY,an.kbZ),$e()),ne.current.lengthSq()>.001){const It=Math.max(0,1-8*At);Oe.x+=ne.current.x*At,Oe.z+=ne.current.z*At,n.current+=ne.current.y*At,ne.current.multiplyScalar(It),ne.current.lengthSq()<1e-4&&ne.current.set(0,0,0)}Wt&&(Oe.set(Wt.x,Wt.y,Wt.z),n.current=0,e.current.set(0,0,0),de()),it.jump&&s.current&&(n.current=ZD,s.current=!1),s.current||(n.current-=KD*At),Oe.y+=n.current*At;const Ct=a.current;I1.set(-Math.sin(Ct),0,-Math.cos(Ct)),D1.set(Math.cos(Ct),0,-Math.sin(Ct)),wc.set(0,0,0),it.forward&&wc.addScaledVector(I1,1),it.backward&&wc.addScaledVector(I1,-1),it.left&&wc.addScaledVector(D1,-1),it.right&&wc.addScaledVector(D1,1),wc.lengthSq()>0&&wc.normalize();const Ft=wc.lengthSq()>0;let ft=lR*(et.speed/5);if(it.run&&!Be.current&&(ft*=$D),Be.current&&(ft*=.55),it.crouch&&(ft*=e5),e.current.lerp(wc.multiplyScalar(ft),18*At),Oe.addScaledVector(e.current,At),s.current&&Ft){const It=Oe.y-Hh;for(const Ot of hp){if(Ot.top===void 0)continue;const Ln=Oe.x-Ot.cx,Q=Oe.z-Ot.cz,ye=Ot.hw+a0-Math.abs(Ln),De=Ot.hd+a0-Math.abs(Q);if(ye>0&&De>0){const Le=Ot.top-It;if(Le>.02&&Le<=t5&&e.current.x*-Ln+e.current.z*-Q>0){Oe.y=Ot.top+Hh,n.current=0,s.current=!0;break}}}}const Zt=Oe.x,sn=Oe.z,cn={x:Oe.x,y:Oe.y,z:Oe.z};
4454uR(cn,a0,hp,Hh),Oe.x=cn.x,Oe.z=cn.z;const _e=Oe.x-Zt,Bt=Oe.z-sn;_e!==0&&(_e>0?e.current.x<0:e.current.x>0)&&(e.current.x=0),Bt!==0&&(Bt>0?e.current.z<0:e.current.z>0)&&(e.current.z=0);const Ue=Array.from(tn.getState().remotePlayers.values()).filter(It=>!It.isDead).map(It=>({x:It.x,z:It.z})),nt={x:Oe.x,z:Oe.z};n5(nt,Ue,a0),Oe.x=nt.x,Oe.z=nt.z;const bt=cR+a0,mt=ti.getState().localVehicleId;for(const It of ti.getState().vehicles){if(It.id===mt)continue;const Ot=Oe.x-It.x,Ln=Oe.z-It.z,Q=Ot*Ot+Ln*Ln;if(Q<bt*bt&&Q>1e-4){const ye=Math.sqrt(Q),De=(bt-ye)/ye;Oe.x+=Ot*De,Oe.z+=Ln*De}}let nn=!1;if(n.current<=.1)for(const It of hp){if(It.top===void 0)continue;const Ot=It.top+Hh;if(Oe.y<=Ot+.06&&Oe.y>=Ot-.06){const Ln=Oe.x-It.cx,Q=Oe.z-It.cz;if(Math.abs(Ln)<=It.hw+.08&&Math.abs(Q)<=It.hd+.08){Oe.y=Ot,n.current=0,s.current=!0,nn=!0;break}}}if(!nn){const It=xE+Hh;Oe.y<=It?(Oe.y=It,n.current=0,s.current=!0):s.current=!1}Oe.y<QD&&(Oe.set(0,xE+Hh,0),n.current=0,s.current=!0);const kn=Math.atan2(-Math.sin(Ct),-Math.cos(Ct));if(Ft&&e.current.lengthSq()>.3){let Ot=Math.atan2(e.current.x,e.current.z)-p.current;for(;Ot>Math.PI;)Ot-=2*Math.PI;for(;Ot<-Math.PI;)Ot+=2*Math.PI;p.current+=Ot*(1-Math.exp(-10*At))}else{const It=z.current!=="none"?5:2;let Ot=kn-p.current;for(;Ot>Math.PI;)Ot-=2*Math.PI;for(;Ot<-Math.PI;)Ot+=2*Math.PI;p.current+=Ot*(1-Math.exp(-It*At))}i.current.rotation.y=p.current,x.current=Ft,_.current=it.run&&Ft,A.current=it.crouch,R.current=!s.current,w.current>0&&(w.current=Math.max(0,w.current-At/.28)),E.current>0&&(E.current=Math.max(0,E.current-At/.32)),D.current>0&&(D.current=Math.max(0,D.current-At/.42)),G.current>0&&(G.current=Math.max(0,G.current-At/.5)),H.current>0&&(H.current=Math.max(0,H.current-At/.54)),k.current>0&&(k.current=Math.max(0,k.current-At/.36)),ie.current>0&&(ie.current=Math.max(0,ie.current-At/.36)),ve.current>0&&(ve.current=Math.max(0,ve.current-At/.4)),J.current>0&&(J.current=Math.max(0,J.current-At/.44)),W.current>0&&(W.current=Math.max(0,W.current-At/.22)),ue.current>0&&(ue.current=Math.max(0,ue.current-At)),ee.current>0&&(ee.current=Math.max(0,ee.current-At/.55)),P.current>0?P.current-=At:L.current=0,X.current>0?X.current-=At:F.current=0,ae.current>0?ae.current-=At:le.current=0;const Dt=it.attack&&!he.current,Tt=it.combo&&!K.current,gn=oe.current&&!we.current,En=it.fire&&!ce.current||gn,Lr=it.switchWeapon&&!re.current;if(he.current=it.attack,K.current=it.combo,ce.current=it.fire,we.current=oe.current,re.current=it.switchWeapon,Lr){const It=z.current==="laser_rifle"?"light_saber":z.current==="light_saber"?"none":"laser_rifle";z.current=It,Qe(It),Fe?.send("switch_weapon",{weapon:It})}if(Dt){let It=!1;if(ot.getState().phase==="playing"){for(const Ot of y_)if(Math.hypot(Oe.x-Ot.x,Oe.z-Ot.z)<Mj){Fe?.send("capture_flag",{flagId:Ot.id}),It=!0;break}}if(!It){const Ot=L.current;(P.current>0||Ot===0)&&(Ot===0?(w.current=1,L.current=1,P.current=.52,qt("punch"),Fe?.send("attack",{type:"punch1"})):Ot===1&&w.current<.65?(E.current=1,L.current=2,P.current=.56,qt("punch"),Fe?.send("attack",{type:"punch2"})):Ot===2&&E.current<.65&&(D.current=1,L.current=0,P.current=0,qt("punch"),Fe?.send("attack",{type:"punch3"})))}}if(Tt){const It=F.current;(X.current>0||It===0)&&(It===0?(G.current=1,F.current=1,X.current=.62,qt("kick"),Fe?.send("attack",{type:"kick1"})):It===1&&G.current<.65&&(H.current=1,F.current=0,X.current=0,qt("kick"),Fe?.send("attack",{type:"kick2"})))}if(En){if(Ie!==-1){ti.getState().setDriver(Ie,""),ti.getState().setLocalVehicle(-1);const Ot=ti.getState().vehicles.find(Ln=>Ln.id===Ie);Ot&&Oe.set(Ot.x+Math.cos(Ot.rotY)*2.2,Ot.y+1,Ot.z-Math.sin(Ot.rotY)*2.2),Fe?.send("vehicle_exit",{vehicleId:Ie});return}const{vehicles:It}=ti.getState();for(const Ot of It){if(Ot.driverId!==""||Ot.hp<=0)continue;const Ln=Ot.x-Oe.x,Q=Ot.z-Oe.z;if(Math.sqrt(Ln*Ln+Q*Q)<=Aj){const ye=tn.getState().sessionId;ti.getState().setLocalVehicle(Ot.id),ye&&ti.getState().setDriver(Ot.id,ye),Fe?.send("vehicle_enter",{vehicleId:Ot.id});return}}}const yr=ot.getState(),er=yr.ammo,Vs=yr.isReloading;if(En&&!Vs&&z.current==="light_saber"){const Ot=[k,ie,ve,J],Ln=["saber1","saber2","saber3","saber4"],Q=[.36,.36,.4,.44],ye=le.current,De=Ot[ye];De.current<.3&&(De.current=1,ae.current=Q[ye]+.22,le.current=ye<3?ye+1:0,ye===3&&(ae.current=0),jL(ye),Se(Oe.x,Oe.y+1,Oe.z,p.current,ye,ct),qt("punch"),Fe?.send("attack",{type:Ln[ye]}))}if(z.current==="laser_rifle"&&!Vs&&(En||oe.current)&&er>0&&W.current<=0&&ue.current<=0&&(W.current=1,ee.current=1,ue.current=1/aR.laser_rifle.fireRate,Ye())){HL();const Ot=Oe.x+-Math.sin(Ct)*.9,Ln=Oe.y+1.1,Q=Oe.z+-Math.cos(Ct)*.9,{targetedVehicleId:ye,targetedPlayerId:De,vehicles:Le}=ti.getState(),{remotePlayers:xe}=tn.getState();let dt=!1;if(ye!==-1){const xt=Le.find(Et=>Et.id===ye);xt&&xt.hp>0&&(tl.set(xt.x-Ot,xt.y+.8-Ln,xt.z-Q).normalize(),dt=!0)}
4454if(!dt&&De!==""){const xt=xe.get(De);xt&&!xt.isDead&&(tl.set(xt.x-Ot,xt.y+1-Ln,xt.z-Q).normalize(),dt=!0)}if(dt||(pe.getWorldDirection(px),mx.copy(pe.position).addScaledVector(px,100),tl.set(mx.x-Ot,mx.y-Ln,mx.z-Q).normalize(),tl.dot(px)<.2&&tl.copy(px)),V(Ot,Ln,Q,tl.x,tl.y,tl.z,ct),Fe?.send("attack",{type:"laser",ox:Ot,oy:Ln,oz:Q,dx:tl.x,dy:tl.y,dz:tl.z}),er-1<=0){const xt=ot.getState();xt.ammoBoxes>0&&(xt.isReloading||xt.startReload(),xt.autoReloadLeft>0?Fe?.send("auto_resupply",{type:"ammo"}):Fe?.send("use_item",{type:"ammo"}))}}{const It=ot.getState();te.current>0&&(te.current-=At),It.phase==="playing"&&It.autoHealLeft>0&&It.healthCapsules>0&&It.hp>0&&It.hp<It.maxHp*.3&&te.current<=0&&(te.current=2,Fe?.send("auto_resupply",{type:"health"}))}vt(Oe.x,Oe.z,i.current.rotation.y);const xr=Be.current?2:u.current,ia=l.current,Ws=Math.cos(ia),Ps=Math.sin(ia),hi=Math.cos(Ct),Fi=-Math.sin(Ct);BC.set(Oe.x+Math.sin(Ct)*xr*Ws+hi*hx,Oe.y+Ps*xr,Oe.z+Math.cos(Ct)*xr*Ws+Fi*hx),IC.set(Oe.x+hi*hx,Oe.y+1,Oe.z+Fi*hx);const _r=1-Math.exp(-8*At),ui=1-Math.exp(-18*At);m.current.lerp(BC,_r),v.current.lerp(IC,ui),pe.position.copy(m.current),pe.lookAt(v.current);const tr=pe,xa=Be.current?38:it.run&&Ft?Lj:Dj;if(tr.fov=vn.lerp(tr.fov,xa,1-Math.exp(-6*At)),tr.updateProjectionMatrix(),t.current+=At,t.current>=Ej&&Fe){t.current=0;const It={none:0,laser_rifle:1,light_saber:2},Ot=(x.current?1:0)|(_.current?2:0)|(A.current?4:0)|(s.current?0:8)|(Ie!==-1?16:0),Ln=It[z.current]??0;Fe.send("move",{x:Oe.x,y:Oe.y,z:Oe.z,vx:e.current.x,vz:e.current.z,rotY:p.current,animBits:Ot,weaponId:Ln})}}),b.jsx("group",{ref:i,position:[0,RC,0],children:b.jsx("group",{visible:Ie===-1,children:b.jsx(_M,{playerClass:lt,color:ct,anim:{isMoving:x,isRunning:_,isCrouching:A,isJumping:R,punchPhase:w,punchPhase2:E,punchPhase3:D,kickPhase:G,kickPhase2:H,equippedWeapon:z,saberPhase1:k,saberPhase2:ie,saberPhase3:ve,saberPhase4:J,shootPhase:W,aimPhase:ee}})})})}const DC=.35;function Oj(){const i=tn(e=>e.remotePlayerIds);return b.jsx(b.Fragment,{children:i.map(e=>b.jsx(zj,{id:e},e))})}function Nj(i){return tn(e=>e.remotePlayers.get(i)?.isDead===!0)}function Uj(i){return tn(e=>{const t=e.remotePlayers.get(i);if(!t)return"";const n=t.countryCode??"";return`${t.hp}|${t.displayName}|${t.playerClass}|${n}`})}function zj({id:i}){const e=Nj(i),t=Uj(i),n=q.useRef(null),s=q.useRef(new se(0,.9,0)),a=q.useRef(!1),l=q.useRef(!1),u=q.useRef(!1),h=q.useRef(!1),p=q.useRef("none"),m=q.useRef(0),v=q.useRef(0),x=q.useRef(0),_=q.useRef(0),A=q.useRef(0),R=q.useRef(0),w=q.useRef(0),E=q.useRef(0),D=q.useRef(0),L=q.useRef(0),P=q.useRef(0),G=q.useRef(0),H=q.useRef(0),F=q.useRef(null),X=()=>tn.getState().remoteActions,z=Nc.getState().addProjectile,k=db.getState().addSlash;ps((te,ue)=>{const he=tn.getState().remotePlayers.get(i);if(!he||!n.current)return;const K=he.y>.01?he.y:.9;s.current.set(he.x,K,he.z);const re=10+n.current.position.distanceTo(s.current)*6;n.current.position.lerp(s.current,Math.min(1,re*ue));const we=(he.rotY-n.current.rotation.y+Math.PI*3)%(Math.PI*2)-Math.PI;n.current.rotation.y+=we*Math.min(1,12*ue);const Be=he.animBits??0;a.current=!!(Be&1),l.current=!!(Be&2),u.current=!!(Be&4),h.current=!!(Be&8);const pe=he.weaponId??0;p.current=pe===1?"laser_rifle":pe===2?"light_saber":"none",P.current=pe>0?1:0;const Re=X().get(i);if(Re&&Re.ts!==G.current){G.current=Re.ts,F.current=Re.type,H.current=DC;const lt=k0[he.playerClass]??"#ffffff";if(Re.type==="shoot"||Re.type==="laser"){const ct=Re.ox!==void 0?Re.ox:Re.x+Math.sin(Re.rotY)*.4,vt=Re.oy!==void 0?Re.oy:Re.y+.8,qt=Re.oz!==void 0?Re.oz:Re.z+Math.cos(Re.rotY)*.4;Re.dirX!==void 0&&Re.dirY!==void 0&&Re.dirZ!==void 0?z(ct,vt,qt,Re.dirX,Re.dirY,Re.dirZ,lt):z(ct,vt,qt,Math.sin(Re.rotY),0,Math.cos(Re.rotY),lt)}else if(Re.type.startsWith("saber")){const vt={saber1:0,saber2:1,saber3:2,saber4:3}[Re.type]??0;k(Re.x,Re.y+.9,Re.z,Re.rotY,vt,lt)}}if(H.current>0){H.current-=ue;const ct=1-Math.max(0,H.current/DC),vt=F.current;m.current=vt==="punch1"?ct:0,v.current=vt==="punch2"?ct:0,x.current=vt==="punch3"?ct:0,_.current=vt==="kick1"?ct:0,A.current=vt==="kick2"?ct:0,R.current=vt==="saber1"?ct:0,w.current=vt==="saber2"?ct:0,E.current=vt==="saber3"?ct:0,D.current=vt==="saber4"?ct:0,L.current=vt==="shoot"||vt==="laser"?ct:0,H.current<=0&&(F.current=null,m.current=v.current=x.current=0,_.current=A.current=0,R.current=w.current=E.current=D.current=0,L.current=0)}});const ie=t.split("|"),ve=Math.max(0,Number(ie[0])||0),J=ie[1]||i.slice(0,6),le=ie[2]||"neon_striker",ae=ie[3]??"",W=sg(ae),ee=k0[le]??"#ffffff";return b.jsxs("group",{ref:n,visible:!e,children:[b.jsx(_M,{playerClass:le,color:ee,anim:{isMoving:a,isRunning:l,isCrouching:u,isJumping:h,equippedWeapon:p,punchPhase:m,pu
4454nchPhase2:v,punchPhase3:x,kickPhase:_,kickPhase2:A,saberPhase1:R,saberPhase2:w,saberPhase3:E,saberPhase4:D,shootPhase:L,aimPhase:P}}),b.jsx(yM,{position:[0,1.6,0],center:!0,distanceFactor:12,style:{pointerEvents:"none",userSelect:"none"},children:b.jsxs("div",{style:{background:"rgba(0,0,0,0.75)",color:ee,padding:"2px 8px",fontSize:"11px",fontFamily:"Courier New, monospace",letterSpacing:"0.1em",border:`1px solid ${ee}`,whiteSpace:"nowrap",display:"flex",alignItems:"center",gap:6},children:[b.jsx("span",{style:{lineHeight:1},children:W}),b.jsx("span",{children:J})]})}),b.jsx(Fj,{hp:ve,color:ee})]})}function Fj({hp:i,color:e}){const t=Math.max(0,i/100);return b.jsxs("group",{position:[0,1.3,0],children:[b.jsxs("mesh",{children:[b.jsx("planeGeometry",{args:[.8,.07]}),b.jsx("meshBasicMaterial",{color:"#111"})]}),b.jsxs("mesh",{position:[(t-1)*.4,0,.001],scale:[t,1,1],children:[b.jsx("planeGeometry",{args:[.8,.07]}),b.jsx("meshBasicMaterial",{color:e})]})]})}function kj(){const i=Nc(n=>n.projectiles),e=Nc(n=>n.impacts),t=Nc(n=>n.shrapnelBursts);return b.jsxs(b.Fragment,{children:[i.map(n=>b.jsx(Hj,{data:n},n.id)),e.map(n=>b.jsx(Gj,{data:n},n.id)),t.map(n=>b.jsx(Vj,{data:n},n.id))]})}function Hj({data:i}){const e=q.useRef(null),t=q.useRef(0),n=q.useRef(!1),s=Nc.getState().removeProjectile,a=q.useRef(null);if(a.current===null){const u=u5(i.px,i.py,i.pz,i.dx,i.dy,i.dz,mS,f5);a.current=u!=null?Math.max(.06,u-.04):mS}ps((u,h)=>{if(n.current||!e.current)return;const p=a.current??mS,m=DL*h;if(t.current+=m,t.current>=p){n.current=!0,s(i.id);return}e.current.position.x+=i.dx*m,e.current.position.y+=i.dy*m,e.current.position.z+=i.dz*m});const l=q.useMemo(()=>{const u=new se(i.dx,i.dy,i.dz);if(u.lengthSq()<1e-8)return new gr;u.normalize();const h=new gr;return h.setFromUnitVectors(new se(0,0,1),u),h},[i.dx,i.dy,i.dz]);return b.jsx("group",{ref:e,position:[i.px,i.py,i.pz],children:b.jsxs("group",{quaternion:l,children:[b.jsxs("mesh",{renderOrder:2,children:[b.jsx("boxGeometry",{args:[.14,.14,2.2]}),b.jsx("meshBasicMaterial",{color:i.color})]}),b.jsxs("mesh",{renderOrder:1,children:[b.jsx("boxGeometry",{args:[.38,.38,1.9]}),b.jsx("meshBasicMaterial",{color:i.color,transparent:!0,opacity:.55,depthWrite:!1})]}),b.jsxs("mesh",{renderOrder:0,children:[b.jsx("boxGeometry",{args:[.7,.7,1.6]}),b.jsx("meshBasicMaterial",{color:i.color,transparent:!0,opacity:.2,depthWrite:!1})]}),b.jsxs("mesh",{position:[0,0,1.15],children:[b.jsx("sphereGeometry",{args:[.22,10,10]}),b.jsx("meshBasicMaterial",{color:i.color})]})]})})}const LC=.4;function Gj({data:i}){const e=q.useRef(null),t=q.useRef(null),n=q.useRef(null),s=q.useRef(0),a=q.useRef(!1),l=Nc.getState().removeImpact;return ps((u,h)=>{if(a.current)return;if(s.current+=h,s.current>=LC){a.current=!0,l(i.id);return}const p=s.current/LC,v=.05+(1-(1-p)*(1-p))*2.2;e.current&&e.current.scale.setScalar(v),t.current&&(t.current.opacity=(1-p)*.7),n.current&&(n.current.opacity=Math.max(0,1-p*2.4))}),b.jsx("group",{position:[i.px,i.py,i.pz],children:b.jsxs("group",{ref:e,children:[b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.38,12,12]}),b.jsx("meshBasicMaterial",{ref:t,color:i.color,transparent:!0,opacity:.75,depthWrite:!1})]}),b.jsxs("mesh",{children:[b.jsx("sphereGeometry",{args:[.18,8,8]}),b.jsx("meshBasicMaterial",{ref:n,color:"#ffffff",transparent:!0,opacity:1,depthWrite:!1})]})]})})}const PC=.58,jj=12.5;function OC(i,e){const{color:t,impactKind:n}=i;return n==="player"?e%5===0?"#ffffff":e%6===0?"#ff3355":t:n==="vehicle"?e%4===0?"#ffeedd":e%5===0?"#ffaa44":t:n==="post"?e%2===0?"#8e9eac":e%3===0?"#4a5a6c":t:n==="wall"?e%2===0?"#2c3544":e%4===0?"#1a2230":t:t}function Vj({data:i}){const e=q.useRef(null),t=q.useRef([]),n=q.useRef(i.fragments),s=q.useRef(0),a=q.useRef(!1),l=Nc.getState().removeShrapnelBurst;return ps((u,h)=>{if(a.current)return;if(s.current+=h,s.current>=PC){a.current=!0,l(i.id);return}const p=n.current;for(let x=0;x<p.length;x++){const _=p[x];_.vy-=jj*h,_.offX+=_.vx*h,_.offY+=_.vy*h,_.offZ+=_.vz*h,_.rotX+=_.wX*h,_.rotY+=_.wY*h,_.rotZ+=_.wZ*h}const m=s.current/PC,v=Math.max(0,1-m*1.12);for(let x=0;x<p.length;x++){const _=t.current[x],A=p[x];if(_){_.position.set(A.offX,A.offY,A.offZ),_.rotation.set(A.rotX,A.rotY,A.rotZ);const R=_.material;R&&(R.opacity=v)}}}),b.jsx("group",{ref:e,position:[i.px,i.py,i.pz],children:n.current.map((u,h)=>{const p=[u.scale,u.scale*.75,u.scale*1.05];return b.jsxs("mesh",{ref:m=>{t.current[h]=m},scale:p,castShadow:!0,children:[b.jsx("boxGeometry",{args:[1,1,1]}),b.jsx("meshStandardMaterial",{color:OC(i,h),metalness:i.impactKind==="post"?.5:.1,roughness:.42,emissive:OC(i,h),emissiveIntensity:i.impactKind==="player"?.22:i.impactKind==="vehicle"?.12:.06,transparent:!0,opacity:.96,depthWrite:!0})]},h)})})}const NC=.62,Wj=[[.04,2,.01],[2,.04,.01],[.04,2,.01],[.04,.04,1.8]],Xj=[0,0,Math.PI/4,0],UC=[{rotYOffset:-.22,opacity:.18},{rotYOffset:0,opacity:.32},{rotYOffset:.22,opacity:.18}];function qj(){const i=db(e=>e.slashes);return b.jsx(b.Fragment,{children:i.map(e=>b.jsx(Yj,{data:e},e.id))})}function Yj({data:i}){const e=[q.useRef(null),q.useRef(null),q.useRef(null)],t=q.useRef(null),n=q.useRef(0),s=q.useRef(!1),a=db(m=>m.removeSlash);ps((m,v)=>{if(s.current)return;if(n.current+=v,n.current>=NC){s.current=!0,a(i.id);return}const x=n.current/NC,_=(1-x)*(1-x);UC.forEach(({opacity:A},R)=>{const w=e[R].current;w&&(w.opacity=A*_)}),t.current&&(t.current.intensity=_*4)}
4454);const[l,u,h]=Wj[i.step],p=Xj[i.step];return b.jsxs("group",{position:[i.px,i.py,i.pz],"rotation-y":i.rotY,children:[UC.map(({rotYOffset:m,opacity:v},x)=>b.jsx("group",{"rotation-y":m,"rotation-z":p,children:b.jsxs("mesh",{renderOrder:1,children:[b.jsx("boxGeometry",{args:[l,u,h]}),b.jsx("meshBasicMaterial",{ref:e[x],color:i.color,transparent:!0,opacity:v,depthWrite:!1})]})},x)),b.jsx("pointLight",{ref:t,color:i.color,intensity:4,distance:6,decay:2})]})}const Jj="#2d3a1e",zC="#00ff88",Kj="#1a1a1a",Zj="#555",Qj="#88ccff",$j="#3a3a3a";function Y3({rotY:i=0}){const e=q.useMemo(()=>({body:new rl({color:Jj,roughness:.7,metalness:.2}),neon:new Kr({color:zC}),wheel:new rl({color:Kj,roughness:.9}),rim:new rl({color:Zj,metalness:.8,roughness:.2}),glass:new rl({color:Qj,transparent:!0,opacity:.35,roughness:0}),metal:new rl({color:$j,metalness:.7,roughness:.3})}),[]);return b.jsxs("group",{"rotation-y":i,children:[b.jsx("mesh",{material:e.body,position:[0,.42,0],castShadow:!0,receiveShadow:!0,children:b.jsx("boxGeometry",{args:[2.1,.55,4.2]})}),b.jsx("mesh",{material:e.body,position:[0,.95,.3],castShadow:!0,children:b.jsx("boxGeometry",{args:[1.9,.18,2.2]})}),b.jsx("mesh",{material:e.metal,position:[0,.34,-2.18],castShadow:!0,children:b.jsx("boxGeometry",{args:[2,.28,.18]})}),b.jsx("mesh",{material:e.metal,position:[0,.34,2.18],castShadow:!0,children:b.jsx("boxGeometry",{args:[2,.28,.18]})}),b.jsx("mesh",{material:e.glass,position:[0,1.05,-.72],"rotation-x":-.42,castShadow:!0,children:b.jsx("boxGeometry",{args:[1.75,.55,.06]})}),b.jsx("mesh",{material:e.metal,position:[0,1.5,.5],castShadow:!0,children:b.jsx("boxGeometry",{args:[1.8,.09,.09]})}),b.jsx("mesh",{material:e.metal,position:[-.88,1.14,.5],castShadow:!0,children:b.jsx("boxGeometry",{args:[.09,.78,.09]})}),b.jsx("mesh",{material:e.metal,position:[.88,1.14,.5],castShadow:!0,children:b.jsx("boxGeometry",{args:[.09,.78,.09]})}),b.jsx("mesh",{material:e.metal,position:[-.88,1.14,1.3],"rotation-x":-.4,castShadow:!0,children:b.jsx("boxGeometry",{args:[.07,.88,.07]})}),b.jsx("mesh",{material:e.metal,position:[.88,1.14,1.3],"rotation-x":-.4,castShadow:!0,children:b.jsx("boxGeometry",{args:[.07,.88,.07]})}),b.jsx("mesh",{material:e.neon,position:[-1.06,.44,0],children:b.jsx("boxGeometry",{args:[.03,.06,3.6]})}),b.jsx("mesh",{material:e.neon,position:[1.06,.44,0],children:b.jsx("boxGeometry",{args:[.03,.06,3.6]})}),b.jsx("pointLight",{color:zC,intensity:6,distance:5,decay:2,position:[0,.1,0]}),b.jsx(gx,{x:-1.12,z:-1.35,mats:e}),b.jsx(gx,{x:1.12,z:-1.35,mats:e}),b.jsx(gx,{x:-1.12,z:1.35,mats:e}),b.jsx(gx,{x:1.12,z:1.35,mats:e}),b.jsx("mesh",{material:e.neon,position:[-.6,.6,-2.12],children:b.jsx("boxGeometry",{args:[.3,.18,.06]})}),b.jsx("mesh",{material:e.neon,position:[.6,.6,-2.12],children:b.jsx("boxGeometry",{args:[.3,.18,.06]})}),b.jsx("pointLight",{color:"#aaffcc",intensity:12,distance:18,decay:2,position:[0,.65,-2.4]}),b.jsx("mesh",{material:new Kr({color:"#ff2244"}),position:[-.58,.6,2.12],children:b.jsx("boxGeometry",{args:[.28,.14,.05]})}),b.jsx("mesh",{material:new Kr({color:"#ff2244"}),position:[.58,.6,2.12],children:b.jsx("boxGeometry",{args:[.28,.14,.05]})}),b.jsx("mesh",{material:e.metal,position:[.75,1.62,.5],castShadow:!0,children:b.jsx("cylinderGeometry",{args:[.025,.025,.55,6]})}),b.jsx("mesh",{material:e.neon,position:[.75,1.92,.5],children:b.jsx("sphereGeometry",{args:[.045,6,6]})}),b.jsx("mesh",{material:e.metal,position:[.35,.98,-.55],"rotation-x":-.55,children:b.jsx("torusGeometry",{args:[.17,.025,8,20]})})]})}function gx({x:i,z:e,mats:t}){return b.jsxs("group",{position:[i,.36,e],"rotation-z":Math.PI/2,children:[b.jsx("mesh",{material:t.wheel,castShadow:!0,children:b.jsx("cylinderGeometry",{args:[.36,.36,.26,14]})}),b.jsx("mesh",{material:t.rim,children:b.jsx("cylinderGeometry",{args:[.22,.22,.28,10]})}),[0,Math.PI/1.5,2*Math.PI/1.5].map((n,s)=>b.jsx("mesh",{material:t.rim,"rotation-z":n,children:b.jsx("boxGeometry",{args:[.04,.3,.04]})},s))]})}const e9=1.4,Fl=new se,t9=36,FC=30,n9=1.6,kC=1.8,HC=["KeyW","ArrowUp"],GC=["KeyS","ArrowDown"],jC=["KeyA","ArrowLeft"],VC=["KeyD","ArrowRight"];function i9(){const{vehicles:i,localVehicleId:e}=ti();return b.jsxs(b.Fragment,{children:[i.map(t=>
4454t.id===e?b.jsx(r9,{vehicleId:t.id},t.id):b.jsx(s9,{vehicleId:t.id},t.id)),b.jsx(l9,{})]})}function s9({vehicleId:i}){const e=q.useRef(null);ps((n,s)=>{const a=ti.getState().vehicles.find(p=>p.id===i);if(!a||!e.current)return;const l=1-Math.exp(-14*s),u=e.current;u.position.x=vn.lerp(u.position.x,a.x,l),u.position.y=vn.lerp(u.position.y,a.y,l),u.position.z=vn.lerp(u.position.z,a.z,l);const h=(a.rotY-u.rotation.y+Math.PI*3)%(Math.PI*2)-Math.PI;u.rotation.y+=h*Math.min(1,12*s)});const t=ti.getState().vehicles.find(n=>n.id===i);return t?b.jsxs("group",{ref:e,position:[t.x,t.y,t.z],rotation:[0,t.rotY,0],children:[b.jsx(Y3,{})," ",b.jsx(J3,{vehicleId:i})," "]}):null}function r9({vehicleId:i}){const e=q.useRef(null),t=q.useRef(0),n=q.useRef(0),s=q.useRef(0),a=q.useRef({fwd:!1,bwd:!1,left:!1,right:!1}),{updateVehicle:l}=ti(),u=tn(m=>m.room);q.useEffect(()=>{const m=ti.getState().vehicles.find(v=>v.id===i);!m||!e.current||(e.current.position.set(m.x,m.y,m.z),n.current=m.rotY,e.current.rotation.y=m.rotY)},[]),q.useEffect(()=>{const m=x=>{HC.includes(x.code)&&(a.current.fwd=!0),GC.includes(x.code)&&(a.current.bwd=!0),jC.includes(x.code)&&(a.current.left=!0),VC.includes(x.code)&&(a.current.right=!0)},v=x=>{HC.includes(x.code)&&(a.current.fwd=!1),GC.includes(x.code)&&(a.current.bwd=!1),jC.includes(x.code)&&(a.current.left=!1),VC.includes(x.code)&&(a.current.right=!1)};return window.addEventListener("keydown",m),window.addEventListener("keyup",v),()=>{window.removeEventListener("keydown",m),window.removeEventListener("keyup",v),a.current={fwd:!1,bwd:!1,left:!1,right:!1}}},[]);const h=q.useRef(new Map),p=q.useRef(new Map);return ps((m,v)=>{if(!e.current)return;const x=e.current.position,_=Math.min(1,Math.abs(t.current)/4);a.current.left&&(n.current+=kC*_*v),a.current.right&&(n.current-=kC*_*v),e.current.rotation.y=n.current;const A=a.current.fwd?1:a.current.bwd?-.6:0;t.current+=A*t9*v,t.current-=t.current*n9*v,t.current=Math.max(-FC*.45,Math.min(FC,t.current)),Math.abs(t.current)<.05&&(t.current=0),x.x-=Math.sin(n.current)*t.current*v,x.z-=Math.cos(n.current)*t.current*v,x.y=.36;const R=Math.sqrt(x.x*x.x+x.z*x.z),w=xp-e9;if(R>w){const ee=w/R;x.x*=ee,x.z*=ee,t.current*=.15}const E=cR,D=x.x,L=x.z;uR(x,E,hp,0),(x.x!==D||x.z!==L)&&(t.current*=.18);const G=2.85*2,H=qD/1e3,F=performance.now()/1e3,X=ti.getState().vehicles;for(const ee of X){if(ee.id===i)continue;const te=x.x-ee.x,ue=x.z-ee.z,he=te*te+ue*ue;if(he>=G*G||he<1e-4)continue;const K=Math.sqrt(he),ce=te/K,re=ue/K,oe=(G-K)*.62;x.x+=ce*oe,x.z+=re*oe;const we=-Math.sin(n.current)*t.current,Be=-Math.cos(n.current)*t.current,pe=we*ce+Be*re;if(pe>=0)continue;const Re=ee.speed??0,lt=-Math.sin(ee.rotY)*Re,ct=-Math.cos(ee.rotY)*Re,vt=lt*ce+ct*re,qt=pe-vt,Wt=-1.8199999999999998*qt*.5,de=we+Wt*ce,an=Be+Wt*re,$e=Math.sqrt(de*de+an*an);n.current=Math.atan2(-de,-an);const Qe=de*-Math.sin(n.current)+an*-Math.cos(n.current);t.current=Qe>=0?$e:-$e,t.current*=.9;const Ye=Math.min(38,Math.abs(qt)*1.2+Math.abs(pe)*.35);if(Ye>=5.5&&u){const pt=p.current.get(ee.id)??0;F-pt>=H*.95&&(p.current.set(ee.id,F),u.send("vehicle_bash",{otherVehicleId:ee.id,impact:Ye}))}}const z=9,k=.42,ie=x.x+Math.sin(n.current)*z*Math.cos(k),ve=x.y+Math.sin(k)*z+1.2,J=x.z+Math.cos(n.current)*z*Math.cos(k);m.camera.position.lerp(new se(ie,ve,J),1-Math.exp(-8*v)),m.camera.lookAt(x.x,x.y+1.2,x.z),window.__eclipseVehicleSpeed=t.current;const le=4,ae=2.4,W=1.5;if(Math.abs(t.current)>=le&&u){const ee=performance.now()/1e3,{remotePlayers:te}=tn.getState();te.forEach((ue,he)=>{if(ue.isDead)return;const K=ue.x-x.x,ce=ue.z-x.z;if(K*K+ce*ce>ae*ae)return;const re=h.current.get(he)??0;ee-re<W||(h.current.set(he,ee),u.send("attack",{type:"vehicle_ram",targetId:he}))})}l(i,{x:x.x,y:x.y,z:x.z,rotY:n.current,speed:t.current}),s.current+=v,s.current>=.05&&(s.current=0,u?.send("vehicle_move",{vehicleId:i,x:x.x,y:x.y,z:x.z,rotY:n.current,speed:t.current}),u?.send("move",{x:x.x,y:x.y+.95,z:x.z,vx:0,vz:0,rotY:n.current,animBits:16,weaponId:(()=>{const ee=ot.getState().equippedWeapon;return ee==="laser_rifle"?1:ee==="light_saber"?2:0})()}))}),b.jsxs("group",{ref:e,children:[b.jsx(Y3,{}),b.jsx(J3,{vehicleId:i})]})}function J3({vehicleId:i}){const e=ti(t=>{const n=t.vehicles.find(s=>s.id===i);return n&&n.maxHp>0?n.hp/n.maxHp:1});return e>=1?null:b.jsx(o9,{pct:e})}const WC=["#ffee44","#ffaa00","#ff6600","#ff3300"],XC=["#ff4400","#dd2200","#ff8800","#cc3300"],qC=["#2a2a2a","#1a1a1a","#333333","#111111"],a9="#ffdd22",L1=26;function o9({pct:i}){const e=i<=0,t=i<.33,n=i<.66,s=e?1:t?.72:n?.45:.22,a=q.useRef(Array(L1).fill(null)),l=q.useRef(Array.from({length:L1},(p,m)=>m/L1*Math.PI*2)),u=q.useRef(null),h=q.useRef(null);return ps((p,m)=>{const v=1.6+s*1.8;l.current=l.current.map((x,_)=>x+m*v*(.7+_%4*.15));for(let x=0;x<6;x++){const _=a.current[x];if(!_)continue;const A=l.current[x],R=Math.sin(A)*.5+.5,w=s*.35;_.position.set(Math.sin(A*1.3+x)*w,.3+R*s*1.4,Math.cos(A*1.1+x)*w);const E=(.1+R*.18)*s;_.scale.setScalar(E),_.material.opacity=.75+R*.25}for(let x=6;x<14;x++){const _=a.current[x];if(!_)continue;const A=l.current[x],R=Math.sin(A*.9+x*.4)*.5+.5,w=x/8*Math.PI*2,E=(.15+R*.2)*s;_.position.set(Math.cos(w+A*.3)*E,.15+R*s*1.8,Math.sin(w+A*.3)*E);const D=(.07+R*.14)*s;_.scale.setScalar(D),_.material.opacity=(.5+R*.5)*s}for(let x=14;x<22;x++){const _=a.current[x];if(!_)continue;const A=l.current[x],R=Math.sin(A*.6+x)*.5+.5,w=x/8*Math.PI*2,E=.18+R*s*.55;
4454_.position.set(Math.cos(w+A*.15)*E,s*1.5+R*s*2.8,Math.sin(w+A*.15)*E);const D=(.14+R*.3)*(.5+s*.5);_.scale.setScalar(D),_.material.opacity=(.18+R*.22)*s}for(let x=22;x<26;x++){const _=a.current[x];if(!_)continue;const A=l.current[x],R=Math.sin(A*2.2+x)*.5+.5;_.position.set(Math.sin(A+x*1.3)*s*.8,.5+R*s*2.2+Math.cos(A*.7)*.4,Math.cos(A+x*1.3)*s*.8);const w=.018+R*.022;_.scale.setScalar(w),_.material.opacity=R*s}if(u.current){const x=.85+Math.sin(l.current[0]*3.7)*.15;u.current.intensity=s*18*x}if(h.current){const x=.8+Math.sin(l.current[3]*5.1)*.2;h.current.intensity=s*8*x}}),!n&&!e?null:b.jsxs("group",{position:[0,.55,0],children:[b.jsx("pointLight",{ref:u,color:"#ff5500",intensity:s*18,distance:e?18:t?13:8,decay:2}),b.jsx("pointLight",{ref:h,color:"#ff9900",intensity:s*8,distance:e?10:6,decay:2,position:[.4,.8,.2]}),Array.from({length:6},(p,m)=>b.jsxs("mesh",{ref:v=>{a.current[m]=v},children:[b.jsx("sphereGeometry",{args:[1,6,6]}),b.jsx("meshBasicMaterial",{color:WC[m%WC.length],transparent:!0,opacity:.9,depthWrite:!1})]},`core-${m}`)),Array.from({length:8},(p,m)=>b.jsxs("mesh",{ref:v=>{a.current[6+m]=v},children:[b.jsx("sphereGeometry",{args:[1,5,5]}),b.jsx("meshBasicMaterial",{color:XC[m%XC.length],transparent:!0,opacity:.7,depthWrite:!1})]},`sec-${m}`)),t&&Array.from({length:8},(p,m)=>b.jsxs("mesh",{ref:v=>{a.current[14+m]=v},children:[b.jsx("sphereGeometry",{args:[1,5,5]}),b.jsx("meshBasicMaterial",{color:qC[m%qC.length],transparent:!0,opacity:.2,depthWrite:!1})]},`smoke-${m}`)),Array.from({length:4},(p,m)=>b.jsxs("mesh",{ref:v=>{a.current[22+m]=v},children:[b.jsx("sphereGeometry",{args:[1,4,4]}),b.jsx("meshBasicMaterial",{color:a9,transparent:!0,opacity:.9,depthWrite:!1})]},`ember-${m}`)),e&&b.jsxs("mesh",{position:[0,-.35,0],children:[b.jsx("boxGeometry",{args:[3.8,1.4,5.8]}),b.jsx("meshBasicMaterial",{color:"#080808",transparent:!0,opacity:.92})]})]})}function l9(){const i=ti(s=>s.setTargetedVehicle),e=ti(s=>s.setTargetedPlayer),t=ti(s=>s.setTargetScreenNdc),{camera:n}=Gc();return ps(()=>{const{vehicles:s,localVehicleId:a}=ti.getState(),{localPos:l,isAiming:u}=ot.getState(),{remotePlayers:h,sessionId:p}=tn.getState();if(!l){i(-1),e(""),t(0,0);return}if(a===-1&&!u){i(-1),e(""),t(0,0);return}const m=50,v=u?.1:.18,x=(G,H,F)=>(Fl.set(G,H,F).project(n),Fl.z>=1?1/0:Math.sqrt(Fl.x*Fl.x+Fl.y*Fl.y));let _=-1,A=v,R=0,w=0;for(const G of s){if(G.hp<=0)continue;const H=G.x-l.x,F=G.z-l.z;if(Math.sqrt(H*H+F*F)<1.5||Math.sqrt(H*H+F*F)>m)continue;const X=x(G.x,G.y+.8,G.z);X<A&&(A=X,_=G.id,R=Fl.x,w=Fl.y)}let E="",D=v,L=0,P=0;a===-1&&h.forEach((G,H)=>{if(G.isDead||H===p||s.some(ie=>ie.driverId===H))return;const F=G.x-l.x,X=G.z-l.z,z=Math.sqrt(F*F+X*X);if(z<1||z>m*.7)return;const k=x(G.x,G.y+1,G.z);k<D&&(D=k,E=H,L=Fl.x,P=Fl.y)}),_!==-1&&A<=D?(i(_),e(""),t(R,w)):E!==""?(i(-1),e(E),t(L,P)):(i(_),e(""),t(0,0))}),null}const c9=[{name:"forward",keys:["ArrowUp","KeyW"]},{name:"backward",keys:["ArrowDown","KeyS"]},{name:"left",keys:["ArrowLeft","KeyA"]},{name:"right",keys:["ArrowRight","KeyD"]},{name:"jump",keys:["Space"]},{name:"run",keys:["ShiftLeft","ShiftRight"]},{name:"crouch",keys:["ControlLeft","KeyC"]},{name:"attack",keys:["KeyE"]},{name:"combo",keys:["KeyR"]},{name:"fire",keys:["KeyF","Digit0"]},{name:"switchWeapon",keys:["KeyQ"]}],u9={shadow_runner:[{id:"faca",name:"Faca Monofilamento",type:"weapon",icon:"🗡️",quantity:1,description:"Lâmina silenciosa de corte molecular.",slot:1},{id:"pistola",name:"Pistola Neon",type:"weapon",icon:"🔫",quantity:1,description:"Pistola semi-automática compacta.",slot:2},{id:"kit_saude",name:"Kit de Saúde",type:"consumable",icon:"💉",quantity:2,description:"Recupera 50 HP. Uso imediato.",slot:3},{id:"smoke",name:"Granada de Fumo",type:"special",icon:"💨",quantity:1,description:"Cria cortina de fumo por 5s.",slot:4}],pulse_tank:[{id:"espingarda",name:"Espingarda de Plasma",type:"weapon",icon:"🔫",quantity:1,description:"Alto dano a curta distância.",slot:1},{id:"placa",name:"Placa de Armadura",type:"armor",icon:"🛡️",quantity:3,description:"Absorve 30 de dano.",slot:2},{id:"kit_saude",name:"Kit de Saúde",type:"consumable",icon:"💉",quantity:2,description:"Recupera 50 HP.",slot:3},{id:"bomba",name:"Bomba de Pulso",type:"special",icon:"💥",quantity:1,description:"Atordoa inimigos num raio de 5m.",slot:4}],neon_striker:[{id:"smg",name:"SMG Neon-X",type:"weapon",icon:"🔫",quantity:1,description:"Cadência elevada, dano moderado.",slot:1},{id:"boost",name:"Boost de Energia",type:"consumable",icon:"⚡",quantity:2,description:"+30% velocidade por 8s.",slot:2},{id:"kit_saude",name:"Kit de Saúde",type:"consumable",icon:"💉",quantity:2,description:"Recupera 50 HP.",slot:3},{id:"emp",name:"Bomba EMP",type:"special",icon:"🌀",quantity:1,description:"Desactiva HUDs inimigos por 3s.",slot:4}]},pA=jc((i,e)=>({items:[],initForClass:t=>{i({items:u9[t]??[]})},useItem:t=>{i(n=>({items:n.items.map(s=>s.id===t&&s.quantity>0?{...s,quantity:s.quantity-1}:s).filter(s=>s.quantity>0||s.type==="weapon")}))},addItem:t=>{const n=e().items.find(s=>s.id===t.id);i(n?s=>({items:s.items.map(a=>a.id===t.id?{...a,quantity:a.quantity+t.quantity}:a)}):s=>({items:[...s.items,t]}))}})),f9={background:"linear-gradient(135deg, rgba(5,8,35,0.52) 0%, rgba(2,4,22,0.58) 100%)",backdropFilter:"blur(44px) saturate(2.4) brightness(0.82)",WebkitBackdropFilter:"blur(44px) saturate(2.4) brightness(0.82)",border:"1px solid rgba(0,245,255,0.38)",borderRadius:18,boxShadow:["0 0 90px rgba(0,245,255,0.14)","0 8px 32px rgba(0,0,0,0.5)","inset 0 1px 0 rgba(255,255,255,0.10)","inset 0 -1px 0 rgba(0,0,0,0.3)","inset 0 0 80px rgba(0,245,255,0.025)"].join(", "),backgroundImage:["linear-gradient(135deg, rgba(5,8,35,0.52) 0%, rgba(2,4,22,0.58) 100%)","repeating-linear-gradient(45deg, rgba(255,255,255,0.013) 0px, rgba(255,255,255,0.013) 1px, transparent 1px, transparent 14px)"].join(", ")},d9=[["W / A / S / D","Move"],["SHIFT","Sprint"],["CTRL / C","Crouch"],["SPACE","Jump"],["E","Punch (near a flag = capture)"],["R","Kick"],["I / M","Inventory / pack (1–4 with pack open)"],["H / B","Use medkit / ammo box (in arena)"],["ENTER / /","Open room chat"],["F2 / F3","Toggle chat"],["V / L","Mic (V) or listen without mic (L)"],["Scroll","Camera zoom"],["Mouse","Rotate camera (with pointer lock)"],["ESC","Pause / free mouse"]];function h9({onResume:i}){const e=ot(a=>a.isPaused);tn(a=>a.room);const t=tn(a=>a.disconnect),n=ot(a=>a.setPhase);if(!e)return null;const s=()=>{t(),n("menu")};return b.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:4e3,pointerEvents:"all"},children:[b.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.42)",backdropFilter:"brightness(0.6)",WebkitBackdropFilter:"brightness(0.6)"}}),b.jsxs("div",{style:{...f9,position:"relative",width:380,maxWidth:"90vw",padding:"36px 40px",fontFamily:"monospace",color:"#e0e8ff",display:"flex",flexDirection:"column",gap:0},children:[b.jsx("div",{style:{position:"absolute",top:0,left:40,right:40,height:2,background:"linear-gradient(90deg, transparent, #00f5ff, transparent)",borderRadius:2}}),b.jsxs("div",{style:{textAlign:"center",marginBottom:32},children:[b.jsx("div",{style:{fontSize:11,letterSpacing:"0.35em",color:"rgba(0,245,255,0.5)",marginBottom:6},children:"ECLIPSE PROTOCOL"}),b.jsx("div",{style:{fontSize:22,fontWeight:"bold",letterSpacing:"0.2em",color:"#00f5ff",textShadow:"0 0 18px #00f5ff, 0 0 40px rgba(0,245,255,0.4)"},children:"GAME PAUSED"})]}),b.jsx(YC,{color:"#00f5ff",onClick:i,primary:!0,children:"▶ RESUME"}),b.jsx(m9,{}),b.jsx(p9,{}),b.jsx(g9,{}),b.jsx(YC,{color:"#ff2d7a",onClick:s,style:{marginTop:6},children:"✕ LEAVE ROOM"}),b.jsx("div",{style:{position:"absolute",bottom:0,left:40,right:40,height:1,background:"linear-gradient(90deg, transparent, rgba(0,245,255,0.3), transparent)"}})]})]})}function YC({children:i,onClick:e,color:t,primary:n,style:s}){return b.jsx("button",{onClick:e,style:{display:"block",width:"100%",padding:"13px 20px",background:n?"rgba(0,245,255,0.08)":"rgba(255,255,255,0.03)",border:`1px solid ${n?t:"rgba(255,255,255,0.1)"}`,borderRadius:8,color:n?t:"rgba(255,255,255,0.7)",fontFamily:"monospace",fontSize:13,letterSpacing:"0.15em",curs
4454or:"pointer",textAlign:"left",marginBottom:8,transition:"all 0.15s",textShadow:n?`0 0 10px ${t}`:"none",boxShadow:n?"inset 0 0 20px rgba(0,245,255,0.05)":"none",...s},onMouseEnter:a=>{a.currentTarget.style.background=n?"rgba(0,245,255,0.15)":"rgba(255,255,255,0.07)"},onMouseLeave:a=>{a.currentTarget.style.background=n?"rgba(0,245,255,0.08)":"rgba(255,255,255,0.03)"},children:i})}function p9(){const i=ot(t=>t.graphicsQuality),e=ot(t=>t.setGraphicsQuality);return b.jsxs("details",{style:{marginBottom:8,border:"1px solid rgba(255,255,255,0.08)",borderRadius:8,overflow:"hidden"},children:[b.jsxs("summary",{style:{padding:"13px 20px",cursor:"pointer",background:"rgba(255,255,255,0.03)",fontFamily:"monospace",fontSize:13,letterSpacing:"0.15em",color:"rgba(255,255,255,0.7)",listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",userSelect:"none"},children:[b.jsx("span",{children:"▣ GRAPHICS"}),b.jsx("span",{style:{fontSize:10,opacity:.5},children:"click to expand"})]}),b.jsxs("div",{style:{padding:"14px 20px 16px",background:"rgba(0,0,0,0.3)",borderTop:"1px solid rgba(255,255,255,0.05)",display:"flex",gap:8},children:[b.jsx("button",{onClick:()=>e("performance"),style:{flex:1,borderRadius:6,padding:"8px 10px",border:i==="performance"?"1px solid #00ff88":"1px solid rgba(255,255,255,0.2)",background:i==="performance"?"rgba(0,255,136,0.12)":"rgba(255,255,255,0.03)",color:i==="performance"?"#00ff88":"#bbb",fontFamily:"monospace",fontSize:11,letterSpacing:"0.1em",cursor:"pointer"},children:"PERFORMANCE"}),b.jsx("button",{onClick:()=>e("quality"),style:{flex:1,borderRadius:6,padding:"8px 10px",border:i==="quality"?"1px solid #00f5ff":"1px solid rgba(255,255,255,0.2)",background:i==="quality"?"rgba(0,245,255,0.12)":"rgba(255,255,255,0.03)",color:i==="quality"?"#00f5ff":"#bbb",fontFamily:"monospace",fontSize:11,letterSpacing:"0.1em",cursor:"pointer"},children:"QUALITY"})]})]})}function m9(){return b.jsxs("details",{style:{marginBottom:8,border:"1px solid rgba(255,255,255,0.08)",borderRadius:8,overflow:"hidden"},children:[b.jsxs("summary",{style:{padding:"13px 20px",cursor:"pointer",background:"rgba(255,255,255,0.03)",fontFamily:"monospace",fontSize:13,letterSpacing:"0.15em",color:"rgba(255,255,255,0.7)",listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",userSelect:"none"},children:[b.jsx("span",{children:"⌨ CONTROLS"}),b.jsx("span",{style:{fontSize:10,opacity:.5},children:"click to expand"})]}),b.jsx("div",{style:{padding:"12px 20px 16px",background:"rgba(0,0,0,0.3)",borderTop:"1px solid rgba(255,255,255,0.05)"},children:d9.map(([i,e])=>b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",padding:"5px 0",borderBottom:"1px solid rgba(255,255,255,0.04)",gap:12},children:[b.jsx("span",{style:{background:"rgba(0,245,255,0.08)",border:"1px solid rgba(0,245,255,0.2)",borderRadius:4,padding:"2px 8px",fontSize:10,color:"#00f5ff",letterSpacing:"0.1em",whiteSpace:"nowrap",flexShrink:0},children:i}),b.jsx("span",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",textAlign:"right"},children:e})]},i))})]})}function g9(){const i=Ic(l=>l.musicVolume),e=Ic(l=>l.sfxVolume),t=Ic(l=>l.isMuted),n=Ic(l=>l.setMusicVolume),s=Ic(l=>l.setSfxVolume),a=Ic(l=>l.toggleMute);return b.jsxs("details",{style:{marginBottom:8,border:"1px solid rgba(255,255,255,0.08)",borderRadius:8,overflow:"hidden"},children:[b.jsx("style",{children:`
4455        .ep-slider {
4456          -webkit-appearance: none;
4457          appearance: none;
4458          width: 100%;
4459          height: 4px;
4460          border-radius: 2px;
4461          outline: none;
4462          cursor: pointer;
4463          transition: opacity 0.2s;
4464        }
4465        .ep-slider::-webkit-slider-thumb {
4466          -webkit-appearance: none;
4467          appearance: none;
4468          width: 14px;
4469          height: 14px;
4470          border-radius: 50%;
4471          background: #00f5ff;
4472          box-shadow: 0 0 8px #00f5ff;
4473          cursor: pointer;
4474        }
4475        .ep-slider::-moz-range-thumb {
4476          width: 14px;
4477          height: 14px;
4478          border-radius: 50%;
4479          background: #00f5ff;
4480          box-shadow: 0 0 8px #00f5ff;
4481          cursor: pointer;
4482          border: none;
4483        }
4484        .ep-slider-sfx::-webkit-slider-thumb { background: #8000ff; box-shadow: 0 0 8px #8000ff; }
4485        .ep-slider-sfx::-moz-range-thumb     { background: #8000ff; box-shadow: 0 0 8px #8000ff; }
4486      `}),b.jsxs("summary",{style:{padding:"13px 20px",cursor:"pointer",background:"rgba(255,255,255,0.03)",fontFamily:"monospace",fontSize:13,letterSpacing:"0.15em",color:"rgba(255,255,255,0.7)",listStyle:"none",display:"flex",justifyContent:"space-between",alignItems:"center",userSelect:"none"},children:[b.jsx("span",{children:"♫ AUDIO"}),b.jsx("span",{style:{fontSize:10,opacity:.5},children:"click to expand"})]}),b.jsxs("div",{style:{padding:"16px 20px 18px",background:"rgba(0,0,0,0.3)",borderTop:"1px solid rgba(255,255,255,0.05)",display:"flex",flexDirection:"column",gap:16},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[b.jsx("span",{style:{fontSize:11,letterSpacing:"0.12em",color:"rgba(255,255,255,0.55)"},children:"MASTER MUTE"}),b.jsx("button",{onClick:a,style:{background:t?"rgba(255,45,122,0.15)":"rgba(0,245,255,0.10)",border:`1px solid ${t?"#ff2d7a":"#00f5ff"}`,borderRadius:6,padding:"4px 14px",color:t?"#ff2d7a":"#00f5ff",fontFamily:"monospace",fontSize:11,letterSpacing:"0.12em",cursor:"pointer",textShadow:t?"0 0 8px #ff2d7a":"0 0 8px #00f5ff"},children:t?"🔇 MUTED":"🔊 ON"})]}),b.jsxs("div",{children:[b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:8},children:[b.jsx("span",{style:{fontSize:11,letterSpacing:"0.12em",color:"rgba(255,255,255,0.55)"},children:"MUSIC"}),b.jsxs("span",{style:{fontSize:11,color:"#00f5ff",fontFamily:"monospace"},children:[Math.round(i*100),"%"]})]}
4486),b.jsx("input",{type:"range",min:0,max:1,step:.01,value:i,onChange:l=>n(parseFloat(l.target.value)),className:"ep-slider",style:{background:`linear-gradient(90deg, #00f5ff ${i*100}%, rgba(255,255,255,0.1) ${i*100}%)`,opacity:t?.4:1}})]}),b.jsxs("div",{children:[b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginBottom:8},children:[b.jsx("span",{style:{fontSize:11,letterSpacing:"0.12em",color:"rgba(255,255,255,0.55)"},children:"SFX"}),b.jsxs("span",{style:{fontSize:11,color:"#8000ff",fontFamily:"monospace"},children:[Math.round(e*100),"%"]})]}),b.jsx("input",{type:"range",min:0,max:1,step:.01,value:e,onChange:l=>s(parseFloat(l.target.value)),className:"ep-slider ep-slider-sfx",style:{background:`linear-gradient(90deg, #8000ff ${e*100}%, rgba(255,255,255,0.1) ${e*100}%)`}})]}),b.jsx("div",{style:{fontSize:9,color:"rgba(255,255,255,0.22)",letterSpacing:"0.08em",textAlign:"center",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:10},children:"♫ B.E.R. — The Night Begins To Shine (Instrumental)"})]})]})}const v9={background:"linear-gradient(135deg, rgba(5,8,35,0.50) 0%, rgba(2,4,20,0.55) 100%)",backdropFilter:"blur(36px) saturate(2.2) brightness(0.80)",WebkitBackdropFilter:"blur(36px) saturate(2.2) brightness(0.80)",border:"1px solid rgba(0,245,255,0.32)",borderRadius:14,boxShadow:["0 0 70px rgba(0,245,255,0.11)","0 8px 32px rgba(0,0,0,0.5)","inset 0 1px 0 rgba(255,255,255,0.09)","inset 0 0 60px rgba(0,245,255,0.02)"].join(", "),backgroundImage:["linear-gradient(135deg, rgba(5,8,35,0.50) 0%, rgba(2,4,20,0.55) 100%)","repeating-linear-gradient(135deg, rgba(255,255,255,0.011) 0px, rgba(255,255,255,0.011) 1px, transparent 1px, transparent 12px)"].join(", ")};function y9(){const i=ot(m=>m.isInventoryOpen),e=ot(m=>m.toggleInventory),t=pA(m=>m.items),n=pA(m=>m.useItem),s=ot(m=>m.healthCapsules),a=ot(m=>m.ammoBoxes),l=ot(m=>m.hp),u=ot(m=>m.maxHp),h=tn(m=>m.room);if(q.useEffect(()=>{if(!i)return;document.pointerLockElement&&document.exitPointerLock();const m=v=>{if(v.key==="Escape"){v.preventDefault(),e();return}if(/^[1-4]$/.test(v.key)){v.preventDefault();const x=Number(v.key),_=t.find(A=>A.slot===x);_&&_.type!=="weapon"&&n(_.id)}};return window.addEventListener("keydown",m),()=>window.removeEventListener("keydown",m)},[i,e,t,n]),!i)return null;const p=m=>t.filter(v=>v.type===m);return b.jsxs("div",{style:{position:"absolute",inset:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:3800,pointerEvents:"all"},children:[b.jsx("div",{style:{position:"absolute",inset:0,background:"rgba(0,0,0,0.38)",backdropFilter:"brightness(0.55)",WebkitBackdropFilter:"brightness(0.55)"},onClick:e}),b.jsxs("div",{style:{...v9,position:"relative",width:520,maxWidth:"90vw",padding:"28px 32px",fontFamily:"monospace",color:"#e0e8ff",pointerEvents:"all"},children:[b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:20,borderBottom:"1px solid rgba(0,245,255,0.15)",paddingBottom:12},children:[b.jsxs("div",{children:[b.jsx("div",{style:{fontSize:18,fontWeight:"bold",color:"#00f5ff",letterSpacing:"0.15em",textShadow:"0 0 12px #00f5ff"},children:"PACK"}),b.jsx("div",{style:{fontSize:11,color:"rgba(0,245,255,0.5)",marginTop:2,lineHeight:1.45},children:"[Ctrl+Shift+I] pack · max. 2 medkits + 2 ammo in a lobby game · ESC closes · [H] medkit · [B] ammo · [1]–[4] use slot"})]}),b.jsx("button",{onClick:e,style:{background:"none",border:"1px solid rgba(0,245,255,0.3)",borderRadius:6,color:"#00f5ff",cursor:"pointer",fontSize:16,padding:"4px 10px",letterSpacing:"0.05em"},children:"✕"})]}),b.jsx(A0,{children:"ARENA CONSUMABLES"}),b.jsxs("div",{style:{display:"flex",gap:12,marginBottom:20},children:[b.jsxs("div",{style:{flex:1,background:"rgba(255,40,60,0.10)",border:"1px solid rgba(255,40,60,0.40)",borderRadius:10,padding:"12px 16px",display:"flex",flexDirection:"column",gap:6},children:[b.jsx("div",{style:{fontSize:28,textAlign:"center"},children:"💉"}),b.jsx("div",{style:{fontSize:11,letterSpacing:"0.1em",color:"#ff6677",textAlign:"center"},children:"MEDKIT"}),b.jsx("div",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",textAlign:"center"},children:"Restores 50 HP"}),b.jsxs("div",{style:{textAlign:"center",fontSize:18,color:"#ff4455",fontWeight:700},children:["×",s]}
4486),b.jsxs("div",{style:{fontSize:10,color:"#888",textAlign:"center"},children:["HP: ",l,"/",u]}),b.jsx("button",{onClick:()=>{s>0&&h&&h.send("use_item",{type:"health"})},disabled:s<=0||l>=u,style:{background:s>0&&l<u?"rgba(255,40,60,0.25)":"rgba(255,255,255,0.05)",border:"1px solid rgba(255,40,60,0.4)",borderRadius:6,color:s>0&&l<u?"#ff6677":"#555",cursor:s>0&&l<u?"pointer":"not-allowed",fontSize:11,padding:"6px",letterSpacing:"0.1em"},children:l>=u?"HP FULL":s<=0?"NO MEDKITS":"USE [H]"})]}),b.jsxs("div",{style:{flex:1,background:"rgba(255,230,0,0.08)",border:"1px solid rgba(255,230,0,0.35)",borderRadius:10,padding:"12px 16px",display:"flex",flexDirection:"column",gap:6},children:[b.jsx("div",{style:{fontSize:28,textAlign:"center"},children:"📦"}),b.jsx("div",{style:{fontSize:11,letterSpacing:"0.1em",color:"#ffe600",textAlign:"center"},children:"AMMO BOX"}),b.jsx("div",{style:{fontSize:11,color:"rgba(255,255,255,0.5)",textAlign:"center"},children:"Adds 30 rounds"}),b.jsxs("div",{style:{textAlign:"center",fontSize:18,color:"#ffe600",fontWeight:700},children:["×",a]}),b.jsx("button",{onClick:()=>{a>0&&h&&h.send("use_item",{type:"ammo"})},disabled:a<=0,style:{background:a>0?"rgba(255,230,0,0.15)":"rgba(255,255,255,0.05)",border:"1px solid rgba(255,230,0,0.4)",borderRadius:6,color:a>0?"#ffe600":"#555",cursor:a>0?"pointer":"not-allowed",fontSize:11,padding:"6px",letterSpacing:"0.1em"},children:a<=0?"NO AMMO":"RELOAD [B]"})]})]}),b.jsx(A0,{children:"QUICK SLOTS (1–4)"}),b.jsx("div",{style:{display:"flex",gap:10,marginBottom:20},children:[1,2,3,4].map(m=>{const v=t.find(x=>x.slot===m);return b.jsx(x9,{slot:m,item:v,onUse:n},m)})}),p("weapon").length>0&&b.jsxs(b.Fragment,{children:[b.jsx(A0,{children:"WEAPONS"}),b.jsx(P1,{items:p("weapon"),onUse:n})]}),p("consumable").length>0&&b.jsxs(b.Fragment,{children:[b.jsx(A0,{children:"CONSUMABLES"}),b.jsx(P1,{items:p("consumable"),onUse:n})]}),[...p("armor"),...p("special")].length>0&&b.jsxs(b.Fragment,{children:[b.jsx(A0,{children:"GEAR"}),b.jsx(P1,{items:[...p("armor"),...p("special")],onUse:n})]})]})]})}function A0({children:i}){return b.jsx("div",{style:{fontSize:10,letterSpacing:"0.2em",color:"rgba(0,245,255,0.5)",marginBottom:8,textTransform:"uppercase"},children:i})}function x9({slot:i,item:e,onUse:t}){const n=!e;return b.jsxs("div",{onClick:()=>e&&t(e.id),title:e?.description,style:{width:72,height:72,borderRadius:8,border:`1px solid ${n?"rgba(255,255,255,0.08)":"rgba(0,245,255,0.4)"}`,background:n?"rgba(255,255,255,0.03)":"rgba(0,245,255,0.06)",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",cursor:n?"default":"pointer",position:"relative",transition:"border-color 0.15s"},children:[b.jsx("div",{style:{fontSize:10,color:"rgba(255,255,255,0.3)",position:"absolute",top:4,left:6},children:i}),e?b.jsxs(b.Fragment,{children:[b.jsx("div",{style:{fontSize:24},children:e.icon}),b.jsx("div",{style:{fontSize:9,color:"rgba(255,255,255,0.6)",marginTop:2,textAlign:"center",maxWidth:64,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:e.name}),e.quantity>1&&b.jsxs("div",{style:{position:"absolute",bottom:4,right:6,fontSize:9,color:"#ffe600"},children:["×",e.quantity]})]}):b.jsx("div",{style:{fontSize:18,color:"rgba(255,255,255,0.1)"},children:"+"})]})}function P1({items:i,onUse:e}){return b.jsx("div",{style:{display:"flex",flexWrap:"wrap",gap:8,marginBottom:16},children:i.map(t=>b.jsxs("div",{onClick:()=>t.type!=="weapon"&&e(t.id),title:t.description,style:{display:"flex",alignItems:"center",gap:10,background:"rgba(255,255,255,0.04)",border:"1px solid rgba(255,255,255,0.1)",borderRadius:8,padding:"8px 14px",cursor:t.type!=="weapon"?"pointer":"default",minWidth:160,flex:"1 0 auto",maxWidth:220},children:[b.jsx("div",{style:{fontSize:22},children:t.icon}),b.jsxs("div",{style:{flex:1,overflow:"hidden"},children:[b.jsx("div",{style:{fontSize:12,color:"#e0e8ff",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},children:t.name}),b.jsx("div",{style:{fontSize:10,color:"rgba(255,255,255,0.35)",marginTop:2},children:t.description})]}),t.quantity>1&&b.jsxs("div",{style:{fontSize:12,color:"#ffe600",fontWeight:"bold"},children:["×",t.quantity]})]},t.id))})}function _9(){const i=q.useRef(null),e=Ic(n=>n.musicVolume),t=Ic(n=>n.isMuted);return q.useEffect(()=>
4486{const n=i.current;if(!n)return;n.volume=t?0:e;function s(){n.play().catch(a=>{})}return s(),window.addEventListener("click",s,{once:!0}),window.addEventListener("keydown",s,{once:!0}),window.addEventListener("touchstart",s,{once:!0}),()=>{window.removeEventListener("click",s),window.removeEventListener("keydown",s),window.removeEventListener("touchstart",s),n.pause()}},[]),q.useEffect(()=>{const n=i.current;n&&(n.volume=t?0:e)},[e,t]),b.jsx("audio",{ref:i,src:"/theme.mp3",loop:!0,preload:"auto",style:{display:"none"}})}function b9(){q.useRef(null);const i=ot(a=>a.setPaused),e=ot(a=>a.toggleInventory),t=ot(a=>a.setCommsTyping),n=ot(a=>a.selectedClass),s=pA(a=>a.initForClass);return q.useEffect(()=>{n&&s(n)},[n,s]),q.useEffect(()=>{const a=()=>{const l=!!document.pointerLockElement,{isInventoryOpen:u,isCommsTyping:h}=ot.getState();!l&&!u&&!h&&i(!0),l&&i(!1)};return document.addEventListener("pointerlockchange",a),()=>document.removeEventListener("pointerlockchange",a)},[i]),q.useEffect(()=>{const a=l=>{if(l.repeat||!(l.ctrlKey&&l.shiftKey&&l.code==="KeyI"))return;const u=l.target;if(u instanceof HTMLTextAreaElement||u instanceof HTMLElement&&u.isContentEditable)return;if(u instanceof HTMLInputElement){if(u.dataset.eclipseComms!=="1")return;l.preventDefault(),u.blur(),ot.getState().setCommsTyping(!1)}else l.preventDefault();const h=!ot.getState().isInventoryOpen;e(),h&&document.pointerLockElement&&document.exitPointerLock(),h&&t(!1)};return window.addEventListener("keydown",a,{capture:!0}),()=>window.removeEventListener("keydown",a,{capture:!0})},[e,t]),null}function S9(){const i=Lo(e=>e.t);return b.jsxs("div",{style:{position:"fixed",bottom:80,left:"50%",transform:"translateX(-50%)",color:"#aaa",fontSize:12,fontFamily:"monospace",pointerEvents:"none",letterSpacing:.5,textAlign:"center",lineHeight:1.5,maxWidth:"min(520px, 92vw)"},children:[b.jsx("div",{children:i("arena_pointer_line1")}),b.jsx("div",{style:{fontSize:11,color:"#666",marginTop:4},children:i("arena_pointer_line2")})]})}function A9(){const i=ot(a=>a.isPaused),e=ot(a=>a.isInventoryOpen),n=ot(a=>a.graphicsQuality)==="performance",s=()=>{document.querySelector("canvas")?.requestPointerLock()};return b.jsxs(b.Fragment,{children:[b.jsx(m6,{map:c9,children:b.jsxs(mM,{shadows:{type:mp},dpr:n?[1,1.35]:[1,2],gl:{antialias:!0,powerPreference:"high-performance",toneMappingExposure:n?1.58:1.72},camera:{fov:70,near:.1,far:500},style:{background:"#060008"},children:[b.jsx("ambientLight",{intensity:.38,color:"#1a1828"}),b.jsx("hemisphereLight",{color:"#5c2830",groundColor:"#100c18",intensity:.58}),b.jsx("directionalLight",{castShadow:!0,position:[0,110,-220],intensity:1.05,color:"#e05028","shadow-mapSize":n?[1024,1024]:[2048,2048],"shadow-camera-near":.4,"shadow-camera-far":500,"shadow-camera-left":-170,"shadow-camera-right":170,"shadow-camera-top":170,"shadow-camera-bottom":-170,"shadow-bias":-5e-4,"shadow-normalBias":.045,"shadow-radius":3}),b.jsx("directionalLight",{position:[-100,60,100],intensity:.28,color:"#1c1040"}),b.jsx(W3,{}),b.jsx(bj,{}),b.jsxs(q.Suspense,{fallback:null,children:[b.jsx(Pj,{}),b.jsx(Oj,{})]}),b.jsx(kj,{}),b.jsx(qj,{}),b.jsx(i9,{}),b.jsx(P3,{multisampling:0,children:b.jsx(O3,{intensity:n?.38:.55,luminanceThreshold:n?.22:.18,luminanceSmoothing:.9})}),!1]})}),b.jsx(b9,{}),!i&&b.jsx(S9,{}),b.jsx(h9,{onResume:s}),e&&b.jsx(y9,{}),b.jsx(_9,{})]})}function M9(i){switch(i){case"not_supported":return Ir("voice_not_supported");case"NotAllowedError":case"PermissionDeniedError":return Ir("voice_blocked");case"NotFoundError":case"DevicesNotFoundError":return Ir("voice_no_device");case"NotReadableError":case"TrackStartError":return Ir("voice_in_use");default:return Ir("voice_generic")}}function E9(i,e){const[t,n]=q.useState(0),s=q.useRef(0),a=q.useRef(null);return q.useEffect(()=>{if(!i){cancelAnimationFrame(s.current),a.current?.close(),a.current=null,n(0);return}let l;e.current&&e.current.state!=="closed"?l=e.current:(l=new AudioContext,e.current=l),a.current=l,l.resume();const u=l.createMediaStreamSource(i),h=l.createAnalyser();h.fftSize=512,h.smoothingTimeConstant=.6,u.connect(h);const p=new Uint8Array(h.frequencyBinCount),m=()=>{h.getByteTimeDomainData(p);let v=0;for(let _=0;_<p.length;_++){const A=(p[_]-128)/128;v+=A*A}const x=Math.sqrt(v/p.length);n(Math.min(100,Math.round(x*500))),s.current=requestAnimationFrame(m)};return s.current=requestAnimationFrame(m),()=>{cancelAnimationFrame(s.current),l.close(),e.current===l&&(e.current=null),a.current=null,n(0)}},[i,e]),t}function T9(){const i=tn(D=>D.room),e=tn(D=>D.sessionId),t=q.useRef(null),[n,s]=q.useState("off"),[a,l]=q.useState(!1),[u,h]=q.useState(null),[p,m]=q.useState(""),[v,x]=q.useState(null),_=q.useRef(null),A=E9(n==="mic"?v:null,_);q.useEffect(()=>{if(!i||!e)return;const D=new iP(i,e,{onLive:L=>{x(L),l(!1),h(null),s("mic")},onListenLive:()=>{x(null),l(!1),h(null),s("listen")},onFailed:L=>{x(null),l(!1),s("off"),h(M9(L))},onStep:L=>{m(L)}});return t.current=D,()=>{D.dispose(),t.current=null,x(null),l(!1),h(null),m(""),s("off")}},[i,e]);const R=q.useCallback(D=>{if(h(null),!t.current){h(Ir("voice_channel_starting"));return}if(D==="mic"&&((!_.current||_.current.state==="closed")&&(_.current=ne
4486w AudioContext),_.current.resume()),D==="off"){l(!1),x(null),s("off"),t.current.setVoiceMode("off");return}if(D==="listen"){l(!0),s("off"),x(null),t.current.setVoiceMode("listen");return}D==="mic"&&(l(!0),s("off"),x(null),t.current.setVoiceMode("mic"))},[]),w=q.useCallback(()=>h(null),[]);return{voiceMode:n,voiceEnabled:n!=="off",voicePending:a,voiceError:u,voiceStep:p,micLevel:A,setVoiceMode:R,clearVoiceError:w}}const JC={shadow_runner:"#00f5ff",pulse_tank:"#ff2d2d",neon_striker:"#ffe600"},w9=["#00f5ff","#ff2d7a","#ffe600","#00ff88","#ff8800","#cc44ff","#ff6b9d","#7af3c1","#a78bfa","#fbbf24","#38bdf8","#f472b6"],bM=y_.map((i,e)=>({id:i.id,x:i.x,z:i.z,color:w9[e]??"#fff"}));function C9(){const i=ot(n=>n.hazardText),e=ot(n=>n.hazardSeq),t=ot(n=>n.clearHazard);return q.useEffect(()=>{if(!i)return;const n=window.setTimeout(()=>t(),3200);return()=>window.clearTimeout(n)},[i,e,t]),i?b.jsx("div",{style:{position:"absolute",top:64,left:"50%",transform:"translateX(-50%)",maxWidth:"min(420px, 90vw)",padding:"7px 14px",background:"rgba(14, 10, 6, 0.9)",border:"1px solid rgba(255, 140, 60, 0.45)",color:"#ffdccc",fontSize:"0.7rem",textAlign:"center",borderRadius:8,pointerEvents:"none",zIndex:5,lineHeight:1.35,boxShadow:"0 4px 20px rgba(0,0,0,0.4)"},children:i}):null}function R9(){const i=ot(F=>F.score),e=ot(F=>F.kills),t=ot(F=>F.deaths),n=ot(F=>F.selectedClass),s=ot(F=>F.equippedWeapon),a=ot(F=>F.ammo),l=ot(F=>F.isReloading),u=ot(F=>F.zoomLevel),h=ot(F=>F.hp),p=ot(F=>F.maxHp),m=ot(F=>F.ammoBoxes),v=ot(F=>F.healthCapsules),x=ot(F=>F.matchTimeLeft),_=ot(F=>F.lobbyMaxPlayers),A=ot(F=>F.respawnsLeft),R=ot(F=>F.autoReloadLeft),w=ot(F=>F.autoHealLeft),E=ot(F=>F.phase);tn(F=>F.syncRevision);const D=tn.getState().allPlayers,L=tn(F=>F.sessionId),P=JC[n??""]??"#ffe600",G=s==="laser_rifle"?"⚡ LASER RIFLE":s==="light_saber"?"⚔ LIGHTSABER":"— NO WEAPON —",H=Array.from(D.values()).sort((F,X)=>X.score-F.score);return b.jsxs("div",{style:Ci.overlay,children:[b.jsx(C9,{}),b.jsxs("div",{style:Ci.scoreBox,children:[b.jsx("span",{style:Ci.scoreValue,children:i}),b.jsx("span",{style:Ci.scoreLabel,children:"PTS"}),E==="playing"&&x>0&&b.jsxs("div",{style:Ci.matchClock,children:[Math.floor(x/60),":",String(Math.floor(x%60)).padStart(2,"0")]}),b.jsxs("div",{style:Ci.livesLine,children:["❤ ",A," · auto ↻",R," · auto +",w]})]}),b.jsxs("div",{style:Ci.flagPanel,title:`${XD} pts per flag. See minimap.`,children:[b.jsx("div",{style:Ci.flagPanelTitle,children:"FLAGS"}),bM.map(F=>{const X=tn.getState().flags.get(F.id),z=X?.ownerId?D.get(X.ownerId):void 0,k=X?.ownerId&&z?b.jsx(Ld,{countryCode:z.countryCode,name:z.displayName,flagSize:"0.95em",gap:4}):X?.ownerId?X.ownerId.slice(0,4):null;return b.jsxs("div",{style:Ci.flagLine,children:[b.jsx("span",{style:{display:"inline-block",width:6,height:6,borderRadius:2,background:F.color,marginRight:6}}),b.jsx("span",{style:{color:k?"#dff7ff":"#666"},children:k??"—"})]},F.id)})]}),b.jsxs("div",{style:Ci.playerPanel,children:[b.jsxs("div",{style:Ci.panelHeader,children:["RANKING ",b.jsx("span",{style:{color:"#00f5ff"},children:H.length}),b.jsxs("span",{style:{color:"#555"},children:["/",_]})]}),b.jsxs("div",{style:{display:"flex",gap:4,fontSize:"0.58rem",color:"#555",marginBottom:4,letterSpacing:"0.05em"},children:[b.jsx("span",{style:{flex:1},children:"PLAYER"}),b.jsx("span",{style:{width:28,textAlign:"right"},children:"K"}),b.jsx("span",{style:{width:28,textAlign:"right"},children:"D"}),b.jsx("span",{style:{width:28,textAlign:"right"},children:"F"}),b.jsx("span",{style:{width:36,textAlign:"right"},children:"PTS"})]}),H.map((F,X)=>{const z=JC[F.playerClass]??"#fff",k=F.id===L;return b.jsxs("div",{style:{...Ci.playerRow,opacity:F.isDead?.45:1},children:[b.jsxs("span",{style:{color:"#555",fontSize:"0.65rem",minWidth:14},children:[X+1,"."]}),b.jsx("span",{style:{...Ci.playerDot,background:F.isDead?"#444":z,boxShadow:F.isDead?"none":`0 0 6px ${z}`}}),b.jsxs("span",{style:{...Ci.playerName,color:k?"#fff":"#ccc",fontWeight:k?700:400},children:[b.jsx(Ld,{countryCode:F.countryCode,name:F.displayName,gap:5,flagSize:"0.85em"}),k&&b.jsx("span",{style:{color:"#555",fontSize:"0.65rem"},children:" (you)"})]}),b.jsx("span",{style:{width:28,textAlign:"right",color:"#aaa",fontSize:"0.65rem"},children:F.kills}),b.jsx("span",{style:{width:28,textAlign:"right",color:"#888",fontSize:"0.65rem"},children:F.deaths}),b.jsxs("span",{style:{width:28,textAlign:"right",color:"#00ff88",fontSize:"0.65rem"},children:["🚩",F.flagsCaptured]}),b.jsx("span",{style:{...Ci.playerScore},children:F.score})]},F.id)}),H.length===0&&b.jsx("div",{style:{color:"#444",fontSize:"0.7rem",padding:"4px 0"},children:"waiting for players…"})]}),b.jsxs("div",{style:{...Ci.kdClassStrip,borderColor:`${P}55`},children:[b.jsxs("span",{style:Ci.kdItem,children:[b.jsx("b",{children:e}),b.jsx("span",{style:Ci.muted,children:"K"})]}),b.jsx("span",{style:Ci.kdSep,children:"·"}),b.jsxs("span",{style:Ci.kdItem,children:[b.jsx("b",{children:t}),b.jsx("span",{style:Ci.muted,children:"D"})]}),b.jsx("span",{style:{color:P,fontSize:"0.58rem",fontWeight:700,marginLeft:8},children:n?.replace(/_/g," ")})]}),b.jsxs("div",{style:Ci.quickInventory,children:[b.jsxs("div",{style:{...Ci.quickItem,borderColor:"#ff4455"},children:[b.jsx("span",{style:{fontSize:"1rem"},children:"💉"}),b.jsx("span",{style:{color:"#ff4455",fontWeight:700},children:v}),b.jsx("span",{style:{color:"#555",fontSize:"0.55rem"},children:"HP"})]}),b.jsxs("div",{style:{...Ci.quickItem,borderColor:"#ffe600"},children:[b.jsx("span",{style:{fontSize:"1rem"},children:"📦"}),b.jsx("span",{style:{color:"#ffe600",fontWeight:700},children:m}),b.jsx("span",{style:{color:"#555",fontSize:"0.55rem"},children:"AMMO"})]})]}),b.jsxs("div",{style:{...Ci.weaponPanel,borderColor:P},children:[" ",b.jsxs("div",{style:Ci.zoomIndicator,children:[[0,1,2].map(F=>b.jsx("div",{style:{width:8,height:8+F*4,background:u===F?P:"#1a1a2e",boxShadow:u===F?`0 0 5px ${P}`:"none",borderRadius:1,transition:"background 0.2s"}},F)),b.jsx("span",{style:{color:"#555",fontSize:"0.6rem",marginLeft:4},children:["NEAR","MID","FAR"][u]})]})," ",b.jsx("div",{style:{...Ci.weaponLabel,color:P},children:G}),s==="laser_rifle"&&b.jsx("div",{style:Ci.ammoRow,children:l?b.jsx(W9,{accentColor:P}):b.jsxs(b.Fragment,{children:[Array.from({length:30}).map((F,X)=>b.jsx("span",{style:{display:"inline-block",width:7,height:14,margin:"0 1px",background:X<a?P:"#1a1a2e",boxShadow:X<a?`0 0 4px ${P}`:"none",transition:"background 0.15s"}},X)),b.jsxs("span",{style:{color:"#888",fontSize:"0.65rem",marginLeft:8},children:[a,"/30"]})]})}),s==="light_saber"&&b.jsx("div",{style:{color:"#888",fontSize:"0.65rem",letterSpacing:"0.1em"},children:"UNLIMITED — [F] SLASH"}),s==="none"&&b.jsx("div",{style:{color:"#555",fontSize:"0.65rem",letterSpacing:"0.1em"},children:"[Q] EQUIP WEAPON"}),b.jsxs("div",{style:Ci.controlHints,children:[b.jsx("span",{children:"[I]/[M] PACK"}),b.jsx("span",{children:"[E] PUNCH"}),b.jsx("span",{children:"[R] KICK"}),b.jsx("span",{children:"[F] ATTACK"}),b.jsx("span",{children:"[Q] SWITCH"}),b.jsx("span",{children:"[H] HEAL"}),b.jsx("span",{children:"[B] RELOAD"}),b.jsx("span",{style:{color:"#00ff88"}
4486,children:"[F] ENTER/EXIT JEEP"}),b.jsx("span",{style:{color:"#88ccff"},children:"[ENTER] [/] CHAT"}),b.jsx("span",{style:{color:"#88ccff"},children:"[F2]/[F3] CHAT"}),b.jsx("span",{style:{color:"#ffaac8"},children:"[V] MIC"}),b.jsx("span",{style:{color:"#88ccff"},children:"[L] LISTEN"})]})]}),b.jsx(G9,{}),b.jsx(N9,{}),b.jsx(I9,{}),b.jsx(L9,{}),b.jsx(P9,{}),b.jsx(O9,{hp:h,maxHp:p,accentColor:P}),b.jsx(D9,{}),b.jsx(j9,{}),b.jsx(X9,{}),b.jsx(V9,{}),b.jsx(q9,{}),b.jsx(B9,{})]})}const Ci={overlay:{position:"fixed",inset:0,zIndex:100,pointerEvents:"none",fontFamily:"ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, sans-serif",color:"#fff"},scoreBox:{position:"absolute",top:14,left:"50%",transform:"translateX(-50%)",display:"flex",flexDirection:"column",alignItems:"center",background:"rgba(0,0,0,0.6)",padding:"6px 20px",border:"1px solid #00f5ff33"},scoreValue:{fontSize:"1.4rem",fontWeight:700,color:"#00f5ff",lineHeight:1},scoreLabel:{fontSize:"0.55rem",letterSpacing:"0.2em",color:"#888"},matchClock:{fontSize:"0.95rem",color:"#00ffaa",fontWeight:700,marginTop:2},livesLine:{fontSize:"0.55rem",color:"#888",marginTop:2},flagPanel:{position:"absolute",top:88,left:12,minWidth:120,maxWidth:148,background:"rgba(0,0,0,0.42)",border:"1px solid rgba(0,245,255,0.12)",padding:"4px 6px",borderRadius:6,opacity:.88},flagPanelTitle:{fontSize:"0.48rem",color:"#5a5a5a",letterSpacing:"0.12em",marginBottom:2},flagLine:{fontSize:"0.58rem",display:"flex",alignItems:"center"},playerPanel:{position:"absolute",top:16,right:16,minWidth:260,background:"rgba(0,0,0,0.80)",border:"1px solid #1a1a3a",padding:"8px 12px",display:"flex",flexDirection:"column",gap:2},panelHeader:{fontSize:"0.65rem",letterSpacing:"0.2em",color:"#888",textTransform:"uppercase",marginBottom:4,borderBottom:"1px solid #1a1a3a",paddingBottom:4},playerRow:{display:"flex",alignItems:"center",gap:5,fontSize:"0.75rem",padding:"2px 0"},playerDot:{width:7,height:7,borderRadius:"50%",flexShrink:0},playerName:{flex:1,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"flex",alignItems:"center",minWidth:0,gap:4},playerScore:{color:"#ffe600",fontSize:"0.7rem",width:36,textAlign:"right",flexShrink:0},kdClassStrip:{position:"absolute",bottom:20,left:20,display:"flex",gap:6,alignItems:"center",background:"rgba(0,0,0,0.5)",padding:"5px 12px",fontSize:"0.8rem",borderRadius:6,border:"1px solid"},kdItem:{display:"flex",gap:3,alignItems:"center"},kdSep:{color:"#555"},muted:{color:"#888",fontSize:"0.6rem"},quickInventory:{position:"absolute",bottom:58,left:20,display:"flex",gap:8},quickItem:{display:"flex",flexDirection:"column",alignItems:"center",gap:2,background:"rgba(0,0,0,0.70)",border:"1px solid",padding:"6px 10px",fontSize:"0.7rem",minWidth:48},weaponPanel:{position:"absolute",bottom:24,left:"50%",transform:"translateX(-50%)",background:"rgba(0,0,0,0.80)",border:"1px solid",padding:"10px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:6,minWidth:280},weaponLabel:{fontSize:"0.80rem",fontWeight:700,letterSpacing:"0.20em",textTransform:"uppercase"},ammoRow:{display:"flex",alignItems:"center",flexWrap:"wrap"},controlHints:{display:"flex",gap:10,fontSize:"0.58rem",color:"#555",letterSpacing:"0.08em",marginTop:2,flexWrap:"wrap",justifyContent:"center"},zoomIndicator:{display:"flex",alignItems:"flex-end",gap:3,marginTop:2}};function B9(){const i=Lo(X=>X.t);Lo(X=>X.lang);const e=tn(X=>X.chatMessages),t=tn(X=>X.sessionId),n=tn(X=>X.room),[s,a]=q.useState(""),[l,u]=q.useState(!1),h=q.useRef(null),p=q.useRef(null),{voiceMode:m,voiceEnabled:v,voicePending:x,voiceError:_,voiceStep:A,micLevel:R,setVoiceMode:w,clearVoiceError:E}=T9(),D=q.useCallback(()=>{if(x){w("off");return}w(m==="mic"?"off":"mic")},[x,m,w]),L=q.useCallback(()=>{if(x){w("off");return}w(m==="listen"?"off":"listen")},[x,m,w]),P=q.useCallback(()=>{const X=s.trim();if(!X||!n){h.current?.blur(),ot.getState().setCommsTyping(!1);return}n.send("chat",{text:X}),a(""),h.current?.blur(),ot.getState().setCommsTyping(!1)},[s,n]),G=q.useCallback(()=>{if(!tn.getState().room)return;const{isPaused:z,isInventoryOpen:k}=ot.getState();z||k||(ot.getState().setCommsTyping(!0),document.pointerLockElement&&document.exitPointerLock(),u(!0),queueMicrotask(()=>h.current?.focus()))},[]),H=q.useCallback(()=>{ot.getState().setCommsTyping(!1),u(!1),a("")},[]);if(q.useEffect(()=>{const X=z=>{const k=z.target,ie=k instanceof HTMLInputElement||k instanceof HTMLTextAreaElement||k instanceof HTMLElement&&k.isContentEditable,ve=tn.getState().room,{isPaused:J,isInventoryOpen:le}=ot.getState();if(z.code==="Escape"&&l){z.preventDefault(),H();return}if(z.code==="KeyV"&&!z.repeat&&!ie){if(z.ctrlKey||z.metaKey||z.altKey||J||le||(z.preventDefault(),!ve))return;D();return}if(z.code==="KeyL"&&!z.repeat&&!ie){if(z.ctrlKey||z.metaKey||z.altKey||J||le||(z.preventDefault(),!ve))return;L();return}if((z.code==="F2"||z.code==="F3")&&!z.repeat){if(z.ctrlKey||z.metaKey||z.altKey||J||le||!ve)return;if(z.preventDefault(),l){H();return}if(ie)return;G();return}if((z.code==="Enter"||z.code==="NumpadEnter"||z.key==="/")&&!z.repeat&&!ie){if(z.ctrlKey||z.metaKey||z.altKey||J||le||(z.preventDefault(),!ve))return;G(),z.key==="/"&&queueMicrotask(()=>a(ae=>ae||"/"));return}};return window.addEventListener("keydown",X,{capture:!0}),()=>window.removeEventListener("keydown",X,{capture:!0})},[l,H,G,D,L]),q.useEffect(()=>{const X=p.current;X&&(X.scrollTop=X.scrollHeight)},[e,l]),!n||!t)return null;const F=e.slice(-8);return b.jsx("div",{style:{position:"fixed",bottom:128,left:16,width:360,maxWidth:"calc(100vw - 32px)",zIndex:250,pointerEvents:"auto",fontFamily:"ui-monospace, 'Cascadia Code', 'Courier New', monospace"},children:b.jsxs("div",{style:{background:"linear-gradient(165deg, rgba(12,10,22,0.94) 0%, rgba(6,5,14,0.97) 100%)",border:"1px solid rgba(0, 210, 255, 0.35)",borderRadius:8,boxShadow:"0 12px 40px rgba(0,0,0,0.55), inset 0 1px 0 rgba(255,255,255,0.06)",overflow:"hidden"},children:[b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:8,padding:"8px 10px",borderBottom:"1px solid rgba(0, 210, 255, 0.15)",background:"rgba(0, 30, 45, 0.35)"},children:[b.jsx("span",{style:{fontSize:10,letterSpacing:"0.14em",fontWeight:700,color:"rgba(0, 220, 255, 0.85)"},children:i("comms_title")}),b.jsxs("div",{style:{display:"flex",gap:6},children:[b.jsx("button",{type:"button",onClick:()=>{l?H():G()},style:{padding:"4px 10px",fontSize:10,letterSpacing:"0.08em",cursor:"pointer",background:l?"rgba(0, 180, 220, 0.25)":"rgba(255,255,255,0.06)",border:"1px solid rgba(0, 210, 255, 0.35)",borderRadius:4,color:"#b8e8ff"}
4486,children:i("comms_btn_open")}),b.jsxs("button",{type:"button",onClick:D,style:{padding:"4px 10px",fontSize:10,letterSpacing:"0.08em",cursor:x?"wait":"pointer",background:x?"rgba(180, 140, 80, 0.22)":m==="mic"?`rgba(${Math.round(80+R*.8)}, 40, 80, 0.35)`:"rgba(255,255,255,0.06)",border:`1px solid ${x?"rgba(255,200,120,0.45)":m==="mic"?`rgba(255, ${Math.round(80+R*1.4)}, 160, 0.75)`:"rgba(140,120,160,0.35)"}`,borderRadius:4,color:x?"#ffcc88":m==="mic"?"#ffc8d8":"#a898b8",boxShadow:m==="mic"&&R>8?`0 0 ${4+R/6}px rgba(255,80,140,${.3+R/200})`:"none",transition:"box-shadow 0.08s, border-color 0.08s, background 0.08s",display:"flex",flexDirection:"column",alignItems:"center",gap:2},title:i("comms_title_mic"),children:[b.jsx("span",{children:i(x?"comms_mic_pending":m==="mic"?"comms_mic_on":"comms_mic_off")}),m==="mic"&&b.jsx("div",{style:{display:"flex",gap:1,alignItems:"flex-end",height:8},children:Array.from({length:8}).map((X,z)=>{const k=(z+1)*11,ie=R>=k;return b.jsx("div",{style:{width:3,height:3+z,borderRadius:1,background:ie?z<4?"#00ffaa":z<6?"#ffcc00":"#ff4466":"rgba(255,255,255,0.12)",boxShadow:ie?"0 0 3px currentColor":"none",transition:"background 0.06s"}},z)})})]}),b.jsx("button",{type:"button",onClick:L,style:{padding:"4px 10px",fontSize:10,letterSpacing:"0.08em",cursor:x?"wait":"pointer",background:x?"rgba(180, 140, 80, 0.22)":m==="listen"?"rgba(30, 90, 120, 0.45)":"rgba(255,255,255,0.06)",border:`1px solid ${x?"rgba(255,200,120,0.45)":m==="listen"?"rgba(80, 200, 255, 0.6)":"rgba(100, 140, 160, 0.35)"}`,borderRadius:4,color:x?"#ffcc88":m==="listen"?"#a8e8ff":"#8898a8",display:"flex",flexDirection:"column",alignItems:"center",gap:2},title:i("comms_title_listen"),children:b.jsx("span",{children:i(m==="listen"?"comms_listen_on":"comms_listen_off")})})]})]}),(x||v)&&A&&b.jsxs("div",{style:{padding:"4px 10px",fontSize:10,color:m==="mic"?"#88ffcc":m==="listen"?"#a8d8ff":"#ffcc88",background:"rgba(0,0,0,0.25)",borderBottom:"1px solid rgba(255,255,255,0.06)",letterSpacing:"0.06em"},children:["▶ ",A]}),_&&b.jsxs("div",{style:{display:"flex",alignItems:"flex-start",gap:8,padding:"8px 10px",fontSize:11,lineHeight:1.4,color:"#ffb0c0",background:"rgba(60, 12, 24, 0.55)",borderBottom:"1px solid rgba(255,100,140,0.25)"},children:[b.jsx("span",{style:{flex:1},children:_}),b.jsx("button",{type:"button",onClick:E,style:{flexShrink:0,padding:"2px 8px",fontSize:10,cursor:"pointer",background:"rgba(255,255,255,0.08)",border:"1px solid rgba(255,160,180,0.35)",borderRadius:4,color:"#ffd0d8"},children:"OK"})]}),b.jsxs("div",{ref:p,style:{maxHeight:l?148:72,overflowY:"auto",padding:"8px 10px",display:"flex",flexDirection:"column",gap:4},children:[F.length===0&&b.jsx("span",{style:{fontSize:11,color:"rgba(180,170,200,0.45)"},children:i("comms_empty_hint")}),F.map((X,z)=>b.jsxs("div",{style:{background:"rgba(0,0,0,0.35)",padding:"4px 8px",fontSize:11,borderLeft:`3px solid ${X.senderId===t?"#40e0c0":"rgba(0,200,255,0.45)"}`,wordBreak:"break-word",lineHeight:1.35,color:"#ddd"},children:[b.jsx("span",{style:{color:X.senderId===t?"#6ee8d0":"#9cd8ff",fontWeight:700},children:b.jsx(Ld,{countryCode:X.countryCode,name:X.displayName,gap:4,flagSize:"0.9em"})}),b.jsx("span",{style:{color:"rgba(255,255,255,0.35)"},children:" · "}),X.text]},`${X.ts}-${z}`))]}),l&&b.jsxs("div",{style:{display:"flex",gap:8,padding:"8px 10px",borderTop:"1px solid rgba(0, 210, 255, 0.12)",background:"rgba(0,0,0,0.4)"},children:[b.jsx("input",{ref:h,"data-eclipse-comms":"1",value:s,onChange:X=>a(X.target.value),maxLength:200,placeholder:i("comms_placeholder"),onBlur:()=>ot.getState().setCommsTyping(!1),onKeyDown:X=>{X.key==="Enter"&&(X.preventDefault(),P())},style:{flex:1,padding:"6px 8px",background:"rgba(20,18,32,0.95)",border:"1px solid rgba(90, 140, 180, 0.4)",borderRadius:4,outline:"none",color:"#f0f0f5",fontSize:12,fontFamily:"inherit"}}),b.jsx("button",{type:"button",onClick:P,style:{padding:"6px 12px",fontSize:11,fontWeight:600,cursor:"pointer",background:"rgba(0, 140, 200, 0.45)",border:"1px solid rgba(0, 210, 255, 0.4)",borderRadius:4,color:"#fff"},children:i("comms_send")})]})]})})}function I9(){const i=ot(s=>s.hitFlashAt),e=ot(s=>s.hitFlashType),t=q.useRef(null);q.useEffect(()=>{const s=t.current;if(!s||!i)return;s.style.transition="none",s.style.opacity="1";const a=setTimeout(()=>{s.style.transition="opacity 0.35s ease-out",s.style.opacity="0"},60);return()=>clearTimeout(a)},[i]);const n=e==="kick"?"#ff6600":"#00f5ff";return b.jsx("div",{ref:t,style:{position:"absolute",inset:0,pointerEvents:"none",opacity:0,boxShadow:`inset 0 0 100px 30px ${n}44`,border:`3px solid ${n}33`,borderRadius:2}})}function D9(){const i=ti(n=>n.localVehicleId),[e,t]=q.useState(0);return q.useEffect(()=>{if(i===-1){t(0);return}const n=setInterval(()=>{const s=window.__eclipseVehicleSpeed??0;t(Math.round(Math.abs(s)*3.6))},80);return()=>clearInterval(n)},[i]),i===-1?null:b.jsxs("div",{style:{position:"absolute",top:"50%",left:20,transform:"translateY(-50%)",background:"rgba(0,0,0,0.70)",border:"1px solid #00ff88",padding:"14px 20px",display:"flex",flexDirection:"column",alignItems:"center",gap:4,fontFamily:"'Courier New', monospace",pointerEvents:"none"},children:[b.jsx("div",{style:{fontSize:"0.55rem",letterSpacing:"0.25em",color:"#00ff88"},children:"MILITARY JEEP"}),b.jsx("div",{style:{fontSize:"2.2rem",fontWeight:700,color:"#fff",lineHeight:1},children:e}),b.jsx("div",{style:{fontSize:"0.55rem",color:"#555"},children:"KM/H"}),b.jsxs("div",{style:{marginTop:8,fontSize:"0.58rem",color:"#00ff88",letterSpacing:"0.1em",textAlign:"center"},children:["W/S — THROTTLE",b.jsx("br",{}),"A/D — STEER",b.jsx("br",{}),"[F] — EXIT"]})]})}function L9(){const i=ot(l=>l.damageFlashAt),e=ot(l=>l.hp),t=ot(l=>l.maxHp),n=q.useRef(null);q.useEffect(()=>{const l=n.current;if(!l||!i)return;l.style.transition="none",l.style.opacity="1";const u=setTimeout(()=>{l.style.transition="opacity 0.55s ease-out",l.style.opacity="0"},80);return()=>clearTimeout(u)},[i]);const s=t>0?e/t:1,a=s<.3?.18+(1-s/.3)*.3:0;return b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:n,style:{position:"absolute",inset:0,pointerEvents:"none",opacity:0,boxShadow:"inset 0 0 140px 50px #ff000066",border:"4px solid #ff000044"}}),a>0&&b.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",opacity:a,boxShadow:"inset 0 0 180px 80px #cc0000",animation:"lowHpPulse 1.2s ease-in-out infinite"}}),b.jsx("style",{children:`
4487        @keyframes lowHpPulse {
4488          0%, 100% { opacity: ${a}; }
4489          50% { opacity: ${(a*1.8).toFixed(2)}; }
4490        }
4491      `})]})}function P9(){const i=ot(n=>n.vehicleHitAt),e=q.useRef(null),t=q.useRef(null);return q.useEffect(()=>{if(!i)return;const n=e.current,s=t.current;!n||!s||(n.style.transition="none",n.style.opacity="1",setTimeout(()=>{n.style.transition="opacity 0.5s ease-out",n.style.opacity="0"},60),s.style.animation="none",s.offsetWidth,s.style.animation="vehicleShake 0.35s ease-out")},[i]),b.jsxs(b.Fragment,{children:[b.jsx("div",{ref:e,style:{position:"absolute",inset:0,pointerEvents:"none",opacity:0,background:"radial-gradient(ellipse at center, #ff880055 0%, #ff440099 50%, #cc220000 100%)",boxShadow:"inset 0 0 120px 60px #ff6600aa",border:"6px solid #ff880066"}}),b.jsx("div",{ref:t,style:{position:"absolute",inset:0,pointerEvents:"none"}}),b.jsx("style",{children:`
4492        @keyframes vehicleShake {
4493          0%   { transform: translate(0, 0) rotate(0deg); }
4494          15%  { transform: translate(-8px, 6px) rotate(-1.5deg); }
4495          30%  { transform: translate(7px, -5px) rotate(1deg); }
4496          45%  { transform: translate(-5px, 4px) rotate(-0.8deg); }
4497          60%  { transform: translate(4px, -3px) rotate(0.5deg); }
4498          75%  { transform: translate(-2px, 2px) rotate(-0.3deg); }
4499          100% { transform: translate(0, 0) rotate(0deg); }
4500        }
4501      `})]})}function O9({hp:i,maxHp:e,accentColor:t}){const n=e>0?Math.max(0,Math.min(1,i/e)):0,s=n<.3,l=n<.15?"#ff2222":s?"#ff7700":t;return b.jsxs("div",{style:{position:"absolute",bottom:24,left:370,display:"flex",flexDirection:"column",alignItems:"flex-start",ga
4501p:3,background:"rgba(0,0,0,0.60)",border:`1px solid ${l}55`,padding:"8px 12px",minWidth:160},children:[b.jsx("div",{style:{fontSize:"0.58rem",letterSpacing:"0.2em",color:l,textShadow:`0 0 8px ${l}`},children:"HP"}),b.jsx("div",{style:{width:140,height:8,background:"rgba(255,255,255,0.08)",borderRadius:2,overflow:"hidden",border:"1px solid rgba(255,255,255,0.1)"},children:b.jsx("div",{style:{width:`${n*100}%`,height:"100%",background:l,boxShadow:`0 0 8px ${l}`,transition:"width 0.25s ease-out, background 0.4s"}})}),b.jsxs("div",{style:{fontSize:"0.68rem",color:l,fontWeight:700,letterSpacing:"0.05em"},children:[i,b.jsxs("span",{style:{color:"#555",fontWeight:400},children:["/",e]})]})]})}function N9(){const i=tn(h=>h.sessionId);tn(h=>h.syncRevision);const e=tn.getState().flags,t=Array.from(e.values()).find(h=>h.isBeingCaptured&&h.capturingPlayerId===i);if(!t)return null;const s=bM.find(h=>h.id===t.id)?.color??"#00f5ff",a=Math.min(1,t.captureProgress??0)*100,l=Math.ceil((1-(t.captureProgress??0))*5),u=t.id.replace("flag_","").toUpperCase();return b.jsx("div",{style:{position:"absolute",bottom:90,left:"50%",transform:"translateX(-50%)",width:280,pointerEvents:"none"},children:b.jsxs("div",{style:{background:"linear-gradient(135deg, rgba(3,5,25,0.72) 0%, rgba(1,3,18,0.78) 100%)",backdropFilter:"blur(20px) saturate(2)",WebkitBackdropFilter:"blur(20px) saturate(2)",border:`1px solid ${s}55`,borderRadius:10,padding:"12px 18px",boxShadow:`0 0 30px ${s}22, inset 0 0 40px ${s}08`,overflow:"hidden",position:"relative"},children:[b.jsx(U9,{color:s}),b.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginBottom:8},children:[b.jsxs("div",{style:{fontSize:10,letterSpacing:"0.22em",color:s,textShadow:`0 0 10px ${s}`},children:["◉ CAPTURING — ",u]}),b.jsxs("div",{style:{fontSize:18,fontWeight:"bold",color:s,textShadow:`0 0 12px ${s}, 0 0 30px ${s}`,lineHeight:1},children:[l,"s"]}
4501)]}),b.jsx("div",{style:{height:8,background:"rgba(255,255,255,0.07)",borderRadius:4,overflow:"hidden",border:"1px solid rgba(255,255,255,0.08)"},children:b.jsx("div",{style:{width:`${a}%`,height:"100%",background:`linear-gradient(90deg, ${s}aa, ${s})`,boxShadow:`0 0 12px ${s}, 0 0 24px ${s}66`,borderRadius:4,transition:"width 0.12s linear",position:"relative"},children:b.jsx("div",{style:{position:"absolute",top:0,right:0,width:16,height:"100%",background:"linear-gradient(90deg, transparent, rgba(255,255,255,0.5))",borderRadius:"0 4px 4px 0"}})})}),b.jsxs("div",{style:{marginTop:5,fontSize:9,letterSpacing:"0.12em",color:"rgba(255,255,255,0.35)",textAlign:"center"},children:[Math.round(a),"% · Mant\\u00e9m E para capturar"]})]})})}function U9({color:i}){const e=q.useRef(null);return q.useEffect(()=>{const t=e.current;if(!t)return;let n=0,s=0;const a=()=>{n=(n+.8)%100,t.style.top=`${n}%`,s=requestAnimationFrame(a)};return s=requestAnimationFrame(a),()=>cancelAnimationFrame(s)},[]),b.jsx("div",{ref:e,style:{position:"absolute",left:0,right:0,height:1,background:`linear-gradient(90deg, transparent, ${i}44, transparent)`,pointerEvents:"none",top:"0%"}})}const K3=xp,ds=292,kl=ds/2/K3;function Ro(i,e){return[ds/2+i*kl,ds/2+e*kl]}const z9=h5(d5),F9=10,KC=150,ZC={skyscraper:{fill:"rgba(18,46,120,0.96)",stroke:"rgba(0,160,255,0.95)"},tower:{fill:"rgba(16,36, 90,0.92)",stroke:"rgba(0,120,210,0.85)"},apartment:{fill:"rgba(14,26, 60,0.88)",stroke:"rgba(50, 90,170,0.70)"},shop:{fill:"rgba(40,30,  8,0.88)",stroke:"rgba(220,160, 0,0.80)"},warehouse:{fill:"rgba(50,24,  6,0.88)",stroke:"rgba(230,100, 0,0.78)"},bg:{fill:"rgba( 8,10, 18,0.55)",stroke:"rgba(30, 50,100,0.30)"}},O1={shadow_runner:"#00f5ff",pulse_tank:"#ff3333",neon_striker:"#ffe600"};function k9(i,e,t,n,s,a){const l=Math.min(n,s),u=Math.min(a,l/2);i.beginPath(),i.moveTo(e+u,t),i.lineTo(e+n-u,t),i.quadraticCurveTo(e+n,t,e+n,t+u),i.lineTo(e+n,t+s-u),i.quadraticCurveTo(e+n,t+s,e+n-u,t+s),i.lineTo(e+u,t+s),i.quadraticCurveTo(e,t+s,e,t+s-u),i.lineTo(e,t+u),i.quadraticCurveTo(e,t,e+u,t),i.closePath(),i.fill()}function H9(i,e,t,n=!1){const[s,a,l,u,h,p]=e,m=ZC[p]??ZC.apartment,[v,x]=Ro(s-l,a-u),_=l*2*kl,A=u*2*kl,R=Math.max(.5,Math.min(1.5,_*.12));if(i.fillStyle=m.fill,k9(i,v,x,_,A,R),n&&(i.shadowColor=m.stroke,i.shadowBlur=p==="skyscraper"?5:p==="tower"?3:1.5),i.strokeStyle=m.stroke,i.lineWidth=t,i.beginPath(),i.moveTo(v+R,x),i.lineTo(v+_-R,x),i.quadraticCurveTo(v+_,x,v+_,x+R),i.lineTo(v+_,x+A-R),i.quadraticCurveTo(v+_,x+A,v+_-R,x+A),i.lineTo(v+R,x+A),i.quadraticCurveTo(v,x+A,v,x+A-R),i.lineTo(v,x+R),i.quadraticCurveTo(v,x,v+R,x),i.closePath(),i.stroke(),i.shadowBlur=0,h>=22&&p!=="bg"){const[w,E]=Ro(s,a);i.fillStyle=m.stroke,i.shadowColor=m.stroke,i.shadowBlur=6,i.beginPath(),i.arc(w,E,Math.min(1.6,_*.14),0,Math.PI*2),i.fill(),i.shadowBlur=0}}function G9(){const i=q.useRef(null),e=q.useRef(0),t=ot(p=>p.localPos),n=ot(p=>p.selectedClass)??"neon_striker",s=tn(p=>p.sessionId),a=ti(p=>p.localVehicleId),l=q.useRef(t),u=q.useRef(n),h=q.useRef(a);return l.current=t,u.current=n,h.current=a,q.useEffect(()=>{const m=i.current.getContext("2d"),v=()=>{const x=l.current,_=u.current,A=tn.getState().remotePlayers,R=tn.getState().flags,w=ti.getState().vehicles,E=h.current,D=ds/2,L=ds/2,P=ds/2-1;m.clearRect(0,0,ds,ds),m.save(),m.beginPath(),m.arc(D,L,P,0,Math.PI*2),m.clip();const G=m.createRadialGradient(D,L,0,D,L,P);G.addColorStop(0,"rgba(10,12,28,0.98)"),G.addColorStop(.55,"rgba(5,6,18,0.98)"),G.addColorStop(1,"rgba(2,3,10,1)"),m.fillStyle=G,m.fillRect(0,0,ds,ds);const H=m.createRadialGradient(D,L,P*.35,D,L,P);H.addColorStop(0,"rgba(0,0,0,0)"),H.addColorStop(1,"rgba(0,0,0,0.42)"),m.fillStyle=H,m.fillRect(0,0,ds,ds),m.strokeStyle="rgba(0,200,255,0.055)",m.lineWidth=.45;for(let te=-KC;te<=KC;te+=F9){const[ue]=Ro(te,0),[,he]=Ro(0,te);m.beginPath(),m.moveTo(ue,0),m.lineTo(ue,ds),m.stroke(),m.beginPath(),m.moveTo(0,he),m.lineTo(ds,he),m.stroke()}for(const[te,ue,he,K]of p5)m.setLineDash(K.length?[...K]:[]),m.beginPath(),m.arc(D,L,te*kl,0,Math.PI*2),m.strokeStyle=ue,m.lineWidth=he,m.stroke();m.setLineDash([]);const F="rgba(6,5,14,0.92)",X="rgba(0,210,255,0.18)";m.fillStyle=F;const z=8*kl;m.fillRect(D-z/2,0,z,ds),m.fillRect(0,L-z/2,ds,z);const k=8*kl;for(const te of[-16,16]){const[ue]=Ro(te-4,0),[,he]=Ro(0,te-4);m.fillRect(ue,0,k,ds),m.fillRect(0,he,ds,k)}m.save(),m.setLineDash([5,8]),m.strokeStyle=X,m.lineWidth=.8,m.beginPath(),m.moveTo(D,0),m.lineTo(D,ds),m.stroke(),m.beginPath(),m.moveTo(0,L),m.lineTo(ds,L),m.stroke(),m.setLineDash([]),m.restore(
4501);for(const te of z9){const he=Math.hypot(te[0],te[1])>62;H9(m,te,he?.62:te[4]>=28?1:.72,!he&&te[4]>=22)}m.fillStyle="rgba(255,220,100,0.75)";for(const[te,ue]of fR){const[he,K]=Ro(te,ue);m.save(),m.translate(he,K),m.rotate(Math.PI/4),m.fillRect(-1.1,-1.1,2.2,2.2),m.restore()}const ie=R;for(const te of bM){const[ue,he]=Ro(te.x,te.z),K=ie.get(te.id),ce=K?.ownerId?"#ffe600":te.color;m.beginPath(),m.arc(ue,he,6.5,0,Math.PI*2),m.fillStyle=ce+"28",m.fill(),m.beginPath(),m.arc(ue,he,4,0,Math.PI*2),m.fillStyle=ce,m.shadowColor=ce,m.shadowBlur=K?.isBeingCaptured?14:5,m.fill(),m.shadowBlur=0,K?.isBeingCaptured&&(K.captureProgress??0)>0&&(m.beginPath(),m.arc(ue,he,6.5,-Math.PI/2,-Math.PI/2+K.captureProgress*Math.PI*2),m.strokeStyle="#ffffff",m.lineWidth=1.5,m.stroke()),m.font="bold 6px monospace",m.textAlign="center",m.fillStyle="#000000",m.fillText(te.id.slice(-1).toUpperCase(),ue,he+2.2)}for(const te of w){const[ue,he]=Ro(te.x,te.z),K=te.id===E;m.save(),m.translate(ue,he),m.rotate(-te.rotY);const ce=5*kl,re=2.8*kl;m.fillStyle=K?"rgba(0,230,80,0.95)":"rgba(0,160,60,0.80)",m.shadowColor="#00ff66",m.shadowBlur=K?10:5,m.fillRect(-re/2,-ce/2,re,ce),m.fillStyle="#ffffff",m.shadowBlur=0,m.beginPath(),m.moveTo(0,-ce/2-2.5),m.lineTo(2.5,-ce/2+1.5),m.lineTo(-2.5,-ce/2+1.5),m.closePath(),m.fill(),m.restore()}for(const te of A.values()){if(te.isDead||te.id===s)continue;const[ue,he]=Ro(te.x,te.z),K=O1[te.playerClass]??"#fff";m.beginPath(),m.arc(ue,he,5,0,Math.PI*2),m.fillStyle=K+"30",m.fill(),m.beginPath(),m.arc(ue,he,3.2,0,Math.PI*2),m.fillStyle=K,m.shadowColor=K,m.shadowBlur=7,m.fill(),m.shadowBlur=0}if(E<0){const[te,ue]=Ro(x.x,x.z),he=O1[_]??"#fff";m.save(),m.translate(te,ue),m.rotate(Math.PI-x.rotY);const K=.35+.35*Math.abs(Math.sin(Date.now()*.003));m.beginPath(),m.arc(0,0,8,0,Math.PI*2),m.globalAlpha=K*.55,m.fillStyle=he,m.fill(),m.globalAlpha=1,m.beginPath(),m.moveTo(0,-7),m.lineTo(4.5,4.5),m.lineTo(0,2.5),m.lineTo(-4.5,4.5),m.closePath(),m.fillStyle=he,m.shadowColor=he,m.shadowBlur=12,m.fill(),m.shadowBlur=0,m.fillStyle="#ffffff",m.beginPath(),m.arc(0,0,1.5,0,Math.PI*2),m.fill(),m.restore()}const ve=P-5,J=[[-Math.PI/2,"N","#00f5ff"],[0,"E","rgba(0,210,255,0.65)"],[Math.PI/2,"S","rgba(0,180,255,0.55)"],[Math.PI,"W","rgba(0,180,255,0.55)"]];m.strokeStyle="rgba(0,200,255,0.22)",m.lineWidth=.7;for(let te=0;te<Math.PI*2;te+=Math.PI/4){const ue=Math.cos(te),he=Math.sin(te),K=te%(Math.PI/2)<.01,ce=ve-(K?7:4);m.beginPath(),m.moveTo(D+ue*ce,L+he*ce),m.lineTo(D+ue*ve,L+he*ve),m.stroke()}m.textAlign="center",m.textBaseline="middle";for(const[te,ue,he]of J){const K=D+Math.cos(te)*(ve-11),ce=L+Math.sin(te)*(ve-11);m.font=ue==="N"?"bold 9px monospace":"7px monospace",m.fillStyle=he,ue==="N"&&(m.shadowColor="#00f5ff",m.shadowBlur=8),m.fillText(ue,K,ce),m.shadowBlur=0}m.textBaseline="alphabetic";const le=10*kl,ae=14,W=ds-20;m.strokeStyle="rgba(0,210,255,0.65)",m.lineWidth=1.5,m.beginPath(),m.moveTo(ae,W),m.lineTo(ae,W-4),m.moveTo(ae,W),m.lineTo(ae+le,W),m.moveTo(ae+le,W),m.lineTo(ae+le,W-4),m.stroke(),m.font="6px monospace",m.textAlign="center",m.fillStyle="rgba(0,210,255,0.75)",m.fillText("10u",ae+le/2,W-6),m.textAlign="left",m.textAlign="center";for(const[te,ue,he,K]of m5){const[ce,re]=Ro(te,ue);m.font="5px monospace",m.fillStyle=K,m.fillText(he,ce,re)}m.textAlign="left",m.restore(),m.beginPath(),m.arc(D,L,P,0,Math.PI*2),m.strokeStyle="rgba(0,210,255,0.72)",m.lineWidth=1.85,m.stroke(),m.beginPath(),m.arc(D,L,P-2.5,0,Math.PI*2),m.strokeStyle="rgba(0,0,0,0.55)",m.lineWidth=2.5,m.stroke(),m.beginPath(),m.arc(D,L,P+1.8,0,Math.PI*2),m.strokeStyle="rgba(100,200,255,0.22)",m.lineWidth=1,m.stroke(),m.strokeStyle="rgba(0,200,255,0.12)",m.lineWidth=.6;const ee=5;m.beginPath(),m.moveTo(D-ee,L),m.lineTo(D+ee,L),m.moveTo(D,L-ee),m.lineTo(D,L+ee),m.stroke(),e.current=requestAnimationFrame(v)};return e.current=requestAnimationFrame(v),()=>cancelAnimationFrame(e.current)},[]),b.jsxs("div",{style:{position:"absolute",bottom:18,right:18,width:ds+18,padding:"10px 9px 12px",pointerEvents:"none",background:"linear-gradient(200deg, rgba(8,10,22,0.88) 0%, rgba(4,5,14,0.92) 100%)",border:"1px solid rgba(0, 200, 255, 0.32)",borderRadius:10,boxShadow:"0 10px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.05)"},children:[b.jsxs("div",{style:{textAlign:"center",marginBottom:8,pointerEvents:"none"},children:[b.jsx("div",{style:{fontFamily:"monospace",fontSize:11,fontWeight:700,letterSpacing:"0.22em",color:"rgba(0, 220, 255, 0.9)"},children:"MAPA TÁCTICO"}),b.jsx("div",{style:{fontFamily:"monospace",fontSize:8,letterSpacing:"0.12em",color:"rgba(160, 180, 200, 0.55)",marginTop:2},children:`NORTE · ANEL ${K3}u`})]}),b.jsx("canvas",{ref:i,width:ds,height:ds,style:{display:"block",margin:"0 auto",borderRadius:"50%",boxShadow:"inset 0 0 24px rgba(0,0,0,0.35)"}}),b.jsxs("div",{style:{marginTop:10,display:"flex",flexWrap:"wrap",justifyContent:"center",gap:"6px 10px",fontFamily:"monospace",fontSize:8,letterSpacing:"0.04em",color:"rgba(180, 190, 210, 0.75)",pointerEvents:"none",lineHeight:1.4},children:[b.jsx("span",{style:{color:"#7ee8d0"},children:"▲ Tu"}),b.jsx("span",{style:{color:"#b8a0e0"},children:"● Enemy"}),b.jsx("span",{style:{color:"#ffe600"},children:"◆ Flag"}),b.jsx("span",{style:{color:"#00ff88"},children:"■ Vehicle"}),b.jsx("span",{style:{color:"#ffdc60"},children:"◇ Object"})]}),b.jsx("div",{style:{marginTop:6,display:"flex",justifyContent:"center",gap:12,flexWrap:"wrap",fontFamily:"monospace",fontSize:7,pointerEvents:"none"},children:Object.entries(O1).map(([p,m])=>b.jsx("span",{style:{color:m,opacity:.8},children:p.replace("_"," ").replace(/\b\w/g,v=>v.toUpperCase())},p))})]})}function j9(){const i=ot(t=>t.isAiming);return ti(t=>t.localVehicleId)!==-1||!i?null:b.jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none",background:"radial-gradient(circle at center, transparent 18%, rgba(0,0,0,0.78) 44%, rgba(0,0,0,0.94) 70%)",transition:"opacity 0.12s ease-out"}})}function V9(){const i=ot(t=>t.hitMarkerAt),e=q.useRef(null);return q.useEffect(()=>{const t=e.current;if(!t||!i)return;t.style.transition="none",t.style.opacity="1";const n=setTimeout(()=>{t.style.transition="opacity 0.35s ease-out",t.style.opacity="0"},60);return()=>clearTimeout(n)},[i]),b.jsx("div",{ref:e,style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none",opacity:0}
4501,children:b.jsxs("svg",{width:24,height:24,viewBox:"0 0 24 24",children:[b.jsx("line",{x1:"2",y1:"2",x2:"10",y2:"10",stroke:"#ff3300",strokeWidth:"2.5",strokeLinecap:"round"}),b.jsx("line",{x1:"14",y1:"14",x2:"22",y2:"22",stroke:"#ff3300",strokeWidth:"2.5",strokeLinecap:"round"}),b.jsx("line",{x1:"22",y1:"2",x2:"14",y2:"10",stroke:"#ff3300",strokeWidth:"2.5",strokeLinecap:"round"}),b.jsx("line",{x1:"10",y1:"14",x2:"2",y2:"22",stroke:"#ff3300",strokeWidth:"2.5",strokeLinecap:"round"})]})})}function W9({accentColor:i}){const[e,t]=q.useState(0),n=q.useRef(Date.now());return q.useEffect(()=>{n.current=Date.now();let s;const a=()=>{const l=(Date.now()-n.current)/1e3,u=Math.min(1,l/3);t(u),u<1&&(s=requestAnimationFrame(a))};return s=requestAnimationFrame(a),()=>cancelAnimationFrame(s)},[]),b.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:4,width:"100%"},children:[b.jsx("span",{style:{color:"#ff8c00",fontSize:"0.62rem",letterSpacing:"0.18em"},children:"RELOADING"}),b.jsx("div",{style:{width:180,height:4,background:"rgba(255,255,255,0.08)",borderRadius:2,overflow:"hidden",border:"1px solid rgba(255,140,0,0.25)"},children:b.jsx("div",{style:{width:`${e*100}%`,height:"100%",background:`linear-gradient(90deg, #ff6600, ${i})`,boxShadow:"0 0 8px #ff8800",borderRadius:2,transition:"width 0.06s linear"}})}),b.jsxs("span",{style:{color:"#555",fontSize:"0.58rem"},children:[Math.round(e*100),"%"]})]})}function X9(){const i=ot(h=>h.isAiming),e=ot(h=>h.equippedWeapon);if(ti(h=>h.localVehicleId)!==-1||e==="none"||!i)return null;const n=12,s=5,a=60,l=a/2,u=a/2;return b.jsx("div",{style:{position:"absolute",top:"50%",left:"50%",transform:"translate(-50%, -50%)",pointerEvents:"none"},children:b.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,style:{overflow:"visible"},children:[b.jsx("circle",{cx:l,cy:u,r:19,stroke:"#fff",strokeWidth:.8,strokeOpacity:.4,fill:"none"}),b.jsx("line",{x1:l,y1:u-s,x2:l,y2:u-s-n,stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}),b.jsx("line",{x1:l,y1:u+s,x2:l,y2:u+s+n,stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}),b.jsx("line",{x1:l-s,y1:u,x2:l-s-n,y2:u,stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}),b.jsx("line",{x1:l+s,y1:u,x2:l+s+n,y2:u,stroke:"#fff",strokeWidth:1.5,strokeLinecap:"round"}),b.jsx("circle",{cx:l,cy:u,r:1.5,fill:"#fff"})]})})}function q9(){const i=ti(A=>A.targetedVehicleId),e=ti(A=>A.targetedPlayerId),t=ti(A=>A.targetScreenNdcX),n=ti(A=>A.targetScreenNdcY),s=ti(A=>A.vehicles);tn(A=>A.syncRevision);const a=i!==-1,l=!a&&e!=="";if(!a&&!l)return null;let u="",h=0,p=0,m="";if(a){const A=s.find(R=>R.id===i);if(!A||A.hp<=0)return null;h=A.hp,p=A.maxHp,m="⬛",u="MILITARY JEEP"}else{const A=tn.getState().remotePlayers.get(e);if(!A||A.isDead)return null;h=A.hp,p=A.maxHp>0?A.maxHp:100,m="◈",u=`${sg(A.countryCode)} ${A.displayName.toUpperCase()}`}const v=p>0?Math.max(0,Math.min(1,h/p)):0,x=v<.25?"#ff2200":v<.55?"#ff8800":l?"#ff4488":"#00ff88",_=a?v<=0?"":v<.2?"CRIT":"":v<.25?"CRIT":"";return b.jsxs("div",{style:{position:"absolute",top:`${(1-n)/2*100}%`,left:`${(t+1)/2*100}%`,transform:"translate(-50%, -50%) scale(0.88)",pointerEvents:"none",display:"flex",flexDirection:"column",alignItems:"center",gap:4,opacity:.95},children:[b.jsxs("svg",{width:44,height:44,viewBox:"0 0 52 52",fill:"none",children:[b.jsx("polyline",{points:"4,13 4,4 13,4",stroke:x,strokeWidth:"2",strokeLinecap:"round"}),b.jsx("polyline",{points:"39,4 48,4 48,13",stroke:x,strokeWidth:"2",strokeLinecap:"round"}),b.jsx("polyline",{points:"4,39 4,48 13,48",stroke:x,strokeWidth:"2",strokeLinecap:"round"}),b.jsx("polyline",{points:"39,48 48,48 48,39",stroke:x,strokeWidth:"2",strokeLinecap:"round"}),b.jsx("circle",{cx:"26",cy:"26",r:"1.8",fill:x,fillOpacity:"0.9"})]}),b.jsxs("div",{style:{background:"rgba(0,0,0,0.75)",border:`1px solid ${x}44`,padding:"4px 8px",display:"flex",flexDirection:"column",alignItems:"center",gap:2,minWidth:120},children:[b.jsxs("div",{style:{fontSize:"0.5rem",letterSpacing:"0.08em",color:x,maxWidth:140,textAlign:"center",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:[m," ",u,_?` · ${_}`:""]}),b.jsx("div",{style:{width:110,height:4,background:"rgba(255,255,255,0.08)",borderRadius:2,overflow:"hidden"},children:b.jsx("div",{style:{width:`${v*100}%`,height:"100%",background:x,boxShadow:`0 0 4px ${x}`,transition:"width 0.15s ease-out, background 0.25s"}})}),b.jsxs("div",{style:{fontSize:"0.58rem",color:x,fontWeight:700},children:[h,b.jsxs("span",{style:{color:"#555",fontWeight:400},children:["/",p]})]})]})]})}function Y9(){const i=Lo(x=>x.t),e=ot(x=>x.lobbyMaxPlayers),t=ot(x=>x.lobbyTimeLeft),n=ot(x=>x.lobbyStartIn),s=ot(x=>x.setPhase),a=tn(x=>x.disconnect),l=tn(x=>x.allPlayers.size),u=tn(x=>x.sessionId);q.useEffect(()=>{if(!u)return;const x=document.querySelector("canvas");document.pointerLockElement&&document.exitPointerLock(),x?.blur?.()},[u]);const h=Math.floor(t/60),p=Math.floor(t%60),m=Math.round(jD/1e3),v=q3()!=null;return b.jsxs("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"radial-gradient(ellipse at center, #0a1520 0%, #020408 100%)",color:"#dff7ff",fontFamily:"ui-sans-serif, system-ui, sans-serif"},children:[b.jsx("h1",{style:{fontSize:"1.4rem",letterSpacing:"0.28em",color:"#00f5ff",marginBottom:12},children:i("lobby_title")}),b.jsx("p",{style:{color:"#7c8f99",marginBottom:24,fontSize:"0.88rem",maxWidth:460,textAlign:"center",lineHeight:1.45},children:v?i("lobby_subtitle_private",{max:e}):i("lobby_subtitle",{max:e,cd:m})}),b.jsxs("div",{style:{fontSize:"2.4rem",fontWeight:800,color:l>=2?"#00ffaa":"#ffe600",marginBottom:8},children:[l," / ",e]}),n>0&&l>=2&&b.jsx("p",{style:{color:"#00ffaa",fontSize:"1.15rem",marginBottom:8},children:i("lobby_starts",{n:Math.ceil(n)})}),b.jsx("p",{style:{color:"#555",fontSize:"0.8rem"},children:i("lobby_global",{time:`${String(h).padStart(2,"0")}
4501:${String(p).padStart(2,"0")}`})}),b.jsx("button",{type:"button",onClick:()=>{a(),s("menu")},style:{marginTop:28,padding:"10px 20px",cursor:"pointer",background:"rgba(255,80,100,0.15)",border:"1px solid rgba(255,120,140,0.45)",borderRadius:8,color:"#ffb8c8",fontSize:"0.85rem"},children:i("lobby_leave")})]})}function Z3(i){return i==="time"?"time":i==="last_standing"?"last_standing":"other"}function J9(i,e){switch(i){case"time":return{title:e("end_banner_time_title"),subtitle:e("end_banner_time_sub"),accent:"#f4c15a",bannerBg:"linear-gradient(135deg, rgba(60,40,8,0.95) 0%, rgba(12,8,4,0.92) 100%)"};case"last_standing":return{title:e("end_banner_last_title"),subtitle:e("end_banner_last_sub"),accent:"#c77dff",bannerBg:"linear-gradient(135deg, rgba(40,20,50,0.95) 0%, rgba(8,4,12,0.92) 100%)"};default:return{title:e("end_banner_default_title"),subtitle:e("end_banner_default_sub"),accent:"#00f5ff",bannerBg:"linear-gradient(135deg, rgba(4,24,32,0.95) 0%, rgba(2,6,10,0.92) 100%)"}}}function K9(i,e){return i?{title:e("end_elim_title"),accent:"#ff8c42",bannerBg:"linear-gradient(135deg, rgba(50,30,8,0.95) 0%, rgba(10,6,2,0.92) 100%)"}:{title:e("end_elim_title"),accent:"#ff5c6b",bannerBg:"linear-gradient(135deg, rgba(50,8,12,0.95) 0%, rgba(12,2,4,0.92) 100%)"}}function Z9(i,e){const t=Z3(i.reason),n=!!(e&&i.winnerId===e),a=!!(e?i.standings.find(l=>l.id===e):void 0);return{isWinner:n,isDuel:i.isDuel,wasPlaying:a,variant:t}}const QC=12,$C={dismissColor:"#7ab8c8",metaColor:"#4a5a6a"};function eR({kickHint:i}){const e=Lo(t=>t.t);return b.jsxs(b.Fragment,{children:[b.jsx("p",{style:{color:$C.dismissColor,fontSize:"0.9rem",marginTop:24,letterSpacing:"0.04em",textAlign:"center",maxWidth:480,userSelect:"none",cursor:"default"},children:e("end_dismiss_hint")}),i?b.jsxs("p",{style:{color:$C.metaColor,fontSize:"0.75rem",marginTop:8,textAlign:"center"},children:[e("end_closing")," ",e("end_kick_hint",{n:QC})]}):b.jsx("p",{style:{color:"#555",fontSize:"0.75rem",marginTop:10,textAlign:"center"},children:e("end_kick_hint",{n:QC})})]})}function Q9(){const i=Lo(h=>h.t),e=ot(h=>h.endScreen),t=tn(h=>h.sessionId),n=tn(h=>
4501h.isSpectator),s=tn(h=>h.disconnect),a=ot(h=>h.clearEndScreen),l=ot(h=>h.setPhase),u=q.useRef(!1);if(q.useEffect(()=>{const h=()=>{u.current||(u.current=!0,s(),a(),l("menu"))},p=v=>{v.repeat||(v.preventDefault(),h())},m=v=>{v.preventDefault(),h()};return window.addEventListener("keydown",p,!0),window.addEventListener("pointerdown",m,!0),()=>{window.removeEventListener("keydown",p,!0),window.removeEventListener("pointerdown",m,!0)}},[s,a,l]),e?.kind==="eliminated"){const h=K9(e.environmental,i);return b.jsxs("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(3,4,8,0.94)",color:"#fff",padding:24,textAlign:"center"},children:[b.jsxs("div",{style:{width:"100%",maxWidth:440,borderRadius:14,border:`1px solid ${h.accent}44`,background:h.bannerBg,padding:"22px 20px 18px",marginBottom:20,boxShadow:"0 12px 40px rgba(0,0,0,0.5)"},children:[b.jsx("p",{style:{fontSize:"0.65rem",letterSpacing:"0.28em",color:`${h.accent}cc`,marginBottom:8},children:i("end_state_elimination")}),b.jsx("h1",{style:{fontSize:"1.5rem",color:h.accent,margin:0,letterSpacing:"0.1em"},children:h.title})]}),b.jsx("p",{style:{color:"#b8c4cc",maxWidth:480,lineHeight:1.55,fontSize:"0.95rem",marginBottom:12},children:i("end_elim_body",{deaths:e.totalDeaths,lives:e.livesPerMatch,extra:e.extraRespawns})}),e.environmental?b.jsx("p",{style:{color:"#8a9",fontSize:"0.88rem",maxWidth:420},children:i("end_elim_hazard")}):e.killerName?b.jsx("p",{style:{color:"#9ae8ff",fontSize:"0.9rem",maxWidth:420},children:i("end_elim_by",{name:e.killerName})}):null,b.jsx(eR,{kickHint:!1})]})}if(e?.kind==="match"){const h=Z3(e.reason),p=J9(h,i),m=Z9(e,t),v=i(h==="time"?"end_state_reason_time":h==="last_standing"?"end_state_reason_last_standing":"end_state_reason_other"),x=n?i("end_state_spectator"):m.isWinner?i("end_state_winner"):m.wasPlaying?i("end_state_defeat"):i("end_state_match_end");return b.jsxs("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"flex-start",background:"rgba(2,4,8,0.94)",color:"#fff",padding:"20px 16px 32px",overflowY:"auto"},children:[b.jsxs("div",{style:{width:"100%",maxWidth:480,borderRadius:14,border:`1px solid ${p.accent}55`,background:p.bannerBg,padding:"18px 18px 16px",marginBottom:16,textAlign:"center",boxShadow:"0 8px 32px rgba(0,0,0,0.45)"},children:[b.jsx("p",{style:{fontSize:"0.62rem",letterSpacing:"0.3em",color:`${p.accent}dd`,marginBottom:4},children:v}),b.jsx("p",{style:{fontSize:"0.68rem",letterSpacing:"0.12em",color:"rgba(200,210,220,0.75)",marginBottom:8},children:x}),b.jsx("h1",{style:{fontSize:"1.35rem",color:p.accent,margin:"0 0 6px",letterSpacing:"0.06em",lineHeight:1.2},children:p.title}),b.jsx("p",{style:{fontSize:"0.82rem",color:"rgba(220,230,240,0.88)",lineHeight:1.45,margin:0},children:p.subtitle}),e.isDuel&&b.jsx("p",{style:{color:"#c9a227",fontSize:"0.68rem",letterSpacing:"0.18em",marginTop:10,marginBottom:0},children:i("end_duel_badge")})]}),n&&b.jsx("p",{style:{color:"#7a9aaa",fontSize:"0.8rem",textAlign:"center",maxWidth:420,marginBottom:8},children:i("end_spectator_note")}),!m.isWinner&&m.wasPlaying&&!n&&b.jsx("p",{style:{color:"#9aa6b0",fontSize:"0.88rem",marginBottom:10,textAlign:"center"},children:i("end_not_winner_line")}),m.isWinner&&!n&&b.jsx("p",{style:{color:"#2ee59d",fontSize:"1rem",marginBottom:10,textAlign:"center",fontWeight:600},children:i("end_you_won")}),b.jsxs("p",{style:{color:"#dff7ff",fontSize:"1.02rem",marginBottom:6,display:"flex",alignItems:"center",justifyContent:"center",flexWrap:"wrap",gap:8,textAlign:"center"},children:[i("end_winner"),":"," ",b.jsx("b",{style:{color:p.accent},children:b.jsx(Ld,{countryCode:e.standings.find(_=>_.id===e.winnerId)?.countryCode,name:e.winnerName,flagSize:"1.1em"})})]}),b.jsx("p",{style:{color:"#5a6a7a",fontSize:"0.65rem",letterSpacing:"0.14em",marginTop:12,marginBottom:6,textAlign:"center"},children:i("end_participants",{n:e.standings.length})}),b.jsxs("div",{style:{width:"min(440px, 100%)",border:"1px solid rgba(0, 245, 255, 0.2)",borderRadius:8,background:"rgba(6, 16, 24, 0.85)",padding:"8px 10px 10px"},children:[b.jsxs("div",{style:{display:"flex",fontSize:"0.62rem",letterSpacing:"0.1em",color:"#567",marginBottom:4},children:[b.jsx("span",{style:{width:32},children:"#"}),b.jsx("span",{style:{flex:1},children:i("last_match_name")}),b.jsx("span",{style:{width:28,textAlign:"right"},children:i("last_match_k")}),b.jsx("span",{style:{width:28,textAlign:"right"},children:i("last_match_d")}),b.jsx("span",{style:{width:40,textAlign:"right"},children:i("last_match_score")})]}),e.standings.map((_,A)=>b.jsxs("div",{style:{display:"flex",alignItems:"center",fontSize:"0.8rem",padding:"5px 0",borderTop:"1px solid rgba(255,255,255,0.07)",color:A===0?"#dff7ff":"#9ab"},children:[b.jsx("span",{style:{width:32,color:"#666"},children:A+1}),b.jsxs("span",{style:{flex:1,color:"#e8f2ff",minWidth:0}
4501,children:[b.jsx(Ld,{countryCode:_.countryCode,name:_.name,flagSize:"1em"}),_.id===t?b.jsx("span",{style:{color:"#4a6",fontSize:"0.72rem",marginLeft:6},children:i("end_you")}):null]}),b.jsx("span",{style:{width:28,textAlign:"right"},children:_.kills}),b.jsx("span",{style:{width:28,textAlign:"right"},children:_.deaths}),b.jsx("span",{style:{width:40,textAlign:"right",color:p.accent},children:_.score})]},_.id))]}),b.jsx(eR,{kickHint:!0})]})}return b.jsxs("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",background:"rgba(0,0,0,0.86)",color:"#fff",cursor:"pointer",userSelect:"none"},children:[b.jsx("h1",{style:{fontSize:"1.5rem",color:"#00f5ff",marginBottom:8},children:i("end_title")}),b.jsx("p",{style:{color:"#aaa"},children:i("end_closing")}),b.jsx("p",{style:{color:"#7ab8c8",marginTop:20,fontSize:"0.9rem"},children:i("end_dismiss_hint")})]})}function tR(i){const e=Math.floor(i/60),t=String(Math.floor(i%60)).padStart(2,"0");return`${e}:${t}`}const $9={shadow_runner:"#00f5ff",pulse_tank:"#ff2d2d",neon_striker:"#ffe600"},eV={shadow_runner:"SR",pulse_tank:"PT",neon_striker:"NS"},Cc={padding:"7px 10px",textAlign:"center",fontSize:"0.82rem",whiteSpace:"nowrap",verticalAlign:"middle"},Rc={padding:"6px 10px",textAlign:"center",fontSize:"0.68rem",color:"#445566",letterSpacing:"0.1em",fontWeight:600,borderBottom:"1px solid rgba(0,245,255,0.1)",textTransform:"uppercase"};function tV({p:i,rank:e,showFlags:t}){const n=$9[i.playerClass]??"#aaa",s=i.maxHp>0?Math.max(0,Math.min(1,i.hp/i.maxHp)):0,a=s>.55?"#00dd88":s>.25?"#ffaa00":"#ff3355",l=i.deaths===0?i.kills.toFixed(0):(i.kills/i.deaths).toFixed(2);return b.jsxs("tr",{style:{opacity:i.isDead?.42:1,background:e%2===0?"rgba(255,255,255,0.025)":"transparent"},children:[b.jsx("td",{style:{...Cc,color:e===1?"#ffe600":"#445566",fontWeight:e===1?800:400},children:e}),b.jsx("td",{style:Cc,children:b.jsx("span",{style:{display:"inline-block",padding:"1px 5px",borderRadius:4,background:`${n}1a`,border:`1px solid ${n}44`,color:n,fontSize:"0.68rem",fontWeight:700,letterSpacing:"0.05em"},children:eV[i.playerClass]??"?"})}),b.jsxs("td",{style:{...Cc,textAlign:"left",maxWidth:180},children:[b.jsx(Ld,{countryCode:i.countryCode,name:i.displayName,gap:5}),i.isDead&&b.jsx("span",{style:{marginLeft:6,fontSize:"0.65rem",color:"#ff4466"},children:"☠"})]}),b.jsx("td",{style:{...Cc,color:"#ffe600",fontWeight:700,fontSize:"0.92rem"},children:i.score}),b.jsx("td",{style:{...Cc,color:"#00f5ff"},children:i.kills}),b.jsx("td",{style:{...Cc,color:"#ff4466"},children:i.deaths}),b.jsx("td",{style:{...Cc,color:"#778899"},children:l}),t&&b.jsx("td",{style:{...Cc,color:"#aaffaa"},children:i.flagsCaptured}),b.jsx("td",{style:{...Cc,minWidth:100},children:b.jsxs("div",{style:{display:"flex",alignItems:"center",gap:4},children:[b.jsx("div",{style:{position:"relative",height:6,width:72,background:"rgba(255,255,255,0.08)",borderRadius:3,overflow:"hidden"},children:b.jsx("div",{style:{position:"absolute",inset:0,width:`${s*100}%`,background:a,borderRadius:3,transition:"width 0.25s"}})}),b.jsx("span",{style:{fontSize:"0.62rem",color:"#556"},children:i.hp})]})})]})}function nV(){const i=Lo(m=>m.t),e=tn(m=>m.disconnect);tn(m=>m.syncRevision);const t=tn(m=>m.sessionId),n=ot(m=>m.serverRoomPhase),s=ot(m=>m.lobbyTimeLeft),a=ot(m=>m.lobbyStartIn),l=ot(m=>m.matchTimeLeft),u=ot(m=>m.setPhase);q.useEffect(()=>{if(!t)return;const m=document.querySelector("canvas");document.pointerLockElement&&document.exitPointerLock(),m?.blur?.()},[t]);const h=Array.from(tn.getState().allPlayers.values()).sort((m,v)=>v.score-m.score||v.kills-m.kills||m.deaths-v.deaths),p=h.some(m=>m.flagsCaptured>0);return b.jsxs("div",{style:{position:"fixed",inset:0,zIndex:200,display:"flex",flexDirection:"column",alignItems:"center",background:"radial-gradient(ellipse at center, #05111c 0%, #010507 100%)",color:"#dff7ff",fontFamily:"ui-sans-serif, system-ui, sans-serif",overflowY:"auto",padding:"20px 16px"},children:[b.jsx("div",{style:{textAlign:"center",marginBottom:18,width:"100%",maxWidth:760},children:b.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",flexWrap:"wrap",gap:8},children:[b.jsx("h1",{style:{fontSize:"0.85rem",letterSpacing:"0.3em",color:"#00f5ff",margin:0,opacity:.7},children:"◈ SPECTATOR"}),n==="playing"&&b.jsxs("div",{style:{display:"flex",alignItems:"baseline",gap:6},children:[b.jsx("span",{style:{fontSize:"1.4rem",fontWeight:800,color:"#ffe600",letterSpacing:"0.08em"},children:tR(l)}),b.jsx("span",{style:{fontSize:"0.7rem",color:"#445566"},children:"RESTANTE"})]}),n==="lobby"&&b.jsxs("div",{style:{fontSize:"0.82rem",color:"#445566"},children:[i("spec_global",{time:tR(s)}),a>0&&b.jsx("span",{style:{color:"#00ffaa",marginLeft:8},children:i("spec_starts",{n:Math.ceil(a)})})]}),n==="ended"&&b.jsx("span",{style:{color:"#ff5577",fontSize:"0.85rem"},children:"Partida terminada"}),b.jsx("button",{type:"button",onClick:()=>{e(),u("menu")},style:{padding:"6px 16px",cursor:"pointer",background:"rgba(255,80,100,0.1)",border:"1px solid rgba(255,120,140,0.3)",borderRadius:6,color:"#ffb8c8",fontSize:"0.78rem"},children:i("spec_leave")})]})}),h.length===0?b.jsx("p",{style:{color:"#2a3a4a",marginTop:48,fontSize:"0.9rem"},children:"Aguardando jogadores…"}):b.jsx("div",{style:{width:"100%",maxWidth:760,background:"rgba(0,18,30,0.75)",border:"1px solid rgba(0,245,255,0.12)",borderRadius:10,overflow:"hidden",marginBottom:12},children:b.jsxs("table",{style:{width:"100%",borderCollapse:"collapse"},children:[b.jsx("thead",{children:b.jsxs("tr",{children:[b.jsx("th",{style:Rc,children:"#"}),b.jsx("th",{style:Rc,children:"Classe"}),b.jsx("th",{style:{...Rc,textAlign:"left"},children:"Jogador"}),b.jsx("th",{style:Rc,children:"Pts"}),b.jsx("th",{style:Rc,children:"K"}),b.jsx("th",{style:Rc,children:"D"}),b.jsx("th",{style:Rc,children:"K/D"}),p&&b.jsx("th",{style:Rc,children:"🚩"}),b.jsx("th",{style:Rc,children:"HP"})]})}),b.jsx("tbody",{children:h.map((m,v)=>b.jsx(tV,{p:m,rank:v+1,showFlags:p},m.id))})]})}),b.jsxs("p",{style:{color:"#223344",fontSize:"0.72rem"},children:[h.length," jogador",h.length!==1?"es":""," · actualizado em tempo real"]})]})}function iV(){const i=ot(e=>e.phase);return b.jsxs(b.Fragment,{children:[i==="menu"&&b.jsx(mj,{}),i==="spectate"&&b.jsx(nV,{}),i==="lobby"&&b.jsx(Y9,{}),i==="playing"&&b.jsxs(b.Fragment,{children:[b.jsx(A9,{}),b.jsx(R9,{})]}),i==="end"&&b.jsx(Q9,{})]})}const sV=[{labelKey:"private_cfg_wait_1",ms:6e4},{labelKey:"private_cfg_wait_3",ms:3*6e4},{labelKey:"private_cfg_wait_5",ms:5*6e4},{labelKey:"private_cfg_wait_10",ms:10*6e4},{labelKey:"private_cfg_wait_15",ms:15*6e4}];function rV(){const i=Lo(x=>x.t),[e,t]=q.useState(md),[n,s]=q.useState(()=>Math.min(VD,WD)),[a,l]=q.useState(!1),[u,h]=q.useState(null),[p,m]=q.useState(null),v=async()=>{h(null),l(!0);try{const x=await fetch(`${T0()}
4501/api/private-room`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({maxPlayers:e,lobbyWaitMs:n})}),_=await x.json();if(!x.ok){h((_.error??i("menu_private_error_create"))+(_.detail?` (${_.detail})`:""));return}if(_.playUrl&&_.slug&&_.roomId){m({playUrl:_.playUrl,slug:_.slug,roomId:_.roomId});try{await navigator.clipboard.writeText(_.playUrl)}catch{}}}catch{h(i("menu_private_error_create"))}finally{l(!1)}};return b.jsxs("div",{style:fs.root,children:[b.jsx("a",{href:"/",style:fs.navHome,children:i("menu_nav_home")}),b.jsxs("header",{style:fs.topBar,children:[b.jsx("span",{style:fs.topBarBrand,children:"ECLIPSE"}),b.jsx("span",{style:fs.topBarSep,children:"·"}),b.jsx("span",{style:fs.topBarMode,children:i("private_cfg_mode_badge")})]}),b.jsxs("div",{style:fs.card,children:[b.jsx("h1",{style:fs.h1,children:i("private_cfg_title")}),b.jsx("p",{style:fs.lead,children:i("private_cfg_lead")}),b.jsxs("label",{style:fs.label,children:[i("private_cfg_max_players"),b.jsx("input",{type:"number",min:$b,max:md,value:e,onChange:x=>t(Math.min(md,Math.max($b,Number(x.target.value)||$b))),style:fs.input,disabled:a})]}),b.jsxs("div",{style:fs.label,children:[i("private_cfg_lobby_wait"),b.jsx("div",{style:fs.waitRow,children:sV.map(x=>b.jsx("button",{type:"button",style:{...fs.preset,borderColor:n===x.ms?"rgba(0,245,255,0.6)":"#333"},disabled:a,onClick:()=>s(x.ms),children:i(x.labelKey)},x.ms))})]}),u&&b.jsx("p",{style:fs.err,children:u}),b.jsx("button",{type:"button",style:fs.primary,disabled:a,onClick:()=>void v(),children:i(a?"menu_private_creating":"private_cfg_submit")}),p&&b.jsxs("div",{style:fs.result,children:[b.jsx("p",{style:fs.resultTitle,children:i("private_cfg_link_ready")}),b.jsx("code",{style:fs.url,children:p.playUrl}),b.jsxs("div",{style:fs.actions,children:[b.jsx("button",{type:"button",style:fs.secondary,onClick:()=>{navigator.clipboard.writeText(p.playUrl)},children:i("menu_private_copy")}),b.jsx("button",{type:"button",style:fs.secondary,onClick:()=>{window.location.href=p.playUrl},children:i("private_cfg_open_link")})]}),b.jsx("p",{style:fs.hint,children:i("private_cfg_hint_join")})]}),b.jsx("a",{href:"/",style:fs.back,children:i("private_cfg_back_menu")})]})]})}const fs={root:{position:"relative",minHeight:"100vh",display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:24,background:"radial-gradient(ellipse at 20% 0%, #1a1040 0%, transparent 45%), radial-gradient(ellipse at center, #0a1520 0%, #020408 100%)",color:"#dff7ff",fontFamily:"ui-sans-serif, system-ui, sans-serif",boxSizing:"border-box"},navHome:{position:"absolute",top:"max(12px, env(safe-area-inset-top, 0px))",right:"max(16px, env(safe-area-inset-right, 0px))",zIndex:2,fontSize:"0.78rem",letterSpacing:"0.12em",color:"#7dd4ff",textDecoration:"none"},topBar:{position:"absolute",top:0,left:0,right:0,display:"flex",alignItems:"center",justifyContent:"center",gap:8,padding:"12px 16px",background:"linear-gradient(180deg, rgba(20,8,32,0.9) 0%, transparent 100%)",fontSize:"0.7rem",letterSpacing:"0.25em",color:"#b088e8"},topBarBrand:{color:"#00e5ff"},topBarSep:{opacity:.4,color:"#888"},topBarMode:{color:"#c9a8ff"},card:{width:"100%",maxWidth:440,padding:"28px 24px",background:"rgba(4, 14, 24, 0.92)",border:"1px solid rgba(0, 200, 255, 0.2)",borderRadius:12},h1:{fontSize:"1.15rem",letterSpacing:"0.2em",color:"#00f5ff",margin:"0 0 8px",textAlign:"center"},lead:{fontSize:"0.85rem",color:"#7c9aaa",lineHeight:1.5,textAlign:"center",marginBottom:20},label:{display:"block",fontSize:"0.75rem",color:"#8ab",marginBottom:16},input:{display:"block",width:"100%",marginTop:6,padding:"10px 12px",background:"rgba(0,0,0,0.35)",border:"1px solid rgba(255,255,255,0.12)",color:"#fff",borderRadius:6,fontSize:"1rem"},waitRow:{display:"flex",flexWrap:"wrap",gap:6,marginTop:8},preset:{padding:"6px 10px",fontSize:"0.75rem",cursor:"pointer",background:"rgba(0,30,40,0.5)",border:"1px solid #333",color:"#c0e8f0",borderRadius:6},err:{color:"#f88",fontSize:"0.85rem",marginBottom:8},primary:{width:"100%",marginTop:8,padding:"12px 16px",background:"#00f5ff",color:"#000",fontWeight:700,border:"none",borderRadius:8,cursor:"pointer",letterSpacing:"0.1em"},result:{marginTop:20,padding:12,background:"rgba(0,0,0,0.3)",borderRadius:8},resultTitle:{fontSize:"0.8rem",color:"#8ac",marginBottom:8},url:{fontSize:"0.72rem",wordBreak:"break-all",color:"#7ee8ff"},actions:{display:"flex",flexWrap:"wrap",gap:8,marginTop:10},secondary:{padding:"6px 12px",fontSize:"0.78rem",cursor:"pointer",background:"transparent",border:"1px solid rgba(0,200,255,0.4)",color:"#8df",borderRadius:6},hint:{fontSize:"0.72rem",color:"#5a7a8a",marginTop:10,lineHeight:1.4},back:{display:"block",textAlign:"center",marginTop:20,fontSize:"0.8rem",color:"#6a8aaa"}},Q3=document.getElementById("root");
4501if(!Q3)throw new Error("Root element not found");const aV=typeof window<"u"&&window.location.pathname.replace(/\/$/,"")||"/";function oV(){return aV==="/room/new"?b.jsx(rV,{}):b.jsx(iV,{})}sR.createRoot(Q3).render(b.jsx(q.StrictMode,{children:b.jsx(oV,{})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.